content
stringlengths
1
15.9M
\section{Introduction} Nearly all the interesting phenomena around us emerge from tractable interactions between simple constituents, e.g., electromagnetism and atoms. However, understanding how emergent phenomena \cite{Schmidt2007} arise - the goal of statistical mechanics - is extremely challenging. For systems in thermal equilibrium, Boltzmann and Gibbs provided a highly successful framework, while linear response theory is adequate for describing systems \textit{near} equilibrium, see e.g., \cite{ReichlPrigogine80}. Yet, most fascinating phenomena in nature are associated with systems driven far from equilibrium \cite{Gallavotti2014}, e.g., all life forms, socio-political structures, and the climate system. In particular, such systems would either not exist or be vastly different under conditions of thermal equilibrium, i.e., when they are totally isolated or allowed to exchange energy (or particles, or information \cite{ParrondoEtAl2015}) with just one reservoir. Despite much progress on fluctuation theorems and the \textquotedblleft nonequilibrium counterpart\textquotedblright\ of the free energy in recent years (see, e.g., Ref. \cite{US12}), an overarching framework for far-from-equilibrium systems remains elusive. Often, to study such interesting systems, we rely on models with a few (macroscopic) degrees of freedom, evolving as nonequilibrium stochastic processes. One frequently used approach involves master or Fokker-Planck equations for the probability distribution, with time-independent rates. While analyzing the full time dependence is generally beyond our reach, we can take initial steps, by studying the associated stationary states (which are guaranteed to exist). If these rates obey detailed balance, the stationary distribution can be easily found and the system can be treated as if it is in thermal equilibrium \cite{ReichlPrigogine80}. On the other hand, if the rates \textit{violate} detailed balance, then even finding the stationary distribution is highly non-trivial in general \cite{Hill66}. Specifically, such detailed balance-violating systems settle into nonequilibrium steady-states (NESS), and understanding their properties (e.g., fluctuations and correlations) is quite challenging. In particular, unlike systems in thermal equilibrium, there are persistent probability currents that remain in the infinite time mean \cite{ZS07}, which form closed loops and characterize underlying rotations in configuration space. Studying the observable consequences of such steady current loops is surely a valuable endeavor, and is likely to lead to fruitful insights for all NESS. Here we focus one such observable - the probability angular momentum, in analogy with the familiar angular momenta associated with fluid current loops (e.g., \cite{SuzukiFox-Kemper16a}). As shown below, this quantity is intimately related to fluctuations and temporal correlations in the NESS. Introduced recently in other contexts \cite{SZ14,MMZ16,MMZ17,UGa16}, it will be considered here in the context of the Earth's climate system. The climate system is forced by incoming short-wave solar radiation and it is damped by outgoing infrared radiation emitted to space, with a distribution of net radiative forcing segregated by latitude. As a result, the climate system is approximately in a NESS \cite{Lorenz1955,PeixotoOort,PauluisHeld2002,Lucarini2009,LucariniEtAl2014,Laliberte2015}. While this approximation is violated by non-steady forcings such as solar variability, seasons and Milankovitch cycles in the Earth's orbit, intermittent volcanic eruptions, and anthropogenic greenhouse forcing, much remains to be learned about the steady-state climate. In this study, we will ignore non-steady forcings. The climate system is known to exhibit many self-organized, irregular, spatio-temporal patterns, typically referred to as oscillations. These patterns include the El-Ni\~{n}o Southern Oscillation (ENSO) \cite{Wang2018,WangEtAl2017,MeinenMcPhaden00}, the Madden-Julien Oscillation (MJO) \cite{Zhang05}, the Pacific Decadal Oscillation (PDO) \cite{NewmanAlexander16}, and the Atlantic Multidecadal Oscillation (AMO) \cite{KnightFolland06}. It should be emphasized that these \textquotedblleft oscillations\textquotedblright\ are not single-frequency constant amplitude sinusoidal fluctuations or necessarily wavelike phenomena: their frequency distributions and amplitude variations are broad and important, but they are narrow enough that each one is an empirically recognized coherent spatio-temporal pattern of natural variability. ENSO and the MJO are emergent phenomena that result from a complex \textquotedblleft organization\textquotedblright\ of dynamical processes including tropical convection, the velocities and temperatures of the atmosphere and ocean, and large-scale oceanic and atmospheric waves \cite% {NealeRichter08,KiladisWheeler09}. As such, they are unlikely to obey detailed balance or any particular time-reversal symmetry. Nonetheless, ENSO and the MJO are the dominant modes of equatorial interannual and tropical intraseasonal variability, respectively. So, ENSO and the MJO both emerge from a multiplicity of mechanisms, and dominate other variability in their regions and timescales. These climate oscillations are seen as fluctuations about the time mean climate state and we interpret the specific spatio-temporal character of the oscillations as the physical-space manifestation of the probability currents in the phase space\footnote{% In much of the physics community, \textquotedblleft phase space\textquotedblright\ is a term used for the space of $x$-$p$ (coordinate and momentum). Significantly, these variables are even/odd under time reversal. In this paper, however, we use this term in the sense common in the dynamical systems and climate science communities. In the cases we consider here, there is no reason to regard the variables (e.g., temperature and volume, or two amplitudes of a principal component analysis) as having different symmetry under time reversal. For many in the community of statistical physics, the familiar term in this context is \textquotedblleft configuration space.\textquotedblright\ We will use the two terms interchangeably and assume there is no confusion.} of the climate system. \begin{figure}[tbp] \centering \includegraphics[height=2.5in]{N3d20Traj.png} % \includegraphics[height=2.5in]{MJOTraj.png} \caption{Phase space trajectories for a) ENSO and b) the MJO} \label{fig:ENSOMJO} \end{figure} Climate oscillations are often characterized by climate \textquotedblleft indices\textquotedblright. These indices are empirically determined combinations of climate variables, typically chosen by researchers in the subject area of interest to highlight the most important features of a particular phenomenon. It is not uncommon for different researchers to define different indices to highlight different aspects of the same complex high-dimensional phenomenon. Climate indices are commonly used to measure the amplitude of an oscillation, determine its power spectrum, compare oscillations among models and between models and observations, and for many other uses. While it is most common to focus on a single index, sometimes two indices are used to describe an oscillation and investigate the trajectories of the indices in the resulting two-dimensional phase space. Climate oscillations are then observed to have trajectories which exhibit phase space rotation. For example, ENSO is often described in terms of the NINO3 index, based on the spatially-averaged Sea Surface Temperature in the eastern tropical Pacific (90$^{\circ }$W to 150$^{\circ }$W and 5$^{\circ }$% S to 5$^{\circ }$N), and the average depth of the 20$^{\circ }$C isotherm over the same area, which is a measure of the volume of warm water in the tropical Pacific. The two-dimensional phase space of these indices clearly shows the rotation characteristic of fluctuations within NESS, as seen in Figure~\ref{fig:ENSOMJO}a (e.g. \cite{MeinenMcPhaden00,TimmermannEtAl2018}). Similar phase space rotation is seen (Figure~\ref{fig:ENSOMJO}b) in a multivariate MJO index \cite{WheelerHendon04} based on spatial patterns of variability of outgoing long-wave radiation anomalies, which are a convenient observable closely related to changes in cloud cover. We propose a novel and natural measure to quantify such rotations: the probability angular momentum (PAM). Not only is it intimately related to the underlying probability current loops in phase space, it is readily computed from both observations and models, providing researchers in the climate community a new tool for model diagnosis, validation and intercomparison. One of the simplest classes of models that captures nonequilibrium steady-states are Langevin models based on multivariate linear stochastic differential equations with additive noise. Since their introduction by Uhlenbeck and Orstein \cite{UhOr30}, these models have been applied to many problems in the physics community. They are also used to model many aspects of the climate system, and, when constructed by fitting to data, are known as linear inverse models, e.g. \cite{LIM}. Generally assumed to have Gaussian noise and referred to as Linear Gaussian Models (LGM), they have been successfully used to describe a variety of climate oscillations \cite{LIM,PenlandMatrosova1998,AlexanderEtAl2008,HawkinsSuttton2009,CavanaughEtAl2015,DiasEtAl2018,stevenson2013generalized}. The simplicity of these LGMs allows the properties of the NESS to be calculated analytically and facilitates the presentation of PAM. We emphasize that, although we analyze the PAM in the context of LGMs, the quantity itself is quite general, can be calculated from observations with no assumptions about underlying models, and captures the phase space rotation for any system regardless of the underlying dynamics. For the convenience of readers in the climate science community, we provide in the next section a brief review of the role played by probability current loops in NESSs in general and in LGMs in particular. Section~\ref{sec:angmom} introduces the probability angular momentum - its average as well as its full distribution. In section~\ref{sec:climosc} we calculate the probability angular momentum of two climate oscillations: ENSO and the MJO. We end with a summary and outlook. \section{Nonequilibrium Steady-states and Probability Currents} \label{sec:ness} The highly successful Boltzmann-Gibbs framework for equilibrium statistical mechanics is based on a single hypothesis, that an \textit{isolated} physical system can be found (starting with any initial state but waiting for a time long compared to all intrinsic relaxation time-scales) in any of its allowed configurations, $\{ C \}$, with equal probability, i.e., the probability distribution function (pdf) being\footnote{% Below, we will be considering time-dependent distributions, which we denote by $P\left( C;t\right) $. The superscript ($^{\ast }$) signifies a stationary distribution.} $P_{iso}^{\ast }\left( C\right) \propto 1$ . Considering two systems that can exchange energy (or particles, or other quantities), but otherwise isolated, we arrive at a well defined notion of thermal equilibrium and in particular, the Boltzmann pdf: $P_{B}^{\ast }\propto e^{-\mathcal{H} / k_{B} T}$, where $\mathcal{H}$ is the energy of a configuration $C$. Further, the dynamical behavior in the equilibrium state is symmetric under time-reversal: One cannot distinguish (statistically) a movie taken of this system from another run in reverse. However, this framework fails to describe many interesting nonequilibrium phenomena and, in particular, the climate system. One reason is clear: The climate system is driven by incoming shortwave solar energy, balanced by outgoing long-wave radiation. Roughly speaking, it is coupled to two thermal reservoirs, the Sun at 6000$^{\circ }$K and the cosmic microwave background at 3$^{\circ }$K. The climate system is best regarded as a (approximate) nonequilibrium steady-state. In general, there is no simple way to find, or to hypothesize, the probability distribution of a NESS. Though such a state is, by definition, invariant under time \textit{translation}, it is not so under time reversal. To make progress for this challenging problem, we may start with a master equation\footnote{% Though the form of our equation appears to be for continuous $t$ and discrete $C$, it is simple to write equations for other types of variables, e.g., continuous $t$ and $C$. Note that we have restricted ourselves to systems evolving with time-\textit{independent} rates.} for the evolution of the pdf:% \begin{equation} \frac{\partial }{\partial t}P\left( C;t\right) = \sum_{C^{\prime }}\left[ W\left( C^{\prime }\rightarrow C\right) P\left( C^{\prime };t\right) -W\left( C\rightarrow C^{\prime }\right) P\left( C;t\right) \right] \label{ME} \end{equation}% by postulating a set of (non-negative) rates, $W\left( C^{\prime }\rightarrow C\right) $, for the system to make a transition from $C^{\prime }$ to $C$. As probability is conserved, this equation can be regarded as a continuity equation for the density $P$, with the terms on the right representing net probability currents, $K\left( C^{\prime }\rightarrow C\right) $, from $C^{\prime }$ to $C$. As the system settles into stationarity, $P\left( C;t\right) \rightarrow P^{\ast }\left( C\right) $ (which is unique if the $W$'s allow the system to reach to all $C$'s), while $K$ settles into $K^{\ast }$. Of course, the sum of the $K^{\ast }$'s into each $C$ must vanish. The principal difference between systems in thermal equilibrium and NESS is that, in the former, \textit{every} $K^{\ast }$ vanish. A set of $W$'s which leads to such a condition, $W\left( C^{\prime }\rightarrow C\right) P^{\ast }\left( C^{\prime }\right) =W\left( C\rightarrow C^{\prime }\right) P^{\ast }\left( C\right) $, is said to obey detailed balance (DB)\footnote{% In this form, the criterion for the $W$'s to satisfy DB appears to depend on $P^{\ast }$. Kolmogorov \cite{Kolmo36} provided a criterion which involves only the $W$'s.}. To model general stochastic processes, we typically encounter $W$'s which violate DB. Those systems settle into NESS, with some non-trivial and persistent probability currents. Being in the stationary state, these $K^{\ast }$'s must form closed loops. Our goal is to find observable manifestations of such persistent current loops and we will find that these quantities are automatically \textit{odd} under time reversal. Further details of this approach may be found in ref. \cite{ZS07}. For a large variety of physical systems, a more restrictive version of Eqn. (\ref{ME}) is quite adequate, namely, the Fokker-Planck equation \cite{Riskin89}. Specifically, suppose our configuration space consists of $N$ real variables -- $\mathbf{x}\in \mathbb {R}^{N}$ or $x_{\alpha }$, $\alpha =1,...,N$ -- and the only non-vanishing transitions -- $W\left( C^{\prime }\rightarrow C\right) $ -- take the system from $C^{\prime }$ to infinitesimally nearby $C$'s. Then, Eqn. (\ref{ME}) reduces to% \begin{equation} \frac{\partial }{\partial t}P\left( \mathbf{x},t\right) =\sum_{\alpha }\frac{% \partial }{\partial x_{\alpha }}\left[ \sum_{\beta }\frac{\partial }{% \partial x_{\beta }}\left\{ D_{\alpha \beta }\left( \mathbf{x}\right) P\left( \mathbf{x},t\right) \right\} -\mu _{\alpha }\left( \mathbf{x}\right) P\left( \mathbf{x% },t\right) \right] \label{FP} \end{equation}% where $D_{\alpha \beta }$ is referred to as the diffusion tensor and $\mu _{\alpha }$, the drift vector. The advantage of this form is the correspondence to the continuity equation in, say, fluid dynamics: $\partial \rho /\partial t=-\mathbf{\nabla}\cdot \mathbf{J}$, where $\rho \left( \mathbf{x}% ,t\right) $ is the fluid density field and $\mathbf{J}$, the current (density). In this way, we identify the probability current (density) as% \begin{equation} K_{\alpha }=\mu _{\alpha }P-\partial _{\beta }D_{\alpha \beta }P \label{K} \end{equation}% where repeated indices are summed. Similarly, in analogy with $\mathbf{J}=\rho \mathbf{v}$ in fluids, we identify the velocity field as% \begin{equation} u_{\alpha }\left( \mathbf{x},t\right) =\mu _{\alpha }\left( \mathbf{x}\right) -\partial _{\beta }D_{\alpha \beta }\left( \mathbf{x}\right) -D_{\alpha \beta }\left( \mathbf{x}\right) \partial _{\beta }\ln P\left( \mathbf{x},t\right). \label{u} \end{equation} For the remainder of this paper, we restrict ourselves to the case where the diffusion matrix $D_{\alpha \beta}$ is independent of state of the system, $\mathbf{x}$. Using standard techniques, this stochastic process can be recast as the more intuitive Langevin equation% \begin{equation} \frac{d\mathbf{x}}{dt}=\boldsymbol{\mu}+\boldsymbol{\eta} \label{LE} \end{equation}% Here, we recognize $\boldsymbol{\mu}$ as the deterministic part of this equation of motion (and typically depends only on $\mathbf{x}$), while $\boldsymbol{\eta}$ is an additive Gaussian noise with zero mean (i.e., $\left\langle \boldsymbol{\eta}% \right\rangle \equiv 0$) and covariance $\left\langle \eta _{\alpha } ( t ) \eta_{\beta } (t ^\prime) \right\rangle =2D_{\alpha \beta } \delta ( t - t ^\prime) $. To be specific, we can focus on the Ito formulation of this stochastic differential equation, e.g., discretizing time into steps of $\varepsilon $ and letting \footnote{% Note that the discrete version of the $\delta$ in the noise correlation is a Kronecker delta of the time steps divided by $\varepsilon $. Note also that there is no correlation between $\mathbf{x}\left( t\right) $ and $\boldsymbol{\eta}\left( t\right) $, so that $ < \mathbf{x}\left( t\right) \boldsymbol{\eta}\left( t\right) > \equiv 0$.} $\mathbf{x}\left( t+\varepsilon \right) =\mathbf{x}\left( t\right) +\varepsilon \left[ \boldsymbol{\mu}% \left( \mathbf{x}\left( t\right) \right) +\boldsymbol{\eta}\left( t\right) \right] $ In the remainder of this section, we will present these ideas in the context of LGMs. Being the simplest version of (\ref{LE}) and exactly solvable \cite{Lax60,JBW03,ZS07}, they offer a clear and concise setting for us to introduce the notion of probability angular momentum. Further, since LGMs are frequently used in the climate community \cite{LIM,PenlandMatrosova1998,AlexanderEtAl2008,HawkinsSuttton2009,CavanaughEtAl2015,DiasEtAl2018}, we will exploit them in describing two examples from the global climate system, showcasing characteristics of NESS which cannot fit within the framework of thermal equilibrium. The LGM is completely specified by two matrices, $\mathbb A$ and $\mathbb D$, with \textit{constant} elements $A_{\alpha \beta }$ and $D_{\alpha \beta }$. The former characterizes the deterministic relaxation into the stationary state, while stability of the system requires the real parts of its eigenvalues to be negative. It enters Eqn. (\ref{LE}) throug \begin{equation} \boldsymbol{\mu}={\mathbb A\mathbf{x}} \label{mu=Ax} \end{equation}% and leads to the term \textquotedblleft linear\textquotedblright\ in LGM. The latter, also known as the diffusion matrix, describes the covariance of the noise\footnote{% The $D_{\alpha \beta }$ here is the same as the one introduced above, the only difference being it is restricted to be $x$-independent in a LGM.}, and so, must be positive definite. An alternative expression for this noise is that its distribution is Gaussian: $\propto \exp \left\{ \eta _{\alpha }\Gamma ^{\alpha \beta }\eta _{\beta }/2\right\} $, where $\Gamma ^{\alpha \beta }$ is the matrix inverse of $2D_{\alpha \beta } / \varepsilon $ . Denoting the pdf for our LGM\footnote{% To avoid confusion, we use different notation for quantities in a LGM from the general case, e.g., $p$ and $\mathbf{j}$ instead of $P$ and $\mathbf{K}$.} by $p(\mathbf{x},t)$ and the probability current density by $\mathbf{j}(\mathbf{x},t)$, the Fokker-Planck equation becomes $\partial p/\partial t+\mathbf{\nabla}\cdot \mathbf{j}=0$, with \begin{equation} \mathbf{j}={\mathbb A}\mathbf{x}p-{\mathbb D}\mathbf{\nabla}p \end{equation}% In analogy with $\mathbf{J}=\rho \mathbf{v}$ in fluid dynamics, we may identify the velocity field as $\mathbf{u}={\mathbb A}\mathbf{x}-{\mathbb D}\nabla \ln p $. In the stationary state, the pdf, $p^{\ast }\left( \mathbf{x}\right) $, is a Gaussian \cite{Lax60}% \begin{equation} p^{\ast }(\mathbf{x})=\left. e^{-\mathbf{x}^{T}{\mathbb C}_{0}^{-1} \mathbf{x}/2}\right/ \sqrt{2 \pi \det {\mathbb C}_{0}}. \end{equation}% where\footnote{% Here, $ <\mathcal{O}> ^{\ast }$ refers to the average in the stationary state: $\int \mathcal{O}\left( \mathbf{x}\right) p^{\ast }\left( \mathbf{x}\right) d\mathbf{x}$.} ${\mathbb C}_{0}=\left\langle \mathbf{x}% \mathbf{x}^{T}\right\rangle ^{\ast }$ is the covariance matrix, related to ${% \mathbb A}$ and ${\mathbb D}$ by the generalized fluctuation dissipation relation \cite{Lax60,JBW03} (Einstein relation):% \begin{equation} {\mathbb A}{\mathbb C}_{0}+{\mathbb C}_{0}{\mathbb A}% ^{T}+2{\mathbb D}=0. \label{symPart} \end{equation} As presented, the LGM is able to describe systems which settle into either thermal equilibrium or a NESS. If the matrices ${\mathbb A} $ {and} ${\mathbb D}$ satisfy a further constraint, i.e., $ {\mathbb A}^{-1}{\mathbb D}$ being symmetric, then DB is satisfied and the system settles into thermal equilibrium with ${\mathbb C}_{0}={% \mathbb A}^{-1}{\mathbb D}$ and $\mathbf{j}^{\ast }\equiv 0$. Otherwise, $\mathbf{j}^{\ast }\neq 0$ and we have a NESS. It is straightforward to compute $\mathbf{j}^{\ast }$ which can be written as $-\left[ {\mathbb A% }{\mathbb C}_{0}+{\mathbb D}\right] \mathbf{\nabla}p^{\ast }$. Further, it is instructive to exploit (\ref{symPart}) and write% \begin{equation} \mathbf{j}^{\ast }=\frac{{\mathbb {\Lambda}}}{2}\mathbf{\nabla}p^{\ast } \label{j*} \end{equation}% where% \begin{equation} \mathbb{\Lambda} \equiv \mathbb C_{0}{\mathbb A}^{T}-{% \mathbb A}{\mathbb C}_{0} \label{Lmatrix} \end{equation}% Since ${\mathbb {\Lambda}}$ is manifestly antisymmetric, $\mathbf{\nabla} \cdot \mathbf{j}^{\ast }=0$ follows readily. Being divergence free, these currents must form closed loops, leading to the notion of rotations and \textquotedblleft angular momenta\textquotedblright\ - the main focus of the next section. We end this section with a few remarks. The expression (\ref{j*}) allows us to visualize the $\mathbf{j}^{\ast }$ field easily, as $p^{\ast }$ can be regarded as a \textquotedblleft hill with ellipsoidal contours\textquotedblright\ ($N-1$ dimensional sheets) to which\ $\mathbf{\nabla% }p^{\ast }$ is perpendicular. Thus, ${\mathbb {\Lambda}}$ will generate a vector field lying within these contours. If we focus on a two-dimensional ($N=2$) space, then the contours are ellipses and $\mathbf{j}^{\ast }$ is tangent to them. Explicit examples of such $\mathbf{j}^{\ast }$ fields can be found in, e.g., various figures in Ref. \cite{MMZ16,MMZ17}. Using $\mathbf{u}=\mathbf{K}/P $, we may associate $\mathbf{j}^{\ast }/p^{\ast }$ with a \textquotedblleft probability velocity field\textquotedblright\ (in the NESS) which \textquotedblleft carries probability from one configuration ($\mathbf{x}$) to a nearby one in preferred directions.\textquotedblright\ For the LGM, it is $\mathbf{u}={\mathbb \Omega}\mathbf{x}$, where, ${\mathbb \Omega}={\mathbb A}% +{\mathbb D}{\mathbb C}_{0}^{-1}$ is an angular velocity, providing us with the frequency of rotation in configuration space. Finally, note that we can decompose ${\mathbb A}{\mathbb C}_{0}$ into symmetric and antisymmetric parts% \begin{equation} -{\mathbb A}{\mathbb C}_{0}={\mathbb D}+\frac{{\mathbb \Lambda}}{2} \label{decomp} \end{equation}% Below, we will discuss the significance of this decomposition. \section{Probability Angular Momentum, its Generalization and Distribution} \label{sec:angmom} Probability current loops appear to be abstract concepts; how are they manifested in physical observables? Given that we expect rotations, angles and angular velocities (in configuration space) come naturally to mind \cite{RussellBlythe13}. However, there are disadvantages to these quantities, such as dependence on the choice of origin for $ \mathbf{x}$ and singular properties when the trajectory $\mathbf{x}\left( t\right) $ come close to this origin. We will argue that the analog of angular momentum is a better choice, related to many familiar quantities which are normally used to characterize a time series of observables. In classical mechanics, the angular momentum associated with a point particle of mass $m$ at $\mathbf{r}\left( t\right) $ moving with velocity $\mathbf{% v}\left( t\right) $ is $\mathbf{L} \left( t\right) =\mathbf{r}\times m\mathbf{v}$. Clearly, for a collection of such particles, mass $m_{i}$ at $\mathbf{r}_{i}$ moving with velocity $\mathbf{v}_{i}$, the total angular momentum is just $\sum_{i}\mathbf{r}% _{i}\times \mathbf{v}_{i}m_{i}$ . \ The next step is to generalize to a continuous distribution described by a mass density $\rho (\mathbf{r},t)$ and a velocity field $\mathbf{v}(\mathbf{r},t)$, such as a fluid from an Eulerian perspective. From these, we construct $\,\mathbf{r}\times \mathbf{v}\rho d\mathbf{r}$ and regard $\mathbf{L}(\mathbf{r},t)=\mathbf{r}\times \mathbf{v}(\mathbf{r},t)\rho (\mathbf{r}% ,t)$ as the angular momentum \textit{density}. The \textit{total} angular momentum of the entire distribution is\footnote{% Note that we use the same letter for both the density of a quantity and the total, the former having an additional argument, $\mathbf{x}$.} $\mathbf{L}(t)= \int d\mathbf{r}\,\rho (\mathbf{r},t)\,\mathbf{r}\times \mathbf{v}(\mathbf{r},t)$ , or substituting $\mathbf{J}$ for $\rho \mathbf{v}$,% \begin{equation} \mathbf{L}(t)=\int d\mathbf{r}~\mathbf{r}\times \mathbf{J}(\mathbf{r},t) \label{L in CM} \end{equation}% From here, we propose the \textit{probability angular momentum} in configuration space as a straightforward analogue, by letting $\mathbf{r}% \rightarrow \mathbf{x}$, $\mathbf{v}\rightarrow \mathbf{u}$, $\rho \rightarrow P$, and $\mathbf{J}\rightarrow \mathbf{K}$. Now, in $N$ dimensions, the PAM is no longer a (pseudo\mbox{-})vector but a (pseudo\mbox{-})tensor, ${\mathbb L}$, with components% \begin{equation} L_{\alpha \beta }\left( t\right) =\int d\mathbf{x}~\left( x_{\alpha }K_{\beta }(% \mathbf{x},t)-x_{\beta }K_{\alpha }(\mathbf{x},t)\right) \label{PAM} \end{equation}% The integrand here can be regarded as the \textit{probability angular momentum density}% \begin{equation} L_{\alpha \beta }(\mathbf{x},t)=x_{\alpha }K_{\beta }(\mathbf{x},t)-x_{\beta }K_{\alpha }(\mathbf{x},t) \label{L density} \end{equation}% Since $P$ is normalized to unity, the analogue of total mass is simply unity. Thus, if the units of all components of $\mathbf{x}$ are the same, $% \left[ x\right] $, then the units of the PAM (\ref{PAM}) are $\left[ x\right] ^{2}\left[ t\right] ^{-1}$ -- the same as diffusion (cf. below). In a NESS, we have ${\mathbb L}^{\ast }$, i.e., $L_{\alpha \beta }^{\ast }=\int d\mathbf{x}~\left( x_{\alpha }K_{\beta }^{\ast }-x_{\beta }K_{\alpha }^{\ast }\right) $ and note one of the salient features of using angular momenta instead of angles: Since $\mathbf{\nabla}\cdot \mathbf{K}^{\ast }=0$, ${\mathbb L}^{\ast }$ is \textit{independent }of the choice of the origin for $\mathbf{x} $. Turning to the LGM (\ref{LE},\ref{mu=Ax}) in the steady state, the elements of ${\mathbb L}^{\ast }$ are \begin{equation*} L_{\alpha \beta }^{\ast }=\int d\mathbf{x}\left( x_{\alpha }j_{\beta }^{\ast }-x_{\beta }j_{\alpha }^{\ast }\right) \end{equation*}% Substituting (\ref{j*}) and integrating by parts, we find a very simple result for the LGM: \begin{equation} {\mathbb L}^{\ast }={\mathbb {\Lambda}} \label{LGM-L} \end{equation}% Of course, since $\mathbf{j}\propto p$, with components of $\mathbf{x}$ as coefficients, ${\mathbb L}^{\ast }$ is just linear combinations of the two-point correlation ${\mathbb C}_{0}$. Indeed, it is just twice the antisymmetric part of $-{\mathbb A}{\mathbb C}_{0}$, while Eqn. (% \ref{decomp}) puts the PAM on the \emph{same footing }as diffusion\emph{.} It is not an accident that, as noted above, the units of the PAM are those of diffusion. While we are yet to understand the deeper significance underlying angular momenta and diffusion being part of one quantity (associated with the space of probability density), we can regard this relationship as another salient feature of using the PAM instead of angles to characterize rotation in statistical mechanics. Before continuing onto generalizations and distributions of the PAM, we present a brief summary of an explicitly analyzied, simple LGM \cite% {ZS07,UGa16} which may provide a helpful setting for more complex and realistic phenomena. Consider a system with just two degrees of freedom ($% x_{1,2}$), specifically, two coupled simple harmonic oscillators governed by a Hamiltonian, $\mathcal{H} = \left[ k_{1}x_{1}^{2}+k_{2}x_{2}^{2}+k_{\times }\left( x_{1}-x_{2}\right) ^{2}\right] /2$, each immersed in its own thermal bath of temperature $T_{1,2}$. This system has been previously studied by Ciliberto, et al. \cite{CilibertoEtAl2013} In the low-mass over-damped limit, this system is naturally described by Langevin equations (Boltzmann's constant absorbed into $T$): $dx_{\alpha }/dt=-\lambda _{\alpha }\left( \partial \mathcal{H}/\partial \xi _{\alpha }\right) +\eta _{\alpha }$, with $% \left\langle \eta \right\rangle =0$ and $\left\langle \eta _{\alpha }(t)\eta _{\beta }(t^{\prime })\right\rangle =2\lambda _{\alpha }T_{\alpha }\delta _{\alpha \beta }\delta (t-t^{\prime })$. Note that, in the absence of coupling ($k_{\times }=0$) or $T_{1}-T_{2}=0$, this system will settle into thermal equilibrium. Otherwise, it is precisely an LGM with (\ref{mu=Ax}) in (\ref{LE}). The $2\times 2$ matrices ${\mathbb A}$ {and} ${\mathbb D}$ are readily identified, while ${\mathbb C}_{0}$ and ${\mathbb {\Lambda}}$ can be easily computed. In the latter, there is a single independent component, say, $\Lambda_{12}^{\ast }$, which is proportional to $k_{\times }\left( T_{1}-T_{2}\right) $. Thus, we see that $L_{12}^{\ast } = \Lambda_{12}^{\ast }$ is non-zero if and only if $k_{\times }\neq 0$ and $T_{1}\neq T_{2}$, and the system then settles into a NESS. So far, our study of the PAM has led us to two point correlations at (almost) equal times, since $\mathbf{u}=d\mathbf{x}/dt=\underset{\varepsilon \rightarrow 0}{\lim }\left[ \mathbf{x}\left( t+\varepsilon \right) -\mathbf{x}% \left( t\right) \right] /\varepsilon $. There is a natural generalization to correlations at arbitrary times $t\neq t^{\prime }$. Though rarely considered in classical mechanics of point particles, this generalization takes the form% \begin{equation} \mathbf{A}\left( t,t^{\prime }\right) \equiv m\mathbf{r}\left( t\right) \times \mathbf{r}\left( t^{\prime }\right) \label{A} \end{equation}% for any given trajectory $\mathbf{r}\left( t\right) $. Note that the magnitude $% \left\vert \mathbf{A}\right\vert $ is the area of a parallelogram spanned by the two $\mathbf{r}$'s (related to the area in Kepler's second law). As $t^{\prime }\rightarrow t_{+}$, $\mathbf{L}$ is recovered: $\mathbf{L}% \left( t\right) =\left. \partial \mathbf{A}\left( t,t^{\prime }\right) /\partial t^{\prime }\right\vert _{t^{\prime }=t}$. The statistical mechanics analog of $\mathbf{A}$ is Levy's stochastic area\footnote{% Introduced in 1940 by Levy \cite{Levy40}, this concept was subsequently developed in a series of articles. For a modern review and further generalizations, see, e.g., Ref. \cite{HelmesSchwane83}. Most recently, it has been exploited in the context of noisy couple RC circuits \cite{GNT17,GNT19}.}. Here, we consider the two point correlation function at unequal times, $C_{\alpha \beta }\left( t,t^{\prime }\right) $. To be precise, the definition% \begin{equation} C_{\alpha \beta }\left( t,t^{\prime }\right) \equiv \left\langle x_{\alpha }(t)x_{\beta }(t^{\prime })\right\rangle =\int x_{\alpha }x_{\beta }^{\prime }P\left( \mathbf{x},t;\mathbf{x}^{\prime },t^{\prime }\right) d\mathbf{x}\,d\mathbf{x}% ^{\prime } \label{2pf} \end{equation}% requires the \textit{joint} probability distribution: $P\left( \mathbf{x},t;\mathbf{x}^{\prime },t^{\prime }\right) =P\left( \mathbf{x},t\right) G\left( \mathbf{x}^{\prime }-\mathbf{x},t^{\prime }-t\right) $. Here, $G\left( \mathbf{\xi},\tau \right) $ is the time dependent solution to the Fokker-Planck equation (\ref{FP}), subjected to the initial condition $G\left( \mathbf{\xi},0\right) =\delta \left( \mathbf{\xi}\right) $. The analog of $\mathbf{A}\left( t,t^{\prime }\right) $, i.e., the generalization of ${L_{\alpha \beta }(t)}$, is just the antisymmetric combination \begin{equation} \tilde{C}_{\alpha \beta }\left( t,t^{\prime }\right) \equiv C_{\alpha \beta }\left( t,t^{\prime }\right) -C_{\beta \alpha }\left( t,t^{\prime }\right) \label{C-tilde} \end{equation}% so that ${L_{\alpha \beta }}\left( t\right) =\left. d\tilde{C}_{\alpha \beta }\left( t,t^{\prime }\right) /dt^{\prime }\right\vert _{t^{\prime }=t}$. By construction, $\tilde{C}$ is odd under $t\Leftrightarrow t^{\prime }$: $% \tilde{C}_{\alpha \beta }\left( t,t^{\prime }\right) =-\tilde{C}_{\alpha \beta }\left( t^{\prime },t\right) $, a property related to the violation of time reversal symmetry. Of course, in the steady state $\tilde{C}{^{\ast }}$ is stationary, so it depends only on the difference $\tau =t^{\prime }-t$. This formulation parallels that of relative dispersion in fluids \cite{Batchelor52,DukowiczSmith97,LaCasce08}. Clearly, much more information about the dynamics of our system is encoded in $\tilde{C}^{\ast }$ than in $L^{\ast }$ and, naturally, computing these quantities theoretically is difficult in general. However, as the LGM is completely specified by the matrices ${\mathbb A}$ and ${\mathbb D}$, it can be found analytically. In particular, the time-lagged covariance matrix ${% \mathbb C}_{\tau }$ (i.e., $C_{\alpha \beta }^{\ast }\left( t,t+\tau \right) $) is related simply to ${\mathbb C}_{0}$: \begin{equation} {\mathbb C}_{\tau }=\left\langle \mathbf{x}(t+\tau )\mathbf{x}% ^{T}(t)\right\rangle ^{\ast }=e^{{\mathbb A}\tau }{\mathbb C}_{0} \label{eq:Clag} \end{equation}% As expected, it is independent of $t$, due to time translational invariance of a steady-state. Instead of ${\mathbb A}$ and ${\mathbb D}$, the LGM can be specified alternatively by these steady-state covariance matrices ${\mathbb C}_{0}, {\mathbb C}_{\tau }$. The advantage is that this representation is useful for constructing empirical models from data as discussed below. Further, note that $\left. d{\mathbb C}_{\tau }/d\tau \right\vert _{\tau =0}={% \mathbb A\mathbb C}_{0}$ contains the full information contained in ${\mathbb D}$ and ${\mathbb \Lambda }$. Thus, an alternative perspective of an LGM is to specify it by ${\mathbb C}_{0}$, ${% \mathbb D}$ and ${\mathbb \Lambda}$. The advantage of this representation is that all possible systems can be grouped into families with the same ${\mathbb C}_{0}$ and ${\mathbb D}$ but different ${\mathbb \Lambda}$. Since ${\mathbb D}$ is positive definite, one can always transform to coordinates where ${\mathbb D}$ is diagonal \cite{JBW03}. In these coordinates, diffusion is solely in the radial direction in phase space. Then, phase space rotation is completely captured by ${\mathbb \Lambda}$. To emphasize, only one member of the family (the one with ${\mathbb \Lambda}=0$) corresponds to a system in thermal equilibrium. All other members represent nonequilibrium systems (with the same pdf and diffusion) with non-trivial PAM. We will not pursue the study of ${% \mathbb C}_{\tau }$ further here, but examples of its behavior can be found in other contexts \cite{SZ14,MMZ16,MMZ17}. In the final paragraphs of this section, we consider another important aspect of the PAM, namely, its full distribution. Focusing only on a NESS, we observe the system for a length of time and record a single trajectory: $% \mathbf{x}_{obs}\left( t\right) $. Of course, physical data such as in climate science would be observed at typically integer multiples of some finite time step, $\varepsilon $. Then, instead of the continuous velocity, we would use the finite difference approximation: $d\mathbf{x}/dt\approx \left[ \mathbf{x}(t+\varepsilon )-\mathbf{x} (t)\right] /\varepsilon $. From such time series, we can construct another series for \begin{equation} {\mathbb L}_{obs}\left( t\right) =\mathbf{x}_{obs}\left( t\right) \wedge \mathbf{x}_{obs}\left( t+\varepsilon \right) /\varepsilon \label{PAM(t)} \end{equation}% where we have used the wedge product to denote the antisymmetric part of the tensor product. Note that the extra term in the discrete approximation for the velocity plays no role, as $\mathbf{x}_{obs}\left( t\right) \wedge \mathbf{x}_{obs}\left( t\right) \equiv 0$. Meanwhile, under the assumption of ergodicity, various statistical quantities can be computed from a \textit{time average} over the trajectory (denoted by an overline) instead of the ensemble averages discussed above, e.g., \begin{equation*} \overline{{\mathbb L}_{obs}}={\mathbb L}^{\ast } \end{equation*}% In addition to the average over the time series, we can construct a histogram, which approximates the full distribution of the quantity involved. For convenience, let us focus on a two-dimensional configuration space (which can be a subspace of a higher dimensional space) and, dropping the subscript $_{obs}$, we will simply label the observed values as $x_{1}\left( t\right), x_{2}\left( t\right)$. Then, the PAM is characterized by a single (independent) quantity, say, the $1$-$2$ element of ${\mathbb L% }_{obs}$. We denote that time series by% \begin{equation*} \mathcal{L}\left( t\right) \equiv \left( x_{1}(t)x_{2}(t+\varepsilon )-x_{2}(t)x_{1}(t+\varepsilon )\right) /\varepsilon \end{equation*}% and the associated histogram by $H\left( \mathcal{L}\right) $. Note that, in general, $\mathcal{L}\left( t\right) $ will appear with both signs and the support of $H$ is over the entire line $\left( -\infty ,\infty \right) $. Normalizing $H$ provides us with a pdf, which can be compared to the theoretical expression \begin{equation*} f\left( \mathcal{L}\right) =\int \delta \left( \mathcal{L}-\frac{% x_{1}x_{2}^{\prime }-x_{2}x_{1}^{\prime }}{\varepsilon }\right) P^{\ast }\left( \mathbf{x},0;\mathbf{x}^{\prime },\varepsilon \right) d\mathbf{x}\,d\mathbf{x}% ^{\prime } \end{equation*}% where $P^{\ast }\left( \mathbf{x},0;\mathbf{x}^{\prime },\varepsilon \right) =p^{\ast }\left( \mathbf{x}\right) G\left( \mathbf{x}^{\prime }-\mathbf{x}% ,\varepsilon \right) $ is the joint probability in NESS. In the LGM, $G$ is also Gaussian, like $p^{\ast }$, so that the Fourier transform of $f$ \begin{equation} \hat{f}(\phi )=\int f(\mathcal{L})e^{-i\mathcal{L}\phi }d\mathcal{L} \end{equation}% involves only Gaussian integrals and can be computed exactly. The technical details are quite involved and will be deferred to another publication. Let us summarize the main results here. \begin{itemize} \item $1/\hat{f}(\phi )$ is the square root of the determinant of the matrix appearing in the Gaussian. \item As the matrix is $4\times 4$, $1/\hat{f}^2$ is a quartic polynomial in $\phi $. \item The singularities of $\hat{f}(\phi )$ are branch points. Located at the roots of the quartic, they lie on both sides of the real axis, with those nearest to the real axis controlling the large $\mathcal{L}$ asymptotic (exponential) decay of $f(\mathcal{L})$. \item The parameters of the quartic come from the defining matrices of the LGM: either the pair (${\mathbb A}$,${\mathbb D}$), or the set (${\mathbb C}_{0}$,${\mathbb D}$,${\mathbb \Lambda}$). For our $N=2$ case, it is more convenient to use the latter set, as the first two matrices are real symmetric. Meanwhile, let us write ${\mathbb \Lambda}$ as $\left( \begin{array}{cc} 0 & \ell \\ -\ell & 0% \end{array}% \right) $ so that \textit{all} the DB violating aspects of this LGM are contained in a single parameter: $\ell $. \item As expected, in the $\ell =0$ case, $1/\hat{f}^2$ is quadratic in $\phi ^{2}$. Thus, the distribution $f$ is symmetric\ in $\mathcal{L}$ and leads to $\left\langle \mathcal{L}\right\rangle \equiv 0$. \item $\hat{f}$ is of the form $1-i\phi \ell +O\left( \phi ^{2}\right) $ and so, $\left\langle \mathcal{L}\right\rangle =\left. id\hat{f}/d\phi \right\vert _{\phi =0}$ is just $\ell $, confirming Eqn. (\ref{LGM-L}). \item Note that $f$ is not $\delta $ distributed and has a finite variance. For that, we need $\left\langle \mathcal{L}^{2}\right\rangle =\left. -d^{2}\hat{f}/d\phi^{2} \right\vert _{\phi =0}$. In particular, even with $\ell=0$, this variance, which we denote by $\sigma _{0}^{2}$, is non-trivial. The physics is clear: A trajectory for a system in an equilibrium steady state is just as likely to rotate one way as the other, respecting time reversal symmetry. The typical values of these rotations are $O\left( \sigma _{0}\right) $, associated with both the damping and the noise (${\mathbb A}$ and ${\mathbb D}$). \item For $ \ell \ne 0$, we find $\left\langle \mathcal{L}^{2}\right\rangle =\sigma _{0}^{2}+2\ell ^{2}$. As a result, we arrive at a simple expression% \begin{equation*} \sigma _{\ell }^{2}\equiv \left\langle \mathcal{L}^{2}\right\rangle -\left\langle \mathcal{L}\right\rangle ^{2}=\sigma _{0}^{2}+\ell ^{2} \end{equation*}% for the variance of the distribution $f$ for systems in NESS. This leads to an important ratio% \begin{equation} \frac{\left\langle \mathcal{L}\right\rangle }{\sigma _{\ell }}=\sqrt{\frac{% \ell ^{2}}{\sigma _{0}^{2}+\ell ^{2}}} \label{eq:error} \end{equation}% which implies the following caution. If a trajectory with finite time steps is used to find averages and standard deviations of probability angular momenta, and if a NESS system is well described by an LGM, then $\left\langle \mathcal{L}\right\rangle $ can never exceed $\sigma _{\ell }$. Thus, we must examine the statistics of the full pdf in order to come to a meaningful conclusion on whether a nonzero time average $\mathcal{\bar{L}}$ is significant or not. In contrast, stochastic processes with prominent rotational aspects (e.g., noisy limit cycles) are not subjected to the limitations shown here \cite{UGa16}. A comprehensive discussion is beyond the scope of this work and will be presented elsewhere. \end{itemize} Within the context of the LGM, we presented a complete analytic description of various aspects of the PAM. For systems that display prominent rotations, there is little need to identify them as NESS. But, there are many cases where the trajectories in configuration space display subtle rotations, hidden behind a substantial amount of noise. For data from computer simulations or observations, we are necessarily restricted to a finite times series of discrete points. From such a series, we may construct ${% \mathbb L}_{obs}\left( t\right) $ according to (\ref{PAM(t)}) and compute the time average $\overline{{\mathbb L}_{obs}}$. A non-zero value is clear signal of time reversal violation, so that the system cannot be regarded as \textquotedblleft in thermal equilibrium.\textquotedblright\ We should be cautious, however, since the variance of ${\mathbb L}% _{obs}\left( t\right) $ is typically non-trivial, even in equilibrium. For an LGM with just two variables, we are able to find exact analytic results, so that these remarks rest on a sound quantitative foundation. In particular, we computed the full distribution of $\mathcal{L}$ (the single independent quantity associated with ${\mathbb L}$) and showed that it is non-vanishing on both sides of $\mathcal{L}=0$, while a non-zero average depends on the subtle asymmetry of this distribution. Given a times series, $% \mathbf{x}_{obs}\left( t\right) $, a histogram can be compiled for the associated $\mathcal{L}\left( t\right) $, and we can compare that to the theoretical distribution. Such a comparison provides a further criterion, beyond fitting a Gaussian to the histogram of $\mathbf{x}_{obs}$, for whether the data can be adequately described by an LGM. Finally, we address a natural question, namely, how do we interpret the sign of the PAM. Our proposal is that, especially in cases of \textquotedblleft subtle\ displays\textquotedblright\ of this rotation, one of the variables is the \textquotedblleft driver\textquotedblright\ with the other being the \textquotedblleft follower,\textquotedblright\ much like the increase of prey populations \textquotedblleft drives\textquotedblright\ the increase in the numbers of predators. In physical systems, the sign of $\mathcal{\bar{L}} $ may point us to more tractable underlying causes of this \textquotedblleft driver-follower\textquotedblright\ behavior, a key characteristic of NESS. In the paleoclimate literature, a similar interpretation is used with ``phase wheels'' used to indicate the ordering of phenomena and likely causality under cyclical forcing \cite{imbrie1993structure}, here the cycles result from the PAM. In the next section, we apply these finding to two prominent examples of natural variability in the climate system. Of course, like most physical systems, the dynamics here are far from being linear and the stochastics are more complex than additive Gaussian noise. Nonetheless, for reasons that are not fully understood, it is often the case that some aspects of climate oscillations about a steady-state are skillfully modeled by LGMs. \section{Example Climate Oscillations: ENSO and MJO} \label{sec:climosc} Climate oscillations are preferred spatio-temporal patterns of natural variability of the climate system. These climate oscillations are preferred in the sense that they represent some of the most significant variability about the time-average climate state, and are further important as they have significant human impacts. Each oscillation has a typical fairly narrow range of timescales and has a large projection onto different, relatively small subspaces of the massively high-dimensional phase space of the entire climate system. Climate oscillations are quantified with climate indices: functions of subsets of climate variables, filtered to the specific spatio-temporal scales of the pattern, and empirically developed to capture the dominant features of a climate oscillation with one, two, or a few scalar quantities. Generally, a variety of sets of climate indices can be used to quantify a climate oscillation with mostly consistent results \cite{wolter2011nino}. Oscillations often have many coevolving indices, each of which highlights a different aspect of the complex pattern. The El-Ni\~no Southern Oscillation (ENSO) has its largest projection in the tropical Pacific region, dominating ocean temperatures, the location of atmospheric convection and precipitation, and the atmospheric Walker circulation. Individual ENSO events (as defined by indices retaining a value beyond a critical threshold) persist for roughly 9 months and the time between repeated events is on the order of 2 to 7 years. We adopt the common description of ENSO in terms of the NINO3 index (NINO3) and the depth of the 20$^\circ$C isotherm in the tropical Pacific (d20), which roughly indicates the depth of the thermocline which is the region below the surface layer where temperatures begin rapidly decreasing toward abyssal values. ENSO index data is publicly available from a number of sources. Here we use the data from the KNMI Climate Explorer \cite{TrouetVan-Oldenborgh13}. The data used here are monthly averages of observations and extends from 1960 to 2016. The Madden-Julien Oscillation (MJO) is an eastward-moving pattern that has its largest projection on tropical rainfall, convection, and outgoing long-wave radiation. Its timescale is weeks to months. We will describe the MJO in terms of the so-called Original MJO Index (OMI) which is a two-dimensional index representing the principal components of the first two empirical orthogonal functions (EOFs) of filtered outgoing long-wave radiation between $20^{\circ}$N and $20^{\circ}$S \cite{kiladis2014comparison}. Like ENSO data, MJO data is publicly available from a number of sources. Here we use the daily data from NOAA's Earth System Radiation Lab 1/1/1979 - 4/26/2016. The units of phase space for climate indices can be unintuitive. The units of probability angular momentum are the same as the units of diffusion, length$^2$/time. The two ENSO indices, however, have different units of ``length''. NINO3 is a temperature anomaly and has units of $^\circ$C, while d20 is a depth anomaly and has units of cm. As a result, in the NINO3-d20 phase space with monthly data the probability angular momentum has units of $^\circ$C cm/month\footnote{% Note that ``diffusion'' in this case also carries these units, as it is the noise covariance matrix.}. Sometimes one uses indices that have been scaled by their standard deviation resulting in indices which are unitless (Mahalanobis distance). Then, the probability angular momentum would have units of 1/time. Climate oscillations can be modeled by LGMs of the form (\ref{LE} with \ref{mu=Ax}) through a process called linear inverse modeling. A multivariate time series is used to construct the steady-state covariance ${\mathbb C}_0$ and the time-lagged covariance ${\mathbb C}_\tau$. The time lag is empirically chosen to capture the timescale of the climate oscillation of interest. Then Eq.~\eqref{eq:Clag} is used to compute ${% \mathbb A}$ and Eq.~\eqref{decomp} or \eqref{symPart} determines ${\mathbb D}$. There is no guarantee that this procedure will result in a stable SDE, but it often works surprisingly well, e.g., \cite{WinklerNewman01,KirtmanShukla02,HawkinsSutton09,AlexanderEtAl2008}. Here we use linear inverse modeling to construct two-dimensional LGMs for ENSO and the MJO from the time series of their indices. The pdf $f\left( \mathcal{L}_{\tau }\right) $ can be calculated directly from the observed time series as well as theoretically from the LGMs. The pdfs are strongly asymmetric and have exponential tails. The asymmetry leads to the total probability angular momentum of the steady-state, $\left\langle \mathcal{L_{\tau }}\right\rangle $, being nonzero despite the most likely value (mode) being zero. The two methods of generating a pdf (measurement of $f\left( \mathcal{L}_{\tau }\right) $ versus LGM based on ${\mathbb A}, {\mathbb D}$) agree surprisingly well for the ENSO and MJO cases, despite the underlying complexity of these phenomena and their quantifying indices. The linear inverse modeling procedure produces, by construction, a LGM that has same average $\left\langle \mathcal{L_{\tau }}\right\rangle $ as the data. Thus, we rely on the excellent agreement between the full pdf's (Fig.~\ref{fig:ENSOMJO2}) to conclude that measurements of $f\left( \mathcal{L}_{\tau }\right) $ are robust and that they can be used to verify models (both LGMs and more complex climate models) as well as for model intercomparison. Climate phenomena represent complex extremely high-dimensional dynamical systems. The probability angular momentum provides a new quantity based on the persistent probability currents in nonequilibrium steady-states to quantify the fluctuations about the time mean state. The two examples shown here were minimal, involving only two degrees of freedom, but the approach and equations presented here can be applied to more detailed systems as well, keeping \eqref{eq:error} as a guide for how many probability angular momenta (involving various pairs of axes) are reliable. \begin{figure}[tbp] \centering \includegraphics[height=2.5in]{histN3d20.png} % \includegraphics[height=2.5in]{histMJO.png} \caption{Pdfs of the finite-time probability angular momentum for observations and a linear Gaussian model fit to the observations. a) ENSO using monthly data, and b) MJO using daily data. Gray indicates regions where the two pdfs overlap, yellow indicates regions where the model pdf is larger than the observation pdf, and blue indicates regions where the observation pdf is larger than the model pdf.} \label{fig:ENSOMJO2} \end{figure} \section{Summary and Outlook} In this work, we study a principal characteristic of nonequilibrium stationary states, namely, \textit{persistent} probability current loops. Of the many observable consequences, we propose to focus on a particularly convenient quantity: the probability angular momentum (in analogy with angular momenta associated with circulating fluids). Directly related to correlation functions at unequal times, it can be used to characterize any statistical system in NESS. Here, we provide an illustration in the context of climate science, i.e., the two \textquotedblleft oscillatory\textquotedblright\ phenomena, ENSO and MJO. Exploiting the parallel with fluid dynamics, we regard the probability density $P\left( \mathbf{x},t\right) $ (in the space of configurations of a statistical system, or phase space) as a fluid density $\rho \left( \mathbf{r}% ,t\right) $ (in ordinary 3-dimensional space). Similarly, we draw the parallel between current \textit{densities} $\mathbf{K}\left( \mathbf{x},t\right) $ and $\mathbf{J}\left( \mathbf{r},t\right) $, as well as velocity fields $\mathbf{u}=% \mathbf{K}/P$ and $\mathbf{v}=\mathbf{J}/\rho $. From these, we propose to study the \textit{probability angular momentum density}: $\mathbb{L}\left( \mathbf{x}% ,t\right) \equiv \mathbf{x}\wedge \mathbf{u}\,P$. After our system settles into a stationary state, described by distribution $P^{\ast }\left( \mathbf{x}\right) $% , there will be non-trivial steady $\mathbf{K}^{\ast }$, provided it is a NESS. These current loops lead naturally to the concept of the (total) probability angular momentum: $\mathbb{L}^{\ast }=\int d\mathbf{x}~\mathbb{L}^{\ast }\left( \mathbf{x}% \right) =\left\langle \mathbf{x}\wedge \mathbf{u}\right\rangle ^{\ast }$. To emphasize, this quantity must vanish for a system in thermal equilibrium, in which $\mathbf{K}^{\ast }\equiv 0$ and thus, serves as a quantitative measure for the nonequilibrium characteristics of a stationary system. Since $\mathbf{u} $ is associated with $\mathbf{x}$ at an infinitessimally later time, $\mathbb{L}% ^{\ast }$ can be generalized to two point correlation functions at arbitrary unequal times $\left\langle \mathbf{x}(t)\wedge \mathbf{x}(t+\tau )\right\rangle ^{\ast }/\tau $. Noting that $\mathbb{L}^{\ast }$ and $\mathbb{D}$ share the same units, we find an intimate relationship between angular momentum and diffusion, the deeper significance of which is yet to be explored. In general, we argue that the probability angular momentum plays a central role in any study of the nonequilibrium fluctuations in a NESS. If a system evolving in NESS is observed, a single trajectory would be recorded at typically integer multiples of some time step $\varepsilon $: $\mathbf{x}_{obs}\left( n\varepsilon \right) $. From this, we can construct a time series for $\mathbb{L}_{obs}\left( n\varepsilon \right) =\mathbf{x}% (n\varepsilon )\wedge \mathbf{x}(n\varepsilon +\varepsilon )/\varepsilon $. Invoking ergodicity, we expect the time average of $\mathbb{L}_{obs}$ to be $\mathbb{L}^{\ast }$.\ Further, we can study its variations and compile a histogram and study the full distribution of $\mathbb{L}_{obs}$. In general, the variance is non-trivial, even if the time average vanishes. As a result, some care is needed when analyzing model simulations or physical data. Finally, we provide an analytically tractable case for exploring these ideas, namely, the linear Gaussian model. In particular, explicit results are found for the general case of an LGM with just two variables (in which $\mathbb{L}$ is specified by a single quantity $\mathcal{L}$). To illustrate how this approach may be applied to climate studies, we consider certain aspects of the ENSO and MJO phenomena. Using just two indices from the physical data in each case, we show that the histograms of $\mathcal{L}$ are quite asymmetric, and so, there is no doubt that the averages $\left\langle \mathcal{L}\right\rangle $ are non-trivial. Further, we construct LGMs using the time lagged covariance from data, and found that its predictions are in excellent agreement with the histograms. Such analysis gives us confidence that the LGMs capture the essentials of this aspect of the NESS. In the climate context, it is important to note that the predictions and projections for future climate states rely on the persistent probability currents (Fig. 1). When LGMs are used for forecasting \cite{AlexanderEtAl2008}, it is critical to match the probability currents as observed which are, as emphasized here, a source of long timescale predictability. Our conclusion is that probability angular momenta provide a valuable and novel route to study the time reversal violating aspects of not only our climate system but also \textit{all} systems driven far from equilibrium in general. Naturally, many new questions arise. One line of questions follows the applications to the climate system. Needless to say, there are many, many more climate phenomena to which we can apply this type of analysis in addition to the illustrations here -- the North Atlantic Oscillation, Southern and Northern Annular Modes, variability of the Oceanic Meridional Overturning Circulation, etc. The accuracy of models of these phenomena can usefully be constrained by evaluating the probability angular momenta of the model versus those of observations. The other line of pursuit is in the realm of theory. Many issues related to the PAM within the context of the LGM remain to be explored further. A prime example is the behavior of the time-lagged correlation $\left\langle \mathbf{x}(0)\wedge \mathbf{x}(\tau )\right\rangle ^{\ast }$ as a function of $\tau $, as well as their associated distributions. General considerations and a few preliminary investigations for specific systems \cite{SZ14,MMZ16} show that it rises to a maximum before decaying exponentially. What is the physics behind this peak? A comprehensive study, valid for all LGMs in arbitrary dimensional phase space, would be valuable. What are the key characteristics of the LGM that can lead us to predict which are the \textquotedblleft driving variables\textquotedblright\ and which are the \textquotedblleft followers?\textquotedblright\ Beyond these questions associated with the probability currents, loops, angular momenta, and rotations in phase space, we should consider their implications in a wider context. Can such considerations lead us to a quantity, or quantities, beyond the twin pillars of equilibrium statistical mechanics: energy and entropy? From these steps, we may find hints towards formulating a framework for preferred fluctuations in non-equilibrium statistical mechanics and the climate system. \begin{acknowledgements} This work was supported in part by NSF INSPIRE Award \#1245944 and NSF DMR \#1507371. Work of JBW was partially carried out during a stay at the Institute for Marine and Atmospheric research Utrecht (Utrecht University, NL) which was supported by the Netherlands Centre for Earth System Science. Three of us (JBW, BF-K, RKPZ) are grateful for the hospitality of the MPIPKS, where some of this work was carried out during a workshop \textit{Climate Fluctuations and Non-Equilibrium Statistical Mechanics: an Interdisciplinary Dialogue} in the summer of 2017. We would like to thank Kevin Bassler, Ronald Dickman and Beate Schmittmann for helpful discussions. \end{acknowledgements} \bibliographystyle{spmpsci}
\section{Conclusion and Discussion} \label{sec:Conc} We presented an approach to automate the process of augmenting an assistive walking device with ability to prevent falls. Our method has three key components : A human walking policy, fall predictor and a recovery policy. In a simulated environment we showed that an assistive device can indeed help recover balance from a wider range of external perturbations. We introduced \emph{stability region} as a quantitative metric to show the benefit of using a recovery policy. In addition to this, \emph{stability region} can also be used to analyze different design choices for an assistive device. We evaluated six different sensor and actuator configurations. In this work, we only evaluated the effectiveness of using a recovery policy for an external push. It would be interesting to extend our work to other kinds of disturbances such as tripping and slipping. Another future direction would like to take is deploying our recovery policy on the real-world assistive device. This would need additional efforts to make sure that our recovery policy also can adjust for the differences in body structure of users. \section*{Acknowledgment} \small We thank Pawel Golyski and Seung-yong Hyung for their assistance with this work. This work was supported by the Global Research Outreach program of Samsung Advanced Institute of Technology. \section{Experiments and Results} \label{sec:Exp} We validate the proposed framework using the open-source physics engine DART \cite{lee2018dart}. Our human agent is modeled as an articulated rigid body system with $29$ degrees of freedom (dofs) including the six dofs for the floating base. The body segments and the mass distribution are determined based on a $50$th percentile adult male in North America. We select the prototype of our assistive walking device as the testbed.Similar prototypes are described in \cite{caputo,ExoDesign,witte}. It has two cable-driven actuators at hip joints, which can exert about $200$ Nm at maximum. However, we limit the torque capacity to $30$ Nm as a hard constraint. Sensors, such as Inertial Measurement Units (IMU) and hip joint motor encoders, are added to the device. We also introduce a sensing delay of $40$ to $50$ ms. We modeled the interaction between the device and human by adding positional constraints on the thigh and anchor points. For all experiments, the simulation time step is set to $0.002$s. We design experiments to systematically validate the learned human behaviors and effectiveness of the recovery policy. Particularly, our goal is to answer the following questions: \begin{enumerate} \item How does the motion generated by the learned human policy compare to data in the biomechanics literature? \item Does the recovery policy improve the robustness of the gaits to external pushes? \item How does the effectiveness of the assistive walking device change with design choices? \end{enumerate} \subsection{Comparison of Policy and Human Recovery Behaviors} \begin{figure} \centering \includegraphics[width=0.8\linewidth]{images/JointangleComparison_stance.png} \caption{Comparison between hip and knee joint angles during walking generated by the policy and human data~\cite{Winter}.} \label{fig:Jangles} \end{figure} \begin{figure} \centering \begin{subfigure}{1.0\linewidth} \centering \includegraphics[width=0.8\linewidth]{images/WorkLoop_new1.png} \caption{} \label{fig:Tauloops} \end{subfigure} \begin{subfigure}{1.0\linewidth} \centering \includegraphics[width=0.8\linewidth]{images/footplacement_new.png} \caption{} \label{fig:footplacement} \end{subfigure} \caption{(a) Comparison of torque loops of a typical trajectory generated by our policy and human data reported by \cite{Winter} at the hip of stance leg during a gait cycle. The green dots indicate the start and the black dots indicate 50\% of the gait cycle. The arrows show the progression of the gait from 0\% to 100\%. (b) Comparison of the forward foot step locations predicted by the policy and by the model reported by Wang {\em{et~al.}\ } \cite{Wang2014} as a function of the COM velocity. } \label{fig:test} \end{figure} We first validate the steady walking behavior of the human policy by comparing it to the data collected from human-subject experiments. \figref{Jangles} shows that the hip and knee joint angles generated by the walking policy well match the data reported in Winter {\em{et~al.}\ } \cite{Winter}. We also compare the ``torque loop'' between the gait generated by our learned policy and the gait recorded from the real world~\cite{Winter}. A torque loop is a plot that shows the relation between the joint degree of freedom and the torque it exerts, frequently used in the biomechanics literature as a metric to quantify human gait. Although the torque loops in \figref{Tauloops} are not identical, both trajectories form loops during a single gait cycle indicating energy being added and removed during the cycle. We also notice that the torque range and the joint angle range are similar. In addition, we compare adjusted footstep locations due to external perturbations with the studies reported by Wang {\em{et~al.}\ } \cite{Wang2014}. Their findings strongly indicate that the COM dynamics is crucial in predicting the step placement after disturbance that leads to a balanced state. They introduced a model to predict the changes in location of the foot placement of a normal gait as a function of the COM velocity. \figref{footplacement} illustrates the foot placements of our model and the model of Wang {\em{et~al.}\ } against four pushes with different magnitudes in the sagittal plane. For all scenarios, the displacement error is below $4$~cm. \subsection{Effectiveness of Recovery Policy} \begin{figure} \centering \setlength{\tabcolsep}{3pt} \begin{tabular}{c c c c} \includegraphics[width=0.11\textwidth,height=2.1cm]{images/phase10percent.jpg}& \includegraphics[width=0.11\textwidth,height=2.1cm]{images/phase30percent.jpg}& \includegraphics[width=0.11\textwidth,height=2.1cm]{images/phase60percent.jpg}& \includegraphics[width=0.11\textwidth,height=2.1cm]{images/phase90percent.jpg} \\ \end{tabular} \caption{ Four different timing of the left leg swing phase during which we test the performance of the assistive device. First is at 10\% of the phase and then subsequently 30\%, 60\% and 90\% of the left swing leg.} \label{fig:phaseDefinition} \end{figure} We test the performance of the learned recovery policy in the simulated environment with external pushes. As a performance criterion, we define the \emph{stability region} as a range of external pushes from which the policy can return to the steady gait without falling. For better 2D visualization, we fix the pushes to be parallel to the plane, applied on the same location with the same timing and duration (40 milliseconds). All the experiments in this section use the default sensors and actuators provided by the prototype of the walking device: an IMU, hip joint motor encoders, and hip actuators that control the flexion and extension of the hip. \begin{figure} \centering \begin{subfigure}{0.8\linewidth} \centering \includegraphics[width=0.8\linewidth]{images/ExoEffect.png} \caption{} \end{subfigure} \caption{Stability region with and without the use of a recovery policy. A larger area shows increased robustness to an external push in both magnitude and direction. } \label{fig:exohelp} \end{figure} \figref{exohelp} compares the stability region with and without the learned recovery policy. The area of stability region is expanded by 35\% when the recovery policy is used. Note that the stability region has very small coverage on the negative side of y-axis which corresponds to the rightward forces. This is because we push the agent when the swing leg is the left one, making it difficult to counteract the rightward pushes. Figure \ref{fig:s} shows one example of recovery motion. \begin{figure} \centering \includegraphics[width=0.8\linewidth]{images/PhaseEffect.png} \includegraphics[width=0.9\linewidth]{images/Phase_barplots.png} \caption{Comparison of recovery performance when perturbation is applied at four different phases. \textbf{Top:} Comparison of stability region. \textbf{Bottom:} Comparison of COM velocity across five gait cycles. Perturbation is applied during the gait cycle 'p'. Both plots indicate that our policy is least effective at recovering when the perturbation occurs later in the swing phase. } \label{fig:PhaseEffect} \end{figure} \begin{figure*} \centering \setlength{\tabcolsep}{1pt} \renewcommand{\arraystretch}{0.7} \begin{tabular}{c c c c c} \includegraphics[width=0.19\textwidth,height=2.3cm]{images/s1.png}& \includegraphics[width=0.19\textwidth,height=2.3cm] {images/s2.png}& \includegraphics[width=0.19\textwidth,height=2.3cm]{images/s3.png}& \includegraphics[width=0.19\textwidth,height=2.3cm]{images/s4.png}& \includegraphics[width=0.19\textwidth,height=2.3cm]{images/s5.png} \\ \includegraphics[width=0.19\textwidth,height=2.3cm]{images/f1.png}& \includegraphics[width=0.19\textwidth,height=2.3cm] {images/f2.png}& \includegraphics[width=0.19\textwidth,height=2.3cm]{images/f3.png}& \includegraphics[width=0.19\textwidth,height=2.3cm]{images/f4.png}& \includegraphics[width=0.19\textwidth,height=2.3cm]{images/f5.png} \\ \end{tabular} \caption{ \textbf{Top:} Successful gait with an assistive device. \textbf{Bottom:} Unsuccessful gait without an assistive device.} \label{fig:s} \end{figure*} The timing of the push in a gait cycle has a great impact on fall prevention. We test our recovery policy with perturbation applied at four different phases during the swing phase (\figref{phaseDefinition}). We found that the stability region is the largest when the push is applied at 30\% of the swing phase and the smallest at 90\% (\figref{PhaseEffect}, Top). This indicates that the perturbation occurs right before heel strike is more difficult to recover than the one occurs in early swing phase possibly due to the lack of time to adjust the foot location. The difference in the stability region is approximately $28$\%. The bottom of \figref{PhaseEffect} shows the impact of the perturbation timing on COM velocity over four gait cycles. The results echo the previous finding as it shows that the agent fails to return to the steady state when the perturbation occurs later in the swing phase. \begin{comment} \begin{figure} \centering \includegraphics[width=0.8\linewidth]{images/barplots_COMVel_new.png} \vspace{2mm} \caption{Comparison of the COM velocity across gait cycles with and without use of recovery policy. Larger velocity after gait cycle 'p' indicates instability.} \end{figure} \end{comment} \begin{figure} \centering \includegraphics[width=0.8\linewidth]{images/Torques_duringp.png} \vspace{2mm} \caption{Average torques at the hip joints from $50$ trials with various perturbations. The shaded regions represent the 3-sigma bounds. \textbf{Red:} Joint torques exerted by the human and the recovery policy. \textbf{Blue:} Human joint torques without a recovery policy. \textbf{Green:} Torques produced by a recovery policy.} \label{fig:Power} \end{figure} We also compare the generated torques with and without the recovery policy when perturbation is applied. \figref{Power} shows the torques at the hip joint over the entire gait cycle (not just swing phase). We collect $50$ trajectory for each scenario by applying random forces ranging from $200$N to $800$N at the fixed timing of $30$\% of the gait cycle. The results show that hip torques exerted by the human together with the recovery policy do not change the overall torque profile significantly, suggesting that the recovery policy makes minor modification to the torque profile across the remaining gait cycle, instead of generating a large impulse to stop the fall. We also show that the torque exerted by the recovery policy never exceeds the actuation limits of the device. \begin{figure} \centering \includegraphics[width=0.8\linewidth]{images/SensorEffect.png} \caption{Stability region for six policies trained with three sensor configurations and two actuator configurations. } \label{fig:SensorEffect} \end{figure} \subsection{Evaluation of Different Design Choices} Our method can be used to inform the selection of sensors and actuators when designing a walking device with the capability of fall prevention. We test two versions of actuators: the $2$D hip device can actuate the hip joints only in the sagittal plane while the $3$D device also allows actuation in the frontal plane. We also consider three different configurations of sensors: an inertial measurement unit (IMU) that provides the COM velocity and acceleration, an motor encoder that gives us hip joint angles, and the combination of IMU and motor encoder. In total, we train six different recovery policies with three sensory inputs and two different actuation capabilities. For each sensor configuration, we train a fall predictor using only sensors available to that configuration. \figref{SensorEffect} shows the stability region for each of the six design configurations. The results indicate that 3D actuation expands the stability region in all directions significantly comparing to 2D actuation, even when the external force lies on the sagittal plane. We also found that the IMU sensor plays a more important role than the motor encoder, which suggests that COM information is more critical than the hip joint angle in informing the action for recovery. The recovery policy performs the best when combining the IMU and the joint encoder, as expected. \section{Experiments and Results} \begin{figure}[!htpb] \begin{tabular}{c c c c} \hline \includegraphics[width=0.1\textwidth,height=2cm]{images/phase0.png}& \includegraphics[width=0.1\textwidth,height=2cm] {images/phase1.png}& \includegraphics[width=0.1\textwidth,height=2cm]{images/phase3.png}& \includegraphics[width=0.1\textwidth,height=2cm]{images/phase4.png} \\ \hline \end{tabular} \caption{ This figure illustrates the 4 different timing of the left leg swing phase during which we test the performance of the exoskeleton. } \label{fig:phaseDefinition} \end{figure} \label{sec:Exp} \begin{table} \caption{Exoskeleton parameters} \centering \begin{tabular}{|l|l|} \hline Torque Limits & 30 Nm \\ \hline Sensors & IMU and Hip Joint Angle \\ \hline Sensor delay & 40 - 50 ms \\ \hline \end{tabular} \label{tab:exo} \end{table} We validate the proposed framework using the open-source physics engine DART[DART]. Our humanoid model has $29$ degrees of freedom and its weight is $80$~Kg. We also include the simulation model of the exoskeleton reported in [???], which connected to the humanoid with position constraints at hips \sehoon{something like this...}. We listed additional parameters of the exoskeleton model in \tabref{exo}. For all experiments, the simulation time step is set to $0.002$s. \begin{figure} \centering \includegraphics[width=\linewidth]{images/FootPlacements.png} \caption{Comparison of the foot placement learned by the recovery policy and predicted by the model fitted using human motion capture data in (\cite{Wang2014}). The test is performed for 4 different pushes which induces different changes in the CoM velocities. In all the 4 cases, the step lengths are close with an maximum error of 2 cm. Only sagital plane pushes were considered in these experiments.} \label{fig:manoj} \end{figure} We design experiments to systematically validate the learned human behaviors and effectiveness of the exoskeleton policy. In particular, our goal is to answer the following questions: \begin{enumerate} \item Is the learned behavior of the human policy similar to data in the bio-mechanics literature? \item Does the exoskeleton policy improve the robustness of the gaits to external pushes? \item How does the effectiveness of the exoskeleton change with design choices? \end{enumerate} \subsection{Comparison to observed human behaviour} The performance of the exoskeleton must be evaluated on the realistic human behaviors because it involves two-way coupling between the human and exoskeleton. In this section, our goal is to compare the learned human policy in \secref{human_policy}. First, we validate the steady walking behavior of the human policy by comparing it to the data reported in \cite{Winter}. \figref{Tauloops} illustrates the torque loops, the torque over joint angle, at the hip joint during a single gait cycle. We compute the torque loop of the learned policy directly using the simulation, while the ground truth data is collected by applying the inverse dynamics to the nominal human gait. Although they are not identical, both trajectories formulate loops during a single gait cycle indicating energy being added and removed during the cycle. In addition, we compare the joint angles during one cycle at the hip and knee joints (\figref{Jangles}). From the figure, we verify that the joint trajectories of the simulated human are well matched to the data reported in \cite{Winter}. In addition, we compare adjusted foot step locations due to external perturbations, which is comprehensively studied by Wang {\em{et~al.}\ } \cite{Wang2014}. Their findings strongly indicate that the COM dynamics is crucial in finding the next step placement which will help regain balance after a push. They identified a model which predicts the changes in $x$ and $y$ location of the foot placement of a normal gait, $\delta_x$ and $\delta_y$, as a function of the COM velocity. We compare this model against the foot step placements of the learned human policy. \figref{fig:manoj} illustrates the foot placements of our model and the model of Wang {\em{et~al.}\ } against four different magnitudes of pushes in the sagittal plane. For all scenarios, the displacement error is below $?.??$~cm, which indicates that the learned human policy exhibits similar behaviors to a real human. \begin{comment} \begin{figure}[th!] \centering \includegraphics[width=\linewidth]{images/TorqueLoops.png} \caption{} \label{fig:loops} \end{figure} \begin{figure}[th!] \centering \includegraphics[width=\linewidth]{images/COmpare.png} \caption{} \label{fig:JA} \end{figure} \end{comment} \subsection{Effectiveness of exoskeleton policy} To quantify the effectiveness of the exoskeleton policy in enabling recovery from an external push, we define a region of stability as shown in figure \ref{fig:exohelp}.This region, described by a polygon, defines the boundary of the maximum force applied at different angles in the x-y plane within which the policy can successfully recover. The region is computed by generating more rollouts of the policy after convergence. For every angle of push, we perform a line-search to identify the maximum force and this point becomes the vertex of the polygon. The region of stability gives us a good indication of the benefit of exoskeleton policy. Since, an external disturbance can be applied during any moment of the gait cycle, to standardize our experiments, we apply forces when the left leg is in the swing phase, as described in figure \ref{fig:phaseDefinition}. Due to this, we can notice that the area in the positive quadrant of the plots is larger. Figure \ref{fig:exohelp} illustrates the clear benefit of using an exoskeleton in aiding recovery motion. Figure \ref{fig:s} also shows one example of the recovery motion generated with the help of exoskeleton. In addition to the region of stability, figures describe the power usage of exoskeletons during the motion. The power plots help us understand the actions chosen by the exoskeleton policy that helps in successful recovery. As figure \ref{fig:Power} illustrates, the additional torques applied by the exoskeleton at the hips help in recovery. \subsection{Ablation Study} As described in the previous section, although exoskeletons help in recovering balance, it is important to study the factors that affects the performance of the exoskeleton. For example, identifying appropriate sensor information and actuation capability required to achieve best recovery performance by the exoskeleton. In our ablation study, we learn 6 different exoskeleton policies, each policy has an input and actuation chosen from three different sensor inputs and actuation capability at the hip. We choose the area of the region of stability as a measure of the performance of each policy. Larger the area then more capable the exoskeleton is of enabling recovery. Figure \ref{fig:ActuationComp} compares the performance of two types of hip exoskeletons. $2D$ hip exoskeleton can actuate the hips only in the sagital plane, where as $3D$ hip exoskeletons can actuate the hip in both the sagital and frontal plane. $3D$ hip exoskeleton has a larger region of stability. This is reasonable because the additional degree of freedom in the frontal plane enables the exoskeleton to recover from a wider range of angles. Another important factor affecting the performance of exoskeleton is the sensory input to the policy. We compare three different types of input : 1) COM velocity and acceleration and hip joint angles, 2) Only CoM velocity and acceleration and 3) Only Hip joint angles. These are the most commonly used sensory information for a exoskeleton system, because they can be measured using Inertial measurement units (IMU's) and joint angle sensors. There has been some studies on using Electromyography (EMG) sensors as input to exoskeleton controllers, but due to the difficulty in simulating EMG sensors we leave it for future work. The goal of evaluating the exoskeleton performance with different inputs is to identify the kind of sensors needed to design effective exoskeletons. We learn 6 different exoskeleton policies with 3 different sensory inputs and 2 different actuation capabilities (3D and 2D). Figure , reveals that the exoskeleton with COM information plus hip proprioception performs best, this makes intuitive sense because both these pieces of information are needed to distinguish between states that have the same COM velocity/acceleration but are at a different phase of the gait cycle. Our experiments also lead to a important observation about the learned behaviour of the exoskeleton policy. During testing, we generate the region of stability plots when the forces are being applied at 4 different phases of the left leg swing phase, these 4 different timings are shown in figure \ref{fig:phaseDefinition}. Given the constraints such as torque limits, sensing capabilities and sensing delays the exoskeleton policy performs the best at phase 1 and the worst at phase 3. Phase 3 is the stage where the left leg is just about to strike the heel, at this point it is hard for the policy to find an action to adjust to the external disturbance because of the lack of time to react. \section{INTRODUCTION} More than three million older adults every year in the United States are treated for fall injuries. In 2015, the medical costs for falls amounted to more than \$50 billion. Compounding to the direct injuries, fall-related accidents have long-lasting impact because falling once doubles one's chances of falling again. Even with successful recovery, many older adults develop fear of falling, which may make them reduce their everyday activities. When a person is less active, their health condition plummets which increases their chances of falling again. Robotic assistive walking devices or exoskeletons are designed to improve the user's ability to ambulate \cite{rubenstein}. Previous work has shown that these devices can increase the gait stability and efficiency when worn by older adults or people with disabilities \cite{Thatte2019,Wu2015,Thatte2015,GALLE2017183}. In this work, we explore the possibility to augment the existing assistive walking devices with the capability to prevent falls while respecting the functional and ergonomical constraints of the device. Designing a control policy to prevent falls on an existing wearable robotic device has multiple challenges. First, the control policy needs to run in real-time with limited sensing and actuation capabilities dictated by the walking device. Second, a large dataset of human falling motions is difficult to acquire and unavailable to public to date, which imposes fundamental obstacles to learning-based approaches. Lastly and perhaps most importantly, the development and evaluation of the fall-prevention policy depends on intimate interaction with human users. The challenge of modeling realistic human behaviors in simulation is daunting, but the risk of testing on real humans is even greater. We tackle these issues by taking the approach of model-free reinforcement learning (RL) in simulation to train a fall-prevention policy that operates on the walking device in real-time, as well as to model the human locomotion under disturbances. The model-free RL is particularly appealing for learning a fall-prevention policy because the problem involves non-differentiable dynamics and lacks existing examples to imitate. In addition, demonstrated by recent work in learning policies for human motor skills \cite{peng2018deepmimic,YuSIGGRAPH2018}, the model-free RL provides a simple and automatic approach to solving under-actuated control problems with contacts, as is the case of human locomotion. To ensure the validity of these models, we compare the key characteristics of human gait under disturbances to those reported in the biomechanics literature \cite{Winter,Wang2014}. Specifically, we propose a framework to automate the process of developing a \emph{fall predictor} and a \emph{recovery policy} on an assistive walking device, by only utilizing the onboard sensors and actuators. When the fall predictor predicts that a fall is imminent based on the current state of the user, the recovery policy will be activated to prevent the fall and deactivated when the stable gait cycle is recovered. The core component of this work is a robust \emph{human walking policy} a moderate level of perturbations. We use this human walking policy to provide training data for the fall predictor, as well as to teach the recovery policy how to best modify the person's gait to prevent falling. Our evaluation shows that the human policy generates walking sequences similar to the real-world human walking data both with and without perturbation. We also show quantitative evaluation on the stability of the recovery policy against various perturbation. In addition, our method provides a quantitative way to evaluate the design choices of assistive walking device. We analyze and compare the performance of six different configurations of sensors and actuators, enabling the engineers to make informed design decisions which account for the control capability prior to manufacturing process. \section{Method} \label{sec:method} We propose a framework to automate the process of augmenting an assistive walking device with the capability of fall prevention. Our method is built on three components: a human walking policy, a fall predictor, and a recovery policy. We formulate the problem of learning human walking and recovery policies as Markov Decision Processes (MDPs), $(\mathcal{S}, \mathcal{A}, \mathcal{T}, r, p_0, \gamma)$, where $\mathcal{S}$ is the state space, $\mathcal{A}$ is the action space, $\mathcal{T}$ is the transition function, $r$ is the reward function, $p_0$ is the initial state distribution and $\gamma$ is a discount factor. We take the approach of model-free reinforcement learning to find a policy $\pi$, such that it maximizes the accumulated reward: \begin{equation} J(\pi) = \mathbb{E}_{\mathbf{s}_0, \mathbf{a}_0, \dots, \mathbf{s}_T} \sum_{t=0}^{T} \gamma^t r(\mathbf{s}_t, \mathbf{a}_t),\nonumber \end{equation} where $\mathbf{s}_0 \sim p_0$, $\mathbf{a}_t \sim \pi(\mathbf{s}_t)$ and $\mathbf{s}_{t+1}=\mathcal{T}(\mathbf{s}_t, \mathbf{a}_t)$. We denote the human walking policy as $\pi_{h}(\vc{a}_{h}|\vc{s}_{h})$ and the recovery policy as $\pi_{e}(\vc{a}_{e}|\vc{s}_{e})$, where $\vc{s}_h$, $\vc{a}_h$, $\vc{s}_e$, and $\vc{a}_e$, represent the corresponding states and actions, respectively. Our method can be applied to assitive walking devices with any sensors or actuators, though we assume that the observable state $\vc{s}_{e}$ of the walking device is a subset of the full human state $\vc{s}_{h}$ due to sensor limitations. Since our method is intended to augment an assistive walking device, we also assume that the user who wears the device is capable of walking. Under such an assumption, our method only needs to model normal human gait instead of various pathological gaits. \begin{figure} \centering \setlength{\tabcolsep}{1pt} \renewcommand{\arraystretch}{0.7} \begin{tabular}{c c} \includegraphics[width=0.19\textwidth,height=3cm]{images/SimEnv.png}& \includegraphics[width=0.19\textwidth,height=3cm]{images/Exodesign.png} \\ \end{tabular} \caption{\textbf{Left :} We model a 29-Degree of Freedom(DoF) humanoid and the 2-DoF exoskeleton in PyDart. \textbf{Right :} Assistive device design used in our experiments. } \label{fig:Dart} \end{figure} \subsection{Human Walking Policy} \label{sec:human_policy} We take the model-free reinforcement learning approach to developing a human locomotion policy $\pi_{h}(\vc{a}_{h}|\vc{s}_{h})$. To achieve natural walking behaviors, we train a policy that imitates the human walking reference motion similar to Peng {\em{et~al.}\ } \cite{peng2018deepmimic}. The human 3D model (agent) consists of $23$ actuated joints with a floating base as shown in \figref{Dart}. This gives rise to a $53$ dimensional state space $\vc{s}_{h} = [\vc{q},\vc{\dot{q}},\vc{v}_{com}, \boldsymbol{\omega}_{com},\phi]$, including joint positions, joint velocities, linear and angular velocities of the center of mass (COM), and a phase variable that indicates the target frame in the motion clip. We model the intrinsic sensing delay of a human musculoskeletal system by adding a latency of $40$ milliseconds to the state vector before it is fed into the policy. The action determines the target joint angles $\vc{q}_t^{target}$ of the proportional-derivative (PD) controllers, deviating from the joint angles in the reference motion: \begin{equation} \label{eq:action} \vc{q}^{target}_{t} = \hat{\vc{q}}_{t}(\phi) + \vc{a}_{t}, \end{equation} where $\hat{\vc{q}}_{t}(\phi)$ is the corresponding joint position in the reference motion at the given phase $\phi$. Our reward function is designed to imitate the reference motion: \begin{multline} \label{eqn:reward} r_{h}(\vc{s}_{h},\vc{a}_{h}) = w_{q}(\vc{q} - \hat{\vc{q}}(\phi)) \\ + w_{c}(\vc{c} - \hat{\vc{c}}(\phi)) + w_{e}(\vc{e} - \hat{\vc{e}}(\phi)) - w_{\tau}||\boldsymbol{\tau}||^{2}, \end{multline} where $\hat{\vc{q}}$, $\hat{\vc{c}}$, and $\hat{\vc{e}}$ are the desired joint positions, COM positions, and end-effector positions from the reference motion data, respectively. The reward function also penalizes the magnitude of torque $\boldsymbol{\tau}$. We use the same weight $w_{q} = 5.0$, $w_{c} = 2.0$, $w_{e} = 0.5$, and $w_{\tau} = 0.005$ for all experiments. We also use early termination of the rollouts, if the agent's pelvis drops below a certain height, we end the rollout and re-initialize the state. Although the above formulation can produce control policies that reject small disturbances near the target trajectory, they often fail to recover from perturbations with larger magnitude, such as those encountered during locomotion. It is critical to ensure that our human walking policy can withstand the same level of perturbation as a capable real person, so that we can establish a fair baseline to measure the increased stability due to our recovery policy. Therefore, we exert random forces to the agent during policy training. Each random force has a magnitude uniformly sampled from $[0,800]\ N$ and a direction uniformly sampled from [-$\pi/2$,$\pi/2$], applied for $50$ milliseconds on the agent's pelvis in parallel to the ground. The maximum force magnitude induces a velocity change of roughly $0.5$m/sec. We also randomize the time when the force is applied within a gait cycle. Training in such a stochastic environment is crucial for reproducing the human ability to recover from a larger disturbance during locomotion. We represent a human policy as a multi-layered perceptron (MLP) neural network with two hidden layers of $128$ neurons each. The formulated MDP is trained with Proximal Policy Optimization (PPO) [PPO]. \subsection{Fall Predictor} \begin{comment} \begin{algorithm}[t] \caption{Train a Falling Predictor}\label{alg:computeThreshold} \begin{algorithmic}[1] \STATE \textbf{Input:} $\pi_{h}, \mathcal{T}, \rho = N(\boldsymbol{\mu}_\rho, \Sigma_\rho), J$ \STATE Initialize buffer $\mathcal{D}$ for training data \STATE $[{s}_1, \cdots, {s}_M] \leftarrow\ Sample\ states\ from\ N(\boldsymbol{\mu}_\rho, 1.5\Sigma_\rho)$ \STATE $[\tau_1, \cdots, \tau_M] \leftarrow$ Generate rollouts by following $\pi_{h}$ and $\mathcal{T}$ from $[{s}_1, \cdots, {s}_M]$ \STATE Compute returns for rollouts: $R_i = J(\tau_i),\; i \in [1,M]$ \label{line:computeReturn} \STATE Regress $R_i$ to the value funtion $V(s_e)$ \STATE $\bar{R} \leftarrow$ Compute average of returns for rollouts not terminated by $\mathcal{T}$ \label{line:averageReturn} \FOR{$i = 1:M$} \label{line:trainingSetBegin} \IF{$R_i > \bar{R}$} \STATE Add $(V({s}_e), 1)$ in $\mathcal{D}$ \ELSE \STATE Add $(V({s}_e), 0)$ in $\mathcal{D}$ \ENDIF \ENDFOR \label{line:trainingSetEnd} \STATE $\bar{V} \leftarrow$ Classify($\mathcal{D}$) \label{line:classify} \RETURN{$\bar{V}$} \end{algorithmic} \end{algorithm} \end{comment} Being able to predict a fall before it happens gives the recovery policy critical time to alter the outcome in the near future. We take a data-drive approach to train a classifier capable of predicting the probability of the fall in the next $40$ milliseconds. Collecting the training data from the real world is challenging because induced human falls can be unrealistic and dangerous/tedious to instrument. As such, we propose to train such a classifier using only simulated human motion. Our key idea is to automatically label the future outcome of a state by leveraging the trained human policy $\pi_h$. We randomly sample a set of states $\vc{s}_h$ and add random perturbations to them. By following the policy $\pi_h$ from each of the sampled states, we simulate a rollout to determine whether the state leads to successful recovery or falling. We then label the corresponding state observed by the walking device, $(\vc{s}_e, 1)$ if succeeds, or $(\vc{s}_e, 0)$ if fails. We collect about $50000$ training samples. Note that the input of the training data corresponds to the state of the walking device, not the full state of human, as the classifier will only have access to the information available to the onboard sensors. We train a support vector machine (SVM) classifier with radial basis function kernel to predict if a state $\vc{s}_{e}$ has a high chance of leading to a fall or not. We perform a six-fold validation test on the dataset and the classifier achieves an accuracy above $94$\%. \begin{comment} OLD TEXT :by leveraging the learned value function $V_h(\vc{s}_h)$ acquired as a byproduct while learning the human walking policy $\pi_h$. Since the output of the value function is the discounted return from the current state, it can provide valuable information for fall prediction. However, the input to $V_h(\vc{s}_h)$ is the human state $\vc{s}_h$, which is not completely observable by the onboard sensors of the assistive walking device. As such, we need to re-parameterize the value function so that it takes the state of the walking device $\vc{s}_e$ as an input. To this end, we use the human walking policy $\pi_h$ to generate a large amount of rollouts. Therefore, we take the data-driven approach that re-learns the value function $V_h(\vc{s}_e)$ by generating more roll-outs of the human policy and regressing the discounted sum of returns. $V_h(\vc{s}_e)$ is represented as a MLP neural network with 2 hidden layers of 64 nodes each. After the value function is learned, we can label states as either good $(V_h(\vc{s}_e),1)$ or bad $(V_h(\vc{s}_e),0)$ based on the success or failure of a roll-out from the policy. Once we collect the labelled data, we can then train a classifier which can be used as a fall detector. Essentially when the classifier predicts a value $0$, we can conclude that there is a high chance that the human policy will fail and needs assistance from exoskeleton. We use a simple decision tree as our classifier. \end{comment} \subsection{Recovery Policy} The recovery policy aims to utilize the onboard actuators of the assistive walking device to stabilize the gait such that the agent can continue to walk uninterruptedly. The recovery policy $\pi_e$ is trained to provide optimal assistance to the human walking policy when a fall is detected. The state of $\pi_e$ is defined as $\vc{s}_{e}=[\dot{\boldsymbol{\omega}},\boldsymbol{\omega},\vc{q}_{hip},\dot{\vc{q}}_{hip}]$, which comprises of global angular acceleration, angular velocity, and hip joint angle position and velocity, amounting to $10$ dimensional state space. The action space consists of torques at two hip joints. The reward function maximizes the quality of the gait while minimizing the impact of disturbance: \begin{equation} \label{eq:exoReward} r_{e}(\vc{s}_h,\vc{a}_e) = r_{walk}(\vc{s}_h) - w_{1}\|\vc{v}_{com}\| - w_{2}\|\boldsymbol{\omega}_{com}\| - w_3 \|\vc{a}_e\|, \end{equation} where $r_{walk}$ evaluates walking performance using Equation \ref{eqn:reward} except for the last term, and $\vc{v}_{com}$ and $\boldsymbol{\omega}_{com}$ are the global linear and angular velocities. Note that the input to the reward function includes the full human state $\vc{s}_h$. While the input to the recovery policy $\pi_e$ should be restricted by the onboard sensing capability of the assistive walking device, the input to the reward function can take advantage of the full state of the simulated world, since the reward function is only needed at training time. The policy is represented as a MLP neural network with two hidden layers of 64 neurons each and trained with PPO. \section{Related Work} \label{sec:rw} \subsection{Control of assistive devices} Many researchers have developed control algorithms for robotic assistive walking devices. As reported by Yan {\em{et~al.}\ }~\cite{YAN2015120}, existing methods can be broadly classified into trajectory tracking controllers \cite{Wangpre2015,JezPre2004,BlayaPre} and model-based controllers \cite{WickModel,KazModel,vanderkooijModel}. Although trajectory tracking approaches can be easily applied to regular walking cycles, it is unclear how to generate trajectories for unexpected situations due to perturbations. On the other hand, model-based controllers can capture adaptive behaviors by developing control laws with respect to external perturbations but they often require an accurate dynamic model. Based on neuromuscular model of human lower limbs, Thatte et al \cite{Thatte2015,Thatte2017} presented an optimization-based framework which converges better than other control strategies, such as quasi-stiffness control \cite{lenzi}, minimum jerk swing control \cite{lenziminjerk}, virtual constraint control \cite{Greggvirtual} and impedance control \cite{supimpedence}. However, all of these methods focused on controlling regular walking cycles rather than adjusting to external perturbations. More recently, Thatte {\em{et~al.}\ } \cite{Thatte2019} presented a real-time trip avoidance algorithm which estimates future knee and hip positions using a Gaussian filter and updates a trajectory using a fast quadratic program solver. \subsection{Deep RL for assistive devices} Many researchers have demonstrated learning effective policies for high-dimensional control problems using deep reinforcement learning (deep RL) techniques \cite{schulman2015trust,schulman2017proximal}. However, there has been limited work at the intersection of deep RL and control of assistive devices. Hamaya {\em{et~al.}\ } \cite{HAMAYA201767} presented model-based reinforcement learning algorithm to train a policy for a handheld device that takes muscular effort measured by electromyography signals (EMGs) as inputs. The work requires collecting user interaction data on the real-world device to build a model of the user's EMG patterns. However, collecting a large amount of data for lower-limb assistive devices is less practical due to the safety concerns. Another recent work, Bingjing {\em{et~al.}\ } \cite{Bingjing2019}, developed an adaptive-admittance model-based control algorithm for a hip-knee assistive device, the reinforcement learning aspect of this work focused on learning parameters of the admittance model. Our method is agnostic to the assistive walking devices and can be used to augment any device that allows for feedback control. \subsection{Simulating human behaviors} Our recovery policy assumes that the person is able to walk under a moderate level of perturbation, similar to the real healthy people or people assisted by a walking device. The early work of Shiratori {\em{et~al.}\ } \cite{Shiratori2009} developed a trip recovery controller during walking from motion capture data. However, it requires careful analysis of human responses to design state machines. Recently, deep RL techniques have been proven to be effective for developing control policies that can reproduce natural human behaviors in simulated environments. The proposed techniques vary from formulating a reward function from motion capture data \cite{peng2018deepmimic}, to training a low-energy policy with curriculum learning \cite{YuSIGGRAPH2018}, to developing a full-body controller for a muscular-skeleton model \cite{Lee:2019:SMH:3306346.3322972}, to modeling biologically realistic torque limits \cite{Jiang:2019:SBR:3306346.3322966}. Particularly, our work is inspired by the DeepMimic technique proposed by Peng {\em{et~al.}\ } \cite{peng2018deepmimic} which produces a visually pleasing walking gait by mimicking the reference motion and shows stable control near the target trajectory. \subsection{Human responses to perturbations} Our framework relies on accurate modelling of human motions, particularly in response to external perturbations. Researchers in biomechanics studied postural responses of human bodies to falling and slipping incidents and identified underlying principles \cite{Lockhart2012,Moyer2009}. Connor {\em{et~al.}\ } \cite{connor09} and Hof {\em{et~al.}\ } \cite{Hof} also studied balancing strategies of humans for rejecting medial-lateral perturbations during walking. Particularly, we validate the learned human policy by comparing its footstep placement against the data collected by Wang {\em{et~al.}\ } \cite{Wang2014}, which reports a strong correlation between the pelvic states and the next footstep locations. \section{Results} \label{sec:results}
\section{Introduction} Sequence to sequence (seq2seq) learning models \cite{NIPS2014_5346} using an encoder decoder framework have been a popular choice for the task of machine translation before the recent popularity of transformer models \cite{NIPS2017_7181}. Several recent works \cite{bahdanau2014neural,DBLP:journals/corr/LuongPM15,Zhao2018AttentionviaAttentionNM,shankar-etal-2018-surprisingly} aims to improve the translation performance of seq2seq models by formulating new attention mechanisms to capture similarity between the encoder and decoder states. Recent works \cite{zhang-etal-2017-boosting}\cite{van-der-wees-etal-2017-dynamic} \cite{wang-etal-2018-dynamic} suggests that apart from attention mechanisms, data ordering patterns also affect the performance of neural machine translation. In this work we aim to empirically analyze the performance improvements of different data ordering patterns of the training data on the English-Vietnamese translation task. Curriculum learning \cite{Bengio:2009:CL:1553374.1553380} proposes that choosing an ordering of the training samples from easier to learn examples to harder to learn examples can help train better models and achieve faster convergence. We take insights from curriculum learning and evaluate approaches to rank the training data based on complexity using several different metrics. We empirically observe that a pre-fixed data ordering pattern based on sorted perplexity scores from a pre-trained model is able to outperform the default approach of randomly shuffling data every epoch and gets a 1.7 BLEU score improvement. We also perform experiments to analyze the effect of these ranking metrics from different pre-trained models and conclude that a shallow architecture suffices to achieve performance gains by providing an efficient data ordering pattern. The remaining paper is structured by first describing the related work, followed by the different proposed data ordering patterns and experimental results and concluding by briefly describing future work extensions and conclusion from this study. \section{Related Work} Curriculum learning has been studied and applied to various Machine Learning and Natural Language Processing tasks \cite{tsvetkov-etal-2016-learning} \cite{DBLP:journals/corr/CirikHM16} \cite{pmlr-v70-graves17a}. Most training protocols for Neural Machine Translation randomize the order of sentence pairs in the training corpus \cite{sennrich-etal-2017-nematus} \cite{DBLP:journals/corr/abs-1712-05690}. One of the initial studies carried out by \newcite{kocmi-bojar-2017-curriculum} proposed a curriculum learning based mini bucketing approach using sequence length, number of coordinating conjunctions and word ranks by ensuring that samples within each mini-batch have similar linguistic properties. They show that translation quality can be improved by presenting samples from easy to hard based on sentence length and vocabulary frequency. \newcite{zhang-etal-2017-boosting} propose a data boosting and bootstrap paradigm using a probabilistic approach which assigns higher weights to training examples that have lower perplexities in previous epoch. Similarly, \newcite{van-der-wees-etal-2017-dynamic,wang-etal-2018-dynamic} improve the training efficiency of NMT by dynamically selecting different subsets of training data between different epochs using domain relevance and difference between the training costs of two iterations respectively. \newcite{DBLP:journals/corr/abs-1811-00739} propose to split the training samples into a predefined number of bins based on varied difficulty metrics like maximum and average word frequency rank. \newcite{DBLP:journals/corr/abs-1903-09848} uses a difficulty and competence based metric for faster convergence and better performance than uniformly sampling training examples. Our approach differs from these recent works in the main aspect that the model can access the entire training data in each epoch in our approach as compared to other techniques which partition the training data set and provide a different portion of the training data to the model each epoch. \section{Data Ordering Patterns} Neural Machine Translation using seq2seq learning models uses mini-batches of data for training and typically requires multiple passes over the training data to reach convergence. The default baseline strategy used for training the models is using a random shuffle of the training data every epoch. Traditional curriculum learning approaches propose breaking the training data into groups based on the training data complexity and using these groups of training order in a sequential order from lower to higher complexity. Our approach just re-orders the training data and the model can access the whole training data in every epoch as contrasted to curriculum learning where it accesses specific portions of the training data in different training epochs. Each train data point is a pair of sentences: one in the source and the other is the corresponding translation in the target language. We propose 4 different ordering strategies for the training data where this order is fixed before the training starts and mini-batches are chosen from this ordered training data sequentially. No random shuffling of training data is carried out every epoch when using these data patterns. We do not disturb the sentences within a pair in any of our strategies, but rather just re-order different pairs. The following data patterns are proposed: \begin{itemize} \item \textbf{Random Shuffle:} Randomly shuffle the training data points. This results in a model which shuffles the training data only once before training starts. \item \textbf{Sequence Length Order:} Sort the training data based on the length of the sentences of the source or target language. There are 2 orders hence obtained: sorted in ascending and descending order of lengths for each of the source and target sentences. \item \textbf{Perplexity based Order:} Sort the training data based on perplexity scores of each training data pairs from a pre-trained model $M$. For the purpose of optimization, if the cross-entropy of sentence pairs is denoted by $H(p)$, the perplexity is defined as $2^{H(p)}$. This results in 2 orderings: sorted in ascending and descending order of perplexity scores. \item \textbf{BLEU based Order:} Sort the training data based on BLEU score \cite{Papineni:2002:BMA:1073083.1073135} of each training data pairs from a pre-trained model $M$. This results in 2 orderings: sorted in ascending and descending order of BLEU scores \end{itemize} For the perplexity and BLEU score based ordering, we use a pre-trained model on the same training corpus. We experiment with using different pre-trained models to analyze the impact on the performance. The experiments and results are presented in the next section. \section{Experiments} \begin{table*}[h] \begin{centering} \begin{tabular}{|c|c|c|c|} \hline Data Ordering Pattern & Epochs & Test PPL & Test BLEU \\ \hline Random Shuffle every epoch & 32 & 16.55 & \textbf{18.1} \\ \hline Random Shuffle once & 30 & 18.78 & 18.0 \\ \hline Ascending Sequence Length Order for source language & 15 & 24.02 & 16.6 \\ \hline Descending Sequence Length Order for source language & 31 & 20.31 & 17.1 \\ \hline Ascending Sequence Length Order for target language & 23 & 29.64 & 15.6 \\ \hline Descending Sequence Length Order for target language & 29 & 23.66 & 16.8 \\ \hline Ascending PPL Order (From Pre-trained base model) & 32 & 14.69 & \textbf{19.8} \\ \hline Descending PPL Order (From Pre-trained base model) & 31 & 15.28 & 19.1 \\ \hline Ascending BLEU Order (From Pre-trained base model) & 31 & 15.46 & 18.9 \\ \hline Descending BLEU Order (From Pre-trained base model) & 29 & 15.78 & 18.6 \\ \hline \end{tabular} \caption{Effect of different data ordering patterns on the performance on the IWSLT Vietnamese test set. Random shuffle every epoch refers to the default approach of randomly shuffling the data every epoch. Random Shuffle once refers to randomly shuffling the data once before the training starts. PPL refers to perplexity. Epochs refers to number of epochs required for convergence. } \label{table:results} \end{centering} \end{table*} \subsection{Training Details and Hyper-parameters} \label{models} We use an encoder-decoder architecture with Bahdanau attention \cite{bahdanau2014neural} using two layers of 512 units of LSTM encoder and decoder with a 0.2 dropout. We refer to this as the base model when presenting the results. We also experiment with a smaller architecture of the encoder-decoder framework using just 1 layer of 128 unit LSTM encoder and two layers of 128 unit LSTM decoder without attention having a 0.2 dropout probability and refer to this as the small model. The model was trained using an Adam \cite{Kingma2014AdamAM} optimizer with a learning rate of ${10}^{-5}$ . Training was performed on a 12GB Titan-X GPU using a batch size of 128. We use the BLEU score on the test data as the metric to evaluate the performance. \subsection{Dataset} \label{dataset} For our experiments we used the standard IWSLT 2015 English-Vietnamese language data set \cite{Cettolo2015TheI2} which has around 133k training sentence pairs. We sample 60k training samples from the training data by filtering out duplicates and sentences of sequence lengths more than 60 and less than 5 to have a consistent evaluation between the different data shuffling patterns. We use the original validation and test data splits for the experiments. Since our experiments aim to empirically contrast the performance of the different data ordering strategies, we do not use an ensemble of seq2seq models and use greedy decoding instead of beam-decoding (which adds to the memory consumed and the training time of the model). Hence our BLEU scores are typically lower than the state of the art performance of 26.1 on this task. \subsection{Results} We present the experimental results using different data ordering patterns of the training data in table \ref{table:results}. Randomly shuffling the data once before training can achieve a comparable BLEU score to the default technique used for seq2seq model training of randomly shuffling the training data every epoch, but the model with shuffling every epoch achieves a considerably lower test perplexity than with a single shuffle of the training data. A simple curriculum learning based approach of sorting the source language sentences based on their lengths performs considerably inferior to a randomly sorted ordering. Sorting based on the target language sentences length performs better than sorting based on the source language sentences lengths but is still not comparable to the random shuffling performance. This can possibly because of the optimizer getting stuck at a local optima and converging earlier rather than finding the global optima as is evidenced by the small number of epochs required for convergence. Using data ordering patterns sorted on metrics like perplexity and BLEU outperforms the default approach of randomly shuffling the data. Perplexity and BLEU are the most commonly used estimators of the complexity of a sentence pair to be translated correctly by a translation model. A sentence pair having a lower perplexity or BLEU score than another from a pre-trained model implies that the first sentence pair was easier for the model to translate than the latter. From the table it is empirically observed that using an ascending order sorted approach performs the best and gets an improvement in BLEU score of 1.7 points from the default setting. We conjecture this is because the model first accesses less complex examples followed by more complex examples in line with the idea of curriculum learning. The interesting observation made here is that a descending order sorted training data schedule based on perplexity or BLEU also outperforms the default setting of random shuffling though the model accesses training data samples from more complex to less complex. This idea is slightly in contrast to the curriculum learning approach of providing the model with training examples in increasing order of complexity. \subsection{Comparison across models} \label{compare_models} We evaluate the performance of the data ordering sorted based on perplexity and BLEU score from 2 different pre-trained models and show empirically that a smaller trained model is able to provide comparable performance gains to a larger trained model for these 2 data ordering strategies. The base and small models have been explained in section \ref{models}. The results are presented in table \ref{table:diff_models} From these results, we can infer that even a smaller trained model can give a good estimate of the training data sentence pair complexities through perplexity and BLEU metrics. Also this shows that the improvements in performance due to these specific data orderings can be generalized across different models. We also note that perplexity based ascending order is the best performing approach. \begin{table}[h] \resizebox{\linewidth}{!}{ \begin{tabular}{|c|c|c|c|} \hline Pre-Trained Model & Data Pattern & Epochs & BLEU \\ \hline \multirow{4}{*}{Small Model} & Asc PPL & 31 & 19.7 \\ \cline{2-4} & Desc PPL & 30 & 19.1 \\ \cline{2-4} & Asc BLEU & 32 & 18.9 \\ \cline{2-4} & Desc BLEU & 31 & 18.5 \\ \hline \multirow{4}{*}{Base Model} & Asc PPL & 32 & 19.8 \\ \cline{2-4} & Desc PPL & 31 & 19.1 \\ \cline{2-4} & Asc BLEU & 31 & 18.9 \\ \cline{2-4} & Desc BLEU & 29 & 18.6 \\ \hline \end{tabular} } \caption{Comparing performance of data ordering patterns based on sorted perplexity and BLEU score from 2 different pre-trained models. Here PPL, Asc and Desc refer to perplexity, ascending order and descending order respectively. Epochs refers to number of epochs required for convergence.} \label{table:diff_models} \end{table} \section{Ongoing and Future Work} Ongoing work includes verifying this conjecture on the seq2seq framework for other machine translation datasets like English-German and English-French datasets. An extension of this work is to empirically verify if using a transformer based architecture can still provide similar gains from using a perplexity sorted ordering of the training data from a pre-trained model. Results from section \ref{compare_models} show that a small model can be used to rank the training data points and this can then be used for improving the performance of a model trained on this data. This shows a promising future direction of work of making a NMT pipeline involving a low-resource model which can be trained fast and in a computationally inexpensive way for ranking the training data points and a larger model which can exploit this ranked order and produce performance improvements for machine translation. \section{Conclusion} From this study, we conclude that data ordering patterns can have an effect on the model performance for neural machine translation. While simple heuristics like sentence length actually lead to a drop in model performance, heuristics specific to evaluating NMT performance like perplexity and BLEU score can be good measures to rank the data for training and get performance gains over the default approach of randomly sampling data points for training.
\subsection{Definition of Execution Semantics Equivalence} \label{subsec:equivalence} \input{equivalence} \subsection{Proof of Execution Semantics Equivalence} \label{subsec:proof} \input{proof} \subsection{Simplified Cardiac Arrest Treatment Scenario} \label{subsec:cardiacExp} Cardiac arrest is the abrupt loss of heart function and can lead to death within minutes. In a simplified cardiac arrest treatment scenario~\cite{WuTreatment2014}, medical staff intend to activate a defibrillator to deliver a therapeutic level of electrical shock that can correct certain types of deadly irregular heart-beats such as ventricular fibrillation. The medical staff need to check two preconditions: (1) patient's airway and breathing are under control and (2) the electrocardiogram (ECG) monitor shows a shockable rhythm. Suppose the patient's airway is open and breathing is under control, but the ECG monitor shows a non-shockable rhythm. In order to induce a shockable rhythm, a drug, called epinephrine (EPI), is commonly given to increase cardiac output. Giving epinephrine, however, also has two preconditions: (1) patient's blood pH value should be larger than 7.4 and (2) urine flow rate should be greater than 12 mL/s. In order to correct these two preconditions, sodium bicarbonate should be given to raise blood pH value, and intravenous (IV) fluid should be increased to improve urine flow rate. The simplified cardiac arrest treatment scenario has two safety properties: (1) \textbf{P1:} the defibrillator is activated only if the ECG rhythm is shockable and breathing is normal; and (2) \textbf{P2:} the epinephrine is injected only if the blood pH value is larger than 7.4 and urine flow rate is higher than 12 mL/s. \subsection{Model Validation and Verification} \label{subsec:cardiacModel} Wu~\textit{et al.}\ developed a validation protocol to enforce the correct execution sequence of performing treatment, regarding preconditions validation, side effects monitoring, and expected responses checking based on the pathophysiological models~\cite{WuTreatment2014}. We use Yakindu\ statecharts~\cite{yakindu} to model the simplified cardiac arrest treatment procedure with the validation protocol~\cite{WuTreatment2014}, as depicted in Fig.~\ref{fig:cardiacY}. The statechart model consists of six statecharts: $\mathtt{Treatment}$, $\mathtt{Ventilator}$, $\mathtt{EPIpump}$, $\mathtt{SodiumBicarbonatePump}$, $\mathtt{IVpump}$, and $\mathtt{LasixPump}$. The statecharts communicate using events and shared variables. The $\mathtt{Treatment}$ statechart implements the simplified cardiac arrest treatment procedure. The other statecharts implement treatment actions, such as medicine injection. \begin{figure*}[ht] \centering \includegraphics[width =0.99\textwidth]{fig/cardiacY-full} \caption{Simplified Cardiac Arrest Treatment Statechart Model} \label{fig:cardiacY} \end{figure*} We use the Y2U\footnote{The Y2U\ tool is available in \url{www.cs.iit.edu/~code/software/Y2U}.} tool to transform the simplified cardiac arrest treatment statechart model given in Fig.~\ref{fig:cardiacY} to timed automata to formally verify safety properties \textbf{P1} and \textbf{P2}. The transformed simplified cardiac arrest treatment timed automata model is depicted in Fig.~\ref{fig:cardiacU}. \begin{figure*}[ht] \centering \includegraphics[width = 0.99\textwidth]{fig/cardiacU-full} \caption{Simplified Cardiac Arrest Treatment Timed Automata Model} \label{fig:cardiacU} \end{figure*} The safety properties \textbf{P1} and \textbf{P2} are specified by CTL (computation tree logic) formula~\eqref{eq:P1} and formula~\eqref{eq:P2}, respectively. \begin{align} \label{eq:P1} \begin{split} &A[~] \ \mathtt{Treatment.ActivateDefibrillaotr} \ imply \\ &\qquad \mathtt{Breath} == 0 \ \&\& \ \mathtt{Rhythm} == 0 \end{split} \end{align} \begin{align} \label{eq:P2} \begin{split} &A[~] \ \mathtt{Treatment.InjectEPI} \ imply \\ &\qquad (\mathtt{BloodPH_{int}}>7 \ || \ (\mathtt{BloodPH_{int}}==7) \ \&\& \\ &\qquad \mathtt{BloodPH_{frac}}>4) \ \&\& \ (\mathtt{UrineFlow_{int}}>12 \ || \\ &\qquad (\mathtt{UrineFlow_{int}}==12 \ \&\& \ \mathtt{UrineFlow_{frac}}>0) ) \end{split} \end{align} Note that UPPAAL\ timed automata do not support real numbers and strings. For a string, we represent it by an integer variable with a dictionary which maps integer values to string values. For instance, in formula~\eqref{eq:P1}, $\mathtt{Breath} == 0$ and $\mathtt{Rhythm} == 0$ indicate the patient breathing is normal and the ECG rhythm is shockable, respectively. To represent a real number in UPPAAL\ timed automata, we use two integers to represent its integer part and fraction part, respectively. For example, in formula~\eqref{eq:P2}, $\mathtt{BloodPH_{int}}$ and $\mathtt{BloodPH_{frac}}$ represent the integer and fraction parts of the patient's blood pH value, respectively. We first run simulations on the simplified cardiac arrest treatment statecharts through Yakindu\ to validate safety properties \textbf{P1} and \textbf{P2}. The simulation results through Yakindu\ show that both safety properties \textbf{P1} and \textbf{P2} are satisfied. We then verify the two safety properties represented by formula~\eqref{eq:P1} and formula~\eqref{eq:P2} in UPPAAL. The verification results also show that both \textbf{P1} and \textbf{P2} hold. To validate the proposed approach, we inject an error into the simplified cardiac arrest treatment statechart model shown in Fig.~\ref{fig:cardiacY} as follows: change the guard of transition, which transits from state $\mathtt{InjectEPIPre}$ to state $\mathtt{InjectEPI}$, from $\mathtt{BloodPH} > 7.4 \ \&\& \ \mathtt{UrineFlow} >12$ to $\mathtt{BloodPH} > 7.4 \ \&\& \ \mathtt{UrineFlow} >10$. The injected error should fail the safety property \textbf{P2}. We re-transform the statechart model with the injected error to timed automata and verify the safety properties \textbf{P1} and \textbf{P2} through UPPAAL. The verification results show that the safety property \textbf{P1} still holds, while the safety property \textbf{P2} fails. \section{Introduction} \label{sec:intro} \input{intro} \section{Execution Semantics of Basic Yakindu\ Statecharts} \label{sec:formalism} \input{formalism} \section{Transformations from Statecharts to Timed Automata} \label{sec:y2u} \input{y2u} \section{Execution Semantic Equivalence between Statecharts and Transformed Timed Automata} \label{sec:correctness} \input{correctness} \section{Simplified Cardiac Arrest Treatment Case Study} \label{sec:exp} \input{exp} \section{Related Work} \label{sec:related} \input{related} \section{Conclusion} \label{sec:conclusion} \input{conclusion} \begin{acks} \input{acknowledgement} \end{acks} \bibliographystyle{ACM-Reference-Format} \subsubsection{Initialization} \label{subsubsec:initial} \text{} \textbf{Rule~\ref{rule:initial}: Initialization.} Both Yakindu\ statecharts and UPPAAL\ timed automata have \textit{state} elements (called \textit{location} in UPPAAL\ timed automata), \textit{transition} elements (called \textit{edge} in UPPAAL\ timed automata), and \textit{variables}. We initialize a network of UPPAAL\ timed automata by one-to-one mapping \textit{states}, \textit{transitions}, and \textit{variables} in the given Yakindu\ statecharts to \textit{locations}, \textit{edges}, and \textit{variables}, respectively. The formalism of the initialization rule is defined in Rule~\ref{rule:initial}. We use Example~\ref{ex:initial} to explain the initialization rule. \begin{myrule}[Initialization Rule] \label{rule:initial} Given a network of basic Yakindu\ statecharts $\mathcal{Y}=\{ (Y_i, \rho_i) | Y_i = (S_i, s^0_i, T_i, G_i, A_i,\\ V, \Gamma_i, \Delta_{\mathtt{in}}^i, \Delta_{\mathtt{out}}^i) \wedge 1 \le i \le n \}$, for each basic Yakindu\ statechart $Y_i \in \mathcal{Y}$, create a UPPAAL\ timed automaton $U_i = (Y_i(S_i), Y_i(s^0_i), Y_i(T_i), \emptyset, \emptyset, V, \emptyset, \emptyset)$ and denote $\automataSetStep{1} = \{ U_i | 1 \le i \le n \}$ as the network of UPPAAL\ timed automata after initialization. \end{myrule} \begin{example} \label{ex:initial} We initialize a UPPAAL\ timed automata model $\automataSetStep{1}$ for the statechart model shown in Fig.~\ref{fig:stEx}, i.e., $\mathcal{Y}=\{ (Y_1, 1), (Y_2, 2) \}$ specified in Example~\ref{ex:stEx}. Fig.~\ref{fig:initialEx} depicts the initialized timed automata model. In UPPAAL\ GUI, the initial location is depicted by a double circle. \begin{figure}[ht] \centering \includegraphics[width = 0.7\textwidth]{fig/initialEx.png} \caption{Timed Automata Model after Initialization} \label{fig:initialEx} \end{figure} According to Rule~\ref{rule:initial}, for statechart $Y_1$, we create a timed automaton $U_1 = (S_{\mathtt{u}}^1, s^1_0, T_{\mathtt{u}}^1, \emptyset, \emptyset, V_{\mathtt{u}}, \emptyset, \emptyset)$ by one-to-one mapping states, transitions, and variables of $Y_1$, i.e., $S_{\mathtt{u}}^1 = S_{\mathtt{y}}^1 = \{ s_0^1, s_1, s_2 \}$, $T_{\mathtt{u}}^1 = \{ t_{\mathtt{u}}^1,t_{\mathtt{u}}^2,t_{\mathtt{u}}^3,t_{\mathtt{u}}^4 \}$, $t_{\mathtt{u}}^1 = (s_0^1, \mathtt{NULL}, \mathtt{NULL}, \mathtt{NULL}, s_1)$, $t_{\mathtt{u}}^2 = (s_1, \mathtt{NULL}, \mathtt{NULL}, \mathtt{NULL}, s_2)$, $t_{\mathtt{u}}^3 = (s_2, \mathtt{NULL}, \mathtt{NULL}, \mathtt{NULL}, s_1)$, $t_{\mathtt{u}}^4 = (s_2, \mathtt{NULL}, \mathtt{NULL}, \mathtt{NULL},\\ s_2)$, and $V_{\mathtt{u}} = V_{\mathtt{y}} = \{ x, \mathtt{eventA} \}$. Similarly, we create a timed automaton $U_2 = (S_{\mathtt{u}}^2, s^0_2, T_{\mathtt{u}}^2, \emptyset, \emptyset, V_{\mathtt{u}}, \emptyset, \emptyset)$ for statechart $Y_2$, where $S_{\mathtt{u}}^2 = \{ s_0^2, s_3, s_4 \}$, $T_{\mathtt{u}}^2 = \{ t_{\mathtt{u}}^5, t_{\mathtt{u}}^6, t_{\mathtt{u}}^7 \}$, $t_{\mathtt{u}}^5 = (s_0^2, \mathtt{NULL}, \mathtt{NULL}, \mathtt{NULL}, s_3)$, $t_{\mathtt{u}}^6 = (s_3, \mathtt{NULL}, \mathtt{NULL}, \mathtt{NULL}, s_4)$, and $t_{\mathtt{u}}^7 = (s_4, \mathtt{NULL}, \mathtt{NULL}, \mathtt{NULL}, s_3)$. Hence, the timed automata model after initialization is $\automataSetStep{1} = \{ U_1, U_2 \}$. \end{example} \subsubsection{Essential Elements Transformation} \label{subsubsec:basicRule} \text{} \textbf{Rule~\ref{rule:action}: Action Transformation.} Yakindu\ statecharts support both guard actions and state actions, while UPPAAL\ timed automata only support guard actions. Yakindu\ statecharts have two types of state actions, \textit{entry action} and \textit{exit action}, which are carried out on entering or exiting a state, respectively. The \textit{entry} and \textit{exit} actions of a state are transformed into actions of all incoming and outgoing transitions of the state, respectively. The formalism of the action transformation rule is defined in Rule~\ref{rule:action}. We use Example~\ref{ex:action} to explain the action transformation rule. \begin{myrule}[Action Transformation Rule] \label{rule:action} Given a network of basic Yakindu\ statecharts $\mathcal{Y}=\{ (Y_i, \rho_i) | Y_i = (S_i, s^0_i, T_i, G_i, A_i, V, \Gamma_i, \Delta_{\mathtt{in}}^i, \Delta_{\mathtt{out}}^i) \wedge 1 \le i \le n \}$ and the network of UPPAAL\ timed automata $\automataSetStep{1} = \{ U_i | U_i = (S_i, s^0_i, T_i, \emptyset, \emptyset, V, \emptyset, \emptyset) \wedge 1 \le i \le n \}$ after initialization, let $t_{\mathtt{y}}$ denote a transition in statechart $Y_i$ and $t_{\mathtt{u}}$ be $t_{\mathtt{y}}$'s corresponding edge in the time automata $U_i$, let $\state^{\mathtt{in}}_{t_{\mathtt{y}}}$ and $\state^{\mathtt{out}}_{t_{\mathtt{y}}}$ denote the source state and the destination state of transition $t_{\mathtt{y}}$, respectively, and $s(\action_{\mathtt{in}})$ and $s(\action_{\mathtt{out}})$ denote the entry actions and exit actions of state $s$ in statechart $Y_i$, respectively, and let $<a_1; a_2>$ denote that the two actions $a_1$ and $a_2$ are executed sequentially and atomically, we set each edge $t_{\mathtt{u}}$'s action in UPPAAL\ timed automata $U_i$ with an atomic action that consists of exit actions of $t_{\mathtt{y}}$'s source state $\state^{\mathtt{in}}_{t_{\mathtt{y}}}(\action_{\mathtt{out}})$, transition $t_{\mathtt{y}}$'s action $t_{\mathtt{y}}(a)$, and entry actions of $t_{\mathtt{y}}$'s destination state $\state^{\mathtt{out}}_{t_{\mathtt{y}}}(\action_{\mathtt{in}})$ in sequence, i.e., \begin{align*} \begin{split} \forall Y_i \in \mathcal{Y}: \forall t_{\mathtt{y}} \in Y_i(T_i): t_{\mathtt{u}}(a) := <\state^{\mathtt{in}}_{t_{\mathtt{y}}}(\action_{\mathtt{out}}); t_{\mathtt{y}}(a); \state^{\mathtt{out}}_{t_{\mathtt{y}}}(\action_{\mathtt{in}})> \end{split} \end{align*} We use $\automataSetStep{2} = \{ U_i | U_i = (S_i, s^0_i, T_i, \emptyset, \{t_{\mathtt{u}}(a) | t_{\mathtt{u}} \in T_i \}, V, \emptyset, \emptyset) \wedge 1 \le i \le n \}$ to denote the network of UPPAAL\ timed automata after the action transformation. \end{myrule} \begin{example} \label{ex:action} We transform actions in the statechart model $\mathcal{Y}$ specified in Example~\ref{ex:stEx} and update the timed automata model $\automataSetStep{1}$ initialized in Example~\ref{ex:initial}. Fig.~\ref{fig:actionEx} depicts the timed automata model after action transformation. \begin{figure}[ht] \centering \includegraphics[width = 0.7\textwidth]{fig/actionEx.png} \caption{Timed Automata Model after Action Transformation} \label{fig:actionEx} \end{figure} We take the transition $t_{\mathtt{y}}^3 = (s_2, x>0, x=0, 1, s_1)$ of statechart $Y_1$ as an example to illustrate the action transformation rule. The action on transition $t_{\mathtt{y}}^3$ is $x=0$, i.e., $t_{\mathtt{y}}^3(a) \equiv x=0$. The exit action of transition $t_{\mathtt{y}}^3$'s source state $s_2$ is $x=2$, i.e., $\state^{\mathtt{in}}_{t_{\mathtt{y}}^3}(\action_{\mathtt{out}}) \equiv x=2$. The entry action of transition $t_{\mathtt{y}}^3$'s destination state $s_1$ is $x=5$, i.e., $\state^{\mathtt{out}}_{t_{\mathtt{y}}^3}(\action_{\mathtt{in}}) \equiv x=5$. According to Rule~\ref{rule:action}, the action of transition $t_{\mathtt{u}}^3$ in timed automaton $U_1$ is $<x=2; x=0; x=5>$, i.e., $t_{\mathtt{u}}^3 = (s_2, \mathtt{NULL}, <x=2; x=0; x=5>, \mathtt{NULL}, s_1)$, which is marked by a red rectangle in Fig.~\ref{fig:actionEx}. Similarly, we update transitions $t_{\mathtt{u}}^1$ and $t_{\mathtt{u}}^4$ as $t_{\mathtt{u}}^1 = (s_0^1, \mathtt{NULL}, x=5, \mathtt{NULL}, s_1)$ and $t_{\mathtt{u}}^4 = (s_2, \mathtt{NULL}, x=2, \mathtt{NULL}, s_2)$. The action set of timed automaton $U_1$ is updated to be $A_{\mathtt{u}}^1 = \{ <x=2; x=0; x=5>, x=5,x=2 \}$. All other elements of timed automaton $U_1$ are not changed. As the statechart $Y_2$ does not contain actions, the timed automaton $U_2$ is the same with Example~\ref{ex:initial}. Hence, the timed automata model after action transformation is $\automataSetStep{2} = \{ U_1, U_2 \}$, where $U_1= (S_{\mathtt{u}}^1, s^0_1, T_{\mathtt{u}}^1, \emptyset, A_{\mathtt{u}}^1, V_{\mathtt{u}},\\ \emptyset, \emptyset)$ and $U_2 = (S_{\mathtt{u}}^2, s^0_2, T_{\mathtt{u}}^2, \emptyset, \emptyset, V_{\mathtt{u}}, \emptyset, \emptyset)$. \end{example} \textbf{Rule~\ref{rule:guard}: Guard Transformation.} The \textit{guard} of a transition in Yakindu\ statecharts is mapped to the corresponding edge in UPPAAL\ timed automata. If a transition guard contains \textit{events} or \textit{timing triggers}, we transform them with Rule~\ref{rule:event} and Rule~\ref{rule:timer} given below, respectively. The formalism of the guard transformation rule is defined in Rule~\ref{rule:guard}. We use Example~\ref{ex:guard} to explain the guard transformation rule. \begin{myrule}[Guard Transformation Rule] \label{rule:guard} Given a network of basic Yakindu\ statecharts $\mathcal{Y}=\{ (Y_i, \rho_i) | Y_i = (S_i, s^0_i, T_i, G_i, A_i, V, \Gamma_i, \Delta_{\mathtt{in}}^i, \Delta_{\mathtt{out}}^i) \wedge 1 \le i \le n \}$ and the network of UPPAAL\ timed automata $\automataSetStep{2} = \{ U_i | U_i = (S_i, s^0_i, T_i, \emptyset, A_i, V, \emptyset, \emptyset) \wedge 1 \le i \le n \}$ after \textit{action} transformation, let $t_{\mathtt{y}}$ denote a transition in statechart $Y_i$ and $t_{\mathtt{u}}$ be $t_{\mathtt{y}}$'s corresponding edge in timed automata $U_i$, we set each edge $t_{\mathtt{u}}$'s guard in UPPAAL\ timed automata $U_i$ with corresponding transition $t_{\mathtt{y}}$'s guard in Yakindu\ statechart $Y_i$, i.e., \begin{align*} \forall Y_i \in \mathcal{Y}: \forall t_{\mathtt{y}} \in Y_i(T_i): t_{\mathtt{u}}(g) := t_{\mathtt{y}}(g). \end{align*} We use $\automataSetStep{3} = \{ U_i | U_i = (S_i, s^0_i, T_i, \{ t_{\mathtt{u}}(g) | t_{\mathtt{u}}\in T_i \}, A_i, V, \emptyset, \emptyset) \wedge 1 \le i \le n \}$ to denote the network of UPPAAL\ timed automata after guard transformation. \end{myrule} \begin{example} \label{ex:guard} We transform guards in the statechart model $\mathcal{Y}$ specified in Example~\ref{ex:stEx} and update the timed automata model $\automataSetStep{2}$ transformed in Example~\ref{ex:action}. Fig.~\ref{fig:guardEx} depicts the timed automata model after guard transformation. \begin{figure}[ht] \centering \includegraphics[width = 0.7\textwidth]{fig/guardEx.png} \caption{Timed Automata Model after Guard Transformation} \label{fig:guardEx} \end{figure} We take the transition $t_{\mathtt{y}}^1 = (s_0^1, \mathtt{true}, \mathtt{NULL}, 1, s_1)$ as an example to illustrate the guard transformation rule. According to Rule~\ref{rule:guard}, the guard of transition $t_{\mathtt{y}}^1$'s corresponding edge $t_{\mathtt{u}}^1$ is set to be $t_{\mathtt{y}}^1$'s guard $\mathtt{true}$, i.e., $t_{\mathtt{u}}^1 = (s_0^1, \mathtt{true}, x=5, \mathtt{NULL}, s_1)$, which is marked by a red rectangle in Fig.~\ref{fig:guardEx}. Similarly, we update other six transitions by transforming guards as follows: $t_{\mathtt{u}}^2 = (s_1, \mathtt{eventA}, \mathtt{NULL}, \mathtt{NULL}, s_2)$, $t_{\mathtt{u}}^3 = (s_2, x>0, <x=2; x=0; x=5>, \mathtt{NULL}, s_1)$, $t_{\mathtt{u}}^4 = (s_2, x>1, x=2, \mathtt{NULL}, s_2)$, $t_{\mathtt{u}}^5 = (s_0^2, \mathtt{true}, \mathtt{NULL}, \mathtt{NULL}, s_3)$, $t_{\mathtt{u}}^6 = (s_3, \mathtt{after \ 5s}, \mathtt{NULL}, \mathtt{NULL}, s_4)$, and $t_{\mathtt{u}}^7 = (s_4, \mathtt{every \ 10s}, \mathtt{NULL}, \mathtt{NULL}, s_3)$. The guard sets of timed automata $U_1$ and $U_2$ are $G_{\mathtt{u}}^1 = \{ \mathtt{true}, \mathtt{eventA}, x>0, x>1 \}$ and $G_{\mathtt{u}}^2 = \{ \mathtt{true}, \mathtt{after \ 5s},\mathtt{every \ 10s} \}$, respectively. All other elements of timed automata $U_1$ and $U_2$ are the same with Example~\ref{ex:action}. Hence, the timed automata model after guard transformation is $\automataSetStep{3} = \{ U_1, U_2 \}$, where $U_1= (S_{\mathtt{u}}^1, s^0_1, T_{\mathtt{u}}^1, G_{\mathtt{u}}^1, A_{\mathtt{u}}^1, V_{\mathtt{u}},\\ \emptyset, \emptyset)$ and $U_2 = (S_{\mathtt{u}}^2, s^0_2, T_{\mathtt{u}}^2, G_{\mathtt{u}}^2, \emptyset, V_{\mathtt{u}}, \emptyset, \emptyset)$. \end{example} \textbf{Rule~\ref{rule:event}: Event Transformation.} In UPPAAL\ timed automata, we simulate the event occurrence by an auxiliary \textit{event} automaton. The event automaton contains only one location and has a self-loop edge which is synchronized with the transformed timed automata's edges that are triggered by the corresponding event. The synchronization between the transformed timed automata and the event automaton is through a channel declared for the corresponding event. The formalism of the event transformation is defined in Rule~\ref{rule:event}. We use Example~\ref{ex:event} to explain the event transformation rule. \begin{myrule}[Event Transformation Rule] \label{rule:event} Given a network of basic Yakindu\ statecharts $\mathcal{Y}=\{ (Y_i, \rho_i) | Y_i = (S_i, s^0_i, T_i, G_i, A_i, V, \Gamma_i, \Delta_{\mathtt{in}}^i, \Delta_{\mathtt{out}}^i) \wedge 1 \le i \le n \}$ and the network of UPPAAL\ timed automata $\automataSetStep{3} = \{ U_i | U_i = (S_i, s^0_i, T_i, G_i, A_i, V, \emptyset, \emptyset) \wedge 1 \le i \le n \}$ after \textit{guard} transformation, let $V_{\epsilon} \subseteq Y_i(V)$ denote the event variable set of the network of basic Yakindu\ statecharts $\mathcal{Y}$. For each event variable $\epsilon$, we change the variable to be channel type, i.e., $\mathtt{chan} \ \epsilon$, and create an \textit{event} automaton $\automata_{\event} = (\{ s_0 \}, s_0, \{(s_0, \epsilon!, \mathtt{NULL}, \mathtt{NULL}, s_0)\}, \{\epsilon!\}, \emptyset, V, \emptyset, \emptyset)$. In addition, for every guard in $\automataSetStep{3}$, we substitute $\epsilon$ with $\epsilon?$, i.e., \begin{align*} \forall U_i \in \automataSetStep{3}: \forall g \in U_i(G_i): \forall \epsilon \in \varSet_{\event}: g[\epsilon? / \epsilon]. \end{align*} We use $\automataSetStep{4} = \{ U_i | U_i = (S_i, s^0_i, T_i, G_i[\epsilon?/\epsilon], A_i, V, \emptyset, \emptyset) \wedge 1 \le i \le n \} \cup \mathcal{U}_{\epsilon}$ to denote the network of UPPAAL\ timed automata after event transformation, where $\mathcal{U}_{\epsilon} = \{ \automata_{\event} | \epsilon \in V_{\epsilon} \}$ and $G_i[\epsilon?/\epsilon]$ denotes that each event variable $\epsilon$ of every guard in $G_i$ is replaced by $\epsilon?$. \end{myrule} \begin{example} \label{ex:event} We transform events in the statechart model $\mathcal{Y}$ specified in Example~\ref{ex:stEx} and update the timed automata model $\automataSetStep{3}$ transformed in Example~\ref{ex:guard}. Fig.~\ref{fig:eventEx} depicts the timed automata model after event transformation. \begin{figure}[ht] \centering \includegraphics[width = 0.7\textwidth]{fig/eventEx.png} \caption{Timed Automata Model after Event Transformation} \label{fig:eventEx} \end{figure} The statechart model $\mathcal{Y}$ only contains one event variable $\mathtt{eventA}$. According to Rule~\ref{rule:event}, we first change the variable $\mathtt{eventA}$ to be channel type, i.e., re-declare the variable by $\mathtt{chan \ eventA}$. Then, we create an auxiliary event automaton $\automata_{\event}$ with one location and a self-loop edge to simulate the occurrence of $\mathtt{eventA}$, as shown in Fig.~\ref{fig:eventAutomataEx}. The formal representation of the event automaton is $\automata_{\event} = (S_{\epsilon}, s_0^{\epsilon}, T_{\epsilon}, G_{\epsilon}, \emptyset, V_{\mathtt{u}}, \emptyset, \emptyset)$, where $S_{\epsilon} = \{ s_0^{\epsilon} \}$, $T_{\epsilon} = \{(s_0^{\epsilon}, \mathtt{eventA}!, \mathtt{NULL}, \mathtt{NULL}, s_0^{\epsilon})\}$, $G_{\epsilon} = \{\mathtt{eventA}!\}$, and $V_{\mathtt{u}} = \{ x,\mathtt{eventA}\}$. \begin{figure}[ht] \centering \includegraphics[width = 0.1\textwidth]{fig/eventAutomataEx.png} \caption{Event Automaton} \label{fig:eventAutomataEx} \end{figure} In the timed automata model $\automataSetStep{3}$, only the transition $t_{\mathtt{u}}^2 = (s_1, \mathtt{eventA}, \mathtt{NULL}, \mathtt{NULL}, s_2)$ of timed automaton $U_1$ is triggered by $\mathtt{eventA}$. According to Rule~\ref{rule:event}, we update the guard of transition $t_{\mathtt{u}}^2$ to be $\mathtt{eventA}?$, i.e., $t_{\mathtt{u}}^2 = (s_1, \mathtt{eventA}?, \mathtt{NULL}, \mathtt{NULL}, s_2)$, which is marked by a red rectangle in Fig.~\ref{fig:eventEx}. The guard set of timed automaton $U_1$ is updated as $G_{\mathtt{u}}^1 = \{ \mathtt{true}, \mathtt{eventA}?, x>0, x>1 \}$. Other elements of $U_1$ and all elements of $U_2$ are the same with Example~\ref{ex:guard}. Hence, the timed automata model after event transformation is $\automataSetStep{4} = \{ U_1, U_2, \automata_{\event} \}$. \end{example} \textbf{Rule~\ref{rule:timer}: Timing Trigger Transformation.} Yakindu\ statecharts have two types of timing triggers: \textit{every timing trigger} and \textit{after timing trigger}. Similar to the event transformation rule, we simulate the timing trigger's behavior by an auxiliary timing trigger automaton. The transformed timed automata and the timing trigger automaton are synchronized through a channel declared for the corresponding timing trigger. The formalism of the timing trigger transformation is defined in Rule~\ref{rule:timer}. We use Example~\ref{ex:timer} to explain the timing trigger transformation rule. \begin{myrule}[Timing Trigger Transformation Rule] \label{rule:timer} Given a network of basic Yakindu\ statecharts $\mathcal{Y}=\{ (Y_i, \rho_i) | Y_i\\ = (S_i, s^0_i, T_i, G_i, A_i, V, \Gamma_i, \Delta_{\mathtt{in}}^i, \Delta_{\mathtt{out}}^i) \wedge 1 \le i \le n \}$ and the network of UPPAAL\ timed automata $\automataSetStep{4} = \{ U_i | U_i = (S_i, s^0_i, T_i, G_i, A_i, V, \emptyset, \emptyset) \wedge 1 \le i \le n \} \cup \mathcal{U}_{\epsilon}$ after the \textit{event} transformation, let $\tau$ be a timing trigger. \begin{itemize} \item For each timing trigger $\tau$ in the format of $\mathtt{every} \ \tau \in \{ Y_i(G_i) | Y_i \in \mathcal{Y} \}$, \begin{itemize} \item declare a clock variable $\mathtt{clock} \ c_{\tau} = 0$ and a channel variable $\mathtt{chan} \ v_{\tau}$; and \item create an \textit{every} timing trigger automaton $\automata_{\timer}^{\mathtt{every}} = (\{ s_0 \}, s_0, \{(s_0, v_{\tau}! \ \&\& \ c_{\tau} == \tau, c_{\tau}=0, c_{\tau}, s_0)\}, \{v_{\tau}! \ \&\& \ c_{\tau}\\==\tau\}, \{c_{\tau}=0\}, V \cup \{v_{\tau}\}, \{c_{\tau}\}, \{(s_0, c_{\tau} \le \tau)\})$. \end{itemize} \item For each timing trigger $\tau$ in the format of $\mathtt{after} \ \tau \in \{ Y_i(G_i) | Y_i \in \mathcal{Y} \}$, \begin{itemize} \item declare a clock variable $\mathtt{clock} \ c_{{\tau}} = 0$ and a channel variable $\mathtt{chan} \ v_{{\tau}}$; and \item create an \textit{after} timing trigger automaton $\automata_{\timer}^{\mathtt{after}} = (\{ s_0,s_1 \}, s_0, \{(s_0, v_{\tau}! \ \&\& \ c_{\tau}==\tau, c_{\tau}=0, c_{\tau}, s_1)\}, \{v_{\tau}! \ \&\& \\ c_{\tau}==\tau\}, \{c_{\tau}=0\}, V \cup \{v_{\tau}\}, \{c_{\tau}\}, \{(s_0,c_{\tau} \le \tau)\})$. \end{itemize} \item For every guard in $\automataSetStep{4}$, we substitute timing triggers $\mathtt{every} \ \tau$ and $\mathtt{after} \ \tau$ with corresponding $v_{\tau}?$, i.e., \begin{align*} \begin{split} \forall U_i \in \automataSetStep{4}: \forall g \in U_i(G_i): g[v_{\tau}?/\mathtt{every} \ \tau][v_{\tau}?/\mathtt{after} \ \tau]. \end{split} \end{align*} \end{itemize} We use $\automataSetStep{5} = \{ U_i | U_i = (S_i, s^0_i, T_i, G_i[v_{\tau}?/\mathtt{every} \ \tau][v_{\tau}?/\mathtt{after} \ \tau], A_i, V \cup \{ v_{\tau} | \tau \in Y_i(G_i) \wedge Y_i \in \mathcal{Y} \} \}, \{ c_{\tau} | \tau \in Y_i(G_i) \wedge Y_i \in \mathcal{Y} \}, \emptyset) \wedge 1 \le i \le n \} \cup \mathcal{U}_{\epsilon} \cup \mathcal{U}_{\tau}$ to denote the network of UPPAAL\ timed automata after timing trigger transformation, where $\mathcal{U}_{\tau} = \{ \automata_{\timer} | \tau \in \automataSetStep{4}(G) \}$. \end{myrule} \begin{example} \label{ex:timer} We transform timing triggers in the statechart model $\mathcal{Y}$ specified in Example~\ref{ex:stEx} and update the timed automata model $\automataSetStep{4}$ transformed in Example~\ref{ex:event}. Fig.~\ref{fig:timerEx} depicts the timed automata model after timing trigger transformation. \begin{figure}[ht] \centering \includegraphics[width = 0.7\textwidth]{fig/timerEx.png} \caption{Timed Automata Model after Timing Trigger Transformation} \label{fig:timerEx} \end{figure} The statechart model $\mathcal{Y}$ contains two timing triggers $\mathtt{every \ 10s}$ and $\mathtt{after \ 5s}$. We take the timing trigger $\mathtt{every \ 10s}$ as an example to illustrate Rule~\ref{rule:timer}. We first declare a clock variable $\mathtt{clock} \ c_1 = 0$ and a channel variable $\mathtt{chan \ every10s}$ for the timing trigger. Then, we add the clock variable $c_1$ and the channel variable $\mathtt{every10s}$ into the clock set $C$ and the variable set $V_{\mathtt{u}}$ of timed automata model $\automataSetStep{4}$, respectively, i.e., $C = \{ c_1 \}$ and $V_{\mathtt{u}} = \{ x, \mathtt{eventA}, \mathtt{every10s} \}$. Lastly, we create an every timing trigger automaton $\automata_{\timer}^{\mathtt{every}}$ to simulate the behavior of timing trigger $\mathtt{every \ 10s}$, as shown in Fig.~\ref{subfig:everyTimerAutomataEx}. The timing trigger automaton $\automata_{\timer}^{\mathtt{every}}$ contains only one location $s_0^{\mathtt{every}}$ with invariant $c_1 \le 10$ to guarantee that the timing trigger automaton is not allowed to stay in the state $s_0^{\mathtt{every}}$ for more than 10 seconds. The automaton $\automata_{\timer}^{\mathtt{every}}$ also has a self-loop edge which is guarded by $c_1==10$, resets the clock $c_1=0$, and synchronizes with timed automata in $\automataSetStep{4}$ through the output channel $\mathtt{every10s} !$. The formal representation of the timing trigger automaton is $\automata_{\timer}^{\mathtt{every}} = (\{ s_0^{\mathtt{every}} \}, s_0^{\mathtt{every}}, \{(s_0^{\mathtt{every}}, \mathtt{every10s}! \ \&\& \ c_1 == 10, c_1=0, \{c_1\}, s_0^{\mathtt{every}})\}, \{\mathtt{every10s}! \ \&\& \ c_1==10\}, c_1=0, V_{\mathtt{u}}, C, \{(s_0^{\mathtt{every}}, c_1 \le 10)\})$. \begin{figure}[ht] \centering \subfigure[Every Timing Trigger]{ \centering \includegraphics[width = 0.3\textwidth]{fig/everyTimerAutomataEx.png} \label{subfig:everyTimerAutomataEx} } \subfigure[After Timing Trigger]{ \centering \includegraphics[width = 0.3\textwidth]{fig/afterTimerAutomataEx.png} \label{subfig:afterTimerAutomataEx} } \caption{Timing Trigger Automaton} \label{fig:timerAutomataEx} \end{figure} Similarly, we transform the timing trigger $\mathtt{after \ 5s}$. We declare a clock variable $\mathtt{clock} \ c_2 = 0$ and a channel variable $\mathtt{chan \ after5s}$ and add them into the clock set $C$ and the variable set $V_{\mathtt{u}}$, respectively, i.e., $C = \{ c_1, c_2 \}$ and $V_{\mathtt{u}} = \{ x, \mathtt{eventA}, \mathtt{every10s}, \mathtt{after5s} \}$. Instead of the self-loop edge in automaton $\automata_{\timer}^{\mathtt{every}}$, the after timing trigger automaton $\automata_{\timer}^{\mathtt{after}}$ transits the initial state $s_0^{\mathtt{after}}$ to another state $s_5$, as shown in Fig.~\ref{subfig:afterTimerAutomataEx}. The formal representation of the after timing trigger automaton is $\automata_{\timer}^{\mathtt{after}} = (\{ s_0^{\mathtt{after}},s_5 \}, s_0^{\mathtt{after}}, \{(s_0^{\mathtt{after}}, \mathtt{after5s}! \ \&\& \ c_2==5, c_2=0, c_2, s_5)\}, \{\mathtt{after5s}! \ \&\& \ c_2==5\}, \{c_2=0\}, V_{\mathtt{u}}, C, \{(s_0^{\mathtt{after}},c_2 \le 5)\})$. In the timed automata model $\automataSetStep{4}$, the transitions $t_{\mathtt{u}}^6 = (s_3, \mathtt{after \ 5s}, \mathtt{NULL}, \mathtt{NULL}, s_4)$ and $t_{\mathtt{u}}^7 = (s_4, \mathtt{every \ 10s},\\ \mathtt{NULL}, \mathtt{NULL}, s_3)$ are triggered by the after and every timing triggers, respectively. According to Rule~\ref{rule:timer}, we update the guards of transitions $t_{\mathtt{u}}^6$ and $t_{\mathtt{u}}^7$ to be $\mathtt{after5s}?$ and $\mathtt{every10s}?$, respectively, i.e., $t_{\mathtt{u}}^6 = (s_3, \mathtt{after5s}?, \mathtt{NULL}, \mathtt{NULL}, s_4)$ and $t_{\mathtt{u}}^7 = (s_4, \mathtt{every10s}?, \mathtt{NULL}, \mathtt{NULL}, s_3)$, which are marked by red rectangles in Fig.~\ref{fig:timerEx}. The guard set of timed automaton $U_2$ is updated as $G_{\mathtt{u}}^2 = \{ \mathtt{true}, \mathtt{after5s}?,\mathtt{every10s}? \}$. Other elements of $U_2$ and all elements of $U_1$ are the same with Example~\ref{ex:event}. Hence, the timed automata model after event transformation is $\automataSetStep{5} = \{ U_1, U_2, \automata_{\event}, \automata_{\timer}^{\mathtt{every}}, \automata_{\timer}^{\mathtt{after}} \}$. \end{example} \subsubsection{Model Determinism and Synchrony in UPPAAL} \label{subsubsec:synchronous} \text{} As mentioned in Section~\ref{sec:formalism}, Yakindu\ statecharts have deterministic and synchronous execution semantics~\cite{yakinduDoc}, while UPPAAL\ timed automata's execution semantics is non-deterministic and asynchronous~\cite{behrmann2004tutorial}. To maintain the semantics equivalence between the Yakindu\ statecharts and the transformed UPPAAL\ timed automata, we need to model determinism and synchrony in UPPAAL. To implement the determinism within a statechart, Yakindu\ assigns an unique priority to each transition and select the transition with the highest priority from all enabled outgoing transitions of the same state to execute. We enforce the transition priorities in UPPAAL\ by Rule~\ref{rule:priority} given below. \textbf{Rule~\ref{rule:priority}: Transition Priority.} Assume a state has $n$ outgoing transitions $\{t_1, t_2, \dots, t_n\}$ sorted in decreasing priority order (i.e., the transition $t_1$ has the highest priority) and the guard of transition $t_i$ is denoted as $g_i$. To consider transition priorities, we change the transition guard of $t_i$ to be $g_i \ \&\& \ !g_1 \ \&\& \ !g_2 \ \ \&\& \ \ \dots \ \&\& \ !g_{i-1}$ to enforce that higher priority transitions take place before lower priority transitions. The formalism of the transition priority transformation is defined in Rule~\ref{rule:priority}. We use Example~\ref{ex:priority} to explain the transition priority transformation rule. \begin{myrule}[Transition Priority Rule] \label{rule:priority} Given a network of basic Yakindu\ statecharts $\mathcal{Y}=\{ (Y_i, \rho_i) | Y_i = (S_i, s^0_i, T_i, G_i, A_i, V, \Gamma_i, \Delta_{\mathtt{in}}^i, \Delta_{\mathtt{out}}^i) \wedge 1 \le i \le n \}$ and the network of UPPAAL\ timed automata $\automataSetStep{5} = \{ U_i | U_i = (S_i, s^0_i, T_i, G_i, A_i, V, C, \emptyset ) \wedge 1 \le i \le n \} \cup \automataSet_{\event} \cup \automataSet_{\timer}$ after timing trigger transformation, let $t_{\mathtt{y}}$ denote a transition in statechart $Y_i$ and $t_{\mathtt{u}}$ be $t_{\mathtt{y}}$'s corresponding edge in time automata $U_i$, let $\tranSet^{\mathtt{out}}_{\mathtt{y}}(s)=\{ \tran^{\mathtt{out}}_{\mathtt{y}} | \tran^{\mathtt{out}}_{\mathtt{y}} \in Y_i(T_i) \wedge \tran^{\mathtt{out}}_{\mathtt{y}}=(s, *, *, *, *) \}$ denote the outgoing transitions of state $s$ in statechart $Y_i$, and let $\tranSet^{\mathtt{hp}}_{\mathtt{y}}(s, t_{\mathtt{y}})=\{ \tran^{\mathtt{out}}_{\mathtt{y}} | \tran^{\mathtt{out}}_{\mathtt{y}} \in \tranSet^{\mathtt{out}}_{\mathtt{y}}(s) \wedge t_{\mathtt{y}}(\gamma) > \tran^{\mathtt{out}}_{\mathtt{y}}(\gamma) \}$ denote the outgoing transitions of state $s$ with higher priorities than transition $t_{\mathtt{y}}$, for each edge $t_{\mathtt{u}}$ in the network of UPPAAL\ timed automata $\automataSetStep{5}$, we modify the guard of $t_{\mathtt{u}}$ by adding conjunctions of guard negation of higher priority outgoing transitions from $t_{\mathtt{y}}$'s source state, i.e., \begin{align*} \begin{split} \forall Y_i \in \mathcal{Y}: \forall s \in Y_i(S_i): \forall t_{\mathtt{y}} \in \tranSet^{\mathtt{out}}_{\mathtt{y}}(s): t_{\mathtt{u}}(g) := t_{\mathtt{u}}(g) \bigwedge\limits_{j=1}^k \neg t_{\mathtt{u}}^{j}(g) \end{split} \end{align*} where $t_{\mathtt{u}}^{j}$ is the corresponding edge of transition $\tran^{\mathtt{hp}}_{\mathtt{y}} \in \tranSet^{\mathtt{hp}}_{\mathtt{y}}(s, t_{\mathtt{y}})$ and $k = | \tranSet^{\mathtt{hp}}_{\mathtt{y}}(s, t_{\mathtt{y}}) |$. We use $\automataSetStep{6} = \{ U_i | U_i = (S_i, s^0_i, T_i, G_i, A_i, V, C, \emptyset) \wedge 1 \le i \le n \} \cup \mathcal{U}_{\epsilon} \cup \mathcal{U}_{\tau}$ to denote the network of UPPAAL\ timed automata after transition priority transformation. \end{myrule} \begin{example} \label{ex:priority} We transform transition priorities in the statechart model $\mathcal{Y}$ specified in Example~\ref{ex:stEx} and update the timed automata model $\automataSetStep{5}$ transformed in Example~\ref{ex:timer}. Fig.~\ref{fig:priorityEx} depicts the timed automata model after timing trigger transformation. \begin{figure}[ht] \centering \includegraphics[width = 0.7\textwidth]{fig/priorityEx.png} \caption{Timed Automata Model after Transition Priority Transformation} \label{fig:priorityEx} \end{figure} In the statechart model $\mathcal{Y}$, only the transition $t_{\mathtt{y}}^4 = (s_2, x>1, \mathtt{NULL}, 2, s_2)$ has a higher priority transition $t_{\mathtt{y}}^3 = (s_2, x>0, x=0, 1, s_1)$. According to Rule~\ref{rule:priority}, we update the guard of transition $t_{\mathtt{u}}^4$ to be $t_{\mathtt{u}}^4(g) \wedge \neg t_{\mathtt{u}}^3(g)$, i.e., $t_{\mathtt{u}}^4 = (s_2, x>1 \ \&\& \ !x>0, x=2, \mathtt{NULL}, s_2)$, which is marked by a red rectangle in Fig.~\ref{fig:priorityEx}. The guard set of timed automaton $U_1$ is updated as $G_{\mathtt{u}}^1 = \{ \mathtt{true}, \mathtt{eventA}?, x>0, x>1 \ \&\& \ !x>0 \}$. Other elements of $U_1$ and all elements of $U_2$ are the same with Example~\ref{ex:timer}. Hence, the timed automata model after transition priority transformation is $\automataSetStep{6} = \{ U_1, U_2, \automata_{\event}, \automata_{\timer}^{\mathtt{every}}, \automata_{\timer}^{\mathtt{after}} \}$. \end{example} Yakindu\ statecharts implement the determinism among different statecharts by statechart priority and synchronous execution. According to the decreasing statechart priority, each statechart only executes one step in each execution cycle if the transition is enabled, otherwise the statechart stays in the current state. In UPPAAL\ timed automata, we use the lockstep method~\cite{lockstep}, shown in Rule~\ref{rule:synchrony}, to force synchronous execution based on statechart priorities. We ignore the added event automata (Rule~\ref{rule:event}) and timing trigger automata (Rule~\ref{rule:timer}) when modeling synchrony in UPPAAL\, as the added automata does not affect the model's execution behavior. \textbf{Rule~\ref{rule:synchrony}: Statechart Priority and Synchrony.} Suppose a Yakindu\ model contains $n$ basic statecharts $\{ (Y_i, \rho_i) | \rho_i\\ = i \wedge 1 \le i \le n \}$ that are sorted by statechart priority in decreasing order, i.e., the statechart $Y_1$ has the highest priority. The corresponding transformed $n$ time automata are denoted as $\{ U_i | 1 \le i \le n \}$. The lockstep method~\cite{lockstep} to model synchrony is as follows. We declare a variable $\alpha$ with initial value $1$ to indicate the execution index of the transformed timed automata model. For each edge in timed automata $U_i$, we add a conjunction $\alpha == \rho_i$ to its guard to enforce that only the automaton whose corresponding statechart's execution priority is the same with the execution index $\alpha$ is executed. We also add the execution index update action $\mathtt{Inc}(\step) \equiv (\alpha+1) \mod n$ to every action in the transformed timed automata model to enforce that every automaton only executes one step in each execution cycle. If none of outgoing edges is enabled, the automaton stays in current state, which is equivalent to that the automaton executes a self-loop step without any actions. To avoid deadlock, for each location, we add a self-loop edge which is guarded by the negation of all outgoing edge guards of the location and does not have any actions. If a location does not have outgoing edges, the added self-loop edge is guarded by $\mathtt{true}$. The added self-loop edge has the lowest priority among all outgoing edges of the corresponding location. We also apply the above lockstep procedure to these added self-loop edges. The formalism of the statechart priority and synchrony transformation is defined in Rule~\ref{rule:synchrony}. We use Example~\ref{ex:synchrony} to explain the statechart priority and synchrony transformation rule. \begin{myrule}[Statechart Priority and Synchrony Rule] \label{rule:synchrony} Given a network of basic Yakindu\ statecharts $\mathcal{Y}=\{ (Y_i, \rho_i) | Y_i = (S_i, s^0_i, T_i, G_i, A_i, V, \Gamma_i, \Delta_{\mathtt{in}}^i, \Delta_{\mathtt{out}}^i) \wedge \rho_i = i \wedge 1 \le i \le n \}$ and the network of UPPAAL\ timed automata $\automataSetStep{6} = \{ U_i | U_i = (S_i, s^0_i, T_i, G_i, A_i, V, C, \emptyset) \wedge 1 \le i \le n \} \cup \automataSet_{\event} \cup \automataSet_{\timer}$ after transition priority transformation, let $\tranSet^{\mathtt{out}}(s)=\{ \tran^{\mathtt{out}} | \tran^{\mathtt{out}} \in U_i(T_i) \wedge \tran^{\mathtt{out}}=(s, *, *, *, *) \}$ denote the outgoing edges of location $s$ in timed automata $U_i$, let $<a_1; a_2>$ denote that the two actions $a_1$ and $a_2$ are executed sequentially and atomically, we \begin{itemize} \item declare an integer $\mathtt{int} \ \alpha = 1$ to indicate the index of the automaton to be executed; \item define an action $\mathtt{Inc}(\step) \equiv (\alpha+1) \mod n$ to update the automaton execution index $\alpha$; \item for each location in the network of UPPAAL\ timed automata $\automataSetStep{6}$, add a self-loop edge which is guarded by the negation of all outgoing edge guards of the corresponding location and does not have any actions, i.e., $\forall U_i \in \automataSetStep{6} :\ \forall s \in U_i(S_i):\ U_i(T_i) := U_i(T_i) \cup t=(s, g, \mathtt{NULL}, \mathtt{NULL}, s)$, where $\forall \tran^{\mathtt{out}} \in \tranSet^{\mathtt{out}} (s): g := \mathtt{true} \bigwedge \neg \tran^{\mathtt{out}}(g)$; \item add a conjunction $\alpha == \rho_i$ to every edge's guard in the network of UPPAAL\ timed automata $\automataSetStep{6}$, i.e., $\forall U_i \in \automataSetStep{6} :\ \forall t \in U_i(T_i) :\ t(g) := t(g) \ \&\& \ (\alpha == \rho_i)$; and \item add the automaton execution index update action $\mathtt{Inc}(\step)$ to every edge's action in the network of UPPAAL\ timed automata $\automataSetStep{6}$, i.e., $\forall U_i \in \automataSetStep{6} :\ \forall t \in U_i(T_i) :\ t(a) := <t(a); \mathtt{Inc}(\step)>$. \end{itemize} We use $\automataSetStep{7} = \{ U_i | U_i = (S_i, s^0_i, T_i, G_i, A_i, V, C, \emptyset) \wedge 1 \le i \le n \} \cup \automataSet_{\event} \cup \automataSet_{\timer}$ to denote the network of UPPAAL\ timed automata after statechart priority and synchrony transformation. \end{myrule} \begin{example} \label{ex:synchrony} We transform statechart priority and model synchrony in the statechart model $\mathcal{Y}$ specified in Example~\ref{ex:stEx} and update the timed automata model $\automataSetStep{6}$ transformed in Example~\ref{ex:priority}. Fig.~\ref{fig:synchronyEx} depicts the timed automata model after statechart priority and synchrony transformation. \begin{figure}[ht] \centering \includegraphics[width = 0.9\textwidth]{fig/synchronyEx.png} \caption{Timed Automata Model after Statechart Priority and Synchrony Transformation} \label{fig:synchronyEx} \end{figure} According to Rule~\ref{rule:synchrony}, we declare an integer $\mathtt{int \ alpha} = 1$ to indicate the automaton execution index and define an action $\mathtt{Inc(alpha)}$ to update $\mathtt{appha}$. To avoid deadlock, we add a self-loop edge for each location. We take the added self-loop edge $t_{\mathtt{u}}^8$ for location $s_0^1$, which is marked by a red rectangle in Fig.~\ref{fig:synchronyEx}, as an example to illustrate the rule. Before adding edge $t_{\mathtt{u}}^8$, the location $s_0^1$ only has one outgoing edge $t_{\mathtt{u}}^1 = (s_0^1, \mathtt{true}, x=5, \mathtt{NULL}, s_1)$. We set the guard of $t_{\mathtt{u}}^8$ to be $\neg t_{\mathtt{u}}^1(g)$, i.e., $t_{\mathtt{u}}^8 = (s_0^1, !\mathtt{true}, \mathtt{NULL}, \mathtt{NULL}, s_0^1)$. Similarly, we add self-loop edges $t_{\mathtt{u}}^9 = (s_1, !\mathtt{eventA}?, \mathtt{NULL}, \mathtt{NULL}, s_1)$, $t_{\mathtt{u}}^{10} = (s_2, !x>0 \ \&\& \ !(x>1 \ \&\& \ !x>0), \mathtt{NULL}, \mathtt{NULL}, s_2)$, $t_{\mathtt{u}}^{11} = (s_0^2, !\mathtt{true}, \mathtt{NULL}, \mathtt{NULL}, s_0^2)$, $t_{\mathtt{u}}^{12} = (s_3, !\mathtt{after5s}?, \mathtt{NULL}, \mathtt{NULL}, s_3)$, and $t_{\mathtt{u}}^{13} = (s_4, !\mathtt{every10s}?, \mathtt{NULL}, \mathtt{NULL}, s_4)$ for locations $s_1$, $s_2$, $s_0^2$, $s_3$, and $s_4$, respectively. The edge sets of timed automata $U_1$ and $U_2$ are updated as $T_{\mathtt{u}}^1 = \{ t_{\mathtt{u}}^1,t_{\mathtt{u}}^2,t_{\mathtt{u}}^3,t_{\mathtt{u}}^4,t_{\mathtt{u}}^8,t_{\mathtt{u}}^9,t_{\mathtt{u}}^{10} \}$ and $T_{\mathtt{u}}^2 = \{ t_{\mathtt{u}}^5,t_{\mathtt{u}}^6,t_{\mathtt{u}}^7,t_{\mathtt{u}}^{11},t_{\mathtt{u}}^{12},t_{\mathtt{u}}^{13} \}$, respectively. The guard sets of timed automata $U_1$ and $U_2$ are updated as $G_{\mathtt{u}}^1 = \{ \mathtt{true}, \mathtt{eventA}?, x>0, x>1 \ \&\& \ !x>0, !\mathtt{true}, !\mathtt{eventA}?, !x>0 \ \&\& \ !(x>1 \ \&\& \ !x>0) \}$ and $G_{\mathtt{u}}^2 = \{ \mathtt{true}, \mathtt{after5s}?,\mathtt{every10s}?, !\mathtt{true}, !\mathtt{after5s}?, !\mathtt{every10s}? \}$, respectively. To model synchrony by applying the lockstep method, we add a conjunction $\mathtt{alpha} == \rho_i$ and the action $\mathtt{Inc(alpha)}$ to every edge's guard and action in timed automata model $\automataSetStep{6}$, respectively. We take the edge $t_{\mathtt{u}}^1 = (s_0^1, \mathtt{true}, x=5, \mathtt{NULL}, s_1)$, which is marked by a blue rectangle in Fig.~\ref{fig:synchronyEx}, as an example to illustrate the rule. The edge $t_{\mathtt{u}}^1$'s corresponding transition in the given Yakindu\ model is transition $t_{\mathtt{y}}^1$ of statechart $Y_1$. According to Rule~\ref{rule:synchrony}, we update the guard and action of edge $t_{\mathtt{u}}^1$ to be $t_{\mathtt{u}}^1(g) \ \&\& \ \mathtt{alpha} == \rho_1$ and $<t_{\mathtt{u}}^1(a); \mathtt{Inc(alpha)}>$, respectively, i.e., $t_{\mathtt{u}}^1 = (s_0^1, \mathtt{true} \ \&\& \ \mathtt{alpha} == 1, <x=5;\mathtt{Inc(alpha)}>, \mathtt{NULL}, s_1)$. Similarly, we update the other twelve edges in timed automata model $U_1$ and $U_2$ as follows: $t_{\mathtt{u}}^2 = (s_1, \mathtt{eventA}? \ \&\& \ \mathtt{alpha} == 1, \mathtt{NULL}, \mathtt{NULL}, s_2)$, $t_{\mathtt{u}}^3 = (s_2, x>0 \ \&\& \ \mathtt{alpha} == 1, <x=2; x=0; x=5; \mathtt{Inc(alpha)}>, \mathtt{NULL}, s_1)$, $t_{\mathtt{u}}^4 = (s_2, x>1 \ \&\& \ !x>0 \ \&\& \ \mathtt{alpha} == 1, <x=2; \mathtt{Inc(alpha)}>, \mathtt{NULL}, s_2)$, $t_{\mathtt{u}}^5 = (s_0^2, \mathtt{true} \ \&\& \ \mathtt{alpha} == 2, \mathtt{Inc(alpha)}, \mathtt{NULL}, s_3)$, $t_{\mathtt{u}}^6 = (s_3, \mathtt{after5s}? \ \&\& \ \mathtt{alpha} == 2, \mathtt{Inc(alpha)}, \mathtt{NULL}, s_4)$, $t_{\mathtt{u}}^7 = (s_4, \mathtt{every10s}? \ \&\& \ \mathtt{alpha} == 2, \mathtt{Inc(alpha)}, \mathtt{NULL}, s_3)$, $t_{\mathtt{u}}^8 = (s_0^1, !\mathtt{true} \ \&\& \ \mathtt{alpha} == 1, \mathtt{Inc(alpha)}, \mathtt{NULL}, s_0^1)$, $t_{\mathtt{u}}^9 = (s_1, !\mathtt{eventA}? \ \&\& \ \mathtt{alpha} == 1, \mathtt{Inc(alpha)}, \mathtt{NULL}, s_1)$, $t_{\mathtt{u}}^{10} = (s_2, !x>0 \ \&\& \ !(x>1 \ \&\& \ !x>0) \ \&\& \ \mathtt{alpha} == 1, \mathtt{Inc(alpha)}, \mathtt{NULL}, s_2)$, $t_{\mathtt{u}}^{11} = (s_0^2, !\mathtt{true} \ \&\& \ \mathtt{alpha} == 2, \mathtt{Inc(alpha)}, \mathtt{NULL}, s_0^2)$, $t_{\mathtt{u}}^{12} = (s_3, !\mathtt{after5s}? \ \&\& \ \mathtt{alpha} == 2, \mathtt{Inc(alpha)}, \mathtt{NULL}, s_3)$, and $t_{\mathtt{u}}^{13} = (s_4, !\mathtt{every10s}? \ \&\& \ \mathtt{alpha} == 2, \mathtt{Inc(alpha)}, \mathtt{NULL},\\ s_4)$. The guard sets of timed automata $U_1$ and $U_2$ are updated as $G_{\mathtt{u}}^1 = \{ \mathtt{true}\ \&\& \ \mathtt{alpha} == 1, \mathtt{eventA}?\ \&\& \ \mathtt{alpha} == 1, x>0, x>1 \ \&\& \ !x>0\ \&\& \ \mathtt{alpha} == 1, !\mathtt{true}\ \&\& \ \mathtt{alpha} == 1, !\mathtt{eventA}?\ \&\& \ \mathtt{alpha} == 1, !x>0 \ \&\& \ !(x>1 \ \&\& \ !x>0)\ \&\& \ \mathtt{alpha} == 1 \}$ and $G_{\mathtt{u}}^2 = \{ \mathtt{true}\ \&\& \ \mathtt{alpha} == 2, \mathtt{after5s}?\ \&\& \ \mathtt{alpha} == 2,\mathtt{every10s}?\ \&\& \ \mathtt{alpha} == 2, !\mathtt{true}\ \&\& \ \mathtt{alpha} == 2, !\mathtt{after5s}?\ \&\& \ \mathtt{alpha} == 2, !\mathtt{every10s}?\ \&\& \ \mathtt{alpha} == 2 \}$, respectively. The action sets of timed automata $U_1$ and $U_2$ are updated as $A_{\mathtt{u}}^1 = \{ <x=2; x=0; x=5;\mathtt{Inc(alpha)}>, <x=5;\mathtt{Inc(alpha)}>, <x=2; \mathtt{Inc(alpha)}>, \mathtt{Inc(alpha)} \}$ and $A_{\mathtt{u}}^2 = \{ \mathtt{Inc(alpha)} \}$. Other elements of timed automata $U_1$ and $U_2$ are the same with Example~\ref{ex:priority}. Hence, the timed automata model after statechart priority and synchrony transformation is $\automataSetStep{7} = \{ U_1, U_2, \automata_{\event},\\ \automata_{\timer}^{\mathtt{every}}, \automata_{\timer}^{\mathtt{after}} \}$. \end{example} \subsection{Introduction of UPPAAL\ Timed Automata} \label{subsec:y2u-uppaal} \input{y2u-uppaal} \subsection{Transformation Rules} \label{subsec:y2u-rule} \input{y2u-rule}
\section{introduction}\label{intro} A presentation of a group is a concise method of defining a group in terms of generators and relations. In special cases, much information about the corresponding group can be extracted from a given presentation \cite{MKS}. Coxeter presentations are a classical example of this \cite{Bjorner}. Recall that a pair $(W,S)$, where $S = \lbrace s_{1},.., s_{n} \rbrace$ is a non-empty finite set and $W$ is a group, is called a Coxeter system if $W$ has a group presentation with generating set $S$ subject to relations of the form $(s_{i}s_{j})^{m(i, j)}$, for all $s_{i}, s_{j} \in S$, with $m(i, j) = 1$ if $i=j$ and $m(i, j) \geq 2$ otherwise, where no relation occurs on $s_{i}$ and $s_{j}$ if $m(i, j) = \infty$ \cite[Section 5.1]{Humphreys}. Such a group, $W$, is called a Coxeter group. An outline of the rich history of research into these groups is given in \cite[Historical Note]{Bourbaki}. In particular, it is well known that the finite Coxeter groups can be classified via their Coxeter graphs and the class of finite Coxeter groups is precisely the class of finite reflection groups \cite[Chapter VI, Section 4, Theorem 1]{Bourbaki}, \cite{Coxeter2}, \cite{Coxeter}. The applications of Coxeter groups are widespread throughout algebra \cite{Bourbaki}, analysis \cite{Wavelets}, applied mathematics \cite{QM} and geometry \cite{FT2}. However, the many combinatorial properties of Coxeter groups make them an interesting topic of research in their own right (see \cite{Bjorner}). For example, for any subset $I \subseteq S$, $W_{I}$ denotes the subgroup of $W$ generated by $I$. Any subgroup of $W$ which can be obtained in this way is called a parabolic subgroup of $W$ \cite[Section 5.4]{Humphreys}. It is known that the coset $wW_{I}$ contains a unique element of minimal length for each $w \in W$, meaning that we can choose a distinguished coset representative of $wW_{I}$. It follows that there exists a unique factorisation of each element with respect to a given parabolic subgroup \cite[Proposition 2.4.4]{Bjorner}. In certain cases, the reduced expressions for these distinguished coset representatives for a maximal parabolic subgroup can be described explicitly; see for example \cite[Corollary 3.3]{RMThesis}, \cite{Papi}. In this paper, we will consider group presentations which generalise the Coxeter case by allowing generating sets of infinite size and any relations that have even length. We show that a variation of this property of Coxeter groups holds for any group, $G$, which has a group presentation of this type. In particular, we can define a parabolic subgroup of $G$ in an analogous way to the Coxeter case and prove that there exists a (not necessarily unique) factorisation of each element of $G$ with respect to a given parabolic subgroup. We also give a counterexample using cluster group presentations (in the sense of \cite[Definition 1.2]{Webster}) showing that, in contrast to the Coxeter case, this factorisation is not unique in general. Some of these results form part of the author’s Ph.D. thesis \cite{Webster2}, carried out at the University of Leeds. The paper will proceed in the following way. In Section $\ref{sec1}$ we establish basic properties of the length function on $G$ and provide a more detailed summary of the main result of this paper. In Section $\ref{properties}$ we prove our first main result: that there exists a factorisation of each element of $G$ with respect to a given parabolic subgroup. In Section $\ref{clustergroups}$, we construct an example in which the factorisation with respect to a given parabolic subgroup is not unique. \section{Group presentations with even length relations.}\label{sec1} Let $G$ be a group arising from a group presentation $\langle X | R \rangle$, where $X$ may be finite or infinite. By the definition of the presentation of a group, any element $w$ of $G$ can be written as $$w = x_{1}^{a_{1}}x_{2}^{a_{2}}...x_{r}^{a_{r}},$$ where $r \in \mathbb{N}$, $x_{j} \in X$ and $a_{j} = \pm 1$, for all $1 \leq j \leq r$. The \textbf{length} of $w \in G$, $l(w)$, is the smallest $r$ such that $w$ has an expression of this form and a \textbf{reduced expression} of $w$ is any expression of $w$ as a product of $l(w)$ elements of $X\cup X^{-1}$ (where $X^{-1} = \lbrace x^{-1} : x \in X \rbrace$ is a copy of $X$). We refer to $l$ as the \textbf{length function} on $G$. Taking an index set $I$, if $R$ is a set of relations of the form $u_{i} = v_{i}$ for $i \in I$, with $u_{i}, v_{i} \in F(X)$, where $F(X)$ denotes the free group on $X$, then the \textbf{length of the relation $u_{i} = v_{i}$} is given by the length of the word $u_{i}v_{i}^{-1}$ in $F(X)$. Analogously to the Coxeter case, we define a parabolic subgroup of $G$. \begin{definition} For $I \subseteq X$, we denote by $G_{I}$ the subgroup of G generated by $I$. A (standard) \textbf{parabolic subgroup} of $G$ is a subgroup of the form $G_{I}$ for some $I \subseteq X$. \end{definition} Moreover, for each $I \subseteq X$ we define the following sets. $$G^{I} = \lbrace w \in G : l(wx) > l(w) \hspace{0.15cm} \forall \hspace{0.15cm} x \in I \rbrace;$$ $$^{I} G = \lbrace w \in G : l(xw) > l(w) \hspace{0.15cm} \forall \hspace{0.15cm} x \in I \rbrace.$$ In Section \ref{properties}, we will prove our main result: \begin{proposition}\label{decomposition} Let $G$ be a group generated by a fixed set, $X$, of involutions subject only to relations of even length. For $I \subseteq X$, let $G_{I}$ denote the subgroup of $G$ generated by $I$ and $ G^{I} = \lbrace w \in G : l(wx) > l(w) \hspace{0.25cm} \forall \hspace{0.25cm} x \in I \rbrace$. Then every element $w \in G$ has a factorisation $$w = ab,$$ where $a \in G^{I}, b \in G_{I}$ and $l(w) = l(a) + l(b)$. \end{proposition} This result is a strengthening of \cite[Proposition 7.2.4]{Webster2}. By comparison, we can see that this result is similar to \cite[Proposition 2.4.4]{Bjorner} for Coxeter groups. However, unlike the Coxeter case, we will show in Section $\ref{clustergroups}$ that the factorisation for elements of $G$ with respect to a given parabolic subgroup is not necessarily unique or determined by minimal length elements of the coset $wG_{I}$. \section{Proof of main result.}\label{properties} To begin, we prove some basic results for the length function on a group with an arbitrary group presentation $\langle X | R \rangle$. \begin{lemma}\label{Exchange Lemma 2} If $x \in X$ and $w \in G$ then $l(xw) < l(w)$ if and only if there exists a reduced expression of $w$ beginning in $x^{-1}$. \end{lemma} \begin{proof} Let $l(xw) < l(w)$. Suppose $xw = x_{1}^{a_{1}}x_{2}^{a_{2}}...x_{r}^{a_{r}}$ is a reduced expression, where $x_{j} \in X$ with $a_{j} = \pm 1$ for all $1 \leq j \leq r$. Then $w = x^{-1}x_{1}^{a_{1}}x_{2}^{a_{2}}...x_{r}^{a_{r}}$ is an expression of $w$ of length $r+1$. Moreover, this expression must be reduced otherwise $l(w) \leq r$, contradicting that $l(xw) < l(w)$. Conversely, if there exists a reduced expression of $w$ beginning in $x^{-1}$, say $w = x^{-1}x_{2}^{a_{2}}...x_{r}^{a_{r}}$ where $x_{j} \in X$ with $a_{j} = \pm 1$ for all $2 \leq j \leq r$, then $xw = x_{2}^{a_{2}}...x_{r}^{a_{r}}$ and so $l(xw) \leq r-1 < l(w)$. \end{proof} For the remaining results, we let $G$ be a group with group presentation $\langle X | R \rangle$ which satisfies the following conditions. \begin{itemize} \item[(\RomanNumeralCaps{1})] $X$ is a fixed set of involutions. That is, for each $x \in X$, $x^{2} = e$. \item[(\RomanNumeralCaps{2})] Every relation in $R$ has even length. \end{itemize} We establish some properties, analogous to the Coxeter case, of the length function on $G$. The first result is a consequence of Lemma $\ref{Exchange Lemma 2}$. \begin{lemma}\label{IG} Let $I = X \setminus \lbrace x \rbrace$ for some $x \in X$ and take $w \in G$ such that $w \neq e$. Then $w \in$ $^I G $ if and only if all reduced expressions of $w$ begin in $x$. \end{lemma} \begin{proof} If $w \in$ $ ^I G$ has a reduced expression beginning in $y$ for some $y \in X$ such that $y \neq x$ then $l(yw) < l(w)$, contradicting that $w \in$ $ ^I G$. Conversely, suppose $w \in G$ is such that all reduced expressions of $w$ begin in $x$. For any $y \in X$ such that $l(yw) < l(w)$ there exists a reduced expression of $w$ beginning in $y$, by Lemma $\ref{Exchange Lemma 2}$. Hence $y=x$ and so $w \in$ $^I G$. \end{proof} \begin{remark} It follows from Lemma \ref{IG} that $w \in$ $G^{I} $ if and only if all reduced expressions of $w$ end in $x$. \end{remark} The following result is analogous to \cite[Proposition 5.1]{Humphreys} for Coxeter groups. \begin{proposition}\label{5.1} There exists a surjective homomorphism $\varepsilon: G \longrightarrow \lbrace \pm 1 \rbrace$ defined by $\varepsilon: x \longmapsto -1$ for each $x \in X$. It follows that the order of each generator is 2. \end{proposition} \begin{remark} Suppose the group presentation $\langle X | R \rangle$ satisfies only condition $(\RomanNumeralCaps{2})$ and each generator has finite order. In this case, the surjective homomorphism $\varepsilon$ exists and the order of each generator $x \in X$ of $G$ is even. \end{remark} In \cite[Section 5.2]{Humphreys}, the length function on a Coxeter group is defined along with five basic properties. Below, we consider the length function on $G$. As for the Coxeter case, each element of the generating set $X$ of $G$ is an involution and so any element $w$ of $G$ can be written in the form $ w = x_{1}x_{2}...x_{r}$ for $x_{j} \in X$. So the length, $l(w)$, of $w \in G$, will be the smallest $r$ such that $w = x_{1}x_{2}...x_{r}$. \begin{lemma}\label{Length} For all $w_{1}, w_{2} \in G$ and $x \in X$ the following properties hold. \begin{itemize} \item[(1)] $l(w_{1}) = l(w_{1}^{-1})$. \item[(2)] $l(w_{1}) = 1 \text{ if and only if } w_{1} \in X$. \item[(3)] $l(w_{1}w_{2}) \leq l(w_{1}) + l(w_{2})$. \item[(4)] $l(w_{1}w_{2}) \geq l(w_{1}) - l(w_{2})$. \item[(5)] $l(w_{1}) - 1 \leq l(w_{1}x) \leq l(w_{1}) + 1$. \item[(6)] $l(w_{1}x) = l(w_{1}) \pm 1$ and $l(xw_{1}) \neq l(w_{1})$ \end{itemize} \end{lemma} \begin{proof} The proof is analogous to the Coxeter case, see \cite[Section 5.2]{Humphreys}. \end{proof} \begin{remark}\label{generalgroups2} The properties $(1)$, $(3)$ and $(4)$ in Lemma $\ref{Length}$ hold for a group with arbitrary presentation. It is easy to see that $(2)$ and $(6)$ fail for the trivial group given by the presentation $\langle x \vert x = e \rangle$. However, the property \begin{center} \begin{itemize} \item[($2^{\ast})$] $w_{1} \in X\cup X^{-1} $ implies $ l(w_{1}) \leq 1$ \end{itemize} \end{center} holds for any group with group presentation $\langle X \vert R \rangle$. We can then apply $(2^{\ast})$, $(3)$ and $(4)$ to prove that $(5)$ also holds for a group with arbitrary presentation. \end{remark} We are now ready to prove Proposition $\ref{decomposition}$. \begin{proof}[Proof of Proposition $\ref{decomposition}$] We proceed by induction on $l(w)$. If $l(w) = 1$ then $w = x$, for some $x \in X$. If $x \in I$, then we choose $a = e, b = x$ and, by Lemma $\ref{Length}\hspace{1mm}(2)$, this is the desired factorisation. If $x \notin I$, then we claim that $l(xy) > l(x)$ for all $y \in I$ and so we choose $a = x, b = e$. Taking any $y \in I$, if $l(xy) < l(x)$ then $l(xy) = 0$ as $l(x) = 1$, by Lemma $\ref{Length}\hspace{1mm}(2)$. Thus $xy = e$. It follows that $x = y \in I$, contradicting that $x \notin I$. As $l(xy) \neq l(x)$ by Lemma $\ref{Length}\hspace{1mm}(6)$, it must be that $l(xy) > l(x)$. Suppose $l(w) = r \geq 1$ and that the statement holds for every element of $G$ of shorter length. If $w \in G^{I}$ then we choose $b=e$ and $a =w$. Similarly, if $w \in G_{I}$ then we choose $a=e$ and $b=w$. So we need only consider the case when $w \notin G^{I}$ and $w \notin G_{I}$. As $w \notin G^{I}$, there exists $x \in I$ such that $l(wx) < l(w)$. By Lemma $\ref{Length}\hspace{1mm}(5)$, $l(wx) = l(w)-1 < r$. By induction, there exists $a' \in G^{I}$ and $b' \in G_{I}$ such that $wx = a'b'$ and $$l(wx) = l(w)-1 = l(a') + l(b').$$ Let $a=a'$ and $ b = b'x$. Then $ab = a'b'x = (wx)x = wx^{2} = w.$ It remains to show that $l(b'x)=l(b')+1$, giving $l(a) + l(b) = l(a') + l(b'x) = l(a')+l(b') +1 = l(wx) + 1 = l(w)$. We assume, for a contradiction, that $l(b'x) < l(b')$. That is, by Lemma $\ref{Length}\hspace{1mm}(5)$, $l(b'x) = l(b')-1$. By the above, $wx = a'b'$, so $w = a'b'x$, and $l(wx) = l(a') + l(b')$. Thus \begin{align*} l(w) = l(a'b'x) &\leq l(a')+l(b'x) \\ &= l(a') + (l(b')-1)\\ &=(l(a')+l(b'))-1 \\ &=l(wx)-1 \\ &<l(wx), \end{align*} contradicting the fact that $l(wx) < l(w)$. Since $l(b'x) \neq l(b')$ by Lemma $\ref{Length}\hspace{1mm}(6)$, we have $l(b'x) > l(b')$ and so $l(b'x)=l(b')+1$ by Lemma $\ref{Length}\hspace{1mm}(5)$. Therefore, $l(w) = l(a)+l(b)$. Finally, we note that $a=a' \in G^{I}$ and, as $x, b' \in G_{I}$, we have that $b \in G_{I}$. Thus we have obtained the required factorisation of $w$. \end{proof} \begin{remark} By applying Proposition $\ref{decomposition}$ to $w^{-1}$, it can be shown that, for any $I \subseteq X$, every element $w \in G$ has a factorisation $w = ab$ for some $ a \in G_{I}, b \in $ $^{I}G$ such that $l(w) = l(a) + l(b)$. \end{remark} \begin{remark} Proposition $\ref{decomposition}$ does not hold in general for groups with an arbitrary group presentation. A counterexample is given by the the Klein four-group, $\mathcal{V} = \lbrace e, i, j, k \rbrace$ \cite[Section 44.5]{K4}, which has group presentation: $$\mathcal{V} = \langle i, j, k \vert i^{2} = j^{2} = k^{2} = ijk = e \rangle.$$ Taking $w = j$, this is a unique reduced expression of $w$. We have $\mathcal{V}_{\lbrace i \rbrace} = \lbrace e, i \rbrace$ and so $j \notin \mathcal{V}_{\lbrace i \rbrace}$. However, $ji = k$ and so $l(ji) = l(j)$, meaning $w \notin \mathcal{V}^{\lbrace i \rbrace}$. Thus $j$ has no reduced factorisation with respect to $\mathcal{V}_{\lbrace i \rbrace}$. \end{remark} As stated in \cite[Proposition 2.4.4]{Bjorner}, in the Coxeter case this factorisation exists and is furthermore unique. The element in the factorisation lying in the set $W^{I}$ can be shown to be the unique element of $wW_{I}$ of minimal length \cite[Proposition 1.10]{Humphreys}. The uniqueness of these minimal length coset elements distinguish them as coset representatives and they are referred to as the \textit{minimal coset representatives} \cite[Section 1.10]{Humphreys}. Thus the set $wW_{I}\cap W^{I}$ contains only one element, namely the minimal coset representative of $wW_{I}$. The uniqueness of the factorisation for elements of Coxeter groups is a consequence of the Deletion Condition and is not a property that is transferable to the factorisations of elements in $G$ with respect to given parabolic subgroup, $G_{I}$. A counterexample proving this will be given in the next section. However, in the cases when $I = X$ and $\vert I \vert = 1$ the factorisation of all elements of the group with respect to the corresponding parabolic subgroup will be unique. \begin{lemma}\label{unique case} If $I = X$ or $I = \lbrace x \rbrace$ for some $x \in X$, then for all $w \in G$, $wG_{I}\cap G^{I}$ contains a unique element. Hence the factorisation of each element of $G$ with respect to $G_{I}$ is unique. \end{lemma} \begin{proof} If $I = X$ then $G_{I} = G$ and $G^{I} = \lbrace e \rbrace$, thus $wG_{I}\cap G^{I} = \lbrace e \rbrace$. If $I = \lbrace x \rbrace$ for some $x \in X$, then $G_{I} = \lbrace e, x \rbrace$, as $X$ is a fixed set of involutions generating $G$, and $wG_{I} = \lbrace w, wx \rbrace$ for any $w \in G$. By Lemma $\ref{Length} (6)$, $l(wx) = l(w) \pm 1$ meaning that exactly one of $w$ or $wx$ is an element of $G^{I}$ and thus the unique element in $ wG_{I}\cap G^{I}$. We conclude that, in both cases, the factorisation of any $w \in G$ with respect to $G_{I}$ is unique as if $w = ab = a'b'$ where $a, a' \in G^{I}$ and $b, b' \in G_{I}$, then $a, a' \in wG_{I}\cap G^{I}$. Thus $a = a'$ and consequently $b = b'$. \end{proof} \section{Non-uniqueness of factorisations.}\label{clustergroups} In this section, we present a counterexample demonstrating that the factorisations, shown to exist by Proposition \ref{decomposition}, for elements of a group with a presentation whose generators are involutions and whose relations are of even length are not necessarily unique. Specifically, we consider the finite group, $G$, arising from the group presentation $\langle t_{1}, t_{2}, t_{3} | R \rangle$, where $R$ is the following set of relations: \begin{itemize} \item[$(a)$] $t_{1}^{2} = t_{2}^{2} = t_{3}^{2} = e$ \textit{(each generator is an involution)}. \item[$(b)$] $t_{1}t_{2}t_{1} = t_{2}t_{1}t_{2}, \hspace{0.3cm} t_{1}t_{3}t_{1} = t_{3}t_{1}t_{3}, \hspace{0.3cm} t_{2}t_{3}t_{2} = t_{3}t_{2}t_{3}$ \textit{(the braid relations)}. \item[$(c)$] $t_{1}t_{2}t_{3}t_{1} = t_{2}t_{3}t_{1}t_{2} = t_{3}t_{1}t_{2}t_{3}$ \textit{(the cycle relation)}. \end{itemize} We note that the above group presentation of $G$ satisfies conditions $(\RomanNumeralCaps{1})$ and $(\RomanNumeralCaps{2})$, thus Proposition \ref{decomposition} holds for elements of $G$ with respect to a given parabolic subgroup. \begin{remark} This group presentation is a \textit{cluster group presentation}. Cluster groups are groups defined by presentations arising from cluster algebras. It was first shown in \cite{BM} and then in \cite{GM} that a group presentation could be associated to a quiver appearing in a seed of a cluster algebra of finite type and that the corresponding group is invariant under mutation of the quiver \cite[Lemma 2.5]{GM}, \cite[Theorem 5.4]{BM}. For detailed definitions of cluster algebras and quiver mutation, see \cite[Chapter 2]{Marsh}. It is the group presentation based on the work done in \cite{GM}, that was considered more generally in \cite{Webster} where, due to the context, the corresponding groups were labelled \textit{cluster groups}. Each quiver appearing in a cluster algebra of finite type is mutation-equivalent to an oriented Dynkin diagram \cite[Theorem 1.4]{FZ} and the corresponding cluster group presentation is precisely a Coxeter presentation. Consequently, a cluster group associated to a mutation-Dynkin quiver is isomorphic to the finite reflection group of the same Dynkin type. The presentation defined above is the cluster group presentation associated to the quiver of mutation-Dynkin type $A_{3}$ in Figure \ref{fig: quiver}. \begin{figure}[!htb] \center{ \begin{tikzpicture} \node (v0) at (0:0)[text width=0.5cm] {$1$}; \node (v1) at (0:2)[text width=0.5cm] {$2$}; \node (v6) at (30:2) {}; \node (v4) at (0:4)[text width=0.5cm] {$3$}; \draw[<-] (v0) -- (v1); \draw[->] (v4) -- (v1); \draw[<-] (v4) .. controls (v6) .. (v0); \end{tikzpicture} \caption{\label{fig: quiver} $G$ is the cluster group corresponding \\ to the above quiver of mutation-Dynkin type $A_{3}$.}} \end{figure} \end{remark} It was shown in \cite[Lemma 3.10]{Webster} that an isomorphism between a cluster group associated to a mutation-Dynkin quiver of type $A_{n}$ and the symmetric group on $n+1$ elements, denoted by $\Sigma_{n+1}$, can be constructed explicitly from the quiver. It follows from \cite[Lemma 3.10]{Webster} that the following map defines an isomorphism between $G$ and $\Sigma_{4}$. \begin{lemma}\label{braidgraphiso1} \cite[Proposition 3.4]{Ser}, \cite[Lemma 3.10]{Webster} There exists an isomorphism $\pi: G \longrightarrow \Sigma_{4}$ given by \begin{align*} \pi: &t_{1} \longmapsto (1, 2), \\ \pi: &t_{2} \longmapsto (2, 3), \\ \pi: &t_{3} \longmapsto (2, 4). \end{align*} \end{lemma} From Lemma $\ref{braidgraphiso1}$, we conclude that $G$ contains 24 distinct elements. Moreover, we can use this isomorphism to determine that $t_{i}t_{j}t_{i}t_{k} = t_{k}t_{i}t_{j}t_{i}$ for all combinations of pairwise distinct $i, j, k$. Using this together with the group relations, we construct the Cayley graph of $G$ with respect to this presentation, which is displayed in Figure \ref{fig: Cayley graph}. Our goal is to choose a subset, $I$, of the generating set of $G$ such that we can find an element of $G$ with two distinct factorisations with respect to the corresponding parabolic subgroup, thus proving the factorisations shown to exist in Proposition \ref{decomposition} are not necessarily unique. Due to Lemma \ref{unique case}, $I$ must contain two distinct elements. Take $I = \lbrace t_{1}, t_{2} \rbrace$. From the Cayley graph of $G$ (Figure \ref{fig: Cayley graph}) we have \begin{center} $G^{I} = \lbrace e, \hspace{0.2cm} t_{3},\hspace{0.2cm} t_{1}t_{3},\hspace{0.2cm} t_{2}t_{3}, \hspace{0.2cm}t_{1}t_{2}t_{3},\hspace{0.2cm} t_{2}t_{1}t_{3} \rbrace. $ \end{center} For $ w = t_{2}t_{3}t_{1}t_{2}$, we have $a = t_{2}t_{3} \in G^{I} $ and $ b = t_{1}t_{2} \in G_{I}$. Using the Cayley graph of $G$ in Figure \ref{fig: Cayley graph}, we observe that each of these are all reduced expressions and so $a$ and $b$ yield a factorisation of $w$ as given in Proposition \ref{decomposition}. Moreover, we can apply the cycle relation to $w$ to obtain another reduced expression of $w$, $w = t_{1}t_{2}t_{3}t_{1}$. Let $a' = t_{1}t_{2}t_{3} \in G^{I} $ and $b'=t_{1} \in G_{I}$. As this expression for $a'$ is a subexpression of a reduced expression of $w$, it must be reduced. From Lemma \ref{braidgraphiso1} we conclude that $t_{i} \neq e$ for $i = 1, 2, 3$, thus $t_{1}$ is also reduced. Clearly, as $a$, $a'$ and $b$, $b'$ are of different lengths, these are distinct pairs of elements in $G^{I}$ and $G_{I}$, respectively. Thus, we obtain distinct factorisations $w = ab = a'b'$ where $l(w) = l(a) + l(b) = l(a') + l(b')$ for $a, a' \in G^{I}$ and $b, b' \in G_{I}$. This counterexample demonstrates that for a group $G$ with presentation $\langle X \vert R \rangle $ satisfying conditions $(\RomanNumeralCaps{1})$ and $(\RomanNumeralCaps{2})$, unlike in the Coxeter case, it is possible for the set $wG_{I}\cap G^{I}$ to have more than one element for some $I \subseteq X$ and $w \in G$. In the counterexample above, two distinct elements in this set are given by $a = t_{2}t_{3}$ and $a'= t_{1}t_{2}t_{3}$ for $ w = t_{2}t_{3}t_{1}t_{2}$. Furthermore, for a Coxeter group, $W$, the unique factorisation of an element $w \in W$ with respect to a parabolic subgroup, $W_{I}$, is determined by the unique minimal length element of the coset $wW_{I}$ \cite[Corollary 2.4.5]{Bjorner}. In the more general case, the same example used to demonstrate that the factorisation is not necessarily unique can also be used to show that minimal length elements of $wG_{I}$ do not necessarily yield factorisations of $w$. Indeed, from the Cayley graph in Figure \ref{fig: Cayley graph}, we have \begin{center} $G_{I} = \lbrace e, \hspace{0.2cm} t_{1},\hspace{0.2cm} t_{2},\hspace{0.2cm} t_{1}t_{2}, \hspace{0.2cm}t_{2}t_{1},\hspace{0.2cm} t_{1}t_{2}t_{1} = t_{2}t_{1}t_{2} \rbrace. $ \end{center} Choosing $w = t_{1}t_{2}t_{3} \in G^{I}$, we observe from the Cayley graph that this is a unique reduced expression of $w$ and so the only factorisation with respect to $G_{I}$ is obtained by taking $a = w$ and $b = e$. However, \begin{center} $wG_{I} = \lbrace t_{1}t_{2}t_{3}, \hspace{0.2cm} t_{1}t_{2}t_{3}t_{1},\hspace{0.2cm} t_{1}t_{2}t_{3}t_{2},\hspace{0.2cm} t_{2}t_{3}t_{1}, \hspace{0.2cm}t_{2}t_{3}t_{2},\hspace{0.2cm} t_{2}t_{3} \rbrace.$\end{center} Thus no factorisation of $w$ can be obtained from the minimal length element, $t_{2}t_{3}$, of $wG_{I}$. The property that this factorisation is unique for elements of $W$, and determined by the unique minimal length element of $wW_{I}$, is a result of the Deletion Condition \cite[Theorem 1.7]{Humphreys}. The Deletion Condition is a characterising result for Coxeter groups. That is, if $W$ is a group and $S$ a set of involutions generating $W$, then $(W, S)$ has the Deletion Condition if and only if $(W, S)$ is a Coxeter system \cite[Theorem 1.5.1]{Bjorner}. Considering the proof of \cite[Proposition 1.10(c)]{Humphreys}, we see that the factorisations of $w$ with respect to $G_{I}$, as taken in the above counterexample, are no longer unique or determined by the minimal length elements of $wG_{I}$ because, without the Deletion Condition, we can no longer omit certain factors from a non-reduced expression of $w$ and leave $w$ unchanged. \newpage \begin{figure}[H] \center{ \begin{tikzpicture} \newdimen\R \R=2cm \draw[xshift=-1.49\R, yshift=-.88\R] (0:\R) \foreach \x in {60, 120, 180, 240, 300, 360} { -- (\x:\R) }; \foreach \x in {120, 240} \node[xshift=-1.49\R, yshift=-.88\R, inner sep=1pt,circle,draw,fill,label={}] at (\x:\R) {}; \node[xshift=-1.49\R, yshift=-.88\R, inner sep=1.5pt,circle,draw,fill=orange,label={}] at (180:\R) {}; \node[xshift=-2.2\R, yshift=-.88\R, align=center] at (180:\R) {$t_{3}t_{2}t_{1}t_{2} = t_{3}t_{1}t_{2}t_{1}$ \\ \color{gray} $(1, 3)(2, 4)$}; \node[xshift=-2\R, yshift=-.88\R, align=center] at (120:\R) {$t_{3}t_{1}t_{2}$ \\ \color{gray} $(2, 3, 1, 4)$}; \node[xshift=-2\R, yshift=-.88\R, align=center] at (240:\R) {$t_{3}t_{2}t_{1} $ \\ \color{gray} $(1, 3, 4, 2)$}; \draw[xshift=-1.49\R, yshift=-2.62\R] (0:\R) {(120:\R) -- (180:\R) }; \node[xshift=-1.49\R, yshift=-2.62\R, inner sep=1.5pt,circle,draw,fill=pink,label={}] at (180:\R) {}; \node[xshift=-1.49\R, yshift=-2.95\R, align=center] at (180:\R) {$t_{3}t_{2}t_{1}t_{3} $ \\ \color{gray}$(4, 1, 3)$}; \draw[xshift=-1.49\R, yshift=.86\R] (0:\R) {(360:\R) -- (60:\R) }; \node[xshift=-1.49\R, yshift=.86\R, inner sep=1.5pt,circle,draw,fill=blue,label={}] at (60:\R) {}; \node[xshift=-1.49\R, yshift=1.18\R, align=center] at (60:\R) {$t_{3}t_{1}t_{3}t_{2} = t_{1}t_{3}t_{1}t_{2}$ \\ \color{gray} $(1, 4, 3)$}; \draw (0:\R) \foreach \x in {60,120, 180, 240, 300, 360} { -- (\x:\R) }; \foreach \x in {60,120, 180, 240, 300, 360} \node[inner sep=1pt,circle,draw,fill,label={}] at (\x:\R) {}; \node[xshift=0.4\R, align=center] at (60:\R) {$t_{1}t_{3}$ \\ \color{gray}$(2, 4, 1)$}; \node[xshift=-0.35\R, yshift=0.1\R, align=center] at (120:\R) {$t_{3}t_{1}t_{3} = t_{1}t_{3}t_{1}$ \\ \color{gray}$(1, 4)$}; \node[xshift=0.4\R, align=center] at (180:\R) {$t_{3}t_{1}$ \\ \color{gray}$(1, 4, 2)$}; \node[xshift=-0.35\R, align=center] at (240:\R) {$t_{3}$ \\ \color{gray}$(2, 4)$}; \node[xshift=0.2\R, align=center] at (300:\R) {$e$ \\ \color{gray}$()$}; \node[xshift=-0.35\R, align=center] at (360:\R) {$t_{1}$ \\ \color{gray}$(1, 2)$}; \draw[xshift=-1.49\R, yshift=.86\R] (0:\R) {(180:\R) -- (240:\R) }; \node[xshift=-1.49\R, yshift=.86\R, inner sep=1.5pt,circle,draw,fill=red,label={}] at (180:\R) {}; \node[xshift=-1.49\R, yshift=1.18\R, align=center] at (180:\R) {$t_{3}t_{1}t_{2}t_{3}$ \\ \color{gray} $(1, 4)(2, 3)$}; \draw[xshift=1.49\R, yshift=.86\R] (0:\R) \foreach \x in {60,120,...,360} { -- (\x:\R) }; \foreach \x in {120, 360} \node[xshift=1.49\R, yshift=.86\R, inner sep=1pt,circle,draw,fill,label={}] at (\x:\R) {}; \node[xshift=1.49\R, yshift=.88\R, inner sep=1.5pt,circle,draw,fill=green,label={}] at (60:\R) {}; \node[xshift=2\R, yshift=1\R, align=center] at (60:\R) {$t_{1}t_{3}t_{2}t_{3} = t_{1}t_{2}t_{3}t_{2}$ \\ \color{gray}$(1, 2)(3, 4)$}; \node[xshift=1\R, yshift=1.01\R, align=center] at (120:\R) {$t_{1}t_{3}t_{2} $ \\ \color{gray}$(2, 3, 4, 1)$}; \node[xshift=1\R, yshift=.86\R, align=center] at (360:\R) {$t_{1}t_{2}t_{3}$ \\ \color{gray}$(2, 4, 3, 1)$}; \draw[yshift=1.74\R] (0:\R) {(360:\R) -- (60:\R) }; \node[xshift=-0.025\R, yshift=1.78\R, inner sep=1.5pt,circle,draw,fill=pink] at (60:\R) {}; \node[yshift=2\R, align=center] at (60:\R) {$t_{1}t_{3}t_{2}t_{1}$ \\ \color{gray} $(4, 1, 3)$}; \draw[xshift=2.98\R] (0:\R) {(120:\R) -- (60:\R) }; \node[xshift=2.98\R, inner sep=1.5pt,circle,draw,fill=pink,label={}] at (60:\R) {}; \node[xshift=3.35\R, yshift=0.5, align=center] at (60:\R) {$t_{1}t_{2}t_{3}t_{1}$ \\ \color{gray} $(1, 4, 3)$}; \draw[yshift=-1.74\R] (0:\R) \foreach \x in {60,120, 180, 240, 300, 360} { -- (\x:\R) }; \foreach \x in {60,120, 180, 240, 300, 360} \node[yshift=-1.74\R, inner sep=1pt,circle,draw,fill,label={}] at (\x:\R) {}; \node[xshift=0.4\R, yshift=-1.74\R, align=center] at (180:\R) {$t_{3}t_{2}$ \\ \color{gray}$(3, 4, 2)$}; \node[xshift=-0.31\R, yshift=-1.74\R, align=center] at (240:\R) {$t_{3}t_{2}t_{3} = t_{2}t_{3}t_{2}$ \\ \color{gray}$(3, 4)$}; \node[xshift=0.4\R, yshift=-1.74\R, align=center] at (300:\R) {$t_{2}t_{3}$ \\ \color{gray}$(2, 4, 3)$}; \draw[xshift=-1.49\R, yshift=-2.62\R] (0:\R) \foreach \x in {60,120,...,360} { (300:\R) -- (360:\R)}; \node[xshift=-1.49\R, yshift=-2.62\R, inner sep=1.5pt,circle,draw,fill=green] at (300:\R) {}; \node[xshift=-1.49\R, yshift=-2.88\R, align=center] at (300:\R) {$t_{3}t_{2}t_{3}t_{1} = t_{2}t_{3}t_{2}t_{1}$ \\ \color{gray} $(1, 2)(3, 4)$}; \draw[xshift=1.49\R, yshift=-.88\R] (0:\R) \foreach \x in {300, 360, 60} { -- (\x:\R) }; \foreach \x in {60,120, 300, 360} \node[xshift=1.49\R, yshift=-.88\R, inner sep=1pt,circle,draw,fill,label={}] at (\x:\R) {}; \node[xshift=1.9\R, yshift=-.88\R, align=center] at (60:\R) {$t_{1}t_{2}$ \\ \color{gray}$(2, 3, 1)$}; \node[xshift=1.2\R, yshift=-.9\R, align=center] at (240:\R) {$t_{2}$ \\ \color{gray}$(2, 3)$}; \node[xshift=1.9\R, yshift=-.9\R, align=center] at (300:\R) {$t_{2}t_{1}$ \\ \color{gray}$(1, 3, 2)$}; \node[xshift=1.14\R, yshift=-.84\R, align=center] at (360:\R) {$t_{1}t_{2}t_{1} = t_{2}t_{1}t_{2}$ \\ \color{gray}$(1, 3)$}; \draw[xshift=2.98\R, yshift=-1.74\R] (0:\R) {(120:\R) -- (60:\R) }; \node[xshift=2.98\R, yshift=-1.74\R, inner sep=1.5pt,circle,draw,fill=orange,label={}] at (60:\R) {}; \node[xshift=3.5\R, yshift=-1.7\R, align=center] at (60:\R) {$t_{1}t_{2}t_{1}t_{3} = t_{2}t_{1}t_{2}t_{3}$ \\ \color{gray} $(1, 3)(2, 4)$}; \draw[xshift=1.49\R, yshift=-2.62\R] (0:\R) \foreach \x in {60,120, 180, 240, 300, 360} { -- (\x:\R) }; \foreach \x in {240, 360} \node[xshift=1.49\R, yshift=-2.62\R, inner sep=1pt,circle,draw,fill,label={}] at (\x:\R) {}; \node[xshift=1.49\R, yshift=-2.62\R, inner sep=1.5pt,circle,draw,fill=blue,label={}] at (300:\R) {}; \node[xshift=1\R, yshift=-2.62\R, align=center] at (240:\R) {$t_{2}t_{3}t_{1}$ \\ \color{gray}$(1, 4, 3, 2)$}; \node[xshift=2.3\R, yshift=-2.62\R, align=center] at (300:\R) {$t_{2}t_{3}t_{1}t_{3} = t_{2}t_{1}t_{3}t_{1} $ \\ \color{gray}$(1, 4)(2, 3)$}; \node[xshift=1\R, yshift=-2.62\R, align=center] at (360:\R) {$t_{2}t_{1}t_{3}$ \\ \color{gray}$(2, 4, 1, 3)$}; \draw[xshift=2.98\R, yshift=-1.74\R] (0:\R) {(240:\R) -- (300:\R) }; \node[xshift=3.3\R, yshift=-1.74\R, align=center] at (300:\R) {$t_{2}t_{1}t_{3}t_{2} $ \\ \color{gray}$(4, 1, 3)$}; \node[xshift=2.98\R, yshift=-1.74\R, inner sep=1.5pt,circle,draw,fill=pink,label={}] at (300:\R) {}; \draw[xshift=1.49\R, yshift=-4.36\R] (0:\R) {(120:\R) -- (180:\R) }; \node[xshift=1.49\R, yshift=-4.36\R, inner sep=1.5pt,circle,draw,fill=red,label={}] at (180:\R) {}; \node[xshift=1.49\R, yshift=-4.8\R, align=center] at (180:\R) {$t_{2}t_{3}t_{1}t_{2} $ \\ \color{gray}$(1, 4, 3)$}; \end{tikzpicture} \caption{\label{fig: Cayley graph} The Cayley graph of $(G, \lbrace t_{1}, t_{2}, t_{3} \rbrace)$ and the corresponding permutations of each element under $\pi$. The coloured nodes denote an identification of vertices.}} \end{figure} \newpage
\section{Keywords:} Higgs boson, Beyond the Standard Model, Extended Higgs sectors, Renormalization Group, Multiple Point Principle, Dark Matter} % \end{abstract} \section{Introduction} \label{sec:introduction} It is widely believed that investigations of the Higgs boson and the resulting breaking of Electroweak Symmetry provide the best opportunity for finding new physics beyond the Standard Model (SM). In part, this is because the Higgs boson is the most recently discovered fundamental particle \cite{Aad:2012tfa}, and investigations of its properties are still underway (though so far no significant deviation from the SM has been observed \citep{Aad:2015zhl, Khachatryan:2014kca, Khachatryan:2014jba, Aad:2015gba}). This view is reinforced by the required relative smallness of the Higgs boson mass and its related {\em hierarchy problem}. Since the SM Higgs boson mass is unprotected by any symmetries, it should have large quantum corrections of magnitude comparable to the scale of new physics. To restore a physical Higgs mass of order the Electroweak scale one must {\em fine-tune} to ensure the unnatural cancelation of the bare Higgs mass with its corrections. Provided there is new physics of some type beyond the SM (a reasonable assumption, given its large number of problems and omissions) this is a genuine and very real issue that must be addressed. The combined ATLAS and CMS value of the Higgs mass \citep{Aad:2015zhl}, $m_h = 125.09 \pm 0.23\,$GeV, raises further questions. This is a challenging value for both supersymmetry and composite Higgs models, requiring a significant tuning of parameters or a non-minimal field content \citep{Buttazzo:2013uya,Craig:2013cxa,Ross:2017kjc}, making it difficult to motivate any particular models and unclear which direction to head next. However, this particular mass has another reason for being peculiar - it is just the right value to allow the Higgs potential to be {\em metastable} at high energies \cite{Buttazzo:2013uya}. As usual for a parameter of a Quantum Field Theory, the Higgs quartic coupling $\lambda$ evolves with energy according to the Renormalization Group (RG) and is pulled downwards at higher energies by the large top-quark mass. If it were to run to negative values the potential may become unstable and the correct pattern of Electroweak Symmetry breaking is lost. Indeed, requiring absolute stability of the vacuum up to the Planck scale $M_{\rm Pl}$, i.e.\ $\lambda(M_{\rm Pl}) \ge 0$, places a limit on the top mass \cite{Buttazzo:2013uya}, \begin{equation} \label{eq:SM_topmassstabilitylimit} m_t < 171.36 \pm 0.46 \text{ GeV}, \end{equation} which is in tension with the current experimental value by about $2.6 \, \sigma$. Figure~\ref{fig:SM_lambda_beta}(a) shows the quartic coupling dependence on renormalization scale $\mu$, and the $3 \, \sigma$ uncertainties that arise from the uncertainties in the top-quark mass $m_t$ and the strong coupling constant $\alpha_s$. The quartic coupling turns negative at an energy scale of $\mu \sim 10^{10}$ GeV, though a stable potential is not ruled out due to the uncertainties. However, a very small negative value is not a catastrophe, since the vacuum may still be {\em metastable} with a lifetime much longer than the age of the universe. That nature should choose this metastable vacuum is intriguing. Why does the quartic coupling become so very nearly zero right at the Planck scale? \begin{figure}[htb] \centering \includegraphics[width=\textwidth]{Figure_1.pdf} \caption{Three-loop running of the SM Higgs quartic coupling $\lambda$ and its $\beta$ function with $3 \, \sigma$ uncertainties from the top pole mass $m_t$ (dashed) and the strong coupling constant $\alpha_s$ (dotted). These plots originally appeared in Ref.~\cite{McDowall:2018tdg}. \label{fig:SM_lambda_beta}} \end{figure} We may gain further insight by examining the beta-function of the quartic coupling, shown in Figure~\ref{fig:SM_lambda_beta}(b). As indicated already in Figure~\ref{fig:SM_lambda_beta}(a), the running of $\lambda$ flattens out at high energies, i.e.\ $\beta_{\lambda}(M_{\rm Pl}) \approx 0$ too. We stress that in the SM this is {\em not} an ultraviolet fixed-point since $\lambda$ would continue to evolve if we increased the energy further. However, if some new physics theory takes over above the Planck scale, then the SM running becomes irrelevant and we must instead consult the new theory. If this new theory sets $\lambda = \beta_\lambda=0$ at the Planck scale we may recover a low energy phenomenology very similar to what we observe, modulo the slight deviation in the Higgs mass. In this article, we will review one proposed high scale possibility, the {\em Mutliple Point Principle} (MPP) \cite{Froggatt:1995rt}. Although this is not compatible with the SM running, it provides a Higgs mass prediction that is curiously close to the measured value. We will then examine several theories with extended Higgs sectors to see if they alter the running sufficiently to provide the correct Higgs mass. For recent investigations of alternative high scale boundary conditions at $M_{\rm Pl}$ see, for example, Refs.~\citep{Degrassi:2012ry,Holthausen:2011aa,Iacobellis:2016eof,Eichhorn:2014qka,Khan:2014kba,Helmboldt:2016mpi}. \section{The Multiple Point Principle in the SM} The Multiple Point Principle (MPP) asserts that nature chooses the Higgs potential parameters so that different phases of electroweak symmetry breaking may coexist. This is analagous to how ice, water and vapour may coexist for specific values of temperature and pressure near water's triple-point. Since the two phases must be energetically comparable in order to coexist, this means that the potential should have at least two degenerate vacua, that is an additional vacuum degenerate with the usual Electroweak vacuum. The authors of this principle argue in Ref.~\cite{Froggatt:1995rt} that this is rather natural if we consider {\em extensive} variables constrained by some new physics theory at high energies, as long as the system has a rather strong first order phase transition. Again we may use the analogy of water and note that slush (in which ice and liquid water coexist) is present for a (relatively) wide range of extensive variables (in this case temperature and pressure) due to the existence of a first order phase transition. Returning to the Higgs potential, a possible {\em extensive} quantity could be $\langle |\phi|^2 \rangle$. If this were set by some new physics theory at the Planck scale with a strong first order phase transition, it would be rather likely to find $\langle |\phi|^2 \rangle\sim M_{\rm Pl}^2$, leading to a second degenerate vacuum at the Planck Scale. In essense, this principle is relying on a rather flat distribution of {\em extensive} parameter space set at the Planck scale matching to a rather peaked distribution of {\em intensive} parameters (i.e.\ the usual Higgs potential parameters) due to a strong first-order phase transition, which in turn leads to a second degenerate vacuum \cite{bennett:1996hx} We should note that what this Planck scale theory could be is still unknown, and Ref.~\cite{Froggatt:1995rt} makes no attempt to describe one, using only general principles to support the assertion. Also, we note that this provides no explanation of why the Planck scale is so much bigger than the electroweak scale. Nevertheless, the contraints on the Higgs parameters does provide a {\em prediction} of the Higgs boson mass that can be compared with experiment, and we further note that this prediction was first made long before the Higgs boson discovery. The one-loop Coleman-Weinberg effective potential~\cite{Coleman:1973jx} can be written, \begin{equation} V_{\rm eff} = - \mu^2(\mu) \phi^2 + \frac{1}{4} \lambda \left( \mu \right) \phi^4(\mu) + \frac{1}{16\pi^2} V_1, \end{equation} where $V_1$ takes the schematic form $V_1 \sim \phi^2 \log \left( \phi^2/\mu^2 \right)$. For a more explicit form see, for example, Ref.~\cite{Jegerlehner:2014xxa}. We see that at one-loop, in addition to the new logarithmic contribution, the parameters $\mu$ and $\lambda$ become energy dependent. For low field values (and low energies) this reproduces the usual ``wine-bottle'' potential of the Higgs mechanism, but for higher field values, the logarithm pulls the potential back down. Eventually the $\phi^4$ terms becomes dominant and the potential will remain stable at the Planck scale if $\lambda(M_{\rm Pl})>0$. However, the additional structure causes a second minimum very close to the Planck scale. This is schematically depicted in Figure~\ref{fig:SMpot}. In the SM, taking the measured central values of the Higgs potential parameters, the second vacuum is of slightly lower energy than the Electroweak vacuum, causing the potential to be metastable. The MPP posits that the two minima should be degenrate. \begin{figure}[htb] \centering \includegraphics[width=0.5 \textwidth]{Figure_2.pdf} \caption{A schematic depiction of the one-loop effective potential in the SM. This is intended only to present a general picture of the minima and is not to scale. \label{fig:SMpot}} \end{figure} For high field values the effective potential is dominated by its quadratic term, $V_{\rm eff} \approx \lambda \left( \mu \right) \phi^4$, so the second minima at the Planck scale requires \begin{equation} \label{eq:SM_MPP} \frac{d V_{\rm eff}}{d \phi} \bigg\vert_{\phi=M_{\rm Pl}} \approx \lambda \left( \mu \right) \phi^3 + \frac{1}{4} \beta_{\lambda} \left( \mu \right) \phi^4 = 0. \end{equation} We see that the MPP is satisfied if $\lambda(M_{\rm Pl}) = \beta_{\lambda}(M_{\rm Pl}) =0$. Applying this boundary condition, the MPP hypothesis gave an early prediction~\cite{Froggatt:1995rt} of the Higgs mass $m_h = 135 \pm 9$ GeV, which is remarkably good considering it was made 17 years before the discovery of the Higgs boson, and they simultaneously predicted the top-quark mass (finding $173 \pm 5\,$GeV) in the same year it was discovered. A more recent calculation using the measured top-quark mass and newer determinations of e.g.\ $\alpha_s$, gave $m_h = 129 \pm 1.5$ GeV \cite{Buttazzo:2013uya}. Although this is slightly too high to be compatible with our by now very accurate Higgs mass measurement, it is still rather remarkable. Figure \ref{fig:SM_lambdabetalambda}(a) shows contours corresponding to the boundary conditions $\lambda(M_{\rm Pl})=0$ and $\beta_{\lambda} \left( M_{Pl} \right) = 0$ in the $m_h-m_t$ plane, and we see that a slighly heavier Higgs is needed for both conditions to be satisfied. These contours are calculated using three-loop SM RG equations; the Higgs mass is calculated to two-loop order, while the top mass additionally contains three-loop QCD corrections. This plot is in agreement with the similar plot in Ref.~\citep{Degrassi:2012ry}, but we used a different value of the uncertainty in the strong coupling constant $\alpha_s \left( M_Z \right) = 0.1181 \pm 0.0013$ to reflect more recent estimates \cite{PDG:2015}. We also use the reduced Planck scale $M_{\rm Pl} = 2.4 \times 10^{18}\,$GeV as our scale at which these boundary conditions are set. Figure \ref{fig:SM_lambdabetalambda}(a) shows that $\lambda \left( M_{\rm Pl} \right) = 0$ can be satisfied with an acceptable value of $m_h$ for a top mass $171\, {\rm GeV} \lesssim m_t \lesssim 174\,$GeV, and although the corresponding value of $\beta_{\lambda} \left( M_{\rm Pl} \right)$ is not zero, it is extremely small. \begin{figure}[!tbp] \centering \includegraphics[width=\textwidth]{Figure_3.pdf} \caption{\textbf{(a)} $\lambda \left( M_{Pl} \right) = 0$ (red) and $\beta_{\lambda} \left( M_{Pl} \right) = 0$ (black) contours in the $m_h-m_t$ plane. The dashed lines show $3 \,\sigma$ variations in $\alpha_s \left( M_Z \right) = 0.1181 \pm 0.0013$. \textbf{(b)} Mass values that satisfy both boundary conditions at various UV scales. The green region corresponds to a $1\, \sigma$ uncertainty in $\alpha_s$. Ellipses show the experimentally allowed values of $m_t$ and $m_h$ with $1 \,\sigma$ (dark grey) and $3\,\sigma$ (light grey) uncertainty. These plots originally appeared in Ref.~\cite{McDowall:2018tdg}. \label{fig:SM_lambdabetalambda}} \end{figure} Note that we have required that these boundary conditions be satisfied at $M_{\rm Pl}$, but if the theory that dictates the appearance of a second minimum were to become active at a lower energy scale, these boundary conditions would need to be altered. Figure \ref{fig:SM_lambdabetalambda}(b) shows the $m_h-m_t$ plane with points that satisfy both boundary conditions $\lambda = \beta_{\lambda} = 0$ simultaneously at different UV scales. The green region corresponds to a $1\, \sigma$ uncertainty in $\alpha_s$. We see it is possible to obtain a Higgs mass that is within experimental limits by applying these boundary conditions at approximately $5 \times 10^{17}$ GeV. It's interesting to note that this is a scale of importance in string scenarios (see e.g \citep{Ginsparg:1987ee, Witten:1996mz}). As one approaches the Planck Scale, one might expect gravity to become significant and contribute to the RGE running of couplings. The study of these effects has caused some confusion in the literature. An initial calculation of the effect on the running of gauge couplings \cite{Robinson:2005fj}, using a quantised Einstein-Hilbert action as an effective field theory below the Planck scale, showed that this alters the gauge couplings sufficiently to render them asymptotically free. However, this calculation was disputed \cite{Pietrykowski:2006xy,Toms:2007sk} on the grounds that the derived result is gauge-dependent and therefore unreliable; a calculation performed with a different gauge choice (the harmonic gauge) instead revealed the contributions to be exactly zero. A recalculation was then done using the gauge-invariant background field method \cite{Toms:2010vy,Mackay:2009cf} and found a result in support of the original claim that the gauge coupling is rendered asymptotically free, though with a modified $\beta$-function. Also see Refs.~\cite{He:2010mt,Daum:2009dn} for alternative calculations. Calculations have also been performed to asses the affect on the quartic Higgs self-coupling relevant to the MPP \cite{Haba:2014qca,Wang:2015oka}. These two calculations disagree on the sign of the gravitational contributions to Yukawa couplings, but the corrections to the predicted Higgs mass are small; they predict a Higgs mass of ``approximately 130 GeV'' and ``$\gtrsim 131.5$ GeV'', neither of which are differing very far from the earlier prediction of $129 \pm 1.5$ GeV \cite{Buttazzo:2013uya} and remain incompatible with the SM. See also Ref.~\cite{Branchina:2018xdh} for a discussion of the effect on the electroweak vacuum of Planck suppressed operators. \section{A Real Singlet Extension} The simplest extension to the Higgs sector is to include an extra real singlet $S$, with potential, \begin{eqnarray} V \left( \Phi, S \right) &=& \mu^2 \Phi^{\dagger} \Phi + m_S^2 S^2 + \lambda \left( \Phi^{\dagger} \Phi \right)^2 + \lambda_S S^4 + k_2 \Phi^{\dagger} \Phi S^2, \label{eq:real_potential} \end{eqnarray} where a $Z_2$ symmetry, under which the new scalar is odd, has been used to eliminate terms odd in $S$ (see Ref.~\cite{Robens:2015gla} for a discussion of this model). During electroweak symmetry breaking, the real singlet field can acquire a non-zero vacuum expectation value (vev) $v_S$ alongside the SM Higgs. The usual Higgs scalar may then mix with the new singlet, though this mixing should not be too strong if we want to avoid LHC constraints. The singlet mass $m_S$ is fixed by the tadpole equation minimising the potential, analagous to the fixing of $\mu$ using the vev $v$. This leaves the parameters $\lambda$, $\lambda_S$, $k_2$ and $v_S$. We refer to this as the ``broken phase''. Alternatively, if the new scalar does not aquire a vev (i.e.\ $v_S=0$) the tadpole equation becomes trivial and cannot be used to remove $m_S$. Therefore we have parameters $\lambda$, $\lambda_S$, $k_2$ and $m_S$. Now the scalars do not mix, and the new scalar may be a Dark Matter candidate, so we refer to this as the ``Dark Matter phase''. This real singlet model has been investigated in the context of the MPP in Refs.~\citep{Haba:2013lga,Haba:2014sia,Haba:2016gqx,Hamada:2014xka,Kawana:2014zxa,Kawana:2015aca}, with varying results. Haba et al.\ \cite{Haba:2013lga} investigated the model in the Dark Matter phase for the MPP as well as the Veltman condition \cite{Veltman:1980mj}. They found that both boundary conditions could be accommodated (separately) with a 126 GeV Higgs boson, while simultaneously providing the correct DM relic density. An alternative approach was taken in Refs.~\cite{Haba:2014sia,Haba:2016gqx} where the MPP was instead imposed on the real singlet model with the addition of an extra right-handed neutrino. Again, the MPP could be made compatible with a 126 GeV Higgs boson provided the scalar mass fell between approximately $850 - 1400$ GeV and the right-handed neutrino remained very heavy (of order $10^{14}$ GeV). The MPP can instead be imposed at the ``string scale'' of $10^{17}$ GeV in order to facilitate Higgs inflation, which results in somewhat lighter DM at around $400-470$ GeV \cite{Hamada:2014xka}. Ref.~\cite{Kawana:2014zxa} includes three additional right-handed neutrinos (one for each generation) at $10^{13}$ GeV and instead of fixing the MPP condition at $M_{\rm Pl}$ allows the boundary condition energy scale to shift, insisting only that $\lambda=\beta_\lambda=0$ at a single scale. Similarly to the other analyses this finds the DM mass must be of order $770-1050$ GeV. Finally, Ref.~\cite{Kawana:2015aca} investigates a gauged B-L model, and claim that this can accommodate an MPP condition applied at $10^{17}$ GeV, as well as Higgs inflation, by tuning the coupling of the Higgs boson to the new scalar. We see that applying the Planck scale MPP to the real singlet model requires $\lambda = \lambda_S = k_2 = \beta_{\lambda} = \beta_{\lambda_S} = \beta_{k_2} = 0$. However, this constraint will immediately decouple the new scalar state, and the couplings will not be regenerated by renormalization group running. In other words we revert back to the SM. This seems a serious barrier to the MPP, but is not quite as bad as it appears. Firstly, the MPP itself is somewhat imprecise --- the strong first order phase transition made the particular choice of parameters {\em more likely} but some wriggle-room in these parameters is not unreasonable. (How much wriggle-room is appropriate depends on the UV theory of course.) Furthermore, our calculations themselves are imprecise and include uncertainties. We truncate our $\beta$-functions at two-loops and apply approximations to find the MPP solutions themselves. Therefore, it is more appropriate to ask if the MPP constraints can be approximately applied, i.e.\ $\lambda $, $\lambda_S$, $k_2$, $\beta_{\lambda}$, $\beta_{\lambda_S}$ and $\beta_{k_2}$ should be ``small''. To investigate if small parameters are compatible with the low energy observations we fix all the quartic scalar couplings at $M_{Pl}$. We perform a scan over Planck scale parameters, allowing $\lambda$, $\lambda_S$ and $|\kappa_2|$ to vary between $0$ and $1$. We also allow $v_S$ or $m_S$ to vary between zero and $2\,$TeV in the broken or Dark Matter phases respectively. We use SARAH 4.12.2 \cite{Staub:2013tta} to calculate the two-loop $\beta$ functions as well as the mass matrices, tadpole equations, vertices and loop corrections we need to calculate mass spectra at low energies; and FlexibleSUSY 2.0.1 \cite{Athron:2017fvs,Athron:2014yba,Allanach:2001kg,Allanach:2013kza} is used to build the spectrum generator needed to get the mass spectrum for each point. Valid parameter choices must result in a vacuum that is bounded from below up to $M_{Pl}$, so we also require, at all scales, the vacuum stability conditions, \begin{equation} \label{eq:real_vsc} \lambda, \lambda_S \geq 0, \qquad \qquad \sqrt{\lambda \lambda_S} + k_2 \geq 0. \end{equation} We also require dimensionless couplings remain perturbative up to $M_{Pl}$, so, \begin{equation} \label{eq:real_perturbative} \lambda, \lambda_S, k_2 \leq \sqrt{4 \pi}. \end{equation} We further check vacuum stability using Vevacious \cite{Camargo-Molina:2013qva} which minimises the one-loop effective potential and checks that it is indeed the global minimum. We also require that one of the two scalars of the model is a valid SM Higgs, with mass in the range $124.7$ GeV $\leq m_{h,H} \leq 127.1$ GeV. We allow for a wider range of Higgs masses than the experimental uncertainty as an estimate of the theoretical uncertainty associated with the calculation of the mass spectrum. These constraints already invalidate much of the parameter space, but we must also apply experimental constraints from the LHC, LEP and Tevatron to ensure they are phenomenologically viable. To this end, we employ HiggsBounds \cite{Bechtle:2013wla} and HiggsSignals \cite{Bechtle:2013xfa}, and further use sHDECAY \cite{Costa:2015llh,Coimbra:2013qq,Butterworth:2010ym} to calculate the total widths and branching ratios for each parameter choice. In the Dark Matter phase we must also include constraints from the dark matter, using micrOMEGAS \cite{Belanger:2014vza} to calculate the relic density to compare with the combined WMAP \cite{Hinshaw:2012aka} and Planck \cite{Ade:2015xua} result, \begin{equation} \label{eq:real_DM_relic_density} \Omega h^2 = 0.1199 \pm 0.0027. \end{equation} A point is excluded if the calculated relic density is greater than $\Omega h^2 + 3 \sigma$ to ensure that a DM candidate does not overclose the universe, but we allow for the possibility that there may be some other contributions to the relic density which we are not taking into account. We also include constraints from dark mattter direct detection that place limits on the spin independent cross section of weakly interacting massive particles (WIMPs) on nucleons. The strongest of those constraints comes from the LUX experiment \cite{Akerib:2016vxi}. We present the results of the analysis of the broken phase in Figure~\ref{fig:figure_4}, where we see lots of parameter choices pass the theoretical and experimental constraints, although only a few of these obey the MPP criterion of the quartic couplings being small. We are interested in points that fall in the lower left corner of Figure~\ref{fig:figure_4}(a-c) as well as those to the left in Figure~\ref{fig:figure_4}(d). To further aid in the discrimination of small values we have coloured red those points for which $\beta_{\lambda} < 0.0009$, $\beta_{\lambda_S} < 0.019$, and $\beta_{k_2} < 0.0045$, which is an estimate of the truncation error in their high scale values as estimated by the difference between the one and two loop Renormalization Group running. \begin{figure}[tbh] \centering \includegraphics[width=\textwidth]{Figure_4} \caption{Values of \textbf{(a)} $\lambda(M_{\rm Pl})$, \textbf{(b)} $\lambda_S(M_{\rm Pl})$ and \textbf{(c)} $\lambda(M_{\rm Pl})$ compared to their respective $\beta$-functions in the broken phase. All points pass theoretical and experimental constraints. Red points further obey $\beta_{\lambda} < 0.0009$, $\beta_{\lambda_S} < 0.019$, $\beta_{k_2} < 0.0045$ at $M_{Pl}$. Also shown \textbf{(d)} is the mass of the additional Higgs for values of $\lambda(M_{\rm Pl})$.} \label{fig:figure_4} \end{figure} These reasonably numerous red points indicate parameter choices for which there is indeed a second approximately degenerate vacuum at the Planck scale, that provide the correct Higgs boson mass and conform to all low energy observations. This remarkable result need not have been the case. Unfortunately we have also lost predictive power. The SM Higgs mass is fixed by our constraints, so not a prediction and the new Higgs mass can take on a rather wide range of values between $200\,$GeV and $2\,$TeV. It is much more difficult to accommodate the MPP in the Dark Matter phase, as can bee seen in Figure~\ref{fig:figure_5}, which is in part due to the extra constraint from Dark Matter which considerably reduces the acceptable points. We do see parameter choices that evade all constraints with very small values of the $\beta$-functions (red points) but these often have rather large values of the quartic couplings. This is especially true for $\kappa_2$ but is also true, to a lesser degree, for $\lambda$. \begin{figure}[tbh] \centering \includegraphics[width=\textwidth]{Figure_5} \caption{Values of \textbf{(a)} $\lambda(M_{\rm Pl})$, \textbf{(b)} $\lambda_S(M_{\rm Pl})$ and \textbf{(c)} $\lambda(M_{\rm Pl})$ compared to their respective $\beta$-functions in the Dark Matter phase. All points pass theoretical and experimental constraints. Red points further obey $\beta_{\lambda} < 0.0009$, $\beta_{\lambda_S} < 0.019$, $\beta_{k_2} < 0.0045$ at $M_{Pl}$. Also shown \textbf{(d)} is the mass of the additional scalar for values of $\lambda(M_{\rm Pl})$.} \label{fig:figure_5} \end{figure} \section{A Complex Singlet Extension} \label{sec:complex_singlet} We may complicate the model only slightly be promoting our new singlet to a complex field, $\mathbb{S} = S_1 + i S_2$, and consider a potential of the form~\citep{Barger:2008jx, Barger:2010yn, Gonderinger:2012rd, Costa:2014qga, Coimbra:2013qq, Robens:2015gla, Muhlleitner:2017dkd} \begin{equation} \label{eq:complex_potential} V = \frac{\mu^2}{2} H^{\dagger} H + \frac{\lambda}{4} \left( H^{\dagger} H \right)^2 + \frac{\delta}{2} \left( H^{\dagger} H \right) \left| \mathbb{S} \right|^2 + \frac{b_2}{2} \left| \mathbb{S} \right|^2 + \frac{d_2}{4} \left| \mathbb{S} \right|^4 + \left( \frac{b_1}{4} \mathbb{S}^2 + a_1 \mathbb{S} + c.c \right). \end{equation} For computational convenience we define \begin{equation} b_{\pm} = \frac{1}{2} \left (b_2 \pm b_1 \right), \end{equation} which function as the (squared) masses if the model is recast as two real scalar fields. The complex singlet field may acquire a non-zero vev for its real, and possibly imaginary, part. If both real and imaginary parts acquire non-zero vevs, \begin{equation} \label{eq:complex_vevs} \mathbb{S} = \frac{1}{\sqrt{2}} \left[ v_{s_1} + s_1 + i \left( v_{s_2} + s_2 \right) \right], \end{equation} we again call this the ``broken phase'' following our earlier nomenclature (introduced in Ref.~\cite{Costa:2014qga}). Therefore, in addition to the bilinear terms $\mu^2$ and $b_{\pm}$ which are fixed via the electroweak vacuum minimisation conditions, the model is described by \begin{equation} \label{eq:complex_inputs_broken} \lambda, \quad d_2, \quad \delta, \quad v_{s_1}, \quad v_{s_2}, \quad a_1. \end{equation} In this phase, all three scalar field fluctuations $h$, $s_1$ and $s_2$ mix. In contrast, if the vev of the imaginary part remains zero, the second electroweak vacuum minimisation condition (for $S_2$) is trivial and $b_-$ becomes a free parameter. In this case the input parameters are \begin{equation} \label{eq:complex_inputs_DM} \lambda, \quad d_2, \quad \delta, \quad v_{s_1}, \quad b_{-}, \quad a_1. \end{equation} Now we find ourselves in the ``dark matter phase'', where mixing is allowed between $h$ and the real part of the complex singlet field $s_1$. The imaginary part $s_2$ does not mix and is a dark matter candidate kept stable by the symmetry $S_2 \to - S_2$. The numerical analysis of this model follows closely with that of the real singlet extension discussed above. We scan over $\lambda$, $d_2$ and $\delta$, allowing them to vary between $0$ and $0.5$; $v_{s_1}$ and $v_{s_2}$, if present, are allowed to take values up to $2\,$TeV; $b_-$ has dimension mass$^2$ and is allowed to range to $10^5\,$GeV$^2$. Finally $a_1$, with dimension mass$^3$ and is allowed up to $10^8\,$GeV$^3$. We make use of SARAH and FlexibleSUSY again (though slightly older versions, 4.9.3 and 1.6.1 respectively). Constraints on vacuum stability and perturbativity are again applied; in this case stability requires \citep{Gonderinger:2012rd} \begin{equation} \label{eq:complex_vacuumstability1} \lambda, d_2 \geq 0, \qquad \qquad \delta + \sqrt{\lambda d_2} \geq 0. \end{equation} The global minimum is ensured with Vevacious. Finally, we allowed the same Higgs mass range as before and apply experimental constraints using HiggsBounds, and HiggsSignals \cite{Bechtle:2013xfa}, and sHDECAY. MicrOMEGAS is used to provide constraints from Dark Matter in the Dark Matter phase. For further details of this anaylis see Ref.~\cite{McDowall:2018tdg}. We are in principle interested in the high scale constraints $\lambda = \beta_{\lambda} = 0$, $d_2 = \beta_{d_2} =0$ and $\delta=\beta_\delta=0$. However, similar to the real scalar case, we note that setting $\delta$ to zero at $M_{\rm Pl}$ decouples the extra scalars from the SM, and since $\beta_\delta=0$ for this choice, $\delta$ remains zero at all scales and the new scalars are unobservable. We are therefore forced to only consider $\delta$ ``small''. The situation for $d_2$ is slightly more subtle --- for non-zero values of $\delta$, we cannot set $d_2$ exactly to zero at $M_{\rm Pl}$ since it is immediately driven negative by RG running and the vacuum destabilises according to (\ref{eq:complex_vacuumstability1}). So again, we are forced to only consider $d_2$ ``small'' at the Planck scale and indeed must keep it large enough at $M_{\rm Pl}$ to stop it running negative. Fortunately this is not too onerous, and stability is still viable with $d_2$ as small as $0.005$ at the Planck scale, but it is not really clear how large we should permit this to be and still regard the MPP as ``approximately valid''. In the broken phase, we now have three neutral scalars that mix. One must provide the SM Higgs, while we will call the other two $m_{h_{\rm Light}}$ and $m_{h_{\rm Heavy}}$. Obviously $m_{h_{\rm Light}} < m_{h_{\rm Heavy}}$, but that $h_{\rm Light}$ may still be heavier than the SM-like Higgs, or correspondingly $h_{\rm Heavy}$ may be lighter. We note that these new states may be considerably lighter than the discovered Higgs mass as long as the component from the doublet is not too large, leaving it relatively decoupled. This time we will look first at surviving scenarios in the $m_{h_{Light}} - m_{h_{Heavy}}$ plane, with small values of $\lambda$ and $\beta_\lambda$ at the high scale. In Figure~\ref{fig:complex_lighthiggs_heavyhiggs_comparison}(a) we see scenarios that survive all theoretical and experimental constraints. For clarity of the plot, we restrict our points to those with $\lambda<0.067$ and $\beta_{\lambda,\delta,d_2} < 0.05$ at $M_{\rm Pl}$. Points shown in red have been further restricted to have exceptionally small values of $\beta_{\lambda} < 0.00005$, which is the appropriate truncation error arising from the RG running. Corresponding restrictions on $\beta_\delta$ and $\beta_{d_2}$ would be $\beta_\delta<0.00025$ and $\beta_{d_2}<0.001$, but unfortunately we find if we apply these then no points survive. \begin{figure}[!tbp] \centering \includegraphics[width=\textwidth]{Figure_6} \caption{Values of $m_{h_{Light}}$ and $m_{h_{Heavy}}$ in the broken phase. All points obey $\lambda<0.067$ and $\beta_{\lambda,\delta,d_2} < 0.05$ at $M_{\rm Pl}$. The grey bands highlight the SM Higgs mass range. \textbf{(a)} Red points obey the more restrictive condition $\beta_\lambda < 0.00005$. \textbf{(b)} Red points obey $\beta_\lambda < 0.0005$, $\beta_\delta<0.0025$ and $\beta_{d_2}<0.01$. These plots originally appeared in Ref.~\cite{McDowall:2018tdg}. \label{fig:complex_lighthiggs_heavyhiggs_comparison}} \end{figure} However, we are reluctant to declare the MPP incompatible with the complex singlet extension. These restrictions on the $\beta$-functions are exceedingly severe and may be too strong. Without knowing the form of the UV completion, we don't know the size of any possible threshold corrections that might arise was we approach the Planck scale, so really don't know how much deviation from zero we should allow in our boundary conditions. To allow some extra slack, we can somewhat arbitrarily relax our boundary condition $\beta$-function cut-offs to ten times the truncation error. We now find some points survive and plot these in figure \ref{fig:complex_lighthiggs_heavyhiggs_comparison}(b). Notice that a small number of points survive that have the SM Higgs as the heaviest of the three scalars. In the dark matter phase only two of the three scalars are allowed to mix, with the third becoming a dark matter candidate. We call the non-SM-like Higgs $h_{\rm New}$ whilst the DM scalar is $h_{DM}$. Figure \ref{fig:complex_DM_additionalhiggs_DMhiggs_comparison}(a) examines these extra scalar masses when we restrict $\lambda$ and $\beta_\lambda$ to be consistent with zero. Again, for clarity of the plot, we show only points with $\beta_\lambda<0.05$ in blue before demonstrating the effect of the constraint $\beta_\lambda<0.00005$ in red. It is interesting to note that no points with $m_{h_{New}} < m_{h_{SM}}$ survive the stronger constraint on $\beta_{\lambda}$, and the majority of the points that do survive have almost degenerate masses of $m_{h_{New}}$ and $m_{h_{DM}}$. The tree level masses of $m_{h_{New}}$ ($m_{h_{DM}}$) have a linear dependence on $a_1$ ($b_{-}$) which appears to dominate when both of the additional scalars are heavier than the SM Higgs. Figure \ref{fig:complex_DM_additionalhiggs_DMhiggs_comparison}(a) might suggest that small values of the $\beta$ functions at the Planck scale correlates with a small mass difference $\Delta m = |m_{h_{New}} - m_{h_{DM}}|$. However, while $80\%$ of the points that pass through the constraint $\lambda<0.067, \beta_\lambda < 0.00005$ result in $\Delta m < 40$ GeV, so do $67\%$ of the points that don't. This tendency towards degeneracy is a feature of all of the points that satisfy the theoretical constraints. These points exhibit small values of the soft $U(1)$ breaking parameters $a_1$ and $b_1$, forcing a small $\Delta m$ \citep{Coimbra:2013qq}. It is interesting to note that many points in the degenerate mass region can completely account for the dark matter relic density. The degeneracy opens up co-annihilation channels involving both $m_{h_{DM}}$ and $m_{h_{New}}$ that enter the relic density calculation \citep{Baker:2015qna,Ghorbani:2014gka}. These new channels help bring down the relic density to within the $3 \sigma$ range. As in the broken phase, no DM phase points survive when the severe truncation error cut-offs are applied simultaneously with the experimental constraints. However, we see scenarios survive if we relax the constraints by a factor of 10. These scenarios are shown in Figure \ref{fig:complex_DM_additionalhiggs_DMhiggs_comparison}(b). \begin{figure}[!tbp] \centering \includegraphics[width=\textwidth]{Figure_7} \caption{Values of $m_{h_{Light}}$ and $m_{h_{Heavy}}$ in the DM phase. All points obey $\lambda<0.067$ and $\beta_{\lambda,\delta,d_2} < 0.05$ at $M_{\rm Pl}$. The grey bands highlight the SM Higgs mass range. \textbf{(a)} Red points obey the more restrictive condition $\beta_\lambda < 0.00005$. \textbf{(b)} Red points obey $\beta_\lambda < 0.0005$, $\beta_\delta<0.0025$ and $\beta_{d_2}<0.01$. These plots originally appeared in Ref.~\cite{McDowall:2018tdg}. \label{fig:complex_DM_additionalhiggs_DMhiggs_comparison}} \end{figure} \section{The Two Higgs Doublet Model} \label{sec:THDM} Finally we will examine models with two Higgs doublets to see if they are compatible with the MPP. The most general potential of the Two Higgs Doublet Model (2HDM) (see Ref.~\cite{Branco:2011iw} for a useful review) is, \begin{eqnarray} V \left(H_1, H_2 \right) &=& m_{11}^2 H_{1}^{\dagger} H_{1} + m_{22}^2 H_{2}^{\dagger} H_{2} - \left( m_{12}^2 H_{1}^{\dagger} H_{2} + c.c \right) + \lambda_1 \left( H_{1}^{\dagger} H_{1} \right)^2 \\ \nonumber &&+ \lambda_2 \left( H_{2}^{\dagger} H_{2} \right)^2 + \lambda_3 \left( H_{1}^{\dagger} H_{1} \right) \left( H_{2}^{\dagger} H_{2} \right) + \lambda_4 \left( H_{1}^{\dagger} H_{2} \right) \left( H_{2}^{\dagger} H_{1} \right) \\ \nonumber &&+ \left( \frac{\lambda_5}{2} \left( H_{1}^{\dagger} H_{2} \right)^2 + \lambda_6 \left( H_{1}^{\dagger} H_{1} \right) \left( H_{1}^{\dagger} H_{2} \right) + \lambda_7 \left( H_{2}^{\dagger} H_{2} \right) \left( H_{1}^{\dagger} H_{2} \right) + c.c \right), \label{eq:THDM_potential} \end{eqnarray} where the two Higgs-doublets themselves are given by, \begin{equation} H_n = \begin{pmatrix} \chi_n^{+} \\ \left( H_n^0 + i A_n^0 \right)/\sqrt{2} \end{pmatrix}, \quad n=1,2. \label{eq:THDM_Hn} \end{equation} The parameters $m_{11}^2$, $m_{22}^2$ and $\lambda_{1,2,3,4}$ are real, whilst $m_{12}^2$ and $\lambda_{5,6,7}$ can in princple be complex and induce CP violation. During electroweak symmetry breaking the neutral components of the Higgs fields, $H_n^0$, develop vacuum expectation values (vevs) $\langle H_n^0 \rangle = v_n / \sqrt{2}$. The relationship to the SM vev $v = \sqrt{v_1^2 + v_2^2} = 246\, \mathrm{GeV}$ is determined by the Fermi constant but the ratio of the vevs, $\tan \beta = v_2/v_1$, is a free parameter. The physical scalar sector of the model includes two neutral scalar Higgs $h$ and $H$, a pseudoscalar Higgs $A$ and the charged Higgs $H^{\pm}$. It's clear that the 2HDM potential is considerably more complicated than its Standard Model counterpart, so it's common to employ additional global symmetries to increase the predictivity of the model. There are only six possible types of global symmetry that have a distinctive effect on the potential \citep{Ivanov:2006yq,Ferreira:2015rha}. The 2HDM has been considered for suitability of the MPP in Refs.~\cite{Froggatt:2004st, Laperashvili:2004bu,Froggatt:2006zc,Froggatt:2007qp,Froggatt:2007py,McDowall:2018ulq}, though all but the last of these predate the Higgs discovery so could not be confronted with the measured Higgs mass. Ref.~\cite{Froggatt:2007py} is notable in that it shows that the MPP itself may be used as a mechanism for suppressing CP-violabtion and Flavour Changing Neutral Currents (FCNCs). In Ref.\cite{McDowall:2018ulq} we took the more usual route of implementing a $\mathbb{Z}_2$ symmetry to forbid FCNCs by allowing only one type of fermion to couple to one Higgs doublet. This requirement sets $\lambda_6$, $\lambda_7$ and $m_{12}$ to zero. Following Ref.\cite{McDowall:2018ulq}'s treatment, we may then softly break this $\mathbb{Z}_2$ by re-introducing a (real) non-zero $m_{12}$. We will restrict ourselves to a Type-II model where up-type quarks and leptons couple to the first Higgs-doublet and down-type quarks to the second Higgs-doublet, though we note that the most significant effect of the Yukawa sector comes from which doublet the top-quark couples to, so results for other 2HDM Yukawa assignments would be very similar to those for Type-II. For each parameter point the model is described by the bilinear terms $m_{11}$ and $m_{22}$, which are replaced by $M_Z$ and $\tan \beta$ by applying the electroweak vacuum minimisation conditions, as well as the additonal input parameters, $m_{12}$ and $\lambda_{i}(M_{\rm Pl})$ with $i=1\ldots 5$. As previously we use SARAH to calculate the two-loop $\beta$ functions, which are used by FlexibleSUSY to run the couplings between $M_Z$ and $M_{\rm Pl}$. We also consider a simpler model, the Inert Doublet Model (IDM), where we introduce an additional unbroken $\mathbb{Z}_2$ symmetry, under which the new doublet has odd parity but all other fields are even (see \cite{Ilnicka:2015jba} for a useful review). The scalar sector now consists of the SM Higgs field $H$ and an inert doublet $\Phi$, with mixing between the two forbidden by the new symmetry. The inert doublet does not couple to any of the SM fields and does not gain a vacuum expectation value. The potential is, \begin{eqnarray} V \left(H, \Phi \right) &=& m_{11}^2 H^{\dagger} H + m_{22}^2 \Phi^{\dagger} \Phi + \lambda_1 \left( H^{\dagger} H \right)^2 + \lambda_2 \left( \Phi^{\dagger} \Phi \right)^2 \\ \nonumber &&+ \lambda_3 \left( H^{\dagger} H \right) \left( \Phi^{\dagger} \Phi \right) + \lambda_4 \left( H^{\dagger} \Phi \right) \left( \Phi^{\dagger} H \right) + \left( \frac{\lambda_5}{2} \left( H^{\dagger} \Phi \right)^2 + c.c \right). \label{eq:Inert_potential} \end{eqnarray} Once again the quartic coupling can have complex values, but we will focus on the real-valued case. Note that now the mixing term proportional to $m_{12}^2$ is absent. During electroweak symmetry breaking the neutral component of the SM Higgs doublet acquires a vacuum expectation value $v = 246\,$GeV. The neutral Higgs $h$ corresponds to the SM Higgs boson whilst $H$, $A$ and $H^{\pm}$ are inert scalars. The lightest of these is stable thanks to the $\mathbb{Z}_2$ symmetry and, assuming it is one of the neutral scalars $H$ or $A$, it is a potential Dark Matter (DM) candidate \citep{PhysRevD.95.015017,PhysRevD.92.055006}. As in the previous case, the mass term associated with the SM Higgs doublet $m_{11}^2$ is fixed via the electroweak minimisation conditions, but now we don't have a second vev to fix $m_{22}^2$, which must remain an input. Our input parameters are therefore $m_{22}$ and $\lambda_{i}(M_{\rm Pl})$ with $i=1\ldots 5$. As in the Type-II model, we use SARAH and FlexibleSUSY to calculate the mass spectrum and to run couplings between the low and high scales of interest. Valid points in our parameter space scan must be perturbative up to the Planck scale. For the Higgs quartic couplings this requires them to satisfy $\lambda_i < \sqrt{4 \pi}$ up to $M_{Pl}$. We require points that are bounded from below at all scales up to $M_{Pl}$ \citep{Chowdhury:2015yja}. To that end we check if the boundedness conditions \citep{Branco:2011iw}, \begin{eqnarray} \lambda_1, \lambda_2 &>& 0, \\ \nonumber \lambda_3 &>& -2 \sqrt{\lambda_1 \lambda_2}, \\ \nonumber \lambda_3 + \lambda_4 - |\lambda_5| &>& -2 \sqrt{\lambda_1 \lambda_2}, \label{eq:THDM_VSCs} \end{eqnarray} are met at all scales \citep{Sher:1988mj,Chataignier:2018aud}. The goal for the MPP is to have an additional minimum at $M_{\rm Pl}$, degenerate with the electroweak minimum,. This is naively satisfied if all of the quartic couplings are zero at $M_{\rm Pl}$, i.e.\ $\lambda_i = 0, i = 1 \ldots 5$. However, the RG running of $\lambda_1$ and $\lambda_2$ results in an unstable vacuum configuration \citep{Froggatt:2004st, Laperashvili:2004bu,Froggatt:2006zc,Froggatt:2007qp}. It is also possible for degenerate vacua to exist within the 2HDM if we relax the condition $\lambda_i = 0$. Specifically, by allowing $\lambda_1$, $\lambda_2$, $\lambda_3$ and $\lambda_4$ to be non-zero at $M_{\rm Pl}$, the following conditions \citep{Froggatt:2004st} are consistent with the implementation of the MPP at $ M_{\rm Pl}$; \begin{eqnarray} \label{eq:THDM_MPP_conditions} \lambda_5 \left( M_{\rm Pl} \right) &=& 0 \\ \nonumber \lambda_4 \left( M_{\rm Pl} \right) &<& 0 \\ \nonumber \tilde{\lambda} \left( M_{\rm Pl} \right) = \sqrt{\lambda_1 \lambda_2} + \lambda_3 + \text{min}(0,\lambda_4) &=& 0 \\ \nonumber \beta_{\tilde{\lambda}} \left( M_{\rm Pl} \right) &=& 0. \end{eqnarray} To investigate whether these MPP conditions in the Type-II 2HDM are consistent with the current experimental constraints on the SM Higgs mass $m_h$ and the top-quark mass $m_t$, we generated points in the parameter space, applying the theoretical constraint of vacuum stability at all scales. Figure \ref{fig:THDMII_MPP_comparison}(a) shows an example of the running of $\lambda_1$, $\lambda_2$ and $\tilde{\lambda}$ for a point that results in experimentally valid values of the SM Higgs mass and the top-quark mass, and is also consistent with the MPP conditions of (\ref{eq:THDM_MPP_conditions}). Vacuum stability requires that all of these couplings remain greater than zero at all scales, but the negative running of $\tilde{\lambda}$ pulls it to negative values. \begin{figure}[htb!] \centering \includegraphics[width=\textwidth]{Figure_8} \caption{\textbf{(a)} Example running of $\lambda_1$, $\lambda_2$ and $\tilde{\lambda}$ for a point that provides valid masses for the SM Higgs and the top quark in the Type-II Two Higgs Doublet Model. Boundedness from below and vacuum stability requires that all three couplings are positive at all scales. \textbf{(b)} Results of our Multiple Point Principle scan in the $m_{h} - m_{t}$ plane of the Type-II Two Higgs Doublet Model. The blue points provide valid SM higgs masses whilst the red points also pass the vacuum stability conditions at all scales. The ellipses show the experimentally allowed values of $m_t$ and $m_{h}$ at $1 \,\sigma$ (dark grey) and $3 \,\sigma$ (light grey) uncertainty. These plots originally appeared in Ref.~\cite{McDowall:2018ulq}. \label{fig:THDMII_MPP_comparison}} \end{figure} Figure \ref{fig:THDMII_MPP_comparison}(b) shows an investigation of the $m_h - m_t$ plane, where we temproarily suspend vacuum stability to demonstrate the effect. We see plenty of valid points in blue, where vacuum stability is not required. However, the points that satisfy the vacuum stability conditions, highlighted in red, have larger values of the top Yukawa $y_t$ which positively contribute to the running of the quartic couplings. The larger required $y_t$ corresponds to a top mass in the range $220 \lesssim m_t \lesssim 230\,$GeV which is not compatible with current experimental bounds on the top-quark mass. These MPP constraints also apply to the Inert Doublet Model. We examined the IDM parameter space as we did for the Type-II 2HDM, applying the MPP conditions at $M_{Pl}$ and requiring valid points to be stable up to the Planck scale and to have a SM Higgs candidate. Figure \ref{fig:Inert_MPP_vsc} shows the running of the quartic couplings $\lambda_1$, $\lambda_2$ and $\tilde{\lambda}$ for an example point in our scan that provided a valid SM Higgs and top mass. As in the Type-II model, a stable vacuum requires all three of these couplings to be positive at all scales. Clearly this point fails our vacuum stability test, and unfortunately it is representative of the other points in our scan. We found {\em no points} that could simultaneously satisfy the constraints of perturbativity, vacuum stability and the requirement of a realistic SM mass spectrum. Specifically, there are points that provide valid SM Higgs and top masses, but all of these points fail the condition $\tilde{\lambda} > 0$. In fact, we found no points that could satisfy the MPP conditions outlined in (\ref{eq:THDM_MPP_conditions}) that remained stable up to the Planck scale, regardless of their Higgs or top masses. This therefore suggests that the multiple point principle cannot be implemented successfully in the Inert Doublet Model. \begin{figure}[htb!] \centering \includegraphics[width=0.5\textwidth]{Figure_9} \caption{Example running of $\lambda_1$, $\lambda_2$ and $\tilde{\lambda}$ for a point that provides valid masses for the SM Higgs and the top quark in the Inert Doublet Model. Boundedness from below and vacuum stability requires that all three couplings are positive at all scales. This plot originally appeared in Ref.~\cite{McDowall:2018ulq}. \label{fig:Inert_MPP_vsc}} \end{figure} \section{More Exotic Models} The MPP has also been applied to several other models of new physics, of varying degrees of complexity. For example, Ref.~\cite{Hamada:2015fma} consider one of the more minimal extensions by including either a Majorana fermion triplet or a real scalar triplet, and in both cases were able to find good agreement with the MPP by keeping the new states rather heavy (of order $10^{16}$ GeV for the fermion triplet and slightly higher for the scalar). Ref.~\cite{bennett:1997kq} studies what the authors term an ``anti-GUT'' within the context of the SM. This is a model where each generation comes with a full complement of the SM gauge groups, augmented with an additional local $U(1)$, so that the full group (at high energies) is $[SU(3) \times U(2) \times U(1)]^3 \times U(1)$. The resulting Higgs mass prediction is $139 \pm 16$ GeV, though the uncertainty in this prediction would no doubt be significantly reduced with more modern inputs, and they also find reasonable agreement with the SM Yukawa couplings. Another proposed alternative is to mix a fundamental scalar with the scalar bound states of a new strongly interacting gauge symmetry~\cite{haba:2017quk}. This allows for the dynamical generation of the Higgs mass, with a classically scale invariant theory satisfying the MPP condition. They predict new scalar states at approximately 300 GeV as well as a new gauge boson coupling to the SM fermions. The MPP may also be used to constrain theories with extra dimensions. Ref.~\cite{Hamada:2017yji} examines the SM compactified at high scales onto $S^1$ and $T^1$, additionally applying the MPP. They find this constrains the neutrinos in the model to have Dirac masses, with the lightest of order $1-10$ meV. This would prevent neutrinoless double-beta decay and have interesting cosmological consequences. An more exotic suggestion comes from the original authors of the MPP: the existence of a bound state made of six top-quarks and six anti-top-quarks~\citep{Froggatt:2004nn,Froggatt:2004bh,Das:2008an,Laperashvili:2016cah,Laperashvili:2017sih,Nielsen:2017ows}. They postulate a new phase different from and degenerate with the standard electroweak Higgs phase, caused by the condensation of this new top-anti-top bound state. They claim this bound state arises from the exchange of Higgs bosons due to the large top Yukawa coupling. Therefore the MPP is extended to insist on not just two, but three degenrate vacua: two at low energies and one at the Planck scale. The authors also claim that the extra energy density of this new bound state provides a solution for the cosmological constant problem. \section{Summary and Conclusions} \label{sec:conclusions} The measured value of the Higgs boson mass implies that, if the SM is true to high scales, the Higgs quartic coupling and its $\beta$-function are intriguingly close to zero at the Planck scale. Indeed, their values imply that the SM vacuum is metastable, with a slightly deeper vacuum at the Planck scale. One suggested explanation for this is the {\em Multiple Point Principle}. By considering {\em extensive} variables, nature tends to choose Higgs parameters so that different phases of Electroweak symmetry breaking may coexist. This predicts a second degenerate vacuum at the Planck scale, rather similar to that implied by the Higgs measurements. An analysis of the MPP in the SM provides a prediction of the Higgs mass, $m_h = 129 \pm 1.5\,$Gev which is slightly above the measured value. It is therefore intersting to ask how extensions to the SM might change this picture, especially since we do expect new physics to appear well before the Planck scale. In this paper, we have reviewed the compatibility of the MPP with simple Higgs sector extensions, considering both extra scalars and doublets. We began our review of extended models by considering an additional real scalar field, in both the broken and Dark Matter phases. We had to weaken the MPP constraints somewhat in order to prevent the extra states from decoupling, but found promising results. These real scalar extensions were both compatible with the (relaxed) MPP, though working scenarios in the Dark Matter case were rare due to the additional Dark Matter constraints. Unfortunately the MPP didn't prove very predictive because it left us with a wide range of allowed additional scalar masses. The next extension we considered was an extra complex singlet, where again we had to relax the MPP condition in order to prevent decoupling. We also found that we were unable to keep the parameter $d_2$ very small at the Planck scale since it tended to run negative, destabilizing the vacuum. Furthermore, our constraints setting the $\beta$-functions for the Higgs parameters to zero could not all be accommodated simultaneously while keeping viable low energy phenomenology. However, relaxing these constraints somewhat did again yield scenarios that are stable, evade experimental constraints, have the correct Higgs mass, and in the Dark Matter phase, provide the correct relic density, Finally we investigated the Type-II Two Higgs Doublet Model and the Inert Doublet Model. Models with a second Higgs doublet have much more flexibility in their scalar potential, which one might expect gives them more freedom to accommodate the boundary conditions of the the MPP. However, we found that both the Type-II 2HDM and the IDM cannot satisfy the conditions required at the Planck scale by the MPP. Specifically, we found no points in either model's parameter space that was consistent with the MPP whilst also having a valid SM Higgs, an experimentally acceptable top quark mass, and a stable vacuum. In the Type-II case we found that a stable vacuum would require a top mass on the order of $230\,$GeV, whilst in the Inert case we found no points at all that could meet our theoretical requirements. The results of our analysis would suggest that the Multiple Point Principle is not compatible with the Two Higgs Doublet Models that we investigated. In general it seems rather difficult to accommodate an {\em exact} MPP in any of these models. There are several possible explanations for this. Firstly the MPP conditions may only hold approximately. The original conjecture that there should be a second degenerate vacuum at the Planck scale was itself based on general arguments, and may be realised with some slight modifications. Indeed, one might expect threshold corrections for the new theory to become significant as we approach the Planck scale, slightly modifying the RG running. Secondly, we do expect new physics before the Planck scale to solve the many deficiencies of the SM. It could be that this new physics alters the Higgs running sufficiently to allow the MPP to hold more exactly. It would be interesting to examine the SM Higgs sector with alternative additions, such as vector-like fermions. Finally, the literature thus far has entirely neglected finite temperature effects in the study of the MPP. Such effects could very well alter the vacuum structure, Utimately the question remains, is the peculiar behaviour of the SM Higgs potential at the Planck scale a coindindence or a sign of new physics? \section*{Funding} DJM acknowledges partial support from the STFC grants ST/L000446/1 and ST/P000746/1. \section*{Acknowledgments} The authors would like to thank Peter Athron for invaluable help with FlexibleSUSY; as well as Karl Nordstrom, Ant\'onio Morais and David Sutherland for useful discussions. \bibliographystyle{frontiersFPHY}
\subsection{Exercise: One-mode Thermal States} \label{exer4} For simplicity, we start by analyzing the purification complexity of the thermal state for a single oscillator, {\it i.e.,}\ $\hat \upsilon_{{th}}(\beta,\omega)$ in eq.~\eqref{density_thermal}. For this exercise, we limit ourselves to considering the diagonal basis. In fact, this is a simple case of the one-mode mixed states \eqref{Gaussian_decom} studied in section \ref{sec:onemode}, where we set the squeezing parameter $r=0$. Hence the purification complexity is given by simply substituting $r=0$ into eq.~\eqref{complexity_one_mode}, \begin{equation} \hspace{-16pt}\mathcal{C}^{\mt{diag}}_{1,{th}}(\beta,\omega,\mu)= \left\{ \begin{array}{lc} \frac 12 \ln \frac{\mu}{\omega} + \frac{1}{2}\ln \left( \frac{{ \frac{\mu}{\omega}\,\coth(\beta \omega/2)-1}}{{\frac{\mu}{\omega}- \coth(\beta \omega/2) }} \right)\, , &{\rm for}\ \ \coth(\frac{\beta \omega}{4}) \leq \frac{\mu}{\omega}\,,\\ \\ \ln \coth\(\frac{\beta \omega}{4}\) \, , &{\rm for}\ \ \tanh(\frac{\beta \omega}{4})\leq \frac{\mu}{\omega} \leq \coth(\frac{\beta \omega}{4})\,,\\ \\ \frac 12 \ln\frac{\omega}{\mu} +\frac{1}{2} \ln \left( \frac{{\frac{\omega}{\mu}\, \coth(\beta \omega/2)-1}}{{\frac{\omega}{\mu}- \coth(\beta \omega/2)}} \right) , & {\rm for}\ \ \frac{\mu}{\omega} \leq \tanh(\frac{\beta \omega}{4}) \,. \end{array} \right. \label{complexity_thermal} \end{equation} Here we have substituted $\bar r=\frac{1}{2}\ln \frac{\omega}{\mu}$ from setting $r=0$ in eq.~\eqref{rbar}, and we have used the definition of $\alpha$ given in eq.~\eqref{hope}. The interplay between the different regimes of eq.~\eqref{complexity_thermal} is explored in figure \ref{fig:Ffun}. \begin{figure}[h] \begin{center} \includegraphics[width=0.7\textwidth]{figures/LimitsS3.pdf} \end{center} \caption{Different regimes of eq.~\eqref{complexity_thermal}: values of $\beta \mu$ above the blue curve, {\it i.e.,}\ $\beta \omega \coth(\beta\omega/4)$, correspond to the first regime in this equation; below the red curve {\it i.e.,}\ $\beta \omega \tanh(\beta\omega/4)$, correspond to the third regime; while between the blue and red curves correspond to the second regime. We observe that when $\beta \mu\gg 1$, there is a very narrow range of frequencies $\beta \omega$ between the blue and red lines (since both curves converge towards $\beta\omega$) for which the intermediate regime applies. } \label{fig:Ffun} \end{figure} Of course, one well-known purification of the thermal state \eqref{density_thermal} is the TFD state, see eq.~\eqref{TFDpureonemode}. However, this is not necessarily the optimal purification which leads to a minimal complexity. Examining eq.~\eqref{complexity_thermal}, it turns out that the optimal purification is in fact the TFD state for the intermediate regime, {\it i.e.,}\ $\tanh({\beta \omega}/{4})\leq \frac{\mu}{\omega} \leq \coth({\beta \omega}/{4})$. This can be seen by observing that eqs.~\eqref{case2compl} and \eqref{rbar} yield $s=0$ when $r=0$ in this case and therefore the purification \eqref{Fock_psi12} reduces to the TFD state in eq.~\eqref{two_mode}. For example, this case will be of relevance when the reference frequency $\mu$ and the oscillator frequency $\omega$ are equal. We may also consider two other interesting limits: First, for $\omega \coth \frac{\beta \omega}{4} \ll \mu $, the first line in eq.~\eqref{complexity_thermal} applies and this limit yields \begin{equation} \mathcal{C}^{\mt{diag}}_{1,{th}}\simeq \frac 12\, \ln\! \(\frac{\mu}{\omega}\, \coth \frac{\beta \omega}{2}\) \qquad {\rm with}\ \ {s} \simeq \frac 12\, \ln \!\(\frac{\mu}{\omega}\,\tanh \frac{\beta \omega}{2}\)\,, \end{equation} see eq.~\eqref{case13r2} and \eqref{rbar}. Hence the optimal purification is far from being the TFD state, for which $s=0$. Next, in the opposite limit with $\mu \ll \omega \tanh \frac{\beta \omega}{4}$, the third case in eq.~\eqref{complexity_thermal} applies. This limit then yields \begin{equation}\label{thermal_complexity_case3} \mathcal{C}^{\mt{diag}}_{1,{th}} \approx \frac 12\, \ln\! \(\frac{\omega}{\mu} \coth \frac{\beta \omega}{2}\) \qquad {\rm with}\ \ s\simeq \frac 12\, \ln \!\(\frac{\mu}{\omega}\,\coth \frac{\beta \omega}{2}\)\,. \end{equation} Hence, the optimal purification is again far from the TFD state. While we have limited our attention to the diagonal basis here, the analogous results for the physical basis can be found by using $r=0$ in section \ref{fizz}. \subsection{Discretization of the Free Scalar}\label{QFT} In order to apply our results from the last several sections to a QFT, we follow \cite{qft1} and consider a free massive scalar theory with Hamiltonian \begin{equation}\label{Ha_scalarQFT} H=\frac{1}{2}\int d^{d-1}x\left[\pi(x)^2+(\vec\nabla\phi(x))^2+m^2\,\phi(x)^2\right]\,. \end{equation} We start by regulating the theory by placing it on a periodic `square' lattice with lattice spacing $\delta$ and where each side has a linear length $L$. Therefore the total number of sites is given by $N^{d-1}\equiv (L/\delta)^{d-1}$. The lattice Hamiltonian is then the Hamiltonian for $N^{d-1}$ coupled harmonic oscillators, which can be written as\footnote{The lattice sites are designated with $\vec{n}=n_i\,\hat{x}^i$, where $\hat{x}^i$ are unit normals along the spatial axes.} \begin{equation}\label{ham88} \begin{split} H&=\sum_{\vec{n}}\left\{\frac{\bar p(\vec{n})^2}{2M}+\frac12 M \left[\bar{\omega}^2 \bar x(\vec{n})^2+\Omega^2\sum_i\( \bar x(\vec{n})-\bar x(\vec{n}-\hat{x}_i)\)^2\right]\right\}\,, \end{split} \end{equation} where in the second line, we have defined $\bar x(\vec{n})=\delta^{d/2}\phi(\vec{n})$, $\bar p(\vec{n})=\delta^{(d-2)/2}\pi(\vec{n})$, $\bar{\omega}=m$ and $\Omega=1/\delta=M$, see, e.g., \cite{qft1}. Further, periodic boundary conditions are imposed with $\bar x(\vec{n}+ N\hat{x}_i)\equiv\bar x(\vec{n})$ for any $i$. Next we rewrite the Hamiltonian in terms of the normal modes \begin{equation}\label{Thefreq} x_{\vec k}\equiv\frac{1}{N^{\frac{d-1}2}}\sum_{\vec n}\exp\!\left(\frac{2\pi i \vec k\cdot\vec n}{N}\right)\bar x(\vec n)\,, \quad \omega_{\vec k}^2= m^2 + 4\Omega^2 \sum_i \sin^2 \frac{\pi k_i}{N}\,, \end{equation} where $\vec k=(k_1,\cdots,k_{d-1})$ with $k_i=1,2,\cdots N$. The Hamiltonian then becomes \begin{equation}\label{normal_QFT} H=\frac{1}{2M}\sum_{\vec k}\(|{p}_{\vec k}|^2+M^2{\omega}_{\vec k}^2\,|x_{\vec k}|^2\)\,, \end{equation} where we have used that $x^\dagger_{\vec k}= x_{-\vec k}$. This means that we can think of the system as a system of $N^{d-1}$ decoupled real harmonic oscillators with frequencies as indicated by eq.~\eqref{Thefreq} and with masses $1/\delta$. Of course, the diagonalization process can also be performed directly for the continuum Hamiltonian and in the infinite volume limit,\footnote{Recall that there are two independent limits here. The continuum limit refers to taking the lattice spacing $\delta$ small compared to the other physical parameters in the problem, {\it e.g.,}\ $\delta m \to 0$ and $\delta/L\to0$. In that case, the sum over lattice points becomes an integral over positions on a square torus, given the boundary conditions under eq.~\reef{ham88}. The infinite volume takes the limit $L=N\delta\to\infty$ while holding $\delta$ fixed. Hence in this limit, $L$ is large compared to the other dimensionful parameters, {\it e.g.,}\ $mL\to\infty$ and $L/\delta\to\infty$. Recall that the difference between adjacent values of the dimensionful momenta in eq.~\eqref{Thefreq} is $\Delta k=\frac{2\pi}{N\delta}= \frac{2\pi }{L}$, and hence the momentum sums are replaced with integrals in the infinite volume limit. The results of this section will all involve both the continuum and infinite volume limits, while those of section \ref{apply02} are given on the circle ({\it i.e.,}\ $d=2$) with finite $L$.\label{linecirclefoot}} in which case one obtains the eigenfrequencies $\omega_{\vec k}=\sqrt{{\vec k}^2+m^2}$ and the sum over the (dimensionless) $k_i$ is replaced by the (dimensionful) momentum integral $V_{d-1}\, \int\! \frac{d^{d-1}k}{(2\pi)^{d-1}}$. Here $V_{d-1}=L^{d-1}$ was introduced as an IR regulator for the spatial volume of the system. It is natural to interpret the reference state as the ground state of an ultralocal Hamiltonian of the form \begin{equation}\label{ultra1} H=\frac{1}{2}\int d^{d-1}x\left[\pi(x)^2+\mu^2\,\phi(x)^2\right]\,. \end{equation} That is, we have dropped the usual term with spatial derivatives here and so in the ground state, the field is not correlated at different spatial points. On the lattice, this Hamiltonian \reef{ultra1} becomes \begin{equation}\label{normal_QFT2} H=\frac{1}{2M}\sum_{\vec k}\(|{p}_{\vec k}|^2+M^2\mu^2\,|x_{\vec k}|^2\)\,. \end{equation} Finally, recall that we have implicitly set the mass parameter $M$ to one in all our previous expressions, {\it e.g.,}\ in eqs.~\eqref{TargetGaussianPure} and \eqref{ref_state}. It is easy to restore the dependence on the mass by merely multiplying the frequencies by $M$. This does not influence the various expressions for the complexity since those were given in terms of ratios of frequencies. \subsection{Purification Complexity in the Diagonal Basis} As we noted above, the Hamiltonian \eqref{normal_QFT} consists of a sum of decoupled harmonic oscillators. As a consequence, the corresponding thermal density matrix for the QFT factorizes into a product of thermal density matrices, one for each mode. In other words, one can find the simple mixed state \begin{equation}\label{density_QFT} \hat\rho_{{th}}(\beta) = \bigotimes_{\vec k}\ \hat{\upsilon}_{{th}}(\beta,\omega_{\vec k})\,, \end{equation} where $\hat \upsilon_{th}$ denotes the thermal density matrix of a single oscillator with frequency $\omega_{\vec k}$ and inverse temperature $\beta$, as defined in eq.~\eqref{density_thermal}. In proceeding with our evaluation of the purification complexity, we will focus here on the diagonal basis and save a discussion of the physical-basis complexity for section \ref{wonka}. Given a mixed state with a product structure as in eq.~\eqref{density_QFT}, we recall from section \ref{optimal} that we expect the optimal purification will be both an essential purification and a mode-by-mode purification.\footnote{To connect directly to the discussion in section \ref{sec:manyho}, we can write the thermal density matrix in the form given in eq.~\reef{density_fun_A} using the expressions in eq.~\reef{parameters} with $r=0$. In this form, we would find that $A$ and $B$ are commuting matrices with $A={\rm diag}(\omega_{\vec k}\, {\rm \coth} \beta\omega_{\vec k})$ and $B= {\rm diag}(\omega_{\vec k}\, {\rm csch} \beta\omega_{\vec k})$.} Hence we expect that the final result for the purification complexity eq.~\eqref{density_QFT} is simply obtained by summing the complexities for the individual modes, \begin{equation}\label{sum_complexity} \mathcal{C}_{1,th}^{\mt{diag,tot}}(\beta,\mu)= \sum_{\vec k} \mathcal{C}^{\mt{diag}}_{1,th}(\beta ,\omega_{\vec k},\mu) \,, \end{equation} where $\mathcal{C}^{\mt{diag}}_{1,th}(\beta ,\omega_{\vec k},\mu)$ is given in eq.~\eqref{complexity_thermal}. Alternatively, in the continuum formulation, we have \begin{equation}\label{sum_complexity02} \mathcal{C}_{1,th}^{\mt{diag,tot}}(\beta,\mu)= V_{d-1}\ \int_{|\vec k|<\Lambda} \frac{d^{d-1}k}{(2\pi)^{d-1}} \ \mathcal{C}^{\mt{diag}}_{1,th}(\beta ,\omega_{\vec k},\mu) \,, \end{equation} where the momentum cutoff $\Lambda$ was introduced to regulate the system in the UV.\footnote{This regulator is different than the lattice regularization introduced above in that the momentum integration bound is a sphere, while the edge of the momentum integration of the lattice regularization is a cube given by the edges of the first Brillouin zone. The continuum limit corresponds to $\Lambda$ being much greater than any dimensionful parameter in the problem, {\it e.g.,}\ $\beta \Lambda \to \infty$.} To proceed, we define two critical frequencies with \begin{equation}\label{dog3} \omega_{c,1}: \quad \beta \mu=\beta \omega_{c,1} \coth \left(\frac{\beta \omega_{c,1}}{4}\right)\,, \qquad \omega_{c,2}: \quad \beta \mu=\beta \omega_{c,2} \tanh \left(\frac{\beta \omega_{c,2}}{4}\right)\,. \end{equation} These correspond to the frequencies where there is a transition between the three different regimes in eq.~\reef{complexity_thermal} --- see the blue and red points indicated in figure \ref{fig:Ffun}. The critical frequencies are functions of $\beta$ and $\mu$, and of course, they can be converted to a corresponding momentum with $k_{c,1}^2=\omega_{c,1}^2-m^2$ and $k^2_{c,2}=\omega_{c,1}^2-m^2$. Now we will evaluate eq.~\reef{sum_complexity02} for the three cases distinguished by the relation between the critical frequencies and the cutoff frequency $\omega_\Lambda \equiv \sqrt{\Lambda^2+m^2}$: \begin{enumerate} \item $\omega_\Lambda< \omega_{c,1}$: \begin{equation} \label{dog35} \hspace{-30pt}\mathcal{C}_{1,th}^{\mt{diag,tot}}(\beta,\mu)=\frac{\Omega_{d-2}V_{d-1}}2\int_0^\Lambda \frac{k^{d-2}\,dk}{(2\pi)^{d-1}}\,\left[ \ln \frac{\mu}{\omega_{\vec k}} + \ln \!\left( \frac{{ \mu\,\coth(\beta \omega_{\vec k}/2)-\omega_{\vec k}}}{{\mu-\omega_{\vec k}\, \coth(\beta \omega_{\vec k}/2) }} \right)\right] \end{equation} \item $\omega_{c,1}<\omega_\Lambda< \omega_{c,2}$: \begin{equation}\label{dog4} \begin{split} \hspace{-40pt}\mathcal{C}_{1,th}^{\mt{diag,tot}}(\beta,\mu)=&\frac{\Omega_{d-2}V_{d-1}}2\int_0^{k_{c,1}} \frac{k^{d-2}\,dk}{(2\pi)^{d-1}}\,\left[ \ln \frac{\mu}{\omega_{\vec k}} + \ln \!\left( \frac{{ \mu\,\coth(\beta \omega_{\vec k}/2)-\omega_{\vec k}}}{{\mu-\omega_{\vec k}\, \coth(\beta \omega_{\vec k}/2) }} \right)\right] \\ &\qquad+ \Omega_{d-2}V_{d-1} \int_{k_{c,1}}^{\Lambda} \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \, \ln \coth\(\frac{\beta \omega_{{\vec k}}}{4}\) \end{split} \end{equation} \item $\omega_{c,2}<\omega_\Lambda$: \begin{equation}\label{dog5} \begin{split} \hspace{-40pt}\mathcal{C}_{1,th}^{\mt{diag,tot}}(\beta,\mu)=&\frac{\Omega_{d-2}V_{d-1}}2\int_0^{k_{c,1}} \frac{k^{d-2}\,dk}{(2\pi)^{d-1}}\,\left[ \ln \frac{\mu}{\omega_{\vec k}} + \ln \!\left( \frac{{ \mu\,\coth(\beta \omega_{\vec k}/2)-\omega_{\vec k}}}{{\mu-\omega_{\vec k}\, \coth(\beta \omega_{\vec k}/2) }} \right)\right] \\ &\qquad+ \Omega_{d-2}V_{d-1} \int_{k_{c,1}}^{k_{c,2}} \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \, \ln \coth\(\frac{\beta \omega_{{\vec k}}}{4}\) \\ &+ \frac{\Omega_{d-2} V_{d-1}}{2} \int_{k_{c,2}}^\Lambda \frac{k^{d-2}dk}{(2\pi)^{d-1}}\,\left[ \ln \frac{\omega_{{\vec k}}}{\mu} + \ln\! \left( \frac{ \omega_{{\vec k}}\,\coth(\beta \omega_{{\vec k}}/2)-\mu}{\omega_k-\mu\,\coth(\beta \omega_{{\vec k}}/2)} \right)\right], \end{split} \end{equation} \end{enumerate} where $\Omega_{d-2}\equiv{2 \pi^{\frac{d-1}{2}}}/{\Gamma(\frac{d-1}{2})}$ is the volume of a unit ($d-2$)-sphere. These results can be simplified in certain limits. In particular, here we will focus on the case of a massless scalar, {\it i.e.,}\ $m=0$, in which case, the critical frequencies and momenta are equal to one another, {\it i.e.,}\ $k_{c,1}=\omega_{c,1}$ and $k_{c,2}=\omega_{c,2}$. We also focus on the case where the reference frequency is much larger than the temperature, {\it i.e.,}\ $\beta \mu \gg 1$. Working in this regime, eq.~\reef{dog3} can be solved for the critical momenta in a perturbative expansion yielding \begin{equation} k_{c,1}=\mu \left(1-2e^{-\frac{\beta \mu}{2}}+\cdots\right)\, , \qquad k_{c,2}=\mu \left(1+2e^{-\frac{\beta \mu}{2}}+\cdots\right)\,. \end{equation} Hence we see that only the first case is relevant when $\mu \gtrsim \Lambda$ and that the third case becomes relevant as well when $\mu\lesssim\Lambda$. Further, since $k_{c,2}-k_{c,1}=4\mu e^{-\frac{\beta \mu}{2}} +\cdots$, we see that the range of the integration in the second lines of eqs.~\reef{dog4} and \reef{dog5} is extremely small and the corresponding contributions are exponentially suppressed for $\beta \mu \gg 1$. Therefore, it is reasonable to ignore the contribution of these integrals to the complexity in the following. Let us also comment on the behaviour of the various integrals near their limits of integration. First, near $k=0$, the integrands have at worst a logarithmic divergence in $d=2$, while this is suppressed by the factor of $k^{d-2}$ in higher dimensions, and so the integrals converge there. Logarithmic divergences also appear at $k_{c,1}$ and $k_{c,2}$, {\it i.e.,}\ $\ln(k_{c,1}-k)$ and $\ln(k-k_{c,2})$, and so the integrals are well behaved there. This leaves us with a UV divergence due to the terms proportional to $|\ln{\mu/\omega_{{\vec k}}}|$. In fact, this contribution is identical to that for the vacuum state of the free scalar Hamiltonian \eqref{Ha_scalarQFT}, {\it e.g.,}\ see \cite{qft1}, and hence the UV divergence in the complexity is identical to that in the complexity of the vacuum state. We note that the latter result is different from what happens for the TFD state for the same Hamiltonian \eqref{Ha_scalarQFT}, where the UV divergence is precisely double that of the vacuum, {\it e.g.,}\ see \cite{Chapman:2018hou}. This doubling is natural if we think of the TFD state as an entangled state of two copies of the underlying QFT. In this case, the circuit constructing the state is introducing entanglement at short distance ({\it i.e.,}\ UV) scales in both copies of the QFT, which produces the UV divergences in the complexity. For the thermal mixed state, this short distance entanglement must be introduced for the physical degrees of freedom, but there is no need to do the same for the auxiliary degrees of freedom. Hence it is natural that the UV divergence in the purification complexity of the thermal state matches that in the complexity of the vacuum state. We return to comment on this point and explicitly evaluate eqs.~\reef{dog35}-\reef{dog5} in section \ref{compare7}. To close here, we note that the final result for the purification complexity (with $m=0$) can be shown to be proportional to $V_{d-1}\, T^{d-1}$, or equivalently to the thermal entropy, where the proportionality factor is a function of $\beta \Lambda$ and $\beta \mu$. For later convenience, let us quote the result for the entropy of the thermal state for the massless theory, \begin{equation}\label{green4} \begin{split} S\(\hat{\rho}_{\text{th}} \)\big|_{m=0}&=\frac{\Omega_{d-2}}{(2\pi)^{d-1}}\, \frac{\zeta(d)\Gamma(d+1)}{d-1}\,V_{d-1}\,T^{d-1}\,. \end{split} \end{equation} We recall that ref.~\cite{Chapman:2018hou} showed that the complexity of formation for the TFD state is also proportional to the entropy when $m=0$. \subsection{Purification Complexity in the Physical Basis} \label{wonka} Recall from sections \ref{sec:onemode} and \ref{fizz} that the complexity typically shows different properties in the diagonal and physical bases. Hence we investigate the purification complexity for the thermal mixed state in the physical basis in this section. However, for the free scalar field theory where the density matrix takes the simple product form shown in eq.~\eqref{density_QFT}, we still expect that in the physical basis, the optimal purification will be an essential purification and also a mode-by-mode purification. So the final result for the purification complexity is again obtained by summing the complexities for the individual modes, {\it i.e.,}\ \begin{equation}\label{sum_complexity98} \mathcal{C}_{1,th}^{\mt{phys,tot}}(\beta,\mu)= \sum_{\vec k} \mathcal{C}^{\mt{phys}}_{1,th}(\beta ,\omega_{\vec k},\mu) \,, \end{equation} where $\mathcal{C}^{\mt{phys}}_{1,th}(\beta ,\omega_{\vec k},\mu)$ is the purification complexity of the one-mode thermal density matrix, {\it i.e.,}\ of eq.~\eqref{Gaussian_decom} with $r=0$. Alternatively, in the continuum formulation, we have \begin{equation}\label{sum_complexity69} \mathcal{C}_{1,th}^{\mt{phys,tot}}(\beta,\mu)= V_{d-1}\ \int_{|\vec k|<\Lambda} \frac{d^{d-1}k}{(2\pi)^{d-1}} \ \mathcal{C}^{\mt{phys}}_{1,th}(\beta ,\omega_{\vec k},\mu) \,, \end{equation} where the momentum cutoff $\Lambda$ regulates the UV portion of the integral. Let us begin by examining $\mathcal{C}^{\mt{phys}}_{1,th}(\beta ,\omega,\mu)$, which is simply determined by setting $r=0$ or $\bar r=\frac12\ln(\omega/\mu)$ in the results of section \ref{fizz}.\footnote{We have dropped the subscript ${\vec k}$ on the frequency here to reduce the clutter in our formulae for the time being. Further recall that the result for $\bar r$ follows from eq.~\reef{rbar}.} As shown in that section, we cannot find the full analytical results for the purification complexity in the physical basis. However, we can consider certain limits where the results are simplified. In particular, we now investigate the limit of small $\alpha $, which corresponds either to a low-temperature limit or a high-frequency limit, {\it i.e.,}\ $\beta \omega \gg 1$. In this limit, eq.~\reef{hope} yields $\alpha \simeq e^{-\beta\omega/2} \ll 1 $. Further, for small $\alpha$, the diagonal and physical bases are very close, {\it i.e.,}\ the orthogonal transformation in eq.~\reef{thetadef} is close to the identity. The latter follows from evaluating the expressions in eq.~\reef{rounder} with $\alpha\to 0$ and assuming $\sinh(\bar r-\bar s)=-\sinh s<0$, which yields\footnote{That is, we are assuming that the auxiliary squeezing parameter is positive, {\it i.e.,}\ $s>0$. Later, we see that this corresponds to $\mu>\omega$. Footnote \ref{foot66} comments on the regime $s<0$, which corresponds to $\mu<\omega$.} \begin{equation}\label{star1} \theta\simeq \alpha/\sinh s +{\cal O}(\alpha^3)\,. \end{equation} Now since we want to expand our expressions for small $\alpha$, it is easiest to use $s$ as the optimization parameter in evaluating the purification complexity, in analogy to eq.~\reef{walk2}.\footnote{This contrasts with section \ref{fizz}, where we optimized with respect to $\theta$ as in eq.~\reef{purification_C_pos}.} In the physical basis, the single mode purification complexity is given by minimizing eq.~\reef{complexityPosition123}. Hence we must evaluate the expressions there in terms of $s$ and in a small $\alpha$ expansion using eqs.~\reef{eq:omegatotheta} and \reef{star1} as well as $r=0$. We find\footnote{Note that the first equation is exact because $\bar{r}+ \bar{s}= 2\bar{r}+s$ with $r=0$.} \begin{equation}\label{star2} \frac12 \ln \frac{\omega_+\omega_-}{\mu^2} = 2\bar{r} +s\,, \qquad \frac12 \ln \frac{\omega_+}{\omega_-} = s + {\cal O}(\alpha^2)\,. \end{equation} Now we see that eq.~\eqref{complexityPosition123} reduces to \begin{equation}\label{lumber3} \mathcal{C}_{1,th}^{\mt{phys}} \left(\ket{\psi}_{12}\right) = |\bar{r}| +\left|\bar{r}+s \right|+\frac{2\, \alpha\,s}{\sinh s} +{\cal O}(\alpha^2)\,. \end{equation} At the leading order in $\alpha$, this is minimized when the second absolute value vanishes, which fixes $s=-\bar r=\frac12\ln(\mu/\omega)$ (which implies $\bar s=0$). Further, we note that consistency with our assumption that $s>0$ requires that we are in the regime $\mu>\omega$.\footnote{Let us add that if we assume $s<0$, we are lead to the following approximation \begin{equation} \begin{split} \theta &= \frac{\pi}{2}- \frac{\alpha}{\sinh |s|} +{\cal O}(\alpha^3)\,,\qquad \text{with} \\ \frac12 \ln \frac{\omega_+\omega_-}{\mu^2} &= 2\bar{r} +s\,, \qquad \frac12 \ln \frac{\omega_+}{\omega_-} = |s| + {\cal O}(\alpha^2)\,. \end{split} \end{equation} The expression for the complexity in eq.~\reef{lumber3} remains unchanged, and it is again minimized by setting the second term to zero. Hence, we find $s=-\bar{r} =\frac12\ln(\mu/\omega)$ as before, but consistency with $s<0$ now requires that we are in the regime $\mu<\omega$. The final expression for the purification complexity \reef{small_alpha} also remains unchanged in this regime. \label{foot66}} Hence in the region $\beta\omega\gg1$, we find that the purification complexity becomes\footnote{Note that the $\omega\to\mu$ limit of this expression agrees with the complexity of the thermofield double ${\cal C}_{1,th}^{\rm phys}\to 2\alpha$, as expected from the results of section~\ref{warmup}: namely, that the optimal purification for states with $\omega=\mu$ is the thermofield double.} \begin{equation}\label{small_alpha} \mathcal{C}_{1,th}^{\mt{phys}} (\hat\upsilon_{th}) =\frac12\,\left| \ln\frac{\mu}{\omega} \right| +\frac{2 \alpha \,\ln\frac{\mu}{\omega}}{\sqrt{\mu/\omega}-\sqrt{\omega/\mu}} + {\cal O}(\alpha^2)\,. \end{equation} This result is very close to the complexity for the (pure) vacuum state of a single harmonic oscillator at frequency $\omega$, as expected. Now let us turn to the purification complexity of the mixed thermal state for the free scalar field theory. As noted above, we expect that it takes the simple form given in eq.~\reef{sum_complexity98} or \reef{sum_complexity69} given the simple product structure of the thermal state \eqref{density_QFT}. At this point, let us recall the definitions of our parameters for the thermal state \begin{equation}\label{termal_parameter} \alpha = \frac{1}{2}\, \ln \!\( \coth \frac{\beta\omega_{\vec k} }{4}\) \,, \qquad \bar{r}=\frac12\, \ln \frac{\omega_{\vec k}}{\mu} \,. \end{equation} As the combination $\beta\omega_{\vec k}$ grows, the value of $\alpha$ rapidly decreases, {\it e.g.,}\ $\frac{1}{2}\ln \( \coth \(10^{-2}\)\) \approx 2.3$, $\frac{1}{2}\ln \( \coth (10^2) \) \approx 10^{-87}$. Now the momentum integral in eq.~\reef{sum_complexity69} is dominated by the phase space near the UV cutoff $|{\vec k}|\sim \Lambda$ and hence with $\beta\Lambda\ll 1$, $\alpha$ will be very small over a majority of this integration. Further, if the reference frequency $\mu$ is large enough, {\it e.g.,}\ near the cutoff $\Lambda$, we will have $-\bar r$ very large over the complementary part of the momentum integral. Hence, we can expect in a physically interesting setting that, over the entire integral, either $\alpha$ is small or $|\bar r|$ is large, and this is precisely the regime where the single-mode purification complexity in the physical basis is given by the simplified expression in eq.~\eqref{pos_ac}. Hence we can simplify eq.~\reef{sum_complexity69} to the following \begin{equation}\label{sum_complexity49} \mathcal{C}_{1,th}^{\mt{phys,tot}}(\beta,\mu)= \Omega_{d-2}V_{d-1} \int_0^\Lambda \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \, (\sin 2\theta_c + \cos 2\theta_c)\,\sinh ^{-1}\!\(\frac{\sinh 2 \alpha}{\sin 2\theta_c} \) \,, \end{equation} where both $\theta_c$ and $\alpha$ are implicitly functions of $k$ --- see eqs.~\reef{gumby7} and \reef{termal_parameter}. However, it is still hard to explicitly do the remaining integral without any further assumptions. If we assume the small $\alpha$ limit is valid over most of the momentum integral, we can use eq.~\eqref{small_alpha} to simplify the purification complexity to \begin{equation}\label{laugh88} \mathcal{C}_{1,{th}}^{\mt{phys,tot}}(\beta,\mu) \simeq \Omega_{d-2}V_{d-1} \int_0^\Lambda \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \, \left[\frac12\, \left| \ln\frac{\mu}{\omega_k} \right|+ \frac{ \ln\! \( \coth\! \frac{\beta\omega_{k} }{4}\) \,\ln\frac{\mu}{\omega_k}}{\sqrt{\mu/\omega_k}-\sqrt{\omega_k/\mu}} \right]\,, \end{equation} where we use the notation $\omega_k=\sqrt{k^2+m^2}$ and where we have only dropped the higher order terms in the $\alpha$ expansion. Note that this approximation of the integrand is valid in the UV portion of the integration. In this case, the first term simply reproduces the vacuum complexity ({\it i.e.,}\ the zero temperature complexity) and hence the purification complexity has precisely the same UV divergences as the vacuum complexity (for one copy of the underlying QFT). Of course, this feature is identical to what we found for the diagonal basis. Further, this approximation is valid more generally in the full range of integration in the situation where $\beta m\gg1$. In this case, the second term gives the leading finite temperature corrections to the vacuum complexity, which are suppressed by factors of $e^{-\beta m/2}$. \subsection{Mutual Complexity of TFD States} \label{compare7} In this section, we compare the purification complexity of a thermal mixed state with the complexity of the corresponding TFD state, using a quantity known as the mutual complexity. We follow the nomenclature introduced by \cite{Ali:2018lfv} in considering the holographic complexity of subregions. Consider a pure state $\ket{\Psi_{\mathcal{A}\mathcal{B}}}$ on a collection of degrees of freedom comprised of two subsystems, $\mathcal{A}$ and $\mathcal{B}$. There are two mixed states that are naturally constructed here, namely, the reduced density matrices, \begin{equation} \hat{\rho}_\mathcal{A}={\rm Tr}_\mathcal{B}(\ket{\Psi_{\mathcal{A}\mathcal{B}}}\bra{\Psi_{\mathcal{A}\mathcal{B}}})\,,\qquad \hat{\rho}_\mathcal{B}={\rm Tr}_\mathcal{A}(\ket{\Psi_{\mathcal{A}\mathcal{B}}}\bra{\Psi_{\mathcal{A}\mathcal{B}}})\,. \end{equation} It is clear that each of the purification complexities for $\hat{\rho}_\mathcal{A}$ and $\hat{\rho}_\mathcal{B}$ is less than the complexity of the original pure state. That is, since $\ket{\Psi_{\mathcal{A}\mathcal{B}}}$ provides one particular purification of $\hat{\rho}_\mathcal{A}$, it is unlikely to be the optimal purification and so we have the inequality \begin{equation} \label{ramen1} \mathcal{C}\!\(\hat{\rho}_\mathcal{A}\) =\text{min} \ {\mathcal{C}\!\( \ket{\Psi_{\mathcal{A}\mA^c}}\)} \le \mathcal{C}\!\( \ket{\Psi_{\mathcal{A}\mathcal{B}}}\) \,, \end{equation} as well as the analogous inequality for $\hat{\rho}_\mathcal{B}$. Implicitly, we chose the same cost function and basis to define the circuit complexity of the pure state $\ket{\Psi_{\mathcal{A}\mathcal{B}}}$.\footnote{Note the choice of basis is important in establishing the inequality for the $F_1$ cost function, which we are implicitly using here. For example, in eq.~\reef{ramen1}, we are {\it not} claiming that $\mathcal{C}^{\mt{phys}}_1\(\hat{\rho}_\mathcal{A}\) \le \mathcal{C}^{\text{diag}}_1 \( \ket{\Psi_{\mathcal{A}\mathcal{B}}}\)$, even though $\mathcal{C}^{\text{diag}}_1 \( \ket{\Psi_{\mathcal{A}\mathcal{B}}}\)$ may seem the natural definition for the complexity of the pure state. Of course, the basis choice does not play a role for covariant cost functions such as $F_2$. } \begin{figure}[htbp] \centering\includegraphics[width=4.5in]{figures/purificationAB} \caption{Illustration of the optimal purification of two mixed states in two complementary subsystems $\mathcal{A}$ and $\mathcal{B}$ of an original pure state $\ket{\Psi}_{\mathcal{A}\mathcal{B}}$. The state in the subsystem $\mathcal{A}$ is purified by a state $\ket{\Psi}_{\mathcal{A}\mA^c}$ and the one in the subsystem $\mathcal{B}$ is purified by $\ket{\Psi}_{\mathcal{B}\mB^c}$. Even though the direct product of the purifying systems $\ket{\Psi}_{\mathcal{A}\mA^c} \otimes \ket{\Psi}_{\mathcal{B}\mB^c}$ generally has a larger number of degrees of freedom than the original state $\ket{\Psi}_{\mathcal{A}\mathcal{B}}$, the mutual complexity eq.~\eqref{ramen2A} can have either sign.}\label{purificationAB} \end{figure} As illustrated in figure \ref{purificationAB}, it is also obvious that in building the pure state, {\it e.g.,}\ $\ket{\Psi_{\mathcal{A}\mA^c}}$, from the corresponding unentangled reference state, the circuit should only work hard enough to establish the correlations found in $\hat\rho_\mathcal{A}$ amongst the physical degrees of freedom. However, it need not establish an analogous set of correlations (in particular, analogous UV correlations) amongst the ancillary degrees of freedom. Similarly, the correlations between $\mathcal{A}$ and $\mathcal{A}^c$ in $\ket{\Psi_{\mathcal{A}\mA^c}}$ need not precisely mirror those between $\mathcal{A}$ and $\mathcal{B}$ in $\ket{\Psi_{\mathcal{A}\mathcal{B}}}$. As discussed in the introduction, the {\bf mutual complexity} is constructed to quantify the additional correlations in the original pure state with the following difference of complexities, \begin{equation}\label{ramen2A} \Delta\mathcal{C} = \mathcal{C}\!\(\hat{\rho}_\mathcal{A}\) + \mathcal{C}\!\(\hat{\rho}_\mathcal{B}\) - \mathcal{C}\!\( \ket{\Psi_{\mathcal{A}\mathcal{B}}}\) \,. \end{equation} This quantity was introduced in \cite{Ali:2018lfv}, where it was studied for subregions in the context of holographic complexity. The structure in eq.~\reef{ramen2A} was chosen to parallel that of the mutual information, which can be defined by a similar difference of entanglement entropies. However, whereas the mutual information is always positive (or zero), we cannot prove that $\Delta\mathcal{C}$ is always positive or negative from the basic definitions of complexity and purification complexity. Hence the sign of the mutual complexity is nontrivial. In the present case, the pure state of interest will be a TFD state, {\it i.e.,}\ $\ket{\Psi_{\mathcal{A}\mathcal{B}}}=\ket{\rm TFD}$, which can be regarded as an entangled state of two copies, {\it i.e.,}\ the left and right copies, of the underlying QFT. The corresponding mixed states will both be the thermal state \reef{density_QFT}, which is produced by tracing over either the left or right degrees of freedom, {\it i.e.,}\ $\hat\rho_\mathcal{A}=\hat\rho_\mathcal{B}=\hat\rho_{th}(\beta)$. That is, we will consider \begin{equation}\label{ramen2} \Delta\mathcal{C} = 2\, \mathcal{C}\!\(\hat\rho_{th}(\beta)\) - \mathcal{C}\!\( \ket{\rm TFD}\) \,. \end{equation} Again, while the TFD state provides one purification of the thermal mixed state, it will not generally be the optimal purification.\footnote{Let us point out that by examining figure \ref{fig:Ffun}, we find that there exist situations for which the TFD state is the optimal purification, but this requires $\beta \Lambda$ to be an order one number. However, we regard such a situation where the temperature is of the same order as the UV cutoff as unphysical.} Another noteworthy feature of the mutual complexity \reef{ramen2} is that we expect it to be UV finite for the TFD state. This expectation arises from our previous observation that the UV divergences in the purification complexity of $\hat\rho_{th}(\beta)$ precisely matched those found in the vacuum state of one copy of the QFT, while the TFD state doubles the prefactors in those UV divergences. Hence we will see that these divergences cancel in our calculations below. We refer to complexity models with the property that the mutual complexity is always positive as satisfying {\bf subadditivity} since in these cases the complexity of the combined state $\Psi_{\mathcal{A}\mathcal{B}}$ is less than the sum of the complexities of the two reduced density matrices, $\hat{\rho}_\mathcal{A}$, and $\hat{\rho}_\mathcal{B}$ \cite{BrianMixedComplexity} --- see also the discussion in \cite{Caceres:2018blh}. In the same way, we refer to complexity models as satisfying {\bf superadditivity} if $\Delta\mathcal{C}$ is always negative. Further, in section \ref{sec:holo}, we will also see that the mutual complexity plays a role in distinguishing different holographic conjectures for the complexity of mixed states. \subsubsection{Mutual complexity in the diagonal basis}\label{subsubsubmcdb} Let us begin with the TFD state entangling two modes. Eq.~\eqref{two_mode} shows that $\ket{\text{TFD}}_{12}$ is the two-mode squeezed state with $r=s=0$, and from eq.~\reef{eq:cases1}, we can see that its circuit complexity with the $F_1$ cost function in the diagonal basis reads \cite{Chapman:2018hou} \begin{equation}\label{poll3} \begin{split} \mathcal{C}_{1}^{\mt{diag}} \(\ket{\text{TFD}}_{12}\)&= \left| \frac 12 \ln \frac{\omega}{\mu} + \alpha \right| +\left| \frac 12 \ln \frac{\omega}{\mu} - \alpha \right| \,,\\ &= \left\{ \begin{array}{llc} \ln \frac{\mu}{\omega} & &{\rm for}\ \ \coth(\frac{\beta \omega}{4}) \leq \frac\mu\omega\,,\\ \\ \ln \coth\!\(\frac{\beta \omega}{4}\) \quad &\ \ \ \ &{\rm for}\ \ \tanh(\frac{\beta \omega}{4})\leq \frac\mu\omega \leq \coth(\frac{\beta \omega}{4})\,,\\ \\ \ln \frac{\omega}{\mu} & &{\rm for}\ \ \frac\mu\omega \leq \tanh(\frac{\beta \omega}{4}) \,. \end{array} \right. \end{split} \end{equation} Here we have expressed the three parameter regimes in the same way as they appears in eq.~\eqref{complexity_thermal} for the purification complexity of the thermal mixed state. Obviously, the results in the intermediate regime are the same in both cases because the optimal purification for the thermal state in this region coincides with the TFD state, as shown in section \ref{exer4}. As noted in eq.~\reef{ramen2}, the two subsystems are described by the same mixed state, {\it i.e.,}\ $\hat{\rho}_{1,2}=\hat{\upsilon}_{{th}}$, and hence the mutual complexity of this TFD state in the diagonal basis becomes \begin{equation}\label{Delta_norm} \Delta\mathcal{C}_{1}^{\mt{diag}}\!\(\ket{\text{TFD}}_{12}\) = 2\,\mathcal{C}_{1}^{\mt{diag}}\!\(\hat{\upsilon}_{{th}}\) - \mathcal{C}_{1}^{\mt{diag}}\! \(\ket{\text{TFD}}_{12}\)\,. \end{equation} Combining eqs.~\eqref{complexity_thermal} and \reef{poll3}, we find \begin{equation}\label{hunt1} \Delta\mathcal{C}_{1}^{\mt{diag}} (\ket{\text{TFD}}_{12})= \left\{ \begin{array}{llc} \ln\! \left( \frac{{ \mu\coth(\beta \omega/2)-\omega}}{{\mu-\omega \coth(\beta \omega/2) }} \right) &&{\rm for}\ \ \omega\coth(\frac{\beta \omega}{4}) \leq \mu\,,\\ \\ \ln \coth\!\({\beta \omega}/{4}\) &\ \ \ \ & {\rm for}\ \ \omega\tanh(\frac{\beta \omega}{4})\leq \mu \leq \omega\coth(\frac{\beta \omega}{4})\,,\\ \\ \ln\! \left( \frac{{\omega \coth(\beta \omega/2)-\mu}}{{\omega- \mu \coth(\beta \omega/2)}} \right) && {\rm for}\ \ \mu \leq \omega\tanh(\frac{\beta \omega}{4}) \,. \end{array} \right. \end{equation} It is straightforward to show that this result for $\Delta\mathcal{C}_1^{\mt{diag}}\!\(\ket{\text{TFD}}_{12}\)$ is positive and decays exponentially with increasing frequency (yielding zero in the limit $\beta\omega\to\infty$). Using the nomenclature introduced above, we have found that in the diagonal basis, the $\mathcal{C}_1$ complexity is subadditive for these thermal states. In order to be able to compare with the equivalent results in the physical basis which will appear in section \ref{sec:mcipb}, we plot $\Delta\mathcal{C}_{1}^{\mt{diag}}\! \(\ket{\text{TFD}}_{12}\)$ in figure \ref{Delta_diag}. \begin{figure}[htbp] \center \includegraphics[width=0.7\textwidth]{figures/Full_DeltaC_diag02} \caption{The integrated mutual complexity in the diagonal basis,~{\it i.e.,}\ $\Delta \mathcal{C}_{1}^{\text{diag}} \(\ket{\text{TFD}}\) $ defined in eq.~\eqref{delta_diag} for a massless field theory in different dimensions.}\label{Delta_diag} \end{figure} Now let us evaluate the mutual complexity \reef{ramen2} of the TFD state in the free scalar theory. Because of the product form of the TFD state and the corresponding thermal density matrices \eqref{density_QFT}, the mutual complexity simply requires summing eq.~\reef{hunt1} over all of the modes, {\it i.e.,}\ \begin{equation}\label{rocket0} \Delta \mathcal{C}_{1}^{\text{diag}} \(\ket{\text{TFD}}; \beta,\mu\) = \Omega_{d-2}V_{d-1} \int_{|\vec k|<\Lambda} \frac{k^{d-2} dk}{(2\pi)^{d-1}}\ \Delta\mathcal{C}_{1}^{\mt{diag}} \(\ket{\text{TFD}}_{12}; \beta,\omega_{{\vec k}},\mu\)\,. \end{equation} Using our previous results, it is easy to show that there are three possible expressions depending on the relation between the cutoff frequency $\omega_\Lambda$ and the critical frequencies, $\omega_{c,1}$ and $\omega_{c,2}$, defined in eq.~\reef{dog3}. We find \begin{equation}\label{delta_diag} \begin{split} &\Delta \mathcal{C}_{1}^{\text{diag}} \(\ket{\text{TFD}}\)\(\beta,\mu\) =\Omega_{d-2}V_{d-1} \int_0^\Lambda \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \, \ln \coth\left(\frac{\beta \omega_{{\vec k}}}{2}\right) \\ &\ \ \ +\ \left\{ \begin{array}{lr} \Omega_{d-2}V_{d-1} \int_0^\Lambda\! \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \,I_1 & {\rm for}\ \ \omega_\Lambda \le \omega_{c,1}\,,\\ \\ \Omega_{d-2}V_{d-1} \( \int_0^{k_{c,1}}\! \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \,I_1 + \int_{k_{c,1}}^{\Lambda}\! \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \,I_2\)& {\rm for}\ \ \omega_{c,1} \le \omega_\Lambda \le \omega_{c,2}\,,\\ \\ \Omega_{d-2}V_{d-1} \left(\int_0^{k_{c,1}}\! \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \, I_1 +\int_{k_{c,1}}^{k_{c,2}}\! \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \, I_{2} +\int_{k_{c,2}}^\Lambda\! \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \, I_{3} \right) & {\rm for}\ \ \omega_{c,2} \le \omega_\Lambda\,. \end{array} \right. \end{split} \end{equation} The first line is a ``universal contribution," which is common to all three cases, and the expression on the second line is determined by the relationship between the cut-off and the critical frequencies, with \begin{eqnarray} I_{1}&=&\ln \left( \frac{ \mu-\omega_{{\vec k}}\tanh(\beta \omega_{{\vec k}}/2)}{\mu-\omega_{{\vec k}} \coth(\beta \omega_{{\vec k}}/2)} \right)\,,\qquad I_{2}=\ln \left( \frac{\coth(\beta \omega_{{\vec k}}/4)}{\coth(\beta \omega_{{\vec k}}/2)} \right)\,, \nonumber\\ &&\qquad\qquad I_{3}=\ln \left( \frac{ \omega_{{\vec k}}-\mu\tanh(\beta \omega_{{\vec k}}/2)}{\omega_{{\vec k}}-\mu\coth(\beta \omega_{{\vec k}}/2)} \right)\,. \end{eqnarray} First, let us observe that as expected the mutual complexity $\Delta_{1}^{\text{diag}} \(\ket{\text{TFD}}\)$ is finite. In particular, the terms which could potentially produce UV divergences, {\it i.e.,}\ $|\ln\frac{\mu}{\omega_{{\vec k}}}|$, and which would appear in the complexity of the TFD state and the thermal state (as well as the vacuum state) separately, have been fully canceled in the mutual complexity. In order to produce explicit results, let us focus on the massless field theory. For simplicity, we also assume that $\mu \gg\Lambda$ (as well as $\mu\beta\gg1$), which assures us that we are in the first regime, {\it i.e.,}\ $\omega_\Lambda< \omega_{c,1}$, in eq.~\reef{delta_diag}. Further, this assumption allows us to use $k/\mu$ as an expansion parameter in the second integral below. Now the universal contribution coming from the first line of eq.~\eqref{delta_diag} yields\footnote{Certain integrals relevant for the complexity can be evaluated analytically with $m=0$, {\it e.g.,}\ \begin{equation}\label{C_entropy} \begin{split} \int_0^{\infty} k^n\ \ln \coth({\beta k}/{2}) \,dk&= \frac{(2^{n+2}-1)\Gamma(n+2)\zeta(n+2)}{(n+1)(2\beta)^{n+1}}\,,\qquad {\rm for}\ n\geq 0\,,\\ \int_0^{\infty} \frac{k^n}{\sinh \beta k} \,dk&= \frac{(2^{n+1}-1)\Gamma(n+1)\zeta(n+1)}{2^n\beta^{n+1}}\,,\qquad {\rm for}\ n\geq 1\,. \end{split} \end{equation} } \begin{equation}\label{gaga66} \begin{split} \Delta \mathcal{C}_{1}^{\text{diag},\(0\)}(\ket{\text{TFD}}) \big|_{m=0} =& \, \Omega_{d-2}V_{d-1} \int_0^\Lambda \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \, \ln\, \coth\!\left({\beta k}/{2}\right) \\ =& \, \frac{\Omega_{d-2}}{(4\pi)^{d-1}}\,(2^d-1)\zeta(d)\Gamma(d-1) \,V_{d-1} T^{d-1} \\ =& \, \frac{2^d-1}{2^{d-1}d}\,S\(\hat{\rho}_{\text{th}} \)\big|_{m=0}\,, \end{split} \end{equation} where the expression for the thermal entropy was given in eq.~\reef{green4}. Note that because the integral is UV finite, we have taken the upper limit of the integration to infinity. Turning to the second contribution, we find\footnote{The term we have neglected in the second line, {\it i.e.,}\ $\mathcal{O}\!\({k^{2}}/{\mu^2}\)$, is also proportional to $e^{-k\beta}$ when the momentum is large with respect to the temperature, which makes it convergent.} \begin{eqnarray} \Delta \mathcal{C}_{1}^{\text{diag},\(1\)}(\ket{\text{TFD}}) \big|_{m=0}&=&\Omega_{d-2}V_{d-1} \int_0^\Lambda \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \, \ln\! \left( \frac{ \mu-k\,\tanh(\beta k/2)}{\mu-k\, \coth(\beta k/2)} \right) \nonumber\\ &\simeq& \Omega_{d-2}V_{d-1} \int_0^\Lambda \frac{ k^{d-2}dk}{(2\pi)^{d-1}} \, \[ \frac{k}{\mu}\, \frac{2}{\sinh \beta k} +\mathcal{O}\!\({k^2}/{\mu^2}\) \]\label{gaga69}\\ \nonumber\\ &=& \Delta \mathcal{C}_{1}^{\text{diag},\(0\)}(\ket{\text{TFD}}) \big|_{m=0}\left[2(d-1)\,\frac{T}\mu +\mathcal{O}\!\({T^{2}}/{\mu^2}\)\right]\,. \nonumber \end{eqnarray} Hence for the massless theory, the universal contribution \reef{gaga66} is proportional to the thermal entropy, while the second integral modifies this result with a series of corrections suppressed by powers of $T/\mu$. Note that both eq.~\reef{gaga66} and the leading correction in eq.~\reef{gaga69} are positive, and hence the mutual complexity of the thermofield double state exhibits subadditivity, for the massless scalar in the diagonal basis. Of course, this had to be the case since eq.~$\eqref{hunt1}$ is always positive. For a small mass, we can also evaluate the integrals for the massive theory to find additional corrections suppressed by powers of $m/T$. The leading contribution comes from the universal correction, which can be rewritten as \begin{equation} \begin{split} \Delta \mathcal{C}_{1}^{\text{diag},(0)}(\ket{\text{TFD}}) &= \Omega_{d-2} V_{d-1} \int \frac{k^{d-2} dk}{(2\pi)^{d-1}}\, \ln \frac{e^{\beta \omega_{k}}+1}{e^{\beta \omega_{k} }-1}\,,\\ &= \frac{\Omega_{d-2} }{(2\pi)^{d-1}}\,V_{d-1}T^{d-1}\int_{\beta m}^\infty dx ~ x \( x^{2}-\beta^2m^2\)^{\frac{d-3}{2}}\ln\,\coth\!\(x/{2}\)\,, \end{split} \end{equation} where as usual, $\omega_{k}^2= k^2+m^2$, and in the second line, we defined $x\equiv\beta\omega_{k}$. For $d=3$, the integral yields a relatively simple analytical answer \begin{eqnarray} \Delta \mathcal{C}_{1}^{\text{diag},(0)}(\ket{\text{TFD}})\big|_{d=3} &=& \frac{V_2\, T^2}{2\pi} \bigg[-\beta^2m^2\(\frac13\,\beta m +i \frac\pi2\) \nonumber\\ &&\qquad-\beta m \[\text{Li}_2\!\(e^{\beta m}\)+\text{Li}_2\!\(-e^{-\beta m}\)+\text{Li}_3\!\(e^{\beta m}\)-\text{Li}_3\!\(-e^{-\beta m}\)\] \bigg] \nonumber\\ &\simeq& \frac{V_2\, T^2}{8\pi} \[ {7\,\zeta(3)}+\frac{m^2}{T^2}\(2\,\ln \!\(\frac{m}{2T}\)-1\) +\mathcal{O}\(m^3/T^3\)\]\,, \label{gaga67} \end{eqnarray} where Li$_n$ denotes the polylogarithm function. For $d>3$ (and $m/T\ll 1$ again), one finds \begin{eqnarray} \Delta \mathcal{C}_{1}^{\text{diag},(0)}(\ket{\text{TFD}})\big|_{d} &\simeq&\frac{\Omega_{d-2}\,V_{d-1} T^{d-1}}{(2\pi)^{d-1}} \int_{m\beta}^\infty dx\[ x^{d-2} - \frac{d-3}{2}\beta^2m^2\,x^{d-4} \] \ln\,\coth\!\( x/{2}\) \nonumber\\ &\simeq& \frac{\Omega_{d-2}\,V_{d-1}T^{d-1}}{(4\pi)^{d-1}}\bigg[(2^d-1)\zeta(d)\Gamma(d-1) \label{gaga68}\\ &&\qquad\qquad\quad -{(2^{d-1}-2)\zeta(d-2)\Gamma(d-2)}\,\frac{m^2}{T^2} +\mathcal{O}(m^3/T^3)\bigg]\,. \nonumber \end{eqnarray} Of course, the leading contribution above (and in eq.~\reef{gaga67}) matches the universal result for $m=0$ in eq.~\reef{gaga66}. Note that the $m^2/T^2$ correction to the integrand in eq.~\reef{gaga68} vanishes for $d=3$. Hence in eq.~\reef{gaga67}, the correction at this order comes entirely from the modification to the lower limit of the range of integration. In contrast for $d>3$, the change in the lower limit of integration yields a higher order correction of order $(\beta m)^{d-1}$, {\it i.e.,}\ this contribution is higher order than the $(\beta m)^2$ term retained in eq.~\eqref{gaga68}. We also note that for both $d=3$ and $d>3$, the leading correction is always negative. However, in this regime with $m/T\ll1$, the mutual complexity is still dominated by the leading term \reef{gaga66}, which is positive. Hence the complexity of the TFD state remains subadditive in this limit. Of course, this had to be the case given the positivity of eq.~\eqref{hunt1}. \subsubsection{Mutual complexity in the physical basis}\label{sec:mcipb} We now turn to evaluating the mutual complexity of the TFD state in the physical basis. For a single mode, the TFD state \eqref{two_mode} is obtained from the general purification \eqref{Fock_psi12} by setting $r=s=0$. Using eqs.~\eqref{rbar} and \eqref{thetadef}, we can demonstrate that this corresponds to \begin{equation} \begin{split} X_-= 1\,,\quad \theta=\frac{\pi}{4}, \quad \omega_{\pm}=\omega e^{\pm 2 \alpha}, \quad \frac 12 \ln \frac{\omega_+}{\omega_-}= 2\alpha, \quad H = \frac{1}{2}\left( \begin{array}{cc} \ln \frac{\omega}{\mu} & -2\alpha \\ -2\alpha & \ln \frac{\omega}{\mu} \\ \end{array} \right)\,. \end{split} \end{equation} It is then straightforward to show that the complexity of the TFD state \eqref{two_mode} is given by \begin{equation}\label{TFD_position} \begin{split} \mathcal{C}_{1}^{\mt{phys}} \(\ket{\text{TFD}}_{12}\) &= \left| \ln \frac{\omega}{\mu} \right| + 2\alpha = \left\{ \begin{array}{lr} \ln \frac{\mu}{\omega} + \ln \coth \(\frac{\beta \omega}{4} \) , & \omega \le \mu\,,\\ \\ \ln \frac{\omega}{\mu}+ \ln \coth \(\frac{\beta \omega}{4} \) , & \omega \ge \mu \,.\\ \end{array} \right. \end{split} \end{equation} This result is consistent with the complexity derived in \cite{Chapman:2018hou} using the $F_1$ cost function --- see eq.~(138) in \cite{Chapman:2018hou} with $C_1^{\mt{LR}}=|\ln \lambda|+2 |\alpha|$ and note that the physical basis was denoted as the LR basis there. As before, the two reduced density matrices are $\hat{\rho}_{1,2}=\hat{\upsilon}_{{th}}$, and we wish to evaluate the mutual complexity of the TFD state but now in the physical basis: \begin{equation}\label{DeltaCpos} \Delta \mathcal{C}_1^{\mt{phys}} \( \ket{\text{TFD}}_{12}\) = 2\, \mathcal{C}_1^{\mt{phys}} \( \hat{\upsilon}_{{th}}\) - \mathcal{C}_{1}^{\mt{phys}} \(\ket{\text{TFD}}_{12}\) \,. \end{equation} The purification complexity $\mathcal{C}_{1}^{\mt{phys}}\!\(\hat{\upsilon}_{{th}}\)$ is defined using eq.~\eqref{purification_C_pos} and $\mathcal{C}_{1}^{\mt{phys}} \(\ket{\text{TFD}}_{12}\)$ is given in eq.~\reef{TFD_position}. This expression is evaluated numerically in figure \ref{deltaCLR_thermal01}, and we note that in the physical basis, $\Delta \mathcal{C}_1^{\mt{phys}} \(\ket{\text{TFD}}_{12}\)$ does not have a definite sign. That is, eq.~\reef{DeltaCpos} may be positive or negative depending on the parameters, which contrasts with the corresponding expression for the mutual complexity always being positive in the diagonal basis. \begin{figure}[t] \includegraphics[width=0.5\textwidth]{figures/deltaCLR_thermal} \hspace{0.01\textwidth} \includegraphics[width=0.55\textwidth]{figures/deltaCLR_thermal02} \caption{The mutual complexity $\Delta \mathcal{C}_1^{\mt{phys}}\( \ket{\text{TFD}}_{12}\)$ as defined in eq.~\eqref{DeltaCpos} with fixed $\bar{r}=\frac{1}{2}\ln\frac{\omega}{\mu}<0$ as a function of $\alpha$. We find that the quantity $\Delta \mathcal{C}_1^{\mt{phys}}$ can be either positive or negative. The right plot is the region with $\bar{r}$ near the transition point $\bar{r}=-2.177$.}\label{deltaCLR_thermal01} \end{figure} One can gain some analytical insight into the above result by focusing on the limit of small $\alpha$, {\it i.e.,}\ large $\beta\omega$. Combining eqs.~\reef{small_alpha} and \eqref{TFD_position}, the single-mode mutual complexity \reef{DeltaCpos} becomes \begin{equation} \label{board88} \begin{split} \Delta \mathcal{C}_1^{\mt{phys}} (\ket{\text{TFD}}_{12}) &=2\,\mathcal{C}_1^{\mt{phys}} (\hat{\upsilon}_{{th}}) - \mathcal{C}_{1}^{\mt{phys}} \(\ket{\text{TFD}}_{12}\) \\ &= 2\alpha \( \frac{2 \,\ln\frac{\mu}{\omega}}{\sqrt{\mu/\omega}-\sqrt{\omega/\mu}}-1 \) + \mathcal{O}(\alpha^2) \,. \end{split} \end{equation} Comparing to figure \ref{deltaCLR_thermal01}, we see that this leading expression captures the linear behaviour in the vicinity of $\alpha=0$, and that the sign of the slope determines whether the corresponding mutual complexity will be negative over some range. Further, eq.~\reef{board88} shows that the slope is determined by the ratio $\mu/\omega$ (or alternatively by $\bar r =\frac12\ln(\omega/\mu)$). We also observe that this slope ({\it i.e.,}\ the function multiplying $2\alpha$) is invariant under $\frac{\mu}\omega\to\frac\omega\mu$. The transition between positive and negative values of the slope occurs at \begin{equation} 2\,|\bar r_c|=\left| \ln \frac{\omega_c}{\mu} \right|\simeq 4.35464\cdots \,. \end{equation} That is, $\Delta \mathcal{C}_1^{\mt{phys}} (\ket{\text{TFD}}_{12}) $ is entirely positive (for all values of $\alpha$) in the region $0.01285\lesssim \omega/\mu\lesssim 77.84$, or alternatively $\left| \bar{r} \right| \lesssim 2.177$, and it has negative contributions (for small values of $\alpha$) outside of this range. Of course, these results precisely match those found numerically, as shown in figure \ref{deltaCLR_thermal01}. Now because of the factorization of the thermal state in free field theory, the corresponding mutual complexity is given by simply summing eq.~\reef{DeltaCpos} over each of the modes, \begin{equation}\label{integral_phys} \Delta \mathcal{C}_1^{\mt{phys}} \( \ket{\text{TFD}}\) = V_{d-1} \int \frac{d^{d-1}k}{(2\pi)^{d-1}} \left[ 2\,\mathcal{C}_{1}^{\mt{phys}}\!\(\hat{\upsilon}_{{th}}\) - \mathcal{C}_{1}^{\mt{phys}}\! \(\ket{\text{TFD}}_{12}\) \right]\,. \end{equation} It is possible to demonstrate that this expression for the mutual complexity in the physical basis is finite by considering the small $\alpha$ limit in eq.~\eqref{board88} which demonstrates that the mutual complexity is exponentially suppressed for large momentum, hence resulting in a convergent integral. Although evaluating this expression analytically is a challenge, it is straightforward to evaluate this mutual complexity numerically. Figure \ref{deltaC_phys} shows the mutual complexity $\Delta \mathcal{C}_1^{\mt{phys}}\( \ket{\text{TFD}}\)$ for a massless free scalar in $d=2$, as an example. Varying the reference frequency from IR scales to UV scales, we see that mutual complexity begins with negative values for $\beta \mu\ll1$, then rises to positive values at intermediate scales with $\beta \mu\sim 1$, and finally becomes negative again for $\beta \mu\gg1$. In other words, the mutual complexity $\Delta \mathcal{C}_1^{\mt{phys}}\! \(\ket{\text{TFD}}\) $ can be {\bf negative} when the reference frequency is very large or extremely small. This again stands in contrast with the diagonal basis, where the corresponding mutual complexity was found to be positive for all values of the reference frequency. \begin{figure}[htbp] \includegraphics[width=0.5\textwidth]{figures/Delta_phys_small} \hspace{0.01\textwidth} \includegraphics[width=0.48\textwidth]{figures/Delta_phys_large} \caption{The integrated mutual complexity in the physical basis $\Delta \mathcal{C}_1^{\mt{phys}}\( \ket{\text{TFD}}\)$ in eq.~\eqref{integral_phys} for a massless free scalar field theory in $d=2$ as a function of $\beta \mu$. The two plots show different regimes of the parameter $\beta \mu$. The integrated mutual complexity is negative when $\beta \mu$ is very small or very large. }\label{deltaC_phys} \end{figure} Using a change of variables $\tilde k = \beta k$ in the integral in eq.~\eqref{integral_phys}, it is possible to extract an overall coefficient proportional to the entropy \eqref{green4} of the massless theory, {\it i.e.,}\ $V_{d-1}T^{d-1}\sim S_{\mt{th}}$. The remaining integral is a function of the dimensionless parameter $\beta\mu$. Finiteness of the result in the limit $\beta \mu\gg 1$ requires that this function will approach a constant.\footnote{Though it is not immediately obvious from the plot in the right panel of figure \ref{deltaC_phys}, we were able to confirm that in the limit of large $\beta \mu$, the result approaches a constant.} Hence, the resulting mutual complexity is proportional to the entropy in this limit. \subsection{Other Proposals for Mixed State Complexity} Before proceeding with a further discussion of our results, we would first like to briefly review the other proposals for mixed-state complexity made in \cite{BrianMixedComplexity} and possible connections to our current work: {\bf Spectrum and Basis Complexity:} One alternative \cite{BrianMixedComplexity} is to break the problem of preparing mixed states into two parts --- creating the spectrum and creating the basis of eigenvectors. The spectrum complexity $\mathcal{C}_S$ is defined as the minimal purification complexity of some mixed state $\hat\rho_{\text{spec}}$ which has the same spectrum as $\hat\rho_\mathcal{A}$, where one also optimizes over the possible $\hat\rho_{\text{spec}}$. Since one possible $\hat\rho_{\text{spec}}$ with the required spectrum is simply $\hat\rho_\mathcal{A}$, we conclude that $\mathcal{C}_S \le \mathcal{C}_P$, where $\mathcal{C}_P$ denotes the purification complexity of $\hat\rho$. In our analysis, the spectrum is defined by the eigenvalues of the matrix $B$ in eq.~\eqref{matrix_B}. The basis complexity can be defined in different ways: The first suggestion in \cite{BrianMixedComplexity} is simply the difference $\mathcal{C}_P-\mathcal{C}_S$. The second suggestion is to define ${\mathcal{C}}_{B}$ as the complexity ({\it i.e.,}\ minimal number of unitary gates) required to go from the optimal $\hat{\rho}_{\text{spec}}$ to our target state $\hat{\rho}$. The latter preparation can be made with unitary gates because the two mixed states share the same spectrum. We can easily demonstrate $\mathcal{C}_P\leq \mathcal{C}_S+ \mathcal{C}_B$ since on the left-hand side, the preparation is constrained to pass through the intermediate state $\hat\rho_{\text{spec}}$. Our construction using the physical basis seems closely related to this approach. To modify the spectrum, one must use ``mixed" entangling gates acting between $\cal A$ and ${\cal A}^c$, and so these would appear in the circuit preparing (the purification of) $\hat\rho_{\text{spec}}$. The gates acting only on the $\cal A$ degrees of freedom are modifying the basis, and the circuit preparing $\hat\rho_\mathcal{A}$ from $\hat\rho_{\text{spec}}$ is comprised solely of these gates. However, it seems that there is no natural role for the gates acting only on $\mathcal{A}^c$. In this framework then, not using these gates may be the reason for the difference in the complexities, {\it i.e.,}\ $\mathcal{C}_P\leq \mathcal{C}_S+ {\mathcal{C}}_{B}$. Let us also note that both the spectrum complexity and the entanglement entropy are both insensitive to the action of the gates acting only on ${\cal A}$ or only on ${\cal A}^c$. Only the ${\cal A}{\cal A}^c$ entangling gates change these quantities. For example, considering two mixed states of a single harmonic oscillator with the same entanglement entropies, this implies that the spectrum complexities must also be equal. It would be interesting to understand to what extent this property generalizes to states over many degrees of freedom, {\it e.g.,}\ the thermal state of a free scalar, studied in section \ref{apply01}. We will explore some of the issues above in the future work \cite{wip99}. {\bf Open System Complexity:} Open system complexity studies the complexity of circuits which move through the space of density matrices using general CPTP maps, rather than only unitary transformations. This requires characterizing these general maps in terms of elementary operations and then assigning a cost to the latter. Of course, as discussed in the introduction, the dilation theorems \cite{dilaton} imply that the most general CPTP maps acting on a system of qubits can be realized as unitary evolution of the system coupled to ancillary qubits \cite{watrous2009quantum}, which seems to bring this approach back to the framework used for the purification complexity. However, one potential difference for the open system complexity is that some of the ancillae may be introduced and traced out, {\it i.e.,}\ they are re-initialized, at every step. This would contrast with having a single reservoir of ancillae on which we can repeatedly act before tracing them at the very end of the unitary evolution, as described for the purification complexity. {\bf Ensemble Complexity:} The ensemble complexity is defined using a decomposition of the mixed state over an ensemble of pure states as follows \begin{equation} \mathcal{C}_E=\min_{\{p_i, |\psi_i\rangle\} } \sum_i p_i \, \mathcal{C}(|\psi_i\rangle )\,,\qquad{\rm where}\quad \hat \rho = \sum_i p_i |\psi_i\rangle \langle \psi_i|\,. \end{equation} Of course, this notion reduces to the pure state complexity when the state $\hat \rho_\mathcal{A}$ is pure. Even with a Gaussian mixed state $\hat \rho_\mathcal{A}$, we would generally have to explore ensembles which are not constructed solely from Gaussian states. In the case of the thermal state, a decomposition is available in terms of coherent states and this allows to put a bound on the ensemble complexity of thermal states --- see section 3.5 of \cite{BrianMixedComplexity} for further details. \subsection{Mutual Complexity in QFT} In section \ref{compare7}, we considered beginning with the pure state $\ket{\Psi_{\mathcal{A}\mathcal{B}}}$, and then constructed the two reduced density matrices, $\hat\rho_\mathcal{A}$ and $\hat\rho_\mathcal{B}$. Then in eq.~\reef{ramen2A}, the mutual complexity was defined as the combination \cite{Ali:2018lfv}, \begin{equation}\label{ramen2Ax} \Delta\mathcal{C} = \mathcal{C}\!\(\hat{\rho}_\mathcal{A}\) + \mathcal{C}\!\(\hat{\rho}_\mathcal{B}\) - \mathcal{C}\!\( \ket{\Psi_{\mathcal{A}\mathcal{B}}}\) \,, \end{equation} which quantifies the additional correlations between the subsystems $\mathcal{A}$ and $\mathcal{B}$. Our first application of this quantity was to compare the complexity of the TFD state with the purification complexity of the thermal mixed state produced by tracing out either the left or the right degrees of freedom, {\it e.g.,}\ see eq.~\reef{ramen2}. As a warm-up exercise, we evaluated the mutual complexity for a two-mode TFD state and as shown in eq.~\reef{hunt1}, we found $\Delta\mathcal{C}_{1}^{\mt{diag}}\(\ket{\text{TFD}}_{12}\) > 0$. More generally, we might evaluate the mutual complexity for general two-mode pure Gaussian states $\ket{\Psi}_{12}$. That is, integrating out each of the degrees of freedom in term yields two distinct mixed states, $\hat{\rho}_1$ and $\hat{\rho}_2$, and so one might compare the purification complexity of these two mixed states with that of the parent pure state, with the analogous expression to that in eq.~\reef{ramen2Ax}. In fact, using the results for the purification complexity of one-mode Gaussian states in eq.~\eqref{complexity_one_mode}, it is straightforward to show that subadditivity always holds for any two-mode pure Gaussian state, {\it i.e.,}\ \begin{equation}\label{astorm} \Delta\mathcal{C}_{1}^{\mt{diag}}\(\ket{\Psi}_{12}\)= \mathcal{C}^{\text{diag}}_{1}\(\hat{\rho}_1\)+\mathcal{C}^{\text{diag}}_{1}\(\hat{\rho}_2\) - \mathcal{C}_{1}^{\text{diag}} \(\ket{\Psi}_{12}\) \ge 0\,. \end{equation} However, this inequality does not extend to the purification complexity calculated in the physical basis, as in section \ref{fizz}. It would be interesting to investigate whether the above inequality can be made more restrictive, {\it e.g.,}\ where the mutual complexity is greater than some finite bound proportional to the entanglement entropy. Since in section \ref{apply01}, the TFD state has a simple product structure for the free scalar field theory, the mutual complexity becomes simply a sum over the same quantity evaluated for each of the individual modes --- see eqs.~\reef{rocket0} and \reef{integral_phys}. Hence the positivity appearing in eq.~\reef{hunt1} for the two-mode TFD states in the diagonal basis extends to the TFD state of the full scalar QFT. That is, $\Delta \mathcal{C}_{1}^{\text{diag}} \(\ket{\text{TFD}}\)>0$ irrespective of the values of the temperature, reference frequency or the mass of the scalar. This positivity is not replicated for the mutual complexity when it is evaluated using the physical basis, as shown in figure \ref{deltaC_phys}. There we showed that for a massless two-dimensional scalar, $\Delta \mathcal{C}_{1}^{\text{phys}} \(\ket{\text{TFD}}\)$ becomes negative when the reference frequency $\mu$ is much smaller or much larger than the temperature. In section \ref{compare7} we found that with $\mu\gg T$, the mutual complexity of the TFD state is proportional to entanglement entropy between the left and right copies of the field theory. However, in general, there would be an overall proportionality constant which contains a temperature dependence through the (dimensionless) ratio $T/\mu$, as well as $T/m$ for a massive scalar. This behaviour is easily seen analytically in the diagonal basis using eqs.~\reef{gaga66} and \reef{gaga69}, but similar results also apply in the physical basis, see comments at the end of section \ref{sec:mcipb}. In any event, the appearance of the entanglement entropy in the regime $\mu\gg T$ reinforces the intuition that the mutual complexity in eq.~\reef{ramen2Ax} quantifies the correlations between the subsystems to which the pure state is reduced. Before turning to subregions, let us briefly comment again that $\Delta \mathcal{C}$ is UV finite for the TFD state. For the free scalar, we found that the leading UV divergence in the purification complexity of the thermal mixed state is the same for either the diagonal or physical basis, as determined in eqs.~\eqref{dog35}-\eqref{dog5} or eq.~\eqref{laugh88}, respectively. The precise form of this leading divergence can be found as \begin{equation}\label{holorocket} \mathcal{C}(\hat\rho_{th}(\beta)) \simeq \begin{cases} \frac{\Omega_{d-2} V_{d-1}}{2\,(2\pi)^{d-1} (d-1)}\,\Lambda^{d-1} \( \ln \frac{\mu}{\Lambda} + \frac{1}{d-1} \) \,, & \mu \ge \Lambda\,,\\ \frac{\Omega_{d-2} V_{d-1}}{2\,(2\pi)^{d-1} (d-1)}\,\Lambda^{d-1} \( \ln \frac{\Lambda}{\mu} + \frac{2}{d-1} \( \frac{\mu}{\Lambda}\)^{d-1} - \frac{1}{d-1} \) \,,&\mu \le \Lambda \,. \end{cases} \end{equation} Exactly, the same divergences also appear in the complexity of the vacuum state of the scalar field theory, {\it e.g.,}\ see appendix B of \cite{qft2}. These divergences are also exactly one-half of those found for the TFD state, and hence the subtraction in eq.~\reef{ramen2} yields $\Delta\mathcal{C}\(\ket{\text{TFD}}\)$ which is UV finite (in either basis). More precisely, all of the potentially divergent contributions cancel in the integrand of eq.~\reef{delta_diag} for the diagonal basis and of eq.~\reef{integral_phys} for the physical basis, and so all of the UV divergences cancel in the corresponding mutual complexities. Of course, this UV finiteness is directly related to the fact that optimal purification of the thermal state $\hat\rho_{th}(\beta)$ is not the TFD state. Much of the preparation of the TFD state involves introducing short-distance correlations in {\it both} copies of the field theory. Even though the optimal purification of $\hat\rho_{th}(\beta)$ involves introducing a number of auxiliary degrees of freedom that is equivalent to introducing a second copy of the QFT, there is no need to prepare the purification with UV correlations amongst the ancillae since after they are integrated out, these will not affect the physical correlations of the thermal mixed state.\footnote{Similar comments appear in \cite{BrianMixedComplexity} using the basis and spectrum language, {\it i.e.,}\ preparing the TFD state requires many gates which adjust the basis of the purifying system but which do not affect the mixed thermal state of the original system.} This is why the UV divergences in $\mathcal{C}(\hat\rho_{th}(\beta))$ carry exactly a factor of one-half compared to $\mathcal{C}\(\ket{\text{TFD}}\)$.\footnote{Given the optimal purification of $\hat\rho_{th}(\beta)$, it may be interesting to investigate the properties of $\rho_{\mathcal{A}^c}$, {\it i.e.,}\ the mixed state found after tracing out the physical degrees of freedom. For example, one should find that it is much less entangled at short distances.} In section \ref{apply02}, we considered the purification complexity of subregions of the vacuum. In this case, both the vacuum state and the mixed states produced by reducing to a subregion can again be written in a product form. However, the basis of states appearing in these products is not the same, {\it i.e.,}\ for the vacuum, we use momentum eigenstates (which are eigenstates of the Hamiltonian), while for the subregions, we use eigenstates of the corresponding modular Hamiltonian. Hence we can no longer apply eq.~\reef{astorm} to determine the sign of the mutual complexity of the vacuum divided into two complementary subregions, $\mathcal{A}$ and $\mathcal{B}$. However, we found that $\Delta \mathcal{C}_1^{\rm diag}$ is still positive in the diagonal basis, as illustrated in figure \ref{fig:mutualcomp}. In the physical basis, we gave two definitions of the mutual complexity in eq.~\eqref{twoDeltaCs}, which differ by the basis in which the ground state complexity is evaluated. Our analysis indicates that $\Delta\mathcal{C}_1^{\rm phys}$ is generally negative, while $\Delta\tilde{\mathcal{C}}_1^{\rm phys}$ is positive, as illustrated in figure \ref{fig:subregion2-phys}. The sign difference between these two definitions is due to the vacuum complexity being much larger in $\Delta\mathcal{C}_1^{\rm phys}$ than in $\Delta\tilde{\mathcal{C}}_1^{\rm phys}$. The cutoff dependence of $\Delta \mathcal{C}^{\rm phys}_1$ is related to the subleading divergences of the subregion complexities and the ground state complexity, which are all logarithmic. On the other hand, the cutoff dependence of $\Delta\tilde{\mathcal{C}}_1^{\rm phys}$ is dominated by the subleading divergence of $\mathcal{C}^{\cal AB}_1(|\Psi_0\rangle)$, which is linear in the cutoff. At this point, let us note that for subregions of the vacuum, it is again the case that the original state, {\it i.e.,}\ the vacuum state, does not provide the optimal purification. If the vacuum was the optimal purification, then the subregion complexity would simply match the complexity of the ground state. As a result, the leading divergence of all of the subregion complexities would be $\mathcal{C}\sim V(\Sigma)/\delta^{d-1}$ (where $V(\Sigma)$ is the volume of the global time slice) and the corresponding mutual complexity would also exhibit a volume-law divergence. Instead as shown in eqs.~\reef{Theamazingsubregionequation} and \reef{divergences2}, the leading divergences are instead proportional to $V(\mathcal{A})$, the volume of the subregion, and as discussed above, the mutual complexity is then controlled by the subleading divergences appearing in the individual complexities. Again, this reflects the fact that in the optimal purification, there is no need to prepare UV correlations amongst the ancillae. Moreover, we might note that the ground state would not even be an essential purification (with the minimal number of ancilla) for subsystems whose size is less than half of that of the full system. We turn to the comparison of the mutual complexity from our QFT and our holographic calculations in the next subsection. However, before closing here, let us note that there is no reason why in calculating the mutual complexity, the initial state must be a pure state. That is, a simple generalization of eq.~\reef{ramen2Ax} would be \begin{equation}\label{ramen2Ay} \Delta\mathcal{C} = \mathcal{C}\!\(\hat{\rho}_\mathcal{A}\) + \mathcal{C}\!\(\hat{\rho}_\mathcal{B}\) - \mathcal{C}\!\( \hat{\rho}_{\mathcal{A}\cup\mathcal{B}}\) \,, \end{equation} where the combined system begins in a mixed state $\hat{\rho}_{\mathcal{A}\cup\mathcal{B}}$. We still expect that in this situation the mutual complexity \reef{ramen2Ay} quantifies the additional correlations between the subsystems $\mathcal{A}$ and $\mathcal{B}$. Using our results, a simple example would be to consider two neighbouring (but not overlapping) subregions, $\mathcal{A}$ and $\mathcal{B}$, in the vacuum state. These combine to form the larger subregion $\mathcal{A}\cup\mathcal{B}$ (but note that we assume $\mathcal{A}\cap\mathcal{B}=0$). Building on eq.~\reef{deltaC-subregion} in the holographic context, we would find that the leading contribution to the mutual complexity becomes \begin{eqnarray} \text{AdS}_{d+1},\text{P}\,:\qquad\Delta\mathcal{C}_A&=&-\frac{L^{d-1}}{2\pi^2 (d-2) G_N}\, \ln\! \left(\frac{2(d-1)\ell_{\text{ct}}}{L}\right)\,\frac{{V}(\partial\mathcal{A}\cap\partial\mathcal{B})}{\delta^{d-2}}+\cdots\,, \nonumber\\ \text{AdS}_{d+1},\text{P}\,:\quad \Delta\mathcal{C}_{V2.0} &=&- \frac{4L^{d-1}}{ d(d-1)(d-2)G_N }\,\frac{{V}(\partial\mathcal{A}\cap\partial\mathcal{B})}{\delta^{d-2}}+\cdots\,. \label{mutdPmix} \end{eqnarray} In this case, we observe that this leading divergence is comparable to that in the mutual information between the subregions $\mathcal{A}$ and $\mathcal{B}$. Of course, this suggests that in general one should think of the mutual complexity as being related to mutual information, rather than the entanglement entropy even when $\hat{\rho}_{\mathcal{A}\mathcal{B}}$ is a pure state. It would be interesting to investigate this generalization \reef{ramen2Ay} further in the case of disjoint ({\it i.e.,}\ non-neighbouring) subregions $\mathcal{A}$ and $\mathcal{B}$, where the mutual information is finite, and exhibits an interesting phase transition for holographic CFTs \cite{Headrick:2010zt,Hartman:2013mia,Faulkner:2013yia}. A similar setup studying purifications of two complementary subregions appears also in the context of the entanglement of purification \cite{pure0,pure1,pure2,terhal2002entanglement}. It would be interesting to investigate the relation between these two notions. Further, we observe that the mutual complexity \reef{ramen2Ay} for mixed states would generally be nonvanishing (but UV finite) using the subregion-CV approach \reef{eq:cv}, even if the subregions lie in a constant time slice on the boundary. Another interesting issue to investigate would be if inequalities similar to the Araki-Lieb inequality \cite{Araki:1970ba} can be used to bound the difference in complexity between two complementary subsystems when starting with a mixed state. Finally, to close here, let us comment on the case of partially overlapping subregions. In this case, one is naturally lead to consider the following generalization of the mutual complexity \begin{equation}\label{ramen2Aaa} \Delta\mathcal{C} = \mathcal{C}\!\(\hat{\rho}_\mathcal{A}\) + \mathcal{C}\!\(\hat{\rho}_\mathcal{B}\) - \mathcal{C}\!\( \hat{\rho}_{\mathcal{A}\cup\mathcal{B}}\) - \mathcal{C}\!\( \hat{\rho}_{\mathcal{A}\cap\mathcal{B}}\) \,. \end{equation} With this difference of complexities, the leading divergences in the individual complexities cancel, and the sign of the result is nontrivial. It would be interesting to investigate the properties of this generalization further. \subsection{Holographic Complexity} \label{holod} Much of the motivation of our paper was to compare the results for the purification complexity in the free scalar QFT to those for the mixed state complexity found in holography. Hence we now compare the QFT results of sections \ref{apply01} and \ref{apply02} for the purification complexity of thermal states and subregions in the vacuum state to the analogous results found with the subregion-CV \eqref{eq:cv}, subregion-CA \eqref{eq:ca}, and subregion-CV2.0 \eqref{eq:cv2} prescriptions found in section \ref{sec:holo}. Recall that motivated by previous comparisons, we focused our analysis of the complexity in the QFT on the $F_1$ cost function \reef{func2}. For example, the structure of the UV divergences for the $\mathcal{C}_1$ complexity in QFT was found to be similar to that for holographic complexity \cite{qft1,qft2}. However, the basis dependence of this measure was found to play an important role in evaluating the complexity of TFD states \cite{Chapman:2018hou}, and so we also evaluated our QFT complexities in both the diagonal and physical bases here. One more observation, before turning to the results, is that the authors of \cite{NonLocal} have argued that the relevant gates in holographic complexity should be non-local. Of course, the original analysis of the QFT complexity \cite{qft1}, which we adapt here in our analysis, also involves non-local gates. Hence this is a common point for the complexity in both frameworks. The leading UV divergence in any of the holographic prescriptions for the complexity of the reduced state on a subregion has the same volume-law form as found for a pure state. That is, all three prescriptions yield an expression of the form $\mathcal{C}\simeq k_d\, V(\mathcal{A})/\delta^{d-1}+\cdots$ where $V(\mathcal{A})$ is the volume of the boundary subregion $\mathcal{A}$ on which the mixed state is defined, and $k_d$ is some constant depending on the dimension, the central charge $c_T$ and the prescription chosen. In the vacuum (or any pure state), the leading divergence is precisely the same except that $V(\mathcal{A})$ is replaced by $V(\Sigma)$, the volume of the entire Cauchy surface in the boundary theory. This volume-law behaviour is the same as found for the free scalar. For example, the leading divergence in the QFT complexity of the thermal state is shown in eq.~\reef{holorocket}. As noted there, this divergence is precisely the same as found for the vacuum state \cite{qft2}. Similarly, for subregions in the vacuum state we found a leading divergence proportional to the volume of the subregion, see eqs.~\eqref{Theamazingsubregionequation} and \eqref{divergences2}. When considering subregions of the vacuum, an interesting feature which distinguishes the subregion-CA and subregion-CV2.0 proposals from the subregion-CV prescription is that the former two generate subleading divergences that are associated with the geometry of the boundary of the subregion, {\it e.g.,}\ as shown in eq.~\reef{A4P}. In contrast, no such contributions appear with the subregion-CV proposal, {\it e.g.,}\ see eq.~\reef{ads4subcv}.\footnote{ While this equation does exhibit a subleading logarithmic divergence, there is no `area-law' divergence proportional to $R/\delta$.} Of course, as discussed in section \ref{revvH}, we could modify the subregion-CV prescription by adding a term proportional to the volume of the HRT surface, as in eq.~\reef{eq:cvX}. This modified prescription would yield boundary contributions similar to those found with the subregion-CA and subregion-CV2.0 proposals. As this modification of the subregion-CV prescription highlights, at least to leading order, the boundary contributions are proportional to the entanglement entropy of the reduced density matrix on the subregion. We would like to explore further the relation between the subleading divergences in the complexity and entanglement entropy by returning to our results of AdS$_3$ in section \ref{holosub}. Recall that using global coordinates in the bulk of AdS$_3$ corresponds to the two-dimensional boundary CFT living on a circle with a finite circumference $C$. Further our results for the subregion complexity for the subregion-CA and subregion-CV2.0 proposals were presented in eqs.~\eqref{toderive} and \eqref{CV203G} with a finite term, which we could not determine analytically. However, in the limit of small subregions, {\it i.e.,}\ $\ell/C\ll1$, we were able to predict the form of these finite functions $f(\ell/C)$ and $\tilde f(\ell/C)$ in eqs.~\eqref{lim0} and \eqref{lim1}, by comparing to the results coming from putting the boundary CFT on an infinite line. However, if we imagine that the boundary contributions to the subregion complexity are related to entanglement entropy, we should recall the formula for the entanglement entropy of an interval in CFT$_2$ on a finite circle: $S_{EE}=\frac{c}{3} \ln \(\frac{C}{\pi\delta}\sin\(\frac{\pi\ell}{C}\)\)$ \cite{Calabrese:2004eu,Calabrese:2005zw}. This formula suggests that $f(\ell/C)$ and $\tilde f(\ell/C)$ should be given by the following expressions, \begin{eqnarray} f(\ell/C)&=&{c\over 3\pi^2} \(- \ln\!\left(\frac{2\ell_{\text{ct}}}{L}\right) \ln\!\left[ \frac{1}{\pi}\sin\(\frac{\pi\ell}{C}\)\right] +\frac{\pi^2}{8}\)\,, \label{ab}\\ \label{at} \tilde f(\ell/C) &=& -\frac{4\,c}{3} \( \ln\!\left[ \frac{1}{\pi}\sin\(\frac{\pi\ell}{C}\)\right] + \frac{\pi^2}{8}\)\,. \end{eqnarray} Of course, the expressions above reduce to those in eqs.~\eqref{lim0} and \eqref{lim1} in the limit $\ell/C\to 0$. However, we note that eqs.~\reef{ab} and \reef{at} are symmetric about $\ell/C=1/2$, and so a similar logarithmic singularity appears in the limit $\ell/C\to 1$, {\it e.g.,}\ $\tilde f(\ell/C)\simeq -\frac{4\,c}{3} \,\ln [ \frac{C-\ell}{C}]$ in this limit. Figure \ref{numericsglobal} shows results for $f(\ell/C)$ and $\tilde f(\ell/C)$ obtained by numerical integration (see \cite{Chapman:2018bqj,future1} for further details) and compares these to the predictions in eqs.~\reef{ab} and \reef{at}. In both cases, the numerical results fit almost perfectly with the predicted analytic expressions. Hence it appears that the subleading logarithmic divergence in the complexities in eqs.~\eqref{toderive} and \eqref{CV203G} takes precisely the same form as the corresponding entanglement entropy. This suggests a deep relation between the two quantities (at least for two-dimensional CFTs). It would be interesting to investigate this relation further, and to investigate if eqs.~\reef{ab} and \reef{at} can be derived analytically. \begin{figure}[t] \begin{center} \includegraphics[width=0.49\textwidth]{figures/CAab}~~ \includegraphics[width=0.43\textwidth]{figures/CV20ab} \end{center} \caption{Finite part of the complexity using the subregion-CA (left) and subregion-CV2.0 (right) using global coordinates. For subregion-CA, we expressed $f(\ell/C) \equiv {c\over 3\pi^2} \(- \ln\!\left(\frac{2\ell_{\text{ct}}}{L}\right) b(\ell/C)+a(\ell/C)\)$ and the left plot shows our numerical evaluation of $a(\ell/C)$ (green dots) and $b(\ell/C)$ (blue dots). These results are overlaid with the corresponding expressions suggested by the entanglement formula in eq.~\reef{ab}, {\it i.e.,}\ $a(\ell/C)=\pi^2/8$ and $b(\ell/C)=\ln\!\[ \frac{1}{\pi}\sin\(\frac{\pi\ell}{C}\)\]$ (black and red curves). For subregion-CV2.0, we expressed $\tilde f(\ell/C) \equiv -\frac{4\,c}{3}\, \tilde a(\ell/C)$ and the right plot shows our numerical evaluation of $\tilde a(\ell/C)$ (blue dots). These results are overlaid with the corresponding expression in eq.~\reef{at}, {\it i.e.,}\ $\tilde a(\ell/C)=\ln\!\[ \frac{1}{\pi}\sin\(\frac{\pi\ell}{C}\)\]+ \pi^2/8$ (red curve). In both cases, the numerical results fit almost perfectly with the predicted analytic expressions.}\label{numericsglobal} \end{figure} With the subregion-CA or subregion-CV2.0 proposals, the boundary divergences discussed above dominate the mutual complexity of the vacuum state, {\it e.g.,}\ see eqs.~\reef{mutdP} and \reef{holomutualcomp}. Hence, given a bipartition of the vacuum into subregions $\mathcal{A}$ and $\mathcal{B}$, the mutual complexity is UV divergent with the leading divergence taking the form $\Delta \mathcal{C}\sim V(\partial\mathcal{A})/\delta^{d-2}$, where we have implicitly used that $\partial\mathcal{A}=\partial\mathcal{B}$. Of course, this divergence has precisely the same form as the celebrated area-law term \cite{Sorkin_1983,Bombelli_1986,Srednicki_1993} found in the entanglement entropy between $\mathcal{A}$ and $\mathcal{B}$. This again supports the claim that the mutual complexity characterizes the correlations between the two subsystems appearing in eq.~\reef{ramen2Ax}. Similar observations relating the mutual complexity and the entanglement entropy also appear in \cite{Caceres:2018luq}. With a bipartition of the vacuum state on a fixed time slice, the mutual complexity precisely vanishes using the subregion-CV prescription. Of course, if we adopted the modified prescription for $\mathcal{C}'_V(\mathcal{A})$ in eq.~\reef{eq:cvX}, the resulting mutual complexity would, of course, be proportional to the entanglement entropy. Further, this construction emphasizes the observation below eq.~\reef{mutdPmix} that it is more appropriate to think of these mutual complexities as being proportional to the mutual information between the subregion and its complement. That is, applying eq.~\reef{eq:cvX} to evaluate eq.~\reef{ramen2Ay} clearly yields $\Delta\mathcal{C}'_V=\eta\,I(\mathcal{A},\mathcal{B})$ where $I(\mathcal{A},\mathcal{B})=S_{\rm EE}(\mathcal{A}) + S_{\rm EE}(\mathcal{B})-S_{\rm EE}(\mathcal{A}\cup\mathcal{B})$ is precisely the mutual information of the two subregions. The mutual complexity is, of course, an interesting quantity to compare between the holographic and QFT approaches. Our results for $\Delta\mathcal{C}$ are summarized in table \ref{tab.comp} for all three holographic prescriptions calculated in section \ref{sec:holo}, as well as those for the free scalar QFT calculated in sections \ref{apply01} and \ref{apply02}. One feature common to the holography and QFT is that the UV divergences in the complexity of the thermal state $\hat{\rho}_{th} (\beta)$ precisely match those found in the complexity of a single copy of the vacuum,\footnote{We return to this point below.} or alternatively, they are precisely one-half of those found for the TFD state. As a consequence, the mutual complexity of the TFD state is UV finite in both holography and the free QFT. Further, we demonstrated that the mutual complexity for the TFD state calculated for the free scalar in the diagonal basis is proportional to the thermal entropy in \eqref{gaga66}, where we have taken $m=0$ and also $\beta\mu\gg1$. In the physical basis, we also expect that with the limit $\beta\mu\gg 1$ and $\beta m \ll 1$, the mutual complexity will be proportional to the entropy --- see comments at the end of section \ref{sec:mcipb}. Again, this matches the behaviour found in eqs.~\reef{exs222} and \reef{CV2.0entropy} for the subregion-CA and subregion-CV2.0 approaches. Unfortunately, the holographic complexity is superadditive, while in the diagonal basis, the QFT complexity is subadditive, {\it i.e.,}\ $\Delta\mathcal{C}({\rm TFD})<0$ for holography while $\Delta\mathcal{C}({\rm TFD})>0$ for the free QFT using the diagonal basis. However, the QFT mutual complexity in the physical basis was observed to be negative when the reference frequency $\beta \mu$ was either very small or very large, see the figure \ref{deltaC_phys}. Hence in these regimes, the physical basis results compare well with the holographic results, for the subregion-CA and subregion-CV2.0 proposals. Of course, for the $t_L=0=t_R$ time slice, the mutual complexity to the TFD state vanishes using the subregion-CV prescription. However, we could also apply the modified prescription in eq.~\reef{eq:cvX}, in which case we would find $\Delta\mathcal{C}'_V({\rm TFD})=2\eta\, S$. In this case, the sign is determined entirely by the sign of the parameter $\eta$, and in particular, choosing $\eta>0$ would yield a subadditive result as found using the diagonal basis in the free QFT. For subregions in the vacuum state of a two-dimensional free scalar field theory, using numerical fits, we inferred the general divergence structure of the purification complexity in the diagonal basis in eq.~\eqref{Theamazingsubregionequation} and in the physical basis in eq.~\eqref{divergences2}. The leading divergence is a volume term $\frac{\ell}{2\delta}|\ln \frac{1}{\mu\delta}\,|$, where the coefficient precisely matches that found in the vacuum. In this respect, the QFT complexities show the same behaviour as found with the three holographic subregion complexity proposals, in eq.~\eqref{ads3subcv} for subregion-CV, eq.~\eqref{toderive} for subregion-CA and eq.~\eqref{CV203G} for subregion-CV2.0.\footnote{Note that our QFT results of section \ref{apply02} are valid for the circle and so should be compared to the holographic result in global coordinates, see footnote \ref{linecirclefoot}.} The numerical fits for the QFT complexities (see eqs.~\eqref{Theamazingsubregionequation} and \eqref{divergences2}) did reveal a subleading logarithmic divergence proportional to $\ln(C/\delta)$,\footnote{Here we denote the total size of the system as $C(=L$ in section \ref{apply02}) to facilitate the comparison with the corresponding holographic results.} which was found in the holographic results for the subregion-CA and subregion-CV2.0 approaches (see eqs.~\eqref{toderive} and \eqref{CV203G}). However, our numerical results were not sensitive enough to resolve the precise form of the subleading contributions, {\it e.g.,}\ to find a form similar to that found for the corresponding holographic systems in eqs.~\reef{ab} and \reef{at}. It would be interesting to extend our QFT calculations to larger lattices, but also higher dimensional lattices where the subleading divergences become stronger. Here, we might note that as discussed above, the subleading contributions in the subregion complexity are expected to dominate the corresponding mutual complexity. In this regard, the functional dependence of $\Delta\mathcal{C}$ on $\ell/C$ compares well between the QFT and the holographic results on general grounds. That is, we may compare the free scalar QFT results in figure \ref{fig:mutualcomp} for the diagonal basis and in figure \ref{fig:subregion2-phys} for both definitions in the physical basis with the form appearing in figure \ref{numericsglobal} for the subleading contributions in the corresponding subregion-CA and subregion-CV2.0 results. In both cases, the mutual complexity rises dramatically for small $\ell/C$, has a broad maximum at $\ell/C=1/2$ and is symmetric under $\ell/C\to (C-\ell)/C$. A preliminary examination of the QFT results for the diagonal basis showed the following gave a good fit to our numerical results\footnote{Note that $L/\delta = 1000$ for all three curves.} \begin{equation} \label{ccfit} \Delta \mathcal{C}^{\rm diag}_1 \approx \frac{200}{500+\mu C}\left[ \ln\left(\frac{C}{\pi\delta}\sin\(\frac{\pi \ell}C\)\right) + 8.33+0.0214\,\mu C\right]\,. \end{equation} Figure \ref{fig:mutualcompXYZ} compares this function to our numerical results in figure \ref{fig:mutualcomp}. It would be interesting to investigate these fits in more detail and in particular, to produce the analogous fitting function for the physical basis results. The latter will require producing numerical results with much greater resolution than figure \ref{fig:subregion2-phys} which was produced with $N=C/\delta=100$. \begin{figure} \center \includegraphics[width=0.6\textwidth]{mutualcomp-compare} \caption{Fits (solid curves) and data (points) of the size dependence of the mutual complexity in the diagonal basis $\Delta\mathcal{C}_1^{\rm diag}$ for different reference frequencies $\mu L = 100$, $200$ and $300$. The cutoff was set to $\delta/L = 1/N = 1/1000$. The solid lines correspond to the fit in eq.~\eqref{ccfit}.}\label{fig:mutualcompXYZ} \end{figure} Unfortunately, there was not a good match for the sign of these mutual complexities in comparing the holographic and free QFT results. In particular, for all three holographic approaches, the vacuum mutual complexity was generally superadditive, {\it i.e.,}\ $\Delta\mathcal{C}<0$.\footnote{Of course, the modified subregion-CV approach \reef{eq:cvX} could yield either sign for the mutual complexity depending on the sign of the parameter $\eta$.} In contrast, using the diagonal basis in the free QFT produced a subadditive result for subregions of the vacuum. In the case of the physical basis, we actually proposed two definitions for the mutual complexity in eq.~\reef{twoDeltaCs}. With the first definition, where we introduce a partition of the vacuum degrees of freedom according to the arbitrary choice made for the subregions, $\Delta\mathcal{C}_1^{\mt{phys}}<0$ which agrees with holography. However, the leading contribution in the QFT result appears to be linear, {\it i.e.,}\ proportional to $\ell/\delta$, whereas the leading term in the subregion-CA and subregion-CV2.0 results are proportional to $\ln(\ell/\delta)$. With the second definition, where we subtract the standard vacuum complexity, $\Delta\tilde\mathcal{C}_1^{\mt{phys}}>0$ which disagrees with the holographic results. However, in this case, the leading contribution in the QFT result appears to be logarithmic, as shown in figure \ref{fig:subregion4-phys}. If we compare the leading divergences noted above in the purification complexity and the holographic complexity from subregion-CA, we are lead to identify\footnote{Of course, the same identification comes from comparing leading divergences in the purification complexity of the thermal state, or even the complexity of vacuum state.} \begin{equation} \ln \left(\frac{\ell_{\text{ct}}}{L} \right) \sim \big| \ln \( \mu\delta\) \big| = \begin{cases} \ln \left(\mu \delta \right) \,,&{\rm for}\ \mu\delta >1 \,,\\ \ln \left(\frac{1}{\mu \delta } \right) \,, &{\rm for}\ \mu\delta < 1\,. \end{cases} \end{equation} We note that the definition of circuit complexity in the free scalar QFT introduces an new scale -- the reference frequency $\mu$, while the CA proposal for holographic complexity depends on the arbitrary length scale $\ell_{\rm ct}$, which is introduced by the null boundary counterterm \cite{Lehner:2016vdi}. The comparison of the divergences in these approaches motivates us to relate the ratio $\mu\delta$ in the QFT complexity to $\ell_{ct}/L$ in the CA proposal with $\ell_{\rm ct}/L \sim {\rm max}(\mu\delta,1/\mu\delta)$.\footnote{We are implicitly assuming that $\ell_{\rm ct}/L>1$ in order that the CA complexity is positive.} A similar identification was pointed out in \cite{qft1,qft2} and the discussion section of \cite{Vaidya2}. We observe that this identification has interesting implications for the subregion-CA results since the coefficient $\ln(\ell_{ct}/L)$ also appears in terms beyond the leading contribution to the complexity. For example, an extra factor of $|\ln(\mu\delta)|$ would appear in the leading term in the mutual complexity in eq.~\reef{mutdP}. If $\mu$ and $\delta$ are independent scales, this would mean that this leading term no longer matches the area-law divergence appearing in the entanglement entropy. However, this interpretation can be restored if the reference frequency scales with the UV cutoff, {\it e.g.,}\ $\mu\delta = e^{-\sigma}$ so that the logarithmic factor simply introduces a new numerical factor, {\it i.e.,}\ $|\ln(\mu\delta)|=|\sigma|$. Our calculations also lend themselves to examining another interesting quantity, namely, the difference of the complexity of the thermal state and that of the vacuum state, {\it i.e.,}\ \begin{equation}\label{ramenZ} \begin{split} \delta\mathcal{C} = \mathcal{C}\!\(\hat\rho_{th}(\beta)\) - \mathcal{C}\!\( \rm{vac}\) = \frac{\Delta\mathcal{C}\(\ket{\text{TFD}}\) +\widetilde{\Delta\mathcal{C}}_{\text{formation}}}{2} \,. \end{split} \end{equation} As we noted above, the UV divergences in $\mathcal{C}\!\(\hat\rho_{th}(\beta)\)$ are precisely the same as in $\mathcal{C}\!\( \rm{vac}\)$, and hence we are left with a UV finite quantity in $\delta\mathcal{C}$. In the second expression in eq.~\reef{ramenZ}, we are expressing this quantity in terms of the mutual complexity of the TFD state (see eq.~\reef{ramen2}) and the ``complexity of formation'' of the TFD state \cite{Chapman:2016hwi,Chapman:2018hou}, {\it i.e.,}\ $\widetilde{\Delta\mathcal{C}}_{\text{formation}} = \mathcal{C}\(\ket{\text{TFD}}\) - 2\mathcal{C}\!\( \rm{vac}\)$. The quantity $\delta \mathcal{C}$ will be positive in free scalar QFT using the diagonal basis. This can be seen by comparing eq.~\eqref{complexity_thermal} with the corresponding the vacuum complexity for each mode, \begin{equation} \mathcal{C}\!\( \rm{vac}\)=\frac{1}{2}\,\left|\ln \frac{\mu}{\omega}\,\right |\, . \end{equation} Hence the difference is positive for each mode, and summing over all modes, as in eq.~\reef{sum_complexity02}, we find a positive result. Further, we see that this integrand decays exponentially for large frequencies, {\it i.e.,}\ $\beta\omega\gg1$, and so the integral will be UV finite, as already noted above. In the physical basis, we can combine eq.~\eqref{board88} for the mutual complexity of the TFD state, together with the result that $\widetilde{\Delta\mathcal{C}}_{\text{formation}}=2\alpha$ (see eq.~\eqref{TFD_position}) to show that in the limit $\beta\omega\gg 1$ \begin{equation}\label{deltaCslopdisc} \delta\mathcal{C}_1^{\mt{phys}} = 2\alpha \frac{ \,\ln\frac{\mu}{\omega}}{\sqrt{\mu/\omega}-\sqrt{\omega/\mu}} + \mathcal{O}(\alpha^2) \,. \end{equation} The latter is again exponentially suppressed for large frequencies and so we expect the corresponding $\delta\mathcal{C}$ to be UV finite when integrated over frequencies. A plot of $\delta \mathcal{C}_1^{\mt{phys}}$ for a single-mode is shown in figure \ref{deltaCLR_thermal01disc} and is also positive (this plot is simply obtained from the plot in figure \ref{deltaCLR_thermal01} by multiplying by a half and adding $\alpha$). Hence we also expect that $\delta\mathcal{C}>0$ in the physical basis. Supporting evidence for this positivity can be found in observing that the slope in the plot for small $\alpha$ can be read from the coefficient in eq.~\eqref{deltaCslopdisc}, which again is always positive. Let us add that in either the diagonal or physical basis, we find that $\delta C$ is proportional to the thermal entropy, at least for the limits of large $\mu \beta$ and small $m\beta$, as may be inferred from the discussion at the end of section \ref{sec:mcipb}. \begin{figure}[t] \begin{center} \includegraphics[width=0.6\textwidth]{figures/deltaCphysDisc} \end{center} \caption{The quantity $\delta \mathcal{C}_1^{\mt{phys}}\( \ket{\text{TFD}}_{12}\)$ as defined in eq.~\eqref{ramenZ} with fixed $\bar{r}=\frac{1}{2}\ln\frac{\omega}{\mu}<0$ as a function of $\alpha$. We find that the quantity $\delta \mathcal{C}_1^{\mt{phys}}$ is always positive.}\label{deltaCLR_thermal01disc} \end{figure} Using any of the three holographic approaches, $\delta \mathcal{C}$ is again a UV finite quantity because there are no boundary contributions in $\mathcal{C}(\hat\rho_{th}(\beta))$, and the remaining UV divergences match those in $\mathcal{C}({\rm vac})$. Recall that the mutual complexity of the TFD was vanishing for the CV proposal and so by eq.~\reef{ramenZ}, $\delta \mathcal{C}$ is simply given by one-half of the complexity of formation. The latter was evaluated for planar geometries in eq.~(5.8) of \cite{Chapman:2016hwi}. Hence we obtain \begin{equation} \delta \mathcal{C}_V = \frac{1}{2}\mathcal{C}_V^{\text{formation}}= 2\sqrt{\pi}\,\frac{(d-2)\Gamma(1+\frac{1}{d})}{(d-1) \Gamma(\frac{1}{2}+\frac{1}{d})}\, S\,, \end{equation} which is positive for $d>2$ and vanishing for $d=2$. For the CA proposal, eq.~\eqref{exs222} combines with the complexity of formation in eq.~(3.38) of \cite{Chapman:2016hwi} to yield \begin{equation} \delta \mathcal{C}_A= -\frac{1}{4\pi^2}\left[a(d) +g_0+4\pi\(1-\frac{1}d-\frac{d-2}{2\,d}\, \cot\(\frac{\pi}{d}\)\) \right]\,S\,, \end{equation} where $a(d)$ and $g_0$ are defined in eq.~\eqref{eq:thermalCAhelp}. One may show that the sum of the three terms inside the square brackets above is always positive,\footnote{Note that for large $d$, the third term is actually large and negative ({\it i.e.,}\ $\sim -2d$), however, this behaviour is precisely canceled by the growth of $g_0\sim 2d$. Further recall that we argued that $\ell_{\rm ct}/L>1$ to ensure that the holographic complexity is positive and hence $a(d)$ is always positive.} and hence we find that $\delta\mathcal{C}_A<0$. Similarly, using the CV2.0 approach, we combine eq.~(3.35) of \cite{Chapman:2016hwi} with eqs.~\eqref{cv20main2} and \eqref{CV2.0entropy} to find \begin{equation} \delta \mathcal{C}_{V2.0}=-\frac{8 }{d(d-1)}\,S\,, \end{equation} which is once again negative. That is, according to both the CA and CV2.0 proposals, it is easier to prepare the mixed thermal state than the pure vacuum state. Now comparing $\delta\mathcal{C}$ for the free scalar QFT with that coming from holography, we observe that in all instances, this quantity is proportional to the entropy of the thermal state. As explained above, in the QFT result, this required considering the limits, $\mu \beta\gg1$ and $m\beta\ll1$. Of course, the latter is natural to compare the result to the boundary CFT in the holographic framework. However, we must also note that while $\delta\mathcal{C}$ is positive for the free scalar and for the CV approach, it is negative for the CA and CV2.0 approaches. Hence there is some tension between the results for the two last approaches and those for the free QFT. Let us summarize our comparison of the purification complexity for the free scalar QFT with the various subregion proposals in holography: Our results do show that various general features are common to the two frameworks. However, a detailed comparison does not lead to any definite conclusions. Based on comparisons of the mutual complexity for the TFD and vacuum states, it seems that details of the QFT results using the diagonal basis are quite different from the corresponding holographic results. Recall that previous calculations of the complexity of formation for the free scalar \cite{Chapman:2018hou} already indicated that the diagonal basis did not produce results comparable to holography. The QFT results using the physical basis can be brought into closer alignment with the holographic results, at least in certain regimes, {\it e.g.,}\ $\beta\mu\gg1$ or $\beta\mu\ll1$ is required for the mutual complexity of the TFD state to be superadditive. These restrictions may be informing us about the microscopic model underlying holographic complexity. However, we are still left with apparent discrepancies for the mutual complexity of the vacuum state, as well as for the purification complexity of the thermal state \reef{ramenZ}, which may be warning us that these comparisons simply have limited applicability. \subsection{Entanglement Entropy} \label{sec_EE} Much of the original motivation to study holographic complexity was trying to understand the structure behind the horizon which is not encoded in the entanglement entropy \cite{Volume3}. From the quantum information perspective, entanglement entropy is simply one of a broad array of diagnostics with which to characterize quantum entanglement. Hence while the Ryu-Takayanagi prescription \cite{Ryu:2006bv,Ryu:2006ef} for holographic entanglement entropy has provided many new insights on the connection between geometry and entanglement in quantum gravity, it is not surprising that the full picture will require drawing on additional observables, such as holographic complexity. Here, we explicitly compare the information about a given reduced density matrix which is encoded in the complexity and the information which is encoded in the entanglement entropy. We begin with the density matrices for a single harmonic oscillator, as described in section \ref{warmup}.\footnote{This comparison was also examined in \cite{Camargo:2018eof}, with the conclusion that ``complexity is more.''} The entanglement entropy of such a density matrix can be read from the results of \cite{Srednicki_1993} \begin{equation}\label{entropy_rho1} S_1 = -{\text{Tr}} ( \hat{\rho}_1 \ln \hat{\rho}_1) = -\ln(1-u) -\frac{u}{1-u} \ln u\,, \end{equation} where using the parametrization in eq.~\eqref{Gaussian_decom}, we have $u=e^{-\beta \omega}$.\footnote{Using eqs.~\eqref{dense1} and \reef{parameters}, we may match the wavefunction parameters in \cite{Srednicki_1993} with our notation as $\cosh\beta\omega=\gamma/\beta$ and $\omega^2e^{2r}=\sqrt{\gamma^2-\beta^2}$.} Hence the entanglement entropy depends only on the combination $\beta\omega$, and is independent of the squeezing parameter $r$. This is to be contrasted with our result for the complexity, {\it e.g.,}\ see eq.~\eqref{complexity_one_mode}, which depends on both of these parameters. That is, while the entanglement entropy is entirely fixed by the temperature, the purification complexity also contains information about the squeezing of the mixed state. The natural extension of these observations to a general $N$-mode Gaussian state is as follows: First, note that general $N$-mode Gaussian states can be decomposed as\footnote{See appendix \ref{app:purification} for more details.} \begin{equation}\label{laud} \hat{\rho}_\mathcal{A} = U_\mathcal{A} \(\bigotimes_{i=1}^{N} \hat{\upsilon}_{\text{th}} (\beta_i, \omega_i) \) U_\mathcal{A}^\dagger\,. \end{equation} However, acting on a density matrix $\hat{\rho}_\mathcal{A}$ by a unitary operator as follows $U \hat{\rho}_AU^\dagger$ does not change its eigenvalues, and hence does not modify the entanglement entropy. Hence the entanglement entropy of any such state \reef{laud} does not depend on the unitaries $U_\mathcal{A}$ and, in fact, is a simple sum of the thermal entropies for each mode, {\it i.e.,}\ \begin{equation} S_\mathcal{A}= \sum_{i=1}^N S_{\text{th}}(\beta_i \omega_i) \quad{\rm where}\quad S_{\text{th}}(\beta_i \omega_i)=\frac{\beta_i\omega_i}{e^{\beta_i\omega_i}-1}-\ln(1-e^{-\beta_i\omega_i})\,. \end{equation} That is, the entanglement entropy of the states $\hat{\rho}_\mathcal{A}$ and $U_\mathcal{A}^\dagger\,\hat{\rho}_\mathcal{A}\, U_\mathcal{A}=\bigotimes_{i=1}^{N} \hat{\upsilon}_{\text{th}} (\beta_i, \omega_i)$ are identical. On the contrary, the purification complexity will generally depend on the unitary operator $U_\mathcal{A}$, as well as the choice of the reference state $\ket{\Psi_R}$. In the previous one-mode example, these two extra pieces of data are combined together and encoded in the single parameter $\bar{r} \equiv r+\frac{1}{2} \ln \frac{\omega}{\mu}$ appearing in eq.~\reef{complexity_one_mode}. For a more general mixed state, its entanglement entropy is only sensitive to its eigenvalues, while we expect that the purification complexity will capture some of the information about the unitary operator part $U_\mathcal{A}$ in the density matrix which is absent in the entanglement entropy. In any event, this general example further emphasizes the conclusion that the purification complexity offers access to more information about mixed states than the entanglement entropy. \subsection{Other Cost Functions} In the main text, we defined the purification complexity by minimizing the complexity of pure states which purify a given mixed state using the $F_1$ cost function. Of course, the latter is only one choice amongst many possibilities, and so here we briefly explore the complexity of mixed states with other cost functions. We also give a short discussion of applying the Fubini-Study approach \cite{qft2} to this problem, but leave further details of this case to \cite{wip99}. Before proceeding, we must note that the authors of \cite{Camargo:2018eof} have considered the purification complexity for one-mode Gaussian mixed states using the $F_2$ cost function in their appendix C, as we will do below. They considered the most general purification consisting of a six real (or three complex) parameter family of two-mode pure Gaussian states as purifications. The authors used numerical minimization to show that the purification complexity using the $F_2$ cost function is subadditive. Below, we go further analytically by restricting our attention to the three-dimensional space of real purifications, {\it i.e.,}\ eq.~\reef{Fock_psi12}. {\bf Purification Complexity with $F_2$ and $\kappa=2$ cost functions:} Here, we will focus on the one-mode Gaussian state $\hat{\rho}_1$, {\it e.g.,}\ see eq.~\eqref{Gaussian_decom}, and consider the $F_2$ and $\kappa=2$ cost functions for which the complexity of the pure state \eqref{Fock_psi12} is defined as \begin{equation}\label{F2_pure} \begin{split} \mathcal{C}_{\kappa=2}\(\ket{\psi}_{12} \) &=\mathcal{C}_{2}\(\ket{\psi}_{12} \)^2 = \( \frac 12\ln \frac{\omega_+}{\mu}\)^2+ \( \frac 12\ln \frac{\omega_-}{\mu}\)^2 \\ &={\frac 12} \left(\bar{r}+\bar{s}\right){}^2+ {\frac 12}\( \cosh^{-1} \( \cosh 2\alpha \cosh (\bar{r}-\bar{s}) \) \)^2 \end{split} \end{equation} where the two normal frequencies $\omega_{\pm}$ are defined in eq.~\eqref{eigenvalues_2modes}. We can define the purification complexity of the mixed state $\hat{\rho}_1$ using the $\kappa=2$ and $F_2$ cost functions as the minimal value of eq.~\eqref{F2_pure} over all possible purifications \begin{equation} \mathcal{C}_2 \( \hat{\rho}_1\) \equiv \text{min}_{s}\, \mathcal{C}_{2} \left(\ket{\psi}_{12}\right) \,, \quad \mathcal{C}_{\kappa=2} \( \hat{\rho}_1\) = \text{min}_{s}\, \mathcal{C}_{\kappa=2} \left(\ket{\psi}_{12}\right)= \mathcal{C}_2 \( \hat{\rho}_1\)^2 \,. \end{equation} Here, the minimization is performed with respect to the free parameter $s$ (or equivalently $\bar{s}$ defined in eq.~\eqref{rbar}). In principle, we only need to find the extremal point by solving $\partial_{\bar{s}} \mathcal{C}_{2}= 0 = \partial_{\bar{s}}\mathcal{C}_{\kappa=2}$, where the two cost functions share the same minimal point with respect to the free parameter $\bar{s}$. For the special limit of the pure state we have $\alpha=0$ which leads to a minimum at $\bar{s}=0$ and $\mathcal{C}_{2}\big|_{\text{min}}= \bar{r}$, as expected. Unfortunately, the above minimizations cannot, in general, be performed analytically. However, we are able to make more comments on the special case of the thermal mixed state $\hat{\upsilon}_{th}$ with $\bar r= \frac{1}{2}\ln\frac{\omega}{\mu}$, see eqs.~\eqref{Gaussian_decom} and \eqref{rbar}. Here, the purification complexity with the $F_2$ cost function reads \begin{equation} \begin{split}\label{kappa2222} \mathcal{C}_{\kappa=2} \(\hat{\upsilon}_{\text{th}}\) &=\text{min}_{s} {\frac 12}\(\left(s- \ln \frac{\mu}{\omega} \right)^2+ \( \cosh^{-1} \(\cosh 2\alpha \cosh s\) \)^2 \)\,. \end{split} \end{equation} We are able to get an analytic solution for the purification complexity and for the mutual complexity in a number of special limits. First, consider the limit of large frequency (or small temperature) $\beta \omega \gg 1$, where we have $\alpha \ll 1 $. Here it is easy to find that the minimal point at the $\mathcal{O}(\alpha^2)$ order approximately locates at \begin{equation} s\approx \frac{1}{2} \ln \frac{\mu}{\omega} - \alpha^2 \frac{\mu^2 - 2\mu\omega \,{\rm ln}\frac{\mu}{\omega} -\omega^2}{(\mu-\omega)^2}\,, \end{equation} for which the complexity is \begin{equation} {\cal C}_{\kappa=2}\(\hat{\upsilon}_{\text{th}}\) = \frac14 \left({\rm ln}\frac{\mu}{\omega}\right)^2 + \alpha^2\, {\rm ln}\frac{\mu}{\omega}\, \left(\frac{\mu+\omega}{\mu-\omega}\right)+{\cal O}(\alpha^4)\,. \end{equation} On the other hand, we can take the small frequency or large temperature limit $\beta \omega\ll 1$, or $\alpha \gg 1$, together with $\ln\frac{\mu}{\omega} -2\alpha \gg 1$ to find \begin{equation} 2s\approx \ln \frac{\mu}{\omega} -\ln \cosh 2\alpha \approx \ln \frac{\mu}{\omega} + \ln 2 -2\alpha. \end{equation} The requirement $\ln \frac{\mu}{\omega} -2\alpha \gg 1$ ensures that $s$ is large and positive, allowing us to perform an expansion in $s$ and solve the resulting transcendental equation for the minimal point. This will not be satisfied, {\it e.g.,}\ for a small reference frequency. The complexity of this purification is then \begin{equation} {\cal C}_{\kappa=2} \(\hat{\upsilon}_{\text{th}}\) = \left(\alpha +\frac12 {\rm ln}\frac{\mu}{2\omega} \right)^2+ {\cal O}(1/\alpha)\,. \end{equation} Next, we turn to the mutual complexity. We will need the complexity of the TFD state which can be obtained by substituting $s=0$ in eq.~\eqref{kappa2222} and reads \begin{equation}\label{Fk2_TFD} \begin{split} \mathcal{C}_{\kappa=2}\(\ket{\text{TFD}}_{12} \) = \frac{1}{2} \( \ln \frac{\omega}{\mu} \)^2+ 2\alpha^2 \,. \end{split} \end{equation} By numerical minimization, it is easy to show that the mutual complexity with the $\kappa=2$ cost function is subadditive, {\it i.e.,}\ \begin{equation} \Delta \mathcal{C}_{\kappa=2} \( \ket{\text{TFD}_{12}}\) = 2\mathcal{C}_{\kappa=2} \(\hat{\upsilon}_{\text{th}}\) - \mathcal{C}_{\kappa=2}\(\ket{\text{TFD}}_{12} \) \ge 0 \,. \end{equation} Except for the numerical proof, we can also show the subadditivity analytically in the various limits studied above. For the case $\beta \omega \gg 1 $ we find \begin{equation} \begin{split} \Delta \mathcal{C}_{\kappa=2} \( \ket{\text{TFD}_{12}}\) \approx 2\( \ln \frac{\mu}{\omega} \left(\frac{\mu+\omega}{\mu-\omega}\right) -1\) \alpha^2 + \mathcal{O}(\alpha^4) \ge 2\alpha^2 \ge 0\,. \end{split} \end{equation} Similarly, in the opposite limit $\beta \omega \ll 1$ (but also $\ln\frac{\mu}{\omega} -2\alpha \gg 1$), we have \begin{equation} \begin{split} \Delta \mathcal{C}_{\kappa=2} \( \ket{\text{TFD}_{12}}\) \approx 2\alpha\, \ln\frac{\mu}{2\omega}- \ln 2\, \ln\frac{\mu}{\sqrt{2}\omega} \,, \end{split} \end{equation} which is again positive in this limit. Note that the term proportional to $\ln^2(\mu/\omega)$ has been canceled in both these limits. To close this section, we would like to mention the following inequality between purification complexities with the different cost functions \begin{equation} \mathcal{C}_1^{\text{diag}}(\hat{\rho}_\mathcal{A}) \ge \mathcal{C}_2(\hat{\rho}_\mathcal{A})= \sqrt{\mathcal{C}_{\kappa=2}(\hat{\rho}_\mathcal{A})}\,. \end{equation} These relations are valid for any mixed state $\hat{\rho}_\mathcal{A}$, and arise straightforwardly from the definition of complexity of pure states. Although we do not have an analytic solution for $\mathcal{C}_2(\hat{\rho}_\mathcal{A})$, this inequality can, of course, be tested numerically. From the second equality, we can show that the subadditivity of purification complexity using the $F_2$ measure follows from the subadditivity for the $\kappa=2$ cost function because of their special relation and the fact that the inequality $A^2 +B^2 \ge C^2$ implies the inequality $|A| + |B| \ge |C|$. Finally, note that the analysis in this section is restricted to purifications of a single-mode Gaussian state by one additional auxiliary mode, and we have not addressed more general questions related to optimizing the purifications, when using the $F_2$ or $\kappa=2$ cost functions. For example, we have not clarified whether the optimal purifications should be essential purifications for these new cost functions. We will return to these issues in \cite{wip99}. {\bf Fubini-Study approach:} Instead of approaching the complexity with Nielsen's geometric approach \cite{Nielsen:2006,nielsen2006quantum,nielsen2008}, the authors of \cite{qft2} developed a similar geometric approach based on the Fubini-Study metric, {\it i.e.,}\ quantum information metric for pure states as a distance measure on the space of pure states to derive complexity. It is straightforward to extend our discussion of purification complexity using this Fubini-Study method, as follows, \begin{equation}\label{purificationFS} \mathcal{C}_{\rm{FS}} \( \hat \rho_\mathcal{A} \) \equiv \text{min}_{\mathcal{A}^c} \, \mathcal{C}_{\rm FS}\( \ket{\Psi_{\mathcal{A}\mA^c}} \)\,. \end{equation} Here, the $\mathcal{C}_{\rm FS}$ is the Fubini-Study complexity of the pure state $\ket{\Psi_{\mathcal{A}\mA^c}} $, which purifies the target mixed state $\hat{\rho}_\mathcal{A}$. Returning to our simple one-mode mixed state $\hat{\rho}_1$ in eq.~\reef{Gaussian_decom}, we can easily define \begin{equation} \mathcal{C}_{\rm{FS}} \( \hat \rho_1 \) \equiv \text{min}_{s} \, \mathcal{C}_{\rm FS}\( \ket{\psi_{12}} \)= \text{min}_{s} \,\mathcal{C}_{2}\( \ket{\psi_{12}} \) \,, \end{equation} where we have used the fact that the Fubini-Study complexity of Gaussian states is the same as that evaluated using the $F_2$ cost function, {\it e.g.,}\ compare the results of \cite{qft1} and \cite{qft2}. Therefore, the above results for $\mathcal{C}_{2}(\hat{\rho}_{1})$ also give the purification complexity for the Fubini-Study method. As shown in this paper, the purification complexity for $N$-mode systems requires a careful treatment for the optimal purification. In order to avoid these complications, the future work \cite{wip99} extends the Fubini-Study method to mixed states by considering a quantum information metric, or quantum fidelity susceptibility, of mixed states in order to develop a measure of complexity for mixed states. Remarkably, it is found that the complexity of arbitrary Gaussian mixed states using this new approach is exactly equivalent to the purification complexity based on the Fubini-Study metric \eqref{purificationFS}. In other words, the quantum information metric provides a perfect measure for the purification complexity of mixed states, without implementing the purification, and hence without optimizing over the additional parameters associated with the auxiliary degrees of freedom. \subsection{Purification Complexity in the Diagonal Basis} Here we study the diagonal basis complexity and mutual complexity of density matrices of different subregions of the vacuum state of a discretized free scalar theory in two dimensions. We focus on a circular lattice of oscillators.\footnote{See footnote \ref{linecirclefoot} on the distinction between a circular lattice and the line.} We state the problem in terms of matrices on this lattice, and then describe the algorithm we used in order to find the complexity numerically. We then present our results for the complexity and the mutual complexity. Further, in discussing our results, we focus on the case of a very small mass in order that the results might mimic those of a holographic CFT. \subsubsection{Set-up} We begin with the lattice of harmonic oscillators~\eqref{ham88} realizing a regularization of a free quantum field theory~\eqref{Ha_scalarQFT} on a one-dimensional circle of length $L$ with $N$ oscillators and lattice spacing $\delta = L/N$. The various oscillators are located at sites $\bar x_a$ where $a=1,\dots,N$ and we impose periodic boundary conditions $\bar x_{N+1}:=\bar x_1$. The Hamiltonian in normal mode coordinates $x_k$ defined in eq.~\eqref{Thefreq} is given by eq.~\eqref{normal_QFT2} and the complex coordinates are related according to $x^\dagger_k= x_{N-k}$. The ground state wavefunction of this system of harmonic oscillators is straightforward to find in normal mode basis\footnote{Note that eq.~\eqref{eq:ground-normal} differs from~\eqref{TargetGaussianPure} in that we have the magnitude squared of $x_k$ instead of simply the squared of each $\tilde{x}_k$. This is because while we assumed $\tilde{x}_k$ is real, the transformation~\eqref{Thefreq} defining $x_k$ is complex. It is possible to use instead the real Fourier transformations involving trigonometric functions in which case we would find real normal modes $\tilde{x}_k$ and the ground state would be given by~\eqref{TargetGaussianPure}, but we opt instead to use the simpler transformation~\eqref{Thefreq} at the cost of having complex $x_k$.\label{footcomplexcoord}} \begin{equation} \label{eq:ground-normal} \Psi_0(x_k) = \prod^{N}_{k=1} \left(\frac{\omega_k}{{\pi}}\right)^{1/4}\,\mathrm{exp}\!\left(-\frac{1}{2}\omega_k |x_k|^2\right)\,. \end{equation} This can be explicitly written in the physical basis using the transformation~\eqref{Thefreq} \begin{equation}\label{eq:Mpos2} \Psi_0(\bar{x}_a) = \left({\rm det}\left(\frac{M}{\pi}\right)\right)^{1/4} {\rm exp}\left[-\frac12 M_{ab} \bar{x}_a\bar{x}_b\right]\,, \end{equation} where \begin{equation} \label{eq:Mpos} M_{ab} = \frac1N \sum_{k=1}^N \omega_k\, {\rm exp}\left[-\frac{2\pi i k}{N}(a-b) \right]\,. \end{equation} Next, we partition the system into two subregions ${\cal A}=\{\bar{x}_1,\,\bar{x}_2,\,\cdots,\,\bar{x}_J \}$ and ${\cal B}=\{\bar{x}_{J+1},\,\cdots,\,\bar{x}_N \}$ and decompose the matrix $M$ as in eq.~\eqref{Gaussian_AB} \begin{equation} M= \left( \begin{array}{cc} \Gamma & K \\ K^\dagger & \Omega \\ \end{array} \right) \end{equation} where $\Gamma$ links the oscillators in the subregion ${\cal A}$ while $\Omega$ links the oscillators in subregion ${\cal B}$. The $K$ matrices link the two subregions and are responsible for the entanglement between ${\cal A}$ and ${\cal B}$. Tracing out the oscillators in ${\cal B}$ then gives us a density matrix of the form~\eqref{densityFun_A}-\eqref{density_fun_A}, where the matrices $A$ and $B$ are related to $M$ by~\eqref{pure_constrians} \begin{equation} \label{pure_constraints} A=\Gamma-\frac12 K \Omega^{-1} K^\dagger\,,\quad B=\frac12 K \Omega^{-1} K^\dagger\,. \end{equation} If $K=0$ then $B=0$ and we have a pure state. This is to be expected since without $K$ there is no entanglement between the two regions and both wave-functions are pure: $\Psi_{\cal AB} = \Psi_{\cal A} \otimes \Psi_{\cal B}$. In this section, our goal is to calculate the purification complexity of the density matrix~\eqref{densityFun_A} obtained by the procedure above. Although the numerical minimization for purification complexity is always possible in principle, the number of free parameters will increase rapidly with the size of the subsystem, which means that we will need much more time in order to perform the numerical minimization for a larger lattice. Instead, we have claimed in section~\ref{MbyM} that even for density matrices which are not simple products of single modes, mode-by-mode purifications can be used to provide a good approximation of the optimal purifications. Hence, here we have taken the strategy to focus on mode-by-mode purifications in the numerical minimization for the complexity of the mixed state in a given subregion $\hat{\rho}_\mathcal{A}$. We expect our results presented later will approximate the purification complexity ${\cal C}^{\rm diag}_1$ for subregions of the vacuum. We comment on the quality of this approximation in section \ref{commentsonApp}. In order to find the purification complexity using a mode-by-mode approximation, we have followed the following algorithm. We begin by computing the parameter matrix $M_{ab}$ in eq.~\eqref{eq:Mpos}. Next, given a partition of our system ${\cal A} \cup {\cal B}$, we compute $A$ and $B$ using~\eqref{pure_constraints}. We then diagonalize $A$ with an orthogonal transformation $O_A $ by $D_A=O_A A O_A^T$, and proceed to rescale the entries of $A$ by $D_A^{-1/2}$. We then diagonalize the $\tilde{B}= D_A^{1/2} O_A B O_A^T D_A^{1/2}$ matrix in this new non-orthogonal basis\footnote{The basis is non-orthogonal for non-commuting $A$ and $B$ because of the rescaling by $D_A$ between the two orthogonal transformations $O_A$ and $O_B$.} with an orthogonal transformation $O_B$ by $D_B=O_B \tilde{B} O_B^T$. The density matrix in the non-orthogonal basis $\tilde{x} = O_B D_A^{1/2} O_A \bar{x}\equiv R\bar{x}$ now takes the following form $$ \rho_{\cal A}(\tilde{x}_i,\tilde{x}'_i) = |{\rm det}R|^{-1} \sqrt{{\rm det}\left(\frac{A-B}{\pi}\right)} \prod_{i} {\rm exp}\left[-\frac12 (\tilde{x}_i^2+(\tilde{x}'_i)^2)+ b_i\tilde{x}_i \tilde{x}'_i\right]\,, $$ where the number of non-zero eigenvalues $b_i$ indicates the number of ancillary oscillators which are necessary in order to purify the density matrix. We proceed to purify the mixed state $\hat{\rho}_\mathcal{A}$ with a mode-by-mode purification in this non-orthogonal basis, {\it i.e.,}\ \begin{equation}\hat{\rho}_{\cal A} ={\rm Tr}_{\mathcal{A}^c}\hat{\rho}_{\mathcal{A}\mA^c}\,,\quad \hat{\rho}_{\mathcal{A}\mA^c}=|\Psi_{\mathcal{A}\mA^c} \rangle \langle \Psi_{\mathcal{A}\mA^c}|\,, \end{equation} with \begin{equation} \label{eq:mbym} \Psi_{\mathcal{A}\mA^c}(\tilde{x}_i,y_{i}) = {\cal N} \prod_i {\rm exp}\left[-\frac12 (1+b_i)\tilde{x}_i^2- \frac{k_i^2}{4b_i}y_i^2-k_i \tilde{x}_iy_i \right]\,. \end{equation} We return to the orthogonal basis $\bar{x} = R^{-1}\tilde{x}$ with \begin{equation} \label{eq:AAc} \Psi_{\mathcal{A}\mA^c}(\bar{x}_i,y_i) = {\cal N}' {\rm exp}\left[-\frac12 (\bar{x},y){\cdot}M_{\cal A} {\cdot}\left( \begin{array}{c} \bar{x} \\ y \\ \end{array} \right) \right]\,, \end{equation} and find the eigenvalues $\lambda_i$ of $M_{\cal A}$. Finally, we minimize the complexity ${\cal C}^{\rm diag}_1 = \frac{1}{2}\sum_i |{\rm ln}\frac{\lambda_i}{\mu}|$ over the free parameters $k_i$. For some of the subregions considered, this minimization has to be done over an ${\cal O}(10^2)$ number of parameters. Fortunately, in our problem at hand, dividing this minimization into a sequence of minimizations over ${\cal O}(1)$ parameters indeed reaches the global minima of the function to be optimized.\footnote{Indeed, even taking the minimization over one parameter at a time gives the global minima \emph{most} of the time. We found that minimizing over 2 or 3 parameters at a time gave accurate enough results without requiring too much more computational power.} Obviously, we can follow the same process to derive the purification complexity for the complementary subregion $\hat{\rho}_\mathcal{B}$. Following the analysis in section \ref{compare7}, we can define the mutual complexity for subregions in the diagonal basis as \begin{equation}\label{mutual_diag_sub} \Delta\mathcal{C}_1^{\rm diag}\equiv {\cal C}^{\rm diag}_1(\rho_{\cal A}) + {\cal C}^{\rm diag}_1(\rho_{{\cal B}})- {\cal C}^{\rm diag}_1(|\Psi_0 \rangle ) \,. \end{equation} \subsubsection{Numerical results in the diagonal basis} Throughout the following discussion, we have set the mass to $mL=0.01$. Again, our aim is that by setting the mass to such a small value, our QFT results might resemble those found in holography where the boundary theory is conformal. A comparison of the results for the free scalar theory and for holography is considered in section \ref{sec:disc}. \begin{figure} \center \includegraphics[width=0.7\textwidth]{N1000-complexities-clean} \caption{Purification complexity in the diagonal basis for subregions of the vacuum as a function of the subregion size. The cutoff was set to $N = L/\delta = 1000$ and the mass to $mL=0.01$. The purification complexity for the subregion with $\ell \to L$ agrees with the complexity of the ground state in diagonal basis.}\label{fig:size} \end{figure} \begin{figure} \includegraphics[width=0.44\textwidth]{cut-comp-clean}~ \includegraphics[width=0.46\textwidth]{cut-comp-9-10}\\ \includegraphics[width=0.45 \textwidth]{cut-comp-1-20} \includegraphics[width=0.55 \textwidth]{cut-comp-19-20} \caption{Purification complexity in the diagonal basis for subregions of the vacuum as a function of the lattice cutoff. The mass was set to $m L =0.01$. The different plots correspond to different subregion sizes $\ell/L = 0.05,\,0.1,\, 0.9$ and $0.95$ as indicated and each plot contains five different reference frequencies of $\mu L = 100,\,200,\,300,\,400$ and $500$ respectively.} \label{fig:subregion1} \end{figure} {\bf Dependence on the size of the subregion:} First, we find the subregion complexity as a function of the subregion size for a lattice of 1000 harmonic oscillators for different values of the reference frequency and plot the results in figure~\ref{fig:size}. For all cases, the complexity grows linearly with the subregion size up to the expected complexity of the vacuum. The slope of the plot decreases with increasing reference frequency. {\bf Structure of divergences in purification complexity:} For subregions with fixed size, we plot the cutoff dependence of the purification complexity in figure~\ref{fig:subregion1}. The large $N$ (or equivalently, the small $\delta$) behavior of the subregion complexity with $\ell/L=1/20,\,1/10,\,9/10$ and $19/20$ is given by \begin{equation} \label{fit} \begin{split} \mathcal{C}^{\rm diag}_1(\ell/L=0.05,\mu L,\delta/L) \approx & \, \frac{\ell}{2\, \delta} \ln \frac{1}{\mu \delta} + 0.232 \ln\frac{L}{\delta} + 0.307\, \mu \ell +2.08\,,\\ \mathcal{C}^{\rm diag}_1(\ell/L=0.10,\mu L,\delta/L) \approx & \, \frac{\ell}{2\, \delta} \ln \frac{1}{\mu \delta} + 0.241\ln\frac{L}{\delta}+ 0.312\, \mu \ell +2.11\,,\\ \mathcal{C}^{\rm diag}_1(\ell/L=0.90,\mu L,\delta/L) \approx & \, \frac{\ell}{2\, \delta} \ln \frac{1}{\mu \delta} + (0.542-0.304\mu\ell)\,\ln\frac{L}{\delta}+ 0.340 \, \mu \ell -0.308\,,\\ \mathcal{C}^{\rm diag}_1(\ell/L=0.95,\mu L,\delta/L) \approx & \,\frac{\ell}{2\, \delta} \ln \frac{1}{\mu \delta} +(0.383-0.147\,\mu \ell)\,\ln\frac{L}{\delta}+ 0.329\, \mu \ell +0.688\,. \end{split} \end{equation} These suggest a divergence structure of the form\footnote{Note that the fits in eq.~\eqref{fit} were obtained using the data for large values of $L/\delta$, {\it i.e.,}\ $L/\delta>300$ in figure \ref{fig:subregion1}. Furthermore, we kept $\mu L$ fixed in these fits (and plots). Therefore, the fits correspond to a region where $\mu \delta$ is small. More generally, one could consider reference frequencies of the order of the cutoff, or even larger. The intuition from the pure state results (see footnote \ref{footvac}) leads to the conclusion that there should be an absolute value on the logarithmic factor, as we write in eq.~\eqref{Theamazingsubregionequation}.\label{foot67}} \begin{equation}\label{Theamazingsubregionequation} \mathcal{C}^{\rm diag}_1(\ell/L,\mu L,\delta/L) \approx \frac{\ell}{2\, \delta} \left|\ln \frac{1}{\mu \delta} \right|+f_1(\mu L,\ell/L)\ln\frac{L}{\delta}+f_2(\mu L,\ell/L) \end{equation} where $f_1$ and $f_2$ are dimensionless functions, which are independent of the cutoff scale $\delta$. We note that the leading divergence matches the results found in~\cite{qft1,qft2} for the full system with $\ell\to L$. In eq.~\eqref{Theamazingsubregionequation}, we have found the structure of divergences for our system with $mL=0.01$, which was chosen to emulate a massless field theory. In the case of a massive theory, {\it i.e.,}\ $mL\gtrsim 1$, we expect that the divergence structure is again as in eq.~\eqref{Theamazingsubregionequation}, except that the coefficients $f_1$ and $f_2$ would now also depend on the additional mass parameter, {\it e.g.,}\ $f_1= f_1(\mu L, \ell/L, mL)$ and $f_2= f_2(\mu L, \ell/L, mL)$. On the other hand, we expect that the UV divergence in the first term is a universal volume term, as in the massless theory. This contribution represents the cost required to prepare the ground state entanglement at very short scales, while the other terms depend on the details of the QFT ({\it e.g.,}\ the mass).\footnote{In particular, we found that the complexity of the \emph{full} ground state is, using eqs.~\eqref{complexity_pure} and \eqref{Thefreq}, \begin{equation}\label{512} {\cal C}^{\rm diag}_1(\hat{\rho}_0) = \frac{L}{2\delta} {\rm ln}\left(\mu\delta\right) + \frac12 {\rm ln}\left(\frac{1}{mL}\right) - \frac{m^2L^2}{48}+{\cal O}(m^4,m^2\delta^2)\,, \end{equation} where here we assumed $\mu \ge \sqrt{\frac{4}{\delta^2} + m^2}$ in order to obtain this simple analytic form. Alternatively, for $\mu<m$, the same result is obtained up to an overall minus sign. For the values we chose, $\frac12 {\rm ln}\left(\frac{1}{mL}\right)-\frac{m^2L^2}{48} \approx \frac12 {\rm ln}\left(\frac{1}{mL}\right)\approx 2.30$, although this zero mode contribution would diverge in the $m\to 0$ limit. For intermediate values of the reference frequency $m < \mu < \sqrt{\frac{4}{\delta^2}+m^2}$, numerical fitting show the same leading divergence and a subleading logarithmic divergence ${\cal C}^{\rm diag}_1(\hat{\rho}_0) = \frac{L}{2\delta} | {\rm ln}\left(\mu\delta\right) | - \tilde f(\mu L)| \rm \ln(\mu \delta)| +{\rm finite}$, with $\tilde f(\mu L) \approx 4.10 \times 10^{-7} (\mu L)^{1.85}>0$. We used the parameters $m L=0.01$, $\mu L = 20,\,40,\,60,\,80,\,100,\,200,\,300,\,400,\,500$ for data with $L/\delta = 1$ to $10^4$, and found fits for the large $L/\delta$ behaviour. \label{footvac}} The structure of UV divergences is similar for holographic complexity, as we examine in section \ref{sec:holo}. A detailed comparison of the QFT and holographic results is also discussed in section \ref{holod}. {\bf Mutual complexity in the diagonal basis for subregions:} The numerical results for the mutual complexity \eqref{mutual_diag_sub} are shown in figures \ref{fig:mutualcomp} and \ref{fig:mutualcomp2}. We observe that the mutual complexity in the diagonal basis is positive for all of the subregion sizes shown there. However, we do not have an analytic argument which proves that this should be the case in general. The mutual complexity rises dramatically for small subregion sizes in figure \eqref{mutual_diag_sub}, and then it continues to increase as the subregion size grows until the subregion reaches half of the system. Further, $\Delta\mathcal{C}$ is symmetric under $\ell\to L-\ell$. It has a positive logarithmic dependence on the cutoff which comes from the subleading divergence in the complexities. Looking at eq.~\reef{fit}, we observe that while $f_1(\mu \ell)+ f_1(\mu (L-\ell))$ becomes negative for large enough reference frequency, this contribution is offset by the negative coefficient of the logarithmic term in the vacuum complexity (see footnote~\ref{footvac}) to produce an overall positive cutoff dependence in the mutual complexity, as can be seen in figure~\ref{fig:mutualcomp2}. \begin{figure} \center \includegraphics[width=0.6\textwidth]{mutualcomp} \caption{Subregion size dependence of the mutual complexity in the diagonal basis $\Delta\mathcal{C}_1^{\rm diag}$ for different reference frequencies $\mu L = 100$, $200$ and $300$. The cutoff was set to $\delta/L = 1/N = 1/1000$ and the mass to $m L = 0.01$.}\label{fig:mutualcomp} \end{figure} \begin{figure} \center \includegraphics[width=0.43\textwidth]{cut-mutualcomp-1-20} \includegraphics[width=0.55\textwidth]{cut-mutualcomp} \caption{Cutoff dependence of the mutual complexity in the diagonal basis $\Delta\mathcal{C}_1^{\rm diag}$ for different reference frequencies $\mu L = 100$, $200$, $300$, $400$ and $500$. The subregion sizes were fixed to $\ell/L = 0.1$ and $0.05$ and the mass to $m L = 0.01$.}\label{fig:mutualcomp2} \end{figure} \subsection{Purification Complexity in the Physical Basis} We introduced the physical basis purification complexity ${\cal C}^{\rm phys}_1$ in section \ref{fizz} and further investigated some of its properties in section \ref{subsec3phys}. In this subsection, we investigate the behaviour of ${\cal C}^{\rm phys}_1$ for subregions of the vacuum for a two-dimensional free scalar QFT on a circular lattice. The procedure to do this is very similar to the algorithm introduced in the previous section. In fact, the only difference comes after finding the purification matrix in the position basis in eq.~\eqref{eq:AAc}. From the purification matrix in the position basis \begin{equation}\label{MAMAMAMAMAMA} M_{\cal A} = \begin{pmatrix} \Gamma^{\rm pos} & K^{\rm pos} \\ \left(K^{\rm pos}\right)^T & \Omega^{\rm pos} \end{pmatrix}\,, \end{equation} we rotate the physical modes and the ancilla modes independently to diagonalize $\Gamma^{\rm pos}$ and $\Omega^{\rm pos}$ according to \begin{equation} M_{\cal A} \to M_{\cal A}^{\rm phys} = R_{\rm phys} M_{\cal A} R_{\rm phys}^T\,, \quad R_{\rm phys} = \begin{pmatrix} R_{\cal A} & 0 \\ 0 & R_{{\cal A}^c} \end{pmatrix}\,, \end{equation} where $R_{\cal A} \in SO(N_{\cal A},\mathbb{R})$ and $R_{{\cal A}^c} \in SO(N_{{\cal A}^c},\mathbb{R})$ such that $\Gamma^{\rm phys} = R_{\cal A} \Gamma^{\rm pos} R_{\cal A}^T$ and $\Omega^{\rm phys} = R_{{\cal A}^c} \Omega^{\rm pos} R_{{\cal A}^c}^T$ are diagonal. Finally, the generator matrix $H^{\rm phys}$ can be found by taking the matrix logarithm of the parameter matrix in this basis as in~\eqref{eq:Hphys} \begin{equation} \label{eq:C1phys} H^{\rm phys} = \frac12\, \ln\!\left(\frac{M_{\cal A}^{\rm phys}}{\mu}\right)\,. \end{equation} The physical basis complexity of these purifications is defined as in eq.~\eqref{C1phys}\footnote{Notice that eq.~\eqref{C1phys} does not have a minimization, while eq.~\eqref{eq:C1phys} includes a minimization over purifications. This is because~\eqref{C1phys} is the complexity in physical basis of~\emph{one particular purification}, while~\eqref{eq:C1phys} is the purification complexity of the density matrix $\rho_{\cal A}$, defined as the minimal complexity over all purifications of $\rho_{\cal A}$.} \begin{equation} {\cal C}^\mt{phys}_1 \( \hat{\rho}_\mathcal{A}\)= \text{min}\,\sum_{a,b=1}^{N_{\cal A}+N_{\mathcal{A}^c}} |H^{\rm phys}_{ab}|\,, \end{equation} where we need to minimize the purification complexity over the free parameters $k_i$ which were introduced in eq.~\eqref{eq:mbym}. \subsubsection{Numerical results in the physical basis} Again, we set $mL=0.01$ throughout the following. By setting the mass to such a small value, we expect that our QFT results might behave similar to those found for a holographic CFT. \textbf{Dependence on the size of the subregion:} We plot the purification complexity in the physical basis as a function of the subregion size for a lattice of 100 harmonic oscillators for different values of the reference frequency in figure~\ref{fig:subregion-phys}. Unlike the diagonal basis complexity, we find that for subregions approaching the full system, the physical basis purification complexity can increase beyond the complexity of the full system before decreasing rapidly to the full system complexity. At first sight, this might seem contradictory, since the ground state is one of the possible purifications over which the purification complexity is minimized. However, the complexity of the ground state in the physical basis partitioned by ${\cal A}$ and ${\cal A}^c$ can be greater than the complexity of the ground state itself. In fact, the purification complexity in the physical basis should be less than the complexity of the ground state~\emph{in that same basis}. In the right panel of figure~\ref{fig:subregion-phys}, we compare the purification complexity in the physical basis ${\cal C}^{\rm phys}_1(\rho_{\cal A})$ to the complexity of the ground state ${\cal C}^{\cal AB}_1(|\Psi_0 \rangle )$ in the basis which does not mix the degrees of freedom in the subsystem ${\cal A}$ with the modes in the complementary region $\mathcal{B}$. Indeed, we find that ${\cal C}^{\rm phys}_1(\rho_{\cal A}) \le {\cal C}^{\cal AB}_1(|\Psi_0 \rangle )$ for all subregions ${\cal A}$ and the inequality is only saturated when $\mathcal{A}$ encompasses the entire system ({\it i.e.,}\ $\ell/L=1$). Note that comparing $\mathcal{C}^{\rm phys}_1(\rho_{\cal A})$ with the complexity of the ground state $\mathcal{C}^{\rm diag}_1(|\Psi_0\rangle)$ in the diagonal basis, we find that the above bound does not hold. In particular, the figure shows that for large subregions ({\it i.e.,}\ $\ell/L\gtrsim 0.6$), the subregion complexity exceeds that of the ground state in diagonal basis (but, of course, they coincide at $\ell/L=1$). There is no contradiction in finding $\mathcal{C}^{\rm phys}_1(\rho_{\cal A})>\mathcal{C}^{\rm diag}_1(|\Psi_0\rangle)$ for some subregions since the two complexities are evaluated using different gate sets. As noted above, when the complexities are evaluated using the same basis, the subregion complexity is smaller than that of the vacuum. \begin{figure} \center \includegraphics[width=0.49\textwidth]{phys-size-magnitudes} \includegraphics[width=0.49\textwidth]{purif-vs-ground} \caption{Left panel: subregion complexity as a function of the subregion size in physical basis for reference frequencies $\mu L = 0.1$, $1$, $10$, $100$, $1000$. Right panel: comparison of the subregion complexity to the complexity of the ground state in the physical basis for $\mu L = 100$. In both plots, the cutoff was set to to $L/\delta=N=100$ and the mass to $m L =0.01$.} \label{fig:subregion-phys} \end{figure} \textbf{Structure of divergences in purification complexity:} For subregions with fixed size, we plot the cutoff dependence of the purification complexity in figure~\ref{fig:subregion3-phys}. The large $N$ (or equivalently, the small $\delta$) behavior of the subregion complexity with $\ell/L=1/10,\,9/10,\,1/20$ and $19/20$ is \begin{equation} \begin{aligned} \label{fit2} \mathcal{C}^{\rm phys}_1(\ell/L=0.05,\mu L,\delta/L) &\approx \frac{\ell}{2\, \delta}\ln \frac{1}{\mu \delta}+3.31 \ln \frac{L}{\delta} + 0.149\, \mu \ell -6.54\,,\\ \mathcal{C}^{\rm phys}_1(\ell/L=0.10,\mu L,\delta/L) &\approx \frac{\ell}{2\, \delta} \ln \frac{1}{\mu \delta} + 3.60 \ln \frac{L}{\delta}+ 0.253\, \mu \ell -5.79\,,\\ \mathcal{C}^{\rm phys}_1(\ell/L=0.90,\mu L,\delta/L) &\approx \frac{\ell}{2\, \delta}\ln \frac{1}{\mu \delta} +4.74 \ln \frac{L}{\delta} + 0.343\, \mu \ell -13.1\,,\\ \mathcal{C}^{\rm phys}_1(\ell/L=0.95,\mu L,\delta/L) &\approx \frac{\ell}{2\, \delta} \ln \frac{1}{\mu \delta} +5.04 \ln \frac{L}{\delta} + 0.333\, \mu \ell -14.5\,. \end{aligned} \end{equation} These fits suggest a divergence structure for the subregion complexities in the physical basis of the form\footnote{As mentioned in footnote~\ref{foot67}, our fits were made for small $\delta/L$ with $\mu L $ fixed. In general, we expect the leading term to be the absolute value of the logarithmic term. Our resolution in the physical basis fits was not high enough to rule out a term of the form $f_0(\mu L,\ell/L)\, \frac{\ell}{\delta}$ where $f_0(\mu L,\ell/L) \lesssim {\cal O}(10^{-2})$.} \begin{equation} \label{divergences2} \mathcal{C}^{\rm phys}_1(\mu L,\delta/L) \approx \frac{\ell}{2\, \delta} \left|\ln \frac{1}{\mu \delta}\right| +f_1(\mu L,\ell/L) \ln \frac{L}{\delta}+f_2(\mu L,\ell/L)\,. \end{equation} Similarly to the discussion for the diagonal basis, we expect the structure of divergences in the physical basis to be the same as in eq.~\eqref{divergences2} for more general cases, except that the coefficients $f_1$ and $f_2$ will depend on the other parameters of the system. For example, for a massive scalar QFT, we expect $f_i=f_i(\mu L,\ell/L,mL)$. \begin{figure} \includegraphics[width=0.44\textwidth]{phys-cutoff} \includegraphics[width=0.45\textwidth]{phys-cut-9-10}\\ \includegraphics[width=0.44\textwidth]{phys-cut-1-20} \includegraphics[width=0.55\textwidth]{phys-cut-19-20} \caption{Subregion complexity in the physical basis as a function of the cutoff $N=L/\delta$ for $\ell/L = 0.05,\,0.1,\,0.9$ and $0.95$. The mass was set to $mL=0.01$.} \label{fig:subregion3-phys} \end{figure} \textbf{Mutual complexity in physical basis:} We plot the mutual complexity in the physical basis \begin{equation} \label{DeltaCphys} \Delta\mathcal{C}_1^{\rm phys}\equiv {\cal C}^{\rm phys}_1(\rho_{\cal A}) + {\cal C}^{\rm phys}_1(\rho_{{\cal B}})- {\cal C}^{\rm phys}_1(|\Psi_0 \rangle ) \,, \end{equation} in figures~\ref{fig:subregion2-phys} and \ref{fig:subregion4-phys}, which we observe to be negative for all of the subregion sizes shown there. However, some explanation is required here. The mutual complexity~\eqref{DeltaCphys} will be different depending on whether the physical basis for the three states considered is fixed to be one which separates ${\cal A}$ and/or ${\cal B}$ from the rest of the degrees of freedom, or if the physical basis is considered for each state independently. More precisely, the physical basis for $\rho_{\cal A}$ (and $\rho_{\cal B}$) will be a basis in which the ${\cal A}$ and ${\cal A}^c$ (and the ${\cal B}$ and ${\cal B}^c$, respectively) degrees of freedom are kept separate. However, for the ground state, there is no natural partition of the system into ${\cal A} \cup {\cal B}$ independently of the density matrices $\rho_{\cal A}$ and $\rho_{\cal B}$. Therefore, if the physical basis in the evaluation of the complexity of the ground state were to be considered independently of the other two complexities, we would find that the physical basis for the ground state corresponds to all of the degrees of freedom in the system, and the physical basis would coincide with the diagonal basis. Therefore, to be more explicit, we define two mutual complexities in the physical basis \begin{equation} \begin{aligned} \label{twoDeltaCs} \Delta\mathcal{C}_1^{\rm phys}\equiv {\cal C}^{{\cal AA}^c}_1(\rho_{\cal A}) + {\cal C}^{{\cal BB}^c}_1(\rho_{{\cal B}})- {\cal C}^{\cal AB}_1(|\Psi_0 \rangle ) \,,\\ \Delta\tilde{\mathcal{C}}_1^{\rm phys}\equiv {\cal C}^{{\cal AA}^c}_1(\rho_{\cal A}) + {\cal C}^{{\cal BB}^c}_1(\rho_{{\cal B}})- {\cal C}^{\rm diag}_1(|\Psi_0 \rangle ) \,, \end{aligned} \end{equation} where ${\cal C}^{\cal AB}$ denotes the physical basis complexity of a state given a partition of the system into ${\cal A} \cup {\cal B}$. It is natural to expect that $\Delta{\cal C}_1^{\rm phys} < \Delta \tilde{\mathcal{C}}_1^{\rm phys}$, since the difference between the two definitions in eq.~\eqref{twoDeltaCs} is the subtraction of the vacuum complexity in two different bases. More precisely, the ${\cal C}^{\cal AB}_1(|\Psi_0 \rangle )$ evaluates the complexity of the ground state subject to the additional constraint that the ${\cal A}$ and ${\cal B}$ degrees of freedom remain separated. Being a minimization with additional constraints compared to ${\cal C}^{\rm diag}_1(|\Psi_0 \rangle )$, it follows that ${\cal C}^{\cal AB}_1(|\Psi_0 \rangle ) > {\cal C}^{\rm diag}_1(|\Psi_0 \rangle )$ from which the above conclusion follows. Just like the mutual complexity in the diagonal basis, we observe that both of the mutual complexities in the physical basis increase in magnitude as a function of the subregion size, reaching maximum at $\ell/L = 1/2$, and are symmetric about this point. The $\Delta \tilde{\mathcal{C}}^{\rm phys}_1$ shows similar behaviour to the diagonal basis mutual complexity: it is positive and depends logarithmically on the cutoff. Again, this logarithmic dependence comes from the subleading logarithmic divergence of the complexities. The subleading divergence in the subregion complexities in the physical basis are positive, while the subleading divergence of the complexity of the ground state is negative for all cases studied here (see footnote~\ref{footvac}). On the other hand, the $\Delta \mathcal{C}^{\rm phys}_1$ is negative and decreases linearly as a function of the cutoff. This contrasts with the logarithmic cutoff dependence of the mutual complexity in the diagonal basis in figure \ref{fig:mutualcomp2}. The negative linear dependence of $\Delta \mathcal{C}^{\rm phys}_1$ on the cutoff is due to the vacuum complexity in the ${\cal AB}$ basis having a subleading positive linear divergence, which is not present for the diagonal basis. \begin{figure} \center \includegraphics[width=0.45\textwidth]{mutualcomp-phys-magnitudes} \includegraphics[width=0.54\textwidth]{phys-mutualcomp-magnitudes} \caption{The two definitions of mutual complexity in the physical basis $\Delta\mathcal{C}_1^{\rm phys}$ and $\Delta\tilde{\mathcal{C}}_1^{\rm phys}$ as a function of the subregion size for various reference frequencies. The cutoff was set to $L/\delta=N=100$ and the mass to $m L =0.01$.} \label{fig:subregion2-phys} \end{figure} \begin{figure} \center \includegraphics[width=0.44\textwidth]{mutualcomp-phys-cut-1-10} \includegraphics[width=0.55\textwidth]{mutualcomp-phys-cut-1-20} \includegraphics[width=0.44\textwidth]{phys-mutualcomp-1-10} \includegraphics[width=0.55\textwidth]{phys-mutualcomp-1-20} \caption{The two definitions of mutual complexity in the physical basis $\Delta\mathcal{C}_1^{\rm phys}$ and $\Delta\tilde{\mathcal{C}}_1^{\rm phys}$ as a function of the cutoff for various reference frequencies $\mu L = 100$, $200$, $300$, $400$ and $500$. The mass was set to $m L =0.01$.} \label{fig:subregion4-phys} \end{figure} \subsection{Comment on the Approximation}\label{commentsonApp} Lastly, we comment on the accuracy of our approximation. As mentioned above, strictly speaking, the algorithms presented are only an upper bound for the complexity of subregions of the ground state of our QFT in the different bases. The reason for this is that we only minimized over possible \textbf{mode-by-mode purifications} (see section \ref{MbyM}), assuming that the complexity of the optimal mode-by-mode purification would be close to the optimal complexity obtained by exploring most general purifications. In section~\ref{MbyM}, we found that the optimal purification is indeed a mode-by-mode purification when the target density matrix is a product density matrix ($\hat{\rho} = \otimes_i \hat{\rho}_i$). For Gaussian density matrices of the form~\eqref{density_fun_A}, this is the case when $\[A,B\]=0$, and we introduced a measure of how close a matrix was to being a product state in~\eqref{Delta1}. For the subregions of the vacuum studied in this section, we find $\Delta = 0.5$ for $\ell > \ell_c$ with $\ell_c = {\cal O}(\delta)$. In contrast, for random matrices $A$ and $B$, we find $\Delta \approx \sqrt{2}$ for large~$N$. \subsection{Purifying General Gaussian States}\label{sec:purificationX} In this subsection, we study Gaussian purifications of Gaussian density matrices with an arbitrary number of modes. The discussion will follow closely the one in \cite{pure2}, and as before, we will focus on density matrices and wavefunctions with real parameters for simplicity. We start with the wavefunction of a pure Gaussian state \begin{equation}\label{Gaussian_AB} \Psi_{\mathcal{A}\mA^c} = \mathcal{N}_{\mathcal{A}\mA^c}\ \exp\! \[ -\frac{1}{2} (\vec q_{\mathcal{A}},\vec q_{\mathcal{A}^c}) \left( \begin{array}{cc} \Gamma & K \\ K^T & \Omega \\ \end{array} \right) \left( \begin{array}{c} \vec q_{\mathcal{A}} \\ \vec q_{\mathcal{A}^c} \\ \end{array} \right) \]\,, \end{equation} where the degrees of freedom were divided into the ``inside'' region $\mathcal{A}$ containing the $N_{\mathcal{A}}$ coordinates $\vec q_{\mathcal{A}}$, and the ``outside'' region $\mathcal{A}^c$ containing the $N_{\mathcal{A}^c}$ coordinates $\vec q_{\mathcal{A}^c}$. The wavefunction matrix in eq.~\eqref{Gaussian_AB} has to be positive definite in order for the wavefunction to be normalizable. The square matrices $\Gamma$ and $\Omega$ are real, symmetric and positive definite.\footnote{Note that sub-matrices of positive definite matrices are also positive definite. It will also be important that positive definite matrices are invertible.} Further, the rectangular $N_{\mathcal{A}}\times N_{\mathcal{A}^c}$ matrix $K$ is also real\footnote{The restriction to real matrices here and above are a choice that we impose to simplify our analysis. In contrast, the positivity of $\Gamma$ and $\Omega$ is required to ensure that the wavefunction is normalizable.} and $\mathcal{N}_{\mathcal{A}\mA^c}$ is the normalization factor (ensuring that the wavefunction has unit norm). The reduced density matrix describing the mixed state on the subsystem ${\cal A}$ is obtained by tracing out the degrees of freedom in the outside region ${\mathcal{A}^c}$, as follows \begin{equation} \hat{\rho}_{\mathcal{A}} = {\text{Tr}}_{\mathcal{A}^c} \big( \ket{\Psi_{\mathcal{A}\mA^c}}\bra{\Psi_{\mathcal{A}\mA^c}} \big)\,. \end{equation} This amounts to the Gaussian integral \begin{equation}\label{densityFun_A} \begin{split} \hspace{-2pt} \rho_{\mathcal{A}}\(\vec q_{\mathcal{A}}, {\vec q}_{\mathcal{A}}^{\,\, \prime}\) &= \int d\, q_{\mathcal{A}^c} \ \Psi_{\mathcal{A}\mA^c}({\vec q}_{\mathcal{A}}, {\vec q}_{\mathcal{A}^c})\, \Psi^\dagger_{\mathcal{A}\mA^c}({\vec q}^{\,\, \prime}_{\mathcal{A}},{\vec q}_{\mathcal{A}^c}) \\ &= \mathcal{N}_{\mathcal{A}}\ \exp\! \[ -\frac{1}{2} ({\vec q}_{\mathcal{A}},{\vec q}^{\,\, \prime}_{\mathcal{A}}) \left( \begin{array}{cc} \Gamma- \frac{1}{2}K\Omega^{-1}K^T& - \frac{1}{2}K\Omega^{-1}K^T \\ -\frac{1}{2}K\Omega^{-1}K^T& \Gamma- \frac{1}{2}K\Omega^{-1}K^T \\ \end{array} \right) \left( \begin{array}{c} {\vec q}_{\mathcal{A}} \\ {\vec q}^{\,\, \prime}_{\mathcal{A}} \\ \end{array} \right) \]\,. \end{split} \end{equation} Following the reverse logic, let us start with a general mixed Gaussian state of $N_\mathcal{A}$ modes with the (real) density matrix \begin{equation}\label{density_fun_A} \rho_{\mathcal{A}}\({\vec q}_{\mathcal{A}}, {\vec q}^{\,\, \prime}_{\mathcal{A}}\) = \mathcal{N}_{\mathcal{A}}\ \exp\! \[ -\frac{1}{2} ({\vec q}_{\mathcal{A}},{\vec q}^{\,\, \prime}_{\mathcal{A}}) \left( \begin{array}{cc} A & - B \\ -B& A \\ \end{array} \right) \left( \begin{array}{c} {\vec q}_{\mathcal{A}} \\ {\vec q}^{\,\, \prime}_{\mathcal{A}} \\ \end{array} \right) \]\,, \end{equation} where the ${N_{\mathcal{A}} \times N_{\mathcal{A}} }$ matrices $A$ and $B$ are both real and symmetric. Further, we must require $B$ to be positive semi-definite to ensure that the density matrix is non-negative, and $A-B$ to be a strictly positive matrix to ensure that the density matrix can be normalized.\footnote{This also implies that $A$ is a strictly positive matrix, since the sum of two positive definite matrices is also positive definite.} In this case, a wavefunction of the form \eqref{Gaussian_AB} will purify $\rho_{\mathcal{A}}$ if the two following constraints are satisfied \begin{equation}\label{pure_constrians} \Gamma= A+B\,, \qquad \frac{1}{2}K\Omega^{-1}K^T=B \,. \end{equation} In this situation, the ${\vec q}_\mathcal{A}$ are the physical degrees of freedom while the ${\vec q}_{\mathcal{A}^c}$ are now auxiliary degrees of freedom. While $\Gamma$ is completely fixed by the first constraint above, it should be clear that the second constraint leaves a great deal of freedom in the choice of $\Omega$ and $K$. Assuming $K$ has a left inverse (and $B$ is invertible),\footnote{We stress that these conditions are not achieved for generic purifications. For example, a linear transformation $K: {\cal A}^c \to {\cal A}$ has left inverse if and only if it is injective ({\it i.e.,}\ one-to-one). This immediately implies that $N_{{\cal A}^c} = {\rm dim}({\cal A}^c) \leq {\rm dim}({\cal A}) = N_{\cal A}$. This constraint does not hold in general since we can introduce as many ancillae as we wish in purifying a given mixed state. However, it does hold for essential mode-by-mode purifications, which will be the focus of our analysis in the following. Similar comments apply for the conditions under which $B$ is invertible.} we can rewrite the constraints \reef{pure_constrians} as \begin{equation}\label{constrain2} \Gamma= A+B\,, \qquad \Omega= \frac12\, K^{T} B^{-1} K \,, \end{equation} where $\Omega$ is completely determined by $B$ and $K$. Hence we can think of the freedom in choosing the purification as being parameterized by the choice of the $N_{\mathcal{A}}N_{\mathcal{A}^c}$ components of $K$. Of course, this is the multi-mode generalization of the freedom found in eq.~\reef{pure1}, where the single parameter $k$ parameterized the purifications of the density matrix \reef{dense1} for a single degree of freedom. Hence with many modes (and ancillae), the purification complexity will be found by optimizing the usual complexity of the purification \reef{Gaussian_AB} over the freedom in choosing the matrix $K$. However, it is natural to first ask what is the minimum number of ancillae $N_{\mathcal{A}^c}$ required to purify the mixed state ${\rho}_{\mathcal{A}}$. A priori, we cannot be sure that such purifications, with only the essential number of additional modes, will lead to the minimal value of the purification complexity, however, we will provide evidence for this later in this section. In order to count the degrees of freedom needed for the purification, we start by bringing the matrices $A$ and $B$ in eq.~\eqref{density_fun_A} to a canonical form by performing a sequence of coordinate transformations: First, we find an orthogonal matrix $O_A$ that diagonalizes $A$, {\it i.e.,}\ $D_A = O^T_A\cdot A\cdot O_A$. We then rescale the coordinates ${\vec q}_A$ such that $A$ becomes the unit matrix. Finally, we diagonalize the transformed $B$ matrix with a second orthogonal transformation $O_B$. The complete coordinate transformation reads \begin{equation}\label{nonorthogonal_trans} {\vec q}_{\mathcal{A}}= O_A \cdot D_A^{-1/2}\cdot O_B \cdot \tilde {\vec q}_{\mathcal{A}}\,, \end{equation} and of course, the same equation holds for ${\vec q}^{\,\, \prime}_\mathcal{A}$. In this basis,\footnote{As an aside, we note that eq.~\eqref{nonorthogonal_trans} is not an orthogonal transformation and as a consequence, the reference state \eqref{ref_state}, which we are implicitly choosing for the purified $\mathcal{A}\mA^c$ system, \begin{equation} \Psi_{R}\({\vec q}_{\mathcal{A}},{\vec q}_{\mathcal{A}^c}\)= \mathcal{N}_{R}\ \exp\! \[ -\frac{\mu}{2} ({\vec q}_{\mathcal{A}},{\vec q}_{\mathcal{A}^c}) \left( \begin{array}{cc} \mathbb{I}_{N_{\mathcal{A}}} & 0 \\ 0 & \mathbb{I}_{N_{\mathcal{A}^c}} \\ \end{array} \right) \left( \begin{array}{c} {\vec q}_{\mathcal{A}} \\ {\vec q}_{\mathcal{A}^c} \\ \end{array} \right) \]\,, \label{ref_stat} \end{equation} transforms nontrivially. The transformed reference state becomes \begin{equation}\label{new_referenece} \Psi_{R}\(\tilde{{\vec q}}_{\mathcal{A}},{\vec q}_{\mathcal{A}^c}\)= \mathcal{N}_{R}\,{\rm det}(D_A)\ \exp\! \[ -\frac{\mu}{2} (\tilde{{\vec q}}_{\mathcal{A}},{\vec q}_{\mathcal{A}^c}) \left( \begin{array}{cc} O_B^T \cdot D_A^{-1}\cdot O_B & 0 \\ 0 & \mathbb{I}_{N_{\mathcal{A}^c}} \\ \end{array} \right) \left( \begin{array}{c} \tilde{{\vec q}}_{\mathcal{A}} \\ {\vec q}_{\mathcal{A}^c} \\ \end{array} \right) \]\,, \end{equation} which is no longer an unentangled product state. However, this point is irrelevant for our argument determining the minimal value of degrees of freedom $N_{\mathcal{A}^c}$ required for the purification.} the quadratic form describing the density matrix \eqref{density_fun_A} is given in terms of matrices $\tilde A$ and $\tilde B$ which read \begin{equation}\label{new_AB} \tilde{A}=\mathbb{I}_{N_{\mathcal{A}}}, \quad \tilde{B}= O_B^T\cdot {D_A^{-1/2}}\cdot O_A^T \cdot B \cdot O_A \cdot {D_A^{-1/2}}\cdot O_B= D_B\,. \end{equation} In this canonical form, the matrix $B$ has become \begin{equation}\label{matrix_B} \tilde{B}=D_B=\left( \begin{array}{ccccccc} b_1 & & & & & & \\ & b_2 & & & & & \\ & & \ddots & & & & \\ & & & b_{n_B} & & & \\ & & & & 0 & & \\ & & & & & \ddots & \\ & & & & & & 0 \\ \end{array} \right), \end{equation} with $n_B=\text{rank}(\tilde B)=\text{rank}(B)$\ non-zero components. Therefore written in terms of the transformed coordinates $\tilde{\vec q}_\mathcal{A}$, the density matrix ${\rho}_{\mathcal{A}}$ has been decomposed into $n_B$ two-by-two blocks describing modes in a mixed state, {\it i.e.,}\ \begin{equation} \left( \begin{array}{cc} 1& b_i \\ b_i& 1 \\ \end{array} \right) \,, \end{equation} and $N_{\mathcal{A}}-n_B$ two-by-two unit matrices describing modes in a pure state. Now it is possible to follow the procedure in section \ref{sec:onemodepuri} to purify each of the mixed-state modes with a single ancilla, and finally transform back with eq.~\eqref{nonorthogonal_trans} to obtain a purification of the density matrix ${\rho}_{\mathcal{A}}$ in the original ${\vec q}_\mathcal{A}$ basis. We refer to such purifications as { \bf mode-by-mode purifications}. It is also straightforward to show that we cannot purify ${\rho}_{\mathcal{A}}$ with less than $n_B$ additional degrees of freedom, namely $N_{\mathcal{A}^c} \ge n_B$. Towards this goal, we consider the following theorem regarding the rank of the product of two matrices \begin{equation} \text{rank}(M \cdot N) \le \text{min}(\text{rank}(M),\text{rank}(N))\,. \end{equation} Hence applying this theorem to the second constraint in eq.~\eqref{pure_constrians}, {\it i.e.,}\ $\frac{1}{2}K\,\Omega^{-1}K^T=B$, we see that if a solution exists then we must have $\text{rank}(B) \le \text{min}(\text{rank}(\Omega^{-1}),\text{rank}(K))$. Next we observe that since the $N_{\mathcal{A}^c}\times N_{\mathcal{A}^c}$ matrix $\Omega$ is invertible, $\text{rank}(\Omega^{-1})=\text{rank}(\Omega)=N_{\mathcal{A}^c}$. Furthermore, $\text{rank}(K)\le \text{min}(N_\mathcal{A},N_{\mathcal{A}^c})\le N_{\mathcal{A}^c}$ since $K$ is an $N_\mathcal{A}\times N_{\mathcal{A}^c}$ matrix. Hence we arrive at \begin{equation}\label{rank} N_{\mathcal{A}^c} \ge n_B\,, \end{equation} where $n_B\equiv \text{rank}(B)$. That is, we will need at least $n_B$ ancillae in the $\mathcal{A}^c$ system in order to purify the mixed Gaussian state ${\rho}_{\mathcal{A}}$. However, having explicitly constructed a purification with $N_{\mathcal{A}^c}=n_B$ above, we know that it is possible to saturate this bound and we may conclude that this is the minimum number of extra degrees of freedom needed for the purification. We refer to these purifications containing only the essential number of ancillae as {\bf essential purifications}.\footnote{We chose this name to distinguish this class of purifications from the {\it optimal} purifications, which are defined to be the purifications yielding the minimal complexity.} \subsection{Optimal Purification in the Diagonal Basis} \label{optimal} In the previous subsection, we found the minimum number of ancillae required to purify a mixed Gaussian state (with a Gaussian pure state). However, we still need to find the {\bf optimal purification} for the mixed state ${\rho}_{\mathcal{A}}$ according to the definition of purification complexity \reef{def_pureC}, a question which we examine in the diagonal basis here. While we do not have a general solution for this question, we will argue that the optimal purification has a relatively simple form at least in certain interesting cases. First, we demonstrate that the optimal purification is, in fact, the essential purification for the case of a single physical degree of freedom. It would become very cumbersome to extend our proof to higher numbers of physical modes, but we believe that our result suggests that the same should hold more generally. On the other hand, as we demonstrated above, even if we fix the number of ancillae, there are many ways to purify ${\rho}_{\mathcal{A}}$ when the system $\mathcal{A}$ contains many modes. Finally, we argue that at least for some simple but interesting Gaussian states in physical problems, the optimal purification can be found by optimizing the purifications of the individual diagonals. However, before proceeding with these questions, we begin by showing that there is a symmetry amongst the Gaussian purifications, which leads to same purification complexity from a family of distinct purifications all of which produce the same mixed state. \subsubsection{Degenerate purifications} \label{genre} Here, we will demonstrate that there is a degeneracy amongst the purifications \reef{Gaussian_AB} defined by eq.~\reef{pure_constrians}. That is, we will show that for a fixed mixed state, there are many distinct purifications, all of which have the same diagonal spectra and hence, they have the same complexity using eq.~\reef{complexity_pure}. This introduces a symmetry which will be useful to simplify our analysis in the following. Beginning with a purification described by eq.~\eqref{Gaussian_AB}, we can perform a coordinate transformation on the ancillae \begin{equation} \left(\begin{array}{c} {\vec q}_{\mathcal{A}} \\ \hat{{\vec q}}_{\mathcal{A}^c} \\ \end{array} \right) = \left( \begin{array}{cc} \mathbb{I}_{N_{\mathcal{A}}}& 0 \\ 0 & R_{\mathcal{A}^c}^{-1} \\ \end{array} \right) \left( \begin{array}{c} {\vec q}_{\mathcal{A}} \\ {\vec q}_{\mathcal{A}^c} \\ \end{array} \right) \,, \label{transf99} \end{equation} where in general, $R_{\mathcal{A}^c}\in GL(N_{\mathcal{A}^c},\mathbb{R})$. Of course, the transformed wavefunction is characterized by the matrix \begin{equation} \left( \begin{array}{cc} \hat{\Gamma} & \hat{K} \\ \hat{K}^T & \hat{\Omega} \\ \end{array} \right) = \left( \begin{array}{cc} \Gamma & K\,R_{\mathcal{A}^c} \\ R_{\mathcal{A}^c}^T\,K^T & R_{\mathcal{A}^c}^T\,\Omega\, R_{\mathcal{A}^c}\\ \end{array} \right) \,. \label{newmat} \end{equation} Integrating out the $\hat{{\vec q}}_{\mathcal{A}^{c}}$ still yield precisely the same density matrix. Now in considering complexity, we may require that the reference state \reef{ref_stat} remains unchanged by the transformation \reef{transf99}, which imposes the constraint \begin{equation} R_{\mathcal{A}^c}^T\, R_{\mathcal{A}^c}=\mathbb{I}_{N_{\mathcal{A}^c}}\,, \end{equation} {\it i.e.,}\ $R_{\mathcal{A}^c} \in SO(N_{\mathcal{A}^c})$. That is, restricting eq.~\reef{transf99} to be an orthogonal transformation leaves the reference state unchanged, but further, such a transformation will also leave the diagonal spectrum, {\it i.e.,}\ the eigenvalues of eq.~\reef{newmat}, unchanged. Hence, evaluating the complexity with the expressions in eq.~\reef{complexity_pure}, we would find that all of these distinct purifications yield precisely the same complexity, and hence the same purification complexity for the corresponding mixed state. This degeneracy will allow us to reduce the number of parameters in searching for the optimal purification below. Perhaps we should add that since the complexity is a scalar function on the $N_\mathcal{A} N_{\mathcal{A}^c}$-dimensional space of purifications, we expect that for a generic value of the complexity, a $(N_\mathcal{A} N_{\mathcal{A}^c}-1)$-dimensional subspace will be degenerate, {\it i.e.,}\ have the same complexity. Of course, this is a much larger subspace than that defined by the $SO(N_{\mathcal{A}^c})$ transformations above, {\it i.e.,}\ the latter defines a subspace of dimension $\frac12 N_{\mathcal{A}^c}(N_{\mathcal{A}^c}-1)$. The key feature distinguishing these purifications is that the diagonal spectrum is left invariant by the $SO(N_{\mathcal{A}^c})$ transformations. In contrast, for a typical purification on the degenerate subspace, the spectrum will be different even though the complexity $\mathcal{C}_1$ is unchanged. \subsubsection{Essential Purifications} \label{threeA} In general, one would expect that increasing the number of ancillae might help in reducing the complexity of the corresponding purifications for a fixed density matrix. In this section, we will demonstrate that this is not the case for the Gaussian states in which we are interested. More precisely, we will consider the mixed state \reef{dense1} for a single harmonic oscillator and show that purifying this Gaussian state with two ancillae does not improve the purification complexity over the previous complexity \reef{complexity_one_mode} found with a single ancilla. Further, we will take this result for a single oscillator as an indication that adding extra ancillae does not improve the purification complexity for Gaussian mixed states in general. We begin with the following Gaussian state for three modes, \begin{equation}\label{pure33} \psi_{123}(x,y,z) = \langle{x,y,z}\ket{\psi_{123}} = \left({\rm det}\frac{M_3}{\pi}\right)^{1/4} {\rm exp}\left[-\frac12\, \vec x^{\, T}{\cdot} M_3{\cdot}\vec x\right]\,, \end{equation} where as before, $M_3$ is chosen to be real, and $\vec x^{\, T}=(x,y,z)$, where $x$ corresponds to the physical degree of freedom while $y$ and $z$ are the ancillae. In order for this state to be a purification of the single-mode density matrix in eq.~\reef{dense1}, {\it i.e.,}\ \begin{equation} \hat{\rho}_1(x)={\text{Tr}}_{y,z}\big( \ket{\psi_{123}}\bra{\psi_{123}}\big) \,, \label{trace44} \end{equation} we must constrain the parameters in $M_3$ appropriately. To understand these constraints, we write \begin{equation} \label{eq:polar} M_3 = \big(R^\phi_{13}\big)^T \big(R^\theta_{12}\big)^T \begin{pmatrix} \lambda_1 & 0 & 0 \\ 0 & \lambda_2 & 0 \\ 0 & 0 & \lambda_3 \end{pmatrix} R^\theta_{12}\, R^\phi_{13}\,, \end{equation} where \begin{equation} R^\theta_{12} = \begin{pmatrix} \ {\rm cos}\theta & {\rm sin}\theta & 0\\ -{\rm sin}\theta & {\rm cos}\theta & 0\\ 0 & 0 & 1 \end{pmatrix} \qquad{\rm and}\qquad R^\phi_{13} = \begin{pmatrix} \ {\rm cos}\phi & 0 & {\rm sin}\phi\\ 0 & 1 & 0 \\ -{\rm sin}\phi & 0 & {\rm cos}\phi \end{pmatrix}\,. \end{equation} That is, we have parameterized the matrix $M_3$ in terms of the three eigenvalues, $\lambda_i$ with $i={1,2,3}$, and two angles, $\theta$ and $\phi$. In principle, $M_3$ should be described by six independent parameters, but we have discarded the last rotation angle because of the degeneracy described in the previous subsection. Now eq.~\reef{trace44} imposes two constraints (cf. eq.~\eqref{pure_constrians} with $A=a$ and $B=b$) with which we can solve for the angles as \begin{eqnarray} \label{eq:phi} \sin^2\phi&=&\frac{\lambda_3}{(\lambda_3-\lambda_1)(\lambda_3-\lambda_2)}\left(a+b-(\lambda_1+\lambda_2)+ \frac{\lambda_1\lambda_2}{a-b}\right)\,,\\ {\rm sin}^2\theta &=& \lambda_2 \frac{\lambda_1-\lambda_3}{\lambda_1-\lambda_2} \frac{ a+b-(\lambda_1+\lambda_3)+\frac{\lambda_1\lambda_3}{a-b}}{(a+b-\lambda_3)\lambda_3-\lambda_1\lambda_2 +\frac{\lambda_1\lambda_2\lambda_3}{a-b}} \label{eq:theta}\\ &= &\frac{\lambda_2}{\lambda_3} \frac{\lambda_1-\lambda_3}{\lambda_1-\lambda_2} \left(1+ \frac{(a-b-\lambda_3)\lambda_1(\lambda_2-\lambda_3)}{(a-b)((a+b-\lambda_3)\lambda_3-\lambda_1\lambda_2) +\lambda_1\lambda_2\lambda_3} \right)\,. \nonumber \end{eqnarray} Note that these expressions restrict the three eigenvalues to lie within an allowed space where eqs.~\reef{eq:phi} and \reef{eq:theta} yield $0\le \sin^2\phi\le1$ and $0\le \sin^2\theta\le1$. Now using the $F_1$ cost function, the complexity of the Gaussian state \eqref{pure33} becomes \begin{equation} \mathcal{C}^{\text{diag}}_{1}\left(\ket{\psi}_{123}\right) = \frac{1}{2} \( \left|{\ln}\frac{\lambda_1}{\mu}\right|+\left|{\ln}\frac{\lambda_2}{\mu}\right|+\left|{\ln}\frac{\lambda_3}{\mu}\right| \)\,, \label{330x} \end{equation} where $\mu$ is the frequency characterizing the corresponding reference state \reef{ref_state}. Of course, because of the absolute values, the form of $\mathcal{C}_1$ will depend on whether the ratios $\lambda_i/\mu$ are bigger or smaller than one (similar to what was found in eq.~\reef{eq:cases1} with a single ancilla). Hence, there are eight distinct branches and we note that they intersect at the three planes defined by $\lambda_i=\mu$. That is, $\mathcal{C}_1=\ln f$ where $f$ is any of eight combinations of products of the ratios $\lambda_i/\mu$ or their inverses (whichever is greater than one), {\it e.g.,}\ $f=\frac{\lambda_1\lambda_2}{\mu\,\lambda_3}$ in the octant where $\lambda_1,\lambda_2>\mu>\lambda_3$. Given eq.~\reef{330x}, the purification complexity is given by optimizing the eigenvalues to minimize the result. One can argue that this minimum will not appear at some point inside one of the octants as follows: Firstly, we recall that the eigenvalues $\lambda_i$, as well as the reference frequency $\mu$, are all positive quantities. Now within any of the branches (or octants), $f$ has a simple functional dependence on the eigenvalues. In particular, when $\lambda_i<\mu$, $f$ contains a factor of $1/\lambda_i$ and so $\partial_{\lambda_i}\mathcal{C}_1 =-1/\lambda_i <0$. Now, naively, the minimum along this direction would appear at $\lambda_i\to \infty$, but this is inconsistent with the constraint that $\lambda_i<\mu$. Therefore there are no local extrema within the corresponding octants. Similarly, with $\lambda_i>\mu$, $f$ contains a factor of $\lambda_i$ and $\partial_{\lambda_i}\mathcal{C}_1 =1/\lambda_i >0$. In this case, the derivative again vanishes with $\lambda_3\to\infty$, but the corresponding extrema would be a maximum of the complexity. Again, we conclude that no local extrema appear within these octants. Therefore, we are led to conclude that the minima for the complexity \reef{330x} must appear either (1) on the planes where the branches intersect or (2) at the boundaries of the allowed parameter space for the $\lambda_i$. Next, we consider the boundaries of the allowed parameter space. The latter arise where either of the expressions in eqs.~\reef{eq:phi} and \reef{eq:theta} reaches zero or one, {\it i.e.,}\ ${\rm sin}^2\theta = 0$ or 1, or ${\rm sin}^2\phi = 0$ or 1. At these boundaries, we find that only two of the degrees of freedom are entangled: \begin{eqnarray} M_3|_{\sin\theta=0} &=& \begin{pmatrix} \lambda_1 \cos^2\phi + \lambda_3\sin^2\phi & 0 & (\lambda_1-\lambda_3)\cos\phi\sin\phi\\ 0 & \lambda_2 & 0 \\ (\lambda_1-\lambda_3)\cos \phi\sin \phi & 0 & \lambda_3 \cos^2\phi + \lambda_1\sin^2\phi \end{pmatrix} \,, \nonumber\\ M_3|_{\sin^2\theta=1} &=& \begin{pmatrix} \lambda_2 \cos^2\phi + \lambda_3\sin^2\phi & 0 & (\lambda_2-\lambda_3)\cos\phi\sin\phi\\ 0 & \lambda_1 & 0 \\ (\lambda_2-\lambda_3)\cos \phi\sin \phi & 0 & \lambda_3 \cos^2\phi + \lambda_2\sin^2\phi \end{pmatrix} \,, \label{hospital}\\ M_3|_{\sin\phi=0} &=& \begin{pmatrix} \lambda_1 \cos^2\theta + \lambda_2\sin^2\theta & \ (\lambda_1-\lambda_2)\cos\theta\sin\theta & 0\\ (\lambda_1-\lambda_2)\cos \theta\sin \theta & \ \lambda_2 \cos^2\theta + \lambda_1\sin^2\theta & 0\\ 0 & 0 & \lambda_3 \end{pmatrix} \,, \nonumber\\ M_3|_{\sin^2\phi=1} &=& \begin{pmatrix} \lambda_3 & 0 & 0\\ 0 & \lambda_2 \cos^2\theta + \lambda_1 \sin^2\theta & \ (\lambda_1-\lambda_2)\cos\theta\sin\theta\\ 0 & (\lambda_1-\lambda_2)\cos \theta\sin \theta &\ \lambda_1 \cos^2\theta + \lambda_3\sin^2\theta \\ \end{pmatrix} \,. \nonumber \end{eqnarray} We may discard the last case ({\it i.e.,}\ $\sin^2\phi=1$) because the corresponding purification \reef{pure33} only involves entanglement between the two ancillae. Hence this will always leave the physical oscillator in a pure state when tracing out the two ancillae. In the other three cases, the physical oscillator couples to one of the two ancillae. In any of these situations, the complexity will be minimized by setting the eigenvalue for the unentangled degree of freedom to the reference frequency, {\it i.e.,}\ $\lambda_i=\mu$, in which case its contribution to the complexity vanishes. Hence with this choice, we can discard the second ancilla, and the problem reduces to determining the purification complexity with a single ancilla. That is, the minimum complexity on any of these three edges will be precisely the same as that found with a single ancilla in section \ref{warmup}.\footnote{Following the results of section \ref{warmup}, to find the optimal two harmonic oscillator purification of our density matrix, we would find three cases again depending on the relation of the parameters of the density matrix. For cases 1 and 3 of section \ref{sec:onemode}, one of the eigenmodes of the optimal two harmonic oscillator purification is equal to the reference frequency. The fact that the unentangled eigenmode of the optimal three harmonic oscillator purification is also equal to the reference frequency implies that the optimal three harmonic oscillator purification has a degenerate eigenvalue. This makes one of the angles in the polar decomposition~\eqref{eq:polar} degenerate in the same way that the angles of radial coordinates are degenerate at the origin of the coordinate system.} This leaves us to consider the intersection planes between the various branches of eq.~\reef{330x}. Of course, on any of these intersections, one of the eigenvalues is again set to the reference frequency, {\it e.g.,}\ $\lambda_3=\mu$. Hence we note that the minima identified above arise at the intersection of one of the intersection planes with one of the boundaries of the allowed parameter space. However, on the `interior' of the intersection plane, we still have the freedom to optimize two independent eigenvalues (rather than just one on the boundary), and so one might wonder if the complexity finds a lower minimum in the interior. However, one may use analogous arguments to those above examining $\partial_{\lambda_i}\mathcal{C}_1$ to argue that again on any of the intersection planes the minimum must be where this plane meets the boundary or one of the other planes where another eigenvalue reaches $\mu$. Hence the first possibility is already covered by the previous analysis of the complexity on the boundary of the allowed parameter space. Repeating the derivative argument for the intersection of two planes, one is lead to the possibility that the minimum may lie at the intersection of all three planes, {\it i.e.,}\ at $\lambda_1=\lambda_2=\lambda_3=\mu$. However, this possibility is ruled out since eq.~\reef{eq:phi} makes clear that this point is not within the allowed parameter space.\footnote{Actually, if the three eigenvalues are identical, then the rotations in eq.~\reef{eq:polar} act trivially. As a result, $M_3\propto \mathbb{I}$ which implies that the original state was actually pure, and hence this case is not really of interest here.} Therefore we conclude that the complexity is optimized on the boundary of the allowed parameter space. However, there we found that one of the two ancillae decoupled and the optimal purification reduced to that found with a single ancilla in section \ref{warmup}. That is, with two ancillae, the minimum complexity in the diagonal basis is achieved with a purification where the physical degree of freedom is only entangled with one of the ancillae, and the second ancilla remains unentangled. We provide an additional numerical check of this result in appendix \ref{app:numerics}. We might note that it appears that the first three cases in eq.~\reef{hospital} yield three distinct minima. However, we should note that the first two cases, {\it i.e.,}\ $\sin^2\theta =0$ and 1, differ only in the labelling of the eigenvalues and are in fact describing the same purifying states \reef{pure33}, where $x$ and $z$ are entangled while $y$ remains unentangled. The only difference in the third case, {\it i.e.,}\ $\sin\phi=0$ is that the purification entangles $x$ and $y$ while $z$ remains unentangled. Of course, both purifications yield the same optimal complexity. We might add that this degeneracy is a remnant of the $SO(2)$ symmetry implied by the discussion in subsection \ref{genre}. While our analysis yields a clear result for a single physical oscillator, it would be difficult to extend this analysis to a mixed state with many degrees of freedom. Still, we are emboldened to interpret this result as an indication that adding extra ancillae will not improve the purification complexity for Gaussian mixed states in general. That is, throughout the following, we will assume that the optimal purification for a Gaussian mixed state for many oscillators is an essential purification, {\it i.e.,}\ the number of ancillae saturates eq.~\reef{rank} with $N_{\mathcal{A}^c}=n_B$. \subsubsection{Mode-by-Mode Purifications} \label{MbyM} In section \ref{sec:purificationX}, we identified the minimum number of ancillae required to purify a Gaussian mixed state \reef{density_fun_A}. Our approach involved finding a `diagonal' basis in which the density matrix $\rho_{\cal A}$ took a canonical form where each mode was separately either in a mixed or pure state. Each of the mixed state modes could then be purified by a single ancilla, using the construction presented in section \ref{sec:onemodepuri} for one-mode mixed states. We will refer to these purifications as {\bf mode-by-mode purifications}. Certainly, there are many ways to purify a mixed state on many degrees of freedom, as illustrated in figure \ref{more_modes}. The top panel indicates a simple mode-by-mode purification while the lower panel illustrates a general purification for a multi-mode Gaussian state. Implicitly, the general purification will have many more free parameters to optimize and so one would expect that this would allow for a smaller purification complexity for the corresponding mixed state. In this subsection, we will examine this question and identify the conditions for which a mode-by-mode purification provides the optimal purification for a Gaussian mixed state. To make our analysis both explicit and tractable, we focus on Gaussian mixed states for two degrees of freedom. \begin{figure}[tbph] \centering\includegraphics[width=4.5in]{figures/more_modes} \caption{Illustration of the different ways to purify a multi-mode Gaussian state $\hat{\rho}_A$. We refer to the purifications of the form $\Psi_{11^c} \otimes \Psi_{22^c} \otimes \cdots \otimes \Psi_{NN^c}$ as mode-by-mode purifications.\label{more_modes}} \end{figure} Hence, considering the two-mode system as an example, we can purify the two modes individually or together, as illustrated in the figure \ref{more_modes}. The corresponding pure states can be written as \begin{equation} \ket{\Psi}= \ket{\Psi_{11^c}} \otimes \ket{\Psi_{22^c}} \qquad \text{or} \qquad |\widetilde\Psi\rangle =\ket{\Psi_{12(12)^c}} \,. \end{equation} That is, we have a mode-by-mode purification on the left and a general purification on the right. To proceed with explicit calculations, let us begin with Gaussian mixed states (for two modes) taking a simple product form, \begin{eqnarray} \label{eq:density-mixed} \rho_{\mathcal{A}}({\vec q}_{\mathcal{A}}, {\vec q}^{\,\, \prime}_{\mathcal{A}} )&=&\rho_{1}(x_1,x_1')\ \rho_{2}(x_2,x_2') \\ &=& \mathcal{N}_{\mathcal{A}}\ \exp \[ -\frac{1}{2} ({\vec q}_{\mathcal{A}},{\vec q}^{\,\, \prime}_{\mathcal{A}}) \left( \begin{array}{cc} \ A_{D} & - B_{D} \\ -B_{D}&\ A_{D} \\ \end{array} \right) \left( \begin{array}{c} {\vec q}_{\mathcal{A}} \\ {\vec q}^{\,\, \prime}_{\mathcal{A}} \\ \end{array} \right) \]\,, \nonumber \end{eqnarray} where ${\vec q}_{\mathcal{A}}=(x_1,x_2)$, \begin{equation}\label{gamble6} A_{D}=\left( \begin{array}{cc} a_1 & 0 \\ 0 & a_2 \\ \end{array} \right)\qquad{\rm and}\qquad B_{D}=\left( \begin{array}{cc} b_1 & 0 \\ 0 & b_2 \\ \end{array} \right)\,. \end{equation} Borrowing from the analysis in section \ref{sec:onemodepuri}, the mode-by-mode purification can be written as \begin{equation}\label{gamble8} \Psi_{\otimes \mathcal{A}\mA^c} = \mathcal{N}_{\otimes \mathcal{A}\mA^c}\ \exp \[ -\frac{1}{2} ({\vec q}_{\mathcal{A}},{\vec q}_{\mathcal{A}^c}) \left( \begin{array}{cc} \Gamma_D & K_D \\ K_D^T & \Omega_D \\ \end{array} \right) \left( \begin{array}{c} {\vec q}_{\mathcal{A}} \\ {\vec q}_{\mathcal{A}^c} \\ \end{array} \right) \] \end{equation} where ${\vec q}_{\mathcal{A}^c}=(y_1,y_2)$, \begin{equation} \label{gamble} \Gamma_D =\left( \begin{array}{cc} a_1+b_1 & 0\\ 0 & a_2+b_2 \\ \end{array} \right)\,,\quad \Omega_D =\left( \begin{array}{cc} \frac{k_1^2}{2b_1}& 0\\ 0 & \frac{k_2^2}{2b_2}\\ \end{array} \right) \quad{\rm and}\quad K_D =\left( \begin{array}{cc} k_1& 0\\ 0 & k_2 \\ \end{array} \right)\,. \end{equation} We then translate the above purification to the parameters introduced in section \ref{subsec:altdesc} using eq.~\reef{transform_paras}, {\it i.e.,}\ \footnote{Note that we have set $\omega_1=\omega_2=\omega$ for both oscillators. Choosing different frequencies can be absorbed by redefining the squeezing parameters, $r_{1,2}$ and $s_{1,2}$.} \begin{equation} \begin{split} a_1+b_1 &= \omega e^{2r_1} \cosh 2\alpha_1\,, \qquad \frac{k_1^2}{2b_1} =\omega e^{2s_1} \cosh 2\alpha_1\,, \quad k_1= -\omega e^{r_1+s_1} \sinh 2\alpha_1 \,,\\ a_2+b_2 &= \omega e^{2r_2} \cosh 2\alpha_2\,, \qquad \frac{k_2^2}{2b_2} =\omega e^{2s_2} \cosh 2\alpha_2\,, \quad k_2= -\omega e^{r_2+s_2} \sinh 2\alpha_2 \,. \end{split} \end{equation} For this kind of purification, we only need to minimize two free parameters $s_1,s_2$ and the final complexity is given by the sum of the one-mode complexities of purification \begin{equation} \mathcal{C}_{\otimes \mathcal{A}\mA^c}^{\text{diag}}= \mathcal{C}_{1}^{\text{diag}}\!\[\hat{\rho}_1(r_1,\alpha_1)\] + \mathcal{C}_{1}^{\text{diag}}\!\[\hat{\rho}_2(r_2,\alpha_2)\]\,, \label{gamble4} \end{equation} where $\mathcal{C}_{1}^{\text{diag}}$ is given in eq.~\eqref{complexity_one_mode}. We can also consider the most general purification of eq.~\reef{eq:density-mixed}. The latter takes the form given in eq.~\reef{Gaussian_AB}, which we write here as \begin{equation}\label{gamble2} \Psi_{ \mathcal{A}\mA^c} = \mathcal{N}_{ \mathcal{A}\mA^c}\ \exp \[ -\frac{1}{2} ({\vec q}_{\mathcal{A}},{\vec q}_{\mathcal{A}^c}) \left( \begin{array}{cc} \Gamma & K \\ K^T & \Omega \\ \end{array} \right) \left( \begin{array}{c} {\vec q}_{\mathcal{A}} \\ {\vec q}_{\mathcal{A}^c} \\ \end{array} \right) \] \end{equation} with \begin{equation}\label{gamble2a} \Gamma =\Gamma_D\,, \quad \Omega =\frac{1}{2} \left( \begin{array}{cc} \frac{f_2^2}{b_2}+\frac{k_1^2}{b_1} & \frac{f_2 k_2}{b_2}+\frac{f_1 k_1}{b_1} \\ \frac{f_1 k_1}{b_1}+\frac{f_2 k_2}{b_2} & \frac{f_1^2}{b_1}+\frac{k_2^2}{b_2} \\ \end{array} \right) \quad{\rm and}\quad K =\left( \begin{array}{cc} k_1& f_1\\ f_2 & k_2 \\ \end{array} \right)\,. \end{equation} Here we have used eq.~\eqref{constrain2} to constrain the pure state, but we do not demand that $\Omega$ or $K$ are diagonal as in eq.~\reef{gamble}. For this purification \reef{gamble2}, we have four free parameters $\(k_1,k_2,f_1,f_2\)$ and thus, the purification complexity is defined as \begin{equation} \mathcal{C}_{\mathcal{A}}^{\text{diag}}= \text{min}_{k_1,k_2,f_1,f_2}\( \mathcal{C}_{\mathcal{A}\mA^c}^{\text{diag}} \)\,.\label{gamble3} \end{equation} However, as discussed in subsection \ref{genre}, there is degeneracy amongst the possible optimal purifications. In particular, the purification complexity will be unchanged by the following $SO(2)$ transformation\footnote{We note that this rotation only acts on the ancillae and so leaves $\Gamma=\Gamma_D$ unchanged -- see eq.~\reef{newmat}.} \begin{equation} \hat{K}= \left( \begin{array}{cc} k_1& f_1\\ f_2 & k_2 \\ \end{array} \right) \cdot \left( \begin{array}{cc} \cos \theta& -\sin \theta\\ \sin \theta &\ \cos \theta \\ \end{array} \right) =\left ( \begin{array}{cc} \hat{k}_1& \hat{f}_1\\ \hat{f}_2 & \hat{k}_2 \\ \end{array} \right)\,. \end{equation} Hence we can simplify the optimization by eliminating one of the parameters $(k_1,k_2,f_1,f_2)$, {\it e.g.,}\ we can choose $\tan \theta = f_1/k_1$ to set $\hat{f_1}=0$. That is, we know there will be an optimal purification in which $f_1=0$ and hence we can reduce eq.~\reef{gamble3} to \begin{equation}\label{two_modes} \mathcal{C}_{\mathcal{A}}^{\text{diag}}= \text{min}_{k_1,k_2,f_1=0,f_2} \( \mathcal{C}_{\mathcal{A}\mA^c}^{\text{diag}} \)\,. \end{equation} However, performing the minimization numerically using Mathematica, we found that the optimal purification coincided with the mode-by-mode purification \reef{gamble} ({\it i.e.,}\ $f_2=0$). To be precise, we determined optimal purifications for mixed states described by $\alpha_i \in [0,5]$ and $r_i \in [-10,10]$,\footnote{Note that this corresponds to an exponentially large range for the parameters, $a_i$ and $b_i$, using eqs.~\reef{parameters} and \reef{hope}.} and were able to show that $\frac{\mathcal{C}_{\otimes \mathcal{A}\mA^c}^{\text{diag}}-\mathcal{C}^{\text{diag}}_{\mathcal{A}}}{\mathcal{C}^{\text{diag}}_{\mathcal{A}}} \lesssim 10^{-10}$. Hence the general purification complexity \reef{two_modes} reduces to the expression in eq.~\reef{gamble4}. This demonstrates that the mode-by-mode purification is indeed the optimal purification for two-mode Gaussian mixed states which factorize as in eqs.~\eqref{eq:density-mixed}-\eqref{gamble6}. However, the previous conclusion does {\bf{not}} apply for the most general two-mode Gaussian mixed states, as we will now demonstrate. Let us replace the previous example \reef{eq:density-mixed}-\eqref{gamble6} with a general two-mode density matrix \reef{density_fun_A} where \begin{equation}\label{gamble7} A=\left( \begin{array}{cc} a_1 & 0 \\ 0 & a_2 \\ \end{array} \right) \qquad{\rm and}\qquad B=\left( \begin{array}{cc} b_1 & g \\ g & b_2 \\ \end{array} \right)\,. \end{equation} Comparing to the factorized case ({\it i.e.,}\ with eq.~\reef{gamble6}), one may also expect the off-diagonal components of $A$ to be nonvanishing in general. However, we can always perform an $SO(2)$ transformation to diagonalize $A$ leaving us with the expressions given above. In section \ref{sec:purificationX}, we showed that any Gaussian state can be decomposed into a product state using a general ({\it i.e.,}\ non-orthogonal) transformation as in eq.~\eqref{nonorthogonal_trans}. One may then naively expect that the optimal purification of ${\rho}_{\mathcal{A}}$ will be a simple mode-by-mode purification in this new `diagonal' basis, {\it i.e.,}\ the simplest solutions found in section \ref{sec:purificationX}. However, a more careful analysis is required since, as we stressed in eq.~\eqref{new_referenece}, this general transformation modifies the reference state so that it is no longer a product state in the new basis. To test the hypothesis that the optimal purification takes the form of a mode-by-mode purification in the diagonal basis, we examined a variety of examples using similar numerical methods to those employed above. The purification takes the same form as in eq.~\reef{gamble2} where $\Gamma$, $\Omega$ and $K$ are constrained by eq.~\eqref{pure_constrians} using the $A$ and $B$ matrices given in eq.~\reef{gamble7}. Let us parameterize $K$ as in eq.~\reef{gamble2a} and then as in the previous example, we can use a rotation acting on the ancillary directions ${\vec q}_{\mathcal{A}^c}=(y_1,y_2)$ to set $f_1=0$. Then as above, we found the optimal purification numerically for a variety of examples by minimizing over the three remaining free parameters $(k_1,k_2,f_2)$. Given the optimal purification, we can examine its form in the diagonal basis produced by the transformation in eq.~\reef{nonorthogonal_trans}. Since we have already diagonalized $A$ in eq.~\reef{gamble7}, this transformation reduces to \begin{equation}\label{late1} {\vec q}_\mathcal{A}= A^{-1/2}\cdot O_B \cdot\tilde{\vec q}_\mathcal{A}\,. \end{equation} For a mode-by-mode purification, all three matrices, $\Gamma$, $\Omega$ and $K$, should be simultaneously diagonal in the new basis. The transformation \reef{late1} is chosen to make sure that $A$ and $B$ in the density matrix \reef{density_fun_A} are diagonal and hence with $\Gamma=A+B$ from eq.~\reef{pure_constrians}, the $\Gamma$ matrix is automatically diagonal in the new basis. Hence the question reduces to determining whether or not $\Omega$ and $K$ are both diagonal or rather simultaneously diagonalizable in the new basis. The latter refers to the fact that there are still the $SO(2)$ transformations \reef{newmat} which map amongst the optimal purifications. For example, let us begin with the original coordinates in eq.~\reef{Gaussian_AB}, and the optimal $K_{op}$ is found by the minimization among the three free parameters in the matrix \begin{equation} K =\left( \begin{array}{cc} k_1& 0\\ f_2 & k_2 \\ \end{array} \right)\,. \end{equation} Now applying the (inverse of the) transformation in eq.~\reef{late1}, it becomes \begin{equation} \tilde{K}= O^T_B \cdot A^{-1/2} \cdot K_{op} = \left ( \begin{array}{cc} \tilde{k}_1& \tilde{f}_1\\ \tilde{f}_2 & \tilde{k}_2 \end{array} \right) \,. \label{late2} \end{equation} But then we would employ eq.~\reef{newmat} to see if we can find a rotation such that $\tilde K$ becomes diagonal, {\it i.e.,}\ \begin{equation} \label{Khat} \hat{K} = \left ( \begin{array}{cc} \hat{k}_1& 0\\ 0 & \hat{k}_2 \end{array} \right)\overset{?}{=}\tilde{K}\, R_{\mathcal{A}^c} \end{equation} with $R_{\mathcal{A}^c} \in SO(2)$. This is a nontrivial constraint since $R_{\mathcal{A}^c}$ rotates each of the rows of $\tilde K$ as a vector separately, and hence if $\tilde K$ is diagonalizable, then these row vectors must already be orthogonal in $\tilde K$. Therefore a necessary condition to have a mode-by-mode purification is that \begin{equation} \delta \tilde{K}= \tilde{k}_1\tilde{f}_2 + \tilde{k}_2\tilde{f}_1 = 0\,.\label{late3} \end{equation} In fact, $\delta \tilde{K}= 0$ is a necessary and sufficient condition. Since we have put $B$ in a diagonal form with the transformation \reef{late1}, the second constraint in eq.~\reef{constrain2} shows that if $K$ is also diagonal then $\Omega$ will also be diagonal in the same basis. Therefore we can see that when $\delta \tilde{K}= 0$, the optimal purification is indeed a mode-by-mode purification. On the other hand, if $\delta\tilde{K} \neq 0$, the optimal purification must still have a more complicated form in the diagonal basis. \begin{figure}[htbp] \centering\includegraphics[width=3.6in]{deltaKtilde} \caption{$\delta \tilde{K}$ (see eq.~\reef{late3}) as a function of $g$ (the off-diagonal component of $B$). In this example, ${a_1}/{\mu}=4, {a_2}/{\mu} =2, {b_1}/{\mu}= 2$ and ${b_2}/{\mu}= \frac{3}{2}$. The red vertical line indicates the upper bound ${g}/{\mu}=1$ for the parameter $g$, which is constrained by the positivity of the matrix $A-B$. Along the top axis, $\Delta$ is a measure which quantifies the deviation of $A$ and $B$ from being commuting --- see eq.~\reef{Delta1}.} \label{deltaK12} \end{figure} A typical plot for $\delta \tilde{K}$ is shown in figure \ref{deltaK12}. Recall that the optimal purification, {\it i.e.,}\ the optimal $\tilde K$, was found numerically following the scheme in eq.~\reef{two_modes}. Our numerical results support the hypothesis that the mode-by-mode purification is optimal when the $A,B$ matrices commute, or equivalently, when the density matrix can be factorized, as in eqs.~\eqref{eq:density-mixed}-\eqref{gamble6}.\footnote{For commuting $A,B$, we explored two possibilities numerically: $a_1=a_2$ or $g=0$. The latter is the same as with the mode-by-mode purification. For the former, we considered the parameters in the ranges: $a_1=a_2 \in [2,6]\,,b_1,b_2 \in [1,3]\,, g\in [0,0.5]$. We found that $\delta \tilde{K}$ was fluctuating within the range $10^{-6}$ to $10^{-9}$.\label{hard}} This result is not surprising because when $[A,B]=0$, it is always possible to find an orthogonal transformation that acts on the ${\vec q}_\mathcal{A}$ and brings the target state (explicitly) to the form of a factorized product of one-mode Gaussian states. In this case, our numerical results support the previous conjecture about the optimal purification for such product states. While we found in general that a mode-by-mode purification is not optimal, we would still like to show that such purifications (in the diagonal basis) produce a very good approximation to the optimal one in certain circumstances. In particular, for a variety of examples, as we detail below, we found the optimal purification numerically, but found that the associated complexity did not improve very much the complexity found by only optimizing over mode-by-mode purifications, {\it i.e.,}\ by restricting the purification to have the form in eqs.~\eqref{gamble8}-\eqref{gamble} in the $\tilde{\vec q}_\mathcal{A}$ basis of eq.~\eqref{late1} and minimizing the complexity of the two free parameters $\hat{k}_{1,2}$.\footnote{That is, we define a two-parameter family of purifications with \begin{equation} K=\sqrt{A}\, O_B \, \hat{K} \qquad{\rm where}\quad \hat{K} = \left ( \begin{array}{cc} \hat{k}_1& 0\\ 0 & \hat{k}_2 \end{array} \right)\,, \end{equation} and then optimize the complexity in the diagonal basis $\mathcal{C}^{\text{diag}}_1$, {\it i.e.,}\ \eqref{complexity_pure} with the forms of $K,\Gamma,\Omega$ matrices in the original basis over the two free parameters $\hat{k}_i$. That is, the complexity is still defined in the regular way but our approximation is that $\tilde{\mathcal{C}}$ is derived by limiting the optimization to only varying these two parameters. When the matrix $A$ is not diagonal, the mode-by-mode purification takes the form $K=O_A \cdot D_A^{-1/2}\cdot O_B \cdot \hat{K}$, where $O_A$ is the matrix that brings $A$ to the diagonal form $D_A$, see eq.~\eqref{nonorthogonal_trans}.} In order to quantitatively measure the deviation of the $A$ and $B$ matrices from being commuting, we define \begin{equation}\label{Delta1} \Delta=\sqrt N\, \frac{\parallel\!\! [A,B]\!\!\parallel_\mt{F}}{\parallel\!\! A\!\!\parallel_\mt{F}\,\parallel\!\!B\!\!\parallel_\mt{F}}\,, \end{equation} where $\parallel\!\! A\!\!\parallel_\mt{F}$ denotes the Frobenius norm, {\it i.e.,}\ \begin{equation} \parallel\!\! A\!\!\parallel_\mt{F}\equiv \sqrt{\operatorname{Tr}\left(A^\dagger\, A\right)} = \sqrt{\sum_{i=1}^m \sum_{j=1}^n |A_{ij}|^2} \,, \end{equation} for an $m\times n$ matrix. We have chosen this definition \reef{Delta1} so that it does not change if we rescale the matrices $A$ and $B$ by an overall constant. Note that we have also included an overall factor of $\sqrt{N}$ in eq.~\reef{Delta1} where $N$ is the number of oscillators in the original mixed state ({\it i.e.,}\ both $A$ and $B$ are $N\times N$ matrices). This ensures that if the matrices are chosen at random ({\it i.e.,}\ with all elements of order one), then $\Delta$ does not scale with $N$ ({\it i.e.,}\ it does not becomes arbitrarily small or large as the number of degrees of freedom becomes large, as in our QFT calculations).\footnote{When all elements are taken to be of order one, the Frobenius norm of a random matrix scales like $N$, but that of a commutator scales like $N^{3/2}$. This is because every element in the commutator is roughly speaking the sum of $N$ random variables whose variance $\sigma^2\sim 1$. Hence, the variance of the sum is $\sigma^2\sim N$.} These features eliminate any trivial effects from our measure of noncommutativity, assuring that we can still use it when dealing with a very large number of oscillators in the QFT calculations. For example, applying the definition \eqref{Delta1} to the two-mode case with the matrices $A$ and $B$ as defined in eq.~\eqref{gamble7}, one finds \begin{equation}\label{delta-bound} \Delta = \frac{2 \,|\left(a_1-a_2\right) g\, |}{\sqrt{\left(a_1^2+a_2^2\right) \left(b_1^2+b_2^2+2 g^2\right)}} < \frac{ |a_1-a_2| }{\sqrt{\left(a_1^2+a_2^2\right)}} < 1\,, \end{equation} where the constrains are due to the positivity of the matrices $A$ and $B$.\footnote{In particular, the first inequality follows from $b_1^2+b_2^2+2 g^2=4 g^2+(b_1-b_2)^2+2(b_1 b_2-g^2)>4g^2$, where $b_1 b_2-g^2>0$ comes from the positivity of the matrix $B$.} Our numerical tests of the optimality of the mode-by-mode purifications compared to the complete minimization can be found in figures \ref{deltaC_onebyone} and \ref{deltaC_large}. Figure \ref{deltaC_onebyone}, demonstrates that the difference between the two complexities (mode-by-mode versus exact minimization) is very small when the matrices $A$ and $B$ are nearly commuting. Figure \ref{deltaC_large} explores a wider range of parameters, to include not nearly commuting matrices, {\it i.e.,}\ larger values of $\Delta$. We have scanned $a_1, a_2, \in [1,5]\,, b_1,b_2 \in [0.001, 3]$ and $g \in [0, 0.5]$ numerically, and found that with a large $\Delta$, the relative difference of complexity can rise up to about $5\%$, as shown in the figure \ref{deltaC_large}. We therefore see that at least in these cases, the mode-by-mode purifications provide a good approximation for the complexity. \begin{figure}[h] \includegraphics[width=0.5\textwidth]{figures/Deltaa1_parameter} \hspace{0.01\textwidth} \includegraphics[width=0.5\textwidth]{figures/Deltag_parameter} \caption{The relative difference between the mode-by-mode `complexity' $\tilde \mathcal{C}_1^\mt{diag}$ and the optimal complexity $\mathcal{C}_1^\mt{diag}$ for nearly commuting $A$ and $B$. Left panel: $a_2/\mu =3, b_1/\mu =1, b_2/\mu = 1.5, g_1/\mu =0.5$ and $a_1/\mu \in (1,6)$. The vertical red line indicates the lower bound $a_1/\mu= 7/6$, which is fixed by requiring that the matrix $A-B$ is positive. Right panel: $a_1 /\mu=5, a_2/\mu =2, b_1/\mu = 1, b_2/\mu= 1.5$ and $g/\mu \in (0,\sqrt{\frac{3}{2}}) $. The vertical blue line indicates the upper bound $g/\mu=\sqrt{\frac{3}{2}}$, which is determined by requiring the positivity of the matrix $B$. At the upper bound $g/\mu=\sqrt{\frac{3}{2}}$, one of the eigenvalues of the matrix $B$ vanishes and we see that the relative complexity difference vanishes too. This is because in this case, the state $\hat\rho_{\mathcal{A}}$ is mixed for only one of the two modes and its essential purifications will be by definition mode-by-mode purifications.} \label{deltaC_onebyone} \end{figure} \begin{figure}[h] \centering\includegraphics[width=4.0in]{figures/deltaa_largedeltaB} \caption{The relative difference between the mode-by-mode `complexity' $\tilde \mathcal{C}_1^\mt{diag}$ and the optimal complexity $\mathcal{C}_1^\mt{diag}$ for $A$ and $B$ with larger $\Delta$. Here we take $a_1/\mu \in (\frac{181}{1000},5)$ as the free parameter with fixed $a_2/\mu = \frac{1}{5}\,, b_1/\mu=b_2/\mu =\frac{1}{10}\,, g/\mu = \frac{9}{100}$. As $a_1/\mu \rightarrow \infty$, $\Delta$ approaches the upper bound, {\it i.e.,}\ $1$ coming from the positivity of $A-B$ and $B$ matrices as shown in \eqref{delta-bound}. The vertical red line indicates the lower bound $a_1/\mu =\frac{181}{1000}$ constrained by the positivity of $A-B$. The maximum relative difference with these parameter is $ 4.718\%$ at $a_1/\mu = 1.585$. Note that at $a_1/\mu=0.785$ the value of the relative difference of the complexity essentially vanishes ({\it i.e.,}\ $\frac{\tilde \mathcal{C}^{\text{diag}}_1- \mathcal{C}^{\text{diag}}_1}{\mathcal{C}^{\text{diag}}_1}=6.583\times 10^{-8}$). This means that the mode-by-mode purification is optimal in this case, even though $A$ and $B$ do not commute and $\rho_{\mathcal{A}}$ is mixed in both modes. We might expect such ``coincidences'' from counting arguments similar to those that appear in the last paragraph of section \ref{genre} since the complexity is a scalar function of many parameters.} \label{deltaC_large}\end{figure} To conclude this section, we are motivated by our numerical results for two-mode Gaussian states to make the second conjecture that for the general $N_{\mathcal{A}}$-mode Gaussian state $\rho_{\mathcal{A}}$ whose density matrix elements satisfy \begin{equation} [A,B]=0\,, \end{equation} the optimal purification will be a mode-by-mode purification (in the diagonal basis). Further, when $[A,B]\ne0$ but these matrices are still close to commuting in the sense that $\Delta\ll1$, the mode-by-mode purification will still be a good approximation to the true optimal purification. \subsection{Optimal Purification in the Physical Basis}\label{subsec3phys} As we pointed out in section \ref{subsec:compure}, the $\mathcal{C}_1$ complexity is basis dependent. In the previous subsection, we focused on the diagonal basis, and so here we would like to explore the sensitivity of our results to this choice. In particular, we will evaluate the purification complexity using, what we call, the physical basis. Recall that the diagonal modes are generally linear combinations of the physical degrees of freedom (in $\mathcal{A}$ in eq.~\reef{Gaussian_AB}) and the auxiliary degrees of freedom (in $\mathcal{A}^c$) and further, these linear combinations are tuned in a way which depends on the state in question. Another natural basis would be one that separates the action of the fundamental gates~\eqref{gates} on the physical and ancillary degrees of freedom. More precisely, the generators might contain $\hat{x}_a$ ($\hat{p}_b$) which are linear combinations of positions (momenta) of physical oscillators or ancillae separately, but not both. Of course, we still require entangling gates which introduce entanglement between the two subsystems, {\it e.g.,}\ where $\hat{x}_a$ acts on $\mathcal{A}$ and $\hat{p}_b$, on $\mathcal{A}^c$. We denote this set of elementary gates, the physical basis. In evaluating the $\mathcal{C}_1$ complexity in the physical basis, we begin with the purification in eq.~\eqref{Gaussian_AB}. We then find the orthogonal transformation $O_{\mathcal{A}\mA^c} = O_{\cal A} \otimes O_{\mathcal{A}^c}$ (with $O_{\cal A} \in O(N_{\cal A})$, $O_{\mathcal{A}^c} \in O(N_{\mathcal{A}^c})$) which diagonalizes the blocks $\Gamma$ and $\Omega$, \begin{equation} \label{diagonalize} \Gamma' = O_{\cal A}\, \Gamma \,O_{\cal A}^T\,,\quad {\rm and} \quad \Omega' = O_{\mathcal{A}^c}\, \Omega\, O_{\mathcal{A}^c}^T\,. \end{equation} The key difference from the diagonal basis is that this transformation leaves us with a nonvanishing off-diagonal matrix $K$, which captures the entanglement between the physical and ancillary subsystems. That is, \begin{equation} K' = O_{\cal A}\, K\, O_{\mathcal{A}^c}^T \neq 0\,, \end{equation} and thus the purification takes the form \begin{equation}\label{waffle} \Psi_{\mathcal{A}\mA^c} = \mathcal{N}_{\mathcal{A}\mA^c}\ \exp\! \[ -\frac{1}{2} (\vec q_{\mathcal{A}}{\!\!'}\ ,\vec q_{\mathcal{A}^c}{\!\!\!\!'}\ ) \left( \begin{array}{cc} \Gamma' & K' \\ K'^T & \Omega' \\ \end{array} \right) \left( \begin{array}{c} \vec q_{\mathcal{A}}{\!\!'} \\ \vec q_{\mathcal{A}^c}{\!\!\!\!'}\ \ \\ \end{array} \right) \]\,, \end{equation} which has diagonal blocks $\Gamma'$ and $\Omega'$ but nonvanishing off-diagonal blocks $K'$ and $K'^T$. The physical basis complexity ${\cal C}^\mt{phys}_1$ is then given by eq. \eqref{rotate2pos} \begin{equation} \label{C1phys} {\cal C}^\mt{phys}_1 = \sum_{a,b=1}^{N_{\cal A}+N_{\mathcal{A}^c}} |H_{ab}|\,, \end{equation} where $H$ is the generator~\eqref{Hgen} producing the optimal trajectory in the physical basis.\footnote{It is important to keep in mind that the generator matrix $H$ is not diagonal in the physical basis. This matrix is diagonal only in the diagonal basis.} The generator matrix can be found by taking the matrix logarithm of the parameter matrix in eq.~\reef{waffle}, {\it i.e.,}\ \begin{equation}\label{eq:Hphys} H = \frac12\, \ln\!\left(\frac{M_\mt{T}}{\mu}\right)\qquad{\rm where} \quad M_\mt{T} = \left(\begin{array}{cc} \Gamma' & K' \\ K'^T & \Omega' \\ \end{array}\right)\,. \end{equation} We would like to stress that the original calculation of the pure state complexity was not optimized in this basis and so strictly speaking what we provide here is a bound on the physical basis complexity. We now summarize how the results in section \ref{optimal} change for the physical basis. \subsubsection{Degenerate purifications} In section \ref{genre}, we discussed the $SO(N_{\mathcal{A}^c})$ degeneracy of the purifications yielding equal complexities for any given mixed state. This degeneracy was characterized by orthogonal transformations $R_{\mathcal{A}^c} \in SO(N_{\mathcal{A}^c})$ of the ancillary degrees of freedom \eqref{transf99}. This degeneracy was due to the fact that a rotation of the degrees of freedom does not change the spectrum of the parameter matrix \eqref{newmat}, and the diagonal-basis complexity depends only on this spectrum and the reference scale $\mu$. Revisiting this question for the physical-basis complexity, we emphasize that this degeneracy is built into the definition of ${\cal C}^\mt{phys}_1$. Indeed, while the definition of physical-basis complexity~\eqref{C1phys} might not seem invariant under $SO(N_{\mathcal{A}^c})$ transformations of the ancillary degrees of freedom at first sight, it is important to remember that the prescription to define the physical-basis complexity of any purification will give identical parameter matrix $M_\mt{T}$ after the canonical rotation required to diagonalize the blocks $\Gamma$ and $\Omega$. Consider any two purifications \begin{equation} M_{\mt{T},1} = \left(\begin{array}{cc} \Gamma_1 & K_1 \\ K_1^T & \Omega_1 \\ \end{array}\right) \,, \quad M_{\mt{T},2} = \left(\begin{array}{cc} \Gamma_2 & K_2 \\ K_2^T & \Omega_2 \\ \end{array}\right)\,, \end{equation} related by the transformation in eq.~\eqref{transf99} \begin{equation} \left(\begin{array}{cc} \Gamma_1 & K_1 \\ K_1^T & \Omega_1 \\ \end{array}\right) = \left(\begin{array}{cc} \Gamma_2 & K_2 R_{\mathcal{A}^c} \\ R_{\mathcal{A}^c}^TK_2^T & R_{\mathcal{A}^c}^T \Omega_2 R_{\mathcal{A}^c} \\ \end{array}\right)\,. \end{equation} Then the canonical transformations \eqref{diagonalize} diagonalizing the blocks $\Gamma_i$ and $\Omega_i$ will be related by \begin{equation} O_{1,\cal A} = O_{2,\cal A}\,, \quad O_{1,\mathcal{A}^c} = O_{2,\mathcal{A}^c} R_{\mathcal{A}^c}\,. \end{equation} The resulting physical-basis parameter matrix $M'_\mt{T}$ will be the same for both purifications, and consequently they will both have the same physical-basis complexity. \subsubsection{Essential purifications} In section \ref{threeA} using the diagonal basis, we showed that purifying a Gaussian mixed state \reef{dense1} for a single harmonic oscillator with two ancillae does not improve the purification complexity over the one found with a single ancilla. In the physical basis, we were not able to produce an analytical proof of the same result; however, our numerical results showed that again adding an extra ancillary degree of freedom did not improve the purification complexity for a wide range of single harmonic oscillator mixed states. In particular, we found that the purification complexity of the optimal purification with one ancilla and with two ancillae differed by $\frac{\Delta {\cal C}}{\cal C} \lesssim 10^{-13}$ for a wide range of mixed states.\footnote{The states considered numerically were of the form~\eqref{dense1} with $a\in [2\mu ,10\mu]$ and $b \in [\mu, a-\mu]$} Moreover, when looking at the precise value of the parameters that minimize the complexity in the general case, we found that the purifications correspond to those which only entangle one ancilla to the physical oscillator, and the eigenvalue of the unentangled ancilla is simply the reference state scale $\mu$. These results seem to indicate that the conclusion of section \ref{threeA} applies to the physical-basis complexity as well. That is, we will assume that the optimal purification in the physical basis for a Gaussian mixed state with many degrees of freedom is again an essential purification. \subsubsection{Mode-by-mode purifications} Using more numerics, we examined the questions addressed in section \ref{MbyM} but here for the physical-basis complexity. In particular, we considered the conditions for the optimal purification of a mixed state of many degrees of freedom to be a mode-by-mode purification, and we found that the results are similar to those for the diagonal-basis complexity: the optimal purification of a Gaussian density matrix $\hat\rho$ for many modes is mode-by-mode when the density matrix is a product of single-mode density matrices ({\it i.e.,}\ $\hat\rho = \otimes \hat\rho_i$). More precisely, for a range of mixed states~\eqref{densityFun_A} of two harmonic oscillators characterized by commuting parameter matrices $A$ and $B$,\footnote{We considered states with parameter matrices of the form \eqref{gamble8}-\eqref{gamble} with $a_1 \in [2\mu , 4\mu]$, $a_2 \in [2\mu, 3\mu]$, $b_1 \in[\mu, a_1-\mu]$ and $b_2 \in[\mu, a_2-\mu]$.} we compared the complexity found by optimizing mode-by-mode purifications~\eqref{gamble8} with that found from more general purifications~\eqref{gamble2a}. Our numerical results showed essentially no difference, {\it i.e.,}\ $\frac{\Delta {\cal C}}{\cal C} \lesssim 10^{-12}$. For non-product density matrices ({\it i.e.,}\ where the parameter matrices $A$ and $B$ no longer commute), we compared the complexity found with general purifications to that found by only optimizing over mode-by-mode purifications. We used the following convenient parametrization of the matrices $A$ and $B$ of the density matrix~\eqref{density_fun_A} in the physical basis\footnote{Note that this parametrization is not the same as in section \ref{MbyM}, since $A$ is not diagonal here.} \begin{equation} A=\left( \begin{array}{cc} \bar{a}_1 & -\bar{g} \\ -\bar{g} & \bar{a}_2 \\ \end{array} \right) \qquad{\rm and}\qquad B=\left( \begin{array}{cc} \bar{b}_1 & \bar{g} \\ \bar{g} & \bar{b}_2 \\ \end{array} \right)\,. \end{equation} We again found that the difference is quite small -- see figures \ref{deltaC_onebyone_position}. The maximal difference obtained in these cases is about $3.5\%$. Note that in the cases examined there, we are fixing the parameters $\bar a_i$ and $\bar b_i$ while $\bar g$ varies. In this situation, there will be an upper bound on $\bar g$ which comes from requiring positivity of the parameter matrix $B>0$. As $\bar{g}$ reaches its maximum allowed value ({\it i.e.,}\ $\bar{g} \to 0.7\mu$ on the right), one of the eigenvalues of the $B$ matrix approaches zero. Hence at this point, we are dealing with the purification of only one mode and as a result, the relative difference in complexity approaches zero. In the left panel of figure \ref{deltaC_onebyone_position}, the relative difference in complexity decreases earlier and gets close to zero across the entire range $\bar{g} \in \[0.725\mu,1.22\mu\]$. At present, we do not understand the reason for this usual behaviour,\footnote{We note that the left panel of figure \ref{deltaC_onebyone} seems to hint at similar behaviour.} but it may be related to the fact that one of the eigenvalues of $A-B$ also vanishes as $\bar{g} \to 1.22\mu$. Let us add that the relative difference will not necessarily increase as $\Delta$ increases. In particular, it is also possible that the relative difference is very small, even for relatively large values of $\Delta$. As before, such ``coincidences'' could result from counting arguments similar to those that appear in the last paragraph of section \ref{genre} since the complexity is a scalar function of many parameters. \begin{figure}[h] \includegraphics[width=0.5\textwidth]{figures/deltaC-clean} \includegraphics[width=0.5\textwidth]{figures/deltaC2-clean} \caption{The relative difference between the mode-by-mode physical-basis `complexity' $\tilde \mathcal{C}_1^\mt{phys}$ and the optimal physical-basis complexity $\mathcal{C}_1^\mt{phys}$. In the left panel, we are focusing on nearly commuting $A$ and $B$ matrices with parameters: $\bar{a}_1=5\mu$, $\bar{b}_1=\mu$, $\bar{a}_2=3\mu$ $\bar{b}_2=1.5\mu$ and $\bar{g}\in [0,1.22\mu]$. In the right panel, we explore larger values of $\Delta$ with parameters: $\bar{a}_1=15\mu$, $\bar{b}_1=0.5\mu$, $\bar{a}_2=1.5\mu$ $\bar{b}_2=\mu$ and $\bar{g}\in [0,0.7\mu]$. The plots extend to the maximum allowed value for $\bar{g} $, which is determined by demanding $B>0$. } \label{deltaC_onebyone_position} \end{figure} \subsection{Review of the Holographic Proposals} \label{revvH} The subregion-CV conjecture \cite{Alishahiha:2015rta, Carmi:2016wjl} suggests that the complexity associated to a boundary subregion $\mathcal{A}$ on a given time slice is given by the maximal spatial volume of a codimension-one surface, $\mathcal{R_\mathcal{A}}$ bounded by the boundary subregion and its Hubeny-Rangamani-Takayanagi (HRT) surface $\mathcal{E}_\mathcal{A}$ \cite{Ryu:2006bv,Ryu:2006ef,Hubeny:2007xt,Dong:2016hjy}: \begin{equation}\label{eq:cv} \mathcal{C}_V(\mathcal{A})=\text{max}_{\partial \mathcal{R_A}= \mathcal{A} \cup \mathcal{E}_\mathcal{A}} \left[\frac{\mathcal{V}(\mathcal{R_A})}{G_N\, \ell_{\text{bulk}}}\right]\,. \end{equation} The appearance of an arbitrary bulk length scale, $\ell_{\text{bulk}}$, is a somewhat undesirable feature. In the following, we assume that $\ell_{\text{bulk}}=L$, the AdS curvature radius. Note that while a more sophisticated prescription to define $\ell_{\text{bulk}}$ for black hole geometries was given in \cite{Couch:2018phr}, it still yields $\ell_{\text{bulk}}\sim L$ for the planar AdS black holes which we consider below, {\it i.e.,}\ see eq.~\reef{BH_metric}. A second proposal is the subregion-CA conjecture \cite{Carmi:2016wjl}, which suggests that the subregion complexity is given by the on-shell gravitational action on a particular bulk region $\widetilde{W}_\mathcal{A}$, which is defined as the intersection of the Wheeler-DeWitt (WDW) patch and the entanglement wedge of the boundary region $\mathcal{A}$ \cite{EW1,EW2,EW3}: \begin{equation}\label{eq:ca} \mathcal{C}_A(\mathcal{A})=\frac{I_{\text{grav}}(\widetilde{W}_{\!\mathcal{A}})}{\pi }\,. \end{equation} The gravitational action on regions with boundaries includes surface terms in addition to the usual bulk contribution. These surface terms include the Gibbons-Hawking-York (GHY) term \cite{Gibbons:1976ue,York:1972sj} for space-like or time-like boundaries, and an analogous contribution for null boundaries \cite{Lehner:2016vdi,Parattu:2015gga}. For null boundaries, one must also include the null counterterm introduced in \cite{Lehner:2016vdi} to restore reparametrization invariance along the null generators. In addition to the codimension-one boundary surfaces, the boundary of $\widetilde{W}$ also contains codimension-two joints at the intersection of the boundary surfaces. Their contributions have been addressed in \cite{Hayward1993,Brill:1994mb} for joints which do not involve null surfaces, and in \cite{Lehner:2016vdi} for joints which involve at least one null surface. The full prescription can be found in \cite{Lehner:2016vdi}, or in appendix A of \cite{Carmi:2016wjl}. Hence, in order to calculate $\mathcal{C}_A(\mathcal{A})$, we must evaluate \begin{equation} I_{\text{grav}}=I_{\text{bulk}}+ I_{\mt{GHY}}+I_{\text{null}}+ I_{\text{ct}}+ I_{\text{joints}}\,. \label{actor} \end{equation} Let us add that defining the counterterm $I_{\text{ct}}$ requires introducing a new arbitrary length scale $\ell_\text{ct}$ and the choice of this length scale influences various properties of the complexity. Comparing the structure of the UV singularities in holographic and QFT calculations of complexity leads to the suggestion that the choice of this length scale may be related to the choice of microscopic scales in defining the reference state and the gates in the complexity model of the boundary theory ({\it e.g.,}\ $\mu$ in our QFT construction) \cite{qft1,qft2,Vaidya2}. The complexity = spacetime volume (CV2.0)\footnote{An update to the complexity = spacetime volume conjecture, denoted `CA2.0', was proposed in \cite{Fan:2018wnv}. However, for Einstein-Hilbert gravity with minimally coupled matter, this approach simply reduces to the CV2.0 proposal. As such, we will not consider it further here.} conjecture \cite{Couch:2016exn} simplifies the CA conjecture by proposing that the complexity can be determined by evaluating the spacetime volume of the WDW patch. The simplification still displays all of the properties expected of holographic complexity. Our subregion-CV2.0 conjecture is the natural generalization of this proposal to boundary subregions. That is, the complexity of a subregion $\mathcal{A}$ is given by the spacetime volume of the region appearing in eq.~\reef{eq:ca}, {\it i.e.,}\ the intersection of the WDW patch and the entanglement wedge,\footnote{The units are naturally absorbed by the AdS curvature scale in the definition here following \cite{Couch:2018phr}. Their approach uses the relation $\mathcal{C}\sim {\cal P}\,\cal V_\text{WDW}$ where ${\cal P}= -\frac{\Lambda}{8\pi G_{N}}\sim 1/(G_N L^2)$ is the `bulk' pressure \cite{Kastor:2009wy}. Note that the application of these arguments is not straightforward for solutions with nontrivial scalar hair \cite{Fan:2018wnv}.} \begin{equation}\label{eq:cv2} \mathcal{C}_{V2.0}(\mathcal{A})=\frac{{\cal V}(\widetilde{W}_{\!\mathcal{A}})}{G_N\, L^{2} }\,. \end{equation} As a pragmatic point, we note that in our calculations below, the integrand of the bulk action, {\it i.e.,}\ the Einstein-Hilbert term, is simply constant with $R-2\Lambda = -\frac{2d}{L^2}$. Hence, the complexity in eq.~\eqref{eq:cv2} and the bulk action evaluated for eq.~\reef{eq:ca} are simply related by \begin{equation}\label{cv20main2} \mathcal{C}_{V2.0}(\mathcal{A}) = -\frac{8\pi}{d}\, I_{\text{bulk}}(\widetilde W_\mathcal{A})\,. \end{equation} {\bf Additivity properties:} The various holographic proposals for subregion complexity differ in several important respects. $\mathcal{C}_V$ is superadditive --- see section 2.1 of \cite{BrianMixedComplexity}. That is, let $\sigma$ be the Cauchy slice on which a pure state is defined, and divide this surface into a subregion $\mathcal{A}$ and its complement $\mathcal{B}$. Then the corresponding holographic complexities evaluated satisfy, \begin{equation}\label{volineqholo} \mathcal{C}_V(\mathcal{A}) + \mathcal{C}_V (\mathcal{B}) \le \mathcal{C}_V(\sigma=\mathcal{A}\cup\mathcal{B})\,, \end{equation} {\it i.e.,}\ the mutual complexity \reef{ramen2A} is negative. Intuitively, superadditivity in $\mathcal{C}_V$ is the result of dealing with positive definite volumes and the fact that the requirement to pass through the HRT surface adds an additional constraint in maximizing the volume. Let us add that this inequality is saturated in simple examples where the boundary Cauchy slice defines a time-reversal symmetric state (for which the HRT surface for $\mathcal{A}$ and $\mathcal{B}$ lies within the corresponding extremal bulk surface). Similarly, the subregion-CV2.0 conjecture yields superadditive results. This follows because the spacetime volume is always positive and further the intersection of the entanglement wedge and the WDW patch is a subregion within the WDW patch of $\sigma$. Hence it becomes evident that the mutual complexity \reef{ramen2A} will always be negative using this proposal. Let us emphasize that there are no obvious simple examples where the corresponding inequality would be saturated, {\it i.e.,}\ we {\it cannot} easily achieve $\Delta\mathcal{C}_{V2.0}=0$, unless one of the subregions vanishes. On the other hand, recall that the calculation of $\mathcal{C}_A$ in eq.~\reef{eq:ca} involves the length scale $\ell_\text{ct}$ associated with the null boundary counterterm. Different values of this length scale result in $\mathcal{C}_A$ being subadditive or superadditive in different situations \cite{BrianMixedComplexity} --- see also \cite{Caceres:2018blh}. However, one should expect that the complexity, and hence the leading divergence, is positive, which partially fixes this ambiguity and further results in $\mathcal{C}_A$ being superadditive. {\bf Structure of divergences:} All three proposals have a leading UV divergence proportional to the volume of the boundary subregion, {\it i.e.,}\ $V(\mathcal{A})/\delta^{d-1}$ but the subleading divergences are quite different. The subregion-CA conjecture yields subleading divergences with any power of $\delta$. In particular, in \cite{Carmi:2016wjl}, a class of subleading divergences associated with the boundary of the subregion were identified for the subregion-CA approach, {\it e.g.,}\ $V(\partial\mathcal{A})/\delta^{d-2}$. Similarly, subleading divergences with any power of delta appear for subregion-CV2.0, as is easily inferred from the results of \cite{Carmi:2016wjl} and the relation in eq.~\reef{cv20main2}. In contrast, it was shown that the subregion-CV approach yields power-law divergences involving only odd or even powers of the cutoff $\delta$ for an even- or odd-dimensional boundary theory, respectively. Hence the $V(\partial\mathcal{A})/\delta^{d-2}$ term does not appear with the subregion-CV approach. Before closing let us add that one could easily modify the three proposals in eqs.~\reef{eq:cv}, \reef{eq:ca} and \reef{eq:cv2} by including additional surface terms on the boundaries associated with the entanglement wedge. Because these bulk boundaries vanish when the subregion expands to fill the entire Cauchy slice on the holographic boundary, these surface contributions would disappear, and one would still recover the original proposal for holographic complexity of a pure state. For example, in the subregion-CV conjecture, one could add an extra term proportional to the volume of HRT surface $\mathcal E_A$ to produce the revised conjecture, \begin{equation}\label{eq:cvX} \mathcal{C}'_V(\mathcal{A})=\mathcal{C}_V(\mathcal{A}) +\eta\,\frac{\mathcal{V}(\mathcal{E_A})}{4 G_N}\,, \end{equation} where $\mathcal{C}_V(\mathcal{A})$ is the maximal volume expression in eq.~\reef{eq:cv} and $\eta$ is a (dimensionless) constant which remains to be determined. Our normalization of the second term makes clear that we are simply adding a term proportional to the entanglement entropy of the subregion $\mathcal{A}$, {\it i.e.,}\ $\mathcal{C}'_V(\mathcal{A})=\mathcal{C}_V(\mathcal{A}) +\eta\,S_\text{EE}(\mathcal{A})$. With this revised proposal, the form of the UV divergences becomes closer to that found with the subregion-CA and the subregion-CV2.0 approaches, {\it i.e.,}\ new subleading divergences associated with the boundary of $\mathcal{A}$ appear. Further, choosing a negative $\eta$ will ensure that the inequality in eq.~\reef{volineqholo} is never saturated with $\mathcal{C}'_V(\mathcal{A})$. On the other hand, if $\eta$ is chosen to be positive, this revised proposal \reef{eq:cvX} will typically be superadditive (because the mutual complexity will be dominated by the subleading divergence associated with the $S_\text{EE}(\mathcal{A})$ contribution). We reiterate that similar boundary terms could also be introduced to modify the subregion-CA and subregion-CV2.0 proposals, but the effect would be less important. We discuss this proposal \reef{eq:cvX} further in section \ref{holod}. \subsection{Complexity of Thermal States}\label{holography_thermal} Here, we apply these holographic prescriptions to evaluate the complexity of the thermal state, {\it i.e.,}\ where the subregion is taken to be one boundary of an (uncharged) eternal black hole, and to evaluate the mutual complexity of the corresponding thermofield double state. This system was already studied in \cite{BrianMixedComplexity} and we review their results here.\footnote{Note that our notation, {\it e.g.,}\ in eqs.~\reef{thermalCV} and \reef{eq:thermalCA}, is not identical to that in \cite{BrianMixedComplexity}, however, our results are in complete agreement with theirs. The only exception is that we have accounted for a factor of 4 typo in the second term in eq.~(2.17) of \cite{BrianMixedComplexity}.} The holographic calculation is performed for a two-sided AdS$_{d+1}$ black hole with the boundary dimension $d\geq2$ and with metric \begin{equation}\label{BH_metric} ds^2= \frac{L^2}{z^2} \( -f(z)\, dt^2 + \frac{dz^2}{f(z)} + d\vec{x}^{\,2} \)\,,\qquad{\rm where}\ \ f(z)= 1-\(\frac{z}{z_0}\)^{d}\,. \end{equation} Note that the boundary and horizon geometries are taken to be flat in this geometry. This eternal black hole in the bulk is dual to a thermofield double state in the boundary theory with temperature $T=\frac{d}{4\pi z_0}$. As noted above, we choose the subregion to be a constant time slice on one of the boundaries and so the corresponding reduced state in the boundary theory is the thermal mixed state with the same temperature. With this choice, the HRT surface is simply the bifurcation surface on the horizon (which is reached with $z\to z_0$ holding $t$ fixed), and the entanglement wedge is simply the static patch outside of the horizon, {\it i.e.,}\ $z\ge z_0$. {\bf Subregion-CV:} The result for subregion-CV \reef{eq:cv}, obtained in eq.~(2.16) of \cite{BrianMixedComplexity}, is \begin{equation}\label{thermalCV} \mathcal{C}_V(\mathcal{A}) = \frac{L^{d-1}}{(d-1)G_N}\,\frac{L}{\ell_{\text{bulk}}}\,\frac{V(\mathcal{A})}{\delta^{d-1}} + {b}(d)\, \frac{L}{\ell_{\text{bulk}}}\, S \,, \end{equation} where $\ell_{\text{bulk}}$ is the extra length scale appearing in eq.~\eqref{eq:cv}, and $V(\mathcal{A})$ is the spatial volume of the boundary theory. Further, ${b}(d)$ is a positive dimension-dependent coefficient given by \begin{align} {b}(d)=2\sqrt{\pi}\,\frac{d-2}{d-1}\,\frac{ \Gamma(\frac{d+1}{d})}{\Gamma(\frac{d+2}{2d})}\,. \end{align} Hence the finite term in eq.~\reef{thermalCV} is positive and proportional to $S=\frac{L^{d-1}}{4G_N\,z_0^{d-1}}\,V(\mathcal{B})$, the black hole entropy. Of course, $S$ can also be interpreted as the entropy of the thermal state in the boundary theory. In the simplest situation where $t_\text{L}=t_{\text{R}}=0$,\footnote{Here, $t_\text{L}$ and $t_{\text{R}}$ denote the times on the left and right boundaries, respectively.} the mutual complexity \reef{ramen2A} vanishes, {\it i.e.,}\ \begin{equation}\label{mutualCV} \Delta \mathcal{C}_{V} \equiv \mathcal{C}_V(\mathcal{L}) + \mathcal{C}_V (\mathcal{R}) -\mathcal{C}_V (\mathcal{L}\cup \mathcal{R})=0\,, \end{equation} because of the symmetry of the two-sided geometry. Hence, in this case, the inequality \eqref{volineqholo} is exactly saturated. More generally, the same result arises if we choose $t_\text{L}+t_{\text{R}}=0$, which ensures that the full boundary state is still the TFD state without any additional time evolution. On the other hand, if we allow for some time evolution with $t_L,\,t_{R}>0$, then $\mathcal{C}_V(\mathcal{L})$ and $\mathcal{C}_V (\mathcal{R})$ remain invariant while $\mathcal{C}_V (\mathcal{L}\cup \mathcal{R})$ increases. Therefore the mutual complexity becomes negative, and the complexity of the time-evolved TFD state is superadditive. {\bf Subregion-CA:} The final result for subregion-CA \reef{eq:ca} is\footnote{Compare to eq.~(2.14) of \cite{BrianMixedComplexity}.} \begin{equation}\label{eq:thermalCA} \mathcal{C}_A (\mathcal{A}) = a(d)\,\frac{L^{d-1}}{16\pi^2 G_N} \,\frac{V(\mathcal{A})}{\delta^{d-1}}-\frac{a(d)+g_0}{4\pi^2}\, S \end{equation} where the constants, $a(d)$ and $g_0$, are given by \begin{eqnarray}\label{eq:thermalCAhelp} a(d)&=&4\, \ln\! \left[\frac{\ell_{\text{ct}}}{L} (d-1)\right]\,, \nonumber\\ g_0&=& 2\left[\psi_0(1)-\psi_0\left(\frac{1}{d}\right) \right] \,, \label{g0} \end{eqnarray} with $\psi_0(z)=\Gamma'(z)/\Gamma(z)$. Note that $g_0$ is positive for $d>1$ (while, of course, it vanishes for $d=1$). The constant $a(d)$ involves the scale $\ell_{\text{ct}}$ appearing in the boundary counterterm in the gravitational action \reef{actor} --- see also eq.~\eqref{eq:ct}. Note that we must choose that $\ell_{\text{ct}}>L/(d-1)$ to ensure that $a(d)$, and hence the complexity $\mathcal{C}_A(\mathcal{B})$, is positive. Therefore, the finite contribution in eq.~\eqref{eq:thermalCA} is negative and proportional to the entropy of the thermal state. Using the subregion-CA approach, the mutual complexity \eqref{sushi} for the TFD state with $t_\text{L}=t_{\text{R}}=0$ becomes\footnote{Again, we may choose $t_\text{L}+t_{\text{R}}=0$ more generally. This result appears in eqs.~(2.7)-(2.8) of \cite{BrianMixedComplexity}.} \begin{equation}\label{exs222} \Delta \mathcal{C}_{A} \equiv \mathcal{C}_A(\mathcal{L}) + \mathcal{C}_A (\mathcal{R}) -\mathcal{C}_A (\mathcal{L}\cup \mathcal{R}) = - \frac{g_d}{2\pi^2}\,S \end{equation} where \begin{equation} g_d = a(d) +g_0 +4\pi\,\frac{d-1}{d}\,. \end{equation} Since each of the terms contributing to $g_d$ is itself positive, the mutual complexity is negative and hence the complexity of the TFD state is superadditive. If we evolve the system forward in time with $t_\text{L},\,t_{\text{R}}>0$, then $\mathcal{C}_A(\mathcal{L})$ and $\mathcal{C}_A (\mathcal{R})$ are again invariant while generally $\mathcal{C}_A (\mathcal{L}\cup \mathcal{R})$ increases. A detailed analysis \cite{Carmi:2017jqz} shows that the complexity remains constant up to a critical time, at which point it briefly dips down slightly before beginning to grow linearly. We show in appendix \ref{app:notthesamelabel} that the mutual complexity will remain negative even in this short time period where $\mathcal{C}_A (\mathcal{L}\cup \mathcal{R})$ decreases from its value at $t=0$ and therefore the complexity of the time-evolved TFD state is always superadditive as well. {\bf Subregion-CV2.0:} It is easy to extract the results for the subregion-CV2.0 using eq.~\eqref{cv20main2}. Some results for the bulk portion of the gravitational action appear in eqs.~(2.26), (B.10) and (B.16) of \cite{BrianMixedComplexity}. After accounting for the relevant proportionality factor, we obtain \begin{equation}\label{CV20ref1} C_{V2.0}(\mathcal A) = \frac{2\, V(\mathcal A) L^{d-1}}{d (d-1)G_N} \left(\frac{1}{\delta^{d-1}}-\frac{1}{z_0^{d-1}}\right), \end{equation} for the complexity of the thermal state, and \begin{equation}\label{CV2.0entropy} \begin{split} \Delta C_{V2.0}& =-\frac{16 }{d} \left(\frac1{d-1}+\frac{\pi}{d}\, \cot\frac{\pi}{d}\right)S\,, \end{split} \end{equation} for the mutual complexity. This result for the mutual complexity is once again negative for $d\geq 2$, and this means that the complexity of the TFD state according to the subregion-CV2.0 proposal is again superadditive. We also note that, as with the other proposals, the mutual complexity is proportional to the entropy. \subsection{Complexity of Vacuum Subregions } \label{holosub} Below we summarize the results from all three approaches for a subregion of the CFT vacuum in two dimensions, {\it i.e.,}\ an interval in the boundary of AdS$_3$. These are the holographic results which are most relevant for the comparison with the QFT results in section \ref{apply02}. We also consider a disk-shaped subregion in the CFT vacuum in three dimensions, {\it i.e.,}\ on the boundary of AdS$_4$, to gain some intuition about the behaviour with an odd number of boundary dimensions. The general formulae for an arbitrary $d$ appear in appendix \ref{app:appsubCA4}. {\bf Subregion-CV:} With the subregion-CV approach for the case of AdS$_3$, both in global coordinates and in the Poincar\'e patch, we have \begin{equation}\label{ads3subcv} \text{AdS}_3,\text{G/P}\,:\quad\mathcal{C}_V(\mathcal{A}) = \frac{2c}{3} \left( \frac{\ell}{\delta} -\pi \right) \end{equation} where $c=3L/(2G_\mt{N})$ is the central charge of the two-dimensional boundary CFT \cite{Brown:1986nw}, $\ell$ is the size of the interval and $\delta$ is the UV cutoff. For global coordinates in AdS$_3$, this result comes from \cite{Abt:2017pmf}, and for the Poincar\'e patch, it was found in \cite{Alishahiha:2015rta}. The relevant formulae for the derivation in the Poincar\'e patch are summarized in appendix \ref{app:appsubCA4}, see eq.~\eqref{subCVamazing}. The constant term ({\it i.e.,}\ $-\pi$) is a topological term studied in \cite{Abt:2017pmf}. For a ball-shaped subregion with radius $R$ on the boundary of AdS$_{d+1}$, the calculation of $\mathcal{C}_V$ is outlined in eqs.~(5) and (7) of \cite{Alishahiha:2015rta} --- see also eq.~(4.9) of \cite{Carmi:2016wjl} and our eq.~\eqref{subCVamazing}. For example, for the case of a disk on the boundary of $\text{AdS}_4$, one obtains \begin{equation}\label{ads4subcv} \text{AdS}_4,\text{P}\,:\quad\mathcal{C}_V(\mathcal{A})=\frac{\pi^4 c_T}{3}\left(\frac{ R^2}{2 \delta ^2}-\ln\! \left(\frac{R}{\delta} \right)-\frac{1}{2}\right) \end{equation} where $c_T=3 L^2/(\pi^3 G_\mt{N})$ is the central charge appearing in the OPE of two stress tensors in the boundary theory, {\it e.g.,}\ see \cite{Buchel:2009sk}. {\bf Subregion-CA:} Next, we turn to the subregion-CA results. For the case of a flat boundary (in the Poincar\'e patch), the divergence structure of the subregion complexity in vacuum AdS was studied in \cite{Carmi:2016wjl}. However, these results did not include the boundary counterterms $I_{\text{ct}}$, which restores the reparametrization invariance on the null surfaces. We evaluate the contribution of $I_{\text{ct}}$ in our calculations in appendix \ref{app:appsubCA4}. We have also corrected a number of typos in the original calculation of \cite{Carmi:2016wjl}, and explicitly demonstrated the cancellation of the normalization constants of the null normals. Combining eqs.~\eqref{Ibulksubapp}, \eqref{Isjsubapp} and \eqref{CACAtotapp} for the case of AdS$_3$ yields \begin{align}\label{3P} \text{AdS}_3,\text{P}\,:\quad \mathcal{C}_A(\mathcal{A}) &= \frac{c}{3 \pi^2}\Bigg( \frac{\ell}{2\delta}\ln \left(\frac{\ell_{\text{ct}}}{L} \right) - \ln \left(\frac{2 \ell_{\text{ct}}}{L}\right) \ln \left( \frac{\ell}{\delta}\right) + \frac{\pi^2}{8}\Bigg) \, , \end{align} where $\ell$ is again the size of the boundary interval. Further, we note that the UV divergences were regulated in the above calculation by anchoring the WDW patch at the UV cutoff surface. Repeating these calculations in global coordinates \cite{Chapman:2018bqj,future1}, we find\footnote{We note that this result can be obtained either by anchoring the WDW patch at the cutoff surface, or by anchoring it at the boundary of AdS$_3$ (as in \cite{Chapman:2018bqj}) but adding the usual counterterms of the kind often used in holographic renormalization ({\it e.g.,}\ see \cite{Emparan:1999pm}) on the cutoff surface. We return to the idea of adding holographic counterterms in regulating holographic complexity in \cite{future1}.} \begin{equation}\label{toderive} \text{AdS}_3,\text{G}\,:\quad\mathcal{C}_{A}(\mathcal{A}) = {c\over 3\pi^2}\left( \frac{\ell}{2 \delta}\, \ln\! \left( {\ell_{\text{ct}} \over L} \right) - \ln\!\left(\frac{2\ell_{\text{ct}}}{L}\right) \ln\!\left( \frac{C}{\delta}\right) \right)+f(\ell/C)\,, \end{equation} where $C$ is the circumference of a time slice on the boundary. Here, $f(\ell/C)$ is some finite contribution, whose precise form we did not determine analytically. However, we do know that in the limit $\ell/C\to 0$, eq.~\reef{toderive} should reduce to the previous expression in eq.~\reef{3P} and hence \begin{equation}\label{lim0} \frac{\ell}{C}\ll1\ :\quad f(\ell/C)\simeq {c\over 3\pi^2}\( \ln\!\left(\frac{2\ell_{\text{ct}}}{L}\right) \ln\!\left( \frac{C}{\ell}\right) + \frac{\pi^2}{8}\) + {\cal O}(\ell/C)\,. \end{equation} We return to examine this finite part in more detail in section \ref{holod}. For a disk-shaped region (of radius $R$) on the boundary of AdS$_4$ using Poincar\'e coordinates, we obtain \begin{align}\label{4P} \hspace{-0.4cm} \text{AdS}_4,\text{P}:~\mathcal{C}_A(\mathcal{A})&= \frac{\pi^2 c_T}{12}\Bigg( \frac{ R^2}{\delta^2}\ln\! \left(\frac{2 \ell_{\text{ct}}}{L} \right) - \frac{2 R}{\delta} \ln\! \left(\frac{4 \ell_{\text{ct}}}{L} \right) + 2\ln\frac{R}{\delta} + \ln\! \left(\frac{ \ell_{\text{ct}}}{2L} \right)\Bigg) . \end{align} This calculation can also be seen as the smooth limit of the result obtained in \cite{Caceres:2018luq} for subregions with kinks/corners, {\it i.e.,}\ compare with eq.~(5.8) of \cite{Caceres:2018luq}. {\bf Subregion-CV2.0:} Again, it is straightforward to extract the results for the subregion-CV2.0 proposal using eq.~\eqref{cv20main2}. We have the results for the bulk portion of the gravitational action in eq.~\eqref{Ibulksubapp} for AdS$_3$ in Poincar\'e coordinates ({\it i.e.,}\ $d=2$) and so after accounting for the relevant proportionality factor we obtain \begin{equation} \label{CV203P} \text{AdS}_3,\text{P}\,:\quad \mathcal{C}_{V2.0}(\mathcal{A}) = \frac{4\,c}{3}\left(\frac{\ell}{2\delta}-\ln\frac{\ell}{\delta}-\frac{\pi^2}{8}\right)\,. \end{equation} Further the analogous result for AdS$_3$ in global coordinates \cite{Chapman:2018bqj,future1},\footnote{This result was obtained by anchoring the WDW patch at the cutoff surface, as we will describe in \cite{future1}. The result for another regularization scheme where the WDW patch is anchored at the boundary of AdS$_3$ can be read from eq.~(B.18) of \cite{Chapman:2018bqj} \begin{equation}\label{anotherreg} \text{AdS}_3,\text{G}\,:\quad\mathcal{C}_{V2.0}(\mathcal{A}) =\frac{4}{3}c \left(\frac{\ell}{\delta}-\ln \frac{\ell}{\delta}+\text{finite}\right), \end{equation} where we notice that the leading divergence has changed by a factor of 2, however, the universal logarithmic piece remains unchanged.} \begin{equation} \label{CV203G} \text{AdS}_3,\text{G}\,:\quad\mathcal{C}_{V2.0}(\mathcal{A}) = \frac{4\,c}{3} \left(\frac{\ell}{2\delta}-\ln \frac{C}{\delta}\right)+\tilde f(\ell/C)\,, \end{equation} where $C$ is again the circumference of a time slice on the boundary and $\tilde f(\ell/C)$ is a finite contribution. We return to examine this contribution in more detail in section \ref{holod}. However, let us observe here that in the limit $\ell/C\to 0$, eq.~\reef{CV203G} must reduce to the previous expression in eq.~\reef{CV203P} and hence we expect to find \begin{equation}\label{lim1} \frac{\ell}{C}\ll1\ :\quad \tilde f(\ell/C)\simeq \frac{4\,c}{3} \( \ln\!\left( \frac{C}{\ell}\right) - \frac{\pi^2}{8}\) + {\cal O}(\ell/C)\,. \end{equation} We can also use eq.~\eqref{Ibulksubapp} to evaluate the complexity for a disk-shaped region on the boundary of AdS$_4$ in Poincar\'e coordinates, \begin{equation} \label{CV204P} \text{AdS}_4,\text{P}\,:\quad \mathcal{C}_{V2.0}(\mathcal{A}) = \frac{\pi^4 c_T}{9}\left(\frac{R^2}{\delta^2}-\frac{2R}{\delta}-4 \ln \frac{R}{4 \delta}+1\right)\,. \end{equation} With all three proposals, the leading divergence is proportional to the volume of the boundary region $V(\mathcal{A})$, {\it i.e.,}\ $V(\mathcal{A})=\ell$ with $d=2$ while $V(\mathcal{A})=\pi R^2$ with $d=3$. However, the subleading divergences are quite different for subregion-CV compared to subregion-CA and subregion-CV2.0. With either of the latter two, the subleading contribution is a negative term proportional to the area of the boundary of $\mathcal{A}$, {\it e.g.,}\ $V(\partial\mathcal{A})=2\pi R$ with $d=3$. In contrast, no comparable contribution appears in the subregion-CV results. Similar boundary contributions with a negative sign were found in \cite{Caceres:2018luq} for subregion-CA. Such subleading divergences appear to be a generic feature of both the subregion-CA and subregion-CV2.0 approaches, and can be understood as a contribution to the complexity proportional to the entanglement entropy \cite{AgonCX} -- see also the discussion around eq.~\reef{eq:cvX}. {\bf Mutual Complexity:} Now we can use the previous results together with the results for the complexity of the full boundary time slice to evaluate the mutual complexity. The first observation is that in our examples here, we are considering the vacuum state and subregions of the vacuum for the boundary CFT on a constant time slice. Hence for the CV and subregion-CV proposals, the maximal volume slices also all lie in the constant time slice in the bulk. Hence the two bulk volumes corresponding to a subregion and its complement precisely add up to equal the volume for the full vacuum state. That is, we are in a situation where we saturate the inequality in eq.~\reef{volineqholo} and the mutual complexity vanishes.\footnote{As for the previous discussion of the CV proposal for the TFD state with $t_L=0=t_R$.} Of course, if we choose to examine the vacuum state on a more general Cauchy slice in the boundary, we expect the mutual complexity to be negative, {\it i.e.,}\ the complexity would be superadditive. It would be interesting to understand the precise form of $\Delta\mathcal{C}_V$ in these situations. The results are more interesting for the CA and CV2.0 proposals. Here we will focus our discussion on the case of a flat boundary, {\it i.e.,}\ with Poincar\'e coordinates in the bulk, since they are easily generalized to higher dimensions. We illustrate the discussion with the example of AdS$_4$, where we begin by evaluating the complexity of the full vacuum state, using eqs.~\eqref{eq:Cafullappd} and \eqref{eq:Ibulkfs}, \begin{eqnarray} \label{D4P} \text{AdS}_4,\text{P}\,:\qquad\mathcal{C}_A(\text{vac})&=& \frac{\pi\, c_T}{12}\frac{V(\Sigma)}{\delta^2}\,\ln\! \frac{2 \ell_{\text{ct}}}{L} \,, \nonumber\\ \text{AdS}_4,\text{P}\,:\quad \mathcal{C}_{V2.0}(\text{vac}) &=& \frac{\pi^3 c_T}{9}\frac{V(\Sigma)}{\delta^2}\,, \label{full4P} \end{eqnarray} where $V(\Sigma)$ is the spatial volume of the entire time slice in the boundary.\footnote{In fact, the time slice is two-dimensional and so $V(\Sigma)$ is an area in this specific example.} Next, we gave the results for a disk-shaped region in eqs.~\reef{4P} and \reef{CV204P} for the subregion-CA and subregion-CV2.0, respectively, which we re-express here as \begin{eqnarray} \text{AdS}_4,\text{P}\,:\qquad\mathcal{C}_A(\mathcal{A})&=& \frac{\pi\, c_T}{12}\left( \frac{ {V}(\mathcal{A})}{\delta^2}\,\ln\! \left(\frac{2 \ell_{\text{ct}}}{L} \right) - \frac{{V}(\partial\mathcal{A})}{\delta} \ln \left(\frac{4 \ell_{\text{ct}}}{L} \right) + 2\pi\,\ln\frac{L}{\delta} + \text{finite}\, \right)\,, \nonumber\\ \text{AdS}_4,\text{P}\,:\quad \mathcal{C}_{V2.0}(\mathcal{A}) &=& \frac{\pi^3 c_T}{9}\left(\frac{{V}(\mathcal{A})}{\delta^2}-\frac{{V}(\partial\mathcal{A})}{\delta}-4\pi\, \ln \frac{L}{\delta}+\text{finite}\, \right)\,, \label{A4P} \end{eqnarray} where $V(\mathcal{A})=\pi R^2$ is the area of the disk and $V(\partial\mathcal{A})=2\pi R$ is the circumference of the boundary of the disk. This leaves us to evaluate the complexity of the exterior of the disk, which we denote $\mathcal{B}$. While this calculation may seem more formidable because $\mathcal{B}$ has an infinite extent in this flat boundary geometry, the geometric interpretation of the two leading singularities would be precisely as in eq.~\reef{A4P}. Further, we would have $V(\mathcal{A})+V(\mathcal{B})=V(\Sigma)$ and $V(\partial\mathcal{A})=V(\partial\mathcal{B})$ and hence the mutual complexity becomes \begin{eqnarray} \text{AdS}_4,\text{P}\,:\qquad\Delta\mathcal{C}_A&=&- \frac{\pi\, c_T}{6}\,\ln \left(\frac{4 \ell_{\text{ct}}}{L} \right) \, \frac{{V}(\partial\mathcal{A})}{\delta} + \cdots \,, \nonumber\\ \text{AdS}_4,\text{P}\,:\quad \Delta\mathcal{C}_{V2.0} &=&- \frac{2\pi^3 c_T}{9}\,\frac{{V}(\partial\mathcal{A})}{\delta}+\cdots\,. \label{mut4P} \end{eqnarray} In fact, this result can be extended to any (smooth) bipartition of the two-dimensional time slice in the boundary theory, and $V(\partial\mathcal{A})$ will denote the length of the boundary between the subregion $\mathcal{A}$ and its complement $\mathcal{B}$. Given the sign of the results above, we see that the complexity of the vacuum is superadditive for both the subregion-CA and subregion-CV2.0 approaches. We might also note that the leading singularity in eq.~\reef{mut4P} has the same form as that in the entanglement entropy for the same bipartition. Hence, at least to leading order here, the mutual complexity is again proportional to the entanglement entropy between the two subregions. Using the results of appendix \ref{app:appsubCA4} and of \cite{Carmi:2016wjl}, these calculations are easily extended to higher dimensions, where we find for $d>2$ \begin{eqnarray} \label{deltaC-subregion} \text{AdS}_{d+1},\text{P}\,:\qquad\Delta\mathcal{C}_A&=&-\frac{L^{d-1}}{2\pi^2 (d-2) G_N}\, \ln\! \left(\frac{2(d-1)\ell_{\text{ct}}}{L}\right)\,\frac{{V}(\partial\mathcal{A})}{\delta^{d-2}}+\cdots\,, \nonumber\\ \text{AdS}_{d+1},\text{P}\,:\quad \Delta\mathcal{C}_{V2.0} &=&- \frac{4L^{d-1}}{ d(d-1)(d-2)G_N }\,\frac{{V}(\partial\mathcal{A})}{\delta^{d-2}}+\cdots\,. \label{mutdP} \end{eqnarray} Of course, using our previous results for subregions on the boundary of AdS$_3$, these calculations are easily extended to $d=2$. In this case, we find that the mutual complexity becomes \begin{equation} \begin{split} \text{AdS}_3,\text{P}\,:\qquad\Delta\mathcal{C}_A=&\,-\frac{2\,c}{3\pi^2 }\, \ln\! \left(\frac{2\ell_{\text{ct}}}{L}\right)\,\ln\frac{\ell}{\delta}+\cdots\,,\\ \text{AdS}_3,\text{P}\,:\quad \Delta\mathcal{C}_{V2.0}=&\,- \frac{8\,c}{ 3}\,\ln\frac{\ell}{\delta}+\cdots\,. \label{holomutualcomp} \end{split} \end{equation} Hence these general results again show that the mutual complexity is negative and hence that the complexity of the vacuum state is superadditive. We may also note that to leading order, the mutual complexity is proportional to the entanglement entropy of the subregions. \subsection{Subregion-CV} Here we summarize the results of \cite{Alishahiha:2015rta} (see eq.~(5)-(7)) as well as \cite{Carmi:2016wjl} (see eq.~(4.9)) for the subregion complexity using the CV conjecture for a ball shaped region on the boundary of AdS$_{d+1}$ in Poincar\'e coordinates. The bulk spacetime is described by the metric \begin{equation} ds^2 = \frac{L^2}{z^2}\left[dz^2 - dt^2 +d \rho^2 +\rho^2 d \Omega_{d-2}^2 \right]. \end{equation} For a ball-shaped region on a constant time slice with $\rho\le R$, the complexity is given by performing the following integral \begin{equation}\label{subCVamazing} C_V = \frac{L^{d-1}\Omega_{d-2}}{(d-1) G_N} \int_\delta^R dz \frac{(R^2-z^2)^{\frac{d-1}{2}}}{z^d} \end{equation} where $\Omega_{d-2}=2 \pi^{\frac{d-1}{2}}/\Gamma\left(\frac{d-1}{2}\right)$ is the volume of the $S^{d-2}$ sphere and $R$ is the radius of the ball (or half the size of the interval for a two dimensional boundary). The explicit results of this integration for $d=2$ (AdS$_3$) and $d=3$ (AdS$_4$) are presented in the main text in eqs.~\eqref{ads3subcv} and \eqref{ads4subcv}. \subsection{Subregion-CA} The form of the intersection $\widetilde W$ between the WDW patch (starting at the cutoff surface) and the entanglement wedge is illustrated in figure \ref{fig:calV}, together with its projection on the $t=0$ time slice, where we label the various surfaces and joints required for the calculation. The region $\widetilde W$ is bounded by four surfaces. $S^{\pm}$ are the boundaries of the WDW patch and $C^{\pm}$ are the boundaries of the entanglement wedge. They are described by the following constraints \begin{equation}\label{surfsurf} S^{\pm}: \quad t= \pm (z-\delta), \qquad C^{\pm}:\quad t=\pm (R-\sqrt{\rho^2+z^2}), \end{equation} where $R$ is the radius of the ball shaped subregion for which we evaluate the complexity. The affinely parameterized normals to the various surfaces are\footnote{Here we chose the direction such that the normal vectors are future oriented, in order to be consistent with the conventions of appendix C of \cite{Lehner:2016vdi} which we use throughout the following.} \begin{equation}\label{normalsnormals} S^{\pm}: \quad k_{1,2}= \alpha (-dt \pm dz), \qquad C^{\pm}: \quad k_{3,4}= \beta \left(-dt\mp \frac{\rho d\rho +z dz}{\sqrt{\rho^2+z^2}}\right). \end{equation} \begin{figure}[!ht] \centering \includegraphics[height=3in]{figures/subWDW}\hspace{2cm} \includegraphics[height=3in]{figures/subWDWtopc} \caption{The intersection of the entanglement wedge and the WDW patch defines the region $\mathcal{\widetilde{W}}$ that is relevant for the evaluation of $\mathcal{C}_A(B)$.}\label{fig:calV} \end{figure} The subregion-CA conjecture consists of evaluating the gravitational action of the region $\widetilde W$. When the normals to the null surfaces are affinely parametrized the relevant contributions are: the bulk contribution $I_{\text{bulk}}$, the joints $J^{(1)}$, $J^{(2)}$ and (twice) $J^{(3)}$ (see figure \ref{fig:calV}), whose contributions we label $I^{(1)}$, $I^{(2)}$ and $I^{(3)}$, respectively, and finally the counterterm contribution required to render the result independent of the normalization constants $\alpha$ and $\beta$. This counterterm was first presented in appendix B of \cite{Lehner:2016vdi} and it reads \begin{equation}\label{eq:ct} I_{\text{ct}}=-\frac{1}{8 \pi G_\mt{N}}\int d \lambda \, d^{d-1}x \sqrt{\gamma} \, \Theta \ln \left( \ell_{\text{ct}} |\Theta| \right), \end{equation} where the expansion parameter is $\Theta=\partial_\lambda \ln \sqrt {\gamma}$, $\gamma$ is the metric on the light surface modulo light rays and $\ell_{\text{ct}}$ is an arbitrary constant representing the freedom in the definition of this counter term. The parameter $\lambda$ runs along the null generators of the light surface and has to be defined such that it matches our definition of the normal vectors $k^\mu = d x^\mu/ d\lambda$. Since the boundary of the entanglement wedge is a killing horizon with vanishing expansion \cite{Casini:2011kv,Faulkner:2013ica} we only have to include the counter term on the boundaries of the WDW patch $S^{\pm}$. Finally the complexity is given by \begin{equation} \mathcal{C}_A (B) = \frac{1}{\pi} \left(I_{\text{bulk}}+I^{(1)}+I^{(2)} + 2I^{(3)}+2 I_{\text{ct}} \right). \end{equation} Most of the contributions above were already evaluated in \cite{Lehner:2016vdi} and we quote the results here (fixing a few small typos). For the bulk contribution we have \begin{equation}\label{Ibulksubapp} I_{\text{bulk}}=-\frac{d\, \Omega_{d-2} L^{d-1}}{4 \pi G_\mt{N}} \int_0^{\frac{R-\delta}{2}} dt \int_{t+\delta}^{R-t} \frac{dz}{z^{d+1}}\frac{((R-t)^2-z^2)^{\frac{d-1}{2}}}{d-1}. \end{equation} For the various joints we have\footnote{We have fixed the following factors: overall factor of $R$ in $I^{(2)}$ was missing, upper limit of integration in $I^{(3)}$ was changed to $\frac{R+\delta}{2}$.} \begin{equation} \begin{split} I^{(1)} = & \, - \frac{ \Omega_{d-2} L^{d-1}}{4 \pi(d-1) G_\mt{N}} \frac{(R^2-\delta^2)^{\frac{d-1}{2}}}{\delta^{d-1}} \ln\left(\frac{\alpha \delta}{L}\right), \\ I^{(2)} = & \, -\frac{L^{d-1} \Omega_{d-2} }{4 \pi G_\mt{N}} \int_\delta^R \frac{dz}{z^{d-1}} R (R^2-z^2)^{\frac{d-3}{2}}\ln\left(\frac{\beta z}{L}\right), \\ I^{(3)} = & \, \frac{L^{d-1} \Omega_{d-2} }{8 \pi G_\mt{N}} \int_\delta^{\frac{R+\delta}{2}} \frac{d\bar z}{\bar z^{d-1}} (R+\delta)^{\frac{d-1}{2}} (R+\delta-2 \bar z)^{\frac{d-3}{2}} \ln\left(\frac{\alpha \beta \bar z^2 (R+\delta)}{2 L^2 (R+\delta-\bar z)}\right), \end{split} \end{equation} where in $I^{(3)}$ we have relabeled the integration variable as $\bar z$ for reasons that will become clear in a moment. Recall that the boundaries of the WDW patch had vanishing expansion and so no counterterm was needed in order to cancel the dependence on the normalization constant $\beta$. To make this observation manifest let us use the following change of variables \begin{equation}\label{zzbar} \bar z = \frac{z (R+\delta)}{R+z}, \qquad z=\frac{R\, \bar z}{R+\delta-\bar z}\,, \end{equation} which relabels the various points on the joint $J^{(3)}$ by the corresponding value of $z$ on the joint $J^{(2)}$ along the same light ray originating from the point $z=\rho=0$, $t=R$. After this change of variables we are able to combine the contributions of the joints $J^{(2)}$ and $J^{(3)}$ as follows \begin{equation} I^{(2)}+2 I^{(3)} = \frac{L^{d-1} \Omega_{d-2}}{4 \pi G_\mt{N}} \int_\delta^R \frac{dz}{z^{d-1}} R\, (R^2- z^2)^{\frac{d-3}{2}} \ln\left(\frac{\alpha z (R+\delta)^2}{2(R+z) L R}\right), \end{equation} where we see explicitly that all the dependence on $\beta$ canceled out. Next, we evaluate the contribution of the counterterm. For this purpose, we first identify the light-ray parameter $\lambda=-L^2/\alpha z$ which is consistent with the normal definition $k_1^{\mu} = dx^\mu/d\lambda$, see eq.~\eqref{normalsnormals}, along the surface $S^+$, see eq.~\eqref{surfsurf}. We then evaluate the expansion \begin{equation} \Theta = \partial_\lambda \ln\sqrt{\gamma} = -\frac{\alpha (d-1) z}{L^2}. \end{equation} Finally the counter term contribution reads \begin{equation} I_{\text{ct}} = \frac{\Omega_{d-2}L^{d-1}}{8 \pi G_\mt{N}} \int_\delta^{\frac{R+\delta}{2}} \frac{d \bar z}{\bar z^d} (R+\delta)^{\frac{d-1}{2}}(R+\delta-2 \bar z)^{\frac{d-1}{2}} \ln\(\frac{\ell_{\text{ct}}\,\alpha (d-1)\bar z}{L^2}\). \end{equation} Once again, it will be useful to use the change of coordinates \eqref{zzbar}, which brings this contribution to the form \begin{equation}\label{thecounterterm2} I_{\text{ct}} = \frac{\Omega_{d-2}L^{d-1}}{8 \pi G_\mt{N}} \int_\delta^{R} \frac{d z}{ z^d} R\, (R+z)^{\frac{d-3}{2}}(R- z)^{\frac{d-1}{2}} \ln\left(\frac{\ell_{\text{ct}}\,\alpha (d-1) z (R+\delta)}{L^2(R+z)}\right). \end{equation} Combining all the joints and the counter term and using integration by parts together with the identity $\int\frac{dz}{z^d}R^2 (R^2-z^2)^{\frac{d-3}{2}} = -\frac{1}{z^{d-1}}\frac{(R^2-z^2)^{\frac{d-1}{2}}}{d-1}$ finally yields \begin{equation} \begin{split}\label{Isjsubapp} I_{\text{s,j,ct}} &\equiv 2 I_{\text{ct}}+I^{(1)}+I^{(2)}+ 2 I^{(3)} = \frac{\Omega_{d-2}L^{d-1}}{4 \pi G_\mt{N}} \int_\delta^R dz \frac{R\left(R^2 -z^2\right)^{\frac{d-3}{2}}}{z^{d-1}} \times \\ &~~~~~~~~~~~~~~~~~~~~~~~~~~~\times \left[\frac{\left(R -z\right) }{z } \left[\frac{1}{(d-1)}+\ln \left(\frac{\ell_{\text{ct}}(d-1)}{L}\right)\right] + \ln\left(\frac{R+\delta}{2 R}\right)\right], \end{split} \end{equation} and we see that all the dependence on $\alpha$ has canceled. The final result for the complexity is then given by combining eqs.~\eqref{Ibulksubapp} and \eqref{Isjsubapp}, {\it i.e.,}\ \begin{equation}\label{CACAtotapp} \mathcal{C}_A =\frac{1}{\pi}\left( I_{\text{bulk}}+I_{\text{s,j,ct}}\right). \end{equation} We evaluated this expression explicitly for the cases of $d=2$ and $d=3$ and the final results are given by eqs.~\eqref{3P} and \eqref{4P}. \subsection{Full state CA in the Poincar\'e patch} For completeness, we also include the counter term contribution $I_{\text{ct}}$ in the full state CA calculation in the Poincar\'e patch of AdS$_{d+1}$. The other contributions to the full-state CA calculation appear in \cite{Carmi:2016wjl} and we review them below. The WDW patch starts at the cutoff surface $z=\delta$ and we use an IR regulator $\rho=\rho_{\text{max}}$ all the way through the bulk, see figure \ref{fig:calAfull}. \begin{figure}[!ht] \centering \includegraphics[height=3in]{figures/WDWfull} \caption{The WDW patch relevant for the evaluation of $\mathcal{C}_A$ of the full region in the poincar\'e patch of AdS$_{d+1}$. We introduce an IR regulator $\rho_{\text{max}}$ in order to obtain a finite answer.}\label{fig:calAfull} \end{figure} We start with the bulk contribution \begin{equation} \begin{split}\label{eq:Ibulkfs} I_{\text{bulk}}&=-\frac{d\, L^{d-1}\,\Omega_{d-2}}{4 \pi G_N}\int_\delta ^\infty \frac{dz}{z^{d+1}}\int_0^{z-\delta} dt \int_0^{\rho_{\text{max}}} d\rho \,\rho^{d-2}\\ &=-\frac{ L^{d-1}\,\,\Omega_{d-2} }{4 \pi G_N}\frac{\rho_{\text{max}}^{d-1}}{(d-1)^2} \frac{1}{\delta^{d-1}}\,. \end{split} \end{equation} Next we consider the joint $J^{(1)}$, see figure \ref{fig:calAfull}, whose contribution reads \begin{equation} \begin{split} I^{(1)} &= - \frac{ L^{d-1} \, \Omega_{d-2}}{4 \pi G_N (d-1)}\, \frac{\rho_{\text{max}}^{d-1}}{\delta^{d-1}}\, \ln\left(\frac{\alpha \delta}{L}\right)\label{eq:Ijfs}. \end{split} \end{equation} Finally we include the counter term \eqref{eq:ct}\footnote{The surfaces $S^{\pm}$ only contribute the counter term since we chose their normals to be affinely parametrized.} \begin{equation} \begin{split}\label{eq:Ictfs} I_{\text{ct}}&=\frac{L^{d-1}\Omega_{d-2}}{8\,\pi\, G_N} \rho_{\text{max}}^{d-1}\,\int_\delta^\infty \frac{dz}{z^d}\, \,\ln\left(\frac{\ell_{\text{ct}} (d-1) \alpha}{L^2}\, z\right) \\ &=\frac{L^{d-1}\Omega_{d-2}}{8\,\pi\, G_N}\, \rho_{\text{max}}^{d-1}\frac{1}{(d-1)}\,\,\frac{1}{\delta^{d-1}}\left[\ln\left(\frac{\ell_{\text{ct}}(d-1)\,\alpha\,\delta}{L^2}\right)+ \frac{1}{d-1}\right]\,. \end{split} \end{equation} Adding the bulk, joint and counterterm contributions in eqs.~\eqref{eq:Ibulkfs}-\eqref{eq:Ictfs}, we obtain \begin{equation} \begin{split}\label{eq:Cafullappd} \mathcal{C}_A&= \frac{1}{\pi}\,(\, I_{\text{bulk}} + 2 I_{\text{ct}} + I^{(1)}) =\frac{L^{d-1}\Omega_{d-2}}{4\,\pi ^2 (d-1)\, G_N}\,\,\frac{\rho_{\text{max}}^{d-1}}{\delta^{d-1}}\,\ln\left(\frac{\ell_{\text{ct}}(d-1)}{L}\right). \end{split} \end{equation} \subsection{Complexity of Pure Gaussian States}\label{subsec:compure} The authors of \cite{qft1} proposed a framework for evaluating the complexity of Gaussian states of bosonic field theories. The idea was to discretize the field theory on a spatial lattice such that one obtains a chain of coupled harmonic oscillators with position operators $\hat x_a$ and momentum operators $\hat p_b$ satisfying usual commutation relations $[\hat x_a,\hat p_b]=i \delta_{ab}$, where $a,b=1,\ldots,N$ indicate the positions on the lattice. The wavefunction of a pure Gaussian state with vanishing first moments ({\it i.e.,}\ $\langle \hat x_a\rangle = 0=\langle \hat p_a\rangle$) which will serve as our target state takes the following form in the position-space representation \begin{equation}\label{wavematrix} \langle x_a | \psi_\mt{T} \rangle \equiv \psi_\mt{T}(x_a) = {\cal N}_{\mt{T}} \exp \left[-\frac{1}{2}\sum_{a,b=1}^{N} M^{ab}_\mt{T}\, x_a\, x_b \right]. \end{equation} The normalization constant is given by ${{\cal N}_{\mt{T}}}^4 = {\rm det}\left(\frac{M_T}{\pi}\right)$. For simplicity, we will focus on cases where the matrix $M^{ab}$ is real (and of course, symmetric).\footnote{We will describe below how to evaluate the complexity of such states according to \cite{qft1}. For cases where $M^{ab}$ is complex, a more general treatment is needed where the $GL(N,\mathbb{R})$ group of gates, appearing below in eq.~\reef{gates}, must be extended to $Sp(2N,\mathbb{R})$, {\it e.g.,}\ see \cite{Chapman:2018hou}.} The matrix $M^{ab}$ can be diagonalized by an orthogonal transformation in terms of a set of ``normal mode'' coordinates $\tilde x_k$ and characteristic frequencies $\omega_k$\footnote{In the following, we are taking the normal modes $\tilde{x}_k$ to be real linear combinations of the position basis modes $x_a$. Later we will find that for applications in QFT it is easier to consider complex normal modes $x_k$ (see, {\it e.g.,}\ eqs.~\eqref{Thefreq} and \eqref{eq:Fourier}). In this case we should replace $\tilde{x}_k^2 \to |x_k|^2$ in eq.~\eqref{TargetGaussianPure}.} \begin{equation}\label{TargetGaussianPure} \langle \tilde x_k | \psi_\mt{T} \rangle =\psi_\mt{T}(\tilde x_k) = {\cal N}_{\mt{T}} \exp \left[-\frac{1}{2}\sum_{k=1}^{N} \omega_k \,\tilde x_k^2 \right]. \end{equation} The latter can be viewed as the Gaussian wavefunction \begin{equation}\label{Odiag} \psi_\mt{T}(\tilde x_k) = {\cal N}_{\mt{T}}\exp \left[-\frac{1}{2}\sum_{k,k'=1}^{N} \tilde M^{k k'}_\mt{T}\, \tilde x_k\, \tilde x_{k'} \right]\quad{\rm with}\quad \tilde M_\mt{T} = O^T M_\mt{T}\, O = \text{diag}(\omega_1, \cdots, \omega_N)\,, \end{equation} and where the orthogonal matrix $O$ produces the change of basis $x_a = O_a{}^k \tilde x_k$ which diagonalizes the matrix $M_\mt{T}$. As an example, one might think of the ground state of a chain of coupled harmonic oscillators with normal mode frequencies $\omega_k$, where the mass of the harmonic oscillators has been set to one. In fact, to be consistent with dimensional analysis, we have assumed that all the equations above also contain a characteristic mass which we will set to one from now on. A natural reference state is the factorized Gaussian state\footnote{The normalization constant of the reference state is given by ${\cal N}_{\mt{R}}^4 = {\rm det} \left( \frac{M_R}{\pi}\right)= \left(\frac{\mu}{\pi}\right)^N $.} \begin{equation}\label{ref_stateO} \langle x_a | \psi_\mt{R} \rangle \equiv \psi_\mt{R}(x_a) = {\cal N}_{\mt{R}} \exp \left[-\frac{1}{2}\sum_{a=1}^{N} \mu \, x_a^2 \right]\,, \end{equation} where the degrees of freedom are completely disentangled in the position basis. Note that we are choosing the same reference frequency $\mu$ for each $x_a$ so that the degrees of freedom are all on the same footing, {\it i.e.,}\ \begin{equation} M_\mt{R}=\mu\ \text{diag}(1,1, \cdots,1). \end{equation} Hence for the example of a chain of oscillators, the reference state is translation invariant.\footnote{Similarly, the ground state of any translation invariant Hamiltonian will be translation invariant. This would be reflected in the entries of the parameter matrix $M_{ab}$ in eq.~\eqref{wavematrix} which will be a function of $a-b$.} With this simple reference state, the change of basis introduced in eq.~\reef{Odiag} yields \begin{equation}\label{ref_state} \langle \tilde x_k | \psi_\mt{R} \rangle= \psi_\mt{R}(\tilde x_k) = {\cal N}_{\mt{R}} \exp \left[-\frac{1}{2}\sum_{k=1}^{N} \mu \,\tilde x_k^2 \right]\,. \end{equation} That is, in the diagonal basis, the reference state remains a factorized Gaussian with $\tilde M_\mt{R}=M_\mt{R}$. Now, the target state \reef{TargetGaussianPure} can be produced by acting with a unitary transformation on this reference state \reef{ref_state}, {\it i.e.,}\ $\ket{\psi_\mt{T}}= U_\mt{TR}\, \ket{\psi_\mt{R}}$ where $U_\mt{TR}$ is constructed as a string of fundamental gates, \begin{equation} g_{ab}= e^{i\frac{\varepsilon}{2} (\hat x_a \hat p_b + \hat p_b \hat x_a)}\,.\label{gates} \end{equation} These gates produce a $GL(N,\mathbb{R})$ group of transformations. Those with $a\ne b$ introduce entanglement between the different oscillators, while with $a=b$, the gates scale the coefficients of the corresponding coordinate -- see \cite{qft1} for further details. Generally, there will be an infinite number of such ``circuits," {\it i.e.,}\ sequences of fundamental gates, which will accomplish the desired transformation. The complexity is defined as the minimum number of gates needed to construct the desired target state \reef{TargetGaussianPure} from the reference state \reef{ref_state}. To identify the optimal circuit, Nielsen and his collaborators \cite{nielsen2006quantum,nielsen2008,Nielsen:2006} developed a geometric method, which was adapted to evaluate the complexity of QFT states in \cite{qft1}. This construction is based on a continuum representation of the unitary transformations \begin{equation}\label{unitaries} U(\sigma) = \cev{\mathcal{P}}\, \exp \!\[ -i \int^\sigma_0\!\!\! d s\, \mathcal{H}( s)\], \quad \text{where} \quad \mathcal{H}(s)= \sum_I Y^I(s)\,\mathcal{O}_I \end{equation} where $s$ parametrizes the circuit and $\cev{\mathcal{P}} $ signifies a path ordering along $s$ from right to left. The ``Hamiltonian" $\mathcal{H}(s)$ is constructed from the (Hermitian) generators $\mathcal{O}_I$ of the fundamental gates, {\it e.g.,}\ $\mathcal{O}_{ab}=-\frac12(\hat x_a \hat p_b + \hat p_b \hat x_a)$ in eq.~\reef{gates}. The coefficients $Y^I(s)$ are control functions specifying which gates (and how many times they) are applied at any particular point $s$ in the circuit. In eq.~\reef{unitaries}, we have actually specified a path $U(\sigma)$ through the space of unitaries, or through the space of states with $\ket{\psi(\sigma)}=U(\sigma)\ket{\psi_\mt{R}}$. We then fix the boundary conditions for the circuits of interest, with $0\le\sigma\le1$, as \begin{equation} U(\sigma=0)= \mathbbm{1}\,, \qquad U(\sigma=1)= U_\mt{TR}\,, \end{equation} where $U_\mt{TR}$ is the desired unitary producing $\ket{\psi_\mt{T}}= U_\mt{TR}\, \ket{\psi_\mt{R}}$. From this perspective, the $Y^I(s)$ can also be interpreted as the components of the tangent vector to this trajectory. Nielsen's approach identifies the optimal circuit by minimizing the cost defined as \begin{equation}\label{gen-cost} \mathcal{D}(U(\sigma))\equiv \int^1_0 ds ~ F \( U(s), Y^I(s) \), \end{equation} where $F$ is a local functional of the position $U(s)$ and the tangent vector $Y^I(s)$ along the trajectory.\footnote{When this functional only depends on $Y^I(s)$ as in eq.~\reef{func2}, the cost (and the underlying geometry) is right invariant, {\it e.g.,}\ \cite{Brown:2016wib,Brown:2017jil}.} Two simple examples of such cost functions are \begin{equation}\label{func2} F_1(U,Y)=\sum_I \left|Y^I\right|~,\qquad\qquad F_2(U,Y)=\sqrt{\sum_I \(Y^I\)^2}~. \end{equation} With the $F_2$ measure, the cost \reef{gen-cost} is simply the proper distance in a Riemannian geometry, and hence identifying the optimal circuit is equivalent to finding the shortest geodesic connecting the reference and target states in this geometry. With the $F_1$ measure, the cost essentially counts the number of gates, and so this choice comes closest to the original concept of complexity. However, in contrast with the $F_2$ measure, a disadvantage of the $F_1$ cost function is that it is not ``covariant", {\it i.e.,}\ the corresponding complexity $\mathcal{C}_1$ depends on the choice of the basis for the generators $\mathcal{O}_I$.\footnote{In~\cite{Fermions1,coherent}, a basis-independent alternative was proposed using the Schatten norm. For Gaussian states with vanishing first moments, {\it i.e.,}\ $\langle x_a\rangle = 0=\langle p_a\rangle$, the complexity found using the ($p=1$) Schatten cost function is identical with ${\cal C}_1$, as shown in eq.~\reef{complexity_pure}. However, we note that this Schatten complexity does not yield the desired complexity of formation for the TFD states studied in \cite{Chapman:2018hou}.} However, the structure of the UV divergences for the $\mathcal{C}_1$ complexity was found to be similar to that for holographic complexity \cite{qft1,qft2}. Further, the basis dependence played an important role in \cite{Chapman:2018hou}, which studied the complexity of thermofield double (TFD) states for a free scalar. In particular, the complexity of formation was found to match that for holographic systems \cite{Chapman:2016hwi}, {\it i.e.,}\ $\widetilde{\Delta\mathcal{C}}_{\text{formation}} \propto S_\mt{th}$ in the massless limit,\footnote{Here, $S_\mt{th}$ is the thermal entropy of the thermal mixed state living on either side of the TFD, or equivalently the entanglement entropy between the two copies of the field theory.} when the gates were chosen to act on the physical degrees of freedom corresponding to the two separate copies of the field theory, {\it i.e.,}\ the Left-Right basis \cite{Chapman:2018hou}. In contrast, if the basis of gates were chosen to act on the diagonal modes (with which the TFD state could be expressed as a simple product state), the $\mathcal{C}_1$ complexity produced $\widetilde{\Delta\mathcal{C}}_{\text{formation}} \simeq 0$ to leading order. We reviewed the results above to motivate that in this paper, we will focus entirely on studying the purification complexity of mixed states using the $F_1$ measure. Further, we will test the sensitivity of our $\mathcal{C}_1$ complexity to the choice of basis. In particular, in each case, we will examine the results for the physical basis and the diagonal basis. As a further review of key results, let us add the following: For a broad variety of cost functions including those in eq.~\reef{func2}, the optimal circuit taking eq.~\reef{ref_state} to eq.~\reef{TargetGaussianPure} is simply a straight-line path which only applies the scaling gates \reef{gates} (with $a=b$) to each of the corresponding normal modes $\tilde x_k$ \cite{qft1}. In fact, \cite{qft1} recasts the discussion of circuits in terms of a matrix representation. In particular, the trajectory through the space of states is described by \begin{equation} \tilde{M}(\sigma)=U(\sigma)\, \tilde M_\mt{R}\, U^T(\sigma)\,, \end{equation} where the $\tilde M^{ab}$ define Gaussian wavefunctions in terms of the normal modes, as in eq.~\reef{Odiag}. For the case in hand, the optimal trajectory is simply \begin{equation}\label{Hgen} U(\sigma) = e^{\tilde H \sigma}, \qquad {\rm with}\quad \tilde H =\frac{1}{2}\, \text{diag}\!\left(\ln(\omega_1/\mu), \cdots, \ln(\omega_N/\mu) \right)\,. \end{equation} For this linear trajectory, the complexity is given in terms of the elements of $\tilde H$, and in particular, the $\mathcal{C}_1$ complexity becomes \begin{equation}\label{complexity_pure} \begin{split} \mathcal{C}_{1}^{\mt{diag}} & = \frac 12\, \sum_{k=1}^N \left|\ln \frac{\omega_k}{\mu}\right| \,. \end{split} \end{equation} We make repeated use of this result in the following and so the interested reader is invited to see \cite{qft1} for a detailed derivation. As we noted above, the $\mathcal{C}_1$ complexity is sensitive to the choice of basis for the gates (or generators), and the superscript `diag' above is added to indicate that the complexity was evaluated using gates acting on the normal-mode coordinates $\tilde x_k$. However, as noted in the previous discussion, it is interesting to consider different choices of basis in certain cases. This is simply done by rotating the generator $\tilde H$ to the relevant basis and summing over (the absolute values of) its elements \begin{equation}\label{rotate2pos} H = O\, \tilde H\, O^T\qquad{\rm and}\qquad \mathcal{C}_1 = \sum_{a,b=1}^N |H^{ab}|\,. \end{equation} Implicitly, we have assumed here that the straight-line circuit \eqref{Hgen} remains optimal in the new basis. However, in general (and for our examples below), it is difficult to prove that this simple trajectory is still optimal. Nevertheless, evaluating the cost of the trajectory \eqref{Hgen} provides a bound on the $\mathcal{C}_1$ complexity for the new basis. In examining mixed state complexity below, we will consider the {\bf physical basis} which distinguishes between the two classes of oscillators in purifications of a mixed state, {\it i.e.,}\ the original physical oscillators and the auxiliary degrees of freedom. We will indicate when our calculations refer to this basis by using the superscript `phys'. More details on different interesting bases and the distinction between them can be found in section~\ref{subsec3phys} and appendix~\ref{app:4HO}. In closing here, let us add that an alternative approach to the complexity of QFT states based on the Fubini-Study metric was developed in \cite{qft2}. For Gaussian states with vanishing first moments and an appropriate definition of the measure, this alternative approach produces precisely the same complexity as in eq.~\reef{complexity_pure}. Hence we expect that many of our results for the purification complexity of mixed states in the following can be easily extended to the Fubini-Study approach. \subsection{Gaussian Purifications of One-Mode Mixed States}\label{sec:onemodepuri} Turning to the purification complexity of mixed states, we begin by considering Gaussian density matrices for a single oscillator and explore their purifications. Consider a single harmonic oscillator in a mixed state $\hat \rho$, such that \begin{equation}\label{dense1} \rho(x,x')\equiv \bra{x} \hat \rho \ket{x'} = \left(\frac{a-b}\pi\right)^{1/2}\, e^{-\frac{1}{2} \left( a x^2 + a x'^2 - 2 b x x' \right) } \end{equation} where we will assume that $a$ and $b$ are real. Note that this is compatible with $\rho$ being a Hermitian operator, {\it i.e.,}\ $\rho^\dagger=\rho$ or $\rho^*(x',x)=\rho(x,x')$. The overall normalization constant was chosen to ensure ${\rm Tr}[\rho]=\int dx\, \rho(x,x)=1$. In order for the Gaussian integral in this norm to be well defined, we need $a>b$. Further, in order that the density matrix be positive semi-definite ({\it i.e.,}\ $\bra{\psi} \hat{\rho} \ket{\psi}\geqslant 0$ for arbitrary wavefunctions $\psi(x)$) we should require that $b\geqslant 0$.\footnote{Since probabilities are all either zero or positive, the density matrix is positive semidefinite, {\it e.g.,}\ see section III of \cite{mann1993gaussian}. We will see below that $b\geqslant 0$ ensures that the purifying wavefunction also has real parameters.} Next, we consider purifications of the density matrix \eqref{dense1} by pure Gaussian states with two degrees of freedom \begin{equation}\label{wfunction1} \psi_{12}(x,y)\equiv \braket{x,y}{\psi} = \left(\frac{\omega_1\omega_2-k^2}{\pi^2}\right)^{1/4} e^{-\frac{1}{2}\left(\omega_1 x^2 + \omega_2 y^2 + 2 k\, xy \right)} \end{equation} where again we will assume for simplicity that $\omega_{1,2}$ and $k$ are all real. For this wavefunction to be normalizable, {\it i.e.,}\ $1=\int dx\,dy\ |\psi(x,y)|^2$, we need $\omega_2>0$ and $\omega_1\, \omega_2 -k^2 >0$. The density matrix corresponding to $\ket{\psi}$ is simply given by \begin{equation} \rho_{12}(x,y,x',y') = \left(\frac{\omega_1\omega_2-k^2}{\pi^2}\right)^{1/2} e^{-\frac{1}{2}\left(\omega_1 x'^2 + \omega_2 y'^2 + 2 k x'y' \right)} e^{-\frac{1}{2}\left(\omega_1 x^2 + \omega_2 y^2 + 2 k xy \right)}\,. \end{equation} Tracing out the auxiliary oscillator, we find \begin{align} \begin{split} \rho_{1}(x',x) =\int dy\, \rho_{12}(x,y,x',y) = \frac{\sqrt{\omega_1\omega_2-k^2}}{\sqrt{\pi\,\omega_2}}\, e^{-\frac{1}{2} \left[ \left(\omega_1-\frac{k^2}{2\omega_2}\right) (x^2 +x'^2) - \frac{k^2}{\omega_2 }\,xx'\right]}. \end{split} \end{align} Therefore comparing the above density matrix to eq.~\reef{dense1}, we find \begin{equation}\label{ABA} a = \omega_1 - \frac{k^2}{2\omega_2}\,,\qquad b = \frac{ k^2}{2\omega_2 }\,. \end{equation} From the second equation, we see that $b\geq0$ ensures a real purification. Note that for $b=0$, we simply get \begin{equation} a=\omega_1\,, \qquad k=0 \end{equation} and $\omega_2$ is unconstrained. That is, for the density matrix \reef{dense1} of an already pure state ({\it i.e.,}\ $\rho(x,x')=\psi_1(x)\psi^\dagger_1(x')$), the purification in eq.~\reef{wfunction1} is itself simply the product of two decoupled wavefunctions ({\it i.e.,}\ $\psi_{12}(x,y) = \psi_1(x)\psi_2(y)$). For non-zero $b$, we may solve for $\omega_1$ and $\omega_2$ in terms of $a$, $b$ and $k$ to find \begin{equation} \omega_1=a + b\,,\qquad \omega_2 = \frac{ k^2}{2b}\,. \end{equation} Hence we arrive at the one-parameter family of wavefunctions \begin{equation}\label{pure1} \psi_{12}(x,y) = \left(\frac{(a-b)}{2b}\frac{k^2}{\pi^2}\right)^{1/4}\, e^{-\frac{1}{2}\left[\left(a+b\right) x^2 + \frac{ k^2}{2b} y^2 + 2 k xy \right]}\,, \end{equation} all of which produce the same density matrix \reef{dense1} upon tracing out the auxiliary position $y$. The purification complexity is then found by optimizing the usual pure state complexity over the free parameter $k$ distinguishing these different purifications. \subsection{Alternative Description of the Purifications} \label{subsec:altdesc} Before we evaluate the purification complexity of the density matrix in eq.~\reef{dense1}, it will be convenient to introduce a second representation of the Gaussian states in order to simplify the optimization and to make clear the role of the ancillae for our Gaussian examples. Hence let us work in terms of the energy eigenstates of a given Hamiltonian \begin{equation}\label{Hamiltonian} H = \frac{1}{2} \hat p^2+ \frac{1}{2} \omega^2 \hat x^2 = \omega \left(a^\dagger a +\frac{1}{2}\right)\,, \end{equation} where we have set the mass to one.\footnote{The frequency $\omega$ of the oscillator is an arbitrary choice here, but of course, the result of our analysis will only depend on this choice through the parameters of the density matrix \reef{dense1}.} The annihilation and creation operators are defined as usual with \begin{equation} a\equiv\sqrt{\frac{ \omega}{2}}\left(\hat x+i \frac{\hat p}{ \omega}\right), \qquad a^{\dagger} \equiv \sqrt{\frac{ \omega}{2}}\left(\hat x-i \frac{\hat p}{ \omega}\right) \label{ac} \end{equation} and satisfy the commutation relations $[a,a^{\dagger}]=1$. The corresponding energy eigenstates can be written as \begin{equation} |n\rangle = \frac{(a^{\dagger})^n}{\sqrt{n!}} |0\rangle \end{equation} where $|0\rangle$ is the vacuum state of the Hamiltonian \eqref{Hamiltonian}. It is well known in the literature of quantum information, {\it e.g.,}\ see \cite{RevModPhys.84.621,ferraro2005gaussian,serafini2017quantum}, that Gaussian states can be decomposed in terms of standard operators defined using these creation and annihilation operators. In particular, the most general real density matrix of a one-mode Gaussian state can be decomposed according to\footnote{In this paper, we only consider Gaussian states with $\langle x\rangle=0=\langle p\rangle$, which implies that the exponent of the Gaussian wavefunction does not contain a term linear in $x$. If such terms were present, we would have to extend eq.~\reef{Gaussian_decom} by conjugating with the displacement operator, {\it e.g.,}\ see the discussion of complexity of coherent states in \cite{coherent}.} \begin{equation}\label{Gaussian_decom} \begin{split} \hat{\rho}_1 &= \hat S_1(r) \, \hat{\upsilon}_{th} (\beta,\omega)\,\hat S_1^\dagger(r) \,. \end{split} \end{equation} The operator $\hat S_1(r)$ is the one-mode squeezing operator, acting on our oscillator which we denote by the subscript 1 (in anticipation for introducing a second oscillator for the purification, which we will denote by a subscript 2), which for real values of $r$ reads\footnote{Note that the frequency $\omega$ from the definition of $a,\,a^\dagger$ in eq.~\reef{ac} does not appear here. The infinitesimal version of this squeezing operator is simply the scaling gate (with $a=b$) in eq.~\reef{gates}. } \begin{equation}\label{onemode_squeezed} \begin{split} \hat S_1(r) \equiv e^{-\frac{r}{2}\left({a_1^\dagger}{}^2-a_1^2\right)} = e^{i \frac{r}2 \left(\hat{x}_1\hat{p}_1 + \hat{p}_1 \hat{x}_1 \right)}\,. \end{split} \end{equation} This squeezing operator acts on the wavefunction $\psi(x) \equiv \langle x|\psi \rangle$ by rescaling the coordinate $x$ according to $\langle x|\hat S_1(r)|\psi \rangle = e^{r/2}\, \psi(e^r x)$. The remaining operator $ \hat{\upsilon}_{th} (\beta,\omega )$ is a thermal density matrix for the canonical ensemble with temperature $1/\beta$, {\it i.e.,}\ \begin{equation}\label{density_thermal} \hat{\upsilon}_{th}(\beta, \omega) \equiv \frac{e^{-\beta \omega\, a^\dagger a}}{{\text{Tr}} (e^{-\beta \omega\, a^\dagger a})}= \(1- e^{-\beta\omega}\) \sum_{n=0}^\infty e^{-\beta \omega\,n} \ket{n}\!\bra{n}\,. \end{equation} We can evaluate the position space representation of the density matrix $\hat{\rho}$ in eq.~\eqref{Gaussian_decom}, {\it i.e.,}\ $\langle x|\hat{\rho}| x' \rangle$, using Mehler's formula~\cite{erdelyi1953higher}, {\it e.g.,}\ \begin{equation} \sum_{n=0}^\infty \frac{u^n}{2^n n!} H_n(x)H_n(y)=\frac{1}{\sqrt{1-u^2}} \exp \( -\frac{u^2(x^2+y^2)-2u xy }{1-u^2} \). \end{equation} Of course, this yields a Gaussian density matrix of the form in eq.~\eqref{dense1} with the following parameters \begin{equation}\label{parameters} a = \frac{e^{2r}\, \omega\, \cosh \beta \omega}{\sinh \beta\omega}>0\,, \qquad b =\frac{e^{2r}\, \omega}{\sinh \beta \omega} >0 \,, \qquad \frac{a}{b}= \cosh \beta \omega \ge 1 \,. \end{equation} Demanding that the temperature and frequency are positive is then equivalent to the previous restrictions, $a>b\geqslant0$, discussed around eq.~\reef{dense1}. We note that while the parameter $\omega$ was introduced as a dimensional scale here, our result for the complexity will only depend on the dimensionless combinations $\beta \omega$ and $\mu/\omega$, as well as the (dimensionless) squeezing parameter $r$.\footnote{Below, we will see that the complexity only depends on two parameters, namely $\beta\omega$ and a particular combination of $\mu/\omega$ and $r$. The latter reduction can be traced back to a symmetry of complexity, {\it i.e.,}\ the `distance' between the reference state and target state is left unchanged if we rescale $\mu$ and shift $r$ simultaneously.} However, the parameter $\omega$ will still play an important role later on when considering different modes of a free QFT on the lattice in sections \ref{apply01} and \ref{apply02}.\footnote{As we noted above, $\omega$ does not appear in the squeezing operator and further, $\omega$ only appears in the dimensionless combination $\beta\omega$ in the thermal density matrix \reef{density_thermal} (and implicitly in the definition of $|n\rangle$ in that same equation). However, from eq.~\reef{parameters}, we see that it sets the scale of the dimensionful parameters, $a$ and $b$, in eq.~\reef{dense1}. Further, it will set the scale of the dimensionful parameters in the purified state \reef{wfunction1} --- see eq.~\reef{transform_paras} below.} When the temperature is set to zero, {\it i.e.,}\ $\beta\omega\to\infty$, eq.~\reef{Gaussian_decom} reduces to a pure state. From eq.~\reef{parameters}, we see that this corresponds to the limit $b/a \rightarrow 0$. The decomposition \eqref{Gaussian_decom} suggests that in order to purify this mixed state, one must purify the thermal part $\hat{\upsilon}_{th}$ of the density matrix.\footnote{In section \ref{sec_EE}, we explicitly demonstrate that the thermal part of eq.~\reef{Gaussian_decom} is also the component which determines the (entanglement) entropy of the mixed Gaussian state.} This can be done in terms of the thermofield double state, {\it e.g.,}\ see \cite{Chapman:2018hou} \begin{equation}\label{two_mode} \begin{split} \ket{\text{TFD}}_{12} \equiv S_{12}(\alpha)\, \ket{0}_1\ket{0}_2 = \left(1-e^{-\beta \omega} \right)^{1/2}\, \sum_{n=0}^\infty e^{-\frac{1}{2}\,\beta \omega \,n } \ket{n}_1\ket{n}_2 \end{split} \end{equation} where we have introduced the two-mode squeezing operator which entangles the two degrees of freedom, \begin{equation}\label{2squeezed_operator} \begin{split} S_{12}(\alpha) &\equiv e^{\alpha\, \left(a_1^\dagger a_2^\dagger - a_1 a_2\right)} = e^{-i \alpha \(\hat{x}_1\hat{p}_2 + \hat{p}_1 \hat{x}_2\) }\,. \end{split} \end{equation} The (real) squeezing parameter $\alpha$ for eq.~\reef{two_mode} is given by \begin{equation}\label{hope} \tanh \alpha = e^{-\beta \omega/2} \,,\qquad \alpha= \frac{1}{2}\ln \frac{1 +e^{-\beta \omega/2}}{1-e^{-\beta \omega/2}}\,. \end{equation} The thermal density matrix $\hat \upsilon_{th}$ in eq.~\eqref{density_thermal} is then produced by tracing out the auxiliary degree of freedom \begin{equation}\label{TFDpureonemode} {\text{Tr}}_2( \ket{\text{TFD}}_{12} \bra{\text{TFD}}_{12}) = \(1- e^{-\beta\omega}\) \sum_n^\infty e^{-\beta \omega\,n} \ket{n}_1\!\bra{n}_1= \hat{\upsilon}_{th}(\beta,\omega) \,. \end{equation} However, we may also act with any unitary operator on the second oscillator in eq.~\reef{two_mode} and then this trace would yield an identical thermal density matrix. Hence we can write the most general two-mode purification of eq.~\eqref{Gaussian_decom} as \begin{equation}\label{Fock_psi12} \ket{\psi}_{12} = S_1(r)\,S_2(s) \, S_{12}(\alpha) \,\ket{0}_1\ket{0}_2\,, \end{equation} where we have introduced a second one-mode squeezing operator $S_2(s)$ to account for the freedom noted above in defining the purification of $\hat{\upsilon}_{th}(\beta,\omega)$. Eq.~\reef{Fock_psi12} is the most general two-mode purification using Gaussian states with real parameters. This can be seen by writing the position-space wavefunction \begin{equation}\label{Pure12} \begin{split} &\qquad \qquad\qquad\quad \psi_{12}(x,y) \equiv \langle{x,y}\ket{\psi}_{12}= \\ = &\sqrt{\frac{ \omega}{\pi}}\, e^{\frac{r+s}{2}} \, \exp\[-\frac{\omega }{2}\(\cosh 2\alpha\, (e^{2r}x^2+ e^{2 s}y^2) - 2\,e^{r+ s} x\,y \sinh 2\alpha\)\]\,. \end{split} \end{equation} This wavefunction has precisely the same form as given in eq.~\eqref{wfunction1}, and we identify the parameters as \begin{equation}\label{transform_paras} \omega_1 =\omega\, e^{2r} \cosh 2\alpha\,, \qquad \omega_2= \omega\, e^{2 s} \cosh 2\alpha\,, \qquad k= -\omega \,e^{r+s} \sinh 2\alpha\,. \end{equation} Of course, substituting these relations into eq.~\eqref{ABA} yields the same values for $a,b$ as shown in eq.~\eqref{parameters}, where we have used the following identities following from eq.~\eqref{hope} \begin{equation} \cosh2\alpha=\frac{1}{\tanh(\beta\omega/2)}\,,\qquad \sinh2\alpha=\frac1{\sinh(\beta\omega/2)}\ ,\qquad \tanh^2\!\alpha=e^{-\beta\omega}\,. \label{hope2} \end{equation} In the representation \eqref{Pure12}, the squeezing parameter $s$ encodes the freedom in defining the purification, which was previously captured by $k$ in eq.~\reef{pure1}. Hence with this description, the purification complexity will be found by optimizing the usual pure state complexity over $s$. To close here, we note that the expressions in eqs.~\reef{Pure12} and \reef{transform_paras}, as well as throughout the next section, can easily be written in terms of the parameter $\beta\omega$, which appears in the thermal density matrix \reef{density_thermal} using the relations \eqref{hope2}. However, we continue to write our results in terms of the squeezing parameter $\alpha$ appearing in the purification \reef{Fock_psi12}. One reason for this is that it simplifies the expressions for the limits of validity of the different regimes in our final result for the purification complexity --- see eq.~\reef{complexity_one_mode}. Further, $\alpha$ will also be a convenient parameter in our discussion of the purification complexity of a thermal density matrix (and in comparing it to the complexity of the thermofield double state \cite{Chapman:2018hou}) in section \ref{apply01}. \subsection{Purification Complexity in the Diagonal Basis} \label{sec:onemode} According to the definition of purification complexity \cite{BrianMixedComplexity}, see also eq.~\eqref{def_pureC}, we evaluate the complexity of the mixed state by optimizing the purification to have the minimal circuit complexity as a pure state. We emphasize that we are simplifying this problem here by focusing on Gaussian mixed states and constraining ourselves to only considering Gaussian purifications. As mentioned in section \ref{subsec:compure}, throughout the following, we focus on the complexity defined with the $F_1$ cost function \reef{func2}. Recall that the $\mathcal{C}_1$ complexity for Gaussian states was found to replicate the behaviours of holographic complexity most closely \cite{qft1,qft2,Chapman:2018hou}. However, as was also mentioned above, the $F_1$ cost function is basis dependent, and so we must specify that in this subsection, we evaluate the $\mathcal{C}_1$ complexity in the diagonal basis. We will explore the results using the physical basis, which does not mix the original degree of freedom with the ancilla, in the next subsection. The coefficient matrix $M_\mt{T}^{ab}$ in eq.~\eqref{wavematrix} for the purifying wavefunction $\ket{\psi_{12}}$ in eq.~\eqref{Pure12} is given by \begin{equation} M_\mt{T}^{ab}=\omega \left( \begin{array}{cc} \ e^{2 r} \cosh 2 \alpha & -e^{r+ s} \sinh 2 \alpha \\ -e^{r+s} \sinh 2 \alpha & \ e^{2 s} \cosh 2 \alpha \\ \end{array} \right). \label{house} \end{equation} Again, the free parameter $s$ specifies a family of purifications of the same mixed state $\hat{\rho}_1$ in eq.~\eqref{Gaussian_decom}. The prescription for evaluating the complexity of pure states was briefly reviewed in section \ref{subsec:compure}, and the $\mathcal{C}_1$ complexity was given in eq.~\reef{complexity_pure}. Hence, the complexity of the Gaussian state \eqref{Fock_psi12} becomes\footnote{We note again that the superscript `diag' indicates that we are working with the diagonal basis, {\it i.e.,}\ with gates acting on the eigenmodes which mix the physical and auxiliary degrees of freedom.} \begin{equation} \mathcal{C}_{1}^{\text{diag}}\left(\ket{\psi}_{12}\right) = \frac 12 \left|\ln \frac{\omega_+}{\mu}\right|+\frac 12\left|\ln \frac{\omega_-}{\mu}\right|\,, \label{walk1} \end{equation} where $\omega_\pm$ are the eigenvalues of the matrix $M^{ab}$, {\it i.e.,}\ \begin{equation}\label{eigenvalues_2modes} \omega_{\pm}= \omega\, e^{r+s}\( \cosh\! 2\alpha\, \cosh (r-s) \pm \sqrt{\cosh^2 2\alpha\,\cosh^2 (r-s) -1} \)\,. \end{equation} Now according to the definition of purification complexity \eqref{def_pureC}, the complexity of the corresponding mixed state \reef{Gaussian_decom} is given by\footnote{Note that we only optimize over the purification of the target state. We assume that the reference state is fixed as a factorized Gaussian, where both the physical and auxiliary degrees of freedom appear with the same reference frequency. \label{foot7}} \begin{equation} \mathcal{C}_{1}^{\text{diag}}\left(\hat{\rho}_1\right) = \text{min}_{s}\, \mathcal{C}_{1}^{\text{diag}} \left(\ket{\psi}_{12}\right) \,, \label{walk2} \end{equation} where the dependence on the squeezing parameter $s$ is hidden in the eigenfrequencies $\omega_\pm$ in eq.~\reef{eigenvalues_2modes}. Before proceeding, we must consider that there are three possibilities in eq.~\reef{walk1} depending on the relative magnitudes of the frequencies, \begin{equation}\label{eq:cases1} \begin{split} \text{case 1: }~ \mathcal{C}_{1}^{\text{diag}} &= \frac 12 \ln \frac{\mu^2}{\omega_+\omega_-} = -( \bar r + \bar s)\,, \qquad \qquad\qquad \qquad\quad\, \mu \ge \omega_\pm\,,\\ \text{case 2: }~ \mathcal{C}_{1}^{\text{diag}} &=\frac 12 \ln \frac{\omega_+}{\omega_-} = \cosh^{-1}\! \big[\cosh 2\alpha \cosh (\bar r - \bar s) \big]\,, \qquad \omega_- \le\mu \le \omega_+,\\ \text{case 3: }~ \mathcal{C}_{1}^{\text{diag}} &=\frac 12 \ln \frac{\omega_+\omega_-}{\mu^2} = \bar r + \bar s\, , \qquad \qquad\qquad \qquad\qquad\quad \mu \le \omega_\pm\,. \end{split} \end{equation} These results have been simplified by the introduction of the shifted squeezing parameters, \begin{equation}\label{rbar} \bar r \equiv r+\frac 12 \ln \frac{\omega }{\mu}\qquad {\rm and}\qquad \bar s \equiv s+\frac 12 \ln \frac{\omega }{\mu}\, . \end{equation} Now in order to perform the minimization in eq.~\reef{walk2}, we must identify the different regimes in eq.~\eqref{eq:cases1} in terms of the parameters of the purifying wavefunction,\footnote{This is done by analyzing the functional dependence of $\frac{\omega_\pm}{\mu}$ on $\cosh(2\alpha)\cosh(\bar r -\bar s)$ separately for each sign of $\bar r + \bar s$.} \begin{equation}\label{eq:limits23} \begin{split} &\text{case 1: }~ \tanh^2\! \alpha\le \tanh\bar r\, \tanh\bar s \quad \text{and} \quad \bar r + \bar s \le 0\,, \\ &\text{case 2: }~\tanh^2\! \alpha \ge \tanh\bar r\, \tanh\bar s\,, \\ &\text{case 3: }~ \tanh^2\! \alpha \le \tanh\bar r\, \tanh\bar s \quad \text{and} \quad \bar r + \bar s \ge 0 \,. \end{split} \end{equation} We see immediately that for case 1, both $\bar r$ and $\bar s$ will be negative, while for case 3, both will be positive. Let us next identify the value of $\bar s$ which yields a minimal complexity within each regime. For case 1, the complexity in eq.~\eqref{eq:cases1} is monotonically decreasing as a function of $\bar s$, and hence the minimal complexity is obtain by the maximal allowed value of $\bar s$, which can be found from eq.~\eqref{eq:limits23}. Similarly for case 3, the complexity is monotonically increasing with $\bar s$, and so the minimal complexity is associated with the minimal value of $\bar s$ allowed according to the inequalities in eq.~\eqref{eq:limits23}.\footnote{Recall that the boundary of the allowed values for $\bar s$ in each of these cases are precisely those for which $\omega_+=\mu$ or $\omega_-=\mu$ for case 1 and 3 respectively. Thus, the optimal purification in case 1 will have $\omega_+=\mu$, and similarly the optimal purification in case 3 will have $\omega_-=\mu$.} Incidentally, these two critical values of $\bar s$ coincide and are given by\footnote{Let us note that when $\bar{r}<0$ and $e^{2 \bar r} \cosh(2 \alpha)>1$, $\bar{s}_{\rm crit}$ is pushed to minus infinity. Therefore case 1 is not valid for any value of $\bar s$ and we are left with case 2 only. Similarly, for $\bar{r}>0$ and $e^{-2 \bar r} \cosh(2 \alpha)>1$, $\bar{s}_{\rm crit}$ is pushed to infinity, case 3 is not valid for any value of $\bar s$ and we are once again left with case 2 only.} \begin{equation}\label{case13r2} \text{case 1,3: }~\bar s_{\text{crit}} = \tanh^{-1}\!\left(\frac{\tanh^2 \alpha}{\tanh \bar r }\right)= \frac 12 \ln\! \left( {\frac{{e^{2 \bar{r} } \cosh 2 \alpha-1}}{{e^{2 \bar{r} }-\cosh 2 \alpha}}}\right)\,. \end{equation} Hence the minimal complexity in these two regimes is given by \begin{equation} \text{case 1,3: }~\mathcal{C}_{1}^{\text{diag}} =\pm \frac 12 \ln \!\left( \frac{{1-e^{-2 \bar{r} }\cosh 2 \alpha}}{{e^{2 \bar{r} } \cosh 2 \alpha-1}}\right). \end{equation} For case 2, the minimal complexity is obtained by minimizing the function in eq.~\eqref{eq:cases1}, which leads to \begin{equation}\label{case2compl} \text{case 2: }~\bar s_{\text{min}} = \bar r \qquad \longrightarrow \qquad\mathcal{C}_{1}^{\text{diag}}=2 \alpha\,. \end{equation} Now the final step is to clarify which one of these minimal complexities is the relevant one for given values of $\bar r $ and $\alpha$. If $\bar r <0$ for instance, both cases 1 and 2 could be in principle relevant, as long as $e^{2\bar r}\cosh(2\alpha)<1$. However for $0 > \bar{r} > -\alpha$, the lowest complexity is that in case 2 and hence the final answer for the purification complexity is given by eq.~\eqref{case2compl}. A similar argument can be given in the overlapping regime of cases 2 and 3. We finally arrive at the purification complexity \reef{walk2} for the one-mode Gaussian mixed states \reef{Gaussian_decom}, \begin{equation}\label{complexity_one_mode} \mathcal{C}_{1}^{\text{diag}}\(\hat{\rho}_1\) = \left\{ \begin{array}{lr} \frac 12 \, \ln \!\left( \frac{{e^{-2 \bar{r} }\cosh 2 \alpha }-1}{1-{e^{2 \bar{r} } \cosh 2 \alpha }}\right), &~~~ 0\le \alpha \le -\bar{r} \,,\\ \\ 2\alpha , &~~~ \alpha \ge |\bar{r} |\,,\\ \\ \frac 12\, \ln\! \left( \frac{{e^{2 \bar{r} } \cosh 2\alpha-1}}{{1-e^{-2 \bar{r} }\cosh 2\alpha}} \right) , &~~~ 0\le \alpha \le \bar{r} \,. \end{array} \right. \end{equation} One interesting point about this result is that the complexity of the mixed state $\hat{\rho}_1$ generally depends on both the thermal parameter $\beta\omega$ (or alternatively, $\alpha$), and the shifted squeezing parameter $\bar{r}$ (which has absorbed the ratio $\mu/\omega$), whereas the (entanglement) entropy of this state only depends on the combination $\beta\omega$. We return to this point in section \ref{sec_EE}. At this point, we can also point out the various benefits of the parametrization introduced in subsection \ref{subsec:altdesc}. First, $\alpha$ and $r$ are natural dimensionless parameters associated with the thermal state and its squeezing. The state described by those parameters is always physical, which means we do not need to impose extra constraints on those parameters. In particular, the density matrix is automatically positive semi-definitive and hermitian for any positive temperature and frequency. For $r=0$, the density matrix corresponds to a thermal state at temperature $1/\beta$ for a single harmonic oscillator of frequency $\omega$. More generally, for non-zero $r$, one can think of it as the thermal density matrix with an inverse temperature $\beta'=e^{-2r}\beta$ for a harmonic oscillator of frequency $\omega' = e^{2r}\omega$. That is, using eq.~\eqref{parameters}, one can easily show that \begin{equation}\label{scaling_rels} \hat{\rho}_1 = \hat S_1(r) \, \hat{\upsilon}_{th} (\beta,\omega)\,\hat S_1^\dagger(r) = \hat{\upsilon}_{th} (e^{-2r}\beta, e^{2r}\omega)\,. \end{equation} In addition, these parameters simplify the analytical analysis of the minimization, and bring the final result for the complexity and, in particular, the limits of validity of each regime into a (much more) compact form. Further, the physical meaning of the purification becomes clear --- in order to purify the Gaussian state, we only need to purify its thermal component, and the extra freedom in the optimization comes from the squeezing operator $S_2(s)$ on the ancilla. Finally, the parametrization is closely related to the thermofield double state at temperature $1/\beta$ which is defined by $r =s=0$; and for $r=s\neq0$, it is the thermofield double at temperature $1/\beta'$ of a harmonic oscillator of frequency $\omega'$ (where $\beta'$ and $\omega'$ are the same as defined above). \subsection{Purification Complexity in the Physical Basis} \label{fizz} Next, we explore the sensitivity of our previous results to the choice of the basis. In particular, we re-examine the purification complexity of the one-mode mixed Gaussian state, defined in eq.~\reef{dense1} or \eqref{Gaussian_decom}, with the $F_1$ cost function but using the physical basis. That is, here the gates implicitly act directly on the original and auxiliary degrees of freedom, rather than on the linear combinations comprising the eigenmodes of $M_\mt{T}$ describing the purification. This change of basis is accomplished with the orthogonal transformation described in eq.~\reef{rotate2pos}. To begin, we re-express the wavefunction matrix \eqref{house} for the purification $\ket{\psi_{12}}$ in terms of the shifted squeezing parameters in eq.~\eqref{rbar} as follows \begin{equation}\label{MabPos} M_\mt{T}^{ab}=\mu \left( \begin{array}{cc} \ e^{2 \bar{r}} \cosh 2 \alpha & -e^{\bar{r}+ \bar{s}} \sinh 2 \alpha \\ -e^{\bar{r}+ \bar{s}} \sinh 2 \alpha & \ e^{2 \bar{s}} \cosh 2 \alpha \\ \end{array} \right)\,. \end{equation} Similarly, the eigenvalues \eqref{eigenvalues_2modes} become \begin{equation}\label{round2} \omega_{\pm}= \mu\, e^{\bar{r}+ \bar{s}}\( \cosh\! 2\alpha\, \cosh (\bar{r}- \bar{s}) \pm \sqrt{\cosh^2 2\alpha\,\cosh^2 (\bar{r}- \bar{s}) -1} \)\,. \end{equation} Now, in order to evaluate the $\mathcal{C}_1^{\mt{phys}}$ complexity as in eq.~\eqref{rotate2pos}, we need to determine the orthogonal transformation which brings the matrix \eqref{MabPos} to its diagonal form, see eq.~\eqref{Odiag}. That is, \begin{equation}\label{thetadef} \tilde M_\mt{T}=\left( \begin{array}{cc} \omega_- & 0 \\ 0 & \omega_+ \\ \end{array} \right)= O^T \, M_\mt{T} \, O\qquad{\rm with}\quad O \equiv\left( \begin{array}{cc} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \\ \end{array} \right)\,, \end{equation} where $\theta \in [0,\frac{\pi}{2}]$ and \begin{equation}\label{rounder} \begin{split} & \sin \theta =\frac{1}{\sqrt{X^2+1}}\,,\qquad \cos \theta =\frac{X}{\sqrt{X^2+1}}\,, \\ &X\equiv \frac{1}{\sinh 2\alpha} \left(\sqrt{\cosh ^22 \alpha \cosh ^2(\bar r-\bar s)-1}-\cosh 2 \alpha \sinh (\bar r- \bar s)\right) \ge 0\,. \end{split} \end{equation} The next step is to rotate the generator $\tilde H$ in eq.~\eqref{Hgen}, {\it i.e.,} \begin{equation} \tilde{H}= \frac{1}{2} \left( \begin{array}{cc} \ln \frac{\omega_-}{\mu} & 0\\ 0 & \ln \frac{\omega_+}{\mu} \\ \end{array} \right)\, , \end{equation} as in eq.~\eqref{rotate2pos}, which defines the circuit generator in the physical basis\footnote{As an aside, we note that the circuit generator $H$ is easily expressed in terms of the ``relative wavefunction" matrix $M_{\mt T} M_\mt{R}^{-1}$ directly in the physical basis as $H = \frac{1}{2}\ln \left(M_{\mt T} M_\mt{R}^{-1} \right)$.} \begin{equation}\label{position_H} H= O \, \tilde{H} \, O^T = \frac{1}{2} \left( \begin{array}{cc} \cos^2\theta \ln \frac{\omega_-}{\mu} + \sin^2 \theta \ln \frac{\omega_+}{\mu} &- \sin \theta\cos \theta\,\ln \frac{\omega _+}{\omega _-}\\ -\sin \theta\cos \theta\,\ln \frac{\omega _+}{\omega _-}& \cos^2\theta \ln \frac{\omega_+}{\mu} + \sin^2 \theta \ln \frac{\omega_-}{\mu} \end{array} \right)\,. \end{equation} Again using eq.~\eqref{rotate2pos}, $\mathcal{C}_1$ for the purified state corresponding to the wavefunction matrix \eqref{MabPos} in the physical basis becomes \begin{equation} \begin{split}\label{complexityPosition123} \mathcal{C}_1^{\mt{phys}} (\ket{\psi_{12}}) =\frac 14\, \bigg( 2\, \sin 2\theta & \ln \frac{\omega_+}{\omega_-} + \left| \ln \frac{\omega_+\omega_-}{\mu^2}-\cos 2\theta \ln \frac{\omega_+}{\omega_-} \right| \\ &\left. +\left| \ln \frac{\omega_+\omega_-}{\mu^2}+\cos 2\theta \ln \frac{\omega_+}{\omega_-} \right| \, \right) . \\ \end{split} \end{equation} It will be convenient to optimize the purification by varying the angle $\theta$ rather than working with the squeezing parameter $s$. Hence we use eq.~\reef{rounder} to replace \begin{equation} \label{eq:stotheta} \sinh(\bar r-\bar s)=- \tanh 2 \alpha \, \cot 2 \theta\,. \end{equation} Note that the sign of $\sinh(\bar r-\bar s)$ will be positive for $\theta>\pi/4$ and negative for $\theta<\pi/4$. Combining this expression with eqs.~\reef{round2} and \reef{rounder}, we can also express the other factors in eq.~\eqref{complexityPosition123} in terms of $\theta$ as follows \begin{equation} \begin{split} \label{eq:omegatotheta} &\frac 12\, \ln \frac{\omega_+}{\omega_-} = \cosh^{-1}\! \(\cosh 2\alpha \cosh (\bar r-\bar s) \) =\sinh ^{-1}(\sinh 2 \alpha \, \csc 2 \theta ) \,, \\ &\frac 12\, \ln \frac{\omega_+\omega_-}{\mu^2} =\bar{r}+\bar{s}= 2\bar{r} +\sinh ^{-1}(\tanh 2 \alpha \, \cot 2 \theta )\,.\\ \end{split} \end{equation} Using these expressions and examining eq.~\eqref{complexityPosition123} according to the different possible signs in the absolute values, we obtain \begin{eqnarray} (a)~--\,:&& \mathcal{C}_1^{\mt{phys}}=- 2\bar{r}+\sin 2 \theta \,\sinh ^{-1}\!\( \frac{\sinh 2 \alpha }{\sin 2\theta} \) -\sinh ^{-1}(\tanh 2 \alpha \, \cot 2 \theta ) \nonumber\\ (b) ~+-\,:&& \mathcal{C}_1^{\mt{phys}}= \sqrt{2} \sin\( 2\theta -\frac{\pi}{4}\)\, \sinh ^{-1}\!\( \frac{\sinh 2 \alpha }{\sin 2\theta} \) \label{complexitypositionabcd}\\ (c) ~-+\,:&& \mathcal{C}_1^{\mt{phys}}= \sqrt{2} \sin\( 2\theta +\frac{\pi}{4}\)\, \sinh ^{-1}\!\( \frac{\sinh 2 \alpha }{\sin 2\theta} \) \nonumber\\ (d) ~++\,:&& \mathcal{C}_1^{\mt{phys}}= 2\bar{r}+\sin 2 \theta \,\sinh ^{-1}\!\( \frac{\sinh 2 \alpha }{\sin 2\theta} \) +\sinh ^{-1}(\tanh 2 \alpha \, \cot 2 \theta ) \nonumber \end{eqnarray} where for instance $+-$ indicates that the sign of the expression inside the first absolute value in eq.~\eqref{complexityPosition123} is positive and the sign of the expression inside the second absolute value is negative. Finally, the purification complexity in the physical basis for the one-mode Gaussian mixed state is given by minimizing this expression with respect to the free parameter $\theta$ \begin{equation}\label{purification_C_pos} \mathcal{C}_1^{\mt{phys}} \( \hat{\rho}_1\) =\text{min}_{\theta}\, \mathcal{C}_{1}^{\mt{phys}} \left(\ket{\psi}_{12}\right)\,. \end{equation} Unfortunately, the exact analytical minimization of eq.~\eqref{purification_C_pos} is not possible since it would require solving a transcendental equation. Hence, in order to develop some intuition, let us consider the simple case $\mu=\omega e^{2r}$, {\it i.e.,}\ $\bar{r}=0$ where the purification complexity reduces to \begin{equation}\label{SimpleCasePos} \mathcal{C}_1^{\mt{phys}} = \left\{ \begin{array}{lr} \sqrt{2} \sin\( 2\theta -\frac{\pi}{4}\) \,\sinh ^{-1}\!\( \frac{\sinh 2 \alpha }{\sin 2\theta} \) \qquad :&\! +-\,,\\ \\ \sqrt{2} \sin\( 2\theta +\frac{\pi}{4}\) \,\sinh ^{-1}\!\( \frac{\sinh 2 \alpha }{\sin 2\theta} \) \qquad :&\ -+\,.\\ \end{array} \right. \end{equation} That is, $\mathcal{C}_1^{\mt{phys}}$ is given be either cases (b) or (c) in eq.~\reef{complexitypositionabcd}. We are able to rule out cases (a) and (d) ({\it i.e.,}\ $++$ and $--$) by verifying that the product of the terms in the absolute values in eq.~\eqref{complexityPosition123} is negative using the identity\footnote{This identity can be verified separately in each region $0<\theta<\pi/4$ and $\pi/4<\theta<\pi/2$ by using the fact that for $\alpha=0$ we obtain an equality together with the fact that the derivative of the left hand side with respect to $\alpha$ has a definite sign in each region, namely, it is negative for $0<\theta<\pi/4$ and positive for $\pi/4<\theta<\pi/2$.} \begin{equation} \sinh^{-1}\left(\tanh 2\alpha\,|\cot 2 \theta\,|\,\right)-\,|\cos 2\theta\,| \,\sinh^{-1}\left(\sinh 2\alpha\,|\csc 2\theta\,|\,\right) <0\,. \end{equation} To proceed further, let us point out an interesting way to identify which set of signs of the terms in the absolute values is relevant for the evaluation of complexity. We can regard the expressions for each of the cases in eq.~\reef{complexitypositionabcd} as evaluating the expression in eq.~\reef{complexityPosition123}, but without the absolute values, rather we are inserting the specified signs in front of the last two terms. Hence for a given value of $\theta$, we can evaluate all four of these expressions. However, the correct result will correspond to the largest value because in this case with the specified signs, both of the second and third terms must be making a positive contribution to the complexity, as required by the absolute values in eq.~\reef{complexityPosition123}. Using this reasoning in eq.~\eqref{SimpleCasePos} with $\bar r=0$, we can see that when $\theta<\pi/4$, case (c) is the correct choice, while for $\theta>\pi/4$, the relevant case is (b). This fact will also be useful when performing the numerical analysis of more general cases later on. We may also use the identity $ a \sinh^{-1}(x)>\sinh^{-1} (a x)$ for $a>1$, $x>0$,\footnote{This is due to the fact that $\sinh^{-1}(x)$ is concave down.} with $a=\sin(2\theta)\pm \cos(2\theta)>1$ for $0<\theta<\pi/4$ and $\pi/4<\theta<\pi/2$ respectively, as well as the monotonicity of $\sinh^{-1}(x)$, in order to demonstrate that the minimal value for the complexity is obtained for $\theta=\frac{\pi}{4}$ (which corresponds to $\bar{s}=\bar{r}=0$), see eq.~\eqref{eq:stotheta}. This yields the following purification complexity \begin{equation} \mathcal{C}_1^{\mt{phys}} \( \hat{\rho}_1(\bar{r}=0)\) = \text{min}_{\theta}\, \mathcal{C}_{1}^{\mt{phys}} \left(\ket{\psi}_{12}\right)= 2\alpha \,. \end{equation} We may also point out, that for $r=0$, this is simply the TFD purification of a state with temperature $\beta$ and frequency $\omega=\mu$. The addition of the squeezing parameter $r$ leads to the TFD purification of a state with temperature $\beta'=e^{-2r }\beta$ and frequency $\omega'=\omega e^{2r}$ which is equal to the reference frequency $\mu$, according to the logic described around eq.~\eqref{scaling_rels}. Next, we return to the general case for which we examine the optimization \reef{purification_C_pos} numerically. Without loss of generality, let us assume that $\mu \ge \omega e^{2r}$, or equivalently $\bar{r}<0$.\footnote{Note that the system is symmetric under the exchange $\bar r \rightarrow -\bar r$, $\theta \rightarrow \frac{\pi}{2}-\theta$, and (a)$\leftrightarrow$(d), (b)$\leftrightarrow$(c). As a consequence, though the details of the analysis will slightly vary, the value of the complexity obtained by minimizing \eqref{complexityPosition123} will only depend on the absolute value of $\bar r$.} We will try to use the same logic as above in order to identify the ranges of $\theta$ in which the different sets of signs in eq.~\eqref{complexitypositionabcd} are valid. It is useful to start by looking at a plot of all possible sign combinations given by the four cases (a)--(d), for all values of $0<\theta<\pi/2$ --- see figure \ref{fig:complexity_pos}. As noted before, the relevant sign combination for the complexity will always be the highest of the four lines, since that possibility takes into account the correct (positive) signs for all the absolute values. Therefore, we must minimize the complexity over the uppermost envelope of the plots in figure \ref{fig:complexity_pos}. Let us proceed with this graphical understanding in mind. For a non-zero value of $\bar r<0$, the different cases in eq.~\eqref{complexitypositionabcd} are shifted up (case (a)), down (case (d)) or not modified (cases (b) and (c)). Using the same inequalities mentioned above, it is straightforward to see that case (d) becomes irrelevant and is smaller than at least one of the other cases for all values of $\theta$. Therefore, in each region of $\theta$, we should consider two competing sign combinations: \begin{equation} \mathcal{C}_1^{\mt{phys}}\left(\ket{\psi}_{12}\right) =\left\{ \begin{array}{lr} {\rm case}\ (a)\ {\rm or}\ (b)\quad{\rm for}\ \frac{\pi}{4}\le \theta \le \frac{\pi}{2} \,,\\ \\ {\rm case}\ (a)\ {\rm or}\ (c)\quad{\rm for}\ 0\le \theta \le \frac{\pi}{4} \,.\\ \end{array} \right. \end{equation} \begin{figure}[htbp] \includegraphics[width=2.8in]{figures/Cpos00} \includegraphics[width=2.8in,left]{figures/Cpos01} \includegraphics[width=2.8in]{figures/Cpos02} \includegraphics[width=3.2in]{figures/Cpos03} \caption{Possible values for the pure state complexity $\mathcal{C}_1^{\mt{phys}}(|\psi_{12}\rangle)$ in the physical basis as a function of $\theta$, for all possible sign combinations according to eq.~\eqref{complexitypositionabcd} for fixed values of $\bar{r}$ and $\alpha$. The complexity of the mixed state purified by $|\psi_{12}\rangle$ is obtained by minimizing over the uppermost envelope of each of these plots.}\label{fig:complexity_pos} \end{figure} We have examined these cases numerically, see figure \ref{fig:complexity_pos}. The minimal purification complexity is obtained for a value of $\theta$ that either lies at minimal points of the curves (a), (b) or (c) or at the intersections of the curves (a) and (c) or of the curves (a) and (b) depending on the values of $\bar r$ and $\alpha$ considered. These values can be identified by solving transcendental equations. For example, in the regime where $\alpha $ is small or $-\bar{r}$ is large, the minimal complexity is obtained at the point where the curves for cases (a) and (c) intersect, which corresponds to solving the equation \begin{equation}\label{gumby7} \begin{split} -2\bar{r}= \sinh ^{-1}(\tanh 2 \alpha \, \cot 2 \theta_c )+ \cos 2\theta_c\,\sinh ^{-1}\!\(\frac{\sinh 2 \alpha }{\sin 2\theta_c} \)\,, \end{split} \end{equation} and the purification complexity reads \begin{equation}\label{pos_ac} \mathcal{C}_{1,c}^{\mt{phys}} \( \hat{\rho}_1\)=(\sin 2\theta_c + \cos 2\theta_c)\,\sinh ^{-1}\!\(\frac{\sinh 2 \alpha}{\sin 2\theta_c} \) \,. \end{equation} \begin{figure}[htbp] \centering\includegraphics[width=4.5in]{figures/Cc-C1} \caption{The difference between the complexity obtained for $\theta_c$ at the intersection of cases (a) and (c) and the exact purification complexity of one-mode Gaussian states in the physical basis $\mathcal{C}_{1,c}^{\mt{phys}} \( \hat{\rho}_1\)-\mathcal{C}_1^{\mt{phys}} \( \hat{\rho}_1\)$ as a function of $\bar{r}$ for some fixed values of $\alpha$. We see that the complexity obtained at the intersection between cases (a) and (c) with $\mathcal{C}_{1,c}^{\mt{phys}} \( \hat{\rho}_1\)$ in eq.~\eqref{pos_ac} ceases to be optimal for some region of the parameter $\bar{r}$ for large enough values of $\alpha$.}\label{Cc-C1} \end{figure} When the parameter $\alpha$ is large enough, we can find that the minimal complexity corresponds to the minimal point along the curve (c) rather than to the intersection of curves (c) and (a). This is illustrated in figure \ref{Cc-C1} which plots the difference $\mathcal{C}_{1,c}^{\mt{phys}}-\mathcal{C}_{1}^{\mt{phys}}$. The non-zero values in the middle of this plot mean that the minimization is obtained at the local minimal point of curve (c) where the complexity is given by \begin{equation} \mathcal{C}_{1}^{\mt{phys}} \( \hat{\rho}_1\) = \sqrt{2} \sin\( 2\theta_{\mt{min}} +\frac{\pi}{4}\)\, \sinh ^{-1}\!\( \frac{\sinh 2 \alpha }{\sin 2\theta_\mt{min}} \) \end{equation} where \begin{equation} \partial_{\theta} \( \sin\( 2\theta +\frac{\pi}{4}\)\, \sinh^{-1}\!\( \frac{\sinh 2 \alpha }{\sin 2\theta} \) \) \bigg|_{\theta_{\mt{min}}} =0, \qquad 0 \le \theta_{\text{min}} \le \theta_c \, . \end{equation} Although we cannot solve for $\theta_c$ or $\theta_\mt{min}$ analytically, we may evaluate them numerically. Similar equations can be written for other possible positions of the minimum. Figure \ref{complexity_LR} contains results for $\mathcal{C}_1^{\mt{phys}} \( \hat{\rho}_1 \)$ from numerical minimization with fixed value of $\bar{r}$. \begin{figure}[htbp] \centering\includegraphics[width=4.5in]{figures/CLR} \caption{Purification complexity of one-mode Gaussian states in the physical basis $\mathcal{C}_{1}^{\mt{phys}} \( \hat{\rho}_1\)$ as a function of $\alpha$ for some fixed values of $\bar r$. The fact that the curves with $\bar r=-6$ and $\bar r=-10$ coincide after a certain value of $\alpha$ is due to the fact that this minimization is obtained at the minimum of case (c) which is $\bar r$ independent.}\label{complexity_LR} \end{figure} \subsubsection{Differences between the two bases} We must stress again that with the physical basis, the gates act directly on the original and auxiliary degrees of freedom. This contrasts with the diagonal basis where the gates act on the linear combinations comprising the eigenmodes of $M_\mt{T}$ describing the purification. In particular, then, one of the diagonal generators is precisely aligned with the generator $\tilde H$ of the optimal circuit in eq.~\reef{Hgen}. As a consequence, one expects that with other choices of basis, the purification complexity of mixed states (as well as the complexity of pure states) will not be smaller than in the diagonal basis. Comparing our results for of the one-mode Gaussian mixed states in the physical basis \eqref{complexityPosition123} to those in the diagonal basis \eqref{eq:cases1}, we can show \begin{equation} \begin{split} \mathcal{C}_1^{\mt{phys}} &=\frac 12 \( \sin 2\theta \ln \frac{\omega_+}{\omega_-} +\left| \cos 2\theta \frac 12\ln \frac{\omega_+}{\omega_-} -\frac 12 \ln \frac{\omega_+\omega_-}{\mu^2} \right| +\left| \frac 12 \ln \frac{\omega_+\omega_-}{\mu^2}+\cos 2\theta \frac 12\ln \frac{\omega_+}{\omega_-} \right| \) \,, \\ &\ge (\sin 2\theta +|\cos 2\theta |)\,\frac 12 \ln \frac{\omega_+}{\omega_-} \ge \mathcal{C}^\mt{diag}_1 (\text{case 2})\,, \end{split} \end{equation} and \begin{equation} \begin{split} \mathcal{C}_1^{\mt{phys}} &=\frac 12 \( \sin 2\theta \ln \frac{\omega_+}{\omega_-} +\left| \frac 12 \ln \frac{\omega_+\omega_-}{\mu^2}-\cos 2\theta \frac 12\ln \frac{\omega_+}{\omega_-} \right| +\left| \frac 12 \ln \frac{\omega_+\omega_-}{\mu^2}+\cos 2\theta \frac 12\ln \frac{\omega_+}{\omega_-} \right| \) \,, \\ &\ge \sin 2\theta \,\frac 12 \ln \frac{\omega_+}{\omega_-} +\frac{1}{2} \left| \ln \frac{\omega_+\omega_-}{\mu^2} \right| \ge \mathcal{C}^\mt{diag}_1 (\text{case 1,3})\,, \end{split} \end{equation} where we used the inequality $|a-c|+|c-b| \ge |a-b|$. Hence, we conclude \begin{equation} \mathcal{C}_1^{\mt{phys}} (\ket{\psi_{12}}) \ge \mathcal{C}^\mt{diag}_1 (\ket{\psi_{12}}) \,, \qquad \mathcal{C}_1^{\mt{phys}} \( \hat{\rho}_1\) \ge \mathcal{C}^\mt{diag}_1 \( \hat{\rho}_1\) \,, \end{equation} as expected. It is also easy to demonstrate that the latter inequality holds in various examples by numerical minimization. \subsection{Example 1: Two Coupled Harmonic Oscillators} We will start by considering a simple toy model of two coupled harmonic oscillators with Hamiltonian\footnote{A similar toy model was considered in the context of complexity of pure states in reference \cite{qft1}.} \begin{equation}\label{2_hamiltonian} \begin{split} H_{12} &= \frac{1}{2} \( p_1^2 +p_2^2 +\bar\omega^2(x_1^2+x_2^2) +\Omega^2(x_1-x_2)^2 \) \\ &= \frac{1}{2} \( p_+^2 +p_-^2 +\Omega_+^2 x_+^2+\Omega_-^2 x_-^2 \) , \end{split} \end{equation} where the normal-mode coordinates are $x_\pm = \frac{1}{\sqrt{2}}(x_1 \pm x_2)$ and the normal-mode frequencies are $\Omega_+^2 =\bar\omega^2 < \Omega_-^2=\bar\omega^2 + 2\Omega^2$, and where we have set the mass of the oscillators $M$ to one, as in the bulk of the paper. This corresponds to the $N=2$ case of~\eqref{eq:Hregulated}. The corresponding ground state wave function is given by \begin{equation}\label{pure_2HO} \begin{split} \psi_0(x_+,x_-) &= \(\frac{\Omega_+\Omega_-}{\pi^2} \)^{1/4} \exp \( -\frac 12 \(\Omega_+ x_+^2 +\Omega_-x_-^2 \) \). \end{split} \end{equation} Restoring the dependence of this wavefunction on the original coordinates $x_1$ and $x_2$ we obtain \begin{equation} \label{eq:groundreal} \psi_{12}=\psi_0 = \left(\frac{\Omega_-\Omega_+}{\pi^2} \right)^{1/4} \exp \left(- \frac{\Omega_-+\Omega_+}{4} (x_1^2+x_2^2) +\frac{\Omega_--\Omega_+}{2} x_1 x_2\right)\,. \end{equation} We can then compare the wave function to the one in eq.~\eqref{wfunction1} (see also \eqref{transform_paras} and \eqref{rbar}) and find an easy translation to the notation of section~\ref{sec:onemode} \begin{equation}\label{vacuum_parameters} \bar{r}=\bar{s}= \frac14\ln \(\frac{\Omega_-\Omega_+}{\mu^2}\) \,, \quad \alpha = \frac14 \ln \( \frac{\Omega_-}{\Omega_+}\)\,. \end{equation} For the reference state \begin{equation}\label{reference_state} \begin{split} \psi_R(x_+,x_-) &= \sqrt{\frac{\mu}{\pi} }\exp \( -\frac 12 \(\mu x_1^2 +\mu x_2^2 \) \)\,, \end{split} \end{equation} and using the entangling and scaling gates as the fundamental set of gates, the diagonal basis complexity of the ground state using Nielsen's geometric method with the $F_1$ cost function is (see eq.~\eqref{complexity_pure} or \cite{qft1}), \begin{equation} \begin{split}\label{compureappC} \mathcal{C}_{1}^{\text{diag}}\( \psi_0 \) = \frac 12 \left|\ln \frac{\Omega_+}{\mu}\right|+\frac 12\left|\ln \frac{\Omega_-}{\mu}\right| \,. \end{split} \end{equation} In the following, we want to find the complexity of a subsystem given by the first harmonic oscillator after tracing out $x_2$. Tracing out the second oscillator, we obtain a density matrix of the form~\eqref{dense1} for the first oscillator with parameters (see eq.~\eqref{ABA}) \begin{equation} a=\frac{(\Omega_++ \Omega_- )^2+4\Omega_+\Omega_-}{4(\Omega_++\Omega_-)}\,, \quad b = \frac{(\Omega_+ - \Omega_-)^2}{4(\Omega_-+\Omega_-)}\,. \end{equation} As we already know from the discussion in section \ref{warmup}, the purification complexity for a subregion consisting of the first oscillator is not necessarily given by eq.~\eqref{compureappC} since the optimal purification is not necessarily the original pure state in eq.~\eqref{pure_2HO}. The purification complexity can be read by substituting the parameters $\alpha$ and $\bar{r}$ from eq.~\eqref{vacuum_parameters} into eq.~\eqref{complexity_one_mode}. The original ground state~\eqref{pure_2HO} will not be the optimal purification for the subregion except for $\Omega_->\mu>\Omega_+$. More precisely, we can compare the values of $\bar{r}= \frac14 \ln \frac{\Omega_-\Omega_+}{\mu^2}$ and $\alpha = \frac14 \ln \frac{\Omega_-}{\Omega_+}$ and we see that the three cases of section~\ref{sec:onemode} translate to \begin{equation} \begin{aligned} &{\rm case\ 1:} \quad &0 \leqslant \alpha \leqslant - \bar{r} \quad & \to \quad & \mu \geqslant \Omega_- \geqslant \Omega_+\,,\\ &{\rm case\ 2:} \quad & \alpha \geqslant |\bar{r}| \quad & \to \quad & \Omega_- \geqslant \mu \geqslant \Omega_+\,,\\ &{\rm case\ 3:} \quad &0 \leqslant \alpha \leqslant \bar{r}\quad & \to \quad & \Omega_- \geqslant \Omega_+ \geqslant \mu \,. \end{aligned} \end{equation} Indeed, it is straightforward to confirm that when we are in case 2, the original ground states is the one with minimal complexity given by \begin{equation} {\cal C}_{1}^{\text{diag}}\( \rho_{\text{sub}} \) = 2\alpha=\frac12 \ln \frac{\Omega_-}{\Omega_+}= \mathcal{C}_{1}^{\text{diag}}\( \psi_0 \)\,, \end{equation} since $\bar{s} = \bar{r}=\bar{s}_{\text{min}}$ as was found in eq.~\eqref{case2compl}. In contrast, for $\mu $ outside of that region, for example in the case $\mu>\Omega_->\Omega_+$, the complexity of the optimal purification is \begin{equation} \begin{split} {\cal C}^{\text{diag}}_{1}\( \rho_{\text{sub}}\)&= \frac 12 \ln \left( \frac{{e^{-2 \bar{r}} \cosh 2\alpha-1}}{{1-e^{2 \bar{r}}\cosh 2\alpha}} \right) \\ &= \frac12 \ln \left[\frac{\mu^2}{\Omega_-\Omega_+} \frac{\Omega_-+\Omega_+-2\Omega_-\Omega_+/\mu}{2\mu-\Omega_--\Omega_+}\right]< \frac{1}{2} \ln \frac{\Omega_-\Omega_+}{\mu^2}\,, \end{split} \end{equation} which means that the original pure state is not the optimal purification. For completeness, we explicitly write the optimal purifications for each of the three cases. For case 2, as mentioned above, the optimal purification is the ground state of the two harmonic oscillator system itself. This corresponds to the state~\eqref{pure_2HO} or equivalently \eqref{eq:groundreal} in terms of the original $(x_1,x_2)$ coordinates. For the other two cases, the optimal purification takes the following form, see eqs.~\eqref{house}, \eqref{rbar} and \eqref{case13r2}, \begin{equation} \psi_{12} = \left(\frac{\Omega_-\Omega_+}{\pi^2}f \right)^{1/4} \exp \Bigg(-\frac{\Omega_-+\Omega_+}{4}\left(x_1^2 + f x_2^2\right) +\frac{\Omega_--\Omega_+}{2} \sqrt{f}\,x_1x_2 \Bigg)\,, \end{equation} where \begin{equation} f=\frac{\Omega_-+\Omega_+-2\,\mu}{2\,\Omega_- \Omega_+/\mu-\Omega_--\Omega_+}\,. \end{equation} In the case of two harmonic oscillators, there is no distinction between the physical-ancilla basis and the position basis. This is because the ``submatrices'' $\Gamma = \Omega = \frac{\Omega_-+\Omega_+}{2}$ in eq.~\eqref{Gaussian_AB} are simply a number and are therefore already diagonal. Thus, the ground state expressed in the position basis~\eqref{eq:groundreal} is also expressed in terms of the physical-ancilla modes. Lastly, we mention the relation of these purifications to the TFD of the single harmonic oscillator. As observed in section~\ref{warmup}, in the comments around eq.~\eqref{scaling_rels}, the mixed state obtained after tracing out one of the oscillators corresponds to a thermal state with modified frequency $\omega'=\omega e^{2r} = \mu e^{2\bar r}=\sqrt{\Omega_-\Omega_+}$ at an inverse temperature of $\beta' \omega' = 2\, {\rm arcosh}\left(\frac{\Omega_-+\Omega_+}{\Omega_--\Omega_+}\right)$, see also eq.~\eqref{hope2}. Comparing the ground state parameter matrix~\eqref{eq:groundreal} with eqs.~\eqref{house} and~\eqref{hope}, the optimal purification can be seen to correspond to the TFD of two harmonic oscillator at this modified temperature and frequency when we are in case 2, that is, when $\Omega_- >\mu >\Omega_+$. \subsection{Example 2: Four Coupled Harmonic Oscillators} We restrict to the example of a lattice of four harmonic oscillators with the goal of explicitly providing an example of the ground state in the normal mode basis, in position basis and in the physical(-ancilla) basis. We will express these in terms of the parameter matrix $M$ used throughout the main body of the paper. That is, we use $M_{\rm basis}$ to represent the state\footnote{We use the generalization of eq. \eqref{wavematrix} for a complex basis. This will be necessary since the Fourier transformation in eq.~\eqref{eq:Fourier} yields complex normal modes.} \begin{equation} \label{eq:Mbasis} \Psi_0(x_{\rm basis}) = \left( \det \left( \frac{M_{\rm basis}}{\pi}\right) \right)^{1/4} \exp \left[ -\frac12 x^\dagger_{\rm basis} M_{\rm basis} x_{\rm basis}\right]\,. \end{equation} The state we are interested in is the ground state of the free QFT lattice Hamiltonian consisting of four coupled harmonic oscillators, {\it i.e.,}\ the $N=4$ case of~\eqref{eq:Hregulated}. This state was already written in normal mode basis in eq.~\eqref{eq:ground-normal}. For a lattice of four harmonic oscillators, the normal modes $x_k\equiv(x_1,x_2,x_3,x_4)^{T}$ are related to the original physical basis modes $\bar{x}_a \equiv(\bar x_1,\bar x_2,\bar x_3,\bar x_4)^{T}$ by eq.~\eqref{eq:Fourier}, namely \begin{equation} \label{eq:Rmat} x = R \bar{x} \,,\quad {\rm where} \quad R= \frac12 \begin{pmatrix} i & -1 & -i & 1\\ -1 & 1 & -1 & 1\\ -i & -1 & i & 1\\ 1 & 1 & 1 & 1 \end{pmatrix} \,, \end{equation} or, explicitly \begin{equation} \begin{aligned} x_1 &= \frac12 \left(i \bar{x}_1 - \bar{x}_2 - i \bar{x}_3 + \bar{x}_4\right)\,, \quad \quad \quad\, \, \, \, x_2 = \frac12 \left(- \bar{x}_1 + \bar{x}_2 - \bar{x}_3 + \bar{x}_4\right)\,,\\ x_3 &= \frac12 \left(-i \bar{x}_1 - \bar{x}_2 + i \bar{x}_3 + \bar{x}_4\right)\,, \quad\quad \quad x_4 = \frac12 \left(\bar{x}_1 + \bar{x}_2 + \bar{x}_3 + \bar{x}_4\right)\,. \end{aligned} \end{equation} Notice that, while the position basis degrees of freedom are real valued, this is not the case for the normal mode degrees of freedom where, in particular $x_1^* = x_3$ so that $x_{\rm normal}^\dagger = (x_3,x_2,x_1,x_4)$.\footnote{Recall that the Fourier transform obeys the identity $x^\dagger_{ k}= x_{N- k}$, see comment below eq.~\eqref{gracht}.} The parameter matrix in normal mode basis can easily be read off eqs.~\eqref{eq:ground-normal} and \eqref{eq:Fourier} \begin{equation} \label{eq:Mnormal} M_{\rm normal} = \begin{pmatrix} \bar{\omega}_1 & 0 & 0 & 0\\ 0 & \bar{\omega}_2 & 0 & 0\\ 0 & 0 &\bar{\omega}_3 & 0\\ 0 & 0 & 0 & \bar{\omega}_4 \end{pmatrix}\,, \end{equation} where \begin{equation} \bar{\omega}_1=\bar{\omega}_3 = \sqrt{\bar\omega^2+2\sqrt{2}\Omega^2}\,, \quad \bar{\omega}_2 = \sqrt{\bar\omega^2+4\Omega^2}\,, \quad \bar{\omega}_4 = \bar\omega\,. \end{equation} The fact that the parameter matrix in normal mode basis is diagonal reflects the fact that there is no entanglement between normal mode degrees of freedom.\footnote{Note that substituting the parameter matrix \eqref{eq:Mnormal} into the bi-linear form in eq.~\eqref{eq:Mbasis} yields a wavefunction whose dependence on the $x_1$ and $x_3$ coordinates is of the form $\Psi_0 \propto \exp\left[ - \alpha (|x_1|^2 + |x_3|^2) \right] = \exp \left[-2\alpha x_1 x_3\right]$, where $\alpha=\frac{1}{2} \bar\omega^2 + \sqrt{2} \Omega^2$. So although the form seems orthogonal in complex coordinates, it does not look orthogonal when reexpressing the conjugate coordinates in terms of the original ones. This is due to the fact that the normal mode basis given by eq.~\eqref{eq:Fourier} is not Hermitian. This awkward dependence on the product of seemingly different degrees of freedom can be removed by using a real Fourier transformation involving $\sin(\cdots)$ and $\cos(\cdots)$ instead of the complex exponentials in eq.~\eqref{eq:Fourier}. An equivalent way of getting rid of this dependence is to make a second transformation $x_k^{\rm real} =\frac12 \left(x_k+x_k^*\right)$ and $x_{N-k}^{\rm real} =\frac{1}{2i} \left(x_k-x_k^*\right)$ for those values of $k$ for which $x_k$ are not real.} The physical basis parameter matrix can be found by applying the transformation~\eqref{eq:Rmat} to the normal mode basis parameter matrix~\eqref{eq:Mnormal} \begin{equation} M_{\rm pos} = R^\dagger M_{\rm normal} R \end{equation} or simply be read off eq.~\eqref{eq:Mpos}. Either way, for our four harmonic oscillator example it takes the form \footnotesize \begin{equation}\label{eq:Mpos4} M_{\rm pos} =\frac14 \begin{pmatrix} \bar\omega +\bar{\omega}_2+ 2\bar{\omega}_1 & \bar\omega-\bar{\omega}_2 & \bar\omega+\bar{\omega}_2-2\bar{\omega}_1 &\bar\omega-\bar{\omega}_2 \\ \bar\omega-\bar{\omega}_2 & \bar\omega+\bar{\omega}_2 + 2\bar{\omega}_1& \bar\omega-\bar{\omega}_2 & \bar\omega + \bar{\omega}_2-2\bar{\omega}_1\\ \bar\omega + \bar{\omega}_2-2 \bar{\omega}_1 & \bar\omega-\bar{\omega}_2 & \bar\omega+\bar{\omega}_2 + 2\bar{\omega}_1& \bar\omega-\bar{\omega}_2\\ \bar\omega-\bar{\omega}_2 & \bar\omega+\bar{\omega}_2-2 \bar{\omega}_1 & \bar\omega-\bar{\omega}_2 &\bar\omega +\bar{\omega}_2 + 2\bar{\omega}_1 \end{pmatrix}\,. \end{equation} \normalsize The form of the parameter matrix makes evident that the position basis degrees of freedom are entangled with each other. Furthermore, the entanglement decays for longer distances since $\bar\omega < \bar{\omega}_1 < \bar{\omega}_2$ implies $|\bar\omega-\bar{\omega}_2| > |\bar\omega+\bar{\omega}_2-2\bar{\omega}_1|$.\footnote{Recall that our lattice is periodic and so the sites $\bar x_1$ and $\bar x_4$ are nearest neighbors.} This is to be expected for entanglement being spread by nearest neighbor interactions coming from the discretized kinetic term (the last term in~\eqref{eq:Hregulated}). The position and normal mode basis should be familiar to most readers; they are the lattice equivalents of the position and momentum bases in quantum field theory. The physical-ancilla basis is less familiar. In~\cite{Chapman:2018hou}, it appears under the name \emph{left/right} basis since it was used in the context of the TFD state, which is considered a natural purification of the thermal state where the left/right division corresponds to the physical degrees of freedom of the thermal system and the ancilla degrees of freedom introduced in order to purify it.\footnote{Of course, when talking about the TFD it is ambiguous which of the sides we should consider as the physical system and which side represents the ancillae since tracing out either side will reproduce the thermal density matrix.} To define the physical-ancilla basis, we must partition the system into a physical subsystem and an ancilla subsystem. In other words, we consider the four harmonic oscillator ground state~\eqref{eq:Mbasis} as a purification of a mixed state of a subset of the oscillators. This is an important property of the physical-ancilla basis: it depends on a specific partition of the full system. In our example, we will choose to partition the system in two: the $\bar{x}_1$ and $\bar{x}_2$ oscillators as one subsystem and the $\bar{x}_3$ and $\bar{x}_4$ oscillators as the other subsystem. Which subsystem we call physical and which one ancilla depends on which degrees of freedom are traced out in order to construct the given two-mode mixed state. With this partition in mind, we can decompose the physical basis parameter matrix~\eqref{eq:Mpos4}, as in eq.~\eqref{Gaussian_AB}, into\footnote{In section \ref{sec:purificationX} we introduced the decomposition~\eqref{Gaussian_AB} \begin{equation} M_{\rm pos} = \begin{pmatrix} \Gamma & K \\ K^T & \Omega \end{pmatrix} \,, \end{equation} which has the unfortunate notation $\Omega$ for the lower right sub-matrix. In the following, we use instead the letter $\Sigma$ to denote this sub-matrix in order to avoid confusion with the oscillator coupling $\Omega$ in eq.~\eqref{eq:Hregulated}.} \begin{equation} M_{\rm pos} = \begin{pmatrix} \Gamma & K \\ K^T & \Sigma \end{pmatrix} \end{equation} where \begin{equation} \begin{split} \Gamma = \,& \Sigma = \frac14 \begin{pmatrix} \bar\omega + \bar{\omega}_2 +2\bar{\omega}_1 & \bar\omega-\bar{\omega}_2 \\ \bar\omega-\bar{\omega}_2 & \bar\omega + \bar{\omega}_2 +2\bar{\omega}_1\end{pmatrix} \,, \\ \quad K =\,& \frac14 \begin{pmatrix} \bar\omega + \bar{\omega}_2 -2\bar{\omega}_1 & \bar\omega-\bar{\omega}_2 \\ \bar\omega-\bar{\omega}_2 & \bar\omega + \bar{\omega}_2-2\bar{\omega}_1\end{pmatrix}\,. \end{split} \end{equation} The physical-ancilla basis is defined as the basis which diagonalizes the sub-matrices $\Gamma$ and $\Sigma$ without mixing the two subsystems. More precisely, we look for transformations of the form \begin{equation} \label{eq:Rphys-anc} R_{\rm phys-anc}= \begin{pmatrix} R_{\rm phys} & 0\\0 & R_{\rm anc} \end{pmatrix} \end{equation} that diagonalize both $\Gamma$ and $\Sigma$. In our example, this transformation is given by \begin{equation} R_{\rm phys}= \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ -1 & 1 \end{pmatrix}\,,\quad R_{\rm anc}= \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\,, \end{equation} or, explicitly \begin{equation} \begin{aligned} x_1^{\rm phys} &= \frac{1}{\sqrt{2}}(\bar{x}_1+\bar{x}_2)\,, \quad \quad \quad x_2^{\rm phys} = \frac{1}{\sqrt{2}}(\bar{x}_2-\bar{x}_1)\,,\\ x_3^{\rm phys} &= \frac{1}{\sqrt{2}}(\bar{x}_3+\bar{x}_4)\,, \quad \quad \quad x_4^{\rm phys} = \frac{1}{\sqrt{2}}(\bar{x}_3-\bar{x}_4)\,. \end{aligned} \end{equation} The physical-ancilla basis parameter matrix can be found by applying the transformation~\eqref{eq:Rphys-anc} to the position basis parameter matrix~\eqref{eq:Mpos4} \begin{equation} \label{Mphys} M_{\rm phys} = \frac12 \begin{pmatrix} \bar\omega + \bar{\omega}_1 & 0 &\bar\omega - \bar{\omega}_1 & 0 \\ 0 & \bar{\omega}_2 +\bar{\omega}_1 & 0 & \bar{\omega}_1 -\bar{\omega}_2\\ \bar\omega - \bar{\omega}_1 & 0 & \bar\omega + \bar{\omega}_1 & 0 \\ 0 &\bar{\omega}_1 -\bar{\omega}_2 & 0 & \bar{\omega}_2 +\bar{\omega}_1 \end{pmatrix}\,. \end{equation} In this basis, there is no entanglement between the modes in each subsystem ($x_1^{\rm phys}$ is not entangled with $x_2^{\rm phys}$ and similarly for $x^{\rm phys}_3$ and $x_4^{\rm phys}$). However, the entanglement between the two subregions cannot be removed by transformations of the form~\eqref{eq:Rphys-anc}. Consequently, the modes between regions remain entangled. In our case, the state factorizes to a product state form where $x_1^{\rm phys}$ is entangled with $x_3^{\rm phys}$ and $x_2^{\rm phys}$ with $x_4^{\rm phys}$. Bellow we will also see that the ground state is the TFD for a 2 harmonic oscillator modular Hamiltonian. To see this, we compare the physical basis parameter matrix to the thermal parameters by using eqs.~\eqref{house} and \eqref{hope2} for each factor of the factorized state \eqref{Mphys}. First, focusing on the $x_1^{\rm \rm phys}$ and $x_3^{\rm phys}$ modes, we see that they are in a TFD state with inverse temperature $\beta_{13}$ and frequency $\omega_{13}$ given by \begin{equation} \beta_{13}\omega_{13} = 2\, {\rm arcosh}\left(\frac{\bar\omega+\bar{\omega}_1}{\bar{\omega}_1-\bar\omega}\right)\,, \quad \omega_{13} e^{2r_{13}} = \sqrt{\bar\omega\, \bar{\omega}_1}\,, \end{equation} and the $x_2^{\rm \rm phys}$ and $x_4^{\rm phys}$ modes are in a TFD state with inverse temperature $\beta_{24}$ and frequency $\omega_{24}$ given by \begin{equation} \beta_{24} \omega_{24} = 2\, {\rm arcosh}\left(\frac{\bar{\omega}_1+\bar{\omega}_2}{\bar{\omega}_2-\bar{\omega}_1}\right)\,, \quad \omega_{24} e^{2r_{24}} = \sqrt{\bar{\omega}_1\, \bar{\omega}_2}\,. \end{equation} For these to have the same inverse temperature $\beta_0$ we must fix\footnote{The temperature is a free parameter because the modular Hamiltonian can always be rescaled to change the value of $\beta_0$. However, the dimensionless products $\omega \beta_0$ will remain fixed.} \begin{equation} e^{-2r_{13}} = \frac{2}{\beta_0 \sqrt{\bar\omega\,\bar{\omega}_1}} \, {\rm arcosh}\left(\frac{\bar\omega+\bar{\omega}_1}{\bar{\omega}_1-\bar\omega}\right)\,, \quad e^{-2r_{24}} = \frac{2}{\beta_0 \sqrt{\bar{\omega}_1\,\bar{\omega}_2}} \, {\rm arcosh}\left(\frac{\bar{\omega}_1+\bar{\omega}_2}{\bar{\omega}_2-\bar{\omega}_1}\right)\,, \end{equation} which leads to the following frequencies of the Rindler modes \begin{equation} \label{eq:freqs} \omega_{13} = \frac{2}{\beta_0} \,{\rm arcosh}\left(\frac{\bar\omega+\bar{\omega}_1}{\bar{\omega}_1-\bar\omega}\right)\,, \quad \omega_{24} = \frac{2}{\beta_0} \,{\rm arcosh}\left(\frac{\bar{\omega}_1+\bar{\omega}_2}{\bar{\omega}_2-\bar{\omega}_1}\right)\,. \end{equation} Lastly, we can take the small frequency limit (or equivalently, small cutoff limit) $\bar\omega \ll \Omega = 1/\delta$ to see that the $x_1^{\rm phys}$ and $x_3^{\rm phys}$ are the zero modes and that the $x_2^{\rm phys}$ and $x_4^{\rm phys}$ modes have frequencies proportional to the temperature \begin{equation} \omega_{13} = \frac{2^{13/8}}{\beta_0} \sqrt{\frac{\bar\omega}{\Omega}}\,, \quad \omega_{24} = \frac{2}{\beta_0}\, {\rm arcosh}\left(\frac{2+2^{3/4}}{2-2^{3/4}}\right) \approx \frac{2\pi}{\beta_0}\,. \end{equation} Lastly, we can explicitly write the modular Hamiltonian of the $x_1^{\rm phys}$ and $x_2^{\rm phys}$ system from the expression of their frequencies~\eqref{eq:freqs} \begin{equation} \begin{aligned} H_{\rm mod} = &\frac{1}{2M_0} \left(p_1^{\rm phys}\right)^2 + \frac{2\, M_0}{\beta_0^2}\, {\rm arcosh}^2\left(\frac{\bar\omega+\bar{\omega}_1}{\bar{\omega}_1-\bar\omega}\right) \left(x_1^{\rm phys}\right)^2\\ &+\frac{1}{2M_0} \left(p_2^{\rm phys}\right)^2 + \frac{2\, M_0}{\beta_0^2}\, {\rm arcosh}^2\left(\frac{\bar{\omega}_1+\bar{\omega}_2}{\bar{\omega}_2-\bar{\omega}_1}\right) \left(x_2^{\rm phys}\right)^2\,. \end{aligned} \end{equation} \section{Introduction} \input{sections/Introduction} \section{Purification Complexity of a Single Harmonic Oscillator}\label{warmup} \input{sections/GaussianOnemode} \section{Optimal Purification of Mixed Gaussian States}\label{sec:manyho} \input{sections/Nmodes} \section{Complexity of Thermal States in QFT} \label{apply01} \input{sections/thermal} \section{Complexity of Vacuum Subregions in QFT} \label{apply02} \input{sections/SubVac} \section{Holographic Complexity for Mixed States}\label{sec:holo} \input{sections/Holography} \section{Discussion}\label{sec:disc} \input{sections/Discussion} \section*{Acknowledgments} We would like to thank Cesar Ag\'on, Dorit Aharonov, Horacio Casini, Dongsheng Ge, Giuseppe Di Giulio, Giuseppe Policastro, Brian Swingle, Tadashi Takayanagi, Erik Tonni, Erik Verlinde, Jingxiang Wu and Ming-Lei Xiao for useful comments and discussions. Research at Perimeter Institute is supported in part by the Government of Canada through the Department of Innovation, Science and Economic Development Canada and by the Province of Ontario through the Ministry of Economic Development, Job Creation and Trade. JPH and SMR are supported in part by a Discovery Grant awarded to RCM by the Natural Sciences and Engineering Research Council of Canada. JPH is also supported by the Government of Ontario's Ministry of Advanced Education and Skills Development through a Queen Elizabeth II Graduate Scholarship in Science and Technology. RCM also received funding from the BMO Financial Group and from the Simons Foundation through the ``It from Qubit'' collaboration. Research by EC and JDC was supported by NSF grants PHY-1620610 and PHY-1820712. SC acknowledges funding from the European Research Council (ERC) under starting grant No.~715656 (GenGeoHol) awarded to Diego M. Hofman. EC, SC and RCM thank the Galileo Galilei Institute for Theoretical Physics for hospitality and the INFN for partial support where part of this work was carried out. JDC, JPH and SMR would like to thank IAS for their hospitality during PITP 2018 and for thought-provoking talks and conversation.
\section{Introduction} High-energy heavy-ion collisions at the Relativistic Heavy Ion Collider (RHIC) and the Large Hadron Collider (LHC) produce a fluid consisting of quarks and gluons, the fundamental constituents of Quantum Chromodynamics (QCD)~\cite{Busza:2018rrf,Aamodt:2010pa, ADAMS2005102, ADCOX2005184}. The produced fluid is particularly interesting because it is described on microscopic level by a renormalizable and fundamental quantum field theory. While first principle calculations of the macroscopic fluid properties are challenging, phenomenological and theoretical studies are motivated by an increasing amount of experimental results. Remarkably, data and models suggest that a fluid dynamic expansion might be behind some of the recent results of collective behaviour in yet smaller proton-nucleus and proton-proton systems~\cite{Nagle:2018nvi,PHENIX:2018lia, Acharya:2019vdf}. Alternative descriptions in terms of initial-state physics and medium-less hadron production are also being developed~\cite{Nagle:2018nvi, Mace:2018vwq, Bierlich:2018xfw, Greif:2017bnr, Lin:2004en, Zhou:2015iba}, all of which questions the uniqueness of a fluid-like response of the quark-gluon plasma (QGP). Therefore the resolution to the origins of collective behaviour will likely rely on quantitative rather than just qualitative agreement between data and model. To this end, we present a new framework for systematic studies of soft hadronic observables based on up-to-date and efficient modelling of heavy-ion collisions. We combine the successful initial condition model \textsc{TrENTo}~\cite{Moreland:2014oya}, with the recent viscous relativistic fluid dynamics implementation \textsc{Fluid{\it u}M}~\cite{Floerchinger:2018pje} and the novel resonance decay procedure \textsc{FastReso}~\cite{Mazeliauskas:2018irt}. The mode splitting implemented in \textsc{Fluid{\it u}M} allows for a very fast evolution with a single event taking mere seconds to compute. In our work we use an equation of state $p(T)$ based on recent Lattice-QCD calculations~\cite{Borsanyi:2016ksw,Bazavov:2014pvz}, see \cite{Floerchinger:2018pje}, and include both shear and bulk viscous corrections in the evolution and particle freeze-out. In addition we use an enlarged set of resonance decays ~\cite{Alba:2017mqu, Alba:2017hhe, parotto_private} based on the 2016 edition of the Particle Data Group book~\cite{Patrignani:2016xqp}. In the absence of precise first principle calculations, the phenomenological description of heavy-ion collisions has a number of open parameters at different stages of the evolution. They can be estimated indirectly from the comparison of simulations to experimental results. Obviously, a too large number of such parameters can limit the precision of this estimate. Moreover, covering a multi-dimensional parameter space is computationally expensive and requires efficient implementation of the model. In the present work, we determine the specific shear and bulk viscosities of the QGP, as well as the freeze-out temperature $T_\text{fo}$, the starting time of a fluid description $\tau_0$ and the initial entropy profile normalization. Previous multi-observable model-to-data fits focused on the centrality dependence of momentum integrated quantities, like particle multiplicity, mean transverse momentum or flow harmonics~\cite{Bernhard:2016tnd}. In this work we perform a systematic study of more differential data, namely, transverse momentum spectra with $p_\mathrm{T}<$ 3 GeV/$c$ of $\pi$, $K$, and $p$ in five centrality classes of Pb--Pb collisions at the center-of-mass energy per nucleon pair $\sqrt{s_\text{NN}}=2.76\,\text{TeV}$ at the LHC, and compare them with fluid dynamic simulations. Let us mention here already that we are able to put interesting and non-trivial constraints on transport properties, specifically shear and bulk viscosity, from the analysis of transverse momentum spectra for identified particles alone. This might come as a surprise to some readers because it was believed so far that significant constraints on transport properties need an analysis of anisotropic flow. While flow coefficients are indeed expected to contain even more detailed information, we want to emphasize that experimental data on transverse momentum spectra are by now of a rather high quality. We can exploit this here and perform a detailed statistical analysis including fits with systematic $\chi^2$ minimization. We find that $\chi^2$ rises rather quickly away from the global minimum which leads to surprisingly tight constraints on the QCD fluid properties. We summarize the details of initial condition, evolution and hadronization procedures in \Sec{sec:setup}. We discuss the fit procedure and determination of its uncertainties in \Sec{sec:analysis}. We then provide the best fit results and predictions for additional observables in \Sec{sec:spectra} and \Sec{sec:predictions}. Finally, we discuss the analysis and future directions in \Sec{sec:discussion}. \section{Setup\label{sec:setup}} In this section we briefly describe the different components of our theoretical model. We start with the time evolution as implemented in \textsc{Fluid{\it u}M} \cite{Floerchinger:2018pje} solving the equations of relativistic fluid dynamics with shear and bulk viscosity and corresponding relaxation times. Subsequently we turn to the initial conditions, specifically the shape of the energy density in the transverse plane for which we use the \textsc{TrENTo} model \cite{Moreland:2014oya}. Finally, kinetic freeze-out and the implementation of strong resonance decays is done using \textsc{FastReso} \cite{FastReso}. \subsection{Hydrodynamic evolution: \textsc{Fluid{\it u}M}} To solve the relativistic fluid equations of motion, we use the code package \textsc{Fluid{\it u}M} \cite{Floerchinger:2018pje}. It is based on the theoretical framework of relativistic fluid dynamics with mode expansion \cite{Floerchinger:2013rya, Floerchinger:2013hza, Floerchinger:2014fta}, where the fluid dynamic fields are decomposed in terms of a background-fluctuation splitting, similar to what is done for example in cosmology. Schematically, we write the fluid fields $\Phi(\tau ,r,\phi ,\eta )={ \Phi }_{ 0 }(\tau ,r)+{ \Phi }_{ 1 }(\tau ,r,\phi ,\eta)$. The non-linear evolution equations for an azimuthally and Bjorken boost symmetric background ${ \Phi }_{ 0 }(\tau ,r)$ are solved first, while azimuthally and rapidity dependent perturbations ${ \Phi }_{ 1 }(\tau ,r,\phi ,\eta)$ around this are then studied separately. The evolution equations for both the background and the perturbations around them can be implemented with very accurate and highly efficient numerical algorithms \cite{Floerchinger:2018pje}. For the present paper we are interested in azimuthally averaged transverse momentum spectra of identified particles in the mid-rapidity region and do not consider azimuthally and rapidity-dependent perturbations. Neglecting terms that are of quadratic or higher order in perturbation amplitudes, we need only the background solution to the fluid evolution equations as calculated from \textsc{Fluid{\it u}M}. The corresponding equations of motion have been analyzed from a mathematical perspective, and with an emphasis on their causality structure in ref.\ \cite{Floerchinger:2017cii}. We note here that the current implementation of \textsc{Fluid{\it u}M} features a flow at vanishing net baryon number chemical potential, based on a state-of-the-art thermodynamic equation of state~\cite{Borsanyi:2016ksw,Bazavov:2014pvz}, as well as shear and bulk viscous dissipation. For the present paper we assume the shear viscosity to entropy ratio $\eta/s$ to be independent of temperature. The bulk viscosity to entropy ratio $\zeta / s$ is taken to be temperature dependent, however. Specifically, we assume it to be of the Lorentzian form \begin{equation} \label{eq:bulk} \zeta/s= \frac{\left(\zeta/ s\right)_{\text{max}}}{1+\left(\frac{T-T_{\text{peak}}}{\Delta T}\right)^2}, \end{equation} with the peak temperature $T_{\text{peak}}=175$ MeV and $\Delta T=24$ MeV \cite{Moreland:2018gsh}. The maximum value $(\zeta/ s)_{\text{max}}$ is taken as a fit parameter. Shear and bulk relaxation times are assumed to be determined by the relations~\cite{Denicol:2014vaa} \begin{equation} \label{eq:Taupi} \frac{\tau_\text{shear}}{\eta/(\epsilon+p)}= 5 ,\qquad \frac{\tau_\text{bulk}}{\zeta/(\epsilon+p)} = \frac{1}{15\left( \frac{1}{3}- c_s^2 \right)^2 }+\frac{a}{\zeta/(\epsilon+p)}, \end{equation} where $\epsilon$ is the energy density, $p$ is the pressure, $c_s$ is the (temperature dependent) velocity of sound, and $a=0.1\, \text{fm/c}$ is a small offset such that a causal evolution of the radial expansion is indeed ensured \cite{Floerchinger:2017cii}. For more details on the implementation we refer to \cite{Floerchinger:2018pje}. \subsection{Initial conditions: \textsc{TrENTo}} In general terms, a characterization of the initial conditions for Israel-Stewart type fluid dynamics with azimuthal rotation and longitudinal boost symmetry as used for the background in \textsc{Fluid{\it u}M} consists of the temperature $T$, radial fluid velocity $u^r$, two independent components of shear stress $\pi_{\phi}^{\phi}$ and $\pi_{\eta}^{\eta}$ as well as bulk viscous pressure $\pi_{\mathrm{bulk}}$ on some initial Cauchy surface, such as $\tau=\tau_0$. In the present work we neglect initial radial flow and assume initially $\pi_{\phi}^{\phi}=\pi_{\eta}^{\eta}=\pi_{\mathrm{bulk}}=0$. This choice is respecting relativistic causality \cite{Floerchinger:2017cii}. The shape of the initial entropy density distribution in the transverse plane (which determines the temperature through the thermodynamic equation of state) is taken from the initial state model \textsc{TrENTo} \cite{Moreland:2014oya}, with an overall normalization factor that we take as a fit parameter. The parameters of \textsc{TrENTo} have been taken as in ref.\ \cite{Moreland:2014oya}, in particular we selected the reduced thickness parameter $p=0$, the fluctuation parameter $k=1.4$, the nucleon width $\sigma=0.6 \text{ fm}$ and the inelastic nucleon-nucleon cross section $\sigma^{\text{NN}}_{\text{inel}}=6.4 \text{ fm}^2$. Using this set of parameters we have generated the transverse density $T_\text{R}(x,y)$ for $10^5$ events with impact parameter sampled from the range $b\in[0 \, \text{fm} , 20 \, \text{fm}]$ and randomized event plane angle. As usual, the distribution of impact parameters is governed by the random distribution of nuclei in the transverse plane and the probability for them to scatter in the \textsc{TrENTo} model. It is convenient to shift the events in the transverse plane such that $\int d^2 x \{ \vec x \, T_\text{R}(\vec x) \}= 0$. The integrated transverse density $\int d^2x T_\text{R}(\vec x)$ is expected to be monotonously related to the total final charged particle multiplicity, therefore we used this quantity to divide the generated events into narrow multiplicity classes of one percent. Each of these centrality classes can be seen as an ensemble of events with random orientation in the transverse plane. For each centrality class we calculate the averaged or expected entropy density profile as \begin{equation} \label{eq:sinitial} s(r)=\frac{\text{Norm}_i}{\tau_0} \left\langle T_\text{R}(r,\phi) \right\rangle. \end{equation} (Note that for ensembles with random orientation in the transverse plane the right hand side is independent of $\phi$.) We introduce here a normalization constant $\text{Norm}_i$ for each centrality class $i$. Ideally, the initial state model should take care of centrality dependence and all centrality classes would have one identical normalization. While the parameter choice $p=0$ in \textsc{TrENTo} comes close to this, we observe some residual tension with the data which we lift by allowing the normalization to be centrality class dependent. We have taken out the initialization time $\tau_0$ to already take into account the main effect of the longitudinal expansion (Bjorken flow) at early times. The initial temperature as a function of radius is then obtained using the equation of state. While it is convenient for the theoretical description to work with rather narrow centrality classes, they are typically somewhat larger in the experimental results. There are now two possible strategies to deal with this. The first would be to calculate particle spectra for each of the narrow classes and to combine (average) them in a convenient way afterwards. The second strategy is to produce averaged entropy densities for the larger centrality classes by averaging the corresponding distributions from the more narrow classes and to propagate those. The difference in experimental observables between both procedures can be taken as an estimate for the importance of fluctuations. We have compared both strategies and found the difference for transverse momentum spectra to be rather small, of the order of $1\%$ for central collisions. Because of the advantage with respect to computational costs, we follow therefore the second strategy. \subsection{Freeze-out and resonance decays: \textsc{FastReso}} As the system cools down and dilutes, it crosses from a quark-gluon plasma to a fluid dominated by hadronic degrees of freedom. The fluid dynamic description of the latter breaks down eventually, because particle scatterings are no longer efficient in maintaining (first chemical and then kinetic) equilibrium. This necessitates the conversion of fluid fields, such as temperature and flow velocity, to the distribution of hadronic degrees of freedom. The dynamics of hadronization is not completely understood, but lattice QCD calculations show that below the QCD pseudo-critical temperature $T_{pc}=156\pm1.5\,\text{MeV}$~\cite{Bazavov:2018mes,Steinbrecher:2018phh}, color neutral hadrons become the dominant degrees of freedom of the plasma. In particular the equation of state approaches that of a hadron resonance gas (HRG)~\cite{Alba:2017hhe}. Around or somewhat below $155\,\text{MeV}$ in temperature, fluid fields are customary converted to particle distributions using Cooper-Frye procedure ~\cite{Cooper:1974mv}. The spectrum of hadron species $a$ on the freeze-out hypersurface $\Sigma$ is given by the following integral \begin{equation} E_{\bf p}\frac{d N_a}{d^3 {\bf p}} = \frac{\nu_a}{(2\pi)^3}\int_\Sigma f_a(\bar{E}_{\bf p}) p^\mu d\Sigma_\mu,\label{eq:CF} \end{equation} where $\nu_a$ is the degeneracy factor of spin/polarization states and $f_a$ is a particle distribution function, which, in addition to the particle energy in fluid rest-frame $\bar{E}_{\bf p} \equiv-u^\nu p_\nu$, may also depend on the local temperature $T(x)$, fluid velocity $u^\mu(x)$, chemical potential $\mu(x)$, viscous shear-stress $\pi^{\mu\nu}(x)$ and bulk viscous pressure $\pi_\text{bulk}(x)$. Chemical freeze-out takes place when particle species changing interactions are no longer able to keep up with the expansion rate. However, in practice, a simpler criterion based solely on the freeze-out temperature is used and the freeze-out surface $\Sigma$ is assumed to be a surface of constant temperature. One sometimes includes after chemical freeze-out and before kinetic freeze-out a phase described by fluid dynamics but for a fluid in partial chemical equilibrium (see \cite{Bebie:1991ij} for pioneering work in this regard). Such a fluid is governed by a number of conservation laws in addition to the ones for energy and momentum. We have implemented this in our theoretical model but found eventually that the improvement of transverse momentum spectra of the studied particles species is not significant. For this reason we use in the present work a simpler prescription with only a single, chemical {\it and } kinetic freeze-out. On the freeze-out surface we take the particle distribution function to be given by the equilibrium Bose-Einstein or Fermi-Dirac distribution (depending on the species), modified by additional corrections due to bulk and shear viscous dissipation, \begin{equation} f = f_\text{eq} + \delta f^\text{bulk} + \delta f^\text{shear}. \label{eq:initialf} \end{equation} For the viscous corrections we use the commonly employed parametrizations~\cite{Teaney:2003kp,Paquet:2015lta} \begin{align} &\delta f^\text{bulk} = f_\text{eq}(1\pm f_\text{eq})\left[\frac{\bar E_p}{T}\left(\tfrac{1}{3}-c_s^2\right)-\frac{m^2}{3 T\bar E_p} \right]\frac{\pi_\text{bulk}}{\zeta/\tau_\text{bulk}},\label{eq:bulkini}\\ &\delta f^\text{shear} = f_\text{eq}(1\pm f_\text{eq})\frac{\pi_{\rho\nu}p^\rho p^\nu}{2(\epsilon+p)T^2}.\label{eq:shearini} \end{align} Here $m$ is the mass of the primary resonance. After freeze-out the populations of unstable resonances decrease as a consequence of their decays and feed the spectra of long lived particles. This large modification of the pion, kaon and proton spectra can be calculated by decaying all (sufficiently unstable) resonances. An efficient procedure to calculate these direct decays was recently introduced by some of us in ref.~\cite{Mazeliauskas:2018irt}. The main idea is to apply the decay maps to the primary distributions in \Eq{eq:CF} \emph{before} doing the surface integral. The resulting distribution function of decay products can be decomposed into irreducible components (with respect to rotations in the fluid rest frame) that are pre-computed and stored~\cite{FastReso}. Furthermore, for the case of azimuthally symmetric and boost-invariant surface, the freeze-out integrals over space-time rapidity and azimuthal angle can also be pre-computed. Parametrizing the remaining 1+1 dimensional freeze-out surface in radial coordinates by $(\tau(\alpha), r(\alpha) )$ where $\alpha\in (0,1)$ is some parameter, the Cooper-Frye freeze-out integral simplifies to one-dimensional integral over $\alpha$, \begin{align} \frac{d N}{2\pi p_Tdp_Tdy} = & \frac{\nu}{(2\pi)^3} \int_0^1\! d\alpha \; \tau(\alpha) r(\alpha) \nonumber\\ & \times {\Bigg \{} \frac{\partial r}{\partial\alpha} \Big[ K^\text{eq}_1 + \frac{\pi^\eta_\eta}{2(\epsilon+p)T^2} \; K_1^\text{shear} + \frac{\pi^\phi_\phi}{2(\epsilon+p)T^2} \; K_3^\text{shear} - \frac{ \pi_\text{bulk}}{\zeta / \tau_\text{bulk}}\; K_1^\text{bulk} \Big] \nonumber\\ & -\frac{\partial \tau}{\partial\alpha} \Big[ K^\text{eq}_2 + \frac{\pi^\eta_\eta}{2(\epsilon+p)T^2} \; K_2^\text{shear}+ \frac{\pi^\phi_\phi}{2(\epsilon+p)T^2} \; K_4^\text{shear} - \frac{\pi_\text{bulk}}{\zeta/ \tau_\text{bulk}} \; K_2^\text{bulk} \Big] {\Bigg \}}, \label{eq:backgroundspectrumintermsofkernels} \end{align} Here $K_i^\text{eq}(p_{\rm T}, u^r), K_i^\text{shear}(p_{\rm T}, u^r)$ and $K_i^\text{bulk}(p_{\rm T}, u^r)$ are rapidity and azimuthal angle integrated decay kernels~\cite{Mazeliauskas:2018irt}. The kernels have implicit dependence on scalars like freeze-out temperature or decay constants which do not vary on the freeze-out surface. The spectra of pions, kaons and protons as calculated with \Eq{eq:backgroundspectrumintermsofkernels} can then be compared to the experimentally measured $p_{\rm T}$ differential spectra of identified hadrons. For the calculation of freeze-out kernels in \Eq{eq:backgroundspectrumintermsofkernels}, we use the publicly available code \textsc{FastReso} to perform strong and electromagnetic decays of unstable hadrons\footnote{The feed-down from weak decays of $\Lambda$, $\Xi$ and $\Omega$ is not included in accordance with experimental procedure. We neglect resonance spectral widths and perform only the allowed 2-body and 3-body decays.} up to mass $m \approx 3\,\text{GeV}$. We use the list of $\sim 700$ resonances from refs.~\cite{Alba:2017mqu, Alba:2017hhe, parotto_private}, which is based on all listed states (also less well established states) in the Particle Data Group 2016 publication~\cite{Patrignani:2016xqp}. This is approximately twice the number of resonances used previously~\cite{Mazeliauskas:2018irt}. To perform a scan in freeze-out temperature, we varied it in the range $T_\text{fo}\in[130,180]\,\text{MeV}$ with $0.5\,\text{MeV}$ increments and zero baryon chemical potential. The transverse momentum $p_{\rm T}$ (in GeV) and the radial fluid velocity $u^r$ have been discretized each on a 81 point non-linear grid in the range of $[0,3.5]$. \section{Data analysis\label{sec:analysis}} \subsection{Global fit procedure} To summarize, our theoretical description has currently the free parameters $\eta/s$, $(\zeta/s)_\text{max}$, the initialization time $\tau_0$, the freeze-out temperature $T_\text{fo}$ and they are assumed to be independent of the centrality class. In addition, we have the normalization constants $\text{Norm}_i$ for the initial entropy profile which depend on the centrality classes. In order to find the most likely model parameters, in this work we aim at fitting the $p_{\rm T}$-differential spectra of pions, kaons, and protons in five centrality intervals: 0--5\%, 5--10\%, 10--20\%, 20--30\% and 30--40\% for Pb--Pb collisions at $\sqrt{s_{\rm NN}}$ = 2.76 TeV measured by the ALICE Collaboration~\cite{Abelev:2013vea}. We choose to restrict to the soft particle momentum range $p_{\rm T}<3\, \text{GeV}/c$, a region which is believed to be described by a fluid dynamic approximation to QCD dynamics. It is sensitive to radial flow, the viscous transport coefficients and the initial conditions of the plasma~\cite{Gale:2013da, Bernhard:2016tnd, Teaney:2009qa, Dubla:2018czx}. Nine model parameters are left free to vary simultaneously in specific intervals (see Table~\ref{tab:parranges}), in which the physical values are expected to be located based on physical considerations and previous work~\cite{Moreland:2014oya, Dubla:2018czx, Ryu:2017qzn}. Of course it is important to check {\it a posteriori} that the best fit values are indeed inside these intervals and not on its boundary (in the latter case one needs to allow for larger intervals). \begin{table}[ht!] \begin{center} \begin{tabular}{ccccc} \hline \hline $\text{Norm}_i$ & $\tau_{0}$ (fm/$c$)& $\eta/s$ & $(\zeta/s)_\text{max}$ & $T_\text{fo}$ (MeV)\\ 50-67 & 0.1-0.6& 0.08-0.25 & 0.005-0.1 & 130-150\\ \hline \hline \end{tabular} \caption{Ranges for independently varied model parameters.} \label{tab:parranges} \end{center} \end{table} In order to determine which combination of the parameters provides the best description of the experimental data we search for the global minimum of \begin{equation} \chi^2 = \sum^{N}_{i=1}\frac{(x_i - y_i)^2}{\sigma^2_i},\label{eq:chi2} \end{equation} where $x_i$ is the experimental value of the transverse momentum spectrum at some $p_{\mathrm{T}}$ interval for a particular hadron species and centrality class, $y_i$ is the corresponding model prediction (for a given set of model parameters) and $\sigma_i=\sqrt{\sigma^2_{i,\text{sys}} + \sigma^2_{i,\text{stat}}}$ is the sum (in quadrature) of the systematic and statistical uncertainties of the corresponding experimental data point. Let us remark here that we do not introduce a global theoretical uncertainty to all data points, as it was done in some previous studies \cite{Bernhard:2016tnd,Bernhard2019}. The sum in \eqref{eq:chi2} goes over the five centrality classes (0--5\%, 5--10\%, 10--20\%, 20--30\% and 30--40\%), three particle species ($\pi, K,p$) and the number of $p_{\mathrm{T}}$ intervals in the fit range up to 3 GeV/$c$ ($N^\pi_{p_{\rm T}}=41$, $N^K_{p_{\rm T}}=36$ and $N^p_{p_{\rm T}}=34$). The total number of degrees of freedom is accordingly $N_\text{dof} = 555-9$. Note that the degree of correlation in the systematic uncertainties as a function of $p_{\rm T}$ in the experimental measurements is not reported and we do not consider such correlations in the fit. Furthermore, the simulations themselves might have considerable systematic uncertainties. For example, our model assumes a rather simple freeze-out picture without a detailed modeling of hadronic scatterings and the dissipative corrections to the single-particle distribution functions on the freeze-out surface are arguably somewhat uncertain. Also, our model neglects currently a possible temperature dependence of the shear viscosity to entropy ratio. Independently from this, also completely new physics might affect the experimental data in the low transverse momentum regime, for example pion condensation, see \cite{Begun:2015ifa, Begun:2016cva} and references therein. It is hard to predict {\it a priori} the change to model results due to such effects but for the interpretation of results it is important to keep in mind that theoretical uncertainties exist. It remains to find the values of the model parameters which correspond to the fit of the experimental measurements with minimum ${\chi}^{2}$. We have explored here different strategies. What works best eventually is to discretize the model parameters on a hypercubic lattice and to use numerical interpolation between the lattice points. This allows to determine the $\chi^2$ landscape systematically and with the necessary precision. We discretized the parameter ranges by 10 equidistant values for each parameter, which correspond to $10^5$ different model calculations for each centrality class. Let us note here that, thanks to streamlined fluid dynamic evolution and resonance decay procedures in our framework, one model simulation for a particular set of parameters takes only a few tens of seconds per centrality on a single core and even in the exhaustive search with $10^5$ simulations, the entire fit can be performed with a rate of 1 day/centrality class using a $\sim$ 100 core machine. Once all $10^5$ simulations have been computed we use an order-7 spline interpolation\footnote{In languages like Mathematica or Scientific Python such multi-dimensional, higher order B-spline interpolation schemes are readily implemented.} between them and apply a numerical minimization technique to find the lowest value of ${\chi}^{2}$ and its position. For this minimization we used a Minuit algorithm \cite{James:1994vla} to find the global minimum. The best fit found gives a $\chi^2/N_\text{dof}=1.37$. As a check of the numerical interpolation, we have also calculated $\chi^2$ directly for this specific configuration and obtained a compatible result. The best fit parameters obtained in this way are reported in Table \ref{tab:bestfit1.par}. With the choice of the \textsc{TrENTo} parameter $p$ = 0 we observe that the values of $\rm Norm_i$ depend only mildly on centrality (as observed previously~\cite{Bernhard:2016tnd}). \begin{figure*} \centering \includegraphics[width=1.\linewidth]{figures-p0/Figure1-p0-17-03-2020.pdf} \caption{Contour plots of ${\chi}^{2}/N_{\text{dof}}$ as a function of pairs of model parameters with all other parameters kept at the global minimum. The cross denotes the position of the minimum.} \label{correlations} \end{figure*} \subsection{Uncertainties and correlations of model parameters} In order to study correlations between pairs of model parameters according to their posterior probability distribution we use two methods. Firstly, two-dimensional slices of the nine dimensional ${\chi}^{2}$ landscape are computed with the remaining parameters kept at their global best fit (minimum $\chi^2$) value. The results are shown in Fig. \ref{correlations}. The first four panels on the top show the correlations of the initial entropy profile normalization $\text{Norm}_i$ with respect to the other four parameters. As an example we report the normalization for the centrality interval 0--5\%, $\text{Norm}_1$. Thanks to the factored out scaling with initialization time $\tau_{0}$ in \Eq{eq:sinitial}, the different $\text{Norm}_i$ are observed to be almost independent from the other parameters. Only a rather weak correlation is observed between the initial normalization and $\eta$/s as well as $\tau_0$. This could be due to the combined effects of viscous entropy production at early times and the delayed generation of radial flow for larger $\tau_0$ values. In the other six panels of Fig.~\ref{correlations} the correlations of the remaining parameter pairs are shown. We see positive correlation between $(\zeta/s)_\text{max}$ and $\eta/s$, between $\tau_{0}$ and $\eta/s$ as well as between $\tau_{0}$ and $T_\text{fo}$. On the other hand, negative correlations are instead observed between $T_\text{fo}$ and $\eta/s$ as well as between $\tau_{0}$ and $(\zeta/s)_\text{max}$. Finally no strong and clear correlation is observed between $T_\text{fo}$ and $(\zeta/s)_\text{max}$. In order to quantify and supplement the information that is visually available in Fig.\ \ref{correlations}, we also determine numerically the form of $\chi^2$ as a function of the nine model parameters in the vicinity of the minimum. In terms of deviations from the best fit value $\Delta r$ = ($\Delta \text{Norm}_i$, $\Delta \tau_0/(\text{fm/c})$, $\Delta (\eta/s)$, $\Delta(\zeta/s)$, $\Delta T_\text{fo}/\text{MeV}$) we find \begin{equation} \chi^2 =\chi_{\text{min}} + \sum_{i,j=1}^9 A_{ij} \Delta r_i \Delta r_j + \mathcal{O}(\Delta r^3). \label{eq:chi2quadratic} \end{equation} This information is interesting in particular because the probability for the correct fit parameters, given the experimental data we have analysed, is proportional to $e^{-\chi^2/2}$. The quadratic approximation to $\chi^2$ in eq.\ \eqref{eq:chi2quadratic} corresponds then to a Gaussian form of this so-called {\it posterior probability}. The diagonal values of the inverse matrix $A^{-1}$ can then formally be understood as variances of the fit parameters in this approximation to the posterior probability, \begin{equation} \langle (\Delta r_j)^2 \rangle = (A^{-1})_{jj}. \label{eq:defDeltarj} \end{equation} Moreover, the matrix \begin{equation} \rho_{ij} = \frac{(A^{-1})_{ij}}{\sqrt{(A^{-1})_{ii} (A^{-1})_{jj}}} = \frac{\langle \Delta r_i \Delta r_j \rangle}{\sqrt{\langle \Delta r_i^2 \rangle \langle \Delta r_j^2 \rangle}}, \label{eq:derhoij} \end{equation} quantifies correlations between the fitted parameters, again in a Gaussian approximation to the posterior distribution. Note that this information goes beyond what is visually available in Fig.\ \ref{correlations}. The latter shows two-dimensional sections through the $\chi^2$ landscape with the other parameters kept fixed. An expansion around the minimum gives the entries of the matrix $A_{ij}$. However, for the correlations as quantified in eq.\ \eqref{eq:derhoij} one needs actually the entries of the inverse matrix $A^{-1}$. Note that these considerations assume that the uncertainties that enter Eq.\ \eqref{eq:chi2} are independent and normally distributed. { \def0.5{0.5} \begin{table*} \centering \begin{tabular}{ccccccccc} \hline \hline $\text{Norm}_1$ & $\text{Norm}_2$ & $\text{Norm}_3$ & $\text{Norm}_4$ & $\text{Norm}_5$ & $\eta/s$ & $(\zeta/s)_\text{max}$ & $T_\text{fo}$ & $\tau_0$ \\ \hline 1 & 0.89 & 0.89 & 0.89 & 0.89 & -0.72 & -0.78 & 0.67 & 0.49 \\ 0.89 & 1 & 0.89 & 0.89 & 0.89 & -0.72 & -0.77 & 0.66 & 0.49 \\ 0.89 & 0.89 & 1 & 0.89 & 0.89 & -0.72 & -0.77 & 0.65 & 0.5 \\ 0.89 & 0.89 & 0.89 & 1 & 0.89 & -0.71 & -0.76 & 0.64 & 0.5 \\ 0.89 & 0.89 & 0.89 & 0.89 & 1 & -0.71 & -0.76 & 0.63 & 0.49 \\ -0.72 & -0.72 & -0.72 & -0.71 & -0.71 & 1 & 0.97 & -0.88 & 0.13 \\ -0.78 & -0.77 & -0.77 & -0.76 & -0.76 & 0.97 & 1 & -0.85 & -0.01 \\ 0.67 & 0.66 & 0.65 & 0.64 & 0.63 & -0.88 & -0.85 & 1 & 0.01 \\ 0.49 & 0.49 & 0.5 & 0.5 & 0.49 & 0.13 & -0.01 & 0.01 & 1 \\ \hline \hline \end{tabular} \caption{Correlation matrix $\rho_{ij}$ between the fitted parameters in a Gaussian approximation to the posterior distribution as defined in eq.\ \eqref{eq:derhoij}.} \label{rhoij} \end{table*} } We show the resulting matrix $\rho_{ij}$ in Table\ \ref{rhoij}. The uncertainties on the model parameters according to eq.\ \eqref{eq:defDeltarj} are shown in Table \ref{tab:bestfit1.par} as uncertainties from the $\chi^2$ landscape. One remarks here that the latter are actually rather small. On the one side, this illustrates nicely that the experimental data are of high quality and have a high power to constrain theoretical models. On the other side, some remarks of caution about a too straight-forward interpretation are in order. It is known that estimating model parameters including their uncertainty is difficult for situations with large $N_\text{dof}$ and when the minimum $\chi^2$ deviates substantially from its statistical expectation value (for a complete theoretical model) $\langle \chi^2 \rangle = N_\text{dof}$. This problem arises indeed for us when we attempt a global fit for the full range of transverse momenta and all five centrality classes with a single set of parameters. As a characteristic one may calculate the ``goodness of fit'' $Q=1-F_{\chi^2}(\chi^2, N_\text{dof})$ where $F_{\chi^2}(x,\nu)$ gives the cumulative $\chi^2$ distribution function with $\nu$ degrees of freedom. For the full global fit we find $ Q=1.8\times 10^{-8}$, which is indeed very small. This can be understood as the probability for the observed minimal $\chi^2$ given the data are correctly described by the model and all deviations from it arise indeed due to independent Gaussian fluctuations of the experimental data points. In other words, it is rather unlikely that the minimum $\chi^2=1.37\times N_\text{dof}$ we find (and in particular the deviation from the expectation value $\langle\chi^2 \rangle=N_\text{dof}$) arises due to statistical fluctuations only. The fact that the goodness of fit is so small means that the theoretical model as it is currently implemented is in fact incomplete. As we will see in the next section, the situation is not as bad, and our fluid model is certainly competitive with other attempts for theoretical descriptions, at least by visual inspection. Certain physics features might be missing, specifically in the low transverse momentum region for pions. Nevertheless, we should take the experimental data and the goodness of fit seriously. This leaves us with the problem to estimate the uncertainty of model parameters. \subsection{Estimation of systematic uncertainties} In order to quantify how well the model parameters of the fluid description can actually be constrained from transverse momentum spectra, we cannot rely purely on the fit uncertainties, which are unrealistically small. As discussed above, the underlying reason is that the theoretical model is not complete. This can be seen directly from the goodness of fit estimate, but also indirectly from the fact that the outcome for the most likely model parameters depends on how the fits are being done in detail. In this subsection we will discuss this latter point, and estimate systematic uncertainties of the model parameters through variations of the fitting scheme. The first check consists in fitting the five centrality classes separately and estimating the model parameters as a function of centrality. In addition to quantifying uncertainties, this test might also reflect possible temperature dependence of transport coefficients (specifically $\eta/s$). On the left hand side of Fig.\ \ref{systematicc} we show the result for the most likely model parameters when they are determined separately for the different centrality classes (full circles). The error bars illustrate the corresponding uncertainties according to eq.\ \eqref{eq:defDeltarj}, determined from the $\chi^2$ landscape. One finds that the variation arising from the centrality dependence is somewhat larger than the calculated fit uncertainties. In a similar way, we also perform the fit separately restricted to single particle species, as well as restricted to two out of three particle species. This is done globally with respect to centrality. The results for the most likely model parameters obtained in this way are shown on the right hand side of Fig.\ \ref{systematicc} (open stars). One observes that the variations of fit parameters are here substantially larger than the statistical uncertainties estimated from the $\chi^2$ variation. On the other side, for the separate (single particle) fits of pions, kaons or protons we see that $\chi^2/N_\text{dof}$ drops below unity, which indicates the possibility of over-fitting. Since the $\rm Norm_i$ does not show a significant centrality dependence, we have also tried to perform a global fit with 5 parameters, where only one common normalization for all centrality intervals is used. The results from this test is reported in with the black dashed line in Fig.\ \ref{systematicc} and as expected no significant variations are observed with respect to the default fit, however with a larger $\chi^2/N_\text{dof}$ = 1.47. In Fig.~\ref{systematicc} the red lines represent the values obtained from the global fit reported in Table \ref{tab:bestfit1.par}. From the variations shown in Fig.~\ref{systematicc} we determine systematic uncertainties of the fitted model parameters and report them in Table \ref{tab:bestfit1.par} in the right-most column. Specifically, we take this uncertainty to be the maximal deviation seen in Fig.~\ref{systematicc} from the best fit parameter. \begin{table} \begin{center} \begin{tabular}{c|c|c|c} \hline \hline Model & Best fit & Uncertainty & Uncertainty \\ parameter & value & from $\chi^2$ & from fit\\ & & landscape & variations \\ \hline $\text{Norm}_1$ & 54.2 & $\pm$0.6 & -3.3, +9.0 \\ $\text{Norm}_2$ & 55.3 & $\pm$0.6 & -3.3, +8.4 \\ $\text{Norm}_3$ & 56.1 & $\pm$0.6 & -2.9, +7.7 \\ $\text{Norm}_4$ & 56.9 & $\pm$0.7 & -2.9, +7.2 \\ $\text{Norm}_5$ & 56.9 & $\pm$0.7 & -3.4, +6.2 \\ $\tau_{0}$ [fm/c] & 0.179 & $\pm$0.005 & -0.009, +0.001\\ $\eta/s$ & 0.164 & $\pm$0.007 & -0.07, +0.079 \\ $(\zeta/s)_\text{max}$ & 0.059 & $\pm$0.003 & -0.043, 0.040\\ $T_\text{fo}$ [MeV] & 137.1 & $\pm$0.3 & -2.8, +8.0\\ \hline \hline \end{tabular} \caption{Best fit parameters and their uncertainties determined from the $\chi^2$ landscape through eq.\ \eqref{eq:defDeltarj}, and from the variation of the fitting procedure as reported in Fig.~\ref{systematicc}. For the global fit we find $\chi^2/N_\text{dof}=1.37$.} \label{tab:bestfit1.par} \end{center} \end{table} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{figures-p0/Fig2-20-03-2020.pdf} \caption{Best fit model parameters and corresponding $\chi^2/N_\text{dof}$ obtained when different centrality classes are fitted separately (left side) and when the fit is restricted to kaons or kaons and pions (right side). We use these variations to estimate uncertainties of the best fit parameters as reported in Table~\ref{tab:bestfit1.par}.} \label{systematicc} \end{figure} \section{Results and discussion\label{sec:results}} The final step in the modeling workflow is to compute observables with best fit parameters, Table~\ref{tab:bestfit1.par}, and to make predictions for observables not used in the fit. In this work, the simulations are performed for Pb--Pb collisions at $\sqrt{s_{\rm NN}}$ = 2.76 TeV for the centrality intervals 0--5\%, 5--10\%, 10--20\%, 20--30\% and 30--40\%. First, we compare the fitted $p_{\rm T}$-differential spectra of identified hadrons to experimental measurements. Then we study the derived quantities, like the total multiplicities and mean-$p_{\rm T}$ for different hadron species. Finally, we make model calculations for observables not used in the fit. Namely, we compute the $p_{\rm T}$ spectra for strange and multi-strange baryons at the same collision energy and centrality classes at $\sqrt{s_{\rm NN}}$ = 2.76 TeV and we make predictions for the pion, kaons, and protons spectra in Pb--Pb collisions at $\sqrt{s_{\rm NN}}$ = 5.02 TeV. \subsection{Fitted particle spectra of $\pi$, $K$, $p$\label{sec:spectra}} \begin{figure*} \centering \includegraphics[width=\linewidth]{figures-p0/Figure3_17_03_2020.pdf} \caption{Top: The best fit for $\pi, K, p$ spectra compared to the experimental data in five centrality classes in Pb--Pb collisions at $\sqrt{s_{\rm NN}}$ = 2.76 TeV. Bottom: The data to model ratios. The shaded areas correspond to the sum in quadrature of the statistical and systematic experimental uncertainties. \label{bestfit} } \end{figure*} In Fig.~\ref{bestfit} (top panels) we show the transverse momentum differential spectra of identified light hadrons $\pi$, $K$ and $p$ using our best fit parameters ($\chi^2/N_\text{dof}=1.37$) listed in Table~\ref{tab:bestfit1.par} (lines) and we compare our results with the ALICE measurement (symbols). The bottom panels show the data to model ratio with shaded areas representing the combined experimental uncertainties. Simulations are in overall good quantitative agreement with the experimental measurements. Kaon and proton spectra are reproduced within 10\%-20\% accuracy and within $3\sigma$ of experimental errors from the data or the entire $p_{\rm T} < 3\, (\text{GeV}/c)$ momentum range in all the centrality classes. The pion spectra is reproduced well in a narrower $ 0.5< p_{\rm T} < 2.5\, (\text{GeV}/c)$ momentum range, while low-$p_{\mathrm{T}}$ pions are systematically underpredicted and make major contributions to the relatively large $\chi^2/N_\text{dof}=1.37$ in the fit. We checked that excluding soft pions from the fit results in a significantly smaller $\chi^2/N_\text{dof}\lesssim 0.6$ and the minimum moves out from the parameter ranges given in Table~\ref{tab:parranges}. Such discrepancies in the pion spectra are well known and have been observed both in hydrodynamic simulations~\cite{Song:2013qma,Alqahtani:2017tnq,Ryu:2017qzn, Dubla:2018czx} and blast-wave fits with resonance decays~\cite{Mazeliauskas:2019ifr,Melo:2019mpn}. The enhancement of low-$p_{\mathrm T}$ pion spectra is typically attributed to the feed-down of resonance decays~\cite{Schnedermann:1993ws}. However, even after we included a considerably larger set of primary resonances~\cite{Alba:2017mqu, Alba:2017hhe, parotto_private}, the agreement of soft pion spectra improved only marginally. Additional physics effects like finite widths of resonance decays~\cite{Huovinen:2016xxq}, the presence of pion condensation in heavy-ion collisions~\cite{Begun:2015ifa, Begun:2016cva} or going beyond linearised viscous corrections to the freeze-out spectra~\cite{Alqahtani:2017tnq} are being studied. We would like to note here that our simulations show flat data to model ratio for protons within the uncertainties for the considered momentum range and in all centrality classes. However, a slight tendency towards over-predicting the low $p_{\mathrm T}$ protons is also observed. In this context it is interesting to note that in studies simulating a hadronic phase after chemical freeze-out~\cite{Ryu:2017qzn,Dubla:2018czx}, protons have been observed to receive an additional boost, resulting in a harder spectrum. In addition to the data to model comparison of partice spectra, we can compute other derived observables: particle multiplicity and mean $p_{\rm T}$. In the top panel of Fig.~\ref{yield_and_meanpt} we compare our results of total charged and identified particle multiplicities at mid-rapidity as a function of collision centrality for pions, kaons, and protons with the ALICE measurements~\cite{Abelev:2013vea}. Our simulations give a reasonably good description of the centrality dependence of the charged hadron multiplicity. However, also in this case we see a tension with the pion and total charged hadron yields, especially in most central collisions, which is a clear reflection of the underestimation of the low $p_{\rm T}$ pion spectra observed in Fig.~\ref{bestfit}. In the bottom panel of Fig.~\ref{yield_and_meanpt} we compare the mean transverse momentum $\langle p_{\rm T} \rangle$, for pions, kaons, and protons as a function of centrality between our simulations and the experiment~\cite{Abelev:2013vea}. While $\langle p_{\rm T} \rangle$ of kaons agrees very well with the experimental measurements, the $\langle p_{\rm T} \rangle$ of pions and protons show some residual deviations. For the pions this is a reflection of the deviation between model and data in the transverse momentum spectrum below $p_{\rm T}$ = 0.5 GeV/$c$, which results in a slightly larger $\langle p_{\rm T} \rangle$ for pions in our model. As for the protons, the slight discrepancy could be due to the absence of an hadronic phase between chemical and kinetic freeze-out in our model. We note that similar discrepancies are observed in other hydrodynamic simulations~\cite{Ryu:2017qzn, Alqahtani:2017tnq} and none appears able to reproduce data within the very small experimental uncertainties. \begin{figure} \centering \includegraphics[width=0.49\linewidth]{figures-p0/Figure4a-p0.pdf} \hfill \includegraphics[width=0.49\linewidth]{figures-p0/Figure4b-p0.pdf} \caption{Mid-rapidity densities d$N/$d$y$ (for $|y|<$ 0.5) for charged hadrons $h^\pm$, pions $\pi^+$, kaons $K^+$ and protons $p$ (top panel) and mean--$p_\text{T}$ (bottom panel) as functions of centrality from the calculation in comparison with the ALICE experimental measurements~\cite{Abelev:2013vea, alicemult}.} \label{yield_and_meanpt} \end{figure} To our best knowledge no recent heavy-ion simulations (including our own presented here) are able to produce a uniformly good description of identified particle spectra from central to mid-central nucleus-nucleus collisions if experimental uncertainties are taken seriously. The pioneering studies of \cite{Bozek:2009dw} showed excellent agreement of identified particle spectra measured at RHIC with ideal hydrodynamic simulations, but the agreement worsened when effects of viscosity were included. In the \textsc{EKRT} model~\cite{Niemi:2015qia}, pion spectra are described well at the expense of over-predicted kaon and proton yields, which is in line with our finding when we attempt to fit only the pion spectra. In Ref.~\cite{Ryu:2017qzn} where the effect of both bulk viscosity and hadronic rescattering were studied, the data to model agreement is arguably on the same level as in our work, although we employ a single freeze-out approximation. We note here that the extensive Bayesian analyses of refs.~\cite{Bernhard:2016tnd,Bernhard2019} have concentrated on momentum integrated observables. In summary, the excellent quality of experimental data of identified particle spectra indicates the need of including additional physics in hydrodynamic simulations of heavy-ion collisions. \subsection{Strange, multi-strange and energy dependence of particle spectra\label{sec:predictions}} Having found the optimal parameters of our model, many other observables, not used in the fit, can be directly predicted. This is an important step in validating the physics picture behind the model. Therefore we use the fluid dynamic evolution with the best fit parameters to compute the $p_{\rm T}$ spectra of strange and multi-strange hadrons ($\Lambda$, $\Xi$, $\Omega$) and compare the results with the ALICE measurements \cite{Abelev:2013xaa, ABELEV:2013zaa}. The comparison is shown in Fig.~\ref{LXO} for the 10--20\% (left panel) and 20--40\% (right panel) centrality intervals. \begin{figure*}[ht!] \centering \includegraphics[width=0.8\linewidth]{figures-p0/Figure5-18-03-2020.pdf} \caption{ Differential $p_{\rm T}$ spectra of strange and multi-strange baryons of Pb--Pb collisions with $\sqrt{s_\text{NN}}$ = 2.76 TeV. The normalization for both centrality intervals is taken from a global 5D fit with a value of 55.2.} \label{LXO} \end{figure*} From the comparison one can see that if the value of $T_\text{fo}= 137.1\,\text{MeV}$ is kept the same as obtained from the best fit (solid lines), the experimental $p_{\rm T}$-differential spectra of strange and multi-strange baryons are underestimated by the simulation. This effect is more pronounced for the $\Lambda$ baryons, which shows a $\sim 40\%-50\%$ discrepancy, while for the $\Xi$ and $\Omega$ the simulation and data tend to agree for $p_{\rm T}$ $>$ 2 GeV/$c$. In previous work \cite{Ryu:2017qzn} it was observed that strange and multi-strange baryons are more sensitive to a change in the switching temperature from a fluid evolution to URQMD dynamics than pions, kaons and protons. In our case, if we increase the value of $T_\text{fo}$ to 145 MeV, while keeping all other parameters fixed, the simulation shows better agreement with data at low momentum, see in Fig.~\ref{LXO} (dashed lines), but $\Xi$ is then over-predicted for $p_{\rm T}>2\,\text{GeV}/c$. The tendency of strange and multi-strange hadrons preferring higher freeze-out temperatures~\cite{Bellwied:2018tkc,Bluhm:2018aei}, is sometimes used as an evidence for the scenario of sequential hadronization where the switching from quark to hadron degrees of freedom occurs at different temperatures for different particle flavours~\cite{Bellwied:2013cta, Adamczyk:2017iwn,Alba:2020jir}. However, one should not discount the possibility that additional resonance feed-down might improve the agreement with data. Indeed, by approximately doubling the list of primary hadrons~\cite{Alba:2017mqu, Alba:2017hhe, parotto_private}, we observed a nearly 20\% increase in the feed-down for $\Lambda$ baryons compared to previous calculations~\cite{Mazeliauskas:2018irt}. Further extensions of decay channels and global fits including the strange particles would certainly reduce the apparent discrepancy. Finally, we can use our model to make predictions for the $p_{\mathrm{T}}$-differential spectra of pions, kaons and protons in Pb--Pb collisions at $\sqrt{s_\text{NN}}$ = 5.02 TeV. At higher collision energies, nuclei have more energy to deposit in the collision area, which ultimately results in an increased final particle multiplicity and higher initial QGP energy density. However as the increase of multiplicity is fractional, the fundamental properties of the QGP are not expected to change substantially and we can use the same best fit model parameters to predict particle spectra at higher energies. The only change made is the overall normalization $\text{Norm}_i$ of the initial entropy density profile. The normalization at $\sqrt{s_\text{NN}}$ = 5.02 TeV Pb--Pb collisions is fixed by doing a fit to the published unidentified charged hadron multiplicity as a function of the collision centrality~\cite{Adam:2015ptt}\footnote{We performed the fit in the same centrality classes as used for $\sqrt{s_\text{NN}}$ = 2.76 TeV Pb--Pb by combining the ALICE measurement at $\sqrt{s_\text{NN}}$ = 5.02 TeV energy into larger centrality bins. The new normalization factors are correspondingly $\text{Norm}_i= 75.6, 78.1, 77.8, 76.8, 76.4$.}. We report the result in Fig.~\ref{5tevMult}, together with the model calculations for integrated yields of pions, kaons and protons as a function of centrality. The corresponding plots for the $p_{\mathrm{T}}$-differential spectra of pions, kaons and protons in Pb--Pb collisions at $\sqrt{s_\text{NN}}$ = 5.02 TeV are reported in Fig.~\ref{predictionspectra} for the centrality intervals 0--5\%, 5--10\%, 10--20\%, 20--30\% and 30--40\%. The $p_{\mathrm{T}}$-spectra at $\sqrt{s_\text{NN}}$ = 5.02 TeV are higher and flatter than the ones at $\sqrt{s_\text{NN}}$ = 2.76 TeV, which illustrates that stronger radial flow has been developed in the systems with larger final multiplicities at the higher collision energy. \begin{figure}[ht!] \centering \includegraphics[width=0.49\linewidth]{figures-p0/Figure6-p0.pdf} \caption{Mid-rapidity densities dN/d$y$ ($\lvert y \rvert <$0.5) of charged hadrons as functions of centrality in Pb--Pb collisions at $\sqrt{s_\text{NN}}$ = 5.02 TeV in comparison with the ALICE measurements~\cite{Adam:2015ptt}. Prediction for the mid-rapidity densities dN/d$y$ ($\lvert y \rvert <$0.5) of pions, kaon and protons are also reported.} \label{5tevMult} \end{figure} \begin{figure*}[ht!] \centering \includegraphics[width=\linewidth]{figures-p0/Figure7-p0-19-03-2020.pdf} \caption{Predictions for the $p_{\mathrm{T}}$--differential spectra of pions (left panel), kaons (middle panel) and protons (right panel) in Pb--Pb collisions at $\sqrt{s_\text{NN}}$ = 5.02 TeV, in five centrality classes. } \label{predictionspectra} \end{figure*} \section{Summary and conclusion\label{sec:discussion}} In summary, we have performed a global fit of transverse momentum particle spectra for identified pions, kaons and protons in five centrality classes based on a relativistic fluid approximation to QCD dynamics including a realistic thermodynamic equation of state as well as shear and bulk viscous dissipation, see ref.\ \cite{Floerchinger:2018pje} for further details. We have taken experimental data points measured at $\sqrt{s_\text{NN}}=2.76$ TeV by the ALICE collaboration in the transverse momentum range $p_\text{T} < 3$ GeV/$c$ as well as their experimental uncertainty into account, and searched for the most likely value of open parameters of the theoretical model on this basis. One immediate result is the outcome for the most likely model parameters. They are summarized in Table \ref{tab:bestfit1.par}. In particular, the initialization time of the fluid description comes out relatively low, $\tau_0=0.179$ fm/c. For the shear viscosity to entropy ratio we find $\eta/s=0.164$, and for the peak value of the bulk viscosity to entropy ratio $(\zeta/s)_\text{max}=0.059$. The combined chemical and kinetic freeze-out temperature is determined to be $137.1$ MeV. Our best fit value for the shear viscosity to entropy density ratio $\eta=0.164$ is rather close to the findings of ref.\ \cite{Niemi:2015qia} but deviates somewhat from the result of ref.\ \cite{Bernhard2019} which reports a minimum value $(\eta/s)_\text{min}=0.085$ at $T=154$ MeV and a positive slope towards larger temperatures. Ref.\ \cite{Dubla:2018czx} also pointed towards such a small minimal value $(\eta/s)_\text{min}=0.08$. On the other side, the analysis of ref.\ \cite{Kurkela:2019kip} pointed towards values in the range of our finding, specifically $\eta/s\approx 3/(4\pi)$. Our best fit value for the freeze-out temperature is lower than found in other studies. In particular, the statistical hadronization model fits to integrated light and multi-strange hadrons find $T_\text{ch}=156.5\,\text{MeV}$ in 0-10\% centrality bin~\cite{Andronic:2017pug}. However, excluding the multi-strange particles from the fit, as also done in our work, lowers the statistical hadronisation model fit down to $\sim 145\,\text{MeV}$ (see the recent publication \cite{Alba:2020jir}). In addition, we note that the inclusion of (admittedly poorly understood) viscous corrections to the freeze-out distribution affects the best fit value of the freeze-out temperature. We checked that without these corrections, the best fit value indeed increases to $\sim 145\,\text{MeV}$. Finally, the number of included resonances also impact the optimal freeze-out temperature. Therefore such systematic differences in the modelling of hadronic freeze-out must be kept in mind when comparing different studies. Moreover, from a quadratic expansion of $\chi^2$, corresponding to a Gaussian approximation to the posterior probability of the model parameters, we determine also their uncertainties as well as their correlation matrix, see Tables \ref{rhoij} and \ref{tab:bestfit1.par}. Note that in contrast to the Bayesian approach followed in refs.\ \cite{Bernhard:2016tnd,Bernhard2019}, our method to characterize the likelihood of the model parameters is independent of the parameter windows chosen as a prior. It is a local characterization using only the shape of the $\chi^2$ landscape in the vicinity of the minimum itself. Let us also emphasize that we take the entire form of the transverse momentum dependent particle spectra -- as well as the reported experimental uncertainties -- into account and not only integrated quantities such as total multiplicities or mean transverse momentum. From table \ref{tab:bestfit1.par} it becomes apparent that these uncertainties extracted from the $\chi^2$ landscape are rather small. This underlines the quality of the experimental data and their high power to constrain theoretical models. However, one must also say that the best fitting model parameters lead to $\chi^2/N_\text{dof}=1.37$ with $N_\text{dof}=546$. The deviation from the expectation value $\langle \chi^2 \rangle = N_\text{dof}$ is actually relatively large, which strictly speaking, implies that it is very unlikely that the current theoretical model correctly describes all of the observed physics. In other words, the residual deviations in Fig.\ \ref{bestfit} are statistically significant. The tension concerns in particular pions in the region of low transverse momenta. We may speculate which physics effect our model is missing. One possibility that comes to mind is that contributions from the feed down of decaying resonances have for some reason been underestimated. We have checked this possibility by doing our calculation with two different sets of hadronic resonances. While the current implementation uses the rather large set of $\sim 700$ resonances of ref.\ \cite{pdg}, we have also tried a smaller set based on an earlier listing ~\cite{Mazeliauskas:2018irt} and found the difference for the low-$p_\text{T}$ pions to be rather small. Of course, it cannot be fully excluded that an even larger set, or a more detailed description of the decay process~\cite{Lo:2017sux,Huovinen:2016xxq}, could remedy the problem. Another interesting possibility is a non-thermal production mechanism for low-momentum pions such as from evolving coherent fields or condensates. An idea how this can happen in an out-of-equilibrium scenario is the one of a disoriented chiral condensate, see \cite{Mohanty:2005mv} for a review. Further work is needed to see whether such contributions from coherent fields and fluid dynamics can be reconciled. Given that the current theoretical model is incomplete, it is rather difficult to determine its model parameters and the corresponding uncertainty. In particular, although straight-forward to calculate, the uncertainty from the $\chi^2$ landscape as quoted in Table \ref{tab:bestfit1.par} can {\it not} be taken as a complete estimate of uncertainty in a situation where the theoretical description is itself not yet complete. For this reason we have also studied how our best fit parameters change when the procedure for their determination is varied. Specifically, in Fig.\ \ref{systematicc} we show how the best fit parameters change if the fit is not done globally, i.e.\ for all centrality classes and all three particle species, but rather separately for individual centrality classes (and all three species), separately for pions, kaons and protons or for case in which only two species at a time are considered (but including all centrality intervals). One observes that this leads indeed to a sizeable variation of the model parameters and we estimate on this basis the uncertainties from fit variations in Table \ref{tab:bestfit1.par}. While in the present work we have focused on identified particle transverse momentum spectra, additional very interesting information is carried by harmonic flow coefficients and $n$-particle correlation functions. While they are sensitive to more detailed information from the initial state, their evolution is also highly sensitive to thermodynamic and transport properties \cite{Bernhard:2016tnd, Floerchinger:2013rya, Teaney:2003kp, Gale:2013da, Dubla:2018czx, Ryu:2017qzn, Song:2013qma, Niemi:2015qia, Bernhard2019}. Our theoretical framework \cite{Floerchinger:2018pje, Mazeliauskas:2018irt} has been developed also to describe those, and we plan to extend our theory-experiment comparison in this direction. In conclusion we find that a fluid dynamic description of transverse momentum spectra for identified pions, kaons and protons works reasonably but with statistically significant residuals. The experimental data are now of a rather high quality and we expect that they will indeed allow to find a more complete theoretical description in the future. \section*{Acknowledgement} The authors thank Paolo Parotto for sharing his PDG2016 resonance and decay lists. This work is part of and supported by the DFG Collaborative Research Centre "SFB 1225 (ISOQUANT)". A.D. is partially supported by the Netherlands Organisation for Scientific Research (NWO) under the grant 19DRDN011, VI.Veni.192.039. Computational resources have been provided by the GSI Helmholtzzentrum f{\"u}r Schwerionenforschung.
\subsection*{Introduction} \section{Introduction} Executions of large trades can affect the price of the traded asset, a phenomenon known as \emph{market impact}. The price is affected in the direction unfavourable to the trade: while selling, the market impact decreases the price; while buying, the market impact increases the price. Therefore, a trader who wishes to minimise her trading costs has to split her order into a sequence of smaller sub-orders which are executed over a finite time horizon. How to optimally split a large order is a question that naturally arises. Academically, the literature discussing such an optimal split was initiated by the seminal papers by \cite{AC01opt} and by \cite{BL98opt}. Both papers deal with the trading process of one large market participant who would like to buy or sell a large amount of shares or contracts during a specified duration. The optimisation problem is formulated as a trade-off between two pressures. On the one hand, market impact demands to trade slowly in order to minimise the unfavourable impact that the execution itself has on the price. On the other hand, traders have an incentive to trade rapidly, because they do not want to carry the risk of adverse price movements away from their decision price. Such a trade-off between market impact and market risk is usually translated into a stochastic control problem where the trader's strategy (i.e. the control) is the trading speed. The class of admissible strategies defines the set over which the risk-cost functional is optimised. In the design of mathematical models for optimal trade execution we identify two phases. The first phase is the description of trading costs. This refers to the choice of a function $F$ that depends on time, asset price, quantity to execute and trading speed, and models the instantaneous cost of trading. The overall cost during the time window ${[0,\timeHorizon]}$ is then expressed as the time integral \[ J(q) = \int_{0}^{T} F(t,x _t,q_t,\dot{q}_t)dt, \] where the path $t \mapsto x _t$ is the evolution of the asset price during the trading period. The letter $q$ stands for quantity of the asset and the trajectory $t\mapsto q(t)$, ${[0,\timeHorizon]} \rightarrow \mathbb{R}$, is referred to as inventory trajectory. Its time derivative $\dot{q}$ is the rate of execution and it represents the control variable that a trader modulates while executing the trade. The minimisation of the trading cost $J$ faces the challenge that the price path $t \mapsto x _t$ is not known at the beginning of the trading period. Hence, in order to gain some predictive power, a stochastic model for the evolution of the asset price is introduced. This is the second phase in the design of mathematical models for trade execution. Concretely, it means that a stochastic process $\lbrace S_t: \, 0\leq t \leq T \rbrace$ is introduced and the actual price trajectory $(x_t)$ is thought of as a realisation of this stochastic process. Then, the mathematical optimisation focuses on the expected trading cost \begin{equation}\label{eq.expectedTradingCost} \mathbb{{E}}\left[ \int_{0}^{T} F(t,S_t, q_t,\dot{\inventory}_{t}) dt \right]. \end{equation} Notice that this entails a considerable degree of model dependency, in that the optimisation is based on the distributional assumptions on the price process. Two alternatives exist for the minimisations of the expected trading cost in equation \eqref{eq.expectedTradingCost}. These alternatives are static minimisation (giving rise to static trading strategies) and dynamic minimisation (giving rise to dynamic trading strategies). Static strategies are completely decided at the beginning of the trading period; they are based only on the information available at the initial time of the trade. Mathematically, this is formulated by considering $q$ as a deterministic path. In this case it is often observed that, by interchanging expectation and time integral in equation \eqref{eq.expectedTradingCost}, the actual realisation of the price process disappears from the formulae, replaced by its expected trajectory. When the expected price path is the only feature of the price process that enters the formulae (as in \cite{AC01opt}), the static strategy does not take into account the volatility of asset prices, whose role however is paramount in financial markets. A visual representation of the relevance of volatility in the context of trade execution is provided by Figure \ref{fig.aPosterioriTwoVolatilities}. In Figure \ref{fig.aPosterioriTwoVolatilities} Almgren and Chriss's framework is adopted. The price process is a standard one-dimensional Brownian motion and two price paths are considered, one with low volatility and the other with high volatility. Notwithstanding the remarkable difference between the two, they have the same expected path (dashed blue line in the first quadrant) and, as a consequence, the static liquidation strategy is the same for both price paths (dashed blue line in the second quadrant). The simplicity of the model is such that it compromises on the possibility to distinguish rather different market regimes. This is made clear by comparing the static optimal solution with the a-posteriori one. \begin{figure} \centering \includegraphics[width=0.50\textwidth]{aPosterioriTwoVolatilities} \caption{{A-posteriori optimal and static optimal inventories in two different volatility regimes}} \label{fig.aPosterioriTwoVolatilities} \end{figure} The a-posteriori solution is the minimiser $q$ of the cost functional $J$ given the actual price trajectory $x $. This is not implementable in real trading because it is anticipative, in that it assumes that the entire price trajectory is known at the beginning of the trading period. However, since it is independent of the choice of the price process, the a-posteriori solution constitutes a useful term of comparison for the stochastic model. In the example of Figure \ref{fig.aPosterioriTwoVolatilities}, we observe how different the two a-posteriori solutions corresponding to the two market regimes are. In the case of low volatility, the a-posteriori solution is close to the static one, because the price path does not depart significantly from its expected trajectory. Instead, in the case of high volatility, the a-posteriori solution deviates from the static one: the inventory trajectory is considerably steeper where the price is above its expected value, and it is almost flat when the price is below its expected value. In order to take into account more features of the price process (such as its volatility), the literature on optimal trade execution has utilised the mathematical techniques of stochastic optimal control. This has produced the second alternative the minimisation of the expected cost in equation \eqref{eq.expectedTradingCost}, and dynamic trading strategies proliferated since \cite{BL98opt} (in discrete time) and \cite{GS11opt} (in continuous time). An excellent presentation of the techniques of stochastic optimal control applied to trade execution is contained in the textbook by \cite{CJP15alg}. Dynamic trading strategies take fully into account the distributional features of the price process because they are obtained via the Hamilton-Jacobi-Bellman equation, in which the generator of the diffusion that models the price enters.\footnote{In the case of linear temporary market impact and quadratic inventory cost, a recent work by \cite{BMO18opt} actually discusses techniques that can be more generally applied to the case of general semimartingales. In this case there is no HJB equation; instead the authors rely on forward-backward stochastic differential equations. In Section \ref{sec.framework}, we will review this general solution.} Furthermore, dynamic strategies are random when seen from the initial time, in that they depend on the information that is revealed to the trader during the trading period. Mathematically, this means that dynamic strategies are stochastic processes adapted to the relevant market information filtration. Since deterministic strategies are in particular adapted stochastic processes, the class of static strategies is a subset of the class of dynamic strategies. Therefore, the minimisation over the class of dynamic strategies is expected to improve the result obtained when minimising over the smaller class of static strategies. This however is not always confirmed in the models. Indeed, despite the mathematical sophistication, cases exist in which optimal trading strategies, although sought among dynamic ones, are in fact static. One of such cases is for example the ``Liquidation without penalties only temporary impact'' in \cite[Section 6.3]{CJP15alg}, an other is the ``Optimal acquisition with terminal penalty and temporary impact'' in \cite[Section 6.4]{CJP15alg}. This reduction to static optimal solutions clashes with the intuition for which trading strategies should take into account actual realisations of price paths, as the a-posteriori solutions in Figure \ref{fig.aPosterioriTwoVolatilities} suggest. A second drawback of applying the technique of HJB equation to the problem of optimal trade execution is the heavy model dependence. Optimality of the trading strategies holds under the assumption that the price follows some specified dynamics, and this invests of considerable importance the second phase in the design of mathematical models. In this paper, we propose a new alternative for the minimisation of trading costs. This new alternative considers the pathwise optimisation of the cost functional $J$ without taking expectation. We observe that the reason for the anticipativeness of a-posteriori solutions is the imposition of the constraint that the liquidation terminates exactly at the (arbitrarily fixed) trading horizon. Relaxing this constraint enables to produce adapted pathwise solutions that display two remarkable features. On the one hand, they avoid the degeneracy to static trajectories even in the cases where the techniques of HJB equation do not produce genuinely dynamic strategies; on the other hand, their model dependence is moderate and confined to the expected trajectory of the price path, as was the case for static strategies, rather than to the full law of the price process. Our trading strategies give rise to inventory trajectories that are obtained in closed-form formulae. Moreover, we can characterise these trajectories as solutions to certain random Young differential equations, inspired by the second-order Euler-Lagrange equations in the classical Calculus of Variations. Such a characterisation allows to implement the inventory trajectories via an easily-simulated initial value problem. \nocite{CJ19alg} \nocite{HJN19mea} \nocite{CDJ17alg} \nocite{CJ19tra} \nocite{MC20mar} \nocite{RZ18gam} \nocite{CDP20max} \nocite{KK18nas} \nocite{XZ13opt} \nocite{DS86use} The rest of the paper is organised as follows. Section \ref{sec.framework} describes in detail the mathematical framework in which the problem of optimal trade execution is formulated. Our descriptions examines in particular two aspects of the mathematical models. The first aspect (Section \ref{sec.reductionStatic}) is the reduction to static optimal inventories that happens in the context of stochastic optimal control of the expected quantity in equation \eqref{eq.expectedTradingCost}. Proposition \ref{prop.reductionToStaticSolution} examines such a reduction, listing its causes. This is novel in the literature and answers the questions raised in \cite{BD14opt}, \cite{BP18sta} and \cite{BBDN18sta} about the comparison between static and dynamic solutions to the problem of optimal trade execution. The second aspect is the unbiasedness of liquidation errors (Section \ref{sec.errorsOfLiquidation}). Section \ref{sec.goodTradeExecutions} presents the concept of good trade execution. Section \ref{sec.IC} specialises good trade executions in the case of linear temporary market impact and quadratic inventory cost. In particular, Section \ref{sec.closedformIC} derives a closed-form formula for good trade executions, and Section \ref{sec.eulerLagrangeIC} characterises it in terms of a Cauchy problem with random Young differential equations. Uniqueness of the good trade execution follows from this characterisation. Section \ref{sec.alternativeRiskCriteria} presents good trade executions with risk criteria other than the quadratic inventory cost. More precisely, Section \ref{sec.timeIC} considers a time-dependent variant of the quadratic inventory cost, whereas Section \ref{sec.varInspiredRiskCriterion} presents good trade executions when the risk criterion is inspired by the value-at-risk adopted in \cite{GS11opt}. Finally, two applications are given in Section \ref{sec.applications}, and Section \ref{sec.conclusions} concludes the paper. Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath} presents the mathematical apparatus on which the characterisation of good trade executions is based. \section{Framework} \label{sec.framework} We adopt the perspective of liquidation; the case of acquisition is \emph{mutatis mutandis} the same. Let $\mathtt{x_0}$ denote initial inventory, and let $\mathtt{x}_{\mathtt{T} } =0$ be the liquidation target. The letter $q$ stands for quantity of the asset and the trajectory $t\mapsto q(t)$, ${[0,\timeHorizon]} \rightarrow \mathbb{R}$, shall be referred to as inventory trajectory. Its time derivative $\dot{q}$ is the rate of execution and it represents the control variable that a trader modulates while executing the trade. Without yet referring to any probabilistic structure, let us introduce the space of such inventory trajectories: \begin{equation*} \begin{split} \mathcal{Q}^{0,\mathtt{x_0}}_{\text{pw}} := \Big\lbrace q:{[0,\timeHorizon]}\rightarrow & \mathbb{R}, \quad q \text{ absolutely continuous}, \, \, q(0) = \mathtt{x_0}, \, q(T) = \mathtt{x}_{\mathtt{T} } \Big\rbrace. \end{split} \end{equation*} The subscript ``pw'' stands for ``pathwise'' and emphasises the non-probabilistic perspective. \begin{defi}\label{def.priceprocess} Let $\big(\Omega,\sigmaAlgebra, \Prob \big)$ be a probability space, and let $\lbrace S_t:\, 0\leq t\leq T\rbrace$ be a stochastic process defined on it. We say that $S$ is a price process if: 1. for all $0\leq t\leq T$ the second moment of $S_t$ is finite; 2. the maps $t\mapsto \mathbb{{E}}[S_t]$ and $t\mapsto \mathbb{{E}}[S^{2}_t]$ are in $L^1[0,T]$; 3. there exists some $p\geq 1$ such that all the paths of $S$ are of finite $p$-variation, i.e. for all $\omega$ in $\Omega$, \begin{equation*} \pvarNormInterval[S_{\cdot} (\omega)]{p}{{[0,\timeHorizon]}} < \infty. \end{equation*} \end{defi} Notice that the paths of the price process are not necessarily assumed to be continuous. Given a price process $\lbrace S_t:\, 0\leq t\leq T\rbrace$, we let $\lbrace \mathfrak{F}_t: \, 0\leq t\leq T\rbrace$ be the minimal ${\mathbb{P}}$-completed right-continuous filtration generated by $S$. It is always assumed that $\mathfrak{F}_0$ is trivial. If the price process is a semimartingale, we additionally introduce the following terminology. We say that the semimartingale $S$ is a totally square integrable special semimartingale if the following two conditions hold: \begin{enumerate} \item the semimartingale $S$ is a special semimartingale, i.e. it admits a canonical decomposition \begin{equation*} S_t = S_0 + A_t + M_t, \qquad 0\leq t \leq T, \end{equation*} where $A$ is a predictable bounded variation process, $M$ is a local martingale, and $A_0 = M_0 = 0$; \item the following integrability holds: \begin{equation*} \mathbb{{E}} \Big[ \langle M \rangle_T \Big] + \mathbb{{E}} \left[ \norm[A]_{2,{[0,\timeHorizon]}}^{2} \right] \, < \infty, \end{equation*} where $\langle M \rangle$ denotes the quadratic variation of the local martingale $M$, and $ \norm[A]_{2,{[0,\timeHorizon]}}$ denotes the $2$-variation of the path $A$ on the time interval ${[0,\timeHorizon]}$.\footnote{Recall that the 2-variation $ \norm[x]_{2,{[0,\timeHorizon]}}$ of a path $x: t\mapsto x_t \in \R^{d}$ is defined as \begin{equation*} \norm[x]_{2,{[0,\timeHorizon]}} := \sup \left\lbrace \left( \sum_{t_{i}} \abs{x_{t_{i+1}} -x_{t_{i}}}^{2} \right)^{1/2} : \, \, 0=t_0< t_1<\dots<t_n=T \right\rbrace, \end{equation*} where the supremum is taken over all the partitions of the interval ${[0,\timeHorizon]}$.} \end{enumerate} Execution rates are progressively measurable square-integrable processes; more precisely, we define the space of execution rates as \begin{equation}\label{eq.definitionOfSpaceExecutionRates} \begin{split} \mathcal{R}:= \Big\lbrace r \in L\squared\Big([0,T]\times& \Omega, \, \mathcal{B}[0,T]\otimes \mathfrak{F}_{T}, \, dt\otimes {\mathbb{P}}\Big): \, \\ & r \text{ is } (\mathfrak{F}_t)_t\text{-progressively measurable}\Big\rbrace. \end{split} \end{equation} Notice that the measurability depends on the filtration of the price process. Admissible inventory trajectories are first integrals of execution rates with initial value $\mathtt{x_0}$. More precisely, we define the space $\mathcal{Q}^{0,\mathtt{x_0}}$ of admissible inventory trajectories as \begin{equation}\label{eq.definitionOfSpaceInventoryTrajectories} \mathcal{Q}^{0,\mathtt{x_0}} := \left\lbrace (q_t)_{t\in{[0,\timeHorizon]}}: \,\, \exists r \in \mathcal{R}, \, q_t=\mathtt{x_0} + \int_{0}^{t}r_u du \, \forall 0\leq t \leq T \right\rbrace. \end{equation} Among admissible inventory trajectories we distinguish those that are fuel-constrained, namely such that their terminal value is $\mathtt{x}_{\mathtt{T} } =0$. Thus, a fuel-constrained admissible inventory trajectory is an $(\mathfrak{F}_t)_t$-adapted process with absolutely continuous paths, with deterministic initial value $\mathtt{x_0}$, terminal value $\mathtt{x}_{\mathtt{T} } =0$, and such that its derivative is in $\mathcal{R}$. More precisely, we define the space $\spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}}$ of fuel-constrained admissible inventory trajectories as \begin{equation*} \spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}} := \left\lbrace (q_t)_{t\in{[0,\timeHorizon]}} \in \mathcal{Q}^{0,\mathtt{x_0}}: \quad q_T = \mathtt{x}_{\mathtt{T} } \,\, {\mathbb{P}}\text{-a.s.} \right\rbrace. \end{equation*} Notice that every realisation of a generic $q$ in $\spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}}$ is a path in $\mathcal{Q}^{0,\mathtt{x_0}}_{\text{pw}}$, namely for all $q$ in $\spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}}$ and all $\omega$ in $\Omega$ it holds \begin{equation*} \left(q_t(\omega)\right)_{0\leq t \leq T} \, \in \, \mathcal{Q}^{0,\mathtt{x_0}}_{\text{pw}}. \end{equation*} In the space of fuel-constrained inventory trajectories we isolate the subspace of static trajectories, given by \begin{equation*} \spaceInventoryTrajectories_{\text{static}}^{0,\mathtt{x_0}} = \left\lbrace q \in \spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}}: \quad q_t \text{ is } \mathfrak{F}_0\text{-measurable} \text{ for all } t \geq 0 \right\rbrace. \end{equation*} These are the execution strategies whose entire trajectories are $\mathfrak{F}_0$-measurable, namely deterministic. We say that the admissible inventory trajectories not in $ \spaceInventoryTrajectories_{\text{static}}^{0,\mathtt{x_0}}$ are non-static (or dynamic): therefore, the admissible inventory trajectory $q$ is non-static if $q$ is in $\mathcal{Q}^{0,\mathtt{x_0}}\setminus \spaceInventoryTrajectories_{\text{static}}^{0,\mathtt{x_0}}$. It is convenient to extend the definitions of the spaces of inventory trajectories to the case where the initial time is not zero. The symbols $\spaceInventoryTrajectories_{\text{pw}}^{t,\mathtt{x}_t}$, $\mathcal{Q}^{t,\mathtt{x}_t}$, $\spaceInventoryTrajectories_{\text{fuel}}^{t,\mathtt{x}_t}$ and $\spaceInventoryTrajectories_{\text{static}}^{t,\mathtt{x}_t}$ will denote the straightforward generalisations of the definitions above to the case where the initial time is $t$ in $[0,T)$ and the trajectories are pinned to the value $\mathtt{x}_t$ at time $t$. With the notation introduced so far, we now formulate the classical stochastic optimisation problem associated with optimal trade execution. Let $X = (S,q)$ denote the state variable, which keeps track of the fundamental price $S$ and of the inventory $q$. The dynamics of $X$ is controlled by an execution rate $\dot{\inventory}$ in $\mathcal{R}$. In order to emphasise this dependence, we can write $X=X^{r}$, where $r$ is the control in the space $\mathcal{R}$ of execution rates. With this notation, we express the objective function $H=H^{\dot{\inventory}}$ of the classical stochastic optimisation problem as \begin{equation}\label{eq.objectiveFunction} H^{\dot{\inventory}} (t,x_1,x_2) := \mathbb{{E}}_{t,S_t=x_1, q_t=x_2} \left[ \int_{t}^{T} F(s,X^{\dot{\inventory}}_s,\dot{\inventory}_s) ds \right], \end{equation} where $q$ is in $\spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}}$, and where $F=F(t,X,r)=F(t,S,q,r)$ is a Lagrangian that describes risk-adjusted execution-impacted costs from trade. The stochastic optimisation problem for fuel-constrained inventory trajectories is therefore written as \begin{equation}\label{eq.fuelConstrainedStochOptProblem} \inf \left\lbrace H^{\dot{\inventory}} (0,S_0,\mathtt{x_0}): \, q \in \spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}} \right\rbrace . \end{equation} An important aspect in the definition of the Lagrangian $F$ in equation \eqref{eq.objectiveFunction} is the description of how the trade execution impacts the price, i.e. the market impact. In this work we focus on the so-called temporary market impact. Let $S_t$ denote the price process at time $t$. We say that the liquidator exerts a temporary market impact on $S_t$ if for some function $g$ in $C(\mathbb{R}^{2})$ the execution price of her order at time $t$ is \begin{equation*} g(S_t,\dot{\inventory}_t), \end{equation*} where $t\mapstoq_t$ is the liquidator's inventory trajectory, and $\dot{\inventory}_{t}$ denotes its time derivative at time $t$. A well-known example of temporary market impact is given by $g(S,r) = S+c_{1}^{2} r$, for some coefficient $c_{1}>0$ of market impact. In this case, the execution cost is a linear function of the rate of execution $\dot{\inventory}$; since in a liquidation $q$ is decreasing, the steepest the inventory trajectory is at time $t$, the smaller the execution price is at time $t$. The classical formulation in \cite{AC01opt} utilises this linear temporary market impact. In the following two paragraphs \ref{sec.reductionStatic} and \ref{sec.errorsOfLiquidation}, we introduce the concepts of reduction to static optimal strategies and the concept of liquidation error. We show that, in the context of linear temporary market impact with quadratic inventory cost, fuel-constrained optimal liquidation strategies are bound to be static, and non-fuel constrained optimal liquidation strategies commit biased errors of liquidation. This motivates the search for a formulation of the problem of optimal execution that is alternative to the classical one of equation \eqref{eq.fuelConstrainedStochOptProblem}. A possible alternative will then be presented in Section \ref{sec.goodTradeExecutions}; under this alternative, optimal liquidation strategies will be non-static, and -- despite being non-fuel constrained -- they will have unbiased liquidation errors. \subsection{Reduction to static optimal strategies}\label{sec.reductionStatic} In a temporary market impact model, trade revenues gained in the infinitesimal time $dt$ are $ -g(S_t, \dot{\inventory}_t) \dot{\inventory}_t dt$. When the temporary market impact is linear, this becomes \begin{equation*} \left(-S_t \dot{\inventory}_t - c_{1}^{2} \dot{\inventory}_t^{2} \right) dt, \end{equation*} where revenues decompose in a first summand $S_t \dot{\inventory}_t$ where the price process appears, and a second summand $c_{1}^{2} \dot{\inventory}_t^{2}$ that does not comprise the price process. Clearly, such a decomposition holds in more general situations than the one of linear market impact. If this decomposition holds for the whole Lagrangian $F$ and if the bounded variation component $A$ of the price process $S$ is deterministic, then we observe the reduction of optimal dynamic solutions to optimal static ones. This happens in some cases studied in the literature (see \cite[Sections 6.3 and 6.4]{CJP15alg}), where the optimal inventory trajectory, although sought dynamic, is eventually found to be static. It means that the optimiser of \eqref{eq.fuelConstrainedStochOptProblem} is in the space $\spaceInventoryTrajectories_{\text{static}}^{0,\mathtt{x_0}}$ of static inventory trajectories. The following proposition explains this phenomenon, pointing out those aspects of the model that cause the reduction to static trade executions. \begin{prop}[``Reduction to static optimal trade executions'']\label{prop.reductionToStaticSolution} Assume that \begin{equation}\label{eq.decompositionOfLagrangian} F(t,X,r) = rS + \lagrangian(t,q,r), \end{equation} for some Caratheodory function\footnote{See Definition \ref{def.caratheodory} in Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath} for the definition of Caratheodory function. The function $\lagrangian$ in the statement of Proposition \ref{prop.reductionToStaticSolution} is assumed to be a Caratheodory function with the choices: 1. the open interval $(0,T)$ as the subset $U$ of $\R^{n}$ in Definition \ref{def.caratheodory}; 2. the two-dimensional variable $(q,r)$ as the variable $\xi$ in Definition \ref{def.caratheodory}. } $\lagrangian$ that does not depend on $S$. Assume that there exist an integrable function $\alpha$ on ${[0,\timeHorizon]}$ and a constant $\beta \geq 0$ such that \begin{equation*} \abs{\lagrangian (t,q,r)} \leq \alpha(t) + \beta \left(q^{2} + r ^{2} \right). \end{equation*} Let the price process $S$ be a totally square integrable continuous canonical semimartingale with canonical decomposition \begin{equation}\label{eq.evolutionOfFundamentalPrice} S_t = S_0 + A_t + M_t, \qquad 0\leq t \leq T. \end{equation} Assume that $A$ is $\mathfrak{F}_0$-measurable, namely that the drift of the price process is deterministic. Then, for all $0\leq t\leq T$ it holds \begin{equation*} \inf \Big\lbrace H^{\dot{\inventory}} (t,S_t,\mathtt{x}_t) : \, q \in \spaceInventoryTrajectories_{\text{static}}^{t,\mathtt{x}_t} \Big\rbrace = \inf \Big\lbrace H^{\dot{\inventory}} (t,S_t,\mathtt{x}_t) : \, q \in \spaceInventoryTrajectories_{\text{fuel}}^{t,\mathtt{x}_t} \Big\rbrace. \end{equation*} \end{prop} \begin{proof} We give first the proof in the case where $M$ in the canonical decomposition of $S$ is a martingale. Let $q$ be in $\spaceInventoryTrajectories_{\text{fuel}}^{t,\mathtt{x}_t}$. Let $X$ be the state variable $X = (S,q)$ and let $Y$ be the two dimensional path $Y=(q,A)$. Let $\varphi$ in $C^{\infty}(\mathbb{R}^2)$ be the function $\varphi(x,y)=xy$. Notice that \begin{equation*} \varphi(X^{\dot{\inventory}}_{r} ) - \varphi(X^{\dot{\inventory}}_{t}) -\int_{t}^{r}X^{\dot{\inventory}}_s dY_s, \qquad t\leq r, \end{equation*} is a centred martingale. Hence, \begin{equation*} \begin{split} H^{\dot{\inventory}} (t,S_t,\mathtt{x}_t) = & \mathbb{{E}}_t \Big[ \int_{t}^{T} F(s,X^{\dot{\inventory}}_s, \dot{\inventory}_s) ds \\ & \qquad + \varphi (X^{\dot{\inventory}}_T) - \varphi (X^{\dot{\inventory}}_t) -\int_{t}^{T} X^{\dot{\inventory}}_r dY_r \Big] \\ =& - \mathtt{x}_t S_t +\mathbb{{E}}_t \Big[ \int_{t}^{T} \left(-q_r dA_s + \lagrangian(r,q_r,\dot{\inventory}_r)dr\right). \Big] \end{split} \end{equation*} It holds \begin{equation*} \begin{split} \inf_{q\in \spaceInventoryTrajectories_{\text{fuel}}^{t,\mathtt{x}_t}} H^{\dot{\inventory}} &(t,S_t,\mathtt{x}_t)\\ \geq& -\mathtt{x}_t S_t + \mathbb{{E}}_t \Big[ \inf_{q \in \spaceInventoryTrajectories_{\text{pw}}^{t,\mathtt{x}_t}} \int_{t}^{T} \left(-q_r dA_s + \lagrangian(s,q_s,\dot{\inventory}_s)ds\right) \Big], \end{split} \end{equation*} where the infimum on the right hand side is taken in a pathwise sense for each realisation of the price $S$. In fact, the integrand does not depend on such a realisation (i.e. it does not depend on $\omega$ in $\Omega$) because $A$ is non-random. Therefore, any minimising sequence for the infimum inside the expectation is actually independent of $\omega$ and we have \begin{equation*} \begin{split} \inf_{q\in \spaceInventoryTrajectories_{\text{fuel}}^{t,\mathtt{x}_t}} H^{\dot{\inventory}} &(t,S_t,\mathtt{x}_t)\\ \geq & -\mathtt{x}_t S_t + \inf_{q \in \spaceInventoryTrajectories_{\text{static}}^{t,\mathtt{x}_t}} \mathbb{{E}}_t \Big[ \int_{t}^{T} \left(-q_r dA_s + \lagrangian(s,q_s,\dot{\inventory}_s)ds \right) \Big]\\ =& \inf_{q \in \spaceInventoryTrajectories_{\text{static}}^{t,\mathtt{x}_t}} H^{\dot{\inventory}} (t,S_t,\mathtt{x}_t). \end{split} \end{equation*} This yields the stated equality in the case where $M$ is a martingale. If instead $M$ is only a local martingale, a standard localisation argument concludes the proof. \end{proof} \begin{remark}\label{remark.optimalityinAC01opt} The classical optimal trade execution proposed by \cite{AC01opt} was originally formulated with optimality claimed over the set of static inventory trajectories and under the assumption that the price process is an arithmetic Brownian motion. However, it is easy to show that the same solution of the static optimisation is obtained if the Brownian motion is replaced by any square-integrable martingale. In this sense, the static optimal solution of Almgren and Chriss is robust. In view of Proposition \ref{prop.reductionToStaticSolution}, this robustness actually extends to the case where the liquidation strategy is regarded as the optimiser over the class of fuel-constrained inventory trajectories. \end{remark} \begin{remark}\label{remark.GS11dynamicSolution} A simple case where the optimal trading strategy is non-static is discussed by \cite{GS11opt}. This means that the optimal inventory trajectory obtained from the stochastic control problem is in the space $\spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}}\setminus \spaceInventoryTrajectories_{\text{static}}^{0,\mathtt{x_0}}$. In view of Proposition \ref{prop.reductionToStaticSolution}, we understand the dynamism of their solution by noticing the following. The risk measure adopted by those authors (see \cite[Section 2.1]{GS11opt}) is the value-at-risk of the position $q_t S_t$, and this has the consequence of disrupting the assumption that the Lagrangian $F$ can be decomposed as in equation \eqref{eq.decompositionOfLagrangian}. Indeed, Gatheral and Schied consider the optimisation \begin{equation}\label{eq.GS11optimisationProblem} \inf\left\lbrace \mathbb{{E}} \Big[ \int_{0}^{T} \left(\dot{\inventory}_t^{2} + \lambda q_tS_t\right) dt \Big] : \, q \in \spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}} \right\rbrace, \end{equation} where the price process $S_t = \exp(\sigmaW_t -\sigma^{2} t /2)$ is the exponential martingale of $\sigmaW$, where $W$ denotes the standard one-dimensional Brownian motion, and where $\lambda$ and $\sigma$ are positive coefficients. Equation \eqref{eq.GS11optimisationProblem} is \cite[Equation (2.7)]{GS11opt}. Alternatively, it can be noticed that the same minimisation as in equation \eqref{eq.GS11optimisationProblem} is produced by choosing $F(t,X,r)=rS + r^{2}$ and $dS=\lambda Sdt +\sigma SdW$. Indeed, the expected cost \begin{equation}\label{eq.GS11alternativeFormulation} \begin{split} \mathbb{{E}} \Big[ \int_{0}^{T} \left(\dot{\inventory}_t^{2} + \dot{\inventory}_tS_t\right) dt \Big],& \\ & \text{ with } dS_t = \lambda S_t dt + \sigma S dW_t, \end{split} \end{equation} differs from the expected cost in equation \eqref{eq.GS11optimisationProblem} (where the price process is the exponential martingale) only by a constant. With the modelling choices in equation \eqref{eq.GS11alternativeFormulation}, the Lagrangian $F$ does not incorporate any risk criterion and thus it satisfies the assumptions of Proposition \ref{prop.reductionToStaticSolution}, but the price process $S$ has a position dependent drift coefficient, violating the assumption that $A$ in equation \eqref{eq.evolutionOfFundamentalPrice} is deterministic. \end{remark} \begin{remark} In view of Proposition \ref{prop.reductionToStaticSolution}, we understand why incorporating signals (i.e. short-term price predictors) in the framework of optimal trade execution leads to dynamic optimal strategies (see \cite{CJ16inc} and \cite{LN19inc}). Indeed, signals are incorporated by modelling the price evolution as \[ dS_t = I_t dt + \sigma(t,S_t)dW_t, \] where $I_t$ is a Markov process that represents the signal. The stochasticity of $I$ disrupts the assumption on the drift $A$ in Proposition \ref{prop.reductionToStaticSolution}. \end{remark} \begin{corol} \label{corol.reductionToOptimalStatic} Assume the setting of Proposition \ref{prop.reductionToStaticSolution}. Assume that the price process is modelled as the diffusion \begin{equation}\label{eq.SDEofFundamentalPrice} dS_t = \mu(t)dt +\sigma(t,S_t)dW_t, \end{equation} for some measurable Lipschitz coefficients $\mu$ and $\sigma$. Assume that the drift coefficient $\mu$ is a deterministic function of time only. Assume that \begin{enumerate} \item for all $t$ the map $(q, r)\mapsto -\mu(t)q + \lagrangian(t,q,r)$ is strictly convex; \item there exist exponents $p>m\geq 1$ and coefficients $\alpha_1>0$, $\alpha_2,\alpha_3 \in \mathbb{R}$ such that \begin{equation*} -\mu(t)q + \lagrangian(t,q, r) \geq \alpha_1 \abs{r}^{p} + \alpha_2 \abs{q}^m + \alpha_3, \end{equation*} for all $t$, $q$ and $r$. \end{enumerate} Then, the infimum in equation \eqref{eq.fuelConstrainedStochOptProblem} is attained for some optimal deterministic $q$ in $\spaceInventoryTrajectories_{\text{static}}^{0,\mathtt{x_0}} \cap W^{1,p}(0,T)$, where $W^{1,p}(0,T)$ denotes the Sobolev space of absolutely continuous function such that their $p$-th power and the $p$-th power of their derivative are integrable on the time interval $(0,T)$. \end{corol} \begin{remark}\label{remark.reductionToStaticSolutionInCarteaTextbook} The assumptions on $F$ in Corollary \ref{corol.reductionToOptimalStatic} are satisfied in particular by the classical choice \begin{equation}\label{eq.classicalLagrangianWithLinearTemporaryImpact} F(t,S, q,r) =rS + c_{1}^{2} r^{2} + c_{2}^{2} \, q^{2} , \end{equation} where $c_{1}>0$ is a coefficient of temporary market impact and $c_{2}\geq 0 $ is a coefficient of risk aversion (or of inventory cost). Therefore, Corollary \ref{corol.reductionToOptimalStatic} explains why in \cite[Section 6.3]{CJP15alg} the optimal solution is sought dynamic and eventually found to be static. This also says that, although in \cite{AC01opt} the optimal trade execution was sought only over the class $\spaceInventoryTrajectories_{\text{static}}$ for tractability, this was in fact without loss of generality (Remark \ref{remark.optimalityinAC01opt}). \end{remark} \begin{proof}[Proof of Corollary \ref{corol.reductionToOptimalStatic}] The fact that the infimum over $\spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}}$ is actually the same as the infimum over $\spaceInventoryTrajectories_{\text{static}}^{0,\mathtt{x_0}}$ follows from Proposition \ref{prop.reductionToStaticSolution}. Existence, uniqueness and $p$-integrability of the minimiser follow from the two assumptions on the function $(t,q,r) \mapsto -\mu(t)q +\lagrangian(t,q,r)$; see \cite[Theorem 4.1]{Dac08dir}. \end{proof} \subsection{Errors of liquidation}\label{sec.errorsOfLiquidation} The space $\spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}}$ of fuel-constrained admissible inventory trajectories has been isolated from the space $\mathcal{Q}^{0,\mathtt{x_0}}$ of first integrals of execution rates. An inventory trajectory $q$ in $\mathcal{Q}^{0,\mathtt{x_0}}\setminus \spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}}$ is said to commit a liquidation error, because with positive probability $q_T \neq \mathtt{x}_{\mathtt{T} } $. Liquidation errors are common among dynamic solutions to optimal trade execution problems. This is because the mathematical techniques used for dynamic solutions are not well-suited to simultaneously impose the two constraints $q_0 = \mathtt{x_0}$ and $q_T = \mathtt{x}_{\mathtt{T} } $. Clearly, the constraint $q_0 = \mathtt{x_0}$ has the priority and hence the constraint $q_T = \mathtt{x}_{\mathtt{T} } $ is relaxed. The usual relaxation entails to introduce a terminal penalisation for the outstanding inventory at final time. Hence, if $F$ is the Lagrangian describing risk-adjusted cost of trade, it is custom to relax the minimisation in equation \eqref{eq.fuelConstrainedStochOptProblem} and consider instead the problem \begin{equation} \label{eq.introOfTerminalPenalisation} \inf\left\lbrace \mathbb{{E}} \Big[ \int_{0}^{T} F(t,X_t^{\dot{\inventory}},\dot{\inventory}_{t}) dt + c_{5}^{2} \Big(q_T - \mathtt{x}_{\mathtt{T} } \Big)^{2} \Big] : \, q \in \mathcal{Q}^{0,\mathtt{x_0}} \right\rbrace, \end{equation} where $c_{5}\geq 0$ is a coefficient of penalisation for outstanding terminal inventory. Notice that the minimisation is performed over the broad class $\mathcal{Q}^{0,\mathtt{x_0}}$ of first integrals of execution rates. Notice also that the objective function in equation \eqref{eq.introOfTerminalPenalisation} can be expressed in the general form discussed so far because \begin{equation*} \begin{split} \mathbb{{E}} \Big[ \int_{0}^{T} F(t,X_t^{\dot{\inventory}},\dot{\inventory}_{t}) &dt + c_{5}^{2} \Big(q_T - \mathtt{x}_{\mathtt{T} } \Big)^{2} \Big] = \mathbb{{E}} \Big[ \int_{0}^{T} G(t,X_t^{\dot{\inventory}},\dot{\inventory}_{t}) dt \Big], \end{split} \end{equation*} where $ G(t,X_t^{\dot{\inventory}},\dot{\inventory}_{t}) = F(t,X_t^{\dot{\inventory}},\dot{\inventory}_{t}) + 2c_{5}^{2} \dot{\inventory}_{t} q_t$. We isolate liquidation errors whose expected value is null from those that on average either finish the liquidation before the time horizon $T$ (negative liquidation error) or after it (positive liquidation error). \begin{defi} We say that the admissible inventory trajectory $q$ in $\mathcal{Q}^{0,\mathtt{x_0}}$ has an unbiased liquidation error if $\mathbb{{E}}[q_T] = \mathtt{x}_{\mathtt{T} } $. We say that $q$ has a biased liquidation error if instead $\mathbb{{E}}[q_T] \neq \mathtt{x}_{\mathtt{T} } $. \end{defi} By extension we say that a liquidation strategy is unbiased if its inventory trajectory has unbiased liquidation error, and we say that it is biased if it is not unbiased. The next proposition shows that the classical optimisation problem corresponding to linear temporary market impact with quadratic inventory cost produces in general optimal liquidation strategies with biased liquidation error. In other words, if the optimal inventory trajectory in this framework happens to have unbiased liquidation error, this unbiasedness is not robust with respect to the values of the model parameters $c_{1}$, $c_{2}$ and $c_{5}$: independently changing these values will disrupt the expected value of the inventory at $T$, turning it into a biased termination. The solution to the optimisation problem is derived from \cite{BMO18opt}. Notice that the statement is general with respect to the distributional assumption of the price process, which is only assumed to be a totally square integrable semimartingale. \begin{prop} Let the price process $S$ be a totally square integrable special semimartingale. Consider the minimisation problem \begin{equation} \label{eq.BMO18optimisation} \inf\left\lbrace \mathbb{{E}}\Big[ \int_{0}^{T}F(t,S_t,q_t,\dot{\inventory}_{t}) dt + c_{5}^{2} \Big(q_T - \mathtt{x}_{\mathtt{T} } \Big)^{2} - q_{T} S_T \Big] : \, q \in \mathcal{Q}^{0,\mathtt{x_0}} \right\rbrace, \end{equation} where the Lagrangian $F$ is $F(t,S_t,q_t,\dot{\inventory}_{t}) = \dot{\inventory}_{t} S_t + c_{1}^{2} \dot{\inventory}_{t}^{2} + c_{2}^{2} q_{t}^{2}$. Let $\hat{q}$ be the minimiser for \eqref{eq.BMO18optimisation}, and let $M:= \lbrace (c_{1}, c_{2}, c_{5}) \in \mathbb{R}_{+}^{3}: \,\, \mathbb{{E}}[\hat{q}_T]=\mathtt{x}_{\mathtt{T} } \rbrace$. Then, $M$ is included in a manifold of dimension $2$. \end{prop} \begin{proof} Let $c_{3}$ be the ratio $c_{3}=c_{2}/c_{1}$ between the coefficient $c_{2}$ of risk aversion and the coefficient $c_{1}$ of linear temporary market impact. Let $c_{6}$ be the ratio $c_{6}=c_{5}/c_{1}$ between the coefficient $c_{5}$ of penalisation of outstanding inventory at time $T$ and the coefficient $c_{1}$ of linear temporary market impact. Define the functions $\varphi$ and $\Phi$ as follows: \begin{equation}\label{eq.timeFunctionsInBMO18solution} \begin{split} \varphi(t) :=& c_{3} \cosh (c_{3} t) + c_{6}^{2} \sinh(c_{3} t), \qquad t\geq 0, \\ \Phi(s,t) : = & \frac{\varphi(T - t)}{\varphi(T - s)} , \qquad 0\leq s \leq t \leq T. \end{split} \end{equation} Let $v(t)$ be the following conditional expectation at time $t$: \begin{equation} \label{eq.conditionalExpectationInBMO18solution} \begin{split} v(t) :=& \mathbb{{E}}_t \Big[\frac{1}{2c_{1}^{2}}\int_{t}^{T} \Phi(t,r)dS_r \Big] = \mathbb{{E}}_t \Big[\frac{1}{2c_{1}^{2}}\int_{t}^{T} \Phi(t,r)dA_r \Big], \end{split} \end{equation} where $S$ is the price process with canonical decomposition $S_t = S_0 + A_t + M_t$. Then, \cite[Theorem 3.1]{BMO18opt} proves that the optimal inventory trajectory that solves the minimisation problem in equation \eqref{eq.BMO18optimisation} is \begin{equation}\label{eq.BMO18solution} \hat{q}_t = \Phi(0,t)\mathtt{x_0} + \int_{0}^{t} \Phi(s,t)v(s) ds. \end{equation} This minimiser produces unbiased liquidation errors only if \begin{equation*} \frac{\varphi(0)}{\varphi(T)}\mathtt{x_0} = \frac{1}{2c_{1}^{2}} \int_{0}^{T} \Phi(t,T)\mathbb{{E}} \Big[\int_{t}^{T} \Phi(t,r)dA_r\Big]dt. \end{equation*} Consider $\varphi$ and $\Phi$ as functions of $(c_{1}, c_{2}, c_{5})$. Let $f: \mathbb{R}_{+}^{3}\rightarrow \mathbb{R}$ be defined as \begin{equation*} f(c_{1}, c_{2}, c_{5}) = \frac{\varphi(0)}{\varphi(T)}\mathtt{x_0} - \frac{1}{2c_{1}^{2}} \int_{0}^{T} \Phi(t,T)\mathbb{{E}} \Big[\int_{t}^{T} \Phi(t,r)dA_r\Big]dt. \end{equation*} Then, $0$ is a regular value of $f$ and $M\subset f^{-1}(0)$. \end{proof} \begin{remark} In the spirit of Proposition \ref{prop.reductionToStaticSolution}, we remark that the solution $\hat{q}$ to the minimisation problem in equation \eqref{eq.BMO18optimisation} is static if the drift of the price process is deterministic, in particular if the price process is a martingale. \end{remark} \begin{remark} When the price process is a martingale, the optimal inventory trajectory of equation \eqref{eq.BMO18solution} is such that the terminal value is \begin{equation*} q_T = \frac{c_{3} \mathtt{x_0}}{c_{3} \cosh (c_{3} T ) + c_{6}^{2} \sinh(c_{3} T)}. \end{equation*} In this case then, the optimal inventory trajectory will always finish with a positive inventory left to liquidate after the initially fixed time horizon $T$ of the liquidation. \end{remark} \begin{remark} A liquidation strategy that is unbiased for any choice of $c_{1}$ and $c_{2}$ is obtained from equation \eqref{eq.BMO18solution} only in the limit as $c_{5} \uparrow \infty$, which yields the fuel-constrained solution \begin{equation*} \begin{split} q_t =& R(0,t)\mathtt{x_0} - \frac{1}{2c_{1}^{2}} \int_{0}^{t} R(s,t)S_s ds \\ & - \frac{1}{2c_{1}^{2}} \int_{0}^{t} R(s,t) \int_{s}^{T} \mathbb{{E}}_s \left[ S_r\right] \partial_r R(s,r) dr ds, \end{split} \end{equation*} where $R(s,t)= \sinh(c_{3} (T - t)) / \sinh(c_{3} (T - s))$. This says that the inventory trajectory in equation \eqref{eq.BMO18solution} has unbiased liquidation error only in the degenerate case of deterministic terminal inventory. \end{remark} \section{Good trade executions} \label{sec.goodTradeExecutions} Let $S$ be a price process as defined in Definition \ref{def.priceprocess}. Let the class $\mathcal{R}$ of inventory rates and the class $\mathcal{Q}^{0,\mathtt{x_0}}$ of admissible inventory trajectories be as defined in equations \eqref{eq.definitionOfSpaceExecutionRates} and \eqref{eq.definitionOfSpaceInventoryTrajectories} respectively. From the class $\mathcal{Q}^{0, \mathtt{x_0}}$ of admissible inventory trajectories we isolate the class of unbiased admissible inventory trajectories. An unbiased admissible inventory trajectory is defined as an $(\mathfrak{F}_t)_t$-adapted process with absolutely continuous paths, with deterministic initial value $\mathtt{x_0}$, expected terminal value $\mathtt{x}_{\mathtt{T} } $, and such that its derivative is in $\mathcal{R}$. More precisely, we define the space $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $ of unbiased admissible inventory trajectories as \begin{equation*} \spaceUnbiasedInventoryTrajectories^{0,\initialInventory} := \left\lbrace (q_t)_{t\in{[0,\timeHorizon]}} \in \mathcal{Q}^{0,\mathtt{x_0}}: \quad \mathbb{{E}} [q_T] = \mathtt{x}_{\mathtt{T} } \right\rbrace. \end{equation*} The constraint $\mathbb{{E}} [q_T] = \mathtt{x}_{\mathtt{T} } $ relaxes the fuel constraint $ q_T = \mathtt{x}_{\mathtt{T} } $ used in the definition of $\spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}}$. Recall that, without loss of generality, the liquidation target $\mathtt{x}_{\mathtt{T} } $ is set equal to $0$; nonetheless, we do not suppress it from our equations because this makes the formulae easier to interpret (see Remarks \ref{remark.turnGoodExecutionIntoStaticAndIntoAposteriori} and \ref{remark.varianceOfLiquidationError}). We consider the following minimisation problem over the class of unbiased admissible inventory trajectories: \begin{equation}\label{eq.optimisationGoodExecution} \inf \left\lbrace \int_{0}^{T} F (t,S_t, q_t,\dot{\inventory}_{t} )dt: \, q \in \spaceUnbiasedInventoryTrajectories^{0,\initialInventory} \right\rbrace, \end{equation} where $F=F(t,x_1,x_2,x_3): (0,T)\times \mathbb{R}^{3} \rightarrow \mathbb{R}$ is a space-differentiable Caratheodory function.\footnote{See Definitions \ref{def.caratheodory} and \ref{def.space-diff_caratheodory}.} We use the symbol $J$ to denote the map $q \mapsto \int_{0}^{T} F (t,S_t, q_t,\dot{\inventory}_{t} )dt$, for $q$ in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $. \begin{assumption}\label{assumption.Lagrangian} Let $F=F(t,x_1,x_2,x_3): (0,T)\times \mathbb{R}^{3} \rightarrow \mathbb{R}$ be the Lagrangian in the minimisation problem \eqref{eq.optimisationGoodExecution}. It is assumed that $F$ is a space-differentiable Caratheodory function, and that the function $\lagrangian=\lagrangian(t,x_1,x_2,x_3):=F(t,x_1,x_2,x_3)-x_1 x_3$ is such that: 1. $\lagrangian$ is in the Sobolev space $\sobolevSpace[1,4] ((0,T)\times K)$ for all compact subsets $K$ of $\mathbb{R}^{3}$; 2. for almost every $t$ in $(0,T)$, $(\partial_{x_2}\lagrangian)^{2}(t,0,x,0)+(\partial_{x_3}\lagrangian)^{2}(t,0,0,x)=0$ only if $x=0$; 3. the functions $t\mapsto 1/\lagrangian(t,0,1,0)$ and $t\mapsto 1/\lagrangian(t,0,0,1)$ are non-negative and square-integrable over $(0,T)$. \end{assumption} Assumption \ref{assumption.Lagrangian} is used to associate the Lagrangian $F$ in equation \eqref{eq.optimisationGoodExecution} with a weight function on the Sobolev space $\sobolevSpace(0,T)$ and with a weight function on $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $. \begin{defi}\label{def.pwFnorm} Let $F=F(t,x_1,x_2,x_3): (0,T)\times \mathbb{R}^{3} \rightarrow \mathbb{R}$ be a space-differentiable Caratheodory function. Let $F$ satisfy Assumption \ref{assumption.Lagrangian}. Let $\eta$ be in $\sobolevSpace(0,T)$. Then, the pathwise $F$-weight $\lvert \eta\rvert_{F}$ of $\eta$ is defined by the equation \begin{equation}\label{eq.definitionPathWiseFnorm} \lvert \eta \rvert^{2}_{F} = \int_{0}^{T} \left( \ell_{2}^{2}(t,\eta_t) + \ell_{3}^{2}(t,\dot{\eta}_t) \right) dt, \end{equation} where \begin{equation*} \begin{split} \ell_2(t,x) := \frac{\partial_{x_2}\lagrangian(t,0,x,0)}{2\sqrt{\lagrangian(t,0,1,0)}}, \qquad \ell_3(t,x) := \frac{\partial_{x_3}\lagrangian(t,0,0,x)}{2\sqrt{\lagrangian(t,0,0,1)}}. \end{split} \end{equation*} \end{defi} \begin{remark}\label{remark.degenerateAssumption} Let $F:(0,T)\times\mathbb{R}^{3}\rightarrow\mathbb{R}$ be a space-differentiable Caratheodory function, and define $\lagrangian(t,x):=F(t,x)-x_1 x_3$. Assume that $\lagrangian$ satisfies points 1. and 2. in Assumption \ref{assumption.Lagrangian}. Assume that $t\mapsto 1/\lagrangian(t,0,0,1)$ is non-negative and square-integrable. If $\partial_{x_2}\lagrangian(t,0,x,0)=0$ for all $t$ and all $x$, then we drop the requirement that $t\mapsto 1/\lagrangian(t,0,1,0)$ is non-negative and square-integrable and we understand equation \eqref{eq.definitionPathWiseFnorm} with the convention that $\ell_2 \equiv 0$. \end{remark} \begin{defi}\label{def.Fnorm} Let $F$ be as in Definition \ref{def.pwFnorm}. Let $\eta$ be in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $. Then, the $F$-weight $\norm[\eta]_{F}$ of $\eta$ is defined by the following equation \begin{equation}\label{eq.definitionFnorm} \norm[\eta]_{F}^{2} = \mathbb{{E}} \left[ \lvert \eta \rvert_{F}^{2}\right], \end{equation} where $\lvert \eta \rvert_{F}$ is the random variable $\omega\mapsto \lvert \eta(\omega) \rvert_{F}$, where $\lbrace \eta(\omega): \, \omega \in \Omega\rbrace$ are the paths of $\eta$ and, for every $\omega$ in $\Omega$, $\lvert \eta(\omega) \rvert_{F}$ is the pathwise $F$-weight of $t\mapsto \eta_t (\omega)$. \end{defi} Every square-integrable random variable $\xi$ with $\mathbb{{E}}[\xi] = \mathtt{x}_{\mathtt{T} } $ identifies a subclass of trajectories in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $ with specified terminal (random) variable. More precisely, for every $\xi$ in $L\squared\big(\Omega,\sigmaAlgebra, \Prob \big)$ with $\mathbb{{E}}[\xi] = \mathtt{x}_{\mathtt{T} } $ we define \begin{equation*} \spaceUnbiasedInventoryTrajectories^{0,\initialInventory} (\xi) := \left\lbrace q \in \spaceUnbiasedInventoryTrajectories^{0,\initialInventory} : \, {\mathbb{P}}(q_T=\xi)=1 \right\rbrace. \end{equation*} The class $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} (\xi)$ with $\xi \equiv \mathtt{x}_{\mathtt{T} } $ is the class of inventory trajectories that commit no liquidation error, namely $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} (\mathtt{x}_{\mathtt{T} } ) = \spaceInventoryTrajectories_{\text{fuel}}^{0,\mathtt{x_0}}$. \begin{defi}[``Optimal execution of terminal variable $\xi$'']\label{defi.optimalExecutionOfSpecifiedTerminalVariable} Let $\xi$ be in $L\squared \big(\Omega,\sigmaAlgebra, \Prob \big)$ with $\mathbb{{E}}[\xi] = \mathtt{x}_{\mathtt{T} } $. We say that $q$ in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $ is the optimal execution of terminal variable $\xi$ if $q$ minimises $\eta \mapsto J(\eta)$ over $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} (\xi)$, namely if $ {\mathbb{P}}(q_T =\xi)=1 $ and for all $\eta \in \spaceUnbiasedInventoryTrajectories^{0,\initialInventory} (\xi)$ it holds \begin{equation*} \begin{split} \int_{0}^{T} F(t,S_t,\eta_t,&\dot{\eta}_t )dt \geq \int_{0}^{T} F(t,S_t, q_t ,\dot{\inventory}_t )dt \end{split} \end{equation*} with probability one. \end{defi} For every $q \in \spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $ we trivially have that $q \in \spaceUnbiasedInventoryTrajectories^{0,\initialInventory} (q_T)$. We can define a ``tubular'' neighbourhood of $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} (q_T) $ by looking at those trajectories $\eta$ in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $ such that the $L\squared({\mathbb{P}})$-norm of the difference $\eta_T - q_T$ between terminal values is controlled by the $F$-weight of the difference $\eta - q$. More precisely, for $q$ in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $ and $C\geq 0$ we set \begin{equation}\label{eq.staticTubularNeighbourhoodIC} \spaceUnbiasedInventoryTrajectories^{0,\initialInventory} (q,C):= \left\lbrace \eta \in \spaceUnbiasedInventoryTrajectories^{0,\initialInventory} : \, \norm[\eta_T-q_T ]_{L\squared({\mathbb{P}})} \leq C \Fnorm{\eta -q}^{2} \right\rbrace. \end{equation} This captures the idea of $\eta_T$ not being too far from the terminal value $q_T$ given that the trajectory $\eta$ has kept close to $q$ in the time window $0\leq t<T$. Also, we define a pathwise analogous to the tubular neighbourhood of equation \eqref{eq.staticTubularNeighbourhoodIC}. Given a non-negative $\xi$ in $L\squared({\mathbb{P}})$ we define \begin{equation}\label{eq.pathwiseTuburalNeighbourhoodIC} \spaceUnbiasedInventoryTrajectories^{0,\initialInventory} _{\text{pw}}(q,\xi):= \Big\lbrace \eta \in \spaceUnbiasedInventoryTrajectories^{0,\initialInventory} : \, \abs{\eta_T-q_T} \leq \xi \lvert \eta-q \rvert_{F}^{2} \Big\rbrace, \end{equation} where $\abs{\eta_T-q_T}$ is the absolute value of the difference between the values of $\eta$ and of $q$ at time $T$, and $\lvert \eta-q \rvert_{F}$ is the pathwise $F$-weight of the difference $\eta - q$. \begin{remark}\label{remark.tubular_neigh_depend_on_F} Notice that both $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} (q,C)$ and $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} _{\text{pw}}(q,\xi)$ depend on the Lagrangian $F$. Nonetheless, we omit this dependence from the notation, and the symbols for these tubular neighbourhoods do not carry reference to $F$. \end{remark} \begin{defi}[``Good trade execution'']\label{defi.goodTradeExecution} We say that $q$ in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $ is a $(C,\xi)$-good trade execution for the minimisation in equation \eqref{eq.optimisationGoodExecution} if there exist $\xi \in L\squared_{+} ({\mathbb{P}})$ and $C\geq 0$ such that \begin{enumerate} \item for all $\eta$ in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} (q,C)$ it holds \begin{equation*} \begin{split} \mathbb{{E}} & \left[ \int_{0}^{T} F(t,S_t, \eta_t , \dot{\eta}_t )dt \right] \geq \mathbb{{E}}\left[ \int_{0}^{T} F(t,S_t, q_t,\dot{\inventory}_t)dt\right]; \end{split} \end{equation*} \item for all $\eta$ in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} _{\text{pw}}(q,\xi)$ it holds \begin{equation*} \begin{split} \int_{0}^{T}F(t,&S_t,\eta_t ,\dot{\eta}_t )dt \geq \int_{0}^{T} F(t,S_t, q_t,\dot{\inventory}_t)dt, \end{split} \end{equation*} with probability one. \end{enumerate} \end{defi} When we emphasise the path $t\mapstoq_t$ of a good trade execution, we use interchangeably the term \emph{good inventory trajectory}. \begin{remark} A good trade execution is in particular an optimal execution of its own terminal variable: if $q$ is as in Definition \ref{defi.goodTradeExecution}, then $q$ is an optimal execution of terminal variable $q_T$ as defined in Definition \ref{defi.optimalExecutionOfSpecifiedTerminalVariable}. In other words, a $(C,\xi)$-good trade execution is in particular a $(0,0)$-good trade execution. \end{remark} \subsection{Quadratic inventory cost}\label{sec.IC} In this section (Section \ref{sec.IC}), we consider the following Lagrangian $F$: \begin{equation}\label{eq.LagrangianIC} F(t,S,q,r) := rS + c_{1}^{2} r^{2} +c_{2}^{2} q^{2}, \end{equation} where $c_{1}>0$ is a coefficient of market impact, and $c_{2}\geq 0$ is a coefficient of risk aversion. For future reference, we set $c_{3}:=c_{2}/c_{1}$. Notice that in fact $F$ does not depend on $t$. We study the problem in \eqref{eq.optimisationGoodExecution} with $F$ as in equation \eqref{eq.LagrangianIC}. \begin{remark} The Lagrangian $F$ in equation \eqref{eq.LagrangianIC} represents risk-adjusted revenues from trade where the market impact is temporary and linear, and the risk criterion is quadratic inventory cost. This aligns to common modelling choices such as those in \cite{LN19inc} and in \cite{BMO18opt}. However, our relaxation of the fuel constraint entails that the inventory is sought in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $: we do not modify the objective function as is instead common in the studies of optimal dynamic liquidation strategies, where the terms of terminal asset position $q_T S_T$ and of terminal inventory cost $c_{5} ^{2} (q_T - \mathtt{x}_{\mathtt{T} } )^{2}$ are usually added to the function that describes revenues from trade (see beginning of Section \ref{sec.errorsOfLiquidation}). \end{remark} \begin{remark} The Lagrangian $F$ in equation \eqref{eq.LagrangianIC} is the same as the Lagrangian in equation \eqref{eq.classicalLagrangianWithLinearTemporaryImpact}. However, the optimisation in equation \eqref{eq.optimisationGoodExecution} is pathwise and hence it differs from the classical optimisation of expected risk-adjusted revenues used in equation \eqref{eq.fuelConstrainedStochOptProblem}. For this reason, the martingale cancellation exploited in the proof of Proposition \ref{prop.reductionToStaticSolution} is not applicable to the present case: we will be able to produce a non-static solution also in the case where the price process has deterministic drift (in particular, where the price process is a martingale). \end{remark} \begin{lemma} Let $F$ be as in equation \eqref{eq.LagrangianIC}. Then, $F$ satisfies Assumption \ref{assumption.Lagrangian}. Moreover, the pathwise $F$-weight is a seminorm on $\sobolevSpace(0,T)$, and the $F$-weight is a seminorm on $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $. If $c_{2}>0$, then these seminorms are norms. \end{lemma} \begin{proof} As for the requirements in Assumption \ref{assumption.Lagrangian}, we only notice that the case $c_{2}=0$ is covered in Remark \ref{remark.degenerateAssumption}. As for the second part of the claim, we apply Lemma \ref{lemma.SobolevSeminorm} from Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath} to see that the pathwise $F$-weight is a seminorm. The fact that the $F$-weight is a seminorm follows from the fact that the pathwise $F$-weight is a seminorm. Finally, $c_{2}>0$ guarantees that $\abs{\eta-\tilde{\eta}}_{F} >0$ if $\eta\neq\tilde{\eta}$. \end{proof} We denote the pathwise seminorm induced by the pathwise $F$-weight by $\lvert\cdot\rvert_{c_{1}, c_{2}}$. More precisely, we set \begin{equation}\label{eq.pathwiseSobolevNormIC} \lvert \eta \rvert_{c_{1},c_{2}}^{2} := \int_{0}^{T} \left( c_{2}^{2} \eta_t ^{2} + c_{1}^{2} \dot{\eta}_t^{2} \right)dt, \end{equation} for $\eta$ in $\sobolevSpace(0,T)$. Moreover, we denote the seminorm on $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $ induced by the $F$-weight by $\norm[\cdot]_{c_{1}, c_{2}}$. \subsubsection{Closed-form formula}\label{sec.closedformIC} \begin{prop} \label{prop.goodExecutionIC} Let $F$ be as in equation \eqref{eq.LagrangianIC}. Let $c_{3}$ be the ratio of the coefficients of risk aversion and of market impact, namely $c_{3} := c_{2}/c_{1}$. Let $\alpha$ be the function $\alpha(t)=1-\sinh(c_{3}(T-t))/\sinh(c_{3} T)$, and let $K$ be the constant \[ K= \frac{1}{2c_{1}^{2} \sinh(c_{3} T)} \int_{0}^{T} \cosh(c_{3} (T-u))\mathbb{{E}}\big[S_u\big]du. \] For $0\leq t \leq T$, define \begin{equation}\label{eq.goodExecutionIC} \begin{split} q_t:= & \big(1-\alpha(t)\big) \mathtt{x_0} + \alpha(t)\mathtt{x}_{\mathtt{T} } \\ &- \frac{1}{2c_{1}^{2}} \int_{0}^{t} \cosh\big(c_{3} (t-u)\big)S_udu \\ &+ K \sinh(c_{3} t). \end{split} \end{equation} Then, $(q_t)_{t\in{[0,\timeHorizon]}}$ is a $(C,\xi)$-good trade execution. The constant $C$ is explicitly given by the formula \[ C^{-1} = c_{3} \int_{0}^{T} \sinh\big(c_{3} (T-u)\big)\mathrm{Var}^{\frac{1}{2}}\big(S_u\big) du; \] the random variable $\xi$ is explicitly given by the formula \begin{equation*} \begin{split} \xi^{-1} = \Big\lvert & 2c_{1}c_{2} \frac{ \mathtt{x}_{\mathtt{T} } - \mathtt{x_0} }{\sinh(c_{3} T)} -c_{3} \int_{0}^{T} \sinh (c_{3} (T - t))S_t dt \\ & +c_{3} \frac{\cosh(c_{3} T)}{\sinh(\ratioAversionOverImpactT)} \int_{0}^{T} \cosh(c_{3} (T - t))\mathbb{{E}}[S_t] dt \Big\rvert. \end{split} \end{equation*} \end{prop} \begin{remark}\label{remark.turnGoodExecutionIntoStaticAndIntoAposteriori} The structure of the solution $q$ in equation \eqref{eq.goodExecutionIC} is threefold: a time-dependent convex combination between initial inventory $\mathtt{x_0}$ and liquidation target $\mathtt{x}_{\mathtt{T} } $ appears on the first line; a dynamic response to the actual price trajectory appears on the second line; an adjustment for the terminal constraint $\mathbb{{E}}[q_T] = \mathtt{x}_{\mathtt{T} } $ appears on the third line. If in the integral appearing on the second line of equation \eqref{eq.goodExecutionIC} we replace the fundamental price $S_u$ with its expected value $\mathbb{{E}}[S_u]$, then the inventory trajectory $q$ is turned into the optimal static one, i.e. into the minimiser of $\mathbb{{E}} [J(\eta)]$ over all $\eta$ in $\spaceInventoryTrajectories_{\text{static}}^{0,\mathtt{x_0}}$. See Corollary \ref{corol.staticOptimalSolIC} in Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath}. Instead, if in the definition of the constant $K$ appearing on the third line of equation \eqref{eq.goodExecutionIC} we replace $\mathbb{{E}}[S_u]$ with $S_u$, then the inventory trajectory $q$ is turned into the optimal a-posteriori one, i.e. into the minimiser of $J(\eta)$ over all $\eta$ in $\spaceInventoryTrajectories_{\text{pw}}^{0,\mathtt{x_0}}$. This is an immediate application of Proposition \ref{prop.weakFormEulerLagrange} in Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath}. \end{remark} \begin{proof}[Proof of Proposition \ref{prop.goodExecutionIC}] Let $q$ be as in equation \eqref{eq.goodExecutionIC}. The fact that $q$ is in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $ is apparent. Let $f_t:= 2c_{1}^{2} \dot{\inventory}_{t} + S_t$ and notice that $f$ is absolutely continuous with derivative \begin{equation}\label{eq.eulerLagrangeWithCancellationIC} \dot{f}_t = 2 c_{1}^{2} q_t . \end{equation} Let $\eta$ be in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $. We write $e$ for the difference $e:=\eta-q$, and we observe that $e_0=0$ and $\mathbb{{E}} e_T = 0$. Then, we have \begin{equation*} \begin{split} J(\eta) - J(q) = & \int_{0}^{T} \Big[ f_t \dot{e}_t + 2c_{1}^{2} q_t \, e_t\Big]dt +\int_{0}^{T}\big(c_{1}^{2} \dot{e}^{2} + c_{2}^{2} e^{2} \big)dt. \end{split} \end{equation*} The second integral on the right hand side is $ \lvert e \rvert_{c_{1},c_{2}}^{2}$. Using integration-by-parts we see that in fact $J(\eta) - J(q) $ $= f_T e_T $ $ + \lvert e \rvert_{c_{1},c_{2}}^{2}$, because of equation \eqref{eq.eulerLagrangeWithCancellationIC}. Therefore, the difference $J(\eta) - J(q) $ is non-negative if \begin{equation*} \abs{e_T} \leq \frac{ \lvert e \rvert_{c_{1},c_{2}}^{2}}{\abs{f_T}}. \end{equation*} This gives $\xi = 1/\lvert f_T\rvert$. Secondly, consider the expected difference $\mathbb{{E}} J (\eta) - \mathbb{{E}} J (q)$ $=\mathbb{{E}}[f_T e_T] + \normInventoryTrjectories{e}^{2}$. We can estimate \begin{equation*} \mathbb{{E}}[f_T e_T] \leq \mathrm{Var}^{\frac{1}{2}}(f_T)\norm[e_T]_{L\squared({\mathbb{P}})}, \end{equation*} because $\mathbb{{E}} e_T = 0$. Moreover, \begin{equation*} \mathrm{Var}^{\frac{1}{2}}(f_T) \leq c_{3} \int_{0}^{T} \sinh(c_{3}(T - t))\mathrm{Var}^{\frac{1}{2}}(S_t) dt. \end{equation*} Therefore, the expected difference $\mathbb{{E}} J (\eta) - \mathbb{{E}} J (q)$ is non-negative if \begin{equation*} \norm[e_T]_{L\squared({\mathbb{P}})} \leq \frac{ \normInventoryTrjectories{e}^{2} }{c_{3} \int_{0}^{T} \sinh(c_{3}(T - t))\mathrm{Var}^{\frac{1}{2}}(S_t) dt}. \end{equation*} This gives the constant $C$ in the statement and concludes the proof. \end{proof} \begin{remark} We remark that the good inventory trajectory of equation \eqref{eq.goodExecutionIC} is written without assuming a particular SDE dynamics for the price evolution. In particular, Proposition \ref{prop.goodExecutionIC} applies to the case in which the price process is modelled as a fractional Brownian motion, or as the sum of a possibly discontinuous semimartingale and a fractional Brownian motion. Moreover, the good inventory trajectory is robust, in the sense that it retains its optimality when one price process $S$ is replaced by another price process $\tilde{S}$ with $\mathbb{{E}}[S_t] = \mathbb{{E}}[\tilde{S}_t]$ for all $t$. \end{remark} \begin{remark}\label{remark.varianceOfLiquidationError} Given $q$ as in equation \eqref{eq.goodExecutionIC}, we can compute \begin{equation*} \norm[q_T-\mathtt{x}_{\mathtt{T} } ]_{L\squared({\mathbb{P}})} = \frac{1}{2c_{1}^{2}} \mathbb{{E}}^{\frac{1}{2}} \left[\big( \int_{0}^{T} \cosh\big(c_{3} (T-t)\big) \Big( S_t-\mathbb{{E}}[S_t] \Big)dt \big)^{2}\right] \end{equation*} and estimate \begin{equation*} \mathrm{Var}(q_T) \leq \frac{T}{4c_{1}^{4}} \int_{0}^{T} \cosh^{2}\big(c_{3} (T-t)\big) \mathrm{Var}(S_t)dt. \end{equation*} We therefore remark the following two facts. First, the smaller $\int \mathrm{Var}(S_t)dt$ is, the more precise the good execution $q$ of Proposition \ref{prop.goodExecutionIC} is. Second, the square of the coefficient $c_{1}$ of linear market impact is inversely proportional to the standard deviation of $q_{T}$, and thus the precision with which the good execution $q$ of equation \eqref{eq.goodExecutionIC} gets to its liquidation target $\mathtt{x}_{\mathtt{T} } $ increases when the strategy itself can exert more influence on the execution price. \end{remark} \begin{remark} \label{remark.alternativeFinalConstraints} Unbiased admissible inventory trajectories $q$ have been defined as absolutely continuous stochastic processes on ${[0,\timeHorizon]}$ such that $\mathbb{{E}}[q_T] = \mathtt{x}_{\mathtt{T} } $. This has meant that the constant $K$ in equation \eqref{eq.goodExecutionIC} has been chosen to minimise $\mathbb{{E}} [(q_T - \mathtt{x}_{\mathtt{T} } ) ^{2}]$. We can give two alternatives to this minimisation: \begin{enumerate} \item Choose $K$ in such a way to minimise \begin{equation*} \mathbb{{E}} \left[ \fint_{t_0}^{T} (q_t-\mathtt{x}_{\mathtt{T} } )^{2} dt \right] , \end{equation*} for some $0\leq t_0 <T$. The symbol $ \fint_{t_0}^{T} dt$ stands for the mean $ \frac{1}{T - t_0}\int_{t_0}^{T}dt$. This yields \begin{equation*} K= \frac{1}{2c_{1}^{2} \fint_{t_0}^{T}\sinh^{2} (c_{3} t) dt} \fint_{t_0}^{T} \sinh(c_{3} t) \psi(t) dt, \end{equation*} where $\psi(t)=\int_{0}^{t} \cosh(c_{3} (t-u))\mathbb{{E}}[S_u] du $ $- (1-\alpha(t))(\mathtt{x_0} - \mathtt{x}_{\mathtt{T} } )$. Notice that this tends to the former choice when $t_0 \uparrowT$. \item Choose $K$ in such a way to minimise \begin{equation*} \mathbb{{E}} \left[ \Big( \fint_{t_0}^{T}q_tdt -\mathtt{x}_{\mathtt{T} } \Big)^{2} \right], \end{equation*} for some $0\leq t_0 <T$. This yields \begin{equation*} K= \frac{c_{3} (T - t_0)} {2c_{1}^{2} \left( \cosh(\ratioAversionOverImpactT) - \cosh(c_{3} t_0) \right) } \fint_{t_0}^{T} \psi(t) dt, \end{equation*} with $\psi$ as above. \end{enumerate} Notice however that the alternative choices for the constant $K$ make the corresponding inventory trajectory fall out of the set $\mathcal{U}^{0,\mathtt{x_0}}$. \end{remark} \subsubsection{Characterisation via Euler-Lagrange equation}\label{sec.eulerLagrangeIC} The differential equation in \eqref{eq.eulerLagrangeWithCancellationIC} is the linchpin on which the derivation of the good inventory trajectory is based. This equation is the Euler-Lagrange equation associated with the functional $J$. Equation \eqref{eq.eulerLagrangeWithCancellationIC} is a random ordinary differential equation, where differentiation is possible because the price process is cancelled out in the sum $ 2c_{1}^{2} \dot{\inventory}_{t} + S_t$. Such a cancellation allows to circumvent the need of an integration with respect to the price process. However this integration is possible; Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath} presents the theory of the Euler-Lagrange equation in the presence of a (rough) price path. The motivation for this theory comes from the fact that equation \eqref{eq.eulerLagrangeWithCancellationIC} can be rewritten as \begin{equation}\label{eq.eulerLagrangeSystemIC} \begin{cases} dq_t=& r_t dt \\ dr_t=& c_{3}^{2} (q_t - \mathtt{x}_{\mathtt{T} } )dt - dS_t/2c_{1}^{2}. \end{cases} \end{equation} We interpret the system in equation \eqref{eq.eulerLagrangeSystemIC} as a random Young differential equation. This equation is useful in simulations because it avoids the computation of the integrals in equation \eqref{eq.goodExecutionIC} and the evaluation of hyperbolic functions. Moreover, since we use Young integration to integrate with respect to the price process $S$, the system in equation \eqref{eq.eulerLagrangeSystemIC} has a pathwise meaning and thus it also makes sense in the practical implementation of the trading strategy, where the price process $S$ is replaced by the single price path observed during the liquidation. In this paragraph, we apply the theory of Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath} in order to characterise the good trade execution of Proposition \ref{prop.goodExecutionIC} in terms of an initial value problem for the dynamics in \eqref{eq.eulerLagrangeSystemIC}. We start by noticing that the Lagrangian $F$ in equation \eqref{eq.LagrangianIC} satisfies Assumption \ref{assumption.decompositionOfF} in Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath}. Equation \eqref{eq.eulerLagrangeSystemIC} is equation \eqref{eq.strongFormEulerLagrangeEquation} with $F$ given by \eqref{eq.LagrangianIC}. Moreover, by casting Definition \ref{defi.solutionToSecondOrderRDE} to the case of equation \eqref{eq.eulerLagrangeSystemIC}, we have: \begin{defi}\label{defi.meaningOfSolutionToEulerLagrangeSystemIC} Let $q$ be in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $. We say that $q$ solves equation \eqref{eq.eulerLagrangeSystemIC} if for all $\omega$ in $\Omega$, all $\eta$ in $C^{\infty}_{0} (0,T)$ and all $0\leq s\leq t \leq T$ the following holds: \begin{equation} \label{eq.meaningOfSolutionToEulerLagrangeSystemIC} \begin{split} \int_{s}^{t} \dot{\eta}_u dq_u (\omega) =& \eta_t \dot{\inventory}_{t}(\omega) - \eta_s \dot{\inventory}_s (\omega) \\ & - c_{3}^{2} \int_{s}^{t} \eta_u \big(q_u (\omega) - \mathtt{x}_{\mathtt{T} } \big) du + \frac{1}{2c_{1}^{2}} \int_{s}^{t} \eta_{u} dS_u (\omega). \end{split} \end{equation} \end{defi} We remark that Definition \ref{defi.meaningOfSolutionToEulerLagrangeSystemIC} is pathwise: a scenario $\omega$ in $\Omega$ could be fixed and the definition would still make sense. The integral on the left hand side of equation \eqref{eq.meaningOfSolutionToEulerLagrangeSystemIC} is well defined because for all $\omega$ in $\Omega$ the path $\dot{\inventory}(\omega)$ is in $L\squared {[0,\timeHorizon]}$. Similarly, the first integral on the right hand side has a pathwise meaning and it is well defined because $q(\omega)$ is in $L\squared {[0,\timeHorizon]}$ for all $\omega$ in $\Omega$. Thirdly, the integral $\int \eta dS$ on the right hand side of equation \eqref{eq.meaningOfSolutionToEulerLagrangeSystemIC} is the Young integral introduced in Lemma \ref{lemma.integrationByPartsYoungIntegral}. \begin{lemma} \label{lemma.twoSolutionsEulerLagrangeIC} Let $q$ and $\tilde{q}$ be two solutions to equation \eqref{eq.eulerLagrangeSystemIC}. If $c_{3} \neq 0 $, then there exist constants $K_1$ and $K_2$ such that \begin{equation*} q_t - \tilde{q}_t = K_1 e^{c_{3} t } + K_2 e^{-c_{3} t}; \end{equation*} if $c_{3}=0$, then there exist constants $K_1$ and $K_2$ such that \begin{equation*} q_t - \tilde{q}_t = K_1 + K_2 t. \end{equation*} In particular, in both cases the difference between $q$ and $\tilde{q}$ is deterministic. \end{lemma} \begin{proof} Let $\eta$ be arbitrary in $C^{\infty}_{0}(0,T)$. By Definition \ref{defi.meaningOfSolutionToEulerLagrangeSystemIC} we have that \begin{equation*} \begin{split} \int_{0}^{t} \dot{\eta}_u dq_u =& \eta_t \dot{\inventory}_{t} - c_{3}^{2} \int_{0}^{t} \eta_u \big(q_u - \mathtt{x}_{\mathtt{T} } \big) du + \frac{1}{2c_{1}^{2}} \int_{0}^{t} \eta_{u} dS_u ; \\ \int_{0}^{t} \dot{\eta}_u d\tilde{q}_u =& \eta_t \dot{\inventory}_{t} - c_{3}^{2} \int_{0}^{t} \eta_u \big(\tilde{q}_u - \mathtt{x}_{\mathtt{T} } \big) du + \frac{1}{2c_{1}^{2}} \int_{0}^{t} \eta_{u} dS_u . \end{split} \end{equation*} Let $\epsilon_t:= q_t - \tilde{q}_t$. Subtract one line from the other and obtain that the function \begin{equation*} t\mapsto \int_{0}^{t} \dot{\eta}_u \dot{\epsilon}_u du + c_{3}^{2} \int_{0}^{t} \eta_u \epsilon_u du - \eta_t \dot{\epsilon}_t \end{equation*} is constantly null. The first two summands are differentiable in $t$ and hence the third summand $ \eta_t \dot{\epsilon}_t $ is differentiable too. Since $\eta$ is arbitrary, $\dot{\epsilon}$ is differentiable in $(0,T)$. Differentiating $t\mapsto \eta_t \dot{\epsilon}_t$, we obtain \begin{equation*} \dot{\eta}_t \dot{\epsilon}_t + c_{3}^{2} \eta_t \epsilon_t - \dot{\eta}_t \dot{\epsilon}_t - \eta_t \ddot{\epsilon}_t = 0. \end{equation*} Hence $\ddot{\epsilon}_t = c_{3}^{2} \epsilon_t$, proving the lemma. \end{proof} \begin{lemma} \label{lemma.uniquenessOfEulerLagrangeIC} The solution $q$ to equation \eqref{eq.eulerLagrangeSystemIC} with constraint \begin{equation}\label{eq.initialAndTerminalConstraintForGoodTradeExecution} \begin{cases} q_0 = \mathtt{x_0} \\ \mathbb{{E}} \left[ q_T \right] = \mathtt{x}_{\mathtt{T} } \end{cases} \end{equation} is unique. \end{lemma} \begin{proof} Let $q$ and $\tilde{q}$ be two solutions to equation \eqref{eq.eulerLagrangeSystemIC} satisfying the constraints in \eqref{eq.initialAndTerminalConstraintForGoodTradeExecution}. Assume $c_{3} \neq 0$. Then, by Lemma \ref{lemma.twoSolutionsEulerLagrangeIC} it must be \begin{equation*} q_t - \tilde{q}_t = K_1 e^{c_{3} t } + K_2 e^{-c_{3} t}, \end{equation*} for constants $K_1$ and $K_2$. Therefore \begin{equation*} \begin{cases} q_0 - \tilde{q}_0 = K_1 + K_2 =0 \\ \mathbb{{E}} q_T - \mathbb{{E}} \tilde{q}_T = K_1 e^{\ratioAversionOverImpactT } + K_2 e^{-\ratioAversionOverImpactT } =0 \end{cases} \end{equation*} Solving for $K_1$ and $K_2$ we find $K_1=K_2=0$. The case $c_{3} = 0$ is analogous. \end{proof} Having established uniqueness of the solution to equation \eqref{eq.eulerLagrangeSystemIC} with constraint \eqref{eq.initialAndTerminalConstraintForGoodTradeExecution}, we link equation \eqref{eq.eulerLagrangeSystemIC} to the good trade execution of Proposition \ref{prop.goodExecutionIC}. This link is established as an application of Lemma \ref{lemma.characterisationOfSolutionToSecondOrderRDE} from Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath}. \begin{lemma} \label{lemma.characterisationEulerLagrangeIC} Let $q$ be in $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $. Then, the following are equivalent \begin{enumerate} \item the inventory trajectory $q$ solves the Euler-Lagrange equation \eqref{eq.eulerLagrangeSystemIC}; \item the function $f_t:= 2c_{1}^{2} \dot{\inventory}_t + S_t$ is absolutely continuous with derivative \begin{equation*} \dot{f}_t = 2 c_{2}^{2} q_t. \end{equation*} \end{enumerate} In particular, the $(C,\xi)$-good trade execution in Proposition \ref{prop.goodExecutionIC} solves the Euler-Lagrange equation \eqref{eq.eulerLagrangeSystemIC}. \end{lemma} We are finally in the position to prove the main result of this paragraph. \begin{prop}[``Characterisation of good trade execution via Euler-Lagrange equation''] \label{prop.eulerLagrangeCharacterisationIC} The good trade execution for the minimisation of \eqref{eq.optimisationGoodExecution} with the Lagrangian $F$ as in equation \eqref{eq.LagrangianIC} is characterised as the solution to the Euler-Lagrange equation in \eqref{eq.eulerLagrangeSystemIC} with initialisation \begin{equation}\label{eq.initialisationEulerLagrangeIC} \begin{cases} q_0 = \mathtt{x_0} \\ r_0 = - S_0 / (2c_{1}^{2}) + {c_{3}}{\sinh^{-1} (c_{3} T)} \Big[ (\mathtt{x}_{\mathtt{T} } - \mathtt{x_0}) \cosh(\ratioAversionOverImpactT) +\tilde{K} \Big], \end{cases} \end{equation} where \begin{equation*} \begin{split} \tilde{K}=&\frac{\cosh(\ratioAversionOverImpactT)}{2c_{1}^{2}} \int_{0}^{T} \cosh(c_{3} t) \mathbb{{E}} \big[S_t \big] dt -\frac{\sinh(\ratioAversionOverImpactT)}{2c_{1}^{2}} \int_{0}^{T} \sinh(c_{3} t) \mathbb{{E}} \big[S_t \big] dt. \end{split} \end{equation*} In particular, the good trade execution in Proposition \ref{prop.goodExecutionIC} is the only good trade execution for the minimisation \eqref{eq.optimisationGoodExecution} with the Lagrangian $F$ as in equation \eqref{eq.LagrangianIC}. \end{prop} \begin{remark} Proposition \ref{prop.goodExecutionIC} gives a characterisation of the good trade execution in terms of an initial value problem that is easily simulated. This is the practical relevance of the characterisation. We will rely on the initial value problem \eqref{eq.eulerLagrangeSystemIC} with initial conditions \eqref{eq.initialisationEulerLagrangeIC} in our numerical experiments in Section \ref{sec.applications}. \end{remark} \begin{proof} First we examine the following two implications. \begin{enumerate} \item \emph{A good trade execution solves equation \eqref{eq.eulerLagrangeSystemIC}}. Let $\tilde{q}$ be a good trade execution for the minimisation of \eqref{eq.optimisationGoodExecution} with the Lagrangian $F$ as in equation \eqref{eq.LagrangianIC}. Then in particular, for every $\omega$ in $\Omega$ it holds \begin{equation*} \tilde{q}(\omega) = \mathrm{argmin} \left\lbrace J(\eta):\, \eta \in \tilde{q}(\omega) + \sobolevSpaceCompactSupport(0,T) \right\rbrace. \end{equation*} Therefore, by Proposition \ref{prop.eulerLagrangeNecessity}, we have that $\tilde{q}(\omega)$ solves the equation \begin{equation*} \begin{cases} d\tilde{q}_t(\omega)=& \tilde{r}_t(\omega)dt \\ d\tilde{r}_t(\omega)=& c_{3}^{2} \tilde{q}_t(\omega)dt - dS_t(\omega)/2c_{1}^{2}. \end{cases} \end{equation*} \item \emph{A solution to equation \eqref{eq.eulerLagrangeSystemIC} is a good trade execution}. Assume that $q$ solves the Euler-Lagrange equation in \eqref{eq.eulerLagrangeSystemIC}. Then, by Lemma \ref{lemma.characterisationEulerLagrangeIC} we have that $f_t(\omega):= 2c_{1}^{2} \dot{\inventory}_t(\omega) + S_t(\omega)$ is absolutely continuous in $t$ for all $\omega$ in $\Omega$ and its time derivative is $\dot{f}_t(\omega) = 2 c_{2}^{2} q_t(\omega)$. Hence, for all $\omega$ in $\Omega$ and all $\eta$ in $q(\omega) + \sobolevSpaceCompactSupport(0,T)$ we have \begin{equation*} \begin{split} J(\eta) - J(q(\omega)) = & \int_{0}^{T} \big(2c_{2}^{2} q_t(\omega) - \dot{f}_t (\omega) \big)e_t dt + \int_{0}^{T} \big(c_{1}^{2} \dot{e}_t^{2} + c_{2}^{2} e_t^{2} \big) dt, \end{split} \end{equation*} where $e = \eta-q(\omega)$. The first summand on the right hand side is null and thus $J(\eta)\geq J(q(\omega))$. This shows that $q$ is a $(0,0)$-good trade execution. \end{enumerate} In view of these two implications and of Lemma \ref{lemma.uniquenessOfEulerLagrangeIC}, it only remains to show that the initialisations in equation \eqref{eq.initialisationEulerLagrangeIC} are equivalent to the constraints in \eqref{eq.initialAndTerminalConstraintForGoodTradeExecution}. Consider an equation of the form \begin{equation*} dY_t = (AY_t + B)dt + D dS_t, \end{equation*} where the unknown $Y$ is in $\mathbb{R}^{2}$, the matrix $A$ is in $\mathbb{R}^{2\times 2}$ and $B$ and $D$ are two-dimensional real vectors. Equation \eqref{eq.eulerLagrangeSystemIC} is of this form with the choice $Y=(q,r)^{\mathsf{T}}$ and \begin{equation*} A= \begin{pmatrix} 0 & 1 \\ c_{3}^{2} & 0 \end{pmatrix}, \qquad B= \begin{pmatrix} 0 \\ -c_{3}^{2} \mathtt{x}_{\mathtt{T} } \end{pmatrix} = 0, \qquad D= \begin{pmatrix} 0 \\ -\frac{1}{2c_{1}^{2}} \end{pmatrix}. \end{equation*} Assume first that $t\mapsto \mathbb{{E}}[S_t]$ is differentiable. Then, if we set $\mu_t=\mathbb{{E}}[Y_t]$ we have that $\mu$ solves the ordinary differential equation \begin{equation}\label{eq.ODEforExpectedInventory} \dot{\mu}_t = A\mu_t + \varphi_t D, \end{equation} where $\varphi_t= d\mathbb{{E}}[S_t]/dt$. This ordinary differential equation has a two-dimensional space of solutions; hence we can exploit these two degrees of freedom to adjust for the constraints $q_0 = \mu_0 = \mathtt{x_0}$ and $\mu_T = \mathtt{x}_{\mathtt{T} } = 0$. Define the function $e_1=e_1(t)$ as \begin{equation*} \begin{split} e_1(t) = & e_1(0) + \mathbb{{E}}[S_t]\sinh(c_{3} t)/ (2c_{1} c_{2}) \\ & - \frac{1}{2c_{1}^{2} } \int_{0}^{t} \cosh(c_{3} u) \mathbb{{E}}[S_u] du. \end{split} \end{equation*} Define the function $e_2=e_2(t)$ as \begin{equation*} \begin{split} e_2(t) = & e_2(0) + \Big(S_0 -\cosh(c_{3} t)\mathbb{{E}}[S_t]\Big)/ (2c_{1} c_{2}) \\ & + \frac{1}{2c_{1}^{2} } \int_{0}^{t} \sinh(c_{3} u) \mathbb{{E}}[S_u] du. \end{split} \end{equation*} The general solution to equation \eqref{eq.ODEforExpectedInventory} is \begin{equation*} \begin{cases} \mu^{(1)}_t = e_1(t) \cosh(c_{3} t ) + e_2(t)\sinh(c_{3} t) \\ \mu^{(2)}_t = c_{3} e_1(t) \sinh(c_{3} t ) + c_{3} e_2(t)\cosh(c_{3} t). \end{cases} \end{equation*} The constraints $q_0 = \mu_0 = \mathtt{x_0}$ and $\mu_T = \mathtt{x}_{\mathtt{T} } = 0$ impose the choices \begin{equation*} \begin{cases} e_1(0)=\mathtt{x_0} \\ e_2(0)=R+\sinh^{-1} (c_{3} T)\Big[\mathtt{x}_{\mathtt{T} } - e_1(T)\cosh(c_{3} T)\Big], \end{cases} \end{equation*} where \begin{equation*} R= \frac{\cosh(c_{3} T)\mathbb{{E}}[S_T] - S_0}{2c_{1}c_{2}} -\frac{1}{2c_{1}^{2}}\int_{0}^{T} \sinh(c_{3} u)\mathbb{{E}}[S_u]du. \end{equation*} Hence, the constraints $q_0 = \mu_0 = \mathtt{x_0}$ and $\mu_T = \mathtt{x}_{\mathtt{T} } = 0$ are translated into the initialisation in the statement. The case where the map $t\mapsto \mathbb{{E}}[S_t]$ is not differentiable is handled via a standard approximation argument. \end{proof} \subsection{Alternative risk criteria}\label{sec.alternativeRiskCriteria} We present two alternatives to the risk criterion used in Section \ref{sec.IC}. This means that we modify the third summand in the Lagrangian of equation \eqref{eq.LagrangianIC}, and we study the minimisation problem with such a modified Lagrangian. The first alternative (Section \ref{sec.timeIC}) preserves the same structure but increases the weight of the coefficient $c_{2}$ of risk aversion linearly in time. The second alternative (Section \ref{sec.varInspiredRiskCriterion}) is instead inspired by the value-at-risk for geometric Brownian motion used in \cite{GS11opt}. \subsubsection{Linearly time-dependent coefficient of risk aversion}\label{sec.timeIC} The third summand in the Lagrangian $F$ of equation \eqref{eq.LagrangianIC} accounts for the risk aversion. So far this term has been taken constant in the time variable $t$. We now propose a linear $t$-dependence, with higher risk aversion for $t$ closer to the liquidation horizon $T$. More precisely, we consider the Lagrangian \begin{equation}\label{eq.LagrangianTimeIC} F(t,S,q,r):= rS + c_{1}^{2} r^{2} +c_{2}^{2} \, t \, q^{2}, \end{equation} where $c_{1}>0$ is a coefficient of market impact and $c_{2}\geq0$ is a coefficient of risk aversion. For future reference, we set $c_{3}:=c_{2}/c_{1}$. We study the minimisation problem in \eqref{eq.optimisationGoodExecution} with $F$ as in equation \eqref{eq.LagrangianTimeIC}. \begin{lemma} Let $F$ be as in equation \eqref{eq.LagrangianTimeIC}. Then, $F$ satisfies Assumption \ref{assumption.Lagrangian}. Moreover, the pathwise $F$-weight is a seminorm on $\sobolevSpace(0,T)$, and the $F$-weight is a seminorm on $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $. If $c_{2}>0$, then these seminorms are norms. \end{lemma} We denote the pathwise seminorm induced by the pathwise $F$-weight by $\lvert\cdot\rvert_{c_{1}, c_{2}\sqrt{t}}$. More precisely, we set \begin{equation}\label{eq.pathwiseSobolevNormTimeIC} \lvert \eta \rvert_{c_{1},c_{2}\sqrt{t}}^{2} := \int_{0}^{T} \left( c_{2}^{2} \, t \, \eta_t ^{2} + c_{1}^{2} \dot{\eta}_t^{2} \right)dt, \end{equation} for $\eta$ in $\sobolevSpace(0,T)$. Moreover, we denote the seminorm on $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $ induced by the $F$-weight by $\norm[\cdot]_{c_{1}, c_{2}\sqrt{t}}$. We proceed with statements analogous to those in Sections \ref{sec.closedformIC} and \ref{sec.eulerLagrangeIC}, namely: in Proposition \ref{prop.goodTradeExecutionTimeIC} we give a closed-form formula for a good trade execution in the case of the Lagrangian $F$ of \eqref{eq.LagrangianTimeIC}; then, in Proposition \ref{prop.characterisationEulerLagrangeTimeIC} we show that in fact such a good trade execution is unique, and we characterise it as the solution of a random Young differential equation. All the arguments are straightforward adaptations from those presented above, and thus we omit the proofs. \begin{prop}\label{prop.goodTradeExecutionTimeIC} Let the Lagrangian $F$ be as in equation \eqref{eq.LagrangianTimeIC}. Let $\mathtt{Ai}$ and $\mathtt{Bi}$ be the first and the second Airy's functions, namely the two independent solutions to the second order linear ordinary differential equation $u^{\prime \prime}(t) - tu(t) = 0$. Define the functions $\alpha$, $\beta$, $\phi$ as follows \begin{equation*} \begin{split} \alpha(t) =& \mathtt{Ai}(c_{3}^{2/3} t),\\ \beta(t) =& \mathtt{Bi}(c_{3}^{2/3} t), \\ \phi(t) =& \frac{1}{2c_{1}^{2}}\int_{0}^{t} \alpha^{-2}(s)\int_{0}^{s}\alpha(u)dS_u \,ds, \end{split} \end{equation*} where the innermost integral in the definition of $\phi$ is the Young integral introduced in Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath}. Define the constants $c_A$ and $c_B$ as follows \begin{equation*} c_A = \frac{\beta(T)\mathtt{x_0} - \alpha(T)\beta(0)\mathbb{{E}}\phi(T)} {\alpha(0)\beta(T) - \alpha(T)\beta(0)}, \end{equation*} \begin{equation*} c_B = \frac{ \alpha(T)} {\alpha(0)\beta(T) - \alpha(T)\beta(0)}\Big(\alpha(0)\mathbb{{E}}\phi(T) - \mathtt{x_0}\Big). \end{equation*} For $0\leq t \leq T$, define \begin{equation}\label{eq.goodTradeExecutionTimeIC} q_t := c_A \alpha(t) + c_B\beta(t) - \alpha(t) \phi(t). \end{equation} Then, $(q_t)_{t\in{[0,\timeHorizon]}}$ is a $(C,\xi)$-good trade execution, where \begin{equation*} C=1/ \lVert S_{T} - 2c_{1}^{2} \dot{\alpha \phi}(T) \rVert_{L\squared({\mathbb{P}})}, \end{equation*} \begin{equation*} \xi=1/ \lvert S_{T} +2c_{1}^{2} c_A\dot{\alpha}(T) +2c_{1}^{2} c_B \dot{\beta}(T) -2c_{1}^{2} \dot{\alpha \phi}(T) \rvert, \end{equation*} where the symbol $ \dot{\alpha \phi}$ denotes the time derivative of the product function $t\mapsto\alpha(t)\phi(t)$. \end{prop} The Lagrangian $F$ in equation \eqref{eq.LagrangianTimeIC} satisfies Assumption \ref{assumption.decompositionOfF} from Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath}. Equation \eqref{eq.strongFormEulerLagrangeEquation} in the present case reads \begin{equation}\label{eq.eulerLagrangeSystemTimeIC} \begin{cases} dq_t=r_{t} dt \\ dr_{t} = c_{3}^{2} \, t \, q_t dt - dS_t / 2c_{1}^{2} . \end{cases} \end{equation} We show that the good trade execution in Proposition \ref{prop.goodTradeExecutionTimeIC} is characterised as the unique solution to the random Young differential equation \eqref{eq.eulerLagrangeSystemTimeIC}. \begin{prop}\label{prop.characterisationEulerLagrangeTimeIC} The good trade execution of Proposition \ref{prop.goodTradeExecutionTimeIC} is characterised as the unique solution to the random Young differential equation \eqref{eq.eulerLagrangeSystemTimeIC} with initialisation \begin{equation*} \begin{cases} q_0 = \mathtt{x_0} \\ r_0 = e_A(0) \alpha_0 + e_B (0) \beta_0, \end{cases} \end{equation*} where $\alpha$ and $\beta$ are as in Proposition \ref{prop.goodTradeExecutionTimeIC}, and \begin{equation*} \begin{split} & e_A (0) = \frac{ \beta_T \mathtt{x_0} - \beta_0 \tilde{K}}{\alpha_0\beta_T - \alpha_T \beta_0}, \qquad e_B (0) = \frac{\alpha_0 \tilde{K} - \alpha_T \mathtt{x_0}}{\alpha_0\beta_T - \alpha_T \beta_0}, \\ & \tilde{K} = \frac{S_0}{2c_{1}^{2} W_0}\left(\alpha_T \beta_0 - \alpha_0 \beta_T \right) + \frac{1}{2c_{1}^{2}} \int_{0}^{T} \mathbb{{E}}\left[S_u\right] \frac{d}{d u} \left(\frac{\alpha_T \beta_u - \beta_T \alpha_u}{W_u}\right) du , \\ & W_t = \alpha_t \dot{\beta}_t - \dot{\alpha}_t \beta_t. \end{split} \end{equation*} In particular, the good trade execution in Proposition \ref{prop.goodTradeExecutionTimeIC} is the only good trade execution for the minimisation \eqref{eq.optimisationGoodExecution} with the Lagrangian $F$ as in equation \eqref{eq.LagrangianTimeIC}. \end{prop} \subsubsection{VaR-inspired risk criterion}\label{sec.varInspiredRiskCriterion} \cite{GS11opt} model the fundamental price $S$ as a geometric Brownian motion and they adopt the value-at-risk as measure of risk aversion. This means penalising instantaneous revenues from trade by subtracting a term proportional to $q_t S_t$ at every time $t$. Inspired by their modelling choices, we now consider the Lagrangian \begin{equation}\label{eq.LagrangianVaR} F(t,S,q,r):= rS + c_{1}^{2} r^{2} +c_{2}^{2} \, q S, \end{equation} where $c_{1}>0$ is a coefficient of market impact and $c_{2}\geq0$ is a coefficient of risk aversion. Notice that in fact $F$ does not depend on $t$. We study the minimisation problem in \eqref{eq.optimisationGoodExecution} with $F$ as in equation \eqref{eq.LagrangianVaR}. \begin{lemma} Let $F$ be as in equation \eqref{eq.LagrangianVaR}. Then, $F$ satisfies Assumption \ref{assumption.Lagrangian}. Moreover, the pathwise $F$-weight is a seminorm on $\sobolevSpace(0,T)$, and the $F$-weight is a seminorm on $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $. \end{lemma} \begin{proof} Assumption \ref{assumption.Lagrangian} is understood as per Remark \ref{remark.degenerateAssumption}, namely we drop the requirement on $t\mapsto 1/\lagrangian(t,0,1,0)$ because $\partial_{x_3}\lagrangian(\cdot,0,\cdot,0)\equiv 0$. \end{proof} We denote the pathwise seminorm induced by the pathwise $F$-weight by $\lvert\cdot\rvert_{c_{1}}$. More precisely, we set \begin{equation}\label{eq.pathwiseSobolevNormVaR} \lvert \eta \rvert_{c_{1}}^{2} := \int_{0}^{T} c_{1}^{2} \dot{\eta}_t^{2} dt, \end{equation} for $\eta$ in $\sobolevSpace(0,T)$. Moreover, we denote the seminorm on $\spaceUnbiasedInventoryTrajectories^{0,\initialInventory} $ induced by the $F$-weight by $\norm[\cdot]_{c_{1}}$. We proceed with statements analogous to those in Sections \ref{sec.closedformIC} and \ref{sec.eulerLagrangeIC}, namely: in Proposition \ref{prop.goodTradeExecutionVaR} we give a closed-form formula for a good trade execution in the case of the Lagrangian $F$ in equation \eqref{eq.LagrangianVaR}; then, in Proposition \ref{prop.characterisationEulerLagrangeVaR} we show that such a good trade execution is unique, and we characterise it as the solution of a random Young differential equation. All the arguments are straightforward adaptations from those presented above, and thus we omit the proofs. \begin{prop}\label{prop.goodTradeExecutionVaR} Let $F$ be as in equation \eqref{eq.LagrangianVaR}. Let $K$ be the constant \begin{equation*} K=\frac{1}{2c_{1}^{2} T}\int_{0}^{T} \left( \mathbb{{E}}\left[S_s\right] - c_{2}^{2} \int_{0}^{s}\mathbb{{E}}\left[S_u\right]du \right) ds. \end{equation*} For $0\leq t\leqT$, define \begin{equation}\label{eq.goodExecutionVaR} \begin{split} q_t =& \left(1-\frac{t}{T}\right)\mathtt{x_0} + \frac{t}{T}\mathtt{x}_{\mathtt{T} } \\ & - \frac{1}{2c_{1}^{2}}\int_{0}^{t} \left( S_s - c_{2}^{2} \int_{0}^{s}S_u du \right) ds\\ & +Kt \end{split} \end{equation} Then, $(q_t)_{t\in{[0,\timeHorizon]}}$ is a $(C,\xi)$-good trade execution. The random variable $\xi$ is explicitly given by the formula \begin{equation*} \xi^{-1} = \left\lvert \frac{2c_{1}^{2}}{T} \big(\mathtt{x}_{\mathtt{T} } - \mathtt{x_0} \big) +2c_{1}^{2} K +c_{2}^{2} \int_{0}^{T} S_t dt \right\rvert \end{equation*} and the constant $C$ is explicitly given by the formula $C^{-1}=\lVert \xi^{-1} \rVert_{L\squared({\mathbb{P}})}$. \end{prop} \begin{remark} The good trade execution in equation \eqref{eq.goodExecutionVaR} has the same structure of the one in equation \eqref{eq.goodExecutionIC}, namely: a time-dependent convex combination of $\mathtt{x_0}$ and $\mathtt{x}_{\mathtt{T} } $ (first line), a dynamic response to the realisation of the price path (second line), and an adjustment for the constraint $\mathbb{{E}}[q_T] = \mathtt{x}_{\mathtt{T} } $ (third line). Moreover, notice that \begin{equation*} \lim_{c_{2}\downarrow 0} \frac{\sinh\left(\frac{c_{2}}{c_{1}} (T - t)\right)}{\sinh\left(\frac{c_{2}}{c_{1}} T \right)} = 1 - \lim_{c_{2}\downarrow 0} \frac{\sinh\left(\frac{c_{2}}{c_{1}} t\right)}{\sinh\left(\frac{c_{2}}{c_{1}} T \right)} = 1- \frac{t}{T}, \end{equation*} so that the good trade execution in equation \eqref{eq.goodExecutionVaR} and the good trade execution in equation \eqref{eq.goodExecutionIC} agree when the risk aversion vanishes, i.e. in the limit as $c_{2}\downarrow 0$. \end{remark} \begin{remark} Of the good trade execution in equation \eqref{eq.goodExecutionVaR}, we can compute \begin{equation*} \lVert q_T - \mathtt{x}_{\mathtt{T} } \rVert_{L\squared({\mathbb{P}})} = \frac{1}{2c_{1}^{2}} \mathbb{{E}}^{\frac{1}{2}} \Big[ \big( \int_{0}^{T} \Big\lbrace c_{2}^{2} \int_{0}^{t} (S_u - \mathbb{{E}}[S_u])du - (S_t - \mathbb{{E}}[S_t]) \Big\rbrace dt \big)^{2} \Big] \end{equation*} and estimate \begin{equation*} \mathrm{Var}(q_T) \leq \frac{T}{2c_{1}^{4}} \int_{0}^{T} \left( c_{2}^{4} t \int_{0}^{t} \mathrm{Var}(S_u)du + \mathrm{Var}(S_t) \right)dt. \end{equation*} Therefore, the two facts presented in Remark \ref{remark.varianceOfLiquidationError} also hold for the good trade execution of Proposition \ref{prop.goodTradeExecutionVaR}. \end{remark} The Lagrangian $F$ in equation \eqref{eq.LagrangianVaR} satisfies Assumption \ref{assumption.decompositionOfF} from Appendix \ref{sec.eulerLagrangeInPresenceOfPricePath}. With this $F$, equation \eqref{eq.strongFormEulerLagrangeEquation} reads \begin{equation}\label{eq.eulerLagrangeSystemVaR} \begin{cases} dq_t=r_{t} dt \\ dr_{t} = c_{3}^{2} \, t \, S_t dt/2 - dS_t / 2c_{1}^{2} , \end{cases} \end{equation} where $c_{3}:=c_{2}/c_{1}$. We now characterise the good trade execution in Proposition \ref{prop.goodTradeExecutionVaR} as the unique solution to the random Young differential equation \eqref{eq.eulerLagrangeSystemVaR}. Observe that equation \eqref{eq.eulerLagrangeSystemVaR} is solved by direct integration and this simplifies several calculations compared to the cases of Sections \ref{sec.eulerLagrangeIC} and \ref{sec.timeIC}. \begin{prop}\label{prop.characterisationEulerLagrangeVaR} The good trade execution of Proposition \ref{prop.goodTradeExecutionVaR} is characterised as the unique solution to the random Young differential equation \eqref{eq.eulerLagrangeSystemVaR} with initialisation \begin{equation*} \begin{cases} q_0 =& \mathtt{x_0} \\ r_0 =& \frac{\mathtt{x}_{\mathtt{T} } - \mathtt{x_0}}{T} +\frac{1}{2c_{1}^{2} T} \int_{0}^{T} \left(\mathbb{{E}}[S_t] - S_0 - c_{2}^{2} \int_{0}^{t} \mathbb{{E}}[S_u]du\right)dt. \end{cases} \end{equation*} In particular, the good trade execution in Proposition \ref{prop.goodTradeExecutionVaR} is the only good trade execution for the minimisation \eqref{eq.optimisationGoodExecution} with $F$ is as in equation \eqref{eq.LagrangianVaR}. \end{prop} \section{Applications}\label{sec.applications} In this section we given two applications of the trading schedule proposed in Proposition \ref{prop.goodExecutionIC}. Because of the reliance on the expected trajectory $t\mapsto\mathbb{{E}}[S_t]$ of the fundamental price, the use case of our framework is one where such an expected trajectory can serve as a reliable forecast for the price. This means that an implicit mean-reversion is assumed, and we will be choosing our price processes accordingly. \subsection{INTC shares: high-frequency mean-reverting jump diffusion} We consider the liquidation of a large portfolio of shares; the whole liquidation happens during intraday trading hours and on a single limit order book. We model the fundamental price $S$ on the mid-price of the order book, according to the following high-frequency mean-reverting jump-diffusion model: \begin{equation}\label{eq.jumpdiffusion} S_t = \exp \left( m(t) + Y(t) + N(t) \right), \end{equation} where $m(t)$ is $\mathfrak{F}_0$-measurable, continuous and of finite variation, $Y(t)$ is the Ornstein-Uhlenbeck process $dY(t) = -\alpha Y((t)dt + \sigma dW(t)$, and $N(t)$ is a compound Poisson process independent from $Y(t)$ and with i.i.d marks symmetrically distributed around zero. Therefore, the expected price trajectory is $\mathbb{{E}}[S_t]=\exp(m(t))$, and it represents the reversion target. The liquidator acts adopting this as her price forecast during the execution. As an example, we calibrate our model to the high-frequency NASDAQ order book data available for the trading of INTC on 22 January 2019. The dataset is provided by LOBSTER (\url{https://lobsterdata.com/}). The calibration procedure is straightforward: we first extrapolate the mean-reversion target from the raw data, we then estimate the Ornstein-Uhlenbeck factor from the difference between the log-price and the logarithm of the mean-reversion target, and we finally calibrate the point process on the data points $\lbrace Y(t_i): \, \vert Y(t_i)-Y(t_{i-1})\exp(-\alpha(t_i - t_{i-1})) \vert > k \sigma \sqrt{1-\exp(-2\alpha(t_{i}-t_{i-1}))/\alpha} \rbrace$ that are displaced beyond $k$ standard deviations from the expected value. In the interest of conciseness, we omit the details of this calibration procedure. The so-calibrated price process is displayed in the upper quadrant of Figure \ref{fig.INTCliquidation}, together with the original data stream. The lower quadrant in Figure \ref{fig.INTCliquidation} reports the inventory trajectory and its rate of execution computed as a solution to the Cauchy problem of equation \eqref{eq.eulerLagrangeSystemIC} with initialisation \eqref{eq.initialisationEulerLagrangeIC}. We remark two aspects observable from the picture. The first aspect is that the liquidation terminates after the initially decided horizon $T=1.0$ for the liquidation. This is because the realisation of the price path dwells for most of the time window of the liquidation below its expected value. Consequently, the liquidator decreases the rate of liquidation, in order to prevent her own price impact from exacerbating her trading cost even further. The trade-off between a limited exposure to market volatility and a parsimonious rate is resolved in favour of the latter. The second aspect is the reaction to the price jump that happens around $t=0.21$. The jump is upward and hence favourable to the liquidation. Consequently, the liquidator reacts by increasing the rate of execution to exploit this. \subsection{5Y government bonds: Brownian bridge} As a second application, we consider an entirely different time scale from the one of intraday INTC stock price, and in fact different from the time scale at which models of trade executions are usually applied. In this sense, the application is at the boundary between trade execution and dynamic portfolio management. We consider the sale of 5Y government bonds motivated by market conditions whereby bond yields are negative. Historically, this was observed in 2016 for German bunds and such a phenomenon reappeared in March 2019. Four examples are reported in the upper quadrant of Figure \ref{fig.bonds}, where we show the prices of 5Y German bunds with maturities October 2019, April 2020, October 2020, and April 2021. The reason for negative yields was twofold. On the one hand, central banks launched programmes to stimulate the economy by cutting interest rates and by injecting liquidity via the so-called quantitative easing. On the other hand, in volatile economic regimes risk-adversed investors tend to move their capital to safe investments such as government bonds (a phenomenon known as flight-to-quality), and this exerted upward pressure on bond prices. We consider an investor who wishes to unwind a long position on a negative yielding bond before incurring into the sure loss at the bond's maturity. The sale is done gradually in time, on the one hand because the investor does not want to suddenly loose all the liquidity associated with the bonds, and on the other hand because the investor is mindful of the market impact that an abrupt sale would incur into. In the upper quadrant of Figure \ref{fig.bonds} we observe that, after the period of overprice and as the maturity approaches, the trajectories converge on a downward slope towards the face value, which pins the trajectories at maturity. We base our modelling choices on this observation and, in line with a tradition that dates back to the Seventies (\cite{Boy70sto}), we adopt a Brownian bridge as the price process. More precisely, the price process $S$ is modelled as \begin{equation}\label{eq.priceProcessBond} dS_t = \frac{V - S_t}{T - t} dt + \sigma dW_t, \end{equation} where $V$ is the face value of the bond, $W$ is a standard one-dimensional Brownian motion, and $\sigma$ is the volatility coefficient. In this model for the price process, the expected price path is the line segment from the decision price $x _0$ at time $t=0$ to the face value at maturity. The second quadrant in Figure \ref{fig.bonds} shows good trade executions in this setting. The inventory trajectories are simulated following the dynamics in equation \eqref{eq.eulerLagrangeSystemIC} with initialisation \eqref{eq.initialisationEulerLagrangeIC}. The way in which the good trade executions react to market scenarios is indicative of the dynamic adjustment of inventory trajectories during the liquidation. In particular, in scenarios \#1 and \#3 the liquidation is faster than the static solution; in this way it exploits favourable market conditions. Notice that this is advantageous especially in scenario \#3, where a faster liquidation means that the liquidator concentrates her sale before the price plunges below its expected trend. On the contrary, in scenario \#4, the good inventory trajectory is less steep than the static solution, because unfavourable market conditions recommend to parsimoniously impact the price. \section{Conclusions}\label{sec.conclusions} In this paper, we examined the mathematical models of optimal trade execution with respect to two properties: non-static trajectories and unbiased liquidation errors. Non-static trajectories are those that react to the actual realisation of the price path during the execution, rather than being based only on assumed distributional properties of this price. Secondly, a liquidation error is said to be unbiased if its expectation is zero, entailing that the expected value of the terminal inventory coincides with the execution target. We introduced our proposal for execution strategies, which enjoy both properties. In particular, in order to have non-static solutions even when the fundamental price is modelled as a martingale, we considered the minimisation of trading costs from a \emph{pathwise} perspective, rather than the minimisation of \emph{expected} trading costs. We considered three risk criteria. The first criterion is the classical quadratic inventory cost; the second is a time-dependent modification of the first; the third was inspired by the value-at-risk employed in \cite{GS11opt}. For all of them, we derived explicit closed-form formulae of our inventory trajectories. Furthermore, we characterised them through initial value problems that allow to easily implement our strategies in practice. We demonstrated this through two applications, one on the liquidation of INTC shares, the other on the liquidation of German bunds. \section*{Acknowledgements} We are grateful to Eyal Neuman for discussion and suggestions that helped us improve the paper. We would also like to thank two anonymous referees for their comments and recommendations. \section*{} \begin{center} \begin{figure} \centering \begin{tabular}{c} \includegraphics[width=0.89\textwidth]{INTCdata.png} \\ \hline \\ \includegraphics[width=0.89\textwidth]{INTCliquidation.png} \\ \begin{small} \begin{tabular}{lr | lr} initial inventory $\mathtt{x_0} $ : & 10000.0 & price process : & see equation \eqref{eq.jumpdiffusion} \\ liquidation target $\mathtt{x}_{\mathtt{T} } $ : & 0.0 & coef market impact $ c_{1} $: & 1.35\\ time horizon of liquidation $T $ : & 1.0 & coef risk aversion $ c_{2} $ : & 1.15 \\ initial price $S_0 $ : & 485777 & \\ \end{tabular} \end{small} \end{tabular} \caption{{Upper quadrant: Historical intraday mid-price of INTC on 2019-01-22 (10am-3pm) and a sample path of the process in equation \eqref{eq.jumpdiffusion}. Lower quadrant: Inventory trajectory and rate for the liquidation referring to the sampled price path.}} \label{fig.INTCliquidation} \end{figure} \end{center} \begin{center} \begin{figure} \centering \begin{tabular}{c} \includegraphics[width=.9\textwidth]{BUNDESREPUB_BO} \\ \begin{tiny} \begin{tabular}{lllllrr} \textbf{bond name} & \textbf{ISIN} & \textbf{borrower} & \textbf{issue date} & \textbf{maturity} & \textbf{cpn} & \textbf{red.yield} \\ BUNDESREPUB.DTL.BO 2015 ZERO 17/04/20 & DE0001141711 & BCKKE & 2015-01-23 & 2020-04-17 & 0.00 & -0.6459 \\ BUNDESREPUB.DTL.BO 2015 1/4\% 16/10/20 & DE0001141729 & BCKKE & 2015-07-03 & 2020-10-16 & 0.25 & -0.6955 \\ BUNDESREPUB.DTL.BO 2014 1/4\% 11/10/19 & DE0001141703 & BCKKE & 2014-09-05 & 2019-10-11 & 0.25 & -0.4781 \\ BUNDESREPUB.DTL.BO 2016 ZERO 09/01/21 & DE0001141737 & BCKKE & 2016-02-05 & 2021-04-09 & 0.00 & -0.7484 \\ \end{tabular} \end{tiny} \\ \\ \hline\\ \includegraphics[width=0.99\textwidth]{bridge_1d16h3m_invAndPrice} \\ \begin{small} \begin{tabular}{lr | lr} initial inventory $\mathtt{x_0} $ : & 1000.0 & price process : & see equation \eqref{eq.priceProcessBond} \\ liquidation target $\mathtt{x}_{\mathtt{T} } $ : & 0.0 & volatility $\sigma $ : & 1.1642\\ time horizon of liquidation $T $ : & 1.0 & coef market impact $ c_{1} $: & 0.05855\\ initial price $S_0 $ : & 103.893 & coef risk aversion $ c_{2} $ : & 0.07341 \\ \end{tabular} \end{small} \end{tabular} \caption{{Upper quadrant: Historical prices of bonds with negative yields. Lower quadrant: Good trade executions in the context of a Brownian bridge.}} \label{fig.bonds} \end{figure} \end{center} \newpage \addcontentsline{toc}{section}{References} \bibliographystyle{apalike}
\section{Introduction} How water evolves during star formation, from the molecular cloud core down to the protoplanetary disk, is a key question concerning the origin of the Solar System, the formation of exoplanets, and, ultimately, the possible emergence of life in planetary systems. Water is observed during all stages of star formation: from molecular clouds, through the dense-core phase and the protoplanetary disk and finally in planetary systems such as our Solar System \citep{dishoeck2014}. In star-forming pre-stellar molecular clouds, water is predominantly present in the ice: the gas-phase abundance is constrained to be of the order $X_\mathrm{gas}$(H$_2$O) $\sim10^{-8}$--$10^{-9}$ relative to H$_2$ \citep{bergin2002, caselli2012} while absorption ice spectroscopy has revealed $X_\mathrm{ice}$(H$_2$O) $\sim10^{-4}$--$10^{-5}$ \citep{pontoppidan2004}. It is an open question what processing, if any, water experiences during star formation. Classically, two scenarios are considered: inheritance or processing. In the inheritance scenario, the bulk of the water present in the planetary system after formation is inherited from the molecular cloud and is therefore representative of the chemistry in the molecular cloud before star formation begins \citep[e.g.,][]{visser2009, drozdovskaya2016}. In the alternative scenario, a substantial amount of water is destroyed and reformed in local processes within the envelope or protoplanetary disk during the formation process. In this case the final water chemistry is determined by local processes in the specific system \citep[see, e.g.,][ for an discussion of each scenario]{cleeves2014}. The deuterium fractionation of water is a useful proxy for the processing of water during star formation and can help distinguish between the two scenarios outlined above. The enrichment of deuterium is driven by several chemical processes, and their efficiency depend on physical conditions such as temperature, density, visual extinction, and ionization sources \citep{ceccarelli2014}. At low temperatures the prominent pathway is the gas-phase exchange reaction H$_{3}^{+}$ + HD $\rightleftharpoons$ H$_2$D$^{+}$ + H$_2$ + $\Delta E$, where $\Delta E \approx124$~K\footnote{The exact value of $\Delta E$ depends on the spin state of the involved reactants.}. This reaction is effectively one-way at low temperatures ($T \lesssim 50$~K) due to the endothermicity of the backward reaction. This leads to an enrichment of H$_2$D$^+$ which subsequently dissociatively recombines with free electrons to form atomic D, thus increasing the local atomic D/H ratio in the gas-phase and ultimately on dust grain surfaces where water and other molecules are formed through hydrogenation. Measurements of water deuteration through the different stages of star formation can therefore be used to trace the chemical evolution of water from the molecular cloud down to the protoplanetary disk. Observations of water are challenging due to the high abundance of water in the Earths atmosphere which makes the atmosphere opaque to prominent water emission lines. One solution is to observe water from space, as was done with the \textit{Herschel Space Observatory} \citep[see, e.g.,][]{dishoeck2011}. Observations from \textit{Herschel} have greatly expanded our knowledge of the different origins of water emission toward protostars, i.e., cold and warm envelope gas, shocks and outflows \citep[e.g.,][]{kristensen2012,coutens2013,visser2013}. Another approach is to target rarer water isotopologs such as H$_{2}^{18}$O or the deuterated isotopologs HDO and D$_2$O. These molecules have transitions which fall outside of the opaque water bands in the atmosphere and can be observed with ground based telescopes. First attempts to constrain the HDO/H$_2$O ratio toward low-mass protostars utilized single-dish telescopes, thus observing a mixture of small- and large-scale emission and suffering from beam dilution. This led to a large discrepancy between measurements obtained with different telescopes and highlighted the importance of high spatial resolution to constrain the origin of the emission \citep[e.g.,][]{stark2004, parise2005, coutens2012}. \cite{jorgensen2010a} reported the first interferometric determination of the HDO/H$_2$O abundance ratio in the hot corino of NGC1333 IRAS 4B. Since then water deuteration has been studied toward a number of low-mass Class 0 protostars using interferometers to resolve the water emission in the hot corino where $T > 100$~K and ice is entirely sublimated off the dust grains \citep{taquet2013observation, coutens2014, persson2014}. These measurements reveals varying degrees of deuterium fractionation on different spatial scales toward Class 0 protostars. On larger spatial scales, in cold gas, a high degree of deuterium fractionation has been detected with HDO/H$_2$O and D$_2$O/HDO ratios of the order $\gtrapprox 10^{-2}$ in the gas-phase \citep{coutens2014}. Meanwhile, the water emission from the hot corino, i.e., small spatial scales, show lower HDO/H$_2$O ratios in the range $\sim10^{-4}$--$10^{-3}$. In comparison, the measured HDO/H$_2$O ratios in the Solar System range from as low as the local ISM value\footnote{[HDO/H$_2$O] = 2$\times$[D/H] and [D/H]$_\mathrm{ISM}$ = 2$\times10^{-5}$ \citep{prodanovic2010}.} ratio of $\sim 4\times10^{-5}$ to cometary values as high as [HDO/H$_2$O] $\sim 10^{-3}$; the Earth's D/H ratio, as measured from Vienna Standard Mean Ocean Water, is D/H = $1.557\times10^{-4}$ \citep{deLaeter2003} which corresponds to HDO/H$_2$O $\sim 3\times10^{-4}$. A possible explanation for the observed variation of the HDO/H$_2$O ratio on different spatial scales is that water and its deuterated version are not well mixed in the ice. The evolution of water deuteration during star formation and the effects of the layered ice structure have been the subject of recent modelling efforts \citep[e.g.,][]{cazaux2011, taquet2013model, furuya2016}. Combining chemical models and the available observations of the HDO/H$_2$O and D$_2$O/HDO ratios, \cite{furuya2016} proposed that water is primarily formed in the molecular cloud stage, before the dense core phase. This leads to a lower deuterium fractionation of water which initially freezes out onto the interstellar dust grains and constitutes the bulk of the water ice reservoir. Later, in the dense prestellar core phase, the deuterium fractionation is enhanced as the temperature drops and the visual extinction increases. In this phase highly deuterated ice is formed on top of the existing water ice on grain mantles. This scenario can explain the observed variation in the HDO/H$_2$O ratio on different spatial scales. On larger scales, the observed gas-phase HDO/H$_2$O ratio reflects the high deuterium fractionation of the outer layers of ice formed in the dense core phase as well as gas-phase synthesis of deuterated water through ion-neutral reactions in the cold outer regions of the envelope \citep{taquet2014, furuya2016}. In this region, the dust temperature is not sufficiently high to entirely sublimate the ice, and the inferred gas-phase abundance comes from a combination of the photodesorption of the outermost ice layers and gas-phase reactions with H$_2$D$^{+}$ which can form HDO and D$_2$O under these conditions. Meanwhile, on smaller scales the entire ice is sublimated off the grains and the ratio is lowered since the bulk of the water is formed with lower deuteration in the molecular cloud phase. Hence the ice abundances record the physical and chemical conditions of the different stages of star formation and the abundance of deuterated water could reflect the duration of the dense core phase. This in turn may depend on the local cloud conditions, since timescales of star formation is likely influenced heavily by external factors influencing the stability of the cloud, such as turbulence and radiation \citep[e.g.,][]{ward-thompson2007}. Here we present observations of HDO and H$_{2}^{18}$O toward three isolated Class 0 protostars, L483, BHR71--IRS1, and B335. We classify these sources as isolated as they are not associated with any known cloud complexes. This is in contrast to the previously targeted protostars which are identified as part of star-forming regions like NGC1333 and Ophiucus and likely influenced by the dynamics within these stellar nurseries. The sources were selected to address if and how the deuterium fractionation of water varies as a function of the local cloud environment. BHR71--IRS1 is a Bok globule located in the Southern Coalsack dark nebulae with a bolometric luminosity $L_\mathrm{bol} \approx 15~L_\odot$ \citep{tobin2019}. It is part of a wide binary system, with the companion located at 3200 au at a distance $d\approx200$~pc. Lynds 483, commonly referred to as L483, is an isolated dense core which harbors the infrared Class 0 source IRAS 18148--0440. Traditionally, L483 was associated with the Aquila Rift region at an inferred distance of $200$~pc, however recent astrometry has revised the distance to the Aquila Rift up to $d\approx436\pm$9~pc \citep{ortiz-leon2018}. Subsequent analysis based on stellar extinction and parallaxes from Gaia DR2 has shown that L483 is in fact located at a distance of 200-250~pc, i.e., not a part of the Aquila Rift complex \citep{jacobsen2018}. We assume a distance of $200$~pc in this paper. At this distance the estimated bolometric luminosity is 10-13~$L_\odot$ \citep{tafalla2000,shirley2000}. B335 is a Bok globule located at $d\approx100$~pc \citep{olofsson2009} and is the least luminous of our targets with a bolometric luminosity of $L_\mathrm{bol} \approx 0.72~L_\odot$ \citep{evans2015}. The central source is also known as IRAS 19347+0727 and identified as a low-mass Class 0 protostar. The central gas shows signs of infall and a rotational structure \citep[e.g.,][]{imai2019}. The paper is structured as follows. The observations and calibration procedures are presented in Section \ref{sec:2}. Results are presented in Section \ref{sec:3}. The HDO/H$_2$O ratios are deduced and compared with previous measurements of water deuteration toward protostars in Section \ref{sec:4} along with a discussion of the implications. Finally, the results are summarized in Section \ref{sec:5} along with an outlook for the study of water deuteration and the impact of the local cloud environment. \begin{figure} \centering \includegraphics[width=\hsize]{all_cont.pdf} \caption{Continuum emission at 202.7~GHz toward the three sources. The map shows emission above 3$\sigma_\mathrm{rms}$ with white contours at 5$\sigma_{\mathrm{rms}}$, 10$\sigma_{\mathrm{rms}}$, and 30$\sigma_{\mathrm{rms}}$. The maps are presented on same linear scale. The black cross marks the peak location and the grey arrows indicate the potential direction of outflows which may be perturbing the dust distribution. For BHR71--IRS1 the grey arrows indicates the outflow direction presented by \cite{benedettini2017} and \cite{yang2017_BHR71}. } \label{fig:cont} \end{figure} \section{Observations} \label{sec:2} The low-mass embedded protostars L483, BHR71--IRS1, and B335 were observed with ALMA during Cycle 5 (PI Jes K. J{\o}rgensen, projectid: 2017.1.00693.S). For L483 the observations were centered on $\alpha_{\mathrm{J}2000}$=18:17:29.9, $\delta_{\mathrm{J}2000}$=--04:39:39.6, for BHR71--IRS1 $\alpha_{\mathrm{J}2000}$=12:01:36.5, $\delta_{\mathrm{J}2000}$=--65:08:49.3, and for B335 $\alpha_{\mathrm{J}2000}$=19:37:00.9, $\delta_{\mathrm{J}2000}$=07:34:09.6. Information on the observation dates and calibration sources can be found in Table \ref{table:observations}. One spectral setup targeted the HDO $3_{1,2}$--$2_{2,1}$ and $2_{1,1}$--$2_{1,2}$ transitions at 225.8967~GHz (LSB) and 241.5616~GHz (USB) respectively in the ALMA band 6. Another spectral setup targeted the H$_{2}^{18}$O $3_{1,3}$--$2_{2,0}$ transition at 203.4075~GHz in Band 5. Each spectral window contains 1920 channels with a width of 122~\mbox{kHz} (0.11 km s$^{-1}$). The source velocities, estimated from the HDO $3_{1,2}$--$2_{2,1}$ transition are $4.5$~km~s$^{-1}$, $-5.0$~km~s$^{-1}$, $7.9$~km~s$^{-1}$ for L483, BHR71--IRS1, and B335 respectively. Each dataset was pipeline-calibrated using {\sc casa 5.1} \citep{casa}. Phase self-calibration was performed using continuum channels for each dataset with {\sc casa 5.4}. For B335 a substantial improvement in the S/N ratio was achieved through self-calibration, while only marginal gains were achieved for BHR71-IRS1 and no gains for L483. For the latter we opted to use the pipeline product, since the self-calibrated data offered no improvements. For the self-calibrated sources we performed continuum subtraction using {\sc casa uvcontsub} before inversion. The images were deconvolved using the {\sc tclean} algorithm with a robust parameter of $-0.5$. For each source a continuum image was created at 202.7~GHz. The synthesized beam size range from $0\farcs4\times0\farcs3$ to $0\farcs7\times0\farcs5$ for the HDO spectral windows and $0\farcs8\times0\farcs5$ to $1\farcs2\times1\farcs0$ for the H$_{2}^{18}$O spectral window (see Fig. \ref{fig:maps}). \begin{table*} \centering\caption{Observation log.} \label{table:observations} \centering \begin{tabular}{l l c c c c c c} \hline \hline \noalign{\smallskip} Source & Date & Phase Calibrator & Bandpass Calibrator & Max. baseline~(m) & N$_{\mathrm{antenna}}$ & ALMA Band\\ \noalign{\smallskip} \hline \noalign{\smallskip} L483 & 2017 March 11 & J1743$-$0350 & J1751+0939 & 1100 & 42 & 6 \\%& $0.502 \times 0.338$ \\ L483 & 2017 August 27 & J1743$-$0350 & J1751+0939 & 768 & 44 & 5 \\%& $0.828 \times 0.519$ \\ BHR71--IRS1 & 2017 January 15 & J1147$-$6753 & J0904$-$5735 & 1797 & 46 & 6 \\%& $0.922 \times 0.688$ \\ BHR71--IRS1 & 2017 September 4 & J1147$-$6753 & J1107$-$4449 & 677 & 43 & 5 \\%& $0.428 \times 0.330$ \\ B335 & 2017 March 20 & J1955+1358 & J2025+3343 & 740 & 44 & 6 \\%& $0.681 \times 0.520$ \\ B335 & 2017 August 27 & J1938+0448 & J2000$-$1748 & 759 & 45 & 5\\ \noalign{\smallskip} \hline \end{tabular} \end{table*} \begin{figure*} \resizebox{\hsize}{!} {\includegraphics{3x3_figure_all0maps.pdf}} \caption{Integrated emission for the targeted water transitions toward each of the sources. \emph{Left column:} HDO $3_{1,2}$--$2_{2,1}$ transition at 225.9~GHz. The white shaded regions show the FWHM extent of a 2D gaussian fitted to the data in the image plane and the white cross indicates the peak position of the fit. \emph{Middle column:} HDO $2_{1,1}$--$2_{1,2}$ transition at 241.6~GHz. \emph{Right column:} H$_{2}^{18}$O $3_{1,3}$--$2_{2,0}$ transition at 203.4~GHz. \newline Emission below $5\sigma$ is not included, where $\sigma = \sigma_{\mathrm{rms}} \times N_\mathrm{channels}^{0.5} \times d\varv$; $d\varv$ is the channel width and $N$ is the number of collapsed channels. The black cross marks the 202.7~GHz continuum peak position toward which the spectra are extracted.} \label{fig:maps} \end{figure*} \section{Results} \label{sec:3} Figure \ref{fig:cont} shows the continuum emission at 202.7~GHz above 3$\sigma_{\mathrm{rms}}$ toward the three sources. All sources are clearly detected and the continuum structure is resolved on linear scales of $\sim 100$ au. Toward L483 the continuum emission is extended along the north-west to south-east diagonal potentially tracing the cavity walls of an outflow directed perpendicular to this direction. Toward B335 the dust emission extends far out from the central source with a notable lack of emission in the east-west direction, likely driven by outflows along this direction. Since B335 is located closer than the other two sources more of the envelope emission is filtered out by the interferometer. Comparing the continuum toward B335 with \cite{imai2016}, who observed the source at similar angular resolution and continuum wavelength, we see good agreement: the 10$\sigma$ contours (3 mJy~beam$^{-1}$) appear almost identical. Toward BHR71--IRS1 the continuum appears more circular with no evidence of the known outflows perturbing the dust in the plane of the sky. The HDO emission lines are identified using data from the Jet Propulsion Laboratory \citep[JPL,][]{JPL}, referencing \cite{HDO_ref}, while the H$_{2}^{18}$O transitional data originate from the Cologne Database for Molecular Spectroscopy \citep[CDMS,][]{CDMS}, with spectral details from \cite{h218o_ref}. All querying was done through the Splatalogue interface\footnote{\url{http://www.cv.nrao.edu/php/splat/}}. The targeted water isotopologs are detected toward each of the sources: the HDO transitions are detected with high signal to noise (SNR $> 10$) while the H$_{2}^{18}$O lines are slightly weaker detections (SNR $\sim 5-10$, Fig. \ref{fig:maps}). The targeted emission lines are presented in Figure \ref{fig:fitted_lines} along with fitted gaussian profiles. The H$_{2}^{18}$O data are rebinned by a factor of two for clarity, however this does not influence the abundances and HDO/H$_2$O ratios derived in this paper. \begin{figure*} \resizebox{\hsize}{!} {\includegraphics{all_lines.pdf}} \caption{Continuum-subtracted spectra for the three target transitions, extracted toward the continuum peak. Blue lines represent the gaussian fits. For BHR71--IRS1, dimethyl ether lines (green) are fitted and subtracted from the spectrum before the H$_{2}^{18}$O line (blue) is fitted. The H$_{2}^{18}$O lines have been rebinned by a factor of two for clarity.} \label{fig:fitted_lines} \end{figure*} Each spectrum is extracted toward the 202.7~GHz continuum peak of the source (see Fig. \ref{fig:cont}). For the spectral windows centered on the HDO transitions the image cube is convolved with a gaussian kernel using the {\sc imsmooth} function in {\sc casa}. The size of the gaussian kernel is determined such that the shape of the beam in the resulting image matches the larger beam of the H$_{2}^{18}$O image cube at 203~GHz, allowing for direct comparison between the extracted spectra (see Fig. \ref{fig:maps} for beam sizes before the convolution). Toward B335 and BHR71--IRS1 the emission lines are fitted using a single gaussian profile. Toward L483 the emission lines show two components: a brighter redshifted component and weaker blueshifted component. In this case two gaussian profiles were used to fit the lines. The double-peaked line profiles are consistent with previous high-resolution observations of hot corino species toward L483 presented in \cite{oya2017} and \cite{jacobsen2018} who independently found evidence of infalling rotating motion in the hot corino region toward the source. Toward BHR71--IRS1 there is a slight hint of a broader outflow component in the wings of the emission lines, but this component is too weak to influence the fitted profile significantly. No extended outflow structure is seen when imaging the line-wings of any of the water transitions. The H$_{2}^{18}$O line is partialy blended with dimethyl ether (CH$_3$OCH$_3$) toward BHR71-IRS1. In this case, six transitions of CH$_3$OCH$_3$ are fitted with gaussian profiles using a fixed FWHM and system velocity and the fit is subsequently subtracted from the spectrum to remove the blending before the H$_{2}^{18}$O line is fitted. In Appendix \ref{app:velocity} we present velocity field for the three transitions toward each source. These maps confirm that no high-velocity outflow components contribute to the observed emission for the emission lines in question. Toward L483 the velocity field is consistent with the results of \citet{jacobsen2018}. Figure \ref{fig:maps} shows integrated emission maps for H$_{2}^{18}$O and HDO toward the three sources. The detected emission originates from the central $\sim 100$ au for each source, consistent with the emission originating in the hot corino ($T>100$~K). In both cases the central emission is unresolved and the slight variation in the extent of the emitting region can be explained by the differences in synthesised beam size. The peak positions of the continuum emission and water emission overlap down to scales of the synthesised beam size. Since we aim to determine the gas-phase abundances of HDO and H$_2^{18}$O in the hot corino, it is essential that the observed emission lines originate from this region. We are confident this is the case for several reasons. The emission is compact, originating from scales of less than 100~au. This is confirmed by fitting two-dimensional gaussian profiles to the emission maps. Here the FWHM extent on linear scales ranges from 50~au to 100~au. The fitted 2D profiles for the HDO $3_{1,2}-2_{2,1}$ transition toward the three sources are shown in the left column of Figure \ref{fig:maps}. Additionally, the upper energy levels of the detected transitions lie around 100--200~K and the transitions are thus not easily excited in the cold outer envelope. Lastly, the line widths (FWHM $\lesssim 6~\mathrm{km}~\mathrm{s}^{-1}$) of the emission lines are consistent with emission from the hot corino, with little or no evidence of outflow emission blending as described above and the emission is not extended along the known outflow directions, as in NGC1333 IRAS 2A \citep{persson2012}. \begin{table*} \caption{Fit parameters for the targeted HDO and H$_{2}^{18}$O transitions.} \label{table:lines} \centering \smallskip \smallskip \begin{tabular}{c c c c c c} \hline\hline \noalign{\smallskip} Species & $\nu_\mathrm{rest}$ (\mbox{GHz}) & $F_{\nu}^{\mathrm{peak}}$ \mbox{(mJy beam$^{-1}$)} & FWHM (km~s$^{-1}$) & $\varv_{\mathrm{lsr}}$ (km~s$^{-1}$) & $N$ (cm$^{-2}$) \\ \hline \noalign{\smallskip} \multicolumn{6}{c}{\it L483} \\ \hline HDO & 225.896720$^{a}$ & $37\pm4$ & $4.8\pm0.3$ & $1.7\pm0.1$ & ($1.7\pm0.2$)$\times10^{15}$ \\ HDO & 225.896720$^{b}$ & $78\pm8$ & $5.6\pm0.2$ & $7.4\pm0.1$ & ($4.3\pm0.4$)$\times10^{15}$ \\ HDO & 241.561550$^{a}$ & $42\pm5$ & $5.1\pm0.2$ & $2.1\pm0.2$ & ($1.8\pm0.2$)$\times10^{15}$ \\ HDO & 241.561550$^{b}$ & $82\pm8$ & $5.5\pm0.4$ & $7.7\pm0.2$ & ($3.8\pm0.4$)$\times10^{15}$ \\ H$_{2}^{18}$O & 203.407520$^{a}$ & $10.2\pm1.5$ & $5.2\pm1.0$ & $2.4\pm0.4$ & ($2.3\pm0.6$)$\times10^{15}$ \\ H$_{2}^{18}$O & 203.407520$^{b}$ & $10.5\pm1.5$ & $5.2\pm1.0$ & $9.2\pm0.4$ & ($2.4\pm0.6$)$\times10^{15}$\\ \noalign{\smallskip} \hline \noalign{\smallskip} \multicolumn{6}{c}{\it B335} \\ \hline HDO & 225.896720 & $190\pm19$ & $4.74\pm0.04$ & $7.97\pm0.16$ & ($3.1\pm0.3$) $\times 10^{15}$ \\ HDO & 241.561550 & $187\pm19$ & $4.71\pm0.05$ & $7.89\pm0.15$ & ($2.6\pm0.3$) $\times 10^{15}$ \\ H$_{2}^{18}$O & 203.407520 & $32\pm4$ & $5.78\pm0.36$ & $7.49\pm0.14$ & ($2.9\pm0.4$) $\times 10^{15}$ \\ \noalign{\smallskip} \hline \noalign{\smallskip} \multicolumn{6}{c}{\it BHR71--IRS1} \\ \hline HDO & 225.896720 & $65\pm7$ & $4.51\pm0.16$ & -$4.97\pm0.05$ & ($1.9\pm0.2$) $\times 10^{15}$ \\ HDO & 241.561550 & $66\pm7$ & $4.57\pm0.15$ & -$4.67\pm0.05$ & ($2.2\pm0.2$) $\times 10^{15}$ \\ H$_{2}^{18}$O & 203.407520 & $17\pm3$ & $3.80\pm0.48$ & -$4.07\pm0.20$ & ($2.0\pm0.4$) $\times 10^{15}$\\ \noalign{\smallskip} \hline \end{tabular} \tablefoot{$F_\mathrm{\nu}$ includes 10\% calibration uncertainty. FWHM uncertainty is determined as the maximum between the uncertainty in the fitted gaussian and the channel width. Column densities $N$ were calculated assuming optically thin emission from a gas in LTE at 124~K. Furthermore, the column densities assume that the emission fills the beam. Toward L483, ${}^a$ denotes the weaker blueshifted component and ${}^b$ the brighter redshifted component.\\} \end{table*} \begin{figure*} \resizebox{\hsize}{!} {\includegraphics{object_comparison_wide.pdf}} \caption{Comparison between the D/H ratio and HDO/H$_2$O ratio for comets in the Solar System and hot corino observations toward Class 0 protostars. Values for IRAS 16293--2422, IRAS 2A, and IRAS 4B are from \cite{persson2014}, while IRAS 4A--NW has been adjusted from the value quoted in the paper as a mistake in the data analysis was discovered, which enhanced the HDO abundance by a factor of $\sim$2. Errorbars show 1$\sigma$ uncertainties. For the isolated sources the uncertainty is based on statistical errors from the fitted gaussian profiles and a flux calibration uncertainty of 10\%. On the right axis the corresponding D/H ratio is shown. The references for the Oort Cloud Comets (OCC) and Jupiter Family Comets (JFC) can be found in Appendix \ref{app:table}. The colored regions show the standard deviation for each class of objects. Note that the HDO/H$_2$O ratio for the protostars are derived from observations of HDO and H$_{2}^{18}$O while some cometary values are derived from other proxies for the D/H ratio.} \label{fig:objects_comparison} \end{figure*} \section{Analysis and discussion} \label{sec:4} \subsection{Estimating the column densities of HDO and H$_{2}^{18}$O and deriving the HDO/H$_2$O ratio} We estimated the column densities of HDO and H$_{2}^{18}$O considering optically thin emission and local thermodynamic equilibrium (LTE) with an excitation temperature of 124~K. The choice of analysis was motivated by the aim to compare the present results with previous measurements presented in \cite{persson2014} and \cite{coutens2014} who determined the water deuteration in the hot corino toward a number of sources using the same method and excitation temperature. Choosing the same methodology, we can directly compare the water deuteration under similar assumptions. The results are summarized in Table \ref{table:lines}. The estimated column densities range from $(2-7)\times10^{15}$ cm$^{-2}$, comparable to the estimates of \cite{persson2014} where the HDO column densities range from $1.5\times10^{15}$ cm$^{-2}$ for the faintest source, IRAS 4B, to $1.2\times10^{16}$ cm$^{-2}$ for IRAS 2A. The estimated HDO/H$_2$O ratios for L483, B335, and BHR71--IRS1 are ($2.2\pm0.4$)$\times 10^{-3}$, ($1.7\pm0.3$)$\times 10^{-3}$, and ($1.8\pm0.4$)$\times 10^{-3}$, respectively. Uncertainties are derived from the statistical uncertainties of the fitted gaussian profiles with an additional 10\% uncertainty on the flux calibration. From the column density of H$_{2}^{18}$O we infer the H$_2$O water column densities by assuming the Galactic oxygen isotope ratio of $^{16}$O/$^{18}$O$ = 560$ \citep{wilson1994}. The HDO column density is determined as the weighted average of the two transitions. The HDO/H$_2$O ratios toward the three sources show little scatter and are well within the uncertainties of one another which suggests similar chemical evolution of water in these systems. The assumption of a fixed excitation temperature for the three sources only has a moderate effect on the estimated HDO/H$_2$O ratios. Calculations presented by \cite{persson2014} and \cite{jorgensen2010a} have shown that varying the excitation temperature in the range 50--300~K has limited influence on the HDO column densities in the LTE approximation. We confirm this in Appendix \ref{app:tex}, where the HDO/H$_2$O ratio is calculated for the measured line strengths and excitation temperatures in the range 30~K to 300~K. Toward L483, an excitation temperature $T_\mathrm{ex}\leqslant$ 60~K is needed to bring the HDO/H$_2$O ratio within the range of the four clustered sources reported in \cite{persson2014} while B335 and BHR71--IRS1 require $T_\mathrm{ex}\leqslant$ 70~K. Such low excitation temperatures in the inner $\sim50$-$100$~au are not expected. Since we observe two transitions of HDO for all three sources we can calculate the excitation temperature for each source under the assumption of LTE. The excitation temperatures are 127$\pm24$~K, 174$\pm59$~K, and 103$\pm$21~K for L483, B335, and BHR71--IRS1; hence the choice of 124~K as the excitation temperature is consistent with the HDO line strengths toward the three sources. Meanwhile, the derived excitation temperature for HDO is inconsistent with the lower excitation temperatures needed to bring the HDO/H$_2$O ratio down the values similar to the clustered sources, i.e., 60~K for L483 and 70~K for B335 and BHR71--IRS1. Computing the HDO/H$_2$O ratio for the estimated excitation temperatures yields ($2.2\pm0.4$)$\times 10^{-3}$ for L483, ($2.1\pm0.3$)$\times 10^{-3}$ for B335, and ($1.6\pm0.3$)$\times 10^{-3}$ for BHR71--IRS, all well within the error bars. Using the estimated excitation temperatures rather than the fixed value does not affect the conclusions presented here. The difference between optically thin LTE calculations, similar to those presented here, and more advanced modelling for comparable observations of HDO and H$_2^{18}$O have been studied in previous works to determine how well the former assumptions work in this regime. \cite{persson2014} ran radiative transfer models for IRAS 16293--2422 and IRAS 2A and found that the water column densities were consistent with those derived from optically thin LTE calculations. Similarly, \cite{coutens2014} ran non-LTE {\sc radex} calculations and found column densities consistent with the LTE calculations. These results suggest that the water emission originating in the hot corino of these low-mass Class 0 protostars is well approximated by LTE calculations and that the emission is not optically thick. We note that if the densities in the inner envelopes of the isolated protostars are lower than the clustered counterparts then the emission from the water isotopologs could be sub-thermal and the LTE approximation invalid. We consider it unlikely to be the case; observational estimates of the overall envelope masses and bolometric luminosities for L483 and B335 are comparable to those of IRAS 2A, IRAS4A, and IRAS4B \citep[see, e.g.,][]{shirley2002, jorgensen2007, kristensen2012}. With comparable envelope masses and luminosities it is unlikely that the inner density profile, i.e. on hot corino scales, would differ substantially between the isolated and clustered sources. The advantage of more advanced models, as opposed to the LTE approach adopted here, is often diminished by the uncertainties of the physical source parameters such as the kinematics, the density profile, protostellar parameters etc. Attempting more advanced modelling may thus offer little improvement over the LTE approach and makes direct comparison between sources more challenging. \subsection{Water deuteration: Comparison with existing observations} Figure \ref{fig:objects_comparison} shows the calculated HDO/H$_2$O ratios for the three isolated protostars along with existing data for a number of low-mass embedded protostars in clustered star-forming regions and cometary values from the Solar System. The protostellar values in Figure \ref{fig:objects_comparison} are all derived from interferometric observations with high spatial resolution to probe the hot corino emission where the ice is sublimated entirely off the dust grains. The three sources observed in this work have a similar degree of deuterium fractionation with HDO/H$_2$O ratios in the range $(1.7-2.2)\times10^{-3}$. Meanwhile, the four previously observed protostars lie in the range $(5.5-9.2)\times10^{-4}$. This suggests that the sources presented here, which are all isolated protostars, have a distinct chemical history compared to the clustered protostars previously targeted. Comets for which the D/H ratio have been determined generally show lower values than the isolated protostars as seen in Figure \ref{fig:objects_comparison}. Meanwhile, the clustered protostars show reasonable agreement with the Oort Cloud Comets, which have led to the suggestion that comets form from gas that is chemically similar to the gas observed in hot corinos, with little or no processing after this stage \citep{persson2014}. Assuming this is the case, and that the D/H ratio of comets have not changed significantly after their formation, this would suggest that the Solar System was formed in a clustered region of star formation. Such a scenario is also supported by evidence such as the abundance of short-lived radionuclides, high-eccentricity orbits of small Solar System bodies, and low occurrence rate of isolated protostars \citep{adams2010}. The apparent differentiation between clustered and isolated protostars can be understood in the framework for water formation and deuterium fractionation proposed by \cite{furuya2016}. They propose that water is primarily formed in the molecular cloud with limited deuteration. Later on, in the dense-core phase, deuteration is enhanced due to the low temperature and high shielding leading to the freeze-out of CO and a higher D/H ratio in the gas-phase. In this scenario, the duration of the dense-core phase determines the amount of deuteration, with a longer dense-core phase resulting in an enhanced deuterium enrichment in the ice. Conversely, a prolonged molecular cloud phase could decrease the deuterium fractionation and the HDO/H$_2$O ratio is thus related to the ratio of the life-time of the two stages. The star-formation process is recognized to be heterogenous in nature, with some stars born in dense clusters while others are formed in relatively isolated regions of molecular clouds \citep[e.g.,][]{ward-thompson2007}. Stars born in dense clusters are likely to collapse on shorter timescales; the mean free-fall time scales with the inverse square root of the mean density $\rho_0$, $t_{\mathrm{ff}} = (3\pi/32G\rho_{0})^{1/2}$ \citep[e.g.,][]{padoan2014, krumholz2014}. Furthermore, external pressure from nearby massive stars in the local cloud region can trigger and potentially accelerate the collapse process in dense star forming regions. Accordingly, isolated protostars could experience a longer dense-core phase, enhancing the deuterium fractionation and potentially also enhancing the abundance of complex organic molecules formed from CO ice. The isolated protostars presented here all exhibit a higher deuterium fractionation than comparable counterparts in more dense, star-forming regions, in agreement with the theoretical expectation as outlined above. Assuming that the water formation processes are understood, this enhanced deuterium fractionation can imply two things: either the timescale of the dense-core phase is longer for the isolated cores or the molecular cloud phase, where most H$_2$O is formed, is shorter for clustered star formation. The latter option does not appear likely since both theoretical and observational data imply that isolated cores do not collapse more easily than their clustered counterparts \citep{ward-thompson2007}. Given that the isolated protostars presented here exhibit higher deuterium fractionation compared to clustered protostars, this implies that the ratio between the duration of the dense-core phase and the molecular cloud phase is higher for these sources. Another possible explanation for the differences between the HDO/H$_2$O ratios toward clustered and isolated protostars could be variations in the temperatures between the different regions. For example, higher initial gas temperatures in the clustered regions, e.g., due to irradiation by neighboring young stars, would also reduce the efficiency of deuteration enrichment in these regions. Further, observational constraints and numerical studies are needed to address the relative importance of the collapse time-scales and gas temperatures. The observations presented here support the hypothesis that the local cloud environment influences the early physical evolution and ultimately the chemistry of young stellar systems. A consequence of this is that the water deuteration can be an important proxy for both the chemical and the physical history of protostars. Regarding the question of inheritance or local processing of water during star formation, the results presented here favor the inheritance scenario, at least at the earliest protostellar phase, since all three isolated protostars show similar HDO/H$_2$O ratios. The lack of pronounced variation between the sources indicate a similar physical and chemical evolution for the systems, with little impact from local variations in, e.g., protostellar luminosity or accretion bursts. This conclusion is compatible with previous studies which modeled the water evolution from the collapse of an isolated pre-stellar cores to circumstellar disk \citep{visser2009, cleeves2014, drozdovskaya2016, furuya2017}. \section{Summary and outlook} \label{sec:5} In this paper we present the first ALMA Band 5 observations of the H$_{2}^{18}$O $3_{1,3}$--$2_{2,0}$ transition toward three isolated low-mass Class 0 protostars. Combined with observations of the HDO $3_{1,2}$--$2_{2,1}$ and $2_{1,1}$--$2_{1,2}$ transitions we have determined the HDO/H$_2$O ratio for the sources and compared with previous determinations of the water deuteration toward low-mass Class 0 protostars. \begin{enumerate} \item The targeted water emission is detected in the hot corino toward the targeted sources with a high S/N on angular scales of 0\farcs3-1\farcs1 corresponding to linear scales of $\sim$50-150~au. The column densities of HDO and H$_2^{18}$O have been determined assuming optically thin emission under local thermodynamic equilibrium with an excitation temperature of 124 K. \item From the estimated column densities the derived HDO/H$_2$O ratios for L483, B335, and BHR71--IRS1 are ($2.2\pm0.4$)$\times 10^{-3}$, ($1.7\pm0.3$)$\times 10^{-3}$, and ($1.8\pm0.4$)$\times 10^{-3}$, respectively. \item The three isolated protostars show a factor of $\sim2$ higher deuterium fractionation than the previously targeted sources, which are associated with larger cloud complexes. This observed differentiation in water deuteration is significant and can be explained by variations in the collapse timescales or initial gas temperatures depending on the cloud environment. In clustered regions external perturbations from nearby stars may either accelerate the collapse process through turbulence or heat the gas, leading to a lower deuterium fractionation. If this is the case then the degree of deuterium fractionation correlates with the local cloud environment, providing a new proxy for the early evolutionary history of young stars. \item The similarity of the HDO/H$_2$O ratio toward the three isolated protostars could indicate that little processing of the water has occurred from cold cloud to hot core and suggests that the conditions in the dense core phase, before the onset of the collapse, determines the deuterium fractionation at later stages. \end{enumerate} These observations present the first measurements of water deuteration targeting specific cloud environments and have nearly doubled the number of protostars for which the hot corino water deuteration has been measured. The observations indicate that isolated protostars have a distinct chemical history and further exploration of the relationship between cloud environment and deuterium fractionation could strengthen our understanding of the physical and chemical evolution during star formation. A natural progression is to determine the water deuteration toward more clustered or high-mass protostars, which should show lower fractionation levels according to the chemical evolution outlined above. Another option is to target doubly deuterated water, D$_2$O. At this stage the D$_2$O column density has only been determined toward the hot corino region of one source, NGC 1333 IRAS 2A \citep{coutens2014}. Expanding the number of sources for which the D$_2$O/HDO ratio is measured would test if the trend shown in Fig. \ref{fig:objects_comparison} is real. Should the trend not be present for the doubly deuterated water isotopolog then we are missing important details in the current chemical models. A third option to constrain the importance of the local cloud environment for the chemical evolution is to determine the deuteration of other molecules, such as methanol, in the hot corino. If the relationship between local cloud environment and molecular deuteration proposed here is correct, then the deuteration should be enhanced for all molecules. In parallel with observational efforts, numerical modeling is needed to improve our understanding of the effects of the local cloud environment on the chemistry of young stellar systems. So far, little work has been done to model the chemical evolution in the context of a dynamic molecular cloud environment, i.e., collapse models which include the influence of the surrounding cloud environment with the local differences in temperature, density, UV-field, and turbulence. Such modeling would strengthen our understanding of the link between chemistry, particularly the deuterium fractionation, and the local cloud environment. \begin{acknowledgements} We thank the anonymous referee for valuable comments, which improved the manuscript. This paper makes use of the following ALMA data: ADS/JAO.ALMA\#2017.1.00693.S. ALMA is a partnership of ESO (representing its member states), NSF (USA) and NINS (Japan), together with NRC (Canada), NSC and ASIAA (Taiwan), and KASI (Republic of Korea), in cooperation with the Republic of Chile. The Joint ALMA Observatory is operated by ESO, AUI/NRAO and NAOJ. The group of JKJ acknowledges support from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No 646908) through ERC Consolidator Grant "S4F". Research at the Centre for Star and Planet Formation is funded by the Danish National Research Foundation. Astrochemistry in Leiden is supported by the Netherlands Research School for Astronomy (NOVA). A.C. postdoctoral grant is funded by the ERC Starting Grant 3DICE (grant agreement 336474). \end{acknowledgements} \bibliographystyle{aa}
\section{Introduction}\label{intro} The density of states of the Schr\"odinger operator $-\Delta +V$ is one of the main characteristics defining the physical properties of the matter. At this point, most of the known estimates for the integrated density of states pertain to two {\it asymptotic} regimes, each carrying restrictions on the underlying potentials. The first one stems from the Weyl law and its improved version due to the Fefferman-Phong uncertainty principle \cite{F}. It addresses the energies or eigenvalues $\lambda\to +\infty$ and deteriorates for the potentials oscillating at a wide range of scales. The second one concentrates on the asymptotics as $\lambda$ tends to $0$ for disordered potentials, the so-called Lifschitz tails, and takes advantage of probabilistic arguments and the random nature of the disordered potentials. The goal of the present paper is to establish new bounds on the integrated density of states via the counting function of the so-called localization landscape \cite{FM-PNAS}. The main theorem can be viewed as a new version of the uncertainty principle, which, contrary to the above, applies uniformly across the entire spectrum and covers all potentials bounded from below irrespectively of their nature. To set the stage, let us consider the spectrum of the Schr\"odinger operator $L=-\Delta +V$ on a domain $\Omega\subset {\mathbb{R}}^d$. We shall assume for the time being that $\Omega$ is a cube in ${\mathbb{R}}^d$ of sidelength $R_0\in {\mathbb{N}}$ and make sure that the estimates that we seek do not depend on the size of the domain, so that we can pass to the limit of infinite domain whenever it is desired and appropriate. Assume furthermore that $V$ is a bounded non-negative function on $\Omega$ and $L=-\Delta +V$ (once again, the boundedness assumption on $V$ is, at this point, cosmetic: the resulting estimates do not depend on the maximum value and we can include more general potentials into consideration). We denote by $N$ the (normalized) integrated density of states of the operator $L$ with periodic boundary conditions on $\partial\Omega$, i.e., \begin{equation}\label{eq2.1} N(\mu):=\frac{1}{|\Omega|}\times \left\{\mbox{the number of eigenvalues $\lambda$ such that } \lambda \leq \mu\right\}. \end{equation} As usual, eigenvalues are counted with multiplicity. It is known that the operator $L$ above, with periodic boundary conditions on $\partial\Omega$, has a discrete spectrum consisting of positive eigenvalues and hence, the definition is coherent. In 1911, Hermann Weyl proposed what became later known as the Weyl law for the asymptotics of $N(\mu)$, as $\mu\to+\infty$, for the Laplace-Beltrami operator with the Dirichlet boundary conditions in a bounded domain. In his setting, the law gives an asymptotic of a multiple of $\mu^{d/2}$ as $\mu\to +\infty$. Perhaps much more importantly than the result itself, it gave a general approach to the asymptotics of the density of states of an elliptic operator, and in particular, the rule of thumb traditionally used in physics is \begin{equation}\label{eq1.1-bis} N(\mu) \sim \frac{1}{(2\pi)^d |\Omega|} \iint_{|\xi|^2+V(x)<\mu} \, dxd\xi, \quad \mbox{as } \mu\to\infty. \end{equation} It is simultaneously impossible to list all the directions in which the Weyl law has been extended over the years and to give a sharp class of $V$ to which it applies, with nice control of the asymptotic errors\footnote{The estimate from above is due to Cwickel, Lieb and Rosenblum \cite{S79}.}. However, the oscillations of $V$ at the scales smaller than $\mu^{-1/2}$ can easily destroy the validity of the volume-counting \eqref{eq1.1-bis} for the corresponding $\mu$. In fact, the Weyl law prediction \eqref{eq1.1-bis} fails even for systems as simple as two uncoupled harmonic oscillators, that is, the potential $V(x_1, x_2)=x_1^2+\varepsilon x_2^2$ with a small $\varepsilon$ (see, e.g., \cite{F}, p. 143). An obvious shortcoming of the ``classical" Weyl law is the emphasis on the volume counting itself, as an eigenfunction cannot occupy an arbitrarily shaped volume in the phase space. This issue has been alleviated with the celebrated Uncertainty Principle of Fefferman and Phong ultimately reaching out to the problem of stability of matter \cite{F}. Instead of the volume-counting of \eqref{eq1.1-bis}, Fefferman and Phong suggested to estimate the number of disjoint cubes with sidelength $\mu^{-1/2}$ and such that $\left(\fint_Q |V|^p\, dx\right)^{1/p} \leq C\,\mu$, smoothing the oscillations of $V$ at the correct scales. The resulting bounds on $N(\mu)$ were proved when $V$ is a polynomial and $p=\infty$ in \cite{F} and for $V\geq 0$ in a suitable reverse H\"older case by Shen \cite{Shen-TAMS, Shen-Duke}, and were also extended to estimates on a number of negative eigenvalues for general $V\leq 0$. Overall, these ideas have brought a number of fascinating results -- their goals and achievements, stemming from a new diagonalization of pseudodifferential operators, are beyond the scope of our review. But in the particular context of interest in this paper, they also \color{red} fall \color{black} short in some respects. First, searching for the aforementioned collection of optimal cubes for every $\mu$ can be computationally very challenging. Secondly, and this is exactly the reason for the restrictions on the potential and/or asymptotic nature of the results, the sharp estimates from above and below for positive potentials are only available when $V$ behaves not too violently at the corresponding scales. This rends them formally inapplicable for the Anderson or other disordered potentials, and more generally whenever $V$ is very different from its average on a cube. The Landscape Law proposed in this paper addresses both of these issues. The landscape ``determines" the correct cubes and exhibits precisely the correct oscillation, in some sense creating a perfect effective potential for the Fefferman-Phong-type counting from any initial $V$. above which would be desirably close to the estimate from below is challenging and requires different techniques. landscape, which yielded astonishingly precise non-asymptotic estimates on the density of states for both periodic and certain Anderson-type potentials throughout multiple numerical and physical experiments \cite{FM-PNAS, ADFJM-SIAM, ADFJM-PRL}. However, so far no rigorous mathematical results have supported these findings and, in particular, it was not clear what are the exact bounds, what is the range of potentials to which the theory could be applied, whether the results are generic or governed by the particular choice of examples, whether one can truly furnish localization landscape theory in the context of Anderson localization. In the present paper we prove that a counting function arising from the landscape provides sharp estimates from above and below on the density of states {\it for any non-negative potential} in the Schr\"odinger operator. As a by-product, we derive new estimates on the integrated density of states for the Anderson-type potentials. However, the latter is only a particular instance of our theory -- our main results are deterministic. The concept of {\it localization landscape} was pioneered by the second and third authors of the present paper in \cite{FM-PNAS}. The landscape is the solution to $(-\Delta+V)\,u=1$, with the same boundary conditions as the original operator in question. When applied to the Laplacian rather than the Schr\"odinger operator and equipped with the Dirichlet boundary conditions, the landscape is nothing else than the classical torsion function, however, its role in our theory and its character in the presence of a potential are very different, and we will continue using the {\it landscape} terminology which seems to be more illustrative under the circumstances. First numerical \cite{ADFJM-PRL} and then rigorous mathematical results \cite{ADFJM-CPDE} have demonstrated the relationship between the landscape and the location and shape of localized eigenfunctions, including the pattern of their exponential decay. One of the key observations underpinning these works is that the operator $L=-\Delta +V$ has exactly the same spectrum as a conjugated operator $$-\frac {1}{u^2}\, {\rm div} \, u^2 \,\nabla +\frac 1u$$ which brings up $1/u$ as an effective potential. This is a consequence of the identity \begin{equation}\label{eq1.2} \int |\nabla f|^2 + Vf^2\, dx = \int u^2 \left| \nabla \,\Bigl(\frac fu\Bigr)\right|^2 +\frac1u\, f^2 \, dx, \end{equation} valid for all $f$ in the corresponding Sobolev space $W^{1,2}(\Omega)$ and proved in \cite{ADFJM-CPDE}. However, not only $1/u$ plays the role of a potential, but it exhibits decisively better properties than the original $V$. The reduced kinetic energy, which is the first term on the right-hand side of of \eqref{eq1.2}, is small in many typical examples, at least at the bottom of the spectrum, and hence $1/u$ ``absorbs" the information about both kinetic and potential energy of the original system, in some sense, yielding a stronger form of the Uncertainty Principle than those discussed above. Motivated by these considerations, we were led to investigate the information about the spectrum of $L$ encoded in $1/u$, and the numerical experiments brought surprising results, in fact, exceeding original expectations \cite{ADFJM-PRL, ADFJM-SIAM}. In generic samples of Anderson-type potentials in finite one- and two-dimensional domains one could observe two strongly emerging patterns. First, the eigenvalues at the bottom of the spectrum are essentially dimensional multiples of local minima of $1/u$. That is, independently of the potential, we observe an almost equality \begin{equation}\label{eq1.3}\left(1+\frac d4\right) \left(\min \frac 1u\right)_j \sim \lambda_j \end{equation} where the eigenvalues and minima are indexed in nondecreasing order. Secondly, a version of the Weyl law governed by the potential $1/u$ \begin{equation}\label{eq1.4} N(\mu) \sim \frac{1}{(2\pi)^d \,|\Omega|} \iint_{|\xi|^2+\frac{1}{u(x)}<\mu} \, dxd\xi \end{equation} yields, contrary to \eqref{eq1.1-bis}, an approximation of the density of states throughout the spectrum, for all values of $\mu$, albeit working a little worse than minima \eqref{eq1.3} at the very bottom. Figure~\ref{fg:weyl1d}, taken from \cite{ADFJM-SIAM}, shows the advantage of using the landscape rather than the original $V$ in the predictor \eqref{eq1.4}. \begin{figure}[htbp] \includegraphics[width=3in]{fig15a.png} \caption{\cite{ADFJM-SIAM} The IDOS $N$ (in black), the original Weyl law approximation $N_V$ from the right-hand side of \eqref{eq1.1-bis} (in green), and the approximation using the landscape function, $N_W$, $W=1/u$, from the right-hand side of \eqref{eq1.4} (in red) for a random uniform potential in one dimension on an interval of length 512. The quantities are not normalized by volume.} \label{fg:weyl1d} \end{figure} Both observations have been immediately adopted by physicists, for Schr\"odinger and Poisson-Schr\"odinger (Hartree-Fock) systems~\cite{LED1, LED2, Schulz-PRB, JApplPhys}, and for Dirac equation~\cite{Dirac}; however, even rigorous mathematical conjectures remained beyond reach, particularly if aiming for non-asymptotic statements. Indeed, one can rather easily construct counterexamples about taking \eqref{eq1.3} or \eqref{eq1.4} as near identities~\cite{ComtetPRL, ReplyPRL}, and the numerical evidence was initially restricted to dimensions 1 and 2, either Anderson-type or periodic potentials, and reasonably small domains, especially in dimension 2. The latter point, in particular, could raise doubts on the applicability of these approximations in the limit of infinite domain. The present paper is the first mathematical treatment of a rigorous connection between the landscape function and the eigenvalues of $L$ in the entire range of $\lambda$. We show that a counting function of the minima of $1/u$ yields sharp deterministic estimates {\it from above and below} on the integrated density of states, without restrictions on the underlying potential. Passing to the statements of the results, recall that $\Omega$ is a cube in ${\mathbb{R}}^d$ of sidelength $R_0\in {\mathbb{N}}$. For any $r>0$ such that $R_0$ is an integer multiple of $r$, we denote by $\{Q\}_r$ a disjoint collection of cubes of sidelength $r$, such that every $Q_r$ is contained in $\Omega$ and $\bigcup_{Q\in \{Q\}_r} \bar Q = \bar\Omega$. Our cubes are always open unless stated otherwise. We shall work with functions satisfying periodic boundary conditions on $\partial\Omega$ and, slightly abusing the notation, will often identify $\Omega$ with the torus $({\mathbb{R}}/R_0 \,{\mathbb{Z}})^d$. As in the beginning of the introduction, $V$ is a bounded nonegative function on $\Omega$, $L=-\Delta +V$ is the Schr\"odinger operator on $\Omega$, which we take with the periodic boundary conditions, and the integrated density of states is defined by \eqref{eq2.1}. Going further, let $u$ be the solution to $Lu=1$ on $\Omega$, also with periodic boundary conditions. Then it is known (and easy to prove) that $u$ is positive and bounded, and we define \begin{equation}\label{eq2.2} N_u(\mu):=\frac{1}{|\Omega|}\times \left\{\mbox{the number of cubes } Q\in \{Q\}_{\kappa\,\mu^{-1/2}} \mbox{ such that } \min_Q \frac 1u \leq \mu\right\}, \end{equation} where by convention $1\leq \kappa<2$ (depending on $\mu$) is the smallest number such that $R_0$ is an integer multiple of $\kappa \mu^{-1/2}$. \begin{theorem}[The Landscape law] \label{t2.1} Retain the definitions above. There exist constants $C_i$, $i=1,...,4,$ depending on the dimension only, such that \begin{equation}\label{eq2.4} C_1 \alpha^{d} N_u (C_2 \alpha^{d+2} \mu) - C_3N_u (C_2 \alpha^{d+4} \mu) \leq N(\mu) \leq N_u (C_4 \mu) \end{equation} for every $\alpha<2^{-4}$ and every $\mu>0$. \end{theorem} The strength of Theorem~\ref{t2.1} lies in its generality compared to all previously available results: \begin{itemize} \item Theorem~\ref{t2.1} is not asymptotic, the estimate \eqref{eq2.4} is valid throughout the spectrum, with constants independent of $\mu$. \item The constants in \eqref{eq2.4} do not depend on smoothness or oscillations of $V$, nor on the possible probability law beyond its construction (or lack of thereof), nor, in fact, on the $L^\infty$ norm of $V$ or the size of the domain $R_0$. If one allows the dependence on $\|V\|_{L^\infty(\Omega)}$, the situation for large $\mu$ is of course rather trivial (both the density of states and $N_u(\mu)$ roughly behave as those of the Laplacian), and similarly the scales bigger than $R_0$ would be easy to handle. We emphasize the lack of dependence on any of these parameters, which makes it possible to apply the theorem to the limit of an infinite potential or an infinite domain. \end{itemize} Looking at \eqref{eq2.4}, one obviously faces the question of the polynomial correction in the estimate from below. And indeed, in applications \eqref{eq2.4} often transforms into the even stronger estimate $$N_u (C'_2 \,\mu) \leq N(\mu) \leq N_u (C_4\, \mu)$$ by taking $\alpha$ small. There are (at least) two mechanisms to achieve this, which are fortunately roughly complementary. The first one is to prove a doubling condition for the landscape $u$. \begin{theorem}[The doubling case] \label{t2.1-bis} Retain the definitions above. If, in addition, $u^2$ is a doubling weight at relatively small scales, specifically, if there is a constant $C_D \geq 1$ such that \begin{equation}\label{eq2.5} \int_{Q_{2s}} u^2\, dx\leq C_D \left( \int_{Q_{s}} u^2\, dx +s^{d+4}\right) \end{equation} for every cube $Q_s$ of sidelength $s>0$ then \begin{equation}\label{eq2.6} N_u (C'_2 \,\mu) \leq N(\mu) \leq N_u (C_4\, \mu) \ \hbox{ for every $\mu>0$,} \end{equation} where $C_4$ is as in Theorem~\ref{t2.1} and $C'_2$ depends only on $C_D$ and the dimension. \end{theorem} In the doubling condition and everywhere below, we interpret $u$ as a function on the torus, that is, if the cubes intersect the boundary, it is understood that one uses the periodic extension of $u$. There is a certain dichotomy between the range of applicability of Theorem~\ref{t2.1-bis} and its complement, in particular, disordered systems. Notice that \eqref{eq2.4} transforms into \eqref{eq2.6} if $N_u(\mu)$ decays sufficiently fast as $\mu$ tends to $0$. This would not be the case, e.g., in the realm of periodic potentials, when one expects that both the integrated density of states and $N_u (\mu)$ behave as $\mu^{d/2}$. Fortunately, in this case $u^2$ is a doubling weight, \eqref{eq2.5} is satisfied, and hence we can directly apply Theorem~\ref{t2.1-bis}. A similar situation \color{red} occurs \color{black} when $V$ is sufficiently well-behaved. For instance, for $d\geq 3$, if $V$ satisfies the Kato condition \begin{equation}\label{Kato} \sup_{z\in {\mathbb{R}}^d, \, r>0} \int_{B_r(z) \cap \Omega} \frac{V(x)}{|x-z|^{d-2}} \, dx =:K <\infty, \end{equation} then \eqref{eq2.5} is verified and hence, the integrated density of states satisfies \eqref{eq2.6} directly. This can be seen as a combination of results from Theorem~1.3 in \cite{Kurata}, which guarantee that for non-negative supersolutions to $(-\Delta +V) u \geq 0$ there exists $\delta>0$ such that $u^\delta$ is doubling, and classical Moser inequalities for subsolutions to $-\Delta u\leq 1$, which allow one to bound $\sup_{Q_s} u$ by $\left( \fint_{Q_{s}} u^2\, dx\right)^{1/2}+r^2$ (cf. \cite{HL}, Theorem 4.14). We observe that this includes, on finite domains, even singular potentials weaker than $1/|x|^2$, but as usual, one has to pay attention to emerging constants: if \eqref{Kato} is used, the resulting constant in \eqref{eq2.6} \color{red} may \color{black} depend on $K$, which might or might not be suitable for the problem at hand. In fact, if $V$ is regular itself, \eqref{eq2.5} could be easier to check directly, without involving \eqref{Kato}, but for now let us move to the case when \eqref{eq2.5} \color{red} can fail. \color{black} could display pure point spectrum and exponentially decaying eigenfunctions. A certain pre-runner of Anderson localization (in fact, a simpler phenomenon of rare big regions) manifests itself through the so-called Lifschitz or Urbach tails: as $\mu\to 0$, $N(\mu)$ behaves roughly as $e^{-c \mu^{-d/2}}$ contrary to the more usual behavior $\mu^{d/2}$ observed in non-disordered systems (compare to the Weyl law above). We underline that this, once again, is an asymptotic result, now at the edge $\mu \to 0$, with a limited understanding of errors and the range where the asymptotic is precise. A typical example of potential that destroys \eqref{eq2.5} is any of the Anderson-type potentials. The latter is a subclass of disordered potentials where $V$ is, for instance, a linear combination of bumps with random amplitudes taking values between 0 and 1 according to some probability law. It is a setting of the Anderson localization -- a famous phenomenon when such a system, in the limit of an infinite domain, could display pure point spectrum and exponentially decaying eigenfunctions. We shall see that in this case, although \eqref{eq2.5} fails, fortunately $N_u(\mu)$ has exponential growth as $\mu \to 0$, and hence \eqref{eq2.4} implies \eqref{eq2.6} because the exponential behavior suppresses polynomial corrections. In the terminology of \cite{PasturBook}, such is the situation near fluctuation boundaries generally exhibited by Schr\"odinger operators with random (disordered) potentials. Hence, any fluctuating boundary would yield \eqref{eq2.6}. Here we just isolate one result. \begin{theorem}\label{t1.11} Retain the definitions of $\Omega$ and $L$ from Section~\ref{intro}. Let $\varphi\in C_0^\infty(B_{1/10}(0))$ be a nontrivial bump function supported in the ball centered at 0 of radius $1/10$, with $0\leq \varphi\leq 1$, and set $$ V=V_{\omega} (x)=\sum_{j\in {\mathbb{Z}}^d} \omega_j \varphi(x-j) \quad \hbox{for } x\in \Omega, $$ where the $\omega_j$ are i.i.d. variables taking values in $[0,1]$, whose probability distribution $$F(\delta)=\mathbb{P}\{\omega \leq \delta\}, \quad 0\leq \delta\leq 1,$$ is not trivial, i.e., not concentrated at one point, and such that $0$ is the infimum of its support. Denote by $N^E_u(\mu)=\mathbb{E}\, N_u(\mu)$ the expectation of the counting function of minima of $1/u$, as defined in \eqref{eq2.2} and by $N^E(\mu)=\mathbb{E}\, N(\mu)$ the expectation of the density of states, as defined in \eqref{eq2.1}. Then there exist constants $C_5, C_6 >0$ depending on the dimension and the expectation of the random variables $\omega_j$ added an s and the name only, and a constant $C_4>0$, depending on the dimension only, such that \begin{equation}\label{eq3.33-bis} C_5N_u^E (C_6\, \mu) \leq N^E(\mu) \leq N_u^E (C_4\, \mu), \end{equation} for every $\mu>0$. \end{theorem} Since $0$ is the infimum of the support of $F$, we have $F(\delta) > 0$ for $\delta >0$; also, the measure is not a Dirac mass at the origin, so $\lim_{\delta \to 0} F(\delta) < 1$. This implies that the common expectation $\mathbb{E}(\omega)$ of the $\omega_j$ lies in $(0,1)$, and we claim that $d$ and $\mathbb{E}(\omega)$ alone control our constants. We will see in Theorems \ref{t3.1} and \ref{t1.15} that both numbers $N^E(\mu)$ and $N_u^E(\mu)$ are related to the behavior of the distribution function $F(\delta)$, and in particular its asymptotics when $\delta$ tends to $0$, which may be complicated; here we say that the constants in these relations depend only on $d$ and $\mathbb{E}(\omega)$. We underline -- yet again -- that Theorem \ref{t1.11} is not an asymptotic result, and multiple numerical experiments \cite{ADFJM-SIAM} show the strength of this estimate in the intermediate regime where $\mu$ is neither large nor small, as well as its applicability to the potentials where $V$ is disordered but unbounded and thus, no other results for large $\mu$ are readily available. Moreover, even in the asymptotic regimes, \eqref{eq3.33-bis} offers more precision than the traditional Lifschitz tail estimates, in particular, encompassing faithfully the differences between individual choices of the disordered potentials; this will be discussed more thoroughly in Section \ref{S3}; also see~\cite{Desforges} for a detailed numerical study of the Landscape Law and its comparison to the available results in the presence of disorder. In conclusion, we would like to zoom back out from the specific applications and to reiterate that the Main Theorem should be viewed as a form of the Uncertainty Principle whose generality is not inhibited by properties of the potential or range of the energies, a ``black box" which gives good bounds on the density of states irrespectively of the physical nature of the initial system. \vskip 0.08 in \noindent{Acknowledgements.} We thank Douglas Arnold and David Jerison for uncountable inspiring conversations on the subject and the joint work \cite{ADFJM-PRL, ADFJM-SIAM} which lies at the foundation of the results in this paper. The third author would also like to thank T. Spencer and L. Pastur for many stimulating discussions, and W. K\"onig, Z. Shen, and W. Kirsch, for sharing some references and the historical perspective. David is supported in part by the H2020 grant GHAIA 777822, and Simons Foundation grant 601941, GD. Filoche is supported in part by Simons Foundation grant 601944, MF. Mayboroda is supported in part by the NSF grants DMS 1344235, DMS 1839077, and Simons Foundation grant 563916, SM. \section{Main estimates: doubling and non-doubling scenario} We start with the {\it Proof of Theorem~\ref{t2.1}.} \noindent {\bf Step I: the upper bound}. We start with the upper bound on $N(\mu)$. The estimate $N(\mu)\leq N$ is valid if we can find $H_N$, a codimension $N$ subspace of $H$ (where $H$ is the space of periodic functions in $W^{1,2}(\Omega)$), such that $$ \frac{\langle Lv, v\rangle}{\|v\|_{L_2(\Omega)}^2}: = \frac{\int_{\Omega}|\nabla v|^2+V\,v^2\, dx}{\int_{\Omega}v^2\, dx} > \mu \quad \mbox{ for all } v\in H_N.$$ To this end, denote $$\mathcal{F}:= \left\{Q\in \{Q\}_{\kappa\,(C_4\mu)^{-1/2}} \mbox{ such that } \min_Q \frac 1u \leq C_4 \mu\right\},$$ with $C_4$ to be defined below, and $1\leq \kappa<2$ (depending on $\mu$) is the smallest number such that $R_0$ is an integer multiple of $\kappa \mu^{-1/2}$. Then let $H_N$ be the space of $v\in H$ such that $\int_Q v\, dx=0$ for every $Q\in \mathcal{F}.$ Since the cubes $Q\in \mathcal{F}$ are disjoint, it is evident that $H_N$ has co-dimension $N={\rm Card }\, \mathcal{F}$, simply taking the bumps on $Q$'s as an orthogonal complement of $H_N$. We recall from \cite{ADFJM-CPDE}, Lemma~4.1, that $$\int_{\Omega}|\nabla v|^2+V\,v^2\, dx\geq \int_{\Omega}\frac 1u \,v^2\, dx \quad \mbox{ for all } v\in H$$ and hence, $$2 \int_{\Omega}|\nabla v|^2+V\,v^2\, dx\geq \int_{\Omega}|\nabla v|^2+\frac 1u \,v^2\, dx \quad \mbox{ for all } v\in H.$$ Thus, it is enough to prove that \begin{equation}\label{eq2.7} \int_{\Omega}|\nabla v|^2+\frac 1u \,v^2\, dx > 2\mu\,\int_{\Omega}v^2\, dx \quad \mbox{ for all } v\in H_N \setminus \{0 \} . \end{equation} On the part of $\Omega$ corresponding to any $Q\in \{Q\}_{\kappa\,(C_4\mu)^{-1/2}}$ such that $Q\not\in \mathcal{F}$ the bound \eqref{eq2.7} is valid provided that $C_4 >2$ because $\min_Q \frac 1u \geq C_4 \mu$ on such cubes. For $Q\in \mathcal{F}$, we use the Poincar\'e inequality to write $$\int_Q |\nabla v|^2\, dx\geq C_P\, C_4 \mu \int_Q |v-v_Q|^2\, dx= C_P \, C_4 \mu \int_Q v^2\, dx, $$ where $C_4 \mu$ comes from the size of $Q$ and we used the fact that $v_Q=\int_Q v\, dx=0$ by the definition of $H_N$. Here $C_P$ is the Poincar\'e constant and depends on the dimension only. Choosing $C_4$ so large that $C_P \, C_4 > 2$, we arrive at the desired estimate. \medskip \noindent {\bf Step II: the lower bound in the doubling case.} In this direction, in order to prove that $M\leq N(\mu)$, we need to find $H_M$, a subspace of $H$ of dimension $M$, such that \begin{equation}\label{eq2.8bis} \frac{\langle Lv, v\rangle}{\|v\|_{L_2(\Omega)}^2}: = \frac{\int_{\Omega}|\nabla v|^2+V\,v^2\, dx}{\int_{\Omega}v^2\, dx}\leq \mu \quad \mbox{ for all } v\in H_M. \end{equation} To this end, let \begin{equation} \label{deff} \mathcal{F}':= \left\{Q\in \{Q\}_{\kappa\,(C_2\mu)^{-1/2}} \mbox{ such that } \min_Q \frac 1u \leq C_2 \mu\right\}, \end{equation} where $C_2$ will be chosen below. Let $H_M$ be the linear span of the functions $u\chi_Q$, $Q\in \mathcal{F}'$, picked such that $\chi_Q \in C_0^\infty(Q)$, $\chi_Q=1$ on $Q/2$, $0\leq \chi\leq 1$ on $Q$, and $|\nabla \chi_Q|\leq 4l(Q)^{-1}$. Since $-\Delta u\leq 1$, the Moser-Harnack inequality (\cite{HL}, Theorem 4.14) yields \begin{equation} \label{Moser-Harnack} \sup_Q u \leq C_H \left(\frac{1}{|Q|}\int_{2Q}u^2\right)^{1/2} +C_H l(Q)^2, \end{equation} where $C_H$ depends on the dimension only. In particular, using also the doubling condition three times, \begin{equation} \label{MH2} \sup_{Q} u \leq C_H C_D^{3/2} \sup_{Q/4} u + C' \color{black} l(Q)^2, \end{equation} where $C'=C'(C_D, C_H)$ is a constant depending on $C_D, C_H$, and the dimension only. We use \eqref{eq1.2}, the definition of $\chi_Q$, \eqref{Moser-Harnack} for $Q/4$, and \eqref{MH2} \begin{multline}\label{eq2.8} \frac{\langle L(u\chi_Q), u\chi_Q\rangle}{\|u \chi_Q\|_{L_2(\Omega)}^2} = \frac{\int u^2 |\nabla \chi_Q|^2 + u\chi_Q^2\, dx}{\int (u\chi_Q)^2\, dx} \leq \frac{ 16\, l(Q)^{-2}\int_{Q} u^2 \,dx + \int_{Q} u \, dx}{\int_{Q/2} u^2\, dx}\\[4pt] \leq \frac{ 16\, l(Q)^{-2}\sup_Q u^2 +\sup_Q u}{4^{-d} \left(\frac{1}{C_H} \sup_{Q/4} u- \frac{1}{16}l(Q)^2\right)^2} \leq \frac{ 4^{d+2} \, l(Q)^{-2}\sup_Q u^2 + 4^d \sup_Q u} {\left(\frac{1}{C_H^2 C_D^{3/2}} \sup_{Q} u- \bigl(\frac{1}{16}+ \frac{C'}{C_H^2 C_D^{3/2}} \bigr)l(Q)^2\right)^2} \, . \end{multline} We temporarily choose $\kappa$ small enough in terms of $C_D$ and $C_H$ so that $$\frac{1}{2 C_H^2 C_D^{3/2}} \sup_{Q} u \geq \left(\frac{1}{16}+ \frac{C'}{C_H^2 C_D^{3/2}} \right)l(Q)^2,$$ and then, for some constants $C'_{d,5}$, $C''_{d,5}$, $C_{d,5}$ depending on the dimension, $C_D$, and $C_H$ we have \begin{equation}\label{eq2.9} \frac{\langle L(u\chi_Q), u\chi_Q\rangle}{\|u \chi_Q\|_{L_2(\Omega)}^2} \leq C'_{d,5} \, l(Q)^{-2} +C''_{d,5} \,\frac{1}{\sup_Q u} \leq C_{d,5} C_2 \mu, \end{equation} where the last inequality comes from the definition \eqref{deff} of $\mathcal{F}'$. Having fixed $\kappa$ as above, we now choose $C_2$ such that $C_{d,5} C_2=1$ and arrive at the desired estimate. To be precise, we only showed the desired inequality on the elements of the basis of $H_M$ but since the cubes $Q$ are disjoint, we immediately get it for any element of $H_M$ as well. The only difference with what we want is that the estimate we achieved is in terms of the cardinality of a set $\mathcal{F}'$ defined with an artificially small $\kappa$. However, if we increase the $\kappa$ to our usual fork $1\leq \kappa<2$, the cardinality of the resulting set $\mathcal{F}$ becomes even smaller, and our basis $H_M$ has less elements than expected, as desired. \medskip \noindent {\bf Step III: the lower bound in the non-doubling case.} Our goal, once again, is to establish \eqref{eq2.8bis} for some subspace $H_M$ of dimension $M$. This time, we pick any $\alpha \in (0, 1/16]$ and consider cubes of sidelength $R = \kappa\,(C^*\alpha^{d+4} \mu)^{-1/2}$. For $Q \in \{Q\}_R$, denote by $\check Q=Q_r$ the cube concentric with $Q$ but with the smaller sidelength $r = \alpha R = \kappa\,(C^*\alpha^{d+2} \mu)^{-1/2}$. Now take \begin{equation} \label{otherf'} \mathcal{F}':= \left\{Q\in \{Q\}_{R} \mbox{ such that } \min_{\check Q} \frac 1u \leq C^*\alpha^{d+2} \mu \, \, \mbox{ and } \min_{Q} \frac 1u \geq C^*\alpha^{d+4}\mu \right\}, \end{equation} and let $H_M$ be the linear span of the functions $u\chi_Q$, $Q\in \mathcal{F}'$, where we pick $\chi_Q \in C_0^\infty(Q)$, $0\leq\chi_Q\leq 1$, such that $\chi_Q=1$ on $2 \check Q$ and $|\nabla \chi_Q|\leq CR^{-1}$. As before, we want to estimate \begin{equation}\label{eq2.10} \frac{\langle L(u\chi_Q), u\chi_Q\rangle}{\|u \chi_Q\|_{L_2(\Omega)}^2} = \frac{\int u^2 |\nabla \chi_Q|^2 + u\chi_Q^2\, dx}{\int (u\chi_Q)^2\, dx} \end{equation} (by \eqref{eq1.2}). By definition of $\mathcal{F}'$, $u \leq (C^*\alpha^{d+4} \mu)^{-1}$ on $Q$, so the numerator is at most $C^2 R^{-2} \int_Q u^2 + \int_Q u \leq (C^*\alpha^{d+4} \mu)^{-1}|Q| \big( C^2 \kappa^{-2} + 1\big)$. For the denominator $D$, we first apply the Moser-Harnack inequality \eqref{Moser-Harnack} to $\check Q$, then the definition of $\mathcal{F}'$, to get that \begin{multline*} D \geq \int_{2 \check Q} u^2 \geq |\check Q| \big[C_H^{-1} \sup_{\check Q} u - \ell(\check Q)^2\big]^2 = \alpha^d |Q| \big[C_H^{-1} \sup_{\check Q} u - \alpha^2 R^2\big]^2 \\ \geq \alpha^d |Q| \big[C_H^{-1} (C^*\alpha^{d+2}\mu)^{-1} - \kappa^2 \alpha^2 (C^*\alpha^{d+4} \mu)^{-1}\big]^2 = \alpha^d |Q| (C^*\alpha^{d+2}\mu)^{-2} [C_H^{-1} - \kappa^2]^2. \end{multline*} We chose $\kappa^2\leq \frac{1}{2C_H}$; then the first term dominates the second one and the expression in \eqref{eq2.10} is bounded by \begin{equation}\label{eq2.11} \frac{C_{d,6} \,(C^*\alpha^{d+4} \mu)^{-1}}{C_{d,7} \alpha^d(C^*\alpha^{d+2} \mu)^{-2}} \leq C_{d,8} C^* \mu = \mu, \end{equation} provided that we choose $C^\ast = C_{d,8}^{-1}$. Then, using the orthogonality of the $\chi_Q$, we get that $$ N(\mu) \geq {\rm Card} \Big\{Q\in \{Q\}_{R} \, ; \, \min_{\check Q} \frac 1u \leq C^*\alpha^{d+2} \mu \, \, \mbox{ and } \min_{Q} \frac 1u \geq C^*\alpha^{d+4}\mu \Big\} \geq N_1-N_2, $$ where \begin{multline*} \qquad N_1 = {\rm Card} \Big\{Q\in \{Q\}_{R} \, ; \, \min_{\check Q} \frac 1u \leq C^*\alpha^{d+2} \mu \Big\}, \\ N_2 = {\rm Card} \Big\{Q\in \{Q\}_{R} \, ; \, \min_{Q} \frac 1u \leq C^*\alpha^{d+4}\mu \Big\}. \end{multline*} Notice that the cubes $\check Q = Q_r$ in this argument are smaller and do not cover $\Omega$, so $N_1$ is probably not as large as $N'_1 = {\rm Card} \left\{R\in \{Q\}_{r} \, ; \, \min_{R} \frac 1u \leq C^*\alpha^{d+2} \mu \right\}$. However, keeping in mind that we can treat $\Omega$ as a torus, we can do the estimate above for a collection of translations of our cubes $Q$ by a collection of at most $C \alpha^{-d}$ small vectors $e_j$, $j\in J$, so that when we take the cubes $Q = Q_R$ as above, the smaller cubes $\check Q + e_j$, $Q \in \{Q\}_{R}$ and $j \in J$, cover $\Omega$. This implies that the sum of the corresponding numbers $N_1$ is at least $C^{-1} N_u(C^*\alpha^{d+2} \mu)$, where $N_u$ is defined in \eqref{eq2.2} and $C$ accounts for a slight difference between $r$ and the official radius $\kappa (C^*\alpha^{d+2} \mu)^{-1/2}$ associated to $C^*\alpha^{d+2} \mu$. Let us pick a nearly optimal translation $e_j$, so that $N_1 \geq C^{-1} \alpha^{d} N_u(C^*\alpha^{d+2} \mu)$. Similarly, $N_2 \leq C N_u(C^*\alpha^{d+4}\mu)$, and thus by the estimate above $$ N(\mu) \geq C^{-1} \alpha^{d} N_u(C^*\alpha^{d+2} \mu) - C N_u(C^*\alpha^{d+4}\mu). $$ This is precisely the bound \eqref{eq2.4}. \hfill$\Box$ \vskip 0.08in It is important to point out that Theorem~\ref{t2.1} does not rely on the condition $V\in L^\infty(\Omega)$ and there is no dependence in constants on $\|V\|_{L^\infty(\Omega)}$ or on the size of the domain $R_0$. This is one of the main features of our estimates. If instead one allows our estimates to depend on $\|V\|_{L^\infty(\Omega)}$, the situation for large $\mu$ is of course rather trivial, as both the density of states and $N_u(\mu)$ roughly behave as those for the Laplacian. In particular, there exist constants $C_5, C_2, C_4$ depending on the dimension only, such that \eqref{eq2.6} is valid for all $\mu>C_5 \|V\|_{L^\infty(\Omega)}$. We will use an enhanced version of this statement in the next section. \section{Anderson-type potential} \label{S3} We start this section with estimates on the expectation of the counting function $N_u(\mu)$ associated to the landscape as in \eqref{eq2.2}. \begin{theorem}\label{t3.1} Let $\Omega$ and $L= -\Delta + V$ be as in Theorem \ref{t1.11}. In particular, let $\varphi\in C_0^\infty(B_{1/10}(0))$ be such that $0\leq \varphi\leq 1$, and set \begin{equation} \label{3.2a} V=V_{\omega} (x)=\sum_{j\in {\mathbb{Z}}^d} \omega_j \, \varphi(x-j), \quad x\in \Omega, \end{equation} where the $\omega_j$ are i.i.d. variables taking values $\omega_j \in [0,1]$, with a probability distribution \begin{equation} \label{3.3a} F(\delta)=\mathbb{P}\{\omega \leq \delta\}, \quad 0\leq \delta\leq 1, \end{equation} which is not concentrated at one point, and such that 0 is the infimum of its support. Denote by $N^E_u(\mu)=\mathbb{E}\, N_u(\mu)$ the expectation of the counting function of the minima of $1/u$, as defined in \eqref{eq2.2}. Then there exist constants $\mu^*, c_P, \gamma_1, \gamma_2$, depending on the dimension and the common expectation of the random variables $\omega_j$ only, and constants $m, \widetilde c_P, \gamma_3, \gamma_4$, depending on the dimension only, such that \begin{equation}\label{eq3.2} \gamma_3 \,\mu^{d/2} F(\widetilde c_P \mu)^{\gamma_4 \mu^{-d/2}}\leq N^E_u(\mu) \leq \gamma_1 \,\mu^{d/2} F(c_P \mu)^{\gamma_2 \mu^{-d/2}}, \end{equation} whenever $\mu<\mu^*$ and $R_0>(\mu m)^{-1/2}$. \end{theorem} Let us put this Theorem into the context of known results for the Lifschitz tails. On the way to our ultimate goals, we will show the following by-product of Theorem~\ref{t1.11}. \begin{theorem}\label{t1.15} Retain the notation and assumptions of Theorem~\ref{t1.11}. Then there exist constants $\mu^*, m, c_P, \gamma_1, \gamma_2$, depending on the dimension and the expectation of the random variable only, and constants $\widetilde c_P, \gamma_3, \gamma_4$ depending on the dimension only, such that \begin{eqnarray}\label{eq1.12} \gamma_3 \,\mu^{d/2} F(\widetilde c_P \mu)^{\gamma_4 \mu^{-d/2}}\leq & N_u^E(\mu) & \leq \gamma_1 \,\mu^{d/2} F(c_P \mu)^{\gamma_2 \mu^{-d/2}},\\ \label{eq1.13} \gamma_3 \,\mu^{d/2} F(\widetilde c_P \mu)^{\gamma_4 \mu^{-d/2}}\leq & N^E(\mu) & \leq \gamma_1 \,\mu^{d/2} F(c_P \mu)^{\gamma_2 \mu^{-d/2}} \end{eqnarray} whenever $\mu<\mu^*$ and $R_0>(\mu m)^{-1/2}$. \end{theorem} This result, and in particular the traditionally sought-after estimate \eqref{eq1.13}, is in itself stronger than formally known asymptotics of the density of states, particularly {\it for the continuous model}, although it is fair to say that \eqref{eq1.13} would be expected by specialists in the subject and perhaps could even be addressed by other methods than those in the present paper. Let us explain the situation in the currently available literature. The literature devoted to Lifschitz tails is extensive, particularly if one includes Poisson and other models, and we do not thrive here to give a comprehensive list of references or methodology -- see, e.g., \cite{Kirsch06, Konig, PasturBook} for surveys of related results. Here we just provide some pointers which will highlight the novelties of \eqref{eq1.13} (silently passing to the limit of infinite domain and removing the superscript $E$). The early literature, by now considered classical, and many modern textbooks treat the case when $F(\delta)\geq C \delta^\beta$ for some $C, \beta>0$, and provide the asymptotics \begin{equation} \label{dwa} \lim_{\mu\to 0} \frac{\log |\log N(\mu)|}{\log \mu}=-\frac{d}{2}, \end{equation} see, for instance, \cite{KirschInvitation, Simon}. The quantity $$L:= \lim_{\mu\to 0} \frac{\log |\log N(\mu)|}{-\log \mu}$$ is generally known as a Lifschitz exponent, and, in addition to the results above, it is proved in \cite{PasturBook} that $$\lim_{\mu\to 0} \frac{\log( -\log F(\mu))}{-\log \mu}=a>0\quad \Longrightarrow \quad L=d/2+a.$$ Theorems~\ref{t1.11} and \ref{t1.15} ascertain that for any non-trivial $F$ such that $F(\delta) > \delta$ for $\delta >0$, we can recover the Lifschitz exponent from the behavior of the landscape counting function \begin{equation}\label{Lu}L\equiv L_u, \quad\mbox{where}\quad L_u:= \lim_{\mu\to 0} \frac{\log |\log N_u(\mu)|}{-\log \mu} \end{equation} (assuming for simplicity that the limit exists) and in particular, \begin{equation}\label{PasturTails}L= \frac d2+\lim_{\mu\to 0} \frac{\log( -\log F(\mu))}{-\log \mu}, \end{equation} without any a priori restrictions on $F$. This formally recovers and generalizes the results mentioned above. In the context of our methods, however, such statements lose much of the precision exhibited in \eqref{eq3.33-bis}, \eqref{eq1.12}, \eqref{eq1.13}. Indeed, the problem of \eqref{dwa} is not only, or not so much, the restricted class of the potentials to which it applies, but rather the notorious imprecision of double-logarithmic asymptotics. The underlying method of proof in \cite{KirschInvitation, Simon} factually gives $$\gamma_3 \,\mu^{d/2} F(\widetilde c_P \mu)^{\gamma_4 \mu^{-d/2}}\leq N^E(\mu) \leq e^{-\gamma' \mu^{-d/2}}.$$ In general, the upper bound is larger than the lower bound and does not give sufficient precision to improve the double logarithm -- see the discussion and the related conjectures in \cite{KirschInvitation}. This is a well-known problem. The subtle difference between refined asymptotics roughly speaking asserting that $N(\mu) \sim e^{-c\mu^{-d/2}}$ and those with the logarithmic correction $N(\mu) \sim e^{c \mu^{-d/2}\log \mu}$ has not been overlooked in the literature. However, the refined estimates turned out to be much more challenging. At this point they are only available in ${\mathbb{Z}}^d$ rather than ${\mathbb{R}}^d$ and under various additional constraints on the probability distribution -- see \cite{Konig} and \cite{M}\footnote{We are using here the review of these results from \cite{Kirsch06}. Unfortunately, the dissertation \cite{M} has never been published and so we cannot attest to the validity of the proofs or to exact statements beyond what has been quoted \cite{Kirsch06}.}. The proofs pass through the parabolic Anderson model -- an approach not yet developed, to the best of our knowledge, in the context of the alloy Anderson model on ${\mathbb{R}}^d$ considered in the present paper. And, even in ${\mathbb{Z}}^d$, the situation has been far from well-understood. Both the conditions on the potential and the results in \cite{Konig} and \cite{M} are quite technical, so we will not provide the detailed statements. Let us just mention that they appeal to various cases according to the behavior of the scale function $$S(\lambda, t)=(\lambda t)^{-1}G(\lambda t)-t^{-1} G(t), \quad \mbox{where}\quad G(t)=\log \mathbb{E}(\exp (-tV(0)),$$ (whether $S\sim C(\lambda^\rho-1)t^\rho$ with $C,\rho$ positive or negative, or $S\sim C\,\log \lambda$, or $S\sim -C(\lambda t)^{-1}\, \log t$) and draw the asymptotics in terms of of $I(\mu)=\sup_{t>0} (\mu t-G(t)).$ Such is the presentation in \cite{M}, and \cite{Konig} gives somewhat different statements, also with a dependence on the features of a certain implicitly defined scale function. The strength of these results compared to Theorem~\ref{t1.15} is that, at least in some cases, they provide actual asymptotics rather than the estimates from above and below and feature a number of cases that we did not explicitly consider, such as unbounded potentials. The weakness is that their coverage does not encompass all potentials, even among the bounded ones, and at this point is completely restricted to ${\mathbb{Z}}^d$. By contrast, Theorem~\ref{t1.15} provides a simple and universal law, covering all bounded potentials at once, clearly identifying the source of the logarithmic correction, the ``Pastur tails" \eqref{PasturTails}, the exact transition from the classical to quantum regime. Below are just a few examples of applications of \eqref{eq1.13}: \begin{enumerate} \item $V$ is a Bernoulli potential: $\omega$ takes values $0$ or $1$ with probability $1/2$. Then $$\gamma_3 \,\mu^{d/2} e^{-\gamma_4 \mu^{-d/2}}\leq N^E(\mu) \leq \gamma_1 \,\mu^{d/2} e^{-\gamma_2 \mu^{-d/2}}. $$ \item $V$ is given by a uniform distribution on $[0,1]$ or any other $F$ such that $F(\delta)$ is bounded from above and below by some positive power of $\delta$. This leads to logarithmic correctors predicted in the physics literature \cite{LN, PS} $$\gamma_3 \,\mu^{d/2} e^{\gamma_4 \, \mu^{-d/2} \log \mu }\leq N^E(\mu) \leq \gamma_1 \,\mu^{d/2} e^{\gamma_2\, \mu^{-d/2} \log \mu }.$$ \item $V$ is given by the probability distribution with $F(\delta)\sim e^{-C\delta^{-a}}$, $a>0$. Then $$\gamma_3 \,\mu^{d/2} e^{\gamma_4 \, \mu^{-d/2-a}}\leq N^E(\mu) \leq \gamma_1 \,\mu^{d/2} e^{\gamma_2\, \mu^{-d/2-a}}.$$ This is an example of \eqref{PasturTails}. \end{enumerate} With this, we return to the proof of Theorem~\ref{t3.1}. Our initial lemma is purely deterministic. \begin{lemma}\label{l3.4} Let $\Omega$ and $L$ be as in Section~\ref{intro}, with $V$ defined as follows. Let $\varphi\in C_0^\infty(B_{1/10}(0))$ be such that $0\leq \varphi\leq 1$, and set $$ V=V_{\omega} (x)=\sum_{j\in {\mathbb{Z}}^d} \omega_j \, \varphi(x-j), \quad x\in \Omega, $$ where the sequence $\omega = \{\omega_j \}_{j\in {\mathbb{Z}}^d}$ takes values in $[0,1]$. For $r \in [\sqrt d, R_0]$, where we recall that $R_0$ is the scale of $\Omega$, let us denote by $Q = Q_{r}$ the maximal cube consisting of unit cubes centered on ${\mathbb{Z}}^d$ (and with edges parallel to the axes) which is contained in $B_{r/2}(0)$. Since $r \geq \sqrt d$, $Q_r$ contains at least one unit cube. Assume that $r \in [3\sqrt d, R_0]$ is such that \begin{equation}\label{eq3.13-bis} {\rm Card}\, \big\{j\in Q_{r}\cap {\mathbb{Z}}^d:\, \omega_j\geq c_P r^{-2} \big\} \geq \lambda\, |Q_{r}|, \end{equation} for some $c_P, \lambda>0$. If $c_P$ is large enough, depending on $\lambda$ and the dimension only, then there exist $\varepsilon=\varepsilon(\lambda, d)>0$ (small) and $M=M(\varepsilon, \lambda, d)>0$ (large) such that if $\xi_0 \in \overline B_{r/3}(0)$ is such that \begin{equation}\label{eq3.5} u(\xi_0)\geq Mr^2 \end{equation} then \begin{equation}\label{eq3.7} u(\xi) \geq (1+\varepsilon)\, u(\xi_0)\quad \mbox{for some point}\quad \xi\in \overline{B_{\sqrt{1+\varepsilon}\,r}(\xi_0)}. \end{equation} \end{lemma} Again this is a deterministic statement, for which we do not care where the $\omega_j$ are coming from and probabilistic considerations are irrelevant. That is, at this point $V$ could be any realization, even extremely unlikely, of the construction described in Theorem \ref{t3.1}, even if we intend to show later that our assumption \eqref{eq3.13-bis} is quite probable in some circumstances. Here we gave a statement for a point $\xi_0 \in \overline B_{r/3}(0)$ so that we can take $Q_{r}$ centered at the origin, but a similar statement for any $\xi_0 \in \Omega$ would be easy to obtain, because we could use the translation invariance of our problem by ${\mathbb{Z}}^d$ to apply the result to $\xi_0 - \overline\xi_0$, where $\overline\xi_0 \in {\mathbb{Z}}^d$ is such that $\xi_0 - \overline\xi_0 \in \overline B_{r/3}(0)$; we assumed $r \geq 3\sqrt d$ only to guarantee that we can find $\overline\xi_0$. We will use this comment about other centers $\xi_0$ later in the proof. \vskip 0.08 in \noindent {\it Proof}.\,\, Because of the periodic nature of $\Omega$ and $L$, we may assume that $\Omega$ is centered at the origin; we do not assume that $\xi_0 = 0$ because ${\mathbb{Z}}^d$ plays a special role in the definition of $V$. \vskip 0.08 in \noindent {\bf Step I}. Let $\xi_0 \in \Omega$ be given, set $B_\rho = B_\rho(\xi_0)$ (for computations on $u$, we like to think that $\xi_0$ is the origin) and denote by $m(\rho) = m(\xi_0,\rho)$ the average of $u$ on the sphere centered at $\xi_0$ with radius $\rho$. That is, when $d \geq 2$ we set $$ m(\rho)=\fint_{\partial B_\rho} u\, d\sigma, \quad \rho>0, $$ where $d\sigma$ is the $(d-1)$ dimensional surface measure on $\partial B_r$, and when $d=1$ $$ m(\rho)=\frac{u(\xi_0+\rho)+u(\xi_0-\rho)}{2}, \quad \rho>0. $$ For brevity, we set $m(0) = u(\xi_0)$; this makes sense because $u$ is continuous on $\Omega$. We claim that \begin{equation}\label{eq3.8} m(\rho)\leq m(r)+r^2-\rho^2\quad\mbox{for}\quad 0\leq \rho<r < \,\mathrm{dist}\,(\xi_0,\d\Omega), \end{equation} and in particular, \begin{equation}\label{eq3.9} m(r)\geq m(0)-r^2. \end{equation} This can be seen, for instance, by comparison with harmonic functions. Let $v$ be a solution to $-\Delta v=0$ in $B_r$ that coincides with $u$ on $\partial B_r$ and set $w(y):=v(y)+r^2-|y-\xi_0|^2$ for $y\in B_r$. Then $-\Delta w=2d\geq 1 \geq -\Delta u$ in $B_r$ (because $L u = -\Delta u + Vu = 1$ and $V \geq 0$) and $w=v=u$ on $\partial B_r$. Hence, $w\geq u$ by the maximum principle, so that $$m(\rho)= \fint_{\partial B_\rho} u\, d\sigma\leq \fint_{\partial B_\rho} w\, d\sigma =\fint_{\partial B_\rho} v\, d\sigma+r^2-\rho^2=m(r)+r^2-\rho^2,$$ where we used the mean value property for harmonic functions in the last equality. The estimates \eqref{eq3.8}--\eqref{eq3.9} follow. Furthermore, when $d \geq 2$, the Poisson formula for a harmonic function $v$ in $B_r$ yields $$v(y)= \frac{r^2-|y-\xi_0|^2}{d\alpha_d r}\int_{\partial B_r}\frac{v(z)}{|z-y|^d}\,d\sigma_z \, ,$$ where $\alpha_d$ is the volume of a unit ball in ${\mathbb{R}}^d$. Hence there exists a dimensional constant $c_1$ such that $v(y)\leq c_1 m(r)$ for all $y\in B_{2r/3}$. The same is of course true when $d=1$, because harmonic functions on ${\mathbb{R}}$ are affine. Moreover, since $$u(y) \leq w(y)=v(y)+r^2-|y-\xi_0|^2,$$ we get that \begin{equation}\label{eq3.10} u(y)\leq c_1 m(r)+r^2 \quad\mbox{for }\, y\in B_{2r/3}. \end{equation} Notice that $c_1$ can be taken equal to 1 when $y=x$, according to \eqref{eq3.9}. \vskip 0.08 in \noindent {\bf Step II}. Now we want to use the size of $V$. Integrating by parts against the Green function in a ball, we get for $d\geq 3$ \begin{multline}\label{eq3.11} m(r)=m(0)+c_2 \int_{B_r} \Delta u(y) \left(|y-\xi_0|^{2-d}-r^{2-d}\right)\, dy\\ =m(0)+c_2 \int_{B_r} (Vu-1) \left(|y-\xi_0|^{2-d}-r^{2-d}\right)\, dy \end{multline} for some dimensional constant $c_2>0$ and as usual assuming $\overline B_r\subset \Omega$. Now assume that $0\leq r\leq R$ and $\overline B_R\subset \Omega$, and subtract \eqref{eq3.11} for $R$ from this; we get that \begin{multline}\label{eq3.12} m(R)-m(r) =c_2 \int_{B_R\setminus B_r} (Vu-1)\left(|y-\xi_0|^{2-d}-R^{2-d}\right)\, dy\\ +c_2 \int_{B_r} (Vu-1) \left(r^{2-d}-R^{2-d}\right)\, dy \end{multline} Recall that we are interested in $\xi_0 \in \overline B_{r/3}(0)$, so that since $Q_r \subset B_{r/2}(0)$, it is contained in $B_r = B_r(\xi_0)$. We will only keep the contribution of $V$ on $Q_r$ (because we want to use its simpler structure), and since $$ \int_{B_R\setminus B_r} \left(|y-\xi_0|^{2-d}-R^{2-d}\right)\, dy + \int_{B_r} \left(r^{2-d}-R^{2-d}\right)\, dy \leq C R^d (r^{2-d}-R^{2-d}) \leq C (R^2-r^2) $$ \eqref{eq3.12} yields \begin{equation} \label{3.12b} m(R)-m(r) \geq -c_3 (R^2-r^2)+c_2 \left(r^{2-d}-R^{2-d}\right) \int_{Q_r}Vu \, dy, \end{equation} In dimension $d=2$ one has \begin{equation}\label{eq3.11-1} m(r)=m(0)+c_2 \int_{B_r} (Vu-1) \log \frac{r}{|y-\xi_0|}\, dy \end{equation} in place of \eqref{eq3.11}, and since $$ \int_{B_R\setminus B_r} \log \frac{r}{|y-\xi_0|} dy + \int_{B_r} \log \frac{R}{r} dy \leq C (R^2-r^2) + C r^2 \log \frac{R}{r} \leq C (R^2-r^2), $$ we obtain \begin{equation}\label{eq3.11-2} m(R)-m(r) \geq -c_3 (R^2-r^2) +c_2 \log\frac Rr\, \int_{Q_r}Vu \, dy \end{equation} in place of \eqref{3.12b}. In dimension $d=1$, \eqref{eq3.11} becomes \begin{equation}\label{eq3.11-3} m(r)= m(0) + c_2 \int_{B_r} u''(y) \,(r-|y-\xi_0|)\, dy = m(0)+c_2 \int_{B_r} (Vu-1)\,(r-|y-\xi_0|)\, dy \end{equation} and hence we have \begin{equation}\label{eq3.11-4} m(R)-m(r) \geq -c_3 (R^2-r^2)+c_2 \,(R-r) \int_{Q_r}Vu \, dy \end{equation} in place of \eqref{3.12b}. \vskip 0.08 in \noindent {\bf Step III}. Write $Q_r=\bigcup_{j\in J} R_j$, where $R_j$ is the cube of unit sidelength centered at $j\in {\mathbb{Z}}^d$, and $J = {\mathbb{Z}}^d \cap Q_r$ precisely corresponds to the cubes $R_j$ that are contained in $Q_r$. Then set \begin{equation} \label{3.17g} J_V:=\big\{j\in J \, : \, \omega_j\geq c_P r^{-2}\big\}. \end{equation} Observe that since $V(x) = \sum \omega_j \,\varphi(x-j)$, with $\varphi\in C_0^\infty(B_{1/10}(0))$, we have that $\fint_{R_j} V = \omega_j \fint_{R_0} \varphi$, where $R_0$ (exceptionally) denotes the unit cube centered at $0$. Thus \begin{equation} \label{3.18g} J_V:=\big\{j\in J \, : \, \fint_{R_j} V \geq c'_P r^{-2}\big\}, \end{equation} with $c_P' = c_P \fint_{R_0} \varphi$. Denote by $m_r$ the average of $u$ on the ball $B_r(\xi_0)$ (notice the difference with $m(r)$ which is an average on the sphere) and let $u_j:=\inf_{R_j} u$. Now pick some $\eta>0$ (a dimensional constant to be chosen below) and let \begin{equation} \label{3.19g} J_\eta=\{j\in J_V:\, u_j<\eta\, m_r\}. \end{equation} \vskip 0.08 in \noindent {\bf Step IV}. We start with the case when $${\rm Card}\,J_\eta \geq \frac{\lambda}{2}\, |Q_r|. $$ By Harnack's inequality at scale 1 (see, \cite{GT}, Theorem~8.18), $$ \fint_{R_j} u\, dx \leq 2^d \fint_{2R_j} u\, dx \leq C \left(\inf_{R_j} u +1\right). $$ Since, in addition, $u\geq 1$ on $\Omega$ (recall that $0 \leq V \leq 1$ here, and see \cite{ADFJM-CPDE}, Proposition~3.2), we have $$\fint_{R_j} u\, dx \leq C_H' \inf_{R_j} u, $$ for some constant $C_H'$ depending on the dimension only. Therefore, $$\int_{R_j} u\, dx=\fint_{R_j} u\, dx\leq C_H' \eta m_r \quad \mbox{for any } \, j\in J_\eta.$$ Then $$ \int_{B_r\setminus \bigcup_{j\in J_\eta} R_j} u\, dx \geq |B_r| m_r - C_H' \eta m_r \,{\rm Card}\,J_\eta $$ and $$ \fint_{B_r\setminus \bigcup_{j\in J_\eta} R_j} u\, dx \geq \frac{|B_r| - C_H' \eta \,{\rm Card}\,J_\eta}{|B_r|-{\rm Card}\,J_\eta} \,m_r \\ =\Big(1+ \frac{(1-C_H' \eta) \,{\rm Card}\,J_\eta}{|B_r|-{\rm Card}\,J_\eta} \Big) m_r \geq (1+c_3 \lambda)\, m_r, $$ for $\eta=(2\,C_H')^{-1}$ and a suitable dimensional constant $c_3$. We conclude that there exists a point $\xi\in B_r$ such that \begin{multline}\label{eq3.13} u(\xi)\geq (1+c_3 \lambda)\, m_r \geq (1+c_3\lambda) (m(0)-r^2) \\ \geq m(0) +c_3\lambda m(0)-m(0)\,(1+c_3\lambda)/M \end{multline} where we integrated \eqref{eq3.9} for the second inequality and used the fact that $m(0) = u(\xi_0) \geq M r^2$ by \eqref{eq3.5} in the third one. If we fix \begin{equation}\label{eq3.14} M\geq \frac{c_4}{\lambda} \end{equation} then there exists a point $\xi\in B_r$ such that \begin{equation}\label{eq3.15} u(\xi) \geq (1+c_5\lambda) \,m(0), \end{equation} where as usual all $c_i$ depend on the dimension only. Hence, choosing \begin{equation}\label{eq3.16} \varepsilon<c_5\lambda, \end{equation} we arrive at \eqref{eq3.7}. \vskip 0.08 in \noindent {\bf Step V}. Assume now that, on the contrary, $${\rm Card}\,J_\eta \leq \frac{\lambda}{2}\, |Q_r|. $$ Let $R=\sqrt{1+\varepsilon}\, r$, $\varepsilon<1/2$. First assume that $d \geq 3$; then by \eqref{3.12b}, \begin{multline*} m(R)-m(r) \geq -c_3 (R^2-r^2)+c_2 \left(r^{2-d}-R^{2-d}\right) \int_{Q_r}Vu \, dy\\ \geq -c_3 (R^2-r^2)+c_2 \left(r^{2-d}-R^{2-d}\right) \sum_{j\in J_V\setminus J_\eta}\int_{R_j}Vu \, dy. \end{multline*} But for such $j$, $\int_{R_j}Vu \, dy \geq u_j \int_{R_j}V \, dy \geq \eta m_r \int_{R_j}V =\eta m_r \fint_{R_j}V \geq \eta m_r c'_P r^{-2}$ by various definitions including \eqref{3.18g} and \eqref{3.19g}. Thus, since $R=\sqrt{1+\varepsilon}\, r$, \begin{multline*} m(R)-m(r) \geq -c_3 (R^2-r^2) +c_2 \left(r^{2-d}-R^{2-d}\right) c_P' r^{-2} \eta m_r \,({\rm Card}\, J_V-{\rm Card}\, J_\eta) \\ \geq -c_3 \varepsilon r^2+c_6\varepsilon c_P' m_r \,\lambda. \end{multline*} When $d=1,2$, we use \eqref{eq3.11-2} and \eqref{eq3.11-4} instead of \eqref{3.12b}, and get the same final estimate, namely $$m(R)-m(r) \geq -c_3 \varepsilon r^2+c_6\varepsilon c_P' m_r \,\lambda $$ (possibly further adjusting $c_3$ and $c_6$ still depending on dimension only). Using \eqref{eq3.9} and its integrated version for $m_r$, and then the fact that $m(0) \geq M r^2$ by \eqref{eq3.5}, we obtain that \begin{multline*} m(R)\geq m(0)-r^2 -c_3 \varepsilon r^2+c_6\varepsilon c_P' \,\lambda \big(m(0)-r^2 \big) \\ \geq m(0) \Big(1 + c_6\varepsilon c_P' \,\lambda \big(1-\frac 1{M}\big) -\frac {1+c_3\varepsilon}{M}\Big). \end{multline*} Choosing $c_P$ so large that \begin{equation}\label{eq3.17} c_P' \geq \frac{4}{c_6\lambda} \end{equation} (recall Step III) and $M$ such that \begin{equation}\label{eq3.18} M>c_7\max\left\{1, \frac 1 \varepsilon, \frac 1\lambda\right\} \end{equation} (the third part takes care of \eqref{eq3.14}) we ensure that the second term in the parentheses above is larger than $2\varepsilon$ and the third term smaller than $\varepsilon$, so that $$m(R)\geq m(0) \left(1 + \varepsilon \right) $$ and hence, \eqref{eq3.7} holds for some $\xi\in \partial B_R$, as needed for \eqref{eq3.7}. \hfill$\Box$ \vskip 0.08in \begin{lemma}\label{l3.19} Let $\Omega$ and $L = -\Delta + V$ be as in Theorems \ref{t1.11} and \ref{t3.1}. In particular $V$ is a random potential governed by a probability measure, as in \eqref{3.2a} and \eqref{3.3a}. Fix $0<\lambda<1$. Then choose $c_P=c_P(\lambda,d)$ large enough, $\varepsilon=\varepsilon(\lambda, d)>0$ small enough, and $M=M(\varepsilon, \lambda, d)>0$ large enough, as in Lemma~\ref{l3.4}. Recall that $\Omega = {\mathbb{R}}^d/R_0 \,{\mathbb{Z}}^d$ and, for $r \in [3\sqrt d, R_0]$, let $Q_r$ denote as before the maximal cube consisting of unit cubes centered on ${\mathbb{Z}}^d$ which is contained in $B_{r/2}(0)$. Then let \begin{equation}\label{eq3.20} \mathbb{P}_r:= \mathbb{P}\big(\big\{{\rm Card}\, \{j\in Q_r \cap {\mathbb{Z}}^d \, :\, \omega_j\leq c_P r^{-2}\} \geq (1-\lambda)\, |Q_r| \big\}\big). \end{equation} Also define a similar quantity for the whole domain, i.e., \begin{equation}\label{eq3.20-bis} \mathbb{P}_{\Omega} = \mathbb{P}\Big(\big\{{\rm Card}\, \{j\in \Omega \cap {\mathbb{Z}}^d \, :\, \omega_j\leq c_P R_0^{-2}\} \geq \bigl(1-\lambda\bigr)\, |\Omega| \Big\}\Big). \end{equation} Finally, for $3\sqrt d \leq r < R_0$, set $r_k = (1+\varepsilon)^{k/2} \,r$ for $0 \leq k \leq k_{max}$, where $k_{max}$ is the largest integer such that $r_k < R_0$. Then \begin{equation}\label{eq3.21} \mathbb{P} \Big(\Big\{ \sup_{\xi \in \overline B_{r/3}(0)} u(\xi) \geq Mr^2 \Big\} \Big) \leq \mathbb{P}_{\Omega} + C \varepsilon^{-d} \sum_{0 \leq k \leq k_{max}} \mathbb{P}_{r_k}, \end{equation} where $C$ depends only on the dimension. \end{lemma} Here we shall not even need our assumption that the probability distribution $F$ of \eqref{3.3a} is not concentrated at one point and $F(\delta) > 0$ for $\delta > 0$; we will evaluate the probabilities later. We wrote our estimates with all the cubes $Q_\rho$, and our test ball $\overline B_{r/3}(0)$, all centered at $0$, but since the $\omega_j$ are i.i.d. variables and our problem is invariant under translations by ${\mathbb{Z}}^d$, the various probabilities mentioned in the statement would be the same with all the cubes (and the test ball) centered anywhere else on ${\mathbb{Z}}^d$. We will also use this invariance during the proof. \smallskip \noindent {\it Proof}.\,\, The idea is to repeatedly use Lemma~\ref{l3.4} and stop when the resulting ball exceeds the size of $\Omega$. Let $r$ be given, suppose that $\sup_{\xi \in \overline B_{r/3}(0)} u(\xi) \geq Mr^2$; we pick $\xi_0 \in \overline B_{r/3}(0)$ such that $u(\xi_0) \geq Mr^2$, and try to use Lemma~\ref{l3.4} repeatedly to find points $\xi_j$ with $u(\xi_j)$ always larger. Set (for later coherence of notation) $Q_0 = Q_r$. One possibility is that \eqref{eq3.13-bis} fails (with this choice of $Q_r$); we call this event $\mathfrak{A}_0$. But suppose not; then Lemma~\ref{l3.4} gives a point $\xi_1 \in {\overline{B_{r_1}}(\xi_0)}$, with $r_1 = (1+ \varepsilon)^{1/2}$ as above, such that $u(\xi_1) \geq (1+ \varepsilon) u(\xi_0)$, as in \eqref{eq3.7}. Notice that $u(\xi_1) \geq M r_1^2$, so we can try to apply Lemma~\ref{l3.4} again. This time, it could be that $\xi_1 \notin \overline B_{r_1/3}(0)$, so we choose $\overline\xi_1 \in {\mathbb{Z}}^d$ such that $\xi_1-\overline\xi_1 \in \overline B_{r_1/3}(0)$, and apply the lemma after translating by $\overline\xi_1$. We will need to be more specific later about how we choose $\overline\xi_1$, but for the moment let us not bother. This means that the role of $Q_r$ is now played by $Q_1 = \overline\xi_1 + Q_{r_1}$. One possibility is that \eqref{eq3.13-bis} fails for $Q_1$; we call this event $\mathfrak{A}_1$. But we assume not for the moment, and the lemma gives a new point $\xi_2 \in {\overline{B_{r_2}}(\xi_1)}$ such that $u(\xi_2) \geq (1+ \varepsilon) u(\xi_1)$, as in \eqref{eq3.7}. Then $u(\xi_2) \geq M r_2^2$ and we can try to apply Lemma~\ref{l3.4} again. We continue as long as we do not encounter an event $\mathfrak{A}_k$ where \eqref{eq3.13-bis} fails for $Q_k$, and then we end with a last application for $k_{max}$, which gives a point $\xi_{k_{max}+1}$ such that $u(\xi_{k_{max}+1}) \geq M r_{k_{max}+1}^2 \geq M R_0^2$. Let $\xi_\infty \in \Omega$ be such that $u(\xi_\infty) = || u ||_\infty$, and notice that $u(\xi_\infty) \geq M R_0^2$. We now try to apply Lemma~\ref{l3.4} one last time, to the point $\xi_\infty$, but for this it will be convenient to enlarge our domain. Suppose for definiteness that our fundamental domain $\Omega$ (we abuse notation a little, and give it the same name as ${\mathbb{R}}^d / R_0 {\mathbb{Z}}^d$) is the cube of sidelength $R_0$ centered at the origin; we know that, due to our periodic conditions, other choices would be equivalent, but with this choice we were able to state and prove Lemma~\ref{l3.4} without crossing the boundary. Pick an odd integer $N$ larger than $4 \sqrt d$, and denote by $\widetilde\Omega$ the cube centered at the origin and with sidelength $NR_0$; thus $\widetilde\Omega$ is composed of $\Omega$, plus a certain number of translated copies. Extend $V$ and $u$ to be $R_0 {\mathbb{Z}}^d$-periodic. Then the extension of $u$ still satisfies $L u = 1$ on $\widetilde\Omega$, and by uniqueness it is the landscape function associated to $\widetilde\Omega$ and periodic boundary conditions. We apply Lemma~\ref{l3.4} with this new, larger domain, and the radius $r = 2\sqrt d R_0$, so that the corresponding cube $Q_r$ is precisely $\Omega$. Our choice of $N$ is large enough for this to be possible, and also we may assume, since our problem is invariant by translations from ${\mathbb{Z}}^d$, that $\xi_\infty \in \overline B_{r/3}(0)$. Our last bad event $\mathfrak{A}_{k_{max}+1}$ is when \eqref{eq3.13-bis} fails for $Q_r = \Omega$, and if this does not happen, we get a new point $\xi \in \widetilde\Omega$ such that $u(\xi) \geq (1+ \varepsilon) u(\xi_\infty)$. This is impossible, because $u(\xi_\infty) = || u ||_\infty$ and $u$ takes the same values on $\widetilde\Omega$ as on $\Omega$. \smallskip At this point we proved that if the event of the left-hand side of \eqref{eq3.21} occurs (i.e., we can find $\xi_0$ as above, with $u(\xi_0) \geq Mr^2$), then one of the bad events $\mathfrak{A}_k$ occurs. What we just need to do now is check that the probability of each event $\mathfrak{A}_k$ is at most the corresponding term of the right-hand side of \eqref{eq3.21}. In particular, we do not need to check anything about the independence of these events, we just add their probability. In our last case we made sure that $Q_r = \Omega$ precisely, and so this is almost the definition (compare \eqref{eq3.20-bis} with \eqref{eq3.13-bis}); there is a small discrepancy, due to the fact that since $r = 2\sqrt d R_0$ here, we should have said $\omega_j \leq C_P (2\sqrt d R_0)^{-2}$ rather than $\omega_j \leq C_P R_0^{-2}$, but the difference only amounts to making $C_P$ a little larger, which is not a problem, and we prefer the less sharp, but simpler form in \eqref{eq3.20-bis}. For $0 \leq k \leq k_{max}$, we need to evaluate the probability of the event $\mathfrak{A}_k$, but we have to be a little careful, because we only know that \eqref{eq3.13-bis} fails for the translated cube $Q_k = \overline\xi_k + Q_{r_k}$, but a priori we do not know which cube this is. Given the position of $\xi_0 \in \overline B(r/3)(0)$, and the fact that for $0 \leq m < k$, $|\xi_{m+1}-\xi_m| \leq r_{m+1}$, we see that $|\xi_k| \leq \sum_{m=1}^{k} r_m \leq C\varepsilon^{-1} r_k$. We need to find $\overline\xi_k \in {\mathbb{Z}}^d$ such that $|\xi_k-\overline\xi_k| \leq r_k/3$, so we can choose $\overline\xi_k$ in some set $\Xi_k$, known in advance, with less than $C \varepsilon^{-d}$ elements. Our event $\mathfrak{A}_k$ can only happen if \eqref{eq3.13-bis} fails for one of the cubes $\overline\xi + Q_{r_k}$, $\overline\xi \in \Xi_k$, and the total probability that this happens is at most $C \varepsilon^{-d} \mathbb{P}(r_k)$ (all the smaller events associated to a single $\overline\xi \in \Xi_k$ have the same probability $\mathbb{P}(r_k)$, because our $\omega_j$ are i.i.d.). This completes the proof of Lemma \ref{l3.19}. \hfill$\Box$ \vskip 0.08in \begin{lemma}\label{l3.23} Let $Q$ be some cube in ${\mathbb{R}}^d$ and assume that the $\omega_j$, $j\in {\mathbb{Z}}^d\cap Q$, are i.i.d. variables taking values $0\leq \omega_j\leq 1$, with a probability distribution $$F(\delta)=\mathbb{P}\{\omega \leq \delta\}, \quad 0\leq \delta\leq 1,$$ which is not trivial, i.e., not concentrated at one point, and such that 0 is the infimum of the support. Fix $0<\mu<1$, $c_P^*>0$, and consider $r>0$ such that $\mu-F(c_P^* r^{-2}) >0$. Then such that \begin{multline}\label{eq3.24} \mathbb{P}\left(\left\{{\rm Card}\, \big\{j\in Q\cap {\mathbb{Z}}^d:\, \omega_j\leq c_P^* r^{-2}\big\} \geq \mu\, {\rm Card}\, \{Q\cap {\mathbb{Z}}^d\}\right\} \right) \\ \leq \big(H(\mu) F(c_P^* r^{-2})^\mu\big)^{{\rm Card}\, \{Q\cap {\mathbb{Z}}^d\}} \end{multline} with $H(\mu) = \big(\mu^\mu (1-\mu)^{1-\mu}\big)^{-1}$. \end{lemma} While we intend to use the Lemma for $\mathbb{P}_r$ and $\mathbb{P}_\Omega$ from Lemma~\ref{l3.19}, we chose to state it in full generality to emphasize explicit dependence on the constants which could be useful in other contexts. Also, observe that \begin{equation} \label{mumu} \lim_{\mu \to 1} H(\mu) = 1; \end{equation} we will be able to choose $\mu$ so close to $1$, depending on $\mathbb{E}(\omega)$ and the dimension only, that $H(\mu) F(c_P^* r^{-2})^\mu < F(c_P^* r^{-2})^{1/2}$, at least for $r$ sufficiently large, also depending on $\mathbb{E}(\omega)$ and the dimension only. \vskip 0.08in \noindent {\it Proof}.\,\, Let $P$ denote the left-hand side of \eqref{eq3.24}, and define the random variables $\zeta_j$ equal to 1 when $\omega_j\leq c_P^* r^{-2}$ and 0 otherwise. By our assumptions the $\zeta_j$ are independent and identically distributed. Furthermore, $$ P = \mathbb{P}\Big(\Big\{\sum_{j\in Q\cap {\mathbb{Z}}^d}\zeta_j \geq \mu\, {\rm Card}\, \{Q\cap {\mathbb{Z}}^d\}\Big\}\Big), $$ hence for any $t > 0$, \begin{equation} \label{eq3.25} P = \mathbb{P}\left(\left\{e^{t\sum_{j\in Q\cap {\mathbb{Z}}^d} \zeta_j} \geq e^{t\mu\, {\rm Card}\, \{Q\cap {\mathbb{Z}}^d\}}\right\} \right) \leq e^{-t\mu\, {\rm Card}\, \{Q\cap {\mathbb{Z}}^d\}} A \end{equation} by Chebyshev's inequality, and where $A$ is the expectation of the product of independent identically distributed variables $e^{t\zeta_j}$, hence $A = A_0^{{\rm Card}\, \{Q\cap {\mathbb{Z}}^d\}}$, where $A_0$ is the expectation of any of the $e^{t\zeta_j}$. That is, $$ A_0 = e^t \mathbb{P}(\{\omega_j\leq c_P^* r^{-2} \}) + \mathbb{P}(\{\omega_j > c_P^* r^{-2} \}) = e^t F(c_P^* r^{-2}) + 1-F(c_P^* r^{-2}) $$ and, by \eqref{eq3.25}, $$ P \leq \exp \left( -{\rm Card}\, \{Q\cap {\mathbb{Z}}^d\} \big(t\mu - \log A_0\big)\right) $$ for every $t>0$. We now want to optimize in $t$, but let us introduce notation before we compute. Set $N = {\rm Card}\, \{Q\cap {\mathbb{Z}}^d\}$, $F = F(c_P^* r^{-2})$ (two constants) and, for $t>0$, $$ f(t): = t\mu - \log A_0 = t\mu -\log (e^t F + 1-F). $$ Thus $P \leq e^{-N f(t)}$, and we study $f$. First, $f(0)=0$, and $f'(t) = \mu - \frac{e^t F}{e^t F + 1-F}$. Thus $f'(0)=\mu-F = \mu-F(c_P^* r^{-2})>0$ by our assumptions, and hence $f$ is increasing near $0$. In fact, $f'$ only vanishes at the point $t^*$ such that $$e^{t^*}=\frac{\mu}{1-\mu}\, \frac {1- F}{F}$$ (notice that this last value is $>1$ since $\mu > F$). Since we strongly expect $f(t)$ to be minimal for $t=t^\ast$, we decide to take $t = t^\ast$ in the inequality above. This yields \begin{multline}\label{eq3.27} P \leq e^{-N f(t^\ast)}= e^{-N t^\ast\mu + N\log (e^{t^\ast} F + 1-F))} \\ = \exp \left(-N \mu \log\Big(\frac{\mu}{1-\mu}\, \frac {1- F}{F}\Big) + N \log \big(e^{t^\ast} F + 1-F \big) \right) \\ = \exp \left(-N \mu \log\Big(\frac{\mu}{1-\mu}\, \frac {1- F}{F}\Big) + N \log \Big(\frac{1-F}{1-\mu} \Big) \right) \\ = \exp \left(-N \log\Big( \frac{\mu^\mu (1-\mu)^{1-\mu}}{F^{\,\mu} \,(1- F)^{1-\mu}} \Big) \right) = \Big( \frac{F^{\,\mu} \,(1- F)^{1-\mu}}{\mu^\mu (1-\mu)^{1-\mu}} \Big)^N. \end{multline} We may drop $(1- F)^{1-\mu} \leq 1$, and now this is the same thing as \eqref{eq3.24}; Lemma \ref{l3.23} follows. \hfill$\Box$ \vskip 0.08in \smallskip \begin{corollary}\label{c3.28} Let $\Omega$, $L$, and $V$ be as in Theorem \ref{t3.1}. There exist constants $R^*, c_P, M, \gamma_1, \gamma_2$, depending only on the dimension and the common expectation of the random variables $\omega_j$, such that \begin{equation}\label{eq3.29} \mathbb{P}\left\{u(\xi_0)\geq Mr^2 \right\} \leq\gamma_1 F(c_P\, r^{-2})^{\,\gamma_2\, r^{d}} \end{equation} for any $\xi_0\in \Omega$ and any $r \in (R^*, R_0]$. \end{corollary} \noindent {\it Proof}.\,\, This will follow from a combination of Lemmas ~\ref{l3.19} and \ref{l3.23}. First recall our assumption that the measure associated to $F$ (call it $\nu$) is nontrivial. Let $\mathbb{E}(\omega)$ denote the expectation of our random variables; then \begin{equation} \label{expect} 0 < \mathbb{E}(\omega) < 1. \end{equation} where the first inequality holds because $\nu$ is not a Dirac mass at the origin, and second one holds because the support of $\nu$ touches $0$ and is contained in $[0,1]$. Furthermore notice that $\mathbb{E}(\omega) = \int_{[0,1]} \delta d\nu(\delta) = \int_{(0,1]} \delta d\nu(\delta) \leq 1- \nu(\{ 0 \})$ by Chebyshev's inequality, so $F(0) = \nu(\{ 0 \}) \leq 1- \mathbb{E}(\omega) < 1$. Clearly, $F(c_p r^{-2})$ decays as $r$ grows. We choose a value of $F(c_p r^{-2})$ that we don't want to exceed, half of the way between $1-\mathbb{E}(\omega)$ and $1$, i.e., $F_0 = \frac{2-\mathbb{E}(\omega)}{2} < 1$, choose (we shall see why soon) $a = \frac{\mathbb{E}(\omega)}{2-\mathbb{E}(\omega)} \in (0,1)$, and check now that \begin{equation} \label{aaa} F(a) \leq F_0 = \frac{2 - \mathbb{E}(\omega)}{2}. \end{equation} Indeed $\mathbb{E}(\omega) = \int_{[0,1]} x d\nu(x) \leq a \nu([0,a]) + \nu((a,1] = a F(a) + 1 - F(a)$, hence $F(a)(1-a) \leq 1-\mathbb{E}(\omega)$ and since $1-a = \frac{2-2\mathbb{E}(\omega)}{2-\mathbb{E}(\omega)}$, we get \eqref{aaa}. Now let $\mu \in (3/4,1)$ be given, to be chosen soon in terms of $F_0$, very close to $1$. Also set $\lambda = 1-\mu$ (small), and with this $\lambda$, define $c_P=c_P(\lambda,d)$ large enough, as in Lemma~\ref{l3.4}, and choose $\varepsilon=\varepsilon(\lambda, d)>0$ small enough, and $M = M(\varepsilon, \lambda, d)$ large enough, again as in Lemma~\ref{l3.4}. Those choices also work for Lemma~\ref{l3.19}, so we will be able to apply these two lemmas with these constants. We choose $R^\ast$ so large that $c_P (R^\ast)^{-2} \leq a$; $R^\ast$ depends on $\lambda$ and $\mu$, but soon we will be able to choose $\mu$ (and hence, $\lambda$), that depends only on $\mathbb{E}(\omega)$ and the dimension, so eventually $R^\ast$ will depend only on $\mathbb{E}(\omega)$ and the dimension as well. With this choice of $R^\ast$, and since we shall always restrict to radii $r \geq R^\ast$, we will get that \begin{equation} \label{aaaa} F(c_P r^{-2}) \leq F(c_P (R^\ast)^{-2}) \leq F(a) \leq F_0 : = \frac{2 - \mathbb{E}(\omega)}{2}. \end{equation} The whole point of Lemma \ref{l3.23} was to give a bound on the probability $\mathbb{P}_r$ of \eqref{eq3.20}, and this bound is \begin{equation} \label{3.40} \mathbb{P}_r \leq \big(H(\mu) F(c_P r^{-2})^\mu\big)^{N}, \end{equation} with $N = {\rm Card}\, \{Q\cap {\mathbb{Z}}^d\}$. Notice that we can take $c_P^\ast = c_P$, and the assumption that $F(c_P r^{-2}) < \mu$ is satisfied by \eqref{aaaa} if we take $\mu > F_0$. We also take $\mu > 3/4$, so that $F(c_P r^{-2})^{\mu-1/2} \leq F_0^{\mu-1/2} \leq F_0^{1/4}$ and use \eqref{mumu} to finally choose $\mu$ so close to $1$ that $H(\mu) F_0^{1/4} < 1$. This way \eqref{3.40} implies that $\mathbb{P}_r \leq F(c_P r^{-2})^{N/2}$, which will be good enough for us. Now let $r \geq R^\ast$ be given, and let us evaluate the probability (call it $P$) of \eqref{eq3.29}. Notice that $P$ is smaller than the probability of having $u(\xi) \geq Mr^2$ for some point of a cube $S$ of size roughly $(10 \sqrt d)^{-1}r$, say, that contains $\xi_0$. This probability does not depend on $S$ (by invariance), and can be estimated as in Lemma~\ref{l3.19}. Thus we get that $$ P \leq \mathbb{P}_{\Omega} + C \varepsilon^{-d} \sum_{0 \leq k \leq k_{max}} \mathbb{P}_{r_k}, $$ with $r_k = (1+\varepsilon)^{k/2} r$. We use (the consequence of) \eqref{3.40} to estimate $\mathbb{P}_{r_k}$, noticing that $F(c_P r_k^{-2}) \leq F(c_P r^{-2})$ and each set $Q_{r_k}\cap {\mathbb{Z}}^d$ has at least one more point than the previous one. That is, $N_k = {\rm Card}\{Q_{r_k}\cap {\mathbb{Z}}^d\}$ is at least $N+k$, where $N = {\rm Card}\{Q_{r}\cap {\mathbb{Z}}^d\}$. Then $\mathbb{P}_{r_k} \leq F(c_P r_k^{-2})^{N_k/2} \leq F(c_P r^{-2})^{(N+k)/2}\leq F_0^{k/2} F(c_P r^{-2})^{N/2}$. We have a similar estimate for $\mathbb{P}_{\Omega}$ (which is of the same type as $\mathbb{P}_{r_k}$, with $r_k \sim R_0$). So we can sum the geometric series, and get the more precise estimate \begin{equation} \label{3.41} P \leq \gamma_1 F(c_P r^{-2})^{ {\rm Card}\{Q_r\cap {\mathbb{Z}}^d\}/2} \leq \gamma_1 F(c_P r^{-2})^{\gamma_2 r^d} \end{equation} with constants $\gamma_1$ and $\gamma_2$ that depend on $d$ and $\mathbb{P}(\omega)$ (through our choice of $F_0$, $a$, $\mu$, and then the various constants that ensue, including $\varepsilon$). As was said earlier, we can then compute $R^\ast$, depending on these constants. Corollary \ref{c3.28} follows. \hfill$\Box$ \vskip 0.08in \begin{corollary}\label{c3.31} Let $\Omega$, $L$, and $V$ be as in Theorem \ref{t3.1}, in particular $V$ is a random potential governed by i.i.d. random variables $\omega_j$. Then there exist constants $\mu^*, M, c_P, \gamma_3, \gamma_4$, depending only on the dimension and the expectation of the $\omega_j$, \begin{equation}\label{eq3.29aa} N^E_u(\mu) \leq \gamma_3 \mu^{d/2} \, F(M c_P\,\mu)^{\,\gamma_4\, \mu^{-d/2}}, \end{equation} whenever $\mu<\mu^*$ and $R_0>(\mu M)^{-1/2}$. \end{corollary} \noindent {\it Proof}.\,\, Recall from \eqref{eq2.2} and the statement of Theorem \ref{t1.11} that $$ N^E_u(\mu)= \frac{1}{|\Omega|}\times \mathbb{E} \left\{\mbox{the number of cubes } Q\in \{Q\}_{\kappa\,\mu^{-1/2}} \mbox{ such that } \min_Q \frac 1u \leq \mu\right\}, $$ where $1\leq \kappa<2$ (depending on $\mu$) is the smallest number such that $R_0$ is an integer multiple of $\kappa \mu^{-1/2}$. The expectation of the number of cubes is less than the sum of expectations (by the triangle inequality), so $$ N^E_u(\mu) \leq \frac{1}{|\Omega|} \, \frac{|\Omega|}{(\kappa \mu^{-1/2})^d} \sup_{Q\in \{Q\}_{\kappa\,\mu^{-1/2}} } \mathbb{P} \left\{ \min_Q \frac 1u \leq \mu\right\}. $$ We want to apply our estimate in \eqref{3.41}, coming from Lemma~\ref{l3.19}. This one gives the probability that the infimum of $\frac 1u$ on $B_{r/3}(0)$ is at most $(Mr^2)^{-1}$, so we should take $r$ such that $(Mr^2)^{-1}=\mu$. Notice that $r \leq R_0$ by our condition on $R_0$. We get equal probabilities for integer translations of that ball, as usual, by the translation invariance of our setting. Now each cube $Q\in \{Q\}_{\kappa\,\mu^{-1/2}}$ can be covered by less than $C$ integer translations of of $B_{r/3}(r/3)0)$ (taken from a fixed subgrid), and for each one the probability that $\frac 1u \leq \mu$ somewhere on the ball is estimated as in \eqref{3.41}. Therefore $$ N^E_u(\mu) \leq C (\kappa \mu^{-1/2})^{-d} \gamma_1 F(c_P r^{-2})^{\gamma_2 r^d} \leq \gamma_3 \mu^{d/2} F(Mc_P \mu)^{\gamma_4 \mu^{-d/2}}, $$ as announced. \hfill$\Box$ \vskip 0.08in We now give a lower bound for $N^E_u(\mu)$. \begin{lemma}\label{c3.30} Let $\Omega$, $L$, and $V$ be as in Theorem \ref{t3.1} and in the previous lemmas. There exist constants $m, \widetilde c_P, \gamma_5, \gamma_6$, depending on the dimension only, such that \begin{equation}\label{eq3.31} N^E_u(\mu) \geq \gamma_5 \, \mu^{d/2} \, F(\widetilde c_P\,\mu)^{\,\gamma_6\, \mu^{-d/2}}, \end{equation} whenever $\mu\leq 1$ and $R_0>(\mu m)^{-1/2}$. \end{lemma} \noindent {\it Proof}.\,\, Much as above, we start observing that \begin{align} N^E_u(\mu) =\,& \frac{1}{|\Omega|}\times \mathbb{E} \left\{\mbox{the number of cubes } Q\in \{Q\}_{\kappa\,\mu^{-1/2}} \mbox{ such that } \min_Q \frac 1u \leq \mu\right\}\\ \geq\, & \frac{1}{|\Omega|}\times \sum_{Q\in \{Q\}_{\kappa\,\mu^{-1/2}}}\mathbb{P} \left\{ \min_{Q} \frac 1u \leq \mu\right\}. \end{align} Now we recall again from from \cite{ADFJM-CPDE}, Lemma~4.1 (or \eqref{eq1.2}), that $$\int_{\Omega}|\nabla f|^2+V\,f^2\, dx\geq \int_{\Omega}\frac 1u \,f^2\, dx,$$ for all $f$ in the space of periodic functions in $W^{1,2}(\Omega)$, and in particular for $f\in C_0^\infty (\Omega)$. We will choose $f$ to be a standard cut-off on $4C_1Q$, $C_1\geq 1$; that is, $f\in C_0^\infty (4C_1Q)$, $f=1$ on $C_1Q$ and $|\nabla f|\leq (C_1 l(Q))^{-1}$. We will need that $4C_1Q \subset \Omega$, i.e., $\Omega$ should be large enough to accommodate this. This is ensured by the condition $R_0>(\mu m)^{-1/2}$ if $m$ is small enough. It follows that \begin{multline*} \min_{C_1 Q} \frac 1u \leq \frac{1}{|C_1Q|} \left(\int_{C_1Q} \frac 1u f^2\right) \leq \frac{1}{|C_1Q|} \left(\int_\Omega |\nabla f|^2 +Vf^2\right) \\ \leq \frac{1}{|C_1Q|} \left(\int_{4C_1Q} (C_1 l(Q))^{-2} +V \right) \leq 4^d \Big((C_1l(Q))^{-2}+\fint_{4C_1Q} V \Big). \end{multline*} We choose $C_1$ such that $4^d C_1^{-2}\leq 1/2$; then $4^d (C_1l(Q))^{-2} \leq l(Q)^{-2}/2 = \kappa^{-1} \mu /2 \leq \mu/2$, and now $\min_{C_1Q} \frac 1u \leq \mu/2 + 4^d \fint_{4C_1Q} V$. Therefore $$ \mathbb{P}\left\{ \min_{C_1Q} \frac 1u\leq \mu\right\} \geq \mathbb{P}\left\{4^d\fint_{4C_1Q}V\, dx\leq \mu/2\right\} \geq \mathbb{P}\left\{\max_{4C_1Q}V \leq 4^{-d}\mu/2\right\}. $$ Note that $$\mathbb{P}\left\{ \min_{C_1Q} \frac 1u\leq \mu\right\}\le \sum_{Q'\in\, C_1Q\bigcap \{Q\}_{\kappa\,\mu^{-1/2}}}\mathbb{P}\left\{ \min_{Q'} \frac 1u\leq \mu\right\}. $$ Therefore, \begin{align*} \sum_{Q\in \{Q\}_{\kappa\,\mu^{-1/2}}}\mathbb{P}\left\{ \min_{C_1Q} \frac 1u\leq \mu\right\} \le & \sum_{Q\in \{Q\}_{\kappa\,\mu^{-1/2}}} \sum_{Q'\in\, C_1Q\bigcap \{Q\}_{\kappa\,\mu^{-1/2}}}\mathbb{P}\left\{ \min_{Q'} \frac 1u\leq \mu\right\}\\ \leq & \, C_1^d\sum_{Q\in \{Q\}_{\kappa\,\mu^{-1/2}}} \mathbb{P}\left\{ \min_{Q} \frac 1u\leq \mu\right\}. \end{align*} Combining all of the above and using the independence of the $\omega_j$, we conclude that \begin{align*} \sum_{Q\in \{Q\}_{\kappa\,\mu^{-1/2}}} \mathbb{P}\left\{ \min_{Q} \frac 1u\leq \mu\right\} \ge & \,C_1^{-d}\sum_{Q\in \{Q\}_{\kappa\,\mu^{-1/2}}}\mathbb{P}\left\{ \omega_j \leq 4^{-d}\mu/2\,\, \forall\,j\in 5C_1Q\cap {\mathbb{Z}}^d\right\} \\ = &\, C_1^{-d}\frac{|\Omega|}{|(\kappa \mu^{-1/2})^d|}F\left(4^{-d}\mu/2\right)^{{\rm Card}\, \{5C_1Q\,\cap {\mathbb{Z}}^d\}}, \end{align*} which yields the desired conclusion. \hfill$\Box$ \vskip 0.08in We are now finished with the proof of Theorem~\ref{t3.1}, which is a combination of Corollary~\ref{c3.31} and Lemma~\ref{c3.30}. We just renamed the four $\gamma_j$, and also renamed $M c_P$ from Lemma~\ref{c3.30} as $c_P$, but both of these constants depend only on $d$ and the expectation of the $\omega_j$. We shall now see how Theorem~\ref{t3.1} provides the desired estimates on the expectation of the density of states. \begin{theorem}\label{t3.32} Let $\Omega$, $L$, and $V$ be as in Theorems \ref{t1.11} and \ref{t3.1}. Then there exist constants $C_5, C_6 >0$, depending on the dimension and the expectation of the random variables $\omega_j$, only and a constant $C_4>0$, depending on the dimension only, such that \begin{equation}\label{eq3.33} C_5N_u^E (C_6\, \mu) \leq N^E(\mu) \leq N_u^E (C_4 \mu), \end{equation} for every $\mu>0$. In particular, there exist constants $\mu^*, m_1, c_P, \gamma_1, \gamma_2$, depending on the dimension and the expectation of the random variable only, and constants $\widetilde c_P, \gamma_3, \gamma_4$, depending on the dimension only, such that \begin{equation}\label{eq3.34} \gamma_3 \,\mu^{d/2} F(\widetilde c_P \mu)^{\gamma_4 \mu^{-d/2}}\leq N^E(\mu) \leq \gamma_1 \,\mu^{d/2} F(c_P \mu)^{\gamma_2 \mu^{-d/2}}, \end{equation} whenever $\mu<\mu^*$ and $R_0>(\mu m_1)^{-1/2}$. \end{theorem} Notice that Theorem \ref{t3.32} is a combination of Theorem~\ref{t1.11} and the statement \eqref{eq1.12} in Theorem~\ref{t1.15}. Since the other part of Theorem~\ref{t1.15}, \eqref{eq1.13}, was proved in Theorem~\ref{t3.1}, both Theorems ~\ref{t1.11} and ~\ref{t1.15} will follow as soon as we prove Theorem \ref{t3.32}. \smallskip \noindent {\it Proof}.\,\, The right-hand side inequality in \eqref{eq3.33} is the right-hand side inequality in \eqref{eq2.4}, hence it has been proved in Theorem~\ref{t2.1}. The proof of the left-hand side of \eqref{eq2.4} will be split into two parts, where $\mu>\mu^\sharp$ and $\mu\le \mu^\sharp$ for some suitable $\mu^\sharp$. For the values of $\mu>\mu^\sharp$ we are going to proceed as for the proof of \eqref{eq2.6} in Theorem \ref{t2.1}, and prove that for any given $\mu_0$, \begin{equation} \label{356} N_u(\mu) \leq N(C' \mu) \,\, \hbox{ for all } \mu>\mu_0, \end{equation} where $C' = (d,\mu_0)$ depends only on $\mu_0$ and the dimension. We will essentially use the fact that the function $u^2$ is a doubling weight. Indeed, given that $\|V\|_{L^\infty(\Omega)} \leq 1$, the Harnack inequality (see, \cite{GT}, Theorem~8.17 and 8.18) guarantees that $$\sup_{Q_{2s}} u \leq C(s) \left(\inf_{Q_s} u +s^2\right).$$ Here the constant $C(s)$ depends on $s$; specifically, the examination of the proof shows that $C(s) \leq C_0^s$ for some dimensional constant $C_0$ (see the comment right after the statement of Theorem~8.20 in \cite{GT} to this effect or simply use the Harnack inequality at scale 1 roughly $s$ times to treat larger $s$). Hence, if $s$ is bounded from above by some constant depending on $d$ and some $\mu_0>0$, we have $$\sup_{Q_{2s}} u \leq C(d,\mu_0) \left(\inf_{Q_s} u +s^2\right).$$ Going further, we recall that $u\geq 1$ on $\Omega$ (see \cite{ADFJM-CPDE}, Proposition~3.2), so that possibly further adjusting $C(d,\mu_0)$ we have $$\sup_{Q_{2s}} u \leq C(d,\mu_0) \inf_{Q_s} u,$$ again assuming that $s$ is bounded from above by some constant depending on $d$ and $\mu_0$. We now follow the argument in \eqref{eq2.8bis}--\eqref{eq2.9}, except that this time we take $C_2=1$. Then the sidelength of the cube under consideration is $\kappa \mu^{-1/2} \leq 2 (\mu_0)^{-1/2}$, and we will be using doubling on cubes of the size at most $16\,(\mu_0)^{-1/2}$ (in fact, we even use smaller $\kappa$). The argument follows the same path, only arriving at the bound by some constant $C'(d,\mu_0) \,\mu$ in place of $C_{d,5}C_2 \mu$ on the right-hand side of \eqref{eq2.9}. Thus \eqref{356} holds: $N_u(\mu) \leq N(C'(d,\mu_0) \mu),$ for all $\mu>\mu_0$. We can write an upper bound on $C'(d,\mu_0)\le e^{\widetilde C \mu_0^{-1/2}}$ explicitly, for a suitable dimensional constant $\widetilde C$. Note that $\mu_0e^{\widetilde C \mu_0^{-1/2}}\to \infty$ either as $\mu_0\to 0$ or as $\mu_0\to \infty$. Therefore, we choose \begin{align} \mu^\sharp= \min_{\mu_0>0}\mu_0e^{\widetilde C \mu_0^{-1/2}} \end{align} and choose $\mu_0$ to attain the minimum. In other words, $$N_u(C'(d,\mu_0)^{-1}\,\mu) \leq N( \mu),$$ for all $\mu>\mu^\sharp=\mu_0\, C'(d,\mu_0)$. Now recall the first inequality in \eqref{eq2.4} of Theorem~\ref{t2.1} and fix the constants $C_1, C_2, C_3$ (depending on dimension only) from this inequality. For the $\mu^\sharp$ given as above, we claim that for a suitable choice of $\alpha<2^{-4}$, depending on dimension and the expectation of the $\omega_j$, and also depending on $\mu^\sharp$, \begin{equation}\label{eq3.35} C_3 N_u^E (C_2 \alpha^{d+4} \mu) \leq \frac 12\, C_1 \alpha^d N_u^E (C_2 \alpha^{d+2} \mu), \end{equation} whenever $\mu<\mu^{\sharp}$ and $R_0>(\mu m_1)^{-1/2}$ (for some $m_1 >0$, that depends on the dimension and the expectation of the $\omega_j$ only). As we shall see, this is basically a consequence of the fact that according to Theorem~\ref{t3.1}, $N_u^E(\mu)$ is exponentially small for small $\mu$, far beating the polynomial increase of $\alpha^{-d/2}$. Indeed, Theorem~\ref{t3.1} says that \begin{equation} \label{350} N_u^E (C_2 \alpha^{d+4} \mu) \leq \gamma_1 \,(C_2 \alpha^{d+4} \mu)^{d/2} F(c_P C_2 \alpha^{d+4} \mu)^{\gamma_2 (C_2 \alpha^{d+4} \mu)^{-d/2}}, \end{equation} provided that $(C_2 \alpha^{d+4} \mu) < \mu^*$ and $R_0>(C_2 \alpha^{d+4} \mu m)^{-1/2}$. These last conditions are ensured if we take $C_2\alpha^{d+4}\mu^\sharp \leq \mu^*$ and $m_1 \leq C_2 \alpha^{d+4} m$. Theorem~\ref{t3.1} also says that \begin{equation} \label{351} N_u^E (C_2 \alpha^{d+2} \mu) \geq \gamma_3 \,(C_2 \alpha^{d+2} \mu)^{d/2} F(\widetilde c_P C_2 \alpha^{d+2} \mu)^{\gamma_4 (C_2 \alpha^{d+2} \mu)^{-d/2}} \end{equation} provided that $(C_2 \alpha^{d+2} \mu) < \mu^*$ and $R_0>(C_2 \alpha^{d+2} \mu m)^{-1/2}$, which will hold if we take $C_2\alpha^{d+2}\mu^\sharp \leq \mu^*$ and $m_1 \leq C_2 \alpha^{d+2} m$. Set $F_2 = F(\widetilde c_P C_2 \alpha^{d+2} \mu)$ and $F_4=F(c_P C_2 \alpha^{d+4} \mu)$; if we want to prove our claim \eqref{eq3.35}, it is enough to prove that \begin{equation} \label{352} C_3 \gamma_1 \,(C_2 \alpha^{d+4} \mu)^{d/2} F_4^{\gamma_2 (C_2 \alpha^{d+4} \mu)^{-d/2}} \leq \frac12 C_1 \alpha^d \gamma_3 \,(C_2 \alpha^{d+2} \mu)^{d/2} F_2^{\gamma_4 (C_2 \alpha^{d+2} \mu)^{-d/2}}. \end{equation} Take $\alpha$ so small that $c_P C_2 \alpha^{d+4} < \widetilde c_P C_2 \alpha^{d+2}$; thus $\alpha$ depends also on the expectation of $\omega$, through $c_P$. Then $F_4 \leq F_2$. Also choose $\alpha$ so small that $\widetilde c_P C_2 \alpha^{d+2} \mu^{\sharp} < \delta_0$, with $\delta_0 = \mathbb{E}(\omega)/2$. This way, if $\nu$ denotes the probability measure defined by $F$, $\mathbb{E}(\omega) = \int_{[0,1]} \delta d\nu(\delta) \leq \delta_0 + \nu((\delta_0,1]) = \delta_0 + 1 - F(\delta_0)$, so $F(\delta_0) \leq 1 - \mathbb{E}(\omega)/2 < 1$. Therefore $F_4 \leq F_2 \leq 1 - \mathbb{E}(\omega)/2$ in the estimates above; now \begin{equation} \label{353} \frac{F_4^{\gamma_2 (C_2 \alpha^{d+4} \mu)^{-d/2}}} { F_2^{\gamma_4 (C_2 \alpha^{d+2} \mu)^{-d/2}}} \leq F_2^{a \mu^{-d/2}}, \end{equation} with $a= \gamma_2 (C_2 \alpha^{d+4})^{-d/2}-\gamma_4 (C_2 \alpha^{d+2})^{-d/2} \geq \frac12 \gamma_2 (C_2 \alpha^{d+4})^{-d/2}$ if $\alpha \leq (\gamma_4/\gamma_2)^{1/2}$. Thus the right-hand side of \eqref{353} is exponentially decreasing when $\alpha$ tends to $0$. The powers of $\mu$ in \eqref{352} are the same, and the rest is polynomial in $\alpha$; thus \eqref{352} holds for $\alpha$ small, and \eqref{eq3.35} follows. Now we average \eqref{eq2.4} and use \eqref{eq3.35}; we get that \begin{equation}\label{eq355} \frac{C_1}{2} \alpha^d N^E_u (C_2 \alpha^{d+2} \mu) \leq N^E(\mu) \leq N^E_u (C_4 \mu), \end{equation} which is the same as \eqref{eq3.33} (recall that we are allowed to let $C_5$ and $C_6$ depend on $\alpha$, which is now chosen depending on $\mathbb{P}(\omega)$ and $d$), except that we have to assume that $\mu<\mu^{\sharp}$ and $R_0 > (m_1 \mu)^{-1/2}$, and \begin{align} \alpha=\min\left\{\, \left(\frac{\mu^\ast}{C_2\mu^\sharp}\right)^{\frac{1}{d+2}}, \, \left(\frac{\delta_0}{\widetilde c_PC_2\mu^\sharp}\right)^{\frac{1}{d+2}}, \, \left(\frac{\gamma_4}{\gamma_2}\right)^{\frac{1}{2}} \right\} \end{align} Taken along with Theorem~\ref{t3.1}, this also automatically gives \eqref{eq3.34}. As usual, we silently redefine the constants, still depending on the same parameters. \hfill$\Box$ \vskip 0.08in
\section*{Introduction} Among the most basic and important problems in Network Science is to find the structure within a network~\cite{fortunato2010,newman2004finding}. One way of doing this is to find the community, or modular structure of the nodes. In many real-world networks, the community structure has been found to control much of their dynamical or functional behavior. Although there are many possible definitions of community~\cite{schaub2017,peel2017}, a commonly used definition assumes that a community is a group of nodes that are more densely connected than what would occur randomly. This intuitively appealing concept of community can be used to define a metric, called {\it Modularity} $Q$, that quantifies the extent to which a partition of the nodes of a network is modular~\cite{newman2004finding}. The community structure of a given network can then be obtained by finding the partition of the network's nodes that has the maximum modularity $Q_{\max}$. Finding this partition, however, is an NP-hard problem~\cite{brandes2008modularity}. It is of considerable interest and importance to develop an algorithm that robustly finds an accurate solution to this optimization problem that completes in polynomial time. The accuracy of a solution can be measured by how close the value $Q$ of the partition found is to the value of $Q_{\max}$. Any solution provides a lower bound estimate of the value of $Q_{\max}$. Thus, the higher a solution's value of $Q$ is, the more accurate it and its estimate of $Q_{\max}$ is. A number of polynomial time complexity algorithms for finding a network partition that enables $Q_{\max}$ to be estimated have been proposed. Some are quite fast, such as random greedy agglomeration\cite{clauset2004finding,newman2004fast,ovelgonne2010cluster} and the Louvain method\cite{blondel2008fast}. These algorithms, however, don't generally find very accurate solutions. Far more accurate solutions can generally be found with spectral clustering algorithms\cite{newman2006finding,newman2006modularity} that iteratively bisect the set of nodes. The most accurate algorithm of this type~\cite{trevino2015fast} combines bi-sectioning based on the eigenvector of largest eigenvalue of the modularity matrix~\cite{newman2006finding}, tuning with generalized Kernighan–Lin refinements~\cite{kernighan_lin,sun2009improved}, and agglomeration. Until recently this was the most accurate algorithm known. Virtually all algorithms for maximizing modularity are partially stochastic, as they make random choices at intermediate steps among what are seemingly equivalent options at that point. These choices can affect the final partition, and, thus, different runs can produce different partitions. Because of this, to find the partition that provides the best estimate of the maximum modularity, algorithms are often run multiple times to produce an ensemble of partitions and the best of those partitions is chosen. It has, however, recently been demonstrated that partitions with even more accurate estimates of $Q_{\max}$ can be obtained with a scheme that uses information contained within an ensemble of partitions generated with conventional algorithms. This idea is known as ensemble learning. Its use distinguishes a new class of modularity maximizing algorithms~\cite{polikar2006ensemble,sagi2018ensemble}. An ensemble learning scheme known as Iterative Core Group Graph Clustering (CGGCi)~\cite{ovelgonne2012ensemble} was the most accurate algorithm for finding the network partition that maximizes modularity in the 10\textsuperscript{th} DIMACS Implementation Challenge~\cite{dimacs}. The CGGCi scheme starts with an ensemble of partitions obtained by using a conventional ``base algorithm'' and identifies ``core groups'' of nodes that are grouped together in the same community in every partition in the ensemble. It then transforms the original network into a weighted reduced network by collapsing each of these core groups into a single ``reduced'' node and summing all link weights between original nodes to assign weights to the links between the reduced nodes. A base algorithm is then used to find an ensemble of partitions of the reduced network, and that ensemble is used to find a new reduced network. This procedure is iterated until no further improvement in $Q$ is found. The best partition of the final reduced network is then mapped back onto the original network to identify the communities. In this paper, we introduce a different ensemble learning scheme for network community detection. It uses an algorithmic paradigm we call Extremal Ensemble Learning (EEL). Our scheme, which we refer to as Reduced Network Extremal Ensemble Learning (RenEEL), starts with an ensemble of partitions obtained using a conventional base algorithm, and then iteratively updates the partitions in the ensemble until a consensus about which partition is best is reached within the ensemble. To find the partitions used to update the ensemble efficiently, core groups of nodes are identified and used to form a reduced network that is partitioned using a base algorithm. RenEEL then uses a partition of the reduced network to update the ensemble through extremal updating. We will show that an algorithm using the RenEEL scheme improves the quality of community structure discovered, especially for larger networks for which estimating the partition with $Q_{\max}$ becomes challenging. Testing our scheme on a wide range of real-world and synthetic benchmark networks, we show that it outperforms all other existing methods, consistently finding partitions with the highest values of $Q$ ever discovered. \section*{Methods} \subsection*{Community detection via modularity maximization} Modularity $Q$ is a metric that quantifies the amount of modular structure there is in a given partition of a network's nodes into disjoint communities $P = \{ c_1, c_2, \ldots, c_r\}$, where $c_i$ is the $i$th community of nodes and $r$ is the number of communities. It is defined as~\cite{newman2004finding} \begin{equation} Q = \sum_{i}\left[\frac{m_i}{m}-\left(\frac{2m_i+e_i}{2m}\right)^2\right] \label{Q} \end{equation} where the sum is over communities, $m_i$ and $e_i$ are respectively the number of internal and external links of community $c_i$, and $m$ is total number of links in the network. The first term in Eq.~\ref{Q} is the fraction of links inside communities, and the second term is the expected fraction if all links of the network were randomly placed. For a weighted network, $m_i$, $e_i$ and $m$ are sums of link weights instead of numbers of links. Modularity measures the deviation of the structure of a network partition from that expected in a random null model. The {\it community structure of a network} corresponds to the partition $P$ of its nodes that maximizes $Q$. The number of communities in $P$ is free to vary. The challenge of detecting the community structure of a network, therefore, is to find the partition with the maximum modularity $Q_{\max}$. \subsection*{Reduced networks} To find a reduced network $G'$ starting from a network $G$ and an ensemble of partitions of it ${\cal P}$, we first identify the core groups in $G$. A \textit{core group} is a set of nodes that are found together in the same community in every partition in the ensemble. Any node that is not found in the same community with some other node in every partition in ${\cal P}$ is itself a core group. $G'$ is then formed by collapsing core groups of nodes into single reduced nodes and combining their links to other nodes by summing their weights. An example of this is shown in Fig.~\ref{cg_network}. Each circle containing multiple nodes of $G$ that are colored the same in Fig.~\ref{cg_network}(a) denotes a core group. Two nodes that do not belong to any circle are shown in black and dark green. The core groups are collapsed to reduced nodes of the same color in the reduced network $G'$ shown in Fig.~\ref{cg_network}(b). The link weights in the reduced network are the sum of link weights between core groups in the original network. The weighted self-loops in $G'$ result from the total internal weights of the core groups in $G$. \begin{figure} \centering \includegraphics{rGn.pdf} \caption{\label{cg_network} {{\bf Construction of a reduced network.} (a) An example network showing seven core groups of nodes. The nodes of the same color belong to the same core group. The nodes inside each of the five circles are collapsed to single nodes in the reduced network, and the two isolated nodes also become nodes in the reduced network. (b) The reduced network after collapsing the core groups into single nodes. The nodes in the reduced network are colored according to the core group nodes in the original network and thickness of each link is proportional to its weight.}} \end{figure} \begin{figure} \centering \includegraphics{EEL-2.pdf} \caption{\label{dcggc} {{\bf The RenEEL scheme.} (a) The steps of an efficient ensemble learning scheme to find the network partition that maximizes modularity $Q$ are shown in this flow chart. In the two steps shown in red a base algorithm is used to obtain an ensemble of partitions. The step shown in purple collapses the core groups to find the reduced network. The ensemble ${\cal P}$ gets updated with extremal criteria in the step shown in blue and is described in (b). The step shown in green guarantees algorithmic termination in a finite network. (b) The procedure of the extremal updating of ensemble ${\cal P}$.}} \end{figure} \subsection*{Reduced Network Extremal Ensemble Learning scheme} The RenEEL scheme is summarized in the flowchart shown in Fig.~\ref{dcggc} and is described as follows. First, an ensemble ${\cal P}$ of at most $k_{\max}$ partitions $P$ of the network $G$ is obtained from multiple runs of a base algorithm. The base algorithm can be, for example, any of the conventional ones that have been developed to find a partition to estimate $Q_{\max}$. Alternatively, a set of base algorithms can be used to find ${\cal P}$. The partitions in ${\cal P}$ are then ordered according to their modularity values, from the one with the largest value $P_{\rm best}$ to the one with the smallest value $P_{\rm worst}$. Next, the core groups of nodes in the ensemble ${\cal P}$ are identified and used to construct the reduced network $G'$. An ensemble ${\cal P'}$ consisting of $k'$ partitions $P'$ of $G'$ is then obtained using a base algorithm. The base algorithm used for this step can either be the same as or different from the base algorithm used to find ${\cal P}$. The steps in which a base algorithm is used to find the ensembles ${\cal P}$ and ${\cal P'}$ are shown in red in Fig.~\ref{dcggc}(a). The partition in ${\cal P'}$ with the largest modularity value $P'_{\rm best}$ is then identified and used to perform an extremal update of ensemble ${\cal P}$. This step is shown in blue in Fig.~\ref{dcggc}(a) and detailed in Fig.~\ref{dcggc}(b). If $Q(P'_{\rm best}) > Q(P_{\rm worst})$, then $P'_{\rm best}$ is expanded into a partition of $G$ and either used in place of $P_{worst}$ in ${\cal P}$ (if $k=k_{\max}$) or added to the ensemble $\cal P$ (if $k < k_{\max}$) as shown in Fig.~\ref{dcggc}(b). In doing so ${\cal P}$ is enriched with a better quality partition. However, it is possible that at any iteration either $P'_{\rm best}$ is already contained in ${\cal P}$, or $Q(P'_{\rm best}) < Q(P_{\rm worst})$. In both cases, in order to move toward consensus within ${\cal P}$, its current size $k$ is reduced by 1 by deleting $P_{\rm worst}$ from it. This procedure is repeated until there is only one partition left in the ensemble $\cal P$. This consensus partition is the partition that has the largest modularity. It can be used to identify the communities of the network, and its modularity $Q_{\rm best}$ estimates $Q_{\max}$. \subsection*{Computational complexity and practical implementation} The most computationally complex and time consuming steps of the RenEEL scheme are those that use a base algorithm to find an ensemble of partitions. These steps are colored in red in the flowchart in Fig.~\ref{dcggc}. Assuming that the size of the ensembles ${\cal P}$ and ${\cal P'}$ are fixed, the computational complexity of executing these steps is simply a fixed multiple of the computational complexity of the base algorithm used. The scaling of the computational complexity of base algorithms is typically between ${\cal O}(n^2)$ and ${\cal O}(n^3)$, where $n$ is the number of nodes in the network. All other steps of the scheme have less complexity; the steps of network reduction, colored purple in Fig.~\ref{dcggc}, and network expansion both have a computational complexity that scales as ${\cal O}(n^2)$, and the rest all have a computational complexity that is ${\cal O}(1)$. Thus, since each iteration of the scheme has only one step that uses the base algorithm a fixed number of times, each iteration has a computational complexity that scales the same as that of the base algorithm used. As the scheme progresses, however, the size of the reduced network monotonically decreases, significantly increasing the speed of later iterations. A RenEEL algorithm applied to a finite network is sure to complete since new partitions are added to the ensemble ${\cal P}$ only if they have a modularity that is greater than $Q(P_{\rm worst})$ and the size of ${\cal P}$ is bounded. However, it is difficult to determine the precise scaling of number of iterations required in general for an algorithm implementing the scheme to complete, as it depends on the structure of the specific network under consideration. For the networks we analyzed, the number of iterations required was approximately proportional to $k_{\max}$. Thus, we find empirically that the overall complexity of a RenEEL algorithm scales roughly as the base algorithm times $k'$ times $k_{\max}$. The base algorithm used to obtain the results presented in this paper is a randomized greedy agglomerative hierarchical clustering algorithm~\cite{ovelgonne2010cluster}. It is commonly used to find the community structure in complex networks~\cite{ovelgonne2012ensemble} and has an expected time complexity that scales as ${\cal O}(m \; \ln n)$~\cite{ovelgonne2010cluster}, where $m$ is the number of links in the network. There can be, at most, ${\cal O}(n^2)$ links. The overall complexity of the algorithm used here thus scales approximately as ${\cal O}(k_{\max}k' n^2 \; \ln n)$. The particular choice of parameters $k_{max}$ and $k'$ is important for the quality of community structure as well as the computational time. In general, higher $k'$ and $k_{max}$ yield higher $Q_{\rm best}$. \subsection*{Co-clustering analysis} In order to visualize the evolution of the clustering results in the RenEEL scheme, co-clustering matrices at various stages of the scheme are shown in Fig.~\ref{g123}. In Fig.~\ref{all_core_groups} the results of the core group co-clustering at the different stages are combined to show their evolution. A co-clustering matrix $S$ is a matrix whose elements $s_{ij}$ are defined as the fraction of times node $i$ and node $j$ are in the same community in an ensemble of partitions ${\cal P}$. The order of the nodes in Figs.~\ref{g123} and \ref{all_core_groups} was determined using simulated annealing to optimize the block-diagonal structure of the matrices. Starting from a random ordering of the nodes, their order was rearranged to minimize a cost function, or ``Hamiltonian'', that is a function of minimum distance of matrix elements ($i,j$) from the diagonal $d_{ij}$ assuming periodic boundary conditions on the order: \begin{eqnarray} H = \sum_{i < j} s_{ij}\;d_{ij}^{\alpha}, \end{eqnarray} where $\alpha$ is an arbitrary factor that controls the non-linear dependence of $H$ on $d_{ij}$. The results in Figs.~\ref{g123} and \ref{all_core_groups} were obtained using $\alpha=3$. Simulated annealing seeks to find the order of nodes that minimizes $H$. For the Monte Carlo updates in our simulated annealing, Metropolis rates~\cite{kirkpatrick1983optimization} with Boltzmann factor $e^{-(\Delta H)/T}$ were used. Starting from a relatively high temperature where the order of the nodes is random, the temperature was systematically lowered each Monte Carlo step until the node order stabilized. To get the three co-clustering matrices shown in Fig.~\ref{g123}, which respectively show results at the initial, intermediate, and final stages of the RenEEL scheme, the following procedure was used in the simulated annealing Monte Carlo. First nodes were reordered by considering swaps of random pairs of nodes so as to minimize $H$ in the final stage co-clustering matrix. Then, swaps of pairs of final stage core groups and swaps of pairs of nodes within the final stage core groups were considered to minimize $H$ in the intermediate stage co-clustering matrix. Finally, swaps of pairs of final stage core groups, swaps of pairs of intermediate stage core groups within a final stage core group, and swaps of pairs of nodes within an intermediate stage core group were considered to minimize $H$ in the initial stage co-clustering matrix. The order of nodes that resulted is used in all three co-clustering matrices in Fig.~\ref{g123} and in Fig.~\ref{all_core_groups}. \subsection*{Benchmark networks used for comparison} To test the effectiveness of our methods of community detection we studied a set of networks. All of these networks were used in the 10\textsuperscript{th} DIMACS challenge.~\cite{dimacs} The networks are unweighted and undirected. They also have no self-loops. They may be connected or disconnected. The networks we studied are listed and described in Table~\ref{table1}. These networks have been compiled from various sources and cover a wide range of sizes, functions and other characteristics. Hence, they are often used as benchmarks for testing community detection methods. The lists of links defining the Email, Jazz, PGPgc, Metabolic networks were downloaded from Ref.~[\citeonline{arenas_data}]. For Adjnoun, Polblog, Netscience, Power, Astro-ph, As-22july06, Cond-mat-2005, they were downloaded from Ref.~[\citeonline{newman_data}]. For Memplus, it was downloaded from Ref.~[\citeonline{memplus_data}]. For Smallworld and CAIDARouterLevel, they were downloaded from Ref.~[\citeonline{other_networks}]. \begin{figure} \centering \includegraphics{CG.pdf} \caption{\label{g123} {\bf Ordered co-clustering matrix with core groups.} Co-clustering matrix after the nodes have been reordered by simulated annealing. (a) after the first iteration (b) at the intermediate stage (c) at completion. The intensity of white in each pixel is proportional to the co-clustering frequency of the corresponding pair of nodes, except when the pair of nodes are always grouped together and, thus, belong to the same core group. In that case the pixel is colored blue in (a), red in (b), and yellow in (c).} \end{figure} \begin{figure} \centering \includegraphics{new-CGall.pdf} \caption{\label{all_core_groups} {\bf Growth of core groups.} Colors blue, red, and yellow represent the core groups after the first iteration, at an intermediate stage, and at the end when the core groups have reached a stable state, respectively. The core groups can only grow. The process is agglomerative.} \end{figure} \section*{Results} \subsection*{Evolution of core groups} The essence of how the RenEEL scheme works and why it is efficient can be seen by the evolution of the co-clustering of the nodes across the ensemble ${\cal P}$. Fig.~\ref{g123} shows the co-clustering results during a typical realization of the scheme on the Email network~\cite{guimera2003self} (see Table~\ref{table1}) at the initial, intermediate and final stages. In the three sub-figures, the intensity with which a pixel $(i,j)$ is colored white corresponds to the frequency that nodes $i$ and $j$ are in the same community in the member partitions of ${\cal P}$. The pixels colored blue, red, and yellow indicate that the nodes are in the same community in all member partitions. The nodes in the blue, red, and yellow blocks on the diagonal are the core groups that are used to form the reduced network. Nodes are listed in the same order in each of the three sub-figures. Fig.~\ref{all_core_groups} shows the evolution of just the core groups in the same realization. The Email network has $n=1133$ nodes. Initially, as shown in Fig.~\ref{g123}(a), there are 446 core groups, most of which contain only one or two nodes. After 100 iterations of the scheme, as shown in Fig.~\ref{g123}(b), the number of core groups is reduced to 192. Finally, in the stable state, after about 300 iterations of the scheme, only 10 core groups remain, as shown in Fig.~\ref{g123}(c). This reduction, from the original network of 1133 nodes to a reduced network of 10 nodes, is a tremendous simplification and greatly improves the overall speed of network clustering. Within a network $G$ it is generally ``easy'' to determine that certain groups of nodes should be clustered together. All partitions group them together. These are the core groups of nodes. The hard work in finding the optimal partition is to determine whether nodes that are grouped together in only some of the partitions should indeed be in the same community, that is, to determine whether or not core groups should combine. This is precisely what RenEEL focuses on. The formation and evolution of core groups in RenEEL is an agglomerative process~\cite{Rokach2005}. Once a core group is formed, RenEEL never subsequently divides it. As the scheme progresses, core groups grow and merge with each other and the number of core groups monotonically decreases. \begin{table} \begin{center} \caption{{\bf Benchmark networks}. A list of empirical and synthetic networks frequently used for benchmarking modularity optimization methods.} \begin{tabular}{||c c c||} \hline {\bf Network} & {\bf Node description} & {\bf Link description} \\ [0.5ex] \hline\hline Adjnoun~\cite{newman2006finding} & the most commonly occurring & pair of words that occur \\ & adjectives and nouns in the novel & in adjacent position \\ & "David Copperfield" by Charles Dickens & in the text of the book \\ \hline Jazz~\cite{gleiser2003community} & musician & collaboration \\ \hline Metabolic~\cite{duch2005community,jeong2000large,overbeek2000wit} & metabolites (e.g., proteins) & interaction between them \\ & (in C. elegans) & \\ \hline Email~\cite{guimera2003self} & members & email interchanges \\ \hline Polblog~\cite{adamic2005political} & weblogs on US politics & hyperlink \\ \hline Netscience~\cite{newman2006finding} & scientists working on & coauthorship \\ & network theory and experiment & \\ \hline Power~\cite{watts1998collective} & either a generator, & power supply line \\ & a transformator or a substation & \\ \hline PGPgc~\cite{boguna2004models} & users of the & interaction \\ & Pretty Good Privacy (PGP) algorithm & \\ \hline Astro-ph~\cite{newman2001structure} & scientists & coauthorship in \\ & & preprints on the Astrophysics \\ & & E-Print Archive between\\ & & Jan 1, 1995 and December 31, 1999.\\\hline Memplus~\cite{davis2011university} & memory circuit elements & connections \\ \hline As-22july06~\cite{newman_data} & autonomous systems & data connection \\ \hline Cond-mat-2005~\cite{newman2001structure} & scientists & coauthorship in \\ & & preprints on the Condensed \\ & & Matter E-Print Archive between\\ & & Jan 1, 1995 and March 31, 2005.\\\hline Smallworld~\cite{watts1998collective} & synthetic & synthetic \\ \hline CAIDARouterLevel~\cite{CAIDA} & routers & links \\ \hline \end{tabular} \label{table1} \end{center} \end{table} \subsection*{Evolution of the ensemble ${\cal P}$} A defining characteristic of RenEEL is that the ensemble of partitions ${\cal P}$ evolves as the scheme progresses. The ensemble ``learns'' what the partition with $Q_{\rm best}$ is by using extremal updating to incorporate new partitions, replace existing ones with higher quality ones, or remove low quality partitions. The new partitions are partitions of the reduced network $G'$. They are used in RenEEL to improve the quality of ${\cal P}$ at every iteration of the scheme until a consensus is reached about what the optimal partition is. A typical way that ${\cal P}$ evolves as the scheme progresses can be seen with the results shown in Fig.~\ref{eel_iter} from an example run of RenEEL that partitions the As-22july06 network~\cite{newman_data}. (See table~\ref{table1}.) In this example run, $k_{\max}=100$ and $k'=20$. Fig.~\ref{eel_iter}(a) and (b) show the modularity value $Q$ of $P_{\rm best}$ the best partition in ${\cal P}$ (red dots), of $P_{\rm worst}$ the worst partition in ${\cal P}$ (black dots), and of $P'_{\rm best}$ the new partition of $G'$ considered for the enrichment of ${\cal P}$ (blue dots) as a function of the number of iterations. The main panel of Fig.~\ref{eel_iter}(a) shows the full results of the scheme, from start to finish. An enlarged view of the results for the initial 150 iterations is shown in the inset of Fig.~\ref{eel_iter}(a). The main panel of Fig.~\ref{eel_iter}(b) shows an enlarged view of the vertical $Q$ axis near the final result of the entire scheme. An enlarged view of both axes at the end stages of the scheme is shown in the inset of Fig.~\ref{eel_iter}(b). Fig.~\ref{eel_iter}(c) shows the size of the reduced network, or equivalently the number of core groups, as a function of the number of iterations. The main panel of Fig.~\ref{eel_iter}(c) shows the results on linear axis scales, and the inset shows the same results on log scales. Fig.~\ref{eel_iter}(d) shows the ensemble size $k$ as function of the number of iterations. In the example run, as can be seen from the inset of Fig.~\ref{eel_iter}(a), for the first 100 iterations the modularity of the new partitions $Q(P'_{\rm best})$ are all significantly better than that of the worst in the ensemble $Q(P_{\rm worst})$. In fact, all the first 100 new partitions generated by RenEEL are better than every one the 100 original ones in ${\cal P}$ generated by the base algorithm. (The number of partitions in ${\cal P}$ initially is $k_{\max}=100$.) So, for the first $k_{\max}$ iterations RenEEL systematically replaced each of the original partitions. There is large increase in $Q(P_{\rm worst})$ at iteration 100. Although it's difficult to see in the figure, there are other similar, significant increases in $Q(P_{\rm worst})$ at iterations 200 and 300, indicating that RenEEL also replaces its first and second 100 new partitions with entirely new sets in the second and third 100 iterations, respectively. After the first 300 iterations, the quality of the new partitions starts to become comparable to the existing partitions. Throughout the process, the $Q(P_{\rm best})$ intermittently raises when a new best partition is discovered. Fig.~\ref{eel_iter}(c) shows that the size of the reduced network keeps decreasing as the scheme progresses. It initially decreases exponentially, then there is what appears to be a power-law decay from iteration 100 to iteration 1000 (see inset of Fig.~\ref{eel_iter}(c)), followed by a sharp, perhaps exponential, decay in the final iterations of the scheme. The original size of this network, $n = 22963$, is reduced to $38$ core groups at the termination step. The size of the ensemble, shown in Fig.~\ref{eel_iter}(d), varies when new partitions are discovered and added to ${\cal P}$ or when low quality partitions are deleted as the scheme drives ${\cal P}$ toward consensus. The plot shows that as the ensemble learns, its size grows and shrinks multiple times before its size falls to unity and the scheme terminates. There are two main periods in which the size of the ensemble grows, one beginning at about iteration 900 and the other at about iteration 1200. During these periods the value of $Q(P_{\rm best})$ increases quickly, as can be seen in the main panel and inset of Fig.~\ref{eel_iter}(b). These are periods when the ensemble ${\cal P}$ has made a ''breakthrough'' by discovering a new set of high quality partitions. The example run ends with a consensus choice that a partition with modularity $Q_{\rm best} = 0.678579$ is the one that maximizes modularity for this network, a value higher than that any previously reported partition. (See Table~\ref{table2}.) \begin{figure} \centering \includegraphics{QEL.pdf} \caption{\label{eel_iter} {\bf Evolution of the ensemble of partitions ${\cal P}$ for a typical run of RenEEL.} (a) Modularity $Q$ of partitions $P_{\rm best}$, $P'_{\rm best}$ and $P_{\rm worst}$ at each iteration of the scheme is shown in red, blue, and black, respectively. The inset is an enlargement of the results for the first 150 iterations. (b) Same results as in (a), but showing only the upper portion of the plot. The inset shows an enlargement of the upper-right corner of the plot. (c) Evolution of the size of the reduced network. The inset shows the same plot on a logarithmic scale. (d) Evolution of the size of the ensemble ${\cal P}$.} \end{figure} \subsection*{Distribution of results for $Q_{\rm best}$} Since virtually all conventional algorithms are stochastic, ensemble learning schemes that use them as base algorithms will also be stochastic. Thus, a range of results for $Q_{\rm best}$ are possible with each realization of virtually all methods of modularity maximization. As an example, Fig.~\ref{q_dist} shows the distribution of $Q_{\rm best}$ that three different methods of community detection produce for the Email network. Results from 250 realizations for each method are shown. Results from the RenEEL, CGGCi ensemble learning schemes, and naive ensemble analyses are shown in red, green, and blue, respectively. The results for all three of these schemes were obtained using a randomized greedy algorithm as the base algorithm and an ensemble size of $k_{\max}=100$. Each of the blue data points were obtained by running the algorithm 100 times and choosing the largest value from those runs. The distributions from the three different methods are all non-overlapping, with the RenEEL results having the largest values, followed those of CGGCi and then those of the naive ensemble analyses with the conventional algorithm. The distribution of $Q_{\rm best}$ for RenEEL is also narrower than those of the other two schemes, which suggests that the results from RenEEL are close to the value of $Q_{\max}$ for the network. \begin{figure} \centering \includegraphics{Q-distribution4.pdf} \caption{\label{q_dist} {\bf Distribution of $Q_{\rm best}$ obtained by various methods.} Frequency plot of $Q_{\rm best}$ for the Email network obtained by multiple realizations of three different methods. Blue corresponds to a naive ensemble analysis scheme, green corresponds to CGGCi scheme, and red corresponds to RenEEL scheme. The y-axis has a logarithmic scale. In this particular example, there is no overlap between the distributions from the different methods.} \end{figure} \subsection*{Application to benchmark networks} To test the accuracy of the RenEEL scheme, we applied it to the benchmark networks listed in Table~\ref{table1}. In Table~\ref{table2}, the maximum modularity value $Q_{\rm best}$ found for these networks by RenEEL is compared to the best previously published values. Many of these values were the best result in the 10\textsuperscript{th} DIMACS challenge~\cite{dimacs_results}. To be consistent, all realizations had $k_{\max}=100$ and $k'=20$ and used the randomized greedy algorithm as a base network. 100 different realizations of RenEEL were run on the smaller networks, up to and including the Netscience network, and 5 were run on the larger networks. For the smaller networks the value of $Q_{\rm best}$ reported in table was consistently obtained. For the larger networks a range of results were obtained and the largest one is listed. As the table shows, the partitions found by RenEEL have a value of $Q_{\rm best}$ that is higher than or equivalent to the best previously reported value for every benchmark network. The difference between $Q_{\rm best}$ found by RenEEL and the previous best values increases with network size. This is due to the fact that for small networks it is generally easier to find the Modularity maximizing partition, but the task becomes more challenging for larger networks. Our results are significant for every network studied. For the smallest networks, our best partition has the same modularity as that of the previous best result. This is presumably because we find the true best partition that other algorithms have also found. For larger networks, however, our results are better than any previously reported result. For some medium size networks, our value of $Q_{\rm best}$ may be only slightly better than the previous best, but, in these cases, finding any new better result is remarkable and mathematically noteworthy. Furthermore, for these networks, we may be discovering the true best partition. For larger networks, our accuracy improvement is substantial. Perhaps a better way of quantifying the mathematical significance of our results would be, if one knew what the value of true best Modularity $Q_{\max}$ is, to consider results for $1/\Delta Q$, where $\Delta Q \equiv Q_{\max}-Q$, instead of the results for $Q$. Unfortunately, that’s not possible as the value of $Q_{\max}$ for most networks is not known. If we could though, it would be clear that our results are indeed highly significant, for every network studied. \begin{table} \begin{center} \caption{{\bf Comparison of results using RenEEL to the previous best results for benchmark networks.} Maximum modularity $Q_{\rm best}$ obtained by the RenEEL scheme compared to the previous best reported values.} \begin{tabular}{||c c c c c||} \hline {\bf Network} & {\bf Nodes} & {\bf Links} & {\bf RenEEL result} & {\bf Previous best} \\ [0.5ex] \hline\hline Adjnoun & 112 & 425 & 0.313367 & 0.313367~\cite{Aloise2012ModularityMI} \\ \hline Jazz & 198 & 2742 & 0.445144 & 0.445144~\cite{Aloise2012ModularityMI} \\ \hline Metabolic & 453 & 2025 & 0.453248 & 0.453248~\cite{Aloise2012ModularityMI} \\ \hline Email & 1133 & 5451 & 0.582829 & 0.582829~\cite{Aloise2012ModularityMI} \\ \hline Polblog & 1490 & 16715 & 0.427105 & 0.427105~\cite{Aloise2012ModularityMI} \\ \hline Netscience & 1589 & 2742 & 0.959900 & 0.959900~\cite{ovelgonne2012ensemble}\\ \hline Power & 4941 & 6594 & 0.940938 & 0.940851~\cite{Aloise2012ModularityMI} \\ \hline PGPgc & 10680 & 24316 & 0.886853 & 0.886564~\cite{dimacs_results} \\ \hline Astro-ph & 16706 & 121251 & 0.745614 & 0.744621~\cite{Aloise2012ModularityMI} \\ \hline Memplus & 17758 & 54196 & 0.700591 & 0.700473~\cite{dimacs_results} \\ \hline As-22july06 & 22963 & 48436 & 0.678579 & 0.678360~\cite{ovelgonne2012ensemble} \\ \hline Cond-mat-2005 & 40421 & 175693 & 0.748187 & 0.746445~\cite{ovelgonne2012ensemble} \\ \hline Smallworld & 100000 & 499998 & 0.793175 & 0.793099~\cite{ovelgonne2012ensemble} \\ \hline CAIDARouterLevel & 192244 & 609066 & 0.872086 & 0.872042~\cite{dimacs_results} \\ \hline \end{tabular} \label{table2} \end{center} \end{table} \section*{Discussion} Recent advances in Machine Learning and Artificial Intelligence have enabled progress to be made toward solving a range of difficult computational problems~\cite{mohammed2016machine}. In this paper, we have introduced a powerful algorithmic paradigm for graph partitioning that we call Extremal Ensemble Learning (EEL). EEL is a form of Machine Learning. An EEL scheme creates an ensemble of partitions and then uses information within the ensemble to find new partitions that are used to update the ensemble using extremal criteria. Through the updating procedure, the ensemble learns how to form improved partitions, as it works toward a conclusion by achieving consensus among its member partitions about what the optimal partition is. The particular EEL scheme we have introduced, Reduced Network Extremal Ensemble Learning (RenEEL), uses information in the ensemble of partitions to create a reduced network that can be efficiently analyzed to find a new partition with which to update the ensemble. We have used RenEEL to find the partition that maximizes the modularity of networks. This is a difficult, NP-hard computational problem\cite{brandes2008modularity}. We have shown that an algorithm using the RenEEL scheme outperforms all existing modularity maximizing algorithms when analyzing a variety of commonly studied benchmark networks. For those networks it finds partitions with the largest modularity ever discovered. For the larger benchmark networks, the partitions that we discovered are novel. Although we have only demonstrated the effectiveness of our algorithm for the well-known problem of finding the network partition that maximizes modularity, the EEL paradigm and the RenEEL scheme can be used to solve other network partitioning problems. For example, the algorithm we used can be straightforwardly adapted to optimize other metrics such as modularity density~\cite{chen2014}, or excess modularity density~\cite{chen2018network}. Work is underway to explore the effectiveness of RenEEL for solving those problems. Its potential effectiveness for finding the partition that maximizes excess modularity density may be especially important. Using excess modularity density largely mitigates the resolution limit problem in community detection by maximizing modularity~\cite{fortunato2007resolution}, making it a preferred metric for applications where the resolution limit is problematic, such as finding the community structure in gene regulatory networks~\cite{trevino2012robust,mentzen2008regulon}. There is potential to improve upon our results using the RenEEL scheme. As previously discussed, any conventional algorithm can be used as the base algorithm of the scheme. There is also freedom to vary the size of the ensembles used in the scheme. Which base algorithm and what ensemble sizes are best to use depends on the network to be analyzed. Using a high quality base algorithm though, such as the Iterative Spectral Bisectioning, Tuning and Agglomeration algorithm~\cite{trevino2015fast}, is likely to yield more accurate results for many of the networks studied. There is also potential to improve the RenEEL scheme itself. For instance, currently, a naive ensemble analysis of partitions of the reduced network is used to find a new partition with which to update the ensemble. Another method, such as a recursive use of the RenEEL scheme, may yield better results. Also, currently, once the original ensemble of partitions is created, no new information is ever added to the system during the learning processes. It may be beneficial to occasionally use a new partition of the original network instead of the reduced network to update the ensemble. Work is in progress to explore if these ideas lead to improved results. Finally, the principal reasons why the RenEEL scheme is both efficient and effective should be noted. Its efficiency stems from its use of an ensemble of partitions to form reduced networks. The smaller size of the reduced networks allows them to be partitioned much more quickly than the full network. Also, because the scheme is so effective, highly accurate results can be obtained even if a fast, but low quality, base algorithm is used. This allows significantly larger networks to be analyzed than what would otherwise be possible. The remarkable effectiveness of RenEEL, even relative to other Ensemble Learning schemes, is mainly due to its extremal updating of the ensemble of partitions. It is of course just one example of a scheme using the EEL paradigm. Its success, though, suggests that EEL is an algorithmic paradigm that will be useful for solving a variety of graph theoretic problems. \section*{Acknowledgements} We thank Peter Grassberger and Eve S. Wurtele for fruitful discussions. This work was supported by the NSF through grants DMR-1507371 and IOS-1546858. Some of the computations in this work were done on the uHPC cluster at the University of Houston, acquired through NFS Award Number 1531814. \section*{Author contributions statement} JG, PS, and KEB conceived of the project. JG performed the simulations. JG, PS, and KEB analyzed the results and wrote the paper. All authors read and approved the manuscript. \section*{Additional information} \textbf{Competing interests} The authors declare that they have no competing interests. \section*{Data Availability} The data used in this study are publicly available from the sources that are cited in the main text.
\section{Introduction} Universality is a hallmark of second order phase transitions\cite{Goldenfeld_book, Zinn_Justin_small} and its explanation may be viewed as a major success of renormalization group theory. There are however well known cases, where the critical properties are actually not universal. Commonly recognized examples include systems with long-ranged interactions,\cite{long_range_Les_Houches} interfacial unbinding transitions in $d=3$,\cite{Parry_2009} some spin glass transitions,\cite{Bernardi_1996} or the eight vertex model.\cite{Baxter_1971} In the RG framework universality emerges as consequence of the existence of isolated fixed points associated with a unique set of relevant perturbations characterized by their scaling dimensions. One way of avoiding the emergence of universality appears when the fixed point features a marginal operator. In such situations the flow diagram may exhibit a line of fixed points and the critical exponents may vary continuously depending on the system parameters and the thermodynamic fields. In this paper we address the classical $O(2)$ model with perturbations which explicitly break the symmetry from $O(2)$ to $\mathbb{Z}_4$. From the perspective of the general theory of continuous phase transitions this system is interesting and somewhat unusual both in dimensionality $d=3$ and $d=2$. In the former case the anisotropy field $\lambda$ acts as an irrelevant operator and the critical behavior is governed by the standard $XY$ (Wilson-Fisher) fixed point. However, $\lambda$ gaps the Goldstone mode in the low-$T$ phase and gives rise to the emergence of one additional length scale which diverges at the critical point. This leads to the effect of distinct susceptibility and correlation length exponents depending on the side from which the phase transition is approached. In dimensionality $d=2$ the anisotropy stabilizes the long-range ordered phase and is known to be a marginal perturbation at the Kosterlitz-Thouless (KT) phase transition occurring at $\lambda=0$. This leads to the appearance of two additional fixed-point lines emerging towards positive and negative values of $\lambda$ from the vicinity of the endpoint of the KT fixed point line located at $\lambda=0$ and $T<T_{KT}$. The existence of these lines renders the exponents characterizing the transition at $\lambda\neq 0$ nonuniversal. The 2-dimensional $O(2)$ model with $\mathbb{Z}_4$ anisotropies is also of high experimental relevance in a number of contexts. For a broad and useful exposition we refer to Ref.~\onlinecite{Taroni_2008}. In addition, both for $d=2$ and $d=3$ in the critical regime the system is equivalent to the Ising model for specific choices of the model couplings. These features lead to reach crossover phenomena and in $d=2$ raise the interesting question concerning the relation between the Ising fixed point and the above-mentioned fixed-point line. The purpose of the present paper is to analyze this interplay and to understand the evolution of the RG flow diagram of the system upon lowering the dimensionality from $d=3$ to $d=2$ in a nonperturbative RG framework, which allows for an (approximate) capturing of the essential features both in $d=2$ and $d=3$ and resolving the rich crossover phenomena. The paper is structured as follows: in Sec.~II we set the context for the present study by giving an overview of the most important results obtained earlier for this system within different approaches both in $d=3$ and $d=2$ . In Sec.~III we present the formulation of the model applied in our analysis, while in Sec.~IV we review the nonperturbative RG framework which is followed by derivation and discussion of the RG flow equations. Certain features of the system can be elucidated from the analysis of the asymptotic forms of flow equations. In Sec.~V we present our results obtained from the numerical integration of the RG equations in a simple truncation varying dimensionality between $d=2$ and $d=3$. We give a summary of our results in Sec.~VI. \section{Overview of key earlier results} In their seminal paper\cite{Jose_1977} Jos\'e \textsl{ et al } analyzed the two-dimensional $XY$ model to which they added $p$-fold anisotropy terms of the form $\sum_{\bf{i}} h_p \cos (p\theta_{\bf i})$, where $\bf i$ enumerates the lattice sites, $\theta_{\bf i}$ is the corresponding angular variable, while $p$ characterizes the anisotropy field. Relying on the Villain approximation they investigated the relevance of the symmetry-breaking perturbations $h_p$ along the line $h_p=0$ in the low-$T$ (KT) phase. They found \begin{equation} 4\leq 2\pi K_{eff}\leq\frac{1}{4}p^2 \label{T_KT} \end{equation} as the condition for the stability of the spin-wave theory with respect to a $p$-fold degenerate perturbation and vortices. In the above $K_{eff}$ is the renormalized stiffness. The first inequality yields the usual KT instability temperature. The relation (\ref{T_KT}) implies the existence of a KT-like phase for a regime of temperatures also for nonvanishing anisotropy field $h_p$ provided $p>4$. For $p=4$ this regime becomes degenerate (for given value of $h_4$) to a single point. The emergent picture yields (at least for small $h_4$) a marginal operator associated with the presence of the anisotropy. As a result Jos\'e \textsl{ et al } predicted nonuniversal exponents along the transition line in the $(T-h_4)$ plane. Significantly later the two-dimensional $XY$ model with cubic anisotropies was addressed by extensive Monte-Carlo (MC) simulations\cite{Rastelli_2004_1, Rastelli_2004_2} performed on the square lattice $XY$ model. These studies confirmed the nonuniversal character of the critical exponents along the transition line for $h_4\neq 0$, but, interestingly, disagreed with Ref.~\onlinecite{Jose_1977} on the very structure of the phase diagram, pointing towards the stability of the KT phase for sufficiently low $h_4$ and yielding a picture similar to that obtained for higher values of $p$. Another controversial aspect concerns the range of conceivable values of critical exponents for this class of models. In particular, Ref.~\onlinecite{Jose_1977} predicted the divergence of the order parameter exponent $\beta$ for vanishing $h_4$ ($\beta\sim h_4^{-1}$), so that in principle the set of allowed values of $\beta$ is unbounded from above. However,\cite{Taroni_2008} experimentally observed values fall within a window $\beta\in [1/8,0.23]$ and point towards the existence of an upper bound on $\beta$. Ref.~ \onlinecite{Taroni_2008} attributed this to suppression of the predicted nonuniversal criticality by finite-size scaling properties of the 2-dimensional XY model and identified the value $\beta\approx 0.23$ as the effective critical exponent of the pure XY model due to finite system size. The length scale of the onset of the true critical singularities at small $h_4$ is then extremely large and at realistic system sizes, they become overshadowed by the KT-type scaling. Our present study is consistent with this point of view. For $d=3$ the XY model with cubic anisotropies was (presumably) first addressed by Aharony\cite{Aharony_1973} within the $\epsilon$ expansion. The perturbative RG approach for this system was later significantly developed by Carmona \textsl{ et al}.\cite{Carmona_2000} In particular, they identified the fixed points present in the phase diagram and investigated their stability upon varying the number of field components. In a relatively recent study\cite{Leonard_2015} L\'eonard and Delamotte employed nonperturbative RG to address a generic mechanism leading to distinct exponents characterizing the critical behavior approaching the transition from high and low temperatures. They analyzed the $O(2)$ model with discrete anisotropies as an illustrative example of this phenomenon, which had long before been observed by Nelson.\cite{Nelson_1976} In the present work we employ a framework similar to Ref.~\onlinecite{Leonard_2015} to investigate the evolution of the system as the dimensionality of the system is reduced from $d=3$ anticipating the appearance of nonuniversal critical features for dimensionality $d$ approaching 2.\cite{Codello_2013} \section{Model} We consider the $d$-dimensional classical $O(2)$ model supplemented with a cubic anisotropy term \begin{align} &S[\phi] = \int d \bm{r} \left[\frac{u_0}{8}(2\rho - \alpha_0^2)^2 + \frac{\lambda_0}{2} \tau + \frac{1}{2} |\nabla\phi|^2 \right]. \label{Bare_action} \end{align} with a (real) two-component order-parameter field $\phi=\phi(\bm{r})=(\phi_1(\bm{r}), \phi_2(\bm{r}))$. The $O(2)$ invariant $\rho$ and the $\mathbb{Z}_4$ invariant $\tau$ are defined as follows \begin{equation} 2\rho = |\phi|^2 =\phi_1^2 +\phi_2^2\;,\;\;\;\;\; \tau = \phi_1^2\phi_2^2\;. \label{Invariants} \end{equation} The uniform contribution involves two quartic couplings: the usual $O(2)$ coupling $u_0$ and the anisotropy strength $\lambda_0$. We observe that Eq.~(\ref{Bare_action}) is invariant under a rotation of the field $\phi$ by $\frac{\pi}{4}$ followed by the transformation $u_0' = u_0+\lambda_0$, $\lambda_0'=-\lambda_0$, $\alpha_0'^2 = \alpha_0^2 \frac{u_0'}{u_0}$. In consequence (for $|\lambda_0|<u_0$), we can assume $\lambda_0>0$ without loss of generality. We concentrate on the situation with symmetry-breaking at mean-field (MF) level, where $\alpha_0^2>0$. The units are chosen so that the coefficient of the gradient term in Eq.~(\ref{Bare_action}) is $\frac{1}{2}$. Note that our definition of $\tau$ differs from that of Refs.~\onlinecite{Carmona_2000, Leonard_2015} which adopted $\tau=\phi_1^4+\phi_2^4$. The two definitions correspond to picking reference frames related by a rotation. One advantage of the present choice is that the minima of the effective potential $U(\rho,\tau)=\frac{u_0}{8}(2\rho - \alpha_0^2)^2 + \frac{\lambda_0}{2} \tau$ are located on the lines $\phi_1=0$ and $\phi_2=0$ as illustrated in Fig.~1. In the absence of the anisotropy ($\lambda_0=0$) Eq.~(\ref{Bare_action}) reduces to the standard $O(2)$ model, which may exhibit long-range order only for $d>2$.\cite{Mermin_1966} The algebraic KT phase occurs for $d=2$ if $\alpha_0^2$ is sufficiently large. As soon as $\lambda_0>0$, the $O(2)$ degeneracy of the ground-state becomes reduced to discrete fourfold degeneracy as illustrated in Fig.~1, and the occurrence of true long-range order is then permissible down to dimensionality $d=1^+$. \begin{figure} \begin{subfigure}[b]{0.23\textwidth} \includegraphics[width=\textwidth]{iso.png} \end{subfigure} % \begin{subfigure}[b]{0.23\textwidth} \includegraphics[width=\textwidth]{aniso.png} \end{subfigure} \caption{(Color online) Contour plots of the effective potential for the pure $O(2)$ model (left panel) and the $O(2)$ model with a $\mathbb{Z}_4$ anisotropy $\tau$ given by Eq.~(\ref{Invariants}) (right panel). In the latter case the ground state is fourfold degenerate with the minima located at the $\phi_1=0$ and $\phi_2=0$ axes. } \end{figure} \section{Nonperturbative RG approach} We employ the 1-particle irreducible variant of non-perturbative renormalization theory to investigate the model defined by Eq.~(\ref{Bare_action}). This is very suitable for the present problem, allowing for capturing the distinct scaling regimes and associated crossover behavior as the system is evolved from the short to long observation scales. We consider the flowing effective action $\Gamma_k[\phi]$, which interpolates between the bare action [Eq.~(\ref{Bare_action})] and the thermodynamic free energy $G[\phi]$ as the flow parameter $k$, implemented as an infrared momentum cutoff, is reduced from the UV cutoff scale $k=\Lambda$ towards zero. The quantity $\Gamma_k[\phi]$ also acts as the generating functional for 1-particle irreducible vertex functions in presence of the IR regulator. The idea to continuously integrate fluctuations out of the partition function via the RG flow is implemented by deforming the propagators so that the fluctuation modes with momentum lower then the cutoff scale ($q<k$) acquire an artificial mass of order $k^2$. The scale $k$ may then be continuously varied leading to the evolution of $\Gamma_k[\phi]$ governed by the Wetterich equation\cite{Wetterich_1993} \begin{equation} \partial_t\Gamma_k[\phi] = \frac{1}{2}\textrm{Tr}\left\{\partial_t R_k \left[\Gamma_k^{(2)}[\phi] +R_k\right]^{-1}\right\}\;, \label{Wetterich} \end{equation} where $\Gamma_k^{(2)}[\phi]$ is the second field derivative of $\Gamma_k[\phi]$ and $R_k$ denotes the cutoff function added to the inverse propagator to damp the modes with $q<k$. The trace sums over momenta and field components, while $t=\log(k/\Lambda)$. The Wetterich framework was successfully used in a diversity of contexts over the last years (for reviews see e.g.~\onlinecite{Berges_2002, Pawlowski_2007, Kopietz_book, RG_book, Metzner_2012}). The functional differential equation given by Eq.~(\ref{Wetterich}) can hardly ever be solved exactly. Here we resort to the approximation scheme known as the derivative expansion.\cite{Berges_2002, Canet_2003, Delamotte_2004, RG_book} This classifies the symmetry-allowed terms in $\Gamma_k[\phi]$ according to the number of derivatives (or momentum powers in Fourier space). We parametrize $\Gamma_k[\phi] $ as \begin{equation} \Gamma_k[\phi] = \int d\bm{r}\left\{U_k(\rho,\tau) + \frac{1}{2}Z_k|\nabla\phi|^2+\frac{1}{8}Y_k(\nabla |\phi|^2)^2 \right\}\;, \label{Gamma} \end{equation} where we neglect the dependence of $Z_k$ and $Y_k$ on $\rho$ and $\tau$. In the low-temperature phase the the effective potential features four degenerate minima corresponding to the ground states. In the present simple truncation we parametrize $U_k(\rho,\tau)$ by expanding around one of them up to the lowest sensible order \begin{equation} U_k(\rho,\tau) = \frac{u_k}{2}(\rho-\rho_{0,k})^2+\frac{\lambda_k\tau}{2}\;, \label{U_truncation} \end{equation} where $\rho_{0,k}=\frac{1}{2}\alpha_k^2$ describes the flowing distance of the minimum from the origin. This approximation level allows for a degree of analytical understanding of the flow and for a rather straightforward resolution of the crossover behavior by direct integration of the RG equations. Within the approximation defined by Eqs.~(\ref{Gamma}) and (\ref{U_truncation}) the problem of integrating Eq.~(\ref{Wetterich}) becomes reduced to the analysis of a set of five coupled integro-differential equations governing the flow of the couplings $\{\alpha_k^2, u_k, \lambda_k, Z_k, Y_k\}$. In $d=3$ an analogous approach was employed in Ref.~\onlinecite{Leonard_2015} with major focus on the hexagonal rather than cubic anisotropy. In that work the effective potential expansion [Eq.~\ref{U_truncation}] was pushed to higher order. This (at least for the pure $O(N)$ models) allows for obtaining results convergent to the complete derivative expansion for $d$ close to 3 (but not for $d$ approaching 2). On the other hand, we retain the $Y_k$ coupling in the present treatment. This is known\cite{Jakubczyk_2017_2} to significantly improve the quality of the approximation for $d=2$. On the technical level, accounting for $Y_k$ distinguishes between momentum-dependent terms in the longitudinal and transverse directions. The present functional RG truncation does not explicitly invoke vortices.\cite{Kosterlitz_1973} In consequence, for $\lambda=0$ the line of fixed points in the low-$T$ phase is recovered only approximately in the form of quasi-fixed points unless the regulator is fine tuned.\cite{Jakubczyk_2014} This issue was first investigated in Refs.~\onlinecite{Graeter_1995, Gersdorff_2001}, and recently was revisited in a sequence of works\cite{Jakubczyk_2014, Defenu_2017, Krieg_2017, Jakubczyk_2017_2} providing insightful understanding of the flow and proposing avenues for improvements. In particular, Ref.\onlinecite{Krieg_2017} showed how the hierarchy of functional RG flow equations can be reduced to the Kosterlitz-Thouless RG equations. On the other hand, the functional RG framework serves as a particularly convenient tool in situations involving rich crossover phenomena.\cite{Strack_2009, Jakubczyk_2010, Leonard_2015, Lammers_2016, Debelhoir_2016, Rancon_2017} and (at the cost of working at truly functional level) is capable of computing also nonuniversal aspects of specific microscopic models.\cite{Machado_2010, Jakubczyk_2016} With the parametrization specified by Eqs.~(\ref{Gamma}) and (\ref{U_truncation}) the regularized propagator is given by \begin{equation} \left[\Gamma_k^{(2)}\right]^{-1}_{i,j}=G_{i}(\bm{q}) = \frac{\delta_{i,j}}{m_{i}^2 + Z_{i} \bm{q}^2 + R_k(\bm{q}^2)}\;, \end{equation} where $i,j\in\{1,2\}$. In our convention $i=1$ corresponds to the longitudinal and $i=2$ to the transverse mode. The flowing masses and $Z$-factors are given by \begin{alignat}{2} &m_1^2 = u \alpha^2\;, \hspace{2cm} &&m_2^2 = \lambda \alpha^2\;, \\ &Z_1 = Z + Y\alpha^2\;, &&Z_2 = Z \nonumber\;. \end{alignat} We suppressed the $k$-dependencies in our notation for clarity. We observe that the essential role of the anisotropy coupling $\lambda$ is to give the transverse mode a mass. At the level of higher-order vertex functions one can easily show that $\lambda$ will influence the vertices with an even number of transverse legs. We also introduce the single-scale propagators \begin{equation} G_{i}'(\bm{q}) = -G_{i}^2 \partial_t R\;. \end{equation} and the operator $D_t=(\partial_t R) \partial_R$\;. \subsection{Flow equations} The derivation of the flow equations follows a standard procedure (see e.g. Ref.~\onlinecite{Berges_2002}). The flow of $\alpha^2$ is extracted from the condition $\frac{d}{dt}U'(\rho,\tau)|_{\rho=\alpha^2/2,\tau=0} =0$. The flow of the masses follows from first differentiating Eq.~(\ref{Wetterich}) twice with respect to the field $\phi_i$, and evaluating at a uniform field configuration, thus deriving a flow equation for the longitudinal and transverse components of $\Gamma_k^{(2)}$. Subsequently, taking the limit $q\to 0$ yields the flow of the masses $m_i^2$. The flow of $Z_1$ and $Z_2$ is obtained from expanding the flow of $\Gamma_k^{(2)}$ in the external momentum and picking the coefficients of order $q^2$. The resulting flow equation for $\alpha^2$ reads: \begin{equation} \partial_t{\alpha^2} = -\frac{1}{u} \int_{\bm{q}}\left[(u+2U(\bm{q}))G_1'(\bm{q}) +(u+2\lambda)G_2'(\bm{q})\right]\;, \end{equation} while the flow of the masses is given by \begin{align} \partial_t{m^2_1} =& - \int_{\bm{q}}\left[(u+2U(\bm{q})) G_1'(\bm{q}) + (u+2\lambda) G_2'(\bm{q}) \right] \\ &- \alpha^2 \int_{\bm{q}}\left[(u + 2U(\bm{q}))^2 G'_1(\bm{q})G_1(\bm{q}) + (u+ 2\lambda)^2 G'_2(\bm{q})G_2(\bm{q})\right], \nonumber \\ \partial_t{m^2_2} =& -\frac{ m_2^2}{m_1^2} \int_{\bm{q}}\left[(u+2U(\bm{q}))G_1'(\bm{q}) +(u+2\lambda)G_2'(\bm{q})\right] \\ &- 3m_2^2 \int_{\bm{q}}(2U(\bm{q}) + \lambda) D_t (G_1(\bm{q})G_2(\bm{q}))\;. \nonumber \end{align} We introduced $\int_{\bm{q}}=\int\frac{d\bm{q}}{(2\pi)^d}$ and $U(\bm{q})=u+Y\bm{q}^2$. We relegate the expressions for the flow of $Z$-factors to the appendix. Upon putting $\lambda=0$ we recover the flow equations well studied for the $O(2)$ model.\cite{Berges_2002, Dupuis_2011, RG_book, Jakubczyk_2017_2} The presence of the mass of the transverse mode underlies the mechanism discussed in Ref.~\onlinecite{Leonard_2015} responsible for generating the unequal critical exponents in the low- and high-temperature phases. There is a clear asymmetry between the properties of the flow of the two masses. If $m_2^2=0$ at some scale, it will never be generated. The converse is obviously not true. It is worth noting that when putting $\lambda=u$, $Y=0$ the flow equations of the longitudinal and transverse masses become identical and the property $\lambda=u$ remains conserved by the flow. Moreover, the resulting equations are equivalent to the corresponding flow of the Ising [$O(1)$] universality class (at the same level of approximation). This means, that if (initially) $\lambda=u$, the phase transition is bound to fall in the Ising universality class. This conclusion holds true also beyond the present approximation level and at any dimensionality. This is also consistent with the results of Ref.~\onlinecite{Carmona_2000}, which identified an Ising-type fixed point in the flow diagram. Another simplification occurs in the high-anisotropy limit $\lambda\to\infty$, where the transverse fluctuations are suppressed. It is then easily shown that the flow of $\alpha$, $u$ and $Z_{\sigma}$ is equivalent that corresponding to the $O(1)$ model. We note however that the present truncation level is probably not quite reliable to address the regime of strong anisotropies and postpone this case to future studies. In $d=2$ and for $\lambda=0$ the IR scaling of the Goldstone propagator follows $G_2\sim k^{2-\eta}$. Its coupling to the longitudinal mode gives rise to similar asymptotic IR scaling of the longitudinal mode $G_1$ as well. This behavior becomes suppressed by the presence of the anisotropy $\lambda$, which is a relevant coupling for low $T_{eff}=\alpha_0^{-2}$ and destabilizes the KT-like phase towards formation of long-ranged order. For small $\lambda_0$ this effect may occur only at asymptotically low scales. For $T_{eff}$ approaching the critical value (and small $\lambda_0$) the flow exhibits very slow evolution controlled by KT (quasi)fixed point line before crossing over to another regime, controlled by another (quasi)fixed point line. This is demonstrated by the numerical solution presented in the next section. In the following we will work with the dimensionless variables defined as \begin{align} \label{rescaling} \tilde \kappa = k^{2-d} Z \alpha^2, \hspace{0.1cm} \tilde u = k^{d-4} Z^{-2} u, \hspace{0.1cm} \tilde \lambda = k^{d-4} Z^{-2} \lambda, \hspace{0.1cm} \tilde Y = k^{d-2} Z^{-1} Y\;, \end{align} in terms of which fixed-point behavior is transparent. \subsection{Note on the scaling laws} Presence of the dangerously irrelevant coupling $\lambda$ influences the scaling laws relating the critical exponents which characterize the correlation functions. We rederived these relations following the line of reasoning of Ref.~\onlinecite{Leonard_2015} (see also \onlinecite{Okubo_2015}). We obtained \begin{align} \label{full_scaling} &\nu' = \nu (1 + y/2)\;, \\ &\gamma^+ = \nu(2-\eta)\;, \nonumber\\ &\gamma_T = \gamma^+ + \nu y\;, \nonumber\\ &\gamma_L = \gamma^+ + \nu y \frac{4-d-\eta}{2}\;, \nonumber \end{align} where $\gamma_T$, $\gamma_L$ are the critical exponents for the transverse and longitudinal susceptibilities, $\gamma^+$ controls the susceptibility divergence when the critical point is approached from the high-temperature phase, $\eta$ is the anomalous dimension, while $y$ is the scaling exponent for $\lambda$ at the $XY$ fixed point (i.e. $\tilde{\lambda}\sim k^y$). The quantities $\nu$ and $\nu'$ denote the critical exponent for the longitudinal and transverse correlation lengths. Eq.~(\ref{full_scaling}) are valid for arbitrary anisotropies (not necessarily cubic) and for any $d$ provided $\lambda$ remains an irrelevant variable. The last of the relations of Eq.~(\ref{full_scaling}) differs from the form given in Ref.~\onlinecite{Leonard_2015} by the $\eta$ present in our expression. The modification of the scaling laws as compared to the pure $O(N)$ case may be traced back to the fact that there exist two large length scales associated to the two directions in the field space. They are determined by the RG scales at which the flow departs from the $XY$ and the low-temperature fixed points respectively.\cite{Leonard_2015} The latter scale is always infinite in the absence of anisotropies. Observe that,\cite{Leonard_2015} quite counterintuitively, the difference between the susceptibility exponents grows upon increasing $y$ so that the less relevant the perturbation, the larger the difference between the critical indices and the deviation from the isotropic case. \section{Integration of the RG flow} We now present the results obtained from numerical integration of the flow equations in the simple truncation defined in Sec.~IVA. We implement the exponential cutoff\cite{Berges_2002} \begin{equation} R_k(\bm q^2) = A \frac{Z_k \bm q^2}{e^{\bm q^2/k^2}-1}\;, \end{equation} where we take $A=2$.\cite{Jakubczyk_2014} We solve the flow equations discussed in Sec.~IVA with the initial condition provided by Eq.~(\ref{Bare_action}). We identify the ordered phase by the condition $\lim_{k\to 0}\alpha^2>0$. On the other hand, for the high-temperature phase the flowing order parameter $\alpha$ reaches zero at a finite value of $k$. For a given fixed initial value of $u=u_0$ we evaluate the critical line $\lambda_{0,u}(\alpha_0)$. The quantity $\alpha_0^{-2}=T_{eff}$ may be understood as an effective temperature of the model. From the analysis of the flow equations in Sec.~IVA it is clear that precisely one point (corresponding to $\lambda_0=u_0$) on the continuum of the critical line is a representative of the Ising universality class. Except for this the critical behavior in $d=3$ is controlled by the Wilson-Fisher fixed point with the dangerously irrelevant coupling $\lambda$, while in $d=2$ one expects the fixed-point line discussed in Ref.~\onlinecite{Jose_1977}. It is perhaps of particular interest to understand the relation between this fixed-point line and the distinct Ising fixed point.\subsection{Results in $d=3$} In Fig.~1 we present the phase diagrams computed for the model defined by Eq.~(\ref{Bare_action}) in the simple truncation in $d=3$ for a sequence of values of $u_0$. \begin{figure}[ht] \begin{center} \label{Fig2} \includegraphics[width=8.5cm]{3d.png} \caption{(Color online) The critical line $\lambda_{0,u}(\alpha_0)$ computed for a sequence of values of $u_0$ in $d=3$. For low anisotropies the critical value of $T_{eff}$ is practically constant. The sudden drop of $T_{eff}$ occurs at $\lambda_0\approx u_0$, where the transition is in the Ising universality class. The same feature occurs for $d=2$ (see Fig.~6). } \end{center} \end{figure} A striking (and counterintuitive) feature is the sudden drop of $T_{eff}$ at larger values of $\lambda_0$, precisely corresponding to $\lambda_0= u_0$, where the transition is in the Ising universality class. This feature of the phase diagram is understood from the flow by observing that the position of the Ising and $XY$ fixed points in the flow diagram are very different. The pronounced decrease of $T_{eff}$ upon rising $\lambda_0$ towards $u_0$ is then a consequence of continuity of the flow. Fig.~2 provides an example manifestation of crossover of a \emph{ nonuniversal} thermodynamic quantity (the critical line) due to an interplay between two RG fixed points. The magnitude of this effect depends strongly on the value of $u_0$. Another manifestation of this crossover behavior is identified by inspecting the critical exponents. As an illustrative example in Fig.~3 we plot the transverse mass as function of $T^c_{eff}-T_{eff}$ and observe the crossover of the corresponding critical exponent $\gamma_T$ between two values related to the Ising and $XY$ fixed points. \begin{figure}[ht] \begin{center} \label{} \includegraphics[width=8.5cm]{powerlaw.png} \caption{(Color online) Renormalized transverse mass $m_2$ (inverse transverse susceptibility) as function of $T^c_{eff}-T_{eff}$ for a sequence of values of $\lambda_0$ and $u_0=1$. Upon varying $\lambda_0$ away from $\lambda_0=u_0$ the corresponding exponent $\gamma_T$ crosses over from the Ising behavior (the upper, blue curve) to the XY value.} \end{center} \end{figure} Crossover behavior manifests itself also by varying the observation scale. For the present situation we exemplify this in Fig.~4 by plotting the anomalous dimension $\eta$ versus the cutoff scale. It exhibits two scaling plateaus describing the Ising and XY universality classes. The specific values of $\eta$ are off the accurate ones by a factor of order 2, which is due to truncation (see e.g. Ref.~\onlinecite{Strack_2009} for comparison). \begin{figure}[ht] \begin{center} \label{} \includegraphics[width=8.5cm]{seta.png} \caption{(Color online) The flowing anomalous dimension $\eta$ as function of the renormalization scale $s=\log(\Lambda/k)$. The plot shows two scaling plateaus described the the Ising (the upper curve) and XY universality classes. For the illustration we chose the quartic coupling $u_0=5$ close to its fixed point value. } \end{center} \end{figure} Leaving aside the Ising-XY crossover we now demonstrate the effect of the anisotropy on the RG flow in the low-$T$ phase.\cite{Leonard_2015} Fig.~5 illustrates the crossover between the scaling behavior controlled by the critical XY (Wilson-Fisher) and the low-$T$ (Nambu-Goldstone) fixed points (both located at $\tilde{\lambda}=0$). We plot the flow of $\tilde{u}$ and $\tilde{Y}$, where the fixed-point behavior is clearly visible. \begin{figure} \begin{subfigure}[b]{0.23\textwidth} \includegraphics[width=\textwidth]{su.png} \end{subfigure} % \begin{subfigure}[b]{0.23\textwidth} \includegraphics[width=\textwidth]{syd3.png} \end{subfigure} \caption{(Color online) Illustration of the crossover between the behavior controlled by the critical XY and the low-$T$ fixed points. For an initial condition somewhat below the critical temperature the flow first converges to the vicinity of the Wilson-Fisher fixed point, from which it departs at a scale $k$ of order of the inverse correlation length $\xi^{-1}$ of the longitudinal mode. The subsequent part of the flow is controlled by the $T=0$ fixed point, which, for $\lambda=0$, is never left down to $k=0$. However, if $\lambda\neq 0$, the flow departs from this fixed point at another critical scale $k=\xi'^{-1}$ related to the transverse mode. The presence of these two scales divergent at the phase transition forms the basis of the generic mechanism leading to distinct critical exponents in the low- and high-temperature phases.\cite{Leonard_2015} } \end{figure} For an initial condition somewhat below the critical temperature the flow first converges to the vicinity of the Wilson-Fisher fixed point, from which it departs at a scale $k$ of order of the inverse correlation length $\xi^{-1}$ of the longitudinal mode. The subsequent part of the flow is controlled by the Nambu-Goldstone fixed point, which, for $\lambda=0$, is never left down to $k=0$. However, if $\lambda\neq 0$, the flow departs from this fixed point at another critical scale $k=\xi'^{-1}$ related to the transverse mode. The presence of these two scales divergent at the phase transition is the source of the generic mechanism leading to distinct critical exponents in the low- and high-temperature phases.\cite{Leonard_2015} In the next section, we discuss evolution of this picture when dimensionality is changed to $d=2$, where, according to earlier studies, one expects a deformation of the flow diagram involving appearance of distinct fixed-point lines describing the KT phase and the phase transition at $\lambda\neq 0$. \subsection{Results in $d=2$} We now discuss the results obtained in the simple truncation for $d=2$. We recall\cite{Graeter_1995, Gersdorff_2001, Jakubczyk_2014, Defenu_2017, Jakubczyk_2017_2} that the present approach does not \emph{stricto sensu} capture the KT phase transition, which (due to approximation) is rounded to a very sharp crossover. The correlation length becomes huge (but is still finite) and the KT line of fixed points is visible as a ''quasi-fixed'' point line, where the flow becomes very slow, but ultimately, at very large RG times, ends up in the high-temperature phase. A similar phenomenon occurs, in the present truncation for the fixed-point line at $\lambda>0$. We begin with plotting the phase diagram - see Fig.~6, which may be compared to the case of $d=3$. \begin{figure}[ht] \begin{center} \label{} \includegraphics[width=8.5cm]{2d.png} \caption{(Color online) The critical line $\lambda_{0,u}(\alpha_0)$ computed for a sequence of values of $u_0$ in $d=2$. The sudden drop of $T_{eff}$ occurs precisely at $\lambda_0\approx u_0$, where the transition is in the Ising universality class. The effect is similar to the one observed for $d=3$ (see Fig.~2). } \end{center} \end{figure} The behavior of the critical line at $\lambda_0\approx u_0$ is very similar to the case $d=3$ and may be understood as a signature of the Ising fixed point. For small $\lambda$ our result apparently indicates an approach of $T_{eff}$ towards a constant value, which is consistent with the results of Ref.~\onlinecite{Jose_1977} obtained from the Villain model. However, within an alternative (presumably less reliable) approach based on the Migdal transformation, Ref.~\onlinecite{Jose_1977} provided another estimate of the critical line: \begin{equation} \label{migdal} \lambda^c_p(T) \propto e^{-A T^2 e^{B/T}}, \end{equation} which is not possible to exclude using our numerical data. As concerns the flow, a schematic illustration of the picture emergent in our approximation is presented in Fig.~7. \begin{figure} \begin{subfigure}[b]{0.23\textwidth} \includegraphics[width=\textwidth]{kappalambda_diagram.png} \end{subfigure} % \begin{subfigure}[b]{0.23\textwidth} \includegraphics[width=\textwidth]{ulambda_diagram.png} \end{subfigure} \caption{A schematic illustration of the picture obtained within the present approximation in $d=2$. The flow diagram features two (quasi)fixed point lines, which, in an exact calculation should turn into exact fixed points. The line located at $\tilde{\lambda}=0$ corresponds to the algebraic KT phase. The line emerging towards large $\lambda$ characterizes the critical points with non-universal exponents. A system tuned to criticality approaches the line and exhibits a very slow flow along it. A single point on this line corresponds to an exact fixed point. The locus $\tilde{\lambda}=\tilde{u}$ is controlled by the Ising fixed point, completely detached from the (quasi)fixed point line. } \end{figure} In addition to the KT (quasi)fixed point line at $\tilde{\lambda}=0$ we identify a similar line extending towards large $\lambda$. A system tuned to the critical point (at some $\lambda_0>0$) approaches the line, and exhibits a regime of very slow flow along the line. We note that the entire (quasi)fixed line is located in the regime $\tilde{\lambda}<\tilde{u}$. The regime $\lambda_0>u_0$ is beyond the scope of the present study. The behavior of the system for the special choice of the initial condition $\lambda_0=u_0$ (and $\alpha_0$ tuned to the critical value) corresponds to the Ising universality class in full analogy to the case of $d=3$. However, for small $\lambda_0$ an intermediate $KT$ scaling sets in so that the flow first proceeds along the KT line and crosses over to the scaling controlled by the line at $\tilde\lambda$ only at low scales. This crossover scale diverges for small $\lambda_0$. This behavior is well illustrated in Fig.~8, where we plot $\tilde{u}$ versus the cutoff scale. \begin{figure}[ht] \begin{center} \label{} \includegraphics[width=8.5cm]{su_d2.png} \caption{(Color online) Flow of $\tilde{u}$ for a sequence of values of the initial anisotropy coupling. For sufficiently low $\lambda_0$ (e.g. the lowest, blue curve) the flow rapidly approaches the KT (quasi)fixed point line and remains in its vicinity for a substantial RG time. Subsequently it crosses over to the behavior governed by the finite $\tilde\lambda$ (quasi)fixed point line from which it ultimately departs due to numerical limitations. The crossover scale diverges for $\lambda_0\to 0$. For sufficiently large $\lambda_0$ the KT scaling is not visible and the flow immediately runs towards the finite $\tilde\lambda$ fixed-point line (see e.g. the highest, green curve). } \end{center} \end{figure} In an exact calculation we expect exact fixed-point behavior along the line at $\tilde\lambda>0$ in accord with Ref~\onlinecite{Jose_1977}. Note however, that the existence of this line is fully established only for small anisotropies. The other worthwhile observation is that the (quasi)fixed point line obtained by us is located for $\tilde\lambda$ significantly smaller than $\tilde u$. The two (quasi)fixed point lines are well identified in the flow diagram in the $(\tilde\lambda, \tilde{\kappa}^{-1}, \tilde u)$ space, and we present the projections in Figs.~9 and 10. \begin{figure} \begin{subfigure}[b]{0.23\textwidth} \includegraphics[width=\textwidth]{ukappa.png} \end{subfigure} % \begin{subfigure}[b]{0.23\textwidth} \includegraphics[width=\textwidth]{ulambda.png} \end{subfigure} \caption{(Color online) Projections of the numerically obtained RG flow diagrams demonstrating the (quasi)fixed point lines. (Compare to Fig.~8.) The (almost) vertical locus represents the KT fixed point line, which crosses over to the tilted line followed by all the plotted curves, corresponding to the finite $\tilde\lambda$ fixed-point line. In the final part of the flow the curves depart from the (quasi)fixed point line and go into the low-$T$ phase. } \end{figure} Generically, all the critical flows converge to one universal line in the $(\tilde\lambda, \tilde{\kappa}^{-1}, \tilde u)$ space, which they follow up to a point determined by numerical accuracy of tuning to the critical point and integrating the flow. The crossover scale between the KT and critical (finite $\tilde{\lambda}$) behavior diverges for $\lambda_0\to 0$. It is not hard to imagine pushing it to values way below the scale controlled by the system size in simulations. This explains the presence of the (apparent) KT phase in Monte-Carlo data. \begin{figure}[ht] \begin{center} \label{} \includegraphics[width=8.5cm]{tlambda.png} \caption{(Color online) Projection of the RG flows from Fig.~9 on the $(\tilde{\kappa}^{-1}, \tilde{\lambda})$ plane. } \end{center} \end{figure} We finally discuss the critical exponents. The values obtained at the present approximation level may serve only as crude estimate. The applied approximation level allows however for observing signatures of nonuniversality. This is demonstrated by plotting the transverse and longitudinal susceptibility exponents as function of anisotropy in Fig.~11. The obtained values are (almost) equal and vary with $\lambda_0$. This is contrasted to the results obtained in $d=3$, where the exponents are (as expected) different from each other and independent of $\lambda_0$. \begin{figure} \begin{subfigure}[b]{0.23\textwidth} \includegraphics[width=\textwidth]{gamma2d.png} \end{subfigure} % \begin{subfigure}[b]{0.23\textwidth} \includegraphics[width=\textwidth]{gamma3d.png} \end{subfigure} \caption{Transverse and longitudinal susceptibility exponents as function of anisotropy $\lambda_0$ for $d=2$ (left panel) and $d=3$ (right panel). In $d=2$ the obtained exponents are (almost) equal, but show dependence on $\lambda_0$. In $d=3$ the two exponents are different, but universal. The range of $\lambda_0$ is chosen small to avoid any possible interference with the Ising fixed point. } \end{figure} One feature concerning the limit $\lambda_0\to 0$ in $d=2$ cannot be accounted for by the present functional RG truncation. This is related to the essential singularity of the correlation length of the pure $O(2)$ model, which is not captured by the applied approximation and requires going at least to 2nd order in complete derivative expansion.\cite{Jakubczyk_2014} This deficiency has impact on the system also for $\lambda_0\neq 0$. Indeed, reasoning by continuity the nonuniversal correlation length exponent $\nu$ should diverge for vanishing $\lambda_0$. By scaling laws this implies also the divergence of the susceptibility and order parameter $\beta$ exponents. This divergence, predicted by Ref.~\onlinecite{Jose_1977} (see also Ref.~\onlinecite{Kadanoff_1977}) is not captured by the present simple truncation, and, in the present framework, requires a higher-order treatment. We leave this, together with an accurate resolution of the exponents (including the scaling exponent of the anisotropy coupling $\lambda$) to future work. \section{Summary and perspective} We employed a simple truncation of the nonperturbative renormalization group to analyze the impact of $\mathbb{Z}_4$-symmetric perturbations on the critical behavior of the $O(2)$ model in dimensionality $d=3$ and $d=2$. This allowed us to treat the two rather different situations in a unified framework and resolve the relatively complex crossover behavior arising due to the interplay of distinct RG fixed points. Both for $d=2$ and $d=3$ in the parameter space there exists a (one-dimensional) domain of attraction of the Ising fixed point, whose presence manifests itself in specific values of the critical exponents, but also via an abrupt variation of the critical temperature as function of the anisotropy coupling. In three dimensions, apart from the special situation $\lambda_0=u_0$, the flow at asymptotically low scales is controlled by the Wilson-Fisher fixed point. However, due to the presence of the dangerously irrelevant anisotropy coupling, the Goldstone mode acquires a gap and the critical exponents differ depending on the side from which the phase transition is approached.\cite{Leonard_2015} This behavior may also be understood by realizing the existence of two distinct divergent scales controlling the flow in regimes corresponding to the vicinity of the critical (XY) and the low-$T$ fixed points. Therefore, the complete picture in $d=3$ involves the interplay of three fixed points and the rich related crossover behavior. In $d=2$, in addition to the Kosterlitz-Thouless fixed point line and the abovementioned Ising fixed point, there exists a separate line of fixed points emerging towards the regime of large anisotropy couplings. Within the present treatment (in an analogy with the Kosterlitz-Thouless phase) this is captured approximately by a flow regime characterized by very slow running of the couplings in the form ot the quasi-fixed points. The RG flow finds itself between the isolated Ising fixed point and the two lines. For small anisotropy coupling the critical trajectories follow the close vicinity of the KT line down to an RG scale where they cross over to the critical fixed-point line. This crossover scale diverges for vanishing anisotropies so that the flow becomes dominated by the KT line down to extremely low RG scales. This picture gives a natural explanation of the KT-like behavior observed in Monte-Carlo simulations of the lattice $XY$ model at sufficiently small anisotropies. There are natural extensions of this work worth investigating in near future. These involve a more accurate, functional parametrization of the flowing effective action, avoiding expansion of the flowing effective potential $U_k(\rho, \tau)$ in the invariants $\rho$ and $\tau$. In $d=2$ this would allow for capturing the KT transition (including the essential singularity of the correlation length) and therefore an accurate resolution of the limit $\lambda\to 0$. We expect that such a truncation would in fact give a very accurate picture at $\lambda>0$. This is because vortices, which are hard to capture by the present approach, are actually not relevant for a description of physics at finite anisotropies. The other observation is that the existence of the line of fixed points at $\lambda\neq 0$ is firmly established only in the limit $\lambda\to 0$. The present framework (at functional level) is by no means restricted to this regime. In particular, it might be very interesting to investigate the case $\lambda_0>u_0$ and the emerging relation to the $p$-state clock models.\cite{Lapilli_2006} \begin{acknowledgments} We thank Bertrand Delamotte, Maxym Dudka, Nicolas Dupuis, and Marek Napi\'{o}rkowski for useful discussions. We acknowledge support from the Polish National Science Center via 2014/15/B/ST3/02212 and 2017/26/E/ST3/00211. \end{acknowledgments} \section*{Appendix} Here we quote the flow equations for the $Z$-factors $Z_1$ and $Z_2$ corresponding to the longitudinal and transverse modes respectively. We introduce $R^{(n,m)}(y) := \frac{d^{n+m} R_k(y)}{dy^n dk^m}$. The flow equations read: \begin{widetext} \begin{align*} \partial_k{Z_{1}} &= \frac{ Y}{ u} \int_{\bm{q}}G_1^2(\bm{q})2U(\bm{q})R^{(0,1)} + \int_{\bm{q}} G_1^3(\bm{q})\alpha^2\Bigg(\frac{1}{2} (u+2U(\bm{q}))^2(R^{(1,1)} + \frac{2}{d}\bm{q}^2R^{(2,1)}) + 2 R^{(0,1)} Y(2u+4U(\bm{q})+ \frac{2}{d} \bm q^2 Y) \\ &\hspace{5.7cm} + 2 \frac{2}{d} \bm{q}^2 Y (u+2U(\bm{q})) R^{(1,1)} \Bigg) \\ &- \int_{\bm{q}} G_1^4(\bm{q}) \alpha^2 \Bigg(2 \frac{2}{d} \bm{q}^2 (u+2U(\bm{q}))^2 (Z_1 + R^{(1,0)}) R^{(1,1)} + \frac{3}{2} (u+2U(\bm{q}))^2 (Z_1+R^{(1,0)}+\frac{2}{d}\bm{q}^2R^{(2,0)}) R^{(0,1)} \\ &\hspace{2.3cm} + 6\frac{2}{d} \bm{q}^2 (u+2U(\bm{q})) (Z_1+R^{(1,0)}) R^{(0,1)}\Bigg) \\ &+ \int_{\bm{q}} G_1^5(\bm{q}) 4 \alpha^2 \frac{2}{d}\bm{q}^2 (u+2U(\bm{q}))^2 \left(Z_1 + R^{(1,0)}\right)^2 R^{(0,1)} + \frac{ Y}{ u} \int_{\bm{q}} G_2^2(\bm{q}) (u+2\lambda)R^{(0,1)} \\ &+ \int_{\bm{q}} G_2^3(\bm{q})\alpha^2\Bigg(\frac{1}{2} (u+2\lambda)^2 \left(R^{(1,1)} + \frac{2}{d}\bm{q}^2R^{(2,1)}\right) + 2 Y(u+2\lambda)R^{(0,1)} \Bigg) \\ &- \int_{\bm{q}} G_2^4(\bm{q}) \alpha^2 (u+2\lambda)^2 \Bigg(2\frac{2}{d} \bm{q}^2 (Z_2 + R^{(1,0)}) R^{(1,1)} + \frac{3}{2} (Z_2+R^{(1,0)}+\frac{2}{d}\bm{q}^2R^{(2,0)}) R^{(0,1)}\Bigg) \\ &+ \int_{\bm{q}} G_2^5(\bm{q}) 4 \alpha^2 \frac{2}{d}\bm{q}^2 (u+2\lambda)^2 \left(Z_2 + R^{(1,0)}\right)^2 R^{(0,1)} \end{align*} and \begin{align*} \partial_k{Z_{2}} &= - \int_{\bm{q}} Y R^{(0,1)}(\bm{q}^2)G_{2}^2(\bm{q}) + \int_{\bm{q}} 6 \alpha^2 \frac{2}{d}\bm{q}^2 (2\lambda + U(\bm{q}))^2 R^{(0,1)}(\bm{q}^2) \left(Z+R^{(1,0)}(\bm{q}^2)\right)^2 G_2^4(\bm{q}) G_1(\bm{q}) \\ &+ \int_{\bm{q}} 2 \alpha^2 \frac{2}{d}\bm{q}^2 (2\lambda + U(\bm{q}))^2 R^{(0,1)}(\bm{q}^2) \left(Z+R^{(1,0)}(\bm{q}^2)\right)^2 G_2^3(\bm{q}) G_1^2(\bm{q}) \\ &- \int_{\bm{q}} 4 \alpha^2 \frac{2}{d}\bm{q}^2 (2\lambda + U(\bm{q}))^2 R^{(1,1)}(\bm{q}^2) \left(Z+R^{(1,0)}(\bm{q}^2)\right) G_2^3(\bm{q}) G_1(\bm{q}) \\ &- \int_{\bm{q}} 2 \alpha^2 (2\lambda + U(\bm{q}))^2 R^{(0,1)}(\bm{q}^2) \left(Z+R^{(1,0)}(\bm{q}^2)+\frac{2}{d}\bm{q}^2 R^{(2,0)}(\bm{q}^2)\right) G_2^3(\bm{q}) G_1(\bm{q}) \\ &- \int_{\bm{q}} \alpha^2 (2\lambda + U(\bm{q}))^2 R^{(0,1)}(\bm{q}^2) \left(Z+R^{(1,0)}(\bm{q}^2)+\frac{2}{d}\bm{q}^2 R^{(2,0)}(\bm{q}^2)\right) G_2^2(\bm{q}) G_1^2(\bm{q}) \\ &+ \int_{\bm{q}} \alpha^2 (2\lambda + U(\bm{q}))^2 (R^{(1,1)}(\bm{q}^2) + \frac{2}{d}\bm{q}^2 R^{(2,1)}(\bm{q}^2)) G_2^2(\bm{q}) G_1(\bm{q})\;. \end{align*} \end{widetext}
\section{Introduction} Premium principles based on Orlicz norms were introduced in the classical paper by Haezendonck and Goovaerts~\cite{HaezendonckGoovaerts1982} as multiplicative equivalents of the zero utility principle. The original formulation was extended by Goovaerts et al.~\cite{GoovaertsKaasDhaeneTang2004} and by Bellini and Rosazza Gianin~\cite{BelliniRosazza2008} to account for general (not necessarily positive) losses. The extended formulation is known under the name of {\em Haezendonck-Goovaerts premium principle} (or equivalently {\em Haezendonck-Goovaerts risk measure}) and has been the subject of extensive study in the literature, see Bellini and Rosazza Gianin~\cite{BelliniRosazza2009} and \cite{BelliniRosazza2012}, Goovaerts et al.~\cite{GoovaertsKaasDhaeneTang2012}, Mao and Hu~\cite{MaoHu2012}, Tang and Yang~\cite{TangYang2012} and \cite{TangYang2014}, Zhu et al.~\cite{ZhuZhangZhang2013}, Ahn and Shyamalkumar~\cite{AhnShyamalkumar2014}, Peng et al.~\cite{PengWangZheng2015}, Wang and Peng~\cite{WangPeng2016}, Liu et al.~\cite{LiuPengWang2017}, Wang et al.~\cite{WangLiuHouPeng2018}. We also refer to the general survey by Goovaerts and Laeven~\cite{GoovaertsLaeven2008} and to the recent paper by Bellini et al.~\cite{BelliniLaevenRosazza2018} where an axiomatization of Orlicz premia in terms of acceptance sets is established. \smallskip As already pointed out in the original work by Haezendonck and Goovaerts~\cite{HaezendonckGoovaerts1982}, the natural model space for such premium principles are Orlicz spaces. Perhaps influenced by the earlier framework of risk measure theory, the bulk of the later literature following~\cite{HaezendonckGoovaerts1982} has developed the theory of Haezendonck-Goovaerts premium principles for bounded losses. In Bellini and Rosazza Gianin~\cite{BelliniRosazza2012} the authors go beyond the bounded setting and focus on a general Orlicz space. However, their main results, most notably their dual representation, are only valid in a special class of Orlicz spaces, which are characterized by Orlicz functions satisfying the growth condition known as {\em $\Delta_2$ condition} in the literature. In this special case, the Orlicz space allows for a tractable duality theory, see e.g.\ Cheridito and Li~\cite{CheriditoLi2008,CheriditoLi2009}. \smallskip Since the Orlicz function defining the premium principle in its original formulation originates from a general (von Neumann-Morgenstern) utility function, there is {\em a priori} no legitimate restriction on the Orlicz function and, thus, on the corresponding Orlicz space. In this short note, we aim to fill this gap and provide a full picture on the stability properties and dual representation of Haezendonck-Goovaerts premium principles defined on a general Orlicz space. Most notably, we prove that Haezendonck-Goovaerts premium principles always satisfy the Fatou property and characterize when they satisfy the stronger Lebesgue property. As a consequence, we can exploit some recent results on functionals on Orlicz spaces, see Gao et al.~\cite{GaoLeungMunariXanthos2017}, to establish tractable dual representations of Haezendonck-Goovaerts premium principles without requiring the $\Delta_2$ condition. In addition, we investigate (semi)continuity properties with respect to the $\Phi$-weak convergence of probability measures. We show that $\Phi$-weak lower semicontinuity is always fulfilled on the appropriate Young domain and establish that $\Phi$-weak continuity holds if and only if $\Phi$ satisfies the $\Delta_2$ condition. \section{Haezendonck-Goovaerts premium principles on Orlicz spaces} We first provide a brief review of Orlicz spaces. For more details on Orlicz spaces we refer to Edgar and Sucheston~\cite{EdgarSucheston1992} and Zaanen~\cite{Zaanen1983}. Throughout the note, let $(\Omega,{\mathcal{F}},\mathbb{P})$ be a nonatomic probability space. We denote by $L^0$ the set of Borel measurable functions $X:\Omega\to\mathbb{R}$. As usual, we identify two functions that are equal almost surely. The set $L^0$ is equipped with its canonical vector lattice structure. A nonconstant function $\Phi:[0,\infty)\to[0,\infty]$ is said to be an {\em Orlicz function} if it is convex, nondecreasing, left-continuous, and satisfies $\Phi(0)=0$. The {\em conjugate} of $\Phi$ is the map $\Psi:[0,\infty)\to[0,\infty]$ defined by \[ \Psi(y) := \sup_{x\in[0,\infty)}\{xy-\Phi(x)\}. \] The function $\Psi$ is also an Orlicz function. The {\em Orlicz space} associated with $\Phi$ is defined by \[ L^\Phi := \left\{X\in L^0 \,; \ \mathbb{E}\left[\Phi\left(\frac{|X|}{\lambda}\right)\right]<\infty \ \ \mbox{for some} \ \lambda\in(0,\infty)\right\}. \] The {\em Orlicz heart} of $L^\Phi$ is given by \[ H^\Phi := \left\{X\in L^\Phi \,; \ \mathbb{E}\left[\Phi\left(\frac{|X|}{\lambda}\right)\right]<\infty \ \ \mbox{for every} \ \lambda\in(0,\infty)\right\}. \] The Orlicz space $L^\Phi$ is a Banach lattice with respect to the Luxemburg norm \[ \|X\|_\Phi := \inf\left\{\lambda\in(0,\infty) \,; \ \mathbb{E}\left[\Phi\left(\frac{|X|}{\lambda}\right)\right]\leq1\right\}. \] We always equip the Orlicz space $L^\Psi$ with the Orlicz norm \[ \|Y\|_\Psi := \sup\{|\mathbb{E}[XY]| \,; \ X\in L^\Phi, \ \|X\|_\Phi\leq1\}. \] The subspace of $L^0$ consisting of $\mathbb{P}$-bounded functions, respectively $\mathbb{P}$-integrable functions, is denoted by $L^\infty$, respectively $L^1$. We always have $L^\infty\subset L^\Phi\subset L^1$ with norm-continuous embeddings. The norm dual of $L^\Phi$ is therefore a subspace of the norm dual of $L^\infty$ and in general cannot be identified with a function space. On the contrary, the norm dual of $H^\Phi$ can always be identified with $L^\Psi$ provided that $\Phi$ is finitely valued (see Edgar and Sucheston~\cite[Theorem 2.2.11]{EdgarSucheston1992}). \smallskip We say that $\Phi$ satisfies the {\em $\Delta_2$ condition} if there exist $y\in(0,\infty)$ and $k\in(0,\infty)$ such that $\Phi(2x)<k\Phi(x)$ for every $x\in[y,\infty)$. Since the underlying probability space is nonatomic, we have that $\Phi$ satisfies the $\Delta_2$ condition if and only if $L^\Phi=H^\Phi$ (see Edgar and Sucheston~\cite[Theorem 2.1.17]{EdgarSucheston1992}). \smallskip From now on, as is standard in the literature on Haezendonck-Goovaerts principles, we fix a finite-valued Orlicz function $\Phi$ that is normalized by $\Phi(1)=1$ (in the case that $\Phi$ assumes the value $\infty$ we have $L^\Phi=L^\infty$, for which we refer to the thorough study by Bellini and Rosazza Gianin~\cite{BelliniRosazza2008}). For a given $\alpha\in(0,1)$ we consider the Orlicz function $\Phi_\alpha:=\frac{\Phi}{1-\alpha}$ and define the map $N_\alpha:L^\Phi\to[0,\infty)$ by \[ N_\alpha(X) := \|X\|_{\Phi_\alpha}. \] For later convenience, we introduce for every $X\in L^\Phi$ the function $\pi_\alpha(X,\cdot):\mathbb{R}\to\mathbb{R}$ defined by \[ \pi_\alpha(X,m) := m+N_\alpha((X-m)^+) \] where $X^+:=\max(X,0)$ for every $X\in L^\Phi$. \begin{definition} The {\em Haezendonck-Goovaerts premium principle} associated to $\Phi$ at level $\alpha$ is the map $\pi_\alpha:L^\Phi\to\mathbb{R}$ defined by \[ \pi_\alpha(X) := \inf_{m\in\mathbb{R}}\{m+N_\alpha((X-m)^+)\} = \inf_{m\in\mathbb{R}}\pi_\alpha(X,m). \] \end{definition} \smallskip The following result collects a number of useful properties of Haezendonck-Goovaerts premium principles. \begin{proposition}[{\cite[Proposition 3]{BelliniRosazza2012}}] \label{prop: preliminary result} For every $X\in L^\Phi$ the function $\pi_\alpha(X,\cdot)$ is convex and satisfies \[ \lim_{m\to-\infty}\pi_\alpha(X,m) = \lim_{m\to\infty}\pi_\alpha(X,m) = \infty. \] In particular, $\pi_\alpha$ is finitely valued and for every $X\in L^\Phi$ there exists $m_X\in\mathbb{R}$ such that \[ \pi_\alpha(X) = \pi_\alpha(X,m_X) = m_X+N_\alpha((X-m_X)^+). \] Moreover, $\pi_\alpha$ is sublinear, monotone increasing, translation invariant, and law invariant. \end{proposition} \section{Stability properties} In the spirit of Haezendonck and Goovaerts~\cite[Theorem 4]{HaezendonckGoovaerts1982}, in this section we take up the study of a variety of continuity properties of Haezendonck-Goovaerts premium principles. \smallskip We start by showing that Haezendonck-Goovaerts premium principles are always Lipschitz continuous with respect to the Orlicz norm induced by $\Phi$. This property was established by Bellini and Rosazza Gianin~\cite[Proposition 4]{BelliniRosazza2012} in the special setting of Orlicz hearts using the dual representation of Haezendonck-Goovaerts premium principles. Since $\pi_\alpha$ is sublinear, Lipschitz continuity on a general Orlicz space follows from the general results by Farkas et al.~\cite[Proposition 3.6, Theorem 3.16]{FarkasKochMunari2014}. \begin{proposition} The Haezendonck-Goovaerts premium principle $\pi_\alpha$ is Lipschitz continuous. In particular, for all $X,Y\in L^\Phi$ we have \[ |\pi_\alpha(X)-\pi_\alpha(Y)| \leq \frac{1}{1-\alpha}\|X-Y\|_\Phi. \ \] \end{proposition} \begin{proof} Since $1-\alpha\in(0,1)$, the convexity of $\Phi$ implies that $\Phi((1-\alpha)x)\leq(1-\alpha)\Phi(x)$ for every $x\in[0,\infty)$. As a result, for every $X\in L^\Phi$ and every $\lambda\in(0,\infty)$ we have \[ \mathbb{E}\left[\Phi\left(\frac{|X|}{\lambda}\right)\right]\leq1 \ \implies \ \mathbb{E}\left[\Phi_\alpha\left(\frac{(1-\alpha)|X|}{\lambda}\right)\right]\leq1, \] showing that $N_\alpha(X)\leq\frac{1}{1-\alpha}\|X\|_\Phi$. The monotonicity of $\pi_\alpha$ now yields \[ \pi_\alpha(X) \leq \pi_\alpha(|X|) \leq N_\alpha(|X|) \leq \frac{1}{1-\alpha}\|X\|_\Phi \] for every $X\in L^\Phi$. Then, it follows from subadditivity of $\pi_\alpha$ that \[ \pi_\alpha(X)-\pi_\alpha(Y) \leq \pi_\alpha(X-Y) \leq \frac{1}{1-\alpha}\|X-Y\|_\Phi. \] for all $X,Y\in L^\Phi$. This establishes the desired statement. \end{proof} \smallskip \begin{remark} The above proof shows that $\pi_\alpha$ is Lipschitz continuous with constant $1$, i.e.\ is nonexpansive, with respect to the norm $N_\alpha$. This is in line with the general result by Pichler~\cite[Corollary 3.7]{Pichler2017}. \end{remark} \smallskip As Lipschitz continuity is generally not strong enough to imply tractable dual representations, we turn to study continuity properties with respect to the {\em order structure} of $L^\Phi$. More precisely, we focus on the Fatou property, which corresponds to lower semicontinuity with respect to dominated almost-sure convergence, and on the stronger Lebesgue property, which corresponds to continuity with respect to dominated almost-sure convergence. \smallskip We start by showing that Haezendonck-Goovaerts principles are always continuous from below and satisfy the Fatou property. In fact, we show that they satisfy a stronger version of the Fatou property where the domination condition is not required at the level of the random variables but only of the corresponding expectations. We write $X_n\uparrow X$ to mean that the sequence $(X_n)\subset L^\Phi$ is increasing and converges almost surely to $X\in L^\Phi$. \begin{theorem} \label{prop: fatou} The Haezendonck-Goovaerts premium principle $\pi_\alpha$ satisfies the following properties: \begin{enumerate}[(i)] \item $\pi_\alpha$ is continuous from below, i.e.\ for every sequence $(X_n)\subset L^\Phi$ and every $X\in L^\Phi$ we have \[ X_n\uparrow X \ \implies \ \pi_\alpha(X_n)\to\pi_\alpha(X). \] \item $\pi_\alpha$ satisfies the Fatou property, i.e.\ for every sequence $(X_n)\subset L^\Phi$ such that $\sup|X_n|\in L^\Phi$ and for every $X\in L^\Phi$ we have \[ X_n\xrightarrow{a.s.}X \ \implies \ \pi_\alpha(X)\leq\liminf\pi_\alpha(X_n). \] \item For every sequence $(X_n)\subset L^\Phi$ such that $\inf_{n\in\mathbb{N}}\mathbb{E}[X_n]>-\infty$ and for every $X\in L^\Phi$ we have \[ X_n\xrightarrow{a.s.}X \ \implies \ \pi_\alpha(X)\leq\liminf\pi_\alpha(X_n). \] \end{enumerate} \end{theorem} \begin{proof} It is well known that {\em (i)} and {\em (ii)} are equivalent for any monotone functional like $\pi_\alpha$. Note that there exists a constant $k\in\mathbb{R}$ such that $\mathbb{E}[\abs{X}]\leq k \norm{X}_{\Phi}$ for every $X \in L^{\Phi}$; see, e.g., Edgar and Sucheston~\cite[Proposition 2.2.1]{EdgarSucheston1992}. Thus, clearly, {\em (iii)} implies {\em (ii)}. It remains to establish {\em (iii)}. We observe first that, for all $X \in L^{\Phi}$ and $m \in \mathbb{R}$, Jensen's inequality yields that $(\mathbb{E}[X]-m)^+\leq \mathbb{E}[(X-m)^+]$. Hence, by Edgar and Sucheston~\cite[Corollary 2.3.11]{EdgarSucheston1992}, we have \begin{equation}\label{DMeqaa} N_{\alpha}((\mathbb{E}[X]-m)^+) \leq N_{\alpha}(\mathbb{E}[(X-m)^+])\leq N_\alpha((X-m)^+). \end{equation} This implies that for every $X\in L^\Phi$ \begin{equation}\label{DMeq} \pi_{\alpha}(\mathbb{E}[X])\leq \pi_{\alpha}(X). \end{equation} Now, let $(X_n)\subset L^\Phi$ and $X \in L^\Phi$ be such that $\inf_n\mathbb{E}[X_n]>-\infty$ and $X_n \xrightarrow{{a.s.}} X$. If $\liminf_n\pi_\alpha(X_n)=\infty$, then there is nothing to prove. Thus, by passing to a subsequence, we may assume that \[ \pi_\alpha(X_n) \to \liminf\pi_\alpha(X_n) \in [-\infty,\infty). \] We claim that $\sup_n\abs{\mathbb{E}[X_n]}<\infty$. If this is not the case, then we find a subsequence $(X_{n_k})$ such that $\mathbb{E}[X_{n_k}]\rightarrow \infty$. This is because $\inf_n\mathbb{E}[X_n]>-\infty$. By \eqref{DMeq} and the positive homogeneity of $\pi_{\alpha}$, it follows that $\pi_{\alpha}(X_{n_k})\geq \pi_\alpha(\mathbb{E}[X_{n_k}])= \mathbb{E}[X_{n_k}]\pi_{\alpha}(1)=\mathbb{E}[X_{n_k}]$ for $k$ large enough. As a result, we get $\pi_{\alpha}(X_{n_k})\to\infty$, a contradiction. This shows that $\sup_n\abs{\mathbb{E}[X_n]}<\infty$. Now, Proposition \ref{prop: preliminary result} asserts that for every $n\in\mathbb{N}$ there exists $m_n\in\mathbb{R}$ such that \[ \pi_\alpha(X_n,m_n)=\pi_\alpha(X_n). \] We claim that $(m_n)$ is bounded. To this effect, suppose otherwise that $(m_n)$ is unbounded. Extract a subsequence $(m_{n_k})$ such that $\abs{m_{n_k}} \rightarrow \infty$. Since $\sup\abs{\mathbb{E}[X_n]}<\infty$, we must have $\abs{m_{n_k}-\mathbb{E}[X_{n_k}]}\to\infty$. Note that, by \eqref{DMeqaa}, we have \[ \pi_\alpha(X_{n_k},m_{n_k})=N_{\alpha}((X_{n_k}-m_{n_k})^+)+m_{n_k} \geq N_{\alpha}((\mathbb{E}[X_{n_k}]-m_{n_k})^+)+m_{n_k}-\mathbb{E}[X_{n_k}] +\mathbb{E}[X_{n_k}]. \] Hence, we can write \[ \pi_\alpha(X_{n_k},m_{n_k}) \geq \pi_{\alpha}(0,m_{n_k}-\mathbb{E}[X_{n_k}])+\mathbb{E}[X_{n_k}]. \] Since $\abs{m_{n_k}-\mathbb{E}[X_{n_k}]}\to\infty$, it follows from Proposition~\ref{prop: preliminary result} that $\pi_{\alpha}(X_{n_k})\to\infty$, a contradiction. This proves that $(m_n)$ is bounded. To conclude the proof, we extract a subsequence $(m_{n_k})$ such that $m_{n_k} \rightarrow m \in \mathbb{R}$. Then, $(X_{n_k}-m_{n_k})^+ \xrightarrow{{a.s.}} (X-m)^+$. It follows from Zaanen~\cite[Theorem 131.6]{Zaanen1983} that \[ N_{\alpha}((X-m)^+)\leq \liminf_k N_{\alpha}((X_{n_k}-m_{n_k})^+). \] As a consequence, we finally obtain \begin{align*} \pi_{\alpha}(X) \leq& \,\,N_{\alpha}((X-m)^+)+m \leq \liminf_k(N_{\alpha}((X_{n_k}-m_{n_k})^+) +m_{n_k}) \\ =& \,\liminf_k\pi_\alpha(X_{n_k},m_{n_k})=\liminf_k\pi_\alpha(X_{n_k})=\lim_n\pi_\alpha(X_{n}) =\liminf_n \pi_{\alpha}(X_n). \end{align*} This establishes {\em (iii)} and completes the proof. \end{proof} \smallskip We proceed to study the stronger Lebesgue property and continuity from above. We write $X_n\downarrow X$ to mean that the sequence $(X_n)\subset L^\Phi$ is decreasing and converges almost surely to $X\in L^\Phi$. \begin{theorem} \label{prop: lebesgue continuity} For the Haezendonck-Goovaerts premium principle $\pi_\alpha$ the following statements are equivalent: \begin{enumerate}[(i)] \item $\pi_\alpha$ is continuous from above, i.e.\ for every sequence $(X_n)\subset L^\Phi$ and every $X\in L^\Phi$ we have \[ X_n\downarrow X \ \implies \ \pi_\alpha(X_n)\to\pi_\alpha(X). \] \item $\pi_\alpha$ satisfies the Lebesgue property, i.e.\ for every sequence $(X_n)\subset L^\Phi$ such that $\sup|X_n|\in L^\Phi$ and for every $X\in L^\Phi$ we have \[ X_n\xrightarrow{a.s.}X \ \implies \ \pi_\alpha(X_n)\to\pi_\alpha(X). \] \item $\Phi$ satisfies the $\Delta_2$ condition. \end{enumerate} \end{theorem} \begin{proof} Suppose that $\Phi$ satisfies the $\Delta_2$ condition and recall that $L^\Phi=H^\Phi$ in this case. That $\pi_\alpha$ satisfies the Lebesgue property follows from Bellini and Rosazza Gianin~\cite[Proposition 4]{BelliniRosazza2012} and Orihuela and Ruiz Gal\`{a}n~\cite[Theorem 1]{OrihuelaRuiz2012}. This shows that {\em (iii)} implies {\em (ii)}. It is immediate to see that {\em (ii)} implies {\em (i)}. We conclude by showing that {\em (i)} implies {\em (iii)}. To this effect, assume that $\pi_\alpha$ is continuous from above but $\Phi$ does not satisfy the $\Delta_2$ condition. In this case, $\Phi_\alpha$ also fails to satisfy the $\Delta_2$ condition. Then, it follows from Zaanen~\cite[Theorem 133.4]{Zaanen1983} that we find a sequence $(X_n)\subset L^\Phi$ and a scalar $\delta\in(0,\infty)$ such that $X_n\downarrow0$ and $N_\alpha(X_n)\geq\delta$ for every $n\in\mathbb{N}$. By Proposition \ref{prop: preliminary result}, for every $n\in\mathbb{N}$ we find $m_n\in\mathbb{R}$ such that $\pi_\alpha(X_n,m_n)=\pi_\alpha(X_n)$. Note that \begin{equation} \label{eq: lebesgue continuity} \pi_\alpha(X_n,m_n) = \pi_\alpha(X_n) \to \pi_\alpha(0) = 0 \end{equation} by continuity from above. Since $\pi_\alpha(X_n,0)=N_\alpha(X_n)\geq\delta$ for every $n\in\mathbb{N}$, we see that only finitely many $m_n$'s can be zero. Hence, we can always assume without loss of generality that $(m_n)$ consists either of strictly-positive or of strictly-negative numbers. We first focus on the strictly-positive case. Assume that $m_n>0$ for every $n\in\mathbb{N}$. We claim that $m_n\to0$. Indeed, otherwise, there exist $\varepsilon\in(0,\infty)$ and a subsequence $(m_{n_k})$ such that $m_{n_k}\geq\varepsilon$ for every $k\in\mathbb{N}$. Then \[ \pi_\alpha(X_{n_k},m_{n_k}) \geq \pi_\alpha(0,m_{n_k}) = m_{n_k} \geq \varepsilon \] for every $k\in\mathbb{N}$, which contradicts \eqref{eq: lebesgue continuity}. This proves the claim. Now, for each $n\in\mathbb{N}$ the affine function $f_n:\mathbb{R}\to\mathbb{R}$ defined by \[ f_n(m) = \frac{\pi_\alpha(X_n,m_n)-\pi_\alpha(X_n,0)}{m_n}m+\pi_\alpha(X_n,0) \] is easily seen to satisfy $f_n(0)=\pi_\alpha(X_n,0)$ and $f_n(m_n)=\pi_\alpha(X_n,m_n)$. Hence, it follows from the convexity of $\pi_\alpha(X_n,\cdot)$ that $\pi_\alpha(X_n,-1)\geq f_n(-1)$. This yields \[ \pi_\alpha(X_1,-1) \geq \pi_\alpha(X_n,-1) \geq f_n(-1) \geq \frac{\delta-\pi_\alpha(X_n,m_n)}{m_n}+\delta \] for every $n\in\mathbb{N}$. However, this is clearly not possible because the right-hand side explodes as $n\to\infty$. As a result, our initial assumption that $\Phi$ does not satisfy the $\Delta_2$ condition is not tenable. Next, we focus on the strictly-negative case. Assume that $m_n<0$ for every $n\in\mathbb{N}$. We again show that $m_n\to0$. Otherwise, there exist $\varepsilon\in(0,\infty)$ and a subsequence $(m_{n_k})$ such that $m_{n_k}\leq-\varepsilon$ for every $k\in\mathbb{N}$ and thus \begin{align*} \pi_\alpha(X_{n_k},m_{n_k}) \geq& \,\,\pi_\alpha(0,m_{n_k}) = m_{n_k}+N_\alpha(-m_{n_k}) = (-m_{n_k})\left(\frac{1}{\Phi^{-1}(1-\alpha)}-1\right) \\ \geq& \left(\frac{1}{\Phi^{-1}(1-\alpha)}-1\right)\varepsilon > 0 \end{align*} for every $k\in\mathbb{N}$, contradicting \eqref{eq: lebesgue continuity} as well. Here, we have used the fact that \[ \Phi^{-1}(1-\alpha) := \sup\big\{x\in[0,\infty) \,; \ \Phi(x)\leq1-\alpha\big\} \in (0,1). \] From now on we can argue as in the strictly-positive case. In sum, we have established that {\em (i)} must imply {\em (iii)}, concluding the proof. \end{proof} \smallskip Since the Haezendonck-Goovaerts principle $\pi_\alpha$ is law invariant, it can be regarded as a functional defined on the set of probability measures associated to random variables in $L^\Phi$. It is therefore natural to also study continuity properties in this setting. In the spirit of Kr\"{a}tschmer et al.~\cite{KratschmerSchiedZahle2014}, we focus on (semi)continuity with respect to the so-called $\Phi$-weak convergence. In line with the language of this note, we formulate our statements in terms of random variables instead of probability measures. To this effect, we write $X_n\xrightarrow{dist.}X$ to mean that the sequence $(X_n)\subset L^\Phi$ converges in distribution to $X\in L^\Phi$. Recall from \cite{KratschmerSchiedZahle2014} that $\Phi$-weak convergence can be properly formulated only on the Young class \[ Y^\Phi := \left\{X\in L^0 \,; \ \mathbb{E}\left[\Phi\left(|X|\right)\right]<\infty\right\}. \] Clearly, $H^\Phi\subset Y^\Phi\subset L^\Phi$. For a sequence $(X_n)\subset Y^\Phi$ and $X\in Y^\Phi$ we say that $(X_n)$ $\Phi$-converges in distribution to $X$ whenever (see \cite[Lemma A.1]{KratschmerSchiedZahle2014}) \[ X_n\xrightarrow{\Phi\text{-}dist.}X \ :\iff \ X_n\xrightarrow{dist.}X \ \ \mbox{and} \ \ \mathbb{E}[\Phi(|X_n|)]\to\mathbb{E}[\Phi(|X|)]. \] \smallskip Our first result shows that Haezendonck-Goovaerts premium principles are always lower semicontinuous with respect to $\Phi$-convergence in distribution. \begin{proposition} The Haezendonck-Goovaerts premium principle $\pi_\alpha$, restricted to $Y^\Phi$, is lower semicontinuous with respect to $\Phi$-convergence in distribution, i.e.\ for every sequence $(X_n)\subset Y^\Phi$ and every $X\in Y^\Phi$ we have \[ X_n\xrightarrow{\Phi\text{-}dist.}X \ \implies \ \pi_\alpha(X)\leq \liminf \pi_\alpha(X_n). \] \end{proposition} \begin{proof} Let $(X_n)\subset Y^\Phi$ and $X\in Y^\Phi$ be such that $X_n\xrightarrow{\Phi\text{-}dist.}X$. Since our probability space is nonatomic, the classical Skorohod representation yields $(Y_n)\subset L^\Phi$ and $Y\in L^\Phi$ such that $X$ and $Y$ have the same distribution, $X_n$ and $Y_n$ have the same distribution for every $n\in\mathbb{N}$, and $Y_n\xrightarrow{a.s.}Y$. Clearly, \begin{equation}\label{wlseq} \mathbb{E}[\Phi(|Y|)]= \mathbb{E}[\Phi(|X|)]= \lim\mathbb{E}[\Phi(|X_n|)]=\lim\mathbb{E}[\Phi(|Y_n|)]<\infty. \end{equation} Observe that $\inf_n \mathbb{E}[Y_n] >-\infty$. Indeed, if $\inf_n \mathbb{E}[Y_n]=-\infty$, then we find a subsequence $(Y_{n_k})$ such that $\mathbb{E}[|Y_{n_k}|] \rightarrow \infty$. Therefore, by Jensen's inequality, $\mathbb{E}[\Phi(|Y_{n_k}|)]\geq \Phi[\mathbb{E}[|Y_{n_k}|] \rightarrow \infty$, contradicting \eqref{wlseq}. As a consequence, Theorem~\ref{prop: fatou}(i) yields that $\pi_\alpha(X)=\pi_\alpha(Y)\leq \liminf\pi_\alpha(Y_n)=\liminf \pi_\alpha(X_n)$. \end{proof} \smallskip In Kr\"{a}tschmer et al.~\cite[Theorem 2.8]{KratschmerSchiedZahle2014} it was proved that {\em all} law-invariant convex risk measures are continuous with respect to $\Phi$-convergence in distribution on the Orlicz heart $H^\Phi$ if and only if $\Phi$ is $\Delta_2$. The following result shows that it is enough to check continuity for the Haezendonck-Goovaerts premium principle $\pi_\alpha$ to know whether $\Phi$ is $\Delta_2$ or not. \begin{proposition} For the Haezendonck-Goovaerts premium principle $\pi_\alpha$ the following statements are equivalent: \begin{enumerate}[(i)] \item[(i)] $\pi_\alpha$ is continuous on $Y^\Phi$ with respect to $\Phi$-convergence in distribution. \item[(ii)] $\pi_\alpha$ is continuous on $H^\Phi$ with respect to $\Phi$-convergence in distribution. \item[(iii)] $\Phi$ satisfies the $\Delta_2$ condition. \end{enumerate} \end{proposition} \begin{proof} It follows from Kr\"{a}tschmer et al.~\cite[Theorem 2.8]{KratschmerSchiedZahle2014} that {\em (iii)} implies {\em (i)} because $H^\Phi=Y^\Phi=L^\Phi$ when $\Phi$ is $\Delta_2$. That {\em (i)} implies {\em (ii)} is obvious since $H^\Phi\subset Y^\Phi$. Hence, it remains to show that {\em (ii)} implies {\em (iii)}. To this end, suppose that {\em (ii)} holds but {\em (iii)} fails. As in the proof of Theorem~\ref{prop: lebesgue continuity}, we take a sequence $(X_n)\subset L^\Phi$ and a scalar $\delta\in(0,\infty)$ such that $X_n\downarrow0$ and $N_\alpha(X_n)\geq\delta$ for every $n\in\mathbb{N}$. By rescaling, we may assume without loss of generality that $\norm{X_1}_\Phi\leq 1$, so that $\mathbb{E}[\Phi(X_1)]\leq 1$; see, e.g., Edgar and Sucheston~\cite[Proposition 2.1.10]{EdgarSucheston1992}. For each $n\in\mathbb{N}$ we clearly have $X_n\wedge k\uparrow X_n$, so that $N_\alpha(X_n\wedge k)\uparrow N_\alpha(X_n)$; see, e.g., Edgar and Sucheston~\cite[Theorem 2.1.11]{EdgarSucheston1992}. As a result, for every $n\in\mathbb{N}$ we can take $a_n\in(0,\infty)$ such that $N_\alpha(X_n\wedge a_n)\geq\frac{\delta}{2}$. Now, set $Y_n=X_n\wedge a_n$ for $n\in\mathbb{N}$. Then, $(Y_n)\subset L^\infty\subset H^\Phi$. Clearly, $Y_n\xrightarrow{a.s.}0$, so that $\Phi(Y_n)\xrightarrow{a.s.}0$. Since $0\leq \Phi(Y_n)\leq \Phi(X_n)\leq \Phi(X_1)\in L^1$, the Dominated Convergence Theorem implies that $\mathbb{E}[\Phi(Y_n)]\to0$. This yields $Y_n\xrightarrow{\Phi\text{-}dist.}0$ and it therefore follows from our assumption {\em (ii)} that $\pi_\alpha(Y_n)\to \pi_\alpha(0)=0$. However, $N_\alpha(Y_n)\geq \frac{\delta}{2}$ and $0\leq Y_n\leq X_1$ for every $n\in\mathbb{N}$. The same argument used in the proof of {\em (i)}$\implies${\em (iii)} in Theorem~\ref{prop: lebesgue continuity} applies to $(Y_n)$ in place of $(X_n)$ there and yields a contradiction. This completes the proof. \end{proof} \smallskip \begin{remark} (i) One may wonder whether the preceding (semi)continuity results also hold with respect to the weaker convergence in distribution (which corresponds to the so-called weak convergence at the level of probability measures). It is easy to see that $\pi_\alpha$ is never continuous with respect to such convergence. Indeed, otherwise, take any $n\in\mathbb{N}$ and let $X_n=n1_{A_n}$ where $\mathbb{P}(A_n)=\frac{1}{n}$. Since we clearly have $X_n\xrightarrow{dist.}0$, it would follow that $0=\pi_\alpha(0)=\lim \pi_\alpha(X_n)\geq \lim\mathbb{E}[X_n]=1$ by \eqref{DMeq}, which is absurd. However, it remains open to us whether $\pi_\alpha$ is lower semicontinuous with respect to convergence in distribution. Incidentally, we note that lower semicontinuity with respect to convergence in distribution is related to a Fatou-type property that was first introduced in Gao and Munari~\cite{GaoMunari2017}. Indeed, one can readily show that the following statements are equivalent: \begin{enumerate} \item[(a)] $\pi_\alpha$ is lower semicontinuous with respect to convergence in distribution, i.e.\ for every sequence $(X_n)\subset L^\Phi$ and every $X\in L^\Phi$ we have \[ X_n\xrightarrow{dist.}X \ \implies \ \pi_\alpha(X)\leq \liminf \pi_\alpha(X_n). \] \item[(b)] $\pi_\alpha$ satisfies the super Fatou property, i.e.\ for every sequence $(X_n)\subset L^\Phi$ and every $X\in L^\Phi$ we have \[ X_n\xrightarrow{a.s.}X \ \implies \ \pi_\alpha(X)\leq \liminf \pi_\alpha(X_n). \] \end{enumerate} It is immediate that {\em (a)} implies {\em (b)} because almost-sure convergence implies convergence in distribution. Conversely, assume that {\em (b)} holds. Let $(X_n)\subset L^\Phi$ and $X\in L^\Phi$ be such that $X_n\xrightarrow{dist.}X$. The classical Skorohod representation yields $(Y_n)\subset L^\Phi$ and $Y\in L^\Phi$ such that $X$ and $Y$ have the same distribution, $X_n$ and $Y_n$ have the same distribution for every $n\in\mathbb{N}$, and $Y_n\xrightarrow{a.s.}Y$. Thus, by {\em (b)}, we obtain $\pi_\alpha(X)=\pi_\alpha(Y)\leq \liminf\pi_\alpha(Y_n)=\liminf \pi_\alpha(X_n)$ as desired. \medskip (ii) Recall that for every $X\in L^1$ the Expected Shortfall of $X$ at level $\lambda\in(0,1)$ is defined by \[ \mathop {\rm ES}\nolimits_\lambda(X) := \frac{1}{1-\lambda}\int_\lambda^1\mathop {\rm VaR}\nolimits_p(X)dp, \] where $\mathop {\rm VaR}\nolimits_p(X)$ denotes the $p$-lower quantile of $X$ for every $p\in(0,1)$. It is worth mentioning that, when $\Phi(x)=x$ on $[0,\infty)$, we have $L^\Phi=L^1$ and $\pi_\alpha$ coincides with Expected Shortfall via \[ \pi_\alpha(X) = \inf_{m\in\mathbb{R}}\left\{m+\frac{1}{1-\alpha}\mathbb{E}[(X-m)^+]\right\} = \mathop {\rm ES}\nolimits_\alpha(X) \] for every $X\in L^1$. In this case, it was shown in Example 2.14 of Chen et al.\ \cite{Chen2018} that $\pi_\alpha$ has the super Fatou property. \end{remark} \section{Dual representations} In the previous section we have established that Haezendonck-Goovaerts premium principles satisfy the Fatou property on {\em any} Orlicz space, regardless of whether $\Phi$ fulfills the $\Delta_2$ condition or not. This allows us to exploit some recent results on dual representations of law-invariant functionals on Orlicz spaces to derive a dual characterization of Haezendonck-Goovaerts premium principles as worst expectations on a suitable set of probability measures. This extends Bellini and Rosazza Gianin~\cite[Proposition 4]{BelliniRosazza2012} beyond the $\Delta_2$ case. Recall that the conjugate function of $\pi_{\alpha}$ with respect to the duality pair $(L^\Phi,L^\Psi)$ is the map $\pi_{\alpha}^\ast:L^\Psi\to(-\infty,\infty]$ defined by \[ \pi_{\alpha}^\ast(Y) := \sup_{X\in L^\Phi}\{\mathbb{E}[XY]-\pi_{\alpha}(X)\}. \] \begin{lemma} \label{prop_conj} For every $Y \in L^\Psi$ we have that $$ \pi_{\alpha}^\ast(Y)= \begin{cases} 0 & Y\geq 0, \ ||Y||_{\Psi_{\alpha}} \leq 1, \ \mathbb{E}[Y]=1, \\ +\infty & \mbox{otherwise}. \end{cases} $$ Here $\Psi_\alpha$ is the conjugate of $\Phi_\alpha$ and $||\cdot||_{\Psi_{\alpha}}$ is the Orlicz norm of $L^{\Psi_{\alpha}}$. \end{lemma} \begin{proof} Take any $Y\in L^\Psi$ and define a map $\pi_{\alpha,H^\Phi}^\ast:L^\Psi\to(-\infty,\infty]$ by setting \[ \pi_{\alpha,H^\Phi}^\ast(Y) = \sup_{X\in H^\Phi}\{\mathbb{E}[XY]-\pi_{\alpha}(X)\}. \] We clearly have that $\pi_{\alpha}^\ast(Y)\geq\pi_{\alpha,H^\Phi}^\ast(Y)$. We claim that the converse inequality also holds. To see this, let $X \in L^\Phi$. By Gao et al.~\cite[Proposition 3.4]{GaoLeungMunariXanthos2017} there exists a sequence $({\mathcal{F}}_n)$ of finitely-generated $\sigma$-subalgebras of ${\mathcal{F}}$ such that $\mathbb{E}[X|{\mathcal{F}}_n]\to X$ almost surely and $\sup_{n\in\mathbb{N}}|\mathbb{E}[X|{\mathcal{F}}_n]|\in L^\Phi$. Since $\pi_{\alpha}$ has the Fatou property, we have \[ \pi_{\alpha}(X) \leq \liminf\pi_{\alpha}(\mathbb{E}[X|{\mathcal{F}}_n]). \] Now, note that $\mathcal{C}=\{Y\in L^\Phi \,; \ \pi_{\alpha}(Y)\leq\pi_{\alpha}(X)\}$ is convex, law-invariant, closed with respect to dominated almost-sure convergence by the Fatou property, and clearly contains $X$. Hence, by Gao et al.~\cite[Corollary 4.5]{GaoLeungMunariXanthos2017} we have $\mathbb{E}[X|{\mathcal{F}}_n]\in\mathcal{C}$ for every $n\in\mathbb{N}$, so that $\limsup\pi_{\alpha}(\mathbb{E}[X|{\mathcal{F}}_n]) \leq \pi_{\alpha}(X)$. As a consequence, we infer that \begin{equation} \label{eq000} \pi_{\alpha}(\mathbb{E}[X|{\mathcal{F}}_n]) \to \pi_{\alpha}(X). \end{equation} Note that $\mathbb{E}[X|{\mathcal{F}}_n]\in L^\infty\subset H^\Phi$ for each $n\in\mathbb{N}$. Thus, by applying~\eqref{eq000} and the Dominated Convergence Theorem, we get \[ \pi_{\alpha,H^\Phi}^\ast(Y) \geq \lim\Big(\mathbb{E}[\mathbb{E}[X|{\mathcal{F}}_n]Y]-\pi_{\alpha}(\mathbb{E}[X|{\mathcal{F}}_n])\Big) = \mathbb{E}[XY]-\pi_{\alpha}(X), \] which in turn implies $\pi^\ast_{\alpha}(Y)\leq\pi_{\alpha,H^\Phi}^\ast(Y)$. Therefore, we have $\pi^\ast_{\alpha}(Y)=\pi_{\alpha,H^\Phi}^\ast(Y)$ as claimed. We can now rely on Bellini and Rosazza Gianin~\cite[Proposition 4]{BelliniRosazza2012} to infer that \[ \pi_{\alpha}^\ast(Y)= \begin{cases} 0 & Y\geq 0, \ ||Y||_{\Psi_{\alpha}} \leq 1, \ \mathbb{E}[Y]=1, \\ +\infty & \mbox{otherwise}. \end{cases} \] This concludes the proof of the lemma. \end{proof} \smallskip We can now state the announced dual representation of Haezendonck-Goovaerts premium principles. In what follows we denote by $\mathcal{P}(\mathbb{P})$ the set of all probability measures over $(\Omega,\mathcal{F})$ that are absolutely continuous with respect to $\mathbb{P}$. \begin{theorem} The Haezendonck-Goovaerts premium principle $\pi_\alpha$ satisfies \[ \pi_{\alpha}(X) = \sup_{\mathbb{Q}\in\mathcal{Q}^\infty_{\alpha}}\mathbb{E}_\mathbb{Q}[X] \] for every $X\in L^\Phi$, where \[ \mathcal{Q}^\infty_{\alpha} = \bigg\{\mathbb{Q}\in\mathcal{P}(\mathbb{P}) \,; \ \frac{d\mathbb{Q}}{d\mathbb{P}}\in L^\infty, \ \bigg\|\frac{d\mathbb{Q}}{d\mathbb{P}}\bigg\|_{L^{\Psi_{\alpha}}}\leq 1\bigg\}. \] \end{theorem} \begin{proof} Recall that $\pi_{\alpha}$ is convex, law-invariant, and satisfies the Fatou property on $L^\Phi$. Then, it follows from Gao at el.~\cite[Theorem 1.1]{GaoLeungMunariXanthos2017} that $\pi_{\alpha}$ is $\sigma(L^\Phi,L^\infty)$ lower semicontinuous. Thus, a direct application of the classical Fenchel-Moreau dual representation gives \[ \pi_\alpha(X) = \sup_{Y\in L^\infty}\{\mathbb{E}[XY]-\pi_\alpha^\ast(Y)\} \] for every $X\in L^\Phi$. In view of Lemma~\ref{prop_conj}, we can write \[ \pi_\alpha(X) = \sup\{\mathbb{E}[XY] \,; \ Y\in L^\infty, \ Y\geq 0, \ ||Y||_{\Psi_{\alpha}}\leq 1, \ \mathbb{E}[Y]=1\} \] for every $X\in L^\Phi$. It remains to observe that every element $Y$ in the above supremum can be expressed as a Radon-Nikodym derivative with respect to $\mathbb{P}$. \end{proof} \smallskip \begin{remark} In the theorem, if we use $ \mathcal{Q}^H_{\alpha} = \big\{\mathbb{Q}\in\mathcal{P}(\mathbb{P}) \,; \ \frac{d\mathbb{Q}}{d\mathbb{P}}\in H^\Psi, \ \big\|\frac{d\mathbb{Q}}{d\mathbb{P}}\big\|_{L^{\Psi_{\alpha}}}\leq 1\big\}$ in the supremum, then it follows from Theorem~\ref{prop: lebesgue continuity} and Orihuela and Ruiz Gal\`{a}n~\cite[Theorem 1]{OrihuelaRuiz2012} that the supremum is attained at every $X\in L^\Phi$ if and only if $\Phi$ satisfies the $\Delta_2$ condition. \end{remark} \section*{Acknowledgements} We thank an anonymous referee for the insightful observations that led to include the discussion on $\Phi$-weak convergence. Niushan Gao and Foivos Xanthos acknowledge financial support of NSERC Discovery Grants. {\footnotesize
\section{Introduction} \label{sec:introduction} \subsection{Clinical relevance and motivation} \textit{If the rumor is tumor, the issue is tissue.} Histopathology is the gold standard and backbone of cancer diagnosis, providing important information for various stages of the treatment process \citep{uicc_tnm_8thEd}. For instance, a fine-grained grading and staging of dysplasia and malignancy in precursor and cancer lesions, respectively, underlies individualized treatment planning in many tumor entities. Moreover, in curative surgery, the assessment of whether the resection specimen margins are free of tumour cells is of vital importance and a core task of clinical pathology. Human pathologists meet these challenges with the help of elaborated diagnostic criteria and grading systems for all kinds of cancer and cancer precursors. Even though their specific details vary for different kinds of cancer, many rely on a combination of features such as \begin{itemize} \item Nuclear inner density, i.e. color, \citep{Zink2004} and \item Deformed and varying nuclear shapes or global alterations of the nuclei \citep{Zink2004}. \item Increased nucleus to stroma ratio and \item Loss of nuclear polarity (e.g. nucleus not anymore at the bottom), as observed in many glandular tumours. \item Deformed cellular shapes and heterogeneous cell sizes, \item Loss of organ- and function-defining positions on small scales (e.g., neighboring cells not in a single layer, but some stacked over each other) and larger scales (e.g., atypical or deformed glandular shapes), \item Invasion (i.e., disrespecting global tissue order and borders between different layers). \end{itemize} As can be seen from this (not-exhaustive) list, diagnosis and grading of malignancy inherently involve a range of different scales. These scales may span a factor of more than a thousand-fold, ranging from sub-nuclear features (which lie on a spatial scale of $\approx \mathcal{O}(\SI{0.1}{\micro\metre})$) via nuclear, cellular ($\approx \mathcal{O}(\SI{10}{\micro\metre})$), inter-cellular ($\approx \mathcal{O}(\SI{100}{\micro\metre})$) to glandular and other higher organisational features ($\gtrapprox \mathcal{O}(\SI{1}{\milli\metre})$). The importance of the integration of information from different scales is reflected in how human pathologists approach these tasks: Regions of interest are repeatedly viewed at several different magnifications by turning the objective revolver of the microscopy back and forth. In this work, we aim to develop a family of deep learning models that architecturally mimic this behaviour. % \subsection{Related works} With their success in various computer vision tasks, deep learning methods have opened up a myriad of perspectives for computer vision and computer-aided diagnosis (CADx) in histopathology \citep{Litjens2017}. Image segmentation is a standard task in computer vision and machine learning and has a direct clinical use in the field of pathology, be it the analysis of the margin status (i.e., distance of tumor cells to resection margin), area-dependent grading systems (with the Gleason score in prostate cancer as a prominent example \citep{Gleason,karimi2020DLGleason,nir_automatic_2018}), or specific research applications, such as the analysis of 3d-tumor morphology from a multiplicity of tissue sections \citep{Schmitz2018, Segovia2019}. In medical image segmentation, standard computer vision models, including fully convolutional neural networks (FCNs, \citealt{Long2015}) and, most prominently, U-Net-based architectures \citep{Ronneberger2015} have successfully been applied to various scenarios and imaging modalities \citep{Litjens2017, Isensee2018}, including computational histopathology \citep{Bulten2019, Liu, Campanella2019}. In addition, more specialized network architectures \citep{Bejnordi2017, li_multi-scale_2018, Vu2019} and training techniques \citep{Campanella2019, Wang2019} have been proposed to address the challenges of computational histopathology. Some of these works touch upon the question on how additional context can be provided to the network, but are mainly confined to local, similar-scale context \citep{Bejnordi2017, li_multi-scale_2018} and/or sliding-window convolutional neural network (CNN) techniques \citep{Bejnordi2017, wetteland_multiscale_nodate} or classification tasks. Early on, \citet{nir_automatic_2018} described the potential of multi-scale features from more separate scales in classical, "hand-crafted" feature-driven machine learning. By integrating the features from different scales by use of a support vector machine (SVM), they paved the way for many works to follow. Recently, the same research group advocated the use of individually trained CNNs as feature extractors whose outputs were, in an ensembling-like fashion, combined by a logistic regression model into a final Gleason grade classification in prostate cancer \citep{karimi2020DLGleason}. Similarly, \citet{wetteland_multiscale_nodate} suggested to train distinct CNNs as feature extractors and merge their information in a classification network in replacement of the original fully-connected layers, which can again be viewed as an ensembling approach. For application to breast cancer and its differential diagnoses, \citet{ning_multiscale_2019} proposed a similar ensembling technique, but again based on classical, hand-crafted feature extractors and using an SVM for integration of multi-scale information. In 3d imaging, multi-path end-to-end trainable models have incorporated similar-scale and local context to reduce the memory footprint and alleviate the problem of the otherwise extremely limited input size in memory-costly 3d-nets \citep{Kamnitsas2017}, with remarkable success in e.g. the sub-acute stroke lesion segmentation challenge ISLES 2015 \citep{maier_isles_2017}. In histopathology, there also have been attempts toward end-to-end trainable multi-scale models \citep{gu_multi-resolution_2018,li_multi-scale_2018}, but which have so far shown only minor benefits as compared to the aforementioned ensembling variants. This observation indicates that multi-scale deep learning-based segmentation of histopathology data is still in its infancy and its actual potential remains to be unveiled. Introduction of additional image context has been a topic of interest also in the natural image domain, resulting in prominent techniques like dilated or atrous convolutions and atrous spatial pyramid pooling \citep{Chen2017DeepLab, Chen2017Atrous}. % Further, \citet{Zhang2018} proposed an FCN architecture that explicitly predicts "scaling factors" for the possible classes from the bottle-neck layer, which are then used to multiply and, thus, highlight the respective feature maps at the final layer. The scaling factors can capture the overall image content and can be trained by use of an additional classification loss. Similarly, \citet{Zhou2019} introduced a reinforcement-based strategy involving two sub-nets, one for encoding context and one for the actual segmentation task. By the properties of the natural image domain, namely the limited image size as compared to histopathologic whole-slide images (WSIs), the scales of detailed and contextual features in these works are, however, much more similar than in histopathology. Congruously, the primary aim of these approaches has been to "help clarify local confusion" \citep{Liu2015} or to make better use of what is fed into to the net anyways, rather than to add large and otherwise unavailable context. For histopathology image segmentation as a specific task, however, we aim for the integration of otherwise unavailable information from much different scales into a single, end-to-end trainable model. \subsection{Contributions} There exist plenty of highly optimized, U-Net-derived architectures employing, for instance, elaborate skip connections \citep{badrinarayanan_segnet_2017}, dense connections \citep{li_denseunet_2018}, attention gating techniques \citep{oktay_attention_2018} and newer FCN architectures like DeepLab \citep{Chen2017DeepLab}. Nevertheless, standard U-Nets have turned out to be robust work horses for many medical computer vision tasks and are hard to beat by internal modifications of the base architecture \citep{Isensee2018, isensee_breaking_the_spell_2019}. However, histopathology diagnosis is, by the nature of the large whole-slide images and with closely interwoven features from very different scales, a very specific and challenging task. Therefore, drawing on the U-Net as a standard base model, this work explores whether an architectural mimicry of how human experts approach this specific task can improve the performance of FCNs for histopathology image segmentation. The main contributions of this paper are as follows: We introduce a family of U-Net-based fully convolutional deep neural nets that are specifically designed for the extensive integration of largely different spatial scales. First, we propose a simple building block that can fuse various encoders with different spatial scales in a manner that preserves relative spatial scales. As a light-weight alternative, we also propose the use of an independent context classification model for gating the segmentation model output. Second, we integrate these building blocks into different multi-scale FCNs and % compare their segmentation performance to U-Net baseline architectures. To illustrate generalizability, the evaluation is based on three different publicly available image datasets provided by recent challenges. Third, by a systematic, stepwise analysis, we identify relevant aspects of the proposed multi-scale FCN family, including the necessity of preserving spatial relationships between different encoders, the benefits from deep guidance by an additional classification loss and possible generalizations through multiple path fusions. Based on these observations, we narrow down the possible multi-scale setups and comment on how to systematically adapt the presented multi-scale FCN family to specific deep learning tasks in histopathology. To foster reproducibility and further research, our proposed models are publicly provided as open source\footnote{https://github.com/ipmi-icns-uke/multiscale/. Please do not hesitate to contact the corresponding author for help with implementation and usage.\label{githubour}} to the community. \section{Model architectures} \subsection{Baseline architectures} \subsubsection{U-Net architecture} Beyond the still popular sliding-window CNN-based techniques, U-Net-based FCN architectures form the de facto standard in the medical image domain \citep{Isensee2018}, including histopathology \citep{Litjens2017}. Beating the standard U-Net by internal modifications is evidently hard \citep{isensee_breaking_the_spell_2019, Isensee2018} and beyond the scope of this work. Rather, as outlined in the introduction, this study examined whether by designing a model of standard components but with its larger architecture mimicking human expert diagnostic procedures, further improvement can be made. Therefore, we chose a non-modified ResNet18-based U-Net \citep{He2015} as a common, standard U-Net variant to form the baseline for this study\footnote{ An implementation of this architecture can be found at % https://github.com/usuyama/pytorch-unet. Accessed: 2019-09-19.}. For a detailed description of the baseline model, the reader is referred to section \ref{sec:supp_baseline_results} in the Supplementary Materials. In brief, the ResNet18 forms the encoder of the otherwise standard U-Net architecture (cf. figure \ref{fig:supp_baseline}), where the encoding ResNet18 has been pre-trained on the ImageNet dataset \citep{ImageNet}. For our study, the baseline model was trained at full-resolution patches of $512 \times 512$ pixels of the WSI images. \subsubsection{Multi-scale ensembles as an upper bound for state-of-the-art performance} We additionally compared our proposed models to ensembling techniques to see if we can reach or even excel their performance with a single, and computationally less costly, model. Inspired by the approach of \citet{karimi2020DLGleason} to Gleason grading, individual U-Nets were trained on the different image scales. The predicted probabilities were then re-sampled to the target resolution and merged by use of different ensembling techniques, % namely hard majority votes, average ensembles (soft majority voting), and logistic regression ensembles. For each ensemble, the best individual model per scale was selected. The logistic regression model was trained and evaluated on the same train and test sets as the individual models. By this procedure, % we aimed to define a thorough and systematic upper bound for state-of-the-art multi-scale ensembling performance. \subsection{The msY model family: Multi-scale multi-encoder architectures} \label{sec:multi_scale_models} To provide the network with context and architectural information (cf. figure \ref{fig:patches} and the considerations in section \ref{sec:introduction}), we constructed a family of multi-scale multi-encoder networks building upon the baseline Res-U-Net architecture. In the following, we first introduce the underlying blocks for integration of multi-scale context, namely the \textit{multi-scale merge block} and the \textit{context classification gate}. Afterwards, we describe the different variants of our setup that are examined in this study. Technically, it is worth noting that common whole-slide image (WSI) formats use so-called pyramid representations, which contain the original image in multiple, downsampled versions. Therefore, multiple scales can directly be loaded from file, with no need for resampling and, hence, only a moderate overhead only. \begin{figure*}[htb] \centering \includegraphics[width=\textwidth]{figures_compressed/patches_all_blue_new_450dpi.png} \caption{Input patches at different spatial scales, shown in an illustrative region of the same whole-slide image as depicted in figure \ref{fig:dataset_example}. The innermost, black rectangle corresponds to a $512 \times 512$ pixel patch of the scale 1, which we refer to as the ``detail patch'' (zoomed view in the top right inset). The next, dark blue rectangle corresponds to a $572 \times 572$ pixel patch of the scale 4. It contains information on how the cells are organised in strands and "trabeculae" -- or whether the cells violate these patterns. These features are hard or impossible to deduce using the innermost patch alone. In this sense, the dark blue patch adds "architectural" information. We refer to it as "local context" or the "local context patch". A zoomed view of it is shown in the bottom right inset. The outermost, light blue rectangle, which we call a "global context patch", contains information on the large-scale organization of the tissue, such as the pseudocapsule, which is typical for hepatocellular carcinoma. Whilst a standard U-Net is provided with the information from the detail patch solely, a msY-Net architecture (section \ref{sec:msY-Net}) can integrate information from the detail patch plus either the local or the global context patch. The msY$^2$- and msY$\textit{I}$-Net architectures are two options for integration of all three scales. The scale bar is 2 mm.} \label{fig:patches} \end{figure*} \subsubsection{Multi-scale merge block: spatial relationship preserving path fusion in multi-scale multi-encoder models} \label{subsec:merge_block} Figure \ref{subfig:msM-Block} sketches the functioning of the multi-scale merge block. At the bottleneck level, the feature maps from both the main encoder and the side (context) encoder have sizes of $16 \times 16 \times 512$. In order to spatially match the output of the full resolution encoder, a $n^\prime \times n^\prime$ center cropping ($\mathcal{S}_{\frac{16}{n^\prime}\times \frac{16}{n^\prime}}$) of the $n$-times down-scaled context path is performed, followed by $n\times n$ bilinear upsampling ($\mathcal{U}_{n\times n}$), where $n^\prime = 4$ if $n=4$ and $n^\prime =8$ if $n=16$. For the case $n^\prime \neq n$, another center cropping with $16 \times 16$ is conducted. Both, now spatially consistent paths are then merged by concatenation. Finally, the number of feature maps is reduced to the original number by a $1\times 1$ convolution. This operation is meant to learn which of the feature maps from the two paths are relevant and how they need to be combined. For application to multiple context encoders, spatial alignment is ensured for any individual context encoder in the same manner as described above. The spatially-aligned feature maps from all encoders are then concatenated. Afterwards, the feature map size is reduced by a $1 \times 1$ convolution with $512 \cdot (m+1)$ input feature maps and $512$ output feature maps, $c^{512 \cdot (m+1), 512}_{1 \times 1}$, where $m$ denotes the number of side encoders. \begin{figure}[htb!] \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/merge_block_v02_450dpi.png} \caption{Multi-scale merge block} \vspace{0.5cm} \label{subfig:msM-Block} \end{subfigure} \begin{subfigure}{\linewidth} \includegraphics[width=\linewidth]{figures_compressed/contextgate_block_v02_450dpi.png} \caption{Context classification gate block} \label{subfig:ccG-Block} \end{subfigure} \caption{ Schematic illustration of the multi-scale merge block (a) and the context classification gate block (b). $\mathcal{E}$, $\mathcal{D}$ are the encoder and decoder path of the network (cf. figure~\ref{subfig:YNetArchitecture}), respectively. The blue upward boxes are the feature maps with their respective sizes printed inside. $\oplus$ denotes concatenation and $\otimes$ channel-wise multiplication. The "leak" connection is a copy, followed by concatenation. $\mathcal{S}_{x \times y}$ stands for the central cropping of the size $x \times y$ in the spatial dimensions and $\mathcal{U}_{a\times b}$ the bilinear upsampling by factors of $a$ and $b$ in the dimensions 1 and 2. $w$ and $h$ denote the spatial width and height, $n$ the number of classes. $\mathcal{C}^{a,b}_{n_1,n_2}$ means $n_1 \times n_2$ convolution with $a$ input feature maps and $b$ output features maps (where $a$ may be omitted if the size of its input is explicitly given), followed by ReLU activation. } \label{fig:blocks} \end{figure} \subsubsection{Context classification gate} \label{subsec:context_gate} Alternatively to the use of multiple encoders that are merged by multi-scale merge blocks, we examined the potential of gating the class-wise predictions from the segmentation network by a context classifier. The context classifier tries to predict the content of the central detail patch from the low-resolution global context patch alone (cf. figure \ref{fig:patches}). As multiple, even mutually exclusive classes can be included in the detail patch, this states a multi-label classification problem. The context classification gate is depicted in figure \ref{subfig:ccG-Block}. The classification net outputs a probability value for each individual class (illustrated by the colored boxes in the bottom left corner). These are multiplied to the probability maps of the segmentation network in a channel-wise manner (similar to how excitations in squeeze-and-excite blocks are handled, cf. \citep{He2015}), thereby emphasizing probable classes and suppressing unlikely diagnoses. To allow the segmentation network to either use or ignore this guidance, a "leak" is constructed by concatenation of the original, un-excited feature maps to the excited ones, followed by a $1 \times 1$ convolution that is to learn how to combine the excited and the leaked feature maps. \subsubsection{msY-Net: Integrating context and tissue architecture} \label{sec:msY-Net} The msY-Net is provided with two patches of the scales 1 and 4 (which correspond to the inner two rectangles in figure \ref{fig:patches}) or 1 and 16 (inner and outer rectangle) as input. The full-resolution patch (scale 1) is fed into the standard U-Net architecture. The other is passed through a separate but analogous encoder architecture ("context encoder") built from another ResNet18. As the skip connections in the U-Net are for helping the decoder re-localise the high-level features and only the full-resolution patch is the one that needs to be segmented, the context encoder does \textit{not} have any skip connections to the decoder. The two paths are merged at the bottleneck of the original U-Net by use of the multi-scale merge block (cf. section \ref{subsec:merge_block}). The resulting architecture is sketched in figure \ref{subfig:YNetArchitecture}. In the following, we refer to a msY-Net that uses detail patches of the scale 1 and context patches of the scale $n$ as msY$_{(n)}$-Net. \subsubsection{msY\textit{I}-Net and msY$^2$-Net: Integration of global and local context} \label{subsec:msYIandmsY2} In order to provide the model with large- and small-scale context information at the same time, we constructed two models that either use two context encoders or one context encoder plus one context classification gate. For the former variant, we added two context encoders using a single multi-scale merge block. We refer to this model as msY$^2$-Net. For the latter variant, a context classification gate that uses the large-context patch was added to an underlying msY-Net. This model is outlined in figure \ref{subfig:YINetArchitecture}. The \textit{I} in the name msY\textit{I}-Net refers to the large-context classification sub-net paralleling the underlying msY-Net \textit{without} any fusion at the bottleneck or before. This network has two outputs: the segmentation of the full-resolution patch from its msY-Net part and the classification of the full-resolution patch content from the large-context encoder, its \textit{I}-part. Finally, the final logits of the two paths are combined by a context classification gate that modifies the segmentation output by the classification of its context (cf. section \ref{subsec:context_gate}). In the msY-Net and the msY$^2$-Net architectures, spatial correspondence between the full resolution encoder and the context encoder(s) is enforced in the multi-scale merge block (cf. figure \ref{fig:blocks}). It should be noted that for the large-context encoder in the msY\textit{I}-Net that ends in a classification gate instead of a multi-scale merge block, there is no such requirement. Therefore, this model can, in principle, be fed with large-context patches of arbitrary scales. \subsubsection{Context classification loss} \label{subsec:context_loss} Additional loss functions can improve the training of specific parts of U-Net-based architectures and are used in various manners \citep{Kickingereder2019, Li2019}, including a classification loss on an additional output derived from the bottleneck feature maps \citep{Metha2018}. Analogously, we computed a classification output from the feature maps of global context encoders (i.e., those with input scale 16) and used it to compute an additional classification loss. The classification loss is computed with respect to the content of the detail patch. As described in section \ref{sec:experiments}, we used a binary cross entropy (BCE) loss for the classification problem and added it to the segmentation loss. By the additional classification loss, we wanted to ease gradient flow through the deeper layers of the context encoder and to explicitly force it to focus on the content of the detail patch. \afterpage{\clearpage} \AddThispageHook{\thispagestyle{empty}} \begin{figure*} \begin{minipage}[t]{0.425\textwidth} \vspace{0pt} \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/Sketch_UNet_v02_450dpi.png} \caption{U-Net (baseline)} \label{subfig:UNetArchitecture} \end{subfigure} \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/Sketch_YNet_v02_450dpi.png} \caption{msY-Net} \label{subfig:YNetArchitecture} \end{subfigure} \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/Sketch_Y2Net_v02_450dpi.png} \caption{msY$^2$-Net} \label{subfig:Y2classNetArchitecture} \end{subfigure} \end{minipage} \hfill \begin{minipage}[t]{0.525\textwidth} \vspace{0pt} \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/Sketch_UINet_v02_450dpi.png} \caption{msU\textit{I}-Net} \label{subfig:UINetArchitecture} \end{subfigure} \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/Sketch_YINet_v02_450dpi.png} \caption{msY\textit{I}-Net} \label{subfig:YINetArchitecture} \end{subfigure} \caption{Schematic illustration of the main architectures studied in this paper. All main and side encoders use an ImageNet-pretrained ResNet-18. The skip connections and the decoder are the same throughout all of our models (see section \ref{sec:supp_baseline_details} for details). The multi-scale merge (msM) and context classification gate (ccG) blocks are described in sections \ref{subsec:merge_block} and \ref{subsec:context_gate} and sketched in figure \ref{fig:blocks}. Ad Avg Pool denotes adaptive average pooling, FC a fully-connected layer and Act the activation function.} \end{minipage} \label{fig:architectures} \end{figure*} \subsubsection{Early and multiple fusions by multi-scale merge blocks} Positioning the multi-scale merge block at the bottleneck level is not obligatory. Technically, a multi-scale merge block can merge any two encoders at any level at which the one shall influence the other (the connection is directed, not mutual). Also, usage of multiple multi-scale merge blocks is possible. Very early merge blocks will, however, not provide much context due to the small receptive fields of the center crop. On the other hand, earlier and in particular multiple fusions may allow for an additional processing of combined features and might facilitate modelling of complex combined features. It should be noted that these multiple merges are computationally inexpensive, as they only introduce additional learnable parameters through the $1 \times 1$ convolutions inside the merge blocks. All models are implemented using PyTorch v1.2.0 \citep{Pytorch}. \section{Materials \& methods} \subsection{Datasets} To examine generalizability of our findings, experiments were conducted on three different datasets for different entities of cancer, collected by different centers and scanned by different scanners. To ensure reproduciblity, we employed the following three publicly available challenge datasets: \subsubsection{PAIP 2019} \label{sec:PAIP_description} The PAIP (Pathology Artificial Intelligence Platform) 2019 challenge (part of the MICCAI 2019 Grand Challenge for Pathology) dataset comprises 50 de-identified whole-slide histopathology images from 50 patients that underwent resection for hepatocellular carcinoma (HCC) in three Korean hospitals (SNUH, SNUBH, SMG-SNU BMC) from 2005 to June 2018 \citep{Paip2019Dataset}. The slides have been stained by hematoxylin and eosin and digitalized using an Aperio AT2 whole-slide scanner at $\times 20$ power and \SI[per-mode=symbol]{0.5021}{\micro\meter\per\pixel} resolution, resulting in image sizes between $35,855 \times 39,407$ and $64,768 \times 47,009$ pixels (1.399 to 3.044 gigapixels). Regions of viable cancer cells as well as whole cancer regions (additionally including stroma cells and so forth) have been annotated manually. As described in \citep{Paip2019Dataset}, one pathologist with 11 years of experience in liver histopathology drew the initial annotations that were then reviewed by another expert pathologist. All cases of the given dataset include cancer regions. With respect to the Edmonson-Steiner grading system \citep{Edmondson1954}, their distribution is as follows: $N=7$ cases of grade 1, $N=23$ grade 2 tumors, and $N=20$ grade 3 samples. All de-identified pathology images and annotations were prepared and provided by the Seoul National University Hospital under a grant from the Korea Health Technology R\&D Project through the Korea Health Industry Development Institute (KHIDI), funded by the Ministry of Health \& Welfare, Republic of Korea (grant HI18C0316). Figure \ref{fig:dataset_example} (A) shows an exemplary whole-slide image from the dataset. It illustrates why hepatocellular carcinoma (HCC) is a prominent example of a cancer that is characterized not only by nuclear abberations, but also by local tissue abnormalities and large-scale features such as a so-called pseudocapsule (as illustrated in the figure). In fact, (low-grade) HCC is challenging to diagnose, as it is often identifiable \textit{only} by abberations of the long-range tissue architecture with only minor nuclear abnormalities, if any \citep{WHODigestive}. This makes the dataset well-suited for demonstration of the importance of multi- and particularly large-scale context features. \begin{figure}[h!] \centering \includegraphics[height=0.9\textheight]{figures_compressed/wsi_overview_halfwidth_300dpi.png} \caption{Exemplary cases from the PAIP 2019 (A), BACH 2018 (B) and CAMELYON 2016 (C) datasets. The arrows mark regions of hepatocallular carcinoma, breast carcinoma and a lymph node macrometastasis in A, B and C, respectively. In B, benign and in situ lesions are indicated by stars and x's. Beside the macrometastasis in C, also isolated tumor cells are found (next to the triangle).} \label{fig:dataset_example} \end{figure} \subsubsection{BACH 2018} \label{sec:BACH_description} The BACH (BreAst Cancer Histology) 2018 challenge \citep{Aresta2019} included the classification of small ($2.048 \times 1.536$) image patches as one task, and the segmentation of WSIs of breast biopsies as another. For the latter task, 10 pixel-wise annotated WSIs were provided for training. Two medical experts performed the image segmentation using the following four labels: (1) normal, (2) benign, (3) in situ and (4) invasive breast carcinoma. WSIs were acquired by a Leica SCN400 ($\times 20$ power, pixel scale: \SI[per-mode=symbol]{0.467}{\micro\meter\per\pixel}) in the period from 2013 to 2015 at the Centro Hospitalar Cova da Beira. The image sizes range from $50,529 \times 36,833$ to $64,703 \times 45,808$ pixels (1.861 to 2.964 gigapixels). Differential diagnosis in suspected breast cancer is known as a challenging task to human pathologists, and also to machine learning approaches. This is reflected in the results of the top-performing teams, reaching only moderate scores of $0.50$ to $0.69$ with respect to the custom challenge metric \citep{Aresta2019}. Figure \ref{fig:dataset_example} (B) illustrates how close the different diagnoses can be interwoven, with invasive and in situ parts of the carcinoma directly neighboring each other. \subsubsection{CAMELYON 2016/MM subset} \label{sec:CAMELYON_description} For the original CAMELYON (Cancer Metastases in Lymph Nodes) 2016 challenge \citep{EhteshamiBejnordi2017}, 399 WSIs of lymph nodes from women with confirmed breast cancer were gathered from two different centers (Radboud UMC and UMC Utrecht) during the first half of 2015. 240 of the 399 slides contained one or more nodal metastases. The images were scanned by a Pannoramic 250 Flash II ($\times 20$, pixel scale: \SI[per-mode=symbol]{0.243}{\micro\meter\per\pixel}) and a NanoZoomer-XR Digital slide scanner C12000-01 ($\times 40$, pixel scale: \SI[per-mode=symbol]{0.226}{\micro\meter\per\pixel}), respectively. Image sizes are $61,440 \times 53,760$ to $217,088 \times 103,936$ pixels (3.303 to 22.563 gigapixels). Initial annotations of lymph node metastases were drawn by medical students and then reviewed and corrected by two expert pathologists, as detailed in \citep{EhteshamiBejnordi2017}. This procedure fits the clinical observation that the detection of lymph node metastasis is a much easier task to human pathologists than diagnosis of HCC and pathologies of the breast. The original dataset contains macrometastases (tumor cell clusters with a diameter $\geq \SI{2}{\milli\meter}$), micrometastases ($\SI{0.2}{\milli\meter} \leq$ diameter $< \SI{2}{\milli\meter}$) as well as yet smaller clusters down to isolated tumor cells. Whilst these are all clinically relevant, isolated tumor cells and very small clusters do not infer with the global lymph node architecture \citep{WHOBreast}. For our experiments, we therefore created a subset of the CAMELYON 2016 dataset, consisting of 20 WSIs with at least one macrometastasis. We refer to this subset as CAMELYON 2016/MM, with MM for macrometastasis. The procedure for the establishment of the CAMELYON 16/MM subset is detailed in section \ref{sec:supp_camelyon_subset}. Figure \ref{fig:dataset_example} (C) provides a typical example of the CAMELYON 2016/MM dataset. As illustrated in figure \ref{fig:dataset_example} (C), this dataset still contains isolated tumor cells (triangle) and micrometastases along with the macrometastases (arrows), but with a higher weight put to the macrometastases and the larger length scales as compared to the original CAMELYON 2016 dataset. However, it should be noted that this task still differs from the other two, namely diagnosis of HCC and pathologies of the breast. Whilst macrometastases infer with the global architecture of the lymph node, they can still be diagnosed at the single- or few-cell level, by virtue of the differences of individual tumor and autochthonous cells. Therefore, even though larger scales certainly help the human pathologist with the diagnosis of macrometastases, the consideration of larger scales and the integration of multi-scale information is of lesser importance. \subsection{Preprocessing} WSI data preprocessing was similarly performed for all three datasets. Compared to the annotations originally provided for the respective challenges, we automatically generated annotations for an "overall tissue" as an additional class. This was achieved by thresholding of the original images with [R, G, B] $\leq$ [235, 210, 235], followed by binary morphological opening and closing operations. The rationale for introducing the additional class was threefold: First, it makes the "background" class, that would otherwise include not only all-white background \textit{but also} healthy tissue, much less heterogeneous. Second, it facilitates sampling of healthy tissue patches as meaningful negative examples (cf. section \ref{sec:experiments}). % Third, the automatically generated "overall tissue" annotations let us generalize the Reinhard color normalization \citep{Reinhard2001} to our application. Reinhard color normalization, as originally introduced, implicitly assumes the color statistics to be computed from meaningful image areas. In contrast, when directly applied to a WSI image, the fraction of all-white background would determine the color statistics and hence a color normalization, which is undesired. To avoid this, images were standardized by Reinhard colour normalization \citep{Reinhard2001} with respect to the "overall tissue" regions only, and then normalized to channel-wise zero average and unit variance, again in the tissue regions only. \subsection{Evaluation metrics} \label{sec:validation} The primary outcome parameter for all experiments was the Jaccard index with the classes weighted as detailed in section \ref{sec:experiments}. Secondary, for experiments on the BACH challenge data, we additionally report the custom metric used in that specific challenge \citep{Aresta2019}. Simply put, the metric is based on a pixel-wise accuracy measure that penalizes predictions that are farther from the given ground truth segmentation class. This is possible since the segmentation classes can be ordered according to their malignancy. We refer to that metric as the ``BACH metric''. For each dataset, we employed a 5-fold cross validation (CV) strategy with the split conducted at the level of the entire WSIs. Splitting is performed such that all classes were present in the validation set. The splits were computed once and then kept fixed throughout all experiments. The number of WSIs in the validation set was 10 for PAIP 2019, 2 for BACH 2018 and 4 for CAMELYON 2016/MM. Validation was performed after the following epochs (number of iterations): 1 ($1,920$), 3 ($5,760$), 5 ($9,600$), 8 ($15,360$), 11 ($21,120$), 16 ($30,720$), 21 ($40,320$), and then every 10 epochs ($19,200$ iterations). At each validation step, a fixed number of $3,072 \times 3,072$ pixel-sized sub-images per image was evaluated. We evaluated four such sub-images per validation WSI for PAIP, ten for BACH and six for CAMELYON 2016/MM, resulting in 40, 40 and 24 of these per spilt for PAIP, BACH and CAMELYON 2016/MM, respectively. The positions of the sub-images were randomly sampled with the condition that, for any WSI, all available classes shall be represented in at least $N_\mathrm{I} / N_\mathrm{c}$ of the sub-images. Here, $N_\mathrm{I}$ denotes the number of validation sub-images from that WSI and $N_\mathrm{c}$ is the number of available classes. Sampling of the sub-image positions was done once, before the first experiment, and then kept fixed throughout all experiments. This means that all models for a given split are evaluated with respect to the exact same sub-images at all validation steps. \subsection{Statistical analysis} \label{sec:statistics} For a given model, performance scores were evaluated per split, from which the mean and 95\%-confidence interval (CI) across the five splits were computed. To set a robust baseline for the experiments in section \ref{subsec:Res1}, the experiments for the baseline, single-scale U-Net were repeated three times and averaged, corresponding to a conservative estimate (over clustered experiments). The results for the individual runs of the baseline U-Net are provided in the section \ref{sec:supp_baseline_results}. As detailed in section \ref{sec:supp_statistical_significance_and_power}, we applied a corrected t-test for use in cross-validation settings \citep{NadeauBengio, BouckaertFrank} to test for statistical significance of the differences between the multi-scale models and the baseline U-Net. As further described in the same section, our study is underpowered for examining differences between different multi-scale models for significance. Therefore, we restricted the tests to comparisons between multi-scale architectures and the baseline U-Net. All statistical analyses were performed using R v4.0.0 \citep{RPackage}. \section{Experiments} \label{sec:experiments} Our experiments were designed as follows: First, we explored the behaviour of the msY-family on the PAIP 2019 dataset. Second, to examine generalizability of our findings, we evaluated the performance of the best performing architectures on the BACH 2018 and the CAMELYON 2016/MM dataset. Third, to aetiologically understand the behaviour of the msY-models and to narrow down the possible design variants, we conducted further experiments with selected variants of that models on the PAIP 2019 dataset. The training strategy and all hyperparameters were manually optimized for training of the baseline Res18-Unet on PAIP 2019 before the experiments and then kept fixed for all models and throughout all experiments. We aimed to reproduce a standard and widely used setup as much as possible, including the use of a common model as the baseline. For the same reason, we chose the binary cross entropy (BCE) loss as a common and widely used loss function (see, e.g., \citealt{heller2020kits}). BCE was used as a loss function for both classification (if the model has an additional classification output, cf. section \ref{subsec:context_gate}) and segmentation. The training process was split into (short pseudo\hbox{-})epochs of $1,920$ patches each, with all patches re-sampled after each individual "epoch". Compared to the use of a fixed number of pre-selected patches, this reduces overfitting given the limited memory resources and the large whole-slide images. For each pseudo-epoch, the patches were balanced with respect to both the individual cases in the training set and the available classes. Optimization was performed using Adam \citep{kingma2014adam} employing a learning rate of $10^{-3}$ and a learning rate decay with $\gamma = 0.5$ every 30 epochs (57,600 iterations). During training, we employed online data augmentation including the following standard operations: rotation, flip along the horizontal axis, saturation and brightness transformation. \subsection{Comparison of msY-family and baseline models} \subsubsection{PAIP 2019} \label{subsec:Exp1} The clinical scenario in our PAIP 2019 experiments is the segmentation of hepatocellular carcinoma for evaluation of tumor extent and margin status after the resection of hepatocellular carcinoma. The comparison of all multi-scale models (including the msY-family and the multi-scale ensembling variants) to the baseline U-Net resulted in a total of $N=9$ pairwise model comparisons. The evaluation of the corresponding results were the primary focus of the PAIP 2019 experiments. In addition, we also compared the different multi-scale architectures amongst each other and to multi-scale ensembles. However, as our study is underpowered for finding statistically significant results in between different multi-scale models (cf. section \ref{sec:supp_statistical_significance_and_power}), we only descriptively present the corresponding results. For the PAIP 2019 experiments, all models were trained for at least 120 pseudo-epochs ($230,400$ iterations) or until convergence of the validation loss was reached. According to the clinical scenario and due to the fact that the localisation of viable tumor cells with respect to the resection margins determines the resection status, we put additional weight to the viable tumor class as compared to the whole tumor class and weight the loss by [0, 1, 2, 6] for background, overall tissue, whole tumour and viable tumor classes, respectively. Segmentation performance as the primary outcome parameter was measured by the weighted average Jaccard index in the classes of interest, i.e., ``whole tumor'' and ``viable tumor'', where the weights are the same as above. As a secondary outcome, we furthermore examined the resource requirements of the models. We report the number of trainable parameters and measured the GPU memory footprint. For the latter, we observed the GPU memory usage of the training process, including forward and backward pass, at different batch sizes using the NVIDIA System Management Interface. The memory footprint of the model without system overhead was then deduced by linear regression and reported as gigabytes per patch in batch. The detailed measurements are reported in section \ref{sec:supp_memory_footprint_results}. For multi-scale models, the term ``patch'' is meant as a multi-scale patch, i.e., including the image patches for all individual scales. The input patch sizes in all models and for all scales are $512 \times 512$ pixels, except at scale 4 ($576 \times 576$ for the U-Net in the ensembles, $572 \times 572$ for the msY-family models). \subsubsection{BACH 2018} \label{subsec:Exp1_BACH} As described in section \ref{sec:BACH_description}, the BACH 2018 dataset allows us to evaluate the models with respect to their capability in the differential diagnoses of breast lesions, which represents the clinical scenario for this experiment. We started from the models from the PAIP 2019 experiments and, after replacement of the output layers, fine-tuned them on the BACH 2018 dataset. Without loss of generality, we fine-tuned the models from the split $i$ ($i \in [0, 1, 2, 3, 4]$) of the PAIP dataset on the split with the same index $i$ ($i \in [0, 1, 2, 3, 4]$) of the BACH 2018 dataset. Training was performed exactly as described in section \ref{subsec:Exp1}, with the following differences: First, for the first 10 pseudo-epochs ($19,200$ iterations), only the output layers were trained and the other weights were kept fixed. Fine-tuning of all weights was then continued for another 70 pseudo-epochs ($134,400$ iterations). Second, in line with the clinical scenario of breast lesion differential diagnosis, we put equal weights to all classes of interest, i.e., ``normal'', ``benign'', ``in situ'' and ``invasive carcinoma'', both for the computation of the loss function and the weighted-average Jaccard index. In order to examine whether our models are on par with state-of-the-art results on this task, we additionally evaluated the scores from the custom BACH 2018 metric as introduced in \citep{Aresta2019}. \subsubsection{CAMELYON 2016/MM} \label{subsec:Exp1_Camelyon} For our CAMELYON 2016/MM experiments, we again started using the models from the PAIP 2019 experiments and, after replacement of the output layers, fine-tuned them on the new dataset. Training was again performed as described in section \ref{subsec:Exp1} except that for the 10 pseudo-epochs ($19,200$ iterations) only the output layers were trained and the other weights were kept fixed. For CAMELYON 2016/MM dataset, we fine-tuned for at least 60 pseudo-epochs ($115,200$ iterations) or until convergence. Again, without loss of generality, we fine-tuned the models from the split $i$ ($i \in [0, 1, 2, 3, 4]$) of the PAIP 2019 dataset on the split with the same index $i$ ($i \in [0, 1, 2, 3, 4]$) of the CAMELYON 2016/MM dataset. \subsection{Context classification loss} \label{subsec:Exp3} We hypothesized that when using a global-scale encoder, introduction of an additional context classification loss as a means of "guidance" may benefit the model (cf. section \ref{subsec:context_loss}). In order to examine whether this is consistently the case, we trained the following models with and without context classification loss on the PAIP 2019 dataset: msY$_{(16)}$, msY$^2$, msY$_{(16),\text{MM}}$. \subsection{Spatial alignment in multi-scale merge blocks} \label{subsec:Exp2} We hypothesized that spatial matching is an essential step in the multi-scale merge block. To test this hypothesis, we compared a msY$^2$-Net, as an example where three different scales are merged, to a variant of the same model but with the multi-scale merge block replaced by a pure concatenation followed by a $1 \times 1$ convolution. This corresponds to a multi-scale merge block but without alignment of the spatial scales and without preserving spatial relationships. The rest of the spatially non-aligned msY$^2$-Net variant remained unchanged. If, in line with the hypothesis, the spatially non-aligned msY$^2$-Net performs worse than its standard variant with the correct multi-scale merge block, it remains to be examined whether this is "only" due to the clumsy initialization and can potentially be overcome without spatial merging. One might hypothesize that the deficit is not architecturally, but due to the introduction of new, untrained convolutions in the middle of the otherwise pretrained encoder. Therefore, we examined two different variants of the non-aligned model: one variant with randomly initialized weights and another variant where the $1 \times 1$ convolution was initialized with the unit matrix at the channels belonging to the main encoder and with 0's everywhere else, both superimposed with random noise (normal distribution with standard deviation $10^{-4}$). In the latter variant, the main encoder corresponded to the unperturbed, pretrained model at the beginning of the training process, up to noise. \subsection{Multiple merging} \label{subsec:Exp4} The multi-scale merge block as presented in section \ref{subfig:msM-Block} can be introduced at any level of the encoders. Therefore, it also allows for earlier or multiple fusions, which may allow for the additional processing of combined features. Very early merge blocks, however, do not provide much additional context, due to the cropping step inside the multi-scale merge block. Therefore, it is not a priori clear, at which level the merge connection shall be established or if multiple path merges can further benefit the model. In order to study whether models with multiple merges can be trained robustly and whether an effect through multiple merges can be found, we compared the segmentation performance of a msY$_{(16)}$-, a msY$^2$- and a msY\textit{I}-Net to the analogues of them with multi-scale merge blocks at all encoder levels. In this experiment, to examine a "maximum" msY-family variant trainable on our hardware, we used ResNet34 instead of a ResNet18 for the global context encoder of the msY$^2$-model. All other models and encoders were ResNet 18-based, as by our standard. Additionally, we examined to which extent the introduction of multiple merges increases the GPU memory footprint of the models. \section{Results} \label{sec:results} \subsection{Multi-scale multi-encoder models improve histopathology image segmentation} \label{subsec:Res1} Table \ref{tab:exp1_paip} reports the weighted average Jaccard index for the two non-trivial classes of the PAIP 2019 dataset, viable tumor and whole tumor (including stroma etc.). According to the clinical scenario of evaluating tumor extent and resection margin status in hepatocelullar carcinoma, 3x more weight is put onto the viable tumor class than on the whole tumor class (cf. section \ref{subsec:Exp1} for details). \begin{table*}[] \caption{Different models from the proposed multi-scale multi-encoder family and multi-scale ensembles versus the baseline U-Net. The figures in the table depict the class-weighted Jaccard index for whole and viable tumor classes on the PAIP 2019 dataset. A $\star$ denotes statistical significance at the level of $0.05$ when compared to the scale 1-U-Net. For a quick overview, the best results per split and overall are marked in bold, ignoring differences $<0.005$. } \centering\small \begin{threeparttable} \begin{tabular}{p{1.285cm} p{0.85cm} p{0.85cm} p{0.7cm} P P P P >{\scriptsize}p{0.4cm} p{2.6cm} >{\scriptsize}p{0.05cm}} \toprule \textbf{Arch.} & \textbf{Scales} & \textbf{\#\,pms.\tnote{$\dagger$}} & \textbf{Mem.\tnote{$\ddagger$}} & \multicolumn{6}{c}{\textbf{Weighted Jaccard}} & \\ \cmidrule(r){5-10} \addlinespace & & & & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] U-Net & 1 & 17.804 & 1.066 & 0.814 & 0.754 & 0.686 & 0.735 & 0.729 & 0.744 (0.707, 0.780) & \\ \addlinespace[\betweenmodels] Avg. Ens.& 1,\,4,\,16 & 53.412\tnote{\S} & 3.506\tnote{\S} & 0.890 & 0.853 & \textbf{0.836} & 0.900 & 0.835 & \textbf{0.863 (0.839, 0.887)} & $\star$\\ Log. Ens.& 1,\,4,\,16 & 53.412\tnote{\S} & 3.506\tnote{\S} & 0.859 & 0.814 & 0.802 & 0.915 & 0.818 & 0.842 (0.805, 0.878) & $\star$\\ Maj. Ens.& 1,\,4,\,16 & 53.412\tnote{\S} & 3.506\tnote{\S} & 0.883 & 0.838 & 0.770 & 0.875 & 0.816 & 0.836 (0.800, 0.873) & $\star$\\ \addlinespace[\betweenmodels] \multirow{2}{*}{msY-Net} & 1,\,4 & 29.282 & 1.422 & \textbf{0.902} & 0.800 & 0.712 & 0.796 & 0.794 & 0.801 (0.748, 0.854) & $\star$\\ & 1,\,16 & 29.284& 1.175 & 0.861 & 0.872 & 0.789 & 0.873 & 0.889 & 0.857 (0.826, 0.887) & $\star$\\ \addlinespace[\betweenmodels] \multirow{2}{*}{msU\textit{I}-Net} & 1,\,4 & 28.983 & 1.389 & 0.833 & 0.811 & 0.779 & 0.858 & 0.898 & 0.836 (0.800, 0.871) & $\star$\\ & 1,\,16 & 28.983 & 1.355 & 0.864 & 0.841 & 0.785 & 0.896 & 0.889 & 0.855 (0.820, 0.890) & $\star$\\ \addlinespace[\betweenmodels] msY\textit{I}-Net& 1,\,4,\,16 & 40.460 & 1.398 & 0.847 & \textbf{0.871} & 0.804 & 0.895 & \textbf{0.910} &\textbf{0.865 (0.833, 0.898)} & $\star$\\ \addlinespace[\betweenmodels] msY$^2$-Net& 1,\,4,\,16 & 40.761 & 1.561 & 0.847 & \textbf{0.873} & 0.795 & \textbf{0.934} & 0.876 & \textbf{0.865 (0.825, 0.905)} & $\star$\\ \\ \bottomrule \end{tabular} \begin{tablenotes} \item[\S] sum of three individual U-Nets (scales: 1, 4, 16) \item[$\dagger$] in units of one million parameters \item[$\ddagger$] GPU memory footprint given in gigabytes per image patch in batch \end{tablenotes} \end{threeparttable} \label{tab:exp1_paip} \end{table*} \begin{table*}[] \caption{The best performing multi-scale architectures versus the baseline U-Net on the BACH 2018 dataset. The figures in the table depict the class-average of the Jaccard index for normal tissue, benign lesions and in situ and invasive carcinoma. A $\star$ denotes statistical significance at the level of $0.05$ when compared to the scale 1-U-Net. The best results per split and overall are marked in bold, ignoring differences $<0.005$. } \centering\small \begin{threeparttable} \begin{tabular}{p{1.285cm} p{0.8cm} p{0.8cm} p{0.67cm} P P P P >{\scriptsize}p{0.38cm} p{2.55cm} >{\scriptsize}c} \toprule \textbf{Arch.} & \textbf{Scales} & \textbf{\#\,pms.\tnote{$\dagger$}} & \textbf{Mem.\tnote{$\ddagger$}} & \multicolumn{6}{c}{\textbf{Weighted Jaccard}} & \\ \cmidrule(r){5-10} \addlinespace & & & & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] U-Net & 1 & 17.804 & 1.066 & 0.523 & 0.476 & 0.478 & 0.510 & 0.501 & 0.498 (0.482, 0.514) \\ \addlinespace[\betweenmodels] Avg. Ens. & 1,\,4,\,16 & 53.412\tnote{\S} & 3.506\tnote{\S} & 0.593 & 0.540 & 0.518 & 0.581 & \textbf{0.622} & 0.571 (0.538, 0.603) & $\star$ \\ \addlinespace[\betweenmodels] msY\textit{I}-Net & 1,\,4,\,16 & 40.460 & 1.398 & \textbf{0.629} & 0.569 & 0.488 & 0.633 & 0.553 & \textbf{0.574 (0.527, 0.621)} & $\star$ \\ \addlinespace[\betweenmodels] msY$^2$-Net & 1,\,4,\,16 & 40.761 & 1.561 & 0.578 & \textbf{0.594} & \textbf{0.536} & \textbf{0.662} & 0.524 & \textbf{0.579 (0.536, 0.622)} & $\star$ \\ \bottomrule \end{tabular} \begin{tablenotes} \item[\S] sum of three individual U-Nets (scales: 1, 4, 16) \item[$\dagger$] in units of one million parameters \item[$\ddagger$] GPU memory footprint given in gigabytes per image patch in batch \end{tablenotes} \end{threeparttable} \label{tab:exp1_bach} \end{table*} \begin{table*}[] \caption{The best performing multi-scale architectures versus the baseline U-Net on the CAMELYON 2016/MM dataset. A ($\star$) denotes statistical significance at the level of $0.05$ when individually compared to the scale 1-U-Net (not correcting for multiple testing). For the comparisons of other models to the baseline U-Net, the null hypothesis cannot be rejected at $0.05$. The best results per split and overall are marked in bold, ignoring differences $<0.005$. } \centering\small \begin{threeparttable} \begin{tabular}{p{1.285cm} p{0.85cm} p{0.85cm} p{0.7cm} P P P P >{\scriptsize}p{0.4cm} p{2.6cm} >{\scriptsize}p{0.05cm}} \toprule \textbf{Arch.} & \textbf{Scales} & \textbf{\#\,pms.\tnote{$\dagger$}} & \textbf{Mem.\tnote{$\ddagger$}} & \multicolumn{6}{c}{\textbf{Jaccard (lymph node metastases)}} & \\ \cmidrule(r){5-10} \addlinespace & & & & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] U-Net & 1 & 17.804 & 1.066 & 0.696 & 0.770 & 0.805 & 0.903 & 0.803 & 0.796 (0.737, 0.854) & \\ \addlinespace[\betweenmodels] Avg. Ens. & 1,\,4,\,16 & 53.412\tnote{\S} & 3.506\tnote{\S} & 0.748 & \textbf{0.944} & 0.798 & 0.923 & 0.883 & \textbf{0.859 (0.794, 0.924)} \\ \addlinespace[\betweenmodels] msY\textit{I}-Net & 1,\,4,\,16 & 40.460 & 1.398 & 0.710 & 0.756 & 0.822 & 0.874 & 0.859 & 0.804 (0.750, 0.859) \\ \addlinespace[\betweenmodels] msY$^2$-Net & 1,\,4,\,16 & 40.761 & 1.561 & \textbf{0.775} & 0.804 & \textbf{0.865} & 0.918 & \textbf{0.889} & 0.850 (0.804, 0.897) & ($\star$) \\ \bottomrule \end{tabular} \begin{tablenotes} \item[\S] sum of three individual U-Nets (scales: 1, 4, 16) \item[$\dagger$] in units of one million parameters \item[$\ddagger$] GPU memory footprint given in gigabytes per image patch in batch \end{tablenotes} \end{threeparttable} \label{tab:exp1_camelyon} \end{table*} The first experiment shows a number of aspects: First and most importantly, there is a considerable improvement over the baseline U-Net by adding multi-scale input, either through ensembling or by multiple encoders as in the msY-family. The effect is found to be statistically significant in our experiments, even when tested only for five CV folds and even with a conservative correction for both the multiplicity of the pairwise comparisons and the violation of the independent samples-assumption underlying standard t-statistics. The proposed multi-scale multi-encoder models reach the same segmentation performance as our best multi-scale ensemble, but as individual end-to-end trainable models and with much lower resource requirements. Taking $msY^2$-Net as an example, it has only $76.3 \%$ of the parameters of a the corresponding ensemble of three U-Nets and comes with a GPU footprint reduced by $54.5 \%$ (if trained in parallel). Concerning the pairwise comparisons between different msY family architectures, our data suggest that, for the PAIP 2019 dataset, the global context patch provides more valuable information than the local context patch. However, the combination of both local and global context appears to lead to a further improvement, as the msY$^2$- and the msY\textit{I}-Net models are consistently found amongst the top performing approaches, but this effect seems marginal and cannot be reliably detected through this study. We next examined whether the superior performance of the multi-scale architectures translates to other datasets, tumor entities and tasks. For the task of breast lesion segmentation and differential diagnosis, the class-wise mean Jaccard indices are reported in table \ref{tab:exp1_bach}. The results are in line with our findings on the PAIP 2019 dataset. Notably, the Jaccard indices on the BACH 2018 dataset are globally lower than on the PAIP 2019 dataset for all architectures. This observation fits the considerations in section \ref{sec:BACH_description} that this is a particularly challenging task, also for the human pathologist. In addition, table \ref{tab:supp_exp1_bachmetric} reports the performances of the same architectures as evaluated by the custom Bach metric used in the original challenge (cf. \citep{Aresta2019} for details). The metric values for all architectures discussed in this section are in the range of the challenge results, with the multi-scale architectures, including the msY-family models and the multi-scale ensembles, reaching top performance. Finally, table \ref{tab:exp1_camelyon} shows the performance of corresponding models applied to lymph node metastases segmentation. The results are again in line with the findings on PAIP 2019 and BACH 2018 data. However, the performance increase through the use of multiple scales is smaller in CAMELYON 2016/MM (6.8\% as compared to 16.3\% for both PAIP 2019 and BACH 2018), which fits our considerations on the different nature and difficulty of these tasks (cf. section \ref{sec:CAMELYON_description}). With respect to the generalizability of these results, we further note that, later, an independent group has been able to present additional evidence in favor of these findings on yet other data \citep{van_rijthoven_hooknet_2020}. The group used a related but different end-to-end-trainable multi-scale model that confirms the benefit from the introduction of a context-encoder, though they train their context-encoder using an additional decoder that makes the model much heavier in terms of trainable parameters and GPU usage and voids the resource improvements as compared to multi-scale ensembles. \subsection{Context classification loss-based deep guidance for context encoder training} \label{subsec:Res4} In order to examine whether the additional classification loss is indeed helpful for ``guidance'' of the global context encoder during training, we re-examined the msY$^2$-, the msY$_{(16)}$- and the msY\textit{I}-Net models on the PAIP 2019 dataset when trained with or without the additional classification loss. From the results in table \ref{tab:exp2_class_loss}, it appears that the additional use of the classification loss consistently improves the model training. Recalling that the relative sizes of the detail and the global context encoder input patches (cf. figure \ref{fig:patches}) translate to a corresponding center-crop operation on the context encoder feature maps (as part of the multi-scale merge block, cf. figure \ref{subfig:msM-Block}), this behaviour might be understood intuitively as the the classification loss helping the context encoder acquire additional gradients for training. Importantly, this technique comes with a very moderate overhead both in terms of the number of additional parameters and the effective GPU memory footprint. \begin{table*}[] \caption{Context classification loss guidance for training of the global context encoder. Numbers are the class-weighted Jaccard indices for the PAIP 2019 dataset. The best results per pairwise comparison and split are marked in bold, where differences $<0.005$ are ignored.} \centering\small \begin{threeparttable} \begin{tabular}{p{1.285cm} p{1.3cm} p{0.85cm} p{0.7cm} P P P P >{\scriptsize}p{0.4cm} p{2.6cm}} \toprule \textbf{Arch.} & \textbf{Clss.\,loss} & \textbf{\#\,pms.\tnote{$\dagger$}} & \textbf{Mem.\tnote{$\ddagger$}} & \multicolumn{6}{c}{\textbf{Weighted Jaccard}} \\ \cmidrule(r){5-10} \addlinespace & & & & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] \multirow{2}{*}{msY$^2$-Net} & with & 40.761 & 1.561 & 0.847 & \textbf{0.873} & \textbf{0.795} & \textbf{0.934} & \textbf{0.876} & \textbf{0.865 (0.825, 0.905)}\\ & without & 40.759 & 1.436 & \textbf{0.903} & 0.851 & 0.737 & 0.826 & 0.779 & 0.819 (0.769, 0.869)\\ \addlinespace[\betweenmodels] \multirow{2}{*}{msY$_{16}$-Net} & with & 29.284 & 1.281 & 0.861 & \textbf{0.872} & \textbf{0.789} & \textbf{0.873} & \textbf{0.889} & \textbf{0.857 (0.826, 0.887)}\\ & without & 29.282 & 1.175 & \textbf{0.883} & 0.847 & 0.713 & 0.715 & 0.764 & 0.785 (0.724, 0.845)\\ \bottomrule \end{tabular} \begin{tablenotes} \item[$\dagger$] in units of one million parameters \item[$\ddagger$] GPU memory footprint given in gigabytes per image patch in batch \end{tablenotes} \end{threeparttable} \label{tab:exp2_class_loss} \end{table*} \subsection{Necessity for spatial alignment in multi-scale merge blocks} \label{subsec:Res2} Drawing on theoretical considerations, we have constructed the multi-scale merge blocks such that spatial relationships between the different paths are preserved upon fusion. Table \ref{tab:exp3_avg_bestloss} repeats the results for the msY$^2$-Net and compares them to those of two variants of the same architecture which both do \textit{not} adhere to this condition. These are constructed by concatenating the bottleneck feature maps from the different paths without any spatial alignment as part of the multi-scale merge block, where the two variants differ in that the merging $1 \times 1$ convolution is either initialized randomly or with pre-defined weights leaving the main path unperturbed at training startup (cf. section \ref{subsec:Exp3} for details). It can be seen that both these variants perform consistently worse than the proposed msY$^2$-Net with correct spatial alignment in the multi-scale merge block. This is irrespective of whether the weights of the $1 \times 1$ convolution are randomly initialized or whether they are initialized such that the ResNet18 encoder of the underlying U-Net is left untouched by the un-aligned merge connections. This suggests that the deficit through the missing alignment step may be architectural rather than only a disturbance of the pretrained encoder by the additional $1 \times 1$ convolution. We therefore conclude that, when merging paths at the bottleneck level in a manner as done by the multi-scale merge block, spatial matching is a necessary step. \begin{table*}[] \caption{Spatial alignment at multi-scale path fusion. Numbers are the class-weighted Jaccard indices for the PAIP 2019 dataset. All models are variants of the msY$^2$ architecture, either with spatial alignment at the multi-scale merge block (1, as per default) or without (2, 3). The best results per pairwise comparison and split are marked in bold, where differences $<0.005$ are ignored.} \centering\small \begin{tabular}{p{3.5cm} P P P P >{\footnotesize}p{1.0cm} p{2.6cm}} \toprule \textbf{msY$^2$-Net variant} & \multicolumn{6}{c}{\textbf{Weighted Jaccard}} \\ \cmidrule(r){2-7} \addlinespace & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] spatially aligned$^1$ & \textbf{0.870} & \textbf{0.835} & \textbf{0.796} & \textbf{0.902} & \textbf{0.865} & \textbf{0.854 (0.822, 0.885)} \\ \addlinespace[\betweenmodels] non-aligned, init$^2$ & \textbf{0.872} & 0.814 & 0.725 & 0.822 & 0.827 & 0.812 (0.770, 0.854) \\ \addlinespace[\betweenmodels] non-aligned, random$^3$ & \textbf{0.875} & 0.787 & 0.777 & 0.808 & 0.832 & 0.816 (0.785, 0.847) \\ \bottomrule \end{tabular} \label{tab:exp3_avg_bestloss} \end{table*} \subsection{Additional path fusions can be added by introduction of multiple multi-scale merge blocks} \label{subsec:Res3} Table \ref{tab:exp4_avg_bestloss} compares the standard msY$^2$-, the msY$_{(16)}$- and the msY\textit{I}-Net with multi-scale merge blocks only at the bottleneck to their respective analogues with multi-scale merge connections at every level of the encoder. \begin{table*}[] \caption{Multi-level multi-scale merging: For three different multi-scale architectures, the standard variant with multi-scale fusion by a single multi-scale merge block only at the bottleneck ("bottleneck") is compared to an analogous architecture, but with multi-scale merge blocks at each individual encoder level ("multiple"). Numbers are the class-weighted Jaccard indices at the PAIP 2019 dataset. The best results per pairwise comparison and split are marked in bold, where differences $<0.005$ are ignored.} \centering\small \begin{threeparttable} \begin{tabular}{p{1.6cm} p{1.2cm} p{0.72cm} p{0.65cm} P P P P >{\scriptsize}p{0.38cm} p{2.55cm}} \toprule \textbf{msY$^2$-Net variant} & \textbf{Merge block(s)} & \textbf{\#\,pms.\tnote{$\dagger$}} & \textbf{Mem.\tnote{$\ddagger$}} & \multicolumn{6}{c}{\textbf{Weighted Jaccard}} \\ \cmidrule(r){5-10} \addlinespace & & & & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] \multirow{2}{*}{msY$_{(16)}$-Net} & bottleneck & 29.284 & 1.175 & \textbf{0.861} & \textbf{0.872} & \textbf{0.789} & 0.873 & 0.889 & \textbf{0.857 (0.826, 0.887)} \\ & multiple & 29.464 & 1.281 & 0.854 & 0.848 & 0.769 & \textbf{0.881} & \textbf{0.903} & 0.851 (0.811, 0.891) \\ \addlinespace[\betweenmodels] \multirow{2}{*}{msY\textit{I}-Net} & bottleneck & 40.460 & 1.398 & 0.847 & \textbf{0.871} & \textbf{0.804} & 0.895 & \textbf{0.910} & \textbf{0.865 (0.833, 0.898)} \\ & multiple & 41.032 & 1.556 & \textbf{0.859} & \textbf{0.872} & \textbf{0.805} & \textbf{0.911} & 0.897 & \textbf{0.869 (0.836, 0.901)} \\ \addlinespace[\betweenmodels] \multirow{2}{*}{msY$^2_\text{(Res34)}$-Net} & bottleneck & 50.869 & 1.516 & 0.870 & 0.835 & 0.796 & \textbf{0.902} & 0.865 & 0.854 (0.822, 0.885) \\ & multiple & 51.140 & 1.608 & \textbf{0.876} & \textbf{0.879} & \textbf{0.802} & 0.863 & \textbf{0.915} & \textbf{0.867 (0.835, 0.899)} \\ \bottomrule \end{tabular} \begin{tablenotes} \item[$\dagger$] in units of one million parameters \item[$\ddagger$] GPU memory footprint given in gigabytes per image patch in batch \end{tablenotes} \end{threeparttable} \label{tab:exp4_avg_bestloss} \end{table*} Our study cannot find relevant differences between single-merge and multiple-merge setups. However, the additional merge connections did at least not lead to any instability in model training. Moreover, they come with a moderate increase in the number of trainable parameters and GPU memory requirements only. Therefore, multiple path fusions can be readily included in msY family models and can be used for further optimization, e.g. by systematic neural architecture searches. \section{Discussion and Conclusions} \label{sec:conclusion} Using the segmentation of carcinoma in hematoxylin-eosin (H\&E) stained whole-slide images % as an example task, our results show that the extensive integration of widely different spatial scales, as a ``mimicry'' of how humans approach analogous tasks, offers significant and relevant improvements over baseline single-scale U-Nets as the de facto standard in histopathology image segmentation. The improvement has been consistently shown for three different datasets, clinical scenarios and tumor entities. From a methodical and architectural perspective, our study presents a family of models that can integrate context from multiple scales and at various levels. As an overarching effect, it shows that when fusing encoder paths from different scales, spatial alignment and the preservation of spatial relationships is necessary. The proposed multi-scale merge block fulfils this requirement. The performance of the proposed architectures in terms of segmentation accuracy was further shown to be (at least) on par with ensembles of U-Nets, where the proposed multi-scale models models are end-to-end trainable systems with a reduced number of parameters and smaller memory footprint. It should, however, be noted that only common ensembling techniques have been studied, and more sophisticated techniques could potentially lead to further improvement. Moreover, different to \citet{karimi2020DLGleason}, the logistic regression-based ensembling did not lead to better performance than standard averaging of the class probabilities of the U-Net trained for the different scales. The reason remains so far unclear; potential explanations could be the different application addressed (Gleason scoring vs. tumor segmentation) and differences in implementation. It goes without saying that future research is also likely to optimize the multi-scale models presented herein much further. As the detailed structure of encoder, decoder and possible skip connections are left entirely untouched, the proposed multi-scale architectures can seamlessly be adopted to various encoder-decoder models. In particular, increased receptive fields in the individual encoders may benefit msY family models, as these would allow the center-crop of multi-scale merge block to acquire high-level features from a larger region. Therefore, the use of dilated or atrous convolutions and atrous spatial pyramid pooling \citep{Chen2017DeepLab, Chen2017Atrous} in the context encoders might considerably benefit the models of the proposed multi-scale architecture family. Continuing with potential for improvement, we note that -- as a straightforward extension of standard single scale CNN-based segmentation -- we trained our networks and encoders on the original "raw" image information. This approach neglects classical work on multi-resolution image representation, which could also be advantageous in the given application context. Moreover, adding multi-level wavelet transforms to the CNN architecture has recently be shown as a very promising means to enlarge perceptive fields \citep{liu_multi-level_2018,savareh_wavelet-enhanced_2019}, which, as said, can be particularly beneficial when implemented in the context encoders. We have shown how the proposed building blocks and the underlying intuition can be extended to any number of arbitrarily sized spatial scales, as relevant for the particular organ and disease of interest. Moreover, additional and early merge connections may offer the possibility to model more complex relations between the different scales. We have shown that the proposed multi-scale merge block can be flexibly used at many levels, and that even msY family models with path fusions at all possible encoder levels can be trained robustly and with minor GPU memory overhead. As both the relevant spatial scales as well as the complexity of the tasks % vary between applications, we finally envision that the msY family architectures with multiple merges open up a rich environment and search space also for neural architecture searches. Apart from the pure network architecture perspective, we used binary cross entropy as a very common, widely used and accepted loss function for the current study. The results, however, already reveal that the integration of an additional context content loss (although again implemented as cross entropy) improves performance. This suggests that the application- and/or architecture-specific loss function design bears the potential for a further improvement of WSI segmentation performance. Furthermore, we directly made use of the labels and annotations as provided by the respective challenge organizers for our experiments. It is, however, well known that the annotation of WSI slides is prone to errors and inter-observer variability. Over the past years, handling of label noise and uncertain annotation has attracted increasing interest and attention in the medical image analysis domain and in computational pathology, where, again, design of specific loss functions provides a promising approach (see \citet{karimi_deep_2020} for a recent review). Concerning the limitations of this study, the results are so far based on three publicly available H\&E stained WSI image datasets; it remains to be seen in future work whether the results generalize to different image data, other tasks, including tumor grading and regression tasks (e.g. for survival prediction), and other diseases. Furthermore, our analysis was built on a cross validation strategy; therefore, confirmation of our findings on separate independent test databases would clearly be desirable. Finally, whilst superior performance was consistently found for the three independent datasets, there still is a dataset dependency. In line with the underlying motivation of a human pathologist's mimicry, the data suggest that the performance increase is larger on tasks that require the human pathologist to integrate information from different scales (PAIP 2019, BACH 2018) and smaller on simpler tasks with more focus on individual cells (CAMELYON 2016/MM). Despite the remaining limitations and potential for future work, the presented study provides clear evidence that a mimicry of how human experts approach a specific task can be successfully used to develop specialized machine learning architectures. It advocates the integration of extensive multi-scale context into deep learning models for complex tasks in computational histopathology. \section*{Acknowledgments} This study was partially supported by an unrestricted grant from Olympus Co Hamburg, Germany, and by the Forschungszentrum Medizintechnik Hamburg (grant 02fmthh2017), Hamburg, Germany. RS gratefully acknowledges funding by the Studienstiftung des deutschen Volkes and the G\"unther Elin Krempel foundation. TR receives study support for various projects from Olympus Co Hamburg, Germany, but declares that there is no conflict to disclose with regards to this project. RW receives funding from Siemens Healthcare, Erlangen, Germany, but declares that there is no conflict to disclose regarding this project. The authors would like to thank NVIDIA for the donation of a graphics card under the GPU Grant Program. In addition, the authors are grateful toward Hinnerk St\"uben for his excellent technical support and toward Claus Hilgetag for proofreading and valuable discussions. \bibliographystyle{model2-names.bst}\biboptions{authoryear} \section{Introduction} \label{sec:introduction} \subsection{Clinical relevance and motivation} \textit{If the rumor is tumor, the issue is tissue.} Histopathology is the gold standard and backbone of cancer diagnosis, providing important information for various stages of the treatment process \citep{uicc_tnm_8thEd}. For instance, a fine-grained grading and staging of dysplasia and malignancy in precursor and cancer lesions, respectively, underlies individualized treatment planning in many tumor entities. Moreover, in curative surgery, the assessment of whether the resection specimen margins are free of tumour cells is of vital importance and a core task of clinical pathology. Human pathologists meet these challenges with the help of elaborated diagnostic criteria and grading systems for all kinds of cancer and cancer precursors. Even though their specific details vary for different kinds of cancer, many rely on a combination of features such as \begin{itemize} \item Nuclear inner density, i.e. color, \citep{Zink2004} and \item Deformed and varying nuclear shapes or global alterations of the nuclei \citep{Zink2004}. \item Increased nucleus to stroma ratio and \item Loss of nuclear polarity (e.g. nucleus not anymore at the bottom), as observed in many glandular tumours. \item Deformed cellular shapes and heterogeneous cell sizes, \item Loss of organ- and function-defining positions on small scales (e.g., neighboring cells not in a single layer, but some stacked over each other) and larger scales (e.g., atypical or deformed glandular shapes), \item Invasion (i.e., disrespecting global tissue order and borders between different layers). \end{itemize} As can be seen from this (not-exhaustive) list, diagnosis and grading of malignancy inherently involve a range of different scales. These scales may span a factor of more than a thousand-fold, ranging from sub-nuclear features (which lie on a spatial scale of $\approx \mathcal{O}(\SI{0.1}{\micro\metre})$) via nuclear, cellular ($\approx \mathcal{O}(\SI{10}{\micro\metre})$), inter-cellular ($\approx \mathcal{O}(\SI{100}{\micro\metre})$) to glandular and other higher organisational features ($\gtrapprox \mathcal{O}(\SI{1}{\milli\metre})$). The importance of the integration of information from different scales is reflected in how human pathologists approach these tasks: Regions of interest are repeatedly viewed at several different magnifications by turning the objective revolver of the microscopy back and forth. In this work, we aim to develop a family of deep learning models that architecturally mimic this behaviour. % \subsection{Related works} With their success in various computer vision tasks, deep learning methods have opened up a myriad of perspectives for computer vision and computer-aided diagnosis (CADx) in histopathology \citep{Litjens2017}. Image segmentation is a standard task in computer vision and machine learning and has a direct clinical use in the field of pathology, be it the analysis of the margin status (i.e., distance of tumor cells to resection margin), area-dependent grading systems (with the Gleason score in prostate cancer as a prominent example \citep{Gleason,karimi2020DLGleason,nir_automatic_2018}), or specific research applications, such as the analysis of 3d-tumor morphology from a multiplicity of tissue sections \citep{Schmitz2018, Segovia2019}. In medical image segmentation, standard computer vision models, including fully convolutional neural networks (FCNs, \citealt{Long2015}) and, most prominently, U-Net-based architectures \citep{Ronneberger2015} have successfully been applied to various scenarios and imaging modalities \citep{Litjens2017, Isensee2018}, including computational histopathology \citep{Bulten2019, Liu, Campanella2019}. In addition, more specialized network architectures \citep{Bejnordi2017, li_multi-scale_2018, Vu2019} and training techniques \citep{Campanella2019, Wang2019} have been proposed to address the challenges of computational histopathology. Some of these works touch upon the question on how additional context can be provided to the network, but are mainly confined to local, similar-scale context \citep{Bejnordi2017, li_multi-scale_2018} and/or sliding-window convolutional neural network (CNN) techniques \citep{Bejnordi2017, wetteland_multiscale_nodate} or classification tasks. Early on, \citet{nir_automatic_2018} described the potential of multi-scale features from more separate scales in classical, "hand-crafted" feature-driven machine learning. By integrating the features from different scales by use of a support vector machine (SVM), they paved the way for many works to follow. Recently, the same research group advocated the use of individually trained CNNs as feature extractors whose outputs were, in an ensembling-like fashion, combined by a logistic regression model into a final Gleason grade classification in prostate cancer \citep{karimi2020DLGleason}. Similarly, \citet{wetteland_multiscale_nodate} suggested to train distinct CNNs as feature extractors and merge their information in a classification network in replacement of the original fully-connected layers, which can again be viewed as an ensembling approach. For application to breast cancer and its differential diagnoses, \citet{ning_multiscale_2019} proposed a similar ensembling technique, but again based on classical, hand-crafted feature extractors and using an SVM for integration of multi-scale information. In 3d imaging, multi-path end-to-end trainable models have incorporated similar-scale and local context to reduce the memory footprint and alleviate the problem of the otherwise extremely limited input size in memory-costly 3d-nets \citep{Kamnitsas2017}, with remarkable success in e.g. the sub-acute stroke lesion segmentation challenge ISLES 2015 \citep{maier_isles_2017}. In histopathology, there also have been attempts toward end-to-end trainable multi-scale models \citep{gu_multi-resolution_2018,li_multi-scale_2018}, but which have so far shown only minor benefits as compared to the aforementioned ensembling variants. This observation indicates that multi-scale deep learning-based segmentation of histopathology data is still in its infancy and its actual potential remains to be unveiled. Introduction of additional image context has been a topic of interest also in the natural image domain, resulting in prominent techniques like dilated or atrous convolutions and atrous spatial pyramid pooling \citep{Chen2017DeepLab, Chen2017Atrous}. % Further, \citet{Zhang2018} proposed an FCN architecture that explicitly predicts "scaling factors" for the possible classes from the bottle-neck layer, which are then used to multiply and, thus, highlight the respective feature maps at the final layer. The scaling factors can capture the overall image content and can be trained by use of an additional classification loss. Similarly, \citet{Zhou2019} introduced a reinforcement-based strategy involving two sub-nets, one for encoding context and one for the actual segmentation task. By the properties of the natural image domain, namely the limited image size as compared to histopathologic whole-slide images (WSIs), the scales of detailed and contextual features in these works are, however, much more similar than in histopathology. Congruously, the primary aim of these approaches has been to "help clarify local confusion" \citep{Liu2015} or to make better use of what is fed into to the net anyways, rather than to add large and otherwise unavailable context. For histopathology image segmentation as a specific task, however, we aim for the integration of otherwise unavailable information from much different scales into a single, end-to-end trainable model. \subsection{Contributions} There exist plenty of highly optimized, U-Net-derived architectures employing, for instance, elaborate skip connections \citep{badrinarayanan_segnet_2017}, dense connections \citep{li_denseunet_2018}, attention gating techniques \citep{oktay_attention_2018} and newer FCN architectures like DeepLab \citep{Chen2017DeepLab}. Nevertheless, standard U-Nets have turned out to be robust work horses for many medical computer vision tasks and are hard to beat by internal modifications of the base architecture \citep{Isensee2018, isensee_breaking_the_spell_2019}. However, histopathology diagnosis is, by the nature of the large whole-slide images and with closely interwoven features from very different scales, a very specific and challenging task. Therefore, drawing on the U-Net as a standard base model, this work explores whether an architectural mimicry of how human experts approach this specific task can improve the performance of FCNs for histopathology image segmentation. The main contributions of this paper are as follows: We introduce a family of U-Net-based fully convolutional deep neural nets that are specifically designed for the extensive integration of largely different spatial scales. First, we propose a simple building block that can fuse various encoders with different spatial scales in a manner that preserves relative spatial scales. As a light-weight alternative, we also propose the use of an independent context classification model for gating the segmentation model output. Second, we integrate these building blocks into different multi-scale FCNs and % compare their segmentation performance to U-Net baseline architectures. To illustrate generalizability, the evaluation is based on three different publicly available image datasets provided by recent challenges. Third, by a systematic, stepwise analysis, we identify relevant aspects of the proposed multi-scale FCN family, including the necessity of preserving spatial relationships between different encoders, the benefits from deep guidance by an additional classification loss and possible generalizations through multiple path fusions. Based on these observations, we narrow down the possible multi-scale setups and comment on how to systematically adapt the presented multi-scale FCN family to specific deep learning tasks in histopathology. To foster reproducibility and further research, our proposed models are publicly provided as open source\footnote{https://github.com/ipmi-icns-uke/multiscale/. Please do not hesitate to contact the corresponding author for help with implementation and usage.\label{githubour}} to the community. \section{Model architectures} \subsection{Baseline architectures} \subsubsection{U-Net architecture} Beyond the still popular sliding-window CNN-based techniques, U-Net-based FCN architectures form the de facto standard in the medical image domain \citep{Isensee2018}, including histopathology \citep{Litjens2017}. Beating the standard U-Net by internal modifications is evidently hard \citep{isensee_breaking_the_spell_2019, Isensee2018} and beyond the scope of this work. Rather, as outlined in the introduction, this study examined whether by designing a model of standard components but with its larger architecture mimicking human expert diagnostic procedures, further improvement can be made. Therefore, we chose a non-modified ResNet18-based U-Net \citep{He2015} as a common, standard U-Net variant to form the baseline for this study\footnote{ An implementation of this architecture can be found at % https://github.com/usuyama/pytorch-unet. Accessed: 2019-09-19.}. For a detailed description of the baseline model, the reader is referred to section \ref{sec:supp_baseline_results} in the Supplementary Materials. In brief, the ResNet18 forms the encoder of the otherwise standard U-Net architecture (cf. figure \ref{fig:supp_baseline}), where the encoding ResNet18 has been pre-trained on the ImageNet dataset \citep{ImageNet}. For our study, the baseline model was trained at full-resolution patches of $512 \times 512$ pixels of the WSI images. \subsubsection{Multi-scale ensembles as an upper bound for state-of-the-art performance} We additionally compared our proposed models to ensembling techniques to see if we can reach or even excel their performance with a single, and computationally less costly, model. Inspired by the approach of \citet{karimi2020DLGleason} to Gleason grading, individual U-Nets were trained on the different image scales. The predicted probabilities were then re-sampled to the target resolution and merged by use of different ensembling techniques, % namely hard majority votes, average ensembles (soft majority voting), and logistic regression ensembles. For each ensemble, the best individual model per scale was selected. The logistic regression model was trained and evaluated on the same train and test sets as the individual models. By this procedure, % we aimed to define a thorough and systematic upper bound for state-of-the-art multi-scale ensembling performance. \subsection{The msY model family: Multi-scale multi-encoder architectures} \label{sec:multi_scale_models} To provide the network with context and architectural information (cf. figure \ref{fig:patches} and the considerations in section \ref{sec:introduction}), we constructed a family of multi-scale multi-encoder networks building upon the baseline Res-U-Net architecture. In the following, we first introduce the underlying blocks for integration of multi-scale context, namely the \textit{multi-scale merge block} and the \textit{context classification gate}. Afterwards, we describe the different variants of our setup that are examined in this study. Technically, it is worth noting that common whole-slide image (WSI) formats use so-called pyramid representations, which contain the original image in multiple, downsampled versions. Therefore, multiple scales can directly be loaded from file, with no need for resampling and, hence, only a moderate overhead only. \begin{figure*}[htb] \centering \includegraphics[width=\textwidth]{figures_compressed/patches_all_blue_new_450dpi.png} \caption{Input patches at different spatial scales, shown in an illustrative region of the same whole-slide image as depicted in figure \ref{fig:dataset_example}. The innermost, black rectangle corresponds to a $512 \times 512$ pixel patch of the scale 1, which we refer to as the ``detail patch'' (zoomed view in the top right inset). The next, dark blue rectangle corresponds to a $572 \times 572$ pixel patch of the scale 4. It contains information on how the cells are organised in strands and "trabeculae" -- or whether the cells violate these patterns. These features are hard or impossible to deduce using the innermost patch alone. In this sense, the dark blue patch adds "architectural" information. We refer to it as "local context" or the "local context patch". A zoomed view of it is shown in the bottom right inset. The outermost, light blue rectangle, which we call a "global context patch", contains information on the large-scale organization of the tissue, such as the pseudocapsule, which is typical for hepatocellular carcinoma. Whilst a standard U-Net is provided with the information from the detail patch solely, a msY-Net architecture (section \ref{sec:msY-Net}) can integrate information from the detail patch plus either the local or the global context patch. The msY$^2$- and msY$\textit{I}$-Net architectures are two options for integration of all three scales. The scale bar is 2 mm.} \label{fig:patches} \end{figure*} \subsubsection{Multi-scale merge block: spatial relationship preserving path fusion in multi-scale multi-encoder models} \label{subsec:merge_block} Figure \ref{subfig:msM-Block} sketches the functioning of the multi-scale merge block. At the bottleneck level, the feature maps from both the main encoder and the side (context) encoder have sizes of $16 \times 16 \times 512$. In order to spatially match the output of the full resolution encoder, a $n^\prime \times n^\prime$ center cropping ($\mathcal{S}_{\frac{16}{n^\prime}\times \frac{16}{n^\prime}}$) of the $n$-times down-scaled context path is performed, followed by $n\times n$ bilinear upsampling ($\mathcal{U}_{n\times n}$), where $n^\prime = 4$ if $n=4$ and $n^\prime =8$ if $n=16$. For the case $n^\prime \neq n$, another center cropping with $16 \times 16$ is conducted. Both, now spatially consistent paths are then merged by concatenation. Finally, the number of feature maps is reduced to the original number by a $1\times 1$ convolution. This operation is meant to learn which of the feature maps from the two paths are relevant and how they need to be combined. For application to multiple context encoders, spatial alignment is ensured for any individual context encoder in the same manner as described above. The spatially-aligned feature maps from all encoders are then concatenated. Afterwards, the feature map size is reduced by a $1 \times 1$ convolution with $512 \cdot (m+1)$ input feature maps and $512$ output feature maps, $c^{512 \cdot (m+1), 512}_{1 \times 1}$, where $m$ denotes the number of side encoders. \begin{figure}[htb!] \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/merge_block_v02_450dpi.png} \caption{Multi-scale merge block} \vspace{0.5cm} \label{subfig:msM-Block} \end{subfigure} \begin{subfigure}{\linewidth} \includegraphics[width=\linewidth]{figures_compressed/contextgate_block_v02_450dpi.png} \caption{Context classification gate block} \label{subfig:ccG-Block} \end{subfigure} \caption{ Schematic illustration of the multi-scale merge block (a) and the context classification gate block (b). $\mathcal{E}$, $\mathcal{D}$ are the encoder and decoder path of the network (cf. figure~\ref{subfig:YNetArchitecture}), respectively. The blue upward boxes are the feature maps with their respective sizes printed inside. $\oplus$ denotes concatenation and $\otimes$ channel-wise multiplication. The "leak" connection is a copy, followed by concatenation. $\mathcal{S}_{x \times y}$ stands for the central cropping of the size $x \times y$ in the spatial dimensions and $\mathcal{U}_{a\times b}$ the bilinear upsampling by factors of $a$ and $b$ in the dimensions 1 and 2. $w$ and $h$ denote the spatial width and height, $n$ the number of classes. $\mathcal{C}^{a,b}_{n_1,n_2}$ means $n_1 \times n_2$ convolution with $a$ input feature maps and $b$ output features maps (where $a$ may be omitted if the size of its input is explicitly given), followed by ReLU activation. } \label{fig:blocks} \end{figure} \subsubsection{Context classification gate} \label{subsec:context_gate} Alternatively to the use of multiple encoders that are merged by multi-scale merge blocks, we examined the potential of gating the class-wise predictions from the segmentation network by a context classifier. The context classifier tries to predict the content of the central detail patch from the low-resolution global context patch alone (cf. figure \ref{fig:patches}). As multiple, even mutually exclusive classes can be included in the detail patch, this states a multi-label classification problem. The context classification gate is depicted in figure \ref{subfig:ccG-Block}. The classification net outputs a probability value for each individual class (illustrated by the colored boxes in the bottom left corner). These are multiplied to the probability maps of the segmentation network in a channel-wise manner (similar to how excitations in squeeze-and-excite blocks are handled, cf. \citep{He2015}), thereby emphasizing probable classes and suppressing unlikely diagnoses. To allow the segmentation network to either use or ignore this guidance, a "leak" is constructed by concatenation of the original, un-excited feature maps to the excited ones, followed by a $1 \times 1$ convolution that is to learn how to combine the excited and the leaked feature maps. \subsubsection{msY-Net: Integrating context and tissue architecture} \label{sec:msY-Net} The msY-Net is provided with two patches of the scales 1 and 4 (which correspond to the inner two rectangles in figure \ref{fig:patches}) or 1 and 16 (inner and outer rectangle) as input. The full-resolution patch (scale 1) is fed into the standard U-Net architecture. The other is passed through a separate but analogous encoder architecture ("context encoder") built from another ResNet18. As the skip connections in the U-Net are for helping the decoder re-localise the high-level features and only the full-resolution patch is the one that needs to be segmented, the context encoder does \textit{not} have any skip connections to the decoder. The two paths are merged at the bottleneck of the original U-Net by use of the multi-scale merge block (cf. section \ref{subsec:merge_block}). The resulting architecture is sketched in figure \ref{subfig:YNetArchitecture}. In the following, we refer to a msY-Net that uses detail patches of the scale 1 and context patches of the scale $n$ as msY$_{(n)}$-Net. \subsubsection{msY\textit{I}-Net and msY$^2$-Net: Integration of global and local context} \label{subsec:msYIandmsY2} In order to provide the model with large- and small-scale context information at the same time, we constructed two models that either use two context encoders or one context encoder plus one context classification gate. For the former variant, we added two context encoders using a single multi-scale merge block. We refer to this model as msY$^2$-Net. For the latter variant, a context classification gate that uses the large-context patch was added to an underlying msY-Net. This model is outlined in figure \ref{subfig:YINetArchitecture}. The \textit{I} in the name msY\textit{I}-Net refers to the large-context classification sub-net paralleling the underlying msY-Net \textit{without} any fusion at the bottleneck or before. This network has two outputs: the segmentation of the full-resolution patch from its msY-Net part and the classification of the full-resolution patch content from the large-context encoder, its \textit{I}-part. Finally, the final logits of the two paths are combined by a context classification gate that modifies the segmentation output by the classification of its context (cf. section \ref{subsec:context_gate}). In the msY-Net and the msY$^2$-Net architectures, spatial correspondence between the full resolution encoder and the context encoder(s) is enforced in the multi-scale merge block (cf. figure \ref{fig:blocks}). It should be noted that for the large-context encoder in the msY\textit{I}-Net that ends in a classification gate instead of a multi-scale merge block, there is no such requirement. Therefore, this model can, in principle, be fed with large-context patches of arbitrary scales. \subsubsection{Context classification loss} \label{subsec:context_loss} Additional loss functions can improve the training of specific parts of U-Net-based architectures and are used in various manners \citep{Kickingereder2019, Li2019}, including a classification loss on an additional output derived from the bottleneck feature maps \citep{Metha2018}. Analogously, we computed a classification output from the feature maps of global context encoders (i.e., those with input scale 16) and used it to compute an additional classification loss. The classification loss is computed with respect to the content of the detail patch. As described in section \ref{sec:experiments}, we used a binary cross entropy (BCE) loss for the classification problem and added it to the segmentation loss. By the additional classification loss, we wanted to ease gradient flow through the deeper layers of the context encoder and to explicitly force it to focus on the content of the detail patch. \afterpage{\clearpage} \AddThispageHook{\thispagestyle{empty}} \begin{figure*} \begin{minipage}[t]{0.425\textwidth} \vspace{0pt} \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/Sketch_UNet_v02_450dpi.png} \caption{U-Net (baseline)} \label{subfig:UNetArchitecture} \end{subfigure} \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/Sketch_YNet_v02_450dpi.png} \caption{msY-Net} \label{subfig:YNetArchitecture} \end{subfigure} \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/Sketch_Y2Net_v02_450dpi.png} \caption{msY$^2$-Net} \label{subfig:Y2classNetArchitecture} \end{subfigure} \end{minipage} \hfill \begin{minipage}[t]{0.525\textwidth} \vspace{0pt} \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/Sketch_UINet_v02_450dpi.png} \caption{msU\textit{I}-Net} \label{subfig:UINetArchitecture} \end{subfigure} \begin{subfigure}{\linewidth} \centering \includegraphics[width=\linewidth]{figures_compressed/Sketch_YINet_v02_450dpi.png} \caption{msY\textit{I}-Net} \label{subfig:YINetArchitecture} \end{subfigure} \caption{Schematic illustration of the main architectures studied in this paper. All main and side encoders use an ImageNet-pretrained ResNet-18. The skip connections and the decoder are the same throughout all of our models (see section \ref{sec:supp_baseline_details} for details). The multi-scale merge (msM) and context classification gate (ccG) blocks are described in sections \ref{subsec:merge_block} and \ref{subsec:context_gate} and sketched in figure \ref{fig:blocks}. Ad Avg Pool denotes adaptive average pooling, FC a fully-connected layer and Act the activation function.} \end{minipage} \label{fig:architectures} \end{figure*} \subsubsection{Early and multiple fusions by multi-scale merge blocks} Positioning the multi-scale merge block at the bottleneck level is not obligatory. Technically, a multi-scale merge block can merge any two encoders at any level at which the one shall influence the other (the connection is directed, not mutual). Also, usage of multiple multi-scale merge blocks is possible. Very early merge blocks will, however, not provide much context due to the small receptive fields of the center crop. On the other hand, earlier and in particular multiple fusions may allow for an additional processing of combined features and might facilitate modelling of complex combined features. It should be noted that these multiple merges are computationally inexpensive, as they only introduce additional learnable parameters through the $1 \times 1$ convolutions inside the merge blocks. All models are implemented using PyTorch v1.2.0 \citep{Pytorch}. \section{Materials \& methods} \subsection{Datasets} To examine generalizability of our findings, experiments were conducted on three different datasets for different entities of cancer, collected by different centers and scanned by different scanners. To ensure reproduciblity, we employed the following three publicly available challenge datasets: \subsubsection{PAIP 2019} \label{sec:PAIP_description} The PAIP (Pathology Artificial Intelligence Platform) 2019 challenge (part of the MICCAI 2019 Grand Challenge for Pathology) dataset comprises 50 de-identified whole-slide histopathology images from 50 patients that underwent resection for hepatocellular carcinoma (HCC) in three Korean hospitals (SNUH, SNUBH, SMG-SNU BMC) from 2005 to June 2018 \citep{Paip2019Dataset}. The slides have been stained by hematoxylin and eosin and digitalized using an Aperio AT2 whole-slide scanner at $\times 20$ power and \SI[per-mode=symbol]{0.5021}{\micro\meter\per\pixel} resolution, resulting in image sizes between $35,855 \times 39,407$ and $64,768 \times 47,009$ pixels (1.399 to 3.044 gigapixels). Regions of viable cancer cells as well as whole cancer regions (additionally including stroma cells and so forth) have been annotated manually. As described in \citep{Paip2019Dataset}, one pathologist with 11 years of experience in liver histopathology drew the initial annotations that were then reviewed by another expert pathologist. All cases of the given dataset include cancer regions. With respect to the Edmonson-Steiner grading system \citep{Edmondson1954}, their distribution is as follows: $N=7$ cases of grade 1, $N=23$ grade 2 tumors, and $N=20$ grade 3 samples. All de-identified pathology images and annotations were prepared and provided by the Seoul National University Hospital under a grant from the Korea Health Technology R\&D Project through the Korea Health Industry Development Institute (KHIDI), funded by the Ministry of Health \& Welfare, Republic of Korea (grant HI18C0316). Figure \ref{fig:dataset_example} (A) shows an exemplary whole-slide image from the dataset. It illustrates why hepatocellular carcinoma (HCC) is a prominent example of a cancer that is characterized not only by nuclear abberations, but also by local tissue abnormalities and large-scale features such as a so-called pseudocapsule (as illustrated in the figure). In fact, (low-grade) HCC is challenging to diagnose, as it is often identifiable \textit{only} by abberations of the long-range tissue architecture with only minor nuclear abnormalities, if any \citep{WHODigestive}. This makes the dataset well-suited for demonstration of the importance of multi- and particularly large-scale context features. \begin{figure}[h!] \centering \includegraphics[height=0.9\textheight]{figures_compressed/wsi_overview_halfwidth_300dpi.png} \caption{Exemplary cases from the PAIP 2019 (A), BACH 2018 (B) and CAMELYON 2016 (C) datasets. The arrows mark regions of hepatocallular carcinoma, breast carcinoma and a lymph node macrometastasis in A, B and C, respectively. In B, benign and in situ lesions are indicated by stars and x's. Beside the macrometastasis in C, also isolated tumor cells are found (next to the triangle).} \label{fig:dataset_example} \end{figure} \subsubsection{BACH 2018} \label{sec:BACH_description} The BACH (BreAst Cancer Histology) 2018 challenge \citep{Aresta2019} included the classification of small ($2.048 \times 1.536$) image patches as one task, and the segmentation of WSIs of breast biopsies as another. For the latter task, 10 pixel-wise annotated WSIs were provided for training. Two medical experts performed the image segmentation using the following four labels: (1) normal, (2) benign, (3) in situ and (4) invasive breast carcinoma. WSIs were acquired by a Leica SCN400 ($\times 20$ power, pixel scale: \SI[per-mode=symbol]{0.467}{\micro\meter\per\pixel}) in the period from 2013 to 2015 at the Centro Hospitalar Cova da Beira. The image sizes range from $50,529 \times 36,833$ to $64,703 \times 45,808$ pixels (1.861 to 2.964 gigapixels). Differential diagnosis in suspected breast cancer is known as a challenging task to human pathologists, and also to machine learning approaches. This is reflected in the results of the top-performing teams, reaching only moderate scores of $0.50$ to $0.69$ with respect to the custom challenge metric \citep{Aresta2019}. Figure \ref{fig:dataset_example} (B) illustrates how close the different diagnoses can be interwoven, with invasive and in situ parts of the carcinoma directly neighboring each other. \subsubsection{CAMELYON 2016/MM subset} \label{sec:CAMELYON_description} For the original CAMELYON (Cancer Metastases in Lymph Nodes) 2016 challenge \citep{EhteshamiBejnordi2017}, 399 WSIs of lymph nodes from women with confirmed breast cancer were gathered from two different centers (Radboud UMC and UMC Utrecht) during the first half of 2015. 240 of the 399 slides contained one or more nodal metastases. The images were scanned by a Pannoramic 250 Flash II ($\times 20$, pixel scale: \SI[per-mode=symbol]{0.243}{\micro\meter\per\pixel}) and a NanoZoomer-XR Digital slide scanner C12000-01 ($\times 40$, pixel scale: \SI[per-mode=symbol]{0.226}{\micro\meter\per\pixel}), respectively. Image sizes are $61,440 \times 53,760$ to $217,088 \times 103,936$ pixels (3.303 to 22.563 gigapixels). Initial annotations of lymph node metastases were drawn by medical students and then reviewed and corrected by two expert pathologists, as detailed in \citep{EhteshamiBejnordi2017}. This procedure fits the clinical observation that the detection of lymph node metastasis is a much easier task to human pathologists than diagnosis of HCC and pathologies of the breast. The original dataset contains macrometastases (tumor cell clusters with a diameter $\geq \SI{2}{\milli\meter}$), micrometastases ($\SI{0.2}{\milli\meter} \leq$ diameter $< \SI{2}{\milli\meter}$) as well as yet smaller clusters down to isolated tumor cells. Whilst these are all clinically relevant, isolated tumor cells and very small clusters do not infer with the global lymph node architecture \citep{WHOBreast}. For our experiments, we therefore created a subset of the CAMELYON 2016 dataset, consisting of 20 WSIs with at least one macrometastasis. We refer to this subset as CAMELYON 2016/MM, with MM for macrometastasis. The procedure for the establishment of the CAMELYON 16/MM subset is detailed in section \ref{sec:supp_camelyon_subset}. Figure \ref{fig:dataset_example} (C) provides a typical example of the CAMELYON 2016/MM dataset. As illustrated in figure \ref{fig:dataset_example} (C), this dataset still contains isolated tumor cells (triangle) and micrometastases along with the macrometastases (arrows), but with a higher weight put to the macrometastases and the larger length scales as compared to the original CAMELYON 2016 dataset. However, it should be noted that this task still differs from the other two, namely diagnosis of HCC and pathologies of the breast. Whilst macrometastases infer with the global architecture of the lymph node, they can still be diagnosed at the single- or few-cell level, by virtue of the differences of individual tumor and autochthonous cells. Therefore, even though larger scales certainly help the human pathologist with the diagnosis of macrometastases, the consideration of larger scales and the integration of multi-scale information is of lesser importance. \subsection{Preprocessing} WSI data preprocessing was similarly performed for all three datasets. Compared to the annotations originally provided for the respective challenges, we automatically generated annotations for an "overall tissue" as an additional class. This was achieved by thresholding of the original images with [R, G, B] $\leq$ [235, 210, 235], followed by binary morphological opening and closing operations. The rationale for introducing the additional class was threefold: First, it makes the "background" class, that would otherwise include not only all-white background \textit{but also} healthy tissue, much less heterogeneous. Second, it facilitates sampling of healthy tissue patches as meaningful negative examples (cf. section \ref{sec:experiments}). % Third, the automatically generated "overall tissue" annotations let us generalize the Reinhard color normalization \citep{Reinhard2001} to our application. Reinhard color normalization, as originally introduced, implicitly assumes the color statistics to be computed from meaningful image areas. In contrast, when directly applied to a WSI image, the fraction of all-white background would determine the color statistics and hence a color normalization, which is undesired. To avoid this, images were standardized by Reinhard colour normalization \citep{Reinhard2001} with respect to the "overall tissue" regions only, and then normalized to channel-wise zero average and unit variance, again in the tissue regions only. \subsection{Evaluation metrics} \label{sec:validation} The primary outcome parameter for all experiments was the Jaccard index with the classes weighted as detailed in section \ref{sec:experiments}. Secondary, for experiments on the BACH challenge data, we additionally report the custom metric used in that specific challenge \citep{Aresta2019}. Simply put, the metric is based on a pixel-wise accuracy measure that penalizes predictions that are farther from the given ground truth segmentation class. This is possible since the segmentation classes can be ordered according to their malignancy. We refer to that metric as the ``BACH metric''. For each dataset, we employed a 5-fold cross validation (CV) strategy with the split conducted at the level of the entire WSIs. Splitting is performed such that all classes were present in the validation set. The splits were computed once and then kept fixed throughout all experiments. The number of WSIs in the validation set was 10 for PAIP 2019, 2 for BACH 2018 and 4 for CAMELYON 2016/MM. Validation was performed after the following epochs (number of iterations): 1 ($1,920$), 3 ($5,760$), 5 ($9,600$), 8 ($15,360$), 11 ($21,120$), 16 ($30,720$), 21 ($40,320$), and then every 10 epochs ($19,200$ iterations). At each validation step, a fixed number of $3,072 \times 3,072$ pixel-sized sub-images per image was evaluated. We evaluated four such sub-images per validation WSI for PAIP, ten for BACH and six for CAMELYON 2016/MM, resulting in 40, 40 and 24 of these per spilt for PAIP, BACH and CAMELYON 2016/MM, respectively. The positions of the sub-images were randomly sampled with the condition that, for any WSI, all available classes shall be represented in at least $N_\mathrm{I} / N_\mathrm{c}$ of the sub-images. Here, $N_\mathrm{I}$ denotes the number of validation sub-images from that WSI and $N_\mathrm{c}$ is the number of available classes. Sampling of the sub-image positions was done once, before the first experiment, and then kept fixed throughout all experiments. This means that all models for a given split are evaluated with respect to the exact same sub-images at all validation steps. \subsection{Statistical analysis} \label{sec:statistics} For a given model, performance scores were evaluated per split, from which the mean and 95\%-confidence interval (CI) across the five splits were computed. To set a robust baseline for the experiments in section \ref{subsec:Res1}, the experiments for the baseline, single-scale U-Net were repeated three times and averaged, corresponding to a conservative estimate (over clustered experiments). The results for the individual runs of the baseline U-Net are provided in the section \ref{sec:supp_baseline_results}. As detailed in section \ref{sec:supp_statistical_significance_and_power}, we applied a corrected t-test for use in cross-validation settings \citep{NadeauBengio, BouckaertFrank} to test for statistical significance of the differences between the multi-scale models and the baseline U-Net. As further described in the same section, our study is underpowered for examining differences between different multi-scale models for significance. Therefore, we restricted the tests to comparisons between multi-scale architectures and the baseline U-Net. All statistical analyses were performed using R v4.0.0 \citep{RPackage}. \section{Experiments} \label{sec:experiments} Our experiments were designed as follows: First, we explored the behaviour of the msY-family on the PAIP 2019 dataset. Second, to examine generalizability of our findings, we evaluated the performance of the best performing architectures on the BACH 2018 and the CAMELYON 2016/MM dataset. Third, to aetiologically understand the behaviour of the msY-models and to narrow down the possible design variants, we conducted further experiments with selected variants of that models on the PAIP 2019 dataset. The training strategy and all hyperparameters were manually optimized for training of the baseline Res18-Unet on PAIP 2019 before the experiments and then kept fixed for all models and throughout all experiments. We aimed to reproduce a standard and widely used setup as much as possible, including the use of a common model as the baseline. For the same reason, we chose the binary cross entropy (BCE) loss as a common and widely used loss function (see, e.g., \citealt{heller2020kits}). BCE was used as a loss function for both classification (if the model has an additional classification output, cf. section \ref{subsec:context_gate}) and segmentation. The training process was split into (short pseudo\hbox{-})epochs of $1,920$ patches each, with all patches re-sampled after each individual "epoch". Compared to the use of a fixed number of pre-selected patches, this reduces overfitting given the limited memory resources and the large whole-slide images. For each pseudo-epoch, the patches were balanced with respect to both the individual cases in the training set and the available classes. Optimization was performed using Adam \citep{kingma2014adam} employing a learning rate of $10^{-3}$ and a learning rate decay with $\gamma = 0.5$ every 30 epochs (57,600 iterations). During training, we employed online data augmentation including the following standard operations: rotation, flip along the horizontal axis, saturation and brightness transformation. \subsection{Comparison of msY-family and baseline models} \subsubsection{PAIP 2019} \label{subsec:Exp1} The clinical scenario in our PAIP 2019 experiments is the segmentation of hepatocellular carcinoma for evaluation of tumor extent and margin status after the resection of hepatocellular carcinoma. The comparison of all multi-scale models (including the msY-family and the multi-scale ensembling variants) to the baseline U-Net resulted in a total of $N=9$ pairwise model comparisons. The evaluation of the corresponding results were the primary focus of the PAIP 2019 experiments. In addition, we also compared the different multi-scale architectures amongst each other and to multi-scale ensembles. However, as our study is underpowered for finding statistically significant results in between different multi-scale models (cf. section \ref{sec:supp_statistical_significance_and_power}), we only descriptively present the corresponding results. For the PAIP 2019 experiments, all models were trained for at least 120 pseudo-epochs ($230,400$ iterations) or until convergence of the validation loss was reached. According to the clinical scenario and due to the fact that the localisation of viable tumor cells with respect to the resection margins determines the resection status, we put additional weight to the viable tumor class as compared to the whole tumor class and weight the loss by [0, 1, 2, 6] for background, overall tissue, whole tumour and viable tumor classes, respectively. Segmentation performance as the primary outcome parameter was measured by the weighted average Jaccard index in the classes of interest, i.e., ``whole tumor'' and ``viable tumor'', where the weights are the same as above. As a secondary outcome, we furthermore examined the resource requirements of the models. We report the number of trainable parameters and measured the GPU memory footprint. For the latter, we observed the GPU memory usage of the training process, including forward and backward pass, at different batch sizes using the NVIDIA System Management Interface. The memory footprint of the model without system overhead was then deduced by linear regression and reported as gigabytes per patch in batch. The detailed measurements are reported in section \ref{sec:supp_memory_footprint_results}. For multi-scale models, the term ``patch'' is meant as a multi-scale patch, i.e., including the image patches for all individual scales. The input patch sizes in all models and for all scales are $512 \times 512$ pixels, except at scale 4 ($576 \times 576$ for the U-Net in the ensembles, $572 \times 572$ for the msY-family models). \subsubsection{BACH 2018} \label{subsec:Exp1_BACH} As described in section \ref{sec:BACH_description}, the BACH 2018 dataset allows us to evaluate the models with respect to their capability in the differential diagnoses of breast lesions, which represents the clinical scenario for this experiment. We started from the models from the PAIP 2019 experiments and, after replacement of the output layers, fine-tuned them on the BACH 2018 dataset. Without loss of generality, we fine-tuned the models from the split $i$ ($i \in [0, 1, 2, 3, 4]$) of the PAIP dataset on the split with the same index $i$ ($i \in [0, 1, 2, 3, 4]$) of the BACH 2018 dataset. Training was performed exactly as described in section \ref{subsec:Exp1}, with the following differences: First, for the first 10 pseudo-epochs ($19,200$ iterations), only the output layers were trained and the other weights were kept fixed. Fine-tuning of all weights was then continued for another 70 pseudo-epochs ($134,400$ iterations). Second, in line with the clinical scenario of breast lesion differential diagnosis, we put equal weights to all classes of interest, i.e., ``normal'', ``benign'', ``in situ'' and ``invasive carcinoma'', both for the computation of the loss function and the weighted-average Jaccard index. In order to examine whether our models are on par with state-of-the-art results on this task, we additionally evaluated the scores from the custom BACH 2018 metric as introduced in \citep{Aresta2019}. \subsubsection{CAMELYON 2016/MM} \label{subsec:Exp1_Camelyon} For our CAMELYON 2016/MM experiments, we again started using the models from the PAIP 2019 experiments and, after replacement of the output layers, fine-tuned them on the new dataset. Training was again performed as described in section \ref{subsec:Exp1} except that for the 10 pseudo-epochs ($19,200$ iterations) only the output layers were trained and the other weights were kept fixed. For CAMELYON 2016/MM dataset, we fine-tuned for at least 60 pseudo-epochs ($115,200$ iterations) or until convergence. Again, without loss of generality, we fine-tuned the models from the split $i$ ($i \in [0, 1, 2, 3, 4]$) of the PAIP 2019 dataset on the split with the same index $i$ ($i \in [0, 1, 2, 3, 4]$) of the CAMELYON 2016/MM dataset. \subsection{Context classification loss} \label{subsec:Exp3} We hypothesized that when using a global-scale encoder, introduction of an additional context classification loss as a means of "guidance" may benefit the model (cf. section \ref{subsec:context_loss}). In order to examine whether this is consistently the case, we trained the following models with and without context classification loss on the PAIP 2019 dataset: msY$_{(16)}$, msY$^2$, msY$_{(16),\text{MM}}$. \subsection{Spatial alignment in multi-scale merge blocks} \label{subsec:Exp2} We hypothesized that spatial matching is an essential step in the multi-scale merge block. To test this hypothesis, we compared a msY$^2$-Net, as an example where three different scales are merged, to a variant of the same model but with the multi-scale merge block replaced by a pure concatenation followed by a $1 \times 1$ convolution. This corresponds to a multi-scale merge block but without alignment of the spatial scales and without preserving spatial relationships. The rest of the spatially non-aligned msY$^2$-Net variant remained unchanged. If, in line with the hypothesis, the spatially non-aligned msY$^2$-Net performs worse than its standard variant with the correct multi-scale merge block, it remains to be examined whether this is "only" due to the clumsy initialization and can potentially be overcome without spatial merging. One might hypothesize that the deficit is not architecturally, but due to the introduction of new, untrained convolutions in the middle of the otherwise pretrained encoder. Therefore, we examined two different variants of the non-aligned model: one variant with randomly initialized weights and another variant where the $1 \times 1$ convolution was initialized with the unit matrix at the channels belonging to the main encoder and with 0's everywhere else, both superimposed with random noise (normal distribution with standard deviation $10^{-4}$). In the latter variant, the main encoder corresponded to the unperturbed, pretrained model at the beginning of the training process, up to noise. \subsection{Multiple merging} \label{subsec:Exp4} The multi-scale merge block as presented in section \ref{subfig:msM-Block} can be introduced at any level of the encoders. Therefore, it also allows for earlier or multiple fusions, which may allow for the additional processing of combined features. Very early merge blocks, however, do not provide much additional context, due to the cropping step inside the multi-scale merge block. Therefore, it is not a priori clear, at which level the merge connection shall be established or if multiple path merges can further benefit the model. In order to study whether models with multiple merges can be trained robustly and whether an effect through multiple merges can be found, we compared the segmentation performance of a msY$_{(16)}$-, a msY$^2$- and a msY\textit{I}-Net to the analogues of them with multi-scale merge blocks at all encoder levels. In this experiment, to examine a "maximum" msY-family variant trainable on our hardware, we used ResNet34 instead of a ResNet18 for the global context encoder of the msY$^2$-model. All other models and encoders were ResNet 18-based, as by our standard. Additionally, we examined to which extent the introduction of multiple merges increases the GPU memory footprint of the models. \section{Results} \label{sec:results} \subsection{Multi-scale multi-encoder models improve histopathology image segmentation} \label{subsec:Res1} Table \ref{tab:exp1_paip} reports the weighted average Jaccard index for the two non-trivial classes of the PAIP 2019 dataset, viable tumor and whole tumor (including stroma etc.). According to the clinical scenario of evaluating tumor extent and resection margin status in hepatocelullar carcinoma, 3x more weight is put onto the viable tumor class than on the whole tumor class (cf. section \ref{subsec:Exp1} for details). \begin{table*}[] \caption{Different models from the proposed multi-scale multi-encoder family and multi-scale ensembles versus the baseline U-Net. The figures in the table depict the class-weighted Jaccard index for whole and viable tumor classes on the PAIP 2019 dataset. A $\star$ denotes statistical significance at the level of $0.05$ when compared to the scale 1-U-Net. For a quick overview, the best results per split and overall are marked in bold, ignoring differences $<0.005$. } \centering\small \begin{threeparttable} \begin{tabular}{p{1.285cm} p{0.85cm} p{0.85cm} p{0.7cm} P P P P >{\scriptsize}p{0.4cm} p{2.6cm} >{\scriptsize}p{0.05cm}} \toprule \textbf{Arch.} & \textbf{Scales} & \textbf{\#\,pms.\tnote{$\dagger$}} & \textbf{Mem.\tnote{$\ddagger$}} & \multicolumn{6}{c}{\textbf{Weighted Jaccard}} & \\ \cmidrule(r){5-10} \addlinespace & & & & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] U-Net & 1 & 17.804 & 1.066 & 0.814 & 0.754 & 0.686 & 0.735 & 0.729 & 0.744 (0.707, 0.780) & \\ \addlinespace[\betweenmodels] Avg. Ens.& 1,\,4,\,16 & 53.412\tnote{\S} & 3.506\tnote{\S} & 0.890 & 0.853 & \textbf{0.836} & 0.900 & 0.835 & \textbf{0.863 (0.839, 0.887)} & $\star$\\ Log. Ens.& 1,\,4,\,16 & 53.412\tnote{\S} & 3.506\tnote{\S} & 0.859 & 0.814 & 0.802 & 0.915 & 0.818 & 0.842 (0.805, 0.878) & $\star$\\ Maj. Ens.& 1,\,4,\,16 & 53.412\tnote{\S} & 3.506\tnote{\S} & 0.883 & 0.838 & 0.770 & 0.875 & 0.816 & 0.836 (0.800, 0.873) & $\star$\\ \addlinespace[\betweenmodels] \multirow{2}{*}{msY-Net} & 1,\,4 & 29.282 & 1.422 & \textbf{0.902} & 0.800 & 0.712 & 0.796 & 0.794 & 0.801 (0.748, 0.854) & $\star$\\ & 1,\,16 & 29.284& 1.175 & 0.861 & 0.872 & 0.789 & 0.873 & 0.889 & 0.857 (0.826, 0.887) & $\star$\\ \addlinespace[\betweenmodels] \multirow{2}{*}{msU\textit{I}-Net} & 1,\,4 & 28.983 & 1.389 & 0.833 & 0.811 & 0.779 & 0.858 & 0.898 & 0.836 (0.800, 0.871) & $\star$\\ & 1,\,16 & 28.983 & 1.355 & 0.864 & 0.841 & 0.785 & 0.896 & 0.889 & 0.855 (0.820, 0.890) & $\star$\\ \addlinespace[\betweenmodels] msY\textit{I}-Net& 1,\,4,\,16 & 40.460 & 1.398 & 0.847 & \textbf{0.871} & 0.804 & 0.895 & \textbf{0.910} &\textbf{0.865 (0.833, 0.898)} & $\star$\\ \addlinespace[\betweenmodels] msY$^2$-Net& 1,\,4,\,16 & 40.761 & 1.561 & 0.847 & \textbf{0.873} & 0.795 & \textbf{0.934} & 0.876 & \textbf{0.865 (0.825, 0.905)} & $\star$\\ \\ \bottomrule \end{tabular} \begin{tablenotes} \item[\S] sum of three individual U-Nets (scales: 1, 4, 16) \item[$\dagger$] in units of one million parameters \item[$\ddagger$] GPU memory footprint given in gigabytes per image patch in batch \end{tablenotes} \end{threeparttable} \label{tab:exp1_paip} \end{table*} \begin{table*}[] \caption{The best performing multi-scale architectures versus the baseline U-Net on the BACH 2018 dataset. The figures in the table depict the class-average of the Jaccard index for normal tissue, benign lesions and in situ and invasive carcinoma. A $\star$ denotes statistical significance at the level of $0.05$ when compared to the scale 1-U-Net. The best results per split and overall are marked in bold, ignoring differences $<0.005$. } \centering\small \begin{threeparttable} \begin{tabular}{p{1.285cm} p{0.8cm} p{0.8cm} p{0.67cm} P P P P >{\scriptsize}p{0.38cm} p{2.55cm} >{\scriptsize}c} \toprule \textbf{Arch.} & \textbf{Scales} & \textbf{\#\,pms.\tnote{$\dagger$}} & \textbf{Mem.\tnote{$\ddagger$}} & \multicolumn{6}{c}{\textbf{Weighted Jaccard}} & \\ \cmidrule(r){5-10} \addlinespace & & & & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] U-Net & 1 & 17.804 & 1.066 & 0.523 & 0.476 & 0.478 & 0.510 & 0.501 & 0.498 (0.482, 0.514) \\ \addlinespace[\betweenmodels] Avg. Ens. & 1,\,4,\,16 & 53.412\tnote{\S} & 3.506\tnote{\S} & 0.593 & 0.540 & 0.518 & 0.581 & \textbf{0.622} & 0.571 (0.538, 0.603) & $\star$ \\ \addlinespace[\betweenmodels] msY\textit{I}-Net & 1,\,4,\,16 & 40.460 & 1.398 & \textbf{0.629} & 0.569 & 0.488 & 0.633 & 0.553 & \textbf{0.574 (0.527, 0.621)} & $\star$ \\ \addlinespace[\betweenmodels] msY$^2$-Net & 1,\,4,\,16 & 40.761 & 1.561 & 0.578 & \textbf{0.594} & \textbf{0.536} & \textbf{0.662} & 0.524 & \textbf{0.579 (0.536, 0.622)} & $\star$ \\ \bottomrule \end{tabular} \begin{tablenotes} \item[\S] sum of three individual U-Nets (scales: 1, 4, 16) \item[$\dagger$] in units of one million parameters \item[$\ddagger$] GPU memory footprint given in gigabytes per image patch in batch \end{tablenotes} \end{threeparttable} \label{tab:exp1_bach} \end{table*} \begin{table*}[] \caption{The best performing multi-scale architectures versus the baseline U-Net on the CAMELYON 2016/MM dataset. A ($\star$) denotes statistical significance at the level of $0.05$ when individually compared to the scale 1-U-Net (not correcting for multiple testing). For the comparisons of other models to the baseline U-Net, the null hypothesis cannot be rejected at $0.05$. The best results per split and overall are marked in bold, ignoring differences $<0.005$. } \centering\small \begin{threeparttable} \begin{tabular}{p{1.285cm} p{0.85cm} p{0.85cm} p{0.7cm} P P P P >{\scriptsize}p{0.4cm} p{2.6cm} >{\scriptsize}p{0.05cm}} \toprule \textbf{Arch.} & \textbf{Scales} & \textbf{\#\,pms.\tnote{$\dagger$}} & \textbf{Mem.\tnote{$\ddagger$}} & \multicolumn{6}{c}{\textbf{Jaccard (lymph node metastases)}} & \\ \cmidrule(r){5-10} \addlinespace & & & & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] U-Net & 1 & 17.804 & 1.066 & 0.696 & 0.770 & 0.805 & 0.903 & 0.803 & 0.796 (0.737, 0.854) & \\ \addlinespace[\betweenmodels] Avg. Ens. & 1,\,4,\,16 & 53.412\tnote{\S} & 3.506\tnote{\S} & 0.748 & \textbf{0.944} & 0.798 & 0.923 & 0.883 & \textbf{0.859 (0.794, 0.924)} \\ \addlinespace[\betweenmodels] msY\textit{I}-Net & 1,\,4,\,16 & 40.460 & 1.398 & 0.710 & 0.756 & 0.822 & 0.874 & 0.859 & 0.804 (0.750, 0.859) \\ \addlinespace[\betweenmodels] msY$^2$-Net & 1,\,4,\,16 & 40.761 & 1.561 & \textbf{0.775} & 0.804 & \textbf{0.865} & 0.918 & \textbf{0.889} & 0.850 (0.804, 0.897) & ($\star$) \\ \bottomrule \end{tabular} \begin{tablenotes} \item[\S] sum of three individual U-Nets (scales: 1, 4, 16) \item[$\dagger$] in units of one million parameters \item[$\ddagger$] GPU memory footprint given in gigabytes per image patch in batch \end{tablenotes} \end{threeparttable} \label{tab:exp1_camelyon} \end{table*} The first experiment shows a number of aspects: First and most importantly, there is a considerable improvement over the baseline U-Net by adding multi-scale input, either through ensembling or by multiple encoders as in the msY-family. The effect is found to be statistically significant in our experiments, even when tested only for five CV folds and even with a conservative correction for both the multiplicity of the pairwise comparisons and the violation of the independent samples-assumption underlying standard t-statistics. The proposed multi-scale multi-encoder models reach the same segmentation performance as our best multi-scale ensemble, but as individual end-to-end trainable models and with much lower resource requirements. Taking $msY^2$-Net as an example, it has only $76.3 \%$ of the parameters of a the corresponding ensemble of three U-Nets and comes with a GPU footprint reduced by $54.5 \%$ (if trained in parallel). Concerning the pairwise comparisons between different msY family architectures, our data suggest that, for the PAIP 2019 dataset, the global context patch provides more valuable information than the local context patch. However, the combination of both local and global context appears to lead to a further improvement, as the msY$^2$- and the msY\textit{I}-Net models are consistently found amongst the top performing approaches, but this effect seems marginal and cannot be reliably detected through this study. We next examined whether the superior performance of the multi-scale architectures translates to other datasets, tumor entities and tasks. For the task of breast lesion segmentation and differential diagnosis, the class-wise mean Jaccard indices are reported in table \ref{tab:exp1_bach}. The results are in line with our findings on the PAIP 2019 dataset. Notably, the Jaccard indices on the BACH 2018 dataset are globally lower than on the PAIP 2019 dataset for all architectures. This observation fits the considerations in section \ref{sec:BACH_description} that this is a particularly challenging task, also for the human pathologist. In addition, table \ref{tab:supp_exp1_bachmetric} reports the performances of the same architectures as evaluated by the custom Bach metric used in the original challenge (cf. \citep{Aresta2019} for details). The metric values for all architectures discussed in this section are in the range of the challenge results, with the multi-scale architectures, including the msY-family models and the multi-scale ensembles, reaching top performance. Finally, table \ref{tab:exp1_camelyon} shows the performance of corresponding models applied to lymph node metastases segmentation. The results are again in line with the findings on PAIP 2019 and BACH 2018 data. However, the performance increase through the use of multiple scales is smaller in CAMELYON 2016/MM (6.8\% as compared to 16.3\% for both PAIP 2019 and BACH 2018), which fits our considerations on the different nature and difficulty of these tasks (cf. section \ref{sec:CAMELYON_description}). With respect to the generalizability of these results, we further note that, later, an independent group has been able to present additional evidence in favor of these findings on yet other data \citep{van_rijthoven_hooknet_2020}. The group used a related but different end-to-end-trainable multi-scale model that confirms the benefit from the introduction of a context-encoder, though they train their context-encoder using an additional decoder that makes the model much heavier in terms of trainable parameters and GPU usage and voids the resource improvements as compared to multi-scale ensembles. \subsection{Context classification loss-based deep guidance for context encoder training} \label{subsec:Res4} In order to examine whether the additional classification loss is indeed helpful for ``guidance'' of the global context encoder during training, we re-examined the msY$^2$-, the msY$_{(16)}$- and the msY\textit{I}-Net models on the PAIP 2019 dataset when trained with or without the additional classification loss. From the results in table \ref{tab:exp2_class_loss}, it appears that the additional use of the classification loss consistently improves the model training. Recalling that the relative sizes of the detail and the global context encoder input patches (cf. figure \ref{fig:patches}) translate to a corresponding center-crop operation on the context encoder feature maps (as part of the multi-scale merge block, cf. figure \ref{subfig:msM-Block}), this behaviour might be understood intuitively as the the classification loss helping the context encoder acquire additional gradients for training. Importantly, this technique comes with a very moderate overhead both in terms of the number of additional parameters and the effective GPU memory footprint. \begin{table*}[] \caption{Context classification loss guidance for training of the global context encoder. Numbers are the class-weighted Jaccard indices for the PAIP 2019 dataset. The best results per pairwise comparison and split are marked in bold, where differences $<0.005$ are ignored.} \centering\small \begin{threeparttable} \begin{tabular}{p{1.285cm} p{1.3cm} p{0.85cm} p{0.7cm} P P P P >{\scriptsize}p{0.4cm} p{2.6cm}} \toprule \textbf{Arch.} & \textbf{Clss.\,loss} & \textbf{\#\,pms.\tnote{$\dagger$}} & \textbf{Mem.\tnote{$\ddagger$}} & \multicolumn{6}{c}{\textbf{Weighted Jaccard}} \\ \cmidrule(r){5-10} \addlinespace & & & & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] \multirow{2}{*}{msY$^2$-Net} & with & 40.761 & 1.561 & 0.847 & \textbf{0.873} & \textbf{0.795} & \textbf{0.934} & \textbf{0.876} & \textbf{0.865 (0.825, 0.905)}\\ & without & 40.759 & 1.436 & \textbf{0.903} & 0.851 & 0.737 & 0.826 & 0.779 & 0.819 (0.769, 0.869)\\ \addlinespace[\betweenmodels] \multirow{2}{*}{msY$_{16}$-Net} & with & 29.284 & 1.281 & 0.861 & \textbf{0.872} & \textbf{0.789} & \textbf{0.873} & \textbf{0.889} & \textbf{0.857 (0.826, 0.887)}\\ & without & 29.282 & 1.175 & \textbf{0.883} & 0.847 & 0.713 & 0.715 & 0.764 & 0.785 (0.724, 0.845)\\ \bottomrule \end{tabular} \begin{tablenotes} \item[$\dagger$] in units of one million parameters \item[$\ddagger$] GPU memory footprint given in gigabytes per image patch in batch \end{tablenotes} \end{threeparttable} \label{tab:exp2_class_loss} \end{table*} \subsection{Necessity for spatial alignment in multi-scale merge blocks} \label{subsec:Res2} Drawing on theoretical considerations, we have constructed the multi-scale merge blocks such that spatial relationships between the different paths are preserved upon fusion. Table \ref{tab:exp3_avg_bestloss} repeats the results for the msY$^2$-Net and compares them to those of two variants of the same architecture which both do \textit{not} adhere to this condition. These are constructed by concatenating the bottleneck feature maps from the different paths without any spatial alignment as part of the multi-scale merge block, where the two variants differ in that the merging $1 \times 1$ convolution is either initialized randomly or with pre-defined weights leaving the main path unperturbed at training startup (cf. section \ref{subsec:Exp3} for details). It can be seen that both these variants perform consistently worse than the proposed msY$^2$-Net with correct spatial alignment in the multi-scale merge block. This is irrespective of whether the weights of the $1 \times 1$ convolution are randomly initialized or whether they are initialized such that the ResNet18 encoder of the underlying U-Net is left untouched by the un-aligned merge connections. This suggests that the deficit through the missing alignment step may be architectural rather than only a disturbance of the pretrained encoder by the additional $1 \times 1$ convolution. We therefore conclude that, when merging paths at the bottleneck level in a manner as done by the multi-scale merge block, spatial matching is a necessary step. \begin{table*}[] \caption{Spatial alignment at multi-scale path fusion. Numbers are the class-weighted Jaccard indices for the PAIP 2019 dataset. All models are variants of the msY$^2$ architecture, either with spatial alignment at the multi-scale merge block (1, as per default) or without (2, 3). The best results per pairwise comparison and split are marked in bold, where differences $<0.005$ are ignored.} \centering\small \begin{tabular}{p{3.5cm} P P P P >{\footnotesize}p{1.0cm} p{2.6cm}} \toprule \textbf{msY$^2$-Net variant} & \multicolumn{6}{c}{\textbf{Weighted Jaccard}} \\ \cmidrule(r){2-7} \addlinespace & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] spatially aligned$^1$ & \textbf{0.870} & \textbf{0.835} & \textbf{0.796} & \textbf{0.902} & \textbf{0.865} & \textbf{0.854 (0.822, 0.885)} \\ \addlinespace[\betweenmodels] non-aligned, init$^2$ & \textbf{0.872} & 0.814 & 0.725 & 0.822 & 0.827 & 0.812 (0.770, 0.854) \\ \addlinespace[\betweenmodels] non-aligned, random$^3$ & \textbf{0.875} & 0.787 & 0.777 & 0.808 & 0.832 & 0.816 (0.785, 0.847) \\ \bottomrule \end{tabular} \label{tab:exp3_avg_bestloss} \end{table*} \subsection{Additional path fusions can be added by introduction of multiple multi-scale merge blocks} \label{subsec:Res3} Table \ref{tab:exp4_avg_bestloss} compares the standard msY$^2$-, the msY$_{(16)}$- and the msY\textit{I}-Net with multi-scale merge blocks only at the bottleneck to their respective analogues with multi-scale merge connections at every level of the encoder. \begin{table*}[] \caption{Multi-level multi-scale merging: For three different multi-scale architectures, the standard variant with multi-scale fusion by a single multi-scale merge block only at the bottleneck ("bottleneck") is compared to an analogous architecture, but with multi-scale merge blocks at each individual encoder level ("multiple"). Numbers are the class-weighted Jaccard indices at the PAIP 2019 dataset. The best results per pairwise comparison and split are marked in bold, where differences $<0.005$ are ignored.} \centering\small \begin{threeparttable} \begin{tabular}{p{1.6cm} p{1.2cm} p{0.72cm} p{0.65cm} P P P P >{\scriptsize}p{0.38cm} p{2.55cm}} \toprule \textbf{msY$^2$-Net variant} & \textbf{Merge block(s)} & \textbf{\#\,pms.\tnote{$\dagger$}} & \textbf{Mem.\tnote{$\ddagger$}} & \multicolumn{6}{c}{\textbf{Weighted Jaccard}} \\ \cmidrule(r){5-10} \addlinespace & & & & \multicolumn{5}{c}{\textbf{Per CV fold}} & \textbf{Mean (95\% CI)} \\ \hline \addlinespace[\betweenmodels] \multirow{2}{*}{msY$_{(16)}$-Net} & bottleneck & 29.284 & 1.175 & \textbf{0.861} & \textbf{0.872} & \textbf{0.789} & 0.873 & 0.889 & \textbf{0.857 (0.826, 0.887)} \\ & multiple & 29.464 & 1.281 & 0.854 & 0.848 & 0.769 & \textbf{0.881} & \textbf{0.903} & 0.851 (0.811, 0.891) \\ \addlinespace[\betweenmodels] \multirow{2}{*}{msY\textit{I}-Net} & bottleneck & 40.460 & 1.398 & 0.847 & \textbf{0.871} & \textbf{0.804} & 0.895 & \textbf{0.910} & \textbf{0.865 (0.833, 0.898)} \\ & multiple & 41.032 & 1.556 & \textbf{0.859} & \textbf{0.872} & \textbf{0.805} & \textbf{0.911} & 0.897 & \textbf{0.869 (0.836, 0.901)} \\ \addlinespace[\betweenmodels] \multirow{2}{*}{msY$^2_\text{(Res34)}$-Net} & bottleneck & 50.869 & 1.516 & 0.870 & 0.835 & 0.796 & \textbf{0.902} & 0.865 & 0.854 (0.822, 0.885) \\ & multiple & 51.140 & 1.608 & \textbf{0.876} & \textbf{0.879} & \textbf{0.802} & 0.863 & \textbf{0.915} & \textbf{0.867 (0.835, 0.899)} \\ \bottomrule \end{tabular} \begin{tablenotes} \item[$\dagger$] in units of one million parameters \item[$\ddagger$] GPU memory footprint given in gigabytes per image patch in batch \end{tablenotes} \end{threeparttable} \label{tab:exp4_avg_bestloss} \end{table*} Our study cannot find relevant differences between single-merge and multiple-merge setups. However, the additional merge connections did at least not lead to any instability in model training. Moreover, they come with a moderate increase in the number of trainable parameters and GPU memory requirements only. Therefore, multiple path fusions can be readily included in msY family models and can be used for further optimization, e.g. by systematic neural architecture searches. \section{Discussion and Conclusions} \label{sec:conclusion} Using the segmentation of carcinoma in hematoxylin-eosin (H\&E) stained whole-slide images % as an example task, our results show that the extensive integration of widely different spatial scales, as a ``mimicry'' of how humans approach analogous tasks, offers significant and relevant improvements over baseline single-scale U-Nets as the de facto standard in histopathology image segmentation. The improvement has been consistently shown for three different datasets, clinical scenarios and tumor entities. From a methodical and architectural perspective, our study presents a family of models that can integrate context from multiple scales and at various levels. As an overarching effect, it shows that when fusing encoder paths from different scales, spatial alignment and the preservation of spatial relationships is necessary. The proposed multi-scale merge block fulfils this requirement. The performance of the proposed architectures in terms of segmentation accuracy was further shown to be (at least) on par with ensembles of U-Nets, where the proposed multi-scale models models are end-to-end trainable systems with a reduced number of parameters and smaller memory footprint. It should, however, be noted that only common ensembling techniques have been studied, and more sophisticated techniques could potentially lead to further improvement. Moreover, different to \citet{karimi2020DLGleason}, the logistic regression-based ensembling did not lead to better performance than standard averaging of the class probabilities of the U-Net trained for the different scales. The reason remains so far unclear; potential explanations could be the different application addressed (Gleason scoring vs. tumor segmentation) and differences in implementation. It goes without saying that future research is also likely to optimize the multi-scale models presented herein much further. As the detailed structure of encoder, decoder and possible skip connections are left entirely untouched, the proposed multi-scale architectures can seamlessly be adopted to various encoder-decoder models. In particular, increased receptive fields in the individual encoders may benefit msY family models, as these would allow the center-crop of multi-scale merge block to acquire high-level features from a larger region. Therefore, the use of dilated or atrous convolutions and atrous spatial pyramid pooling \citep{Chen2017DeepLab, Chen2017Atrous} in the context encoders might considerably benefit the models of the proposed multi-scale architecture family. Continuing with potential for improvement, we note that -- as a straightforward extension of standard single scale CNN-based segmentation -- we trained our networks and encoders on the original "raw" image information. This approach neglects classical work on multi-resolution image representation, which could also be advantageous in the given application context. Moreover, adding multi-level wavelet transforms to the CNN architecture has recently be shown as a very promising means to enlarge perceptive fields \citep{liu_multi-level_2018,savareh_wavelet-enhanced_2019}, which, as said, can be particularly beneficial when implemented in the context encoders. We have shown how the proposed building blocks and the underlying intuition can be extended to any number of arbitrarily sized spatial scales, as relevant for the particular organ and disease of interest. Moreover, additional and early merge connections may offer the possibility to model more complex relations between the different scales. We have shown that the proposed multi-scale merge block can be flexibly used at many levels, and that even msY family models with path fusions at all possible encoder levels can be trained robustly and with minor GPU memory overhead. As both the relevant spatial scales as well as the complexity of the tasks % vary between applications, we finally envision that the msY family architectures with multiple merges open up a rich environment and search space also for neural architecture searches. Apart from the pure network architecture perspective, we used binary cross entropy as a very common, widely used and accepted loss function for the current study. The results, however, already reveal that the integration of an additional context content loss (although again implemented as cross entropy) improves performance. This suggests that the application- and/or architecture-specific loss function design bears the potential for a further improvement of WSI segmentation performance. Furthermore, we directly made use of the labels and annotations as provided by the respective challenge organizers for our experiments. It is, however, well known that the annotation of WSI slides is prone to errors and inter-observer variability. Over the past years, handling of label noise and uncertain annotation has attracted increasing interest and attention in the medical image analysis domain and in computational pathology, where, again, design of specific loss functions provides a promising approach (see \citet{karimi_deep_2020} for a recent review). Concerning the limitations of this study, the results are so far based on three publicly available H\&E stained WSI image datasets; it remains to be seen in future work whether the results generalize to different image data, other tasks, including tumor grading and regression tasks (e.g. for survival prediction), and other diseases. Furthermore, our analysis was built on a cross validation strategy; therefore, confirmation of our findings on separate independent test databases would clearly be desirable. Finally, whilst superior performance was consistently found for the three independent datasets, there still is a dataset dependency. In line with the underlying motivation of a human pathologist's mimicry, the data suggest that the performance increase is larger on tasks that require the human pathologist to integrate information from different scales (PAIP 2019, BACH 2018) and smaller on simpler tasks with more focus on individual cells (CAMELYON 2016/MM). Despite the remaining limitations and potential for future work, the presented study provides clear evidence that a mimicry of how human experts approach a specific task can be successfully used to develop specialized machine learning architectures. It advocates the integration of extensive multi-scale context into deep learning models for complex tasks in computational histopathology. \section*{Acknowledgments} This study was partially supported by an unrestricted grant from Olympus Co Hamburg, Germany, and by the Forschungszentrum Medizintechnik Hamburg (grant 02fmthh2017), Hamburg, Germany. RS gratefully acknowledges funding by the Studienstiftung des deutschen Volkes and the G\"unther Elin Krempel foundation. TR receives study support for various projects from Olympus Co Hamburg, Germany, but declares that there is no conflict to disclose with regards to this project. RW receives funding from Siemens Healthcare, Erlangen, Germany, but declares that there is no conflict to disclose regarding this project. The authors would like to thank NVIDIA for the donation of a graphics card under the GPU Grant Program. In addition, the authors are grateful toward Hinnerk St\"uben for his excellent technical support and toward Claus Hilgetag for proofreading and valuable discussions. \bibliographystyle{model2-names.bst}\biboptions{authoryear}
\section{Introduction} Let $X$ be a connected topological space. A point $x\in X$ is called a \textit{cut point} if $X\setminus \{x\}$ is disconnected. If $X\setminus \{x\}$ has exactly two connected components, then $x$ is a \textit{strong cut point}. A \textit{cut-point space} (resp. \textit{strong cut-point space}) is a connected topological space in which every point is a cut point (resp. strong cut point). In 1936, L.E. Ward \cite{warr} famously proved: If $X$ is a connected and locally connected separable metrizable space in which every point is a strong cut point, then $X$ is homeomorphic to the real line. In 1970, S.P. Franklin and G.V. Krishnarao strengthened Ward's result by showing the word ``metrizable'' could be replaced with ``regular'' \cite{fra1}. Then, in a short addendum \cite{fra} they claimed: \textit{If $X$ is a separable locally compact Hausdorff connected space in which every point is a strong cut point, then $X$ is homeomorphic to the real line.} A mistake in the proof was discovered in 1977 by A.E. Brouwer, who then re-proved the statement \cite[Theorem 8]{bro}. More generally, Brouwer showed every separable locally compact Hausdorff cut-point space embeds into a dendrite \cite[Theorems 5 \& 7]{bro}. In Section 2 of this paper, we prove a stronger result using L.E. Ward's 1988 characterization of dendrons. \begin{ut}\label{t2} If $X$ is a connected separable locally compact Hausdorff space with fewer than $\mathfrak c=|\mathbb R|$ non-cut points, then: \begin{enumerate} \item[\textnormal{(i)}] $X$ embeds into a dendrite whose cut points are precisely the cut points of $X$; and \item[\textnormal{(ii)}] the set of non-cut points of $X$ is a nowhere dense $G_\delta$-set. \end{enumerate}\end{ut} \noindent Every dendrite embeds into Wazewski's plane continuum \cite[10.37]{nad} (see Figure 1), so in fact the set $X$ in Theorem 1.1 embeds into a dendrite in the plane. The result also implies that every separable Hausdorff continuum with only countably many non-cut points is a (plane) dendrite. In Sections 3 and 4, we focus on non-dendritic compactifications of Tychonoff cut-point spaces, including weakly ordered spaces. A space $X$ is \textit{weakly orderable} if there exists a continuous linear ordering of the elements of $X$. To be more precise, $X$ is weakly orderable if there is a continuous one-to-one mapping of $X$ into a Hausdorff arc. Apparently, every connected weakly ordered space is a strong cut-point space. In Section 3 we show that a connected Tychonoff space $X$ is weakly orderable if and only if $X$ is a cut-point space and $\beta X$ is an irreducible Hausdorff continuum (Corollary \ref{46}). In this event, the Stone-\v{C}ech extension of the weak ordering epimorphism continuously orders the internal layers of $\beta X$. We also show each connected weakly orderable normal space densely embeds into an irreducible Hausdorff continuum of the same weight (Theorem \ref{47}). This generalizes a result proved by Roman Duda in the separable metrizable setting \cite[Theorem 5]{dud}. We will see that each cut point of $X$ is a cut point of $\beta X$ (Theorem \ref{41}). On the other hand, in Section 4 we show every separable metrizable cut-point space densely embeds into a reducible metrizable continuum with no cut points (Theorem \ref{54}). An obvious example is the one-point compactification of $\mathbb R$. A locally connected fan of long lines shows this type of embedding is not possible for all Tychonoff cut-point spaces (see Example \ref{ex2}). \begin{figure}[h] \centering \includegraphics[scale=.5]{den.pdf} \caption{Universal plane dendrite} \end{figure} \subsection{Terminology} A \textit{continuum} is a connected compact Hausdorff space. An \textit{arc} is a continuum homeomorphic to the interval $[0,1]$. A \textit{Hausdorff arc} is a linearly ordered (Hausdorff) continuum. A connected space $X$ is \textit{dendritic} if every two points are separated by some other point. Two points $a$ and $b$ are \textit{separated by} a third point $c$ if $X\setminus \{c\}$ is the union of two disjoint open sets, one containing $a$ and the other containing $b$. A \textit{dendron} is a dendritic compact Hausdorff space, and a \textit{dendrite} is a metrizable dendron. A topological space $X$ is \textit{connected im-kleinen} at $x\in X$ provided $x$ has arbitrarily small connected neighborhoods. If $X$ is connected im-kleinen at each of its points, then $X$ is \textit{locally connected} A continuum $X$ \textit{indecomposable} if every proper subcontinuum of $X$ is nowhere dense. A continuum $X$ is \textit{reducible} if for every two points $a,b\in X$ there exists a proper subcontinuum of $X$ containing $a$ and $b$. If no proper subcontinuum of $X$ contains both $a$ and $b$, then $X$ is \textit{irreducible between $a$ and $b$}. A continuum which is irreducible between some two of its points is said to be \textit{irreducible}. A \textit{compactification} of a Tychonoff space $X$ is a compact Hausdorff space which has a dense subspace homeomorphic to $X$. $\beta X$ denotes the \textit{Stone-\v{C}ech compactification} of $X$. Each locally compact Hausdorff space $X$ has a compactification $\gamma X$ such that the remainder $\gamma X\setminus X$ is zero-dimensional, and disjoint closed subsets of $X$ with compact boundaries have disjoint closures in $\gamma X$. The canonical compactification of $X$ with these properties is called the \textit{Freudenthal compactification} of $X$. \section{Proof of Theorem 1.1} Let $X$ be a connected separable locally compact Hausdorff space. Let $\nc(X)$ denote the set of non-cut points of $X$. Suppose $|\nc(X)|<\mathfrak c$. Let $D$ be the Freudenthal compactification of $X$. \begin{ucl}\label{35}Every point in $X$ is a cut point of $D$.\end{ucl} \begin{proof} Let $x\in X$, and write $X\setminus \{x\}=U\sqcup V$. Let $W$ be an open subset of $X$ such that $x\in W$ and $\overline W$ is compact. Then $U\setminus W$ and $V\setminus W$ are disjoint closed subsets of $X$ with compact boundaries. Thus $\overline{U\setminus W}\cap \overline{V\setminus W}=\varnothing$. It follows that $D\setminus \{x\}$ is the union of the two disjoint open sets $(U\cap W)\cup \overline{U\setminus W}$ and $(V\cap W)\cup \overline{V\setminus W}$.\end{proof} \begin{ucl}\label{32}For every two non-degenerate subcontinua $K,L\subseteq D$, if $K\subseteq L$ then $K$ contains a cut point of $L$. \end{ucl} \begin{proof}Suppose $K$ and $L$ are non-degenerate subcontinua of $D$ and $K\subseteq L$. Since $D\setminus X$ is zero-dimensional and compact, $K\cap X$ is a non-empty open subset of $K$. Every open subset of a continuum has cardinality at least $\mathfrak c$. Hence $|\nc(X)|<\mathfrak c$ implies $K$ contains uncountably many cut points of $X$. And by Claim \ref{35}, for each $x\in K\cap X\setminus \nc(X)$ we can write $D\setminus \{x\}=U_x\sqcup V_x$. For a contradiction, suppose $L\setminus \{x\}$ is connected for all $x\in K\cap X\setminus \nc(X)$. Then we may assume $L\setminus \{x\}\subseteq U_x$. For any two points $x\neq y\in K\cap X\setminus \nc(X)$ we have $V_x\subseteq U_y\cup V_y$ and $x\in U_y$. The set $V_x\cup \{x\}$ is connected, therefore $V_x\cup \{x\}\subseteq U_y$ and $V_x\cap V_y=\varnothing$. Thus $\{V_x:x\in K\cap X\setminus \nc(X)\}$ is an uncountable collection of pairwise disjoint non-empty open subsets of $D$. This contradicts the fact that $D$ is separable. Therefore $K$ contains a cut point of $L$.\end{proof} By Claim \ref{32} and \cite[Theorem 1]{warrr}, $D$ is a dendron. Separable dendrons are metrizable by \cite[Theorem I.5]{eb}. Thus $D$ is a dendrite. Clearly $D\setminus X$ contains no cut point of $D$, so by Claim \ref{35} $X$ is equal to the set of cut points of $D$. This concludes our proof of Theorem \ref{t2}(i). Toward proving Theorem \ref{t2}(ii), note that the set of cut points of any dendrite is a countable union of arcs. So by part (i), $\nc(X)$ is a $G_\delta$-subset of $X$. Hence $|\nc(X)|<\mathfrak c$ implies $X$ is scattered (and countable). Every open subset of $X$ is perfect, so $\nc(X)$ is nowhere dense. This concludes the proof of Theorem \ref{t2}(ii). \begin{uc}\label{pp}Every separable Hausdorff continuum with only countably many non-cut points is a dendrite.\end{uc} \section{Weakly ordered Tychonoff spaces} In this section we show connected weakly ordered Tychonoff spaces are precisely those cut-point spaces which can be densely embedded into irreducible continua. These include graphs of certain functions defined on the real line. For a non-trivial example, let $\varphi(t)=\sin(1/t)$ for $t\in \mathbb R\setminus \{0\}$ and put $\varphi(0)=0$. Now let $\mathbb Q =\{q_n:n<\omega\}$ be an enumeration of the rationals, and define $f:\mathbb R \to [0,1]$ by $f(t)=\sum_{n=1}^\infty \varphi(t-q_n)\cdot 2^{-n}.$ The graph $X:=\{\langle t,f(t)\rangle:t\in \mathbb R\}$ is connected, and the elements of $X$ are ordered by the first coordinate projection. This example is due to Kuratowski and Sierp\-i\'n\-ski \cite{ks}. More generally, for every $n\leq \omega$ Duda \cite[Theorem 6]{dud} constructed a function $f:\mathbb R\to [0,1]^n$ whose graph is $n$-dimensional and connected. To prove the first two results, we need the following fact: \renewenvironment{quote}{% \list{}{% \leftmargin1cm \rightmargin\leftmargin } \item\relax } {\endlist} \begin{quote} If $U$ and $V$ are disjoint open subsets of a Tychonoff space $X$, and $W$ is an open subset of $\beta X$ such that $W\cap X=U\cup V$, then the sets $W\cap \cl_{\beta X}U$ and $W\cap \cl_{\beta X} V$ are disjoint $\beta X$-open sets unioning to $W$. \end{quote} Proofs may be found in the proofs of \cite[Lemma 1.4]{walk} and \cite[Theorem 4]{lip}. \begin{ut}\label{41}If $X$ is a connected Tychonoff space, then every cut point of $X$ is a cut point of $\beta X$.\end{ut} \begin{proof}Suppose $x\in X$ is a cut point. Write $X\setminus \{x\}=U\sqcup V$. Let $W=\beta X\setminus \{x\}$. By the fact above, $\beta X\setminus \{x\}$ is the union of two disjoint open sets $[\cl_{\beta X} U]\setminus \{x\}$ and $[\cl_{\beta X} V]\setminus \{x\}$. \end{proof} \begin{ut}\label{42}If $X$ is a connected weakly orderable Tychonoff space, then $\beta X$ is an irreducible continuum.\end{ut} \begin{proof}Let $X$ be a connected weakly ordered Tychonoff space. Let $Y$ be a Hausdorff arc compactification of $X$ in the weak order topology. Let $y_0$ and $y_1$ be the endpoints of $Y$, and note that $Y\setminus X\subseteq \{y_0,y_1\}$. Let $f:X\hookrightarrow Y$ be the identity, and let $\beta f:\beta X\to Y$ be the Stone-\v{C}ech extension of $f$. Then there exist $p\in \beta f^{-1}\{y_0\}$ and $q\in \beta f^{-1}\{y_1\}$. We claim $\beta X$ is irreducible between $p$ and $q$. Let $K$ be any subcontinuum of $\beta X$ containing $p$ and $q$. We show $X\setminus \{y_0,y_1\} \subseteq K$. Let $x\in (y_0,y_1)$. Take $U=f^{-1}[y_0,x)$ and $V=f^{-1}(x,y_1]$ and $W=\beta X\setminus \{x\}$. By the fact above, $[\cl_{\beta X}U]\setminus \{x\}$ and $[\cl_{\beta X} V]\setminus \{x\}$ are disjoint $\beta X$-open sets covering $\beta X\setminus \{x\}$. Since $p\in \cl_{\beta X}U$, $q\in \cl_{\beta X}V$, and $K$ is connected, we have $x\in K$. Thus $X\setminus \{y_0,y_1\}\subseteq K$. So $K$ contains a dense subset of $\beta X$, therefore $K=\beta X$. \end{proof} \begin{ul}\label{43}Let $X$ be a cut point space. For all $x_0,x_1\in X$ there are three disjoint non-empty open sets $U$, $W$ and $V$ such that $X\setminus \{x_0,x_1\}=U\cup W\cup V$. \end{ul} \begin{proof}Write $X\setminus \{x_0\}=U\sqcup W_0$ so that $x_1\in W_0$. Write $X\setminus \{x_1\}=W_1\sqcup V$ with $x_0\in W_1$. Let $W=W_0\cap W_1$. Note that $$X\setminus W=X\setminus (W_0\cap W_1)=(X\setminus W_0)\cup (X\setminus W_1)\subseteq U\cup V\cup \{x_0,x_1\}.$$ So $X\setminus \{x_0,x_1\}=U\cup W\cup V$. Clearly $U\cap W=\varnothing$ and $V\cap W=\varnothing$. Finally, $U\cup \{x_0\}$ is connected, so $U\cup \{x_0\}\subseteq W_1$. Therefore $U\cap V=\varnothing$. \end{proof} \begin{ut}\label{44}Let $X$ be a Tychonoff cut-point space, and suppose $\beta X$ is an irreducible continuum. Then $X$ is weakly ordered. \end{ut} \begin{proof}Let $p,q\in \beta X$ such that $\beta X$ is irreducible between $p$ and $q$. We claim that every indecomposable subcontinuum of $\beta X$ is nowhere dense. Suppose to the contrary that $I$ is an indecomposable subcontinuum of $\beta X$, and $I$ contains a non-empty $\beta X$-open subset $G$. Let $x_0,x_1\in G\cap X$ and write $X\setminus \{x_0,x_1\}=U\sqcup W\sqcup V$ as in Lemma \ref{43}. Then $U\cap G$ and $V\cap G$ are non-empty open sets. Each composant of $I$ is dense in $I$, and every proper subcontinuum of $I$ is nowhere dense. So there is a nowhere dense subcontinuum $N\subseteq I$ which intersects both $\cl_{\beta X}(U\cap G)$ and $\cl_{\beta X}(V\cap G)$. Since $U\cup \{x_0\}$ and $\{x_1\}\cup V$ are connected, we find that $K:=\cl_{\beta X}U\cup N\cup \cl_{\beta X} V$ is a proper subcontinuum of $\beta X$. By irreducibility between $p$ and $q$, $\{p,q\}\not\subseteq K$. Without loss of generality, assume $p\notin K$. Then $p\in \cl_{\beta X} W\subseteq \cl_{\beta X}(X\setminus U)\cap \cl_{\beta X}(X\setminus V)$. Note that $X\setminus U$ and $X\setminus V$ are connected, and $q\in \cl_{\beta X}(X\setminus U)\cup\cl_{\beta X}(X\setminus V)$. Therefore $p$ and $q$ are contained proper subcontinuum of $Y$. This is a contradiction. By Gordh \cite{gor} and the claim above, $\beta X$ is a generalized $\lambda$-type continuum. That is, there is a Hausdorff arc $Y$ and a mapping $\lambda:\beta X\to Y$ such that $\{\lambda^{-1}\{y\}:y\in Y\}$ is an upper semi-continuous decomposition of $\beta X$ into maximal nowhere dense subcontinua. To prove $X$ is weakly ordered, it suffices to show $\lambda\restriction X$ is one-to-one. Suppose $x_0,x_1\in X$ and $\lambda(x_0)=y= \lambda(x_1)$. If $x_0\neq x_1$ then we may write $X\setminus \{x_0,x_1\}=U\sqcup W\sqcup V$ as in Lemma \ref{43}. Then $K:=\cl_{\beta X} [U\cup \lambda^{-1}\{y\}\cup V]$ is a subcontinuum of $\beta X$ which contains both $p$ and $q$. Since $\lambda^{-1}\{y\}$ is nowhere dense, $K$ is a proper subset of $\beta X$. This violates irreducibility between $p$ and $q$. Therefore $x_0=x_1$ and $\lambda$ is one-to-one. \end{proof} \begin{ur}We observe that $\lambda^{-1}\{\lambda(x)\}$ is the union of two continua $H$ and $K$ such that $H\cap K=\{x\}$, and $\lambda^{-1}\{\lambda(x)\}=\{x\}$ if and only if $X$ is connected im-kleinen at $x$.\end{ur} \begin{uc}\label{46}A Tychonoff cut-point space $X$ is weakly orderable if and only if $\beta X$ is an irreducible continuum. \end{uc} \begin{proof}Combine Theorems \ref{42} and \ref{44}. \end{proof} \begin{ut}\label{47}Let $X$ be a connected weakly orderable normal space. Then densely embeds into an irreducible continuum of the same weight as $X$. In particular, if $X$ is separable metrizable then $X$ densely embeds into an irreducible metrizable continuum.\end{ut} \begin{proof} Let $X$ be a connected weakly orderable normal space. Let $\kappa$ be weight of $X$, i.e. the least cardinality of a basis for $X$. By Theorem \ref{42}, $\beta X$ is irreducible between two points $p$ and $q$. Let $\{U_\alpha:\alpha<\kappa\}$ be a basis for $X\setminus \{p,q\}$ with each $U_\alpha\neq\varnothing$. For each $\alpha<\kappa$ we have that $\beta X\setminus U_\alpha$ is the union of two disjoint compact sets $A_\alpha$ and $B_\alpha$ with $p\in A_\alpha$ and $q\in B_\alpha$. By Urysohn's Lemma, for every $\alpha<\kappa$ there is a continuous function $f_\alpha:X\to[0,1]$ such that $f_\alpha[A_\alpha\cap X]=0$ and $f_\alpha[B_\alpha\cap X]=1$. Define $f:X\to [0,1]^\kappa$ by $f(x)=\langle f_\alpha(x)\rangle_{\alpha<\kappa}$. Let $g:X\to [0,1]$ be a homeomorphic embedding of $X$ into the Tychonoff cube $[0,1]^\kappa$, and put $h=f\times g$. Then $h:X\to [0,1]^{ \kappa}\times [0,1]^{ \kappa}$ is a homeomorphism, and $\overline{h[X]}$ is a continuum irreducible between $\beta h(p)$ and $\beta h(q)$. Here, $\beta h:\beta X\to \overline{h[X]}$ is the Stone-\v{C}ech extension of $h$. \end{proof} \section{Non-cut points in compactifications} The non-cut point existence theorem for connected compact spaces, stated below, was originally proved by R.L. Moore \cite{more} in the context of metric spaces. It was generalized for T$_1$ spaces by G.T. Whyburn \cite{why}, and finally for all topological spaces by B. Honari and Y. Bahrampour in \cite{poo}. \begin{ut}[Theorem 3.9 in \cite{poo}]If $X$ is a compact connected topological space with more than one point, then X has at least two non-cut points. \end{ut} No separation axioms are needed to prove the next four results. \begin{ut}\label{52}If $X$ is a cut-point space, then for every $x\in X$ and connected component $C$ of $X\setminus \{x\}$, $C\cup \{x\}$ is non-compact.\end{ut} \begin{proof}Let $X$ be a cut-point space. Let $x\in X$, and let $C$ be a connected component of $X\setminus \{x\}$. Suppose $C\cup \{x\}$ is compact. We will reach a contradiction by finding a non-cut point of $X$ in $C$. Observe that $X\setminus C$ is connected. For if $X\setminus C$ is the union of two nonempty and disjoint separated sets $A$ and $B$ with $x\in A$, then $C\cup B$ is a connected subset of $X\setminus \{x\}$ bigger than $C$. Also, $C$ is closed in the subspace $X\setminus \{x\}$, implying $\overline{C}\in \{C,C\cup \{x\}\}$. \textit{Case 1}: $\overline{C}=C\cup \{x\}$. Then $C\cup \{x\}$ is a compact connected set with more than one point and thus has a non-cut point $y\in C$. Observe that $X\setminus \{y\}$ is equal to the union of the two connected sets $(C\cup \{x\})\setminus \{y\}$ and $X\setminus C$ which have the point $x$ in common. Therefore $y$ is a non-cut point of $X$. \textit{Case 2}: $\overline{C}=C$. Then $C$ is compact and connected. Additionally, $X\setminus C$ is connected implies $C$ has more than one point. Thus $C$ has two non-cut points $y_0$ and $y_1$. There exists $b\in 2$ such that $\{y_b\}\neq \overline{X\setminus C}\cap C$. By connectedness of $X$ we have $\overline{X\setminus C}\cap C =\overline{X\setminus C}\cap \overline{C}\neq\varnothing$. By the choice of $b$ it follows that $\overline{X\setminus C}\cap (C\setminus \{y_b\})\neq\varnothing$. Thus $X\setminus \{y_b\}$ is the union of two non-separated connected sets $X\setminus C$ and $C\setminus \{y_b\}$. Therefore $X\setminus \{y_b\}$ is connected and $y_b$ is a non-cut point of $X$. In each case we reached a contradiction. Therefore $C\cup \{x\}$ is non-compact. \end{proof} \begin{uc}\label{53}Let $X$ be a locally connected cut-point space. If $x\in X$ has a compact neighborhood, and $\{x\}$ is closed, then $X\setminus \{x\}$ has only finitely many connected components. \end{uc} \begin{proof}Suppose $N$ is a compact neighborhood of $x$, and $\{x\}$ is closed. Let $\{C_\alpha:\alpha<\kappa\}$ be the set of connected components of $X\setminus \{x\}$. Since $X$ is locally connected and $X\setminus \{x\}$ is open, each $C_\alpha$ is open. By Theorem \ref{52} and the fact that $\{x\}\cup C_\alpha$ is closed, we have $C_\alpha\setminus N\neq\varnothing$ for each $\alpha<\kappa$. Since $C_\alpha$ is a relatively clopen subset of $X\setminus \{x\}$, by connectedness of $X$ we have $x\in \overline{C_\alpha}$. So $C_\alpha\cap \partial N\neq\varnothing$. The $C_\alpha$'s are pairwise disjoint, so no proper subcollection of $\{C_\alpha:\alpha<\kappa\}$ covers $\partial N$. A finite subcollection covers $\partial N$ by compactness, so $\kappa$ is finite. \end{proof} \begin{uc}\label{53}Let $X$ be a cut-point space which is a dense subset of a compact space $Y$. If $Y\setminus X$ is connected, then $Y$ has no cut points.\end{uc} \begin{proof}Suppose $Y\setminus X$ is connected. For each $p\in Y\setminus X$, the set $Y\setminus \{p\}$ is connected because it has dense connected subset $X$. Now let $x\in X$. By Theorem \ref{52}, $(\cl_{Y}C)\setminus X\neq\varnothing$ for each connected component $C$ of $X\setminus \{x\}$. Since $Y\setminus X$ is connected, this implies $Y\setminus \{x\}$ is connected. \end{proof} \begin{uc}The one-point compactification of a locally compact cut-point space has no cut points. \end{uc} To prove the next theorem, we use the fact that every connected separable metrizable space has a metrizable compactification with path-connected remainder. This was proved by Jan J. Dijkstra in \cite{po}. \begin{ut}\label{54}Every separable metrizable cut-point space densely embeds into a reducible metrizable continuum with no cut points.\end{ut} \begin{proof}Let $X$ be a separable metrizable cut-point space. By \cite[Theorem 1]{po}, there is a metrizable compactification $\gamma X$ such that $\gamma X\setminus X$ is path-connected. By Corollary \ref{53}, $\gamma X$ has no cut points. It remains to show $\gamma X$ is reducible. To that end, let $p,q\in \gamma X$. We will assume $p\neq q$, and exhibit a proper subcontinuum of $\gamma X$ containing $p$ and $q$. If $p,q\in \gamma X\setminus X$, then there is an arc $A\subseteq \gamma X\setminus X$ with $p,q\in A$. Now suppose $p\in X$ or $q\in X$. Assume $p\in X$, and write $X\setminus \{p\}=U\sqcup V$. Without loss of generality, $q\in \cl_{\gamma X} V$. Then $\cl_{\gamma X} (\{p\}\cup V)$ is a proper subcontinuum of $Y$ containing $p$ and $q$. \end{proof} The following example shows Theorem \ref{54} does not generalize to Tychonoff spaces. \begin{ue}\label{ex2}Let $[0,\omega_1)$ denote the $\omega_1$-long line, which is defined as $\omega_1 \times [0,1)$ in the lexicographic order topology. Endow $A:=[0,\omega_1)\times (\{0\}\cup \{1/n:n=1,2,3,...\})$ with the product topology. Then the locally connected fan $$X:=A/\{\langle x,y\rangle\in A:x=0\text{ or }y=0\}$$ is a Tychonoff cut-point space. Define $\overline{X}$ similarly, with $B:=[0,\omega_1]\times (\{0\}\cup \{1/n:n=1,2,3,...\})$ in the place of $A$. Here $[0,\omega_1]=[0,\omega_1)\cup \{\omega_1\}$ denotes the one-point compactification of $[0,\omega_1)$. If $f$ is any continuous real-valued function on $X$, then $f\restriction [0,\omega_1)\times \{1/n\}$ is eventually constant. We observe that $f$ continuously extends $\overline X $ by mapping $\langle \omega_1,1/n\rangle$ to the eventually constant value of $f\restriction [0,\omega_1)\times \{1/n\}$. So $\overline X =\beta X$. Thus if $\gamma X$ any compactification of $X$, then there is a continuous surjection $\beta \iota:\overline X \to \gamma X$ extending identity $\iota:X\to X$. The function $\beta \iota$ is finite-to-one, and $\gamma X \simeq \{\beta \iota^{-1}\{p\}:p\in \gamma X \}$ in the quotient topology. Thus, $\gamma X$ is obtained from $\overline X $ by collapsing finite subsets of $\{\langle \omega_1,1/n\rangle:n=1,2,3,...\}$. We see now that $\gamma X\setminus X\simeq \omega$ and $\gamma X\setminus \{\langle 0,0\rangle\}$ has infinitely many connected components. In particular, $\langle 0,0\rangle$ is a cut point of $\gamma X$. \end{ue} We say that a cut point $x\in X$ is \textit{persistent} if $x$ is a cut point of every compactification of $X$. In Example \ref{ex2}, $\langle 0,0\rangle$ is a persistent cut point of $X$. All other cut points of $X$ are non-persistent. To see this, take $\overline X $ and for each $n=1,2,3,...$ glue together the two points $\langle \omega_1,1/(2n-1)\rangle$ and $\langle \omega_1,1/(2n)\rangle$. The resulting continuum has only one cut-point: $\langle 0,0\rangle$. \begin{ut}\label{58}Let $X$ be a locally connected Tychonoff cut-point space. If $x\in X$ has a compact neighborhood, then $x$ is non-persistent. \end{ut} \begin{proof} By Corollary \ref{53}, $X\setminus \{x\}$ has only finitely many components $C_0,C_1,...,C_{n-1}$. By Theorem \ref{52}, for each $i<n$ there exists $p_i\in [\cl_{\beta X}C_i]\setminus X$. The quotient $\beta X/\{p_i:i<n\}$ is a compactification of $X$ in which $x$ is a non-cut point. \end{proof} \begin{uq}Does every Tychonoff cut-point space have a non-persistent cut point?\end{uq} A positive answer to Question 1 could be viewed as a generalization of the non-cut point existence theorem for Hausdorff continua, since each cut point of a continuum is persistent.
\section{Introduction} Error correcting codes have the ability to efficiently correct large fractions of errors while maintaining a large communication rate. The fundamental trade-offs between these two conflicting desiderata have been intensely studied in information and coding theory. Algorithmic coding theory has further studied what trade-offs can be achieved \emph{efficiently}, i.e., with polynomial time encoding and decoding procedures \smallskip This paper studies insdel codes, i.e., error correcting codes with a large minimum edit distance, which can correct synchronization errors such as insertions and deletions. While codes for Hamming errors and the Hamming metric are quite well understood, insdel codes have largely resisted such progress but have attracted a lot of attention recently~\cite{brakensiek2016efficient,bukh2017improved,guruswami2016efficiently,guruswami2017deletion,haeupler2017synchronization,haeupler2017synchronization3,haeupler2017synchronization2,haeupler2019near,cheng2018synchronization,liu2019list,liu2019explicit,haeupler2018optimal,cheng2019block,cheng2018deterministic}. A striking example of a basic question that is open in the context of synchronization errors is the determination of the maximal fraction of deletions or insertions a unique- or list-decodable binary code with non-vanishing rate can tolerate. That is, we do not even know at what fraction of errors the rate/distance tradeoff for insdel codes hits zero rate. These basic and intriguing questions are open even if one just asks about the existence of codes, irrespective of computational considerations, and even when restricted to the insertion-only setting. \smallskip In this paper we fully answer these questions for list-decodable binary codes and more generally for codes over any alphabet of a fixed size $q$. Our results are efficient and work for any combination of insertions and deletions from which list decoding is information-theoretically feasible at all. \subsection{Prior Results and Related Works} The study of codes for insertions and deletions has a long history and goes back to studies of Levenshtein\cite{Levenshtein65} in the 60s. We refer to the surveys by Sloan~\cite{sloane2002single}, Mercier et al.~\cite{mercier2010survey} and Mitzenmacher~\cite{mitzenmacher2009survey} for a more extensive background, and focus here on works related to the main thrust of this paper, namely the maximal tolerable fraction of worst-cast deletions or insertions for unique- and list-decodable code families with non-vanishing rate. We stress that our focus is on \emph{worst-case} patterns of insdel errors subject to bounds on the fraction of insertions and the fraction of deletions allowed. There is also a rich body of work on tackling random insdel errors, which is not the focus of this work. \smallskip \noindent \textbf{Unique Decoding.} Let us first review the situation for unique decoding, where the decoder must determine the original transmitted codeword. For unique decoding of binary codes, the maximal tolerable fraction of deletions is easily seen to be at most $\frac{1}{2}$ because otherwise either all zeros or all ones in a transmitted codeword can be deleted. (For $q$-ary codes, this fraction becomes $1-1/q$.) On the other hand, for a long time the best (existential) possibility results for unique-decodable binary codes stemmed from analyzing random binary codes. In the Hamming setting, random codes often achieve the best known parameters and trade-offs, and a lot of effort then goes into finding efficient constructions and decoding algorithms for codes that attempt to come close to the random constructions. However, the edit distance is combinatorially intricate and even analyzing the expected edit distance of two random strings, which is the first step in analyzing random codes, is highly non-trivial. % % Lueker~\cite{lueker2009improved}, improving upon earlier results by Dan{\v{c}}{\'\i}k and Paterson~\cite{dancik1994expected,danvcik1995upper}, proved that the expected fractional length of the longest common subsequence between two random strings lies between 0.788071 and 0.826280 (the exact value is still unknown). Using this, one can show that a random binary code of positive rate can tolerate between $0.23$ and $0.18$ fraction of deletions or insertions. Edit distance of random $q$-ary strings were studied by Kiwi, Loebl, and Matou\~sek\cite{kiwi2005expected}, leading to positive rate random codes by Guruswami and Wang \cite{guruswami2017deletion} that correct $1-\Theta(\frac{1}{\sqrt{q}})$ fraction of deletions for asymptotically large $q$. Because random codes do not have efficient decoding and encoding procedures these results were purely existential. Computationally efficient binary codes of non-vanishing rate tolerating some small unspecified constant fraction of insertions and deletions were given by Schulman and Zuckerman~\cite{schulman1999asymptotically}. Guruswami and Wang~\cite{guruswami2017deletion} gave binary codes that could correct a small constant fraction of deletions with rate approaching $1$, and this was later extended to handle insertions as well~\cite{guruswami2016efficiently}. In the regime of low-rate and large fraction of deletions, Bukh and Guruswami~\cite{bukh2016improved} gave a $q$-ary code construction that could tolerate up to a $\frac{q-1}{q+1}$ fraction of deletions, which is $\frac{1}{3}$ for binary codes. Note that this beats the performance of random codes. Together with H\aa stad~\cite{bukh2017improved} they later improved the deletion fraction to $1 - \frac{2}{q+\sqrt{q}}$ or $\sqrt{2}-1 \approx 0.414$ for binary codes. This remains the best known result for unique-decodable codes and determining whether there exist binary codes capable of correcting a fraction of deletions approaching $\frac{1}{2}$ remains a fascinating open question. \smallskip \noindent \textbf{List decoding.} The situation for list-decodable codes over small alphabets is equally intriguing. In list-decoding, one relaxes the decoding requirement from having to output the codeword that was sent to having to produce a (polynomially) small list of codewords which includes the correct one. The trivial limit of $1/2$ fraction deletions for unique-decoding binary codes applies equally well for list-decoding. In their paper, Guruswami and Wang~\cite{guruswami2017deletion} showed that this limit can be approached by efficiently list-decodable binary codes. Similarly, $q$-ary codes list-decodable from a deletion fraction approaching the optimal $1-1/q$ bound can be constructed. However, the situation was not well understood when insertions are also allowed. It had already been observed by Levenshtein~\cite{Levenshtein65} that (at least existentially) insertions and deletions are equally hard to correct for unique-decoding, in that if a code can correct $t$ deletions then it can also correct any combination of $t$ insertions and deletions. This turns out to be not true for list-decoding. This was demonstrated pointedly in \cite{haeupler2018synchronization4}, where it is shown that arbitrary large $\gamma=O(1)$ fractions of insertions (possibly exceeding 1) can be tolerated by list-decodable codes over sufficiently large constant alphabets (see \cref{thm:LargeAlphaInsDelListDecoding}), whereas the fraction of deletions $\delta$ is clearly bounded by $1$. Indeed, the fraction of insertions $\gamma$ does not even factor into the rate of these list-decodable insertion-deletion codes---this rate can approach the optimal bound of $1-\delta$ where $\delta$ is the deletion fraction. The result in \cite{haeupler2018synchronization4}, however, applies only to sufficiently large constant alphabet sizes, and it does not shed any light on the list-decodability of \emph{binary} (or any fixed alphabet) insdel codes. Considering a combination of insertions and deletions, the following bound is not hard to establish. \begin{proposition}\label{thm:impossibility} For any integer $q$ and any $\delta,\gamma \geq 0$ with $\frac{\delta}{1-\frac{1}{q}} + \frac{\gamma}{q-1} \geq 1$ there is no family of constant rate codes of length $n$ which are list-decodable from $\delta n$ deletions and $\gamma n$ insertions. \end{proposition} For the case of insertion-only binary codes, the above limits the maximum fraction of insertions to $100\%$, which is twice as large as the best possible deletion fraction of $1/2$. Turning to existence/constructions of list-decodable codes for insertions, recall that the codes of Bukh, Guruswami, H\aa stad (BGH) could unique-decode (and thus also list-decode) a fraction of $0.414$ insertions (indeed any combination of insertions and deletions totaling $0.414$ fraction). Wachter-Zeh~\cite{wachter2017list} recently put forward a Johnson-type bound for insdel codes. The classical Johnson bound works in the Hamming metric, and connects unique-decoding to list-decoding (for Hamming errors) by showing that any unique-decodable code must also be list-decodable from an even larger fraction of corruptions. One intriguing implication of Wachter-Zeh's Johnson bound for insdel codes is that any unique-decodable insdel code which tolerates a $\frac{1}{2}$ fraction of deletions (or insertions) would automatically also have to be (existentially) list-decodable from a $100\%$ fraction of insertions. Therefore, even if one is interested in unique-decoding, e.g., closing the above-mentioned gap between $\sqrt{2}-1$ and $\frac{1}{2}$, this establishes the search for maximally list-decodable binary codes from insertions as a good and indeed necessary step towards this goal. On the other hand, proving any non-trivial impossibility result bounding the maximal fraction of insertions of list-decodable binary codes away from $100\%$ would directly imply an impossibility result for unique-decoding binary codes from a deletion fraction approaching $\frac{1}{2}$. Follow-up work by Hayashi and Yasunaga~\cite{hayashi2018list} corrected some subtle but crucial bugs in \cite{wachter2017list} and reproved a corrected Johnson Bound for insdel codes. They furthermore showed that the BGH codes~\cite{bukh2017improved} could be list-decoded from a fraction $\approx 0.707$ of insertions. Lastly, via a concatenation scheme used in \cite{guruswami2017deletion,guruswami2016efficiently} they furthermore made these codes efficient. A recent work of Liu, Tjuawinata, and Xing~\cite{liu2019list} also provides efficiently list-decodable insertion-deletion codes and derives a Zyablov-type bound. In summary, for the binary insertion-only setting, the largest fraction of insertions that we knew to be list-decodable (even non-constructively) was $\approx 0.707$. \subsection{Our Results} We close the above gap and show binary codes which can be list-decoded from a fraction $1-\varepsilon$ fraction of insertions, for any desired constant $\varepsilon > 0$. In fact, we give a single family of codes that are list-decodable from any mixed combination of $\gamma$ fraction of insertions and $\delta$ fraction of deletions, as long as $2 \delta + \gamma \le 1 - \varepsilon$. \begin{theorem}\label{thm:main} For any $\varepsilon\in(0, 1)$ and sufficiently large $n$, there exists a constant rate family of efficient binary codes that are $L$-list decodable from any $\delta n$ deletions and $\gamma n$ insertions in $\operatorname{\text{{\rm poly}}}(n)$ time as long as $\gamma + 2\delta \le 1-\varepsilon$ where $n$ denotes the block length of the code, $L=O_\varepsilon(\exp(\exp(\exp(\log^*n))))$, and the code achieves a rate of $\exp\left(-\frac{1}{\varepsilon^{10}}\log^2 \frac{1}{\varepsilon}\right)$. \end{theorem} Since the computationally efficient codes from \Cref{thm:main} match the bounds from \Cref{thm:impossibility} for every $\delta,\gamma$, this nails down the entire feasibility region for list-decodability from insertions and deletions for the binary case. We stress that while we get constructive results, even the existence of inefficiently list-decodable codes, that too just for the insertion-only setting, was not known prior to this work. In the above result, the rather weird looking bound on the list-size is inherited from results on list-decoding from a huge number insertions over larger alphabets~\cite{haeupler2018synchronization4}, which in turn is inherited from the list-size bounds for the list-recoverable algebraic-geometric code constructions in \cite{guruswami2013list}. \smallskip We use similar construction techniques to obtain codes with positive rate over any arbitrary alphabet size $q$ that are list-decodable from any fraction of insertions and deletions under which list-decoding is possible. We thus precisely identify the feasibility region for any alphabet size, together with an efficient construction. Again, recall that the existence of such codes was not known earlier, even for the insertion-only case. \begin{theorem}\label{thm:qaryMain} For any positive integer $q \geq 2$, define $F_q$ as the concave polygon defined over vertices $\left(\frac{i(i-1)}{q}, \frac{q-i}{q}\right)$ for $i = 1, \cdots, q$ and $(0, 0)$. (An illustration for $q=5$ is presented in \cref{fig:actual-region}). $F_q$ does not include the border except the two segments $\left[(0, 0), (q-1, 0)\right)$ and $\left[(0, 0), \left(0, 1-1/q\right)\right)$. Then, for any $\varepsilon > 0$ and sufficiently large $n$, there exists a family of $q$-ary codes that, as long as $(\gamma, \delta) \in (1-\varepsilon)F_q$, are efficiently $L$-list decodable from any $\delta n$ deletions and $\gamma n$ insertions where $n$ denotes the block length of the code, $L=O(\exp(\exp(\exp(\log^*n))))$, and the code achieves a positive rate of $\exp\left(-\frac{1}{\varepsilon^{10}}\log^2 \frac{1}{\varepsilon}\right)$. \end{theorem} We further show in \cref{sec:large-alphabet} that for any pair of positive real numbers $(\gamma, \delta) \not\in F_q$, there exists no infinite family of $q$-ary codes with rate bounded away from zero that can be list decoded from a $\delta$-fraction of deletions plus a $\gamma$-fraction of insertions. \begin{figure}[] \centering \noSTOC{\includegraphics[height=2in]{Region.png}} \STOConly{\includegraphics[width=\linewidth]{Region.png}} \caption{Feasibility region for $q=5$.}\label{fig:actual-region} \end{figure} \subsection{Our Techniques} We achieve these results using two ingredients, each interesting in its own right. The first is a simple new concatenation scheme for list-decodable insdel codes which can be used to boost the rate of insdel codes. The second component, which constitutes the bulk of this work, is a technically intricate proof of the list-decoding properties of the Bukh-Ma codes~\cite{bukh2014longest} which have good (edit) distance properties but a tiny sub-constant rate. We note that these codes were the inner codes in the ``clean construction" in the BGH work on codes unique-decodable from a $1/3$ insdel fraction~\cite{bukh2017improved}. This was driven by a property of these codes called the \emph{span}, which is a stronger form of edit distance that applies at all scales. The Bukh-Ma codes were also used by Guruswami and Li~\cite{GL-oblivious-deletion} in their existence proof of codes of positive rate for correcting a fraction of \emph{oblivious deletions} approaching 1. In this work, the non-trivial list-decodability property of the Bukh-Ma codes drives our result. \subsubsection{Concatenating List-Decodable Insdel Codes} Our first ingredient is a simple but powerful framework for constructing list-decodable insertion-deletion codes via code concatenation. Recall that code concatenation which composes the encoding of an \emph{outer} code $C_{\rm out}$ with an \emph{inner} code $C_{\rm in}$ whose size equals the alphabet size of $C_{\rm out}$. In our approach, the outer code $C_{\rm out}$ is chosen to be a list-decodable insdel code $C_{\rm out}$ over an alphabet that is some large function of $1/\varepsilon$, but which has constant rate and is capable of tolerating a huge number of insertions. The inner code $C_{\rm in}$ is chosen to be a list-decodable insdel code over a fixed alphabet of the desired size $q$, which has non-trivial list decoding properties for the desired fraction $\delta,\gamma$ of deletions and insertions. We show that even if $C_{\rm in}$ has an essentially arbitrarily bad sub-constant rate and is not efficient, the resulting $q$-ary insdel code does have constant rate, and can also be efficiently list decoded from the same fraction of insertions and deletions as $C_{\rm in}$. For the problem considered in this paper, this framework essentially provides efficiency of codes for free. More importantly, it reduces the problem of finding good \emph{constant-rate} insdel codes over a fixed alphabet to finding a family of good list-decodable insdel codes \emph{with an arbitrarily large number of codewords}, and a list-size bounded by some fixed function of $1/\varepsilon$. \smallskip Our decoding procedure for concatenated list-decodable insdel codes is considerably simpler than similar schemes introduced in earlier works~\cite{guruswami2017deletion,guruswami2016efficiently,bukh2017improved,schulman1999asymptotically}. Of course, the encoding is simply given by the standard concatenation procedure. The decoding is done by (i) list-decoding shifted intervals of the received string using the inner code $C_{\rm in}$, (ii) creating a single string from the symbols in these lists, and (iii) using the list-decoding algorithm of the outer code on this string (viewed as a version of the outer codeword with some number of deletions and insertions). The main driving force behind why this simplistic sounding approach actually works is a judicious choice of the outer code $C_{\rm out}$. Specifically, we use the codes due to Haeupler, Shahrasbi, and Sudan~\cite{haeupler2018synchronization4} which can tolerate a very large number of insertions. This means that the many extra symbols coming from the list-decodings of the inner code $C_{\rm in}$ and the choice of overlapping intervals does not disrupt the decoding of the outer code. \subsection{\STOConly{\hspace{-1mm}}Analyzing the \noSTOC{List-Decoding }Properties of Bukh-Ma Codes} The main technical challenge that remains is to construct or prove the existence of arbitrarily large binary codes with optimal list decoding properties for any $\gamma, \delta$ (and $q$). For this we turn to a simple family of codes introduced by Bukh and Ma~\cite{bukh2014longest}, which consist of strings $(0^r\ 1^r)^{\frac{n}{r}}$ which oscillate between $0$'s and $1$'s with different frequencies. (Below we will refer to $r$ as the \emph{period}, and $1/r$ should be thought of as the \emph{frequency} of alternation.) A simple argument shows that the edit distance between any two such strings with sufficiently different periods is maximal, resulting in a tolerable fraction of edit errors of $\frac{1}{2}$ for unique decoding. The Johnson bound of \cite{wachter2017list,hayashi2018list} implies that this code must also be list-decodable from a full fraction $100\%$ of insertions. Therefore, using these codes as the inner codes in the above-mentioned concatenation scheme resolves the list-decoding question for the insertion-only setting. (The deletion-only setting is oddly easier as just random inner codes suffice, and was already resolved in \cite{guruswami2017deletion}.) This also raises hope that the Bukh-Ma codes might have good list-decoding properties for other $\gamma,\delta$ as well. Fortunately, this turns out to be true, though establishing this involves an intricate analysis that constitutes the bulk of the technical work in this paper. \begin{theorem}\label{thm:LowRateListDecBinaryCodes} For any $\varepsilon>0$ and sufficiently large $n$, let $C_{n, \varepsilon}$ be the following Bukh-Ma code: $${C}_{n, \varepsilon} = \left\{\left(0^r1^r\right)^{\frac{n}{2r}}\Big| r=\left(\frac{1}{\varepsilon^4}\right)^k, k< \log_{1/\varepsilon^4} n\right\}.$$ For any $\delta,\gamma \geq 0$ where $\gamma+2\delta < 1-\varepsilon$, ${C}_{n, \varepsilon}$ is list-decodable from any $\delta n$ deletions and $\gamma n$ insertions with\noSTOC{ a list size of $O\left(\frac{1}{\varepsilon^3}\right)$.}\STOConly{ $O(\varepsilon^{-3})$ list size.} \end{theorem} In order to prove \cref{thm:LowRateListDecBinaryCodes} we first introduce a new correlation measure which expresses how close a string is to any given frequency (or Bukh-Ma codeword) if one allows for both insertions and deletions each weighted appropriately. Using this we want to show that it is impossible to have a single string $v$ which is more than $\varepsilon$-correlated with more than $\Theta_\varepsilon(1)$ frequencies. Intuitively, one might expect that each correlation can be (fractionally) attributed to a (disjoint) part of $v$ which would result in the maximum number of $\varepsilon$-close frequencies to be at most $1/\varepsilon$. This, however, turned out to be false. Instead, we use a proof technique which is somewhat reminiscent of the one used to establish the polarization of the martingale of entropies in the analysis of polar codes~\cite{arikan2008channel,blasiok2018polar}. In more detail, we think of recursively sub-sampling smaller and smaller nested substrings of $v$, and analyze the expectation and variance of the bias between the fraction of $0$'s and $1$'s in these substrings. More precisely, we order the run lengths $r_1,r_2,\ldots$ that are $\varepsilon$-correlated with $v$ in decreasing order and first sample a substring $v_1$ with $r_1 \gg |v_1| \gg r_2$ from $v$. While the expected zero-one bias in $v_1$ is the same as in $v$, we show that the variance of this bias is an increasing function in the correlation with $\left(0^{r_1} 1^{r_1}\right)^{\frac{n}{2{r_1}}}$. Intuitively, $v_1$ cannot be too uniform on an scale of length $l$ if it is correlated with $r_1$. Put differently, in expectation the sampled substring $v_1$ will land in a part of $v$ which is either (slightly) correlated to one of the long stretches of zeros in $v$ or in a part which is correlated with a long stretch of ones in $v$, resulting in at least some variance in the bias of $v_1$. Because the scales $r_2, r_3, \ldots$ are so much smaller than $v_1$, this sub-sampling of $v_1$ furthermore preserves the correlation with these scales intact, at least in expectation. Next we sample a substring $v_2$ with $r_2 \gg |v_2| \gg r_3$ within $v_1$. Again, the bias in $v_2$ stays the same as the one in $v_1$ in expectation but the sub-sampling introduces even more variance given that $v_1$ is still non-trivially correlated with the string with period $r_2$. The evolution of the bias of the strings $v_1, v_2, \ldots$ produced by this nested sampling procedure can now be seen as a martingale with the same expectation but an ever increasing variance. Given that the bias is bounded in magnitude by 1, the increase in variance cannot continue indefinitely. This limits the number of frequencies a string $v$ can be non-trivially correlated with, which is exactly what we were after. Our generalization to larger $q$-ary alphabets follows the same high level blueprint, but is technically even more delicate. Recall that in the non-binary case, there are $(q-1)$ different linear trade-offs between $\delta,\gamma$ depending on the exact regime they lie in. \section{Preliminaries} \subsection{List-Decodable Insertion-Deletion Codes} The following list-decodable insertion-deletion codes from \cite{haeupler2018synchronization4} will be used as the outer code in our constructions. \begin{theorem}[Theorem 1.1 from~\cite{haeupler2018synchronization4}]\label{thm:LargeAlphaInsDelListDecoding} For every $\delta,\varepsilon\in(0, 1)$ and constant $\gamma > 0$, there exist a family of list-decodable insdel codes that can protect against $\delta$-fraction of deletions and $\gamma$-fraction of insertions and achieves a rate of $1-\delta-\varepsilon$ or more over an alphabet of size $\left(\frac{\gamma+1}{\varepsilon^2}\right)^{O\left(\frac{\gamma+1}{\varepsilon^3}\right)}=O_{\gamma, \varepsilon}\left(1\right)$. These codes are list-decodable with lists of size $L_{\varepsilon, \gamma}(n)= \exp\left(\exp\left(\exp\left(\log^* n\right)\right)\right)$, and have polynomial time encoding and decoding complexities. \end{theorem} \subsection{Strings, Insertions\noSTOC{ and}\STOConly{,} Deletions, and Distances} In this section we provide preliminary definitions on strings, edit operations, and related notions. \noSTOC{We start by definition of count and bias.} \begin{definition}[Count and Bias] We define $\textsf{count}_a(w)= |\{i | w[i]=a\}|$ as the number of appearances of symbol $a$ in string $w$. The bias of a binary string $w$ is the normalized difference between the appearances of zeros and ones in $w$, i.e., $\textsf{bias}(w) = \frac{\textsf{count}_1(w)-\textsf{count}_0(w)}{|w|}$. With this definition, $\textsf{count}_0(w) = \frac{1-\textsf{bias}(w)}{2}|w|$ and $\textsf{count}_1(w) = \frac{1+\textsf{bias}(w)}{2}|w|$. \end{definition} \noSTOC{Next, we formally define a \emph{matching} between two strings. } \begin{definition}[Matching] A matching $M$ of size $k$ between two strings $S$ and $S'$ is defined to be two sequences of $k$ integer positions $0 < i_1 < \ldots < i_k \leq |S|$ and $0 < i'_1 < \ldots < i'_k \leq |S'|$ for which $S[i_j]=S'[i'_j]$ for all $j \leq k$. The subsequence induced by a matching $M$ is simply $S[i_1],\ldots,S[i_k]$. Every common subsequence between $S$ and $S'$ implicitly corresponds to a matching and we use the two interchangeably. \end{definition} \noSTOC{We now proceed to define the important notion of advantage.} \begin{definition}[Advantage of a Matching] Let $M$ be a matching between two binary strings $a$ and $b$. The \emph{advantage of the matching $M$} is defined as \noSTOC{$$\textsf{adv}_M = \frac{3|M|-|a|-|b|}{|a|}.$$}\STOConly{$\textsf{adv}_M = \frac{3|M|-|a|-|b|}{|a|}.$} \end{definition} \begin{definition}[Advantage] For a given pair of strings $a$ and $b$, the \emph{advantage of $a$ to $b$} is defined as the advantage of the matching $M$ that corresponds to the largest common subsequence between them, i.e., $\textsf{adv}(a, b) = \textsf{adv}_{M=\textnormal{LCS}(a, b)}$. It is easy to verify that the longest common subsequence $M$ maximizes the advantage among all matchings from $a$ to $b$. \end{definition} We now make the following remark that justifies the notion of advantage as defined above. Note that any matching between two strings $a$ and $b$ implies a set of insertions and deletions to convert $b$ to $a$ which is, to delete all unmatched symbols in $b$ and insert all unmatched symbols in $a$ within the remaining symbols. \begin{remark}\label{rmk:advInterpretation} Consider strings $a$ and $b$ and matching $M$ between them. Think of $a$ as a distorted version of $b$ and let $\delta_M$ and $\gamma_M$ represent the fraction of deletions and insertions needed to convert $b$ to $a$ as suggested by $M$, i.e., \noSTOC{$$\delta_M = \frac{\textnormal{Number of unmatched symbols in $b$}}{|b|}=\frac{|b|-|M|}{|b|},$$ and $$\gamma_M = \frac{\textnormal{Number of unmatched symbols in $a$}}{|b|}=\frac{|a|-|M|}{|b|}.$$}\STOConly{$\delta_M = \frac{\textnormal{Number of unmatched symbols in $b$}}{|b|}=\frac{|b|-|M|}{|b|},$ and $\gamma_M = \frac{\textnormal{Number of unmatched symbols in $a$}}{|b|}=\frac{|a|-|M|}{|b|}.$} The $\textsf{adv}_M$ function tracks the value of $|b|(1-2\delta_M-\gamma_M)$ normalized by $|a|$ rather than $|b|$. \noSTOC{$$\textsf{adv}_M(a, b) = \frac{3|M|-|a| - |b|}{|a|} = \frac{3|b|(1-\delta_M) - |b|(1-\delta_M+\gamma_M) - |b|}{|a|}=\frac{|b|}{|a|}\cdot (1- 2\delta_M-\gamma_M)$$}\STOConly{ \begin{align*} &\textsf{adv}_M(a, b) = \frac{3|M|-|a| - |b|}{|a|}\\ &= \frac{3|b|(1-\delta_M) - |b|(1-\delta_M+\gamma_M) - |b|}{|a|}=\frac{|b|}{|a|}\cdot (1- 2\delta_M-\gamma_M) \end{align*} } We will make use of this unnatural normalization later on. \end{remark} We now extend the definition of advantage to the case where the second argument is an infinite string. \begin{definition}[Infinite Advantage] For a finite string $a$ and infinite string $b$, the advantage of $a$ to $b$ is defined as the minimum advantage that $a$ has over all substrings of $b$. $$\textsf{adv}(a, b) = \min_{b' = b[i, j]}\textsf{adv}(a, b').$$ \end{definition} We now define a family of binary strings called \emph{Alternating Strings}. \begin{definition}[Alternating Strings] For any positive integer $r$, we define the infinite alternating string of run-length $r$ as $A_r = (0^r1^r)^\infty$ and denote its prefix of length $l$ with $A_{r,l} = A_r[1,l]$. \end{definition} We finish the preliminaries by the following lemma stating some properties of the notions defined through this section. \begin{lemma}\label{lem:advProperties} The following properties hold true: \begin{itemize} \item For any pair of binary strings $S_1, S_2$ where $\textsf{adv}(S_1, S_2) > 0$, lengths of $S_1$ and $S_2$ are within a factor of two of each other, i.e, $\min(|S_1|, |S_2|) \geq \frac{\max(|S_1|, |S_2|)}{2}$. \item For any binary string $S$ and integer $r$, $\textsf{adv}(S, A_{r}) \geq -\frac{1}{2}$ \end{itemize} \end{lemma} \begin{proof} For the first part, let $M=\textnormal{LCS}(S_1, S_2)$. We have that $\textsf{adv}(S_1, S_2) \geq 0\Rightarrow 3|M|\geq|S_1|+|S_2|$, which, as $|M|\leq\min(|S_1|, |S_2|)$, implies that $\min(|S_1|, |S_2|) \geq \frac{\max(|S_1|, |S_2|)}{2}$. For the second part, let $n=|S|$ and assume that $b\in\{0, 1\}$ is the most frequent bit in $S$ and there are $m$ occurrences of $b$ in $S$. Take a substring $S'$ in $A_r$ as the smallest string that starts at the beginning of a $b^r$ block and contains the same number of $b$s as $S$. The size of $S'$ is no more than $2m$ and the longest common subsequence between $S$ and $S'$ is at least $m$. Therefore, \noSTOC{\begin{equation*} \textsf{adv}(S, A_{r})\geq \textsf{adv}(S, S')\geq\frac{3|M|-|S|-|S'|}{|S|}\geq\frac{3m-2m-2m}{n} \geq \frac{-m}{n} \geq -\frac{1}{2}.\qedhere \end{equation*}}\STOConly{$\textsf{adv}(S, A_{r})\geq \textsf{adv}(S, S')\geq\frac{3|M|-|S|-|S'|}{|S|}\geq\frac{3m-2m-2m}{n} \geq \frac{-m}{n} \geq -\frac{1}{2}.$\qedhere} \end{proof} \section{Proof of \STOConly{Theorem \ref{thm:LowRateListDecBinaryCodes}}\noSTOC{\cref{thm:LowRateListDecBinaryCodes}}: List-Decoding for Bukh-Ma Codes} To prove this theorem, we assume for the sake of contradiction that there exists a string $v$ and $k > \frac{1200}{\varepsilon^3}$ members of ${C}_{n, \varepsilon}$ like $A_{r_1, n}, A_{r_2, n}, \cdots, A_{r_k, n}$, so that each $A_{r_i, n}$ can be converted to $v$ with $I_i$ insertions and $D_i$ deletions where $I_i+2D_i \leq n(1-\varepsilon)$. We define the indices in a way that $r_1 > r_2 > \cdots > r_k$. Given the definition of ${C}_{n, \varepsilon}$, $r_{i} \geq \frac{r_{i+1}}{\varepsilon^4}$. We first show that, for \noSTOC{all }$i=1, 2, \cdots, k$, $\textsf{adv}(v, A_{r_i, n}) \geq \frac{\varepsilon}{2}$. \begin{lemma}\label{lem:advantage} For any $1\leq i\leq k$, $\textsf{adv}(v, A_{r_i, n}) \geq \frac{\varepsilon}{2}$. \end{lemma} \begin{proof} Let $M_i$ denotes the matching that corresponds to the set of $I_i$ insertions and $D_i$ deletions that convert $A_{r_i, n}$ to $v$. $$I_i+2D_i \leq n(1-\varepsilon) \Rightarrow n-I_i-2D_i \geq n\varepsilon\Rightarrow 1-\gamma_i-2\delta_i \geq \varepsilon $ Note that according to \cref{rmk:advInterpretation}, $\textsf{adv}(v, A_{r_i, n}) = \frac{n}{|v|}\cdot(1-\gamma_i-2\delta_i)$. Thus, $\textsf{adv}(v, A_{r_i, n}) \geq \frac{n}{|v|} \varepsilon \geq \frac{\varepsilon}{2}$. The last step follows from the first item of \cref{lem:advProperties}. \end{proof} Having \cref{lem:advantage}, we are ready to prove \cref{thm:LowRateListDecBinaryCodes}. We start with defining a couple of sequences of random variables via random sampling of nested substrings of $v$. We split the string $v$ into substrings of size $l_1 = r_1\varepsilon^2$, pick one uniformly at random and denote it by $v_1$. We define random variable $A_1 = \textsf{adv}(v_1, A_{r_1})$ and random variable $B_1 = \textsf{bias}(v_1)$. Similarly, we split $v_1$ into substrings of length $l_2 = r_2\varepsilon^2$ and pick $v_2$ uniformly at random and define $A_2 = \textsf{adv}(v_2, A_{r_2})$ and $B_2 = \textsf{bias}(v_2)$. Continuing this procedure, one can obtain the two sequences of random variables $A_1, A_2, \cdots, A_k$ and $B_1, B_2, \cdots, B_k$. We will prove the following. \noSTOC{ \begin{lemma}\label{lem:process-guarantees} The following hold for $A_1, A_2, \cdots, A_k$ and $B_1, B_2, \cdots, B_k$. \begin{enumerate} \item $\E[B_i] = \textsf{bias}(v)$ \item $\E[A_i] \geq \frac{\varepsilon}{2}$ \end{enumerate} \end{lemma}} \STOConly{ \begin{lemma}\label{lem:process-guarantees} The following hold for $A_1, \cdots, A_k$ and $B_1, \cdots, B_k$:\\ $\quad (1) \E[B_i] = \textsf{bias}(v),\quad (2) \E[A_i] \geq \frac{\varepsilon}{2}.$ \end{lemma}} \begin{proof Note that one can think of $v_i$ as a substring of $v$ that is obtained by splitting $v$ into substrings of length $l_i$ and choosing one uniformly at random. Let $U$ denote the set of all such substrings. We have that \begin{eqnarray*} \E[B_i] &=& \sum_{\hat{v}\in U}\frac{1}{|U|}\cdot\textsf{bias}(\hat{v}) = \frac{1}{|U|}\sum_{\hat{v}\in U}\frac{\textsf{count}_1(\hat{v})-\textsf{count}_0(\hat{v})}{l_i} \STOConly{\\&}=\STOConly{&} \frac{\textsf{count}_1(v)-\textsf{count}_0(v)}{|U|\cdot l_i} = \textsf{bias}(v). \end{eqnarray*} A similar argument proves the second item. Take the matching $M_i$ between $v$ and $A_{r_i, n}$ that achieves the advantage $\textsf{adv}(v, A_{r_i, n})$, i.e., the largest matching between $v$ and $A_{r_i, n}$. Take some $\hat{v}\in U$; $\hat{v}$ is mapped to some substring in $A_{r_i, n}$ under $M_i$. We call that substring of $\hat{v}$, \emph{the projection of $\hat{v}$ under $M_i$} and denote it by $\hat{v} \rightarrow M_i$. We also represent the subset of $M_i$ that appears between $\hat{v}$ and $\hat{v} \rightarrow M_i$ with $M_i[\hat{v}]$. For a $\hat{v}\in U$, we define $a(\hat{v})$ as the value for advantage that is yielded by the matching $M_i[\hat{v}]$ between $\hat{v}$ and $\hat{v} \rightarrow M_i$. In other words, $a(\hat{v}) = \frac{3|M_i[\hat{v}]| - |\hat{v}|- |\hat{v} \rightarrow M_i|}{|\hat{v}|}$. Given the definitions of advantage and infinite advantage, we have that \noSTOC{$$a(\hat{v}) \leq \textsf{adv}(\hat{v}, \hat{v} \rightarrow M_i) \leq \textsf{adv}(\hat{v}, A_{r_i}).$$}\STOConly{$a(\hat{v}) \leq \textsf{adv}(\hat{v}, \hat{v} \rightarrow M_i) \leq \textsf{adv}(\hat{v}, A_{r_i}).$} This can be used to prove the second item as follows: \begin{eqnarray*} \E[A_i] &=& \sum_{\hat{v}\in U} \frac{1}{|U|}\cdot\textsf{adv}(\hat{v}, A_{r_i}) \geq \frac{1}{|U|}\cdot\sum_{\hat{v}\in U} a(\hat{v})\\ &=&\frac{1}{|U|}\cdot\sum_{\hat{v}\in U} \frac{3|M_i[\hat{v}]|-|\hat{v}|-|\hat{v}\rightarrow M_i|}{|\hat{v}|} \STOConly{\\&}=\STOConly{&}\frac{1}{|U|\cdot|\hat{v}|}\cdot\sum_{\hat{v}\in U} \left(3|M_i[\hat{v}]|-|\hat{v}|-|\hat{v}\rightarrow M_i|\right)\\ &=&\frac{1}{|v|}\cdot \left(3|M_i|-|v|-|A_{r_i, n}|\right) =\textsf{adv}(v, A_{r_i, n})\geq \frac{\varepsilon}{2} \end{eqnarray*} where the last step follows from \cref{lem:advantage}. \end{proof} \begin{lemma}\label{lem:process-variance-guarantee} For the sequence $B_1, B_2, \cdots, B_k$, we have \noSTOC{$$\textnormal{Var}(B_{i+1}) \geq \textnormal{Var}(B_i) + \frac{\varepsilon^3}{1200}, \quad \forall 1\leq i < k.$$} \STOConly{$\textnormal{Var}(B_{i+1}) \geq \textnormal{Var}(B_i) + \frac{\varepsilon^3}{1200}, \quad \forall 1\leq i < k.$} \end{lemma} \begin{proof} To analyze the relation of $\textnormal{Var}(B_i)$ and $\textnormal{Var}(B_{i+1})$, we use the law of total variance and condition the variance of $B_{i+1}$ on $v_i$, i.e., the substring chosen in the $i$th step of the stochastic process, from which we sub sample $v_{i+1}$. \begin{eqnarray} \textnormal{Var}(B_{i+1})&=&\textnormal{Var}\left(\E[B_{i+1}|v_{i}]\right) + \E\left[\textnormal{Var}(B_{i+1}|v_{i})\right]\nonumber\\ &=&\textnormal{Var}\left(B_{i}\right) + \E\left[\textnormal{Var}(B_{i+1}|v_{i})\right]\label{eqn:totalVar1} \end{eqnarray} Equation \eqref{eqn:totalVar1} comes from the fact that the average bias of substrings of length $l_{i+1}$ in $v_i$ is equal to the bias of $v_i$. Having this, we see that it suffices to show that $\E\left[\textnormal{Var}(B_{i+1}|v_{i})\right] \geq \varepsilon^3/1200$. We remind the reader that $v_{i+1}$ is obtained by splitting $v_i$ into substrings of length $l_{i+1} = r_{i+1}\varepsilon^2$ and choosing one at random. We denote the set of such substrings by $U$. Also, there is a matching $M_i$ between $v_i$ and $A_{r_{i+1}}$ with advantage $\varepsilon$ or more. Any substring of length $l_{i+1}$ is mapped to some substring in $A_{r_{i+1}}$, i.e., its projection of the substring under $M_i$. Note there are three different possibilities for such projection. It is either an all zeros string, an all one string, or a string that contains both zeros and ones. We partition $U$ into three sets $U_0$, $U_1$, and $U_e$ based on which case the projection belongs to. (See \cref{fig:substringTypeAlternting}) \begin{figure}[] \centering \noSTOC{\includegraphics[width=.75\textwidth]{substringTypeAlternting.pdf}} \STOConly{\includegraphics[width=\linewidth]{substringTypeAlternting.pdf}} \caption{Partitioning substrings of length $l_{i+1}$ into three sets $U_0, U_1, U_e$}\label{fig:substringTypeAlternting} \end{figure} We partition the sample space into three events $E_0$, $E_1$, and $E_e$ based on whether $v_{i+1}$ belongs to $U_0$, $U_1$, or $U_e$ respectively. We also define the random variable $T$ over $\{0, 1, e\}$ that indicates which one of $E_0$, $E_1$, or $E_e$ happens. Once again, we use the law of total variance to bound $\E\left[\textnormal{Var}(B_{i+1}|v_i)\right]$. \noSTOC{ \begin{eqnarray} \E\left[\textnormal{Var}(B_{i+1}|v_{i})\right] &=&\E_{v_i}\big[\textnormal{Var}_{T}(\E\left[B_{i+1}|v_i, T\right]) + \E_{T}\left[\textnormal{Var}(B_{i+1}|v_i, T)\right]\big]\nonumber\\ &\geq& \E_{v_i}\big[\textnormal{Var}_{T}(\E\left[B_{i+1}|v_i, T\right])\big]\label{eqn:varLoweboundStep2} \end{eqnarray}} \STOConly{ \begin{eqnarray} \E\left[\textnormal{Var}(B_{i+1}|v_{i})\right] &=&\E_{v_i}\big[\textnormal{Var}_{T}(\E\left[B_{i+1}|v_i, T\right])\nonumber\\ &&+ \E_{T}\left[\textnormal{Var}(B_{i+1}|v_i, T)\right]\big]\nonumber\\ &\geq& \E_{v_i}\big[\textnormal{Var}_{T}(\E\left[B_{i+1}|v_i, T\right])\big]\label{eqn:varLoweboundStep2} \end{eqnarray}} Note that the term $\textnormal{Var}_{T}(\E\left[B_{i+1}|v_i, T\right])$ refers to variance of a 3-valued random variable that takes the value $\E_{v_i}\left[B_{i+1}|v_i, T=t\right]$ with probability $\Pr\{T=t|v_i\}$ for $t\in\{0, 1, e\}$. We use three important facts about this distribution to bound its variance from below. First, $\Pr\{T=e|v_i\} \leq 2\varepsilon^2$. To see this, note that the run length of $A_{r_{i+1}}$ is $r_{i+1} =\frac{l_{i+1}}{\varepsilon^2}$ and the length of the projection of $v_i$ in $A_{r_i}$ under the matching that yields the optimal $\textsf{adv}(v_i, A_{r_i})$ is no more than $2|v_i|=2l_i$ (See~\cref{lem:advProperties}). Therefore, $|U_e|\leq \frac{2 l_i}{r_{i+1}}$ and consequently no more that a $\frac{2 l_i / r_{i+1}}{l_i/l_{i+1}} = 2\varepsilon^2$ fraction of strings in $U$ might be mapped to a substring of $A_{r_{i+1}}$ that crosses the border of some $0^{r_{i+1}}$ and $1^{r_{i+1}}$ intervals. Secondly, for any $j\in\{0, 1\}$, $\Pr\{T=j|v_i\} \geq \frac{\textsf{adv}(v_i, A_{r_{i+1}})-8\varepsilon^2}{8}$. This can be showed as follows. Let $M_i^j$ represent the subset of pairs of $M_i$ with one end in $U_j$ for $j\in\{0, 1, e\}$ and $v_i\rightarrow M_i$ represent the substring of $A_{r_{i+1}}$ where $v_i$ is projected under $M_i$. Note that $\Pr\{T=j|v_i\} = \frac{|U_j|}{|U|} = \frac{|U_j|\cdot l_i}{|v_i|}\geq \frac{|M_i^j|}{|v_i|} \geq \frac{|M_i^j|}{2|v_i\rightarrow M_i|}$. Assume for contradiction that $\Pr\{T=j|v_i\} < \frac{\textsf{adv}(v_i, A_{r_{i+1}})-8\varepsilon^2}{8}$ for some $j$. Then, $|M_i^j| < |v_i\rightarrow M_i|\frac{\textsf{adv}(v_i, A_{r_{i+1}})-8\varepsilon^2}{4}$, which since $|M_i^{j'}|\leq\frac{|v_i\rightarrow M_i|}{2}$ for $j'\in\{0, 1\}$ and $|M^e_i|\leq 2\varepsilon^2|v_i\rightarrow M_i|$, gives that $|M_i|<|v_i\rightarrow M_i|\left(\frac{1}{2} + 2\varepsilon^2 + \frac{\textsf{adv}(v_i, A_{r_{i+1}})-8\varepsilon^2}{4}\right) = |v_i\rightarrow M_i|\left(\frac{1}{2} + \frac{\textsf{adv}(v_i, A_{r_{i+1}})}{4}\right)$. However, \noSTOC{ \begin{equation*} \textsf{adv}_{M_i} = \frac{3|M_i|-|v_i|-|p|}{|v_i|} \Rightarrow 2|M_i|-|p|\geq |v_i|\textsf{adv}_{M_i}\Rightarrow |M_i| \geq |p|\left(\frac{1}{2}+\frac{\textsf{adv}_{M_i}}{4}\right). \end{equation*}} \STOConly{$\textsf{adv}_{M_i} = \frac{3|M_i|-|v_i|-|p|}{|v_i|} \Rightarrow 2|M_i|-|p|\geq |v_i|\textsf{adv}_{M_i}\Rightarrow |M_i| \geq |p|\left(\frac{1}{2}+\frac{\textsf{adv}_{M_i}}{4}\right).$} This contradiction implies that $\Pr\{T=j|v_i\} \geq \frac{\textsf{adv}(v_i, A_{r_{i+1}})-8\varepsilon^2}{8}$. The third and final important ingredient is provided by the following lemma that we prove later on. \begin{lemma}\label{lem:polarization} The following holds true: $$\Big|\E\left[B_{i+1}|v_i, T=0\right] - \E\left[B_{i+1}|v_i, T=1\right]\Big| \geq \frac{\textsf{adv}(v_i, A_{r_{i+1}}) - 5\varepsilon^2}{3}$$ \end{lemma} To summarize, the above three properties imply that we have a three-valued random variable where the probability for one value is minuscule and there is at least $[\textsf{adv}(v_i, A_{r_{i+1}}) - 5\varepsilon^2]/3$ difference between the other two values each occurring with adequately large probabilities. This is enough for us to bound below the variance of such random variable. The following straightforward lemma abstracts this. \begin{lemma}\label{lem:threeValuedVariance} Let $X$ be a random variable that can take values $a_0$, $a_1$, and $a_2$ where $\Pr\{X=a_i\} \geq \xi$ for $i\in\{0, 1\}$. Then, we have that $\textnormal{Var}(X) \geq \frac{\xi}{2}(a_0-a_1)^2$. \end{lemma} \noSTOC{\begin{proof} $\textnormal{Var}(X)=\sum_{a_i}\Pr\{X=a_i\}(a_i-\bar{X})^2\geq \xi \left[(a_0-\bar{X})^2+(a_1-\bar{X})^2\right] \geq \frac{\xi}{2}(a_0-a_1)^2$. \end{proof}} Applying \cref{lem:threeValuedVariance} to our random variable gives that: \noSTOC{\begin{equation*} \textnormal{Var}_{T}(\E\left[B_{i+1}|v_i, T\right]) \geq \frac{1}{144}\left(\textsf{adv}(v_i, A_{r_{i+1}})-8\varepsilon^2\right)\left(\textsf{adv}(v_i, A_{r_{i+1}}) - 5\varepsilon^2\right)^2 \end{equation*}} \STOConly{ $$\textnormal{Var}_{T}(\E\left[B_{i+1}|v_i, T\right]) \geq \frac{\left(\textsf{adv}(v_i, A_{r_{i+1}})-8\varepsilon^2\right)\left(\textsf{adv}(v_i, A_{r_{i+1}}) - 5\varepsilon^2\right)^2}{144} $$} Note the right hand side of this inequality is negative when $\textsf{adv}(v_i, A_{r_{i+1}})\leq8\varepsilon^2$. Therefore, we define function $g(x)$ as a function that takes value of $\frac{(x-8\varepsilon^2)(x-5\varepsilon^2)}{144}$ when $x > 8\varepsilon^2$ and zero otherwise. Note that $g$ is a convex function. We have that \begin{equation} \textnormal{Var}_{T}(\E\left[B_{i+1}|v_i, T\right]) \geq g(\textsf{adv}(v_i, A_{r_{i+1}}))\label{lem:3ValVarLowerBound} \end{equation} Plugging \eqref{lem:3ValVarLowerBound} into \eqref{eqn:varLoweboundStep2} gives that \noSTOC{\begin{eqnarray} \E\left[\textnormal{Var}(B_{i+1}|v_{i})\right] &\geq& \E_{v_i}\big[\textnormal{Var}_{T}(\E\left[B_{i+1}|v_i, T\right])\big] \geq\E_{v_i}\big[g(\textsf{adv}(v_i, A_{r_{i+1}}))\big]\nonumber\\ &\geq&g\left(\E_{v_i}\big[\textsf{adv}(v_i, A_{r_{i+1}})\big]\right) = g(\E[A_{i+1}])\label{eqn:jensen}\\ &\geq& g\left(\frac{\varepsilon}{2}\right) = \frac{\varepsilon^3}{1152}+o(\varepsilon^3)\label{eqn:lastStepVarLower} \end{eqnarray}} \STOConly{\begin{eqnarray} \E\left[\textnormal{Var}(B_{i+1}|v_{i})\right] &\geq& \E_{v_i}\big[\textnormal{Var}_{T}(\E\left[B_{i+1}|v_i, T\right])\big] \nonumber\\& \geq &\E_{v_i}\big[g(\textsf{adv}(v_i, A_{r_{i+1}}))\big]\nonumber\\ &\geq&g\left(\E_{v_i}\big[\textsf{adv}(v_i, A_{r_{i+1}})\big]\right) = g(\E[A_{i+1}])\label{eqn:jensen}\\ &\geq& g\left(\varepsilon/2\right) = \varepsilon^3/1152+o(\varepsilon^3)\label{eqn:lastStepVarLower} \end{eqnarray}} where \eqref{eqn:jensen} follows from the Jensen inequality and \eqref{eqn:lastStepVarLower} follows from \cref{lem:process-guarantees} and the fact that $g$ is an increasing function. Note that the right hand side is at least $\frac{\varepsilon}{1200}$ for sufficiently small $\varepsilon$. This completes the proof of \cref{lem:process-variance-guarantee} (With the exception of \cref{lem:polarization}). \end{proof} With \cref{lem:process-variance-guarantee} proved, one can easily prove \cref{thm:LowRateListDecBinaryCodes}. \begin{proof}[{\bf Proof of \cref{thm:LowRateListDecBinaryCodes}}] Since $\textnormal{Var}(B_{i+1}) \geq \textnormal{Var}(B_i) + \varepsilon^3/1200$, we have that \noSTOC{$$\textnormal{Var}(B_{k})\geq\textnormal{Var}(B_1) + (k-1)\frac{\varepsilon^3}{1200} \geq \frac{(k-1)\varepsilon^3}{1200}.$$} \STOConly{$\textnormal{Var}(B_{k})\geq\textnormal{Var}(B_1) + (k-1)\frac{\varepsilon^3}{1200} \geq \frac{(k-1)\varepsilon^3}{1200}.$} If $k > \frac{1200}{\varepsilon^3}$, the above inequality implies that $\textnormal{Var}(B_{k}) > 1$ which is impossible since $B_{k}$ takes value in $[-1, 1]$. This contradiction implies that the list size $k \leq \frac{1200}{\varepsilon^3}$. \end{proof} We now proceed to the proof of \cref{lem:polarization}. \subsection{Proof of \cref{lem:polarization}} \pushQED{\qed} Consider $v_i$ and the matching that yields the optimal advantage from $v_i$ to $A_{r_{i+1}}$, denoted by $M_i$. We denote the substring of $A_{r_{i+1}}$ that is identified by the projection of $v_i$ under $M_i$ as $p = v_i\rightarrow M_i$. To simplify the analysis, we perform a series of transformations on $v_i$, $M_i$, and $p$ that does not decrease $\textsf{adv}_{M_i}$ except by a small quantity. \cref{fig:transformtion} depicts the steps of this transformation described below. \begin{figure}[] \centering \includegraphics[height=4in]{Transformation-Vertical.pdf}\\ \caption{Three steps of transformation in \cref{lem:polarization}.}\label{fig:transformtion} \end{figure} \begin{enumerate} \item \label{step:modificationStepOne}First, we delete all substrings of $U_e$---i.e., substrings of length $l_i$ in $v_i$ whose projection contain both \noSTOC{zeros and ones}\STOConly{0s and 1s}---from $v_i$ \item We reorder the substrings of length $l_{i+1}$ in $v_i$ by shifting all $U_0$ substrings together and all $U_1$ substrings together. We accordingly shift the projections of these strings in $p$ to the similar order. This was, the remainder of $M_i$ from step \ref{step:modificationStepOne} will be preserved as a valid matching between reordered strings. \item At this point, string $p$ consists of a stretch of zeros followed by a stretch of ones. If the length of two stretches are not equal, we add adequate zeros or ones to the smaller stretch to make $p$ have the form of $0^t1^t$. \end{enumerate} To track the changes in $\textsf{adv}_{M_i}$ during this transformation, we track how $|M_i|$, $|v_i|$ and $|p|$ change throughout the three steps mentioned above. In the first step, a total of up to $|U_e| l_{i+1}$ elements are removed from $v_i$ and $M_i$. Note that since the run length of $A_{r_{i+1}}$ is $r_{i+1}$, there can only be $\frac{|p|}{r_{i+1}}$ substrings in $U_e$. Therefore, \noSTOC{$$|U_e| l_{i+1} \leq \frac{|p|l_{i+1}}{r_{i+1}} = |p|\varepsilon^2 \leq 2\varepsilon^2|v_i|.$$}\STOConly{$|U_e| l_{i+1} \leq \frac{|p|l_{i+1}}{r_{i+1}} = |p|\varepsilon^2 \leq 2\varepsilon^2|v_i|.$} The second step preserves $|M_i|$, $|v_i|$ and $|p|$. Finally, since $p$ is a substring of $A_{r_{i+1}}$, the third step increases $|p|$ only by up to $r_{i+1}$. Note the run length of the $A_{r_{i+1}}$s and consequently $l_{i+1}$s are different by a multiplicative factor of at least $\frac{1}{\varepsilon^4}$ by the definition of the code $\mathcal{C}$. Therefore, $r_{i+1} = \frac{l_{i+1}}{\varepsilon^2} = \frac{l_{i+1}|v_i|}{\varepsilon^2|v_i|} = \frac{l_{i+1}|v_i|}{\varepsilon^2 l_{i}} \leq \varepsilon^2|v_i|$. Overall, the value of the $\textsf{adv}_{M_i} = \frac{3|M|-|p|-|v_i|}{|v_i|}$ can be affected by a maximum of $(3-1)\times2\varepsilon^2|v_i| + \varepsilon^2|v_i| = 5\varepsilon^2|v_i|$ decrease in the numerator and $\varepsilon^2|v_i|$ decrease in the denominator. Therefore, the eventual advantage does not drop below $\textsf{adv}_{M_i} - 5\varepsilon^2$. Let us denote the transformed versions of $v_i$, $p$, and $M_i$ by $\bar{v}_i$, $\bar{p}$, and $\bar{M}_i$ respectively. We have shown that \begin{equation} \textsf{adv}_{\bar{M}_i} \geq \textsf{adv}_{M_i} - 5\varepsilon^2.\label{eqn:advLowerBoundAfterTransformation} \end{equation} Further, let $\bar{v}_i = (\bar{v}_i^0, \bar{v}_i^1)$ so that $\bar{v}_i^0$ and $\bar{v}_i^1$ respectively correspond to the part of $\bar{v}_i$ that is mapped to $0^t$ and $1^t$ under $\bar{M}_i$. Consider the matching between $\bar{v}_i$ and $\bar{p}$ that connects as many zeros as possible between the $\bar{v}_i^0$ and $0^t$ and as many ones as possible between the $\bar{v}_i^1$ to $1^t$ portion of $\bar{p}$. Clearly, the size of $\bar{M}_i$ cannot exceed the size of this matching and therefore, \begin{equation}\label{eqn:01advantage} \textsf{adv}_{\bar{M}_i} \leq \frac{3\left[\min\{t, \textsf{count}_0(\bar{v}_i^0)\}+\min\{t, \textsf{count}_1 (\bar{v}_i^1)\}\right] - |\bar{v}_i| - 2t}{|\bar{v}_i|} \end{equation} Note that as long as $t<\textsf{count}_0(\bar{v}_i^0)$ or $t<\textsf{count}_1(\bar{v}_i^1)$, increasing $t$ in the right hand side term does not make it smaller. Therefore, the inequality \eqref{eqn:01advantage} holds for $t=\max_{j\in\{0, 1\}}\{\textsf{count}_j(\bar{v}_i^j)\}$. Without loss of generality, assume that $\textsf{count}_0(\bar{v}_i^0) \leq \textsf{count}_1(\bar{v}_i^1)$ and set $t=\textsf{count}_1(\bar{v}_i^1)$. Then we have the following. \noSTOC{\begin{eqnarray} &&\textsf{adv}_{\bar{M}_i} \leq \frac{3 \textsf{count}_0(\bar{v}_i^0)+\textsf{count}_1 (\bar{v}_i^1) - |\bar{v}_i|}{|\bar{v}_i|}\nonumber\\ &\Rightarrow& \textsf{adv}_{\bar{M}_i} \leq \frac{3 \frac{1-\textsf{bias}(\bar{v}_i^0)}{2}|\bar{v}_i^0|+\frac{1+\textsf{bias}(\bar{v}_i^1)}{2}|\bar{v}_i^1| - (|\bar{v}_i^0|+|\bar{v}_i^1|)}{|\bar{v}_i|}\nonumber\\ &\Rightarrow& 2\textsf{adv}_{\bar{M}_i}|\bar{v}_i| \leq 3 (1-\textsf{bias}(\bar{v}_i^0))|\bar{v}_i^0|+(1+\textsf{bias}(\bar{v}_i^1))|\bar{v}_i^1| - 2(|\bar{v}_i^0|+|\bar{v}_i^1|)\nonumber\\ &\Rightarrow& 2\textsf{adv}_{\bar{M}_i}|\bar{v}_i| \leq \left[1-3\textsf{bias}(\bar{v}_i^0)\right] |\bar{v}_i^0| - \left[1-\textsf{bias}(\bar{v}_i^1)\right] |\bar{v}_i^1|\label{eqn:biasDiscrepency} \end{eqnarray}} \STOConly{ \begin{align} &\textsf{adv}_{\bar{M}_i} \leq \frac{3 \textsf{count}_0(\bar{v}_i^0)+\textsf{count}_1 (\bar{v}_i^1) - |\bar{v}_i|}{|\bar{v}_i|}\nonumber\\ \Rightarrow\ & \textsf{adv}_{\bar{M}_i} \leq \frac{3 \frac{1-\textsf{bias}(\bar{v}_i^0)}{2}|\bar{v}_i^0|+\frac{1+\textsf{bias}(\bar{v}_i^1)}{2}|\bar{v}_i^1| - (|\bar{v}_i^0|+|\bar{v}_i^1|)}{|\bar{v}_i|}\nonumber\\ \Rightarrow\ & 2\textsf{adv}_{\bar{M}_i}|\bar{v}_i| \leq 3 (1-\textsf{bias}(\bar{v}_i^0))|\bar{v}_i^0|\nonumber\\ &+(1+\textsf{bias}(\bar{v}_i^1))|\bar{v}_i^1| - 2(|\bar{v}_i^0|+|\bar{v}_i^1|)\nonumber\\ \Rightarrow\ & 2\textsf{adv}_{\bar{M}_i}|\bar{v}_i| \leq \left[1-3\textsf{bias}(\bar{v}_i^0)\right] |\bar{v}_i^0| - \left[1-\textsf{bias}(\bar{v}_i^1)\right] |\bar{v}_i^1|\label{eqn:biasDiscrepency} \end{align} } We claim that the above inequality leads to the fact that $|\textsf{bias}(\bar{v}_i^1)- \textsf{bias}(\bar{v}_i^0)| \geq \textsf{adv}_{\bar{M}_i}/3$. Assume for contradiction that this is not the case. Therefore, replacing the term $\textsf{bias}(\bar{v}_i^0)$ with $\textsf{bias}(\bar{v}_i^1)$ in \eqref{eqn:biasDiscrepency} does not change the value of the right hand side by any more than $|\bar{v}_i|\cdot \textsf{adv}_{\bar{M}_i}$. Same holds true with replacing the term $\textsf{bias}(\bar{v}_i^1)$ with $\textsf{bias}(\bar{v}_i^0)$ in \eqref{eqn:biasDiscrepency}. This implies that, with $b^* =\max\{\textsf{bias}(\bar{v}_i^0), \textsf{bias}(\bar{v}_i^1)\}$, we have that \noSTOC{\begin{eqnarray} &&\textsf{adv}_{\bar{M}_i}|\bar{v}_i| \leq \left(1-3b^*\right)\cdot |\bar{v}_i^0| - \left(1-b^*\right) |\bar{v}_i^1|\nonumber\\ &\Rightarrow& \left(1-b^*\right) |\bar{v}_i^1|<\left(1-3b^*\right) |\bar{v}_i^0|\label{eqn:advantaegAssumption} \end{eqnarray}} \STOConly{$\textsf{adv}_{\bar{M}_i}|\bar{v}_i| \leq \left(1-3b^*\right)\cdot |\bar{v}_i^0| - \left(1-b^*\right) |\bar{v}_i^1|$ and, therefore, \begin{align} \left(1-b^*\right) |\bar{v}_i^1|<\left(1-3b^*\right) |\bar{v}_i^0|\label{eqn:advantaegAssumption} \end{align}} On the other hand, we assumed earlier (without loss of generality) that $\textsf{count}_0(\bar{v}_i^0) \leq \textsf{count}_1(\bar{v}_i^1)$. Therefore, \STOConly{\begin{eqnarray} &&\left(1-\textsf{bias}(\bar{v}_i^0)\right) |\bar{v}_i^0|\leq\left(1+\textsf{bias}(\bar{v}_i^1)\right) |\bar{v}_i^1|\nonumber\\ &\Rightarrow& \left(1-b^*\right) |\bar{v}_i^0|\leq\left(1+b^*\right) |\bar{v}_i^1|\label{eqn:WLOGassumption} \end{eqnarray}} \noSTOC{\begin{eqnarray} &&\textsf{count}_0(\bar{v}_i^0) \leq \textsf{count}_1(\bar{v}_i^1)\nonumber\\ &\Rightarrow& \left(1-\textsf{bias}(\bar{v}_i^0)\right) |\bar{v}_i^0|\leq\left(1+\textsf{bias}(\bar{v}_i^1)\right) |\bar{v}_i^1|\nonumber\\ &\Rightarrow& \left(1-b^*\right) |\bar{v}_i^0|\leq\left(1+b^*\right) |\bar{v}_i^1|\label{eqn:WLOGassumption} \end{eqnarray}} Note that since $|b^*|\leq 1$, $(1-b^*)^2 > (1+b^*)(1-3b^*) \Rightarrow \frac{1-3b^*}{1-b^*} < \frac{1-b^*}{1+b^*}$. Multiplying the two sides of this inequality to the sides of \eqref{eqn:WLOGassumption} gives that \noSTOC{$$\left(1-3b^*\right) |\bar{v}_i^0|\leq\left(1+b^*\right) |\bar{v}_i^1|$$} \STOConly{$\left(1-3b^*\right) |\bar{v}_i^0|\leq\left(1+b^*\right) |\bar{v}_i^1|$} which contradicts \eqref{eqn:advantaegAssumption}. Therefore, we must have \noSTOC{$$|\textsf{bias}(\bar{v}_i^1)- \textsf{bias}(\bar{v}_i^0)| \geq \textsf{adv}_{\bar{M}_i}/3.$$} \STOConly{$|\textsf{bias}(\bar{v}_i^1)- \textsf{bias}(\bar{v}_i^0)| \geq \textsf{adv}_{\bar{M}_i}/3.$} Note that $\textsf{bias}(\bar{v}_i^j) = \E\left[B_{i+1}|v_i, T=j\right]$ since $\textsf{bias}(\bar{v}_i^j)$ is the average bias of all strings in $U_j$. Therefore, combining with \eqref{eqn:advLowerBoundAfterTransformation}, we have that \begin{equation*} \Big|\E\left[B_{i+1}|v_i, T=0\right] - \E\left[B_{i+1}|v_i, T=1\right]\Big| \geq \frac{\textsf{adv}(v_i, A_{r_{i+1}}) - 5\varepsilon^2}{3}.\qedhere \end{equation*} \popQED \section{Proof of \noSTOC{\cref{thm:main}}\STOConly{Theorem \ref{thm:main}}: Concatenated InsDel Codes}\label{sec:concatenation} We recall that the concatenation of an inner insdel code $\mathcal{C}_{\text{in}}$ over an alphabet of size $|\Sigma_{\text{in}}|$ and an outer insdel code, $\mathcal{C}_{\text{out}}$, over an alphabet of size $|\Sigma_{\text{out}}| = |\mathcal{C}_{\text{in}}|$ as a code over alphabet $\Sigma_{\text{in}}$, is obtained by taking each codeword $x \in \mathcal{C}_\textnormal{out}$, encoding each symbol of $x$ with $\mathcal{C}_{\text{in}}$, and appending the encoded strings together to obtain each codeword of the concatenated code. In this section, we will show that, concatenating an inner code $\mathcal{C}_\textnormal{in}$ from \cref{thm:LowRateListDecBinaryCodes} that can $L_\textnormal{in}$-list decode from any $\gamma$ fraction of insertions and $\delta$ fraction deletions when $2\delta + \gamma < 1-\varepsilon_\textnormal{in}$ along with an appropriately chosen outer code $\mathcal{C}_\textnormal{out}$ from \cref{thm:LargeAlphaInsDelListDecoding}, one can obtain an infinite family of constant-rate insertion-deletion codes that are efficiently list-decodable from any $\gamma$ fraction of insertions and $\delta$ fraction of deletions as long as $2\delta + \gamma < 1-\varepsilon$ for $\varepsilon=\frac{16}{5}\varepsilon_\textnormal{in}$. \subsection{Construction of the Concatenated Code} We start by fixing some notation. Let $\mathcal{C}_\textnormal{out}$ be able to $L_\textnormal{out}$-list decode from $\delta_{\text{out}}$ fraction of deletions and $\gamma_{\text{out}}$ fraction of insertions. Further, let us indicate the block sizes of $\mathcal{C}_\textnormal{out}$ and $\mathcal{C}_\textnormal{in}$ with $n_\textnormal{out}$ and $n_\textnormal{in}=\left\lceil\log \left|\Sigma_{\text{out}}\right|\right\rceil$. To construct our concatenated codes, we utilize \cref{thm:LargeAlphaInsDelListDecoding} to obtain an efficient family of codes $\mathcal{C}_{\text{out}}$ over alphabet $\Sigma_{\text{out}}$ of size $O_{\gamma_{\text{out}}, \delta_{\text{out}}}(1)$ that is $L_{\text{out}}$-list decodable from any $\delta_{\text{out}}$ fraction of deletions and $\gamma_{\text{out}}$ fraction of insertions for appropriate parameters $\delta_{\text{out}}$ and $\gamma_{\text{out}}$ that we determine later. We then concatenate any code in $\mathcal{C}_{\text{out}}$ with an instance of the binary list-decodable codes from \cref{thm:LowRateListDecBinaryCodes}, $C_{\text{in}}$, with parameter $n_{\text{in}}=\left\lceil\log \left|\Sigma_{\text{out}}\right|\right\rceil$ and a properly chosen $\varepsilon_{\text{in}}$. We will determine appropriate values for all these parameters given $\varepsilon$ when describing the decoding procedure in \cref{sec:decoding}. \cref{fig:parameters} shows the order of determining all parameters. We remark that the following two properties for the utilized inner and outer codes are critical to this order of fixing parameters: \begin{enumerate} \item The alphabet size of the family of codes used as the outer code only depends on $\delta_\textnormal{out}$ and $\gamma_\textnormal{out}$ and is independent of the outer block size $n_\textnormal{out}$. (See \cref{thm:LargeAlphaInsDelListDecoding}) \item The list size of the family of codes used as the inner code, $L_\textnormal{in}$, merely depends on parameter $\varepsilon_{\text{in}}$ in \cref{thm:LowRateListDecBinaryCodes} and is independent of the size of the code or its block length, i.e., $|\mathcal{C}_\textnormal{in}|$ or $n_\textnormal{in}$. \end{enumerate} \begin{figure}[] \centering \noSTOC{\includegraphics[width=.7\textwidth]{Parameters.pdf}\\} \STOConly{\includegraphics[width=\linewidth]{Parameters.pdf}\\} \caption{The order of determining parameters in the proof of \cref{thm:main}.}\label{fig:parameters} \end{figure} \subsection{Decoding Procedure and \noSTOC{Determining }Parameters}\label{sec:decoding} We now analyze the resulting family of codes and choose the undetermined parameters along the way of describing the decoding procedure. A pseudo-code of the decoding procedure is available in \cref{alg:conctenatedDecoder}. Let $\mathcal{C}$ be a binary code with block length $n$ that is obtained from the above-mentioned concatenation. Take the codeword $x\in C$ and split it into \emph{blocks} of length $n_{\text{in}}$. Note that each such block corresponds to the encoding of some symbol in $\Sigma_{\text{out}}$ under $\mathcal{C}_{\text{in}}$. Let $x'$ be a string obtained by applying $n\gamma$ insertions and $n\delta$ deletions into $x$ where $n=n_\textnormal{in} n_\textnormal{out}$ and $\gamma+2\delta < 1-\varepsilon$. For each block of $x$, we define the error count to be the total number of insertions that have occurred in that block plus twice the number of deleted symbols in it. Clearly, the average value of error count among all blocks is $n_\textnormal{in}(\gamma+2\delta) < n_\textnormal{in}(1-\varepsilon)$. By a simple averaging, at least $\left(1-\frac{1-\varepsilon}{1-\varepsilon/4}\right) n_{\text{out}} \ge \frac{3\varepsilon}{4}\cdot n_{\text{out}}$ of those blocks have an error count of $n_\textnormal{in}(1-\frac{\varepsilon}{4})$ or less. Let us call the set of all such blocks $S$. Further, we partition $S$ into smaller sets based on the number of deletions occurring in the blocks of $S$. Let $S_i\in S$ be the subset of blocks in $S$ for which the number of deletions is in \noSTOC{$\left[n_{\text{in}}\cdot\frac{\varepsilon}{16}\cdot (i-1), n_{\text{in}}\cdot \frac{\varepsilon}{16}\cdot i\right)$} \STOConly{$[n_{\text{in}}\cdot\frac{\varepsilon}{16}\cdot (i-1), n_{\text{in}}\cdot \frac{\varepsilon}{16}\cdot i)$} for $i=1, 2, \cdots, 8/\varepsilon$\footnote{Note that the fraction of deletions cannot exceed $\frac{1}{2}$ assuming $n_\textnormal{in}(\gamma+2\delta) < n_\textnormal{in}(1-\varepsilon)$.}. The following \noSTOC{two properties }hold true: \begin{enumerate} \item All blocks in $S_i$ suffer from at least $n_{\text{in}}\cdot\frac{\varepsilon}{16}\cdot (i-1)$ deletions. Further, they can suffer from up to $n_{\text{in}}\cdot\left(1-\frac{\varepsilon}{4}-\frac{2\varepsilon}{16}\cdot (i-1)\right)$ insertions. Therefore, they all appear as substrings of length $n_{\text{in}}\cdot\left(2-\frac{\varepsilon}{4}-\frac{3\varepsilon}{16}\cdot (i-1)\right)$ or less in $x'$. \item We have that $S=\dot\bigcup_{i=1}^{8/\varepsilon} S_i$. By the Pigeonhole principle, for some $i^*\in\left[1, 8/\varepsilon\right]$, $|S_{i^*}|\ge \frac{3\varepsilon^2}{32}n_{\text{out}}$. \end{enumerate} Our decoding algorithm consists of $8/\varepsilon$ rounds each consisting of two phases of inner and outer decoding. During the first phase of each round $i=1,2,\cdots, 8/\varepsilon$, the algorithm uses the decoder of the inner code on $x'$ to construct a string $T_i$ over alphabet $\Sigma_\textnormal{out}$ and then, in the second phase, uses the decoder of the outer code on input $T_i$ to obtain a list $List_i$ of size $L_\textnormal{out}$. In the end, the decoding algorithm outputs the union of all such lists $\bigcup_i List_i$. \begin{algorithm} \caption{Decoder of the Concatenated Code}\label{alg:conctenatedDecoder} \begin{algorithmic}[1] \noSTOC{\Procedure{Concatenated-Decoder}{$x', \varepsilon, n_\textnormal{in}, n_\textnormal{out}, \textnormal{Dec}_{\mathcal{C}_\textnormal{in}}(\cdot), \textnormal{Dec}_{\mathcal{C}_\textnormal{out}}(\cdot)$}} \STOConly{\Procedure{Concat'd-Dec}{$x', \varepsilon, n_\textnormal{in}, n_\textnormal{out}, \textnormal{Dec}_{\mathcal{C}_\textnormal{in}}, \textnormal{Dec}_{\mathcal{C}_\textnormal{out}}$}} \medskip \State {Output $\leftarrow\emptyset$} \For{$i\in\left\{1, 2, \cdots, \frac{8}{\varepsilon}\right\}$}\Comment{Round $i$} \State $w\leftarrow\left\lfloor\frac{n_{\text{in}}(2-\varepsilon/4-3\varepsilon(i-1)/16)}{n_{\text{in}} \varepsilon/16}\right\rfloor+1$\noSTOC{\Comment{Length of the sliding window is $w\cdot\frac{n_\textnormal{in}\varepsilon}{16}$.}} \State $T_i \leftarrow $ empty string \medskip \For{$j\in \left\{1, 2, \cdots, \frac{|x'|}{n_{\textnormal{in}}\varepsilon/16}-w\right\}$}\Comment{Phase I\noSTOC{: Inner Decoding}} \State {$List \leftarrow \textnormal{Dec}_{\mathcal{C}_\textnormal{in}}\left(x'\left[\frac{n_{\text{in}} \varepsilon}{16}\cdot j, \frac{n_{\text{in}} \varepsilon}{16}\cdot (j + w) \right]\right)$} \State {Pad symbols of $\Sigma_\textnormal{out}$ corresponding to the elements of $List$ to the right of $T_i$.} \EndFor \medskip \State {Output $\leftarrow$ Output $\cup$ $\textnormal{Dec}_{\mathcal{C}_\textnormal{out}}\left(T_i\right)$}\Comment{Phase II\noSTOC{: Outer Decoding}} \EndFor \State {\bf return} Output \EndProcedure \end{algorithmic} \end{algorithm} \paragraph{Description of Phase I (Inner Decoding)} We now proceed to the description of the first phase in each round $i\in\{1,2,\cdots, 8/\varepsilon\}$. In the construction of $T_i$, we aim for correctly decoding the blocks in $S_i$. As mentioned above, all such blocks appear in $x'$ in a substring of length $n_{\text{in}}\cdot\left(2-\frac{\varepsilon}{4}-\frac{3\varepsilon}{16}\cdot (i-1)\right)$ or less. Having this observation, we run the deocoder of the inner code on substrings of $x'$ of form $x'\left[\frac{n_{\text{in}} \varepsilon}{16}\cdot j, \frac{n_{\text{in}} \varepsilon}{16}\cdot (j + w) \right]$ for all $j=1,2,\cdots, \frac{|x'|}{n_{\textnormal{in}}\varepsilon/16}-w$ where \noSTOC{$$w=\left\lfloor\frac{n_{\text{in}}(2-\varepsilon/4-3\varepsilon(i-1)/16)}{n_{\text{in}} \varepsilon/16}\right\rfloor + 1.$$} \STOConly{$w=\left\lfloor\frac{n_{\text{in}}(2-\varepsilon/4-3\varepsilon(i-1)/16)}{n_{\text{in}} \varepsilon/16}\right\rfloor + 1.$} One can think of such substrings as a \emph{window} of size $w\cdot\frac{n_\textnormal{in} \varepsilon}{16}$ that slides in $\frac{n_\textnormal{in} \varepsilon}{16}$ increments. Note that each block $B$ in $S_i$ appears within such window and is far from it by, say, $D_B$ deletions and no more than $n_{\text{in}}\left(1-\frac{\varepsilon}{4}\right) - 2D_B + \frac{n_{\text{in}} \varepsilon}{16}$ insertions where the additional $\frac{n_{\text{in}} \varepsilon}{16}$ term in insertion count comes from the extra symbols around the block in the fixed sized window. As long as the fraction of insertions plus twice the fraction of deletions that are needed to convert a block of $S_i$ into its corresponding window does not exceed $1-\varepsilon_{\text{in}}$, the output of the inner code's decoder for input $x'\left[\frac{n_{\text{in}} \varepsilon}{16}\cdot j, \frac{n_{\text{in}} \varepsilon}{16}\cdot (j + w) \right]$ will contain the block $B$ of $S_i$. So, we choose $\varepsilon_{\text{in}}$ such that \begin{eqnarray} &&n_{\text{in}}\left(1-\frac{\varepsilon}{4}\right) - 2D_B + \frac{n_{\text{in}} \varepsilon}{16} + 2D_B \le n_{\text{in}}(1-\varepsilon_{\text{in}})\label{eqn:eps-in-choice}\\ &\Leftrightarrow&n_{\text{in}}(1-3\varepsilon/16) \le n_{\text{in}}(1-\varepsilon_{\text{in}})\noSTOC{\nonumber\\ &}\Leftrightarrow\noSTOC{&}\varepsilon_{\text{in}}\le \frac{3}{16}\varepsilon\nonumber \end{eqnarray} Now, each element in the output list corresponds to some codeword of the inner code and, therefore, some symbol in $\Sigma_{\text{out}}$. For each run of the decoder of the inner code, we take the corresponding symbols of $\Sigma_{\text{out}}$ and write them back-to-back in arbitrary order. Then, we append all such strings in the increasing order of $j$ to obtain $T_i$. \paragraph{Description of Phase II (Outer Decoding)} Note that the length of $T_i$ is at most $\frac{|x'|}{n_{\text{in}}\varepsilon/16} L_{\text{in}} \leq \frac{2n_{\text{in}}n_{\text{out}}}{n_{\text{in}}\varepsilon/16} L_{\text{in}} = n_{\text{out}}\cdot\frac{32}{\varepsilon}L_{\text{in}}$. Further, $T_i$ contains symbols corresponding to all blocks of $S_i$ as a subsequence (i.e., in the order of appearance) except possibly the ones that appear in the same run of the inner decoder together. Since the fraction of deletions happening to each block in $S_i$ is less than $\frac{1}{2}$ and the size of the inner decoding sliding window is no more than $2n_\textnormal{in}$, the number of blocks of $S_i$ that can appear in the same window in the first phase is at most 4. This gives that $T_{i}$ has a common subsequence of size at least $\frac{|S_i|}{4}$ with the codeword of the outer code. We mentioned earlier that for some $i^*$, $|S_{i^*}|\ge \frac{3\varepsilon^2}{32}n_{\text{out}}$. Therefore, for such $i^*$, $T_{i^*}$ is different from $x$ by up to a $1-\frac{3\varepsilon^2}{128}$ fraction of deletions and $\frac{32}{\varepsilon}L_{\text{in}}$ fraction of insertions. Therefore, by taking $\delta_{\text{out}}=1-\frac{3\varepsilon^2}{128}$, $\gamma_{\text{out}}=\frac{32}{\varepsilon}L_{\text{in}}=O\left(\frac{1}{\varepsilon^4}\right)$, and using each $T_i$ as an input to the decoder of the outer code in the second phase, $x$ will certainly appear in the outer output list for some $T_i$. (Specifically, for $i=i^*$.) \subsection{Remaining Parameters} As shown in \cref{sec:decoding}, we need a list-decodable code as outer code that can list-decode from $\delta_{\text{out}}=1-\frac{3\varepsilon^2}{128}$ fraction of deletions and $\gamma_{\text{out}}=\frac{32}{\varepsilon}L_{\text{in}}=O\left(\frac{1}{\varepsilon^4}\right)$ fraction of insertions. To obtain such codes we use \cref{thm:LargeAlphaInsDelListDecoding} with parameters $\gamma=\frac{32}{\varepsilon}L_{\text{in}}$ and $\epsilon=\frac{3\varepsilon^2}{256}$. This implies that the rate of the outer code is $r_\textnormal{out} = \frac{3\varepsilon^2}{256} = O(\varepsilon^2)$, it is $L_\textnormal{out}=O_\varepsilon(\exp(\exp(\exp(\log^*n))))$ list-decodable, and can be defined over an alphabet size of $|\Sigma_\textnormal{out}|=e^{O\left(\frac{1}{\varepsilon^{10}}\log \frac{1}{\varepsilon^8}\right)}$. Consequently, $|\mathcal{C}_{in}|=\log|\Sigma_{\text{out}}|=O\left(\frac{1}{\varepsilon^{10}}\log \frac{1}{\varepsilon}\right)$. Note that in \cref{thm:LowRateListDecBinaryCodes}, the block length of the inner code can be chosen independently of its list size as the list size only depends on $\varepsilon_\textnormal{in}$. This is a crucial quality in our construction since in our analysis $\varepsilon_\textnormal{in}$ and $L_\textnormal{in}$ are fixed first and then $|C_\textnormal{in}|$ is chosen depending on the properties of the outer code. As the decoder of the outer code is used $\frac{8}{\varepsilon}$ times in the decoding of the concatenated code, the list size of the concatenated code will be $L=\frac{8}{\varepsilon}\cdot L_{\text{out}} = O_\varepsilon(\exp(\exp(\exp(\log^*n))))$. The rate of the concatenated code is \noSTOC{$$r=r_\textnormal{out} r_\textnormal{in} = O\left(\varepsilon^2\cdot\frac{\log\log |\mathcal{C}_\textnormal{in}|}{n_\textnormal{in}}\right) = \noSTOC{O\left(\varepsilon^2\cdot\frac{\log\log |\mathcal{C}_\textnormal{in}|}{(1/\varepsilon^4)^{|\mathcal{C}_\textnormal{in}|}}\right) =} e^{-O\left(\frac{1}{\varepsilon^{10}}\log^2 \frac{1}{\varepsilon}\right)}.$$} \STOConly{$r=r_\textnormal{out} r_\textnormal{in} = O\left(\varepsilon^2\cdot\frac{\log\log |\mathcal{C}_\textnormal{in}|}{n_\textnormal{in}}\right) = \noSTOC{O\left(\varepsilon^2\cdot\frac{\log\log |\mathcal{C}_\textnormal{in}|}{(1/\varepsilon^4)^{|\mathcal{C}_\textnormal{in}|}}\right) =} e^{-O\left(\frac{1}{\varepsilon^{10}}\log^2 \frac{1}{\varepsilon}\right)}.$} Finally, since the outer code is efficient and the inner code is explicit and can be decoded by brute-force in $O_\varepsilon(1)$ time, the encoding and decoding procedures run in polynomial time. This concludes the proof of \cref{thm:main}. \section{Extension to Larger Alphabets}\label{sec:large-alphabet} In this section we extend the results presented so far to $q$-ary alphabets where $q > 2$. \subsection{Feasibility Region: Upper Bound} For an alphabet of size $q$, no positive-rate family of deletion codes can protect against $1-\frac{1}{q}$ fraction of errors since, with that many deletions, an adversary can simply delete all but the most frequent symbol of any codeword. Similarly, for insertion codes, it is not possible to achieve resilience against $q-1$ fraction of errors as adversary would be able to turn any codeword $x\in q^n$ to $(1, 2, \cdots, q)^n$. The findings of the previous sections on binary alphabets might suggest that the feasibility region for list-decoding is the region mapped out by these two points, i.e., $\frac{\delta}{1-\frac{1}{q}} + \frac{\gamma}{q-1} < 1$. However, this conjecture turns out to be false. The following theorem provides a family of counterexamples. \begin{theorem}\label{thm:counterexamples} For any alphabet size $q$ and any $i=1, 2, \cdots, q$, no positive-rate $q$-ary infinite family of insertion-deletion codes can list-decode from $\delta = \frac{q-i}{q}$ fraction of deletions and $\gamma = \frac{i(i-1)}{q}$ fraction of insertions. \end{theorem} \begin{proof} Take a codeword $x\in [q]^n$. With $\delta n = \frac{q-i}{q} \cdot n$ deletions, the adversary can delete the $q-i$ least frequent symbols to turn $x$ into $x'\in\Sigma_d^{n(1-\delta)}$ for some $\Sigma_d = \{\sigma_1, \cdots, \sigma_{i}\} \subseteq [q]$. Then, with $\gamma n = n(1-\delta)(i - 1)=n\frac{i(i-1)}{q}$ insertions, it can turn $x'$ into $[\sigma_1, \sigma_2, \cdots, \sigma_{i}]^{n(1-\delta)}$. Such adversary only allows $O(1)$ amount of information to pass to the receiver. Hence, no such family of codes can yield a positive rate. \end{proof} Note that all points $(\gamma, \delta) = \left(\frac{i(i-1)}{q}, \frac{q-i}{q}\right)$ are located on a second degree curve inside the conjectured feasibility region $\frac{\delta}{1-\frac{1}{q}} + \frac{\gamma}{q-1} < 1$ (see \cref{fig:conjecture}). \noSTOC{Our next step is to show that the actual feasibility region is a subset of the polygon outlined by these points.}\STOConly{In the extended version of this paper, we use a simple time-sharing argument to show that the actual feasibility region is a subset of the polygon outlined by these points.} \begin{figure}[] \centering \noSTOC{\includegraphics[width=.9\textwidth]{Conjectured.png}} \STOConly{\includegraphics[width=\linewidth]{Conjectured.png}} \caption{Infeasible points inside the conjectured feasibility region. (Illustrated for $q=5$)}\label{fig:conjecture} \end{figure} \begin{theorem}\label{thm:QaryUpperbound} For any positive integer $q > 2$, define $F_q$ as the concave polygon defined over vertices $\left(\frac{i(i-1)}{q}, \frac{q-i}{q}\right)$ for $i = 1, \cdots, q$ and $(0, 0)$. (see \cref{fig:actual-region}). $F_q$ does not include the border except the two segments $\left[(0, 0), (q-1, 0)\right)$ and $\left[(0, 0), \left(0, 1-\frac{1}{q}\right)\right)$. Then, for any pair of positive real numbers $(\gamma, \delta) \not\in F_q$, there exists no infinite family of $q$-ary codes with positive rate that can correct from $\delta$ fraction of deletions and $\gamma$ fraction of insertions. \end{theorem} \noSTOC{ \begin{proof} In order to prove this, it suffices to show that for any pair of consecutive vertices on the polygon like $p_i = \left(\frac{i(i-1)}{q}, \frac{q-i}{q}\right)$ and $p_{i+1} = \left(\frac{i(i+1)}{q}, \frac{q-i-1}{q}\right)$, the entirety of the segment between $p_i$ and $p_{i+1}$ lie outside of the feasibility region. To this end, we show that for any $i=1, 2, \cdots, q-1$ and $\alpha\in(0, 1)$, no family of codes with positive rate is list-decodable from $(\gamma_0, \delta_0) = \alpha p_i + (1-\alpha)p_{i+1}$ fraction of insertions and deletions. Note that in \cref{thm:counterexamples} we proved the infeasibility of the vertices of $F_q$ by providing a strategy for the adversary to convert any string into one out of a set of size $O_q(1)$ using the corresponding amount of insertions and deletions. To finish the proof, we similarly present a strategy for the adversary that is obtained by a simple time sharing between the ones used to show infeasibility at $p_i$ and $p_{i+1}$ in \cref{thm:counterexamples}. Consider a codeword $x\in[q]^n$. As shown in \cref{thm:counterexamples}, the adversary can utilize $n\alpha \cdot p_i$ errors to convert the first $\alpha n$ symbols of $x$ into a string of form $[\sigma_1, \sigma_2, \cdots, \sigma_{i}]^{n\alpha\cdot\frac{i}{q}}$ where $\{\sigma_1, \sigma_2, \cdots, \sigma_{i}\} \subseteq \Sigma$. Similarly, the remaining $n(1-\alpha)p_{i+1}$ errors can be utilized to turn the last $(1-\alpha)n$ symbols of $x$ into a string of the form $[\sigma'_1, \sigma'_2, \cdots, \sigma'_{i+1}]^{n(1-\alpha)\cdot\frac{i+1}{q}}$ where $\{\sigma_1, \sigma_2, \cdots, \sigma_{i+1}\} \subseteq \Sigma$. Note that there are no more than ${q \choose i} i! \cdot {q\choose i+1}(i+1)! = O_q(1)$ of such strings. Therefore, for any given positive rate code, there exists one string of the above-mentioned form which is $(\gamma_0, \delta_0)$-close to exponentially many codewords and, thus, no positive-rate family of codes is list-decodable from $(\gamma_0, \delta_0)$ fraction of insertions and deletions. \end{proof} } \subsection{Feasibility Region: Exact Characterization} Finally, we will show that the feasibility region is indeed equal to the region $F_q$ described in \cref{thm:QaryUpperbound}. The proof closely follows the steps taken for the binary case but is significantly more technical. We first formally define $q$-ary Bukh-Ma codes and show they are list-decodable as long as the error rate lies in $F_q$ and then use the concatenation in \cref{sec:concatenation} to obtain \cref{thm:qaryMain}. \begin{theorem}\label{thm:LowRateListDecQaryCodes} For any integer $q\geq 2$, $\varepsilon>0$, and sufficiently large $n$, let $C^q_{n, \varepsilon}$ be the following Bukh-Ma code: $${C}^q_{n, \varepsilon} = \left\{\left(0^r1^r\cdots q^r\right)^{\frac{n}{qr}}\Big| r=\left(\frac{1}{\varepsilon^4}\right)^k, k< \log_{1/\varepsilon^4} n\right\}.$$ For any $(\gamma, \delta) \in (1-\varepsilon)F_q$ it holds that ${C}^q_{n, \varepsilon}$ is list decodable from any $\delta n$ deletions and $\gamma n$ insertions with a list size of $O\left(\frac{q^5}{\varepsilon^2}\right)$. \end{theorem} We remark that in the case of $q=2$, \cref{thm:LowRateListDecQaryCodes} improves over \cref{thm:LowRateListDecBinaryCodes} in terms of the dependence of the list size on $\varepsilon$. \subsubsection{Proof Sketch for \cref{thm:LowRateListDecQaryCodes}} To prove \cref{thm:LowRateListDecQaryCodes}, we show that Bukh-Ma codes are list-decodable as long as the error rate $(\gamma, \delta)$ lies beneath the line that connects a pair of consecutive non-zero vertices of $F_q$. In other words, for \noSTOC{any pair of points }\STOConly{pairs }$\left(\frac{i(i-1)}{q}, \frac{q-i}{q}\right)$ and $\left(\frac{i(i+1)}{q}, \frac{q-i-1}{q}\right)$ we consider the line passing through them (see \cref{fig:border-characteristics}), i.e., \begin{equation} \gamma + (2i)\delta = \frac{(2q-1)i-i^2}{q}, \quad i=1, \cdots, q-1\label{eqn:line-segments} \end{equation} \begin{figure}[] \centering \noSTOC{\includegraphics[width=.9\textwidth]{Characteristic.png}} \STOConly{\includegraphics[width=\linewidth]{Characteristic.png}} \caption{In the feasibility region for $q=5$, the line passing through $(1.2, 0.4)$ and $(1.8, 0.3)$ (indicated with red dotted line) is characterized as $\gamma + 6\delta \leq 3.6$. (Corresponding to $i=3$ in \cref{eqn:line-segments})}\label{fig:border-characteristics} \end{figure} and show that as long as $\gamma + (2z)\delta \leq (1-\varepsilon)\frac{(2q-1)z-z^2}{q}$ for some $z\in\{1,\cdots,q-1\}$, Bukh-Ma codes are list-decodable. Note that the union of such areas is equal to $(1-\varepsilon)F_q$. The analysis for each line follows the arguments for the binary case. Namely, we assume that $k$ codewords can be converted to some center string $v$ via $(\gamma, \delta)$ fraction of errors. Then, using an appropriate advantage notion and considering some coupled statistic processes obtained by sampling substrings, we show that $k$ is bounded above by some $O_q\left(\operatorname{\text{{\rm poly}}}(1/\varepsilon)\right)$. The only major difference is that the notion of bias cannot be directly used for $q$-ary alphabets. In this general case, instead of keeping track of the variance of the bias, we keep track of the sum of the variances of the frequency of the occurrence of each symbol. We show that this quantity increases by some constant after each substring sampling (analogous to \cref{lem:process-variance-guarantee}) by showing that a positive advantage requires that the frequency of occurrence of at least one of the symbols to be $\varepsilon$-different for two different values of the random variable $T$ (analogous to \cref{lem:polarization}). The rest of this section contains more formal description of generalized notions and proofs for generalized $q$-ary claims. \subsection{Generalized Notation and \noSTOC{Preliminary Lemmas}\STOConly{Preliminaries}} To prove \cref{thm:LowRateListDecQaryCodes}, we need to generalize some of the notions and respective preliminary lemmas for the binary case. We start with defining $i$th order advantage. \begin{definition}[$i$th order $q$-ary advantage of matching $M$] For a pair of positive integers $i < q$, a pair of $q$-ary strings $a$ and $b$, and a matching $M$ between $a$ and $b$, we define \emph{$i$th order $q$-ary advantage of $a$ to $b$} as follows: \noSTOC{$$\textsf{adv}^{q, i}_M(a, b)=\frac{(2i+1)|M|-|a|-\frac{i+i^2}{q} \cdot |b|}{|a|}$$} \STOConly{$\textsf{adv}^{q, i}_M(a, b)=\frac{(2i+1)|M|-|a|-\frac{i+i^2}{q} \cdot |b|}{|a|}.$} \end{definition} Note that the notion of advantage utilized for the binary case is obtained for $q=2$ and $i=1$ in the above definition. The notions of $i$th order advantage between two strings (that is independent of a specific matching, i.e., $\textsf{adv}^{q, i}(a, b)$) and infinite $i$th order advantage are defined in a similar manner to the binary case. \begin{remark}\label{rmk:qAryAdvInterpretation} In the same spirit as of the binary case, $\textsf{adv}^{q, i}_M(a, b)$ is simply the value of \noSTOC{$$|b|\left(\frac{(2q-1)i-i^2}{q}-(2i)\delta_M-\gamma_M\right)$$} \STOConly{$|b|\left(\frac{(2q-1)i-i^2}{q}-(2i)\delta_M-\gamma_M\right)$} normalized by the length of $a$. \noSTOC{Indeed, \begin{eqnarray*} \textsf{adv}^{q, i}_M(a, b) &=& \frac{(2i+1)|M|-|a|-\frac{i+i^2}{q}\cdot|b|}{|a|}\\ &=& \frac{(2i+1)|b|(1-\delta_M)-|b|(1-\delta_M+\gamma_M)-\frac{i+i^2}{q}\cdot|b|}{|a|}\\ &=& \frac{|b|}{|a|}\cdot\left[(2i+1)(1-\delta_M)-(1-\delta_M+\gamma_M)-\frac{i+i^2}{q}\right]\\ &=& \frac{|b|}{|a|}\cdot\left(\frac{(2q-1)i-i^2}{q} -(2i)\delta_M - \gamma_M\right). \end{eqnarray*}} \end{remark} \begin{lemma}\label{lem:qAryLengthPositiveAdv} If for strings $a$ and $b$, $\textsf{adv}^{q, i}(a, b) \geq 0$, then $|a|$ and $|b|$ are within a $q$ factor of each other. \end{lemma} \STOConly{The proof of this lemma is similar to the binary case and can be found in the extended version of this argument.} \noSTOC{\begin{proof} $\textsf{adv}^{q, i}(a, b) \geq 0$ implies that for some matching $M$, \begin{eqnarray} &&adv^{q, i}_M \geq 0 \Rightarrow |a|+\frac{i+i^2}{q}\cdot|b| \leq (2i+1)|M|\nonumber\\ &\Rightarrow& q|a|+(i+i^2)\cdot|b| \leq q(2i+1)|M| \leq q(2i+1)\min(|a|, |b|)\label{eqn:lengths-advantage} \end{eqnarray} Now if $|a|\leq |b|$, \eqref{eqn:lengths-advantage} gives $$q|a|+(i+i^2) |b| \leq q(2i+1) |a| \Rightarrow |b| \leq \frac{2q}{i+1}\cdot |a| \leq q|a|$$ and if $|b|<|a|$, \eqref{eqn:lengths-advantage} gives $$q|a|+(i+i^2) |b| \leq q(2i+1) |b| \Rightarrow |a| \leq \frac{2iq+q-i-i^2}{q}\cdot |b| \leq q|b|.$$ \end{proof}} \begin{definition}[$q$-ary Alternating Strings] For any positive integer $r$, we define the infinite $q$-ary alternating string of run-length $r$ as $A^q_r = (1^r2^r\cdots q^r)^\infty$ and denote its prefix of length $l$ by $A^q_{r,l} = A^q_r[1,l]$. \end{definition} \subsection{Proof of \cref{thm:LowRateListDecQaryCodes}} As mentioned before, \cref{thm:LowRateListDecQaryCodes} can be restated as follows. \begin{theorem}[Restatement of \cref{thm:LowRateListDecQaryCodes}]\label{thm:restated} For any integer $q\geq 2$, $\varepsilon>0$, sufficiently large $n$, and any $z\in\{1, 2, \cdots, q-1\}$, the Bukh-Ma code $C^n_{n, \varepsilon}$ from \cref{thm:LowRateListDecQaryCodes} is list decodable from any $\delta n$ deletions and $\gamma n$ insertions with a list size $O\left(q^5 / \varepsilon^2\right)$ as long as $\gamma + (2z)\delta \leq (1-\varepsilon)\frac{(2q-1)z-z^2}{q}$. \end{theorem} To prove this restated version, once again, we follow the steps taken for the proof of \cref{thm:LowRateListDecBinaryCodes} and assume for the sake of contradiction that there exists a string $v$ and $k = \Omega\left(\frac{q^5}{\varepsilon^2}\right)$ members of ${C}^q_{n, \varepsilon}$ like $A^q_{r_1, n}, A^q_{r_2, n}, \cdots, A^q_{r_k, n}$, so that each $A^q_{r_i, n}$ can be converted to $v$ with $I_i$ insertions and $D_i$ deletions where $I_i+(2z)D_i \leq (1-\varepsilon)\frac{(2q-1)z-z^2}{q}\cdot n$. We define the indices in a way that $r_1 > r_2 > \cdots > r_k$. Given the definition of $C^q_{n,\varepsilon}$, $r_i \geq \frac{r_{i+1}}{\varepsilon^4}$. Given \cref{rmk:qAryAdvInterpretation} and \cref{lem:qAryLengthPositiveAdv}, an argument similar to the one presented in \cref{lem:advantage} shows that for all these codewords, $\textsf{adv}^{q, z}(v, A^q_{r_i, n}) \geq \frac{\varepsilon}{q}$. We define the following stochastic processes similar to the binary case. We split the string $v$ into substrings of size $l_1 = r_1\varepsilon^2$, pick one uniformly at random and denote it by $v_1$. We define random variable $A_1 = \textsf{adv}^{q, z}(v_1, A^q_{r_1})$ and random variables $F^p_1$ for $p=1, 2, \cdots, q$ as the frequency of the occurrence of symbol $p$ in $v_1$. In other words, \noSTOC{$$F^p_1 = \frac{\textsf{count}_p(v_1)}{|v_1|}.$$} \STOConly{$F^p_1 = \frac{\textsf{count}_p(v_1)}{|v_1|}.$} We continue this process for $j=2, 3, \cdots, k$ by splitting each $v_{j-1}$ into substrings of length $l_j = r_j\varepsilon^2$, picking $v_j$ uniformly at random, and defining $A_j = \textsf{adv}^{q, z}(v_j, A^q_{r_j})$ and $F^p_j = \frac{\textsf{count}_p(v_j)}{|v_j|}$ for all $p\in\{1, 2, \cdots, q\}$. We then define the sequence of real numbers $f_1 ,f_2, \cdots, f_k$ as follows: \noSTOC{$$f_i = \sum_{p=1}^q \textnormal{Var}(F^p_i).$$} \STOConly{$f_i = \sum_{p=1}^q \textnormal{Var}(F^p_i).$} This series of real numbers will play the role of $\textnormal{Var}(B_i)$ in the binary case. \noSTOC{\begin{lemma} The following hold for $A_1, A_2, \cdots, A_k$ and $F^p_1, F^p_2, \cdots, F^p_k$ for all $p\in\{1, 2, \cdots, q\}$. \begin{enumerate} \item $\E[F^p_i] = F^p_{i-1}$ \item $\E[A_i] \geq \frac{\varepsilon}{q}$ \end{enumerate} \end{lemma}} \STOConly{\begin{lemma} The following hold for $A_1, \cdots, A_k$ and $F^p_1, \cdots, F^p_k$ for all $p\in\{1, 2, \cdots, q\}$: $(1) \E[F^p_i] = F^p_{i-1}, \textnormal{and } (2) \E[A_i] \geq \frac{\varepsilon}{q}$. \end{lemma}} \begin{proof} Since $v_i$ is a substring of $v_{i-1}$ chosen uniformly at random, the overall frequency of symbol $p$ is equal to the average frequency of its occurrence in each substrings. The second item can be derived as in \cref{lem:process-guarantees}. \end{proof} The next lemma mimics \cref{lem:process-variance-guarantee} for the binary case. \begin{lemma}\label{lem:qAry-process-variance-guarantee} For the sequence $f_1, f_2, \cdots, f_k$, we have that \noSTOC{$$f_{i+1} \geq f_i + \Omega\left(\frac{\varepsilon^2}{q^4}\right).$$} \STOConly{$f_{i+1} \geq f_i + \Omega(\varepsilon^2/q^4).$} \end{lemma} Using \cref{lem:qAry-process-variance-guarantee}, \cref{thm:restated} can be simply proved as follows. \begin{proof}[{\bf Proof of \cref{thm:restated}}] Note that each $f_i$ is the summation of the variance of $q$ random variables that take values in $[0, 1]$. Therefore, their value cannot exceed $q$. Since $f_{i+1} \geq f_i + \Omega(\varepsilon^2/q^4)$, the total length of the series, $k$, may not exceed $O\left(\frac{q^5}{\varepsilon^2}\right)$. This implies that the list size is $O\left(\frac{q^5}{\varepsilon^2}\right)$. \end{proof} We now present the proof of \cref{lem:qAry-process-variance-guarantee}. \begin{proof}[{\bf Proof of \cref{lem:qAry-process-variance-guarantee}}] To relate $f_i$ and $f_{i+1}$, we utilize the law of total variance as follows: \begin{eqnarray} \textnormal{Var}(F^p_{i+1})&=&\textnormal{Var}\left(\E[F^p_{i+1}|v_{i}]\right) + \E\left[\textnormal{Var}(F^p_{i+1}|v_{i})\right]\nonumber\allowdisplaybreaks\\ &=&\textnormal{Var}\left(F^p_{i}\right) + \E\left[\textnormal{Var}(F^p_{i+1}|v_{i})\right]\label{eqn:qArytotalVar1} \end{eqnarray} Equation \eqref{eqn:qArytotalVar1} comes from the fact that the average frequency of symbol $p$ in substrings of length $l_{i+1}$ of $v_i$ is equal to the frequency of $p$ in $v_i$. Having this, we see that it suffices to show that $\E\left[\textnormal{Var}(F^p_{i+1}|v_{i})\right] \geq \Omega\left(\varepsilon^2/q^4\right)$. Similar to \cref{lem:process-variance-guarantee} we define $E_j$ for $j=1,2,\cdots,q$ and $E_e$ respectively as the event that the projection of $v_{i+1}$ falls inside a $j^{r_{i+1}}$ in $A_{r_{i+1}}$ or a string containing multiple symbols. We also define the random variable $T$ out of $\{e, 1, 2, \cdots, q\}$ that indicates which one of these events is realized. Once again, we use the law of total variance to bound $\E\left[\textnormal{Var}(F^p_{i+1}|v_i)\right]$. \noSTOC{\begin{eqnarray} \E\left[\textnormal{Var}(F^p_{i+1}|v_{i})\right] &=&\E_{v_i}\Bigg[\textnormal{Var}_{T}(\E\left[F^p_{i+1}|v_i, T\right]) + \E_{T}\left[\textnormal{Var}(F^p_{i+1}|v_i, T)\right]\big]\nonumber\\ &\geq& \E_{v_i}\big[\textnormal{Var}_{T}(\E\left[F^p_{i+1}|v_i, T\right])\Bigg]\label{eqn:qAryVarLoweboundStep2} \end{eqnarray}} \STOConly{\begin{align} \E\left[\textnormal{Var}(F^p_{i+1}|v_{i})\right] &=\E_{v_i}\Big[\textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right)\nonumber\\ &+ \E_{T}\big[\textnormal{Var}(F^p_{i+1}|v_i, T)\big]\Big]\nonumber\\ &\geq \E_{v_i}\left[\textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right)\right]\label{eqn:qAryVarLoweboundStep2} \end{align}} Combining \eqref{eqn:qArytotalVar1} and \eqref{eqn:qAryVarLoweboundStep2} gives \noSTOC{\begin{eqnarray} &&\textnormal{Var}(F^p_{i+1}) \geq \textnormal{Var}\left(F^p_{i}\right) + \E_{v_i}\left[\textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right)\right]\nonumber\\ &\Rightarrow& \sum_{p=1}^q \textnormal{Var}(F^p_{i+1}) \geq \sum_{p=1}^q \textnormal{Var}\left(F^p_{i}\right) + \sum_{p=1}^q \E_{v_i}\left[\textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right)\right]\nonumber\allowdisplaybreaks\\ &\Rightarrow& f_{i+1} \geq f_{i} + \sum_{p=1}^q \E_{v_i}\left[\textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right)\right]\nonumber\\ &\Rightarrow& f_{i+1} \geq f_{i} + \E_{v_i}\left[\sum_{p=1}^q \textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right)\right]\label{eqn:qAry-incremental-increase} \end{eqnarray}} \STOConly{ \begin{align} &\textnormal{Var}(F^p_{i+1}) \geq \textnormal{Var}\left(F^p_{i}\right) + \E_{v_i}\left[\textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right)\right]\nonumber\\ &\Rightarrow \sum_{p=1}^q \textnormal{Var}(F^p_{i+1}) \geq \sum_{p=1}^q \textnormal{Var}\left(F^p_{i}\right) + \sum_{p=1}^q \E_{v_i}\left[\textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right)\right]\nonumber\allowdisplaybreaks\\ &\Rightarrow f_{i+1} \geq f_{i} + \E_{v_i}\left[\sum_{p=1}^q \textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right)\right]\label{eqn:qAry-incremental-increase} \end{align}} Note that the term \noSTOC{$\textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right)$ } \STOConly{$\textnormal{Var}_{T}(\E[F^p_{i+1}|v_i, T])$ } refers to the variance of a ($q+1$)-valued random variable that takes the value \noSTOC{$\E_{v_i}\left[F^p_{i+1}|v_i, T=t\right]$ } \STOConly{$\E_{v_i}[F^p_{i+1}|v_i, T=t]$ } with probability $\Pr\{T=t|v_i\}$ for $t\in\{e, 1, 2, \cdots, q\}$. Once again, we present a crucial lemma that bounds from below the sum of variances of frequencies with respect to $T$ assuming that the overall advantage is large enough. \begin{lemma}\label{lem:qAry-polarization} For any realization of $v_i$, the following holds true if $\textsf{adv}^{q, z}(v_i, A_{r_{i+1}}) \geq 3q\varepsilon^2$: $$ \sum_{p=1}^q \textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right) \geq \left(\frac{\textsf{adv}^{q, z}(v_i, A_{r_{i+1}}) - 3q\varepsilon^2}{2z+1}\right)^2$$ \end{lemma} We defer the proof of \cref{lem:qAry-polarization} to \cref{sec:qAry-polarization}. Using Jensen inequality, the fact that $z\leq q$, and \cref{lem:qAry-polarization} along with \eqref{eqn:qAry-incremental-increase} give that \noSTOC{$$f_{i+1} \geq f_i + \E_{v_i}\left[ \left(\frac{\textsf{adv}^{q, z}(v_i, A_{r_{i+1}}) - 3q\varepsilon^2}{2z+1}\right)^2 \right] \noSTOC{\geq f_i + \left(\frac{\varepsilon/q - 3q\varepsilon^2}{2q+1}\right)^2} = f_i + \Omega\left(\frac{\varepsilon^2}{q^4}\right) $$} \STOConly{$f_{i+1} \geq f_i + \E_{v_i}\left[ \left(\frac{\textsf{adv}^{q, z}(v_i, A_{r_{i+1}}) - 3q\varepsilon^2}{2z+1}\right)^2 \right] \noSTOC{\geq f_i + \left(\frac{\varepsilon/q - 3q\varepsilon^2}{2q+1}\right)^2} = f_i + \Omega\left(\frac{\varepsilon^2}{q^4}\right) $} for sufficiently small $\varepsilon > 0$. \end{proof} \subsection{Proof of \cref{thm:qaryMain}} To establish \cref{thm:qaryMain}, we closely follow the concatenation scheme presented in \cref{sec:concatenation}. In the following, we provide a high-level description of the proof skipping the details mentioned in \cref{sec:concatenation} and highlighting the necessary extra steps. The construction of the concatenated code is exactly as in \cref{sec:concatenation} with the exception that the inner code is defined over an alphabet of size $q$. Note that if $(\gamma, \delta)\in (1-\varepsilon) F_q$, then $(\gamma, \delta)$ lies underneath one of the lines in the set of lines represented by \eqref{eqn:line-segments}. In other words, there exists some $z\in\{1, 2, \cdots, q-1\}$ for which \noSTOC{$$\gamma + (2z)\delta \leq (1-\varepsilon)\left(\frac{(2q-1)z-z^2}{q}\right).$$} \STOConly{$\gamma + (2z)\delta \leq (1-\varepsilon)\left(\frac{(2q-1)z-z^2}{q}\right).$} Similar to \cref{sec:concatenation}, we define the notion of {\em error count} for each block in the codewords of the concatenated code as \noSTOC{$$ (I+2z\cdot D) \cdot \frac{q}{(2q-1)z-z^2} $$} \STOConly{$ (I+2z\cdot D) \cdot \frac{q}{(2q-1)z-z^2} $} where $D$ and $I$ denote the number of deletions and insertions occurred in the block respectively. As in \cref{sec:concatenation} one can show that at least $\frac{3\varepsilon}{4}\cdot n_\textnormal{out}$ of the blocks contain no more than $\left(1-\frac{\varepsilon}{4}\right) n_\textnormal{in}$ error count. We denote the set of all such blocks by $S$. Once again, we partition $S$ into subsets $S_1, S_2, \cdots$ depending on the number of deletions occurred in the set. More precisely, we define $S_i \subseteq S$ as the set of blocks in $S$ that contain a number of deletions that is in the range $\left[n_{\text{in}}\cdot\frac{\varepsilon}{16q}\cdot (i-1), n_{\text{in}}\cdot \frac{\varepsilon}{16q}\cdot i\right)$ for $i=1, 2, \cdots, 16q/\varepsilon$. Once again, the following hold true: \noSTOC{\begin{enumerate}} \STOConly{\begin{enumerate}[leftmargin=5mm]} \item We have that $S=\dot\bigcup_{i=1}^{16q/\varepsilon} S_i$. By the Pigeonhole principle, for some $i^*\in\left[1, 16q/\varepsilon\right]$, $|S_{i^*}|\ge \frac{3\varepsilon^2}{64q}n_{\text{out}}$. \item Take some $i\in\{1, 2, \cdots, 16q/\varepsilon\}$ and some block in $S_{i}$. Say $D$ deletions have occurred in that block. Then, the total number of insertions is at most $(1-\varepsilon/4)\frac{(2q-1)z-z^2}{q} n_\textnormal{in} -2z D$. Therefore, the total length of the block is \STOConly{ $n_\textnormal{in} - D (1-\varepsilon/4)\frac{(2q-1)z-z^2}{q} n_\textnormal{in} -2z D$ \begin{eqnarray} &=& n_\textnormal{in}\cdot\left[ 1+\left(1-\frac{\varepsilon}{4}\right)\frac{(2q-1)z-z^2}{q} \right] - (2z+1)D\label{eq:block-length} \end{eqnarray}} \noSTOC{ \begin{eqnarray} && n_\textnormal{in} - D (1-\varepsilon/4)\frac{(2q-1)z-z^2}{q} n_\textnormal{in} -2z D\nonumber\\ &=& n_\textnormal{in}\cdot\left[ 1+\left(1-\frac{\varepsilon}{4}\right)\frac{(2q-1)z-z^2}{q} \right] - (2z+1)D\label{eq:block-length} \end{eqnarray}} which is no more than \begin{eqnarray} n_\textnormal{in}\cdot\left[ 1+\left(1-\frac{\varepsilon}{4}\right)\frac{(2q-1)z-z^2}{q} - \frac{\varepsilon}{16q}(i - 1)(2z+1) \right]\label{eqn:block-length-upper-bound} \end{eqnarray} Based on these observations, it is easy to verify that the decoding algorithm and analysis as presented in \cref{sec:concatenation} and \cref{alg:conctenatedDecoder} work for the $q$-ary case with the following minor modifications: \noSTOC{\begin{enumerate}} \STOConly{\begin{enumerate}[leftmargin=3mm]} \item Based on \eqref{eqn:block-length-upper-bound}, the parameter $w$ determining the length of the window should be \begin{equation} w = \left\lfloor\frac{n_\textnormal{in}\cdot\left[ 1+\left(1-\frac{\varepsilon}{4}\right)\frac{(2q-1)z-z^2}{q} - \frac{\varepsilon}{16q}(i - 1)(2z+1) \right]}{n_\textnormal{in}\varepsilon/16} \right\rfloor+1.\label{eqn:window-size} \end{equation} \item As in \eqref{eqn:eps-in-choice}, parameter $\varepsilon_\textnormal{in}$ has to be chosen such that the error count in decoding windows does not exceed $n_\textnormal{in}(1-\varepsilon_\textnormal{in})$. Note that the choice of shifting steps for the decoding window from \eqref{eqn:window-size} may add up to $\frac{n_\textnormal{in} \varepsilon}{16}$ additional insertions to the decoding window. Further, there is up to $n_\textnormal{in} \frac{\varepsilon}{16q}$ uncertainty in the total length of the block from \eqref{eq:block-length} since $D\in \left[n_{\text{in}}\cdot\frac{\varepsilon}{16q}\cdot (i-1), n_{\text{in}}\cdot \frac{\varepsilon}{16q}\cdot i\right)$. This can also add up to $n_\textnormal{in} \frac{\varepsilon}{16q}(2z+1) \leq \frac{\varepsilon}{8}$ insertions. Therefore, we need \noSTOC{\begin{eqnarray*} n_\textnormal{in}(1-\varepsilon/4)+n_\textnormal{in}\left(\frac{\varepsilon}{16} + \frac{\varepsilon}{8}\right)\cdot \frac{q}{(2q-1)z-z^2} \leq n_\textnormal{in}(1-\varepsilon_\textnormal{in}). \end{eqnarray*}} \STOConly{$n_\textnormal{in}(1-\varepsilon/4)+n_\textnormal{in}\left(\frac{\varepsilon}{16} + \frac{\varepsilon}{8}\right)\cdot \frac{q}{(2q-1)z-z^2} \leq n_\textnormal{in}(1-\varepsilon_\textnormal{in}).$} Note that $\frac{q}{(2q-1)z-z^2} \leq \frac{q}{2q-2}\leq 1$. Hence, it suffuces that $1-\frac{\varepsilon}{4}+\frac{\varepsilon}{8}+\frac{\varepsilon}{16} \leq 1-\varepsilon_\textnormal{in}$ or equivalently, $\varepsilon_\textnormal{in}\leq \frac{\varepsilon}{16}$. \item Some modifications are necessary to the parameters of the outer code. Notably, for alphabet size $q$, $|S_{i^*}|\ge \frac{3\varepsilon^2}{64q}n_{\text{out}}$ and the fraction of deletions can be as high as $1-\frac{1}{q}$. This requires $\delta_{\text{out}}=1-\frac{3\varepsilon^2}{128q^2}$. \item Finally, note the the value of $z$ is not know to the decoder. So the decoder has to run the algorithm with modifications mentioned above for all possible values of $z=1, 2, \cdots, q-1$ and the output the union of all lists produced. \end{enumerate} \end{enumerate} \subsection{Proof of \cref{lem:qAry-polarization}}\label{sec:qAry-polarization} \pushQED{\qed} We break down this proof into four steps. In the first step, similar to \cref{lem:polarization}, we modify $v_i$ and $A_{r_{i+1}, n}$ into a simpler structure without significantly changing the advantage. In the second step, we provide an upper bound for the advantage in this modified version that depends on the local frequencies of symbols, more specifically, on what we refer to as $\E\left[F^j_{i+1}|v_i, T=j\right]$. In Step 3, we show that these upper-bounds would yield a non-positive value on the advantage if one replaces the local frequencies with the overall frequency of symbols in $v_i$, i.e., $F^j_i$. In the fourth and last step, we show that this means that the local frequencies have to significantly deviate from global ones to attain the advantage achieved by $\bar{M}_i$ (i.e., $\textsf{adv}^{q, z}_{\bar{M}_i}$), so much that the lower-bound promised in the lemma's statement is achieved. \paragraph{Step 1. Modifying $v_i$ and $A_{r_{i+1}, n}$ for the sake of simplicity:} The proof starts with modifying $v_i$, $A_{r_{i+1}, n}$, and the advantage-yielding matching $M_i$ between them in a way that only slightly changes the value of advantage taking steps identical to the one in \cref{lem:polarization}. Similar to \cref{lem:polarization}, we denote the projection of $v_i$ under $M_i$ by $g = v_i\rightarrow M_i$. (See \cref{fig:transformtion} for a depiction of the steps in binary case.) \begin{enumerate} \item \label{step:qAryModificationStepOne}First, we delete all substrings of $U_e$--i.e., substrings of length $l_{i+1}$ in $v_i$ whose projection does not entirely fall into some stretch of $j^{r_{i+1}}$--from $v_i$. \item We reorder the substrings of length $l_{i+1}$ in $v_i$ by shifting all $U_j$ substrings together and the projections in $g$ to preserve the remainder of $M_i$ from step \ref{step:qAryModificationStepOne}. \item At this point, string $g$ consists of a stretch of symbol $1$ followed by a stretch of symbol $2$, etc. If the length of all stretches are not equal, we add adequate symbols to each stretch to make $g$ have the form of $1^t 2^t \cdots q^t$. \end{enumerate} To track the changes in $\textsf{adv}^{q, z}_{M_i}$ during this transformation, we track how $|M_i|$, $|v_i|$ and $|g|$ change throughout the three steps mentioned above. In the first step, a total of up to $|U_e| l_{i+1}$ elements are removed from $v_i$ and $M_i$. Note that since the run length of $A_{r_{i+1}}$ is $r_{i+1}$, there can only be $\frac{|g|}{r_{i+1}}$ substrings in $U_e$. Therefore, \noSTOC{$$|U_e| l_{i+1} \leq \frac{|g|l_{i+1}}{r_{i+1}} = |g|\varepsilon^2 \leq 2\varepsilon^2|v_i|.$$}\STOConly{$|U_e| l_{i+1} \leq \frac{|g|l_{i+1}}{r_{i+1}} = |g|\varepsilon^2 \leq 2\varepsilon^2|v_i|.$} The second step preserves $|M_i|$, $|v_i|$ and $|g|$. Finally, since $g$ is a substring of $A_{r_{i+1}}$, the third step increases $|g|$ only by up to $q r_{i+1}$. Note the run length of the $A_{r_{i+1}}$s and consequently $l_{i+1}$s are different by a multiplicative factor of at least $\frac{1}{\varepsilon^4}$ by the definition of the code $\mathcal{C}$. Therefore, $qr_{i+1} = \frac{ql_{i+1}}{\varepsilon^2} = \frac{q l_{i+1}|v_i|}{\varepsilon^2|v_i|} = \frac{q l_{i+1}|v_i|}{\varepsilon^2 l_{i}} \leq \varepsilon^2q|v_i|$. Overall, the value of the $\textsf{adv}^{q, z}_{M_i} = \frac{(2z+1)|M|-|v_i|-\frac{z+z^2}{q} \cdot |g|}{|v_i|}$ can be affected by a maximum of $2z\times2\varepsilon^2|v_i| + q\varepsilon^2|v_i| = (2z+q)\varepsilon^2|v_i| \leq 3q \varepsilon^2|v_i|$ decrease in the numerator and $\varepsilon^2|v_i|$ decrease in the denominator. Therefore, the eventual advantage does not drop below $\textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2$. Let us denote the transformed versions of $v_i$, $g$, and $M_i$ by $\bar{v}_i$, $\bar{g}$, and $\bar{M}_i$ respectively. We have shown that \begin{equation} \textsf{adv}^{q, z}_{\bar{M}_i} \geq \textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2.\label{eqn:qAryAdvLowerBoundAfterTransformation} \end{equation} \paragraph{Step 2. Bounding Above $\textsf{adv}^{q, z}_{\bar{M}_i}$ with $f^*$:} Let $\bar{v}_i = (\bar{v}_i^1, \bar{v}_i^2, \cdots, \bar{v}_i^q)$ so that $\bar{v}_i^j$ corresponds to the part of $\bar{v}_i$ that is mapped to $j^t$ under $\bar{M}_i$. Further, let $f^*_j = \E\left[F^j_{i+1}|v_i, T=j\right]$ represent the frequency of the occurrence of symbol $j$ in $\bar{v}_i^j$ as a shorthand, i.e., \noSTOC{$$f^*_j = \frac{\textsf{count}_j(\bar{v}_i^j)}{|\bar{v}_i^j|}$$} \STOConly{$f^*_j = \frac{\textsf{count}_j(\bar{v}_i^j)}{|\bar{v}_i^j|}$} and $p_j$ be the relative length of $\bar{v}_i^j$, i.e., \noSTOC{$$p_j=\frac{|\bar{v}_i^j|}{|\bar{v}_i|}.$$}\STOConly{$p_j=\frac{|\bar{v}_i^j|}{|\bar{v}_i|}.$} In this section, we compute an upperbound for $\textsf{adv}^{q, z}_{\bar{M}_i}$ that depends on $f^*_j$s. For the sake of simplicity, from now on we assume, without loss of generality, that \noSTOC{$$\textsf{count}_1(\bar{v}_i^1) \geq \textsf{count}_2(\bar{v}_i^2) \geq \cdots \geq \textsf{count}_q(\bar{v}_i^q)$$} \STOConly{$\textsf{count}_1(\bar{v}_i^1) \geq \textsf{count}_2(\bar{v}_i^2) \geq \cdots \geq \textsf{count}_q(\bar{v}_i^q)$} or equivalently, \noSTOC{$$f^*_1 p_1 \geq f^*_2 p_2 \geq \cdots \geq f^*_q p_q.$$} \STOConly{$f^*_1 p_1 \geq f^*_2 p_2 \geq \cdots \geq f^*_q p_q.$} Consider the matching between $\bar{v}_i$ and $\bar{p}$ that, for any $j\in\{1, 2, \cdots, q\}$ matches as many $j$s as possible from $j^t$ to $\bar{v}^j_i$. This matching clearly yields the largest possible advantage between the two that is an upperbound for the $\textsf{adv}^{q, z}_{\bar{M_i}}$. Similar to the binary case, we find a $t$ that maximizes this advantage and use its advantage as an upper-bound for $\textsf{adv}^{q, z}_{\bar{M_i}}$. Let $c$ be so that $f^*_c |\bar{v}_i^c| > t \geq f^*_{c+1} |\bar{v}_i^{c+1}|$ . Then, increasing $t$ by one would increase the length of $\bar{p}$ by $q$ and increases the size of the matching by $c$. To see the effect of this increment on the advantage, note that the denominator does not change and the numerator changes by $c(2z+1) - \frac{z+z^2}{q}\cdot q$. This change in advantage is positive as long as \noSTOC{\begin{eqnarray*} &&c(2z+1) - (z+z^2) \geq 0\\ &\Leftrightarrow& c \geq \frac{z+z^2}{2z+1} = \frac{z}{2} + \left(\frac{1}{4} - \frac{1}{4(2z+1)}\right). \end{eqnarray*}} \STOConly{$c(2z+1) - (z+z^2) \geq 0 \Leftrightarrow c \geq \frac{z+z^2}{2z+1} = \frac{z}{2} + \left(\frac{1}{4} - \frac{1}{4(2z+1)}\right).$} Note that the term $\frac{1}{4} - \frac{1}{4(2z+1)}$ is always between $\left[0, \frac{1}{4}\right]$. Hence, incrementing $t$ increases the advantage as long as $c \geq \lfloor\frac{z}{2}\rfloor + 1$. This means that the highest possible advantage is derived when $t = f^*_w |\bar{v}_i^w|$ for $w = \lfloor\frac{z}{2}\rfloor + 1$. With this value for $t$, the matching contains $f^*_j |\bar{v}_i^j|$ edges between $j^t$ and $|\bar{v}_i^j|$ for all $j> w$ and $t$ edges between $j^t$ and $|\bar{v}_i^j|$ for $j\leq w$. Therefore, the size of this matching is \noSTOC{$$t w + \sum_{j=w+1}^q f^*_j |\bar{v}_i^j|.$$}\STOConly{$t w + \sum_{j=w+1}^q f^*_j |\bar{v}_i^j|.$} This yields the following advantage \begin{eqnarray*} &&\frac{(2z+1) \left[t w + \sum_{j=w+1}^q f^*_j |\bar{v}_i^j|\right] -|\bar{v}_i|-\frac{z+z^2}{q} \cdot qt}{|\bar{v}_i|}\\ \noSTOC{&=&\frac{(2z+1) \left[f^*_w |\bar{v}_i^w|w + \sum_{j=w+1}^q f^*_j |\bar{v}_i^j|\right] -|\bar{v}_i|-\frac{z+z^2}{q} \cdot qf^*_w |\bar{v}_i^w|}{|\bar{v}_i|}\\} &=&(2z+1) \left[f^*_w p_ww + \sum_{j=w+1}^q f^*_j p_j\right] - 1 -(z+z^2) \cdot f^*_w p_w\allowdisplaybreaks\\ &=& \left[(2z+1)w -(z+z^2)\right] \cdot f^*_w p_w + (2z+1)\sum_{j=w+1}^q f^*_j p_j - 1 \end{eqnarray*} We remind that this is an upper-bound on the $\textsf{adv}^{q, z}_{\bar{M}_i}$. Next, we plug in $w = \lfloor\frac{z}{2}\rfloor + 1$ into this bound. Note that \noSTOC{$$(2z+1)w -(z+z^2) = z(2w - z) + w - z = \left\{\begin{matrix} \frac{3z+2}{2} & \textnormal{If $z$ is even} \\ \frac{z+1}{2} & \textnormal{If $z$ is odd} \end{matrix}\right.$$} \STOConly{$(2z+1)w -(z+z^2) = z(2w - z) + w - z$ which is equal to $\frac{3z+2}{2}$ if $z$ is even and $\frac{z+1}{2}$ if $z$ is odd.} Therefore, we have the following set of upper-bounds on the advantage \noSTOC{\begin{eqnarray} &\textsf{adv}^{q, z}_{\bar{M}_i} \leq \frac{3z+2}{2} \cdot f^*_w p_w + (2z+1)\sum_{j=w+1}^q f^*_j p_j - 1 & \textnormal{If $z$ is even} \label{eqn:EvenIBound}\\ &\textsf{adv}^{q, z}_{\bar{M}_i} \leq \frac{z+1}{2} \cdot f^*_w p_w + (2z+1)\sum_{j=w+1}^q f^*_j p_j - 1 & \textnormal{If $z$ is odd} \label{eqn:OddIBound} \end{eqnarray}} \STOConly{\begin{eqnarray} \textsf{adv}^{q, z}_{\bar{M}_i} \leq \frac{3z+2}{2} \cdot f^*_w p_w + (2z+1)\sum_{j=w+1}^q f^*_j p_j - 1, \textnormal{If $z$ is even} \label{eqn:EvenIBound}\allowdisplaybreaks\\ \textsf{adv}^{q, z}_{\bar{M}_i} \leq \frac{z+1}{2} \cdot f^*_w p_w + (2z+1)\sum_{j=w+1}^q f^*_j p_j - 1, \textnormal{If $z$ is odd} \label{eqn:OddIBound} \end{eqnarray}} \paragraph{Step 3. Proving Non-positivity of the Bound from Step 3 for Unit Sum Vectors:} In this step, we show that the bounds \eqref{eqn:EvenIBound} and \eqref{eqn:OddIBound} on advantage that were presented in Step 2 are necessarily non-positive for any vector $(f^*_1, \cdots, f^*_q)$ with unit sum including the vector of overall frequencies $\bar{f} = (\bar{f}_1, \cdots, \bar{f}_q)$ where $\bar{f}_j = \frac{\textsf{count}_j(\bar{v}_i)}{|\bar{v}_i|}=F^j_i$. In Step 4, we use this fact to show that $f^*$ needs to deviate noticeably from $\bar{f}$ which gives that the variance of frequencies with respect to $T$ is large enough, thus finishing the proof. \begin{proposition}\label{thm:non-positivity} Let $(p_1, \cdots, p_q)$ and $(f^*_1, \cdots, f^*_q)$ be two positive real vectors with unit sum that satisfy \noSTOC{$$f^*_1 p_1 \geq f^*_2 p_2 \geq \cdots \geq f^*_q p_q.$$} \STOConly{$f^*_1 p_1 \geq f^*_2 p_2 \geq \cdots \geq f^*_q p_q.$} Then, for all integers $1\leq z<q$, the following hold for $w = \lfloor\frac{z}{2}\rfloor + 1$: \begin{enumerate} \item If $z$ is even, \noSTOC{$$\frac{3z+2}{2} \cdot f^*_w p_w + (2z+1)\sum_{j=w+1}^q f^*_j p_j \leq 1.$$}\STOConly{$\frac{3z+2}{2} \cdot f^*_w p_w + (2z+1)\sum_{j=w+1}^q f^*_j p_j \leq 1.$} \item If $z$ is odd, \noSTOC{$$\frac{z+1}{2} \cdot f^*_w p_w + (2z+1)\sum_{j=w+1}^q f^*_j p_j \leq 1.$$}\STOConly{$\frac{z+1}{2} \cdot f^*_w p_w + (2z+1)\sum_{j=w+1}^q f^*_j p_j \leq 1.$} \end{enumerate} \end{proposition} \noSTOC{We defer the proof of \cref{thm:non-positivity} to \cref{sec:proof-of-non-positivity}.}\STOConly{The proof of \cref{thm:non-positivity} can be found in the extended version of this article.} \paragraph{Step 4. Large Deviation of $f^*$s from $\bar{f}$s and Large Variance:} Here we finish the proof assuming $z$ is odd. The even case can be proved in the same way. Note that \cref{thm:non-positivity} gives that for the overall frequency vector $\bar{f}$ which has a unit sum, \begin{equation} \frac{z+1}{2} \cdot \bar{f}_w p_w + (2z+1)\sum_{j=w+1}^q \bar{f}_j p_j - 1 \leq 0.\label{eqn:uniformAdvantage} \end{equation} However, \eqref{eqn:qAryAdvLowerBoundAfterTransformation} and \eqref{eqn:OddIBound} imply that for local frequency vector $f^*$ \begin{equation} \frac{z+1}{2} \cdot f^*_w p_w + (2z+1)\sum_{j=w+1}^q f^*_j p_j - 1 \geq \textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2.\label{eqn:nonUniformAdvantage} \end{equation} Subtracting \eqref{eqn:uniformAdvantage} from \eqref{eqn:nonUniformAdvantage} gives that \noSTOC{\begin{eqnarray*} &&\frac{z+1}{2} \cdot p_w (f^*_w - \bar{f}_w) + (2z+1)\sum_{j=w+1}^q (f^*_j - \bar{f}_j) p_j \geq \textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2.\\ &\Rightarrow&\frac{z+1}{2} \cdot p_w |f^*_w - \bar{f}_w| + (2z+1)\sum_{j=w+1}^q |f^*_j - \bar{f}_j| p_j \geq \textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2.\\ &\Rightarrow&(2z+1)\sum_{j=w}^q |f^*_j - \bar{f}_j| p_j \geq \textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2.\allowdisplaybreaks\\ &\Rightarrow&\sum_{j=w}^q |f^*_j - \bar{f}_j| p_j \geq \frac{\textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2}{2z+1}. \end{eqnarray*}} \STOConly{\begin{align*} &\frac{z+1}{2} \cdot p_w (f^*_w - \bar{f}_w) + (2z+1)\sum_{j=w+1}^q (f^*_j - \bar{f}_j) p_j \geq \textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2.\\ &\Rightarrow\frac{z+1}{2} \cdot p_w |f^*_w - \bar{f}_w| + (2z+1)\sum_{j=w+1}^q |f^*_j - \bar{f}_j| p_j \geq \textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2.\\ &\Rightarrow(2z+1)\sum_{j=w}^q |f^*_j - \bar{f}_j| p_j \geq \textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2.\allowdisplaybreaks\\ &\Rightarrow\sum_{j=w}^q |f^*_j - \bar{f}_j| p_j \geq \frac{\textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2}{2z+1}. \end{align*}} This means that there exists some $j_0$ for which \noSTOC{$$|f^*_{j_0} - \bar{f}_{j_0}| p_{j_0} \geq \frac{\textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2}{2z+1} \Rightarrow (f^*_{j_0} - \bar{f}_{j_0})^2 p_{j_0} \geq (f^*_{j_0} - \bar{f}_{j_0})^2 p_{j_0}^2 \geq \left(\frac{\textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2}{2z+1}\right)^2 .$$} \STOConly{$|f^*_{j_0} - \bar{f}_{j_0}| p_{j_0} \geq \frac{\textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2}{2z+1} \Rightarrow (f^*_{j_0} - \bar{f}_{j_0})^2 p_{j_0} \geq (f^*_{j_0} - \bar{f}_{j_0})^2 p_{j_0}^2 \geq \left(\frac{\textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2}{2z+1}\right)^2 .$} Note that \noSTOC{\begin{eqnarray*} \sum_{p=1}^q \textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right) &=& \sum_{p=1}^q \sum_{j=1}^q \left(\E\left[F^p_{i+1}|v_i, T=j\right] - F^p_i\right)^2\Pr\{T=j|v_i\}\\ &\geq&\left(\E\left[F^{j_0}_{i+1}|v_i, T=j_0\right] - F^{j_0}_i\right)^2\Pr\{T=j_0|v_i\}\\ &=&(f^*_{j_0} - \bar{f}_{j_0})^2 p_{j_0} \geq \left(\frac{\textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2}{2z+1}\right)^2. \end{eqnarray*}} \STOConly{\begin{align*} &\sum_{p=1}^q \textnormal{Var}_{T}\left(\E\left[F^p_{i+1}|v_i, T\right]\right)\\ &\qquad= \sum_{p=1}^q \sum_{j=1}^q \left(\E\left[F^p_{i+1}|v_i, T=j\right] - F^p_i\right)^2\Pr\{T=j|v_i\}\allowdisplaybreaks\\ &\qquad\geq\left(\E\left[F^{j_0}_{i+1}|v_i, T=j_0\right] - F^{j_0}_i\right)^2\Pr\{T=j_0|v_i\}\allowdisplaybreaks\\ &\qquad=(f^*_{j_0} - \bar{f}_{j_0})^2 p_{j_0} \geq \left(\frac{\textsf{adv}^{q, z}_{M_i} - 3q\varepsilon^2}{2z+1}\right)^2. \end{align*}} \qedhere \popQED \noSTOC{ \shortOnly{ \newpage
\section{Introduction} \bigskip Atmospheric cluster formation processes \cite{Fried}, where certain species of the gas molecules (called {\em monomers\/}) can stick together and eventually produce macroscopic particles, are an important component in cloud formation and radiation scattering. The above cluster formation processes are modelled with the so-called General Dynamic Equation (GDE) \cite{Fried}. Under atmospheric conditions, the particle clusters are often aggregates of various molecular species and formed by collisions of several different monomer types, cf.\ \cite{Vehkam,Vehkamki2012} for more details and examples. Accordingly, in the GDE one needs to label clusters not only by the total number of monomers in them but also by counting each monomer type. This results in multicomponent labels for the concentration vector, with nonlinear interactions between the components. Another feature of the GDE which has been largely absent from most of the previous mathematical work on coagulation equations, is the presence of an external monomer source term. Such sources are nevertheless important for atmospheric phenomena (for more details about the chemical and physical origin and relevance of the sources we refer for instance to \cite{Ehn2014, Kerminen2018}), although this problem has been barely considered in the mathematical literature. In this work, we focus on the effect the addition of a source term has on solutions of standard one-component coagulation equations. This is by no means to imply that multicomponent coagulation equations would not have interesting new mathematical features but these will be the focus of a separate work. Here, we consider only one species of monomers, and we are interested in the distribution of the concentration of clusters formed out of these monomers. Let $n_\alpha\ge 0$ denote the concentration of clusters with $\alpha\in {\mathbb N}$ monomers. Considering the regime in which the precise spatial structure and loss of particles by deposition are not important, the GDE yields the following nonlinear evolution equation for the concentrations $n_\alpha$: \begin{align} & \partial_{t}n_{\alpha} \nonumber =\frac{1}{2}\sum_{0< \beta<\alpha}K_{\alpha-\beta,\beta }n_{\alpha-\beta}n_{\beta}-n_{\alpha}\sum_{\beta>0}K_{\alpha,\beta}n_{\beta } \\ &\qquad +\sum_{\beta>0}\Gamma_{\alpha+\beta,\alpha}n_{\alpha+\beta}-\frac{1}{2}% \sum_{0<\beta<\alpha}\Gamma_{\alpha,\beta}n_{\alpha}+ s_{\alpha}\, . \label{B1} \end{align} The coefficients $K_{\alpha,\beta}$ describe the coagulation rate joining two clusters of sizes $\alpha$ and $\beta$ into a cluster of size $\alpha+\beta$, as dictated by mass conservation. Analogously, the coefficients $\Gamma_{\alpha,\beta}$ describe the fragmentation rate of clusters of size $\alpha$ into two clusters which have sizes $\beta$ and $\alpha-\beta$. We denote with $s_{\alpha}$ the (external) source of clusters of size $\alpha$. In applications, typically only monomers or small clusters are being produced, so we make the assumption that the function $\alpha \mapsto s_\alpha$ has a bounded, non-empty support. In the following, we make one further simplification and consider only cases where also fragmentation can be ignored, $\Gamma_{\alpha,\beta}=0$; the reasoning behind this choice is discussed later in Sec.~\ref{sec:rateintro}. An overview of the currently available mathematical results for coagulation-fragmentation models can be found in \cite{C15, LM}. Therefore, we are led to study the evolution equation \begin{equation} \partial_{t}n_{\alpha}=\frac{1}{2}\sum_{\beta<\alpha}K_{\alpha-\beta,\beta }n_{\alpha-\beta}n_{\beta}-n_{\alpha}\sum_{\beta>0}K_{\alpha,\beta}n_{\beta} + s_{\alpha}\,. \label{B2} \end{equation} In this paper, we are concerned with the existence or nonexistence of steady state solutions to (\ref{B2}) for general coagulation rate kernels $K$, including in particular the physically relevant kernels discussed in Sec.~\ref{sec:rateintro}. The source is here assumed to be localized on the ``left boundary'' of the system which have small cluster sizes. Such source terms often lead to nontrivial stationary solutions towards which the time-dependent solutions evolve as time increases. These stationary solutions are nonequilibrium steady states since they involve a steady flux of matter from the source into the system. The characterization of nonequilibrium stationary states exhibiting transport phenomena is one of the central problems in statistical mechanics. The main result of this paper gives a contribution in this direction. More precisely, we address the question of existence of such stationary solutions to (\ref{B2}). We prove that for a large class of kernels---including in particular the diffusion limited aggregation kernel given in (\ref% {KernBrow})---stationary solutions to (\ref{B2}) yielding a constant flux of monomers towards clusters with large sizes exist. On the contrary, for a different class of kernels---including the free molecular coagulation kernel with the form (\ref{eq:BalKer})---such a class of stationary solutions does not exist. In the case of collision kernels for which stationary nonequilibrium solutions to (\ref{B2}) exist, we can even compute the rate of formation of macroscopic particles, which we identify here with infinitely large particles, from an analysis of the properties of these stationary solutions, cf. Section \ref{sec:types_sol}. We find that in this case the main mechanism of transport of monomers to large clusters corresponds to coagulation between clusters with comparable sizes, cf.\ Lemma \ref{lem:J}, Section \ref{sec:estimates}. { The non-existence of such stationary solutions under a monomer source for a general class of coagulation kernels yielding coagulation for arbitrary cluster sizes is one of the novelties of our work. It has been pointed out in Remark 8.1 of \cite{Dub} that for kernels $K_{\alpha,\beta}$ which vanish if $\alpha>1$ or $\beta>1$, and sources $s_{\alpha}$ which are different from zero for $\alpha\geq2$, stationary solutions of (\ref{B2}) cannot exist. Although the example in \cite{Dub} refers to the continuous counterpart of (\ref{B2}) (c.f. (\ref{eq:time_evol})), the argument works similarly for discrete kernels. The example of non existence of stationary solutions in \cite{Dub} relies on the fact that coagulation does not take place for sufficiently large particles and therefore cannot compensate for the addition of particles due to the source term $s_{\alpha}.$ In the class of kernels considered in this paper coagulation takes place for all particle sizes and therefore the nonexistence of steady states must be due to a different reason. At first glance} this result might appear counterintuitive since this non-existence result includes kernels for which the dynamics seems to be well-posed. Hence, one needs to explain what will happen at large times to the monomers injected into the system. Our results suggest that for such kernels the aggregation of monomers with large clusters is so fast that it cannot be compensated by the constant addition of monomers described by the injection term $s_\alpha$. Then the cluster concentration $n_{\alpha}$ would converge to zero as $t\to \infty$ for bounded $\alpha$ even if $n_{\alpha}=0$ is not a stationary solution to \eqref{B2} if $(s_{\beta})\neq 0$. We remark that our non-existence result of stationary solutions includes in particular the so called free molecular kernel (cf. \eqref{KerBall-first} below) derived from kinetic theory which is commonly used for microscopic computations involving aerosols (cf. for instance \cite{Vehkam}). In this paper we consider, in addition to the stationary solutions of (\ref{B2}), also the stationary solutions of the continuous counterpart of (\ref{B2}), \begin{equation} \partial _{t}f(x,t)=\frac{1}{2}\int_{0}^{x}K\left( x-y,y\right) f\left( x-y,t\right) f\left( y,t\right) dy-\int_{0}^{\infty }K\left( x,y\right) f\left( x,t\right) f\left( y,t\right) dy+\eta \left( x\right) . \label{eq:time_evol} \end{equation} In fact, we will allow $f$ and $\eta$ in this equation to be positive measures. This will make it possible to study the continuous and discrete equations simultaneously, using Dirac $\delta$-functions to connect $f(\xi)$ and $n_\alpha$ via the formula $f(\xi) d\xi = \sum_{\alpha=1}^\infty n_\alpha \delta(\xi - \alpha)d\xi$. In most of the mathematical studies of the coagulation equation to date, it has been assumed that the injection terms $s_{\alpha}$ and $\eta\left(x\right) $ are absent. In the case of homogeneous kernels, i.e., kernels satisfying \begin{equation} K(rx,ry)=r^\gamma K(x,y)\label{eq:homogeneity_cond} \end{equation} for any $r>0$, the long time asymptotics of the solutions of (\ref{eq:time_evol}) with $\eta\left( x\right) =0$ might be expected to be self-similar for a large class of initial data. This has been rigorously proved in \cite{MP04} for the particular choices of kernels $K( x,y) =1$ and $K( x,y) =x+y$. In the case of discrete problems, the distribution of clusters $% n_{\alpha}$ has also been proved to behave in self-similar form for large times and for a large class of initial data if the kernel is constant, $% K_{\alpha,\beta}=1$, or additive, $K_{\alpha,\beta}=\alpha+\beta$ \cite{MP04}. For these kernels it is possible to find explicit representation formulas for the solutions of (\ref{B2}), (\ref{eq:time_evol}) using Laplace transforms. For general homogeneous kernels construction of explicit self-similar solutions is no longer possible. However, the existence of self-similar solutions of (\ref{eq:time_evol}) with $\eta=0$ has been proved for certain classes of homogeneous kernels $K( x,y) $ using fixed point methods. These solutions might have a finite monomer density (i.e., $\int_{0}^{\infty}xf\left( x,t\right) dx<\infty$) as in \cite{EM05, FL05}, or infinite monomer density (i.e., $\int_{0}^{\infty}xf% \left( x,t\right) dx=\infty$) as in \cite{BNV18, BNV19,NV13, NTV16}. Similar strategies can be applied to other kinetic equations \cite{GPV, JNV, NNTV}. Problems like (\ref{B2}), (\ref{eq:time_evol}) with nonzero injection terms $s_{\alpha}$, $% \eta\left( x\right) $ have been much less studied both in the physical and mathematical literature. In \cite{DKW99} it has been observed using a combination of asymptotic analysis arguments and numerical simulations that solutions of (\ref{B2}), (\ref{eq:time_evol}) with a finite monomer density behave in self-similar form for long times and for a class of homogeneous coagulation kernels, even considering source terms which depend on time following a power law $t^{\omega}$. Coagulation equations with sources have also been considered in \cite{LK02} using Renormalization Group methods and leading to predictions of analogous self-similar behaviour. For what concerns the rigorous mathematical literature, in \cite{Dub}, the existence of stationary solutions has been obtained in the case of bounded kernels. Well-posedness of the time-dependent problem for a class of homogeneous coagulation kernels with homogeneity $\gamma \in [0,2]$ has been proven in \cite{EM06}. For the constant kernel, the stability of the corresponding solutions has been proven using Laplace transform methods (cf. \cite{Dub}). Convergence to equilibrium for a class of coagulation equations containing also growth terms as well as sources has been studied in \cite{G,GZ}. Analogous stability results for coagulation equations with the form of \eqref{B1} but containing an additional removal term on the right-hand side with the form $-r_{\alpha}n_{\alpha},\ r_{\alpha}>0$ have been obtained in \cite{KT19}. In this paper we study the stationary solutions of (\ref{B2}), (\ref{eq:time_evol}) for coagulation kernels satisfying \begin{align}\label{eq:cond_kernel} &c_{1} w(x,y)\leq K( x,y) \leq c_{2}w(x,y)\,, \qquad w(x,y) := x^{\gamma +\lambda }y^{-\lambda }+ y ^{\gamma +\lambda }x^{-\lambda } \,, \end{align}% for some $c_1,c_2>0$ and for all $x,y$. The weight function $w$ depends on two real parameters: the homogeneity parameter $\gamma$ and the ``off-diagonal rate'' parameter $\lambda$. The parameter $\gamma$ yields the behaviour of kernel $K$ under the scaling of the particle size while the parameter $\lambda$ measures how relevant the coagulation events between particles of different sizes are. However, let us stress that we do not assume the kernel $K$ itself to be homogeneous, even though the weight functions are. The main result of this paper is the following. Given $\eta$ compactly supported there exists at least one nontrivial stationary solution to the problem (\ref{eq:time_evol}) if and only if $|\gamma +2\lambda|<1$. In particular, if $|\gamma +2\lambda|\ge 1$ no such stationary solutions can exist. Note that the parameters $\gamma$ and $\lambda$ are arbitrary real numbers and they may be negative or greater than one here. Therefore, these results do not depend on having global well-posedness of mass-preserving solutions for the time-dependent problem \eqref{eq:time_evol}. In particular, our theorems cover ranges of parameters for which the solutions to the time-depend problem \eqref{eq:time_evol} can exhibit gelation in finite or zero time. A detailed description of the current state of the art concerning wellposedness and gelation results can be found in \cite{BLL}. At a first glance, the fact that the existence of stationary solutions of \eqref{eq:time_evol} does not depend on having or not solutions for the time dependent problem might appear surprising. However, the reason for this becomes clearer if we notice that the homogeneity of the kernel is one of the main factors determining the wellposedness of the time dependent problem \eqref{eq:time_evol}. On the other hand, the homogeneity of the kernel $K$ is not an essential property of the stationary solution problem as it can be seen (cf. \cite{DP}) noticing that if $f$ is a stationary solution of \eqref{eq:time_evol}, then $x^{\theta }f\left( x\right) $ is a stationary solution of \eqref{eq:time_evol} with kernel $\frac{K\left( x,y\right) }{\left( xy\right) ^{\theta}}$ and the same source $\eta$. This new kernel satisfies \eqref{eq:cond_kernel} with $\gamma$ and $\lambda$ replaced by $\left( \gamma-2\theta\right) $ and $\lambda+\theta$ respectively. In particular, we can so obtain kernels with arbitrary homogeneity and having basically the same steady states, up to the product by a power law. We also prove in this paper the analog of these existence and non-existence results for the discrete coagulation equation \eqref{B2}. Moreover, we derive upper and lower estimates, as well as regularity results, for the stationary solutions to \eqref{B2}, \eqref{eq:time_evol} for the range of parameters for which these solutions exist, i.e. $|\gamma +2\lambda|<1$. Finally, we also describe the asymptotics for large cluster sizes of these stationary solutions. \subsection{On the choice of coagulation and fragmentation rate functions}\label{sec:rateintro} Although we do not keep track of any spatial structure, the coagulation rates $K_{\alpha,\beta}$ do depend on the specific mechanism which is responsible for the aggregation of the clusters. These coefficients need to be computed for example using kinetic theory and the result will depend on what is assumed about the particle sizes and the processes yielding the motion of the clusters. For instance, in the case of electrically neutral particles with a size much smaller than the mean free path between two collisions between clusters, the coagulation kernel is (cf.\ \cite{Fried})% \begin{equation} K_{\alpha,\beta}=\left( \frac{3}{4\pi}\right) ^{\frac{1}{6}}\sqrt{6k_{B}T}% \left( \frac{1}{m( \alpha) }+\frac{1}{m( \beta) }% \right) ^{\frac{1}{2}}\left( V( \alpha)^{\frac{1}{3}} +V( \beta) ^{\frac{1}{3}}\right) ^{2} \label{KerBall-first} \end{equation} where $V( \alpha) $ and $m( \alpha) $ are respectively the volume and the mass of the cluster characterized by the composition $% \alpha$. We denote as $k_{B}$ the Boltzmann constant, as $T$ the absolute temperature, and if $m_1$ is the mass of one monomer, we have above $m(\alpha)= m_1 \alpha$. In the derivation, one also assumes a spherical shape of the clusters. If the particles are distributed inside the sphere with a uniform mass density $\rho$, assumed to be independent of the cluster size, we also have $V(\alpha)=\frac{m_1}{\rho} \alpha$. Changing the time-scale we can set all the physical constants to one. Finally, it is possible to define a continuum function $K(x,y)$ by setting $\alpha=x$, $\beta=y$ in the above formula. We call this function the {\em free molecular coagulation kernel}, given explicitly by \begin{equation} K( x,y) =\big(x^{\frac{1}{3}}+y^{\frac{1}{3}}\big)^{2}\big(% x^{-1}+y^{-1}\big)^{\frac{1}{2}}. \label{eq:BalKer} \end{equation} It is now straightforward to check that with the parameter choice $\gamma=\frac{1}{6}$, $\lambda=\frac{1}{2}$ there are $c_1,c_2>0$ such that \eqref{eq:cond_kernel} holds for all $x,y>0$. Since here $\gamma + 2 \lambda = \frac{7}{6}>1$, the free molecular kernel belongs to the second category which has no stationary state. Another often encountered example is diffusion limited aggregation which was studied already in the original work by Smoluchowski \cite{S16}. Suppose that there is a background of non-aggregating neutral particles producing cluster paths resembling Brownian motion between their collisions. Then one arrives at the coagulation kernel \begin{equation} K_{\alpha,\beta}=\frac{2k_{B}T}{3\mu}\left( \frac{1}{ V( \alpha) ^{\frac{1}{3}}}+\frac{1}{ V( \beta)^{\frac{1}{3}}}\right) \left( V( \alpha)^{\frac{1}{3}} + V( \beta) ^{\frac{1}{3}}\right) \label{KernBrow-first} \end{equation} where $\mu>0$ is the viscosity of the gas in which the clusters move. As before, we then set $V(\alpha)=\frac{m_1}{\rho} \alpha$ and define a continuum function $K(x,y)$ by setting $\alpha=x$, $\beta=y$ on the right hand side of (\ref{KernBrow-first}). The constants may then be collected together and after rescaling time one may use the following kernel function \begin{equation} K( x,y)= \left( x^{-\frac{1}{3}} + y^{-\frac{1}{3}} \right) \left( x^{\frac{1}{3}}+ y^{\frac{1}{3}}\right) \,, \label{KernBrow} \end{equation} which we call here {\em diffusive coagulation kernel\/} or {\em Brownian kernel\/}. In this case, for the parameter choice $\gamma=0$, $\lambda=\frac{1}{3}$ there are $c_1,c_2>0$ such that for all $x,y>0$ \eqref{eq:cond_kernel} holds. Since here $0<\gamma + 2 \lambda = \frac{2}{3}<1$, the diffusive kernel belongs to the first category which will have some stationary solutions. Several other coagulation kernels can be found in the physical and chemical literature. For instance, the derivation of the free molecular kernel \eqref{KerBall-first} and the Brownian kernel \eqref{KernBrow-first} is discussed in \cite{Fried}. The derivation of coagulation describing the aggregation between charged and neutral particles can be found in \cite{SB73}. Applications of these three kernels to specific problems in chemistry can be found for instance in \cite{Vehkam}. Concerning the fragmentation coefficients $\Gamma_{\alpha,\beta}$, it is commonly assumed in the physics and chemistry literature that these coefficients are related to the coagulation coefficients by means of the following detailed balance condition (cf.\ for instance \cite{Vehkam}) \begin{equation} \Gamma_{\alpha+\beta,\beta}=\frac{P_{\text{ref}}}{k_{B}T}\exp\!\left( \frac{\Delta G_{\text{ref},\alpha+\beta}-\Delta G_{\text{ref},\alpha}-\Delta G_{\text{ref},\beta}}{k_{B}T}% \right) K_{\alpha,\beta} \label{DetailedBalance} \end{equation} where $\Delta G_{\text{ref},\alpha}$ is the Gibbs energy of formation of the cluster $\alpha$ and $P_{\text{ref}}$ is the reference pressure at which these energies of formation are calculated. Since we assume the coagulation kernel to be symmetric, $ K_{\alpha,\beta}=K_{\beta,\alpha}$, the fragmentation coefficients then satisfy a symmetry requirement $\Gamma_{\alpha+\beta,\alpha}=\Gamma_{\alpha+\beta,\beta}$ for all $\alpha,\beta\in\mathbb{N}^{d}$. In the processes of particle aggregation, usually the formation of larger particles is energetically favourable, which means that% \begin{equation*} \Delta G_{\text{ref},\alpha+\beta}\ll\Delta G_{\text{ref},\alpha}+\Delta G_{\text{ref},\beta}\,. \end{equation*} Under this assumption, it follows from (\ref{DetailedBalance}) that% \begin{equation*} \Gamma_{\alpha+\beta,\beta}\ll K_{\alpha,\beta}\,, \end{equation*} and then we might expect to approximate the solutions of \eqref{B1} by means of the solutions of \eqref{B2}. The description of the precise conditions on the Gibbs free energy $\Delta G_{\text{ref},\alpha }$ which would allow to make this approximation rigorous is an interesting mathematical problem that we do not address in the present paper. Therefore, we restrict our analysis here to the coagulation equations \eqref{B2} and \eqref{eq:time_evol}. \subsection{Notations and plan of the paper} Let $I$ be any interval such that $I \subset {\mathbb R}_+=[0,\infty)$. We reserve the notation ${\mathbb R}_*$ for the case $I=(0,\infty)$. We will denote by $C_{c}(I )$ the space of compactly supported continuous functions on $I$ and by $C_b(I)$ the space of functions that are continuous and bounded on $I$. Unless mentioned otherwise, we endow both spaces with the standard supremum norm. Then $C_b(I)$ is a Banach space and $C_{c}(I )$ is its subspace. We denote the completion of $C_{c}(I)$ in $C_b(I)$ by $C_0(I)$ which naturally results in a Banach space. For example, then $C_0({\mathbb R}_+)$ is the space of continuous functions vanishing at infinity and $C_{0}(I )=C_{c}(I )=C_b(I)$ if $I$ is a finite, closed interval. Moreover, we denote by $ \mathcal{M}_{+}(I) $ the space of nonnegative Radon measures on $I$. Since $I$ is locally compact, $ \mathcal{M}_{+}(I) $ can be identified with the space of positive linear functionals on $C_{c}(I )$ via Riesz--Markov--Kakutani theorem. For measures $\mu\in \mathcal{M}_{+}(I) $, we denote its total variation norm by $\norm{\mu}$ and recall that since the measure is positive, we have $\norm{\mu}=\mu(I)$. Unless $I$ is a closed finite interval, not all of these measures need to be bounded. The collection of bounded, positive measures is denoted by $\mathcal{M}_{+,b}(I):=\{\mu\in \mathcal{M}_{+}(I) \,|\,\mu(I)<\infty\}$ and we denote the collection of bounded complex Radon measures by $\mathcal{M}_{b}(I)$. We recall that the total variation indeed defines a norm in $\mathcal{M}_{b}(I)$, and this space is a Banach space which can be identified with the dual space $C_{0}(I )^*=C_c(T)^*$. In addition, $\mathcal{M}_{+,b}(I)$ is a norm-closed subset of $\mathcal{M}_{b}(I)$. Alternatively, we can endow both $\mathcal{M}_{b}(I)$ and $\mathcal{M}_{+,b}(I)$ with the $\ast$--weak topology which is generated by the functionals $\langle \varphi,\mu\rangle=\int_I \varphi(x) \mu(d x)$ with $\varphi\in C_c(I)$. We will use indistinctly $\eta(x) dx$ and $\eta(dx)$ to denote elements of these measure spaces. The notation $\eta( dx) $ will be preferred when performing integrations or when we want to emphasize that the measure might not be absolutely continuous with respect to the Lebesgue measure. For the sake of notational simplicity, in some of the proofs we will resort to a generic constant $C$ which may change from line to line. \medskip The paper is structured as follows. In Section \ref{sec:setting} we discuss the types of solutions considered here and we state the main results. In Section \ref{sec:existence} we prove the existence of steady states for the coagulation equation with source in the continuum case \eqref{eq:time_evol} assuming $|\gamma+2\lambda|<1$. We prove the complementary nonexistence of stationary solutions to \eqref{eq:time_evol} for $|\gamma+2\lambda|\geq 1$ in Section \ref{sec:nonexistence}. The analogous existence and nonexistence results for the discrete model \eqref{B2} are collected into Section \ref{sec:discr1d}. In Section \ref{sec:estimates} we derive several further estimates for the solutions of both continuous and discrete models, including also estimates for moments of the solutions. These estimates imply in particular that the only relevant collisions are those between particles of comparable sizes. Finally, in Section \ref{sec:discr_cont} we prove that the stationary solutions of the discrete model \eqref{B2} behave as the solutions of the continuous model \eqref{eq:time_evol} for large cluster sizes. \bigskip \section{Setting and main results}\label{sec:setting} \subsection{Different types of stationary solutions for coagulation equations.}\label{sec:types_sol} \bigskip The stationary solutions to the discrete equation \eqref{B2} satisfy: \begin{equation} 0=\frac{1}{2}\sum_{\beta<\alpha}K_{\alpha-\beta,\beta}n_{\alpha-\beta}% n_{\beta}-n_{\alpha}\sum_{\beta>0}K_{\alpha,\beta}n_{\beta}+s_\alpha \label{B2Stat}% \end{equation} where $\alpha\in\mathbb{N}$ and $s_\alpha$ is supported on a finite set of integers. Analogously, in the continuous case, the stationary solutions to \eqref{eq:time_evol} satisfy \begin{equation} 0=\frac{1}{2}\int_{0}^{x}K\left( x-y,y\right) f\left( x-y\right) f\left( y\right) dy-\int_{0}^{\infty}K\left( x,y\right) f\left( x\right) f\left( y\right) dy+\eta\left( x\right), \label{eq:contStat}% \end{equation} where the source term $\eta\left( x\right) $ is compactly supported in $[1, \infty)$. Although we write the equation using a notation where $f$ and $\eta$ are given as functions, the equation can be extended in a natural manner to allow for measures. The details of the construction are discussed in Sec.\ \ref{sec:existence} and the explicit weak formulation may be found in (\ref{eq:stationary_eq}). We remark that equation \eqref{B2Stat} can be written as \begin{equation} J_\alpha\left( n\right) - J_{\alpha-1}\left( n\right) = \alpha s_\alpha \,, \qquad \text{ for } \alpha \geq 1\,, \label{fluxDStat}% \end{equation} where we define $J_0(n)=0$ and, for $\alpha \geq 1$, we set \begin{equation*} J_\alpha(n) = \sum\limits_{\beta=1}^\alpha \sum\limits_{\gamma=\alpha-\beta+1}^\infty K(\beta,\gamma) \beta n_\beta n_\gamma \,. \end{equation*} Notice that we will use indistintly the notation $ K_{\beta,\gamma}$ or $ K(\beta,\gamma)$. On the other hand, for sufficiently regular functions $f$ equation \eqref{eq:contStat} can similarly be written as \begin{equation} \partial_{x}J\left( x;f\right) =x\eta\left( x\right) \label{fluxStat}% \end{equation} where \begin{equation}\label{eq:flux} J\left( x;f\right) =\int_{0}^{x}dy\int_{x-y}^{\infty}dz K(y,z) y f\left( y\right) f\left( z\right). \end{equation} This implies that the fluxes $J_\alpha(n)$ and $J(x;f)$ are constant for $\alpha$ and $x$ sufficiently large due to the fact that $s$ is supported in a finite set and $\eta$ is compactly supported, and we prove in Lemma \ref{lem:flux} that this property continues to hold even when $f$ is a measure. If $s_\alpha$ or $\eta(x)$ decay sufficiently fast for large values of $\alpha $ or $x$ then $J_\alpha(n)$ or $J(x;f)$ converges to a positive constant as $\alpha$ or $x$ tend to infinity. Given that other concepts of stationary solutions are found in the physics literature, we will call the solutions of \eqref{B2Stat} and \eqref{eq:contStat} {\it stationary injection solutions}. In this paper we will be mainly concerned with these solutions. The physical meaning of these solutions, when they exist, is that it is possible to transport monomers towards large clusters at the same rate at which the monomers are added into the system. For comparison, let us also discuss briefly other concepts of stationary solutions and the relation with the stationary injection solutions. One case often considered in the physics literature are {\it constant flux solutions} (cf. \cite{T96}). These are solutions of \eqref{eq:contStat} with $\eta \equiv 0$ satisfying \begin{equation} J(x;f)=J_0\,, \quad \text{for } x>0\,,\label{eq:flux_J0} \end{equation} where $J_0 \in {\mathbb R}_+$ and $J(x;f)$ is defined in \eqref{eq:flux}. Explicit stationary solutions for coagulation equations have been obtained and discussed in \cite{DG92, DS95, DS92_95, L99, S83}. In these papers the collision kernel $K$ under consideration is not homogeneous. In the case of homogeneous kernels $K$ there is an explicit method to obtain power solutions of \eqref{eq:contStat} by means of some transformations of the domain of integration that were introduced by Zakharov in order to study the solutions of the Weak Turbulence kinetic equations (cf.\ \cite{Zakharov1, Zakharov2}). Zakharov's method has been applied to coagulation equations in \cite{Connaughton}. Alternatively, we can obtain power law solutions of \eqref{eq:flux_J0} using the homogeneity $\gamma$ of the kernel (cf.\ \eqref{eq:homogeneity_cond}). Indeed, suppose that $f\left( x\right) =c_{s}\left( x\right) ^{-\alpha}$ for some $c_{s}$ positive and $\alpha \in {\mathbb R}$. Using the homogeneity of the kernel $K$ we obtain \begin{align*} J(x;f)=G\left( \alpha\right) \left( c_{s}\right) ^{2}\left( x\right) ^{3+\gamma-2\alpha} \end{align*} under the assumption that% \begin{equation} G\left( \alpha\right) =\int_{0}^{1}dy\int_{1-y}^{\infty}dzK\left( y,z\right) \left( y\right) ^{1-\alpha}\left( z\right) ^{-\alpha}% <\infty\,.\label{PowLawCond}% \end{equation} Using \eqref{eq:flux_J0}, we then obtain $\alpha = (3+\gamma)/2$ and $c_{s}=\sqrt{\frac{J_{0}}{G\left( \alpha\right) }}.$ Therefore, \eqref{PowLawCond} holds if and only if $|\gamma+2\lambda| <1$. Notice that (\ref{PowLawCond}) yields a necessary and sufficient condition to have a power law solution of (\ref{eq:flux_J0}). However, one should not assume that all solutions of \eqref{eq:flux_J0} are given by a power law; indeed, we have preliminary evidence that there exist smooth homogeneous kernels satisfying \eqref{eq:cond_kernel} for which there are non- power law solutions to \eqref{eq:flux_J0}. Finally, let us mention one more type of solutions associated with the discrete coagulation equation \eqref{B2Stat} that have some physical interest. This is the {\it boundary value problem\/} in which the concentration of monomers is given and the coagulation equation \eqref{B2Stat} is satisfied for clusters containing two or more monomers ($\alpha \geq 2$). The problem then becomes \begin{eqnarray}\label{eq:bvp} 0&=&\frac{1}{2}\sum_{\beta<\alpha}K_{\alpha-\beta,\beta}n_{\alpha-\beta}% n_{\beta}-n_{\alpha}\sum_{\beta>0}K_{\alpha,\beta}n_{\beta}\,, \quad\text{for }\alpha\geq2\, \nonumber \\ n_{1} &=& c_{1} \end{eqnarray} where $c_1 >0$ is given. Notice that if we can solve the injection problem \eqref{B2Stat} for some source $s=s_1\delta_{\alpha,1} $ with $s_1 >0$, then we can solve the boundary value problem \eqref{eq:bvp} for any $c_1>0$. Indeed, let us denote by $N_\alpha(s_1)$, $\alpha\in {\mathbb N}$, the solution to \eqref{B2Stat} with source $s=s_1\delta_{\alpha,1} $. Then equation \eqref{B2Stat} for $\alpha=1$ reduces to $$ N_1(s_1) \sum_{\beta>0} K_{1\beta}N_\beta(s_1) = s_1\, .$$ This implies that $0<N_1(s_1) <\infty$. Then the solution to \eqref{eq:bvp} is given by $$n_\alpha = c_1\frac{N_\alpha(s_1)}{N_1(s_1)}.$$ Moreover, if we can solve \eqref{B2Stat} for some $s_1 > 0$, then we can solve \eqref{B2Stat} for arbitrary values of $s_1$ due to the fact that if $n$ is a solution of \eqref{B2Stat} with source $s$ then for any $\Lambda>0,$ $\sqrt{\Lambda}n$ solves \eqref{B2Stat} with source $\Lambda n.$ In this paper we will consider the problems \eqref{B2Stat} and \eqref{eq:contStat} in Sections \ref{sec:setting} to \ref{sec:estimates}. In Section \ref{sec:discr_cont} we prove that a rescaled version of the solutions to \eqref{B2Stat} and \eqref{eq:contStat} behaves for large cluster sizes as a solution to \eqref{eq:flux_J0}. We will not discuss solutions to \eqref{eq:bvp} in this paper. \medskip { In this paper we will study the solutions of \eqref{B2Stat}, \eqref{eq:contStat} for kernels $K\left( x,y\right) $ which behave for large clusters as $x^{\gamma+\lambda}% y^{-\lambda}+y^{\gamma+\lambda}x^{-\lambda}$ for suitable coefficients $\gamma,\lambda\in\mathbb{R}$ in the case of the equation \eqref{eq:contStat} as well as their discrete counterpart in the case of \eqref{B2Stat}. (See next Subsection for the precise assumptions on the kernels, in particular \eqref{eq:cond_kernel2}, \eqref{eq:cond_kernel3}.) The main result that we prove in this paper is that the equations \eqref{B2Stat}, \eqref{eq:contStat} with nonvanishing source terms $s_{\alpha},\ \eta$, respectively, have a solution if $\left\vert \gamma+2\lambda\right\vert <1$ and they do not have solutions at all if $\left\vert \gamma+2\lambda\right\vert \geq1.$ The heuristic idea behind this result is easy to grasp. We will describe it in the case of the equation \eqref{eq:contStat}, since the main ideas are similar for \eqref{B2Stat}. } {The equation \eqref{eq:contStat} can be reformulated as \eqref{fluxStat}, \eqref{eq:flux}. Since $\eta$ is compactly supported we obtain that $J\left( x;f\right) $ is a constant $J_{0}>0$ for $x$ sufficiently large. The homogeneity of the kernel $K\left( x,y\right) =x^{\gamma+\lambda}y^{-\lambda}+y^{\gamma+\lambda}x^{-\lambda}$ suggests that the solutions of the equation $J\left( x;f\right) =J_{0}$ should behave as $f\left( x\right) \approx Cx^{-\frac{\gamma+3}{2}}$ for large $x,\ $with $C>0.$ Actually this statement holds in a suitable sense that will be made precise later. However, this asymptotic behaviour for $f\left( x\right) $ cannot take place if $\left\vert \gamma+2\lambda\right\vert \geq1$ because the integral in \eqref{eq:flux} would be divergent. Therefore, solutions to \eqref{eq:contStat} can only exist for $\left\vert \gamma+2\lambda\right\vert <1.$ } \subsection{Definition of solution and main results} We restrict our analysis to the kernels satisfying \eqref{eq:cond_kernel}, or at least one of the inequalities there. To account for all the relevant cases, let us summarize the assumptions on the kernel slightly differently here. We always assume that \begin{equation} K:\mathbb{R}_*\times \mathbb{R}_*\rightarrow \mathbb{R}_{+}\, ,\quad K% \text{ is continuous} \,, \label{ContinAssumpt} \end{equation} and for all $x,y$, \begin{equation} K(x,y)\geq 0\, ,\qquad K(x,y)=K(y,x)\, . \label{eq:cond_kernel1} \end{equation}% We also only consider kernels for which one may find $\gamma,\lambda\in {\mathbb R}$ such that at least one of the following holds: there is $c_1>0$ such that for all $(x,y)\in \mathbb{R}_*^{2}$ \begin{equation} K\left( x,y\right) \geq c_{1}\left( x^{\gamma +\lambda }y^{-\lambda }+y^{\gamma +\lambda }x^{-\lambda }\right)\,, \label{eq:cond_kernel2} \end{equation}% and/or there is $c_2>0$ such that for all $(x,y)\in \mathbb{R}_*^{2}$ \begin{equation} K\left( x,y\right) \leq c_{2}\left( x^{\gamma +\lambda }y^{-\lambda }+y^{\gamma +\lambda }x^{-\lambda }\right) \,. \label{eq:cond_kernel3} \end{equation}% The class of kernels satisfying all of the above assumptions includes many of the most commonly encountered coagulation kernels. It includes in particular the Smoluchowski (or Brownian) kernel (cf.\ \eqref{KernBrow}) and the free molecular kernel (cf.\ \eqref{eq:BalKer}). The source rate is assumed to be given by $\eta \in \mathcal{M}_{+}\left( \mathbb{R}% _*\right) $ and to satisfy \begin{equation} \supp\left( \eta \right) \subset \left[ 1,L_{\eta }\right] \text{ for some }% L_{\eta }\geq 1\, . \label{eq:cond_eta} \end{equation} Note that then always $\eta \left( \mathbb{R}% _*\right) <\infty$, i.e., the measure $\eta$ is bounded. We study the existence of stationary injection solutions to equation~% \eqref{eq:time_evol} in the following precise sense: \begin{definition} \label{DefFluxSol} Assume that $K:{{\mathbb R}}_*^{2}\rightarrow {\mathbb{R}% }_{+}$ is a continuous function satisfying \eqref{eq:cond_kernel1} and the upper bound % \eqref{eq:cond_kernel3}. Assume further that $\eta \in \mathcal{M}_{+}\left( \mathbb{% R}_*\right) $ satisfies \eqref{eq:cond_eta}. We will say that $f\in \mathcal{M}_{+}\left( \mathbb{R}_*\right) ,$ satisfying $f\left( \left( 0,1\right) \right) =0$ and \begin{equation} \int_{{\mathbb R}_* }x^{\gamma +\lambda }f\left( dx\right) + \int_{{\mathbb R}_* }x^{-\lambda }f\left( dx\right) <\infty\,, \label{eq:moment_cond} \end{equation} is a stationary injection solution of \eqref{eq:time_evol} if the following identity holds for any test function $\varphi \in C_{c}({{\mathbb R}}_*)$: \begin{equation} \frac{1}{2}\int_{{\mathbb R}_*}\int_{{\mathbb R}_*} K\left( x,y\right) \left[ \varphi \left( x+y\right) -\varphi \left( x\right) -\varphi \left( y\right) % \right] f\left( dx\right) f\left( dy\right) +\int_{{\mathbb R}_*}\varphi \left( x\right) \eta \left( dx\right) =0\,. \label{eq:stationary_eq} \end{equation} \end{definition} \begin{remark}\label{rem:defFluxSol} Definition \ref{DefFluxSol}, or a discrete version of it, will be used throughout most of the paper (cf.\ Sections \ref{sec:setting} to \ref{sec:estimates}). In Section \ref{sec:discr_cont}, we will use a more general notion of a stationary injection solution to \eqref{eq:time_evol}, considering source terms $\eta$ which satisfy $ \supp \eta \subset [a, b]$ for some given constants $a$ and $b$ such that $0<a<b$. Then we require that $f\in \mathcal{M}_{+}\left( \mathbb{R}_*\right)$ and $f((0, a))=0$, in addition to (\ref{eq:moment_cond}). Note that for such measures we have $\int_{{\mathbb R}_*} f(dx) = \int_{[a,\infty)} f(dx)$. The generalized case is straightforwardly reduced to the above setup by rescaling space via the change of variables $x'=x/a$. \end{remark} The condition $f\left( \left(0,1\right) \right) =0$ is a natural requirement for stationary solutions of the coagulation equation, given that $\eta \left( \left( 0,1\right) \right) =0$. As we show next, the second integrability condition (\ref{eq:moment_cond}) is the minimal one needed to have well defined integrals in the coagulation operator. First, note that all the integrals appearing in \eqref{eq:stationary_eq} are well defined for any $\varphi \in C_{c}\left( \mathbb{R}_*\right)$ with $\supp% \varphi \subset ( 0,L]$, because we can then restrict the domain of integration to the set $\left\{ \left( x,y\right) \in \left[ 1,L\right] \times \left[ 1,\infty \right)\right\} $ in the term containing $\varphi \left( x\right)$, and to the set $\left\{ \left( x,y\right) \in \left[ 1,L\right] ^{2}\right\} $ in the term containing $\varphi \left( x+y\right)$. In addition, \eqref{eq:cond_kernel3} implies that $K\left( x,y\right) \leq \tilde{C}_{L}[y^{\gamma + \lambda}+y^{-\lambda}]$ for $\left( x,y\right) \in \left[ 1,L\right] \times \left[ 1,\infty \right)$. Therefore, \begin{align*} & \int_{\mathbb{R}_*}\int_{\mathbb{R}_*}K\left( x,y\right) \left\vert \varphi \left( x+y\right) \right\vert f\left( dx\right) f\left( dy\right) \leq C_{L}\left( \int_{\left[ 1,L\right] }f\left( dx\right) \right) ^{\! 2}\,, \\ & \int_{\mathbb{R}_*}\int_{\mathbb{R}_*}K\left( x,y\right) \left\vert \varphi \left( x\right) \right\vert f\left( dx\right) f\left( dy\right) \leq C_{L}\left( \int_{\mathbb{R}_*}y^{\gamma +\lambda }f\left( dy\right)+\int_{\mathbb{R}_*}y^{-\lambda }f\left( dy\right) \right)\int_{\left[ 1,L\right] }f\left( dx\right) \,, \end{align*}% where $C_{L}$ depends on $\varphi$, $\gamma$, and $\lambda$. Then, the assumption~\eqref{eq:moment_cond} in the Definition \ref{DefFluxSol} implies that all the integrals appearing in % \eqref{eq:stationary_eq} are convergent. We now state the main results of this paper. \begin{theorem} \label{thm:existence} Assume that $K$ satisfies~\eqref{ContinAssumpt}--% \eqref{eq:cond_kernel3} and $| \gamma +2\lambda | <1.$ Let $\eta \neq 0 $ satisfy \eqref{eq:cond_eta}. Then, there exists a stationary injection solution $f\in \mathcal{M}_{+}\left( \mathbb{R}_*\right) $, $f\neq 0$, to~% \eqref{eq:time_evol} in the sense of Definition~\ref{DefFluxSol}. \end{theorem} \begin{theorem} \label{thm:NonExistence} Suppose that $K\left( x,y\right) $ satisfies~% \eqref{ContinAssumpt}--\eqref{eq:cond_kernel3} as well as $| \gamma +2\lambda | \geq 1.$ Let us assume also that $\eta \neq 0$ satisfies \eqref{eq:cond_eta}. Then, there is no solution of~\eqref{eq:time_evol} in the sense of Definition \ref{DefFluxSol}. \end{theorem} \begin{remark} Notice that the free molecular kernel defined as in \eqref{eq:BalKer} satisfies % \eqref{eq:cond_kernel1}--\eqref{eq:cond_kernel3} with $\gamma =\frac{1}{6},\ \lambda =\frac{1}{2}$. Then, since $\gamma +2\lambda >1$, we are in the Hypothesis of Theorem \ref{thm:NonExistence} which implies that there are no solutions of \eqref{eq:time_evol} in the sense of the Definition \ref% {DefFluxSol} for the kernel \eqref{eq:BalKer} and some $\eta\ne 0$. On the other hand, in the case of the Brownian kernel defined in (\ref{KernBrow}) with $\gamma = 0 $ and $\lambda = \frac{1}{3}$ the assumptions of Theorem % \ref{thm:existence} hold and nontrivial stationary injection solutions in the sense of Definition \ref{DefFluxSol} exist for each $\eta$ satisfying (\ref{eq:cond_eta}). \end{remark} \begin{remark} We observe that if $\eta =0$, there is a trivial stationary solution to~% \eqref{eq:time_evol} given by $f=0$. On the other hand, if $\eta \ne 0$, then $f=0$ cannot be a solution. \end{remark} \begin{remark} Assumption \eqref{eq:cond_eta} is motivated by specific problems in chemistry \cite{Vehkam} which have a source of monomers $s_{\alpha}=s\delta_{\alpha,1}$ only. However, in all the results of this paper this assumption could be replaced by the most general condition \begin{equation} \operatorname*{supp}\left( \eta\right) \subset\left[ 1,\infty\right) ,\ \ \int_{\left[ 1,\infty\right) }x\eta\left( dx\right) <\infty \label{GeneralAssumpt}% \end{equation} and in the discrete case, the analogous condition \eqref{eq:Dcond_s} could be replaced by $\sum_{\alpha=1}^{\infty}\alpha s_{\alpha}<\infty$. Indeed, it is easily seen that the only property of the source term $\eta$ that is used in the arguments of the proofs, both in the existence and non-existence results, is that: \begin{equation} \frac{J}{2}\leq\int_{\left[ 1,L_{\eta}\right] }x\eta\left( dx\right) \leq J\ \ ,\ \ \text{where }\int_{\left[ 1,\infty\right) }x\eta\left( dx\right) =J\in\left( 0,\infty\right) \label{WeakCondA1}% \end{equation} for some $L_{\eta}$ sufficiently large, or an analogous condition in the discrete case, which follows immediately from (\ref{GeneralAssumpt}). Moreover, it seems feasible to extend the support of $\eta$ to all positive real numbers $\mathbb{R}_{\ast}$, by assuming suitable smallness conditions for $f$ and $\eta$ near the origin (for instance in the form of a bounded moment) in order to avoid fluxes of volume of particles coming from $x=0$. This would lead us to consider issues different from the main ones considered in this paper, therefore we decided to not further consider this case here. \end{remark} The flux of mass from small to large particles at the stationary state is computed in the next lemma for the above measure-valued solutions. In comparison to (\ref{eq:flux}), then one needs to refine the definition by using a right-closed interval for the first integration and an open interval for the second integration, as stated in (\ref{eq:flux_lem}) below. \begin{lemma}\label{lem:flux} Suppose that the assumptions of Theorem~\ref{thm:existence} hold. Let $f$ be a stationary injection solution in the sense of Definition~\ref{DefFluxSol}. Then $f$ satisfies for any $R>0$ \begin{equation}\label{eq:flux_lem} \int_{ (0,R]}\int_{(R-x,\infty)} K(x,y)x f(dx) f(dy) = \int_{(0,R]} x \eta(dx) \, . \end{equation} \end{lemma} \begin{remark} Note that if $R\geq L_\eta$, the right-hand side of \eqref{eq:flux_lem} is always equal to $J=\int_{[1,L_\eta]} x \eta(dx)>0$. Therefore, the flux is constant in regions involving only large cluster sizes. \end{remark} \begin{proof} If $R<1$, both sides of (\ref{eq:flux_lem}) are zero, and the equality holds. Consider then some $R\ge 1$ and for all $\varepsilon$ with $0<\varepsilon<R$ choose some $\chi_\varepsilon \in C_c^\infty({\mathbb R}_*)$ such that $0\le \chi_\varepsilon\le 1$, $\chi_\varepsilon (x) = 1$, for $1\le x \leq R$, and $\chi_\varepsilon(x) = 0$, for $x \geq R+\varepsilon $. Then for each $\varepsilon$ we may define $\varphi(x) = x \chi_\varepsilon(x) $ and thus obtain a valid test function $\varphi\in C_{c}({{\mathbb R}}_*)$. Since then \eqref{eq:stationary_eq} holds, we find that for all $\varepsilon$ \begin{equation}\label{eq:fluxChi} \frac{1}{2}\int_{{\mathbb R}_* }\int_{{\mathbb R}_* }K\left( x,y\right) \left[(x+y) \chi_\varepsilon(x+y) -x \chi_\varepsilon(x) - y \chi_\varepsilon(y) \right] f\left( dx\right) f\left( dy\right) + \int_{{\mathbb R}_*}x\chi_\varepsilon(x)\eta(dx)=0\,. \end{equation} The first term can be rewritten as follows \begin{eqnarray*} && \frac{1}{2}\iint_{ \{(x,y)| x+y> R\}} K\left( x,y\right) \left[(x+y) \chi_\varepsilon(x+y) -x \chi_\varepsilon(x) - y \chi_\varepsilon(y) \right] f\left( dx\right) f\left( dy\right) \\ &=& \frac{1}{2}\iint_{ \{(x,y)| x+y> R,\ x\leq R,\ y\leq R\}} K\left( x,y\right) \left[(x+y) \chi_\varepsilon(x+y) -x - y \right] f\left( dx\right) f\left( dy\right)\\ && +\frac{1}{2}\iint_{ \{(x,y)| x> R,\ y\leq R \}} K\left( x,y\right) \left[(x+y) \chi_\varepsilon(x+y) -x \chi_\varepsilon(x) - y \right] f\left( dx\right) f\left( dy\right) \\ && +\frac{1}{2}\iint_{ \{(x,y)| y> R,\ x \leq R \}} K\left( x,y\right) \left[(x+y) \chi_\varepsilon(x+y) -x - y \chi_\varepsilon(y) \right] f\left( dx\right) f\left( dy\right) \\ &&+\frac{1}{2}\iint_{ \{(x,y)| y> R,\ x>R \}} K\left( x,y\right) \left[-x \chi_\varepsilon(x) - y \chi_\varepsilon(y) \right] f\left( dx\right) f\left( dy\right). \end{eqnarray*} We readily see that the terms involving $\chi_\varepsilon$ on the right hand side tend to zero as $\varepsilon$ tends to zero due to the fact that for Radon measures $\mu$ the integrals $\int_{[a-\varepsilon, a)}d\mu $ and $\int_{(a,a+\varepsilon]} d\mu $ converge to $0$ as $\varepsilon $ tends to zero. Then we obtain from \eqref{eq:fluxChi} \begin{eqnarray*} & \frac{1}{2}\iint\limits_{ \{(x,y)| x+y> R,\ x \leq R,\ y \leq R \}} K\left( x,y\right) (x+y)f\left( dx\right) f\left( dy\right) + \frac{1}{2}\iint\limits_{ \{(x,y)| x> R,\ y \leq R \}} K\left( x,y\right) y f\left( dx\right) f\left( dy\right)\\ & +\frac{1}{2}\iint\limits_{ \{(x,y)| y> R,\ x \leq R \}} K\left( x,y\right) x f\left( dx\right) f\left( dy\right) = \int_{(0,R]}x\eta(dx)\,. \end{eqnarray*} Rearranging the terms we obtain \begin{align*} & \frac{1}{2}\iint\limits_{ \{(x,y)| x+y> R,\ x \leq R \}} K\left( x,y\right) x f\left( dx\right) f\left( dy\right) + \frac{1}{2}\iint\limits_{ \{(x,y)| x+y> R,\ y \leq R \}} K\left( x,y\right) y f\left( dx\right) f\left( dy\right) \\ &\quad =\int_{(0,R]}x\eta(dx)\, \end{align*} which implies (\ref{eq:flux_lem}) using a symmetrization argument. \end{proof} { The following Lemma will be used several times throughout the paper to convert bounds for certain ``running averages'' into uniform bounds of integrals. The function $\varphi$ below is included mainly for later convenience. \begin{lemma}\label{lem:bound} Suppose $a>0$ and $b \in (0,1)$, and assume that $R\in (0,\infty]$ is such that $R\ge a$. Consider some $f \in \mathcal{M_+}({\mathbb R}_*)$ and $\varphi \in C({\mathbb R}_*)$, with $\varphi\ge 0$. \begin{enumerate} \item\label{it:Rlessinf} Suppose $R<\infty$, and assume that there is $g \in L^1([a,R])$ such that $g\ge 0$ and \begin{equation}\label{eq:avg} \frac{1}{z}\int_{[bz,z]} \varphi(x) f(dx) \leq g(z)\,, \quad \text{for } z \in [a,R] \,. \end{equation} Then \begin{equation}\label{eq:bound} \int_{[a,R]} \varphi(x) f(dx) \leq \frac{\int_{[a,R]}g(z)dz}{\vert \ln b\,\vert } + R g(R)\,. \end{equation} \item\label{it:polcase} Consider some $r\in (0,1)$, and assume that $a/r\le R<\infty$. Suppose that (\ref{eq:avg}) holds for $g(z)=c_0 z^q$, with $q\in {\mathbb R}$ and $c_0\ge 0$. Then there is a constant $C>0$, which depends only on $r$, $b$ and $q$, such that \begin{equation}\label{eq:polbound} \int_{[a,R]} \varphi(x) f(dx) \leq C c_0 \int_{[a,R]} z^q dz \,. \end{equation} \item\label{it:Risinf} If $R=\infty$ and there is $g \in L^1([a,\infty))$ such that $g\ge 0$ and \begin{equation}\label{eq:avgRinfty} \frac{1}{z}\int_{[bz,z]} \varphi(x) f(dx) \leq g(z)\,, \quad \text{for } z \ge a \,, \end{equation} then \begin{equation}\label{eq:boundRinfty} \int_{[a,\infty)} \varphi(x) f(dx) \leq \frac{\int_{[a,\infty)}g(z)dz}{\vert \ln b\,\vert }\,. \end{equation} \end{enumerate} \end{lemma} \begin{proof} We first prove the general case in item \ref{it:Rlessinf}. Assume thus that $R<\infty$ and that $g\ge 0$ is such that (\ref{eq:avg}) holds. We recall that then $0<a\le R$. If $a\ge b R$, we can estimate \begin{equation*} \int_{[a,R]} \varphi(x) f(dx) \leq \int_{[bR,R]} \varphi(x) f(dx)\leq Rg(R)\,, \end{equation*} using the assumption (\ref{eq:avg}) with $z=R$. Thus (\ref{eq:bound}) holds in this case since $g\ge 0$. Otherwise, we have $0<a<b R$. By assumption, the constant $C_1 := \int_{[a,R]} g(z) dz\geq 0$ is finite. Integrating~\eqref{eq:avg} over $z$ from $a$ to $R$, we obtain $$\int_{[a,R]}\int_{[bz,z]}\frac{1}{z} \varphi(x)f(dx) dz\leq C_1\, .$$ The iterated integral satisfies the assumptions of Fubini's theorem, and thus it can be written as an integral over the set \begin{eqnarray} && \{(z,x)\ |\ a \leq z\leq R, \ bz \leq x \leq z \}\nonumber \\ &=& \{(z,x)\ |\ ba\leq x\leq R, \ \max\{a,x\} \leq z \leq \min\{\frac{1}{b}x,R\} \}\nonumber \\ &\supset & \{(z,x)\ |\ a\leq x\leq bR, \ x \leq z \leq \frac{1}{b}x \}\,.\nonumber \end{eqnarray} Therefore, after using Fubini's theorem to obtain an integral where $z$-integration comes first, we find that $$ \int_{[a,bR]} \int_{[x, x/b]}\frac{1}{z} \varphi(x) f(dx ) dz \ \leq\ C_1.$$ The integral over $z$ yields $\ln(x/(bx))=\vert \ln b\,\vert $, and thus $\int_{[a,bR]} \varphi(x) f(dx ) \ \leq\ C_1/ \vert \ln b\,\vert$. To get an estimate for the integral over $[bR,R]$, we use (\ref{eq:avg}) for $z=R$. Hence, \eqref{eq:bound} follows also in this case which completes the proof of the first item. For item \ref{it:polcase}, let us assume that $0<r<1$, $a\le r R<\infty$, and that (\ref{eq:avg}) holds for $g(z)=c_0 z^q$, with $q\in {\mathbb R}$ and $c_0\ge 0$. Since then $g\in L^1([a,R])$ and $g\ge 0$, we can conclude from the first item that that \eqref{eq:bound} holds. Thus we only need find a suitable bound for the second term therein, for $R g(R)=c_0 R^{q+1}$. By changing the integration variable from $z$ to $y=z/R$, we find \[ \int_{[a,R]} z^q dz= R^{q+1}\int_{[a/R,1]} y^q dy \ge R^{q+1}\int_{[r,1]} y^q dy\,. \] Here, $C':=\int_{[r,1]} y^q dy$ satisfies $0<C'<\infty$ for any choice of $q\in {\mathbb R}$. Therefore, we can now conclude that (\ref{eq:polbound}) holds for $C=|\ln b\,|^{-1} + 1/C'$ which depends only on $q$, $b$, and $r$. For item \ref{it:Risinf}, let us suppose that $R=\infty$ and consider an arbitrary finite $R'>a/b$. Then item \ref{it:Rlessinf} holds for $R'$. Moreover, we can employ the estimate derived in the proof of the item \ref{it:Rlessinf} above, and conclude that $\int_{[a,b R']} \varphi(x) f(dx ) \leq C_1/ \vert \ln b\,\vert$ where $C_1=\int_{[a,R']} g(z) dz\le \int_{[a,\infty)} g(z) dz$. Taking $R'\to \infty$ and using the monotone convergence theorem, proves that (\ref{eq:boundRinfty}) holds. This completes the proof of the Lemma. \end{proof} } \section{Existence results: Continuous model}\label{sec:existence} Our first goal is to prove the existence of a stationary injection solution (cf.\ Theorem~% \ref{thm:existence}) under the assumption $|\gamma + 2\lambda|<1$. This will be accomplished in three steps: We first prove in Proposition~\ref% {thm:existence_evolution} existence and uniqueness of time-dependent solutions for a particular class of compactly supported continuous kernels. Considering these solutions at large times allows us to prove in Proposition \ref% {thm:existence_truncated} existence of stationary injection solutions for this class of kernels using a fixed point argument. We then extend the existence result to general unbounded kernels supported in ${% \mathbb{R}}_*^{2}$ and satisfying \eqref{eq:cond_kernel1}--% \eqref{eq:cond_kernel3} with $| \gamma +2\lambda | <1$. Compactly supported continuous kernels are automatically bounded from above but, for the first two results, we will also assume that the kernel has a uniform lower bound on the support of the source. To pass to the limit including the more general kernel functions, it will be necessary to control the dependence of the solutions on both of the bounds and on the size of support of the kernel. To fix the notations, let us first choose an upper bound $L_\eta$ for the support of the source, i.e., a constant satisfying \eqref{eq:cond_eta}. In the first two Propositions, we will consider kernel functions which are continuous, non-negative, have a compact support, and for which we may find $R_{\ast }\geq L_{\eta }$ and $a_1$, $a_2$ such that $0<a_{1}<a_{2}$ and $% K(x,y)\in \lbrack a_{1},a_{2}],$ for $(x,y)\in \lbrack 1,2R_{\ast }]^{2}$. This allows us to prove first that the time-evolution is well-defined, Proposition \ref% {thm:existence_evolution}, and then in Proposition \ref% {thm:existence_truncated} the existence of stationary injection solutions for this class of kernels using a fixed point argument. The proofs include sufficient control of the dependence of the solutions on the cut-off parameters to remove the restrictions and obtain the result in Theorem \ref{thm:existence}. In fact, not only we regularize the kernel, but we also introduce a cut-off for the coagulation gain term. This will guarantee that the equation is well-posed and has solutions whose support never extends beyond the interval $[1,2R_{\ast }]$. To this end, let us choose $\zeta _{R_{\ast }}\in C\left( \mathbb{R}_*\right)$ such that $0\le \zeta _{R_{\ast }}\le 1$, $\zeta_{R_{\ast }}\left( x\right) =1$ for $0\leq x\leq R_{\ast }$, and $\zeta _{R_{\ast}}\left( x\right) =0$ for $x\geq 2R_{\ast }$. We then regularize the time evolution equation \eqref{eq:time_evol} as \begin{equation} \partial _{t}f(x,t)=\frac{\zeta _{R_{\ast }\!}(x) }{2}\int_{\left( 0,x\right] }K( x-y,y) f( x-y,t) f( y,t) dy - \int_{{{{\mathbb R}}_*}}\! K( x,y) f( x,t) f( y,t) dy+\eta( x) \,. \label{evolEqTrunc} \end{equation}% As we show later, this will result in a well-posedness theory such that any solution of \eqref{evolEqTrunc} has the following property: $f\left( \cdot ,t\right) $ is supported on the interval $\left[ 1,2R_{\ast }\right] $ for each $t\geq 0$. Let us also point out that since we are interested in solutions $f$ such that $f\left( % \left( 0,1\right) ,t\right) =0$, the above integral $\int_{\left( 0,x% \right] }\left( \cdot \cdot \cdot \right) $ can be replaced by $\int_{\left[ 1,x-1\right] }\left( \cdot \cdot \cdot \right) $ if $x \geq 1$. \begin{assumption}\label{Assumptions} Consider a fixed source term $\eta \in \mathcal{M}_{+}\left( {{\mathbb R}}_*\right)$ and assume that $L_\eta\ge 1$ satisfies \eqref{eq:cond_eta}. Suppose $R_{\ast }$, $a_1$, $a_2$, and $T$ are constants for which $R_{\ast }>L_\eta$, $0<a_{1}<a_{2}$, and $T>0$. Suppose $K:{% \mathbb{R}}_*^{2}\rightarrow {\mathbb{R}}_{+}$ is a continuous, non-negative, symmetric function such that $K(x,y)\le a_2$ for all $x,y$, and we also have $K(x,y)\in \lbrack a_{1},a_{2}]$ for $(x,y)\in \lbrack 1,2R_{\ast }]^{2}$, and $K(x,y)=0$, if $x\geq 4R_{\ast}$ or $y\geq 4R_{\ast}$. Moreover, we assume that there is given a function $\zeta _{R_{\ast }}$ such that $\zeta _{R_{\ast }}\in C\left( \mathbb{R}_*\right)$, $0\le \zeta _{R_{\ast }}\le 1$, $\zeta _{R_{\ast }}\left( x\right) =1$ for $0\leq x\leq R_{\ast }$, and $\zeta _{R_{\ast }}\left( x\right) =0$ for $x\geq 2R_{\ast }$. \end{assumption} We will now study measure-valued solutions of the regularized problem \eqref{evolEqTrunc} in an integrated form. To this end, we use a fairly strong notion of continuous differentiability although uniqueness of the regularized problem might hold in a larger class. However, since we cannot prove uniqueness after the regularization has been removed, it is not a central issue here. \begin{definition}\label{defC1space} Suppose $Y$ is a normed space, $S\subset Y$, and $T>0$. We use the notation $C^1([0,T],S;Y)$ for the collection of maps $f:\left[ 0,T\right]\to S$ such that $f$ is continuous and there is $\dot{f}\in C([0,T],Y)$ for which the Fr\'echet derivative of $f$ at any $t\in \left( 0,T\right)$ is given by $\dot{f}(t)$. We also drop the normed space $Y$ from the notation if it is obvious from the context, in particular, if $S=\mathcal{M}_{+,b}(I)$ and $Y=C_0(I)^*$ or $Y=S$. \end{definition} Clearly, if $f\in C^1([0,T],S;Y)$, the function $\dot{f}$ above is unique and it can be found by requiring that for all $t\in \left( 0,T\right)$ \[ \lim_{\varepsilon\to 0} \frac{\norm{f(t+\varepsilon)-f(t)-\varepsilon \dot{f}(t)}_Y}{|\varepsilon|} = 0\,, \] and then taking the left and right limits to obtain the values $\dot{f}(0)$ and $\dot{f}(T)$. What is sometimes relaxed in similar notations is the existence of the left and right limits. \begin{definition}\label{DefTimeSol} Suppose that Assumption \ref{Assumptions} holds. Consider some initial data $f_{0}\in \mathcal{M}_{+}({\mathbb{R}}_*)$ for which $f_{0}\left( \left( 0,1\right) \cup \left( 2R_{\ast },\infty \right) \right) =0$. Then $f_0\in \mathcal{M}_{+,b}({\mathbb{R}}_*)$. We will say that $f\in {C^{1}(\left[ 0,T% \right] ,\mathcal{M}_{+,b}({\mathbb{R}}_*))}$ satisfying $f\left( \cdot ,0\right) =f_{0}\left( \cdot \right) $ is a time-dependent solution of (\ref{evolEqTrunc}) if the following identity holds for any test function $\varphi \in C^{1}(\left[ 0,T\right] ,C_{c}\left( {\mathbb{R}}_*\right) )$ and all $0<t<T$, \begin{eqnarray} &&\frac{d}{dt}\int_{{{\mathbb{R}}_*}}\varphi \left( x,t\right) f\left( dx,t\right) -\int_{{{\mathbb{R}}_*}}\dot{\varphi}\left( x,t\right) f\left( dx,t\right) \notag \\ &=&\frac{1}{2}\int_{{{\mathbb{R}}_*}}\int_{{{\mathbb{R}}_*}}K\left( x,y\right) \left[ \varphi \left( x+y,t\right) \zeta _{R_{\ast }}\left( x+y\right) -\varphi \left( x,t\right) -\varphi \left( y,t\right) \right] f\left( dx,t\right) f\left( dy,t\right) \hspace{1cm} \notag \\ &&+\int_{{{\mathbb{R}}_*}}\varphi \left( x,t\right) \eta \left( dx\right) . \label{eq:evol_eqWeak} \end{eqnarray} \end{definition} \begin{remark} Note that for any such solution $f$, automatically by continuity and compactness of $[0,T]$ one has \begin{equation} \sup\limits_{t\in \lbrack 0,T]}\left( \int_{{{\mathbb{R}}_*}}f\left( dx,t\right) \right) <\infty\,, \label{eq:moment_cond_evol} \end{equation}% since $\norm{f}=f({\mathbb R}_*)$. Let us also point out that whenever $\varphi \in C^{1}(\left[ 0,T\right],C_{c}\left( {\mathbb{R}}_*\right) )$ and $f\in {C^{1}(\left[ 0,T\right] ,\mathcal{M}_{+,b}({\mathbb{R}}_*))}$, the map $t\mapsto \int_{{{\mathbb{R}}_*}}\varphi \left( x,t\right) f\left(dx,t\right)$ indeed belongs to $C^{1}(\left[ 0,T\right] ,\mathbb{R}_{*})$. Thus the derivative on the left hand side of \eqref{eq:evol_eqWeak} is defined in the usual sense and, in fact, it is equal to $\int_{{{\mathbb{R}}_*}}\varphi \left( x,t\right) \dot{f}\left(dx,t\right)$. In addition, there is sufficient regularity that after integrating (\ref{eq:evol_eqWeak}) over the interval $\left[ 0,t% \right] $ we obtain% \begin{eqnarray} &&\int_{{{\mathbb{R}}_*}}\varphi \left( x,t\right) f\left( dx,t\right) -\int_{{{\mathbb{R}}_*}}\varphi \left( x,0\right) f_{0}\left( dx\right) \notag \\ &=&\int_{0}^{t}ds\int_{{{\mathbb{R}}_*}}\dot{\varphi}\left( x,s\right) f\left( dx,s\right) \notag \\ &&+\frac{1}{2}\int_{0}^{t}ds\int_{{{\mathbb{R}}_*}}\int_{{{\mathbb{R}}_*}% }K\left( x,y\right) \left[ \varphi \left( x+y,s\right) \zeta _{R_{\ast }}\left( x+y\right) -\varphi \left( x,s\right) -\varphi \left( y,s\right) % \right] f\left( dx,s\right) f\left( dy,s\right) \notag \\ &&+\int_{0}^{t}ds\int_{{{\mathbb{R}}_*}}\varphi \left( x,s\right) \eta \left( dx\right) . \label{eq:EvolWeakInt} \end{eqnarray} \end{remark} We can define also weak stationary solutions of (\ref{evolEqTrunc}). It is straightforward to check that if $F(dx)$ is a stationary solution, then $f(d x ,t)=F(dx)$ is a solution to \eqref{eq:EvolWeakInt} with initial condition $f_0(dx)=F(dx)$. \begin{definition} \label{DefStatSol} Suppose that Assumption \ref{Assumptions} holds. We will say that $f\in {\mathcal{M}_{+}({\mathbb{R}}_*)},$ satisfying $f((0,1) \cup (2R_*,\infty))=0$ is a stationary injection solution of (\ref{evolEqTrunc}) if the following identity holds for any test function $\varphi \in C_{c}\left( {\mathbb{R}}% _*\right) $: \begin{eqnarray} && \notag \\ 0 &=&\frac{1}{2}\int_{{\mathbb{R}}_*}\int_{{\mathbb{R}}_*}K\left( x,y\right) \left[ \varphi \left( x+y\right) \zeta _{R_{\ast }}\left( x+y\right) -\varphi \left( x\right) -\varphi \left( y\right) \right] f\left( dx\right) f\left( dy\right) \notag \\ &&+\int_{{\mathbb{R}}_*}\varphi \left( x\right) \eta \left( dx\right) . \label{eq:evol_eqWeakSt} \end{eqnarray} \end{definition} \begin{proposition} \label{thm:existence_evolution} Suppose that Assumption \ref{Assumptions} holds. Then, for any initial condition $f_{0}$ satisfying $f_{0}\in \mathcal{M}_{+}({\mathbb{R}}_*)$, $% f_{0}\left( \left( 0,1\right) \cup \left( 2R_{\ast },\infty \right) \right) =0$ there exists a unique time-dependent solution $f\in {C^{1}(\left[ 0,T\right] ,\mathcal{M}_{+,b}({\mathbb{R}}_*))}$ to (\ref{evolEqTrunc}) which solves it in the classical sense. Moreover, we have% \begin{equation} f\left( \left( 0,1\right) \cup \left( 2R_{\ast },\infty \right) ,t\right) =0\, ,\quad \text{for }0\leq t \le T\,, \label{fVanish} \end{equation}% and the following estimate holds \begin{equation} \int_{{\mathbb{R}}_*}f(dx,t)\leq \int_{{\mathbb{R}}_*}f_0(dx)+ C t \, ,\quad 0 \leq t \leq T \,, \label{fEstim} \end{equation}% for $C = \int_{{\mathbb{R}}_*}\eta(dx)\ge 0$ which is independent of $f_{0}$, $t$, and $T$. \end{proposition} \begin{remark} We remark that the lower estimate $K(x,y)\geq a_{1}>0$ will not be used in the proof of Proposition \ref{thm:existence_evolution}. However, this assumption will be used later in the proof of the existence of stationary injection solutions. \end{remark} \begin{proof} In this proof we skip some standard computations which may be found in \cite[Section 5]{Vuoksenmaa20}. We define $\mathcal{X}_{R_{\ast }}=\left\{ f\in \mathcal{M}_{+}({\mathbb{R}}% _*):f\left( \left( 0,1\right) \cup \left( 2R_{\ast },\infty \right) \right) =0\right\}$. Since $[1,2R_{\ast }]$ is compact, for any $f\in \mathcal{X}_{R_{\ast }}$ we have $f({\mathbb R}_*)<\infty$, and thus $\mathcal{X}_{R_{\ast }}\subset \mathcal{M}_{+,b}(\mathbb{R}_*)$. For $f\in \mathcal{M}_{+,b}(\mathbb{R}_*)$, we clearly have $f\in \mathcal{X}_{R_{\ast }}$ if and only if $\int \varphi(x) f(d x)=0$ for all $\varphi\in C_0({\mathbb R}_*)$ whose support lies in $\left( 0,1\right) \cup \left( 2R_{\ast },\infty \right)$. Therefore, $\mathcal{X}_{R_{\ast }}$ is a closed subset both in the $\ast -$weak and norm topology of $C_0({\mathbb R}_*)^*=\mathcal{M}_{b}({\mathbb{R}}_*)$. For the rest of this proof, we endow $\mathcal{X}_{R_{\ast }}$ with the norm topology which makes it into a complete metric space. We look for solutions $f$ in the subset $X:=C( \left[ 0,T\right], \mathcal{X}_{R_{\ast }})$ of the Banach space $C\left( \left[ 0,T\right], \mathcal{M}_{b}({\mathbb{R}}_*)\right)$. {The space $X$ is endowed with the norm } \begin{equation*} \left\Vert f\right\Vert _{T}=\sup_{0\leq t\leq T}\left\Vert f\left( \cdot ,t\right) \right\Vert\,. \end{equation*}% By the uniform limit theorem, also $X$ is then a complete metric space. We now reformulate (\ref{evolEqTrunc}) as the following integral equation acting on $\mathcal{X}_{R_{\ast }}$: we define for $0\le t\le T$, $x\in {\mathbb R}_*$, and $f\in X$ first a function \begin{equation} a\left[ f\right] \left( x,t\right) =\int_{{\mathbb{R}}_*}K\left( x,y\right) {f\left( dy,t\right)} \,, \label{aFunct} \end{equation} and using this we obtain a measure, written for convenience using the function notation, \begin{align} &\mathcal{T}\left[ f\right] \left( x,t\right) := f_{0}\left( x\right) e^{-\int_{0}^{t}a\left[ f\right] \left(x, s\right) ds} +\eta \left( x\right) \int_{0}^{t}e^{-\int_{s}^{t}a\left[ f\right] \left( x,\xi \right) d\xi }ds \nonumber \\ & \qquad +\frac{\zeta _{R_{\ast }}(x) }{2}\int_{0}^{t}e^{-\int_{s}^{t}a\left[ f\right] \left( x,\xi \right) d\xi }\int_{0}^{x}K\left( x-y,y\right) f\left( x-y,s\right) f\left( y,s\right) dy ds \,. \label{fIntForm} \end{align}% Notice that the definition \eqref{aFunct} indeed is pointwise well defined and yields a function $(x,s)\mapsto a\left[ f\right] \left( x,s\right) $ which is continuous and non-negative for any $f\in X$. Moreover, we claim that if $f\in X$, then (\ref{fIntForm}) defines a measure in $\mathcal{M}_{+}({\mathbb{R}}% _*)$ for each $t\in [0,T]$, and we have in addition $\mathcal{T}\left[ f\right] \in X$. The only non-obvious term is the term on the right-hand side containing $\int_{0}^{x}K\left( x-y,y\right) f\left( x-y,s\right) f\left( y,s\right) dy$. We first explain how this term defines a continuous linear functional on $C_c\left( {\mathbb{R}}_*\right)$. Define $g(x,s)=\frac{\zeta _{R_{\ast }}(x) }{2}e^{-\int_{s}^{t}a\left[ f\right] \left( x,\xi \right) d\xi }$ which is a jointly continuous function with $g(x,s)=0$ if $x\ge 2 R_{\ast }$. Given $\varphi \in C_{c}\left( {\mathbb{R}}_*\right) $ we then set \begin{align} & \left\langle \varphi,\int_{0}^{t} g(\cdot,s)\int_{0}^{\cdot}K\left( \cdot-y,y\right) f\left( \cdot-y,s\right) f\left( y,s\right) dy ds \right\rangle \nonumber\\ &\quad = \int_{0}^{t} \int_{{\mathbb{R}}_*} \left[ \int_{{\mathbb{R}}_*}K\left( x,y\right) g(x+y,s) \varphi \left( x+y\right) f\left( dx,s\right)\right]f\left( dy,s\right)ds \, . \label{ConvDef} \end{align}% Here the right-hand side of (\ref{ConvDef}) is well defined since $% f\left( \cdot ,s\right) \in \mathcal{X}_{R_{\ast }}$ for each $s\in \left[ 0,t\right] .$ Moreover, this operator defines a continuous linear functional from $C_c\left( {\mathbb{R}}_*\right) $ to $\mathbb{R}$, and thus is associated with a unique positive Radon measure. Finally, if $\varphi(x)=0$ for $1\le x\le 2 R_{\ast }$, then $g(x+y,s) \varphi \left( x+y\right)=0$ for $x+y<1$, which implies that the right hand side of \eqref{ConvDef} is zero. Therefore, the measure belongs to $\mathcal{X}_{R_{\ast }}$ for all $t$. Continuity in $t$ follows straightforwardly. The operator $\mathcal{T}\left[ \cdot \right] $ defined in (\ref{fIntForm}) is thus a mapping from $C([0,T],\mathcal{X}_{R_{\ast }})$ to $C([0,T],\mathcal{X}% _{R_{\ast }})$ for each $T>0.$ We now claim that it is a contractive mapping from the complete metric space \begin{equation*} {X}_{T} :=\left\{ f\in X \, |\, \left\Vert f-f_{0}\right\Vert _{T}\leq 1\right\} \end{equation*}% to itself if $T$ is sufficiently small. This follows by means of standard computations using the assumption $K\left( x,y\right) \leq a_{2}$, as well as the inequality $\left\vert e^{-x_{1}}-e^{-x_{2}}\right\vert \leq \left\vert x_{1}-x_{2}\right\vert $ valid for $x_{1}\geq 0,\ x_{2}\geq 0.$ Therefore, there exists a unique solution of $f=\mathcal{T}\left[ f\right] $ in ${X}_{T}$ assuming that $T$ is sufficiently small. Notice that $f\geq 0$ by construction. In order to show that the obtained solution can be extended to arbitrarily long times we first notice that if $f=\mathcal{T}\left[ f\right] $, then $f\in C^{1}(\left[ 0,T\right] ,\mathcal{X}_{R_{\ast }})$ and the definition in (\ref{fIntForm}) implies that $f$ satisfies (\ref{evolEqTrunc}). Integrating this equation with respect to the $x$ variable, we obtain the following estimates: \begin{align} & \partial _{t}\left( \int_{{\mathbb{R}}_* }f\left( dx,t\right) \right) \nonumber \\ & \quad \leq \frac{1}{2}\int_{{\mathbb{R}}_* }f\left( dy,t\right) \int_{{% \mathbb{R}}_*}K\left( x,y\right) f\left( dx,t\right) -\int_{{\mathbb{R}}_* }f\left( dy,t\right) \int_{{\mathbb{R}}_* }K\left( x,y\right) f\left( dx,t\right) + \int_{{\mathbb{R}}_*}\eta \left( dx\right) \nonumber \\ & \quad = -\frac{1}{2}\int_{{\mathbb{R}}_* }f\left( dy,t\right) \int_{{% \mathbb{R}}_*}K\left( x,y\right) f\left( dx,t\right) +\int_{{\mathbb{R}}% _* }\eta \left( dx\right) \nonumber \\ & \quad \leq \int_{{\mathbb{R}}_*}\eta \left( dx\right) \label{eq:zeromomevolreg} \end{align} whence (\ref{fEstim}) follows. We can then extend the solution to arbitrarily long times $T>0$ using standard arguments. After this, the uniqueness of the solution in $C^{1}(\left[ 0,T\right] ,\mathcal{M}_{+,b}({\mathbb{R}}_*))$ follows by a standard Gr\"onwall estimate. \end{proof} \begin{remark}\label{th:boundforzeromomreg} Notice that using the inequality $K(x,y)\geq a_{1}>0$ we can strengthen (\ref{eq:zeromomevolreg}) into the estimate% \begin{equation*} \partial _{t}\left( \int_{{\mathbb{R}}_*}f\left( dx,t\right) \right) \leq -% \frac{a_{1}}{2}\left( \int_{{\mathbb{R}}_* }f\left( dx,t\right) \right) ^{2}+\int_{{\mathbb{R}}_*}\eta \left( dx\right). \end{equation*}% Inspecting the sign of the right hand side this implies an estimate stronger than (\ref{fEstim}), namely,% \begin{equation*} \int_{{\mathbb{R}}_* }f\left( dx,t\right) \leq \max \left\{ \int_{ {% \mathbb{R}}_*}f_{0}\left( dx\right) ,\left(\frac{2}{a_{1}}\int_{{\mathbb{R}}% _*}\eta \left( dx\right)\right)^{\frac 1 2} \right\}. \end{equation*} \end{remark} We now prove that solutions obtained in Proposition \ref% {thm:existence_evolution} are weak solutions in the sense of Definition \ref% {DefTimeSol}. \begin{proposition} \label{WeakSolBounded} Suppose that the assumptions in Proposition \ref% {thm:existence_evolution} hold. Then, the solution $f$ obtained is a weak solution of (\ref{evolEqTrunc}) in the sense of Definition \ref% {DefTimeSol}. \end{proposition} \begin{proof} Multiplying (\ref{evolEqTrunc}) by a continuous test function $\varphi \in C^{1}\left( \left[ 0,T\right] ,C\left( {\mathbb{R}}_*\right) \right) $ with $T>0$ we obtain, using the action of the convolution on a test function in (\ref{ConvDef}): \begin{eqnarray} &&\int_{{\mathbb{R}}_*}\varphi \left( x,t\right) \dot{f}\left( dx,t\right) \notag \\ &=&\frac{1}{2}\int_{{\mathbb{R}}_*}\int_{{\mathbb{R}}_*}K\left( x,y\right) \left[ \varphi \left( x+y,t\right) \zeta _{R_{\ast }}\left( x+y\right) -\varphi \left( x,t\right) -\varphi \left( y,t\right) \right] f\left( dx,t\right) f\left( dy,t\right) \hspace{1cm} \notag \\ &&+\int_{{\mathbb{R}}_*} {\varphi \left( x,t\right)} \eta \left( dx\right) . \label{IntStrForm} \end{eqnarray}% As mentioned earlier, the left-hand side can be rewritten as \begin{equation*} \int_{{\mathbb{R}}_*}\varphi \left( x,t\right) \dot{f}\left( dx,t\right) =\frac{d}{dt}\int_{{\mathbb{R}}_*}\varphi \left( x,t\right) f\left( dx,t\right) -\int_{{\mathbb{R}}_*} {\dot{\varphi}} \left( x,t\right) f\left( dx,t\right) . \end{equation*}% Therefore, $f$ satisfies (\ref{eq:evol_eqWeak}) in Definition \ref{DefTimeSol}. \end{proof} We will use in the following the dynamical system notation $S\left( t\right) $ for the map% \begin{equation} S\left( t\right) f_{0}=f\left( \cdot ,t\right) \label{SemDef} \end{equation}% where $f$ is the solution of (\ref{evolEqTrunc}) obtained in Proposition \ref% {thm:existence_evolution}. Note that by uniqueness $S\left( t\right) $ has the following semigroup property:% \begin{equation} S\left( t_{1}+t_{2}\right) =S\left( t_{1}\right) S\left( t_{2}\right) \text{ for each }t_{1},t_{2}\in \mathbb{R}_+ . \label{SemProp} \end{equation} The operators $S\left( t\right) $ define a mapping% \begin{equation} S\left( t\right) :\mathcal{X}_{R_{\ast }}\rightarrow \mathcal{X}_{R_{\ast }}\ \text{for each }t\geq 0 \label{SemMapping} \end{equation} where $\mathcal{X}_{R_{\ast }}=\left\{ f\in \mathcal{M}_{+}({\mathbb{R}}% _*):f\left( \left( 0,1\right) \cup \left( 2R_{\ast },\infty \right) \right) =0\right\}$, as before. We can now prove the following result: \begin{proposition} \label{thm:existence_truncated} Under the assumptions of Proposition~\ref% {thm:existence_evolution}, there exists a stationary injection solution $\hat{f}% \in \mathcal{M}_{+}({\mathbb{R}}_*)$ to (\ref{evolEqTrunc}) as defined in Definition~\ref{DefStatSol}. \end{proposition} \begin{proof} We provide below a proof of the statement but skip over some standard technical computations. Further details about these technical estimates can be found from \cite[Section 5]{Vuoksenmaa20}. We first construct an invariant region for the evolution equation % \eqref{evolEqTrunc}. Let $f_0 \in \chi_{R_*} $ and set $f(t)=S(t)f_0$. In particular, $f$ satisfies (\ref{eq:evol_eqWeak}). Let us then choose a time-independent test function such that $\varphi (x)=1$ when $1\le x\leq 2R_{\ast}$. Similarly to (\ref{eq:zeromomevolreg}) and using the fact that $f(\cdot,t)$ has support in $[1,2 R_*]$, the lower bound for $K$ implies an estimate \begin{equation*} \frac{d}{dt}\int_{[1,2R_{\ast }]}f\left( dx,t\right) \leq -\frac{a_{1}}{2}% \left( \int_{[1,2R_{\ast }]}f\left( dx,t\right) \right) ^{2}+c_{0} \end{equation*}% where $c_{0}=\int_{{\mathbb R}_*}\eta \left( dx\right) $. As in Remark \ref{th:boundforzeromomreg}, inspecting the sign of the right hand side we then find that if we choose any $M\geq \sqrt{\frac{2c_{0}}{a_{1}}}$, then the following set is invariant under the time-evolution: \begin{equation} \mathcal{U}_{M}=\left\{ f\in \mathcal{X}_{R_{\ast }}:\int_{[1,2R_{\ast }]}f(dx)\leq M\right\} \, . \label{eq:invariant_region} \end{equation} Moreover, $\mathcal{U}_{M}$ is compact in the $\ast -$weak topology due to Banach-Alaoglu's Theorem (cf.\ \cite{Brezis}), since it is an intersection of a $\ast -$weak closed set $\mathcal{X}_{R_{\ast }}$ and the closed ball $\norm{f}\le M$. Consider the operator $S(t):\mathcal{X}_{R_{\ast }}\rightarrow \mathcal{X}% _{R_{\ast }}$ defined in (\ref{SemDef}). We now endow $\mathcal{X}_{R_{\ast }}$ with the $\ast -$weak topology and prove that $S(t)$ is continuous. Due to Proposition \ref{WeakSolBounded} we have that $f(\cdot ,t)=S(t)f_{0}$ satisfies (\ref{eq:EvolWeakInt}) for any test function $% \varphi \in C^{1}\left( \left[ 0,T\right] ,C_c\left( {\mathbb R}_* \right) \right) $,\ $0\leq t\leq T$ with $T>0$ arbitrary. Let $f_{0},\hat{f}% _{0}\in \mathcal{X}_{R_{\ast }}$. We write $f(\cdot ,t)=S(t)f_{0}$ and $\hat{% f}(\cdot ,t)=S(t)\hat{f}_{0}.$ Using (\ref{eq:EvolWeakInt}) and subtracting the corresponding equations for $f$ and $\hat{f}$, we obtain \begin{eqnarray} &&\int_{{\mathbb{R}}_*}\varphi \left( x,t\right) (f\left( dx,t\right) -% \hat{f}\left( dx,t\right) )-\int_{{\mathbb{R}}_*}\varphi \left( x,0\right) (f_{0}\left( dx\right) -\hat{f}_{0}\left( dx\right) ) \notag \\ &=&\int_{0}^{t}ds\int_{{\mathbb{R}}_*}(f\left( dx,t\right) -\hat{f}\left( dx,t\right) )\left( \dot{\varphi} \left( x,s\right) +\mathcal{L}\left[ \varphi \right] \left( x,s\right) \right) \label{SymmEq} \end{eqnarray} where% \begin{equation*} \mathcal{L}\left[ \varphi \right] \left( x,s\right) =\frac{1}{2}\int_{{% \mathbb{R}}_*}K\left( x,y\right) \left[ \varphi \left( x+y,s\right) \zeta _{R_{\ast }}\left( x+y\right) -\varphi \left( x,s\right) -\varphi \left( y,s\right) \right] (f\left( dy,s\right) +\hat{f}\left( dy,s\right) ) \,. \end{equation*} For the derivation of (\ref{SymmEq}), we have used symmetry properties under the transformation $x\leftrightarrow y$: clearly, $K\left( x,y\right) % \left[ \varphi \left( x+y,s\right) \chi _{\left\{ x+y\leq R_{\ast }\right\} }\left( x,y\right) -\varphi \left( x,s\right) -\varphi \left( y,s\right) % \right] $ is then symmetric and $\left[ f\left( dx,s\right) \hat{f}\left( dy,s\right) -f\left( dy,s\right) \hat{f}\left( dx,s\right) \right] $ is antisymmetric, and hence their product integrates to zero. Consider then an arbitrary $\psi \in C_c\left( {\mathbb{R}}_*\right)$. We claim that there is a test function $\varphi \in C^{1}\left( \left[ 0,t\right] ,C_{c}\left( {% \mathbb{R}}_*\right) \right) $ such that% \begin{equation} \dot{\varphi} \left( x,s\right) +\mathcal{L}\left[ \varphi \right] \left( x,s\right) =0\ \ \text{for }0\leq s\leq t\, , \ { x\ge 1}\,, \quad \text{with\ \ }\varphi \left( \cdot ,t\right) =\psi \left( \cdot \right) . \label{AdjEqu} \end{equation} Given such a function $\varphi $, since $f$ and $\hat{f}$ have no support on $(0,1)$, equation (\ref{SymmEq}) implies \begin{equation}\label{eq:adjointsemigest} \int_{{\mathbb{R}}_*}\psi \left( x\right) (f\left( dx,t\right) -\hat{f}% \left( dx,t\right) )=\int_{{\mathbb{R}}_*}\varphi \left( x,0\right) (f_{0}\left( dx\right) -\hat{f}_{0}\left( dx\right) ) \,. \end{equation} Therefore, if such a function $\varphi $ exists for any $% \psi \in C_c\left( {\mathbb{R}}_*\right)$, we would find that the estimate at time $t$, $\left\vert \int_{{\mathbb{R}}_*}\psi \left( x\right) (f\left( dx,t\right) -\hat{f}\left( dx,t\right) )\right\vert $, will become arbitrarily small if the estimate at time $0$, $\left\vert \int_{[1, {2R_{\ast }}]}\varphi \left( x,0\right) (f_{0}\left( dx\right) -\hat{f}_{0}\left( dx\right) )\right\vert $, is made sufficiently small. In particular, this property can be used to prove that for every $f(t)=S(t)f_0$ in a $\ast -$weak open set $U$ one can find a $\ast -$weak open neighbourhood $V$ of $f_0$ such that for any $\hat{f}_{0}\in V$ one has $S(t)\hat{f}_{0} \in U$. Hence, the $\ast -$weak continuity of $% S\left( t\right) $ would then follow. { In order to conclude the proof of the continuity of $S(t)$ in the $\ast -$% weak topology it only remains to prove the existence of $\varphi \in C^{1}\left( \left[ 0,t\right] ,C_{c}\left( {\mathbb{R}}_*\right) \right) $ satisfying (\ref{AdjEqu}) for a fixed $% \psi \in C_c\left( {\mathbb{R}}_*\right)$. First, let us choose $a\in (0,1)$ and $b\ge 4R_{\ast }$ so that the support of $\psi$ is contained in $I_0:=[a,b]$. We now construct $\varphi$ as a solution to an evolution equation in the Banach space $Y:=\defset{h\in C({\mathbb R}_*)}{h(x)=0\text{ if }x\le a\text{ or }x\ge b}$ which is a closed subspace of $C_0({\mathbb R}_*)$. More precisely, we now look for solutions $\varphi\in \tilde{X}:= C([0,t],Y)$, endowed with the weighted norm $\norm{\varphi}_M := \sup_{x\in {\mathbb R}_*,\, s\in [0,t]}|\varphi(x,s)| {\rm e}^{M (s-t)}$. The parameter $M>0$ is chosen sufficiently large, as explained later. Clearly, $\psi\in Y$. To regularize the small values of $x$, we choose a function $\phi_a\in C({\mathbb R}_*)$ such that $0\le \phi_a\le 1$, $\phi_a(x)=0$ if $x\le a$, and $\phi_a(x)=1$ if $x\ge 1$, and then define \[ \tilde{\mathcal{L}}[\varphi](x,s) := \phi_a(x) \mathcal{L}[\varphi](x,s)\,,\quad x>0\,,\ 0\le s\le t\,. \] Now, if $\varphi\in\tilde{X}$, we have $\tilde{\mathcal{L}}[\varphi](x,s)=0$ both if $x\le a$ (due to the factor $\phi_a$) and if $x\ge b$, since $K(x,y)=0$ if $x\ge b \ge 4 R_*$. In addition, the assumptions guarantee that $x\mapsto \mathcal{L}[\varphi](x,s)$ is continuous, so we find that $ \tilde{\mathcal{L}}[\varphi](x,s)\in Y$ for any fixed $s$. We look for solutions $\varphi$ as fixed points satisfying $\varphi=\mathcal{A}[\varphi]$, where \[ \mathcal{A}[\varphi](x,s) := \psi(x) + \int_s^t \tilde{\mathcal{L}}[\varphi](x,s') ds'\,, \quad x>0\,,\ 0\le s\le t\,. \] A straightforward computation, using the uniform bounds of total variation norms of $f$ and $\hat{f}$, shows that $\mathcal{A}$ is a map from $\tilde{X}$ to itself. In addition, since \[ |\mathcal{A}[\varphi_1](x,s)-\mathcal{A}[\varphi_2](x,s)| \le \frac{3a_2}{2} \left(\norm{f}_t+\norm{\hat{f}}_t \right) \norm{\varphi_1-\varphi_2}_{M} \int_s^t {\rm e}^{-M(s'-t)} ds'\,, \] we find that $\mathcal{A}$ is also a contraction if we fix $M$ so that $M> \frac{3a_2}{2} \left(\norm{f}_t+\norm{\hat{f}}_t \right)$. Thus by the Banach fixed point theorem, there is a unique $\varphi\in \tilde{X}$ such that $\varphi=\mathcal{A}[\varphi]$. This choice satisfies (\ref{AdjEqu}), at least for $x\ge 1$, and hence completes the proof of continuity of $S(t)$. } We next prove that also $t\mapsto S\left( t\right) f_{0}$ is continuous in the $\ast -$weak topology. Let $t_{1},t_{2}\in \left[ 0,T% \right] $ with $t_{1}<t_{2}.$ Let $\varphi \in C_{c}\left( {\mathbb{R}}% _*\right) .$ Using (\ref{eq:EvolWeakInt}) we obtain:% \begin{eqnarray*} &&\int_{{{\mathbb{R}}_*}}\varphi \left( x\right) \left[ f\left( dx,t_{2}\right) -f\left( dx,t_{1}\right) \right] \\ &=&\frac{1}{2}\int_{t_{1}}^{t_{2}}ds\int_{{{\mathbb{R}}_*}}\int_{{{\mathbb{% R}}_*}}K\left( x,y\right) \left[ \varphi \left( x+y\right) \zeta _{R_{\ast }}\left( x+y\right) -\varphi \left( x\right) -\varphi \left( y\right) \right] f\left( dx,s\right) f\left( dy,s\right) \\ &&+\int_{t_{1}}^{t_{2}}ds\int_{{{\mathbb{R}}_*}}\varphi \left( x\right) \eta \left( dx\right) . \end{eqnarray*}% Thus using the bound $\left\Vert f\right\Vert _{T}<\infty$ we obtain% \begin{equation}\label{eq:timeweakstar} \left\vert \int_{{{\mathbb{R}}_*}}\varphi \left( x\right) \left[ f\left( dx,t_{2}\right) -f\left( dx,t_{1}\right) \right] \right\vert \leq C \left( t_{2}-t_{1}\right)\norm{\varphi}\,, \end{equation} where the constant $C$ does not depend on $t_1$, $t_2$ or $\varphi$. Therefore, the mapping $t\mapsto S\left( t\right) f_{0}$ is continuous in the $\ast -$weak topology. We can now conclude the proof of Proposition \ref{thm:existence_truncated}. As proven above, for any fixed $t$, the operator $S(t):\mathcal{U}_{M}\rightarrow \mathcal{U}_{M}$ is continuous and $\mathcal{U}_{M}$ is convex and compact when endowed with the $\ast -$weak topology. Using Schauder fixed point theorem, for all $% \delta >0$, there exists a fixed point $\hat{f}_{\delta }$ of $S(\delta )$ in $\mathcal{U}_{M}$. { In addition, $\mathcal{U}_{M}$ is metrizable and hence sequentially compact. As shown in \cite[Theorem 1.2]{EM05}, these properties imply that there is $\hat{f}$ such that $S(t)\hat{f} = \hat{f}$ for all $t$. Thus $\hat{f}$ is a stationary injection solution to \eqref{evolEqTrunc}. } \end{proof} \bigskip We now prove Theorem \ref{thm:existence}. \begin{proofof}[Proof of Theorem~\ref{thm:existence} (existence)] Given a kernel $K(x,y)$ satisfying \eqref{eq:cond_kernel2}, \eqref{eq:cond_kernel3}, it can be rewritten as \begin{equation} K\left( x,y\right) =\left( x+y\right) ^{\gamma}\Phi\left( \frac{x}% {x+y},x\right) \label{B1in3}% \end{equation} where \begin{equation}\label{eq:B1bound} \frac{C_{1}}{s^{p} \left( 1-s\right) ^{p}} \leq \Phi\left( s,x\right) \leq \frac{C_{2}}{s^{p}\left( 1-s\right) ^{p}},\quad {(s,x)\in(0,1)\times {\mathbb R}_{\ast}} \end{equation} with $p=\max\left\{ \lambda,-\left( \gamma+\lambda\right) \right\} $ and the constants $C_1>0$, $C_2<\infty$ independent of $x$. Notice that the dependence of the function $\Phi$ on $x$ is due to the fact that we are not assuming the kernel $K(x,y)$ to be an homogeneous function. By definition of $p$, we have $\gamma + 2 p =|\gamma+2\lambda|\ge 0$, and thus always $p \geq -\frac{\gamma}{2}$. On the other hand, by assumption, $|\gamma+2\lambda|<1$, and thus also $p<\frac{1-\gamma}{2}$. Reciprocally, we observe that kernels with the form \eqref{B1in3} satisfying \eqref{eq:B1bound} with $p \geq -\frac{\gamma}{2}$ satisfy also \eqref{eq:cond_kernel2}, \eqref{eq:cond_kernel3} . We use two levels of truncations. First, given $\varepsilon$ with $0<\varepsilon<1$ we define % \begin{equation} K_{\varepsilon}\left( x,y\right) =\min\left\{ \left( x+y\right) ^{\gamma },\frac{1}{\varepsilon}\right\} \Phi_{\varepsilon}\left( \frac{x}% {x+y}, x\right) +\varepsilon\,, \label{eq:1levTrunc} \end{equation} where $\Phi_\varepsilon$ is smooth, non-negative, and bounded by $\frac{A}{\varepsilon^{\sigma}}$ everywhere, and satisfies \begin{equation} \Phi_{\varepsilon}\left( s, x\right) = \begin{cases} \Phi\left( s, x\right) \,, & \text{if\ \ }\Phi\left( s, x\right) \leq\frac {A}{\varepsilon^{\sigma}}\,,\\ 0\,, & \text{if\ \ }\Phi\left( s, x\right) \geq\frac{2A}{\varepsilon^{\sigma}}\,.% \end{cases} \label{B3in3}% \end{equation} Here $A$ is a large constant independent of $\varepsilon$; we take $A=1$ when $\Phi$ is unbounded, and assume it sufficiently large in a way that will be seen in the proof if $\Phi$ is bounded. Concerning $\sigma$ we take $\sigma=0$ if $p\leq 0$ for any $\gamma$, $\sigma>0$ arbitrary small if $p>0$ and $\gamma\leq 0$ and $0< \sigma <\frac p \gamma$ if $p>0$ and $\gamma >0$. We then have% \begin{equation} 0\leq\Phi_{\varepsilon}\left( s, x\right) \leq C_{2}\min\left\{ \frac {1}{s^{\lambda}}\frac{1}{\left( 1-s\right) ^{\lambda}}+s^{\gamma+\lambda }\left( 1-s\right) ^{\gamma+\lambda},\frac{A}{C_{2}\varepsilon^{\sigma}}\right\}\,. \label{B2in3}% \end{equation} The second level of truncation is to define \begin{equation}\label{eq:2levTrunc} K_{\varepsilon,R_{\ast}}\left( x,y\right) =K_{\varepsilon}\left( x,y\right) \omega_{R_{\ast}}\left( x,y\right), \end{equation} where $\omega_{R_{\ast}}\in C^{\infty}_{0}({\mathbb R}^2_{+})$, $0\le \omega_{R_*}\le 1$, and \begin{equation*} \omega_{R_{\ast}}(x,y) = \begin{cases} 1\,, &\text{if\ \ } (x,y)\in [0,2R_{\ast} ]^2\,, \\ 0\,, &\text{if\ \ } x\geq 4 R_{\ast} \text{ or } y\geq 4R_{\ast} \,. \end{cases} \end{equation*} Notice that, if $\gamma\leq0$ the truncation in $\min\left\{ \left(x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} $ in \eqref{eq:1levTrunc} does not have any effect, because we are only interested in the region where $x\geq1$ and $y\geq1$, due to the fact that the solutions we construct satisfy $f((0,1))=0$. From Proposition~\ref{thm:existence_truncated}, to every $\varepsilon$ and $R_*$, there exists a stationary injection solution $f_{\varepsilon ,R_{\ast }}$ satisfying \begin{align} &\frac{1}{2}\int_{{{\mathbb{R}}_{*}}}\int_{{{\mathbb{R}}_{*}}}K_{\varepsilon ,R_{\ast }}\left( x,y\right) \left[ \varphi \left( x+y\right) \zeta _{R_{\ast }}\left( x+y\right) -\varphi \left( x\right) -\varphi \left( y\right) \right] f_{\varepsilon ,R_{\ast }}\left( dx\right) f_{\varepsilon ,R_{\ast }}\left( dy\right) \notag \label{WeakTruncForm} \\ &+\int_{{{\mathbb{R}}_{*}}}\varphi \left( x\right) \eta \left( dx\right) =0\, , \end{align}% for any test function $\varphi \in {C}_{c}{({\mathbb{R}}_{*})}$. As in the proof of Lemma \ref{lem:flux} consider any $z,\delta>0$ and take $\chi_\delta \in C^\infty({\mathbb R}_+)$ satisfying $\chi_\delta (x) = 1$ if $x \leq z$, and $\chi_\delta(x) = 0$ if $x \geq z+\delta $. Then $\varphi(x) = x \chi_\delta(x) $ is a valid non-negative test function. Since $\zeta_{R_*}\le 1$, we may employ the inequality $\varphi \left( x+y\right) \zeta _{R_{\ast }}\left( x+y\right)\le \varphi \left( x+y\right)$ in (\ref{WeakTruncForm}), and conclude that for these test functions \begin{align*} &\frac{1}{2}\int_{{{\mathbb{R}}_{*}}}\int_{{{\mathbb{R}}_{*}}}K_{\varepsilon ,R_{\ast }}\left( x,y\right) \left[ \varphi \left( x+y\right) -\varphi \left( x\right) -\varphi \left( y\right) \right] f_{\varepsilon ,R_{\ast }}\left( dx\right) f_{\varepsilon ,R_{\ast }}\left( dy\right) +\int_{{{\mathbb{R}}_{*}}}\varphi \left( x\right) \eta \left( dx\right) \ge 0\,. \end{align*}% Using the equalities derived in the proof of Lemma \ref{lem:flux} and taking $\delta\to 0$ then proves that \begin{equation} \int_{\left( 0,z\right] }\int_{( z-x,\infty ) }K_{\varepsilon ,R_{\ast }}\left( x,y\right) xf_{\varepsilon ,R_{\ast }}\left( dx\right) f_{\varepsilon ,R_{\ast }}\left( dy\right) \le \int_{(0,z]}x\eta \left( dx\right)\,, \quad \text{for }z>0\, . \label{eq:CurrentboundRstar} \end{equation} A lower bound for the left hand-side and an upper bound for the right hand-side of (\ref{eq:CurrentboundRstar}), both independent of $R_{\ast }$, are computed next. Since $\supp% \eta \subset \lbrack 1,L_\eta]$ and $\int \eta $ is{\ bounded}, then \begin{equation} \int_{(0,z]} x\eta \left( dx\right) \leq \int_{[1,L_\eta]} x\eta \left( dx\right) =:c, \label{eq:bound_eta} \end{equation}% where $c$ is a constant independent of $R_{\ast }$ and $c$ is bounded by $L_{\eta} \vert|\eta\vert|$. On the other hand we have $K_{\varepsilon ,R_{\ast }}\left( x,y\right) \geq \varepsilon >0$ for $\left( x,y\right) \in \left[ 1,2 R_{\ast }\right] ^{2}.$ Then,% \begin{equation*} \varepsilon \int_{\left( 0,z\right] }\int_{(z-x,2 R_{\ast }] }xf_{\varepsilon ,R_{\ast }}\left( dx\right) f_{\varepsilon ,R_{\ast }}\left( dy\right) \leq c\quad \text{if }0<z\le 2 R_*\, . \end{equation*} Using that here \begin{equation*} [2z/3,z]^{2}\subset \left\{ \left( x,y\right) \in \mathbb{R}_{+}^{2}:0< x\leq z,\ z-x< y\leq 2 R_* \right\} \, , \end{equation*} we obtain \begin{equation*} \varepsilon \iint_{[2z/3,z]^{2}}xf_{\varepsilon ,R_{\ast }}(dx)f_{\varepsilon ,R_{\ast }}(dy)\leq c\quad \text{if }0<z\le 2 R_*\, . \end{equation*}% Since $x\geq 2z/3$ in the domain of integration, we obtain \begin{equation*} 2z/3 \left( \int_{[2z/3,z]}f_{\varepsilon ,R_{\ast }}(dx)\right) ^{2}\leq \frac{c}{\varepsilon}, \end{equation*}% which implies that \begin{equation} \frac{1}{z}\int_{[2z/3,z]}f_{\varepsilon ,R_{\ast }}(dx)\leq \frac{C_{\varepsilon }}{z^{3/2}},\ \ \ 0< z\leq 2 R_{\ast }, \end{equation} where $C_{\varepsilon }$ is a numerical constant depending on $\varepsilon $ but independent of $R_{\ast }$. Since the right hand side is integrable on $[1,2R_{\ast }]$, Lemma~\ref{lem:bound} may be employed to obtain a bound \begin{equation} \int_{[1,2 R_*]}f_{\varepsilon ,R_{\ast }}(dx)\leq \frac{2 C_\varepsilon}{\ln(3/2)} + C_\varepsilon \frac{1}{\sqrt{2 R_{\ast }}}\,. \label{EstTruncFunctionsmallz} \end{equation} Since the support of $f_{\varepsilon ,R_{\ast }}$ lies in $[1,2 R_{\ast }]$ we find that for all $R_{\ast }\ge 1$ \begin{equation} \int_{{\mathbb R}_*}f_{\varepsilon ,R_{\ast }}(dx)\leq \bar C_{\varepsilon }\,, \label{EstTruncFunction} \end{equation} where $\bar C_{\varepsilon }$ is a constant independent of $R_{\ast }$. Following the same argument for arbitrary lower limit $y\ge 1$, we also obtain a decay bound \begin{equation} \int_{[y,\infty)}f_{\varepsilon ,R_{\ast }}(dx)\leq \bar C_{\varepsilon } y^{-\frac{1}{2}}\,. \label{EstTruncFunctiondecay} \end{equation} Thus, estimate (\ref{EstTruncFunction}) implies that for each $\varepsilon$ the family of solutions $\{f_{\varepsilon ,R_{\ast }}\}_{R_{\ast }\ge 1}$ is contained in a closed unit ball of $\mathcal{M}_{+,b}\left( \mathbb{R}_*\right) $. This is a sequentially compact set in the $\ast -$weak topology, and thus by taking a subsequence if needed, we can find $f_{\varepsilon }\in \mathcal{M}_{+,b}\left( \mathbb{R}_*\right) $ such that $f_{\varepsilon }\left( \left( 0,1\right) \right) =0$ and% \begin{equation} f_{\varepsilon ,R_{\ast }^{n}}\rightharpoonup f_{\varepsilon }\text{ as }% n\rightarrow \infty \text{ in the }\ast -\text{weak topology} \label{fWeakLimit} \end{equation}% with $R_{\ast }^{n}\rightarrow \infty $ as $n\rightarrow \infty$. Note that then we can use the earlier ``step-like'' test-functions and the bounds (\ref{EstTruncFunction}) and (\ref{EstTruncFunctiondecay}) to conclude that also the limit functions satisfy similar estimates, namely, \begin{equation} \int_{\left( 0,\infty \right) }f_{\varepsilon }(dx)\leq \bar C_{\varepsilon }\,, \qquad \int_{\left[ y,\infty \right) }f_{\varepsilon }(dx)\leq \bar C_{\varepsilon }y^{-\frac{1}{2}}\,, \quad \text{if } y\ge 1\,. \label{fBound} \end{equation}% Consider next a fixed test function $\varphi \in C_{c}({\mathbb R}_*)$. Now for all large enough values of $n$, we have $\varphi \left( x+y\right) \zeta _{R^n_{\ast }}\left( x+y\right) =\varphi \left( x+y\right)$ everywhere, since the support of $\varphi$ is bounded. We claim that as $n\to \infty$, the limit of (\ref{WeakTruncForm}) is given by \begin{equation} \frac 1 2\int_{{\mathbb R}_*^{2}}K_{\varepsilon }\left( x,y\right) [\varphi (x+y)-\varphi (x)-\varphi (y)]f_{\varepsilon }\left( dx\right) f_{\varepsilon }\left( dy\right) +\int_{{\mathbb R}_*}\varphi (x)\eta \left( dx\right) =0. \label{WeakFormEps} \end{equation} Since $f_{\varepsilon ,R_{\ast }^{n}}$ has support in $[1,2 R_{\ast }]$, it follows that we may always replace $K_{\varepsilon,R_{\ast }}(x,y)$ in (\ref{WeakTruncForm}) by $K_{\varepsilon }(x,y)$ without altering the value of the integral. By the above observations, it suffices to show that \begin{equation} \lim_{n\to \infty}\int_{{\mathbb R}_*^{2}}\phi( x,y) \mu_n(dx)\mu_n(dy) = \int_{{\mathbb R}_*^{2}}\phi( x,y) f_{\varepsilon }\left( dx\right) f_{\varepsilon }\left( dy\right)\, , \label{eq:stongereps} \end{equation} for $\mu_n(dx):=f_{\varepsilon ,R^n_{\ast }}\left( dx\right)$ and \[ \phi( x,y) := K_{\varepsilon }\left( x,y\right) [\varphi (x+y)-\varphi (x)-\varphi (y)]\,. \] Note that although $\phi\in C_b({\mathbb R}_*^2)$, it typically would not have compact support. However, the earlier tail estimates suffice to control the large values of $x,y$, as we show in detail next. We prove (\ref{eq:stongereps}) by showing that every subsequence has a subsequence such that the limit holds. For notational convenience, let $\mu_n$ denote the first subsequence and consider an arbitrary $\varepsilon'>0$. We first regularize the support of $\phi$ by choosing a function $g:{\mathbb R}_+\to [0,1]$ which is continuous and for which $g(r)=1$, for $r\le 1$, and $g(r)=0$, for $r\ge 2$. We set $\phi_M(x,y) := g\left(\frac{x}{M}\right) g\left(\frac{y}{M}\right)g\left(\frac{1}{M x}\right) g\left(\frac{1}{M y}\right)\phi(x,y)$. Then for every $M$, we have $\phi_M\in C_c({\mathbb R}_*^2)$ and thus it is uniformly continuous. By (\ref{fBound}), we may use dominated convergence theorem to conclude that $\int \phi_M(x,y)f_{\varepsilon }\left( dx\right) f_{\varepsilon }\left( dy\right)\to \int \phi(x,y)f_{\varepsilon }\left( dx\right) f_{\varepsilon }\left( dy\right)$ as $M\to \infty$. Thus for all sufficiently large $M$, we have $\left|\int \phi_M(x,y)f_{\varepsilon }\left( dx\right) f_{\varepsilon }\left( dy\right)- \int \phi(x,y)f_{\varepsilon }\left( dx\right) f_{\varepsilon }\left( dy\right)\right|<\varepsilon'$. On the other hand, by the decay bound in (\ref{EstTruncFunctiondecay}) we can find a constant $C$ which does not depend on $R_\ast$ and for which $\left|\int \phi_M(x,y)\mu_n(dx)\mu_n(dy)-\int \phi(x,y)\mu_n(dx)\mu_n(dy)\right|\le C M^{-\frac{1}{2}}$. We fix $M=M(\varepsilon')$ to be a value such that also this second bound is less than $\varepsilon'$ for all $n$. { In order to conclude the proof of (\ref{eq:stongereps}) it only remains to show that $\int\phi_{M}\left( x,y\right) \mu_{n}\left( dx\right) \mu_{n}\left( dy\right) $ converges to $\int\phi_{M}\left( x,y\right) f_{\varepsilon }\left( dx\right) f_{\varepsilon}\left( dy\right) $ as $n\rightarrow \infty.$ This is just a consequence of the fact that the convergence $\mu _{n}\left( dx\right) \rightharpoonup f_{\varepsilon}\left( dx\right) $ as $n\rightarrow\infty$ in the $\ast-$weak topology of the space $\mathcal{M}% _{+,b}\left( \left[ \frac{1}{2M},2M\right] \right) $ implies the convergence $\mu_{n}\left( dx\right) \mu_{n}\left( dy\right) \rightharpoonup f_{\varepsilon}\left( dx\right) f_{\varepsilon}\left( dy\right) $ as $n\rightarrow\infty$ in the $\ast-$weak topology of the space $\mathcal{M}_{+,b}\left( \left[ \frac{1}{2M},2M\right] ^{2}\right) .$ This result can be found for instance in \cite{Billings}, Theorem 3.2 for probability measures, which implies the result for arbitrary measures using simple rescaling arguments. } Since $f_\varepsilon$ is then a stationary solution to (\ref{eq:time_evol}) with $K=K_{\varepsilon}$, we can apply Lemma \ref{lem:flux} directly, and conclude that \begin{equation} \int_{\left(0,z\right] }xf_{\varepsilon }\left( dx\right) \int_{( z-x,\infty ) }K_{\varepsilon }\left( x,y\right) f_{\varepsilon }\left( dy\right) \leq c\quad \text{if }z>0\, , \label{FluxEstEps} \end{equation}% where $c$ is defined in~\eqref{eq:bound_eta} and is independent of $\varepsilon$. We now observe that (\ref{eq:B1bound}) and (\ref{eq:1levTrunc})-(\ref{B3in3}) imply for all sufficiently small $\varepsilon$ \begin{equation*} K_{\varepsilon }(x,y)\geq \varepsilon+C_{0}\min\{z^{\gamma},\frac{1}{\varepsilon}\} \quad \text{for}\ \ (x,y)\in \left[ \frac{z}{2},z\right]^2 \end{equation*} where $C_{0}>0$ is independent of $\varepsilon$ and we used that $\frac{x}{x+y}\in \left[\frac 1 3, \frac 2 3\right]$. Combining this estimate with (\ref{FluxEstEps}) as well as the fact that \begin{equation*} [2z/3,z]^{2}\subset \left\{ \left( x,y\right) \in \mathbb{R}_{+}^{2}:0< x\leq z,\ z-x< y<\infty \right\} \ \end{equation*} we obtain \begin{equation*} \left( \varepsilon+C_{0}\min\{z^{\gamma},\frac{1}{\varepsilon}\} \right) \frac{2}{3} z \left( \int_{[2z/3,z]}f_{\varepsilon }(dx)\right) ^{2}\leq c\quad \text{for all }z\in (0,\infty ). \end{equation*} Therefore, we obtain the following estimates for the measures $f_{\varepsilon}\left( dx\right) $: \begin{equation} \frac{1}{z}\int_{\left[ \frac{2z}{3},z\right] }f_{\varepsilon}\left( dx\right) \leq\frac{\tilde{C}}{z^{\frac{3}{2}}}\left( \frac{1}{\min\left( z^{\gamma},\frac{1}{\varepsilon}\right) }\right) ^{\frac{1}{2}}, \label{A1} \end{equation} \begin{equation} \frac{1}{z}\int_{\left[ \frac{2z}{3},z\right] }f_{\varepsilon}\left( dx\right) \leq\frac{\tilde{C}}{z^{\frac{3}{2}}\sqrt{\varepsilon}}, \label{A2} \end{equation} where $\tilde{C}$ is independent of $\varepsilon$. Consider first the case $\gamma\le 0$ and recall that then $p\ge 0$ and $z^\gamma \le 1$ for $z\ge 1$. Since $f_\varepsilon((0,1))=0$, then the bound (\ref{A1}) implies that for all $z\ge 1$ we have \begin{equation} \frac{1}{z}\int_{\left[ \frac{2z}{3},z\right] } x^{\gamma+p}f_{\varepsilon}\left( dx\right) \leq C z^{\frac{\gamma+2p-3}{2}}\,. \label{A1upgrade} \end{equation} Since $\gamma+2 p <1$, Lemma \ref{lem:bound} implies then that for all $y\ge 1$, \begin{equation} \int_{[y,\infty) } x^{\gamma+p}f_{\varepsilon}\left( dx\right) \leq C y^{-\frac{1-\gamma-2p}{2}}\, \label{A1upbound} \end{equation} where the constant $C$ does not depend on $\varepsilon$. In particular, then the measures $x^{\gamma+p} f_{\varepsilon}\left( dx\right)$ belong to a $\ast$-weak compact set, and there exist $F\in \mathcal{M}_{+,b}\left( \mathbb{R}_{*}\right) $ such that% \begin{equation} x^{\gamma+p} f_{\varepsilon_n}\left(dx\right) \rightharpoonup F\left(dx\right)\text{ as }n\rightarrow \infty \text{ in the }\ast -\text{weak topology} \label{fepsWeakLimitneggamma} \end{equation}% for some sequence $( \varepsilon _{n}) _{n\in \mathbb{N}}$ with $\lim_{n\rightarrow \infty }\varepsilon _{n}=0$. We denote $f\left(dx\right)= x^{-\gamma-p} F\left(dx\right)$, and then $f \in \mathcal{M}_{+}\left( \mathbb{R}_{*}\right) $. In addition, $f((0,1))=0$ and it satisfies the tail estimate \begin{equation} \int_{[y,\infty) } x^{\gamma+p}f\left(dx\right) = \int_{[y,\infty) } F\left(dx\right) \leq C y^{-\frac{1-\gamma-2p}{2}}\,, \quad y\ge 1\,. \label{ftailboundneggamma} \end{equation} It remains to consider the case $\gamma >0$. Then (\ref{A1}) implies that \begin{align} & \frac{1}{z}\int_{\left[ \frac{2z}{3},z\right] }f_{\varepsilon}\left( dx\right) \leq \tilde{C} z^{-\frac{(\gamma+3)}{2}} \,, \quad 1\le z\le \varepsilon^{-\frac{1}{\gamma}}\,, \label{eq:fvepbounda} \\ &\frac{1}{z}\int_{\left[ \frac{2z}{3},z\right] }f_{\varepsilon}\left( dx\right) \leq \frac{\tilde{C} \sqrt{\varepsilon}}{z^{\frac{3}{2}}}\,,\quad z> \varepsilon^{-\frac{1}{\gamma}}\,. \end{align} Using these bounds in item \ref{it:Risinf} of Lemma \ref{lem:bound} implies then that for all $y\ge 1$, \begin{equation} \int_{[y,\infty) } f_{\varepsilon}\left( dx\right) \leq C \left( y^{-\frac{1+\gamma}{2}}+ \left(\frac{\varepsilon}{y}\right)^{\frac{1}{2}}\right)\, \label{A1upgradeposgamma} \end{equation} where the constant $C$ does not depend on $\varepsilon$. Hence, in this case the family of measures $\left\{ f_{\varepsilon }\right\} _{\varepsilon >0}$ is contained in a $\ast$-weak compact set in $\mathcal{M}_{+,b}\left( \mathbb{R}_{*}\right)$. Therefore, there exists $f\in \mathcal{M}_{+,b}\left( \mathbb{R}_{*}\right) $ such that% \begin{equation} f_{\varepsilon _{n}}\rightharpoonup f\text{ as }n\rightarrow \infty \text{ in the }\ast -\text{weak topology} \label{fepsWeakLimit} \end{equation}% for some sequence $\left( \varepsilon _{n}\right) _{n\in \mathbb{N}}$ with $\lim_{n\rightarrow \infty }\varepsilon _{n}=0.$ {To obtain better tail bounds for the limit measure, let us first observe that by (\ref{eq:fvepbounda}), there is a constant $C$ such that for all $\varepsilon$ \[ \frac{1}{z}\int_{\left[ \frac{2z}{3},z\right] } x^{\gamma+p}f_{\varepsilon}\left( dx\right) \leq C z^{\frac{\gamma+2p-1}{2}-1}\,, \quad 1\le z\le \varepsilon^{-\frac{1}{\gamma}}\,. \] Therefore, applying item \ref{it:polcase} of Lemma \ref{lem:bound} with $r=\frac{1}{2}$, and using the assumption $\gamma+2 p <1$, we can adjust the constant $C$ so that \begin{align}\label{eq:fvepafinbound} \int_{[a,\varepsilon^{-\frac{1}{\gamma}}] } x^{\gamma+p}f_{\varepsilon}\left( dx\right) \leq C a^{-\frac{1-(\gamma+2p)}{2}}\,, \quad 1\le a\le \frac{1}{2}\varepsilon^{-\frac{1}{\gamma}}\,. \end{align} Let then $y,R\ge 1$ be such that $y<R$ but they are otherwise arbitrary. We choose a test function $\varphi\in C_c({\mathbb R}_*)$, such that $0\leq \varphi \leq 1$, $\varphi(x)=1$ for $y\leq x\leq R$, and $\varphi(x)=0$ for $x\geq 2R$ and for $x\le \frac{1}{2} y$. Then, if also $\varepsilon\le (2R)^{-\gamma}$, we have \[ \int_{{\mathbb R}_*}\varphi(x) x^{\gamma+p}f_{\varepsilon}\left( dx\right) \le \int_{[\frac{1}{2}y,2R]} x^{\gamma+p}f_{\varepsilon}\left(dx\right) \le C 2^{\frac{1-(\gamma+2p)}{2}}y^{-\frac{1-(\gamma+2p)}{2}} \,, \] where for values $y\le 2$ the estimate follows by using $f_{\varepsilon}((0,1))=0$ and then $a=1$ in (\ref{eq:fvepafinbound}). Applying this with $\varepsilon=\varepsilon_n$ and then taking $n\to\infty$ proves that \[ \int_{[y,R]} x^{\gamma+p}f\left(dx\right) \le \int_{{\mathbb R}_*}\varphi(x) x^{\gamma+p}f\left( dx\right) \le C 2^{\frac{1-(\gamma+2p)}{2}}y^{-\frac{1-(\gamma+2p)}{2}} \,. \] Here we may take $R\to \infty$, and using monotone convergence theorem we can conclude that $f$ satisfies a tail estimate identical to the earlier case with $\gamma\le 0$, namely, also for $\gamma>0$ we can find a constant $C$ such that \begin{equation} \int_{[y,\infty) } x^{\gamma+p}f\left(dx\right) \leq C y^{-\frac{1-\gamma-2p}{2}}\,, \quad y\ge 1\,. \label{ftailboundposgamma} \end{equation} } It only remains to take the limit $\varepsilon _{n}\rightarrow 0$ in (\ref% {WeakFormEps}). Suppose that $\varphi \in C_{c}\left( \mathbb{R}_{*}\right) . $ Then, in the term containing $\varphi (x+y)$ we have that the integrand is different from zero only in a bounded region. Using then that for any $q\in {\mathbb R}$ we have $ \lim_{\varepsilon \rightarrow 0} (x y)^{q} K_{\varepsilon }\left( x,y\right) = (x y)^{q} K\left( x,y\right) $ uniformly in compact subsets of ${\mathbb R}_*$, as well as \eqref{fepsWeakLimitneggamma} and (\ref{fepsWeakLimit}), we obtain that the limit of that term is% \begin{equation*} \int_{(0,\infty )^{2}}K\left( x,y\right) \varphi (x+y)f\left( dx\right) f\left( dy\right). \end{equation*} The terms containing $\varphi \left( x\right) $ or $\varphi \left( y\right) $ can be treated analogously due to the symmetry under the transformation $% x\leftrightarrow y.$ We then consider the limit of the term containing $% \varphi \left( x\right) $ where $\varphi \in C_{c}\left( \mathbb{R}_{*}\right) .$ Our goal is to show that the contribution to the integral due to regions $\{y\geq M\}$ where $M$ is very large, can be made arbitrarily small as $M\to\infty$, uniformly in $\varepsilon.$ Suppose that $M$ is chosen sufficiently large, so that the support of $\varphi$ is contained in $\left( 0,M\right) $. We then have the following identity: \begin{align*} & \int_{\mathbb{R}_{*}^{2}\cap\left\{ y\geq M\right\} }K_{\varepsilon }\left( x,y\right) \varphi\left( x\right) f_{\varepsilon}\left( dx\right) f_{\varepsilon}\left( dy\right) \\ & =\int_{\mathbb{R}_{*}^{2}\cap\left\{ y\geq M\right\} }\left[ \min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} \Phi _{\varepsilon}\left( \frac{x}{x+y}, x\right) +\varepsilon\right] \varphi\left( x\right) f_{\varepsilon}\left( dx\right) f_{\varepsilon }\left( dy\right) \, . \end{align*} Given that only values with $x\geq 1$ may contribute, and $x$ is in a bounded region contained in $\left[ 1,M\right] $, we obtain, using \eqref{A1}, an estimate \begin{align} & \int_{\mathbb{R}_{*}^{2}\cap\left\{ y\geq M\right\} }K_{\varepsilon }\left( x,y\right) \varphi\left( x\right) f_{\varepsilon}\left( dx\right) f_{\varepsilon}\left( dy\right) \nonumber \\ & \quad \leq C \sup_{x\in \supp \varphi} \int_{\left\{ y\geq M\right\} } \min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} \Phi _{\varepsilon}\left( \frac{x}{x+y}, x\right) f_{\varepsilon }\left( dy\right) +C\varepsilon\int_{\left\{ y\geq M\right\} }f_{\varepsilon}\left( dy\right)\,. \label{eq:EstA3} \end{align} Using (\ref{A2}) we can bound the second term uniformly, \[ C\varepsilon\int_{\left\{ y\geq M\right\} }f_{\varepsilon}\left( dy\right) \leq C\sqrt{\varepsilon}\int_{\left\{ y\geq M\right\} }\frac {dy}{y^{\frac{3}{2}}}\leq\frac{C\sqrt{\varepsilon}}{M^{\frac{1}{2}}}\,,% \] where the constant $C$ is always independent of $\varepsilon$, although it might need to be adjusted at each inequality. Therefore, the second term on the right hand side of \eqref{eq:EstA3} tends to zero as $\varepsilon\rightarrow0.$ In order to estimate the first term we need to consider separately different ranges of the values of the exponents $p$ and $\gamma$. We claim that for $1\leq x \leq C_0 \leq M,$ $y\geq M$, where $\supp \varphi \subset [0,C_0]$, the following estimates hold for some constants $C$, $C_*>0$ which do not depend on $\varepsilon$: \begin{enumerate} \item If $\gamma\leq0$ and $p\leq0$ we have \begin{equation} \min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} \Phi_{\varepsilon}\left( \frac{x}{x+y}, x\right) \leq C \, . \label{C1}% \end{equation} \item If $\gamma>0$ and $p\leq0$ we have \begin{align} & \min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} \Phi_{\varepsilon}\left( \frac{x}{x+y}, x\right) \nonumber \\ & \quad \leq C\left( y^{\gamma +\lambda}+y^{-\lambda}\right) \chi_{\left\{ y\le \left( \frac {1}{\varepsilon}\right) ^{\frac{1}{\gamma}}\right\} }+\frac{C}{\varepsilon }\left( y^{\lambda}+y^{-\gamma-\lambda}\right) \chi_{\left\{ y>\left( \frac{1}{\varepsilon}\right) ^{\frac{1}{\gamma}}\right\} }\, , \label{C2 \end{align} where $\chi_{U}$ is the characteristic function of the set $U.$ \item If $\gamma\leq0$ and $p>0$ we have \begin{equation} \min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} \Phi_{\varepsilon}\left( \frac{x}{x+y}, x\right) \leq C\left( y^{\gamma +\lambda}+y^{-\lambda}\right) \chi_{\left\{ y\leq C_{\ast} \varepsilon ^{-\frac{\sigma}{p}}\right\} }\,. \label{C3}% \end{equation} \item If $\gamma>0$ and $p>0$ we have \begin{equation} \min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} \Phi_{\varepsilon}\left( \frac{x}{x+y}, x\right) \leq C\left( y^{\gamma +\lambda}+y^{-\lambda}\right) \chi_{\left\{ y\leq C_{\ast} \varepsilon ^{-\frac{\sigma}{p}}\right\} }\, . \label{C4}% \end{equation} \end{enumerate} \bigskip { In the case 1 we use the fact that, since $p\leq0,$ we have $\sigma=0.$ Then \eqref{B2in3} implies that $\Phi_{\varepsilon}\left( s,x\right) \leq C.$ On the other hand, using that $\gamma\leq0$ and $x\geq1,\ y\geq M$ we have $\min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\}\leq1$ whence \eqref{C1} follows. In the case 2, we use the fact that since $p\leq0$ we have $\sigma=0.$ Moreover, since $x\leq M$ and $y\geq M$ we have that $s=\frac{x}{x+y}\leq \frac{1}{2}.$ Given that $p=\max\left\{ \lambda,-\left( \gamma +\lambda\right) \right\} \leq0$ we have $\lambda\leq0,$ $\left( \gamma+\lambda\right) \geq0.$ Then \eqref{B2in3} implies that $\Phi_{\varepsilon }\left( s,x\right) \leq C\left( s^{\gamma+\lambda}+s^{-\lambda}\right) $. Using then that $y\leq\left( x+y\right) \leq2y$ as well as $1\leq x\leq C_{0}\leq M\leq y$ we obtain $\Phi_{\varepsilon}\left( s,x\right) \leq C\left( \frac{x^{\gamma+\lambda}}{\left( y\right) ^{\gamma+\lambda}}% +\frac{x^{-\lambda}}{\left( y\right) ^{-\lambda}}\right) \leq C\left( y^{\lambda}+y^{-\gamma-\lambda}\right) .$ On the other hand, in order to estimate $\min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon }\right\} $ we use the fact that since $1\leq x\leq C_{0}\leq M\leq y$ we have $\min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon }\right\} \leq C\min\left\{ y^{\gamma},\frac{1}{\varepsilon}\right\} .$ Considering separately the cases $y\leq\left( \frac{1}{\varepsilon}\right) ^{\frac{1}{\gamma}}$ and $y>\left( \frac{1}{\varepsilon}\right) ^{\frac {1}{\gamma}}$ we obtain $$\min\left\{ y^{\gamma},\frac{1}{\varepsilon }\right\} \leq C\left( y^{\gamma}\chi_{\left\{ y\leq\left( \frac {1}{\varepsilon}\right) ^{\frac{1}{\gamma}}\right\} }+\frac{1}{\varepsilon }\chi_{\left\{ y>\left( \frac{1}{\varepsilon}\right) ^{\frac{1}{\gamma} }\right\} }\right).$$ Multiplying the estimates obtained for $\Phi _{\varepsilon}\left( s,x\right) $ and $\min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} $ we derive \eqref{C2}. In the cases 3 and 4 we use the fact that, since $p>0$ we have $0<\sigma <\frac{p}{\gamma}.$ Using \eqref{B3in3} we obtain that $\Phi_{\varepsilon}\left( s,x\right) =0$ if $s\leq C \varepsilon ^{\frac{\sigma}{p}}.$ Using that $\frac{x}{2y}\leq s=\frac{x}{x+y}\leq\frac{x}{y}$ and that $1\leq x\leq C_{0}$ it follows that $\Phi_{\varepsilon}\left( s,x\right) =0$ for $y>C_{\ast} \left( \frac{1}{ \varepsilon}\right) ^{\frac{\sigma}{p}}$ for some $C_{\ast}>0.$ On the other hand \eqref{B3in3} as well as the fact that $s\leq\frac {1}{2}$ implies also that $\Phi_{\varepsilon}\left( s,x\right) \leq\frac {C}{s^{p}}.$ We then have% \begin{equation} \Phi_{\varepsilon}\left( s,x\right) \leq\frac{C}{s^{p}}\chi_{\left\{ y\leq C_{\ast} \left( \frac{1}{ \varepsilon}\right) ^{\frac{\sigma}{p}}\right\}\ . }\label{IntStep}% \end{equation} We now remark that in the case 3, since $\gamma\leq 0$ and $y\geq1$ we have $\left( x+y\right) ^{\gamma}\leq\frac{1}{\varepsilon}$ whence $\min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} =\left( x+y\right) ^{\gamma}\leq y^{\gamma}.$ Combining this inequality with (\ref{IntStep}) we then obtain \begin{equation} \Phi_{\varepsilon}\left( s,x\right) \min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} \leq\frac{C}{s^{p}}y^{\gamma}% \chi_{\left\{ y\leq C_{\ast} \left( \frac{1}{ \varepsilon}\right) ^{\frac{\sigma}{p}}\right\} }\ .\label{IntStep2}% \end{equation} In the case 4 we can derive a similar estimate. To this end we use the fact that since $\sigma<\frac{p}{\gamma}$ it follows, since $\gamma>0,$ that $\Phi_{\varepsilon}\left( s,x\right) =0$ if $y^{\gamma}\geq\frac {1}{\varepsilon}$ and $\varepsilon$ is sufficiently small, because then $y\geq\frac{1}{\varepsilon^{\frac{1}{\gamma}}}\geq C_{\ast} \left( \frac{1}{ \varepsilon}\right) ^{\frac{\sigma}{p}}.$ Then $\Phi_{\varepsilon}\left( s,x\right) \min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon }\right\} \leq C\Phi_{\varepsilon}\left( s,x\right) \min\left\{ y^{\gamma },\frac{1}{\varepsilon}\right\} \leq C\Phi_{\varepsilon}\left( s,x\right) y^{\gamma}\leq\frac{C}{s^{p}}y^{\gamma}\chi_{\left\{ y\leq C_{\ast} \left( \frac{1}{ \varepsilon}\right) ^{\frac{\sigma}{p}}\right\} }$ which yields the inequality (\ref{IntStep2}) that we had obtained also in the case 3. Using then that $p=\max\left\{ \lambda,-\left( \gamma+\lambda\right) \right\} >0$ and $y\geq1$ we obtain $y^{p}\leq y^{\lambda}+y^{-\gamma-\lambda}$ whence both \eqref{C3} and \eqref{C4} follow. } We can now estimate the first term on the right hand side of \eqref{eq:EstA3} in all the cases. { We first observe that in the cases 1, 3 and 4 (cf. \eqref{C1}, \eqref{C3}, \eqref{C4}) the region, where the integrand is non-zero, is contained in the set $V_{\gamma ,\varepsilon,M}=\left\{ y\in\mathbb{R}_{\ast}: y \geq M,\ y^{\gamma}\leq\frac {1}{\varepsilon}\right\} .$ This follows immediately in the cases \eqref{C1}, \eqref{C3}, since in those cases $\gamma\leq0$ and then $y^{\gamma}\leq1\leq \frac{1}{\varepsilon}.$ In the case of \eqref{C4} we remark that due to the presence of the characteristic function on the right of \eqref{C4} the region is restricted to to the set $\left\{ 1\leq y\leq C_{\ast} \varepsilon ^{-\frac{\sigma}{p}}\right\} .$ Since in this case $\gamma>0$ it follows that this set is the same as $\left\{ 1\leq y^{\gamma }\leq C_{\ast} \varepsilon ^{-\frac{\sigma\gamma}{p}}\right\} .$ Using then that $0<\sigma<\frac{p}{\gamma}$ it follows that $C_{\ast } \varepsilon ^{-\frac{\sigma\gamma}{p}}\leq\frac {1}{\varepsilon}$ for $\varepsilon$ sufficiently small. Then, the region of non-zero integrand is contained in $V_{\gamma,\varepsilon,M}$ also in this case, as claimed. We now remark that for any $y\in V_{\gamma,\varepsilon,M}$ we have $\min\left\{ y^{\gamma},\frac{1}{\varepsilon}\right\} =y^{\gamma}.$ Then \eqref{A1} implies that \begin{equation}\label{eq:estimate_V} \frac{1}{y}\int_{\left[ \frac{2y}{3},y\right] }f_{\varepsilon}\left( dx\right) \leq\frac{\tilde{C}}{y^{\frac{3+\gamma}{2}}}\,, \quad\text{if } y \in V_{\gamma,\varepsilon,M}\ . \end{equation} We then obtain, using \eqref{C1}, \eqref{C3}, \eqref{C4}, the following estimate for the first term on the right hand side of \eqref{eq:EstA3} in the cases 1, 3 and 4 \begin{equation} \sup_{x\in\operatorname*{supp}\varphi}\int_{\left\{ y\geq M\right\} }% \min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} \Phi_{\varepsilon}\left( \frac{x}{x+y},x\right) f_{\varepsilon}\left( dy\right) \leq C\int_{V_{\gamma,\varepsilon,M}}\left( y^{\gamma+\lambda }+y^{-\lambda}\right) f_{\varepsilon}\left( dy\right)\ . \label{IntEstB1}% \end{equation} Notice that in the cases 3 and 4, estimate (\ref{IntEstB1}) follows from \eqref{C3}, \eqref{C4}. In the case 1 we use that $p=\max\left\{ \lambda,-\left( \gamma+\lambda\right) \right\} \leq0.$ Then $\left( \gamma+\lambda\right) \geq0$ and $-\lambda\geq0$ and we can use then \eqref{C1} to show that $\min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} \Phi_{\varepsilon}\left( \frac{x}{x+y},x\right) \leq C\left( y^{\gamma +\lambda}+y^{-\lambda}\right) $ in the region of integration. Therefore (\ref{IntEstB1}) follows also in this case. We can now combine \eqref{eq:estimate_V} and (\ref{IntEstB1}) with Lemma \ref{lem:bound} to obtain \begin{align*} & \sup_{x\in\operatorname*{supp}\varphi}\int_{\left\{ y\geq M\right\} }% \min\left\{ \left( x+y\right) ^{\gamma},\frac{1}{\varepsilon}\right\} \Phi_{\varepsilon}\left( \frac{x}{x+y},x\right) f_{\varepsilon}\left( dy\right) \\ & \leq C\int_{ V_{\gamma,\varepsilon,M} }\left( \frac{y^{\gamma+\lambda }+y^{-\lambda}}{y^{\frac{3+\gamma}{2}}}\right) dy \leq C\int_{\left\{ y\geq M\right\} }\left( y^{\frac{\gamma}{2}+\lambda-\frac{3}{2}}+y^{-\left( \lambda+\frac{\gamma}{2}\right) -\frac{3}{2}}\right) dy \leq\frac{C}{M^{b}}% \end{align*} with $b>0$ since $\left\vert \gamma + 2\lambda\right\vert <1.$ Thus this term can be made arbitrarily small by taking $M\rightarrow\infty.$ } It only remains to examine in detail the case (\ref{C2}). In this case we obtain:% \begin{align*} & \int_{\left\{ y\geq M\right\} }\min\left\{ \left( x+y\right) ^{\gamma },\frac{1}{\varepsilon}\right\} \Phi_{\varepsilon}\left( \frac{x}% {x+y}, x\right) f_{\varepsilon}\left( dy\right) \\ & \leq C\int_{\left\{ y\geq M\right\} }\frac{\left( y^{\gamma+\lambda }+y^{-\lambda}\right) }{y^{\frac{3+\gamma}{2}}}dy+\frac{C}{\varepsilon}% \int_{\left\{ y\geq\left( \frac{1}{\varepsilon}\right) ^{\frac{1}{\gamma}% }\right\} }\frac{\left( y^{\lambda}+y^{-\gamma-\lambda}\right) }% {y^{\frac{3+\gamma}{2}}}dy\ . \end{align*} The first integral can be estimated as $\frac{C}{M^{b}}$ with $b>0$ arguing as before (using $\left\vert \gamma+2\lambda\right\vert <1$). It only remains to estimate the last integral. We have $p=\max\left\{ \lambda,-\left( \gamma+\lambda\right) \right\} \leq0,$ whence $\lambda\leq0$ and $-\left( \gamma+\lambda\right) \leq0.$ In this case we have also $\gamma>0.$ Hence, the second integral converges and it can be estimated as \begin{align*} & \frac{C}{\varepsilon}\int_{\left\{ y\geq\left( \frac{1}{\varepsilon }\right) ^{\frac{1}{\gamma}}\right\} }\frac{\left( y^{\lambda}% +y^{-\gamma-\lambda}\right) }{y^{\frac{3+\gamma}{2}}}dy \leq\frac{C}{\varepsilon}\left[ \left( \left( \frac{1}{\varepsilon }\right) ^{\frac{1}{\gamma}}\right) ^{\lambda-\frac{1+\gamma}{2}}+\left( \left( \frac{1}{\varepsilon}\right) ^{\frac{1}{\gamma}}\right) ^{-\gamma-\lambda-\frac{1+\gamma}{2}}\right] \\ & =\frac{C}{\varepsilon}\left[ \left( \varepsilon\right) ^{\frac{1+\gamma }{2\gamma}-\frac{\lambda}{\gamma}}+\left( \varepsilon\right) ^{1+\frac {\lambda}{\gamma}+\frac{1+\gamma}{2\gamma}}\right] =C\left[ \left( \varepsilon\right) ^{\frac{1+\gamma}{2\gamma}-\frac{\lambda}{\gamma}% -1}+\left( \varepsilon\right) ^{\frac{\lambda}{\gamma}+\frac{1+\gamma }{2\gamma}}\right] \\ & =C\left[ \left( \varepsilon\right) ^{\frac{1}{2\gamma }\left( 1-2\lambda-\gamma\right)}+\left( \varepsilon\right) ^{\frac{1}{2\gamma }\left( 1+2\lambda+\gamma\right)}\right]. \end{align*} Thus the integral converges to zero as $\varepsilon\rightarrow0$ since $\vert \gamma +2\lambda \vert <1$. Therefore, we can take the limit $\varepsilon _{n}\rightarrow 0$ as $n\rightarrow \infty $ in (\ref{WeakFormEps}) with an arbitrary large $M$. Then $M\to \infty$ can be taken by the assumed bounds on $K$ and using the tail estimates (\ref{ftailboundneggamma}) or (\ref{ftailboundposgamma}). This yields \begin{equation}\label{eq:weaksoldef} \int_{( 0,\infty )^{2}}K\left( x,y\right) [\varphi (x+y)-\varphi (x)-\varphi (y)]f\left( dx\right) f\left( dy\right) +\int_{(0,\infty )}\varphi (x)\eta \left( dx\right) =0\,, \end{equation}% for any $\varphi \in C_{c}\left( \mathbb{R}_{*}\right) .$ In particular, $f\neq 0$ due to $\eta \neq 0$. Taking the limit of (\ref{A1}) as $\varepsilon \rightarrow 0$ we arrive at% \begin{equation*} \frac{1}{z}\int_{[2z/3,z]}f(dx)\leq \frac{\widetilde C}{z^{3/2+\gamma /2}}\ \ \text{ for all }z\in (0,\infty ), \end{equation*} which implies \begin{equation*} \frac{1}{z}\int_{[2z/3,z]}x^{\mu} f(dx)\leq \widetilde C \frac{z^{\mu} }{z^{3/2+\gamma /2}}\ \ \text{ for all }z\in (0,\infty ), \end{equation*} for any $\mu \in {\mathbb R}$. From Lemma~\ref{lem:bound} we obtain the boundedness of the moment of order $\mu$: \begin{equation}\label{eq:moment_mu} \int_{(0,\infty)}x^{\mu} f(dx)< \infty \end{equation} for any $\mu$ satisfying $\mu < \frac{\gamma + 1}{2}$. In particular, since $|\gamma + 2\lambda| <1$, then the moments $\mu = -\lambda$ and $\mu = \gamma + \lambda$ are bounded, which proves (\ref{eq:moment_cond}). \end{proofof} \bigskip \bigskip \section{Nonexistence result: Continuous model}\label{sec:nonexistence} { The rationale behind the proof of Theorem \ref{thm:NonExistence} is the following. The solutions of \eqref{eq:contStat} satisfy \eqref{eq:flux_J0} for large values of $x$ with $J\left( x;f\right) $ as in \eqref{eq:flux} and $J_{0}=\int x\eta\left( dx\right) $. A detailed analysis of the contributions to the integrand of the different regions, using also the assumption \eqref{eq:moment_cond}, that is the minimal assumption required to define a solution of \eqref{eq:contStat}, shows that $J\left( x;f\right) $ can be approximated for large values of $x$ as% \begin{equation} \int\int_{\left\{ y+z>x,\ y\leq x\right\} \cap\left\{ z\leq\delta y\right\} }yK\left( y,z\right) f\left( y\right) f\left( z\right) dydz\simeq J_{0}\label{ApproxNonEx}% \end{equation} where $\delta>0$ can be chosen arbitrarily small. By assumption $K\left( y,z\right) \approx y ^{\gamma+\lambda}z^{-\lambda}+ z ^{\gamma+\lambda}y^{-\lambda}.$ Suppose that $\gamma+\lambda \geq0>-\lambda,$ since the other ranges of exponents can be studied with slight modifications of the arguments. Notice that the assumption $\left\vert \gamma+2\lambda\right\vert \geq1$ then implies, since $\gamma+2\lambda\geq0,$ that $\gamma+2\lambda\geq1.$ Then $\gamma+\lambda\geq1-\lambda$ and \eqref{eq:moment_cond} implies that% \begin{equation} \int_{1}^{\infty}f\left( z\right) z^{1-\lambda}dz<\infty\ .\label{IntBound}% \end{equation} Moreover, we can approximate (\ref{ApproxNonEx}), using the form of the region of integration, as% \begin{equation} \left( x\right) ^{\gamma+\lambda+1}\int\int_{\left\{ y+z>x,\ y\leq x\right\} \cap\left\{ z\leq\delta y\right\} }f\left( y\right) f\left( z\right) z^{-\lambda}dydz\simeq J_{0}\ .\label{ApproxFlux}% \end{equation} We define $F\left( x\right) =\int_{x}^{\infty}f\left( y\right) dy$. This integral is well defined due to \eqref{eq:moment_cond} and the fact that $\gamma+\lambda \geq0.$ We can then approximate (\ref{ApproxFlux}) for large values of $x$, as% \begin{equation} \int_{1}^{\delta x}\left[ F\left( x-z\right) -F\left( x\right) \right] f\left( z\right) z^{-\lambda}dz\simeq\frac{J_{0}}{\left( x\right) ^{\gamma+\lambda+1}}\ .\label{NonLocEqu}% \end{equation} The equation (\ref{NonLocEqu}) can be thought as a nonlocal differential equation. Due to (\ref{IntBound}) we can approximate formally (\ref{NonLocEqu}% ) for large values of $x$ as% \begin{equation} -\frac{dF}{dx}\simeq\frac{J_{0}}{\int_{1}^{\infty}f\left( z\right) z^{1-\lambda}dz}\frac{1}{\left( x\right) ^{\gamma+\lambda+1}}\ .\label{DE}% \end{equation} Therefore, using the definition of $F$ we formally obtain that $f\left( x\right) \simeq\frac{C}{\left( x\right) ^{\gamma+\lambda+1}}$ as $x\rightarrow\infty.$ However, this implies that $\int_{1}^{\infty}% x^{\gamma+\lambda}f\left( x\right) dx=\infty$ which contradicts \eqref{eq:moment_cond}. This argument is formal and instead of approximating $K\left( y,z\right) $ by means of power laws we must use the inequalities \eqref{eq:cond_kernel2}, \eqref{eq:cond_kernel3}. The solutions of (\ref{NonLocEqu}) can be estimated in terms of the solutions of (\ref{DE}) by means of maximum principle arguments which are described in the following Lemmas. } \bigskip \begin{lemma} \label{lem:F+estimate} Let $a$ and $b$ be constants satisfying $a\geq 0$ and $(a-b)\geq 1$. Let $F: {\mathbb R}_* \to {\mathbb R}$ be a right-continuous non-increasing function satisfying $F(R)\geq 0$, for all $R> 0$. Assume that $f \in \mathcal{M}_+({\mathbb R}_*)$ satisfies $f([1,\infty))> 0$ and \begin{equation}\label{eq:momentBound1} \int_{[1,\infty)} x^a f(dx) < \infty \,. \end{equation} There exists $\delta_0\in(0,1)$ which depends only on $a$ such that the following result holds: If $0<\delta\le \delta_0$, $R_0> 1/\delta $, and $C>0$ are such that \begin{equation} -\int_{\left[ 1,\delta R\right] }\left[ F\left( R-y\right) -F\left( R\right) % \right] y^{b}f\left( dy\right) \leq -\frac{C}{R^{a +1}}\,,\quad \text{for }R\geq R_{0},\label{S4E9_1} \end{equation} then there are $R_0' \geq R_0$ and $B>0$ which depend only on $a$, $f$, $\delta$, $R_0$, and $C$, such that if $a>0$ then \begin{equation} F\left( R\right) \geq \frac{B}{R^{a}}\, , \quad \text{for \ } R\geq R_{0}', \label{S5E3_1} \end{equation} else, if $a=0$, then \begin{equation} F\left( R\right) \geq B \log(R)\, , \quad \text{for \ } R\geq R_{0}'.\label{S5E3_12} \end{equation} \end{lemma} \begin{proof} Since $F$ is non-increasing and right-continuous, we have \begin{equation} F\left( R^{-}\right) =\lim_{\rho \rightarrow R^{-}}F\left( \rho \right) \geq \lim_{\rho \rightarrow R^{+}}F\left( \rho \right) ={F\left( R\right)}\,. \label{S4E7b_1} \end{equation} For the proof, let us first point out that we can increase $R_0$ while keeping $\delta$ and $C$ fixed if needed. We first consider the case of $a>0$, and prove that in this case the choice $\delta_0 := 1-(3/4)^{1/(1+a)}\in (0,1)$ will suffice. From now on, we assume that $\delta$ is fixed to a value such that $0<\delta\le \delta_0$. We use a comparison argument. To this end, we construct an auxiliary function $$F_{\ast}\left( R\right) =\frac{2B}{R^{a}}$$ with $B>0$ to be determined. We choose $B$ in order to have \begin{equation} -\int_{\left[ 1,\delta R\right] }\left[ F_{\ast}\left( R-y\right) -F_{\ast}\left( R\right) \right] y^{b}f\left( dy\right) \geq -\frac{C}{% R^{a+1}}\ \ \text{for }R\geq R_{0}\ . \label{S5E1_1} \end{equation} Therefore, the goal is to impose \begin{equation} -\int_{\left[ 1,\delta R\right] }\left[ \frac{2B}{\left( R-y\right) ^{a}}-\frac{2B}{R^{a}}\right] y^{b}f\left( dy\right) \geq-\frac{C}{R^{a+1}}\ \ \text{for }% R\geq R_{0} \,. \label{S4E8_1} \end{equation} Since $(1-\delta)^{a+1}\ge \frac{1}{2}$, we have for any $R\ge R_0>1/\delta$ and $y\in\left[ 1,\delta R\right] $ \begin{equation*} \frac{1}{\left( R-y\right) ^{a}}-\frac{1}{R^{a}} \leq\frac{2 a y}{R^{a+1}} \,. \end{equation*} Thus, \begin{equation*} -\int_{\left[ 1,\delta R\right] }\left[ \frac{2B}{\left( R-y\right) ^{a}}-\frac{2B}{R^{a}}\right] y^{b}f\left( dy\right) \geq-\frac{4aB}{R^{a+1}}% \int_{\left[ 1,\delta R\right] }y^{1+b}f\left( dy\right). \end{equation*} On the other hand, then $$ \int_{\left[ 1,\delta R\right] }y^{1+b}f\left( dy\right) \leq D,$$ where $D=\int_{\left[ 1,\infty\right) }y^{1+b}f\left( dy\right)$ is a well-defined, strictly positive constant due to $b+1\le a$,~\eqref{eq:momentBound1} and $f\neq0.$ Therefore, choosing $$B=\frac{C }{4D a },$$ we obtain that (\ref{S4E8_1}) holds. For the next step, we require that $f([1,\delta R_0])>0$. If needed, this can be accomplished by increasing $R_0$ since the left hand side, by dominated convergence theorem, approaches $f([1,\infty))>0$, as $R_0\to \infty$. To prove~\eqref{S5E3_1}, we argue by contradiction. Suppose that there exists $R_{1}\geq R_{0}$ such that $F\left( R_{1}\right) <\frac{B}{\left( R_{1}\right) ^{a }}.$ Then, using that $F\left( R\right) $ is decreasing, we obtain that \begin{equation} F\left( R\right) <\frac{B}{\left( R_{1}\right) ^{a }}\,, \quad \text{ for } R \in \left[ R_{1},\frac{R_{1}}{1-\delta }\right]\,.\label{S5E11_1} \end{equation} We define $$G\left( R\right) =F_{\ast}\left( R\right) -\frac{B}{2}\frac{1}{\left( R_{1}\right) ^{a }}-F\left( R\right).$$ Combining (\ref{S4E9_1}) and (\ref{S5E1_1}) we obtain that% \begin{equation} -\int_{\left[ 1,\delta R\right] }\left[ G\left( R-y\right) -G\left( R\right) % \right] y^{b }f\left( dy\right) \geq 0\ \ \text{for all }R\geq R_{0} \ . \label{S5E2_1} \end{equation}% Using~\eqref{S5E11_1} we obtain \begin{align} G\left( R\right) & =F_{\ast }\left( R\right) -\frac{B}{2}\frac{1}{\left( R_{1}\right) ^{a }}-F\left( R\right) >\frac{2B}{R^{a }}-\frac{B}{2}\frac{1}{\left( R_{1}\right) ^{a }}-\frac{B}{\left( R_{1}\right) ^{a }} \notag \\ & \geq B\left( \frac{2\left( 1-\delta \right) ^{a }}{\left( R_{1}\right) ^{a }}-\frac{3}{2}\frac{1}{\left( R_{1}\right) ^{a}}\right) >0, \ \ \ \ \ \ \ \ \text{ for } R\in \left[ R_{1},\frac{R_{1}}{1-\delta }\right], \label{S5E2a_1} \end{align}% since $\delta>0$ is sufficiently small so that $\left( 1-\delta \right) ^{a }>\left( 1-\delta \right) ^{a+1}\ge \frac 3 4$. Notice that since $% F_{\ast }\left( R\right) $ and $\frac{B}{2}\frac{1}{\left( R_{1}\right) ^{a }}$ are continuous functions we have that $G$ is right continuous and (\ref{S4E7b_1}) implies \begin{equation} G\left( R^{-}\right) =\lim_{\rho \rightarrow R^{-}}G\left( \rho \right) \leq \lim_{\rho \rightarrow R^{+}}G\left( \rho \right) =G\left( R\right)\,.\label{S5E33_1} \end{equation} We define $R_{2}$ as \begin{equation*} R_{2}=\inf \left\{ \rho \geq R_{1}:G\left( \rho\right) \leq 0\right\} \,. \end{equation*} Suppose first that $R_{2}<\infty.$ By definition $G(R_2^+) \leq 0$. Since $G$ is right-continuous, then $G(R_2) \leq 0$. From~\eqref{S5E2a_1}, $G(R_2) \geq G(R_2^-) \geq 0$. Therefore, necessarily $G(R_2)=0$. From~\eqref{S5E2a_1} we also have that $R_2>\frac{R_1}{1-\delta}$ and \begin{equation}\label{S5E34_1} G(R)>0 \text{ for } R \in [R_1,R_2). \end{equation} For $y \in [1,\delta R_2]$, we have that $(R_2-y) \in [R_1,R_2)$, therefore $G(R_2-y) >0$. Since $f([1,\delta R_2]) \ge f([1,\delta R_0])>0$, this implies \begin{equation*} -\int_{\left[ 1,\delta R_{2}\right] }\left[ G\left( R_{2}-y\right) -G\left( R_{2}\right) \right] y^{b}f\left( dy\right) <0 \end{equation*}% which contradicts (\ref{S5E2_1}). Then $R_{2}=\infty $ whence $G\left( R\right) \geq 0$ for all $R\geq R_{1}$. Therefore, \begin{equation*} F\left( R\right) \leq F_{\ast }\left( R\right) -\frac{B}{2}\frac{1}{\left( R_{1}\right) ^{a }}\quad \text{ for }R\geq R_{1}\,. \end{equation*} However, this inequality implies that $F\left( R\right) <0$ for $R$ large enough, but this contradicts the definition of $F$. Therefore, \begin{equation*} F\left( R\right) \geq \frac{B}{R^{a}}\ \ \text{if \ }% R\geq R_{0}, \end{equation*} which concludes the proof for $a>0$. Note that $R_0$ in this formula might have been increased compared to the value in the original assumptions, hence it is denoted by $R'_0$ in the conclusions of the Lemma. We now consider the case $a=0$. In this case, we prove that the choice $\delta_0 := \frac{1}{2}$ will suffice. We assume that $\delta$ is fixed to a value such that $0<\delta\le \delta_0$, and that $R_0$ is sufficiently large so that $R_0>\frac{1}{1-\delta}$ and $f([1,\delta R_0])>0$, as before. We construct an auxiliary function $$F_{\ast}\left( R\right) =- B \log(R)$$ with $B>0$ to be determined by the requirement that \begin{equation} -\int_{\left[ 1,\delta R\right] }\left[ F_{\ast}\left( R-y\right) -F_{\ast}\left( R\right) \right] y^{b}f\left( dy\right) \geq -\frac{C}{R}\ \ \text{for }R\geq R_{0} \ . \label{S5E1_12} \end{equation} Therefore, we need to impose% \begin{equation} \int_{\left[ 1,\delta R\right] }\left[B\log(R-y)-B\log(R)\right] y^{b}f\left( dy\right) \geq-\frac{C}{R}\ \ \text{for }% R\geq R_{0} \ . \label{S4E8_12} \end{equation} Since $0<\delta\le\frac{1}{2}$, we have for all $R>1/\delta$ and $y\in\left[ 1,\delta R\right] $ an estimate \begin{equation*} \log(R-y)-\log(R) \geq - \frac{ 2y}{R}\,. \end{equation*} Thus, \begin{equation*} \int_{\left[ 1,\delta R\right] }\left[B\log(R-y)-B\log(R)\right] y^{b}f\left( dy\right) \geq-\frac{2B}{R}\int_{\left[ 1,\delta R\right] }y^{1+b}f\left( dy\right). \end{equation*} Here, $$ \int_{\left[ 1,\delta R\right] }y^{1+b}f\left( dy\right) \leq D,$$ where $D=\int_{\left[ 1,\infty\right) }y^{1+b}f\left( dy\right)$ is a well-defined strictly positive constant due to $b+1\le a$,~\eqref{eq:momentBound1} and $f\neq0.$ Therefore, choosing $$B=\frac{C }{2D },$$ we obtain that (\ref{S4E8_12}) holds. To prove~\eqref{S5E3_12}, we again argue by contradiction. Suppose that there exists $R_{1}\geq R_{0}$ such that $F\left( R_{1}\right) <B\log( R_{1}).$ Then, using that $F\left( R\right) $ is decreasing, we obtain that \begin{equation} F\left( R\right) <B\log(R_{1}) \text{ for } R \in \left[ R_{1},\frac{R_{1}}{1-\delta }\right].\label{S5E11_12} \end{equation} We define $$G\left( R\right) =F_{\ast}\left( R\right) +3B\log( R_{1})-F\left( R\right).$$ Combining (\ref{S4E9_1}) and (\ref{S5E1_12}) we obtain that% \begin{equation} -\int_{\left[ 1,\delta R\right] }\left[ G\left( R-y\right) -G\left( R\right) % \right] y^{b }f\left( dy\right) \geq 0\ \ \text{for all }R\geq R_{0}\ . \label{S5E2_12} \end{equation}% Using~\eqref{S5E11_12} we obtain \begin{align} G\left( R\right) & =F_{\ast }\left( R\right) +3 B\log( R_{1}) -F\left( R\right) > - B\log(R)+3B\log(R_1)-B\log(R_1) \notag \\ & \geq B\left( -\log(\frac{R_1}{1-\delta})+2\log(R_1) \right) = B\log(R_1(1-\delta))>0, \quad \text{ for } R\in \left[ R_{1},\frac{R_{1}}{1-\delta }\right]\,, \label{S5E2a_12} \end{align} where in the last step we used the property that $R_1\ge R_0>\frac{1}{1-\delta}$. Notice that since $F_{\ast }\left( R\right) $ and $3B\log( R_{1})$ are continuous functions we have that $G$ is right continuous and (\ref{S4E7b_1}) implies \begin{equation} G\left( R^{-}\right) =\lim_{\rho \rightarrow R^{-}}G\left( \rho \right) \leq \lim_{\rho \rightarrow R^{+}}G\left( \rho \right) =G\left( R^{+}\right) \ .\label{S5E33_12} \end{equation} We define $R_{2}$ as \begin{equation*} R_{2}=\inf \left\{ \rho \geq R_{1}:G\left( \rho\right) \leq 0\right\} \ . \end{equation*} Using the same reasoning as in the case $a>0$ we obtain that $R_{2}=\infty $, and thus $G\left(R\right) > 0$ for all $R\geq R_{1}.$ Therefore,% \begin{equation*} F\left( R\right) \leq F_{\ast }\left( R\right) + 3B\log(R_1) \quad \text{ for }R\geq R_{1} \ . \end{equation*} However, this inequality implies that $F\left( R\right) <0$ for $R$ large enough, but this contradicts the definition of $F$. Therefore, \begin{equation*} F\left( R\right) \geq B\log(R)\,,\ \ \text{if \ }% R\geq R_{0} \ , \end{equation*} which concludes the proof. \end{proof} \ \begin{lemma} \label{lem:F-estimate} Let $a$ and $b$ be constants satisfying $a<0$ and $(a-b)\geq 1$. Assume that $F: {\mathbb R}_* \to {\mathbb R}$ is a right-continuous non-decreasing function and $f \in \mathcal{M}_+({\mathbb R}_*)$ satisfies $f([1,\infty))> 0$ and \begin{equation}\label{eq:momentBound2} \int_{[1,\infty)} x^a f(dx) < \infty \ . \end{equation} There exists $\delta_0\in(0,1)$ which depends only on $a$ such that the following result holds: If $0<\delta\le \delta_0$, $R_0> 1/\delta $, and $C>0$ are such that $F(R_0)>0$ and \begin{equation} -\int_{\left[ 1,\delta R\right] }\left[ F\left( R-y\right) -F\left( R\right) \right] y^{b}f\left( dy\right) \geq \frac{C}{R^{a +1}}\ \ \text{for }R\geq R_{0},\label{S4E9_2} \end{equation} then there are $R_0'\geq R_0$ and $B>0$ which only depend on $a$, $f$, $\delta$, $R_0$, and $C$, such that \begin{equation} F\left( R\right) \geq \frac{B}{R^{a}}\, , \quad \text{for \ } R\geq R_{0}'.\label{S5E3_2} \end{equation} \end{lemma} \begin{proof} Since $F$ is non-decreasing and right-continuous, we have \begin{equation} F\left( R^{-}\right) =\lim_{\rho \rightarrow R^{-}}F\left( \rho \right) \leq \lim_{\rho \rightarrow R^{+}}F\left( \rho \right) =F\left( R^{+}\right) = F(R)\, . \label{S4E7b_2} \end{equation} We assume $\delta$ is fixed and satisfies $0<\delta\le \delta_0$. We will show that $\delta_0=\frac{1}{2}\in (0,1)$ works in this case. Note that if $R'_0\ge R_0$, then also $F(R'_0)\ge F(R_0)>0$ since $F$ is increasing. Therefore, as in the previous proof, we can increase $R_0$ while keeping $\delta$ and $C$ fixed if needed. In particular, we may assume that $f([1,\delta R_0])>0$, as before. We again use a comparison argument. To this end, we construct an auxiliary function $$F_{\ast}\left( R\right) =\frac{A }{R^{a}},$$ where $A > 0$ is a constant to be determined. We choose $A$ in order to have \begin{equation} -\int_{\left[ 1,\delta R\right] }\left[ F_{\ast}\left( R-y\right) -F_{\ast}\left( R\right) \right] y^{b}f\left( dy\right) \leq \frac{C}{R^{a+1}}\ \ \text{for }R\geq R_{0} \ . \label{S5E1_2} \end{equation} Therefore, we need to impose \begin{equation} -\int_{\left[ 1,\delta R\right] }\left[ \frac{A }{ (R-y) ^{a}}-\frac{A }{R^{a}}\right] y^{b}f\left( dy\right) \leq \frac{C}{R^{a+1}}\ \ \text{for }% R\geq R_{0} \ . \label{S4E8_2} \end{equation} Let us next show that a constant $A$ for the above inequality may be found for the values of $\delta$ considered here. Since $0<\delta\le \delta_0=\frac{1}{2}$, we have $(1-\delta)^{|a|-1}\le 2$ for $a\in [-1,0)$. If $a<-1$, the function $x\mapsto x^{|a|-1}$ is increasing, and thus Taylor's theorem implies \begin{equation*} {\left(\frac{1}{R^{a}}-\frac{1}{\left( R-y\right)^{a}}\right) \leq 2 \vert a \vert y \frac{1}{R^{a+1}}} \end{equation*} whenever $y\in\left[ 1,\delta R\right] $. Thus, \begin{equation*} -\int_{\left[ 1,\delta R\right] }\left[ \frac{A }{\left( R-y\right)^{a}}-\frac{A }{R^a}\right] y^{b}f\left( dy\right) \leq \frac{2 A |a|}{R^{a+1}} \int_{\left[ 1,\delta R\right] }y^{1+b}f\left( dy\right) \end{equation*} for any $A>0$. For $R>1/\delta$ we obtain that $$ \int_{\left[ 1,\delta R\right] }y^{1+b}f\left( dy\right) \leq D,$$ where $D=\int_{\left[ 1,\infty\right) }y^{1+b}f\left( dy\right)$ is a well-defined positive constant due to $b+1\le a$,~\eqref{eq:momentBound2} and $f\neq0.$ Therefore, choosing \begin{equation}\label{eq:cdtA} 0< A \leq \frac{ C }{D |a| } \end{equation} we obtain that (\ref{S4E8_2}) holds. Next we will prove~\eqref{S5E3_2}. We define $$G\left( R\right) =F(R) - F_{\ast}\left( R\right).$$ Combining (\ref{S4E9_2}) and (\ref{S5E1_2}) we obtain that \begin{equation} -\int_{\left[ 1,\delta R\right] }\left[ G\left( R-y\right) -G\left( R\right) % \right] y^{b }f\left( dy\right) \geq 0\ \ \text{for all }R\geq R_{0}. \label{S5E2_2} \end{equation} Since $F$ is increasing and $F(R_0)>0$, then $F(R)\geq F(R_0)>0$ for all $R\geq R_0$. Then $G(R)\geq F(R_0)-\frac{A}{R^{a+1}}$ for any $R\geq R_0$. Therefore, choosing $A$ sufficiently small and satisfying also \eqref{eq:cdtA}, we obtain \begin{equation} G(R)>0 \quad \text{for } R \in \left[R_0,\frac{R_0}{1-\delta}\right].\label{S5E2a_2} \end{equation} Since $F_{\ast }\left( R\right) $ is continuous, we have that $G$ is right continuous and (\ref{S4E7b_2}) implies \begin{equation} G\left( R^{-}\right) =\lim_{\rho \rightarrow R^{-}}G\left( \rho \right) \leq \lim_{\rho \rightarrow R^{+}}G\left( \rho \right) ={G\left( R\right)} \ . \label{S5E33_2} \end{equation} We define $R_{2}$ as \begin{equation*} R_{2}=\inf \left\{ \rho \geq R_0: G\left( \rho\right) \leq 0\right\} \ . \end{equation*} Suppose first that $R_{2}<\infty.$ By definition, $G(R_2^+) \leq 0$. Since $G$ is right-continuous, then $G(R_2) \leq 0$. From~\eqref{S5E33_2}, $G(R_2) \geq G(R_2^-) \geq 0$. Therefore, necessarily $G(R_2)=0$. From~\eqref{S5E2a_2} we also have that $R_2>\frac{R_0}{1-\delta}$ and \begin{equation}\label{S5E34_2} G(R)>0 \text{ for } R \in [R_0,R_2). \end{equation} For $y \in [1,\delta R_2]$, we have that $(R_2-y) \in [R_0,R_2)$, therefore $G(R_2-y) >0$. This implies \begin{equation*} -\int_{\left[ 1,\delta R_{2}\right] }\left[ G\left( R_{2}-y\right) -G\left( R_{2}\right) \right] y^{-\lambda }f\left( dy\right) <0 \end{equation*}% which contradicts (\ref{S5E2_2}). Then $R_{2}=\infty $ whence $G\left( R\right) > 0$ for all $R\geq R_{0}.$ Therefore, \begin{equation*} F\left( R\right) \geq F_*(R) = \frac{A}{R^{a}}\ \ \text{for \ }% R\geq R_{0}, \end{equation*} which proves~\eqref{S5E3_2} with $B=A$. \end{proof} \ \begin{proofof}[Proof of Theorem \ref{thm:NonExistence} (non-existence)] We argue by contradiction. Suppose that $f\in \mathcal{M}_{+}\left( \mathbb{R% }_*\right) $ satisfies $f\left( \left( 0,1\right) \right) =0$ as well as (% \ref{eq:moment_cond}) and it is a stationary injection solution of % \eqref{eq:time_evol} in the sense of Definition \ref{DefFluxSol}. Then, from Lemma \ref{lem:flux} and using also that $f\left( \left( 0,1\right) \right) =0$ we obtain \begin{equation} -\int_{\left[ 1,R\right] }f\left( dx\right) \int_ {\left(R-x ,\infty \right) \cap \left[1,\infty\right)} {K\left( x,y\right) x f\left( dy\right)} +\int_{ [1,R]}x\eta \left( dx\right) =0,\ R\geq 1 \ . \label{S4E5b} \end{equation} Then we introduce a function $J:\mathbb{R}_{*}\rightarrow \mathbb{R}_{+}$ defined by \begin{equation} J\left( R\right) =\iint_{\Sigma _{R}}K\left( x,y\right) xf\left( dx\right) f\left( dy\right) \label{S4E5a} \end{equation}% where \begin{equation*} \Sigma _{R}=\left\{ x\geq 1,\ y\geq 1:x+y>R,\ x\leq R\right\}\ . \end{equation*}% We notice that the function $J$ is constant if $R\geq L_{\eta },$ i.e. \begin{equation} J\left( R\right) =J\left( L_{\eta }\right) \text{ for }R\geq L_{\eta }. \label{S4E5} \end{equation} Suppose that $\eta $ is different from zero. Then (\ref{S4E5b}) implies that $J\left( L_{\eta }\right) =\int_{\mathbb{R}_{+}}x\eta \left( dx\right) >0.$ If $(\gamma + 2\lambda) \geq 1$, we define $a:= \gamma+\lambda$ and $b:= -\lambda$, else, if $(\gamma + 2\lambda) \leq -1$, we define $a:= -\lambda$ and $b:= \gamma+\lambda$. The assumption $|\gamma + 2\lambda|\geq 1$ becomes $a-b\geq 1$ in both cases. By~\eqref{eq:moment_cond} we have \begin{equation} \int_{\left[ 1,\infty \right) }x^{a }f\left( dx\right) <\infty \ . \label{S4E6} \end{equation} We now prove that the main contribution to the integral $J(R)$ in (\ref{S4E5a}) as $% R\rightarrow\infty$ is due to the portion of the region of integration where $x$ is close to $R$ and $y$ is order one. To this end, let us consider parameters $\delta$ which satisfy $0<\delta<\delta_0$ for the value $\delta_0=\delta_0(a)$ given by Lemma \ref{lem:F+estimate} if $a\ge 0$, or by Lemma \ref{lem:F-estimate} if $a<0$. We then define the domains \begin{align*} D_{\delta}^{\left( 1\right) } & =\left\{ x\geq1,\ y\geq1:y\leq\delta x\right\} \ , \\ D_{\delta}^{\left( 2\right) } & =\left\{ x\geq1,\ y\geq1:y>\delta x\right\} \ . \end{align*} We then write \begin{align*} J\left( R\right) & =J_{1}\left( R\right) +J_{2}\left( R\right) \text{ \ \ with} \\ J_{k}\left( R\right) & =\iint_{\Sigma _{R}\cap D_{\delta }^{\left( k\right) }}\left[ K\left( x,y\right) x\right] f\left( dx\right) f\left( dy\right) ,\ \ k=1,2 \ . \end{align*} We estimate first $J_{2}\left( R\right) $ for large values of $R.$ Using % \eqref{eq:cond_kernel3} we obtain \begin{equation*} 0\leq J_{2}\left( R\right) \leq c_{2}\iint_{\Sigma _{R}\cap D_{\delta }^{\left( 2\right) }}\left( x^{a }y^{b }+y^{a }x^{b }\right) xf\left( dx\right) f\left( dy\right) \ . \end{equation*} Using that $\left( a-b \right) >0$ we obtain that in the region $% D_{\delta}^{\left( 2\right) }$ we have $x^{a}y^{b}\leq \delta^{b-a}y^{a}x^{b}$. Therefore, \begin{equation*} J_{2}\left( R\right) \leq C_{\delta}\iint_{\Sigma_{R}\cap D_{\delta}^{\left( 2\right) }}\left( y^{a}x^{1+b}\right) f\left( dx\right) f\left( dy\right) . \end{equation*} Notice that $\Sigma_{R}\cap D_{\delta}^{\left( 2\right) }\subset\left[ 1,R% \right] \times\left[ \frac{\delta R}{1+\delta},\infty\right) ,$ whence \begin{equation*} J_{2}\left( R\right) \leq C_{\delta}\int_{\left[ 1,R\right] }x^{1+b }f\left( dx\right) \int_{\left[ \frac{\delta R}{1+\delta},\infty\right) }y^{a}f\left( dy\right) \ . \end{equation*} Given that $\left(a-b \right) \geq 1$ we obtain, taking into account \eqref{S4E6}, \begin{equation*} \int_{\left[ 1,R\right] }x^{1+b }f\left( dx\right) \leq \int_{\left[ 1,\infty \right) }x^{a }f\left( dx\right) <\infty \ . \end{equation*} Moreover, using again (\ref{S4E6}), it follows that $$ \lim_{R\rightarrow\infty }\int_{\left[ \frac{\delta R}{1+\delta},\infty\right) }y^{a }f\left( dy\right) =0.$$ This implies that the contribution due to $J_{2}$ vanishes in the limit $R\to\infty$, namely \begin{equation*} \lim_{R\rightarrow\infty}J_{2}\left( R\right) =0. \end{equation*} Therefore, (\ref{S4E5}) implies that \begin{equation*} \lim_{R\rightarrow\infty}J_{1}\left( R\right) =J\left( L_\eta\right) \ . \end{equation*} For next step, let us remark that for $(x,y) \in\Sigma _{R}\cap D_{\delta }^{\left( 1\right) }$ we have $x>R-y \geq R-\delta R$ and therefore $(1-\delta)R< x\leq R.$ In this region we have also $y^{a }x^{b }\leq \delta ^{a-b }x^{a }y^{b }.$ Combining \eqref{eq:cond_kernel3} and using the above bounds for $x$, we obtain \begin{equation*} K\left( x,y\right) x\leq c_3\left( 1+\delta ^{|a-b| }\right) R^{a +1}y^{b }\ \ ,\ \ \ \left( x,y\right) \in \Sigma _{R}\cap D_{\delta }^{\left( 1\right) } \end{equation*} where $c_3>0$ can be chosen independent of $\delta $ as soon as $\delta \leq \frac{1}{2}$ which we do in the following. Then \begin{equation*} \liminf_{R\rightarrow \infty }\left( R^{a +1}\iint_{\Sigma _{R}\cap D_{\delta }^{\left( 1\right) }} y^{b }f\left( dx\right) f\left( dy\right) \right) \geq \frac{J\left( L_\eta\right) }{c_3\left( 1+\delta ^{|a-b| }\right) } \ . \end{equation*} Notice that, if $R>1/\delta, 1/(1-\delta)$, \begin{equation*} \Sigma_{R}\cap D_{\delta}^{\left( 1\right) }\subset\left\{ \left( x,y\right) :1\leq y\leq\delta R,\ R<x+y,\ 1 \leq x\leq R\right\} \end{equation*} whence \begin{equation} \int_{\left[ 1,\delta R\right] }y^{b}f\left( dy\right) \int_{\left( R-y,R\right] }f\left( dx\right) \geq\frac{J\left( L_\eta\right) }{2c_3\left( 1+\delta^{|a-b|}\right) }\frac{1}{R^{a+1}} \label{S4E7} \end{equation} for $R\geq R_{0}$ with $R_{0}$ large enough. The rest of the proof is divided into two cases: $a\geq 0$ and $a<0$. Suppose first that $a\geq 0$. Due to (\ref{S4E6}) we may define the function: \begin{equation} F\left( R\right) =\int_{\left( R,\infty\right) }f\left( dx\right) \ \ ,\ \ R\geq1 \ . \label{S4E7a} \end{equation} Note that the function $R\rightarrow F\left( R\right) $ is right continuous, i.e. $F\left( R\right) =F\left( R^+\right) = \lim_{\rho \rightarrow R^{+}}F\left(\rho \right).$ Moreover, $F$ is non-increasing and $F(R)\geq 0$, for all $R\geq 1$. Using (\ref{S4E7a}) we can rewrite (\ref{S4E7}) as: \begin{equation*} -\int_{\left[ 1,\delta R\right] }\left[ F\left( R-y\right) -F\left( R\right) % \right] y^{b}f\left( dy\right) \leq -\frac{J\left( L_\eta\right) }{% 2c_3\left( 1+\delta ^{|a-b| }\right) }\frac{1}{R^{a +1}}\ \ \text{for }R\geq R_{0}. \end{equation*} From Lemma~\ref{lem:F+estimate}, it then follows: \begin{equation} F\left( R\right) \geq \frac{B}{R^{a}}\ \ \text{if \ } R\geq R_{0},\ \text{ for } a>0, \label{S5E3_a} \end{equation} and \begin{equation} F\left( R\right) \geq B \log(R)\ \ \text{if \ } R\geq R_{0},\ \text{ for } a=0, \label{S5E3_b} \end{equation} for some constant $B>0$. In the case where $a>0$, we use~\eqref{S4E6} and~\eqref{S5E3_a} to obtain: \begin{eqnarray} \int_{[1,\infty)} x^{a}f(dx) &=& \int_{[1,R]}x^{a}f(dx)+ \int_{(R,\infty)}x^{a}f(dx) \nonumber \\ &\geq & \int_{[1,R]}x^{a}f(dx)+ R^a\int_{(R,\infty)}f(dx) \nonumber \\ &\geq & \int_{[1,R]}x^{a}f(dx)+ B \ .\nonumber \end{eqnarray} By taking the limit $R \to \infty$ we obtain that $B\leq 0$ which leads to a contradiction. In the case where $a=0$,~\eqref{S5E3_b} yields \begin{eqnarray} \int_{(R,\infty)} f(dx) &\geq & B \log(R). \nonumber \end{eqnarray} By taking the limit $R \to \infty$ we obtain using~\eqref{S4E6} that the left-hand side converges to zero, while the right hand-side diverges, which leads to a contradiction. Suppose now that $a<0$. We define the function $F$ by \begin{equation} F\left( R\right) =\int_{[1,R] }f\left( dx\right) \ \ ,\ \ R\geq1. \label{S4E7aa} \end{equation} The function $R\rightarrow F\left( R\right) $ is right continuous and non-decreasing. Since $f \neq 0$, then $F(R)> 0$, for all $R\geq R_0$, for $R_0$ large enough. Using (\ref{S4E7aa}) we can rewrite (\ref{S4E7}) as: \begin{equation} -\int_{\left[ 1,\delta R\right] }\left[ F\left( R\right) -F\left( R-y\right) % \right] y^{b }f\left( dy\right) \leq -\frac{J\left( L_\eta\right) }{% 2c_3\left( 1+\delta ^{|a-b| }\right) }\frac{1}{R^{a +1}}\ \ \text{for }R\geq R_{0}.\nonumber \end{equation} From Lemma~\ref{lem:F-estimate}, it follows that there are $B>0$ and $R'_0\ge R_0$ such that \begin{equation} F\left( R\right) \geq \frac{B}{R^{a}}\ \ \text{if \ } R\geq R'_{0} \, . \label{S5E3a} \end{equation} From~\eqref{S5E3a} it follows that for all $R>M$ we have \begin{eqnarray*} B \leq R^a \int_{[1,R]} f(dx) \leq R^a \int_{[1,M]} f(dx) + \int_{[M,R]} x^a f(dx) \leq R^a \int_{[1,M]} f(dx) + \int_{[M,\infty)} x^a f(dx). \end{eqnarray*} Using that $a < 0$, we first let $R \to \infty$ and then $M\to \infty$ to obtain that $B \leq 0$, which leads to a contradiction. \end{proofof} \bigskip \bigskip \bigskip \section{Existence and non-existence results: Discrete model}\label{sec:discr1d} \subsection{Setting and main results} We consider the following discrete coagulation equation with source: \begin{equation} \partial_{t}n_{\alpha}=\frac{1}{2}\sum_{\beta<\alpha}K_{\alpha-\beta,\beta }n_{\alpha-\beta}n_{\beta}-n_{\alpha}\sum_{\beta>0}K_{\alpha,\beta}n_{\beta }+ s_{\alpha} \label{eq:Dtimecoag} \end{equation} where $\alpha\in\mathbb{N}=\{1,2,\dots\}$. We assume that the sequence $s=(s_{\alpha})_{\alpha\in {\mathbb{N}}}$ satisfies \begin{equation} \label{eq:Dcond_s} s_{\alpha}\geq 0 \;\; \forall \, \alpha\in {\mathbb{N}} \quad \text{and}% \quad \supp s \subset\{1,2,\dots, L_s\}. \end{equation} We consider coagulation kernels $K_{\alpha,\beta}: {\mathbb N}^2 \to {\mathbb N}$ defined on the integers satisfying the same conditions as before: \begin{equation} K_{\alpha,\beta}\geq 0,\ \ \ K_{\alpha,\beta}=K_{\beta,\alpha}, \label{eq:Dcond_kernel1} \end{equation}% \begin{equation} K_{\alpha,\beta} \geq c_{1}\left( \alpha^{\gamma +\lambda }\beta^{-\lambda }+\beta^{\gamma +\lambda }\alpha^{-\lambda }\right) \label{eq:Dcond_kernel2} \end{equation}% and \begin{equation} K_{\alpha,\beta} \leq c_{2}\left( \alpha^{\gamma +\lambda }\beta^{-\lambda }+\beta^{\gamma +\lambda }\alpha^{-\lambda }\right) \label{eq:Dcond_kernel3} \end{equation}% for $(\alpha,\beta)\in \mathbb{N}^{2}$, with $0<c_{1}\leq c_{2}<\infty$. Similarly to the continuous case, we will try to construct steady states for the coagulation equation \eqref{eq:Dtimecoag} yielding the transfer of particles to infinity. More precisely, we consider stationary injection solutions to the discrete coagulation equation \eqref{eq:Dtimecoag}. \begin{definition} \label{Def:DFluxSol} Assume that $K:{\mathbb{N}}^{2}\rightarrow {\mathbb{R}}_{+}$ is a function satisfying \eqref{eq:Dcond_kernel1} and \eqref{eq:Dcond_kernel3}. Assume further that $s=(s_{\alpha})_{\alpha=1 }^{\infty}$ is a sequence in ${\mathbb{R}}$ satisfying~\eqref{eq:Dcond_s}. We will say that $(n_{\alpha})_{\alpha=1}^{\infty}$ satisfying \begin{equation} \sum_{\alpha=1 }^{\infty} \alpha^{\gamma +\lambda }n_{\alpha} + \sum_{\alpha=1 }^{\infty} \alpha^{-\lambda }n_{\alpha} <\infty \label{eq:Dmoment_cond} \end{equation}% is a stationary injection solution of \eqref{eq:Dtimecoag} if the following identity holds for any test sequence with finite support $% (\varphi_{\alpha})_{\alpha=1}^{\infty}$: \begin{equation} \frac {1}{2}\sum_{\beta}\sum_{\alpha}K_{\alpha,\beta}n_{\alpha}n_{\beta}% \left[ \varphi_{\alpha+\beta}-\varphi_{\alpha}-\varphi_{\beta}\right] +\sum _{ \beta }s_{\beta}\varphi_{\beta}=0 . \label{eq:Dweakform} \end{equation} \end{definition} Next we prove the existence of stationary injection solutions as stated in the next theorems: \begin{theorem} \label{thm:Dexistence} Assume that $K:{\mathbb{N}}^{2}\rightarrow {\mathbb{R}}_{+}$ satisfies~\eqref{eq:Dcond_kernel1}-- \eqref{eq:Dcond_kernel3} and $| \gamma +2\lambda | <1.$ Let $s \neq 0 $ satisfy \eqref{eq:Dcond_s}. Then, there exists a stationary injection solution $% (n_{\alpha})_{\alpha=1}^{\infty}$ to~\eqref{eq:Dtimecoag} in the sense of Definition~\ref{Def:DFluxSol} satisfying $n_{\alpha}\geq 0$ for all $\alpha$. \end{theorem} \begin{theorem} \label{thm:DNonExistence} Suppose that $K:{\mathbb{N}}^{2}\rightarrow {\mathbb{R}}_{+}$ satisfies~\eqref{eq:Dcond_kernel1}--\eqref{eq:Dcond_kernel3} and $|\gamma +2\lambda | \geq 1.$ Let us assume also that $s \neq 0$ satisfies \eqref{eq:Dcond_s}. Then, there is no stationary injection solution of~ \eqref{eq:Dtimecoag} in the sense of the Definition \ref{Def:DFluxSol}. \end{theorem} \bigskip \subsection{Existence result}\label{ssec:discr1dEx} We first consider equations with the form (\ref{eq:Dtimecoag}) but with $n_\alpha(t) $ and $n_\beta(t) $ supported in $I:=\{1,2,\dots,R_{\ast } \}$ for each $t\geq 0.$ Therefore, (\ref{eq:Dtimecoag}) becomes \begin{equation} \label{DevolEqTrunc} \partial_{t}n_{\alpha}=\frac{1}{2}\sum_{\beta\leq \alpha-1}K_{\alpha-\beta,\beta }n_{\alpha-\beta}n_{\beta}-n_{\alpha}\sum_{\beta\leq R_{\ast }}K_{\alpha,\beta}n_{\beta }+\sum_{ \beta \leq R_*}s_{\beta}\delta_{\alpha,\beta} \ \end{equation} where $\delta_{\alpha,\beta}=1$ if $\alpha=\beta$, and $\delta_{\alpha,\beta}=0$ otherwise. Let $(\varphi _{\alpha })_{\alpha \in I}$ be an arbitrary test function such that $\varphi _{\alpha}:[0,T]\rightarrow {\mathbb{R}}$ is continuously differentiable for any $\alpha $. Multiplying \eqref{DevolEqTrunc} by $(\varphi _{\alpha })_{\alpha \in I}$ and adding up in $\alpha$ we obtain the weak formulation of \eqref{DevolEqTrunc}: \begin{align} & \frac{d}{dt}\left( \sum_{\alpha \leq R_{\ast }}{n_\alpha (t)\varphi_\alpha(t)}\right) -\sum_{\alpha \leq R_{\ast }}{n_\alpha(t)\dot{ \varphi}_\alpha(t) } \notag \\ & =\frac{1}{2}\sum_{\beta \leq R_{\ast }}\sum_{\alpha \leq R_{\ast }}K_{\alpha ,\beta }{n_\alpha(t)}{n_\beta(t)}\left[ {\varphi _{\alpha +\beta}(t)} \chi _{\left\{ \alpha +\beta \leq R_{\ast }\right\} }-\varphi _{\alpha }(t)-\varphi _{\beta }(t)\right] +\sum_{\beta \leq R_{\ast}}s_{\beta }\varphi _{\beta }(t), \label{eq:Devol_eqWeak} \end{align} where $\dot \varphi$ denotes the time-derivative of $\varphi$ and $\chi _{\left\{ \alpha+\beta\leq R_{\ast }\right\} } $ is the characteristic function of the set $\left\{ \alpha+\beta\leq R_{\ast}\right\}.$ The approximation \eqref{DevolEqTrunc} is known as the non-conservative approximation of the coagulation equation \eqref{eq:Dtimecoag}. This equation and its weak formulation \eqref{eq:Devol_eqWeak} have been extensively used in the study of the mathematical properties of the coagulation equations (cf. for instance \cite{C98, L99}). Our first goal is to prove the well-posedness for \eqref{DevolEqTrunc}. \begin{proposition} \label{prop:Dwellp} Assume that $1<R_{\ast }<\infty $ and that $% K:I^{2}\rightarrow {\mathbb{R}}_{+}$ is a function satisfying % \eqref{eq:Dcond_kernel1} and \eqref{eq:Dcond_kernel2}. Assume further that $% s=(s_{\alpha})_{\alpha\in I}$ satisfies~\eqref{eq:Dcond_s}. Let $% (n_{\alpha}\left( 0\right))_{\alpha\in I}$ be the initial condition. Then, there exists a unique solution $(n_{\alpha}\left( t\right))_{\alpha\in I}$% , with $n_{\alpha}: (0,\infty)\to {\mathbb{R}}_{+}$ continuously differentiable for any $\alpha$, which solves \eqref{DevolEqTrunc} in the classical sense. \end{proposition} \begin{proof} The proof of this statement relies on classical arguments of the theory of ordinary differential equations. We just outline the main steps. To simplify the notation we define \begin{equation*} g_{\alpha}:{\mathbb{R}}_{+}^{R_{\ast}}\rightarrow {\mathbb{R}}% _{+}^{R_{\ast}} \quad \text{for}\;\; \alpha=1,\dots, R_{\ast} \end{equation*} such that \begin{equation*} g_{\alpha}(\xi_1,\dots, \xi_{R_{\ast}})=\frac{1}{2}\sum_{\beta\leq \alpha-1}K_{\alpha-\beta,\beta}\xi_{\alpha-\beta}\xi_{\beta}-\xi_{\alpha}% \sum_{\beta\leq R_{\ast }}K_{\alpha,\beta}\xi_{\beta}+\sum_{\beta \leq R_*}s_{\beta}\delta_{\alpha,\beta}. \end{equation*} Then, we can rewrite \eqref{DevolEqTrunc} as \begin{align*} \partial_t n_{\alpha}=g_{\alpha}(n_1,\dots, n_{R_{\ast}}), \end{align*} with initial condition $n_{\alpha}\left( 0\right).$ We observe that the functions $g_{\alpha}$ are polynomials, therefore they are locally Lipschitz continuous functions. Thus, due to the Picard-Lindel\"of theorem there exists a unique solution continuously differentiable $(n_{\alpha}\left( t\right))_{\alpha\in I}$ on a maximal time interval $[0,T_{\ast})$. Moreover, since $K_{\alpha ,\beta }\geq 0,$ $s_{\gamma }\geq 0$ by assumption and $n_{\alpha }(0)\geq 0$ it easily follows that $n_{\alpha }\geq 0$ in $[0,T_{\ast })$ for any $\alpha =1,\dots ,R_{\ast }$. The fact that the solutions of \eqref{DevolEqTrunc} are globally defined in time follows from the fact that \begin{equation} \partial_t\left( \sum_{\alpha=1}^{R_*} n_\alpha \right) \leq \sum_{\alpha=1}^{R_*} s_\alpha. \end{equation} \end{proof} Next we show the existence of stationary injection solutions to \eqref{DevolEqTrunc} corresponding to time independent solutions of \eqref{DevolEqTrunc}. \begin{proposition} \label{thm:Dexistence_truncated} Under the assumptions of Proposition~\ref{prop:Dwellp}, there exists a stationary injection solution $(\hat n_{\alpha})_{\alpha\in I}$ to~\eqref{DevolEqTrunc} satisfying $\hat n_{\alpha}\geq 0$ for any $\alpha\in I$. \end{proposition} \begin{proof} We first construct an invariant region for the evolution equation~% \eqref{DevolEqTrunc}. From Proposition~\ref{prop:Dwellp} there exists a unique solution to~\eqref{DevolEqTrunc}, $(n_{\alpha }\left( t\right) )_{\alpha \in I}$, with $n_{\alpha }:(0,\infty )\rightarrow {\mathbb{R}}% _{+} $ continuously differentiable for any $\alpha $. In particular, $(n_{\alpha }\left( t\right) )_{\alpha \in I}$ satisfies~% \eqref{eq:Devol_eqWeak}. Choosing $\varphi _{\alpha }=1$ and using the upper bound for $\chi _{\left\{ \alpha +\beta \leq R_{\ast }\right\} }\leq 1$ and the lower bound $a_{1}=\min_{\alpha ,\beta \in I}K_{\alpha ,\beta }$, we obtain \begin{equation*} \frac{d}{dt}\sum_{\alpha \leq R_{\ast }}n_{\alpha }(t)\leq -\frac{a_{1}}{2}% \left( \sum_{\alpha \leq R_{\ast }}n_{\alpha }(t)\right) ^{2}+c_{0}\hspace{% 1cm} \end{equation*}% where $c_{0}=\sum_{\beta \leq R_{\ast }}s_{\beta }\varphi _{\beta }$. Notice that $a_{1}>0$ because we assume that (\ref{eq:Dcond_kernel2}) holds. We then obtain the invariant region% \begin{equation} \mathcal{U}_{M}=\left\{ (n_{\alpha })_{\alpha \in I}\in {\mathbb{R}}% ^{R_{\ast }}:\sum_{\alpha \leq R_{\ast }}n_{\alpha }\leq M\right\} \label{eq:Dinvariant_region} \end{equation}% with $M\geq \sqrt{\frac{2c_{0}}{a_{1}}}$. Moreover, $\mathcal{U}_{M}$ is compact and convex. Consider the operator $S(t):{\mathbb{R}}^{R_{\ast }}\rightarrow {% \mathbb{R}}^{R_{\ast }}$ defined by $n_{\alpha }(t)=S(t)n_{\alpha }(0)$. This operator is continuous by standard continuity results on the initial data for the solutions of ODEs (cf.~\cite{CD}). Since the functions $n_{\alpha }(t)$ solve a first order ODE, they are also continuous in time. Then, the mapping $t\rightarrow S(t)n_{\alpha }(0)$ is continuous. We can now conclude the proof of Proposition \ref{thm:Dexistence_truncated}. The operator $S(t):\mathcal{U}_{M}\rightarrow \mathcal{U}_{M}$ is continuous and $\mathcal{U}_{M}$ is convex and compact. Then, Brouwer's Theorem (cf.\ \cite{Evans}) implies that for all $\delta >0$, there exists a fixed-point $\hat{n}_{\delta }$ of $S(\delta )$ in $\mathcal{U}_{M}$. Arguing as in the last paragraph of the proof of Theorem \ref{thm:existence} we conclude that there exists $\hat{n}\in \mathcal{U}_{M} $ such that $S(t) \hat{n} = \hat{n}$, which implies that $\hat{n}$ is a stationary injection solution to \eqref{DevolEqTrunc}. \end{proof} We now prove the Theorem \ref{thm:Dexistence}. \begin{proofof}[Proof of Theorem~\ref{thm:Dexistence} (existence)] We just sketch the argument since it is an adaptation of Theorem \ref{thm:existence}. For notational convenience we rewrite the kernel $K_{\alpha,\beta}=K(\alpha ,\beta )$ in the form \eqref{B1in3} where now $x$, $y\in {\mathbb N}$. Throughout this proof we will also use the notation $n_\alpha=n(\alpha)$ and $n_\beta=n(\beta)$. The function $\Phi(s,x)$ is defined in a subset of the rational numbers contained in the interval $(0,1)$ and satisfies \eqref{eq:B1bound} in this domain of definition. We then define the kernel $K_{\varepsilon}(x,y)$ as in \eqref{eq:1levTrunc} and $K_{\varepsilon,R_{\ast}}(x,y)$ as in \eqref{eq:2levTrunc}. Hence, using Proposition \ref{thm:Dexistence_truncated} there exists a stationary injection solution $n_{\varepsilon ,R_{\ast }}$ satisfying \begin{eqnarray} &\frac{1}{2}\sum\limits_{\beta \leq R_{\ast }}\sum\limits_{\alpha \leq R_{\ast }}K_{\varepsilon ,R_{\ast }}(\alpha ,\beta )n_{\varepsilon ,R_{\ast }}(\alpha )n_{\varepsilon ,R_{\ast }}(\beta )\left[ \varphi_{\alpha +\beta }\chi_{\left\{ \alpha +\beta \leq R_{\ast }\right\} }-\varphi_\alpha -\varphi_\beta\right] \nonumber\\ &+\sum_{\beta \leq R_{\ast }}s_{\beta }\varphi_\beta =0\label{WeakD_TruncForm} \end{eqnarray} for any test function $\varphi: {\mathbb N} \to {\mathbb R}$ compactly supported. Choosing $\varphi$ of the form $\varphi _{\alpha }=\alpha \psi _{\alpha }$ for some compactly supported function $\psi: {\mathbb N} \to {\mathbb R}$, we obtain \begin{eqnarray*} &&\varphi_{\alpha+\beta} \chi _{\{ \alpha+\beta \leq R_{\ast }\}} -\varphi_\alpha -\varphi_\beta \\ &=&\alpha(\psi_{ \alpha+\beta}\chi _{\{ \alpha+\beta \leq R_{\ast }\}} -\psi_{\alpha})+ \beta(\psi_{ \alpha+\beta}\chi _{\{ \alpha+\beta \leq R_{\ast }\}} -\psi_\beta). \end{eqnarray*} Symmetrizing we arrive at% \begin{equation} \sum_{\beta \leq R_{\ast }}\sum_{\alpha \leq R_{\ast }}K_{\varepsilon ,R_{\ast }}(\alpha ,\beta )n_{\varepsilon ,R_{\ast }}(\alpha )n_{\varepsilon ,R_{\ast }}(\beta )\left[\alpha(\psi_{ \alpha+\beta}\chi _{\{ \alpha+\beta \leq R_{\ast }\}} -\psi_\alpha)\right] +\sum_{\alpha \leq R_{\ast }}\alpha\psi_\alpha s_\alpha=0.\nonumber \end{equation} Let us assume that \begin{equation} \psi_\alpha=0\text{ \ for \ }\alpha\geq R_{\ast }. \nonumber \end{equation} For such test functions we have $\psi_{\alpha+\beta}\chi _{\{ \alpha+\beta \leq R_{\ast }\}} =\psi_{\alpha+\beta}$, therefore, \begin{equation} \sum_{\beta \leq R_{\ast }}\sum_{\alpha \leq R_{\ast }}K_{\varepsilon ,R_{\ast }}(\alpha ,\beta )n_{\varepsilon ,R_{\ast }}(\alpha )n_{\varepsilon ,R_{\ast }}(\beta )\left[\alpha(\psi_{ \alpha+\beta}-\psi_\alpha)\right] +\sum_{\alpha \leq R_{\ast }}\alpha\psi_\alpha s_\alpha=0.\nonumber \end{equation} Choosing a test function $\psi_\alpha = \chi_{\{\alpha \leq z\}}$ we obtain \begin{equation} \sum_{\alpha \leq z} \alpha n_{\varepsilon ,R_{\ast }}(\alpha )\sum_{\beta > z-\alpha}K_{\varepsilon ,R_{\ast }}(\alpha ,\beta )n_{\varepsilon ,R_{\ast }}(\beta ) = \sum_{\alpha < z} \alpha s_\alpha,\ \ z\in \left( 0,R_{\ast }\right).\nonumber \end{equation} We can then argue as in the proof of \eqref{EstTruncFunction} to obtain \begin{equation*} \sum_{\alpha < R_*} n_{\varepsilon ,R_{\ast }}(\alpha ) \leq \bar{C}_{\varepsilon}. \end{equation*} Therefore there exists a subsequence $R_{\ast}^{n}\to\infty$ and $(n_{\varepsilon}(\cdot ) )\in \ell^{1}({\mathbb N})$ such that $n_{\varepsilon, R^n_{\ast }}(\alpha ) \to n_{\varepsilon}(\alpha)$ for any $\alpha \in {\mathbb N}$. Moreover, $\sum_{\alpha } n_{\varepsilon}(\alpha ) \leq \bar{C}_{\varepsilon}$ and for any bounded test function $\varphi: {\mathbb N} \to {\mathbb R}_+$, $n_{\varepsilon }$ satisfies \begin{equation} \frac{1}{2}\sum_{\beta}\sum_{\alpha }K_{\varepsilon}(\alpha ,\beta )n_{\varepsilon }(\alpha )n_{\varepsilon}(\beta )\left[ \varphi_{\alpha +\beta }-\varphi_\alpha -\varphi_\beta \right] +\sum_{\beta}s_{\beta }\varphi_\beta =0.\label{WeakD_FormEps} \end{equation} Following the same reasoning as in the derivation of \eqref{A1} and \eqref{A2} in the proof of Theorem \ref{thm:existence} we then arrive at \begin{eqnarray} \frac{1}{\beta}\sum_{\alpha \in \left[\frac{2\beta}{3},\beta\right]\cap {\mathbb N}}n_{\varepsilon }(\alpha) &\leq &\frac{c}{\beta^{3/2}}\left( \frac{1}{\min \left\{ \beta^{\gamma},\frac{1}{\varepsilon }\right\} }\right) ^{1/2} \nonumber \\ &\leq & \frac{C}{ \beta^{3/2} \sqrt{\varepsilon}},\ \ \text{ for all }\beta \in {\mathbb N}. \label{IntEstFEps_D} \end{eqnarray} Then, taking subsequences, we obtain that there exists a limit sequence $(n(\alpha ))_{\alpha\in{\mathbb N}}$ such that $n_{\varepsilon_{n}}(\alpha )\to n(\alpha)$ as $n\to\infty$ with $\varepsilon_n\to 0$ as $n\to\infty$ for any $\alpha\in {\mathbb N}$. Definition~\eqref{eq:1levTrunc} implies that $\lim_{\varepsilon \rightarrow 0}K_{\varepsilon }\left( \alpha,\beta\right) =K\left(\alpha,\beta\right)$ uniformly in compact sets. Taking now the limit as $n\to\infty$ in \eqref{WeakD_FormEps} we obtain that $n$ satisfies: \begin{equation} \frac{1}{2}\sum_{\beta}\sum_{\alpha }K(\alpha ,\beta )n(\alpha )n(\beta )\left[ \varphi_{\alpha+\beta }-\varphi_\alpha -\varphi_\beta \right] +\sum_{\beta}s_{\beta }\varphi_\beta =0, \end{equation} for every test function $\varphi$ compactly supported. The only difficulty doing that is to control the contribution due to the regions with $\beta\geq M$ with $M$ large in the sums $$\sum_{\beta}\sum_{\alpha }K(\alpha ,\beta )n_{\varepsilon}(\alpha )\varphi_\alpha n_{\varepsilon}(\beta ).$$ This can be made arguing exactly as in the proof of Theorem \ref{thm:existence} distinguishing the cases \eqref{C1}-\eqref{C4} and replacing the integrals by sums. Moreover, taking the limit of (\ref{IntEstFEps_D}) as $\varepsilon \rightarrow 0$ we arrive at:% \begin{equation*} \frac{1}{\beta}\sum_{\alpha \in [2\beta /3,\beta]\cap {\mathbb N}}n(\alpha)\leq \frac{C}{\beta^{3/2+\gamma /2}}\ \ \text{ for all }\beta\in {\mathbb N}, \end{equation*} which implies \begin{equation*} \frac{1}{\beta}\sum_{\alpha \in [2\beta/3,\beta]\cap {\mathbb N}} \alpha^{\gamma + \lambda} n(\alpha)\leq \bar C \beta^{\gamma + \lambda - 3/2-\gamma /2}\ \ \text{ for all }\beta\in {\mathbb N}, \end{equation*} which implies (\ref{eq:Dmoment_cond}) using that $-1<\gamma +2\lambda<1$ . \end{proofof} \begin{remark} We notice that in the paper \cite{RT} it has been proved that there exists a unique stationary solution of a problem that can be reformulated as a solution of \eqref{eq:Dtimecoag} for the explicit kernel $K_{\alpha,\beta}=\alpha\beta.$ \end{remark} \bigskip \subsection{Non-existence result}\label{ssec:discr1dNEx} We first give an example of a construction of a continuous kernel $\widetilde K$ which interpolates the values of the discrete kernel $K_{\alpha,\beta}$ and satisfies \eqref{eq:cond_kernel2}-\eqref{eq:cond_kernel3}. Let $K_{\alpha, \beta}$ satisfy \eqref{eq:Dcond_kernel1}-\eqref{eq:Dcond_kernel3} and let $w$ denote the corresponding weight function in (\ref{eq:cond_kernel}). We define the continuous kernel $\widetilde{K}: ({\mathbb R}_*)^2 \to {\mathbb R}_+$ by setting \begin{equation}\label{eq:dc_K} \widetilde K(x,y) = \sum_{\alpha,\beta=1}^\infty K_{\alpha,\beta} \zeta_\varepsilon(x-\alpha) \zeta_\varepsilon(y-\beta)+ c_1 \left(\zeta_\varepsilon(x) + \zeta_\varepsilon(y)\right) w(x,y)\,, \quad x,y>0\,, \end{equation} where $\varepsilon<1/2$ and $\zeta_\varepsilon$ is a continuous non-negative function satisfying $\zeta_\varepsilon (x)= 0,\ |x| \geq 1/2+\varepsilon$, $\zeta_\varepsilon (x)= 1,\ |x| \leq 1/2-\varepsilon$ and affine in each interval $(1/2-\varepsilon,1/2+\varepsilon)$ and $(-1/2-\varepsilon,-1/2+\varepsilon)$. We remark that the series in (\ref{eq:dc_K}) is convergent at any $x$ and $y$ since it contains at most $4$ non-zero terms. The function $\widetilde K$ is continuous, non-negative and symmetric as it is written as a sum of functions with the same properties. We now show that $\widetilde K$ satisfies the growth bounds \eqref{eq:cond_kernel2}-\eqref{eq:cond_kernel3} with the same exponents $\gamma, \lambda$ of the discrete kernel $K_{\alpha,\beta}$, although possibly for different constants $c_1$ and $c_2$. Let us observe first that, if $x<\frac{1}{2}$ or $y<\frac{1}{2}$, the second term in (\ref{eq:dc_K}) is proportional to $w(x,y)$ and thus already provides a suitable lower bound. The upper bound may also be checked to hold then, after possibly adjusting $c_2$ from the value in (\ref{eq:Dcond_kernel3}). Hence, we assume $x,y\ge \frac{1}{2}$ in the following. For each $\alpha,\beta \in {\mathbb N}$, we have from \eqref{eq:dc_K} that $\widetilde K(\alpha,\beta)=K_{\alpha,\beta}$. Therefore $\widetilde K(x,y)$ satisfies \eqref{eq:cond_kernel2}-\eqref{eq:cond_kernel3} for $x=\alpha$ and $y=\beta$. If $x\in [\alpha-1/2, \alpha+1/2]$, $y\in [\beta-1/2, \beta+1/2]$ we have that $\frac{1}{2}K_{\alpha,\beta} \leq \widetilde K(x,y) \leq \sum_{i,j=-1,0,1 } K_{\alpha+i,\beta+j} + c_1 \left(\zeta_\varepsilon(x) + \zeta_\varepsilon(y)\right) w(x,y)$, where we set $K_{0,j}=K_{j,0}=0$ for $j\in {\mathbb N}$. Using the bounds \eqref{eq:Dcond_kernel2}, \eqref{eq:Dcond_kernel3}, and the monotonicity properties of $w$, this implies that there exist positive constants $c_1$ and $c_2$ such that $\widetilde K(x,y)$ satisfies \eqref{eq:cond_kernel2}-\eqref{eq:cond_kernel3}. \begin{lemma}\label{lem:discrete_sol_continuous} Assume that: \begin{itemize} \item $K: {\mathbb N}^2 \to {\mathbb R}_+$ is a function satisfying \eqref{eq:Dcond_kernel1} and \eqref{eq:Dcond_kernel3}, \item $\widetilde K: {\mathbb R}_*^2 \to {\mathbb R}_+ $ is a continuous interpolation of $K$ satisfying \eqref{eq:cond_kernel1} and \eqref{eq:cond_kernel3}, i.e., $\widetilde K \in C({\mathbb R}_*^2) $ and $K_{\alpha, \beta} = \widetilde K(\alpha,\beta)$, \item $s = (s_\alpha)_{\alpha \in {\mathbb N}} $ satisfies $s \neq 0$ and \eqref{eq:Dcond_s}, \item $(n_\alpha )_{\alpha \in {\mathbb N}}$ is a stationary injection solution to \eqref{eq:Dtimecoag} in the sense of Definition \ref{Def:DFluxSol}. \end{itemize} Let $f, \eta \in \mathcal{M}_+({\mathbb R}_*)$ be defined by $ f(dx)=\sum_{\alpha=1}^\infty n_\alpha \delta_{\alpha}(dx)$ and $ \eta(dx) = \sum_{\alpha=1}^\infty s_{\alpha}\delta_{\alpha}(dx) $, where $\delta_{\alpha} \in \mathcal{M}_+({\mathbb R}_*)$ is the Dirac measure at $\alpha$. Then $f$ is a stationary injection solution to the continuous coagulation equation \eqref{eq:time_evol} in the sense of Definition \ref{DefFluxSol} with the kernel $\widetilde K$ and source $\eta$. \end{lemma} \begin{proof} We first notice that $\eta$ satisfies \eqref{eq:cond_eta} with $L_\eta = L_s$ and $\widetilde K$ satisfies \eqref{eq:cond_kernel1} and \eqref{eq:cond_kernel3}. Therefore $\widetilde K$ and $\eta$ satisfy the assumptions of Definition \ref{DefFluxSol}. For $f \in \mathcal{M}_+({\mathbb R}_+)$ such that $f=\sum_{\alpha=1}^\infty \delta_{\alpha} n_\alpha$, we have that $f((0,1))=0$. Since $(n_\alpha )_{\alpha \in {\mathbb N}}$ is a stationary injection solution in the sense of Definition \ref{Def:DFluxSol}, then it satisfies \eqref{eq:Dmoment_cond}. Using \eqref{eq:Dmoment_cond} and using Fubini's theorem to exchange the sum and the integral, we obtain: \begin{eqnarray} \infty &>& \sum_{\alpha=1 }^{\infty} \alpha^{\gamma +\lambda }n_{\alpha} + \sum_{\alpha=1 }^{\infty} \alpha^{-\lambda }n_{\alpha} \nonumber\\ &=& \sum_{\alpha=1}^\infty \int_{\left(0,\infty \right) }x^{\gamma +\lambda } n_\alpha { \delta_{\alpha}(dx) } + \sum_{\alpha=1}^\infty \int_{\left(0,\infty \right) }x^{-\lambda } n_\alpha { \delta_{\alpha}(dx) } \nonumber\\ &=& \int_{\left(0,\infty \right) }x^{\gamma +\lambda }\sum_{\alpha=1}^\infty n_\alpha { \delta_{\alpha}(dx) }+ \int_{\left(0,\infty \right) }x^{-\lambda }\sum_{\alpha=1}^\infty n_\alpha { \delta_{\alpha}(dx) } \nonumber\\ &=&\int_{\left(0,\infty \right) }x^{\gamma +\lambda }f\left( dx\right) + \int_{\left(0,\infty \right) }x^{-\lambda }f\left( dx\right) \nonumber \end{eqnarray} which proves \eqref{eq:moment_cond}. For any test function $\varphi \in C_{c}({\mathbb R}_*)$ we use Fubini's theorem to exchange the sum and the integral yielding: \begin{equation}\label{eq:disc_cont1} \int_{ (0,\infty )} \varphi\left( x\right) \eta \left( dx\right) =\int_{(0,\infty )}\varphi\left( x\right) \sum_{\alpha=1}^\infty s_{\alpha} { \delta_{\alpha}(dx) } = \sum_{\alpha=1}^\infty \int_{ (0,\infty )}\varphi\left( x\right) s_{\alpha}{ \delta_{\alpha}(dx) } =\sum_{ \alpha=1 }^\infty s_{\alpha}\varphi_{\alpha}. \end{equation} Using \eqref{eq:moment_cond} we have that for any test function $\varphi \in C_{c}({\mathbb R}_*)$, $$\iint_{ (0,\infty )^2}\widetilde K\left( x,y\right) \left[ \varphi \left( x+y\right) -\varphi \left( x\right) -\varphi \left( y\right) % \right] f\left( dx\right) f\left( dy\right) < \infty $$ is well-defined. Using again Fubini's theorem we obtain that \begin{eqnarray}\label{eq:disc_cont2} &&\frac{1}{2}\iint_{(0,\infty )^2}\widetilde K\left( x,y\right) \left[ \varphi \left( x+y\right) -\varphi \left( x\right) -\varphi \left( y\right) % \right] f\left( dx\right) f\left( dy\right) \nonumber\\ && \hspace{2cm} = \frac {1}{2}\sum_{\beta}\sum_{\alpha}K_{\alpha,\beta}n_{\alpha}n_{\beta}\left[ \varphi_{\alpha+\beta}-\varphi_{\alpha}-\varphi_{\beta}\right]. \end{eqnarray} Adding \eqref{eq:disc_cont1} with \eqref{eq:disc_cont2} and using \eqref{eq:Dweakform} we obtain \eqref{eq:stationary_eq}, which concludes the proof. \end{proof} Let $\mathcal{C} \subset \mathcal{M}_+({\mathbb R}_+)$ be the set of positive bounded Radon measures supported on the natural numbers, i.e., $$\mathcal{C} = \{ f \in \mathcal{M}_+({\mathbb R}_*)\ | \ f = \sum_{\beta = 1}^\infty n_\beta {\delta_{\beta}},\ n_\beta \geq 0,\ \beta \in {\mathbb N} \}.$$ \begin{proofof}[Proof of Theorem~\ref{thm:DNonExistence} (non-existence)] We first recall the interpolation construction in the beginning of the Section which allows to extend to the discrete bounds \eqref{eq:Dcond_kernel2}-\eqref{eq:Dcond_kernel3} and construct a continuous interpolation kernel $\widetilde K$ such that \eqref{eq:cond_kernel2}-\eqref{eq:cond_kernel3} hold. From Theorem~\ref{thm:existence} there is no stationary injection solution to \eqref{eq:time_evol} in the sense of Definition~\ref{DefFluxSol}. In particular, by Lemma \ref{lem:discrete_sol_continuous} then there is no solution in the subset of discrete measures $\mathcal{C}$, which concludes the proof. \end{proofof} \bigskip \bigskip \bigskip \section{Estimates and regularity}\label{sec:estimates} In order to define upper and lower estimates for the measure $f$ we need detailed estimates for the fluxes $J$ defined on the left hand side of (\ref{eq:flux_lem}) in Lemma \ref{lem:flux}. That is, we consider the function \[ J(z) = \iint_{\Omega_z} K\left( x,y\right) xf \left( dx\right) f\left( dy\right) \,, \quad z >0, \] where \begin{equation}\label{eq:Omegaz} \Omega_z := \{(x,y)\ |\ 0< x \leq z ,\ y > z-x \}. \end{equation} Given $\delta>0$, we introduce a partition of $({\mathbb R}_+)^2= \Sigma_1(\delta) \cup \Sigma_2(\delta) \cup \Sigma_3(\delta) $ by \begin{equation} \label{eq:sigma}\Sigma_1(\delta) = \{(x,y)\ |\ y > x/\delta \}\,,\quad \Sigma_2(\delta) = \{(x,y)\ |\ \delta x\leq y \leq x/\delta \}\,,\quad \Sigma_3(\delta) = \{(x,y)\ |\ y < \delta x \} \,, \end{equation} and we then define for $j=1,2,3$ \begin{equation} \label{eq:fluxeq_j} J_j(z,\delta) = \iint_{\Omega_z \cap \Sigma_j(\delta)}K\left( x,y\right) xf \left( dx\right) f\left( dy\right) \ \text{for }z >0. \end{equation} Clearly, $J(z) = \sum_{j=1}^3 J_j(z,\delta) $ for any choice of $\delta$. The following Lemma will be used to prove that the contribution to the integral defining the fluxes due to the points contained in $ \Sigma_1(\delta)$ and $ \Sigma_3(\delta) $ are small for $\delta$ sufficiently small. \begin{lemma}\label{lem:J} Let $K$ satisfy~\eqref{ContinAssumpt}--\eqref{eq:cond_kernel3} and $| \gamma +2\lambda | <1.$ Suppose that $f \in \mathcal{M}_+({\mathbb R}_*)$ satisfies \begin{equation} \frac{1}{z}\int_{[z/2,z]} f(dx) \leq \frac{ A }{z^{(\gamma + 3)/2}}\ \ \text{ for all } z>0. \label{eq:lemm_upperBound} \end{equation} Then for every $\varepsilon>0$ there exists a $ \delta_{\varepsilon}>0$ depending on $\varepsilon$ as well as on $\gamma,\ \lambda$ and on the constants $c_1,\ c_2$ in \eqref{eq:cond_kernel2}--\eqref{eq:cond_kernel3} but independent of $A$ such that for any $\delta \leq \delta_{\varepsilon} $ we have that \begin{equation}\label{eq:flux_sigma1} \sup_{z>0} J_1(z,\delta) \leq \varepsilon A^2 \end{equation} and \begin{equation}\label{eq:flux_sigma3} \sup_{R>0}\frac{1}{R}\int_{[R,2R]} J_3(z,\delta)dz \leq \varepsilon A^2. \end{equation} \end{lemma} \begin{proof} We set $\theta := 1/\delta>1$. In order to estimate the contribution due to the region $ \Sigma_1(\delta) \cap \Omega_z$ we define $$ D(z,\theta):= \{(x,y)\ |\ 0< x \leq z,\ \max\{\theta x ,z/2\} \leq y \}.$$ First suppose that $2\lambda+\gamma \geq 0 $. Using the upper bound for $K$ given in \eqref{eq:cond_kernel3} and the fact that $\Omega_z \cap \Sigma_1 \subset D(z,\theta)$ we obtain that \begin{equation* \iint_{\Omega_z \cap \Sigma_1 }K\left( x,y\right) xf \left( dx\right) f\left( dy\right) \leq 2 c_2 \iint_{D(z,\theta) } x^{1-\lambda}y^{\gamma+\lambda} f \left( dx\right) f\left( dy\right).\ \end{equation*} { Assuming $0<x\le z$ we denote $a:=\max\{\theta x ,z/2\}$. Then we can employ item \ref{it:Risinf} of Lemma \ref{lem:bound} and the upper bound \eqref{eq:lemm_upperBound} to estimate \[ \int_{[a,\infty)} y^{\gamma+\lambda} f\left( dy\right) \le A \frac{2^{|\gamma+\lambda|}}{\nu \ln 2} a^{-\nu}\,, \] where $\nu:=\frac{1-|2\lambda+\gamma|}{2}=\frac{1-(2\lambda+\gamma)}{2}>0$. Therefore, by Fubini's theorem, we can now conclude that \begin{align}\label{eq:Omzcap1} \iint_{\Omega_z \cap \Sigma_1} K\left( x,y\right) x f \left( dx\right) f\left( dy\right) \leq C A \int_{(0,z]} \max\{\theta x ,z/2\}^{-\nu} x^{1-\lambda} f \left( dx\right)\,. \end{align} Denoting $\varphi(x)=\max\{\theta x ,z/2\}^{-\nu} x^{1-\lambda} $, it follows from \eqref{eq:lemm_upperBound} that \[ \frac{1}{y}\int_{[y/2,y]} \varphi(x) f(dx) \leq 2^\nu \max\{\theta y ,z\}^{-\nu} 2^{|1-\lambda|} A y^{\nu-1}\,, \quad \text{ for all } y>0. \] Thus by item \ref{it:Rlessinf} of Lemma \ref{lem:bound}, we find that for any $a'\in (0,z]$, \[ \int_{[a',z]} \varphi(x) f \left( dx\right)\le 2^{|1-\lambda|+\nu} A \int_{[a',z]} \max\{\theta y ,z\}^{-\nu} y^{\nu-1} dy + 2^{|1-\lambda|+\nu} A \max\{\theta ,1\}^{-\nu} \,. \] The limit $a'\to 0$ of the right hand side is finite, and thus we can use monotone convergence theorem to conclude that \[ \int_{(0,z]} \varphi(x) f \left( dx\right)\le 2^{|1-\lambda|+\nu} A \left(\int_{0}^z \max\{\theta y ,z\}^{-\nu} y^{\nu-1} dy + \theta^{-\nu}\right) \,. \] Evaluating the remaining integral and inserting the result in (\ref{eq:Omzcap1}) yields \begin{eqnarray*} \iint_{\Omega_z \cap \Sigma_1} K\left( x,y\right) x f \left( dx\right) f\left( dy\right) \nonumber & \leq & C A^2 \left(1+ \frac{1}{\nu} + \ln \theta \right)\theta^{-\nu} \,. \label{eq:flux1} \end{eqnarray*} Since $\nu >0$, the factor multiplying $A^2$ converges to $0$ as $\theta \to \infty$, i.e., also when $\delta\to 0$. Therefore, to any $\varepsilon>0$ there is $\delta_\varepsilon>0$ such that \eqref{eq:flux_sigma1} holds for all $0<\delta\le \delta_\varepsilon$. In the case where $\gamma +2\lambda <0$ we have $\nu=\frac{1+2\lambda+\gamma}{2}>0$. The above steps can then be repeated simply by exchanging the exponents $\gamma+\lambda$ and $-\lambda$ therein. We find \begin{align* & \iint_{\Omega_z \cap \Sigma_1 }K\left( x,y\right) xf \left( dx\right) f\left( dy\right) \leq 2 c_2 \iint_{D(z,\theta) } x^{1+\gamma+\lambda}y^{-\lambda} f \left( dx\right) f\left( dy\right) \\ & \quad \le C A^2 \left(1+ \frac{1}{\nu} + \ln \theta \right)\theta^{-\nu}\,. \end{align*} Thus also in this case \eqref{eq:flux_sigma1} holds for all sufficiently small $\delta$. To study the region $\Sigma_3(\delta)$, we return to the case $\gamma +2\lambda \ge 0$ and assume also $\delta\le \frac{1}{4}$. Then we have that $$\Omega_z \cap \Sigma_3(\delta) \subset \{(x,y)\ |\ 0 < y \leq \delta z,\ z-y \leq x \leq z \}\,.$$ In particular, if $(x,y)\in \Omega_z \cap \Sigma_3(\delta)$, we have $x\ge (1-\delta)z\ge (\delta^{-1}-1)y> y$. We integrate \eqref{eq:fluxeq_j} in $z$ from $R$ to $2R$, and using \eqref{eq:cond_kernel3} we obtain \begin{eqnarray*} I_3 &:=& \int_{[R,2R]}\iint_{\Omega_z \cap \Sigma_3} K\left( x,y\right) xf \left( dx\right) f\left( dy\right)dz \\ & \leq & 2 c_2 \int_{[R,2R]} \int_{(0,\delta z]} \int_{[z-y,z]} x^{1+\gamma+\lambda}y^{-\lambda}f \left( dx\right)f\left( dy\right)dz . \end{eqnarray*} Notice that in the region of integration we have $ R/2 \leq x \leq z\leq 2R$ since $\delta \le \frac{1}{2}$. Therefore, $(0,\delta z] \subset (0,2\delta R]$. Thus there exists a constant $C>0$ independent of $\delta$ and $R$ such that \begin{eqnarray*} I_3 &\leq & C R^{1+\gamma+\lambda} \int_{[R,2R]} \int_{(0,2 \delta R]} \int_{[z-y,z]} y^{-\lambda}f \left( dx\right)f\left( dy\right)dz. \end{eqnarray*} Using now Fubini's theorem, as well as the fact that $\{(x,z)\ |\ z-y\leq x \leq z,\ R \leq z \leq 2R \} \subset \{(x,z)\ |\ R/2 \leq x \leq 2R, \ x\leq z\leq x+y \}$ if $0<y\le R/2$, we obtain \begin{eqnarray*} I_3 &\leq & C R^{1+\gamma+\lambda}\int_{(0,2\delta R]} y^{-\lambda} f\left( dy\right) \int_{[R/2,2R]}f\left( dx\right) \int_{[x,x+y]} dz \\ &=& C R^{1+\gamma+\lambda}\int_{(0,2\delta R]} y^{1-\lambda}f\left( dy\right) \int_{[R/2,2R]} f\left( dx\right). \end{eqnarray*} Then using the bound \eqref{eq:lemm_upperBound}, the assumption $|\gamma +2\lambda|<1$, and item \ref{it:polcase} of Lemma \ref{lem:bound} applied separately to both of the remaining integrals and with a regularization by $a'\to 0$ in the first integral, we obtain \[ I_3 \leq CA^2 R^{1+\gamma + \lambda} \delta^\nu R^{\nu} R^{-\frac{\gamma+1}{2}}= C A^2 \delta^\nu R, \] where $\nu = \frac{1-|2\lambda+\gamma|}{2}>0$, as before, and $C$ is an adjusted constant independent of $R$ and $\delta$. Thus the prefactor of $A^2 R$ goes to zero as $\delta\to 0$, and we may conclude that to any $\varepsilon>0$ there is $\delta_\varepsilon>0$ such that \eqref{eq:flux_sigma3} holds for all $0<\delta\le \delta_\varepsilon$. Taking smaller of the cutoffs $\delta_\varepsilon$ obtained for \eqref{eq:flux_sigma1} and \eqref{eq:flux_sigma3}, we find a value such that both inequalities are valid whenever $0<\delta\le \delta_\varepsilon$. In the case where $\gamma +2\lambda <0$, also \eqref{eq:flux_sigma3} can be checked as in the first case, by exchanging the exponents $\gamma+\lambda$ and $-\lambda$ in the above. } \end{proof} In this Section we use the assumptions of Theorem~\ref{thm:existence} as stated next which guarantee the existence of a stationary injection solution $f$ in the sense of Definition~\ref{DefFluxSol}. \begin{assumption}\label{assump:estimates} Let $K$ satisfy~\eqref{ContinAssumpt}--\eqref{eq:cond_kernel3} and suppose $| \gamma +2\lambda | <1.$ Let $\eta \neq 0 $ satisfy \eqref{eq:cond_eta}. Let $f \in \mathcal{M}_+({\mathbb R}_*)$, $f\neq 0$ be a stationary injection solution to~\eqref{eq:time_evol} in the sense of Definition~\ref{DefFluxSol} with $f((0,a))=0$, for some $a>0$ (cf.\ Remark \ref{rem:defFluxSol}). \end{assumption} Under Assumption \ref{assump:estimates} we obtain, from Lemma \ref{lem:flux}, that $f$ satisfies: \begin{equation}\label{eq:fluxeq} \iint_{\Omega_z }K\left( x,y\right) xf \left( dx\right) f\left( dy\right) = \int_{(0,z]}x\eta \left(dx\right) \ \text{for }z > 0. \end{equation} Notice that Lemma \ref{lem:J} shows that the contributions of the regions $\Sigma_j(\delta) \cap \Omega_z$ with $j=1,3$ to the fluxes defined in \eqref{eq:flux} are small for $\delta $ sufficiently small. This shows that the flux of particles in the size space is due to region $\Sigma_2(\delta) \cap \Omega_z$, which yields the contribution of the collisions between particles of comparable size. \begin{proposition}\label{prop:estimate} Suppose that Assumption \ref{assump:estimates} holds. Let $J$ be the constant $J= \int_{(0,L_\eta]} x \eta (dx)$. Then: \begin{equation} \frac{1}{z}\int_{[z/2,z]} f(dx) \leq \frac{ C_1\sqrt{J} }{z^{(\gamma + 3)/2}}\ \ \text{ for all } z>0. \label{eq:integral_bounds1} \end{equation} Moreover, there exists a constant $b$, with $0<b<1$ and depending on $\gamma,\ \lambda$ and on the constants $c_1,\ c_2$ in \eqref{eq:cond_kernel2}-\eqref{eq:cond_kernel3} such that \begin{equation} \frac{1}{z}\int_{ (bz,z]} f(dx) \geq \frac{ C_2\sqrt{J} }{z^{(\gamma + 3)/2}}\ \ \text{ for all } z\geq \frac{L_\eta}{\sqrt{b}} \ .\label{eq:integral_bounds2} \end{equation} The constants $C_1, \ C_2$ that appear in \eqref{eq:integral_bounds1} and \eqref{eq:integral_bounds2} depend on $\gamma,\ \lambda$ and on the constants $c_1,\ c_2$ in \eqref{eq:cond_kernel2}-\eqref{eq:cond_kernel3}. \end{proposition} \begin{proof} Using Lemma \ref{lem:flux} we obtain that \eqref{eq:fluxeq} holds. We first prove the upper bound \eqref{eq:integral_bounds1}. Using that $[2z/3,z]^2 \subset \Omega_z$, where $\Omega_z$ is as in \eqref{eq:Omegaz}, we obtain \begin{equation*} \iint_{\left[ 2z/3,z\right]^2} K\left( x,y\right) xf \left( dx\right) f\left( dy\right) \leq J. \end{equation*} Using the lower bound~\eqref{eq:cond_kernel2} for $K$ and the fact that $x$ and $y$ are of the same order of $z$ in the domain of integration we obtain \begin{equation*} z^{\gamma+1} \left( \int_{\left[ 2z/3,z\right] } f \left( dx\right)\right)^2 \leq C^2 J \end{equation*} for some positive constant $ C$ which depends only on $K$. Equivalently, \begin{equation} \frac{1}{z}\int_{\left[ 2z/3,z\right] } f \left( dx\right) \leq \frac{ C \sqrt{J}}{z^{(\gamma+3)/2}},\ \text{for }z\in (0,\infty), \label{eq:upperEstimate} \end{equation} which proves the upper estimate using that $[z/2,z]\subset [4z/9,2z/3] \cup [2z/3,z] $. Using $J= \int_{(0,L_\eta]} x \eta (dx)$ in \eqref{eq:fluxeq} as well as the definition of $J_j$ in \eqref{eq:Omegaz}--\eqref{eq:fluxeq_j} we obtain \begin{equation}\label{eq:sumJ} J = \sum_{j=1}^3 J_j(z,\delta),\ \ z\geq L_\eta. \end{equation} Integrating \eqref{eq:sumJ} with respect to $z$ in $[R,2R]$, using the upper estimate \eqref{eq:integral_bounds1} as well as Lemma \ref{lem:J} we obtain that for $\delta >0$ sufficiently small depending only on $\gamma,\ \lambda$ and on the constants $c_1,\ c_2$ in \eqref{eq:cond_kernel2}--\eqref{eq:cond_kernel3}, the following chain of inequalities holds with $A:=C \sqrt{J}$ and $\varepsilon \leq \frac{1}{4A^2}$ \begin{eqnarray*} \frac{JR}{2} &\leq & J(1-2\varepsilon A^2) R \leq \int_{[R,2R]} J_2(z,\delta) dz \\ &\leq & \int_{[R,2R]}\iint_{\Omega_z \cap \Sigma_2(\delta)} K\left( x,y\right) xf \left( dx\right) f\left( dy\right)dz, \quad R \geq L_\eta \ . \end{eqnarray*} A simple geometrical argument shows that there exists a constant $b$, $0<b<1$, depending only on $\delta$ (and therefore on $\gamma,\ \lambda,\ c_1$ and $c_2$) such that $\underset{z \in [R,2R]}{\bigcup} (\Omega_z \cap \Sigma_2(\delta)) \subset (\sqrt{b}R, R/\sqrt{b}]^2 $. (For a fixed $z$ and $(x,y)\in \Omega_z \cap \Sigma_2(\delta)$ one finds $(\delta^{-1}+1)^{-1} z<x,y\le \delta^{-1} z$; thus for example $b = \frac{\delta^2}{4}$ would suffice.) Moreover, for every $(x,y) \in (\sqrt{b}R, R/\sqrt{b}]^2 $ we have $x K(x,y) \leq C R^{\gamma+1}$, with $C$ depending only on $\gamma,\ \lambda,\ c_1$ and $c_2$. Then \begin{equation*} \frac{JR}{2} \leq C R R^{\gamma+1} \left( \int_{(\sqrt{b}R, R/\sqrt{b}]}f\left( dx\right) \right)^2, \end{equation*} whence $1/R \int_{(\sqrt{b}R,R/{\sqrt{b}}]} f(dx) \geq C \sqrt{J} R^{-(\gamma+3)/2}$ for $R\geq L_\eta$. Thus \eqref{eq:integral_bounds2} follows after substituting $R/\sqrt{b}$ by $z$. \end{proof} In the next Corollary we obtain the moment estimates for a stationary injection solution, when it exists. \begin{corollary}\label{cor:moments} Suppose that Assumption \ref{assump:estimates} holds. Then we have the following moment estimates: \begin{enumerate} \item[a)] $ \int_{\mathbb{R}_{*}}x^{\mu}f\left( dx\right) < \infty \quad \text{for }\quad \mu < \frac{\gamma + 1}{2} $ , \item[b)] $\int_{\mathbb{R}_{*}}x^{\frac{\gamma+1}{2}}f\left( dx\right) = \infty$ . \end{enumerate} \end{corollary} \begin{proof} a) The boundedness of moments of order $\mu$ for $\mu < \frac{\gamma+1}{2}$ has already been obtained in the proof of Theorem~\ref{thm:existence} in Section~\ref{sec:existence} equation~\eqref{eq:moment_mu}. Notice also that $a)$ is an easy consequence of \eqref{eq:integral_bounds1} and Lemma \ref{lem:bound}. b) Using the lower bound~\eqref{eq:integral_bounds2} and multiplying by $z^{(\gamma+3)/2}$ we obtain \begin{equation*} C_2\sqrt{J} \leq z^{(\gamma+1)/2} \int_{(bz,z]}f(dx) \leq C \int_{(bz,z]}x^{(\gamma+1)/2} f(dx),\quad z \geq \frac{L_\eta}{\sqrt{b}} \end{equation*} for some constant $C>0$. In particular, for any natural number $n$ satisfying $b^{-n}\ge L_\eta / \sqrt{b}$ and for $z=b^{-n}$ we have that $C_2\sqrt{J} \leq C \int_{(b^{1-n},b^{-n}]}x^{(\gamma+1)/2} f(dx)$. Summing in $n$ we finally obtain the result $b)$. \end{proof} \begin{remark} Notice that for $\gamma>1$ Corollary \ref{cor:moments} a) implies that the first moment $\int_{{\mathbb R}_*} xf(dx)$ is finite. Therefore the stationary injection solutions can be interpreted in this case as solutions having a finite number of monomers for which the source of monomers $\eta(x)$ is balanced with the flux of monomers towards infinity. This is closely related to the phenomenon of gelation, which takes place for $\gamma>1$, in which it is possible to have solutions with a finite number of monomers having a flux of monomers towards infinity. Notice that for $\gamma<1$ we have that $\int_{{\mathbb R}_*} xf(dx)$ is infinite. We further observe that the existence or non existence of stationary injection solutions is independent of the corresponding kernels yielding mass conservation or gelation. \end{remark} \begin{remark} We observe that for $\gamma>-1$, Corollary \ref{cor:moments} implies that the number of clusters associated to the stationary injection solutions $\int_{{\mathbb R}_*} f(dx)$ is finite and Proposition \ref{prop:estimate} together with Lemma \ref{lem:bound} yields the following integral estimates: $$ \frac{ C_1\sqrt{J}}{z^{(\gamma + 1)/2}} \leq \int_{[z,\infty)} f(dx) \leq \frac{ C_2\sqrt{J}}{z^{(\gamma + 1)/2}} \quad \text{for } z \geq L_{\eta} $$ where $J= \int_{(0,L_\eta]} x \eta (dx)$ and $0< C_1 \leq C_2 $. \end{remark} \begin{remark} The result in Corollary \ref{cor:moments} has been obtained in \cite{Dub} in the case of bounded kernels. \end{remark} The next Corollary contains the estimates for a stationary injection solution in the discrete case. \begin{corollary}\label{prop:Destimate} Assume that $K:{\mathbb{N}}^{2}\rightarrow {\mathbb{R}}_{+}$ satisfies~\eqref{eq:Dcond_kernel1}-% \eqref{eq:Dcond_kernel3} and $| \gamma +2\lambda | <1.$ Let $s \neq 0 $ satisfy \eqref{eq:Dcond_s}. Let $(n_\alpha)_{\alpha=1}^{\infty}$ be a stationary injection solution to~\eqref{eq:Dtimecoag} in the sense of Definition~\ref{Def:DFluxSol}. Then: \begin{equation} \frac{ C_1 \sqrt{J}}{z^{(\gamma + 3)/2}} \leq \frac{1}{z}\sum_{\alpha \in {\mathbb N} \cap [z/2,z]} n_\alpha \leq \frac{ C_2\sqrt{J}}{z^{(\gamma + 3)/2}}\ \ \text{ for all } z\geq L_{s} \label{eq:Dintegral_bounds} \end{equation} where $J=\sum_\alpha s_\alpha$ and the constants $0< C_1 \leq C_2 $ are independent of $s$. \end{corollary} \begin{proof} The results follow directly from Lemma \ref{lem:discrete_sol_continuous} and Proposition \ref{prop:estimate}. \end{proof} Finally we obtain that the solutions to the continuous problem when they exist are measures in $C^k({\mathbb R}_+)$ provided that the source $\eta$ and the kernel $K$ are functions in $ C^k({\mathbb R}_+)$ and that the derivatives of $K$ satisfy some growth conditions. \begin{lemma}\label{lem:estimate_x0} Suppose that Assumption \ref{assump:estimates} holds with $\eta \in L^\infty((0,\infty))$. Let $L_0 \geq \frac{1}{2}$ and $0<\rho < \frac{1}{8}$. Assume that there exists $A > 0$ such that \begin{equation} \int_{[x_0-r,x_0+r]}f(dx) \leq Ar\label{eq:reg_1} \end{equation} for all $r\leq \rho$ and for all $x_0 \in [\frac{1}{4}, L_0]$. Then there exists a constant $B>0$ that depends on $L_0,\ \eta$ and $A$, but it is independent of $r$ such that \begin{equation} \int_{[x_0-r,x_0+r]}f(dx) \leq B( A^2+\| \eta \|_{L^\infty}) r,\label{eq:reg_2} \end{equation} for any $x_0 \in [\frac{1}{4},L_0+1]$ and $r \leq \rho/2$. \end{lemma} \begin{proof} Using \eqref{eq:stationary_eq} we obtain for all $\varphi \in C_c({\mathbb R}_*)$ \begin{equation} \int_{{\mathbb R}_*} \varphi(x) \alpha(x) f(dx) = \int_{{\mathbb R}_*}\varphi \left( x\right) \eta \left( dx\right) + \frac{1}{2}\int_{{\mathbb R}_*}\int_{{\mathbb R}_*} K\left( x,y\right) \varphi \left( x+y\right) f\left( dx\right) f\left( dy\right), \label{eq:regu_stat} \end{equation} where \begin{equation} \label{eq:reg_3} \alpha(x) = \int_{{\mathbb R}_*} K(x,y) f(dy). \end{equation} The continuity and the lower estimate for the kernel $K$ (cf.\ \eqref{eq:cond_kernel2} and \eqref{ContinAssumpt}) imply that $\alpha(x) \geq \alpha_{L_0}>0, $ for all $x \in [\frac{1}{8},L_0+1]$. Using an approximation argument as in Lemma \ref{lem:flux}, we may use in \eqref{eq:regu_stat} a test function $\varphi(x) = \chi_{[x_0-r, x_0+r]}(x)$. Using the boundedness of $\eta$ we obtain \begin{equation} \int_{[x_0-r, x_0+r]}f(dx) \leq \frac{1}{\alpha_{L_0}} \left( 2 \| \eta\|_{L^\infty} r + \frac{1}{2}\int_{{\mathbb R}_*}\int_{{\mathbb R}_*} K\left( x,y\right) \chi_{[x_0-r, x_0+r]}(x+y) f\left( dx\right) f\left( dy\right) \right) \ . \end{equation} We now use a geometrical argument to show that for every $x_0 \in [\frac{1}{4}, L_0+1] $ and $r < \frac{\rho}{2} $ there exists a set $\{ \xi_\ell \}_{\ell \in { I}} \subset {\mathbb R}_+$ such that $\# {I} \leq \frac{L_0+1}{r}$ and $$ \{(x,y) \ |\ |x+y- x_0| \leq r \} \subset \bigcup_{\ell \in {I}} Q_\ell $$ with $Q_\ell=[\xi_\ell - 2r,\xi_\ell +2r] \times [x_0-\xi_\ell - 2r,x_0- \xi_\ell +2r]$ and $\xi_\ell \leq x_0 $ for all $\ell \in {I}$. This can be seen just locating points along the segment $\left\{ \left( x,y\right) :x+y=x_{0},\ x\geq0,\ y\geq0\right\} $ given by $\left\{ \left( \xi_{\ell},x_{0}-\xi_{\ell}\right) \right\} _{\ell\in I}$ and such that $\operatorname*{dist}\left( \xi_{\ell},\left\{ \xi_{j}\right\} _{j\in I}\backslash\left\{ \xi_{\ell}\right\} \right) =r.$ Then, the union of the cubes $Q_{\ell}$ cover the strip $\left\{ \left( x,y\right) :\left\vert x+y-x_{0}\right\vert \leq r,\ x\geq0,\ y\geq0\right\} .$ Using the boundedness of $K$ for $x\geq 1, y \geq 1$ and $x+y \leq L_0 + 1 + \frac{\rho}{2}$ as well as the fact that $f((0,1))=0$ by assumption, we obtain \begin{equation*} \int_{[x_0-r, x_0+r]}f(dx) \leq \frac{1}{\alpha_{L_0}} \left( 2 \| \eta\|_{L^\infty} r + C \sum_{\ell \in { I}} \iint_{Q_\ell} f\left( dx\right) f\left( dy\right) \right) \end{equation*} where $C$ depends on $K$ and $L_0$. Using \eqref{eq:reg_1} it follows that $\iint_{Q_\ell} f\left( dx\right) f\left( dy\right) \leq 4A^2 r^2 $. Then, since $\# I \leq \frac{L_0+1}{r}$, we get \begin{equation*} \int_{[x_0-r, x_0+r]}f(dx) \leq \frac{1}{\alpha_{L_0}} \left( 2 \| \eta\|_{L^\infty} r + 4 A^2 C (L_0+1)r \right). \end{equation*} Hence \eqref{eq:reg_2} follows. \end{proof} \begin{proposition} Suppose that Assumption \ref{assump:estimates} holds with $\eta \in C((0,\infty))$. Then $f \in C((0,\infty))$. In addition, suppose that for some $k\geq 1$ we have that $\eta \in C^k((0,\infty))$, $ K \in C^k((0,\infty)^2)$ and that for every $P>1$ there exists a constant $C_P$ such that \begin{equation}\label{eq:reg_5} \left|\frac{\partial^\ell K}{\partial x^\ell} (x,y)\right| \leq C_P[y^{-\lambda} + y^{\gamma+\lambda}],\ \ \ \forall x \in [1,P],\ y\in (0,\infty), \ 1 \leq \ell \leq k. \end{equation} Then $f \in C^k((0,\infty))$. \end{proposition} \begin{proof} Suppose that $\eta \in C((0,\infty))$. Using that $f((0,1))=0$ it follows that $\int_{[x_0-r, x_0+r]}f(dx) =0$ for all $x_0 \in [ 1/8, 1/2]$ and $r \leq \rho =1/8$. Given any $M>1/8$, it then follows from Lemma \ref{lem:estimate_x0} that $\int_{[x_0-r, x_0+r]}f(dx) \leq C_M r$ for any $x_0 \in [ 1/8, M]$ and $r \leq \rho_M$ and $\rho_M>0$ sufficiently small. Then, since every null set can be covered by a countable union of intervals with arbitrary small lengths, we have that $f$ is absolutely continuous with respect to the Lebesgue measure. Thus $f(dx)=f dx$ for some $f\in L^1_{loc}({\mathbb R}_{+})$. Moreover, $f(x_0)=\lim_{r\to 0} \frac 1 r \int_{[x_0-r,x_0+r]}f(dx),$ a.e. $x_0\in{\mathbb R}_ {+}$ whence $f(x_0)\leq C_{M}$ a.e. $x_0\in{\mathbb R}_ {+}$. Hence $f \in L_{\text{loc}}^\infty({\mathbb R}_+).$ Using also the weak formulation \eqref{eq:regu_stat} it follows that \begin{eqnarray*} f(x) &=& \frac{1}{\alpha(x)}[\eta(x)+\frac{1}{2} \int_0^x K(x-y,y) f(x-y)f(y)dy)]\,,\\ &=& \frac{1}{\alpha(x)}[\eta(x)+ \int_0^{x/2} K(x-y,y) f(x-y)f(y)dy)]\,, \end{eqnarray*} with $\alpha$ given in \eqref{eq:reg_3}. Then $f \in C((0,\infty))$ can be obtained by induction, taking as starting point the fact that $f(x)=0$ for $0 \leq x \leq 1$. The fact that $f \in C^k((0,\infty))$ if $\eta \in C^k((0,\infty)) $ and \eqref{eq:reg_5} follows in a similar manner. \end{proof} \bigskip \bigskip \bigskip \section{Convergence of discrete to continuous model}\label{sec:discr_cont} We start by defining constant flux solution (cf.\ Section \ref{sec:types_sol}). \begin{definition} \label{DefFluxSol2} Assume that $K:{\mathbb{R}}_{*}^{2}\rightarrow {\mathbb{R}% }_{+}$ is a continuous function satisfying \eqref{eq:cond_kernel1} and % \eqref{eq:cond_kernel3}. We will say that $f\in \mathcal{M}_+\left( 0,\infty \right) ,$ satisfying: \begin{equation} \int_{(0,\infty) }x^{\gamma +\lambda }f\left( dx\right) + \int_{(0,\infty ) }x^{-\lambda }f\left( dx\right) <\infty \label{eq:moment_cond2} \end{equation} is a constant flux solution of \eqref{eq:time_evol} with $\eta \equiv 0$ if the following identity holds for some constant $J\geq 0$ and for any $z>0$: \begin{equation} \int_{(0,z]}\int_{(z-y, \infty)}y K\left( x,y\right) f\left( dx\right) f\left( dy\right) =J. \label{eq:stationary_eq2} \end{equation} \end{definition} \begin{remark} Note that in Definition \ref{DefFluxSol2} we use measures $f\in \mathcal{M}_+\left( 0,\infty \right)$ and therefore the measure can be unbounded in any interval of the form $(0,a)$ for any $a>0$. \end{remark} Our goal is to prove that for a large class of kernels $K_{\alpha,\beta}$ satisfying \eqref{eq:Dcond_kernel1}-\eqref{eq:Dcond_kernel3}, the stationary injection solutions to the discrete problem \eqref{eq:Dtimecoag} can be approximated for large cluster sizes by constant flux solutions of the continuous problem \eqref{eq:time_evol} in the sense of Definition \ref{DefFluxSol2}. Since we proved in Theorems \ref{thm:Dexistence}-\ref{thm:DNonExistence} that stationary injection solutions to \eqref{eq:Dtimecoag} exist if and only if $|\gamma+2\lambda|<1$, we will assume this condition in the rest of this Section. To this end, for each $R>0$ we construct stationary injection solutions $f_R$ to \eqref{eq:time_evol} with some suitable kernel $K_R$ and $\eta_R$ satisfying $ \supp \eta_R \subseteq [1/R, L_\eta/R]$ (cf.\ Remark \ref{rem:defFluxSol}). Let $K_{\alpha, \beta}$ satisfy \eqref{eq:Dcond_kernel1}-\eqref{eq:Dcond_kernel3} with $\left\vert \gamma+2\lambda \right\vert <1$ and $s$ satisfy \eqref{eq:Dcond_s}. Let $(n_\alpha )_{\alpha \in {\mathbb N}}$ be a discrete stationary injection solution to \eqref{eq:Dtimecoag} in the sense of Definition \ref{Def:DFluxSol}. For each $R>0$, we define the measure $f_R \in \mathcal{M}({\mathbb R}_*) $ by \begin{equation}\label{eq:dc_fR} f_R(dx) = R^{(3+\gamma)/2}\sum_{\alpha=1}^\infty n_{\alpha} \delta_{\alpha/R}(dx) , \end{equation} and the continuous kernel $K_R: ({\mathbb R}_*)^2 \to {\mathbb R}_+$ by \begin{equation}\label{eq:dc_KR} K_R(x,y) = R^{-\gamma} \sum_{\alpha,\beta=1}^\infty K_{\alpha,\beta} \zeta_\varepsilon(Rx-\alpha) \zeta_\varepsilon(Ry-\beta) {+ c_1 \left(\zeta_\varepsilon(Rx) + \zeta_\varepsilon(Ry)\right) w(x,y)\,,} \end{equation} where $w$ denotes the weight function in (\ref{eq:cond_kernel}), $\varepsilon<1/2$, and $\zeta_\varepsilon$ is a continuous non negative function satisfying $\zeta_\varepsilon (x)= 0,\ |x| \geq 1/2+\varepsilon$, $\zeta_\varepsilon (x)= 1,\ |x| \leq 1/2-\varepsilon$ and affine in each interval $(1/2-\varepsilon,1/2+\varepsilon)$ and $(-1/2-\varepsilon,-1/2+\varepsilon)$. Moreover, we define the source $\eta_R \in \mathcal{M}({\mathbb R}_*) $ with $\supp \eta_R \subseteq [1/R,L_\eta/R]$ by \begin{equation}\label{eq:dc_etaR} \eta_R(dx) = R^{2}\sum_{\alpha=1}^\infty s_{\alpha} \delta_{\alpha/R}(dx). \end{equation} \begin{lemma}\label{lem:fR} The kernel $K_R$ satisfies \eqref{ContinAssumpt}-\eqref{eq:cond_kernel3} with $\left\vert \gamma+2\lambda \right\vert <1$, uniformly in $R$. The measure $f_R$ defined as in \eqref{eq:dc_fR} is a stationary injection solution to \eqref{eq:time_evol} in the sense of Definition \ref{DefFluxSol} (cf.\ Remark \ref{rem:defFluxSol}) satisfying \eqref{eq:moment_cond} and \eqref{eq:stationary_eq} with the kernel $K_R$ and the source $\eta_R$ given by \eqref{eq:dc_KR} and \eqref{eq:dc_etaR} respectively. \end{lemma} \begin{proof} {We first notice that the function $K_R$ is continuous, non-negative and symmetric as it is written as a sum of functions with the same properties. Next we will show that $K_R$ satisfies the growth bounds \eqref{eq:cond_kernel2}-\eqref{eq:cond_kernel3} with the same exponents $\gamma, \lambda$ of the discrete kernel $K_{\alpha,\beta}$. In particular these exponents satisfy $\left\vert \gamma+2\lambda\right\vert <1$. If $x <\frac{1}{2}$ or $y < \frac{1}{2}$, the second term in \eqref{eq:dc_KR} is proportional to $w(x,y)$ and thus it provides a suitable lower bound. The upper bound also holds after possibly adjusting $c_2$ in \eqref{eq:Dcond_kernel3}. Hence, we may assume $x,y \geq \frac{1}{2}$ in the following. For each $\alpha,\beta \in {\mathbb N}$, we have from \eqref{eq:dc_KR} that $K_R(\alpha/R,\beta/R)=R^{-\gamma}K_{\alpha,\beta}$. Therefore $K_R(x,y)$ satisfies \eqref{eq:cond_kernel2}-\eqref{eq:cond_kernel3} for $x=\alpha/R$ and $y=\beta/R$ uniformly in $R$ due to the assumption on $K_{\alpha,\beta}$ \eqref{eq:Dcond_kernel2}-\eqref{eq:Dcond_kernel3}. For $x\in [(\alpha-1/2)/R, (\alpha+1/2)/R]$, $y\in [(\beta-1/2)/R, (\beta+1/2)/R]$ we have that $\frac{1}{2} R^{-\gamma}K_{\alpha,\beta} \leq K_R(x,y) \leq R^{-\gamma} \sum_{i,j=-1,0,1 } K_{\alpha+i,\beta+j}$, where we set $K_{0,j}=K_{j,0}=0,$ for $j\in {\mathbb N}$. This implies together with the bounds \eqref{eq:Dcond_kernel2}-\eqref{eq:Dcond_kernel3} and the monotonicity properties of $w$, that there exist positive constants $c_1$ and $c_2$ that are independent of $R$ and such that $K_R(x,y)$ satisfies \eqref{eq:cond_kernel2}-\eqref{eq:cond_kernel3}, which concludes the first part of the Lemma.} Next we substitute the expressions for $f_R$, $K_R$ and $\eta_R$ in the weak formulation \eqref{eq:stationary_eq} and perform a change of variables $\xi = Rx$ and $\theta = Ry$. We then obtain an expression where all the terms are multiplied by the same factor $R$. Using then that for $m \in {\mathbb N} $, $\zeta_{\varepsilon}(m) = 1, \ m=0$ and $\zeta_{\varepsilon}(m) = 0, \ m\neq 0$ we obtain that the weak formulation of the continuous problem \eqref{eq:stationary_eq} reduces to the weak formulation of the discrete problem \eqref{eq:Dweakform}. \end{proof} \begin{theorem}\label{thm:convergence} Let $(n_\alpha )_\alpha$ be a solution of the stationary problem \eqref{eq:Dtimecoag} in the sense of Definition \ref{Def:DFluxSol}. Let $f_R, K_R$ and $\eta_R$ be as in \eqref{eq:dc_fR}, \eqref{eq:dc_KR} and \eqref{eq:dc_etaR}, respectively. Assume that there exists $K \in C(({\mathbb R}_*)^2)$ such that $K_R \to K $ as $R \to \infty$ uniformly on compact sets of $(0,\infty)^2$. Consider the family of stationary injection solutions defined above $(f_R)_{R>0}$. Then for any sequence $( R_n)_{n\in {\mathbb N}}$ such that $\lim_{n \to \infty} R_{n} = \infty$ there exists a subsequence $( R_{n_k})_{k\in {\mathbb N}}$ and $f \in \mathcal{M}(0,\infty)$ (that might depend on the subsequence) such that \begin{equation}\label{eq:dc_weak_conv} \forall \varphi \in C_c(0,\infty),\ \int_{{\mathbb R}_*} \varphi(x) f_{R_{n_k}}(dx) \to \int_{{\mathbb R}_*} \varphi(x) f(dx) \text{ as } k \to \infty \end{equation} and $f$ is a constant flux solution to \eqref{eq:time_evol} in the sense of Definition \ref{DefFluxSol2} with $J = \sum_{\alpha=1}^\infty \alpha s_\alpha$. \end{theorem} \begin{remark} Note that a priori we may expect that the only constant flux solutions in the sense of Definition \ref{DefFluxSol2} are power laws. { We will see in \cite{FLNVprep} that there are homogeneous kernels $K$ that satisfy the upper and lower bounds \eqref{eq:cond_kernel2}--\eqref{eq:cond_kernel3} for which this is not true.} Therefore the limit measure $f$ can be different for different subsequences $(f_{n_k})_k$ in \eqref{eq:dc_weak_conv}. \end{remark} \begin{remark} The assumption $K_R \to K $ as $R \to \infty$ means that the discrete kernel $K_{\alpha,\beta}$ behaves like the continuous kernel $K$ for large values of $\alpha,\ \beta$. For instance, in the case of the kernel $K_{\alpha,\beta}=\frac{\alpha^{\gamma+\lambda}}{\beta^{\lambda}}% +\frac{\beta^{\gamma+\lambda}}{\alpha^{\lambda}},$ the function $K_{R}$ defined by means of \eqref{eq:dc_KR} converges to $K\left( x,y\right) =\frac {x^{\gamma+\lambda}}{y^{\lambda}}+\frac{y^{\gamma+\lambda}}{x^{\lambda}}$ as $R\rightarrow\infty.$ A large class of kernels $K_{\alpha,\beta}$ for which the convergence $K_{R}\rightarrow K$ as $R\rightarrow\infty$ takes place can be obtained just restricting a continuous homogeneous kernel $K=K\left(x,y\right) $ to integer values, i.e $K_{\alpha,\beta}=K\left( \alpha,\beta\right) $ for $\alpha,\beta\in\mathbb{N}$. \end{remark} \begin{proofof}[Proof of Theorem \ref{thm:convergence}] Using the expression \eqref{eq:dc_fR} for $f_R$ and the upper estimate in Corollary \ref{prop:Destimate} we obtain \begin{equation} \frac{1}{z}\int_{[z/2,z]} f_R(dx) = C \frac{R^{(\gamma+3)/2}}{Rz}\sum_{\alpha \in [R z/2,Rz]} n_\alpha \ \leq \ \frac{C \sqrt{J}}{z^{(\gamma+3)/2}},\ z>0\label{eq:dc_fR_3} \end{equation} for some positive constant $C$ independent of $R$. Note that this estimate is valid for $Rz \geq 1$ and for $0<Rz< 1$ is automatic because the sum is empty. Therefore $\{ {f_R}_{|_K} \}_{R>0}$ is precompact in $\mathcal{M}_+(K)$ for any $K \subset (0,\infty)$ compact, where $|_K$ denotes the restriction to $K$. Given a sequence of compact sets in $(0,\infty)$, $I_n = [2^{-n},2^n]$ we then obtain using a diagonal sequence argument, that there is a subsequence of measures $( f_{R_{n_k}})_{k\in {\mathbb N}}$ and a measure $f\in \mathcal{M}_+({\mathbb R}_+)$ such that \eqref{eq:dc_weak_conv} holds. Moreover \begin{equation} \frac{1}{z}\int_{[z/2,z]} f(dx) \leq \ \frac{C \sqrt{J}}{z^{(\gamma+3)/2}},\ z>0.\label{eq:dc_fR_2} \end{equation} Now we prove that $f $ is a constant flux solution in the sense of Definition \ref{DefFluxSol2}. Indeed, since $f$ satisfies \eqref{eq:dc_fR_2} and using that $\left\vert\gamma+2\lambda\right\vert <1$ and Lemma \ref{lem:bound}, it follows that the moment condition \eqref{eq:moment_cond2} holds. For any test function $\varphi \in C_c(0,\infty)$, since $f_R$ is a stationary injection solution, we have from Lemma \ref{lem:flux} that $f_R$ satisfies \begin{equation}\label{eq:dc_2} \int_{(L_\eta/R,\infty)}dz \varphi(z)\int_{ (0,z]}\int_{(z-x,\infty)} K_R(x,y)x f_R(dx) f_R(dy) = J \int_{(L_\eta/R,\infty)}dz \varphi(z), \end{equation} where $J=\int_{(0,\infty)} x \eta_R(dx) = \sum_{\alpha=1}^\infty \alpha s_\alpha >0$ is independent of $R$. We now rewrite using the domain of integration $\Omega_z$ defined in \eqref{eq:Omegaz} as well as the domains $\Sigma_1(\delta),\ \Sigma_2(\delta)$ and $\Sigma_3(\delta)$ for $\delta >0$ defined in \eqref{eq:sigma}. We use also the partial fluxes $J_j,\ j=1,2,3$ defined in \eqref{eq:fluxeq_j}. In order to make explicit in these fluxes the dependence on the kernel $K$ and the measure $f$, we will rewrite them as $J_j(z,\delta; K,f)$ in the rest of this proof. Therefore \eqref{eq:dc_2} becomes \begin{equation}\label{eq:dc_3} \sum\limits_{j=1}^3\int_{(L_\eta/R,\infty)}dz \varphi(z) J_j(z,\delta; K_R,f_R) = J \int_{ (L_\eta/R,\infty)} dz \varphi(z) \end{equation} for any $\varphi \in C_c(0,\infty)$. Let $\varepsilon >0$ arbitrarily small. Since the kernels $K_R,\ R\geq 1$ satisfy the Assumption \ref{assump:estimates} with $c_1,\ c_2$ in \eqref{eq:cond_kernel2}-\eqref{eq:cond_kernel3} independent of $R$, we can apply Lemma \ref{lem:J} combined with \eqref{eq:dc_fR_3} to obtain \begin{equation}\label{eq:dc_4} \left| \sum_{j \in \{1,3\}} \int_{(L_\eta/R,\infty)} dz \varphi(z) J_j(z,\delta;K_R,f_R) \right| \leq C\varepsilon J \| \varphi \|_{L^\infty(0,\infty)} \end{equation} where $C>0$ is independent of $R$. For every compact set $K\subset (0,\infty)$ we have that $\underset{z \in K}{\bigcup} (\Sigma_2(\delta) \cap \Omega_z)$ is bounded. Then using \eqref{eq:dc_weak_conv} and using that $\lim_{R\to \infty} K_R = K$ uniformly on compact sets of $(0,\infty)$ and that $\varphi$ is compactly supported, we obtain \begin{equation*} \lim_{n\to \infty } \int_{(0,\infty)}dz \varphi(z) J_2(z,\delta ; K_{R_n},f_{R_n}) = \int_{(0,\infty)}dz \varphi(z) J_2(z,\delta;K,f) \end{equation*} for any test function $\varphi \in C_c(0,\infty)$. Then using \eqref{eq:dc_3}-\eqref{eq:dc_4} we arrive at \begin{equation*} \left| \int_{(0,\infty)}dz \varphi(z) J_2(z,\delta;K,f) - J\int_{(0,\infty)}dz \varphi(z) \right| \leq C\varepsilon J \| \varphi\|_{L^\infty(0,\infty)}. \end{equation*} Using again Lemma \ref{lem:J} and \eqref{eq:dc_fR_2} we deduce that \begin{equation*} \left| \sum_{j \in \{1,3\}} \int_{(0,\infty)} dz \varphi(z) J_j(z,\delta;K,f) \right| \leq C\varepsilon J \| \varphi \|_{L^\infty(0,\infty)} \end{equation*} whence \begin{equation*} \left|\int_{(0,\infty)}dz \varphi(z)\int_{ (0,z]}\int_{(z-x,\infty)} K(x,y)x f(dx) f(dy) - J \int_{(0,\infty)}dz \varphi(z)\right| \leq C\varepsilon J \| \varphi \|_{L^\infty(0,\infty)} , \end{equation*} for any $\varphi \in C_c(0,\infty)$. Then since $\varepsilon$ is arbitrary small and $\varphi$ is an arbitrary test function, $f$ is a flux solution in the sense of Definition \ref{DefFluxSol2} and the result follows. \end{proofof} \bigskip \noindent \textbf{Acknowledgements.} The authors are grateful to P.\ Laurencot and R.\ L.\ Pego for interesting discussions about the content of this paper. We also thank the anonymous reviewers for their careful reading of the manuscript and for valuable suggestions of improvements. JL also thanks A.\ Vuoksenmaa for his help with the details of the existence proof in Section \ref{sec:existence}. The authors gratefully acknowledge the support of the Hausdorff Research Institute for Mathematics (Bonn), through the {\it Junior Trimester Program on Kinetic Theory}, of the CRC 1060 {\it The mathematics of emergent effects} at the University of Bonn funded through the German Science Foundation (DFG), and of the {\it Atmospheric Mathematics} (AtMath) collaboration of the Faculty of Science of University of Helsinki, as well as of the Academy of Finland via the {\it Centre of Excellence in Analysis and Dynamics Research} (project No. 307333). The funders had no role in study design, analysis, decision to publish, or preparation of the manuscript. \bigskip \noindent\textbf{Compliance with ethical standards} \smallskip \noindent \textbf{Conflict of interest} The authors declare that they have no conflict of interest. \bigskip
\section{Introduction} Magnetic Skyrmions are microscopic topological defects in spin textures that are characterized by the charge \cite{Nagaosa}, \begin{equation} Q=\frac{1}{4\pi}\int d^{2}{\bf r} \; {\bf n} . \; (\frac{\partial {\bf n}}{\partial x}\times \frac{\partial {\bf n}}{\partial y})=\pm 1 . \end{equation} In mathematical literature, $Q$ is a topologically invariant quantity known as Pontryagin number. It counts how many times ${\bf n}({\bf r})={\bf n}(x,y)$ wraps the unit sphere \cite{Nash}. Skyrmions were first introduced by Skyrme \cite{Skyrme1} to explain hadrons in nuclei. Interestingly it has turned out to be relevant in other condensed matter systems such as chiral magnets \cite{Muhlbauer}. Theoretically, magentic skyrmions were introduced and investigated by Bogdanov and his collaborators in \cite{Bogdanov, Bogdanov1} . Skyrmions can be driven by charge or spin currents in confined geometries \cite{torque}. In general, skyrmions are subject to skyrmion Hall effect (SkHE) caused by Magnus force. SkHE was predicted theoretically in \cite{SkHE} and has been observed experimentally \cite{SkHE1}. Magnus force is the force acting transverse to the skyrmion velocity in the medium and can be interpreted as a manifestation of the real-space Berry phase \cite{Sonin,Freimuth}. SkHE is a detrimental effect since the skyrmions experience it will deviate from going in straight path. As a result, moving skyrmions can be damaged or even destroyed at the edges of thin film sample. One way of suppressing SkHE is to consider two perpendicular chiral thin films strongly coupled via antiferromagnetic (AFM) exchange coupling. It is expected that when skyrmion lattice is formed at the bottom thin film , simultaneously another skyrmion lattice is created at the top thin film with opposite topological charge. In this case, the SkHE is vanished since the Magnus force acting on the top skyrmion (antiskyrmion) is equal to the Magnus force that acts on the bottom antiskyrmion (skyrmion) with opposite sign leaving us with zero net force. Analogous scheme was proposed to suppress SkHE in nanoscale N{\'e}el skyrmions by considering two perpendicular ferromagnetic films separated by an insulator with heavy metal underneath the second ferromagnetic film \cite{Ezawa}. \\ Quantum signatures for large skyrmions can emerge at the phase boundary between skyrmion crystal phase (SkX) and ferromagnetic phase at zero temperature like skyrmions in Fe$_{0.5}$Co$_{0.5}$Si. During this phase transition a quantum liquid phase is expected to emerge \cite{Takashima}. In this case, the classical LLG \cite{Gilbert} and Thiele equation \cite{Thiele} break down due to quantum fluctuations. The full quantum theory of bilayer skyrmions is out of the scope of this work and it can be recovered under some circumstances. As an example, for sufficiently weak antiferromagnetic exchange coupling between thin films, bilayer skyrmion (antiferromagnetically coupled skyrmion-antiskyrmion pair) can be seen as two separate skyrmions and the quantum dynamics is already known for a single large skyrmion \cite{Takashima}. In this work, we give a detailed theory of large bilayer skyrmions ( with sizes at order of 100 nm ) using HDMZ (Heisenberg exchange $+$ Dzyaloshinskii-Moriya interaction $+$ Zeeman interaction) model. We study the problem of entanglement in large bilayer skyrmions from general perspective using our developed continuum theory of bilayer skyrmions and $SU(4)$ representation. In final section, we study the geometry of quantum states in bilayer skyrmions. \section{The $\mathbb{CP}^{1}\otimes \mathbb{CP}^{1}$-Theory of Large Bilayer Skyrmion } \label{continuum} We consider two thin films of chiral magnets separated by an insulating spacer with antiferromagnetic coupling between chiral films. We assumed each film to host Bloch skyrmions under certain ranges of temperature and external magnetic field determined by the film parameters. Skyrmions in the first thin-film are equal in size with skyrmions in the second thin-film but with opposite topological charge. For our model to hold, we assume temperatures lower than the magnon gap and skyrmion with large radius \cite{Takashima}. Fortunately, skyrmions in Fe$_{0.5}$Co$_{0.5}$Si support these assumptions \cite{Feco}. We present a detailed theory of bilayer skyrmions written with respect to $\mathbb{CP}^{1}\otimes \mathbb{CP}^{1}$-theory. The HDMZ Hamiltonian density for each chiral magnet layer is \begin{equation}\label{effective} \mathcal{H}_{i}= \frac{J}{2} \; (\partial_{\mu}{\bf n}^{i})\cdot (\partial_{\mu}{\bf n }^{i})+ D \; {\bf n}^{i}\cdot(\nabla \times{\bf n}^{i}) - {\bf B}\cdot{\bf n}^{i}, \end{equation} We adopted Einstein summation notation for repeated indices $\partial_{\mu}{\bf n}\cdot \partial_{\mu}{\bf n}\equiv \Sigma_{\mu} \partial_{\mu}{\bf n}\cdot \partial_{\mu}{\bf n}$. Since we are interested in two-dimensional thin films $\mu=x,y$. The index $i=S,A$ labels the skyrmion and anti-skyrmion respectively and ${\bf n^{i}}=(\sin\theta^{i}\cos\phi^{i}, \sin\theta^{i}\sin\phi^{i},\cos \theta^{i})^{T}$ gives the transpose magnetic moment unit written in the $O(3)$ representation with a unit modulus constraint $|{\bf n}^{i}|^{2} =1$. The first term in the Hamiltonian represents the exchange interaction with exchange constant $J$, the second term is the DMI term with $D$ being the Dzyaloshinskii-Moriya (DM) vector constant. DMI term is a manifestation of chirality in the system since it has a vanishing value for centrosymmetric crystal structures. The last term is the Zeeman interaction. According to Derrick-Hobart theorem, the Hamiltonian \ref{effective} supports the emergence of large skyrmions \cite{Derrick,Hobart}. Suppose there exists a skyrmion solution ${\bf n}^{0}$ to the system. We compute each contribution in the energy functional as $E^{0}_{H}$, $E^{0}_{DM}$ and $E^{0}_{Z}$, where $H, DM$ and $Z$ denote Heisenberg exchange, Dyzaloshinskii-Moriya and Zeeman terms. Now we consider the scaling ${\bf n}= {\bf n}^{0}(\lambda x)$. Substituting this scaled solution into each term in the energy functional gives, \begin{equation}\label{hobart} E(\lambda)= E^{0}_{H}- \lambda^{-1}|E^{0}_{DM}|+ \lambda^{-2} E^{0}_{Z}. \end{equation} This has a unique minimum point which could be found by the relation $\lambda=\frac{2 E^{0}_{Z}}{|E^{0}_{DM}|}$. It is safe to choose $\lambda=1$ for consistency throughout our argument. From \ref{hobart}, it is not difficult to observe that skyrmion is stabilized by DMI term. When $\lambda\rightarrow \infty$, the equation \ref{hobart} implies that a skyrmion shrinks to zero without the DMI term. The perpendicular magnetic anisotropy (PMA) term was ignored since such a term does not play an important role in Fe$_{0.5}$Co$_{0.5}$Si \cite{Feco}. The total energy is the spatial integral of $\mathcal{H}_{i}$: $ H_{i}= \int d^{2} r\; \mathcal{H}_{i}$. The bilayer skyrmion can be described by the following Hamiltonian $H_{tot}=H_{S}+H_{A}+H_{int}$. The term $H_{int}$ is assumed to contain the AFM exchange coupling between the two chiral magnets, \begin{equation} H_{inter}= -J_{int}\int d^{2}x\; {\bf n}^{i=S}. {\bf n}^{i=A}. \end{equation} AFM interaction term is responsible for the coupling between spin degrees of freedom in skyrmion and spin degrees of freedom in antiskyrmion. AFM-coupled spins are in opposite alignment with each others. \\ We will use a purely geometric approach in our investigation of quantum entanglement. Thus, it is more convenient to work in the equivalent $\mathbb{CP}^{1}$ formulation of nonlinear sigma model NL$\sigma$M \cite{Belavin, Han}. This can be achieved using Hopf map ${\bf n}^{i}= ({\bf z}^{i})^{\dagger}{\bf \sigma}^{i} {\bf z}^{i}$. This mapping connects the classical object ${\bf n}^{i}$ with spinor ${\bf z}^{i}=\begin{bmatrix} \cos\frac{\theta^{i}}{2} \\ \sin\frac{\theta^{i}}{2}e^{i\phi^{i}} \end{bmatrix}$. The spinor ${\bf z}^{i}$ can be interpreted as the coherent-state wavefunction of spin-$\frac{1}{2}$ particles. The DMI term can be phrased in term of the spinor ${\bf z}_{i}$ as follows \begin{align} {\bf n}^{i}.(\nabla \times {\bf n}^{i})= \sin\theta^{i} \cos\theta^{i} (\cos\phi_{i}\; \partial_{x}\phi^{i} + \sin\phi\; \partial_{y}\phi^{i})\\ \nonumber + (\sin\phi^{i} \; \partial_{x}\theta^{i} - \cos\phi^{i} \;\partial_{y}\theta^{i} -\sin^{2}\theta^{i}\partial_{z}\phi^{i})\\ \nonumber= -2{\bf n}^{i}\cdot {\bf a}^{i} -i({\bf z}^{i})^{\dagger} (\sigma^{i}\cdot\nabla) \;{\bf z}^{i} +i(\nabla ({\bf z}^{i})^{\dagger})\cdot\; \sigma^{i} {\bf z}^{i}. \end{align} The equation \ref{effective} can be re-expressed in term of the spinor ${\bf z}^{i}$ as \begin{align}\label{cp1} \mathcal{H}_{i}= \frac{J}{2} \; (\partial_{\mu}{\bf n}^{i})\cdot (\partial_{\mu}{\bf n }^{i}) + D \;{\bf n}^{i}\cdot(\nabla \times{\bf n}^{i}) -{\bf B}\cdot{\bf n}^{i} \\ \nonumber =2 J \; \big(\partial_{\mu} ({\bf z}^{i})^{\dagger}+ia^{i}_{\mu}\; {\bf z}^{\dagger}_{i} - i\kappa \;({\bf z}^{i})^{\dagger} \sigma^{i}_{\mu}\big) \\ \nonumber \big(\partial_{\mu} {\bf z}^{i}- ia^{i}_{\mu}\;{\bf z}^{i}+i\kappa\; \sigma^{i}_{\mu}{\bf z}^{i}\big) -{\bf B} \; ({\bf z}^{i})^{\dagger} \sigma^{i} {\bf z}^{i} \\ \nonumber =2J (D^{i}_{\mu}{\bf z}^{i})^{\dagger} D^{i}_{\mu}{\bf z}^{i}- {\bf B} \; ({\bf z}^{i})^{\dagger} \sigma^{i} {\bf z}^{i}, \end{align} where $D^{i}_{\mu}= \partial_{\mu}- ia^{i}_{\mu}+i\kappa\sigma^{i}_{\mu}$ denotes the covariant derivative for thin film $i$, $\kappa=\frac{D}{2J}$, and $a^{i}_{\mu}= -i ({\bf z}^{i})^{\dagger}\partial_{\mu}{\bf z}^{i}$ is the emergent gauge field. Each magnetic layer carries a $\mathbb{CP}^{1}$- field which is responsible for the magnetization. The $\mathbb{CP}^{1}$-field is a two-component normalized vector with complex entries such that each field is being represented using $SU(2)$ representation. The inclusion of DMI term in the effective Hamiltonian \ref{cp1} is done simply by adding a non-Abelian gauge field proportional to Pauli matrices $\sigma_{\mu}$. The emergent gauge field $a^{i}_{\mu}$ is usually called the real-space Berry connection. It is synthesized by adiabatically varying the spin texture sufficiently slow in time. The real-space Berry phase connection can give rise to the skyrmion Hall effect. Unlike the momentum-space Berry connection which gives rise to the anomalous Hall effect \cite{Freimuth}. Although the non-Abelian gauge field is non-dynamic (constant), it has an associated flux with it. The covariant derivative commutator gives the field tensor, \begin{equation} F^{i}_{\mu \nu}= i[D^{i}_{\mu},D^{i}_{\nu}]=f^{i}_{\mu\nu}+2\kappa^{2}\epsilon_{\mu\nu\lambda}\; \sigma^{i}_{\lambda}. \end{equation} where the abelian part of the flux is $f^{i}_{\mu\nu}=\partial_{\mu}a^{i}_{\nu}-\partial_{\nu}a^{i}_{\mu}$. The two-dimensional emergent vector potential for a single magnetic skyrmion is \begin{equation}\label{gauge} {\bf a}^{i}= -i({\bf z}^{i})^{\dagger}\nabla_{2} {\bf z}^{i}=\frac {\hat{\phi^{i}}}{2r} (1-\cos\theta^{i}(r))= \frac{\hat{\phi^{i}}}{r} \sin^{2} \frac{\theta^{i}}{2}, \end{equation} Since $\hat{\phi^{i}} =(\sin\phi^{i}, \cos\phi^{i},0)$ , the gauge field ${\bf a}^{i}$ turns to be a two-dimensional object. The magnetic flux originating from this gauge field is \begin{equation} \nabla_{2} \times {\bf a}^{i} = \frac{1}{2r} \sin\theta^{i}(r)\;(\theta^{i})^{\prime}(r), \end{equation} where $\nabla_{2}\equiv(\partial_{x},\partial_{y},0)$. The local spin orientation $(\theta^{i},\phi^{i})$ is related to the local coordinate system of a single skyrmion $(r,\varphi)$ such that $\theta_{i}=\theta_{i}(r)$ and $\phi_{i}=\varphi_{i}-\frac{\pi}{2}$. For seek of simplicity, we assume ${\bf B}=B\hat{z}>0$. The geometric considerations of skyrmions impose the following boundary conditions on $\theta_{i }$: (a) $\theta_{i}(\infty)=0$ and (b) $\theta_{i}(0)=\pi$. The total energy of a single skyrmion (anti-skyrmion) reads \cite{Han} \begin{align}\label{SkyrmionE} E_{SK}= 4\pi J \int ^{\infty}_{0} r dr \bigg[(\frac{1}{2} \frac{d\theta_{i}}{dr}+\kappa)^{2}\\ \nonumber-\kappa^{2} +\frac{\kappa}{r}\sin\theta_{i} \cos\theta_{i} +\frac{1}{4r^{2}} \sin^{2} \theta_{i}-\gamma (\cos\theta_{i}-1)\bigg], \end{align} where $\gamma=\frac{B}{2J}$. The total energy of large bilayer skyrmion is \begin{equation}\label{tot} E_{tot}=E_{Sk}(\theta_{S})+E_{Sk}(\theta_{A})+ E_{int}(\theta_{S},\theta_{A} ), \end{equation} In $\mathbb{CP}^{1}$-formulation, the AFM interaction term takes the form \begin{equation} E_{int}= -2\pi J_{int} \int _{o} ^{\infty} rdr \cos\theta_{S}. \cos\theta_{A}. \end{equation} For sufficient AFM interaction, we have the case where each spin in the first film is coupled with another opposite spin in the second film. This allows us to write $\theta_{A}=\pi -\theta_{S}$ and express the total energy functional \ref{tot} in term of a single angle $\theta_{S}$ or $\theta_{A}$. The total energy functional \ref{tot} simplifies for fixed values of DM interaction constants $D$, exchange couplings $J$ and magnetic fields $B$ in both skyrmion and its AFM coupled antiskyrmion. It takes the following simple form \begin{align}\label{key} E_{tot}= 4\pi J \int ^{\infty}_{0} r dr \bigg[(\frac{1}{2} \frac{d\theta^{S}}{dr})^{2}+ 2\gamma +\frac{1}{2r^{2}} \sin^{2} \theta^{S}\bigg] \\ \nonumber +2\pi J_{int}\int ^{\infty}_{0} r dr \cos^{2}\theta^{S} . \end{align} Realistically, in order for \ref{key} to make sense is to introduce a hard cutoff $r_{Sk}$ such that $\theta_{S,A}(r)=0$ for $r\geq r_{Sk}$. Physically, $r_{Sk}$ is a half-skyrmion distance in skyrmion phase crystal or the size of skyrmion. \\ It is not difficult to show that our system has a vanishing skyrmion Hall effect. For each chiral magnet film, Thiele equation can be written as \cite{Thiele,Ezawa} \begin{equation}\label{thiele} {\bf F}= {\bf G} \times ({\bf v}_{s}- \dot{{\bf R}})+ { \Gamma}_{ij}\; (\beta\; {\bf v}_{s}-\alpha\; \dot{{\bf R}}), \end{equation} where ${\bf v}_{s}$ denotes the velocity of spin polarized current, $\alpha$ is the Gilbert damping term, $\beta$ is the non-adiabatic damping constant, ${\bf R}$ represents the center of mass coordinates, ${\bf G}$ and ${ \Gamma}_{ij}$ are the Gyromagnetic vector and dissipative tensor respectively given by \begin{eqnarray} G_{i}= \varepsilon_{ijk}\; \int d^{2}{\bf r}\; ({\bf n}, \partial_{i} {\bf n}, \partial_{j} {\bf n}), \\ \nonumber \Gamma_{ij}= \int d^{2}{\bf r} \; \partial_{i}{\bf n}\; \partial_{j}{\bf n}. \end{eqnarray} We introduced the non-adiabatic spin transfer torque with parameter $\beta$ in \ref{thiele} to account for small dissipative forces that break the conservation of spin in the spin-transfer process. Since we have considered an external magnetic field parallel to the $z$-direction and an in-plane spin polarized current, by symmetry considerations, dissipation tensor has the following simple form \begin{equation} {\bf \Gamma} = \Gamma \begin{pmatrix} 1 & 0& 0 \\ 0& 1 & 0 \\ 0& 0 & 0 \end{pmatrix} \end{equation} and the Gyromagnetic vector takes the form \begin{equation} {\bf G}= 4\pi Q \begin{pmatrix} 0& -1&0 \\ 1& 0 & 0\\ 0& 0& 0 \end{pmatrix} \end{equation} Note that ${\bf F}$ in equation \ref{thiele} vanishes since HDMZ action is translationally invariant ${\bf r}\rightarrow {\bf r}+\delta {\bf r}$ provided that Zeeman field is uniform. Thus, we obtain the following coupled equations \begin{equation} \begin{pmatrix} \alpha \Gamma & -4\pi Q \\ 4\pi Q & \alpha\Gamma \end{pmatrix}\begin{pmatrix} \dot{X}\\ \dot{Y}\end{pmatrix}= \begin{pmatrix} \beta \Gamma & -4\pi Q\\ 4\pi Q & \beta \Gamma \end{pmatrix} \end{equation} This system is non-singular and always has a solution of the form \begin{align} {\bf v}_{Sk}= \dot{{\bf R}}=(\dot{X},\dot{Y}) \\ \nonumber = \frac{\beta}{\alpha}{\bf v}_{s}+ \frac{\alpha-\beta}{\alpha^{3} (\frac{\Gamma}{4\pi Q^{2}})+\alpha} \big({\bf v}_{s} + \frac{\alpha \Gamma }{4 \pi Q} \hat{z}\times {\bf v}_{s}\big). \end{align} From the last result, we observe that skyrmion ( antiskyrmion) velocity ${\bf v}_{Sk}$ is a combination of drag velocity ${\bf v}_{s}$ and Magnus term proportional to the topological charge $Q$. Since we dealt with two thin films of chiral magnets where skyrmions in one layer has opposite charge with the second i.e. $Q_{S}=-Q_{A}$. This implies the vanishing of Magnus term contribution for the whole system. \section{SU(4) Parametrization of Bilayer Skyrmion}\label{su4} At the perfect coupling between skyrmion-antiskyrmion pairs such that each spin in skyrmion is AFM-coupled to a spin in antiskyrmion, the system skyrmion-antiskyrmion pair can be described by a four-component wavefunction. Thus we can represent the spin degrees of freedom in bilayer skyrmions using $SU(4)$ symmetry. The $SU(4)$ skyrmions were studied before in multicomponent quantum Hall system \cite{Tsitsishvili} and graphene \cite{Sarma}. It was found that skyrmions in these systems are stabilized mainly by the competition between Zeeman and Coulomb interactions , unlike skyrmions in chiral magnets . However, both skyrmions share the same topological properties in common regardless of the system details. Since we have AFM coupled skyrmion-antiskyrmion pairs, our system resembles the spin-pseudospin skyrmions in term of parametrization despite the fact that we now have two skyrmions instead of one. For large bilayer skyrmions, we consider the properties of $SU(2)\otimes SU(2)$ skyrmion-antiskyrmion pairs under the presence of DM and Zeeman interactions (HDMZ model). We do this from a perspective of entanglement between the spin degrees of freedom in skyrmion and its AFM coupled anti-skyrmion. Because of Zeeman interaction term, the full $SU(4)$ symmetry breaks down to $U(1)\otimes U(1)$ symmetry where each symmetry group corresponds to a rotation of spin in the skyrmion or antiskyrmion along the applied magnetic field direction ( in our case, the $z$-direction). Thus, we have the symmetry breaking sequence $SU(4)\rightarrow SU(2)\otimes SU(2) \rightarrow U(1)\otimes U(1)$. Interestingly, the DMI term written in term of spinors ${\bf z}^{i}$ preserves the full $SU(2)\otimes SU(2)$ symmetry. This is due to the embedding of DMI term in the covariant derivative that acts on the spinor ${\bf z}^{i}$ as a nondynamic term. We parametrize the $SU(4)$ bilayer skyrmion using a Schmidt decomposition \cite{Goerbig}. According to Schmidt decomposition, every pure state in the Hilbert space $\mathcal{H}_{12}=\mathcal{H}_{1}\otimes \mathcal{H}_{2}$ can be written in the form \begin{equation} |\psi\rangle= \Sigma_{i=0}^{N-1} \lambda_{i} |e_{i}\rangle \otimes |f_{i} \rangle , \end{equation} Where $\{|e_{i}\rangle\}^{N_{1}-1}_{i=0}$ is an orthonormal basis for $\mathcal{H}_{1}$, $\{|f_{i}\rangle\}^{N_{2}-1}_{i=0}$ is an orthonormal basis for $\mathcal{H}_{2}$, $N\leq min \{N_{1},N_{2}\}$, and $\lambda_{i}$ are non-negative real numbers such that $\Sigma_{i=0}^{N-1} \lambda_{i}^{2}=1$. Thus, we can express the wavefunction as \begin{eqnarray}\label{wave} |\Psi({\bf r})\rangle= \cos\frac{\alpha}{2}\mid \varphi^{S}\rangle \otimes | \varphi^{A}\rangle+ \sin\frac{\alpha}{2} e^{i\beta} | \chi^{S}\rangle \otimes | \chi^{A}\rangle && \\ \nonumber =\begin{pmatrix} \cos\frac{\alpha}{2} \cos\frac{\theta^{A}}{2} \cos\frac{\theta^{S}}{2}+ \sin\frac{\theta^{A}}{2}\sin\frac{\theta^{S}}{2} e^{i(\beta-\phi^{A}-\phi^{S})}\\ \cos\frac{\alpha}{2} \sin\frac{\theta^{A}}{2} \cos\frac{\theta^{S}}{2} e^{i\phi^{A}}- \sin\frac{\alpha}{2} \sin\frac{\theta^{S}}{2}\cos\frac{\theta^{A}}{2}e^{i(\beta-\phi^{S})}\\ \cos\frac{\alpha}{2} \cos\frac{\theta^{A}}{2}\sin\frac{\theta^{S}}{2} e^{i\phi^{S}}- \sin\frac{\alpha}{2}\sin\frac{\theta^{A}}{2}\cos\frac{\theta^{S}}{2} e^{i(\beta-\phi^{A})} \\ \cos\frac{\alpha}{2} \sin\frac{\theta^{A}}{2}\sin\frac{\theta^{S}}{2} e^{i(\phi^{A}+\phi^{S})}+ \sin\frac{\alpha}{2}\cos\frac{\theta^{A}}{2}\cos\frac{\theta^{S}}{2} e^{i\beta} \end{pmatrix} \end{eqnarray} Where $\alpha \; \epsilon\; [0,\pi]$ and $\beta \; \epsilon\; [0,2\pi]$ are function of ${\bf r}$, and the local two-component spinors $|\varphi^{S}\rangle$, $| \chi^{S}\rangle$, $|\varphi^{A}\rangle$ and $|\chi^{A}\rangle$ are constructed as follows $|\varphi^{i}\rangle=\begin{pmatrix} \cos\frac{\theta^{i}}{2} \\ \sin\frac{\theta^{i}}{2}e^{i\phi^{i}} \end{pmatrix}$ and $|\chi^{i}\rangle =\begin{pmatrix} -\sin\frac{\theta^{i}}{2}e^{-i\phi^{i}} \\ \cos\frac{\theta^{i}}{2} \end{pmatrix}$, where $\theta^{i}\;\epsilon \;[0,\pi]$ and $\phi^{i}\;\epsilon \;[0,2\pi]$ are the usual polar angles defining the vector ${\bf n}^{i}$. We can read off directly the reduced density matrices using the Schmidt decomposition. The reduced density matrices for spins in skyrmion and antiskyrmion are \begin{eqnarray} \rho_{S}= \mathrm{Tr}_{A}( | \Psi({\bf r})\rangle \langle \Psi({\bf r} |) = \\ \nonumber \cos^{2}\frac{\alpha}{2} | \varphi^{S} \rangle \langle \varphi^{S}| + \sin^{2}\frac{\alpha}{2}\mid \chi^{S} \rangle \langle \chi^{S}|, \end{eqnarray} \begin{eqnarray} \rho_{A}= \mathrm{Tr}_{S}( | \Psi({\bf r})\rangle \langle \Psi({\bf r}|) = \\ \nonumber \cos^{2}\frac{\alpha}{2} \mid \varphi^{A} \rangle \langle \varphi^{A}| + \sin^{2}\frac{\alpha}{2}| \chi^{A} \rangle \langle \chi^{A}|. \end{eqnarray} It is convenient to express the wavefunction \ref{wave} as $|\Psi({\bf r})\rangle= \begin{pmatrix} z_{1}\\ z_{2}\\ z_{3}\\ z_{4} \end{pmatrix}$ such that entanglement measure can be written gently as \cite{Goerbig} \begin{equation} \mathfrak{E}= 4 |z_{1}z_{4}- z_{2}z_{3}|^{2}. \end{equation} For maximal entangled states we have $z_{1}=z_{2}= \frac{1}{\sqrt{2}}$ and $z_{2}=z_{3}=0$ while for separable (factorisable) states we have $z_{1}z_{4}= z_{2}z_{3}$. Consider for simplicity the case when spins in skyrmion and antiskyrmion are perfectly entangled. Let $|\varphi_{S}\rangle= \begin{pmatrix} 1\\0 \end{pmatrix}$, $|\varphi_{A}\rangle= \begin{pmatrix} 0\\1 \end{pmatrix}$, $|\chi_{S}\rangle=\frac{1}{\sqrt{2}} \begin{pmatrix} 1\\1 \end{pmatrix}$ and $|\chi_{A}\rangle=\frac{1}{\sqrt{2}} \begin{pmatrix} -1\\1 \end{pmatrix}$. Clearly when $\alpha=\frac{\pi}{2}$, the off-diagonal terms of density matrix vanish and the diagonal terms become 1. This verify the maximal entanglement condition $\rho_{ik}^{A} =\frac{1}{2} \mathbb{I}_{2}$. \\ The local transformation operators $U$ of the density matrices form a six-dimensional subgroup $SU(2)\otimes SU(2)$ of the full unitary group $U(4)=U(1)\otimes SU(4)$. The local transformation operators $U$ are parametrized by an arbitrary six real variables such that $U(\theta_{S},\phi_{S},\theta_{A},\phi_{A},\alpha,\beta)^{\dagger} U(\theta_{S},\phi_{S},\theta_{A},\phi_{A},\alpha,\beta)=\mathbb{I}_{4}$ (4$\times 4$ identity matrix) . Without loss of generality, we can use $\mathbb{I}_{2} \otimes \sigma_{\mu}$ and $\sigma_{\mu}\otimes\mathbb{I}_{2}$ as hermitian $\mathfrak{su}(2)\otimes \mathfrak{su}(2)$ Lie algebra basis of the full $SU(4)$-bilayer skyrmion theory. Here, $\sigma_{\mu}$ and $\mathbb{I}_{2}$ denote the Pauli matrices and the two-dimensional identity matrix respectively. \section{Geometry of quantum states } We give a geometric description to the problem of entanglement in bilayer skyrmions based on complex projective geometry \cite{Bengtsson}. $\mathbb{CP}^{\mathcal{N}}$ is the space of rays in $\mathbb{C}^{\mathcal{N}+1}$, or equivalently the space of equivalence classes of $\mathcal{N}+1$ complex numbers, at least one of them is non-zero, under $(Z^{0}, Z^{1}, \dots,Z^{\mathcal{N}}) \sim \lambda (Z^{0}, Z^{1}, \dots,Z^{\mathcal{N}})$, where $\lambda \varepsilon\; \mathbb{C}$ and $\lambda \neq 0$. In quantum theory, $\mathbb{CP}^{\mathcal{N}-1}$-field corresponds to $N$-component normalized spinor $z=(z_{1},z_{2},z_{3},\dots z_{\mathcal{N}})^{T}$ such that two vectors $z$ and $e^{i\varphi}z$ are equivalent for arbitrary $\varphi\; \epsilon \; \mathbb{R}$. The normalization of $\mathbb{CP}^{\mathcal{N}-1}$ spinor takes away two real parameters (or one complex) which explains why the space $\mathbb{CP}^{\mathcal{N}-1}$ correspond to $\mathbb{C}^{\mathcal{N}}$ . As we have seen in previous section, the skyrmion -antiskyrmion coupled pair can be described using a four-component spinor which lives in $\mathbb{CP}^{3}$-manifold. Any $\mathbb{CP}^{3}$-manifold is isomorphic to $\frac{U(4)}{[U(3)\otimes U(1)]}\cong \frac{SU(4)}{[SU(3)\otimes U(1)]}$, therefore the second homotopy group is $\pi_{2}(\mathbb{CP}^{3})= \pi_{2}\{\frac{SU(4)}{[SU(3)\otimes U(1)]}\}= \pi_{1}[SU(3)\otimes U(1)]$. Using the fact that homotopy group for the product manifold factorizes as $\pi_{k}(\mathrm{g}\otimes \mathcal{H})= \pi_{k}(\mathrm{g})\otimes \pi_{k}(\mathcal{H})$ alongside with the fact that any simple Lie group $\mathrm{g}$ has a vanishing fundamental homotopy group (i.e $\pi_{1}(\mathrm{g})=0$) give $\pi_{2}(\mathbb{CP}^{3})=\pi_{1}[SU(3)]\otimes \pi_{1}[U(1)]=\mathbb{Z}$ \cite{Nash, Nakahara}. \\ The pure state for each spin-$\frac{1}{2}$ represents a vector in the two-dimensional complex vector space. In Dirac notation, this vector can be expressed as $|\Psi\rangle= \Sigma _{i=0} ^{N-1}\; Z^{i} |i \rangle$, where $|i \rangle$ is a given orthonormal basis. The distance $D_{FS}$ between two states $|\Psi_{1}\rangle$ and $|\Psi_{2}\rangle$ is given by the Fubini-Study distance \cite{Vallee} \begin{equation} \cos^{2}D_{FS}=\frac{| \langle \Psi _{1}| \Psi_{2}\rangle|^{2}}{\langle \Psi_{1} | \Psi_{1}\rangle \langle \Psi_{2} | \Psi_{2}\rangle}= \frac{| Z_{1}. \overline{Z}_{2}|^{2}}{(Z_{1}. \overline{Z}_{1}) (Z_{2}. \overline{Z}_{2}) } . \end{equation} Where $\overline{Z}_{i}$ is the row vector whose entries are the complex conjugates of entries in the column vector $\overline{Z}^{i}$. The Fubini-Study metric measures the distinguishability of pure quantum states. In quantum communication theory, Fubini-Study distance is known as fidelity function. Since we considered a continuum theory for describing large bilayer skyrmions in scetion \ref{continuum}. The distinguishability of any two arbitrary states in large skyrmion or antiskyrmion is supposed to be difficult to observe. The infinitesimal form of the Fubini-Study distance approaches the Fubini-Study metric tensor \begin{equation} ds^{2}= \frac{Z.\overline{Z} dZ.d\overline{Z}- Z.d\overline{Z} dZ .\overline{Z}}{(Z.\overline{Z}) (Z.\overline{Z})} , \end{equation} Here $Z.\overline{Z}= Z^{i}\overline{Z}_{i}$. From Fubini-Study metric, time-energy uncertainty relation can be derived directly for each single spin \cite{Bengtsson}. As a spin-coherent state goes through a closed loop, it will gain the phase $\gamma= \oint \langle \psi(s)\mid \frac{d}{ds}\mid \psi(s)\rangle$. It was found that this phase is equal to the Riemannian curvature $K=\frac{1}{2S}$ of the phase space of spin-coherent state up to a constant. When $S=1/2$ ( like large 2D skyrmions), the curvature is equal to its maximum value $K=1$ \cite{Vallee}.\\ Any arbitrary state vector for bipartite composite system reads \begin{equation} |\Psi \rangle = \frac{1}{\sqrt{N}} \Sigma _{i=0}^{N-1} \Sigma_{j=0} ^{N-1} C_{ij} | i\rangle \otimes |j\rangle , \end{equation} where $C_{ij}$ is $N\times N$ matrix with complex entries. The density matrix for the composite system is given by $\rho_{ij,kl}= \frac{1}{N} C_{ij}C^{\star}_{kl}$. Since the system is in pure state, its density matrix has rank one. Now suppose we perform experiment in one of the two chiral magnets, the reduced density matrix for this subsystem is the partially traced density matrix $\rho_{\mathcal{A}}=\mathrm{Tr}_{\mathcal{B}} \rho:= \mathrm{Tr}_{\mathcal{H_{B}}} \rho$ which equals to $\rho^{\mathcal{A}}_{ik}= \Sigma _{j=0}^{N-1}\rho_{ij,kj}$. The rank of this subsystem density matrix may be greater than one. The global state of the chiral magnets system may be written as a product state spanned in the total Hilbert space $\mathcal{H}=\mathcal{H_{A}}\otimes\mathcal{H_{B}}$ \begin{equation} \mid \Psi \rangle= \mid \mathcal{A}\rangle \otimes \mid \mathcal{B}\rangle= \Sigma _{i=0}^{N-1} \Sigma _{j=0}^{N-1} (a_{i} \mid i\rangle ) \otimes (b_{j} \mid j\rangle), \end{equation} So the matrix $C_{ij}= a_{i}b_{j}$ is the dyadic product of two vectors $a$ and $b$. It is not difficult to notice that such global state of this kind is disentangled or separable since the partially traced matrix and the matrix $C_{ij}$ have rank one and the subsystems are in pure states of their own. On other hand, the maximally entangled state can be identified using the condition $\rho_{ik}^{\mathcal{A}} =\frac{1}{N} \mathbb{I}_{N}$ which corresponds to $\Sigma_{j=0}^{N-1} C_{ij}C^{\star}_{kj}=\delta_{ik}$. It means that we know nothing at all about the state of the subsystems even though the global state is precisely determined. The maximally entangled states form an orbit of the group of local unitary transformations. In our case, this group is $\frac{SU(2)}{\mathbb{Z}}= SO(3)$ which is identical to the real projective space $\mathbb{RP}^{3}$. In general, the group $\frac{U(\mathcal{N})}{U(1)}= \frac{SU(\mathcal{N})}{\mathbb{Z}^{\mathcal{N}}}$ is a Lagrangian submanifold of $\mathbb{CP}^{\mathcal{N}^{2}-1}$. Between these two cases, the separable and maximally entangled cases, the Von Neumann entropy $S= -\mathrm{Tr}(\rho_{\mathcal{A}} \;\mathrm{ln}\rho_{\mathcal{A}})$ takes some intermediate value with a possibility of partial entanglement between the spins. \\ \section{Conclusion} In this letter, the problem of antiferromagnetically coupled skyrmions (bilayer skyrmion) has been studied in detail using continuum theory approach. This was done by considering two thin films formed from the same chiral magnet separated by an insulating spacer with antiferromagnetic coupling between chiral films. We assumed each chiral film to host Bloch skyrmions under certain range of temperatures and external magnetic fields determined by the film parameters. Skyrmions in the first thin-film are equal in size with skyrmions in the second thin-film but with opposite topological charge. We give a representation for the spin degrees of freedom based on $SU(4)$ Lie algebra. Moreover, we have computed the density matrices for the spin degrees of freedom in skyrmion and its AFM-coupled antiskyrmion using Schmidt decomposition. Utilizing from the computed density matrices, we found the conditions for maximal or partial entanglement and separability within bilayer skyrmions . The full $SU(4)$ symmetry is broken to $SU(2)\otimes SU(2)$ symmetry during the Schmidt decomposition process while Zeeman interaction term causes the breaking to $U(1)\otimes U(1)$ symmetry. Interestingly DMI terms preserves the $SU(2)\otimes SU(2)$ symmetry. \\ The geometry of quantum states in bilayer skyrmions can be described using complex projective space $\mathbb{CP}^{3}$ endowed with a unitary-invariant Fubini-Study metric. Geometrically, the entangled states can be described naturally using $\mathbb{CP}^{3}$ space. We have two extreme cases corresponding to maximally entangled and separable states. The space of maximally entangled states happens to be the real projective space $\mathbb{RP}^{3}$ while for separable states is simply the space $\mathbb{CP}^{1}\otimes \mathbb{CP}^{1}$. The entanglement in skyrmion-antiskyrmion pairs can be extended to the whole skyrmion lattice SkX. We can have maximally entangled, partially entangled and separable cases for each coupled pairs. However, for uncoupled skyrmion-antiskyrmion pairs, the formalism studied in this letter can not be accurate in term of entanglement conditions. This is mainly because of the fact that skyrmion-antiskyrmion pairs are treated as antiferromagnetically coupled pairs throughout our formalism. This allowed us to impose conditions on energy eigenstates of skyrmion and antiskyrmion accordingly. We need to consider each skrymion and antiskyrmion as $XXZ$ spin chains and calculate the corresponding entanglement entropy\cite{Vedral}. Other possible scenarios such as having saturated ferromagnetic phase or general helical spin phase in one layer and skyrmion lattice in the second layer are theoretically possible . However we do not find these structures to be of great interest at least in term of having a vanishing Magnus force for the whole system. \\In comparison with graphene and multicomponent Hall systems, intimate relation between the entanglement conditions in large bilayer skyrmions and $SU(4)$-skyrmions has been found. However the system which has been investigated in this letter is different from that studied in Graphene and multicomponent quantum Hall systems. For example, they dealt in graphene case with spin-valley pseudospin degrees of freedom in a single skyrmion \cite{Rosch}. In contrast, we have considered two skyrmions with AFM coupling between its internal spins. This is the reason why we used $\mathbb{CP}^{1}\otimes \mathbb{CP}^{1} $-theory instead of $\mathbb{CP}^{3}$-theory. However, the space of entangled states is $\mathbb{CP}^{3}$-manifold as expected \cite{Bengtsson,Brody}. As a last comment, we propose the usage of entanglement in skyrmion-antiskyrmion lattices for probing the geometric nature of quantum entanglement. This will help in turn further understand and possibly manipulating skyrmion lattices in performing quantum technological tasks such as generating entanglement in systems with large number of spins. \vskip 5mm {\bf Acknowledgments}: I am very much grateful to Professors A.N.Bogdanov and T.Dereli for many fruitful comments on earlier draft of this work. The author would like to thank the anonymous Referee for the constructive comments and for pointing out the typos. The author acknowledges Ko\c{c} University for support. \section{$SU(4)$ Representation} \label{basis} The special unitary group $SU(N)$ has $(N^{2}-1)$ generators, where $-1$ is because of the condition $\mathrm{det}(M)=1$ where $M$ is any element from $SU(N)$. We denote the generators as $\lambda_{A}$, $A=1,2,\dots ,N^{2}-1$. We choose the following normalization condition between generators $\mathrm{Tr}(\lambda_{A}\lambda_{B})= 2\delta_{AB} $. Their commutator and anti-commutator are \cite{Gell-mann} \begin{eqnarray} [\lambda_{A}, \lambda _{B}]= 2i \; f_{ABC} \lambda_{C}, \\ \{\lambda_{A}, \lambda_{B}\}=\frac{4}{N} + 2 \; d _{ABC}\lambda_{C}, \end{eqnarray} where $f_{ABC}$ and $d _{ABC}$ are the structure constants of $SU(N)$. When $\lambda_{A}= \sigma_{A}$ (Pauli matrix) we have $f_{ABC}= \varepsilon_{ABC}$ and $d_{ABC}=0$ in the case of $SU(2)$. \\ Since our developed model of bilayer skrmions in chiral magnets is based on $SU(4)$ we will give a specific attention to this group. $SU(4)$ has 15 generators while $SU(2)\otimes SU(2)$ has 6 generators in total. Embedding $SU(2)\otimes SU(2)$ into $SU(4)$ we find the matrix representation for skyrmion $S$ and its AFM-coupled antiskyrmion $A$ \begin{eqnarray} \tau_{x}^{S}= \begin{pmatrix} \sigma_{x} & 0\\ 0 & \sigma_{x} \end{pmatrix}, \tau_{y}^{S}= \begin{pmatrix} \sigma_{y} & 0\\ 0 & \sigma_{y} \end{pmatrix}, \tau_{z}^{S}= \begin{pmatrix} \sigma_{z} & 0\\ 0 & \sigma_{z} \end{pmatrix}, \end{eqnarray} \begin{eqnarray} \tau_{x}^{A}= \begin{pmatrix} 0 & \mathbb{I}_{2}\\ \mathbb{I}_{2} & 0 \end{pmatrix}, \tau_{y}^{A}= \begin{pmatrix} 0 & -i \mathbb{I}_{2}\\ i \mathbb{I}_{2}& 0 \end{pmatrix}, \tau_{z}^{A}= \begin{pmatrix} \mathbb{I}_{2} & 0\\ 0 & -\mathbb{I}_{2} \end{pmatrix}. \end{eqnarray}
\section{Introduction} \label{sec:introduction} Random graphs are formidable tools to tackle problems in various disciplines, including physics, biology, and information science \cite{Newman10,Mezard09}. Informally speaking, a random graph is a collection of points or nodes interconnected by edges following a random prescription. In one of the simplest random graph models, each pair of nodes is connected (or not) according to a fixed probability, independently of the other nodes in the graph. This model is referred here as the Erd\H{o}s-R\'enyi (ER) random graph model, since it became popular after the seminal works by Paul Erd\H{o}s and Alfr\'ed R\'enyi \cite{Erdos59,Erdos60}. There are essentially two main reasons why ER random graphs are useful mathematical models. On the one hand, due to their finite coordination number, ER random graphs arise naturally in problems that are described in terms of sparse interacting elements, where one unit is coupled to a finite number of others, such as in network theory \cite{Newman10} or in the solution of optimization problems \cite{Mezard09}. On the other hand, ER random graphs can be seen as the infinite dimensional limit of Euclidean lattices. This property has led to analytic progress in the study of certain phase transitions that are otherwise very difficult to tackle in a finite-dimensional Euclidean space, such as the spin-glass transition \cite{Viana1985,Kanter1987,Monasson1998} and the Anderson localization transition \cite{Fyodorov91,Mirlin91,Slanina2012,Mata2017}. The absence of short loops and of any notion of Euclidean distance are distinctive features that allow for a mean-field description of systems interacting through the edges of ER random graphs. Interestingly, random graphs undergo structural phase transitions when certain global statistical properties characterizing the graph structure change as a function of the model parameters \cite{Doro08,Palla04,Callaway2000,Cohen2001,Albert2001,Bianconi2018,Krap00,Bianconi01,Doro05,Park04a,Park04b,Annibale15,Strauss86,Burda04a,Burda04b,Gorsky2016,Gorsky2019,Coolen2019}. The percolation and the condensation transitions are emblematic examples in this context \cite{Doro08,Palla04}. In the first case, the largest connected component of a graph increases as a function of the mean number $c$ of neighbors per node. The graph percolates at a critical value $c = c_{*}$, which means that, for $c \geq c_{*}$, the largest connected component contains a finite fraction of the total number of nodes. Percolation is a powerful notion to analyze the resilience of networks to random or targeted attacks \cite{Callaway2000,Cohen2001,Albert2001,Bianconi2018}, since the survival of the giant component with respect to the removal of a fraction of nodes is taken as an indication of network robustness. Random graphs undergo a condensation transition when a large number of subgraphs clump together to form a densely connected cluster. Different types of condensed graph configurations are possible, depending on the elementary structures composing the cluster. The simplest type of aggregate is formed through a phenomenon referred to as condensation of edges \cite{Krap00,Bianconi01,Doro05}, when a finite fraction of the total number of edges attaches to a single node. Other examples include condensation of two-stars \cite{Park04a,Park04b,Annibale15} and triangles \cite{Strauss86,Burda04a,Burda04b}, where the elementary structures forming the cluster are paths of length two and cycles of length three, respectively. More recently, reference \cite{Isaac_Fernando} has reported a novel type of structural phase transition in ER random graphs, characterized by an abrupt change in the degree statistics of the graph. The degree $K_i$ of a node $i$ is a random variable that counts the number of nodes connected to $i$. By varying a control parameter that allows to probe rare regions of the graph ensemble space, the degree distribution changes discontinuously from a Poisson form, typical of ER random graphs, to a distribution exhibiting a pronounced peak. This peaked distribution identifies a novel type of condensed state, where the degrees assume values in a narrow domain of its available configuration space. The formation of such condensed configurations has been coined {\it condensation of degrees}. These are large deviation events triggered by atypical fluctuations in the graph structure, similar to other random systems that exhibit condensation transitions driven by rare fluctuations \cite{zanetti2014,Corberi19}. The influence of the graph structure on dynamical processes and on the cooperative behavior of models defined on random graphs is a key topic in network theory, which has been attracting a huge interest in recent decades \cite{Pastor2001,Pastorbook,Leone2002,Doro2002,Noh2004,Ichi2004,Perez2004, Perez2005,Perez2005b,Perez2005c,Lee2005,Doro08,Neri2016,Neri2019,lupo2019}. The degree statistics plays a pivotal role on the long-time behavior of random walks on graphs \cite{Noh2004}, on the critical threshold for epidemic spreading \cite{Pastor2001,Pastorbook}, on the linear stability of large interacting systems \cite{Neri2016,Neri2019}, and on the critical properties of cooperative systems defined on random graphs, such as the Ising model \cite{Leone2002,Doro2002}, the Kuramoto model \cite{Ichi2004,Lee2005,Perez2005b,Perez2005c,lupo2019}, and the classical Heisenberg model \cite{Perez2005c,lupo2019}. Since condensation of degrees emerges through a discontinuous transition in the degree distribution, it is therefore compelling to ask how this structural transition impacts the macroscopic behavior of systems interacting through the edges of random graphs. Building on previous works on the large deviation theory of observables defined on graphs \cite{Metz_PerezC2017,PerezC_Metz2018,PerezC_Metz2018_2}, here we investigate how condensation of degrees influences two different problems: the thermodynamic phase transitions of the Ising model on an ER random graph and the eigenvalue distribution of the adjacency matrix of the graph. In the first case, large deviations in the graph structure, leading to condensation of degrees, induce different thermodynamic phase transitions, which are otherwise absent if one is limited to small, typical graph fluctuations. In fact, by computing the magnetization, the internal energy, and the magnetic susceptibility, we show that the Ising model displays three additional first-order transitions: a transition between ferromagnetic phases, a transition between paramagnetic phases, and a transition between a ferromagnetic and a paramagnetic phase. All these transitions are caused by the discontinuous change of the degree statistics. In our second example, we show that the eigenvalue statistics of the adjacency matrix of ER random graphs exhibits a discontinuous behavior across the condensation transition. In particular, the second moment of the eigenvalue distribution drops abruptly, indicating a concentration of eigenvalues around zero. These results are in contrast, for instance, with the percolation transition, where the eigenvalue distribution is insensitive to the formation of a giant component \cite{Bauer2001}. Incidentally, we also derive the percolation transition of atypical configurations of ER random graphs characterized by condensation of degrees, complementing the phase diagram presented in \cite{Isaac_Fernando}. The paper is organized as follows. In the next section we define the ER random graph model and we introduce the main quantities to characterize the condensation transition in the graph structure. Section \ref{IsingXX} presents the results for the thermodynamics of the Ising model defined on rare samples of ER random graphs. The results for the eigenvalue distribution of the adjacency matrix of atypical configurations of ER random graphs are discussed in section \ref{spectrumXX}. We summarize our work and discuss some open problems in section \ref{conclusionXX}. Finally, two appendices provide detailed explanations of the analytical calculations for the Ising model and for the eigenvalue distribution. \section{Condensation of degrees} Erd\H{o}s-R\'enyi random graphs \cite{erdos} are simple undirected graphs with $N$ nodes, where the probability that two nodes are connected is $c/N$, with $c=O(1)$ independent of $N$. A single graph instance is completely defined through its $N \times N$ adjacency matrix $\bC$. The entry $c_{ij}$ of $\bC$ is one if node $i$ is connected to node $j$, and zero otherwise. The elements of $\bC$ are independent and identical distributed random variables drawn from the joint distribution \begin{equation} P_{\text{ER}}(\boldsymbol{C}) =\prod_{i < j} \left[ \frac{c}{N} \delta_{c_{ij},1}+\left(1-\frac{c}{N}\right)\delta_{c_{ij},0} \right] \,. \label{klla} \end{equation} The degree $K_i$ of a node $i$, defined as $K_i = \sum_{j =1 (\neq i)}^N c_{ij}$, is a random variable that counts the number of nodes connected to $i$. In the limit $N\rightarrow \infty$, the distribution of degrees $K_1,\dots,K_N$ becomes Poissonian with mean $c$ \begin{equation} p_c(k)=\frac{e^{-c} c^k}{k!}\,. \label{pois} \end{equation} In order to understand the meaning of condensation of degrees, it is useful to picture the nodes as particles and the different possible values of the degrees as energy levels. Thus, it is natural to ask how the total number of particles is distributed among the different energy levels. Condensation of degrees occurs when a large fraction of nodes (particles) is distributed over a few degrees (energy levels). Such phenomenon is captured by considering the random variable $F_{[a,b]}(\bC)$ that counts the fraction of nodes having degrees in a certain interval $[a,b]$ \begin{equation} F_{[a,b]}(\bC)=\frac{1}{N}\sum_{j=1}^N I_{[a,b]}(K_j)\,, \end{equation} where $I_{[a,b]}(x)$ is an indicator function, that is, $I_{[a,b]}(x)=1$ if $x\in [a,b]$, and zero otherwise. By computing the cumulant generating function of $F_{[a,b]}(\bC)$ \begin{equation} \mathcal{G}(y) = \lim_{N \rightarrow \infty} \ln{\left\langle e^{y N F_{[a,b]}\left( \bC \right)} \right\rangle_{\rm ER}}\,, \end{equation} with $\avER{(\cdots)}$ denoting the average with the distribution $P_{\text{ER}}(\bC)$, reference \cite{Isaac_Fernando} has shown that the degree distribution changes abruptly from its typical Poissonian behavior, given by Eq. \eqref{pois}, to a peaked distribution. The latter distribution characterizes the formation of a condensed state, since a large fraction of nodes has similar degrees. The condensation transition is marked by a discontinuity of the first derivative $\frac{d \mathcal{G}(y)}{d y}$, which is the signature of a first-order phase transition in the parameter space $(c,y)$. The formation of the condensed state is a rare statistical event, triggered by large deviations in the graph structure, which produces two non-analytic points in the rate function controlling the large deviation probability \cite{Isaac_Fernando}. There is an alternative way to interpret the problem that sheds light on the role of the parameter $y$. Instead of looking at the condensation transition from the viewpoint of large deviation theory, one can introduce a modified or constrained ER ensemble, in which the standard distribution $P_{\text{ER}}(\bC)$ is deformed by a Boltzmann-like weight that couples the external control parameter $y$ to the random variable $F_{[a,b]}(\bC)$. In this setting, the probability of drawing a graph with adjacency matrix $\bC$ is \begin{equation} P_y(\bC)= \frac{P_{\text{ER}}(\bC) e^{y N F_{[a,b]} \left( \bC \right) }}{\avER{e^{y N F_{[a,b]} \left( \bC \right) }}}\,. \label{eq:probWeightedY} \end{equation} The role of $y$ becomes clear from Eq. \eqref{eq:probWeightedY}. If $y=0$, the weighted distribution $P_y(\bC)$ coincides with $P_{\text{ER}}(\bC)$. For positive (negative) values of $y$, the Boltzmann-like weight favors graphs where $F_{[a,b]}(\bC)$ is larger (smaller) than its typical value. Thus, $y$ is an external control parameter that biases the graph configurations and enables to probe the ensemble space of ER random graphs away from the typical configurations generated by Eq. \eqref{klla}. We can also interpret a change in $y$ as resulting from an external protocol to modify the graph structure: an increase (decrease) of $y$ corresponds to a rewiring of the links such that more (less) nodes have degrees in $[a,b]$. The average of any observable $A(\bC)$ over atypical ER graph configurations, conditioned by the value of $y$ through Eq. \eqref{eq:probWeightedY}, is thus obtained from \begin{equation} \langle A(\bC) \rangle_y = \lim_{N \rightarrow \infty} \frac{\avER{A(\bC) e^{y N F_{[a,b]}\left( \bC \right) }} }{\avER{ e^{y N F_{[a,b]}\left( \bC \right)}} }\,. \label{klll} \end{equation} Our aim here is to study the impact of the first-order condensation transition on two paradigmatic problems defined on ER random graphs: the magnetic properties of the Ising model and the eigenvalue distribution of the adjacency matrix. Since in both examples we need to evaluate the ensemble average of certain observables that depend on $\bC$, Eq. \eqref{klll} provides a suitable starting point to obtain the typical properties of these systems constrained to rare sectors of the ER graph configuration space. \section{Ising model on constrained random graphs} \label{IsingXX} \subsection{Model definitions and the free energy} \label{sub:ising_model_in_a_random_graph} The Ising model is a mathematical model to study the magnetic properties of a system. Here we are interested in the behavior of the Ising model on an ER random graph, i.e., the spin variables interact ferromagnetically through the edges of the graph. In particular, we will discuss the effect of the condensation transition, summarized in the previous section, on the magnetic properties of the Ising model. Given a graph generated from the weighted ensemble defined by Eq. \eqref{eq:probWeightedY}, the energy of a configuration of binary spins $\bm{\sigma}=(\sigma_1,\dots,\sigma_N)$, with $\sigma_i \in \{-1,1\}$, is given by \begin{equation} H_{\tiny{\bC}}(\bm{\sigma})=-J \sum_{i<j} c_{ij} \sigma_i \sigma_j -h \sum_i \sigma_i \, , \end{equation} where $J > 0$ is the ferromagnetic coupling between any pair of adjacent spins, and $h$ is an external magnetic field. In the canonical ensemble, the thermodynamical properties are captured by the intensive free energy \begin{equation} f(\bC)=- \frac{1}{\beta N} \ln Z(\bC)\,, \end{equation} where $\beta= 1/T$ is the inverse temperature of the system (the Boltzmann constant is equal to one), and $Z(\bC)$ is the partition function of the Ising model for a single realization of the graph \begin{equation} Z(\bC)=\sum_{\bm \sigma}e^{-\beta H_{\tiny{\bC}}(\bm \sigma)} \,. \label{eq:partitionFunctionDef} \end{equation} By assuming that, for a fixed value of $y$, the intensive free energy is a self-averaging quantity in the limit $N \rightarrow \infty$, the thermodynamics of the model is determined by the ensemble average of $f(\bC)$ over the graph configurations in the constrained ensemble \begin{equation} f= - \lim_{N \rightarrow \infty} \frac{1}{\beta N}\frac{\avER{\ln Z(\bC) e^{y N F_{[a,b]} \left( \bC \right) }}}{\avER{e^{y N F_{[a,b]} \left( \bC \right) }}}\,. \label{eq:freeEnergyDef} \end{equation} Note that we have simply employed eq. (\ref{klll}), valid for an arbitrary function $A(\bC)$ of the adjacency matrix. In order to calculate the average $\langle (\cdots) \rangle_{\rm ER}$ of the logarithm of the partition function, we use the replica method \cite{edwardsAnderson} \begin{equation} f = - \lim_{n \rightarrow 0} \lim_{N \rightarrow \infty} \frac{1}{\beta N n}\ln\left(\frac{\avER{Z^n e^{ yNF_{[a,b]} \left( \bC \right) }}} {\avER{e^{yNF_{[a,b]} \left( \bC \right) } }}\right)\,, \label{eq:logarithmReplica} \end{equation} in which we have exchanged the order of the limits $n \rightarrow 0$ and $N \rightarrow \infty$. This assumption, although very difficult to prove in the general case, is usually harmless, and it allows us to compute the free energy in the thermodynamic limit by solving a saddle-point integral. The general strategy of the replica approach consists firstly in evaluating the ensemble average in Eq. \eqref{eq:logarithmReplica} for a positive integer $n$. After the thermodynamic limit is taken, one considers $n \in \mathbb{R}$ and then continues $n$ analytically to $n \rightarrow 0$. Even though the replica method is generally a non-rigorous approach, it has a long tradition in the statistical physics of disordered systems as a correct heuristic method to evaluate ensemble averages \cite{BookParisi}. Since all pairwise couplings in our model are ferromagnetic, exact results for the thermodynamics of the system are obtained by simply restricting ourselves to the replica symmetric solutions for the order parameter \cite{BookParisi,Monasson1998}. All the details of the replica calculation are explained in appendix \ref{Ising}. Here we just present the final analytical expression for the replica symmetric free energy per spin \begin{widetext} \begin{equation} \begin{split} \beta f=& -c \mu_y^2 \ln 2 -\frac{c\mu_y^2}{2} \int d\theta d\theta' W(\theta) W(\theta') \ln\left[\frac{\cosh(\beta J)}{ 1+ \tanh (\beta \theta) \tanh (\beta \theta') \tanh (\beta J ) }\right] \\ &-\sum_{k=0}^\infty p_y(k) \int\left[ \prod_{l=1}^k d\theta_l W(\theta_l)\right] \ln\left( \frac{ \cosh\left[ \beta\left(h + \beta^{-1} \sum_{l=1}^k \arctanh[\tanh(\beta J) \tanh(\beta \theta_l)] \right)\right] } {2^{k-1}\prod_{l=1}^k \cosh\{\arctanh[\tanh(\beta J) \tanh(\beta \theta_l)]\}} \right), \end{split} \label{eq:freeEnergyFinal} \end{equation} \end{widetext} where $W(\theta)$ is the distribution of effective local fields \cite{Monasson1998}, obtained from the solution of the self-consistent distributional equation \begin{equation} \begin{split} W(\theta)&=\sum_{k=0}^\infty q_y(k)\int \left[ \prod_{l=1}^{k} d\theta_l W(\theta_l) \right] \\&\times \delta\left(\theta- h- \frac{1}{\beta} \sum\limits_{l=1}^{k} \arctanh[ \tanh(\beta J)\tanh(\beta \theta_l) ] \right) . \end{split} \label{eq:WstarFinal} \end{equation} The quantity $\mu_y$ in Eqs. \eqref{eq:freeEnergyFinal} and \eqref{eq:WstarFinal} encodes the microscopic graph structure of the constrained ensemble of ER graphs. The parameter $\mu_y$ is obtained from \cite{Isaac_Fernando} \begin{equation} \mu_y= \underset {\mu}{\operatorname {arg\max} } \{\mathcal{F}_y(\mu)\} = \frac{ \sum\limits_{k=0}^\infty \mu_y^k p_c(k) e^{y I_{[a,b]}( k+1)} } { \sum\limits_{k=0}^\infty \mu_y^k p_c(k)e^{y I_{[a,b]}( k)} }\,, \label{eq:muyDef} \end{equation} where the function $\mathcal{F}_y(\mu)$ reads \begin{equation} \mathcal{F}_y(\mu) -\frac{c}{2}-\frac{ c\mu^2}{2} + \ln\left(\sum\limits_{k=0}^\infty e^{yI_{[a,b]}(k)}\mu^k p_c(k)\right)\,. \label{jjjl} \end{equation} The quantities $p_y(k)$ and $q_y(k)$, appearing in Eqs. \eqref{eq:freeEnergyFinal} and \eqref{eq:WstarFinal}, are computed from the following equations \begin{equation} p_y(k)=\frac{\mu_y^k p_c(k)e^{y I_{[a,b]}( k)} } {\sum\limits_{q=0}^\infty \mu_y^qp_c(q)e^{y I_{[a,b]}( q)}}\,, \label{eq:pcTilde} \end{equation} \begin{equation} q_y(k)= \frac{ \mu_y^k p_c(k)e^{y I_{[a,b]}( k+1)} } {\sum\limits_{q=0}^\infty \mu_y^qp_c(q)e^{y I_{[a,b]}( q+1)}}\,, \label{eq:qcTilde} \end{equation} with $k \in \{0,1,2,\dots\}$. The quantity $p_y(k)$ is the probability that a randomly chosen node has degree $k$, while $q_y(k)$ is the probability that a node at one of the extremes of a randomly chosen edge has degree $k+1$ \cite{Newman10}. Both quantities depend on $y$, since they refer to the constrained ensemble of graphs generated from Eq. \eqref{eq:probWeightedY}. By combining Eqs. \eqref{eq:muyDef} and \eqref{eq:pcTilde}, one obtains that $c \mu_y^2 = \langle k \rangle_y$, where \begin{equation} \langle k \rangle_y = \sum_{k=0}^\infty k p_y(k) \label{meandeg} \end{equation} is the mean degree in the constrained ensemble. We point out that Eq. \eqref{eq:WstarFinal} has no closed analytical solution in the general case and one has to resort to the population dynamics algorithm \cite{MezardPopulationDynamics} in order to obtain a numerical solution to the distribution $W(\theta)$. Our aim is to characterize the different phases of the Ising model and the nature of the transitions between them. Thus, it is interesting to calculate the intensive magnetization, obtained from the derivative of the free energy with respect to the external field $h$ \begin{equation} m=\int d\theta \tilde W(\theta) \tanh(\beta \theta)\,, \label{eq:mWtilde} \end{equation} where the distribution $\tilde W(\theta)$ is determined from \begin{equation} \begin{split} \tilde W(\theta)&= \sum_{k=0}^\infty p_y(k) \int\left[ \prod\limits_{l=1}^k d\theta_l W(\theta_l) \right] \\ &\times\delta\left(\theta- h- \frac{1}{\beta} \sum\limits_{l=1}^{k} \arctanh[ \tanh(\beta J)\tanh(\beta \theta_l) ] \right)\,. \end{split} \label{eq:Wtilde} \end{equation} The derivative of $m$ with respect to $h$ yields the magnetic susceptibility \begin{equation} \chi=\int d\theta \frac{\partial \tilde W(\theta)}{\partial h} \tanh(\beta \theta)\,, \label{eq:ChiWtilde} \end{equation} while the analytical expression for the intensive internal energy $u$ reads \begin{equation} \begin{split} u&= -hm -\frac{Jc \, \mu_{y}^2}{2}\bigg\{\tanh(\beta J) \\&{}- \int \frac{d\theta d\theta' W(\theta) W(\theta') \tanh (\beta \theta) \tanh (\beta \theta') \sech^2(\beta J)}{ 1+ \tanh (\beta \theta) \tanh(\beta \theta') \tanh(\beta J) } \bigg\}\,. \label{eq:EnergyW} \end{split} \end{equation} An important feature of the phase diagram of the Ising model is the critical inverse temperature $\beta_c$ where the system changes its behavior from ferromagnetic to paramagnetic in a continuous way. Since the moments of the order parameter distribution $W(\theta)$ vary continuously across this transition, we can use bifurcation analysis and derive the following equation for $\beta_c$ (see appendix \ref{Ising} for details) \begin{equation} \langle k\rangle_{q_y}\tanh(\beta_c J)=1\,, \label{eq:criticalT} \end{equation} with \begin{align*} \langle k\rangle_{q_y}=\sum_{k=0}^\infty q_y(k) k\,. \end{align*} Random graph models usually undergo a second-order percolation transition as a function of the average degree $c$ \cite{Newman10}. In particular, the largest connected component of ER random graphs contains a total number of $O(N)$ nodes provided $c > 1$. Since the $T \rightarrow 0$ limit of the magnetization of the Ising model on a random graph gives the fraction of nodes belonging to the giant connected component \cite{Leone2002}, the limit $T \rightarrow 0$ of Eq. \eqref{eq:criticalT} yields the critical line marking the {\it continuous} percolation transition in the constrained ensemble defined by Eq. \eqref{eq:probWeightedY}. \subsection{Numerical results} We start by discussing the phase diagram for the structural transitions in the constrained ensemble for different intervals $[a,b]$ controlled by a single parameter $k_{*}$, defined through $a = k_{*}-1$ and $b = k_{*}+1$. Figure \ref{fig:cartoon1} shows the critical lines for the second-order percolation transition (dashed lines) and for the first-order condensation transition (solid lines) in the plane $(c,y)$ for different values of $k_{*}$. The continuous percolation transition is obtained by solving the equation $\langle k \rangle_y = 1$, derived from the limit $T \rightarrow 0$ of eq. (\ref{eq:criticalT}), while the condensation transition is obtained by finding the discontinuity of the fraction $f$ of nodes having degrees in $[a,b]$. For fixed values of $c$, the critical values $y_{c}$ on the solid lines identify the condensation transition: for $|y|> |y_{c}|$, the degree distribution $p_y(k)$ is peaked on a few degrees, while $p_y(k)$ exhibits a Poisson-like behavior for $|y|<|y_{c}|$ \cite{Isaac_Fernando}. For fixed values of $y$, the critical values $c_p$ on the dashed lines mark the percolation transition: for $c < c_p$, the graph is solely composed of finite connected components, whereas a giant connected component containing $O(N)$ nodes emerges for $c > c_p$. As shown in figure \ref{fig:cartoon1}, for $k_{*} =2$, the continuous percolation transition meets the condensation transition at a certain value of $y$, below which the percolation transition becomes first-order. Thus, in the case of $k_{*} =2$, the solid line appearing for low $c$ identifies both the percolation and the condensation transition. \begin{figure}[!htbp] \includegraphics[scale=0.75]{fig1.pdf} \caption{Phase diagram illustrating the second-order percolation transition (dashed lines) and the first-order condensation transition (solid lines) for the constrained ER random graph ensemble generated from eq. \eqref{eq:probWeightedY}, where the degrees are conditioned to lie in the interval $[k_{*}-1,k_{*}+1]$. For $k_{*} =2$, the second-order percolation transition terminates at a given value $y < 0$, below which it becomes discontinuous, coinciding with the condensation transition.} \label{fig:cartoon1} \end{figure} \begin{figure}[!htbp] \includegraphics[scale=0.95]{fig2.pdf} \caption{Critical temperature $T_c$ (see Eq. \eqref{eq:criticalT}) identifying the continuous phase transition between the paramagnetic and the ferromagnetic phases. The results for $T_c$ are shown as a function of $y$ for different values of the average degree $c$. The dashed lines mark the critical values $y_{c}$ at which the constrained ER ensemble undergoes a first-order structural transition to a phase exhibiting condensation of degrees (see Fig. \ref{fig:cartoon1}).} \label{fig:phaseDiagramIsing} \end{figure} Figure \ref{fig:phaseDiagramIsing} shows the critical temperature $T_c$ for the second-order phase transition between the paramagnetic and the ferromagnetic phases as a function of $y$. For sufficiently large $c$, $T_c$ drops discontinuously when $y$ crosses the condensation transition, which is a consequence of the abrupt decrease of the average degree $\langle k \rangle_y$ in the condensed phase. Finally, we study the effect of condensation of degrees on the thermodynamics of the Ising model. As we approach the first-order condensation transition in the plane $(c,y)$ (see figure \ref{fig:cartoon1}), the function $\mathcal{F}_y(\mu)$ displays two maxima, one of them being metastable. Figure \ref{magnetic} exhibits the magnetization, the internal energy, and the susceptibility for $c=13$. All quantities are shown as a function of $y$, for three different values of $T$, using figure \ref{fig:phaseDiagramIsing} as a guide. For $T=15$, even though the magnetization is always zero, the system exhibits a first-order transition between two paramagnetic phases at $y=y_c$, since the susceptibility and the internal energy display a jump at $y=y_c$. For $T=8$, the magnetization drops to zero at $y_c$, while $u$ and $\chi$ increase discontinuously. Such behavior characterizes a first-order transition between a ferromagnetic and a paramagnetic phase. Finally, for $T=2$, the Ising model undergoes two different phase transitions as a function of $y$. Firstly, $m$, $u$ and $\chi$ varies discontinuously at $y=y_c$, with the magnetization changing between two finite values, which characterizes a first-order phase transition between ferromagnetic states. By further increasing $y$ in the regime $y > y_c$, we notice that $m$ vanishes continuously, while the magnetic susceptibility seems to diverge at a certain $y$. The latter behavior is typical of the usual second-order phase transition between ferromagnetic and paramagnetic states occurring in the Ising model. \begin{figure}[!h] \includegraphics[scale=0.95]{fig3a.pdf} \\ \includegraphics[scale=0.95]{fig3b.pdf} \\ \includegraphics[scale=0.95]{fig3c.pdf} \caption{Magnetization $m$, internal energy $u$, and magnetic susceptibility $\chi$ of the Ising model as a function of $y$ for average degree $c=13$, zero external magnetic field ($h=0$), and different temperatures $T$. The theoretical results (solid lines) are derived from the numerical solution of Eq. \eqref{eq:WstarFinal} using the population dynamics algorithm, while the different symbols are results obtained from Monte Carlo simulations of the model with a total number of $N=1000$ spins. The inset shows the behavior of $\chi$ around the second-order phase transition between the paramagnetic and the ferromagnetic phases for $T=2$.} \label{magnetic} \end{figure} \section{Spectral properties of constrained random graphs} \label{spectrumXX} \subsection{The eigenvalue distribution} In this section we analyze the impact of the condensation transition on the eigenvalue distribution of ER random graphs drawn from Eq. \eqref{eq:probWeightedY}. By defining the eigenvalues $\lambda_1(\bC),\dots,\lambda_N(\bC)$ of a single instance of the symmetric adjacency matrix $\bC$, the empirical spectral distribution reads \begin{equation} \rho_N(\lambda)= \frac{1}{N}\sum_{i=1}^N \delta\left[ \lambda- \lambda_i(\bC) \right]\,. \label{eq:spectralDensityDefinition} \end{equation} Here we are interested in the average eigenvalue distribution corresponding to rare graph configurations labeled by $y$. Thus, following the prescription of eq. (\ref{klll}), we perform the ensemble average of $\rho_N(\lambda)$ over atypical regions of the ensemble space as follows \begin{equation} \rho_y(\lambda) = \lim_{N \rightarrow \infty} \frac{\avER{\rho_N(\lambda) e^{y N F_{[a,b]}\left( \bC \right) } } }{\avER{ e^{y N F_{[a,b]}\left( \bC \right)}} }\,. \label{spec} \end{equation} The calculation of $\langle . \rangle_{\rm ER}$ in the above equation can be recasted in a problem analogous to the computation of the average free energy in a spin-glass model \cite{Edwards} \begin{equation} \rho_y(\lambda)= -\frac{2}{N\pi} \lim_{\eta\rightarrow0^+} {\rm Im} \left[ \, \frac{\left\langle \partial_z \ln Z(z) e^{y N F_{[a,b]}\left( \bC \right) } \right\rangle_{\rm ER}} {\left\langle e^{y N F_{[a,b]}\left( \bC \right) } \right\rangle_{\rm ER} } \right]\,, \label{pol} \end{equation} where $Z(z)$ is the analogous of a partition function \begin{align*} Z(z)=\int_{-\infty}^{\infty} \left( \prod_{i=1}^N dx_i \right) e^{-\frac{i}{2}\sum\limits_{i,j=1}^N x_i \left( z \delta_{ij} - c_{ij} \right) x_j}\,, \end{align*} with $z= \lambda-i\eta$ and $\partial_z \equiv \frac{\partial}{\partial z}$. The behavior of $\rho_y(\lambda)$ as a function of $y$ will allow us to characterize the effect of condensation of degrees on the global spectral properties of $\bC$. The average spectral density $\rho_y(\lambda)$ can be computed using both the replica and the cavity methods, as developed in the context of sparse random matrix theory \cite{Edwards,Kuhn_2008,Isaac_2008}. Here we compute the ensemble average in Eq. \eqref{pol} by using the replica approach, whose main technical details are explained in appendix \ref{appspec}. The analytical expression for $\rho_y(\lambda)$ is given by \begin{align} \rho_y(\lambda)=-\lim_{\eta\rightarrow0^+} \frac{1}{\pi} \int d\Delta \, \tilde Q(\Delta) \, {\rm Im} \Delta , \label{eq:rhoLambdaQTilde} \end{align} where $\Delta \in \mathbb{C}$ and $d \Delta \equiv d {\rm Re} \Delta \, d {\rm Im} \Delta$. The joint distribution $\tilde Q(\Delta)$ of the real and imaginary parts of the complex variable $\Delta$ is determined from \begin{equation} \begin{split} \tilde Q(\Delta)&= \sum_{k=0}^\infty p_y(k) \int \left[\prod_{l=1}^k d\Delta_l Q(\Delta_l)\right] \\& \times \delta\left( \Delta+ \frac{1}{z+\sum_{l=1}^k \Delta_l } \right)\, , \end{split} \label{kp} \end{equation} where $Q(\Delta)$ obeys the self-consistent equation \begin{equation} \begin{split} Q(\Delta)&= \sum_{k=0}^\infty q_y(k) \int \left[\prod_{l=1}^k d\Delta_l Q(\Delta_l)\right] \\& \times \delta\left( \Delta+ \frac{1}{z+\sum_{l=1}^k \Delta_l } \right)\,. \end{split} \label{eq:QDeltaPopulationDynamics} \end{equation} The quantities $p_y(k)$ and $q_y(k)$, determined respectively by Eqs. \eqref{eq:pcTilde} and \eqref{eq:qcTilde}, encode the statistical properties of the degrees in the constrained ensemble of graphs. The quantity $\tilde Q(\Delta)$ can be easily identified as the distribution of the diagonal elements of the resolvent matrix associated to $\bC$ \cite{Metz2010}. In order to characterize the fluctuations of the eigenvalue distribution, it is interesting to consider the second moment of the spectral density \begin{equation} \langle \lambda^2 \rangle_{\rho_y} =\int d\lambda \rho_y(\lambda)\lambda^2. \end{equation} One can easily show that \begin{equation} \langle \lambda^2 \rangle_{\rho_y} = \langle k \rangle_y\,, \label{lp} \end{equation} where $\langle k \rangle_y$ follows from eq. (\ref{meandeg}). Since $\langle \lambda \rangle_{\rho_y} = 0$ due to the symmetry $\rho_y(\lambda) = \rho_y(-\lambda)$, the variance of the distribution $\rho_y(\lambda)$ is fully determined by the average degree in the constrained ensemble. \subsection{Numerical results} Here we discuss the outcome of solving Eqs. (\ref{eq:rhoLambdaQTilde}-\ref{eq:QDeltaPopulationDynamics}) numerically for different values of $y$ using the population dynamics method. The results are presented in figure \ref{fig:crossingPhaseTransitionSpectralDensity} for two fixed values of $c$, in order to capture the effect of the first-order condensation transition occurring at small and large average degrees (see figure (\ref{fig:cartoon1})). For large $c$, $\rho_y(\lambda)$ is approximately given by the Wigner semicircle law when $y=0$. By increasing $y$, $\rho_y(\lambda)$ gradually develops a bump at $\lambda=0$, until the eigenvalue distribution suddenly becomes more concentrated around $\lambda=0$ for $y > y_c$, which reflects the large fraction of degrees lying in the interval $[a,b]$ within the condensed phase. Accordingly, the variance of $\rho_y(\lambda)$ drops discontinuously as $y$ crosses the critical point $y=y_c$, as illustrated in the inset of figure \ref{fig:crossingPhaseTransitionSpectralDensity}(a). For low values of $c$, the distribution $\rho_{y}(\lambda)$ corresponding to typical graph configurations ($y=0$) is composed of many delta peaks, most of them located at the eigenvalues of finite trees \cite{Bauer2001}. The delta peaks gradually disappear for decreasing $y <0$, until the distribution $\rho_y(\lambda)$ abruptly collapses into a few delta peaks when $|y| > |y_c|$. In particular, figure \ref{fig:crossingPhaseTransitionSpectralDensity}(b) suggests that, when $|y| > |y_c|$, the peak at $\lambda=0$ has the largest weight in comparison to the others. This feature is consistent with the degree distribution $p_y(k)$ characterizing the condensed phase appearing in this specific region of the phase diagram, where $p_y(k)$ displays a large peak at $k=0$ \cite{Isaac_Fernando}. Overall, figure \ref{fig:crossingPhaseTransitionSpectralDensity} shows that the condensation transition leads to a dramatic change of the eigenvalue statistics. This is in contrast, for instance, to the standard second-order percolation transition, which does not bring about any qualitative changes in the moments of the spectral density \cite{Bauer2001}, even though the structure of the graph changes in a striking way. \begin{figure}[!h] \includegraphics[scale=0.80]{fig4a.pdf} \\ \includegraphics[scale=0.80]{fig4b.pdf} \caption{Theoretical results (solid lines) for the spectral density of constrained ER random graphs for different values of $y$ (see Eq. \eqref{eq:probWeightedY}), interval $[1,3]$, and average degrees (a) $c=13$ and (b) $c=2$. Figures (a) and (b) show the behavior of the eigenvalue distribution as we cross the condensation transition for high and low $c$, respectively. The theoretical results are obtained from the numerical solution of Eq. \eqref{eq:QDeltaPopulationDynamics} using the population dynamics algorithm. The square symbols are obtained from the direct diagonalization of $1000$ independent realizations of the $1000 \times 1000$ adjacency matrix characterizing atypical graph configurations generated through a reweighted Monte Carlo method \cite{Isaac_Fernando}. The eigenvalues have been rescaled as $\lambda_i \rightarrow \lambda_i / \sqrt{c}$ in subfigure (a). The inset shows the second moment of the spectral density $\rho_y(\lambda)$ for $c=13$.} \label{fig:crossingPhaseTransitionSpectralDensity} \end{figure} \section{Final remarks} \label{conclusionXX} Random graphs undergo structural transitions when certain control parameters are changed. Here we have studied the effect of a discontinuous transition in the topology of Erd\H{o}s-R\'enyi (ER) random graphs on two different problems: the thermodynamic behavior of the Ising model defined on ER random graphs, and the eigenvalue statistics of the adjacency matrix of ER graphs. This structural transition identifies the discontinuous appearance of rare graph samples having a large number of nodes with similar degrees, following from an abrupt change in the degree statistics. We have shown that this condensation transition has a profound impact on the equilibrium properties of the Ising model as well as on the spectral properties of random graphs. In the case of the Ising model, the condensation transition leads to a rich phase diagram, including additional first-order phase transitions between the paramagnetic and the ferromagnetic phases, which are absent in the typical equilibrium behaviour of the Ising model without an external magnetic field. We have characterized the transitions among the different phases in terms of the magnetization, the internal energy, and the magnetic susceptibility. Concerning the spectral properties of ER random graphs, we have shown that the condensation transition in the graph structure leads to a discontinuous behaviour of the eigenvalue statistics of the adjacency matrix. In particular, the variance of the eigenvalue distribution displays a jump at the condensation transition, which characterizes the abrupt change in the total number of edges. The exactness of our main theoretical results have been supported by Monte Carlo simulations. The first-order phase transitions discussed here are detected by varying a control parameter $y$, which is coupled to a random variable that counts how many degrees lie in an arbitrary interval $[a,b]$. Thus, $y$ enables to probe rare sectors of the graph ensemble space, since this parameter essentially controls the ``distance'' from the regime of typical fluctuations ($y=0$). Therefore, from the perspective of large deviation theory, the condensation transition in the degree statistics is triggered by large deviations in the graph structure. The parameter $y$ has a more concrete meaning when we interpret the generation of {\it rare} graph samples in the original model (see Eq. \eqref{klla}) as the generation of {\it typical} graph samples in a constrained ER ensemble (see Eq. \eqref{eq:probWeightedY}). In this setting, we can picture a variation in $y$ as a change in the graph topology, where some edges are rewired in order to comply with a certain average fraction of degrees in $[a,b]$. This is indeed one of the main ideas underlying the reweighted Monte Carlo approach to generate atypical ER graph samples \cite{Isaac_Fernando,Hart}. Here we have illustrated the impact of condensation of degrees in a paradigmatic model of cooperative behavior, i.e. the Ising model, and on an important spectral observable for dynamical processes on graphs, i.e. the eigenvalue distribution of the adjacency matrix. Although the condensation transition is a statistically rare event, from the results reported here we expect that condensation of degrees has a striking effect on the macroscopic behavior of other large interacting systems modelled through random graphs. Thus, we hope our work stimulates the research towards a better understanding of the effects of condensation of degrees in different topics, such as synchronization phenomena on networks \cite{Doro2002}, diffusion processes on graphs \cite{Noh2004}, the linear stability of sparse interacting systems \cite{Neri2016,Neri2019}, and the dynamics of network formation \cite{Newman10}. Finally, we point out that condensation of degrees is driven by weak correlations between the degrees of ER random graphs. Since the eigenvalues of a sparse random matrix are weakly correlated random variables \cite{Metz_PerezC2017,PerezC_Metz2018,PerezC_Metz2018_2}, it would be interesting to study whether these eigenvalues undergo a similar condensation transition. \begin{acknowledgments} I. P. C and F. L. M. thank London Mathematical Laboratory for financial support. F. L. M. also acknowledges a fellowship and financial support from CNPq/Brazil (Edital Universal 406116/2016-4). \end{acknowledgments}
\section{Training Details} We provide a more detailed visualization and description of HRL (Figure~\ref{fig:hrl}). \begin{figure}[h] \begin{center} \includegraphics[width=0.84\textwidth]{hrl_diagram.pdf} \end{center} \caption{ A diagram showing the structural form of an HRL agent. Every $c$ steps, a higher-level policy $\pi_{\mathrm{hi}}$ chooses a high-level action $g_t$. In the options framework, this high-level action is an identifier, choosing which of $m$ options to activate. In goal-conditioned HRL, the high-level action is a goal-state. In either case, a lower-level policy $\pi_{\mathrm{lo}}$ is used to produce a sequence of atomic actions $a_t$. After $c$ steps, control is returned to the higher-level policy. } \label{fig:hrl} \vspace{-0.1in} \end{figure} \section{Evaluating the Benefits of Modularity} \begin{figure}[h] \setlength{\tabcolsep}{0pt} \renewcommand{\arraystretch}{0.7} \begin{center} \begin{tabular}{cccc} \tiny AntMaze & \tiny AntPush & \tiny AntBlock & \tiny AntBlockMaze \\ \includegraphics[width=0.23\textwidth]{net_0b.pdf} & \includegraphics[width=0.23\textwidth]{net_1b.pdf} & \includegraphics[width=0.23\textwidth]{net_2b.pdf} & \includegraphics[width=0.23\textwidth]{net_3b.pdf} \\ \multicolumn{4}{c}{\includegraphics[width=0.99\textwidth]{net_legend.pdf}} \end{tabular} \end{center} \caption{ We evaluate the importance of modularity -- in this case, using separate networks for separate policies. We find that using separate networks is consistently better, suggesting that modularity is important for both HRL and HRL-like methods. } \label{fig:eval-modular} \vspace{-0.1in} \end{figure} We evaluate the merits of using {\em modularity} in HRL systems. We have already shown in the main text that a non-HRL agent can achieve performance similar to HRL. However, all of these non-HRL agents utilize multiple policies, similar to how HRL agents have separate lower-level and higher-level policies. Thus, we evaluate how important this modularity is. We evaluate HIRO as well as the successful non-hierarchical methods from Section~\ref{sec:sem-explore} with and without separate networks. Specifically, for HIRO we combine the separate networks for lower and higher-level policies into a single network with multiple heads. For Explore \& Exploit and Five Exploit we combine the separate networks for each policy into a single network with multiple heads. The results are presented in Figure~\ref{fig:eval-modular}. We see that combined networks consistently lead to worse performance than structurally separate networks. HIRO and Explore \& Exploit are especially sensitive to this change, suggesting that Hypothesis \h5 is true for settings using goal-conditioned hierarchy or exploration. Overall, the use of separate networks for goal-reaching and task solving is beneficial to the performance of these methods in these settings. \section{Experiment Details} Our implementations are based on the open-source implementation of HIRO~\citep{hiro}, using default hyperparameters. HIRO uses TD3 for policy training~\citep{fujimoto2018addressing}, and so we train all non-hierarchical agents using TD3, with the same network and training hyperparameters as used by HIRO, unless otherwise stated. Since the choice of $c$ in goal-conditioned HRL can also impact low-level training, as the frequency of new goals in recorded experience can affect the quality of the learned low-level behavior. To neutralize this factor in our ablations, we modify transitions $(s_t,g_t,a_t,r_t,s_{t+1},g_{t+1})$ used for low-level training by replacing the next goal $g_{t+1}$ with the current goal $g_t$; in this way the lower-level policy is trained as if the high-level goal is never changed. This implementation modification has a negligible effect on HRL's performance with otherwise default settings. To implement Hierarchical Actor-Critic (HAC)~\citep{levy2017hierarchical}, we augment the HIRO implementation with hindsight experience replay used for the lower-level policy. To implement Option-Critic~\citep{bacon2017option} in this framework, we create $m=5$ separate lower-level policies trained to maximize reward (using $n$-step returns, where $n=3$). We replace the higher-level continuous-action policy with a discrete double DQN-based agent, with $\epsilon$-greedy exploration ($\epsilon=0.5$). For our exploration alternatives (Explore \& Exploit and Switching Ensemble), we utilize multi-step environment rewards with $c_{\mathrm{rew}}=3$, which we found to work well in Section~\ref{sec:eval-sem-train} (see Figure~\ref{fig:eval-sem-train}). We also found it beneficial to train at a lower frequency: we collect 2 environment steps per each training (gradient descent) step. To keep the comparisons fair, we train these variants for 5M training steps (corresponding to 10M environment steps, equal to that used by HRL). \section{Hierarchical Reinforcement Learning} \label{sec:bkg} \vspace{-0.11in} We briefly summarize the HRL methods and environments we evaluate on. We consider the typical two-layer hierarchical design, in which a higher-level policy solves a task by directing one or more lower-level policies. In the simplest case, the higher-level policy chooses a new high-level action every $c$ timesteps.\footnote{We restrict our analysis to hierarchies using fixed $c$, although evaluating variable-length temporal abstractions are an important avenue for future work.} In the options framework, the high-level action is a discrete choice, indicating which of $m$ lower-level policies (called options) to activate for the next $c$ steps. In goal-conditioned hierarchies, there is a single goal-conditioned lower-level policy, and the high-level action is a continuous-valued goal state which the lower-level is directed to reach. Lower-level policy training operates differently in each of the HRL paradigms. For the options framework, we follow~\citet{bacon2017option,frans2017meta}, training each lower-level policy to maximize environment reward. We train $m$ separate Q-value functions to minimize errors, \begin{equation} \mathcal{E}(s_t,a_t,R_t,s_{t+1})=\left(Q_{\mathrm{lo},m}(s_t,a_t) - R_t - \gamma Q_{\mathrm{lo},m}(s_{t+1},\pi_{\mathrm{lo},m}(s_{t+1})\right)^2, \end{equation} over single-step transitions, and the $m$ option policies are learned to maximize this Q-value $Q_{\mathrm{lo},m}(s_t,\pi_{\mathrm{lo},m}(s_t))$. In contrast, for HIRO~\citep{hiro} and HAC~\citep{levy2017hierarchical}, the lower-level policy and Q-function are goal-conditioned. That is, a Q-function is learned to minimize errors, \begin{equation} \mathcal{E}(s_t,g_t,a_t,r_t,s_{t+1},g_{t+1}) = \left(Q_{\mathrm{lo}}(s_t,g_t,a_t) - r_t - \gamma Q_{\mathrm{lo}}(s_{t+1},g_{t+1},\pi_{\mathrm{lo}}(s_{t+1},g_{t+1})\right)^2, \end{equation} over single-step transitions, where $g_t$ is the current goal (high-level action updated every $c$ steps) and $r_t$ is an intrinsic reward measuring negative L2 distance to the goal. The lower-level policy is then trained to maximize the Q-value $Q_{\mathrm{lo}}(s_t,g_t,\pi_{\mathrm{lo}}(s_t,g_t))$. For higher-level training we follow~\citet{hiro,frans2017meta} and train based on temporally-extended $c$-step transitions $(s_t,g_t,R_{t:t+c-1},s_{t+c})$, where $g_t$ is a high-level action (discrete identifier for options, goal for goal-conditioned hierarchies) and \mbox{$R_{t:t+c-1}=\textstyle\sum_{k=0}^{c-1}R_{t+k}$} is the $c$-step sum of environment rewards. That is, a Q-value function is learned to minimize errors, \begin{equation} \mathcal{E}(s_t,g_t,R_{t:t+c-1},s_{t+c}) = \left(Q_{\mathrm{hi}}(s_t,g_t) - R_{t:t+c-1} - \gamma Q_{\mathrm{hi}}(s_{t+c},\pi_{\mathrm{hi}}(s_{t+c}))\right)^2. \end{equation} In the options framework where high-level actions are discrete, the higher-level policy is simply $\pi_{\mathrm{hi}}(s):=\arg\max_{g} Q_{\mathrm{hi}}(s,g)$. In goal-conditioned HRL where high-level actions are continuous, the higher-level policy is learned to maximize the Q-value $Q_{\mathrm{hi}}(s,\pi_{\mathrm{hi}}(s))$. Note that higher-level training in HRL is distinct from the use of {\em multi-step rewards} or {\em $n$-step returns}~\citep{hessel2018rainbow}, which proposes to train a non-hierarchical agent with respect to transitions $(s_t,a_t,R_{t:t+c_{\mathrm{rew}}-1},s_{t+c_{\mathrm{rew}}})$; i.e., the Q-value of a non-HRL policy is learned to minimize, \begin{equation} \mathcal{E}(s_t,a_t,R_{t:t+c-1},s_{t+c}) = \left(Q(s_t,a_t) - R_{t:t+c_{\mathrm{rew}}-1} - \gamma Q(s_{t+c_{\mathrm{rew}}},\pi(s_{t+c_{\mathrm{rew}}}))\right)^2, \end{equation} while the policy is learned to choose atomic actions to maximize $Q(s,\pi(s))$. In contrast, in HRL both the rewards {\em and} the actions $g_t$ used in the Q-value regression loss are temporally extended. However, as we will see in Section~\ref{sec:eval-sem-train}, the use of multi-step rewards alone can achieve almost all of the benefits associated with hierarchical training (controlling for exploration benefits). For our empirical analysis, we consider four difficult tasks involving simulated robot locomotion, navigation, and object manipulation (see Figure~\ref{fig:eval-shallow}). To alleviate issues of goal representation learning in goal-conditioned HRL, we fix the goals to be relative $x,y$ coordinates of the agent, which are a naturally good representation for our considered tasks. We note that this is only done to better control our empirical analysis, and that goal-conditioned HRL can achieve good performance on our considered tasks without this prior knowledge~\citep{nachum2018near}. We present the results of two goal-conditioned HRL methods: HIRO~\citep{hiro} and HIRO with goal relabelling (inspired by HAC;~\citet{levy2017hierarchical}) and an options implementation based on~\citet{frans2017meta} in Figure~\ref{fig:eval-shallow}. HRL methods can achieve strong performance on these tasks, while non-hierarchical methods struggle to make any progress at all. In this work, we strive to isolate and evaluate the key properties of HRL which lead to this stark difference. \section{Discussion and Conclusion} \vspace{-0.13in} Looking back at the initial set of hypotheses from Section~\ref{sec:hypo}, we can draw a number of conclusions based on our empirical analysis. In terms of the benefits of training, it is clear that training with respect to semantically meaningful abstract actions (\h3) has a negligible effect on the success of HRL (as seen from our {\em shadow} experiments; Figure~\ref{fig:eval-sem-train}). Moreover, temporally extended training (\h1) is only important insofar as it enables the use of multi-step rewards, as opposed to training with respect to temporally extended actions (Figure~\ref{fig:eval-sem-train}). The main, and arguably most surprising, benefit of hierarchy is due to exploration. This is evidenced by the fact that temporally extended goal-reaching and agent-switching can enable non-hierarchical agents to solve tasks that otherwise can only be solved, in our experiments, by hierarchical agents (Figure~\ref{fig:eval-sem-expl}). These results suggest that the empirical effectiveness of hierarchical agents simply reflects the improved exploration that these agents can attain. These conclusions suggest several future directions. First, our results show that current state-of-the-art HRL methods only achieve a subset of their claimed benefits. More research needs to be done to fully realize all of the benefits, especially with respect to semantic and temporally extended training. Second, our results suggest that hierarchy can be used as an inspiration for better exploration methods, and we encourage future work to investigate more variants of the non-hierarchical exploration strategies we proposed. Still, our empirical analysis has limitations. Our results and conclusions are restricted to a limited set of hierarchical designs. The use of other hierarchical designs may lead to different conclusions. Additionally, our analysis focuses on a specific set of tasks and environments. The benefits of hierarchy may be different in other settings. For example, the use of hierarchy in multi-task settings may be beneficial for better {\em transfer}, a benefit that we did not evaluate. In addition, tasks with more complex environments and/or sparser rewards may benefit from other mechanisms for encouraging exploration (e.g., count-based exploration), which would be a complementary investigation to this study. An examination of different hierarchical structures and more varied settings is an important direction for future research. \begin{figure} \renewcommand{\arraystretch}{2.2} \begin{center} \begin{tabular}{|l|c|c|p{2in}|} \hline \begin{minipage}{1.5in} \begin{center} Hypothesis \end{center} \end{minipage} & Experiments & Important? \\ \hline (\h1) Temporal training & Figures~\ref{fig:eval-temp},~\ref{fig:eval-sem-train} & \begin{minipage}{2in} \begin{center} Yes, but only for the use of multi-step rewards ($n$-step returns). \end{center} \end{minipage} \\ \hline (\h2) Temporal exploration & Figures~\ref{fig:eval-temp},~\ref{fig:eval-sem-expl} & \begin{minipage}{2in} \begin{center} Yes, and this is important even for non-hierarchical exploration. \end{center} \end{minipage} \\ \hline (\h3) Semantic training & Figure~\ref{fig:eval-sem-train} & No. \\ \hline (\h4) Semantic exploration & Figure~\ref{fig:eval-sem-expl} & \begin{minipage}{2in} \begin{center} Yes, and this is important even for non-hierarchical exploration. \end{center} \end{minipage} \\ \hline \end{tabular} \end{center} \caption{ A summary of our conclusions on the benefits of hierarchy. } \label{tab:conc} \vspace{-0.1in} \end{figure} \section{Experiments} \vspace{-0.1in} Our experiments are aimed at studying the hypotheses outlined in the previous section, analyzing which of the intuitive benefits of HRL are actually present in practice. We begin by evaluating the performance of HRL when varying the length of temporal abstraction used for training and exploration (Section~\ref{sec:eval-temp}, \h1 and \h2), finding that although this has some impact on results, it is not enough to account for the stark difference between HRL and non-hierarchical methods observed in Figure~\ref{fig:eval-shallow}. We then look at the training hypotheses more closely (Section~\ref{sec:eval-sem-train}, \h1 and \h3). We find that, controlling for exploration, hierarchical training is only useful so far as it utilizes multi-step rewards, and furthermore the use of multi-step rewards is possible with a non-hierarchical agent. Given this surprising finding, we focus on the exploration question itself (Section~\ref{sec:sem-explore}, \h2 and \h4). We propose two exploration strategies, inspired by HRL, which enable non-hierarchical agents to achieve performance competitive with HRL. \vspace{-0.1in} \subsection{Evaluating the Benefits of Temporal Abstraction (\h1 and \h2)} \label{sec:eval-temp} \vspace{-0.1in} We begin by evaluating the merits of Hypotheses \h1 and \h2, both of which appeal to the temporally extended nature of high-level actions. In our considered hierarchies, temporal abstraction is a hyperparameter. Each high-level action operates for $c$ environment time steps. Accordingly, the choice of $c$ impacts two main components of learning: \begin{itemize} \item During training, the higher-level policy is trained with respect to temporally extended transitions of the form $(s_t, g_t, R_{t:t+c-1}, s_{t+c})$ (see Section~\ref{sec:bkg} for details). \item During experience collection, a high-level action is sampled and updated every $c$ steps. \end{itemize} The first of these implementation details corresponds to \h1 (temporally extended training) while the second corresponds to \h2 (temporally extended exploration), and we can vary these two parameters independently to study the two hypotheses separately. Accordingly, we take HIRO, the best performing HRL method from Figure~\ref{fig:eval-shallow}, and implement it so that these two instances of temporal abstraction are decoupled into separate choices $c_{\mathrm{train}}$ for training horizon and $c_{\mathrm{expl}}$ for experience collection horizon. We evaluate performance across different choices of these two hyperparameters. \begin{figure}[h] \setlength{\tabcolsep}{0pt} \renewcommand{\arraystretch}{0.7} \begin{center} \begin{tabular}{cccc} \multicolumn{4}{c}{\small Varying Train Horizon}\vspace{0.05in} \\ \tiny AntMaze & \tiny AntPush & \tiny AntBlock & \tiny AntBlockMaze \\ \includegraphics[width=0.21\textwidth]{temporal_0b_train.pdf} & \includegraphics[width=0.21\textwidth]{temporal_1b_train.pdf} & \includegraphics[width=0.21\textwidth]{temporal_2b_train.pdf} & \includegraphics[width=0.21\textwidth]{temporal_3b_train.pdf} \end{tabular} \includegraphics[width=0.99\textwidth]{temporal_legend_train.pdf} \\ \small Varying Exploration Horizon \\%}\vspace{0.05in} \\ \begin{tabular}{cccc} \tiny AntMaze & \tiny AntPush & \tiny AntBlock & \tiny AntBlockMaze \\ \includegraphics[width=0.21\textwidth]{temporal_0b_expl.pdf} & \includegraphics[width=0.21\textwidth]{temporal_1b_expl.pdf} & \includegraphics[width=0.21\textwidth]{temporal_2b_expl.pdf} & \includegraphics[width=0.21\textwidth]{temporal_3b_expl.pdf} \end{tabular} \includegraphics[width=0.99\textwidth]{temporal_legend_expl.pdf} \vspace{-0.1in} \end{center} \caption{ We present the results for different HRL methods while changing the temporal abstraction used for training ($c_{\mathrm{train}}$, top) or the temporal abstraction used for experience collection ($c_{\mathrm{expl}}$, bottom). Average success rates and standard errors are calculated for 5 randomly seeded runs, trained for 10M steps with early stopping. Recall that our HRL baselines use $c_{\mathrm{train}}=c_{\mathrm{expl}}=10$. When varying $c_{\mathrm{train}}$, we find that the choice of horizon matters only so far as $c_{\mathrm{train}}>1$. For $c_{\mathrm{expl}}$, while there exists correlation between performance and temporal abstraction, using no temporal abstraction ($c_{\mathrm{expl}}=1$) can still make non-negligible progress compared to the shallow policies in Figure~\ref{fig:eval-shallow}. } \label{fig:eval-temp} \vspace{-0.1in} \end{figure} The results are presented in Figure~\ref{fig:eval-temp}, showing performance for different values of $c_{\mathrm{train}}$ (top) and $c_{\mathrm{expl}}$ (bottom); recall that our baseline HRL method uses $c_{\mathrm{train}}=c_{\mathrm{expl}}=10$. The strongest effect of $c_{\mathrm{train}}$ is observed in AntMaze and AntPush, where the difference between $c_{\mathrm{train}}=1$ and $c_{\mathrm{train}}>1$ is crucial to adequately solving these tasks. Otherwise, while there is some noticeable difference between specific choices of $c_{\mathrm{train}}$ (as long as $c_{\mathrm{train}}>1$), there is no clear pattern suggesting that a larger value of $c_{\mathrm{train}}$ is better. For $c_{\mathrm{expl}}$, the effect seems slightly stronger. In AntMaze, there is no observed effect, while in AntPush, AntBlock, and AntBlockMaze there exists some correlation suggesting higher values of $c_{\mathrm{expl}}$ do yield better performance. Even so, $c_{\mathrm{expl}}=1$ is often able to make non-negligible progress towards adequately solving the tasks, as compared to a non-hierarchical shallow policy (Figure~\ref{fig:eval-shallow}). Overall, these results provide intriguing insights into the impact of temporally abstracted training and exploration. While temporally extended training appears to help on these tasks, it is enough to have $c_{\mathrm{train}}>1$. Temporally extended exploration appears to have a stronger effect, although it alone does not adequately explain the difference between an HRL agent that can solve the task and a non-hierarchical one that cannot make any progress. Where then does the benefit come from? In the next sections, we will delve deeper into the impact of hierarchy on training and exploration. \vspace{-0.1in} \subsection{Evaluating the Benefits of Hierarchical Training (\h1 and \h3)} \label{sec:eval-sem-train} \vspace{-0.1in} \begin{figure} \setlength{\tabcolsep}{0pt} \renewcommand{\arraystretch}{0.7} \begin{center} \begin{tabular}{cccc} \tiny AntMaze & \tiny AntPush & \tiny AntBlock & \tiny AntBlockMaze \\ \includegraphics[width=0.21\textwidth]{shadow_0b.pdf} & \includegraphics[width=0.21\textwidth]{shadow_1b.pdf} & \includegraphics[width=0.21\textwidth]{shadow_2b.pdf} & \includegraphics[width=0.21\textwidth]{shadow_3b.pdf} \end{tabular} \includegraphics[width=0.9\textwidth]{shadow_legend.pdf} \vspace{-0.1in} \end{center} \caption{ We evaluate and compare the performance of training a non-hierarchical {\em shadow} agent trained on experience collected by a hierarchical agent, thus disentangling the potential benefits of HRL for exploration from the potential benefits of HRL for training. In all environments except AntMaze, the shadow agent can achieve performance competitive with HRL, given an appropriate multi-step reward horizon ($c_{\mathrm{rew}}=3$ performs best). Overall, this suggests that the effect of hierarchy on ease of training (as opposed to exploration) is modest, and can mostly be replicated by a non-hierarchical agent given good experience and the use of multi-step rewards. } \label{fig:eval-sem-train} \vspace{-0.1in} \end{figure} The previous section suggested that temporally extended training (\h1) has at most a modest impact on the performance of HRL. In this section, we take a closer look at the benefits of hierarchy on training and study Hypothesis \h3, which suggests that high-level actions used by HRL are easier for learning as compared to the atomic actions of the MDP. In goal-conditioned hierarchies for example, \h3 claims that it is easier for RL to learn policy and value functions based on delta x-y commands (goals), than it is to learn policy and value functions based on atomic joint-torque actions exposed by the environment. In this section we aim to isolate this supposed benefit from other confounding factors, such as potential exploration benefits. Therefore, we devise an experiment to disentangle exploration from action representation, by training a standard non-hierarchical agent (a {\em shadow} agent) on experience collected by a hierarchical agent. If the benefits of HRL stem primarily from exploration, we would expect the shadow agent to do well; if representation of high-level actions matters for training, we would expected HRL to do better. Accordingly, we augment our HRL implementation (specifically, HIRO) with an additional parallel shadow agent, represented by a standard single-level policy and value function. Each agent -- the HRL agent and the non-hierarchical shadow agent -- has its own replay buffer and collects its own experience from the environment. During training, we train the HRL agent as usual, while the shadow agent is trained on batches of experience gathered from {\em both} replay buffers (70\% from the shadow agent's experience and 30\% from the HRL agent's experience, chosen based on appropriate tuning). This way, any need for exploration is fulfilled by the experience gathered by the HRL agent. Will the non-hierarchical agent's policy still be able to learn? Or does training with a higher-level that uses semantically meaningful high-level actions make learning easier? We present the results of our experiments in Figure~\ref{fig:eval-sem-train}. While the potential impacts of Hypotheses \h2 and \h4 (exploration) are neutralized by our setup, the impact of Hypothesis \h1 (which Section~\ref{sec:eval-temp} showed has a modest impact) still remains. As an attempt to control for this factor, we also consider a setup where the non-hierarchical shadow agent receives multi-step rewards (see Section~\ref{sec:bkg} for an overview of multi-step rewards). Different temporal extents for the multi-step rewards are indicated by $c_{\mathrm{rew}}$ in the figure legend. The results in Figure~\ref{fig:eval-sem-train} show that learning from atomic actions, without higher-level action representations, {\em is} feasible, and can achieve similar performance as HRL. On AntMaze, we observe a slight drop in performance, but otherwise performance is competitive with HRL. The results across different multi-step reward horizons $c_{\mathrm{rew}}$ also provide further insight into the conclusions of Section~\ref{sec:eval-temp}. As suggested by the results of Section~\ref{sec:eval-temp}, temporally abstracted training {\em does} affect performance, especially for AntMaze and AntPush. Still, while temporally abstracted training is important, these results show that the same benefit can be achieved by simply using multi-step rewards (which are much simpler to implement than using temporally extended actions). To confirm that multi-step rewards are not the only component necessary for success, see Figure~\ref{fig:eval-shallow}, in which a non-hierarchical shallow agent with multi-step rewards is unable to make non-negligible progress on these tasks. Overall, we conclude that the high-level action representations used by HRL methods in our domains are not a core factor for the success of these methods, outside of their potential benefits for exploration. The only observed benefit of high-level action representations in training is due to the use of multi-step rewards, and this can be easily incorporated into non-hierarchical agent training. \begin{figure} \setlength{\tabcolsep}{0pt} \renewcommand{\arraystretch}{0.7} \begin{center} \begin{tabular}{cccc} \tiny AntMaze & \tiny AntPush & \tiny AntBlock & \tiny AntBlockMaze \\ \includegraphics[width=0.21\textwidth]{explore_0b.pdf} & \includegraphics[width=0.21\textwidth]{explore_1b.pdf} & \includegraphics[width=0.21\textwidth]{explore_2b.pdf} & \includegraphics[width=0.21\textwidth]{explore_3b.pdf} \end{tabular} \includegraphics[width=0.9\textwidth]{explore_legend.pdf} \\ \begin{tabular}{cccc} \includegraphics[width=0.21\textwidth]{explore5_0b.pdf} & \includegraphics[width=0.21\textwidth]{explore5_1b.pdf} & \includegraphics[width=0.21\textwidth]{explore5_2b.pdf} & \includegraphics[width=0.21\textwidth]{explore5_3b.pdf} \end{tabular} \includegraphics[width=0.9\textwidth]{explore5_legend.pdf} \vspace{-0.1in} \end{center} \caption{ We compare the performance of HRL to Explore \& Exploit (E\&E) and Switching Ensemble (SE) -- two non-hierarchical exploration methods that make use of HRL-inspired temporally extended modulation of behaviors (length of modulation given by $c_{\mathrm{switch}}$). We find that the non-hierarchical methods are able to match the performance of HRL on these tasks (with the only exceptions being Explore \& Exploit on AntBlockMaze and Switching Ensemble on AntPush), suggesting that exploration is the key to success on these tasks. These results also make clear the importance of temporally extended exploration; using $c_{\mathrm{switch}}>1$ is almost always better than $c_{\mathrm{switch}}=1$. } \label{fig:eval-sem-expl} \vspace{-0.1in} \end{figure} \vspace{-0.1in} \subsection{Evaluating the Benefits of Hierarchical Exploration} \label{sec:sem-explore} \vspace{-0.1in} The findings of the previous section show that training a non-hierarchical agent on `good' experience (from a hierarchical agent) performs about as well as the hierarchical agent itself. If representing the policy and value function in terms of temporally extended, abstract actions is not crucial to achieving good performance, the next most-likely explanation is that the `good' experience itself is the key. That is, good exploration is the key component to the success of HRL. This is the claim proposed by Hypotheses \h2 (temporally extended exploration) and \h4 (semantic exploration). In this section, we attempt to extend the experiments presented in Section~\ref{sec:eval-temp} to better understand the impact of good exploration on the performance of a non-hierarchical agent. We will show that it is possible to enable non-hierarchical agents to achieve results competitive with HRL by using two exploration methods inspired by HRL: {\em Explore \& Exploit} and {\em Switching Ensemble}. Explore \& Exploit is inspired by the hypothesis that goal-reaching is a good exploration strategy independent of hierarchy~\citep{baranes2010intrinsically}. Thus, we propose training two non-hierarchical agents -- one trained to maximize environment rewards (similar to the higher-level policy in HRL), and the other trained to reach goals (similar to the lower-level policy in goal-conditioned HRL). Unlike in HRL, each policy operates on the atomic actions of the environments, and the goal for the explore agent is sampled randomly according to an Ornstein-Uhlenbeck process (standard deviation 5 and damping 0.8) as opposed to a learned policy. During experience collection, we randomly switch between the explore and exploit agents every $c_{\mathrm{switch}}$ timesteps. Specifically, every $c_{\mathrm{switch}}$ steps we randomly sample one of the two agents (with probability $0.2,0.8$ for the explore and exploit agents, respectively), and this chosen agent is used for sampling the subsequent $c_{\mathrm{switch}}$ atomic actions. Both agents share the same replay buffer for training. In this way, we preserve the benefits of goal-directed exploration -- temporally extended and based on goal-reaching in a semantically meaningful space -- without explicit hierarchies of policies. Our other proposed exploration method, Switching Ensemble, is inspired by the options framework, in which multiple lower-level policies interact to solve a task based on their shared experience. We propose a simple variant of this approach that removes the higher-level policy. We train multiple (specifically, five) non-hierarchical agents to maximize environment rewards. During experience collection, we choose one of these agents uniformly at random every $c_{\mathrm{switch}}$ timesteps. This way, we again maintain the spirit of exploration used in HRL -- temporally extended and based on multiple interacting agents -- while avoiding the use of explicit hierarchies of policies. This approach is related to the use of {\em randomized value functions} for exploration~\citep{osband2014generalization,osband2016deep,plappert2017parameter,fortunato2017noisy}, although our proposal is unique for having a mechanism ($c_{\mathrm{switch}}$) to control the temporally extended nature of the exploration. For both of these methods, we utilize multi-step environment rewards ($c_{\mathrm{rew}}=3$), which we found to work well in Section~\ref{sec:eval-sem-train} (Figure~\ref{fig:eval-sem-train}). Our findings are presented in Figure~\ref{fig:eval-sem-expl}. We find that the proposed alternatives are able to achieve performance similar to HRL, with the only exceptions being Explore \& Exploit on AntBlockMaze and Switching Ensemble on AntPush. Overall, these methods are able to bridge the gap in empirical performance between HRL and non-hierarchical methods from Figure~\ref{fig:eval-shallow}, confirming the importance of good exploration on these tasks. Notably, these results show the benefit of temporally extended exploration even for non-hierarchical agents -- using $c_{\mathrm{switch}}>1$ is often significantly better than using $c_{\mathrm{switch}}=1$ (switching the agent every step). Furthermore, the good performance of Explore \& Exploit suggests that semantic exploration (goal-reaching) is beneficial, and likely plays an important role in the success of goal-conditioned HRL methods. The success of Switching Ensemble further shows that an explicit higher-level policy used to direct multiple agents is not necessary in these environments. Overall, these results suggest that the success of HRL on these tasks is largely due to better exploration. That is, goal-conditioned and options-based hierarchies are better at exploring these environments as opposed to discovering high-level representations which make policy and value function training easier. Furthermore, these benefits can be achieved without explicit hierarchies of policies. Indeed, the results of Figure~\ref{fig:eval-sem-expl} show that non-hierarchical agents can achieve similar performance as state-of-the-art HRL, as long as they (1) use multi-step rewards in training and (2) use temporally-extended exploration (based on either goal-reaching or randomized value functions). Beyond the core analysis in our experiments, we also studied the effects of modularity -- using separate networks to represent higher and lower-level policies. Due to space constraints, these results are presented in the Appendix. These experiments confirm that the use of separate networks is beneficial for HRL. We further confirm that using separate networks for the Explore \& Exploit and Switching Ensemble methods is crucial for their effectiveness. \section{Introduction} \vspace{-0.1in} Many real-world tasks may be decomposed into natural hierarchical structures. To navigate a large building, one first needs to learn how to walk and turn before combining these behaviors to achieve robust navigation; to wash dishes, one first needs to learn basic object grasping and handling before composing a sequence of these primitives to successfully clean a collection of plates. Accordingly, hierarchy is an important topic in the context of reinforcement learning (RL), in which an agent learns to solve tasks from trial-and-error experience, and the use of hierarchical reinforcement learning (HRL) has long held the promise to elevate the capabilities of RL agents to more complex tasks~\citep{dayan1993feudal,schmidhuber1993planning,parr1998reinforcement,barto2003recent}. Recent work has made much progress towards delivering on this promise~\citep{levy2017hierarchical,frans2017meta,vezhnevets2017feudal,nachum2019multi}. For example,~\citet{hiro,nachum2018near,nachum2019multi} use HRL to solve both simulated and real-world quadrupedal manipulation tasks, whereas state-of-the-art non-hierarchical methods are shown to make negligible progress on the same tasks. ~\citet{levy2017hierarchical} demonstrate similar results on complex navigation tasks, showing that HRL can find good policies with 3-5x fewer environment interactions than non-hierarchical methods. While the empirical success of HRL is clear, the underlying reasons for this success are more difficult to explain. Prior works have motivated the use of HRL with a number of intuitive arguments: high-level actions are proposed at a lower temporal frequency than the atomic actions of the environment, effectively shortening the length of episodes; high-level actions often correspond to more semantically meaningful behaviors than the atomic actions of the environment, so both exploration and learning in this high-level action space is easier; and so on. These claims are easy to understand intuitively, and some may even be theoretically motivated (e.g., shorter episodes are indeed easier to learn; see~\citet{strehl2009reinforcement,azar2017minimax}). On the other hand, the gap between any theoretical setting and the empirical settings in which these hierarchical systems excel is wide. Furthermore, in Markovian systems, there is no theoretical representational benefit to imposing temporally extended, hierarchical structures, since non-hierarchical policies that make a decision at every step can be optimal~\citep{puterman2014markov}. Nevertheless, the empirical advantages of hierarchy are self-evident in a number of recent works, which raises the question, why is hierarchy beneficial in these settings? Which of the claimed benefits of hierarchy contribute to its empirical successes? In this work, we answer these questions via empirical analysis on a suite of tasks encompassing locomotion, navigation, and manipulation. We devise a series of experiments to isolate and evaluate the claimed benefits of HRL. Surprisingly, we find that most of the empirical benefit of hierarchy in our considered settings can be attributed to improved exploration. Given this observation, we propose a number of exploration methods that are inspired by hierarchy but are much simpler to use and implement. These proposed exploration methods enable non-hierarchical RL agents to achieve performance competitive with state-of-the-art HRL. Although our analysis is empirical and thus our conclusions are limited to the tasks we consider, we believe that our findings are important to the field of HRL. Our findings reveal that only a subset of the claimed benefits of hierarchy are achievable by current state-of-the-art methods, even on tasks that were previously believed to be approachable only by HRL methods. Thus, more work must be done to devise hierarchical systems that achieve {\em all} of the claimed benefits. We also hope that our findings can provide useful insights for future research on exploration in RL. Our findings show that exploration research can be informed by successful techniques in HRL to realize more temporally extended and semantically meaningful exploration strategies. \subsubsection*{Author Contributions} \section{Hypotheses of the Benefits of Hierarchy} \label{sec:hypo} \vspace{-0.1in} We begin by listing out the claimed benefits of hierarchical learning. These hypotheses can be organized into several overlapping categories. The first set of hypotheses (\h1 and \h2 below) rely on the fact that HRL uses {\em temporally extended} actions; i.e., the high-level policy operates at a lower temporal frequency than the atomic actions of the environment. The second set (\h3 and \h4 below) rely on the fact that HRL uses {\em semantically meaningful} actions -- high-level actions often correspond to more semantic behaviors than the natural low-level atomic actions exposed by the MDP. For example, in robotic navigation, the atomic actions may correspond to torques applied at the robot's joints, while the high-level actions in goal-conditioned HRL correspond to locations to which the robot might navigate. In options, it is argued that semantic behaviors naturally arise from unsupervised specialization of behaviors~\citep{frans2017meta}. The four hypotheses may also be categorized as {\em hierarchical training} (\h1 and \h3) and {\em hierarchical exploration} (\h2 and \h4). \begin{enumerate}[label=\textbf{(H\arabic*)},leftmargin=*,itemsep=2pt,topsep=0pt,parsep=0pt,partopsep=0pt] \item {\bf Temporally extended training}. High-level actions correspond to multiple environment steps. To the high-level agent, episodes are effectively shorter. Thus, rewards are propagated faster and learning should improve. \item {\bf Temporally extended exploration}. Since high-level actions correspond to multiple environment steps, exploration in the high-level is mapped to environment exploration which is temporally correlated across steps. This way, an HRL agent explores the environment more efficiently. As a motivating example, the distribution associated with a random (Gaussian) walk is wider when the random noise is temporally correlated. \item {\bf Semantic training}. High-level actor and critic networks are trained with respect to semantically meaningful actions. These semantic actions are more correlated with future values, and thus easier to learn, compared to training with respect to the atomic actions of the environment. For example, in a robot navigation task it is easier to learn future values with respect to deltas in x-y coordinates rather than robot joint torques. \item {\bf Semantic exploration}. Exploration strategies (in the simplest case, random action noise) are applied to semantically meaningful actions, and are thus more meaningful than the same strategies would be if applied to the atomic actions of the environment. For example, in a robot navigation task it intuitively makes more sense to explore at the level of x-y coordinates rather than robot joint torques. \end{enumerate} Due to space constraints, see the Appendix for an additional hypothesis based on {\em modularity}. \section{Related Work} \vspace{-0.11in} Due to its intuitive and biological appeal~\citep{badre2011mechanisms,botvinick2012hierarchical}, the field of HRL has been an active research topic in the machine learning community for many years. A number of different architectures for HRL have been proposed in the literature~\citep{dayan1993feudal,kaelbling1993hierarchical,parr1998reinforcement,sutton1999between,dietterich2000hierarchical,florensa2017stochastic,heess2017emergence}. We consider two paradigms specifically -- the {\em options} framework~\citep{precup2000temporal} and {\em goal-conditioned} hierarchies~\citep{nachum2018near}, due to their impressive success in recent work~\citep{frans2017meta,levy2017hierarchical,hiro,nachum2019multi}, though an examination of other architectures is an important direction for future research. One traditional approach to better understanding and justifying the use of an algorithm is through theoretical analysis. In tabular environments, there exist bounds on the sample complexity of learning a near-optimal policy dependent on the number of actions and effective episode horizon~\citep{brunskill2014pac}. This bound can be used to motivate HRL when the high-level action space is smaller than the atomic action space (smaller number of actions) or the higher-level policy operates at a temporal abstraction greater than one (shorter effective horizon). Previous work has also analyzed HRL (specifically, the options framework) in the more general setting of continuous states~\citep{mann2014scaling}. However, these theoretical statements rely on having access to near-optimal options, which are typically not available in practice. Moreover, while simple synthetic tasks can be constructed to demonstrate these theoretical benefits, it is unclear if any of these benefits actually play a role in empirical successes demonstrated in more complex environments. In contrast, our empirical analysis is specifically devised to isolate and evaluate the observed practical benefits of HRL. Our approach to isolating and evaluating the benefits of hierarchy via empirical analysis is partly inspired by previous empirical analysis on the benefits of options~\citep{jong2008utility}. Following a previous flurry of research, empirical demonstrations, and claimed intuitive benefits of options in the early 2000's, \citet{jong2008utility} set out to systematically evaluate these techniques. Similar to our findings, exploration was identified as a key benefit, although realizing this benefit relied on the use of specially designed options and excessive prior knowledge of the task. Most of the remaining observed empirical benefits were found to be due to the use of {\em experience replay}~\citep{lin1992self}, and the same performance could be achieved with experience replay alone on a non-hierarchical agent. Nowadays, experience replay is an ubiquitous component of RL algorithms. Moreover, the hierarchical paradigms of today are largely model-free and achieve more impressive practical results than the gridworld tasks evaluated by~\citet{jong2008utility}. Therefore, we present our work as a re-calibration of the field's understanding with regards to current state-of-the-art hierarchical methods.
\section{Acknowledgments} \section{Conclusions and Outlook} \label{sec:conclusions} We presented a hardware-software co-design for self-measuring energy consumption of class-1 IoT nodes \cite{RFC-7228}. Its generic design is easily portable to many boards due to commodity hardware connected via a standard bus and its seamless integration into a popular IoT OS. It provides functions to trace code sections on the application level and threads on the system level. The module was successfully validated in a comprehensive field trial. We evaluated the portability and accuracy of our in situ measurement module, as well as its overheads. Our findings indicate that the solution successfully competes with specialized, highly optimized designs at high accuracy and low overhead. The flexibility conjoined with accuracy achieved by Eco helps with adding energy awareness to applications via OS-provided primitives. In future work, we will focus on providing a generic, light-weight management tool-set. Extending the support for other types of measurement modules is also considered helpful to make the solution more versatile. As a rational addition to the OS supported self-measurement, we will work on a separate module that provides default implementations of common energy management algorithms such as EWMA \cite{khzs-pmehs-07}, ENO-MAX \cite{vgb-acdce-07}, and LT-ENO \cite{bsbt-dpmle-14}. \section{Validation in Field Trial} \label{sec:deployment} For a field trial under realistic conditions we equipped five energy harvesting sensor nodes with \textsf{Eco}\xspace and deployed them outdoors for environmental sensing of temperature, humidity, air pressure, and particulate matter. The data \textsf{Eco}\xspace provided was used to sustain persistent energy neutral operation by controlling sensing and transmission intervals. During five weeks the temperatures ranged from \SI{1.5}{\degreeCelsius} (\SI{34.7}{\Fahrenheit}) to \SI{40.1}{\degreeCelsius} (\SI{104.18}{\Fahrenheit}) with intra-day fluctuations of over \SI{32}{\degreeCelsius}~(\SI{57.6}{\Fahrenheit}.). \paragraph{Deployment Setup} We deployed five individual \textsf{Eco}\xspace-equipped systems on a rooftop directly exposed to the weather, see \autoref{fig:box_roof_example}. To meet harsh conditions, a waterproof IP65 enclosure box and a tube protected each node and environmental sensors. We diversified the setting by employing sensors of various manufacturers with different power requirements while using the same generic firmware on all of them. Energy-harvesting was based on top mounted solar panels. To connect the IoT devices via IEEE~802.15.4 to the Internet, we used a Raspberry Pi gateway that ran Raspbian Stretch Lite with \texttt{wpan-tools} and \texttt{radvd}. The IoT network was configured as a pure star topology with node distances from \SIrange{2}{10}{\meter}. \begin{figure} \centering \includegraphics[trim=0 0 0 900,clip, width=0.8\columnwidth]{figs/node_outdoor.jpg} \caption{\textsf{Eco}\xspace energy-harvesting~system deployed in a watertight box with a tube connector for environmental sensing} \label{fig:box_roof_example} \end{figure} \subsection{Software Logic} The firmware continuously re-quantifies the charging power and the energy consumed by the task execution, and adapts the duty cycle according to the available energy.The consumption of the application tasks is quantified by the explicit tracing mechanism introduced in \autoref{sec:implementation}. To determine the charging current, the system issues a measurement cycle with enabled alerting and enters low-power sleep mode immediately. Once finished, the module wakes up the node, which reads the value. This procedure is compatible with the lowest possible shutdown modes, which only provide asynchronous wakeup-sources on many MCUs. Isolated consumption is assessed by disabling the charging circuit to ignore energy provided by the solar panel. Depending on available and consumed energy, the duty-cycle and intervals for recording fine-grained traces are also adapted. With the precise and timely knowledge about incoming energy, the node can adapt as early as possible to achieve higher utilization. The MCU-internal real-time clock (RTC) provided an absolute time reference for the measured data. A clock drift compensation was implemented to lower the time synchronization interval for the RTC. Data provided by the simple network time protocol of the RIOT \texttt{sntp} module is therefore used to calibrate the RTC at runtime. To prevent data loss because of wireless transmission failures, data is logged to the local persistent storage for later investigation. Sensor data is encoded in a JSON format, transmitted to the gateway via CoAP messages, and finally stored in an external database for post-processing. \subsection{Results} \autoref{energy_stats_box_2} shows a one-day snapshot of the interplay between power consumption and charging. Negative bars indicate used power by the node when active, positive bars show charging power when the node is inactive. Each power value represents an average over a two-hour binning. The super cap voltage represents the state at the end of each two-hour slot. A typical sun-cycle can be identified based on the voltage of the super cap as well as the available charging power. The much high power consumption of the active node shows the need for energy harvesting and duty cycling. The local memory was utilized to store detailed energy traces of individual task executions for further analysis. With this onboard data storage, we were able to distinguish erroneous node behavior and failing radio transmissions. As we also monitored clock drifts, we were able to correlate these drifts with temperature fluctuations. \begin{figure} \centering \input{figs/day_cycle_node_1.pgf} \caption{Power consumption and charging over one day observed at one \textsf{Eco}\xspace-enabled IoT device (\SI{750}{\milli\ohm} shunt resistor)} \label{energy_stats_box_2} \end{figure} A lesson learned was that the measurements of the charging power for the inactive nodes need careful parameterization at high energy availability. The firmware was configured to limit the duty cycle to a minimum of 10 seconds to keep link stress low for other nodes. With high energy availability, the time to recharge the super cap after a measurement cycle was sometimes shorter than the selected measurement duration for the charging power. This effect is visible in \autoref{energy_stats_box_2} at 10:00am to 2:00pm where the power consumption P$_{use}$ drops. In this case, the charging current was limited because the energy buffer was full and the active period did not consume enough energy to fully utilize availability from the solar panel. Albeit the measurements still show the average of the actually charged power, it may be of interest to know how much could have been charged with more energy storage capacity. This allows to proactively schedule more energy before charging starts again, effectively increasing the utilization of the system further. Additionally, a dynamically switchable load may be helpful in those cases. For the energy tracing, we used a lower thread priority compared to the rest of the system threads, which proved to be problematic when long-running blocking operations occur. For example, file system operations sometimes blocked simultaneous tracing. To circumvent this, either higher priority tracing is required which further increases the invasiveness of the measurement. Or a non-blocking SD card driver needs to be implemented, which would actually lower the CPU utilization. A fine-grained trace of the current for a node equipped with a power demanding dust sensor is shown in \autoref{fig_powertrace}. The consumption of individual sensing steps of the application can be investigated further with this sample. Shortly after boot, the pressure sensor is powered up and initialized. Before the dust sensor starts, the boost converter creates a short spike on the power line. Once the initialization is done, the sensor starts its fan. It is clearly visible how the startup current slowly settles when the fan reaches its final speed. Thereafter, the dust sensor is disabled and the collected data is transmitted. With this kind of self-measurement the node can not only adjust itself to environmental changes but also detect critical component health like raising equivalent series resistance of the super cap or faulty behavior of mechanical components like friction or blocking. Our field trial showed that \textsf{Eco}\xspace is suitable in practice and the collected performance data also underlines that it can be used in even more constrained scenarios \textit{e.g.,}~ with smaller solar panels. Alternatively, a bigger capacitor could be used to allow higher utilization during nighttime. With its persistent storage the system could also buffer processing work that is not time critical to perform calculation when energy oversupply occurs. \begin{figure} \centering \input{figs/trace_620_node_2.pgf} \caption{Power trace of a dust sensor execution cycle} \label{fig_powertrace} \end{figure} \section{Evalution of In Situ Measurement} \label{sec:evaluation} We validate \textsf{Eco}\xspace on four largely diverse MCU-platforms and evaluate measurement accuracy and introduced overhead. In particular, the configuration of the physical communication layer and runtime settings for the shunt monitor are considered. Relevant adjustments regarding I$^2$C communication are the clock speed and the selection of suitable pull-up resistance. Increasing the clock speed reduces the time spent for communication but demands for lower resistances to actually achieve the faster switching times. On the other hand, the lower resistance raises the power loss for the time in which the signal lines are held low. Apart from the electrical properties, we analyze the impact of module parameters that are adjustable at runtime. For this, the sampling rate related settings consisting of conversion time and averaging are examined in different combinations. Conversion time here refers to the duration of a single internal sampling step that may then be additionally averaged before being processed as a sample on the MCU. \paragraph{Setup} A Keithley DMM7510 bench multimeter is employed as an accurate ground truth for reference measurements. To ensure high accuracy, all measurements are performed after the \SI{90}{\minute} warm-up period of the multimeter and an auto calibration cycle is performed in advance. Measurements are repeatedly executed using automated scripts leveraging the remote control features of the employed bench multimeter and power supply (Siglent SPD3303C). Accordingly, the sensor node is controlled by a custom RIOT-shell interface that can start test runs and handles configuration of all runtime parameters. \begin{figure*}[t] \centering \begin{minipage}[t]{\columnwidth} \input{figs/rel_err_dist.pgf} \caption{Relative measurement error at constant load with \SI{332}{\micro\second} bus/shunt conversion time and 16 avg. steps (IQR: 25th-75th percentile, whiskers: Q1-1.5*IQR and Q3+1.5*IQR)} \label{fig:static_load_err_dist} \end{minipage} \qquad \centering \begin{minipage}[t]{\columnwidth} \input{figs/dev_full_range.pgf} \caption{Absolute measurement deviation in 40 mA range at constant load (2.5th to 97.5th percentile)} \label{fig:static_load_err_full_range} \end{minipage}% \end{figure*} \subsection{Measurement Errors} Errors of the measurement and digitization process itself are quantified by comparing results for measurement of the same variable metric between the device under test and the multimeter ground truth values. The digital resolution is deduced from values given in the data sheet combined with the properties of the shunt resistor. Factors that contribute to the sampling latency are described further down in \autoref{subsec:overhead}. For this we focus on the overall time needed for reading measurements without considering interrupt latency separately. The bare interrupt latency is platform specific but insignificant compared to the read duration. \subsubsection{Accuracy} Testing the accuracy of the measurement is done using a fixed resistor as static load. The applied voltage is varied for different current values. Measurements of the device under test and the reference are run simultaneously and repeated 1000 times. \autoref{fig:static_load_err_dist} shows the distribution of the relative errors for current measurements ranging from \SI{200}{\micro\ampere} to \SI{2}{\milli\ampere}. The successive increase towards the lower end of the scale is attributed to bigger relative impact of noise and the digitization resolution. For loads of \SI{200}{\micro\ampere} the median error stays very close to \SI{1}{\percent}, which is well suited for self measurement. Currents higher than \SI{1.8}{\milli\ampere} are much more stable around a median of \SI{0.5}{\permille}. Extending this measurement up to the full range of \SI{40}{\milli\ampere} (for the selected \SI{2}{\ohm} shunt) confirmed that the pattern of negligible deviation stays true for higher currents, as can be seen from the absolute measurement deviation shown in \autoref{fig:static_load_err_full_range}. The plot also highlights that a function for error compensation can be derived with a simple linear fit. We refrain from implementing that for now because the absolute measurement error has no significant impact. \begin{figure*}[t] \centering \input{figs/i2c_comm_power_time.pgf} \caption{Energy and time overhead for a single register read at different I$^2$C configurations} \label{i2c_comm_power_time} \end{figure*} \subsubsection{Resolution} The voltage resolution has a fixed value of \SI{1.25}{\milli\volt} by design. Current measurement resolution depends on the active shunt resistor value ($R_{shunt}$) and the fixed \SI{2.5}{\micro\volt} LSB step size of the shunt voltage as indicated by \autoref{eq:i_lsb}. \begin{equation} \label{eq:i_lsb} I_{LSB} = \frac{\SI{2.5}{\micro\volt}}{R_{shunt}} \end{equation} We select a \SI{2}{\ohm} shunt that allows currents of over \SI{40}{\milli\ampere}, thus covering most typical IoT devices including connected sensors, while still maintaining a reasonable burden voltage around \SI{80}{\milli\volt}. This shunt resistor value grants a resolution of \SI{1.25}{\micro\ampere}. For tracing of the active node consumption this is considered accurate enough. Though, for determination of low power sleep mode consumption additional provisioning of a separate measurement range would be beneficial. In this work, we do not focus on this aspect as related work already covers this in great detail \cite{kzssk-ipcms-17, zx-nhfnp-13, sglll-mvehi-2017, jdcs-mpmem-07, dfpc-emfas-08}. \subsubsection{Latency} The dominating share in read latency is added by I$^2$C communication, which depends on the wiring and clock speed configuration. Selecting an appropriate priority for the power measurement thread is also important. Choosing the priority too low may starve the thread on high utilization and significantly increases latency and jitter. With a high priority it is important to select the sampling rate of the module low enough to not be invasive to the application. For deriving reasonable values, an application should be compiled for the target platform with the 'ps' command functionality included. The overall computation overhead induced by the self-measurement can then be investigated and tweaked for the specific use-case and available hardware resources. \subsection{Cross-Platform Validation} A major goal of \textsf{Eco}\xspace is to enable energy measurement on the majority of IoT platforms, which requires a seamless way to integrate the module with existing platforms. We selected four largely heterogeneous boards to validate the cross-platform applicability of \textsf{Eco}\xspace. For a representative set of samples from different manufacturers and architectures, we explicitly chose two devices from a higher performance class -- 32-Bit Cortex M4 based nucleo-l476rg and slstk3402a, one midrange device -- samr21-xpro running 32-Bit Cortex M0+, and the 8-Bit AVR8 arduino-mega2560 at the lower bound of the target devices. With this choice, we spread our tests over three different manufacturers (STMicroelectronics, Silicon Labs, and Atmel/Microchip) and the two completely different architectures (ARM and AVR). The names refer to the unique board names within RIOT. With the chosen I$^2$C connectivity we already cover one hundred of the RIOT supported boards as of now and extending this list just requires to provide an I$^2$C peripheral driver. Apart from the low-level driver, enabling \textsf{Eco}\xspace for a new platform only requires to physically connect six pins from the microcontroller to the measurement module, which in turn is connected to the energy storage. Enabling the software support is done by providing pin mappings for the hardware (i.e. which pin of the MCU is connected to the measurement peripheral) and a dependency declaration for the driver module to the project Makefile. While the general approach is not strictly tied to RIOT, some specific capabilities simplified the implementation. The tick-less scheduling keeps the system load low in the absence of events. With multi-threading the consumed energy can be implicitly attributed to separate parts of the application. Also, prioritized scheduling provides direct control over the measurement invasiveness. The general applicability of the proposed solution comes at the cost of a higher computational overhead compared to a highly specialized alternative but the following section reveals that the approach is still usable on low-end 8-bit platforms. Considering that in the field of wireless sensor networks these architectures are even expected to be replaced with more capable 32-Bit variants \cite{kackz-sadpn-18}, we argue that the external module together with its tight OS integration can be considered generically applicable for the targeted devices. \subsection{Overhead} \label{subsec:overhead} To quantify the overhead of the self measurement, we investigate the bus communication overhead in terms of time and power usage, power usage for the measurement itself and computation overhead to process the samples. Power usage and computation complexity depend heavily on configuration parameters of the measurement module. In contrast to that, the memory overhead depends mainly on the measurement application and is much bigger when a longer history of measurements or higher temporal resolution needs to be stored. In this case an aggregated quantity like a moving average can save plenty of memory. \subsubsection{Power} The power overhead is generated by three contributors. The measurement module consumes power during sampling, the bus spends energy on communication, and the shunt resistor introduces power loss. Because I$^2$C is used, the related communication overhead directly depends on the configured bus clock and the wiring. The maximum bus speed is only achievable with low value pull up resistors to ensure fast signal switching times. Though, a lower resistance increases the power consumption when the line is pulled low, making it necessary to find an appropriate balance between high speed and low consumption. The main factor to determine the necessary pull-up resistance is the bus capacitance ($C_b$) that needs to be charged by the current through the pull-up. In the used setup $C_b$ is measured to be \SI{158}{\pico\farad}. According to the I$^2$C bus specification, the maximum sufficient pull-up resistance can be calculated using \autoref{eq:rp_max}, where $t_r$ is the rise time specified by the respective I$^2$C speed. \autoref{tbl:i2c_t_rise} lists the maximum resistor values for the given $C_b$ at the different bus speeds. \begin{equation} \label{eq:rp_max} R_p(max) = \frac{t_r}{0.8473 \cdot C_b} \end{equation} \begin{figure} \centering \input{figs/sample_power.pgf} \caption{Power consumption of the measurement module for different configurations (I$^2$C speed high)} \label{bulkmeasure_test_1} \end{figure} Accordingly, \autoref{i2c_comm_power_time} depicts the overhead caused by reading values from the external measurement module in the time and energy domain for multiple bus configurations. Both, energy and time refer to a single register read. The energy values contain the supply for the module itself as well as losses through pull-ups. Plotted time values include all delays introduced by layers up to the reading application. The changed parameters are the speed mode of the MCU I$^2$C peripheral and the pull-up configurations of the wiring. It can be deduced from the data that selecting the pull-up values according to the specification consumes significantly more energy, while the time spent for communication doesn't decrease with a similar magnitude. The results can be used to select the most energy efficient configuration from the overall system view. Our measurements show that the energy cost per read can vary from \SI{4.5}{\micro\watt\second} (\SI{330}{\ohm} pull-up, fast mode) down to \SI{100}{\nano\watt\second} (\SI{4.7}{\kilo\ohm} pull-up, high mode). Because the read duration does not improve with the same ratio, the energetic optimum is between those two points and also depends on how much energy is spent by the MCU during this transaction. With \autoref{eq:e_complete} we identify the high speed configuration with a \SI{2.2}{\kilo\ohm} pull-up as most energy efficient for an average MCU consumption of \SI{12}{\milli\ampere}. This stays in contrast to the I$^2$C specification recommendations and effectively leverages safety margins of the by imposing stricter wiring requirements. \begin{equation} \label{eq:e_complete} E_{read} = (P_{MCU} + P_{read}) \cdot t_{read} \end{equation} \begin{table}[] \centering \caption{Pull-up resistances based on I$^2$C specification} \vspace{0.25cm} \label{tbl:i2c_t_rise} \begin{tabular}{lrrll} \toprule I$^2$C mode & \multicolumn{1}{c}{$t_r$} & \multicolumn{1}{c}{$R_p(max)$} \\ \midrule Fast & \SI{300}{\nano\second} & \SI{~2200}{\ohm} \\ Fast+ & \SI{120}{\nano\second} & \SI{~900}{\ohm} \\ High & \SI{40}{\nano\second} & \SI{~300}{\ohm} \\ \bottomrule \end{tabular} \end{table} Using this configuration, we check whether different conversion times or averaging steps show a significant impact on the energy usage. Respectively, \autoref{bulkmeasure_test_1} shows the average power consumption while sampling. Short conversion times together with low averaging (\textit{i.e.,}~ a high sampling frequency) shows significant impact compared to the overall measurement consumption. With 16 averaging steps the overhead is only visible for the fastest sampling configuration which becomes completely negligible when 64 averaging steps or more are used. Comparing the values with no averaging to the equivalent value with four averaging steps shows no noticeable dependence on how a targeted sampling interval is achieved. The shunt resistor introduces a power loss that depends on the current drawn from the sensor node and the supply voltage. A lower supply voltage implies the fixed maximum drop across the shunt has higher relative impact. For a supply voltage of \SI{2.7}{\volt} and a load of \SI{10}{\milli\ampere} the power wasted in the shunt amounts to \SI{0.2}{\milli\watt} corresponding to around \SI{0.75}{\percent} of the overall power used. At \SI{1}{\volt} using the maximum current of \SI{40}{\milli\ampere} the loss equals \SI{3.2}{\milli\watt} which already corresponds to \SI{8}{\percent}. For systems using such low voltage either a smaller shunt can be used -- reducing the resolution -- or another measurement component with higher gain is~needed. So for systems using voltages as low as \SI{1}{\volt} we recommend using a lower resistance shunt to trade efficiency for resolution. Concluding the evaluation of the different power overhead contributors, yields the static consumption of the sampling process itself as the dominant factor for most cases. The module communication becomes only relevant for very fast sampling and the shunt losses are only of concern when very low voltages and high resolution are required at the same time. Compensation for the measurement consumption can be achieved by subtracting a fixed offset in case of medium to high sampling rates. Maximum sampling rates require a linear correction taking the communication overhead into account. \begin{table*} \begin{threeparttable} \centering \caption{Performance comparison of selected measurement solutions} \vspace{0.25cm} \label{tbl:comparison} \begin{tabular}{lccccr} \toprule & \multicolumn{1}{c}{Voltage} & \multicolumn{1}{c}{Accuracy} & \multicolumn{1}{c}{Power Overhead} & \multicolumn{1}{c}{CPU Overhead} & \multicolumn{1}{c}{Read Duration}\\ \midrule SPOT \cite{jdcs-mpmem-07} & \xmark & \SI{3}{\percent} & $\sim$ \SI{5}{\milli\watt} & \emph{unpublished}\tnote{*} & \emph{unpublished}\tnote{*}\\ iCount \cite{dfpc-emfas-08} & \xmark & \SI{\pm15}{\percent} (\SI{5}{\micro\ampere} - \SI{50}{\milli\ampere}) & \SI{0.3}{\micro\watt} - \SI{30}{\micro\watt} & \emph{unpublished}\tnote{\textdagger} & \SI{15}{\micro\second}\\ Nemo \cite{zx-nhfnp-13} & \xmark & \SI{1.34}{\percent} avg. \SI{8}{\percent} max. & \SI{0.4}{\micro\watt} - \SI{12}{\milli\watt} & \SI{0.6}{\percent} (\SI{10}{\second}@\SI{0.5}{\hertz}, \SI{10}{\milli\second}@\SI{8}{\kilo\hertz}) & \SI{1}{\milli\second}\tnote{\textdaggerdbl}\\ \textsf{Eco}\xspace & \cmark & < \SI{1}{\percent} (> \SI{0.2}{\milli\ampere}) & \SI{6}{\micro\watt} - \SI{1.1}{\milli\watt} & \SI{0.16}{\permille}@\SI{1}{\hertz} \SI{1.5}{\percent}@\SI{100}{\hertz} & \SI{33}{\micro\second}\\ \bottomrule \end{tabular} \begin{tablenotes}\footnotesize \item[*] A longer duration for reading samples is indicated because multiple steps are required per sample and the $I^2C$ is running with a slower clock (\SI{100}{\kilo\hertz}) \item[\textdagger] By using an internal hardware counter the overhead is assumed to be very low, but hardware dependent \item[\textdaggerdbl] Best case for stated bandwidth, ignoring protocol overhead, assuming 16 bit samples \end{tablenotes} \end{threeparttable} \label{table2} \end{table*} \subsubsection{Computation} We need to quantify the CPU occupancy while collecting the samples from the measurement module in order to select an appropriate sampling rate for the target domain. When the CPU is busy with time sensitive computation, a high sampling rate and its overhead can be invasive. Conversely, for an application that only waits for an external sensor measurement to finish and is interested in a fine-grained power trace while the sensor is running, a high overhead for sampling is tolerable. To measure the CPU utilization, the \texttt{ps} command of the RIOT shell is used. The module is set to continuous sampling configuration with interrupt assertion enabled. A dedicated thread for the measurement is woken up by each interrupt and reads the values for voltage and current. This operating mode is left running for ten minutes before the \texttt{ps} command is executed to list the percentage of active time for all threads. The values include every step from reading the device registers to physical unit conversion. The whole procedure is run for eight different sample interval configurations. \autoref{fig:cpu_util} shows the results of this evaluation on four exemplary platforms ranging from a 32-Bit Cortex-M4 board running at \SI{80}{\mega\hertz} (nucleo-l476rg) down to an 8-Bit AVR running at \SI{16}{\mega\hertz} (arduino-mega2560). While the more capable nucleo-l476rg board stays at \SI{54}{\percent} utilization for a sampling time of \SI{280}{\micro\second}, the arduino-mega2560 is working on its limits and is not able to allocate any CPU resources to other application threads. All values drop linearly over almost the full range down to \SI{0.16}{\permille} and \SI{0.57}{\permille} respectively at around \SI{1}{\second}. It is noteworthy that exhausted computational power at the highest sampling rate does not prohibit using \textsf{Eco}\xspace on that platform. Limited computational capabilities are also expected to decrease the required sampling rate due to the lower rate of events that need to be measured. Comparing these values with the raw computational performance of the MCUs shows that the utilization on arduino-mega2560 only increases by a factor $\approx 4$ compared to the nucleo-l476rg whereas the performance differs by a factor of 6 (16 million instructions per second (MIPS) vs. 100 MIPS). The CPU utilization is thus dominated by the I$^2$C transfer time and not limited by the raw instruction performance. As the slowest sampling rate only generates 35 context switches to the measurement thread, its CPU values are subject to inaccuracies of the \texttt{ps} command. Using the module's integrated power calculation instead of reading current and voltage separately can about halve the time for I$^2$C reading. More room for improvement exists in the I$^2$C peripheral drivers of RIOT, which often do not leverage all the hardware features such as interrupt control or direct memory access. \begin{figure} \centering \input{figs/cpu_utils.pgf} \caption{CPU utilization for different sampling intervals} \label{fig:cpu_util} \end{figure} \subsubsection{Memory} Memory overhead can be considered from three different perspectives. The static memory used by the module driver, the measurement thread, and a buffer for storing a history if necessary. The driver itself uses up to \SI{560}{\byte}, depending on the actually used functionality. The application uses additional \SI{36}{\byte} for the ISR callback, \SI{32}{\byte} for a message queue, \SI{268}{\byte} for measurement thread code and additional \SI{256}{\byte} of thread stack size, but the overall memory requirement slightly differs with target architecture and enabled features. Depending on whether separate voltage and current samples need to be stored or a single power value is enough, a history needs either additional two or four bytes per sample. \subsection{Discussion: Rating \textsf{Eco}\xspace} \textsf{Eco}\xspace was designed as a highly portable approach that can be deployed with over one hundred different boards using a hardware shield carrying only commodity components, and software tightly integrated with the RIOT OS. In contrast to many existing solutions, \textsf{Eco}\xspace neither exploits special aspects of individual boards, nor takes advantage of highly specialized or expensive components. Correspondingly, it is natural to question its qualitative positioning with respect to the current state of the art as outlined in \autoref{sec:problem}. We compare the key performance indicators of \textsf{Eco}\xspace and those solutions that are roughly comparable and have published corresponding measurements in \autoref{tbl:comparison}. The indicators are ({\em i})\xspace~{availability of voltage readings}, ({\em ii})\xspace~{relative errors}, ({\em iii})\xspace~{overhead in power and CPU utilization}, and ({\em iv})\xspace~{reading performance}. Overall we find \textsf{Eco}\xspace in the vicinity of the best performers for each indicator. In particular, our system appears to be the most balanced with respect to the considered metrics, and it is the only solution that actually measures voltage. SPOT \cite{jdcs-mpmem-07} and iCount \cite{dfpc-emfas-08} do not keep track of voltage and instead assume a constant value. In particular for super capacitor based energy-harvesting systems, this assumption is not valid and leads to erroneous results. Accessing measurement values of SPOT is also done via I$^2$C, but the related communication overhead (in terms of power and CPU utilization) is not evaluated. In contrast, \textsf{Eco}\xspace takes I$^2$C cost carefully into consideration and can adapt to its different configurations. By using an internal hardware counter and a signal of the switching regulator, iCount almost completely removes the need for additional hardware components and hence has low power overhead. This comes at the cost of losing general applicability for different supply circuits and has the vital downside of requiring complex per device calibration. It is also noteworthy that supply circuit properties and sampling rate affect the achievable resolution \cite{zx-nhfnp-13}. Nemo \cite{zx-nhfnp-13} brings an additional MCU-board which guarantees good measurement accuracy, high sampling rates, and relatively low CPU overhead. The major downsides are its high complexity and power overhead. With \SI{150}{\micro\ampere} in sleep mode it already consumes almost halve the power of our setup during measurements. In active operation this increases to \SI{4.6}{\milli\ampere}, effectively requiring an additional power supply for long term in situ deployments. Nemo is focused on seamless integration into one specific platform and avoiding additional wiring by using modulation of the supply voltage to transmit its information to the measured node. The authors give an example of the overhead based on a use case of sampling at \SI{0.5}{\hertz} for \SI{10}{\second} and then sampling at \SI{8}{\kilo\hertz} for \SI{10}{\milli\second} while buffering all data on the measurement node. Transmitting the buffer to the observed node afterwards results in an average overhead of \SI{0.6}{\percent}. The communication bandwidth implies that the achievable continuous meter-to-node data rate is over 60 times slower than with the $I^2C$ configuration we are using. For use cases where the node continuously needs timely information of its power consumption (\textit{e.g.,}~ when correlating power usage with software tasks), this slower data rate combined with buffering is inadequate. From these observations, we conclude that specifically optimized custom solutions for specific use cases can slightly outperform our generic approach, but the commodity design of \textsf{Eco}\xspace proves to be significantly more versatile without sacrificing performance. \section{Integrated Energy Management:\\ Design and Implementation} \label{sec:implementation} The integrated hardware-software co-design is outlined in the following. First, a flexible modular hardware platform is introduced. \autoref{fig:eh_sys_model} shows the abstract hardware architecture consisting of a wireless sensor node and a power subsystem. The power subsystem includes a power source, modules for charging and measurement and an energy storage element. The node itself is built as a fully modular combination of MCU, radio transceiver, sensors and persistent data storage. \iffalse \begin{figure}[h] \begin{center} \begin {tikzpicture}[-latex, semithick, font=\rmfamily\small, minimum size=25pt,align=center, node distance=.28cm, inner sep=4pt, state/.style ={ rectangle ,top color =white , bottom color = black!10 , draw,black , text=black}, modmarker/.style={circle, draw=black!80, line width=0.2mm, minimum size=8pt, ,align=center, inner sep=2pt, text=white, fill=orange, font=\bfseries\sffamily\large}, line/.style={draw, -latex}, lineda/.style={draw, latex-latex}, notecircle/.style={circle, draw, minimum size=10pt, inner sep=1pt, black!75, font=\sffamily}] \node[state] (ESRC) [] {Energy Source}; \node[state, right=0.5cm of ESRC.east] (CV) [] {Converter}; \node[state, right=0.5cm of CV.east] (M) [] {Monitoring}; \node[state, right=0.5cm of M.east] (ESTR) [] {Energy Storage}; \node[state, below=0.6cm of M.south] (MCU) [] {\ \ \ MCU\ \ \ }; \node[state, left=0.5cm of MCU.west] (TX) [] {TX}; \node[state, right=0.5cm of MCU.east] (S1) [] {Sensors}; \node[state, below=0.5cm of MCU.south] (STRG) [] {Storage}; \path [line] (ESRC) -> (CV); \path [line] (CV) -> (M); \path [lineda] (M) -- (ESTR); \path [line] (M) -- (MCU); \path [-, black!75, dashed] (MCU) edge (S1); \path [-, black!75, dashed] (MCU) edge (TX); \path [-, black!75, dashed] (MCU) edge (STRG); \node[modmarker] (A) at (MCU.north west) {A}; \node[modmarker] (B) at (TX.north west) {B}; \node[modmarker] (C) at (STRG.north west) {C}; \node[modmarker] (D) at (ESTR.north west) {D}; \node[modmarker] (E) at (CV.north west) {E}; \node[modmarker] (F) at (M.north west) {F}; \end{tikzpicture} \end{center} \caption{Model of energy harvesting wireless sensor node with self-measurement of power consumption} \label{fig:eh_sys_model} \end{figure} \fi \begin{figure*} \begin{minipage}{.44\textwidth} \begin{center} \begin {tikzpicture}[-latex, semithick, font=\rmfamily\small, minimum size=25pt,align=center, node distance=.28cm, inner sep=4pt, state/.style ={ rectangle ,top color =white , bottom color = black!10 , draw,black , text=black}, modmarker/.style={circle, draw=black!80, line width=0.2mm, minimum size=8pt, ,align=center, inner sep=2pt, text=white, fill=orange, font=\bfseries\sffamily\large}, line/.style={draw, -latex}, lineda/.style={draw, latex-latex}, notecircle/.style={circle, draw, minimum size=10pt, inner sep=1pt, black!75, font=\sffamily}] \node[state] (ESRC) [] {Power Source}; \node[state, right=0.4cm of ESRC.east] (CV) [] {Converter}; \node[state, right=0.4cm of CV.east] (M) [] {Measurement}; \node[state, right=0.4cm of M.east] (ESTR) [] {Energy Storage}; \node[state, below=0.6cm of M.south] (MCU) [] {\ \ \ MCU\ \ \ }; \node[state, left=0.4cm of MCU.west] (TX) [] {TX}; \node[state, right=0.4cm of MCU.east] (S1) [] {Sensors}; \node[state, below=0.5cm of MCU.south] (STRG) [] {Persistent Data Storage}; \path [line] (ESRC) -> (CV); \path [line] (CV) -> (M); \path [lineda] (M) -- (ESTR); \path [line] (M) -- (MCU); \path [-, black!75, dashed] (MCU) edge (S1); \path [-, black!75, dashed] (MCU) edge (TX); \path [-, black!75, dashed] (MCU) edge (STRG); \node[modmarker] (A) at (MCU.north west) {A}; \node[modmarker] (B) at (TX.north west) {B}; \node[modmarker] (C) at (STRG.north west) {C}; \node[modmarker] (D) at (ESTR.north west) {D}; \node[modmarker] (E) at (CV.north west) {E}; \node[modmarker] (F) at (M.north west) {F}; \end{tikzpicture} \end{center} \caption{Model of energy harvesting wireless sensor node with self-measurement of power consumption} \label{fig:eh_sys_model} \end{minipage} \hspace{1cm} \begin{minipage}{.49\textwidth}\centering \begin{tikzpicture}[ notecircle/.style={circle, draw=black!80, line width=0.2mm, minimum size=7.5pt, inner sep=0pt, text=white, fill=red, font=\bfseries\sffamily\scriptsize}, modmarker/.style={circle, draw=black!80, line width=0.2mm, minimum size=8pt, ,align=center, inner sep=2pt, text=white, fill=orange, font=\bfseries\sffamily\large}, sysiomarker/.style={opacity=0.4, draw=black!80, line width=0.2mm, ,align=center, inner sep=2pt, text=white, fill=red, font=\bfseries\sffamily\large}, sensiomarker/.style={opacity=0.4, draw=black!80, line width=0.2mm, ,align=center, inner sep=2pt, text=white, fill=yellow, font=\bfseries\sffamily\large}, pvmarker/.style={opacity=0.4, draw=black!80, line width=0.2mm, ,align=center, inner sep=2pt, text=white, fill=yellow, font=\bfseries\sffamily\large}, connectortxt/.style={opacity=1,align=center, inner sep=2pt, text=white, font=\bfseries\sffamily\tiny}] \centering\node (img) {\includegraphics[width=.72\columnwidth, angle=0]{figs/node.jpg}}; \node[modmarker] (A) at (1.6,0.8) {A}; \node[modmarker] (B) at (2,-0.25) {B}; \node[modmarker] (C) at (2.6,-1.65) {C}; \node[modmarker] (D) at (-1,1.4) {D}; \node[modmarker] (E) at (-1.3,0.4) {E}; \node[modmarker] (F) at (-1.3,-0.8) {F}; \fill[sysiomarker] (-0.15,-1.12) rectangle (1.12,-1.46) node[connectortxt, pos=.5] {Power interface}; \fill[sensiomarker] (1.13,-1.12) rectangle (1.92,-1.46) node[connectortxt, pos=.5] {Sensor IO}; \fill[sysiomarker] (-0.23,0.83) rectangle (0.05,0.39); \fill[pvmarker] (-1.87,0.58) rectangle (-2.35,0.13) node[connectortxt, pos=.5, rotate=-90] {PV}; \end{tikzpicture}\vspace*{-16pt} \caption{Mounting plate with interconnected modules of the energy-harvesting system}% \label{fig:eh_motherboard}% \end{minipage} \end{figure*} \begin{figure}[b] \centering \includegraphics[width=0.7\columnwidth, angle=0]{figs/riot_arch.pdf} \caption{RIOT module architecture with integrated \texttt{es} command and application level tracing} \label{fig:riot_structure} \end{figure} In the second part, we discuss the RIOT software integration of energy measurement primitives. RIOT is an open source operating system for constrained IoT devices focusing on open network standards and well-known programming interfaces. Software sitting on top of the RIOT operating system can be moved to other platforms without requiring changes to the source code thanks to its extensive hardware abstraction. It supports multi-threading with priority based tickless scheduling. A major benefit of using RIOT comes with portability and extensive library and driver support. Thereby it enables fast development of highly modular and loosely coupled application designs leveraging reusable code that is not tied to specific hardware. Two orthogonal concepts are implemented for the online measurement that provide different trade-offs between integration complexity and accuracy. To add energy awareness to new applications, we provide an API to explicitly gauge the energy consumed on an individual task base i.e. for predefined code-sections. Additionally, we implement an extension to the OS scheduler to provides energy statistics on a per-thread level. With this implicit consumption attribution to software entities, the system can even provide energy usage information without requiring any changes to the application code. \subsection{Hardware} The hardware is composed of an off-the-shelf evaluation board, a super capacitor as energy buffer and a measurement module to quantify the charging and discharging rate. The entire setup is built as an orchestration of independent modules. All of them can be exchanged, which leaves the design flexible regarding the selection of specific components. To represent typical IoT use cases, an IO-interface serves connectivity to external peripherals like sensors for data acquisition. A network uplink is provided by an IEEE 802.15.4 module based on the AT86RF233 radio chip. When there is no network access available, a micro-SD card provides cost effective persistent storage for long term data logging. A bare development board with the low-power STM32L476 MCU is used as base. But the setup is not tied to this specific development board, as we will show later. Using a bare development platform facilitates the use of different radio modules, voltage regulators, energy storage elements, or sensors, while keeping low level control. Analyses of specific component properties is thereby simplified. For the power measurement we design a configurable, yet simple module with the Texas Instruments INA226 shunt monitor. It is interfaced via I$^2$C and allows changing the slave address to use more than one module in a single setup. With a fixed maximum burden voltage of \SI{81.92}{\milli\volt} the measurement range can be manually switched based on three different shunt resistors for simple adaption. Enabling a high dynamic range can be achieved by using an additional module with a higher value shunt resistor in combination with a bypass switch as shown in \cite{kzssk-ipcms-17}. The assembly of all interconnected parts for the deployment-ready Energy-Harvesting system are depicted in \autoref{fig:eh_motherboard}. The bare development board \circled{A} with the external IEEE 802.15.4 radio device \circled{B} on top is plugged into an interface board which in turn provides connection to persistent storage via a micro-SD slot \circled{C}, the power subsystem and various external sensors. A \SI{100}{\farad} (\SI{2.7}{\volt}) super capacitor \circled{D} in combination with a custom photovoltaic charging circuit \circled{E} and the previously introduced measurement module \circled{F} form the external modular power subsystem. All components like the radio, micro-SD card and external sensors can be powered down completely by individually switchable transistors. These are integrated on the interconnect-board below the MCU and are controlled by plain GPIO control. \subsection{Integrated System Software} Integration into RIOT is achieved by providing a peripheral driver for controlling the INA226 over I$^2$C via the respective interfaces of the hardware abstraction layer. Apart from raw register access the driver provides functions for conversion to physical units and calibration. Required calibration values are gathered by connecting a trusted reference multimeter and the measurement module to the same load of a test application. The calibration is enabled by then feeding the values into compile time configuration. We extend the simple command line interface of RIOT with an additional command named \texttt{es}. It builds on top of the existing \texttt{ps} command and adds information on power draw and energy consumed per thread, similar to the default statistics like stack usage and context switching count. The logic for that is implemented with a separate background thread that controls the measurement, reads samples from the external module, and performs required calculations. By that, the thread priority control of the OS can be used to adjust between precise timeliness of the measurements and less invasiveness. The attribution schema splits the samples according to the time each thread was active and accounts it to the different involved threads. This approach has the benefit that not a single line of code needs to be changed to give an overview on energy expenditure by different parts of the application. However, depending on application properties this method may be inaccurate. Energy consumed by threads that trigger an action of high energy demand and then go back to sleep immediately, cannot be evaluated very accurately by this approach. To overcome this limitation, a tracing mechanism is implemented to let an application explicitly record energy traces of specific tasks defined by the developer. Tracing can be controlled by the interface calls \texttt{trace\_start()} and \texttt{trace\_stop()}. It may record a full series of energy samples or return a single aggregated value. Using this tracing, an application can re-evaluate its energy use per task in varying conditions like ambient temperature, state of charge, or degraded component health. When the measurement function is not in use, the module is put to a low-power mode and consumes less than \SI{2}{\micro\ampere}. \autoref{fig:riot_structure} visualizes a simplified RIOT software stack that integrates the aforementioned components. The dashed line in the middle separates the stack into hardware dependent parts on the bottom and hardware independent parts above. The lower line illustrates the border between OS modules and the specific hardware it is running on, and the upper line splits user- or application-code from the OS. In particular, the driver of the INA226 is situated on top of the hardware abstraction and is thus available on every platform that supports I$^2$C. The \texttt{es} command is implemented as a \texttt{sys} component using the shell module. Next to the application the explicit tracing mechanism resides as an independent module. \section{Introduction} \label{sec:intro} Energy is a scarce resource in the constrained Internet of Things (IoT) of independently powered nodes, many of which need to balance tasks with the amount of energy available for sustaining operation over their targeted lifetime. Software development paradigms for these IoT systems recently shift away from static bare-metal code towards flexible, platform independent applications that offer reusable functionality. Nonetheless, building energy-aware systems is still a task that requires developers to deeply engage with many low-level, platform-specific details. Partially this arises because energy availability and power consumption are much more dynamic than system properties such as processing and memory resources. Energy levels fluctuate, in particular on nodes that harvest energy from environmental sources. This makes it crucial for a system to track its power input and consumption, so that runtime tasks can adapt to energy availability quick and effectively. Energy harvesting describes a process where the output of typically weak power sources is collected and stored until a sufficient amount of energy is available to perform a desired task. In the context of low-end IoT networks, energy harvesting allows for building independently powered systems with the potential to sustain perpetual operation, thereby increasing performance and reducing maintenance cost \cite{basm-ehwts-16}. Because of the volatile nature of common energy sources, energy harvesting demands for management mechanisms to effectively use energy and avoid system outages. Tracking, controlling, and optimizing energy consumption depends on many aspects and quickly becomes complex. Therefore, simulations combined with prior external measurements are often applied to estimate power flows. However, for systems that are subject to varying operational or environmental conditions, it is often infeasible to rely entirely on \emph{a priori} lab testing. Simplified models and error-prone parameter estimators imply further inaccuracies. Accurate information about actual deployment conditions are required instead. For those reasons \emph{in situ} measurement is a key strategy to obtain real-world data. For this a generic off-the-shelf solution is desired that is portable, reusable, and covers various settings of software and hardware components. \begin{figure}[h] \includegraphics[width=0.5\textwidth]{figs/eco_overview} \caption{\textsf{Eco}\xspace measures energy in situ by monitoring power sources and consumers.} \label{fig:eco-overview} \end{figure} In this paper, we introduce \textsf{Eco}\xspace, a hardware-software co-design enabling generic energy management on low-end commodity IoT devices (see \autoref{fig:eco-overview}). As a generally applicable approach, \textsf{Eco}\xspace is based on two key principles. First, it connects a simple external measurement module via the standard I$^2$C interface which is widely available on all targeted microcontrollers. Only the control pins require connecting and the power supply line needs to be routed through this module. Second, it uses platform-independent software interfaces that allow for an easy change of microcontroller boards without any need of software adaptation. In detail, we contribute: \begin{sitemize} \item A novel key component enabling energy management on autonomous IoT nodes that are battery-driven, have few kilobytes of memory, and MHz of CPU power. \item An implementation of \textsf{Eco}\xspace in the IoT operating system RIOT that fosters deployment, and allows for online energy evaluation of individual tasks and threads. \item An evaluation of \textsf{Eco}\xspace including its cross-platform validation and the detailed quantification of errors and overheads. \item An extensive real-world deployment within an energy harvesting system as a comprehensive proof of concept of the vertical integration of hardware and software in the field. \end{sitemize} \noindent \textsf{Eco}\xspace outperforms the current state-of-the-art. The closest related results from the literature~\cite{dfpc-emfas-08} focus on the plain measurement problem without higher level system integration. This specialized, component-free approach has lower current measurement accuracy (them 10\% vs. \textsf{Eco}\xspace 1\%), lower resolution (them \SI{10}{\micro\ampere} vs. \textsf{Eco}\xspace \SI{1.25}{\micro\ampere}), but lower energy overhead (them $\approx$0.05\% vs. \textsf{Eco}\xspace $\approx$~1\%). It consists of a few commodity components, only, and allows for measuring current and voltage over adjustable ranges and with flexible sampling rates. Hence, it is easy to reproduce and can be attached to a large variety of IoT boards. The remainder of this paper continues with discussing the energy management problem together with related work. The design of our measurement module in hardware and software is presented (\S~\ref{sec:implementation}), followed by a thorough evaluation (\S~\ref{sec:evaluation}). We report on our deployment experiment and the lessons learned thereof (\S~\ref{sec:deployment}). Finally, we conclude with an outlook in \autoref{sec:conclusions}. \section{The Problems of Dynamic Energy \\ Management and Related Work} \label{sec:problem} Any approach to managing energy on constrained devices relies on accurate knowledge of the actual conditions. Overestimating the available energy may quickly put a node out of service, underrating energy may hinder its operational utility. In a variable, dynamic setting it becomes important to obtain a thorough understanding of the various energy flows, including the consumption of different application tasks and potentially available inflows. The key problem of dynamic energy management arises from the difficulty to determine power consumption timely, with sufficient accuracy, and at tolerable overhead. Methods for quantifying consumption include theoretical or \mbox{(semi-)}empirical estimation, simulation of simplistic models, as well as external or online self-measurements. Previous work on measuring consumption of nodes typically focuses either on local lab setups for very accurate monitoring or very light-weight in situ evaluation. \subsection{Simulation and Estimation of Power \\ Consumption} Software approaches range from simulation of large scale sensor networks \cite{shcaw-spcls-04} to estimations based on offline reference measurements \cite{doth-soees-07, deft-pnppl-11}. The prediction accuracy of the power consumption and battery lifetime is significantly affected by its level of abstraction \cite{lwg-appcs-05}. Neglecting low-level system events such as scheduling and timer related interrupt handling can lead to substantial errors because they often account for a relevant part of the power consumption. Consumption simulation can be performed from a generic high level perspective \cite{arcsj-sipen} down to estimating CPU cycles \cite{shcaw-spcls-04} or even on the instruction level \cite{tlp-assns-05}. The full control over relevant system parameters eases isolated analysis of individual aspects. Downsides relate to the inaccurate reproduction of reality due to environmental changes, varying hardware tolerances, and many other dynamics. Even if conditions and hardware are exactly the same, different device instances can exhibit significant variations in their consumption \cite{lmgf-oeeme-13}. Also, simulations mainly focus on improving \emph{a priori} adjustments, leaving runtime optimizations open to other solutions. Dunkels \textit{et al.}~ \cite{deft-pnppl-11} developed Powertrace, a software solution to allow network level profiling of applications for Contiki~\cite{dgv-clfos-04}. It feeds static values from offline measurements into a linear power model. This light-weight software-only solution has many benefits compared to hardware solutions. Unfortunately, it does not apply to dynamically powered systems such as Energy-Harvesting systems with varying supply voltage. It is also unsuitable when the individual consumption of the various components are tied together with non-linear dependencies. Estimating the energy consumption {\em online} allows incorporating more runtime specific criteria from actually tracking the system states \cite{deft-pnppl-11}. As an example, energy usage caused by packet retransmissions can be accounted with higher accuracy, if the exact number of transmissions is known and considered at runtime. While this varying size can be easily determined in software, other changes such as the efficiency of various electric components are more challenging to estimate. Incorporating runtime information on the actual consumption as feedback for the energy management algorithm was already shown to improve application level performance and robustness against uncertainties \cite{gjkz-gmoes-19}. \subsection{Measuring Power Consumption} A core problem of measuring the power consumption of IoT nodes comes with the heavily varying power demands required by the different power states of the micro controller unit (MCU). These can span over five orders of magnitude~\cite{jdcs-mpmem-07}. Additionally, the measurement itself should have little to no side effects on the observed system. Combining both introduces further complexity. \paragraph{External Observers} Many systems were designed as external observers to record detailed behavior of the sensor node. The underlying architectures range from Linux-capable systems based on single board computers which cannot be deployed in the field \cite{sglll-mvehi-2017,kzssk-ipcms-17,lfzws-ftdst-13,lt-tacft-17,sk-mdtdw-13}, to small add-on boards that are equipped with additional hardware like an MCU \cite{rs-efsnp-10, zx-nhfnp-13} and in some cases also field programmable gate arrays (FPGA) \cite{rs-efsnp-10, thbr-ahsan-11, zsfs-ebgbs-11}. Energy-Harvesting is specifically targeted by custom mobile measurement platforms to even allow observation of multi source harvesters \cite{sglll-mvehi-2017} and by providing tools to record and replay harvesting conditions~\cite{zsfs-ebgbs-11}. With Rocketlogger, Sigrist \textit{et al.}~ \cite{sglll-mvehi-2017} introduced a portable device intended to provide a balance between top notch lab equipment and mobile measurement. The platform provides four voltage and two current channels besides the option to interface digital sensors for additional environment metering. Though, the device is based on a BeagleBone Green that alone consumes \SI{7}{\milli\watt} in deep sleep mode and multiples of \SI{100}{\milli\watt} when active. Thus, long term off-grid deployment is out of~scope. Kazdaridis \textit{et al.}~ \cite{kzssk-ipcms-17} use classic shunt metering with two resistors in series. For dynamic switching, a load switch bypasses the measured current around the high resistance when the burden voltage becomes too high. The switch is controlled by an analog high speed comparator. The measurement module is interfaced over I$^2$C by a BeagleBone Black, which introduces power consumption of \SIrange{8.7}{14.2}{\milli\watt}, still ignoring two additionally needed operational amplifiers. Continuous measurement without MCU interaction are not possible with the module, because no internal sampling buffer or averaging is available. FlockLab by Lim \textit{et al.}~ \cite{lfzws-ftdst-13} targets distributed tracing and profiling. Only a single shunt is used and linear regression is utilized for calibration. Additional focus is laid on precise time stamping with an accuracy of around \SI{50}{\micro\second} to correlate events of different nodes. They also use hardware with relatively high computational power based on a \SI{624}{\mega\hertz} CPU with \SI{128}{\mega\byte} of RAM, disqualifying it for in-situ usage. \paragraph{Self-Measurement} A typical way to keep track of the energy flow on the node itself is to utilize coulomb counters. While the temporal resolution is high enough to assess the state of charge, it is insufficient to attribute energy usage to specific tasks or peripheral hardware. To overcome this issue, custom hardware for faster sampling is required. When the measurement function is implemented within the IoT device itself, it is crucial to know the overhead that is associated with the measurement. This overhead concerns power usage of the measurement circuit, memory usage, and CPU time allocated to performing measurement and calculation. The power measurement based on voltage to frequency conversion introduced by Jiang \textit{et al.}~ \cite{jdcs-mpmem-07} is suited to be directly deployed together with a sensor node. The system called SPOT leverages a voltage to frequency based digitization process to overcome a lot of the previously described measurement challenges. While this solution keeps processing overhead low for infrequent reading, it is high for fast sampling. Furthermore, the discrete components require around \SI{1.7}{\milli\ampere}, which introduces overhead that conflicts with battery powered nodes in the field~\cite{dfpc-emfas-08}. An implementation by Dutta \textit{et al.}~ \cite{dfpc-emfas-08} simplifies SPOT by essentially eliminating the need for any hardware if the platform is powered by a switching regulator. With this, a resolution down to the \SI{1}{\micro\joule} scale is achieved while staying within a \SI{\pm20}{\percent} error margin. By using an MCU-internal counter peripheral a read latency down to \SI{15}{\micro\second} can be achieved, leading to a power overhead of only \SIrange{0.01}{0.1}{\percent}. Shortcomings of the solution are related to inherently high manufacturing tolerances for inductors (around \SI{\pm10}{\percent}), the frequency dependent power overhead, and that the voltage is assumed constant instead of being actually measured. Other approaches either use highly specialized FPGA implementations for the measurement task \cite{aghfg-tphse-18}, or indirectly assess the consumption by measuring voltage changes at the energy storage element \cite{rtr-oease-14}. \subsection{Attributing Energy to Software} The software running on a wireless sensor node defines how energy is spent, \textit{e.g.,}~ by issuing a sensing cycle or requesting the hardware to transmit data. As resources such as CPU, RAM, or hardware peripherals are dynamically shared between a multitude of software components, attributing the exact amount of used energy to the correct software instance is challenging. Therefore, the main problem in this domain is correlating power consumption with the executed software. The granularity and constraints for such attribution mechanisms vary a lot depending on the targeted area of use. For operators of data-centers it may be enough to know how much energy is used per virtual machine and a little overhead is basically negligible. On mobile devices the constraints are already much tighter and attributing energy to individual applications is crucial, \textit{e.g.,}~ to prevent faulty ones from draining the battery. Typical low-end IoT devices further tighten the room for overhead and the granularity is scaled down to smaller entities such as threads, specific tasks or even single function calls. The simplest base metric for power usage correlation is \emph{utilization}, derived from the time a thread occupies the CPU. A much more accurate measure to assess CPU-utilization and correlated power consumption is based on monitoring CPU-internal performance counters \cite{b-beeap-00}. With pTop \cite{drs-ppppt-09}, an implementation for desktop-scale devices was shown that uses this information to attribute power consumption to running processes. Further accuracy improvements to online estimations can be achieved by tracking power states of individual components. For TinyOS, Kellner~\cite{k-foeat-10} uses a common model to estimate the overall power consumption which is then attributed to different individual TinyDB queries with the help of resource containers. Fonseca~\textit{et al.}~ \cite{fdls-qtene-08} augment the tracking of component power states with real power measurement and activity tracking to allow fine-grained offline analysis of energy usage. As TinyOS does not provide threads by default, both solutions introduce abstract entities (\textit{i.e.,}~ activities and resource containers) to which the energy use is attributed. This allows grouping semantically related resource usage and thereby improves its high level visibility to the developer but requires additional instrumentation of the target application. \begin{table}[t] \resizebox{\columnwidth}{!}{ \begin{threeparttable} \centering \caption{Comparison of related work} \vspace{0.25cm} \label{tbl:overview_comparison} \begin{tabular}{lccccr} \toprule \multicolumn{1}{c}{\rotatebox{0}{Variant}} & \multicolumn{1}{c}{\rotatebox{80}{In situ\tnote{\textdagger}}} & \multicolumn{1}{c}{\rotatebox{80}{Adaptive}} & \multicolumn{1}{c}{\rotatebox{80}{\parbox{40pt}{Physical\\ Measurem.}}} & \multicolumn{1}{c}{\rotatebox{80}{Portability}} & \multicolumn{1}{c}{\rotatebox{0}{Measurement Control}} \\ \midrule PowerTOSSIM \cite{shcaw-spcls-04} & \xmark & \xmark & \xmark & \xmark & Offline Simulation \\ \emph{Kazdaridis et al.} \cite{kzssk-ipcms-17} & \xmark & \xmark & \cmark & \cmark & Passive HW Interface \\ Rocket Logger \cite{sglll-mvehi-2017} & \xmark & \xmark & \cmark & \cmark & Time-triggered Logging \\ FlockLab \cite{lfzws-ftdst-13} & \xmark & \xmark & \cmark & \xmark & Time-triggered Logging \\ AVEKSHA \cite{thbr-ahsan-11} & \xmark & \xmark & \cmark & \xmark & Time-triggered Logging \\ Powertrace \cite{deft-pnppl-11} & \cmark & \cmark & \xmark & \cmark & Programmable Tracing \\ \emph{Kellner} \cite{k-foeat-10} & \cmark & \cmark & \xmark & \cmark & Container Tracking \\ SPOT \cite{jdcs-mpmem-07} & \mcmark \tnote{*} & \mcmark & \cmark & \cmark & Passive HW Interface \\ Nemo \cite{zx-nhfnp-13} & \mcmark \tnote{*} & \mcmark & \cmark & \xmark & Time-triggered Logging \\ iCount \cite{dfpc-emfas-08} & \cmark & \mcmark & \cmark & \xmark & Passive SW-Interface \\ Quanto \cite{fdls-qtene-08} & \cmark & \mcmark & \cmark & \xmark & Event-triggered Logging \\ \multirow{2}{*}{\textsf{Eco}\xspace} & \multirow{2}{*}{\cmark} & \multirow{2}{*}{\cmark} & \multirow{2}{*}{\cmark} & \multirow{2}{*}{\cmark} & Thread Tracking \& \\ & & & & & Programmable Tracing\\ \bottomrule \end{tabular} \begin{tablenotes}\footnotesize \item[\textdagger] Referring to usability in \emph{off-grid} in situ deployments (\textit{i.e.,}~ some of the solutions marked as unsuitable may still be usable for \emph{wired} in situ) \item[*] depending on sufficient power supply (refer to \autoref{tbl:comparison} for details) \end{tablenotes} \end{threeparttable}} \end{table} \autoref{tbl:overview_comparison} gives a brief qualitative overview on the discussed work. In the following sections, we introduce a flexible measurement setup that uses readily available parts and is easy to integrate over an I$^2$C bus. It spans a wide configurable measurement range, provides different sampling rates and is compatible with common IoT Platforms. Using various configurations the accuracy is verified with reference measurements. Additionally, the overhead (\textit{i.e.,}~ invasiveness) induced by the measurement action itself and communication with the module is analyzed to show what cost is tied to more fine-grained energy profiling. The results can be used to choose an appropriate measurement configuration for specific use cases by weighing between tolerable overhead and additional granularity.
\section{Introduction}\label{section=introduction} Let $p$ be a prime number at least $3$. Inspired by the breakthrough by Croot, Lev and Pach \cite{CrootLevPach}, Ellenberg and Gijswijt \cite{EllenbergGijswijt} succeeded in providing an upper bound on the number of elements of a set $A$ in $\mathbb{F}_p^n$ that is (\textit{non-degenerate}) \textit{$3$-AP-free}. That means, there exists no triple $(x_1,x_2,x_3)=(a,b,c)\in A$ consisting of three \textit{distinct} elements that is a solution of the linear equation $x_1-2x_2+x_3=0$. (`AP' stands for an arithmetic progression.) Their result states that such an $A$ satisfies \[\label{spade} \#A \leq (\Lambda_{1,\frac{1}{3},p-1})^n\tag{$\spadesuit$} \] for all $p\geq 3$ and $n\geq 1$, where $\#A$ means the cardinality of $A$. Here for $\alpha\in \mathbb{R}_{>0}$ and for $m,h\in \mathbb{N}$, $\Lambda_{m,\alpha,h}$ denotes the minimum of the function $G\colon (0,1]\to \mathbb{R}$; $G(u)=u^{-\alpha h}(1+u+u^2+\cdots +u^{mh})$. (It is more common to use the symbol $\Gamma_{p,3}$ for this constant; we use the symbol above to follow more general notation in our sequel paper \cite[Definition~2.6]{MimuraTokushige}.) It follows from \cite[Proposition~4.12]{BCCGNSU} that $0.8414 p\leq \Lambda_{1,\frac{1}{3},p-1}\leq 0.918p$ for all $p\geq 3$. In this short paper, instead of the equation $x_1-2x_2+x_3=0$, we study the following system of linear equations in $\mathbb{F}_p^n$: \begin{equation*}\label{equation:star} \left\{ \begin{aligned} x_1+x_2-2x_{2k+1}&=0,\\ x_3+x_4-2x_{2k+1}&=0,\\ x_5+x_6-2x_{2k+1}&=0,\\ \vdots\qquad\quad\\ x_{2k-1}+x_{2k}-2x_{2k+1}&=0. \end{aligned} \right. \tag{$\Sk$} \end{equation*} The configuration of the solutions of $\Sk$ is a \emph{$k$-tuple of `crossing $3$-APs'}, namely, $k$ (not necessarily distinct) $3$-APs $(x_1,x_{2k+1},x_2)$, $(x_3,x_{2k+1},x_4),\ldots$, and $(x_{2k-1},x_{2k},x_{2k+1})$, with common middle term $x_{2k+1}$. For $A\subseteq \mathbb{F}_p^n$, an $\Sk$-\emph{semishape} in $A$ means a solution $(x_1,x_2,\ldots,x_{2k+1})\in A^{2k+1}$ of $\Sk$. (Semishapes correspond to \emph{cycles} in \cite{Sauermann}.) We say it is \emph{degenerate} if $\#\{x_1,x_2,\ldots,x_{2k+1}\}<2k+1$; otherwise, an $\Sk$-semishape is called an $\Sk$-\emph{shape}, or simply a \textit{$k$-star}. Namely, an $\Sk$-shape in $A$ is a `distinct $k$-star of $3$-APs' in $A$. See figure~\ref{fig1}. \begin{center} \begin{figure}[h] \includegraphics[width=5.5cm]{./fig.8} \caption{A $k$-star ($\Sk$-shape)}\label{fig1} \end{figure} \end{center} The goal of the paper is to provide an upper bound on the size of $A\subseteq \mathbb{F}_p^n$ that is \emph{$\Sk$-shape-free}. Our main theorem states that \emph{essentially the same estimate} as \eqref{spade}, up to scalar multiple by $k^2$, applies to our setting. \begin{theorem}[Avoiding a $k$-star]\label{theorem=crossing} Let $p\geq 3$ be a prime and $n,k\geq 1$. Assume that $A\subseteq \mathbb{F}_p^n$ does not admit any $\Sk$-shape. Then we have \[\label{club} \#A\leq k^2(\Lambda_{1,\frac{1}{3},p-1})^n.\tag{$\clubsuit$} \] \end{theorem} We emphasize that the following two types of problems are completely different in general: the problem of \emph{prohibiting semishapes that are not singletons}, and that of \emph{avoiding shapes}. Here a semishape is called a \emph{singleton semishape} if it consists of one point. For instance, it is rather `straightforward' to observe that the same bound as \eqref{spade} applies if we furthermore require that the set $A\subseteq \mathbb{F}_p^n$ does not admit non-singleton $\Sk$-semishapes. Indeed, if $(a,b,c)$ is a non-degenerate $3$-AP in $A$, then $(a,c,b,b,\ldots,b)$ is a non-singleton $\Sk$-semishape. This argument \emph{breaks down} in our setting. Tao's \emph{slice rank method} \cite{Tao}, which reformulated the proof technique in \cite{EllenbergGijswijt}, works effectively for problems of the former type. In contrast, there is no direct interpretation in terms of slice rank for problems of the latter type. Compare with \cite[Definition~2.2]{MimuraTokushige}. Naslund addressed \cite{Naslund} the problem of the latter type for the equation $x_1+x_2+\cdots +x_p=0$ in $\mathbb{F}_p^n$. Recently, Sauermann \cite{Sauermann} has provided substantial improvement of the upper bound in that setting. Our proof of Theorem~\ref{theorem=crossing} is inspired by Sauermann's method. We note that there are two major differences from her original argument. First, one of the keys \cite[Lemma~3.1]{Sauermann} to her proof collapses when we collect $\Sk$-semishapes of the form $(a,c,b,b,\ldots,b)$, which appeared in the argument above. This issue arises from a lack of the full symmetry of the coefficients in the system $\Sk$ of equations. We overcome this difficulty by \emph{choosing a `well-behaved' labeling of points} in semishapes from a fixed point-configuration type; see the argument in `Case~2' in the proof of Theorem~\ref{theorem=crossing}. Secondly, in our modification (Lemma~\ref{lemma=extendability}) of the key lemma \cite[Lemma~3.1]{Sauermann}, works `too' ideally. It enables us to have a considerably better bound in Theorem~\ref{theorem=crossing}: the direct application to Sauermann's method would give a bound of the form $\#A \leq C \left(\sqrt{\Lambda_{1,\frac{1}{3},p-1}\cdot p}\right)^n$. \section{Proof of Theorem~$\ref{theorem=crossing}$}\label{section=proof} For $X_1,X_2,\ldots ,X_{2k+1}\subseteq \mathbb{F}_p^n$, an $\Sk$-semishape in $X_1\times X_2\times \cdots \times X_{2k+1}=:\XX$ means $(x_1,x_2,\ldots,x_{2k+1})\in\XX$ that is a solution of $\Sk$. Two $\Sk$-semishapes $(x_1,x_2,\ldots,x_{2k+1})$ and $(x'_1,x'_2,\ldots,x'_{2k+1})$ are said to be \emph{disjoint} if $\{x_1,x_2,\ldots,x_{2k+1}\}$ and $\{x'_1,x'_2,\ldots,x'_{2k+1}\}$ are disjoint. We define disjointness of $3$-APs in the same manner as above. Following \cite{Sauermann}, we define the following notion: for $1\leq i<j\leq 2k+1$, we say that $(x,y)\in X_i\times X_j$ is \emph{$(i,j)$-extendable} in $\XX$ if there exists an $\Sk$-semishape in $\XX$ whose $i$-th term is $x$ and $j$-th term is $y$. Here for a semishape $(x_1,x_2,\ldots,x_{2k+1})$, the $i$-th term of it means $x_i$. In the proof of Theorem~\ref{theorem=crossing}, we employ the following result, which may be seen as the \textit{multicolored version} of the bound of `non-singleton $\Sk$-semishape'-free subsets. See \cite[Section~$3$]{BCCGNSU} for more backgrounds on the multicolored version. This might be known to experts; at least, the statement for $k=1$ is a well-known generalization of the Ellenberg--Gijswijt theorem \cite{EllenbergGijswijt}. Nevertheless, we include an outlined proof for the reader's convenience. \begin{theorem}[Multicolored $\Sk$-free set; compare with \cite{EllenbergGijswijt}]\label{theorem=multicolor} Let $s\in \mathbb{N}$ and let \[ M=\{(x_{1,i},x_{2,i}\ldots,x_{2k+1,i})\in(\mathbb{F}_p^n)^{2k+1}: 1\leq i\leq s\}. \] Assume that they satisfy that \[ (x_{1,i_1},x_{2,i_2},\ldots,x_{2k+1,i_{2k+1}})\textrm{ is an $\Sk$-semishape}\quad \Longleftrightarrow \quad i_1=i_2=\cdots=i_{2k+1}. \] Then, we have $s\leq (\Lambda_{1,\frac{1}{3},p-1})^n$. \end{theorem} \begin{proof} Here we only provide an outlined proof. For $k=1$, as we mentioned above, the assertion is well known to experts. It follows from the proof of the Ellenberg--Gijswijt bound \cite{EllenbergGijswijt} by slice rank method. See \cite[Section~$3$]{BCCGNSU}; we also refer the reader to \cite[Definition~4.2 and Corollary~C]{MimuraTokushige} and \cite[Section~9]{LovaszSauermann} for more details on the use of the slice rank method in the multicolored setting. For $k\geq 2$, we may reduce the problem to the case where $k=1$ in the following argument; it is similar to the `straightforward' argument mentioned in the Introduction from $3$-APs to $\Sk$-semishapes. Fix $k\geq 2$. Suppose that $s> (\Lambda_{1,\frac{1}{3},p-1})^n$. Apply the assertion of Theorem~\ref{theorem=multicolor} for $k=1$ to $X_1\times X_2\times X_{2k+1}$. Here for $j\in [2k+1]$, we define $X_j:=\{x_{j,i}:1\leq i\leq s \}$. It implies that there exist $i_1,i_2,i_{2k+1}$ with $\#\{i_1,i_2,i_{2k+1}\}\geq 2$ such that $(x_{1,i_1},x_{2,i_2},x_{2k+1,i_{2k+1}})$ is a $3$-AP. Then, the following $(2k+1)$-tuple \[ (x_{1,i_1},x_{2,i_2},x_{3,i_{2k+1}},x_{4,i_{2k+1}},\ldots,x_{2k,i_{2k+1}},x_{2k+1,i_{2k+1}}) \] is an $\Sk$-semishape in $X_1\times X_2\times \cdots \times X_{2k+1}$; it violates the condition above for $k$. Therefore, we obtain the bound $s\leq (\Lambda_{1,\frac{1}{3},p-1})^n$ even for $k\geq 2$. \end{proof} \begin{proof}[Proof of Theorem~$\ref{theorem=crossing}$] We prove the statement of the theorem by induction on $k$. The initial case $k=1$ is the well-known result of Ellenberg and Gijswijt \cite{EllenbergGijswijt}. So we move on to the induction step. Let $k\geq 2$. We assume that the statement holds for $k-1$, and we shall show the statement for $k$. (A reader may read the proof below assuming $k=3$, which essentially contains everything needed for the general case.) In the induction step, we consider both $\Sk$-(semi)shapes and $\Skm$-(semi)shapes. Since (semi)shapes of our main concern are $\Sk$-(semi)shapes, we call them simply (semi)shapes. Hence, a `(semi)shape' in the remaining part of the proof always means an $\Sk$-(semi)shape; we do not use any abbreviation for an $\Skm$-(semi)shape. Let $A\subseteq \mathbb{F}_p^n$ be shape-free. Let $t:=\left\lceil\frac{1}{k^2}\#A \right\rceil$. We distinguish the following two cases. \begin{itemize} \item[\emph{Case~$1$.}] There does not exist $t$ disjoint $\Skm$-shapes in $A$. \item[\emph{Case~$2$.}] There \emph{does} exist $t$ disjoint $\Skm$-shapes in $A$. \end{itemize} In Case~$1$, take a maximal family of disjoint $\Skm$-shapes in $A$, and delete all the points in these $\Skm$-shapes from $A$. Note that each deleted $\Skm$-shape has $2k-1$ points. So the resulting set $A'$ satisfies \[ \#A'\geq \#A-(2k-1)(t-1)\geq \left(\frac{k-1}k\right)^2\#A. \] By construction, this $A'\subseteq \mathbb{F}_p^n$ is $\Skm$-shape-free, and it follows from the induction hypothesis that $\#A'\leq (k-1)^2(\Lambda_{1,\frac{1}{3},p-1})^n$. Hence, in Case~$1$, we obtain that \[ \#A\leq k^2(\Lambda_{1,\frac{1}{3},p-1})^n. \] In Case~$2$, take $t$ disjoint $\Skm$-shapes in A. For each $\Skm$-shape $\aa:=(a_1,a_2,\dots,a_{2k-1})$, where the last element $a_{2k-1}$ is the common middle term of the 3-APs, we see that \[ \tilde\aa:=(a_1,a_2,a_1,a_2,a_3,\ldots,a_{2k-1})\in A^{2k+1}, \] which is a concatenation of $(a_1,a_2)$ and $\aa$, is a semishape in $A$. Define a collection $M$ of $t$ disjoint semishapes \[ M:=\{\tilde\aa\in A^{2k+1}: \aa\in A^{2k-1} \textrm{ is in the chosen $t$ disjoint $\Skm$-shapes}\}. \] For each $i\in [2k+1]$, let $X_i$ as the set of all $i$-th term of semishapes in $M$. By disjointness, $\#X_i=t$ for each $i\in [2k+1]$. Furthermore, $2k-1$ sets $X_1$, $X_3$, $X_5,X_6,\ldots,X_{2k+1}$ are pairwise disjoint; $X_1=X_3$ and $X_2=X_4$. We claim that every semishape $(x_1,x_2,\ldots,x_{2k+1})$ in $\XX:=X_1\times X_2\times \cdots \times X_{2k+1}$ satisfies that $x_1=x_3$ and that $x_2=x_4$. Indeed, if $x_1\ne x_3$, then $x_1+x_2=x_3+x_4(=2x_{2k+1})$ implies that $x_2\neq x_4$. Using pairwise disjointness of $X_1,X_2,X_5,X_6,\ldots ,X_{2k+1}$, we have that $x_1,x_2,\ldots,x_{2k+2}$ are all distinct $2k+1$ points which consist of a shape in $A$, a contradiction. Similarly, we have that $x_2=x_4$. Now define \[ B:=\{(x,y)\in X_1\times X_{2k+1}:\textrm{ $(x,y)$ is $(1,2k+1)$-extendable in $\XX$}\}. \] The following is the key lemma to the proof, which substitutes for \cite[Lemma~3.1]{Sauermann}: \begin{lemma}\label{lemma=extendability} Let $(x,y)\ne (x',y')$ be two elements in $B$. Then we have that $y\ne y'$. \end{lemma} \begin{proof} Suppose the contrary: $(x,y)\ne (x',y')$ and $y=y'$. Then $x\ne x'$. By assumption, there must exist two distinct semishapes \[ (x,x_2,x,x_2,x_5,x_6\ldots,x_{2k},y) \text{ and } (x',x'_2,x',x'_2,x'_5,x'_6\ldots,x'_{2k},y) \] in $\XX$. However, then we would find a semishape $(x,x_2,x',x'_2,x_5,x_6\ldots,x_{2k},y)$ in $\XX$, which violates $x_1=x_3$. A contradiction. \end{proof} Note that Lemma~\ref{lemma=extendability} has a great byproduct: It implies that $B\ni (x,y)\mapsto y\in X_{2k+1}$ is \emph{bijective}; in particular, it follows that $\#B=t$. This explains the second difference from Sauermann's original argument, as we discussed in the Introduction. (In her setting, the outcome is that $\#B\leq p^n$.) In what follows, we claim that every semishape in $\XX$ is in fact an element in $M$, in other words, we verify that we can apply Theorem~\ref{theorem=multicolor} to $M$. To show this, we change the indices and express $M$ as \[ M=\{(x_{1,i},x_{2,i},\ldots,x_{2k+1,i}):1\leq i\leq t\}. \] Assume that $\bm x:=(x_{1,i_1},x_{2,i_2},\ldots ,x_{2k+1,i_{2k+1}})$ is a semishape in $\XX$. Then, it is easy to see by disjointness that $i_1=i_3$ and $i_2=i_4$; by our observation on $(1,2k+1)$-extendable pairs, it also follows that $i_1=i_{2k+1}$. These equalities imply that $i_1=i_2=i_3=i_4=i_{2k+1}=:i$. Indeed, note that $x_{1,i_1}+x_{2,i_2}-2x_{2k+1,i_{2k+1}}=0$ and $x_{3,i_1}+x_{4,i_2}-2x_{2k+1,i_{2k+1}}=0$. What remains is to show that $i_5=i_6=\cdots=i_{2k}=i$. Assume the contrary, say, $i_5\neq i$. Then it follows from $x_{5,i}+x_{6,i}=x_{5,i_5}+x_{6,i_6}(=2x_{2k+1,i})$ that $i_6\neq i$. Consider the $(2k+1)$-tuple obtained from $\bm x$ by replacing $x_{3,i}, x_{4,i}$ with $x_{5,i_5},x_{6,i_6}$, that is, \[ (x_{1,i},x_{2,i},x_{5,i_5},x_{6,i_6},x_{5,i},x_{6,i},x_{7,i},x_{8,i} \ldots,x_{2k+1,i}). \] It, however, must be a shape in $A$ by disjointness; this contradicts the choice of $A$. Hence we prove the claim. To close up the argument for Case~$2$, apply Theorem~\ref{theorem=multicolor} to $M$. We obtain that \[ t=\#M\leq (\Lambda_{1,\frac{1}{3},p-1})^n. \] Recall that $t=\left\lceil\frac{1}{k^2}\#A\right\rceil$. Hence, in Case~$2$, we conclude that \[ \#A\leq k^2(\Lambda_{1,\frac{1}{3},p-1})^n. \] Unifying both cases yields \eqref{club}. \end{proof} \section{Further direction} In Theorem~\ref{theorem=crossing} we considered 3-APs sharing the same middle term. We may relax this condition a little bit. More precisely, the statement of Theorem~\ref{theorem=crossing} still holds if we replace $\Sk$ with the following system of equations: \[ \left\{ \begin{aligned} x_1-2x_2+x_{2k+1}&=0,\\ x_3-2x_4+x_{2k+1}&=0,\\ \vdots\qquad\quad\\ x_{2k-1}-2x_{2k}+x_{2k+1}&=0. \end{aligned} \right. \] The reader is invited to verify that the proof of Theorem~\ref{theorem=crossing} is easily extended to the case above. However, the following problem is already beyond the reach of the proof of Theorem~\ref{theorem=crossing}. \begin{problem} Let $A\subseteq \mathbb{F}_p^n$ do not admit any shape defined by \[ \left\{ \begin{aligned} x_1-2x_2+x_{5}&=0,\\ x_3+x_4-2x_{5}&=0. \end{aligned} \right. \] Then is it true $\# A\leq C(p)^n$ for some constant $C(p)<p$ depending only on $p$? \end{problem} If two variables appear more than once in the system, then the situation becomes much involved. In our sequel paper \cite{MimuraTokushige}, we also investigate semishapes associated with the following system of inequalities: \[ \left\{\begin{aligned} x_1-x_2-x_3+x_4&=0,\\ x_1-2x_3+x_5&=0. \end{aligned} \right. \tag{$\mathcal{S}_{\mathrm{W}}$} \] Geometrically, an $\mathcal{S}_{\mathrm{W}}$-shape $(x_1,x_2,x_3,x_4,x_5)$ is the combination shape of a `parallelogram $(x_1,x_2,x_4,x_3)$' and a `$3$-AP $(x_1,x_3,x_5)$'; it may be regarded as a `\textit{$\mathrm{W}$ shape}'. See figure~\ref{fig2}. Here we announce the following result in \cite[Theorem~1.1 and Theorem~B]{MimuraTokushige}: \begin{center} \begin{figure}[h] \includegraphics[width=5.0cm]{./fig.5} \caption{An $\mathcal{S}_{\mathrm{W}}$-shape}\label{fig2} \end{figure} \end{center} \begin{theorem}[Avoiding a `$\mathrm{W}$ shape']\label{theorem=Wshape} Let $p\geq 3$ be a prime. Then there exists $C_{\mathrm{W}}(p)<p$ that satisfies the following: For $n\geq 1$, assume that $A\subseteq \mathbb{F}_p^n$ does not admit any $\mathcal{S}_{\mathrm{W}}$-shape. Then we have \[ \#A\leq 7\left(\sqrt{C_{\mathrm{W}}(p)\cdot p}\right)^n. \] Furthermore, we have that \[ C_{\mathrm{W}}(p)\leq \inf\{\max\{\Lambda_{1,\alpha,p-1},\Lambda_{2,\beta,p-1}\}: 3\alpha+2\beta=1,\ \alpha,\beta>0\}. \] \end{theorem} For sufficiently large $p$, we have that $C_{\mathrm{W}}(p)\leq (0.985)^2p$. See \cite[Remark~4.3]{MimuraTokushige} for details on this estimate. \section*{Acknowledgments} The authors are grateful to the members, Wataru Kai, Akihiro Munemasa, Shin-ichiro, Seki and Kiyoto Yoshino, of the ongoing seminar on the Green--Tao theorem (on arithmetic progressions in the set of prime numbers) at Tohoku University launched in October, 2018. Thanks to this seminar, the first-named author has been intrigued with the subject of this paper. They thank Takumi Yokota for comments. Masato Mimura is supported in part by JSPS KAKENHI Grant Number JP17H04822, and Norihide Tokushige is supported by JSPS KAKENHI Grant Number JP18K03399. \bibliographystyle{amsalpha}
\section{Introduction} A Borel subset $E\subseteq \mathbb{R}^n$ is said to be \emph{countably $\H^k$-rectifiable} (or in short \emph{$\H^k$-rectifiable}) if there exist countably many $k$-dimensional Lipschitz graphs $\Gamma_i$ that cover $E$ up to an $\H^k$-negligible set, that is $ \H^k\left(E\setminus\bigcup_{i=1}^\infty \Gamma_i\right)=0. $ Here with $k$-dimensional Lipschitz graph we mean the graph of a Lipschitz map over any $k$-dimensional subspace of $\mathbb{R}^n$. Analogously, we say that $E$ is \emph{$\H^k$-rectifiable of class $C^{1,\alpha}$} (or simply \emph{$C^{1,\alpha}$ rectifiable} if the dimension $k$ is clear from the context) if $\Gamma_i$ can be chosen to be graphs of $C^{1,\alpha}$ maps. It is a classical fact that $\H^k$-rectifiability is equivalent to $C^{1,0}$ $\H^k$-rectifiability \cite[Theorem~15.21]{Mat95}. Here we are interested in obtaining criteria that, starting from some geometric conditions on the set $E$, allow to conclude that $E$ is $C^{1,\alpha}$ rectifiable. The main geometric objects used throughout the paper are the \emph{$\alpha$-paraboloids}: for any linear $k$-plane $V$ in $\mathbb{R}^n$, any number $\lambda>0$ and any $x\in \mathbb{R}^n$, following \cite{AnzSer} we define \begin{equation}\label{eq:alphaparab} Q_\alpha(x,V,\lambda):=\left\{y\in \mathbb{R}^n: |P_{V^\perp} (y-x) |\le \lambda |P_{V}(y-x)|^{1+\alpha}\right\} \end{equation} where $P_V$ denotes the orthogonal projection on $V$. The following is the first main result. Throughout the paper we tacitly assume for simplicity that all sets appearing in the statements are Borel. We also define for simplicity $\varepsilon_0(k):=2^k240^{-k-1}$. \begin{theorem}[$C^{1,\alpha}$-rectifiability from approximate tangent paraboloids]\label{thm:C1alpharectifgen} Fix $k\in\{1,\ldots,n-1\}$ and $0<\alpha\leq 1$. Consider a subset $E\subset \mathbb{R}^n$ with $\H^k(E)<\infty$ such that for $\H^k$-a.e. $x\in E$ there exists a $k$-plane $V_x$ and $\lambda>0$ such that \begin{equation}\label{eq:parabhyp} \limsup_{r\to 0}{\frac{1}{r^k}\H^k\big(E\cap B(x,r)\setminus Q_\alpha(x,V_x,\lambda)\big)}<\varepsilon_0(k). \end{equation} Then $E$ is $C^{1,\alpha}$ $\H^k$-rectifiable. \end{theorem} The converse of Theorem \ref{thm:C1alpharectifgen} is also true in a slightly stronger form. \begin{proposition}[Converse]\label{prop:converse} If $E$ is a $C^{1,\alpha}$ rectifiable set with $\H^k(E)<\infty$ then for $\H^k$-a.e. $x\in E$ there exist a $k$-plane $V_x$ and $\lambda>0$ such that \begin{equation}\label{eq:approxcone} \lim_{r\to 0}{\frac{1}{r^k}\H^k\big(E\cap B(x,r)\setminus Q_\alpha(x,V_x,\lambda)\big)}=0. \end{equation} In the case when $\alpha=1$ we can take any $\lambda>0$ arbitrarily small. \end{proposition} We call a paraboloid satisfying \eqref{eq:approxcone} an \emph{approximate tangent paraboloid} of $E$ at $x$.\\ The second main result concerns a more general version of Theorem \ref{thm:C1alpharectifgen}, where roughly speaking we allow the plane $V$ to depend not only on $x$ but also on the scale $r$, and moreover we don't require that it passes through $x$. The basic geometric objects we consider are $\eta$-neighbourhoods of $k$-planes, which we call cylinders, that is sets defined by \[ B(V, \eta):=\{y\in \mathbb{R}^n: \mathrm{dist}(y,V)<\eta\}. \] In particular we will consider sets of the form $B(V, \lambda r^{1+\alpha})\cap B(x,r)$ where $V$ is an affine $k$-plane and $\lambda,r>0$, $0<\alpha\leq 1$. \begin{theorem}[$C^{1,\alpha}$-rectifiability from approximate tangent cylinders]\label{thm:C1alpharot} Fix $k\in\{1,\ldots,n-1\}$ and $0<\alpha\leq 1$. Consider a subset $E\subset \mathbb{R}^n$ with $\H^k(E)<+\infty$ such that for $\H^k$-a.e. $x\in E$ the following conditions hold: \begin{equation}\label{eq:ldcyl} \Theta_*^k(E,x)>0 \end{equation} and there exist $\lambda>0$ and for every $r>0$ an affine $k$-plane $V_{x,r}$ such that \begin{equation}\label{eq:cylhyp} \limsup_{r\to 0}{\frac{1}{r^k}\H^k\big(E\cap B(x,r)\setminus B(V_{x,r}, \lambda r^{1+\alpha})\big)}<(1-2^{-k})\varepsilon_0(k)\Theta_*^k(E,x). \end{equation} Then $E$ is $C^{1,\alpha}$ $\H^k$-rectifiable. \end{theorem} \begin{remark} \begin{itemize} \item[(i)] Observe that if $V_{x,r}$ does not depend on $r$, requiring \eqref{eq:parabhyp} or \eqref{eq:cylhyp} is essentially equivalent up to considering different values for $\lambda$ (see Lemma \ref{lemma:parabcyl}). The real difference in the latter case is the possible dependence of $V_{x,r}$ on $r$. We will refer to the first case as \emph{fixed planes}, because they do not change from scale to scale, while to the second as \emph{rotating planes}, because a priori they could change from scale to scale. \item[(ii)] This time the lower density assumption \eqref{eq:ldcyl} is necessary in the proof and it is not clear whether we can remove it. \item[(iii)] All the results are stated in terms of a set $E$, that is for measures of the form $\H^k\llcorner E$, but the same results hold for Radon measures $\mu$ satisfying $0<\Theta^{*k}(\mu,x)<\infty$ for $\mu$-a.e. $x$ (and $\Theta_*^k(\mu,x)>0$ in Theorem \ref{thm:C1alpharot}). Indeed by standard differentiation results for measures the restriction of $\mu$ to the set $\{x: M^{-1}\leq\Theta^{*k}(\mu,x)\leq M\}$ is equivalent, up to constants, to $\H^k$ restricted to the same set, and by locality the density of a subset remains the same $\H^k$-almost everywhere. The density assumptions from above (or from below in Theorem \ref{thm:C1alpharot}) are all we need to make the proof work. The only difference in this case would be in the explicit value of $\varepsilon_0(k)$. \item[(iv)] Conditions \eqref{eq:parabhyp} and \eqref{eq:cylhyp} could actually be required to hold only along a geometric sequence of radii $r_j=r_0\rho^j$, with $0<\rho<1$, thanks to the properties of $\beta$ numbers (see Lemma \ref{lemma:growth}). \end{itemize} \end{remark} To prove Theorem \ref{thm:C1alpharectifgen} and Theorem \ref{thm:C1alpharot} we will actually prove some more quantitative statements. We refer to Proposition \ref{thm:C1alpharectifquant} and Proposition \ref{thm:C1alpharectifCylindersquant} for the precise statements, but since they are a bit technical we limit to state here a simplified version in the case of an Ahlfors-David regular set, that is a compact set $E\subset \mathbb{R}^n$ such that $\delta r^k\leq \H^k(E\cap B(x,r))\leq M r^k$ for every $r\leq \mathrm{diam}(E)$ and for two fixed constants $\delta,M>0$. \begin{proposition}[Quantitative statement] Fix $k\in\{1,\ldots,n-1\}$ and $0<\alpha\leq 1$. Fix moreover $\lambda,\delta,M>0$ and consider a set $E\subset \mathbb{R}^n$ such that \begin{equation} \delta r^k\leq \H^k(E\cap B(x,r))\leq Mr^k\quad\text{for every $0<r\leq \mathrm{diam}(E)$}. \end{equation} Suppose moreover that for every $x\in E$ there exists a $k$-plane $V_x\in G(n,k)$ such that \begin{equation} \H^k(E\cap B(x,r)\setminus Q_\alpha(x,V_x,\lambda))< \varepsilon_0(k)\delta r^k\quad\text{for every $0<r\leq \mathrm{diam}(E)$} \end{equation} where $\varepsilon_0(k)$ is the same as in Theorem \ref{thm:C1alpharectifgen}. Suppose in addition that \[ \mathrm{diam}(E)\leq r_1=(4\lambda(2+4^{1+\alpha})+8C(n,\delta,M,\lambda))^{-1/\alpha}, \] where $C(n,\delta,M,\lambda)$ is the constant of Lemma \ref{lemma:key}(ii). Then $E$ can be covered by one $k$-dimensional graph of a $C^{1,\alpha}$ map. \end{proposition} As a corollary we recover, under some weaker assumptions, a result proved by Ghinassi \cite[Theorem~I]{Ghi}. To state the corollary let us recall (a version of) the $\beta$ numbers, introduced first by Peter Jones in \cite{Jon}: \begin{align} \beta_p(x,r)^p&:=\inf_V \frac{1}{r^k}\!\!\int\limits_{E\cap B(x,r)}\!\! \left(\frac{\mathrm{dist}(y,V)}{r}\right)^p d\H^k(y)\quad\text{if $1\leq p<\infty$}\label{eq:beta}\\ \beta_\infty(x,r)&:=\inf_V\H^k\underset{E\cap B(x,r)}{\mathrm{-esssup}} \frac{\mathrm{dist}(y,V)}{r}\nonumber \end{align} where the infimum is taken over all affine $k$-planes $V$ (not necessarily containing $x$). \begin{corollary}[$C^{1,\alpha}$-rectifiability from a bound on $\beta$ numbers]\label{cor:ghi} Fix $k\in \{1,\ldots, n-1\}$, $0<\alpha\leq 1$. Consider $E\subset \mathbb{R}^n$ with $\H^k(E) < \infty$. Suppose that for $\H^k$-a.e $x\in E$ there exists $1\le p\le\infty$ such that \begin{equation}\label{eq:betap} \limsup_{r\to 0}r^{-\alpha}\beta_p(x,r)<\infty \end{equation} Then $E$ is $C^{1,\alpha}$ $\H^k$-rectifiable \end{corollary} The proof of the above corollary of Theorem \ref{thm:C1alpharot} relies on Theorem \ref{thm:QuantRectifGen} below, which is used to obtain the positive lower density assumption \eqref{eq:ldcyl}. We could avoid using it if we assume directly that $\Theta_*^k(E,x)>0$ for $\H^k$-a.e. $x\in E$. \begin{remark}[$C^{1,\omega}$-rectifiability]\label{rmk:intromoduli} We stated the results for $C^{1,\alpha}$ rectifiability, but actually with a totally analogous proof (see Remark \ref{rmk:moduli}) we can prove the following result regarding more general moduli of continuity: consider a positive sequence $(\lambda_j)_{j\in \mathbb{N}}$ such that $\sum_j \lambda_j <\infty$ and consider the tail sequence given by $\omega_m:=\sum_{j=m}^\infty \lambda_j$. Fix a geometric sequence $r_j=r_0\rho^j$, $0<\rho<1$, and define for any $r>0$ \[ \lambda(r)=\lambda_{j(r)},\qquad \omega(r)=\omega_{j(r)}\qquad\text{where\, $r_{j(r)+1}\leq r< r_{j(r)}$} \] If we replace the left hand side in \eqref{eq:parabhyp} or in \eqref{eq:cylhyp} with \[ \limsup_{r\to 0}\frac{1}{r^k}\H^k(E\cap B(x,r)\setminus B(V_{x,r}, \lambda(r) r)) \] then $E$ is $C^{1,\omega}$ $\H^k$-rectifiable, meaning that up to an $\H^k$-negligible set it can be covered by countably many graphs of $C^1$ maps whose derivative has modulus of continuity $\omega$. Theorem \ref{thm:C1alpharot} corresponds to the choice $\lambda_j=r_j^\alpha$, or equivalently up to constants to $\lambda(r)=r^\alpha$, which indeed gives $\omega(r)=Cr^\alpha$. \end{remark} Let us now compare the above criteria with previously known results. First of all we compare them with the following classical rectifiability criterion. Given $s>0$ and $x\in \mathbb{R}^n$ we define the cone \[ X(x,V,s)=\big\{y\in \mathbb{R}^n : |P_{V^\perp}(y-x)|\leq s |P_V (y-x)|\big\}. \] The following result is a consequence of \cite[Corollary~15.16]{Mat95} (we underline the slightly different definition of the cones $X(x,V,s)$ in the reference above). \begin{theorem}[Rectifiability from approximate tangent cones]\label{thm:rectifgen} Given a set $E\subseteq\mathbb{R}^n$ with $\H^k(E)<+\infty$, suppose that for $\H^k$-a.e. point $x\in E$ there exist a $k$-plane $V$ and $s>0$ such that \begin{equation}\label{eq:Xrk} \limsup_{r\to 0}\frac{1}{(2r)^k}\H^k\big(E\cap B(x,r)\setminus X(x,V,s)\big)< \frac{1}{240^{k+1}}\left(\frac{1}{\sqrt{1+s^2}}\right)^k. \end{equation} Then $E$ is $\H^k$-rectifiable. \end{theorem} We can view Theorem \ref{thm:C1alpharectifgen} as a direct analogue of Theorem \ref{thm:rectifgen} obtained by replacing cones with paraboloids. Observe that under the assumptions of Theorem~\ref{thm:C1alpharectifgen} the set $E$ is $\H^k$-rectifiable, since we can take $s$ small enough so that \eqref{eq:Xrk} is satisfied, and thus Theorem \ref{thm:rectifgen} applies. Theorem \ref{thm:C1alpharot} is instead related to \cite[Theorem 16.2]{Mat95}. One difference (besides the fact that only planes through the point are considered) is that the author asks as an assumption that not only the set $E$ is close to some $k$-plane on every scale \cite[{(15.9)}]{Mat95}, but also viceversa, that in the same scale the $k$-plane is close to the set $E$ \cite[{(15.8)}]{Mat95}, which is much more than \eqref{eq:ldcyl}. A stronger assumption like this one is really necessary because there are examples of sets which satisfy only \cite[{(15.9)}]{Mat95} and also satisfy \eqref{eq:ldcyl} but are not rectifiable (see \cite[Chapter 20]{DS}, choosing $\alpha_n\to 0$ but $\sum \alpha_n^2=+\infty$). Instead in our case the precise rate of shrinking of the set around the planes that we assume (of order $r^{1+\alpha}$) is strong enough to imply rectifiability just assuming positive lower density. Anzellotti and Serapioni \cite{AnzSer} already considered criteria of $C^{1,\alpha}$ rectifiability in terms of approximate tangent parabolic sets. However their approach is a bit different. In fact they prove that the $C^{1,\alpha}$ rectifiability of a set is equivalent to a certain condition involving non-homogeneous blow-ups, together with the (approximate) $\alpha$-H\"{o}lder continuity of the tangent planes. One feature of Theorem \ref{thm:C1alpharectifgen}, instead, is that we do not require any a priori H\"{o}lder continuity of the planes $V_x$ since we deduce it from the geometric condition \eqref{eq:parabhyp} and natural density bounds for the Hausdorff measure. Essentially if the planes were not H\"{o}lder continuous then the measure would locally concentrate too much around $(k-1)$-dimensional subspaces, which is prevented by the density estimates for the Hausdorff measure, see Lemmas \ref{lemma:tube} and \ref{lemma:key}. Moreover the non-homogeneous blow-ups prevent the possibility of obtaining the converse result \cite[Remark after Theorem 3.5]{AnzSer}, which instead we obtain in Proposition \ref{prop:converse}. Finally we give a quantitative result where we cover the entirety of the set with one single $C^{1,\alpha}$ graph, without an additional negligible set. A more recent progress in generalising the result of Anzellotti and Serapioni to $C^{k,\alpha}$ rectifiability is due to Santilli \cite{San17} who develops a differentiability notion of higher order for subsets of the Euclidean space that allows for the characterization of higher order rectifiable sets. We remark that in the case of $C^{1,\alpha}$ rectifiability, $0<\alpha\le 1$, Theorem \ref{thm:C1alpharectifgen} with $\varepsilon_0(k)=0$ corresponds to \cite[Theorem 5.4]{San17} and Proposition \ref{prop:converse} to \cite[Theorem 3.23]{San17}. Other results which employ various techniques in special cases of higher order rectifiability can be found in \cite{Del07, Del08} for the case of curves, and also in \cite{Alb94} for the case of singular sets of convex functions. We now compare Theorem \ref{thm:C1alpharot} with similar criteria involving $\beta$ numbers defined in \eqref{eq:beta}. We could roughly summarize the difference by saying that instead of requiring an $L^2$-closeness to some $k$-plane at every scale we just require closeness in measure. The following is a characterization of $\H^k$-rectifiability using $\beta$ numbers due to Azzam and Tolsa (see also \cite{Paj} for a previous result assuming a lower density assumption). The original result is about Radon measures with positive and finite upper density, but we state it in the case of sets, i.e. for measures of the form $\H^k\llcorner E$ for some set $E$. \begin{theorem}[\citep{AzzTol},\cite{Tol}]\label{thm:QuantRectifGen} Let $E \subset \mathbb{R}^{n}$ be an $\mathcal{H}^{k}$ -measurable set with $\mathcal{H}^{k}(E)<\infty$. The set $E$ is $\H^k$-rectifiable if and only if \[ \int_{0}^{1} \beta_2(x, r)^{2} \frac{d r}{r}<\infty \quad \text { for } \mathcal{H}^{k}\text {-a.e. } x \in E. \] \end{theorem} This essentially captures rectifiability by measuring in a scale-invariant way, using an $L^2$ gauge, how close a set is to lying in a $k$-plane. Ghinassi \cite{Ghi} proved a sufficient condition for a Radon measure on $\mathbb{R}^n$ to be $C^{1,\alpha}$-rectifiable, $0<\alpha \le 1$, using a similar condition which involves the $\beta$ numbers. \begin{theorem}[{\cite[Theorem I]{Ghi}}]\label{thm:C1aRectGhi} Let \(E \subseteq \mathbb{R}^{n}\) such that \(0<\Theta^{k *}(E, x)<\infty\) for \(\H^{k}\) a.e. \(x \in E\), and let \(\alpha \in(0,1) .\) Assume that for $\H^k$-a.e. \(x \in E\) \begin{equation}\label{GhCond} \int_0^1 \frac{\beta_\infty(x,r)^2}{r^{2\alpha}} \frac{dr}{r}<\infty. \end{equation} Then \(E\) is \(C^{1, \alpha}\) k-rectifiable. \end{theorem} We recover this result from Corollary \ref{cor:ghi}: condition \eqref{GhCond} (together with Lemma \ref{lemma:growth}) implies \eqref{eq:betap}, and therefore Corollary \ref{cor:ghi} applies. A remarkable feature of Theorems \ref{thm:QuantRectifGen} and \ref{thm:C1aRectGhi} is that there is no a priori condition on the choice of $k$-planes, which can vary from scale to scale. Corollary \ref{cor:ghi} weakens a bit the assumptions of Theorem \ref{thm:C1aRectGhi}, requiring only a bound on $r^{-\alpha}\beta_p$ instead of an integrability condition. We remark that in \cite{Ghi} Ghinassi was also interested in obtaining a biLipschitz parametrization of the set which is $C^{1,\alpha}$ in both ways, under some Reifenberg-flatness assumptions, building on previous work by David and Toro \cite{DavTor, Tor}. With the present work we intend to show how a more “classical” approach, that follows the lines of similar criteria for standard $C^1$ rectifiability just replacing approximate tangent cones with paraboloids, is capable of giving a relatively simple proof of the $C^{1,\alpha}$ rectifiability. We also remark that the key property that makes the proof work is the summability of $r_j^\alpha$, or more generally of $(\lambda_j)_{j\in\mathbb{N}}$ in Remark \ref{rmk:intromoduli} (equivalently, the integrability on $(0,1)$ of $\lambda(r)$ in $\tfrac{dr}{r}$), which is for instance implied by the summability of the $\beta_\infty(x,r_j)$ and which we exploit to obtain the convergence of $V_{x,r}$ to the tangent plane $V_x$. This is in contrast with Theorem \ref{thm:QuantRectifGen} where instead just the \emph{square} summability of the $\beta$ numbers is required, but at the cost of a more complex proof. A similar difference of assumptions between summability and square summability can be seen between \cite{ADT} and \cite{ATT}, this time involving the $\alpha$ numbers. Since we want to obtain the $C^{1,\alpha}$ rectifiability anyway we take full advantage of the summability of $r_j^\alpha$. We finally mention that in more recent years there has been a growing interest in conditions for higher order rectifiability related to Menger-type curvatures \cite{Kol, GhiGoe}, in the spirit of the original result by L\'{e}ger \cite{Leg} and its generalization to higher dimension \cite{Meu}. The connection established in \cite{LW09, LW11} by Lerman and Whitehouse reveals the similarities and transference of methodology in the literature on criteria involving the Menger-type curvatures and those of the beta numbers. This further suggests investigating weaker assumptions as we have explored with regard to the beta numbers for the results on Menger-type curvatures.\\ \subsection*{Acknowledgements.} We are deeply indebted to Giovanni Alberti for motivating the problem and for many helpful discussions. This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme under grant agreement No 757254 (SINGULARITY). \section{Preliminaries} We denote the Euclidean norm in $\mathbb{R}^n$ by $|\cdot|$. We denote by $G(n,k)$ the Grassmannian of linear $k$-planes in $\mathbb{R}^n$, and given $V\in G(n,k)$ we define $P_V$ as the orthogonal projection on $V$. In the following we often identify $\mathbb{R}^k$ with the span of the first $k$ standard basis vectors in $\mathbb{R}^n$, and $\mathbb{R}^{n-k}$ with the span of the last $n-k$, and we write a vector in $\mathbb{R}^n$ as $y=(y',y'')$ with $y'\in\mathbb{R}^k$, $y''\in \mathbb{R}^{n-k}$. On $G(n,k)$ we consider the metric \[ d(V,W):=\|P_V-P_W\|=\sup_{\substack{x\in \mathbb{R}^n\\ |x|=1}} |(P_V-P_W)x|. \] We will also consider the following equivalent expression for the distance $d$: \begin{equation}\label{eq:dist} d(V,W)=\sup_{\substack{v\in V\\ |v|=1}}\mathrm{dist}(v,W)=\sup_{\substack{v\in V\\ |v|=1}} |P_{W^\perp}v| \end{equation} where $\mathrm{dist}(v,W)=\inf_{w\in W} |v-w|$. For a proof of the equality \eqref{eq:dist} see \cite[Section~34]{AG93}. We note that by compactness all suprema are attained. We also note the following: if $V$ is a $k$-plane which is the graph of a linear function $L:\mathbb{R}^k\to \mathbb{R}^{n-k}$, that is $V=\{(y',y'')\in \mathbb{R}^n:y''=Ly'\}$, then \begin{equation}\label{eq:distequiv} d(V,\mathbb{R}^k)\leq \|L\|\leq \frac{d(V,\mathbb{R}^k)}{\sqrt{1-d(V,\mathbb{R}^k)^2}}. \end{equation} Indeed \[ d(V,\mathbb{R}^k)=\sup_{\substack{y'\in \mathbb{R}^k\\ |y'|=1}} \mathrm{dist}(y',V)\leq \sup_{\substack{y'\in \mathbb{R}^k\\ |y'|=1}} |Ly'|=\|L\|. \] We also consider the space $A(n,k)$ of all affine $k$-planes in $\mathbb{R}^n$. Given $V\in A(n,k)$ we can always write in a unique way, $V\in A(n,k)$ as, $V=\tilde V+a$ with $\tilde V\in G(n,k)$ and $a\in \tilde V^\perp$. We define the (pseudo)distance $d(V,W):=d(\tilde V,\tilde W)$ where $\tilde V,\tilde W\in G(n,k)$ are the linear $k$-planes associated to $V,W$ as above. Given $V\in A(n,k)$ and $\eta>0$ we define the $\eta$-neighbourhood $B(V, \eta):=\{x\in \mathbb{R}^n: \mathrm{dist}(x,V)<\eta\}$. We denote by $\L^n$ the Lebesgue measure in $\mathbb{R}^n$ and following \cite{Mat95} we define the $k$-dimensional Hausdorff measure of a set $E\subset \mathbb{R}^n$ by $\H^k(E)=\lim\limits_{\delta\to 0}\H^k_\delta(E)$ where \[ \H^k_\delta(E)=\inf\left\{\sum_i \mathrm{diam}(E_i)^k:\,E\subset\bigcup_i E_i,\, \mathrm{diam}(E_i)\leq \delta\right\}. \] Note in particular that there is no normalizing factor so that in fact in $\mathbb{R}^n$ we have $\H^n(B(x,r))=(2r)^n$. Given a subset $E\subseteq \mathbb{R}^n$ we define the upper and lower $k$-dimensional Hausdorff densities respectively as \begin{align*} \Theta^{*k}(E,x)&=\limsup_{r\to 0} \,(2r)^{-k}\H^k(E\cap B(x,r))\\ \Theta_*^{k}(E,x)&=\liminf_{r\to 0} (2r)^{-k}\H^k(E\cap B(x,r)) \end{align*} and when they coincide we denote the common value by $\Theta^k(E,x)$. By \cite[Theorem~6.2]{Mat95} if $\H^k(E)<\infty$ then for $\H^k$-a.e. $x\in E$ \begin{equation}\label{eq:Mat6.2} 2^{-k}\leq\Theta^{*k}(E,x)\leq 1. \end{equation} Moreover if $E$ is $\H^k$-rectifiable then for $\H^k$-a.e. $x\in E$ it holds that $\Theta^k(E,x)=1$ \cite[Theorem~16.2]{Mat95}. Throughout the paper we will often refer to a geometric sequence of radii defined by $r_j=r_0\rho^j$, where $r_0>0$ and $0<\rho <1$ are fixed. We will keep track of the constants in order to be able to prove some quantitative statements, but we will not try to optimize them in any way. The remaining of this section could be skipped at a first reading and used only when referenced later. The only notion required for the sequel is that of slanted paraboloids \eqref{eq:alphaparabL}. \subsection{Intersection of cylinders around planes} \begin{lemma}\label{lemma:tube} Consider two linear $k$-planes $V,W\in G(n,k)$ and set $\theta=d(V,W)$. Then there exists a $(k-1)$-plane $Z$ such that for any positive number $\eta$ we have \[ B(V, \eta)\cap B(W, \eta)\subseteq B\left(Z, \frac{2n\eta}{\theta}\right). \] \end{lemma} \begin{proof} We first observe that there exists $e\in W^\perp$ with $|e|=1$ such that $|P_V e|= \theta$. Indeed we have $d(V,W)=\|P_V-P_W\|=\|P_{W^\perp}-P_{V^\perp}\|=d(V^\perp,W^\perp)$ and then by \eqref{eq:dist} we obtain \[ \theta=d(V,W)=d(V^\perp,W^\perp)=\sup_{\substack{e\in W^\perp \\|e|=1}} |P_V e|. \] Now we consider any orthonormal basis $e_{k+1},\ldots,e_n$ of $V^\perp$ and we define $Z:=\mathrm{span}\{e,e_{k+1},\ldots,e_n\}^\perp$. Then $\mathrm{dim}\, Z=k-1$ and for any $x\in B(V, \eta)\cap B(W,\eta)$ we have \[ \begin{cases} |x\cdot e_i|\leq \eta & \text{ for $i=k+1,\ldots, n$}\\ |x\cdot e|\leq \eta \end{cases}. \] We now set $e':=\tfrac{P_V e}{|P_V e|}$ and consider the orthonormal basis $\{e',e_{k+1},\ldots, e_n\}$ of $Z^\perp$. Then for any $x\in B(V, \eta)\cap B(W, \eta)$ by triangle inequality we have \[ |x\cdot e'|=\frac{1}{|P_V e|} |x\cdot P_V e|=\frac{1}{\theta} \left|x\cdot \left(e-\sum_{i=k+1}^n (e\cdot e_i)e_i\right)\right|\leq \frac{1}{\theta}(n-k+1)\eta \] and finally \[ |P_{Z^\perp}x|\leq|x\cdot e'|+\sum_{i=k+1}^n |x\cdot e_i|\leq \frac{1}{\theta}(2n-2k+1)\eta\leq \frac{2n}{\theta}\eta. \] This concludes the proof. \end{proof} \subsection{\texorpdfstring{$\alpha$}{alpha}-paraboloids} For technical reasons we now introduce a variant of the $\alpha$-paraboloids defined in \eqref{eq:alphaparab} which takes into account the possibility of slanting the paraboloid with a linear map. Given $V\in G(n,k)$, a linear map $L:V\rightarrow V^\perp$ and $\lambda>0$ we define \begin{equation}\label{eq:alphaparabL} Q_\alpha^L(V, \lambda)=\{y\in\mathbb{R}^n:| P_{V^\perp}y - L(P_{V}y) |\le \lambda |P_{V}y|^{1+\alpha}\} \end{equation} and then for any $x\in \mathbb{R}^n$ we set $Q_\alpha^L(x,V,\lambda)=x+Q_\alpha^L(V, \lambda)$. These are paraboloids with a linear perturbation parametrized over $V$. If the linear map $L$ is constantly zero then we recover the definition \eqref{eq:alphaparab}. We now proceed to show that these sets and the $\alpha$-paraboloids introduced in \eqref{eq:alphaparab} are, in fact, locally equivalent. Since this property is invariant under rigid motions, without loss of generality in the proof we consider the case where the $k$-plane in \eqref{eq:alphaparabL} is $\mathbb{R}^k$. \begin{lemma}[Local equivalence of paraboloids]\label{lemma:parabequiv} Let $V\in G(n,k)$ be given by the graph of a linear map $L:\mathbb{R}^k\to\mathbb{R}^{n-k}$ and suppose that $\|L\|\leq\frac12$. Then for any given $\lambda > 0$ we have that \[ Q_\alpha(x,V,\lambda)\cap B(x,r_\lambda)\subseteq Q_\alpha^L(x,\mathbb{R}^k,\lambda') \] where $r_\lambda=(4\lambda)^{-1/\alpha}$ and $\lambda'=6\cdot 4^\alpha \lambda$. \end{lemma} \begin{proof} We can suppose without loss of generality that $x=0$. Take any $y\in Q_\alpha(0,V,\lambda)\cap B(0,r_\lambda)$. We want to show that \[ |P_{\mathbb{R}^{n-k}}y-LP_{\mathbb{R}^k}y|\leq \lambda'|P_{\mathbb{R}^k}y|^{1+\alpha}. \] Since $y\in Q_\alpha(0,V,\lambda)\cap B(0,r_\lambda)$ then \[ |P_{V^\perp}y|\leq \lambda |P_V y|^{1+\alpha}\leq \lambda |y|^{1+\alpha}\leq \frac14 |y| \] which implies $|P_V y|\geq |y|-|P_{V^\perp}y|\geq \tfrac34 |y|$. Using that $d(V,\mathbb{R}^k)\leq \|L\|\leq \tfrac12$ it follows that \begin{equation}\label{eq:PV1} |P_{\mathbb{R}^k}y|\geq|P_V y|-|(P_{\mathbb{R}^k}-P_V)y|\geq \frac14 |y|\geq \frac14 |P_V y|. \end{equation} On the other hand since $P_V y\in V$ we have that $P_{\mathbb{R}^{n-k}}P_V y-LP_{\mathbb{R}^k}P_V y=0$ and thus \begin{equation}\label{eq:PL} |P_{\mathbb{R}^{n-k}}y-LP_{\mathbb{R}^k}y|=|P_{\mathbb{R}^{n-k}}P_{V^\perp}y-LP_{\mathbb{R}^k}P_{V^ \perp}y|\leq (1+\|L\|)|P_{V^\perp}y|\leq \frac32 |P_{V^\perp}y|. \end{equation} Putting together \eqref{eq:PV1} and \eqref{eq:PL} we finally obtain \[ |P_{\mathbb{R}^{n-k}}y-LP_{\mathbb{R}^k}y|\leq \frac32 |P_{V^\perp}y|\leq \frac32\lambda |P_V y|^{1+\alpha}\leq 6\cdot 4^\alpha \lambda |P_{\mathbb{R}^k} y|^{1+\alpha}. \] \end{proof} \begin{lemma}[Relation between cylinders and paraboloids]\label{lemma:parabcyl} Fix $V\in G(n,k)$ and $r_0$ and suppose that for every $r<r_0$, \[\H^k(E\cap B(x,r)\setminus B(V, \lambda r^{1+\alpha}))\le \varepsilon r^k. \] Then for every $r<r_0$: \[ \H^k(E\cap B(x,r)\setminus Q_\alpha(x,V,\lambda'))\le \frac{\varepsilon}{1-2^{-k}} r^k \] where $\lambda'=4^{1+\alpha}\lambda$. \end{lemma} \begin{proof} A computation gives that for sufficiently small $r$ we have \[ \left(B(x,r)\setminus B(x,\tfrac{r}{2})\right)\setminus Q_\alpha(x,V,\lambda')\subset B(x,r)\setminus B(V, \lambda r^{1+\alpha}) \] As a consequence we obtain \begin{align*} B(x,r)\setminus Q_\alpha(x,V,\lambda')&= \bigcup_j \left(B(x,\tfrac{r}{2^j})\setminus B(x,\tfrac{r}{2^{j+1}})\right)\setminus Q_\alpha(x,V,\lambda')\\ &\subset\bigcup_j B(x,\tfrac{r}{2^j})\setminus B\left(V, \lambda \left(\tfrac{r}{2^j}\right)^{1+\alpha}\right). \end{align*} Using the assumption we obtain that \[ \H^k\left(E\cap B(x,r)\setminus Q_\alpha(x,V,\lambda')\right)\leq \sum_j \varepsilon \left(\frac{r}{2^j}\right)^k=\frac{\varepsilon}{1-2^{-k}} r^k. \] \end{proof} \subsection{Properties of \texorpdfstring{$\beta$}{beta} numbers} We provide two lemmas regarding $\beta$ numbers. The first allows to control the values of $\beta(x,r)$ at smaller scales with those at bigger scales. The second shows that it is equivalent to require the summability of $\beta(x,r)$ along a geometric sequence of radii or its integrabiity in $\tfrac{dr}{r}$ near the origin. \begin{lemma}\label{lemma:growth} For any $t\in (0,1)$ \[ \beta_2(x,t r)^2\leq \frac{1}{t^{k+2}}\beta_2(x,r)^2 \] \end{lemma} \begin{proof} We consider a $k$-plane $V_{x,r}$ that realizes the infimum for $\beta_2(x,r)$ in \eqref{eq:beta} and use it as a competitor in the definition of $\beta_2(x,t r)$. Then \begin{align*} \beta_2(x,t r)^2 &\leq \frac{1}{(t r)^k}\int\limits_{E\cap B(x,t r)}\left(\frac{\mathrm{dist}(y,V_{x,r})}{t r}\right)^2 d\H^k(y)\\ & \leq \frac{1}{t^{k+2}}\frac{1}{r^k}\int\limits_{E\cap B(x,r)}\left(\frac{\mathrm{dist}(y,V_{x,r})}{r}\right)^2 d\H^k(y)\\ &=\frac{1}{t^{k+2}}\beta_2(x,r)^2. \end{align*} \end{proof} \begin{lemma}\label{lemma:fubini} Fix $0<\rho<1$. Given $r_0\in(\rho,1]$ define $r_j=r_0 \rho^j$. \begin{itemize} \item[(i)] If for some $r_0$ we have $\sum_{j=0}^\infty \beta_2(x,r_j)^2<\infty$ then $\int_0^1 \beta_2(x,r)^2\frac{dr}{r}<\infty $. \item[(ii)] Conversely, if $\int_0^1 \beta_2(x,r)^2\frac{dr}{r}<\infty$ then for every choice of $r_0$ in $(\rho,1]$ we have $ \sum_{j=0}^\infty \beta_2(x,r_j)^2<\infty$. \end{itemize} \end{lemma} \begin{proof} By Fubini and the change of variables $r=r_0\rho^j$ \begin{align*} \int_\rho^1 \left(\sum_{j=0}^\infty \beta_2(x,r_0\rho^j)^2\right)dr_0 &=\sum_{j=0}^\infty \int_\rho^1\beta_2(x,r_0\rho^j)^2dr_0\\ & =\sum_{j=0}^\infty \int_{\rho^{j+1}}^{\rho^j} \beta_2(x,r)^2\frac{1}{\rho^j}dr\\ & = \int_0^1 \beta_2(x,r)^2\underbrace{\left(\sum_{j=0}^\infty \frac{1}{\rho^j}\mathbbm{1}_{[\rho^{j+1},\rho^j)}(r)\right)}_{g_\rho(r)}dr. \end{align*} Since $ g_\rho(r)\leq \frac{1}{r}$ we obtain that the series converges for $\H^1$-a.e. choice of $r_0$ in $(\rho,1]$, but by Lemma \ref{lemma:growth} once it converges for one choice of $r_0$ it converges for all choices, and thus we obtain $(ii)$. On the other hand we use the fact that for any $t\in (0,1)$ $\beta_2(x,tr)^2\leq \frac{1}{t^{k+2}}\beta_2(x,r)^2$ and that $g_\rho(r)\geq\frac{\rho}{r}$ to obtain $(i)$. \end{proof} \begin{lemma}[$\beta_2$ versus $\beta_p$]\label{lemma:betap} We have the following relations: \[ \begin{cases} \beta_2(x,r)\leq 2^{2/p-1}\beta_p(x,r)^{2/p}&\text{ if $1\leq p\leq 2$}\\ \beta_2(x,r)\leq 2^{k/2}\Theta^{*k}(E,x)^{1/2-1/p}\beta_p(x,r) \text{ for $r$ sufficiently small}& \text{ if $2\leq p\leq \infty$} \end{cases}. \] \end{lemma} \begin{proof} The first case follows from the fact that $\mathrm{dist}(y,V_{x,r})\leq 2r$ if $y\in E\cap B(x,r)$ and $V_{x,r}$ is the minimizer for $\beta_p(x,r)$. The second follows from H\"{o}lder inequality: if $2\leq p<\infty$ and $V_{x,r}$ is a minimizer for $\beta_p(x,r)$ then \begin{align*} \beta_2(x,r)^2& \leq\frac{1}{r^k}\int_{E\cap B(x,r)}\left(\frac{\mathrm{dist}(y,V_{x,r})}{r}\right)^2d\H^k(y)\\ & \leq \left(\frac{1}{r^k}\int_{E\cap B(x,r)} \left(\frac{\mathrm{dist}(y,V_{x,r})}{r}\right)^pd\H^k(y)\right)^{2/p}\left(\frac{1}{r^k}\H^k\big(E\cap B(x,r)\big)\right)^{1-2/p} \end{align*} and the conclusion follows. The case $p=\infty$ is treated in a similar fashion. \end{proof} \subsection{Whitney's extension theorem} In the following we will need a Whitney-type extension theorem. We quote a version that can be found in Stein's book \cite[VI.2.3, Theorem~4]{Stein}, which in the particular case of $C^{1,\alpha}$ extensions reduces to the following simplified statement: \begin{theorem}[$C^{1,\alpha}$ extension]\label{Lemma:Whitney} Consider any subset $F\subset\mathbb{R}^k$ and a function $f:F\to \mathbb{R}^d$. Then the following are equivalent: \begin{itemize} \item[(a)] $f$ admits a bounded $C^{1,\alpha}$ extension $\tilde f:\mathbb{R}^k\to \mathbb{R}^d$ with bounded derivatives; \item[(b)] there exist $M>0$ and for every $x\in F$ linear maps $L_x:\mathbb{R}^k\to\mathbb{R}^d$ such that for every $x,y\in F$ \begin{itemize} \item[(i)] $|f(x)-f(y)-L_x(y-x)|\leq M|x-y|^{1+\alpha}$; \item[(ii)] $\|L_x-L_y\|\leq M|x-y|^\alpha$; \item[(iii)] $|f(x)|,\|L_x\|\leq M$. \end{itemize} \end{itemize} \end{theorem} \section{Fixed planes} In this section we prove Theorem \ref{thm:C1alpharectifgen} and Proposition \ref{prop:converse}. We start from the latter. \begin{proof}[Proof of Proposition \ref{prop:converse}] Let $E$ be $C^{1,\alpha}$ rectifiable, thus $\H^k\left(E\setminus \bigcup_{i\in \mathbb{N}}\Gamma_i\right)=0$ with $\Gamma_i$ graphs of $C^{1,\alpha}$ maps. In particular $E$ is $\H^k$ rectifiable and for $\H^k$-a.e. $x\in E$ there exists a tangent plane $V_x$ and $\Theta^k(E,x)=1$ . By locality properties of the density, for $\H^k$-a.e. $x\in E_i:=E\cap \Gamma_i$ we have $\Theta^k(E_i,x)=1$ and thus \begin{equation}\label{eq:E_i} \Theta^k(E\setminus E_i,x)=0 \text{ for $\H^k$-a.e. $x\in E_i$.} \end{equation} Now by Lemma \ref{lemma:parabequiv} and Lemma \ref{Lemma:Whitney}, for some $\lambda>0$ we have that $E_i\cap B(x,r)\setminus Q_\alpha(x,V_x,\lambda)=\emptyset$ for every $x\in E_i$ if $r$ is sufficiently small. Putting together the latter fact and \eqref{eq:E_i} we conclude. \end{proof} We now pass to the proof of Theorem \ref{thm:C1alpharectifgen}. We will prove the following more quantitative result, from which Theorem \ref{thm:C1alpharectifgen} will directly follow. \begin{proposition}[Quantitative statement]\label{thm:C1alpharectifquant} Fix $k\in\{1,\ldots,n-1\}$ and $0<\alpha\leq 1$. Fix moreover $r_0,\lambda,\delta,M>0$ and consider $F'\subseteq F\subseteq \mathbb{R}^n$ such that for every $x\in F$ \begin{equation}\label{eq:upper} \H^k(F\cap B(x,r))\leq Mr^k\quad\text{for every $0<r\leq r_0$}. \end{equation} Suppose moreover that for every $x\in F'$ \begin{equation}\label{eq:ldparab} \H^k(F\cap B(x,r))\geq\delta r^k \quad\text{for every $0<r\leq r_0$} \end{equation} and there exists a $k$-plane $V_x\in G(n,k)$ such that \begin{equation}\label{eq:parabhypquant} \H^k(F\cap B(x,r)\setminus Q_\alpha(x,V_x,\lambda))\leq \varepsilon r^k \end{equation} with $\varepsilon< \frac{1}{4^k+1}\delta$. If $\mathrm{diam}(F')\leq r_1=(4\lambda(2+4^{1+\alpha})+8C)^{-1/\alpha}$ then $F'$ can be covered by one $k$-dimensional graph of a $C^{1,\alpha}$ map, where $C=C(n,\delta,M,\lambda)$ is the constant of Lemma \ref{lemma:key}(ii). \end{proposition} A version of the above for the case of rotating planes is also true: \begin{proposition}[Quantitative statement for rotating planes]\label{thm:C1alpharectifCylindersquant} Fix $k\in\{1,\ldots,n-1\}$ and $0<\alpha\leq 1$. Fix moreover $r_0,\lambda,\delta,M>0$ and consider $F'\subseteq F\subseteq \mathbb{R}^n$ such that for every $x\in F$ and for every $0<r<r_0$ we have \begin{equation}\label{eq:upperCyl} \H^k(F\cap B(x,r))\leq Mr^k. \end{equation} Suppose moreover that for every $x\in F'$ and for every $0<r<r_0$ we have \begin{equation}\label{eq:ldparabCyl} \H^k(F\cap B(x,r))\geq\delta r^k, \end{equation} and there exists a $k$-plane $V_{x,r}$ such that \begin{equation}\label{eq:parabhypCyl} \H^k(F\cap B(x,r)\setminus B(V_{x,r}, \lambda r^{1+\alpha}))\leq \varepsilon r^k \end{equation} with $\varepsilon< \frac{1-2^{-k}}{4^k+1}\delta$. If $\mathrm{diam}(F')\leq r_1=(4\lambda(2+4^{1+\alpha})+8C)^{-1/\alpha}$ then $F'$ can be covered by one $k$-dimensional graph of a $C^{1,\alpha}$ map, where $C=C(n,\delta,M,\lambda)$ is the constant of Lemma \ref{lemma:key}(ii). \end{proposition} We start with a geometric lemma used to cover the totality of a set with the graph of a $C^{1,\alpha}$ map. It is a geometric version of Whitney's extension theorem. \begin{lemma}[Geometric lemma]\label{lemma:geom} Fix $\lambda,C>0$ and consider a set $E\subset \mathbb{R}^n$ with $\mathrm{diam}(E)\leq \min\{(4C)^{-1/\alpha},(4\lambda)^{-1/\alpha}\}$ such that for every $x\in E$ there exists a $k$-plane $V_x$ such that \[ E\setminus Q_\alpha(x,V_x,\lambda)=\emptyset \] and moreover $d(V_x,V_y)\le C|x-y|^\alpha$ for every $x,y\in E$. Then $E$ can be covered by one $C^{1,\alpha}$ $k$-dimensional graph. \end{lemma} \begin{proof} Thanks to the assumption on $\mathrm{diam}(E)$, for any fixed $x_0\in E$ we have that $d(V_{x_0},V_x)\leq C|x-x_0|^\alpha\leq \tfrac14$, hence $V_x$ can be parametrized as a graph of a linear map $L_x$ over $V_{x_0}$ with $\|L_x\|\leq\tfrac12$ by \eqref{eq:distequiv}. We now assume without loss of generality that $V_{x_0}=\mathbb{R}^k$. By Lemma \ref{lemma:parabequiv} for every $x\in E$ \begin{equation}\label{eq:EQalpha} E\setminus Q_\alpha^{L_x}(x,\mathbb{R}^k,6\cdot 4^\alpha\lambda)=\emptyset, \end{equation} We can thus apply Whitney's extension theorem given by Lemma \ref{Lemma:Whitney}: clearly \eqref{eq:EQalpha} implies that $E$ is a graph of a function $f:\mathbb{R}^k\to \mathbb{R}^{n-k} $ since the projection $P_{\mathbb{R}^k}$ is injective on $E$. Assumption $(iii)$ is trivially satisfied. Assumption $(i)$ follows from \eqref{eq:EQalpha} and the definition of slanted paraboloids \eqref{eq:alphaparabL}, while $(ii)$ holds by assumption. \end{proof} The following is the key lemma where we essentially prove that the H\"{o}lder continuity of the tangent planes is a consequence of the paraboloid condition \eqref{eq:parabhyp} together with the positive lower density and the finite upper density. \begin{remark} In the statement and in the proof below, given a point $x$ and parameters $r,\lambda>0$ and an affine $k$-plane $V_x$ we use the simplified notation $C_\alpha^r(x)$ to denote $B(V_x, \lambda r^{1+\alpha})$, where $\lambda>0$ is fixed. \end{remark} \begin{lemma}\label{lemma:key} Consider a set $F\subset\mathbb{R}^n$ and fix $M,\lambda,\delta, r>0$. Suppose that for every $z\in F$ and for every $0<s\leq 5r$ we have \begin{equation}\label{eq:upperhyp} \H^k(F\cap B(z,s))\leq Ms^k. \end{equation} Consider any two points $x,y$ such that $|x-y|\leq r$ and two $k$-planes $V_x,V_y\in A(n,k)$ satisfying \begin{equation}\label{eq:lowerbound} \begin{cases} \H^k(F\cap B(x, r))\geq \delta r^k\\ \H^k(F\cap B(y, r))\geq \delta r^k \end{cases} \end{equation} and \begin{equation}\label{eq:upperbound} \begin{cases} \H^k(F\cap B(x, 2r)\setminus C_\alpha^{ r}(x))\leq \varepsilon r^k\\ \H^k(F\cap B(y, 2r)\setminus C_\alpha^{ r}(y))\leq \varepsilon r^k \end{cases} \end{equation} where $\varepsilon \le \tfrac{\delta}{4}$. Then: \begin{enumerate} \item[(i)] $$\H^k\left(F\cap C_\alpha^r(x)\cap C_\alpha^r(y)\cap B(x,r)\right)\ge \tfrac{\delta}{2}r^k$$ and in particular $B(x,r)\cap C_\alpha^{r}(x)\cap C_\alpha^{r}(y)\neq \emptyset$. \item[(ii)] $$d(V_x,V_y)\leq C(n,\delta,M,\lambda) r^\alpha$$ where $C(n,\delta,M,\lambda)=\frac{20^{n+1}2n M\lambda}{\delta\omega_n}$. \end{enumerate} \end{lemma} \begin{proof} $(i)$ Let us define $A=F\cap C_\alpha^r(x)\cap B(x,r)$. From assumptions \eqref{eq:lowerbound} and \eqref{eq:upperbound} we have that $\H^k(A)\geq (\delta-\varepsilon)r^k$. Moreover since \[A\setminus C_\alpha^r(y)\subseteq F\cap B(y,2r)\setminus C_\alpha^r(y) \] from assumption \eqref{eq:upperbound} it follows that $\H^k(A\setminus C_\alpha^r(y))\leq \varepsilon r^k$. Therefore we obtain \[ (\delta-\varepsilon)r^k\leq \H^k(A)=\H^k(A\cap C_\alpha^r(y))+\H^k(A\setminus C_\alpha^r(y))\leq \H^k(A\cap C_\alpha^r(y)) + \varepsilon r^k. \] This implies \[ \H^k(A\cap C_\alpha^r(y))\geq (\delta -2\varepsilon)r^k\geq \frac{\delta}{2}r^k, \] which concludes. $(ii)$ We set $C=C(n,\delta,M,\lambda)$ for simplicity. Suppose on the contrary that $\theta:=d(V_x, V_y)>Cr^\alpha$. We first claim that there exists an affine $(k-1)$-plane $W$ such that \begin{equation}\label{eq:cylinderW} C_\alpha^{r}(x)\cap C_\alpha^{r}(y)\subset W(4n\lambda r^{1+\alpha}/\theta). \end{equation} If $V_x$ and $V_y$ intersect then the conclusion follows directly from Lemma \ref{lemma:tube}. If on the other hand they do not intersect we consider two points $\tilde x\in V_x,\tilde y\in V_y$ realizing the minimum distance, i.e. such that $\Delta=|\tilde x-\tilde y|=\inf\{|x'-y'|:x'\in V_x, y' \in V_y\}$. Then $\tilde x-\tilde y\perp V_x,V_y$ and we translate both $V_x$ and $V_y$ in direction $\tilde x-\tilde y$ obtaining two $k$-planes $\tilde V_x$ and $\tilde V_y$ both containing the midpoint $\tfrac{\tilde x+\tilde y}{2}$. Since by point $(i)$ $C_\alpha^r(x)\cap C_\alpha^r(y)\neq \emptyset$ we necessarily have $\Delta\leq 2\lambda r^{1+\alpha} $ and therefore $C_\alpha^{r}(x)=B(V_x, \lambda r^{1+\alpha}) \subseteq B(\tilde V_x,2\lambda r^{1+\alpha})$ and similarly for $y$. In conclusion we obtain \[B(V_x, \lambda r^{1+\alpha})\cap B(V_y, \lambda r^{1+\alpha})\subseteq B(\tilde V_x,2\lambda r^{1+\alpha})\cap B(\tilde V_y,2\lambda r^{1+\alpha}) \] where $\tilde V_x$ and $\tilde V_y$ now intersect and we conclude again by Lemma \ref{lemma:tube}. Define now $\eta:=4n\lambda r^{1+\alpha}/\theta$ and $F_\eta:=F\cap B(x,r)\cap B(W, \eta)$. First of all we can assume that $\eta\leq r$, for otherwise we obtain \[ \frac{4n\lambda r^{1+\alpha}}{\theta}>r\implies \theta <4n\lambda r^{\alpha} \] which contradicts the assumption we made that $\theta >Cr^\alpha$. We now claim that \begin{equation}\label{eq:claim} \H^k(F_\eta)< \frac{20^{n+1}nM\lambda}{C\omega_n}r^k. \end{equation} Indeed $F_\eta\subseteq \bigcup_{x\in F_\eta} B(x,\eta)$ and by Vitali Covering Theorem we extract a disjoint finite subfamily $\big(B(x_i,\eta)\big)_{i=1}^N$ such that \[ F_\eta\subseteq \bigcup_{i=1}^N B(x_i,5\eta). \] Then on one hand from the uniform upper density assumption \eqref{eq:upperhyp} we have \begin{equation}\label{eq:Hkbound} \H^k(F_\eta)\leq \sum_{i=1}^N \H^k(F_\eta\cap B(x_i,5\eta))\leq N 5^kM\eta^k. \end{equation} On the other hand we can bound $N$ from above: indeed \[ \bigcup_{i=1}^N B(x_i,\eta)\subseteq W(2\eta)\cap B(x,r+\eta)\subseteq W(2\eta)\cap B(x,2r). \] and therefore since the balls are disjoint \[ N \L^n(B(x,\eta))\leq \L^n(W(2\eta)\cap B(x,3r))\leq (4r)^{k-1}(4\eta)^{n-k+1} \] which implies \begin{equation}\label{eq:Nbound} N\leq \frac{4^n}{\omega_n}\left(\frac{r}{\eta}\right)^{k-1}. \end{equation} Putting together \eqref{eq:Hkbound}, \eqref{eq:Nbound}, the definition of $\eta$ and the assumption that $\theta>Cr^\alpha$ we obtain \begin{align*} \H^k(F_\eta)&\leq N 5^k M\eta^k\leq \frac{4^n}{\omega_n}\left(\frac{r}{\eta}\right)^{k-1} 5^k M\eta^k= \frac{4^n 5^k M}{\omega_n}r^k\frac{\eta}{r}\\ &=\frac{4^n 5^k M }{\omega_n}r^k 4n\lambda\frac{r^\alpha}{\theta}<\frac{4^{n+1} 5^k Mn\lambda }{C \omega_n}r^k\leq \frac{20^{n+1} Mn\lambda}{C\omega_n}r^k \end{align*} which is claim \eqref{eq:claim}. On the other hand by point $(i)$ and \eqref{eq:cylinderW} we have the lower bound $\H^k(F_\eta)\geq \frac{\delta}{2}r^k$ which together with the previous upper bound implies \[ \frac{\delta}{2}r^k\leq \H^k(F_\eta)< \frac{20^{n+1} n M\lambda}{C\omega_n} r^k \] which is a contradiction by the definition of $C$. \end{proof} \begin{remark} We will apply the above lemma twice: the first time with $r=|x-y|$ to obtain the H\"{o}lder continuity of the planes in the proof of Theorem \ref{thm:C1alpharectifgen} and Proposition \ref{thm:C1alpharectifquant}. The second time in the proof of Theorem \ref{thm:C1alpharot} and Proposition \ref{thm:C1alpharectifCylindersquant} with $x=y$ to obtain the rate of tilting of $V_{x,r}$ from one scale $r_j$ to the smaller one $r_{j+1}$ in the case of the rotating planes, and to conclude that the planes stabilize. As a consequence $\H^k$-a.e. point has an approximate tangent paraboloid as per \eqref{eq:parabhyp} and we can conclude by applying Theorem \ref{thm:C1alpharectifgen}. \end{remark} The following is an elementary lemma used in the proof of Proposition \ref{thm:C1alpharectifquant} and Proposition \ref{thm:C1alpharectifCylindersquant}. \begin{lemma}\label{Lemma:Elem} Fix $\lambda>0$ and $\alpha\in (0, 1]$. Let $a,b, w \ge 0$. Suppose that \[ a^2+b^2=w^2,\quad a\ge \lambda b^{1+\alpha} \quad\text{ and }\quad a\le \frac{1}{\lambda^{1/\alpha}}. \] Then $a\ge \frac{\lambda}{2}w^{1+\alpha}$. \end{lemma} \begin{proof} Using the hypotheses we obtain that \[ w^2\le a^2+\lambda^{-\frac{2}{1+\alpha}}a^{\frac{2}{1+\alpha}} =a^{\frac{2}{1+\alpha}}\left(a^{\frac{2\alpha}{1+\alpha}}+\lambda^{-\frac{2}{1+\alpha}}\right) \le a^{\frac{2}{1+\alpha}}2\lambda^{-\frac{2}{1+\alpha}}. \] Hence we have that \[ a\ge \frac{\lambda}{2^{(1+\alpha)/2}}w^{1+\alpha}\geq \frac{\lambda}{2}w^{1+\alpha}. \] \end{proof} \subsection{Proof of Proposition \ref{thm:C1alpharectifquant}} We put together Lemma \ref{lemma:key} and Lemma \ref{lemma:geom} to obtain the proof of Proposition \ref{thm:C1alpharectifquant}. The estimate \eqref{eq:ball} below is similar to the conclusion of \cite[Lemma~3.6]{AnzSer}, but since in our case the proof is a short application of Lemma \ref{Lemma:Elem} we write down the details. \begin{proof}[Proof of Proposition \ref{thm:C1alpharectifquant}] Since \[ B(x,r)\cap Q_\alpha(x,V_x,\lambda)\subset C_\alpha^r(x) \] we also have that $\H^k(F\cap B(x,r)\setminus C_\alpha^r(x))\leq\varepsilon r^k$ whenever \eqref{eq:parabhypquant} holds. For any pair of points $x,y\in F'$ we apply Lemma \ref{lemma:key} with $r=|x-y|$ to obtain that the map $x\mapsto V_x$ is $\alpha$-H\"{o}lder when restricted to $F'$, that is \[ d(V_x,V_y)\leq C|x-y|^\alpha \quad\text{for every $x,y\in F'$} \] where $C=C(n,\delta,M,\lambda)$ is the constant of Lemma \ref{lemma:key}. Observe that $|x-y|\leq \mathrm{diam}(F')\leq r_1\leq \tfrac{r_0}{5}$ so that in Lemma \ref{lemma:key} assumption \eqref{eq:upperhyp} holds. We now claim that for a sufficiently large $\lambda'>\lambda$ (to be chosen later) we have the stronger condition $F'\setminus Q_\alpha(x,V_x,\lambda')=\emptyset$. Indeed suppose by contradiction there are $x,y\in F'$ such that $y\in F'\setminus Q_\alpha(x,V_x,\lambda')$, and set $r=2|x-y|$. We claim that (see Figure \ref{fig:disjoint}) \begin{equation}\label{eq:ball} B(y,\tfrac{r}{4})\cap C_\alpha^{r/4} (y)\subset B(x,r)\setminus Q_\alpha(x,V_x,\lambda). \end{equation} Indeed, using Lemma \ref{Lemma:Elem} with $w=|y-x|$, $a=|P_{V_x}(y-x)|$, $b=|P_{V_x^\perp}(y-x)|$ we have that for every $z\in C_\alpha^{r/4}(y)$ \begin{align*} |P_{V_x^\perp}(z-x)|&=|P_{V_x^\perp}(y-x)+P_{V_y^\perp}(z-y)+(P_{V_x^\perp}-P_{V_y^\perp})(z-y)|\\ & \geq |P_{V_x^\perp}(y-x)|-|P_{V_y^\perp}(z-y)|-|(P_{V_x^\perp}-P_{V_y^\perp})(z-y)|\\ & \geq \frac{\lambda'}{2}|x-y|^{1+\alpha}-\lambda |P_{V_y}(z-y)|^{1+\alpha}-C|x-y|^\alpha |z-y|\\ & \geq \frac{\lambda'}{2} \left(\frac{r}{2}\right)^{1+\alpha}-\lambda \left(\frac{r}{4}\right)^{1+\alpha}-2C\left(\frac{r}{4}\right)^{1+\alpha}\\ & > \lambda r^{1+\alpha}\geq \lambda|P_{V_x}(z-x)|^{1+\alpha} \end{align*} where we have chosen $\lambda'=2C+(1+4^{1+\alpha})\lambda> \frac{2C+(1+4^{1+\alpha})\lambda}{2^\alpha}$. Thus we deduce \eqref{eq:ball} and hence obtain that \[ (\delta-\varepsilon) \left(\frac{r}{4}\right)^k\leq \H^k(F\cap B(y,\tfrac{r}{4})\cap C_\alpha^{r/4}(y))\leq\H^k(F\cap B(x,r)\setminus Q_\alpha(x,V_x,\lambda))\leq \varepsilon r^k \] which is a contradiction since $\varepsilon<\tfrac{1}{4^k+1}\delta$. We have thus proved that \[F'\setminus Q_\alpha(x,V_x,\lambda')=\emptyset \quad\text{ for every $x\in F'$.}\] We can thus apply Lemma \ref{lemma:geom} to the set $F'$ to obtain the desired conclusion. \end{proof} \begin{figure} \centering \begin{tikzpicture}[scale=3] \draw[fill] (0,0) circle [radius=0.01] node[below] {$x$}; \draw[fill] (0.455,0.207) circle [radius=0.01] node[below] {$y$} ; \draw (0,0) circle [radius=1]; \node[below] at (0,-1) {$B(x,r)$}; \draw (-1.3,0)--(1.3,0) node[right] {$V_x$}; \draw (0.455,0.207) circle [radius=0.25]; \begin{scope}[shift={(0.455,0.207)},rotate=-10] \draw (0.3,0) -- (-0.3,0) node[left] {$V_y$}; \end{scope} \begin{scope}[shift={(0.455,0.207)},rotate=-10] \clip (0,0) circle [radius=0.25]; \draw (-1,0) -- (1,0); \draw (-1,-0.05) rectangle (1,0.05); \fill[gray,opacity=0.2] (-1,-0.05) rectangle (1,0.05); \end{scope} \node[above left] at (-1,0) {$Q_\alpha(x,V_x,\lambda)$}; \node[above] at (-1.2,0.5) {$Q_\alpha(x,V_x,\lambda')$}; \draw[dashed] (0.55,0.22) -- (1.3,0.8) node[right] {$B(y,\tfrac{r}{4})\cap C_\alpha^{r/4}(y)$}; \begin{scope} \clip (0,0) circle [radius=1.1]; \draw [smooth,samples=100,domain=-1.2:1.2] plot(\x,{\x*\x}); \draw [smooth,samples=100,domain=-1.2:1.2] plot(\x,{-\x*\x}); \draw [smooth,samples=100,domain=-1.2:1.2] plot(\x,{0.2*\x*\x}); \draw [smooth,samples=100,domain=-1.2:1.2] plot(\x,{-0.2*\x*\x}); \fill [gray,opacity=0.2, domain=-1.2:1.2, variable=\x] (-1.2, 0) -- plot ({\x}, {0.2*\x*\x}) -- (1.2, 0) -- cycle; \fill [gray,opacity=0.2, domain=-1.2:1.2, variable=\x] (-1.2, 0) -- plot ({\x}, {-0.2*\x*\x}) -- (1.2, 0) -- cycle; \end{scope} \end{tikzpicture} \caption{Reference for the proof of Proposition \ref{thm:C1alpharectifquant}.}\label{fig:disjoint} \end{figure} \subsection{Proof of Theorem \ref{thm:C1alpharectifgen}} As a consequence of a standard decomposition argument and Proposition \ref{thm:C1alpharectifquant} we finally obtain the first main result. \begin{proof}[Proof of Theorem \ref{thm:C1alpharectifgen}] Observe that by Theorem \ref{thm:rectifgen} we obtain that the set $E$ is $\H^k$-rectifiable. Therefore for $\H^k$-a.e. $x\in E$ it holds that $\Theta^{k}(E,x)=1$ \cite[Theorem~16.2]{Mat95}. Let $\lambda,r_0>0$ be arbitrary but fixed and define $E_{\lambda,r_0}$ as the set of all $x\in E$ such that for every $0<r\leq r_0$ \[ \begin{cases} \H^k(E\cap B(x,r))\geq \frac12 (2r)^k\\ \H^k(E\cap B(x,r))\leq 2(2r)^k\\ \H^k(E\cap B(x,r)\setminus Q_\alpha(x,V_x,\lambda))\leq \frac{1}{8(4^k+1)} r^k \end{cases} \] Clearly $\H^k(E\setminus\bigcup_{\lambda,r_0}E_{\lambda,r_0})=0$, and moreover the union can be taken among countably many values for the parameters. Hence it suffices to show that each $E_{\lambda,r_0}$ is $C^{1,\alpha}$ rectifiable. We further decompose $E_{\lambda,r_0}$ and define \[ E_{\lambda,r_0}^t:=\{x\in E_{\lambda,r_0}: \H^k(E_{\lambda,r_0}\cap B(x,r))\geq \tfrac12 \H^k(E\cap B(x,r))\text{ for every $0<r\leq t$}\}. \] Again $\H^k\left(E_{\lambda,r_0}\setminus\bigcup_t E_{\lambda,r_0}^t\right)=0$ because by a standard density result the relative density of a subset is $1$ almost everywhere on the subset \cite[Corollary~2.14]{Mat95}, and the union can be taken among countably many values of $t$. It is thus sufficient to prove that each $E_{\lambda,r_0}^t$ is $C^{1,\alpha}$ rectifiable. Now we can directly apply Proposition \ref{thm:C1alpharectifquant} with $M=2^{k+1},\delta=2^{k-1}$ and $F'=E_{\lambda,r_0}^t$, $F=E_{\lambda,r_0}$ to obtain the conclusion. \end{proof} \section{Rotating planes} We now pass to the proof of Proposition \ref{thm:C1alpharectifCylindersquant}, Theorem \ref{thm:C1alpharot} and Corollary \ref{cor:ghi}. The idea is the following: under the assumptions of the proposition, for a fixed $x\in E$ the planes $V_{x,r}$ actually have to converge with a precise rate as $r\to 0$, so that in fact at $\H^k$-a.e. $x\in E$ estimate \eqref{eq:parabhypquant} holds for a certain $V_x$, and we can apply Proposition \ref{thm:C1alpharectifquant}. Theorem \ref{thm:C1alpharot} will follow as a consequence of Proposition \ref{thm:C1alpharectifCylindersquant}. In the following lemma we prove that under the conclusions of Lemma \ref{lemma:key} we can prove the convergence of $V_{x,r}$ to a certain $V_x$ with a precise rate $r^\alpha$. Let us fix as usual a sequence of radii $r_j=r_0\rho^j$ for some $r_0>0$ and $0<\rho<1$. For simplicity we consider the case where $x=0$. \begin{lemma}\label{lemma:rot} Consider a sequence of affine $k$-planes $V_j\in A(n,k)$ and suppose that there exist constants $\lambda,C>0$ such that for every $j\in \mathbb{N}$ \begin{equation}\label{eq:intersection} B(V_j, \lambda r_j^{1+\alpha})\cap B(V_{j+1}, \lambda r_j^{1+\alpha})\cap B(0,r_j)\neq \emptyset \end{equation} and \begin{equation}\label{eq:thetabound} \theta_j:=d(V_j,V_{j+1})\leq C r_j^\alpha. \end{equation} Then there exists a linear $k$-plane $V_\infty\in G(n,k)$ such that for every $j\in \mathbb{N}$ \begin{equation}\label{eq:Vinfty} B(V_j, \lambda r_j^{1+\alpha})\cap B(0,r_j)\subseteq B(V_\infty, \lambda'' r_j^{1+\alpha}) \end{equation} where $\lambda''=\lambda+C+\frac{2\lambda+C}{1-\rho^{1+\alpha}}$. \end{lemma} \begin{figure} \centering \begin{tikzpicture}[scale=3] \draw[fill] (0,0) circle [radius=0.01] node[below] {$0$}; \begin{scope} \draw[thick] (-1,0.5) -- (1,0.5) node[right] {$V_j$}; \draw (-1,0.35) -- (1,0.35) node[below right] {$W_{j}$}; \draw[dotted] (0,0.5) -- (0.5,1) node[right] {$x_j$}; \draw[fill] (-0.7,0.35) circle [radius=0.01] node[below] {$y_j$}; \begin{scope} \clip (0,0) circle [radius=1]; \draw[<->,gray] (0,0) -- (-0.8,-0.6); \node[below] at (-0.6,-0.5) {$r_j$}; \draw[thick] (0,0) circle [radius=1]; \fill[gray,opacity=0.2] (-1,0.3) rectangle (1,0.7); \draw[dashed] (0,0) -- (0,0.5); \draw[fill] (0,0.5) circle [radius=0.01]; \end{scope} \end{scope} \begin{scope}[rotate=-8,scale=0.4] \draw[thick] (-1,0.5) -- (1,0.5) node[below right] {$V_{j+1}$}; \draw (-2.5,0.63) -- (2.5,0.63) node[below right] {$W_{j+1}$}; \draw[<->,gray] (0,0) -- (0.8,-0.6); \node[right] at (0.4,-0.3) {$r_{j+1}$}; \draw[dotted] (0,0.5) -- (-3,-0.5) node[below] {$x_{j+1}$}; \begin{scope} \clip (0,0) circle [radius=1]; \draw[thick] (0,0) circle [radius=1]; \fill[gray,opacity=0.2] (-1,0.3) rectangle (1,0.7); \draw (-1,0.5) -- (1,0.5); \draw[dashed] (0,0) -- (0,0.5); \draw[fill] (0,0.5) circle [radius=0.025]; \end{scope} \end{scope} \end{tikzpicture} \caption{Reference figure for the proof of Lemma \ref{lemma:rot}. } \label{fig:Vinfty} \end{figure} \begin{proof} $(i)$ For every $j\in \mathbb{N}$ we call $x_j$ the unique point in $ V_j$ nearest to the origin. We first claim that $|x_j-x_{j+1}|\leq (2\lambda + C)r_j^{1+\alpha}$. Fix $j\in \mathbb{N}$. By \eqref{eq:intersection} we can find two affine $k$-planes $W_j=\tau_j+V_j$ and $W_{j+1}=\tau_{j+1}+V_{j+1}$ such that $W_j\cap W_{j+1}\cap B(0,r_j)\neq \emptyset$, where $|\tau_j|,|\tau_{j+1}|\leq \lambda r_j^{1+\alpha}$. Let $x'_j\in W_j$ and $ x'_{j+1}\in W_{j+1}$ be the respective points of minimum distance from the origin. Then $|x'_j-x_j|\leq \lambda r_j^{1+\alpha}$ and $| x'_{j+1}-x_{j+1}|\leq \lambda r_j^{1+\alpha}$. Let also $y_j$ be any point in $W_j\cap W_{j+1}\cap B(0,r_j)$, so that $\tilde V_j:=W_j-y_j$ and $\tilde V_{j+1}:=W_{j+1}-y_j$ are $k$-planes containing the origin, and the projections $P_{\tilde V_j}$ and $P_{\tilde V_{j+1}}$ are linear maps. Then we obtain \begin{align*} |x'_j- x'_{j+1}|&=|( x'_j-y_j)-(x'_{j+1}-y_j)|=|P_{\tilde V_j}(-y_j)-P_{\tilde V_{j+1}}(-y_j)|\\ &=|(P_{\tilde V_j}-P_{\tilde V_{j+1}})(-y_j)|\leq C r_j^{1+\alpha} \end{align*} and thus \[ |x_j-x_{j+1}|\leq 2\lambda r_j^{1+\alpha}+|\tilde x_j-\tilde x_{j+1}|\leq (2\lambda + C)r_j^{1+\alpha} \] so that the claim is proved. In particular, since the points $x_j$ are converging to the origin, we obtain \begin{equation}\label{eq:xj} |x_j|\leq \sum_{j=i}^\infty |x_i-x_{i+1}|\leq \sum_{i=j}^\infty (2\lambda+ C)r_i^{1+\alpha}= (2\lambda+ C)\frac{r_j^{1+\alpha}}{1-\rho^{1+\alpha}}. \end{equation} Finally we prove \eqref{eq:Vinfty}. Given any $z\in B(V_j,\lambda r_j^{1+\alpha})$, by triangle inequality and using \eqref{eq:intersection}, \eqref{eq:thetabound} and \eqref{eq:xj} we have that \begin{align*} |P_{V_\infty^\perp}z|&\leq|P_{V_j^\perp}(z-x_j)|+|(P_{V_\infty^\perp}-P_{V_j^\perp})(z-x_j)|+|P_{V_\infty^\perp}(x_j)|\\ &\leq \lambda |P_{V_j}(z-x_j)|^{1+\alpha}+Cr_j^{\alpha}|z-x_j|+|x_j|\\ &\leq \left(\lambda+C+\frac{2\lambda +C}{1-\rho^{1+\alpha}}\right) r_j^{1+\alpha}. \end{align*} \end{proof} \subsection{Proof of Proposition \ref{thm:C1alpharectifCylindersquant} and Theorem \ref{thm:C1alpharot}} \begin{proof}[Proof of Proposition \ref{thm:C1alpharectifCylindersquant}] We essentially want to replace (\ref{eq:parabhypCyl}) with an approximate paraboloid estimate that allows us to pass to Proposition \ref{thm:C1alpharectifquant}.\\[3pt] Let $x\in F'$. Taking $y=x$ in Lemma \ref{lemma:key} and $V_x=V_j:=V_{x,r_j}$, $V_y=V_{j+1}:=V_{x,r_{j+1}}$ and $r=r_{j+1}$, we obtain the conditions (\ref{eq:intersection}) and (\ref{eq:thetabound}) of Lemma \ref{lemma:rot} and hence an affine $k$-plane $V_{x,\infty}$ such that \[ B(V_j, \lambda r_j^{1+\alpha})\cap B(x,r_j)\subseteq B(V_{x,\infty}, \lambda'' r_j^{1+\alpha}), \] where $\lambda''=\lambda+C+\frac{2\lambda+C}{1-\rho^{1+\alpha}}$ (as in Lemma \ref{lemma:rot}). By Lemma \ref{lemma:parabcyl} it follows that \begin{equation*} \H^k(F\cap B(x,r)\setminus Q_\alpha(x,V_{x,\infty},4^{1+\alpha}\lambda''))\leq \frac\varepsilon{1-2^{-k}} r^k. \end{equation*} This reduces to the setting of Proposition \ref{thm:C1alpharectifquant} and hence the result follows. \end{proof} \begin{proof}[Proof of Theorem \ref{thm:C1alpharot}] Since $\H^k(E)<\infty$ by \eqref{eq:Mat6.2} for $\H^k$-a.e. point $x\in E$ we have $\Theta^{*k}(E,x)\leq 1$. Given $r_0,\delta,\lambda>0$, let $E_{r_0,\lambda,\delta}$ denote the set of points in $E$ such that for every $0<r<r_0$ the following conditions hold: \[ \begin{cases} \H^k(E\cap B(x,r))\leq 2(2r)^k.\\ \H^k(E\cap B(x,r))\geq\delta (2r)^k\\ \H^k(E\cap B(x,r)\setminus B(V_{x,r},\lambda r^{1+\alpha}))\leq \frac{1}{4(4^k+1)} \delta r^k \end{cases}. \] Then clearly, $\H^k(E\setminus \bigcup_{r_0,\lambda,\delta}E_{r_0,\lambda,\delta})=0$ and the union can be taken among countably many positive values for all the parameters, hence it is enough to establish claim for each of the sets $E_{r_0,\lambda,\delta}$. We further decompose the sets: for any $t>0$ define $E_{r_0,\lambda,\delta}^t$ as the set of those points $x\in E_{r_0,\lambda,\delta}$ such that \[ \H^k(E_{r_0,\lambda,\delta}\cap B(x,r))\geq \tfrac12 \H^k(E\cap B(x,r)) \text{ for every $0<r\leq t$}. \] As in the proof of Theorem \ref{thm:C1alpharectifgen} it is sufficient to conclude that $E_{r_0,\lambda,\delta}^t$ is $C^{1,\alpha}$ rectifiable, but this reduces to Proposition \ref{thm:C1alpharectifCylindersquant} applied to the sets $F'=E_{r_0,\lambda,\delta}^t$, $F=E_{r_0,\lambda,\delta}$. \end{proof} \begin{remark}\label{rmk:moduli} We briefly go through the modifications needed to obtain the more general version of Theorems \ref{thm:C1alpharectifgen} and \ref{thm:C1alpharot} stated in Remark \ref{rmk:intromoduli}. First of all Whitney's extension theorem holds for general moduli of continuity \cite[VI.4.6]{Stein}. An analogous proof of Lemma \ref{lemma:key} gives that $d(V_x,V_y)\leq C \lambda(r)\leq C\omega(r)$ whenever $|x-y|\leq r$. In particular for a fixed $x$ we have $d(V_{j},V_{j+1})\leq C\lambda(r_j)\leq C\omega(r_j)$ and thus the analogue of Theorem \ref{thm:C1alpharectifgen} follows. Regarding the case of rotating planes, a modification of Lemma \ref{lemma:rot} then gives that since $\sum_j \lambda(r_j)<\infty$ there exists a limit plane $V_\infty$ and $d(V_\infty,V_{m})\leq C\omega_m$. Finally $B(V_{j}, \lambda(r_j)r_j)\subseteq V_\infty(C\omega(r_j)r_j)$ and therefore the application of the above generalization of Theorem \ref{thm:C1alpharectifgen} gives the conclusion. \end{remark} \subsection{Proof of Corollary \ref{cor:ghi}} \begin{proof}[Proof of Corollary \ref{cor:ghi}] First observe that by Lemma \ref{lemma:betap}, for every point $x\in E$ where $\Theta^{*k}(E,x)<\infty$ and where \eqref{eq:betap} holds we have that $\beta_2(x,r)\leq C r^{\gamma}$ for some constants $C,\gamma>0$ and for all $r>0$ sufficiently small. Therefore $\int_0^1\beta_2(x,r)^2\frac{dr}{r}<\infty$ for all points where $\Theta^{*,k}(E,x)<\infty$ and where \eqref{eq:betap} holds, which is true for $\H^k$-a.e. $x\in E$. Thus we can apply Theorem \ref{thm:QuantRectifGen} to conclude that $E$ is $\H^k$-rectifiable, and in particular $\Theta_*^k(E,x)>0$ for $\H^k$-a.e. $x\in E$. Fix now $x\in E$ where $\Theta_*^k(E,x)>0$ and where \eqref{eq:betap} holds for some $p$. If $p=\infty$ we conclude immediately by Theorem \ref{thm:C1alpharot}. Suppose then $1\leq p<\infty$. For every $r>0$ consider a minimizer $V_{x,r}$ of $\beta_p(x,r)$. Then \[ \beta_p(x,r)^p \ge\frac{1}{r^{k}}\H^k\left(E\cap B(x,r)\setminus B(V_{x,r}, \lambda r^{1+\alpha})\right)(\lambda r^{\alpha})^p \] thus using \eqref{eq:betap} and taking $\lambda$ sufficiently big we obtain \begin{align*} \limsup_{r\to 0}\frac{1}{r^{k}}\H^k\left(E\cap B(x,r)\setminus B(V_{x,r}, \lambda r^{1+\alpha})\right)&\le \limsup_{r\to 0}\frac{1}{r^k}\frac{\beta_p(x,r)^p}{\lambda^p r^{p\alpha}}\\ &< (1-2^{-k})\varepsilon_0(k)\Theta_*^{k}(E,x). \end{align*} Now we conclude using Theorem \ref{thm:C1alpharot}. \end{proof} \small \bibliographystyle{alpha}
\section{Introduction} \label{introduction} While reinforcement learning has achieved success in many applications, many state-of-art methods require a large number of training samples to find a good policy. In some tasks (e.g., self-driving cars, robotic control), samples are sufficiently costly so as to render existing algorithms infeasible or impractical. One approach to overcoming this challenge, referred to as \textit{Sim-to-Real}, is to first train an agent in one or more simulated environments before deploying it in the real world. Of course, this solution presents its own challenges, owing to the fact that simulators invariably do not coincide with the real-world. Previous works on Sim-to-Real can be classified according to whether the agent does \citep{finn2017model} or does not \citep{tobin2017domain, peng2018sim, bousmalis2018using} receive feedback in the real-world. From a theoretical perspective, the goal of Sim-to-Real is to learn a real-world policy that has a smaller sample complexity than if an agent was training only on the real-world. Intuitively, this gain comes from training on the simulators (perhaps with a much larger sample complexity), together with some modelling assumptions that link the simulators and real-world. Existing theoretical studies have focused on the setting where feedback is received in the real world \citep{cutler2015real, jiang2018pac}, and where the dynamics are governed by a conventional Markov decision process (MDP). Our contribution is to develop a theoretical framework, algorithm, and analysis for Sim-to-Real {\em without} real-world feedback. Furthermore, we study a type of {\em contextual decision process} (CDP) known as a {\em rich observation MDP} (ROMDP) \citep{krishnamurthy2016pac}, which generalizes an MDP by allowing for policies to be based on a (possibly continuous valued) observation associated to an unseen state variable. We establish a real-world sample-complexity guarantee that is smaller than existing guarantees for learning a single ROMDP \citep{krishnamurthy2016pac, jiang2017contextual, sun2019model}. Our modeling assumptions and approach leverage ideas from {\em domain generalization}, reviewed below, which allow us to identify environments based on the marginal distribution of observations. \section{Related Work} \label{related work} There are two theoretical studies, to our knowledge, that formalize Sim-to-Real and give PAC-style bounds. \citet{cutler2015real} assumes a sequence of environments with levels of fidelity from low to high (the highest is the real world and the rest are simulators). There exists a transfer mapping over the states of any two simulators, which is homogeneous. Samples are more expensive in simulators with higher fidelity and switching between simulators is also costly. \citet{jiang2018pac} assumes a single simulator that differs from the real world only at a small fraction of states to get rid of the dependency of the size of action or state space. Both works consider an MDP setting, and both assume feedback is available from the real world. The idea of a CDP was first introduced by \citet{krishnamurthy2016pac} and extended by \citet{jiang2017contextual}. In general, sample-efficient learning on CDPs with uncountable observation spaces is hard. \citet{jiang2017contextual} provides a sufficient condition for a CDP to be learnable, that is, it admits a Bellman factorization with finite Bellman rank. The ROMDP, a specific type of CDP, was proposed by \citet{krishnamurthy2016pac}, and assumes hidden states with certain dynamics behind the observations. A ROMDP without further assumptions is still difficult to learn. \citet{krishnamurthy2016pac} assume the underlying dynamics are deterministic and the ROMDP is reactive. \citet{dann2018oracle} analyzed computational issues arising in \citet{krishnamurthy2016pac}'s setting via presumed oracles to particular tasks. \citet{jiang2017contextual, sun2019model} studied generalized algorithms for CDPs satisfying some conditions, which partially tighten the sample complexity upper bound in this case. On the other hand, different assumptions are proposed to study ROMDP. \citet{azizzadenesheli2016reinforcement, du2019provably} assume that there is an injective mapping from hidden states to observations, i.e., observations can be partitioned into ``clusters/blocks" where each corresponds to a single state. In our paper, we use a similar setting as \citet{krishnamurthy2016pac}, which is explained in detail in Section \ref{formal setting}. Sim-to-Real also evokes problems from batch learning that involve generalization to a new task. We highlight two such problems, domain generalization \citep{blanchard2011generalizing} and learning-to-learn or meta-learning \citep{baxter2000model}. In both problems, there are several related labeled training tasks/datasets, and the goal is to generalize to a new task. All tasks are viewed as realizations of a meta-distribution, i.e., a distribution on data-generating distributions. In learning to learn, labeled example are also available for this new task, and the objective is to leverage the training tasks to decrease the sample complexity of learning on the test task, with high probability w.r.t. the draw of the test task. In domain generalization, only unlabeled test data are available, meaning the task must be inferred from the marginal distribution of the input variables. The objective here is to minimize the expected error, where expectation is w.r.t. the draw of the test distribution. This is in contrast to the related problem of {\em domain adapation} where all distributions are considered nonrandom. Like both of these problems, our model for to Sim-to-Real assumes a distribution on learning environments, with simulators and real-world being realizations of a common distribution on environments. Our solution also leverages the idea from domain generalization that the environment can be identified from the marginal distribution on observations. \section{Problem Formulation} \label{problem formulation} Each simulator as well as the real world is modeled as a parameterized ROMDP, which is a contextual decision process with underlying hidden states and an environment parameter. All simulators and the real world share the same state space and the same state-action transitions, but differ in the observation and reward distributions, which are determined by their environment parameters. For any set $W$, we define $\Delta(W)$ to be the set of all distributions on $W$, or the set of all probability density functions on $W$, where the meaning will be clear from the context. \subsection{Formal Setting} \label{formal setting} A deterministic parameterized ROMDP is defined by a tuple $\langle \mathcal{A}, \mathcal{S}, \mathcal{X}, T, s_1, D, R, H, \theta \rangle$, where $H$ is the finite horizon of an episode, $\mathcal{A}, \mathcal{S}$ are the action space and the state space, $\mathcal{X} \subseteq \mathbb{R}^d$ is the observation space that is bounded (i.e. there exists $C_b > 0$ such that $\mathcal{X} \subseteq \mathbb{B}_{\mathbb{R}^d}(0, C_B)$), $T:\mathcal{S}\times\mathcal{A} \to \mathcal{S}$ is the Markov transition dynamic, $s_1 \in \mathcal{S}$ is the fixed initial state, $\theta$ is the environment parameter (a vector that encodes necessary information about the environment), $D_{\theta, s} \in \Delta(\mathcal{X})$ denotes the Lebesgue probability density function over observation space at state $s$, $R_\theta: \mathcal{S}\times\mathcal{X}\times\mathcal{A}\to \Delta([0,1])$ is the parameterized reward distribution. The parameter $\theta$ is drawn from a set of parameters $\Theta$. Without loss of generality, we assume the ROMDP is layered, that is, we can partition $\mathcal{S}$ into $H$ disjoint sets $\mathcal{S}_1, ..., \mathcal{S}_H$ and $\mathcal{X}$ into $H$ disjoint sets $\mathcal{X}_1, ..., \mathcal{X}_H$ such that for any $s_h \in \mathcal{S}_h$ and $a \in \mathcal{A}$, $T(s_h,a) \in \mathcal{S}_{h+1}$, and for any $s_h \in \mathcal{S}_h$ and $\theta \in \Theta$, $D_{\theta, s_h} \in \Delta(\mathcal{X}_h)$. The state space and action space are finite and we define $A = |\mathcal{A}|, S = \max_{h}|\mathcal{S}_h|$. There is no restriction on the observation space (except for the boundedness), which may be countably infinite or continuous. Only $\mathcal{A}, \mathcal{S}, \mathcal{X}$ and $H$ are assumed to be known beforehand, while $s_1, T, D, R, \theta$ are all hidden from the agent. There are two aspects of the Markov property in a ROMDP. First, the underlying state transition is Markovian as evidenced by the transition function $T$; second, the observations and the rewards are independent of the previous states and actions given the current state, observation and action as reflected in the definition of $D_{\theta,s}$ and $R_\theta$. Each episode produces a trajectory $(s_1, x_1, a_1, r_1, ..., s_H, x_H, a_H, r_H)$, where states $s_h = T(s_{h-1}, a_{h-1})$, observations $x_h \sim D_{\theta, s_h}$, rewards $r_h \sim R_\theta(s_h, x_h, a_h)$, and all actions $a_h$ are chosen by some strategy. States and parameters are not observable. For every simulator, an action $a_h$ is made based on the sequence $(x_1, a_1, r_1,..., x_{h-1}, a_{h-1}, r_{h-1}, x_h)$. However, for the real world, as there is no feedback at all, $a_h$ is made based only on $(x_1, a_1,..., x_{h-1}, a_{h-1}, x_h)$. In general, an optimal policy of a ROMDP has to memorize the past trajectory, but in this paper we will assume the ROMDP is reactive (see Section \ref{assumption}). This allows us to restrict our attention to {\em meta-policies}, which are functions $\pi:\Theta\times\mathcal{X}\to\mathcal{A}$ that maps any parameter-observation pair to an action. A meta-policy determines a policy $\pi_\theta = \pi(\theta, \cdot)$ for every environment $\theta$. Then we define the expected total reward $V_\theta(\cdot)$ for a meta-policy $\pi$ in a ROMDP with environment parameter $\theta$ via $$ \begin{array}{ccl} V_{\theta}(\pi_\theta) & := & V_{\theta}(s_1, \pi_\theta), \\ V_{\theta}(s_h, \pi_\theta) & := & \mathbb{E}_{x_h\sim D_{\theta, s_h}}[ r_\theta(s_h, x_h, \pi_\theta(x_h)) + V_\theta(T(s_h, \pi_{{\theta}}(x_h))), \pi_\theta)], \forall h<H, \\ V_\theta(s_H, \pi_\theta) & := & \mathbb{E}_{x_H\sim D_{\theta, s_H}}[r_\theta(s_H, x_H, \pi_{{\theta}}(x_H))], \end{array} $$ where $r_\theta(s, x, a):=\mathbb{E}[R_\theta(s, x, a)]$. Here $V_{\theta}(s_h, \pi_\theta)$ denotes the expected reward of the meta-policy $\pi$ starting from state $s_h$. The optimal meta-policy $\pi^*$ is defined to act optimally for any $\theta$, i.e., $\pi^*$ satisfies $$V_\theta(\pi^*_\theta) = \sup_{\pi_\theta} V_\theta(\pi_\theta), \forall \theta\in\Theta.$$ The supremum above is taken over all possible policies for environment $\theta$. Since no constraint is imposed on the relation between $\theta$ and $\pi$, such optimal meta-policy $\pi^*$ always exists by taking the combination of the best policies for every $\theta$. Since in applications there may be different real-world environments (as discussed in Section \ref{introduction}), we formulate the real world as a stochastic environment whose parameter $\theta_R$ is drawn from a prior $\mu\in\Delta(\Theta)$. Moreover, suppose there are $B$ simulators $\beta_1, ..., \beta_B$ associated with $B$ environment parameters $\theta_1, \theta_2,..., \theta_B$, respectively, which are drawn independently according to the same prior $\mu$, i.e. $\theta_R, \theta_1, \theta_2,..., \theta_B \stackrel{iid}{\sim} \mu$. All episodes in the simulator $\beta_b$ / the real world are generated with the corresponding $\theta_b$ / $\theta_R$. We use $\beta$ and $\theta$ interchangeably, like $D_\theta$ and $D_\beta$, $V_\theta$ and $V_\beta$, etc. Our goal is to learn a meta-policy that optimizes the expectation of $V_{\theta_R}$ over $\theta_R$. In other words, we want our meta-policy that performs well, in expectation, for any possible real-world environment. An alternative objective would be to perform well for a specific $\theta_R$, but this would require feedback from the real-world, or much stronger assumptions relating the real-world to the simulators. The expectation of $V_{\theta_R}$, denoted by $V$, is defined as $V(\pi) := \mathbb{E}_{\theta\sim\mu}V_\theta(\pi_\theta).$ Then the definition of $\pi^*$ directly implies that $V(\pi^*) = \sup_{\pi} V(\pi).$ Hence, we define the optimal expected total reward $V^* := V(\pi^*).$ Finally we state the problem. A learning algorithm finds a meta-policy $\hat{\pi}_{\theta_R}$ for the real wold by collecting with-feedback trajectories from the $B$ simulators and no-feedback samples from the real world. Our \textbf{goals} are i) that with probability at least $1-\delta$, the meta-policy $\hat{\pi}$ is $\epsilon$-optimal, that is, $$V^* - \mathbb{E}_{\theta_R \sim \mu}V_{\theta_R}(\hat{\pi}_{\theta_R}) \le \epsilon;$$ ii) to minimize the real-world sample complexity. \subsection{Main Assumptions} \label{assumption} Sample-efficiently learning a near-optimal policy with high probability for a general ROMDP is difficult, and all existing algorithms and PAC bounds are designed for some special cases. \citet{krishnamurthy2016pac} proposed Assumptions 1 and 2 to ensure that a ROMDP is sample-efficiently learnable. In reinforcement learning literature, the optimal $Q$-function is usually referred to as the optimal state/observation-action value function, i.e., the expected reward obtained by taking an action at a state/observation and acting optimally afterwards. In this paper we define the optimal $Q$-function as $$Q^*_{\theta, s_h}(x_h, a_h) := r_\theta(s_h, x_h, a_h) + V^*_\theta(T(s_h, a_h)).$$ A \textit{reactive} policy is a strategy that makes every decision based only on the current observation. For conventional MDPs, there always exists an optimal policy that is reactive. However, for ROMDPs, the Markov property over the action-state transitions does not necessarily imply the Markov property over the action-observation transitions, so making an optimal action requires the memory of the past trajectory. Hence, generally there is no sample-efficient algorithm that can learn a near-optimal policy with high probability from a class of reactive policies \citep[Proposition 1]{krishnamurthy2016pac}. Assumption \ref{A1} has been introduced to guarantee the existence of an optimal reactive optimal policy by assuming that the maximal expected future rewards are independent of the underlying states. \begin{assump} (\textit{Partial reactiveness}). For all $a \in \mathcal{A}, x \in \mathcal{X}, \theta \in \Theta$ and any $s, s' \in \mathcal{S}$ such that $D_{\theta, s}(x), D_{\theta, s'}(x) > 0$, $Q^*_{\theta, s}(x, a) = Q^*_{\theta, s'}(x, a)$. \label{A1} \end{assump} Given that the environment parameters are not observable, we will assume that $\theta$ is determined by the marginal distribution of the observations. A predictor $f: \Delta(\mathcal{X})^{\xi} \times \mathcal{X}\times \mathcal{A} \to [0,1]$ ($\xi$ is the total number of the states of the ROMDP, which is no larger than $HS$) takes as input an observation, an action as well as a vector of all marginal distributions of observations at all possible states, and outputs the predicted expected future reward. Generally, predictors should also take state as an argument, but Assumption \ref{A1} ensures the predictors can be independent of the states. Thus, we define the optimal predictor $f^*$, to replace the use of the optimal $Q$-function, as $f^*(D_\theta, x, a) = Q^*_\theta(x, a), \forall \theta, x, a.$ \begin{assump} (\textit{Realizability}). A class of predictors $\mathcal{F} \subseteq (\Delta(\mathcal{X})^{\xi} \times \mathcal{X}\times \mathcal{A} \to [0,1])$ of size $F = |\mathcal{F}|$ is given, and $f^* \in \mathcal{F}$. \label{A2} \end{assump} We assume that the class of predictors we choose is a good one, that is, the optimal value function $f^*$ is in this class. We make no assumption on the form of $f^*$ itself. In our main theorem (Theorem \ref{thm:main}), $F$ appears in the sample complexity for simulators but not the real world. For any $D_\beta \in \Delta(\mathcal{X})^{\xi}$, let $f_{D_\beta} = f(D_\beta, \cdot, \cdot)$. Then a policy $\pi^f_{D_\beta}(x)$ is naturally induced by $D_\beta$ and $f$, that is, $\pi^f_{D_\beta}(x) = \arg\max_a f_{D_\beta}(x, a).$ We also use $\pi^f_{D}(x)$ to denote the combination of all the policies above for all simulators, i.e., $\pi^f_{D}(x)$ maps $\beta$ to $\pi^f_{D_\beta}$. \bigskip The following notation is used to state Assumption \ref{A3}. Suppose $ l = (l_1, ... , l_d)$ is a non-zero vector and $l_1, ... , l_d$ are non-negative integers. Define the 1-norm $|l|$ of $l$ by $|l| := l_1+ \cdot\cdot\cdot +l_d$ and the partial derivative $f^{(l)}$ of any function $f: \mathbb{R}^d \to \mathbb{R}$ by $f^{(l)} := \frac{\partial^{|l|}}{\partial^{l_1} \cdot\cdot\cdot \partial^{l_d}} f.$ \begin{assump} (\textit{H\"older continuous density}). $D$ is uniformly $\alpha$-H\"older continuous, i.e., there exist $\alpha > 1, C_\alpha$ such that $|D^{(l)}_{\theta, s}(x) - D^{(l)}_{\theta, s}(x')| \le C_\alpha \|x- x'\|^{\alpha-|l|}$ for all $x, x' \in \mathcal{X}, s\in\mathcal{S}, \theta \in \Theta$ and any vector $l$ such that $|l| = \lceil \alpha \rceil - 1$. \label{A3} \end{assump} Assumption \ref{A3} ensures certain convergence properties of a kernel density estimate of the $D_{\theta,s}$ \citep{Tsybakov2009Introduction, jiang2017uniform}, see Section \ref{kde}. $\alpha$ may be arbitrarily large, if the probability density function is infinitely differentiable. \begin{assump} (\textit{Lipschitz continuous value function}). All predictors $f \in \mathcal{F}$ are uniformly Lipschitz continuous over the first parameter, i.e. there exists a constant $C_L$ such that for all $f\in \mathcal{F}, x\in\mathcal{X}, a\in\mathcal{A}$ and any $D_\theta, D'_\theta \in \Delta(\mathcal{X})^{\xi}$, $|f(D_\theta, x, a) - f(D'_\theta, x, a)| \le C_L \cdot \|D_\theta - D'_\theta \|_{\infty}$ where $\|D_\theta - D'_\theta \|_{\infty} := \sup_{x\in\mathcal{X}, s\in\mathcal{S}}|D_{\theta, s}(x) - D'_{\theta, s}(x)|$. \label{A4} \end{assump} Assumption \ref{A4} ensures that small error in density estimation will result in controllable error in future reward prediction. Assumption \ref{A2} and \ref{A4} together imply the true optimal value function is also Lipschitz continuous over the first parameter. \begin{assump} (\textit{Distinguishability of states}). There exists a constant $\zeta > 0$ such that for all $\theta \in \Theta$ and any $s, s' \in \mathcal{S}$, $\sup _{x\in\mathcal{X}}|D_{\theta, s}(x) - D_{\theta, s'}(x) | > \zeta$. \label{A5} \end{assump} Assumption \ref{A5} states that given a fixed $\theta$, the difference between the marginal distributions of observations for any two states cannot be arbitrarily small. If we can fully accurately estimate the distributions, say with infinitely many samples, then we are able to distinguish whether any two underlying states are actually the same one. \section{Methodology} \label{methodology} We are inspired by the idea in domain generalization that the marginal distributions of the observations (i.e., the domains) is used to fully characterize different environments, both simulators and the real world. In this paper, we use {\em kernel density estimation} (KDE) to approximate the distribution of observations at each state in each environment. For every simulator, a near-optimal policy (w.r.t. this particular simulator) is learned and all those policies combined with the distribution estimates give a near-optimal meta-policy (in terms of the expected total reward) for the real world. In the whole procedure, real-world samples are collected for the sole purpose of estimating the densities of observation $D_{\theta_R, s}$, which does not need any feedback from real world. \subsection{Kernel Density Estimation} \label{kde} As mentioned previously, our algorithm computes estimates of $D_\beta$ for each simulator $\beta$ and use them as the argument of the predictors. Kernel density estimation (KDE) is a well-studied method to estimate any distribution. With observations $x^{(1)}_\beta, ... ,x^{(n)}_\beta $ drawn from simulator $\beta$ at state $s$ (i.e., $x^{(1)}_\beta, ... ,x^{(n)}_\beta \stackrel{iid}{\sim} D_{\beta, s}$), the KDE $\hat{D}_{\beta,s}$ is \begin{equation} \hat{D}_{\beta,s}(x) = \displaystyle\frac{1}{n\cdot h^d}\sum_{i=1}^n \kappa\bigg(\frac{x^{(i)}_\beta - x}{h}\bigg). \label{eq:kde-formula} \end{equation} where $h>0$ is the bandwidth, and $\kappa$ is a kernel. In this paper, $\kappa$ is chosen to satisfy the following conditions, \begin{enumerate}[align=left, leftmargin=*, label=\textbf{(K\arabic*)}] \item \label{K1} $\int \kappa(t) dt = 1$, $\int \|t\|^\alpha|\kappa(t)|dt < \infty$, and $\int t^s \kappa(t)dt = 0$ for any non-zero vector $s = (s_1, ..., s_d)$ s.t. $s_1, ..., s_d$ are non-negative integers and $|s| \le \lceil \alpha \rceil - 1$; \item \label{K2} $\|\kappa\|_2 < \infty$, $\|\kappa\|_\infty < \infty$ and $\mathcal{K}:= \{\kappa(\frac{\cdot - x}{h}), x\in\mathcal{X}\}$ is a uniformly bounded VC-class with dimension $\nu$ and characteristic $\Lambda$ for a fixd $h>0$. \end{enumerate} A class of functions $\mathcal{G}$ is a uniformly bounded VC-class with dimension $\nu$ and characteristic $\Lambda$ \citep{talagrand1994sharper, talagrand1996new, gine2001consistency, gine2002rates} if $\|\mathcal{G}\|_\infty := \sup_{g\in\mathcal{G}}\|g\|_{\infty} < \infty$ and there exist positive numbers $ \nu, \Lambda$ such that for all probability measure $\Tilde{P}$ on $\mathbb{R}^d$ and all $\rho \in (0 , \|\mathcal{G}\|_\infty)$, the covering number $N(\mathcal{G}, L_2(\Tilde{P}), \rho)$ satisfies $$N(\mathcal{G}, L_2(\Tilde{P}), \rho) \le \bigg( \frac{\Lambda \cdot \|\mathcal{G}\|_\infty}{\rho} \bigg)^{\nu},$$ where the covering number is the minimal number of open balls of radius $\rho$ w.r.t. $L_2(\Tilde{P})$ distance and centered within $\mathcal{G}$ that cover $\mathcal{G}$. To show the existence of such a kernel, we provide one construction based on the orthonormal basis of Legendre polynomials \citep{Tsybakov2009Introduction}. Let $\{\psi_m(\cdot)\}_{m=0}^{\infty}$ be the orthonormal basis of Legendre polynomials in $L_2([-1, 1])$ defined by the formulas $$\psi_0(t) = \frac{1}{\sqrt{2}} \text{ and } \psi_m(t) = \sqrt{\frac{2m+1}{2}}\frac{1}{2^m m!}\frac{\partial^m}{\partial t^m}\big[(t^2-1)^m\big], m=1, 2, ...,$$ for $t \in [-1,1]$. Then for any $x = (x_1, ..., x_d) \in \mathcal{X}$ define kernel $\Tilde{\kappa}$ as $\Tilde{\kappa}(x) = \gamma(x_1)...\gamma(x_d)$ where $\gamma: \mathbb{R}\to\mathbb{R}$ is defined as \begin{equation} \label{eq:gamma} \gamma(t) = \sum_{m=0}^{\lceil \alpha \rceil -1} \psi_m(0) \psi_m(t)\mathbf{1}[-1\le t\le 1]. \end{equation} \begin{proposition} $\Tilde{\kappa}$ satisfies \ref{K1} and \ref{K2}. \label{prop:kernel} \end{proposition} The next section introduces the training algorithm that learns a meta-policy using the $B$ simulators. Our algorithm is inspired by \citet{krishnamurthy2016pac}. \subsection{Meta-Policy Learning} \label{algorithm} Before starting this subsection, we define the concept of paths. A path, denoted by $p$, is a sequence of at most $H$ actions that the agent takes sequentially from the initial state $s_1$. Moreover, we use $p\circ a$ to denote taking action $a$ after $p$. After taking $p$ / $p\circ a$, it is guaranteed to arrive at one of the states, due to the deterministic dynamics. We use $p$ / $p\circ a$ to denote that state and we call that state the terminal state of path $p$ / $p\circ a$. This allows us to use $s$ and $p$ interchangeably in notation, like $D_s$ and $D_p$. Hence, the empty path $p = \emptyset$ is equivalent to $s_1$, because no action has been taken. \begin{algorithm} \caption{Sim2Real($\mathcal{F}, \epsilon, \delta, \kappa$)} \label{alg:sim2real} \begin{algorithmic}[1] \STATE Set $\phi = \frac{\epsilon}{500H^2\sqrt{A}}$ and $B = \frac{2}{\phi^2}\log(\frac{256H^2SF\log(4HS/\delta)}{\epsilon \delta})$. \STATE Sample $B$ simulators $\beta_1, ..., \beta_B$ such that each simulator $\beta_b$ is associated with parameter $\theta_b$ and $\theta_1, ..., \theta_B \stackrel{iid}{\sim} \mu$. Let $\mathcal{B} = \{\beta_1, ..., \beta_B\}$. \STATE $\hat{D} \gets $ DFS-Distribution($\emptyset, \{\}, \mathcal{B}, \kappa, \epsilon, \delta/4$). \STATE $\mathcal{F} \gets $ DFS-Learn$(\emptyset, \mathcal{B}, \mathcal{F}, \hat{D}, \phi, \delta/4)$. \STATE Choose any $f \in \mathcal{F}$. Let $\hat{V}^*$ be a Monte Carlo estimate of $V^f(\emptyset)$ (computed in Line 4). \STATE $\hat{\pi} \gets$ Learn-on-Simulators($\mathcal{B}, \mathcal{F}, \hat{D}, \hat{V}^*, \epsilon, \delta/4$). \RETURN $\hat{\pi}$. \end{algorithmic} \end{algorithm} \textbf{Sim2Real} (Algorithm \ref{alg:sim2real}) is designed for learning a near-optimal meta-policy for the real world via only simulators, and takes as input $\epsilon, \delta$, a class of predictors $\mathcal{F}$ and a kernel $\kappa$ satisfying the conditions \ref{K1} and \ref{K2}. Sim2Real first generates $B = \Tilde{\mathcal{O}}\big(\frac{H^4A}{\epsilon^2} \cdot \log \frac{FS}{\delta}\big)$ simulators whose environment parameters are sampled according to $\mu$. DFS-Distribution is invoked to compute the KDE for every state on each simulator. DFS-Learn with its helper functions (Consensus and TD-Eliminate) calculates a close approximation of the maximal future reward $V^*(p)$ starting from the path $p$ at which DFS-Learn is invoked. Since DFS-Learn is invoked at the initial state, an approximation of $V^*$ is computed. Learn-on-Simulators finds a near-optimal meta-policy for the real world using the previous KDEs. \begin{algorithm} \caption{DFS-Distribution($p, \hat{D},\mathcal{B}, \kappa, \epsilon, \delta$)} \label{alg:dfs-distribution} \begin{algorithmic}[1] \STATE Set $n_{\text{dist}}$ satisfying (\ref{eq:requisite-ndist}) and $\epsilon_{\text{dist}} = \frac{\zeta}{2} , h = (n_{\text{dist}})^{-\frac{1}{2\alpha+d}}$. \STATE Collect $n_{\text{dist}}$ observations $x^{(i)}_\beta \sim D_{\beta, p}$ for all $\beta \in \mathcal{B}$. \STATE Compute $\hat{D}'_{\beta, p}$ for all $\beta \in \mathcal{B}$ by KDE using (\ref{eq:kde-formula}). \IF{ there exists $p'$ already visited by DFS-Distribution s.t. $\sup_{x\in\mathcal{X}}| \hat{D}'_{\beta, p}(x) - \hat{D}_{\beta, p'}(x)| \le \epsilon_{\text{dist}}$ for all $\beta \in \mathcal{B}$} \STATE Append $\hat{D}$ of $p$ and all $p$'s descendants to $\hat{D}$, using $\hat{D}$ of $p'$ and $p'$'s descendants that correspond to $p$ and $p$'s descendants, respectively. \ELSE \STATE $\hat{D} \gets \hat{D}.\text{append}(\hat{D}_p)$. \FOR{$a \in \mathcal{A}$} \STATE $\hat{D} \gets $ DFS-Distribution($p \circ a, \hat{D}, \mathcal{B}, \kappa, \epsilon, \delta$). \ENDFOR \ENDIF \RETURN $\hat{D}$. \end{algorithmic} \end{algorithm} \textbf{DFS-Distribution} (Algorithm \ref{alg:dfs-distribution}) traverses paths via a DFS (depth-first search). Every time it visits a path $p$ (i.e., a node in the DFS), it compute the KDE for the corresponding state for all environments, where $n_{\text{dist}}$ samples are collected for each simulator. $n_{\text{dist}}$ is chosen satisfying \begin{equation} C_L C_{\text{dist}} \cdot (\frac{1}{n_{\text{dist}}})^{\frac{\alpha}{2\alpha+d}}\sqrt{\log(n_{\text{dist}}) + \log\frac{(B+1)HSA}{\delta}} \le \frac{\phi}{2} = \frac{\epsilon}{1000H^2A}. \label{eq:requisite-ndist} \end{equation} $C_{\text{dist}}$ is a constant independent of $\epsilon, \delta, H, S, A$ (see details in Appendix \ref{C}). Since going through the entire search tree of DFS results in the sample complexity depending on $A^H$, we use a simple technique to avoid computing the estimates for the same state multiple times. DFS-Distribution checks whether the current path leads to a state that is visited before, using the computed estimates. If so, all paths with prefix $p$ (i.e., the subtree with the root being $p$) are pruned from the DFS; otherwise, it visits $p\circ a$ for all action $a$ as the DFS continues. DFS-Distribution returns a set of vectors of distributions over the observation space, where each vector corresponds to a simulator. Every time we say collecting $n$ observations $x^{(i)}\sim D_{\beta,p}$, we execute the path $p$ on simulator $\beta$ to enter its terminal state and collect a single observation, and we repeat this procedure for $n$ times. \begin{algorithm} \caption{DFS-Learn($p, \mathcal{B}, \mathcal{F}, \hat{D}, \phi, \delta$)} \label{alg:dfs-learn} \begin{algorithmic}[1] \STATE Set $\epsilon_{\text{test}} = \big(25(H-|p|-2) + 21\big)\sqrt{A}\phi$. \FOR{$a \in \mathcal{A}$,} \IF{ Not Consensus($p\circ a, \mathcal{B}, \mathcal{F}, \hat{D}, \epsilon_{\text{test}}, \phi, \frac{\delta/2}{HSA}$)} \STATE $\mathcal{F} \gets $ DFS-Learn$(p\circ a, \mathcal{B}, \mathcal{F}, \hat{D}, \phi, \delta)$. \ENDIF \ENDFOR \RETURN TD-Eliminate($p, \mathcal{B}, \mathcal{F}, \hat{D}, \phi, \frac{\delta/2}{HS}$). \end{algorithmic} \end{algorithm} \begin{algorithm} \caption{Consensus($p, \mathcal{B}, \mathcal{F}, \hat{D}, \epsilon_{\text{test}}, \phi, \delta$)} \label{alg:consensus} \begin{algorithmic}[1] \STATE Set $n_{\text{test}} = \frac{2\log(2FB/\delta)}{\phi^2}$. \STATE For each $\beta \in \mathcal{B}$, collect $n_{\text{test}}$ observations $x^{(i)}_\beta \sim D_{\beta, p}$ from the simulator $\beta$. \STATE Compute estimates for each value function, $$\Hat{V}_\beta^f(p) = \frac{1}{n_{\text{test}}} \sum_{i = 1}^{n_{\text{test}}}f (\hat{D}_\beta, x^{(i)}_\beta, \pi^f_{\hat{D}_\beta}(x^{(i)}_\beta)), \forall f \in \mathcal{F}, \beta \in \mathcal{B}.$$ \RETURN $\mathbf{1}[|\Hat{V}_\beta^f(p, \pi^f_\beta) - \Hat{V}_\beta^g(p, \pi^g_\beta)| \le \epsilon_{\text{test}}, \forall f, g\in \mathcal{F}, \beta \in \mathcal{B}]$. \end{algorithmic} \end{algorithm} \begin{algorithm} \caption{TD-Eliminate($p, \mathcal{B}, \mathcal{F}, \hat{D}, \phi, \delta$)} \label{alg:td-eliminate} \begin{algorithmic}[1] \STATE Require estimates $\Hat{V}_\beta^f(p \circ a), \forall f \in \mathcal{F}, \beta \in \mathcal{B}, a \in \mathcal{A}$. \STATE Set $n_{\text{train}} = \frac{2\log(4FB/\delta)}{\phi^2}$. \STATE For each $\beta \in \mathcal{B}$, collect $n_{\text{train}}$ observations $(x^{(i)}_\beta, a^{(i)}_\beta, r^{(i)}_\beta)$ from the simulator $\beta$, where $x^{(i)}_\beta \sim D_{\beta, p}$, $a^{(i)}_\beta$ is chosen uniformly at random, and $r^{(i)}_\beta \sim R(x^{(i)}_\beta, a^{(i)}_\beta)$. \STATE Let $Risk(f_{\hat{D}_\beta}) = \frac{1}{n_{\text{train}}}\displaystyle \sum_{i = 1}^{n_{\text{train}}}\Big(f(\hat{D}_\beta, x^{(i)}_\beta, a^{(i)}_\beta) - r^{(i)}_\beta - \Hat{V}_\beta^f(p \circ a^{(i)}_\beta)\Big)^2, \forall f \in \mathcal{F}, \beta \in \mathcal{B}$. \RETURN $\{f\in\mathcal{F}: Risk(f_{\hat{D}_\beta}) \le \displaystyle \min_{f'\in\mathcal{F}}Risk(f'_{\hat{D}_\beta})+ 2\phi^2 + 8\phi + \frac{22}{n_{\text{train}}}\log(\frac{2FB}{\delta}),\forall \beta \in \mathcal{B}\}$. \end{algorithmic} \end{algorithm} \textbf{DFS-Learn} (Algorithm \ref{alg:dfs-learn}) traverses paths for the purpose of approximating the maximal future reward $V^*(p)$ starting at the path $p$ at which the current series of recursive calls to DFS-Learn is first invoked and meanwhile eliminating those candidate value functions that does not accurately predict $V^*(p')$ where $p'$ is prefixed by $p$. These two parts are done simultaneously because the latter can be considered as a prerequisite of the former. For any predictor $f \in \mathcal{F}$, let $V^f_\beta(p)$ be its prediction on the maximal future reward starting at $p$. \textbf{TD-Eliminate} (Algorithm \ref{alg:td-eliminate}) finds good value functions from $\mathcal{F}$ according to their \textit{Bellman risks} (Line 4). Value functions with smaller Bellman risks have more accurate prediction. The true value function $f^*$ is retained (with high probability) and the rest of the survivors are similar to $f^*$ in terms of their prediction accuracy (see Proof of Lemma \ref{lm:2}). Hence all value functions retained by TD-Eliminate approximate $V^*(p)$ closely if TD-Eliminate is invoked at $p$. Notice that in the Bellman risk formula (Line 4) we also need to know the estimate of $V^f_\beta(p\circ a)$ (denoted by $\hat{V}^f_{\beta}(p\circ a)$ in the formula). This is why a DFS is used. Pruning is executed when all functions in the current $\mathcal{F}$ have similar predictions on $V^f_\beta(p\circ a)$, which is examined by \textbf{Consensus} (Algorithm \ref{alg:consensus}). \begin{algorithm} \caption{Learn-on-Simulators($\mathcal{B}, \mathcal{F}, \hat{D}, \hat{V}^*, \epsilon, \delta$)} \label{alg:Learn-on-Simulators} \begin{algorithmic}[1] \STATE Set $\epsilon_{\text{demand}} = \epsilon/2, n_1 = \frac{32\log(6HSB/\delta)}{\epsilon^2}$ and $n_2 = \frac{8\log(3SH/\delta)}{\epsilon B}$. \WHILE{true} \STATE Pick any $f \in \mathcal{F}$. \STATE For each $\beta\in\mathcal{B}$, collect $n_1$ trajectories from the simulator $\beta$, according to policy $\pi^f_{\hat{D}_\beta}$, respectively. Let $v_\beta^{(j)}$ be the total reward of the $j^{th}$ trajectory on the simulator $\beta$. \STATE $\hat{V}(\pi^f_{\hat{D}}) = \frac{1}{n_1\cdot B}\sum_{\beta\in\mathcal{B}}\sum_{j = 1}^{n_1}v_\beta^{(j)}$. \IF{$|\hat{V}^* - \hat{V}(\pi^f_{\hat{D}})| \le \epsilon_{\text{demand}}$} \RETURN $\pi^f$. \ENDIF \STATE Update $\mathcal{F}$ by calling DFS-Learn($p, \mathcal{B}, \mathcal{F}, \hat{D}, \phi, \frac{\epsilon\delta}{48 H^2S\log(3HS/\delta)}$) at the terminal states of each of the $H$ prefixes $p$ of each of any $n_2$ paths executed on each simulator in line 4. \ENDWHILE \end{algorithmic} \end{algorithm} \textbf{Learn-on-Simulators} (Algorithm \ref{alg:Learn-on-Simulators}) loops until a near-optimal meta-policy is found. We use the previously computed estimate $\hat{V}^*$ of the optimal total reward as the reference to determine whether a meta-policy is near-optimal simply via the Monte-Carlo estimation (Line 4). Intuitively, if $f$, which is retained after the execution of DFS-Learn, makes accurate predictions on all states that are visited according to $\pi^f$, then the expected total reward of the induced meta-policy $\pi^f$ is close to $V^*$. However, this is not guaranteed by merely running DFS-Learn because DFS-Learn only ensures that the predictions on the states where DFS-Learn is invoked are accurate. In the case that the current meta-policy $\pi^f$ induced by $f$ is not near-optimal, $\pi^f$ is likely to lead the agent onto unvisited states where $f$ cannot make precise prediction (see Lemma \ref{lm:8}). Hence we invoke DFS-Learn on those unvisited states to further refine $\mathcal{F}$, during which this particular $f$ is supposed to be removed with high probability. This process keeps being iterated till a good meta-policy is found. Finally, we are able to deploy the learned meta-policy into the real world, combined with the KDE of the real world. \subsection{Deployment in Real World} \label{deployment} In this subsection, we discuss the deployment of the meta-policy $\hat{\pi}$ learned in Section \ref{algorithm}. \textbf{Deploy} (Algorithm \ref{alg:deploy}) collect samples for distribution estimation at paths that are visited by DFS-Distribution previously, and build $\hat{D}_R$ as building $\hat{D}_\beta$. Then we obtain the target policy $\hat{\pi}_{\hat{D}_R} = \hat{\pi}(\hat{D}_R, \cdot)$. \begin{algorithm} \caption{Deploy($\hat{\pi}, \epsilon, \delta$)} \label{alg:deploy} \begin{algorithmic}[1] \STATE Let $n_{\text{dist}}, h$ be the same as in DFS-Distribution. \STATE Collect $n_{\text{dist}}$ observations $x^{(i)}_R$ from the real world at the terminal state of every path visited by DFS-Distribution, and compute $\hat{D}_R$ similarly by KDE. \RETURN $\hat{\pi}_{\hat{D}_R} = \hat{\pi}(\hat{D}_R, \cdot)$. \end{algorithmic} \end{algorithm} In DFS-Distribution and Deploy, samples are collected for the sole purpose to approximate $D$ so that no feedback is needed. DFS-Learn and Learn-on-Simulators require the collection of rewards, but all are gathered from simulators. Thus, our algorithm does not demand any feedback from the real world. \section{Result} \label{result} Our main theorem is the upper bound of the number of simulators needed and the numbers of samples collected from simulators and the real world, respectively. \begin{theorem}[Main Theorem] Suppose Assumption \ref{A1}, \ref{A2}, \ref{A3}, \ref{A4}, \ref{A5} are satisfied and $\epsilon \in (0, 250H^2\sqrt{A}C_L\zeta], \delta \in (0,1)$. Then with probability at least $1-\delta$, Sim2Real and Deploy together find an $\epsilon$-optimal policy $\hat{\pi}_{\hat{D}_R}$, that is, $V^* - \mathbb{E}_{\theta_R \sim \mu}V_{\theta_R}(\hat{\pi}_{\hat{D}_R}) \le \epsilon$. Moreover, at most $$\displaystyle \Tilde{\mathcal{O}}\Big(\frac{H^{11}S^2A^3}{\epsilon^5} \cdot (\log F)^2 \cdot (\log\frac{1}{\delta})^3 + \frac{H^4A}{\epsilon^2} \cdot \log \frac{FS}{\delta} \cdot \big(\frac{H^2\sqrt{A}}{\epsilon}\log \frac{S}{\delta}\big)^{2+\frac{d}{\alpha}}\Big)$$ episodes are collected from at most $$\displaystyle \Tilde{\mathcal{O}}\Big(\frac{H^4A}{\epsilon^2} \cdot \log \frac{FS}{\delta}\Big)$$ simulators and at most $$\displaystyle \Tilde{\mathcal{O}}\Big( \big(\frac{H^2\sqrt{A}}{\epsilon}\log \frac{S}{\delta}\big)^{2+\frac{d}{\alpha}}\Big)$$ no-feedback episodes are collected from the real world. \label{thm:main} \end{theorem} \begin{proof-sketch}[Theorem \ref{thm:main}] The proof of Theorem \ref{thm:main} comprises the following major parts: \noindent \textbf{(1)} The error of KDE in DFS-Distribution and Deploy is upper bounded by $\frac{\phi}{2C_L}$ simultaneous with probability at least $1-\delta$. \noindent \textbf{(2)} Using Assumption \ref{A4}, the error of the prediction by any $f\in\mathcal{F}$, i.e., $|f(D_\beta, x, a) - f(\hat{D}_\beta, x, a)|$, is upper bounded by $\frac{\phi}{2}$. \noindent \textbf{(3)} Intuitively, with some probability, Consensus correctly answers whether the current $\mathcal{F}$ have similar predictions on $V^f_\beta(p)$ and TD-Eliminate ensures that $f^*$ is always retained and all remaining functions make prediction with controllable error. Hence, DFS-Learn guarantees that with probability at least $1-\delta$, $f^*$ is retained and any remaining $f, g \in \mathcal{F}$ satisfy $|\hat{V}^f_\beta(s_h) - V^f_\beta(s_h)| \le \phi$ and $\big|V_\beta^f(s_h) - V_\beta^g(s_h)\big| \le + (H-h+1)(25\sqrt{A}\phi)$, for all $s_h\in\mathcal{S}$ and $\beta \in \mathcal{B}$. \noindent \textbf{(4)} If all calls to DFS-Learn are successful, then for any remaining $f \in \mathcal{F}$, the following holds: $V^* - V(\pi^f_{\hat{D}}) \le 77 H^2\sqrt{A}\phi + \frac{1}{B}\sum_{\beta\in\mathcal{B}}\mathbb{P}(s_1, \pi^f_{\hat{D}_\beta} \to \Bar{L})$ where $\mathbb{P}(s_1, \pi^f_{\hat{D}_\beta} \to \Bar{L})$ is the probability that $\pi^f_{\hat{D}_\beta}$ leads the agent to an unlearned state on the simulator $\beta$. Therefore, a near-optimal meta-policy is guaranteed to be found after all states are visited by DFS-Learn (Line 9 in Algorithm \ref{alg:Learn-on-Simulators}). \noindent \textbf{(5)} Combine samples collected in every procedure to give the upper bounds of sample complexity of simulators as well as the real world. \end{proof-sketch} The $\Tilde{\mathcal{O}}$ notation hides lower-order logarithmic terms (if $Z$ appears in a bound, $\log Z$ is ignored; if $\log Z$ appears, $\log\log Z$ is ignored, etc.). The simulator sample complexity consists of two parts, one for the KDE and the other for finding a near-optimal meta-policy; on the other hand, the real-world sample complexity only relies on KDE. As mentioned in Section \ref{assumption}, if the underlying true $D$ is infinitely differentiable, we can always find a sufficiently large $\alpha$. In this case, we can reduce the exponents of the real-world sample complexity, as $\alpha$ goes to infinity, asymptotically to $$\displaystyle \Tilde{\mathcal{O}}\Big( \frac{H^4A}{\epsilon^2}\big(\log \frac{S}{\delta}\big)^2\Big).$$ \citet{krishnamurthy2016pac} first studied ROMDP in this setting and \citet{jiang2017contextual} and \citet{du2019provably} improved the upper bound of the sample complexity, with which we compare our result. These methods directly learn from the real-world (without access to simulators), and thus require feedback. The method of \citet{krishnamurthy2016pac} requires at most $\Tilde{\mathcal{O}}\big(\frac{H^6A^2S}{\epsilon^3}\log F (\log\frac{1}{\delta})^2\big)$ samples, while the methods of \citet{jiang2017contextual} and \citet{sun2019model}\footnote{In \cite{sun2019model}, given that it is a model-based method, a set of models is added as part of the input of the algorithm, but we still use $F$ to denote the cardinality of this set of models.} require $\Tilde{\mathcal{O}}\big(\frac{H^5AS^2}{\epsilon^2}\log\frac{F}{\delta}\big)$ samples. It should be kept in mind that unlike these other works, our performance measure is an expected reward averaged over all possible real worlds. Nonetheless, we believe these are the most natural benchmarks for our result. \section{Conclusion \& Future Work} Our paper is motivated by Sim-to-Real applications in RL. We are the first to model Sim-to-Real with continuous observations and prove a PAC upper bound on sample complexity, in a domain generalization setting. We propose an algorithm that collects with-feedback samples from simulators to learn a near-optimal meta-policy and is afterwards deployed into real-world environments with collected no-feedback samples from the real world. We prove that the number of simulators is $\text{poly} (H, A, \log S, \log F, 1/\epsilon, \log(1/\delta))$ and the total number of simulator samples is $\text{poly} (H, A, S, \log F, 1/\epsilon, \log(1/\delta))$. More importantly, we prove that the real-world sample complexity (without feedback) is $\Tilde{\mathcal{O}}\big( \big(\frac{H^2\sqrt{A}}{\epsilon}\log \frac{S}{\delta}\big)^{2+\frac{d}{\alpha}}\big)$, which is better than learning directly in the real world with state-of-art algorithms if the underlying distributions of observations are infinitely differentiable. One interesting direction for future work is to extend from the domain generalization setting to the learning-to-learn setting where there is feedback in the real-world. This may enable even smaller real-world sample complexity, and our policy may provide a useful initial policy in this setting. \vskip 0.2in
\section{INTRODUCTION} It can be argued that one of the main challenges in any scientific discipline is to identify which causes are behind the correlations observed among some measured variables, encapsulated by their joint probability distribution. Understanding this problem is crucial in many situations, such as, for example, the development of medical treatments, taking data-based social policy decisions, the design of new materials or the theoretical modeling of experiments. More precise characterizations of causal correlations enable better decision among competing explanations for given statistics, a task known as \term{causal discovery}. Advances in causal understanding also enable quantification of causal effects from purely observational data, thus extracting counterfactual conclusions even in instances where randomized or controlled trials are not feasible, a task known as \term{causal inference}~\cite{pearl,morgan2007counterfactuals,ShpitserPearlIdentification}. Bayesian causal networks, in the form of directed acyclic graphs (DAGs), provide the tools to formalize such problems. These graphs, examples of which are shown in Fig.~\ref{fig:dag}, encode the causal relations between the various variables in the problem, which could be either observed or non-observed. The latter, also known as latent, are required in many relevant situations in order to explain correlations among the observed. The fundamental task addressed in this work underlies both causal discovery and causal inference, and is known as the \term{causal compatibility} problem. It consists of deciding whether a given joint probability distribution over some observed variables can be explained by a given candidate Bayesian causal network. Equivalently, the objective of causal compatibility can be viewed as characterizing the set of distributions compatible with a given Bayesian network. In all cases, the measured variables in a causal network are, by definition, classical. However, causal networks may be classical or quantum depending on whether correlations are established by means of classical or quantum information. Because of its importance and broad range of applications, there is a vast literature devoted to understanding the problem of causal compatibility for classical causal networks; see for instance Ref.~\cite{pearl}. On the contrary, very little is known for the quantum case despite the fact that nature is ultimately quantum and quantum effects are expected to be crucial for the understanding of many relevant phenomena in many scientific disciplines. Moreover the two problems are known to be different, as one of the consequences of Bell's theorem~\cite{Bell66,BellReview} is that quantum causal networks can explain correlations for which the analogous classical network fails~\cite{fritz2012bell,HLP,Wood2015,Chaves2015relaxing,WolfeBellQuantified}. Our work addresses these issues and provides a systematic construction to tackle the problem of causal compatibility for quantum causal networks. \begin{figure}[!b] \begin{center} \subfigure[\label{fig:Bell}] {\centering \begin{minipage}[t]{0.20\textwidth} \centering\includegraphics[scale=0.45]{BellDual.pdf}\end{minipage} } \subfigure[\label{fig:TriangleNoSettings}] {\centering \begin{minipage}[t]{0.23\textwidth} \centering\includegraphics[scale=0.45]{TriangleNoSettingsGPT.pdf}\end{minipage} } \end{center} \caption[]{ DAG representation of different causal scenarios. The red, dashed circles are latent nodes, and the yellow, single-lined circles denote observed variables. % (a)~The Bell scenario is one of the simplest causal structures exhibiting a classical-quantum gap, that is, where there exist distributions that can be realized upon taking the latent nodes to represent quantum states (subsequently denoted as $U\,{=}\,\rho$), but not when the latent nodes are taken to represent distributions over classical hidden variables (subsequently denoted as $U\,{=}\,\Lambda$). % (b)~The triangle scenario, with three observed and three latent nodes, also presents a classical-quantum gap. \label{fig:dag} } \end{figure} As mentioned, several results already exist in the classical case. Whenever the network does not contain any latent variable the solution is rather simple and it suffices to check whether all the conditional independences associated to the network topology are satisfied~\cite{pearl}. The problem, however, becomes much more difficult as soon as the network also includes latent variables, as their presence generally implies nontrivial inequalities on the observed probabilities. A general method to tackle the causal compatibility problem, known as the \term{inflation technique}, is obtained in~\cite{wolfe2016inflation}. It consists of a hierarchy of conditions, organized according to their computational cost, that are necessary for a Bayesian network to be able to explain the observed correlations. Moreover, the hierarchy is asymptotically sufficient, in the sense that the candidate Bayesian network is compatible if, and only if, all conditions in the hierarchy are satisfied~\cite{navascues2017inflation}. When moving to quantum causal scenarios, the problem of causal compatibility presents several new features. In the classical case, the cardinality of the latent variables can be upper bounded~\cite{rosset2016finite} and, therefore, the problem is decidable. In the quantum case, however, a similar upper bound cannot exist because the problem of quantum causal compatibility is undecidable, as implied by recent results on quantum correlations~\cite{Slofstra,Ji2020Connes}. Yet, this fact does not preclude the existence of a method similar to inflation to tackle the question. Unfortunately, the inflation technique cannot be straightforwardly adapted to the quantum case because it relies on information broadcasting, a primitive that is not plausible with quantum information~\cite{BroadcastingMixed,NoCloningGeneral2006}. Other causal analysis techniques which are fundamentally quantum have been proposed. Notable among these is the quantum entropy vector approach in Ref.~\cite{Chaves2015}, which is applicable to all causal structures but uses only those constraints on entropies imposed by the causal structure, the scalar extension in Ref.~\cite{Pozas2019}, which imposes stronger constraints but cannot be applied to causal structures in which all observed nodes are causally connected, such as the triangle scenario in Fig.~\ref{fig:TriangleNoSettings} or the covariance matrix approach in Ref.~\cite{aberg2020covariance}, which provides low-degree polynomial (and, thus, rough) approximations of the sets of quantum correlations in networks. The main result of our work is the construction of \term{quantum inflation}, a systematic technique to study causal compatibility in any quantum Bayesian network. It can be seen as a quantum analog of the classical inflation technique which avoids the latter's reliance on information broadcast. In Sec.~\ref{sec:structures} we introduce the graphical notation to be used throughout this work and define the causal compatibility problem. We next explain quantum inflation by means of a simple example in Sec.~\ref{sec:simple}, deferring its detailed construction for arbitrary two-layer DAGs to Sec.~\ref{sec:details}. Section~\ref{sec:arbitrary} generalizes the technique to apply to \emph{every} possible multilayer causal structure involving unobserved quantum systems, utilizing the two-layer construction as its elementary constituent. Section~\ref{sec:classical} then considers a slight modification to quantum inflation to obtain a new tool for assessing causal compatibility with classical models. The next three sections illustrate the power of quantum inflation through different applications. First, in Sec.~\ref{sec:results}, we focus on the study of quantum correlations and use quantum inflation to characterize correlations achievable in various tripartite quantum causal networks, including the derivation of quantum causal incompatibility witnesses. Second, we show in Sec.~\ref{sec:cryptography} how quantum inflation can be used for cryptography purposes in quantum networks, in particular, to bound the eavesdropper's predictability on the observed measurement outcomes. Third, in Sec.~\ref{sec:mediationanalysis}, we consider a standard application in causality and show how to use quantum inflation to bound the strength of causal effects (this is, to perform do-conditional estimation) in the presence of quantum common causes. Finally, we conclude in Sec.~\ref{sec:conclusions}. We expect quantum inflation to find an application in many different contexts. The most immediate one is probably the characterization of correlations in quantum networks and its use for quantum information protocols. However, tools to characterize classical causal connections are commonly used in many scientific disciplines; see, for instance, Refs.~\cite{biomolecular,genomics} for examples in the context of biomolecular investigations or genomics. Progress in our understanding of these and other processes at smaller scales will eventually have to face quantum phenomena and understand how causal explanations are affected by them. In fact, some recent works advocate, admittedly not always in fully convincing ways, that quantum effects may play a role in biological processes~\cite{qbio1,qbio2}. We expect quantum inflation to be a fundamental method to address all these scientific challenges that are to come. \section{DEVICE-INDEPENDENT QUANTUM CAUSAL STRUCTURES}\label{sec:structures} In this work we consider physical scenarios where an experimenter can observe a number of random variables. Some of such observed variables can be influenced by other observed variables and also by unknown quantum processes. Our goal is to determine whether the postulated causal relations between the observed variables and such hidden processes are compatible with the observed statistics. \begin{figure}[t] \centering \includegraphics[width=0.9\columnwidth]{SWAP.pdf} \caption{The quantum tripartite line in the device-independent framework.} \label{fig:SWAP} \end{figure} Think, for instance, of the scenario depicted in Fig.~\ref{fig:SWAP}. The quantum states $U_{AB}$ and $U_{B'C}$ are, respectively, distributed to the parties Alice and Bob, and Bob and Charlie. Alice (respectively, Charlie) probes her (respectively, his) subsystem with a measurement labeled by $X$ (respectively, $Z$), obtaining the result $A$ (respectively, $C$). Bob probes both of his parts of states $U_{AB}$ and $U_{B'C}$ via a collective measurement labeled $Y$, obtaining the outcome $B$. If Alice, Bob, and Charlie repeat this experiment several times, then they can estimate the probabilities ${\{P_{\text{ABCXYZ}}(a,b,c,x,y,z)\}}$, that, from now on, we just refer to as ${P(a,b,c,x,y,z)}$. We further assume that, for each party, the choice of measurement setting is done independently of the other two parties. This scenario is known as the \emph{tripartite-line causal scenario}~\cite{branciard2010bilocality,branciard2012bilocality}, and it is meant to model the action of a quantum repeater in a device-independent way, where we assume no knowledge of the state preparations or measurement devices involved or, for that matter, the Hilbert spaces ${\mathcal H}_A$, ${\mathcal H}_B$, ${\mathcal H}_{B'}$, and ${\mathcal H}_C$ where those objects act. For any Hilbert space ${\mathcal H}$, let ${\cal B}({\mathcal H})$ denote the set of linear bounded operators mapping ${\mathcal H}$ to itself. The distribution ${P_{\text{ABCXYZ}}}$ is realizable in the tripartite-line causal scenario if and only if there exist Hilbert spaces ${{\mathcal H}_A}$, ${{\mathcal H}_B}$, ${{\mathcal H}_{B'}}$, and ${{\mathcal H}_C}$, quantum states \begin{align}\begin{aligned} &U_{AB}\in{\cal B}({\mathcal H}_A\otimes{\mathcal H}_B), &&U_{AB}\succeq 0,&&\Tr\braks{U_{AB}}=1,\\ &U_{B'C}\in{\cal B}({\mathcal H}_{B'}\otimes{\mathcal H}_C), &&U_{B'C}\succeq 0,&&\Tr\braks{U_{B'C}}=1, \label{states} \end{aligned}\end{align} \noindent and positive operator valued measures (POVMs) \begin{align}\begin{aligned} &E_{a|x}\in {\cal B}({\mathcal H}_A), && E_{a|x}\succeq 0,\;\;\;\; \sum_a E_{a|x}=\boldsymbol{\mathbb{1}}_A,\\ &F_{b|y}\in {\cal B}({\mathcal H}_B\otimes {\mathcal H}_{B'}), && F_{b|y}\succeq 0,\;\;\;\; \sum_b F_{b|y}=\boldsymbol{\mathbb{1}}_{BB'},\\ &G_{c|z}\in {\cal B}({\mathcal H}_C), && G_{c|z}\succeq 0,\;\;\;\; \sum_c G_{c|z}=\boldsymbol{\mathbb{1}}_C, \label{meas} \end{aligned}\end{align} such that \begin{align}\begin{split} &P_{\text{ABCXYZ}}(a,b,c,x,y,z)=\\ &\quad P_\text{X}(x)P_\text{Y}(y)P_\text{Z}(z)\times\\ &\quad\; \Tr\braks*{(U_{AB}\otimes U_{B'C})(E_{a|x}\otimes F_{b|y}\otimes G_{c|z})}. \label{repre} \end{split}\end{align} For simplicity, rather than sketching the corresponding quantum experiment, we prefer to represent the relations between the variables $X$, $Y$, $Z$, $A$, $B$, $C$, $U_{AB}$, and $U_{B'C}$, by means of what we hereby call \emph{device-independent quantum causal structures}, or \term{quantum causal structures}, for short. This structure fully determines the form of the observed statistics, as in Eq.~\eqref{repre}. A quantum causal structure is a Directed Acyclic Graph (\term{DAG}) where each node represents a classical or a quantum system. All quantum nodes are assumed to be latent: This assumption means that we can extract information from them only through their classical successors. Conversely, all classical variables are regarded as directly observable. The outgoing edges of a quantum node represent different subsystems or sectors of the corresponding quantum state, whereas the outgoing edges of a classical node denote copies of the node variable. The interpretation of the DAG is that each node is generated by applying an unknown deterministic quantum operation to all of its incoming edges. A \emph{root node} (a node without incoming edges) can be regarded as the result of applying a transformation to a system with no information content: The corresponding random variable or quantum system is, therefore, assumed uncorrelated with any other root nodes. \begin{figure}[b] \begin{center} \subfigure[\label{fig:Bilocality}] {\centering \begin{minipage}[t]{0.5\linewidth} \includegraphics[scale=0.45]{BilocalityU.pdf} \end{minipage} } \hfill \subfigure[\label{fig:ArbitraryStructure}] {\centering \begin{minipage}[t]{0.46\linewidth} \centering\includegraphics[scale=0.45]{Arbitrary2U.pdf}\end{minipage} } \end{center} \caption[]{ DAG representation of two example causal scenarios with quantum latent nodes. (a)~The tripartite-line causal scenario, where two causally independent parties $A$ and $C$ each share some quantum entanglement with a central party $B$, later denoted $\mathcal{Q}^{{\protect\text{\scalebox{2}[1]{\rotatebox{90}{\faShareAlt}}}}}$ for brevity. (b)~Arbitrary quantum-latent causal structures contain directed edges beyond the traditional network connections of latent-to-terminal edges and root-to-terminal edges. A method for analyzing correlations in general structures with quantum latent nodes is given in Sec.~\ref{sec:arbitrary}. \label{fig:qdags} } \end{figure} The quantum causal structure corresponding to the tripartite-line causal scenario (Fig.~\ref{fig:SWAP}) is depicted in Fig.~\ref{fig:Bilocality}. Since the variables $X$, $Y$, and $Z$ and the quantum states $U_{AB}$ and $U_{B'C}$ are assumed independent, they are represented by root nodes. The random variable $A$ is the result of applying a quantum operation from the random variable $X$ and one part of state $U_{AB}$ to $A$'s sample space. Since the outcome of the map is a classical variable, any such map corresponds to a quantum measurement on ${\mathcal H}_A$, labeled by $X$, i.e., to the POVMs (\ref{meas}). When we specify the quantum operations mapping incoming edges to nodes in a quantum causal structure ${\cal G}$, we speak of a \emph{quantum realization} of ${\cal G}$. A distribution ${P_\text{obs}}$ over the observed nodes ${\pmb{V}\hspace{-1ex}}_{O}$ of ${\cal G}$ is said to be compatible with ${\cal G}$ if there exists a quantum realization that generates the distribution ${P_\text{obs}}({\pmb{V}\hspace{-1ex}}_{O})$. Coming back to our example, ${P_{\text{ABCXYZ}}}$ is compatible with the quantum causal structure in Fig.~\ref{fig:Bilocality} if and only if $P$ admits a decomposition of the form~\eqref{repre}, for some Hilbert spaces ${\mathcal H}_A$, ${\mathcal H}_B$, ${\mathcal H}_{B'}$, and ${\mathcal H}_C$ and operators satisfying Eqs. \eqref{states} and \eqref{meas}. As another example, consider the DAG in Fig.~\ref{fig:ArbitraryStructure}, with quantum nodes $U_{AD}$ and $U_{BC}$. A distribution ${\{P_{\text{ABCXYZS}}\}}$ is compatible with this causal structure if and only if there exists a state ${U_{AD}}$, quantum channels ${\Omega_s\in {\cal B}({\mathcal H}_D)\to{\cal B}({\mathcal H}_{B}\otimes {\mathcal H}_C) }$, and POVMs ${E_{a|x}\in {\cal B}({\mathcal H}_A)}$, ${F_{b|y}\in {\cal B}({\mathcal H}_{B'})}$, and ${G_{c|bz}\in{\cal B}({\mathcal H}_{C})}$ such that \begin{align}\label{eq:arbitrarycompat} &P_{\text{ABCXYZS}}(a,b,c,x,y,z,s)=\nonumber\\ &\quad P_\text{X}(x)P_{\text{Y{\textbar}AX}}(y|a,x)P_\text{Z}(z)P_\text{S}(s)\times\\\nonumber &\quad \;\Tr\braks*{(\boldsymbol{\mathbb{1}}_A\otimes\Omega_s)(U_{AD})(E_{a|x}\otimes F_{b|y}\otimes G_{c|bz})}. \end{align} In general terms, the quantum causal structures we consider are arbitrary combinations of the following elements: \begin{itemize} \item \textit{preparations}, controlled or not, of multipartite quantum states of arbitrary dimension (as an extension to the formalism, we also add sources of global shared randomness in Sec.~\ref{sec:results:optim:linear}), \item \textit{transformations} of (multipartite) quantum systems, described by quantum channels which may be classically controlled, and \item \textit{measurements}, i.e., operations which generate classical random variables from (a set of) quantum states. \end{itemize} Without loss of generality we can assume that all measurements are projective and that all transformations are unitary, since we can dilate all such operations and then subsume all the local ancilla states into the causal structure's preparations. When we depict such a process as a directed acyclic graph, the vertices in the DAG represent the outcomes of these process elements, not the process elements themselves. That is, DAGs are distinct from circuit diagrams. For instance, in Fig.~\ref{fig:ArbitraryStructure} the node $B$ indicates the postmeasurement random variable arising from a measurement on some subsystem of $U_{BC}$ classically controlled by $Y$. The node $U_{BC}$ there indicates the (bipartite) posttransformation state arising from a transformation (classically controlled by $S$) applied to a fraction of the subsystems of $U_{AD}$. Note that combinations of these elements can describe quite complex operations. For instance, an operation with both classical and quantum inputs and outputs is captured in this formalism by a controlled transformation followed by a projective measurement on a subspace of the resulting state. Given a quantum causal structure ${\cal G}$, the purpose of this work is to tackle the following problem. \vspace{10pt} \noindent \textbf{Causal Compatibility Problem}\\ Input: a device-independent causal structure ${\cal G}$, and a probability distribution ${P_\text{obs}}({\pmb{V}\hspace{-1ex}}_{O})$ over its observed nodes ${\pmb{V}\hspace{-1ex}}_{O}$.\\ Output: if ${P_\text{obs}}({\pmb{V}\hspace{-1ex}}_{O})$ is compatible with ${\cal G}$, output \texttt{COMPATIBLE}. Otherwise, output \texttt{INCOMPATIBLE}. \vspace{10pt} The main challenge when addressing the causal compatibility problem comes from the fact that the Hilbert spaces ${\mathcal H}^{(i)}_Q$ required to reproduce the observed statistics ${P_\text{obs}}({\pmb{V}\hspace{-1ex}}_{O})$ are not known \emph{a priori}, and they might well be infinite dimensional. In fact, for the causal structure depicted in Fig.~\ref{fig:Bell} (the quantum correlations scenario), the causal compatibility problem is known to be undecidable~\cite{Slofstra}. Moreover, even the weaker problem of deciding if ${P_\text{obs}}({\pmb{V}\hspace{-1ex}}_{O})$ can be roughly approximated by a compatible distribution cannot be solved, in general, by a Turing machine~\cite{Ji2020Connes}. The quantum inflation technique, introduced in the next sections, is a tool to prove that certain distributions ${P_\text{obs}}({\pmb{V}\hspace{-1ex}}_{O})$ are incompatible with the considered causal structure ${\cal G}$. That is, for some instances, the inflation technique allows us to solve the causal compatibility problem in the negative. Even though the no-go results of Refs.~\cite{Slofstra,Ji2020Connes} imply that this tool, as any other tool designed to tackle the quantum causal compatibility problem, cannot be complete,\footnote{Namely, that for many quantum-latent causal structures ${\cal G}$, there will exist incompatible distributions ${P_\text{obs}}({\pmb{V}\hspace{-1ex}}_{O})$ whose incompatibility cannot be detected through the quantum inflation technique. It is important to note that the undecidability proofs of Refs.~\cite{Slofstra,Ji2020Connes} imply a limitation not specific to quantum inflation, however: Any further method for quantum causal compatibility must also be incomplete.} in the next sections we illustrate its applicability by proving the incompatibility of large sets of observed distributions for different quantum causal structures. \section{QUANTUM INFLATION BY EXAMPLE}\label{sec:simple} For the sake of clarity, it is convenient to start the presentation of quantum inflation through an example. Consider the quantum causal network depicted in Fig.~\ref{fig:TriangleSubsystems}, whereby three random variables $A$, $B$, and $C$ (taking the values $a$, $b$, and $c$, respectively) are generated by conducting bipartite measurements over the ends of three bipartite quantum states $\rho_{AB}$, $\rho_{BC}$, and $\rho_{AC}$ (from now on, quantum latent variables are denoted with $\rho$, instead of $U$). We are handed the distribution $P_\text{obs}(a,b,c)$ of observed variables and asked if it is compatible with this model. How to proceed? Suppose that there existed indeed bipartite states $\rho_{AB}$, $\rho_{BC}$, and $\rho_{AC}$ of systems $A''B'$, $B''C'$, and $A'C''$ and commuting measurement operators $E_a$, $F_b$, and $G_c$, acting on systems $A'A''$, $B'B''$, and $C'C''$, respectively, which are able to reproduce the correlations $P_\text{obs}(a,b,c)$. Now imagine how the scenario would change if $n$ independent copies $\rho_{AB}^i$, $\rho_{BC}^i$, and $\rho_{AC}^i$, \mbox{$i=1,...,n$} of each of the original states are distributed instead, as depicted in Fig.~\ref{fig:TriangleQInf_implicit}. Call $\rho$ the overall quantum state before any measurement is carried out. For any $i,j=1,...,n$ we can, in principle, implement measurement $\{E_a\}_a$ on the $i^\text{th}$ copy of $\rho_{AC}$ and the $j^\text{th}$ copy of $\rho_{AB}$: We denote by $\{E^{i,j}_a\}_a$ the corresponding measurement operators. Similarly, call $\{F^{i,j}_b\}_b$, (respectively, $\{G^{i,j}_c\}_c$) the measurement $\{F_b\}_b$ (respectively, $\{G_c\}_c$) over the states $\rho_{AB}^i$ and $\rho_{BC}^j$ (respectively, $\rho_{BC}^i$ and $\rho_{AC}^j$). \begin{figure}[b] \centering \hfill \subfigure[\label{fig:TriangleSubsystems}]{ \begin{overpic}[scale=0.43]{TriangleSubsystems.pdf} \put(90,35){\huge\faArrowRight} \end{overpic} } \hfill \subfigure[\label{fig:TriangleQInf_implicit}]{ \includegraphics[scale=0.43]{TriangleQInf_implicit.pdf} } \hfill \caption[]{Quantum inflation in the triangle scenario. (a) In the original scenario, by probing systems $A'$ and $A''$ with the quantum measurement $\{E_a\}_a$, a value $a$ for the random variable $A$ is generated. The values $b$ and $c$ for the random variables $B$ and $C$ are produced similarly. (b) In quantum inflation, we distribute $n$ (in the case shown, $n\,{=}\,2$) independent copies of the same states to the parties, which now use the original measurement operators on different pairs of copies of the states they receive. For instance, the measurement operators $\{E_a^{1,1}\}_a$ act on the states corresponding to copies $\rho_{AB}^1$ and $\rho_{AC}^1$, and the measurements with other superindices are defined in an analogous way.} \label{fig:quantum_inflation} \end{figure}classical The newly defined operators and their averages, ${\left< X \right>_\rho \coloneqq \Tr\braks{\rho X}}$, satisfy nontrivial relations. For example, for ${H=E,F,G}$ and ${i\not=k, j\not=l}$ the operators $H^{i,j}_{\_}$ and $H^{k,l}_{\_}$ act on different Hilbert spaces and, hence, commute, \mbox{$\left[H^{i,j}_{\_},H^{k,l}_{\_} \right]=0$}. Similarly, expressions such as ${\expec*{ E^{1,1}_a E^{1,2}_{a'}F^{2,2}_b}_\rho}$ and ${\expec*{ E^{1,2}_aE^{1,1}_{a'}F^{1,2}_b}_\rho}$ can be shown identical, since one can arrive at the second one from the first one just by exchanging $\rho_{AB}^1$ with $\rho_{AB}^2$. More generally, for any function ${Q(\{E^{i,j}_a,F^{k,l}_b,G^{m,n}_c\})}$ of the measurement operators and any three permutations $\pi$, $\pi'$, and $\pi''$ of the indices ${1,...,n}$, one should have \begin{align}\begin{split} \big\langle &Q(\{E^{i,j}_a,F^{k,l}_b,G^{m,n}_c\})\big\rangle_\rho\\ &=\expec*{ Q(\{E^{\pi(i),\pi'(j)}_a,F^{\pi'(k),\pi''(l)}_b,G^{\pi''(m),\pi(n)}_c\})}_\rho. \label{permut} \end{split}\end{align} Finally, note that, if we conduct the measurements $\{E^{i,i},F^{i,i}, G^{i,i}\}_{i=1}^n$ at the same time (something we can do, as they all commute with each other), then the measurement outcomes ${a^1,...,a^n,b^1,..., b^n,c^1,...,c^n}$ are distributed according to \begin{align} \expec*{\prod_{i=1}^nE^{i,i}_{a^i}F^{i,i}_{b^i}G^{i,i}_{c^i}}_\rho =\prod_{i=1}^n P_\text{obs}(a^i,b^i,c^i). \label{stat} \end{align} That is, if the original distribution $P_\text{obs}(a,b,c)$ is compatible with the network in Fig.~\ref{fig:TriangleSubsystems}, then there should exist a Hilbert space $\mathcal{H}$, a state $\rho: \mathcal{H}\to \mathcal{H}$ and operators $\{E^{i,j}_a\}_{i,j,a}$, $\{F^{k,l}_b\}_{k,l,b}$, and $\{G^{m,n}_c\}_{m,n,c}$ satisfying the above relations. If such is the case, we say that $P_\text{obs}(a,b,c)$ admits an \term{${\boldsymbol{n}^\text{th}\text{-order quantum inflation}}$}. By increasing the index of $n$, we arrive at a hierarchy of conditions, each of which must be satisfied by any compatible distribution $P_\text{obs}(a,b,c)$. At first glance, disproving the existence of a quantum inflation looks as difficult as the original feasibility problem. However, the former task can be tackled via noncommutative polynomial optimization (NPO) theory~\cite{npo}. Originally developed to characterize quantum correlations in Bell scenarios through the Navascues-Pironio-Acin (NPA) hierarchy~\cite{npa,npa2}, the general goal of NPO theory is to optimize the expectation value of a polynomial over operators subject to a number of polynomial operator and statistical constraints. This optimization is achieved by means of a hierarchy of semidefinite programming (SDP) tests~\cite{sdp}; see also Appendix~\ref{app_npo}. In our particular case, we are dealing with a feasibility problem. The polynomial operator constraints we wish to enforce on $E^{i,j}_a$, $F^{k,l}_b$, and $G^{m,n}_c$ are that they define complete families of projectors, which commute when acting on different quantum systems. The statistical constraints are given by Eqs.~\eqref{permut} and \eqref{stat}. If for some $n$ we are able to certify, via NPO theory, that $P_\text{obs}(a,b,c)$ does not admit an $n^\text{th}$-order quantum inflation, then we would prove that $P_\text{obs}(a,b,c)$ does not admit a realization in the quantum network in Fig.~\ref{fig:TriangleSubsystems}. An application of this method for this precise scenario is given in Sec.~\ref{sec:SimpleTriangle}. The method just described can be easily adapted to bound the statistics of any network in which the observed variables are defined by measurements on the quantum latent variables, the triangle scenario described in this section being only an example of such networks. To test the incompatibility of a distribution $P_\text{obs}$, one would \begin{itemize} \item consider a modified network with $n$ copies of each of the latent variables; \item extend the original measurement operators to act on all possible copies of each system; \item work out how operator averages relate to $P_\text{obs}$ and to each other; and \item use NPO theory to disprove the existence of a state and operators satisfying the inferred constraints. \end{itemize} In Sec.~\ref{sec:arbitrary} we further show how to extend the notion of quantum inflation to prove infeasibility in general quantum causal structures, where there might be causal connections among observed variables, as well as from observed to latent variables. \section{DETAILED DESCRIPTION}\label{sec:details} To illustrate the details of the construction, we first consider a subset of causal scenarios in which single measurements are applied to different quantum states. They correspond to two-layer DAGs in which arrows coming from a first layer, consisting in both observed and latent variables, go to a second layer of observed variables. Each of the variables in the second layer is regarded as an \emph{outcome variable}, since it is the result of conducting a measurement on a quantum state. The tuple of values of all the classical observed parents of such a variable can be understood as the \emph{measurement setting} used to produce this outcome; this case is, for instance, variables $X$, $Y$, and $Z$ in the tripartite-line scenario in Fig.~\ref{fig:Bilocality}. The essential premise of quantum inflation is to ask what would happen if multiple copies of the original (unspecified) quantum states are simultaneously available to each party. In this gedanken experiment the parties use copies of their original measurement apparatus to perform $n$ simultaneous measurements on the $n$ copies of the original quantum states now available to them. There are different ways in which a party can align her measurements to act on the states now available; thus, we must explicitly specify \emph{upon which unique set} of Hilbert spaces a given measurement operator acts nontrivially. Let us therefore denote measurement operators by \begin{align*} \hat{O}^{\boldsymbol{s}|k}_{i|m}\equiv\hat{O}\big(&\text{outcome variable}{=}k,\,\text{ spaces}{=}\boldsymbol{s},\\ &\;\;\text{setting}{=}m,\,\text{ outcome}{=}i\big), \end{align*} where the four indices specify \begin{compactenum} \item \term{$k$}, the index or name of the \emph{outcome variable} in the original causal graph, \item \term{$\boldsymbol{s}$}, the Hilbert spaces the given operator acts on \item \term{$m$}, the measurement \emph{setting} being used, and \item \term{$i$}, the \emph{outcome} associated with the operator. \end{compactenum} In the example in Fig.~\ref{fig:quantum_inflation}, we have \begin{align} \begin{split}\label{eq:notationtranslation} &E_a^{i,j} = E^{\{A_i',A_j''\}}_{a} = \hat{O}^{\{A_i',A_j''\}|A}_{a|\emptyset} , \\ &F_b^{i,j} = F^{\{B'_i, B''_j\}}_{b} = \hat{O}^{\{B'_i, B''_j\}|B}_{b|\emptyset} , \\ &G_c^{i,j} = G^{\{C'_i,C''_j\}}_{c} = \hat{O}^{\{C'_i,C''_j\}|C}_{c|\emptyset} . \end{split}\end{align} Now, using an $n\,{=}\,2$ quantum inflation as in Fig.~\ref{fig:TriangleQInf_implicit}, one finds that $\boldsymbol{s}$ for outcome variable $k\,{=}\,A$ may be sampled from precisely four possibilities, each value being a different \emph{tuple}: \begin{equation*} \quad\boldsymbol{s}\in\bigg\{ \{A'_{1},A''_{1}\},\{A'_{1},A''_{2}\},\{A'_{2},A''_{1}\},\{A'_{2},A''_{2}\} \bigg\}, \end{equation*} \noindent where $A'_i$ (respectively, $A''_i$) denotes the factor $A$ of the Hilbert space where $\rho^i_{AC}$ (respectively, $\rho^i_{AB}$) acts. These operators are regarded as the noncommuting variables of an NPO problem where the polynomial constraints are derived according to rules pertaining to the operators' projective nature as well as a number of commutation rules. The statistical constraints are then enforced by imposing symmetry under permutations of the state indices, and also equating certain expectation values with products of observed probabilities. \subsubsection*{Projection rules} For fixed $\boldsymbol{s},k,m$, the noncommuting variables $\{\hat{O}^{\boldsymbol{s}|k}_{i|m}\}_i$ must correspond to a complete set of measurement operators. Since we do not restrict the dimensionality of the Hilbert space where they act, we can take them to be a complete set of projectors. That is, they must obey the relations \begin{subequations}\begin{align} \label{rule1} &\hat{O}^{\boldsymbol{s}|k}_{i|m}=(\hat{O}^{\boldsymbol{s}|k}_{i|m})^\dagger,\hat{O}^{\boldsymbol{s}|k}_{i|m}\hat{O}^{\boldsymbol{s}|k}_{i'|m}=\delta_{ii'}\hat{O}^{\boldsymbol{s}|k}_{i|m},\forall\boldsymbol{s},k,i,i',m \\ \label{rule2} &\sum\nolimits_{i}\hat{O}^{\boldsymbol{s}|k}_{i|m}=\boldsymbol{\mathbb{1}}, \mbox{ for all }\boldsymbol{s},k,m. \end{align} \label{rules} \end{subequations} These relations imply, in turn, that each of the noncommuting variables is a bounded operator. Hence, by Ref.~\cite{npo}, the hierarchy of SDP programs provided by NPO is complete; i.e., if said distribution does not admit an $n^\text{th}$-order inflation, then one of the NPO SDP relaxations will detect its infeasibility. \subsubsection*{Commutation rules} Operators acting on different Hilbert spaces must commute. More formally, \begin{align} \left[\hat{O}^{\boldsymbol{s}_1|k_1}_{i_1|m_1},\hat{O}^{\boldsymbol{s}_2|k_2}_{i_2|m_2}\right] =0 \qquad\text{ if }\boldsymbol{s}_1{\cap}\boldsymbol{s}_2{=}\emptyset. \label{commutation:copies} \end{align} As shown in Sec.~\ref{sec:classical}, it is possible to construct an alternative SDP for constraining the correlations of \emph{classical} causal structures by imposing that all measurement operators commute. \subsubsection*{Symmetry under permutations of the indices} Because of the way inflated networks are constructed from the original network, all averages of products of the noncommuting variables must be invariant under any permutation $\pi$ of the source indices. Call $\rho$ the overall quantum state of the inflated network (since we do not cap the Hilbert space dimension, we can assume that all state preparations in the original network are pure). Then we have that \begin{align}\begin{split} \label{eq:symconstraint} \big\langle\hat{O}^{\boldsymbol{s}_1|k_1}_{i_1|m_1} & \!\!\cdot \hat{O}^{\boldsymbol{s}_2|k_2}_{i_2|m_2}\!\!\cdot\dots\cdot\hat{O}^{\boldsymbol{s}_n|k_n}_{i_n|m_n}\big\rangle_\rho \\ = & \expec*{\hat{O}^{\pi(\boldsymbol{s}_1)|k_1}_{i_1|m_1} \!\!\cdot \hat{O}^{\pi(\boldsymbol{s}_2)|k_2}_{i_2|m_2}\!\!\cdot\dots\cdot\hat{O}^{\pi(\boldsymbol{s}_n)|k_n}_{i_n|m_n}}_\rho. \end{split}\end{align} An example of such statistical constraints imposed in the triangle scenario is given in Eq.~\eqref{permut}. Another example, for an inflation level $n\,{=}\,3$, is the following: \begin{subequations}\begin{align}\label{eq:relabelstatesexample} \nonumber&\expec*{E_0^{\{A'_1,A''_1\}}E_1^{\{A'_2,A''_2\}}F_0^{\{B'_1,B''_3\}}G_0^{\{C'_1,C''_1\}}}_\rho\\ \nonumber&\qquad\quad^{\text{apply }\rho_{AB}^1\leftrightarrow\rho_{AB}^2}\\ &=\expec*{E_0^{\{A'_1,A''_2\}}E_1^{\{A'_2,A''_1\}}F_0^{\{B'_2,B''_3\}}G_0^{\{C'_1,C''_1\}}}_\rho\\ \nonumber&\qquad\quad^{\text{apply }\rho_{AB}^1\leftrightarrow\rho_{AB}^3}\\ &=\expec*{E_0^{\{A'_1,A''_2\}}E_1^{\{A'_2,A''_3\}}F_0^{\{B'_2,B''_3\}}G_0^{\{C'_1,C''_1\}}}_\rho\\ \nonumber&\qquad\quad^{\text{apply }\rho_{BC}^1\leftrightarrow\rho_{BC}^3}\\ &=\expec*{E_0^{\{A'_1,A''_2\}}E_1^{\{A'_2,A''_3\}}F_0^{\{B'_2,B''_1\}}G_0^{\{C'_3,C''_1\}}}_\rho, \end{align}\end{subequations} \noindent where, for readability, we identify ${\hat{O}^{\boldsymbol{s}|A}_{a|\emptyset}}$ ${(\hat{O}^{\boldsymbol{s}|B}_{b|\emptyset})}$ ${[\hat{O}^{\boldsymbol{s}|C}_{c|\emptyset}]}$ with $E^{\boldsymbol{s}}_a$ ${(F^{\boldsymbol{s}}_b)}$ ${[G^{\boldsymbol{s}}_c]}$ per Eq.~\eqref{eq:notationtranslation}. \subsubsection*{Consistency with identifiable monomials} Finally, the crucial ingredient that connects an inflated network to the observed correlations is that, as described by Eq.~\eqref{stat} in Sec.~\ref{sec:simple}, certain expectation values pertaining to the inflated network can be related to products of the probabilities of $P_\text{obs}$. We refer to those products of probabilities as the \term{identifiable monomials}. Let $n$ be the order of the considered inflation. We first single out the $j^\text{th}$ copy of each state, for $j=1,\ldots,n$. For each random variable $k$, we write $\vec{j}_k$ for the set of Hilbert spaces on which $k$ acts with the copy labels of all Hilbert spaces set to $j$ (e.g., $\vec{1}_A=\{A'_1,A''_1\}$ and $\vec{2}_A=\{A'_2,A''_2\}$ in Fig.~\ref{fig:quantum_inflation}); we write $i_{j,k}$ for the measurement outcome of $k$ and $m_{j,k}$ for its measurement setting, so we end up describing the operator $\hat{O}^{\vec{j}_k|k}_{i_{j,k}|m_{j,k}}$. For fixed $j$, the product of these operators over all random variables $k$ has an expectation value that reproduces the observed probability ${P_\text{obs}}{\left(\bigcap_k (i_{j,k}|m_{j,k},k)\right)}$. Now, if we furthermore take the product of $j$ over all $n$ copies, the expectation value of the resulting operator reproduces a degree-$n$ monomial comprised of observable probabilities. Formally, for any set of indices $\{i_{j,k},m_{j,k}\}_{j,k}$, we have that \begin{align} &\expec*{\prod_{j=1}^n\prod_{k}\hat{O}^{\vec{\boldsymbol{j}}_{k}|k}_{i_{j,k}|m_{j,k}}\hspace{-0.3ex}}_{\hspace{-1ex}\rho}=\prod_{j=1}^n {P_\text{obs}}{\left(\bigcap_k (i_{j,k}|m_{j,k},k)\hspace{-0.5ex}\right)}, \label{consistent} \end{align} where $(i|m,k)$ denotes the event of probing $k$ with setting $m$ and obtaining the result $i$, and where $\vec{\boldsymbol{j}}_{k}$ indicates that this operator acts nontrivially on only the Hilbert spaces associated with copy index $\boldsymbol{\sigma}{=}\{jj\dots\}$ of those original sources which are parents of party $k$. See Eq.~\eqref{stat} for an example of this consistency rule applied to the triangle scenario. The constraints~\eqref{rules}, \eqref{commutation:copies}, \eqref{eq:symconstraint} and \eqref{consistent} are satisfied by the overall state and operators involved in an $n^\text{th}$-order quantum inflation of a particular causal process with observed distribution $P_\text{obs}$. All have a form suitable to assess their physical realizability through NPO via a feasibility problem. The same machinery can easily be adapted to optimization problems beyond feasibility. Crucially, the left-hand side of Eq.~\eqref{consistent}, under the constraints \eqref{rules}-\eqref{eq:symconstraint}, can be interpreted as a relaxation of the convex hull of $n$ independent copies of a distribution $P_\text{obs}$ compatible with the considered causal structure. Therefore, quantum inflation can be exploited not only for assessing whether an observed probability distribution can be generated in a particular quantum causal scenario, but also to optimize Bell-like polynomial expressions $B(P_\text{obs})$ over all quantum $P_\text{obs}$ admitting a given causal explanation, so long as the polynomial $B(P_\text{obs})$ makes reference only to identifiable monomials. The key idea is to express any Bell-like polynomial $B$ as a linear function over the expectation values $\expec*{\prod_j O_j}$, via the correspondence \eqref{consistent}. Minimizing or maximizing such a linear combination of expectation values can also be cast as a noncommutative polynomial optimization problem, that can be similarly tackled with NPO. In many polynomial optimization problems, no information about the distribution $P_\text{obs}$ is specified in advance; in Sec.~\ref{sec:opt} we show an explicit example of how Eq.~\eqref{consistent} is exploited in the optimization of polynomial Bell operators. In other cases, such as the quantum network security analysis in Sec.~\ref{sec:cryptography}, we consider polynomial optimization subject to partial specification of the identifiable monomials, for instance, if one has constraints pertaining to marginals of $P_\text{obs}$. In fact, this idea can be generalized even further to carry optimizations over polynomials of arbitrary operator averages, i.e., not necessarily those averages related to products of observed probabilities (we show a simple example in Sec.~\ref{sec:results:nonlinear}). Moreover, the quantum inflation technique can also be applied for studying classical causal inference. We explain how to do so in Sec.~\ref{sec:classical}, but, before that, we describe how to extend the ideas above to arbitrary quantum causal networks. \section{ARBITRARY CAUSAL SCENARIOS}\label{sec:arbitrary} In the previous section, we provide a systematic method to characterize the correlations achievable in a subset of quantum causal networks, namely, two-layer DAGs, where no node has both parents and children and where every observable node has at most one observable parent. Let us denote such DAGs to have a \term{network form}. In this section, we generalize all previous methodology to characterize correlations in arbitrary causal structures composed of the elements described in Sec.~\ref{sec:structures}. Namely, we explain how an arbitrary causal structure composed of these elements can be reduced to network form cases, which we can already solve. \subsection{Visible nodes with parents and children: Maximal interruption}\label{sec:interruption} The first generalization we consider extends our techniques for network form DAGs to arbitrary so-called \term{latent exogenous} causal structures, where all unobserved nodes are root nodes but otherwise classical variables can have both parents and children. \begin{figure}[b] \begin{center} \hfill \subfigure[\label{fig:instrumental}] {\centering \includegraphics[scale=0.45]{InstrumentalDAG.pdf} } \hfill \subfigure[\label{fig:instinterrupted}] {\centering \includegraphics[scale=0.45]{InstrumentalDAGInterrupted.pdf} } \hfill \end{center} \caption[]{(a) The instrumental causal structure and (b) its maximal interruption, which is isomorphic to the standard causal structure of a Bell experiment. Tsirelson-type inequalities pertaining to the interrupted graph are translated into constraints for the quantum instrumental scenario~\cite{Himbeeck2018instrumental,Agresti2019,Quantifying2020} via the postselection relation ${P_{\text{\ref{fig:instrumental}}}(A{=}a,B{=}b|X{=}x)} = {P_{\text{\ref{fig:instinterrupted}}}(A{=}a,B{=}b|X{=}x,A^{\#}_1{=}a)}$. } \label{fig:instinterruptionexample} \end{figure} \begin{figure}[b] \begin{center} \hfill \subfigure[\label{fig:BellPlus}] {\centering \includegraphics[scale=0.45]{BellPlus.pdf} } \hfill \subfigure[\label{fig:BellPlusinterrupted}] {\centering \includegraphics[scale=0.45]{BellPlusInterrupted.pdf} } \hfill \end{center} \caption[]{(a) A Bell-like causal structure with a setting common to both parties and (b) its maximal interruption, which is a Bell causal structure assigning distinct outcome variables wholly distinct input variables. Quantum correlations in the common-setting scenario (a) can be explored by applying the standard NPA semidefinite programming hierarchy~\cite{npa,npa2} to the scenario in (b) and then translating back to (a) according to the postselection relation ${P_{\text{\ref{fig:BellPlus}}}(A{=}a,B{=}b|X{=}x,Y{=}y,S{=}s)} = {P_{\text{\ref{fig:BellPlusinterrupted}}}(A{=}a,B{=}b|X{=}x,Y{=}y,S^{\#}_1{=}S^{\#}_2{=}s)}$. } \label{fig:Bellinterruptionexample} \end{figure} We use the term \term{maximal interruption} to refer to our procedure for mapping the correlations of any latent-exogenous causal structure to the correlations of a unique network form structure. The procedure is based on recursive application of two simple rules. First, suppose a directed edge is found to originate from an \emph{endogenous} (nonroot) observable node, such as node $A$ in Fig.~\ref{fig:instrumental}. Such a node is playing two distinct roles simultaneously: On the one hand, it acts like a setting variable relative to its children. On the other hand, it acts like an outcome variable relative to its parents. The standard NPA semidefinite programming hierarchy~\cite{npa,npa2} presumes that every variable is exclusively either a setting or an outcome, however. Interruption splits such dual-role nodes in two, yielding a gedanken experiment graph with an effective outcome node as well as an effective setting node; see Fig.~\ref{fig:instinterrupted}. Postselecting on the effective outcome variable, for example, $A$ in Fig.~\ref{fig:instinterrupted}, taking a value that matches that of the effective setting variable, $A^{\#}_1$ in Fig.~\ref{fig:instinterrupted}, allows us to characterize the set of distributions compatible with the original graph as a projection of the space of distributions compatible with the interrupted graph. This idea has precedent in classical causal networks in the single-world intervention graphs pioneered by Ref.~\cite{Richardson2013SingleWI} (see also the node-splitting procedure of~Ref.~\cite{BarrettQCM}), as well as the $e$-separation technique introduced in Ref.~\cite{evans2012graphicalmethods}. Interruption of the sort illustrated in Fig.~\ref{fig:instinterruptionexample} is already exploited in quantum information research in Refs.~\cite{Himbeeck2018instrumental,Agresti2019,Quantifying2020}. \begin{figure}[b] \begin{center} \hfill \subfigure[\label{fig:tointerrupt}] {\centering \includegraphics[scale=0.45]{ExampleForInterruption.pdf} } \hfill \subfigure[\label{fig:interrupted}] {\centering \includegraphics[scale=0.45]{ExampleForInterruptionInterrupted.pdf} } \hfill \end{center} \caption[]{An example causal structure (a) and its maximal interruption (b). Note that in (a) the observable nodes $A$ and $B$ both possess at least one parent node as well as at least one child node. Additionally, the observable nodes $A$ and $X$ have multiple child nodes. Constraints on distributions extended to the interrupted graph (such as those obtained via quantum inflation) are translated into constraints on the original distribution using the postselection relation ${P_{\text{\ref{fig:tointerrupt}}}(A{=}a,B{=}b,C{=}c|X{=}x)} = {P_{\text{\ref{fig:interrupted}}}(A{=}a,B{=}b,C{=}c|X^\#_1{=}X^\#_2{=}x,A^{\#}_1{=}A^{\#}_2{=}a,B^{\#}_1{=}b)}$. The maximally interrupted DAG in (b) has the two-layer network structure considered in Sec.~\ref{sec:details}. } \label{fig:interruptionexample} \end{figure} The other rule relevant to maximal interruption involves the case where one observable node has multiple children, such as node $S$ in Fig.~\ref{fig:BellPlus}. If every outcome node is considered a ``party'' in the interpretation of Bell scenario causal structures, then such nodes can be thought of setting variables which are common to more than one party. Think of Fig.~\ref{fig:BellPlus} as a Bell experiment in which Alice's (respectively, Bob's) setting consists of one bit determined by a source of private randomness $X$ (respectively, $Y$), as well as one bit determined by a shared random number $S$. Without loss of generality, we can characterize the set of correlations that Alice and Bob can observe in this scenario by instead characterizing compatibility relative to Fig.~\ref{fig:BellPlusinterrupted} and then postselecting on $S^{\#}_1{=}S^{\#}_2$. That is, we can characterize the set of correlations that Alice and Bob \emph{would} observe if the $S$ bit for Alice and the $S$ bit for Bob were independent---i.e., Fig.~\ref{fig:BellPlusinterrupted}---such that the set of distributions compatible with Fig.~\ref{fig:BellPlus} is the projection of the set of distributions compatible with the independent-settings scenario onto the subspace where $S^{\#}_1{=}S^{\#}_2$. Maximal interruption, then, is the combination of both these two forms of node splitting. Graphically, maximal interruption modifies a graph $\mathcal{G}$ as follows: For every observed variable $V$ which is neither a root node nor a terminal node, as well as for any $V$ having multiple children, we introduce $k$ new variables $\{V^{\#}_i\}_i$ where $k$ denotes the number of edges outgoing from $V$. We then replace each edge formerly originating from $V$ by an edge originating from the corresponding $V^{\#}_i$. In the resulting (partially) \emph{interrupted} graph $\mathcal{G}'$ , $V$ is a terminal node and every $V^{\#}_i$ is a root node. The correlations in $\mathcal{G}'$ are related to those in the original graph $\mathcal{G}$ by postselection, namely \begin{align}\label{eq:interruptioncondition} P_{\mathcal{G}}(\dots,V{=}v) = P_{\mathcal{G}'}(\dots,V{=}v|V^{\#}_1{=}\dots{=}V^{\#}_k{=}v). \end{align} Proceeding in this fashion, any latent exogenous causal structure can be converted into a network form. A graphical example of this conversion is shown in Fig.~\ref{fig:interruptionexample}. Distributions over the nodes of the interrupted graph $\mathcal{G}'$ constitute \emph{extensions} of distributions pertaining to the original graph. That is, observed statistics $P$ pertaining to $\mathcal{G}$ only partially specify an extension $P'$ to $\mathcal{G}'$. Critically, a distribution $P$ is compatible with a graph $\mathcal{G}$ if and only if there exists some \term{valid extension} $P'$ of $P$ which is compatible with the interrupted graph $\mathcal{G}'$. $P'_{\boldsymbol{AB}\vert\boldsymbol{A}^\#}$ is said to constitute a valid extension of the original distribution $P_{\boldsymbol{AB}}$ when $P'_{\boldsymbol{AB}\vert\boldsymbol{A}^\#}$ is compatible with the interruption graph $\mathcal{G}'$ and recovers the original distribution $P_{\boldsymbol{AB}}$ under postselection. Formally, we have the following lemma.\par \medskip \begin{samepage} \noindent\textbf{Fundamental Lemma of Interruption} \begin{align}\begin{split}\label{eq:interruption} P_{\boldsymbol{A}\boldsymbol{B}}\in & \textsf{CompatibleDistributions}\big[\mathcal{G}\big]\\ \text{iff}\quad \exists_{P'}\:& :\:\: P'_{\boldsymbol{AB}\vert\boldsymbol{A}^\#} \in \textsf{ValidExtensions}_{\mathcal{G'}}\big[P_{\boldsymbol{AB}}\big],\\ \text{i.e.}\quad & P_{\boldsymbol{AB}}(\boldsymbol{ab})=P'_{\boldsymbol{AB}\vert\boldsymbol{A}^\#}(\boldsymbol{ab} \;\;\vert\,\boldsymbol{a})\\ \text{and}\quad & P'_{\boldsymbol{A}\boldsymbol{B}\vert\boldsymbol{A}^\#}\in \textsf{CompatibleDistributions}\big[\mathcal{G'}\big]. \end{split}\end{align} \end{samepage} This result allows us to witness causal incompatibility relative to $\mathcal{G}$ by witnessing causal incompatibility relative to $\mathcal{G}'$. Since $\mathcal{G}'$ is of network form, we can readily apply quantum inflation to it. \subsection{Latent nodes with parents}\label{sec:nonexog} The remaining case that needs to be considered is that of latent nonexogenous causal structures, where latent nodes can have parents. The Evans exogenization procedure \cite{Evans2018NMP} allows \emph{classical} latent nonexogenous structures to be transformed into latent exogenous causal structures with the same predictive power. The procedure consists in replacing all arrows from a parent node to a latent node with arrows from the parent node to the children of the latent node. This operation is repeated for all parents of all latent nodes such that finally all latent variables become parentless. When applied to quantum latent variables, however, exogenization results in a new quantum network that, in general, does not predict the same distributions of observed events as its predecessor. This result is again related to the impossibility of broadcasting quantum information~\cite{NoCloningGeneral2006}. The example in Fig.~\ref{fig:Exog}, evidencing this compatibility mismatch, is wholly due to Stefano Pironio. \begin{figure}[!b] \begin{center} \hfill \subfigure[\label{fig:NonExog}] {\centering \includegraphics[scale=0.45]{StephanoExample.pdf} } \hfill \subfigure[\label{fig:ExogAnalog}] {\centering \includegraphics[scale=0.45]{StephanoExampleExogenized.pdf} } \hfill \end{center} \caption[]{In (a), there is a causal structure with $\rho_{BC}$ being a nonexogenous unobserved quantum node. In (b), there is a different causal structure, corresponding to the classical latent reduction of the former. While these two graphs are equivalent if the unobserved nodes are classical, they are demonstrably inequivalent when the unobserved nodes are quantum.} \label{fig:Exog} \end{figure} To make the issue explicit, in the original network shown in Fig.~\ref{fig:NonExog} the variable $S$ has the interpretation of a setting, which adjusts the state $\rho_{BC}$ before it is sent to $B$ and $C$. Thus, it is possible for ${P(A,B|X,Y,S{=}0)}$ to maximally violate a Bell inequality for $A$ and $B$, and ${P(A,C|X,Z,S{=}1)}$ to maximally violate a Bell inequality for $A$ and $C$. If one applies the Evans exogenization procedure to the original network, one obtains the network in Fig.~\ref{fig:ExogAnalog}. However, no quantum state prepared independently of $S$ can maximally violate a Bell inequality between $A$ and $B$ and at the same time maximally violate another Bell inequality between $A$ and $C$, due to the monogamy of quantum correlations~\cite{Toner2009,Seevinck2010}. Consequently, it is not possible to reproduce such correlations within the causal network in Fig.~\ref{fig:ExogAnalog}, a product of applying Evans exogenization to Fig.~\ref{fig:NonExog}. One way to deal with this predicament is to regard observable variables with unobserved children as random variables indicating the classical control of a quantum channel. If a nonroot latent node has latent parents, then it is understood as a controlled channel on the Hilbert space defined by the latent parents. If, instead, a nonroot latent node has exclusively observable parents, then the latent node is regarded as a controlled source of quantum state preparation, which we model as a source of quantum states followed by a quantum channel controlled by the observable parents. In the same way, latent variables with latent children are treated as uncontrolled quantum channels (we defer to Appendix~\ref{app:nonexog} the discussion that illustrates the need to account for this type of channels). Thus, in Fig.~\ref{fig:NonExog}, we treat the latent variable $\rho_{AS}$ as a joint quantum state and the root variable $S$ as the classical control for a quantum channel acting on the $BC$ subsystems. That is, one understands ${\rho_{ABC|S=s}=\hat{U}_s \rho_{AS} \hat{U}^{\dagger}_s}$, where, for all values of $s$, $\hat{U}_s$ is a unitary operator that commutes with any operator acting solely on $A$'s subsystem. As such, the joint distribution of the values of the visible variables $A$, $B$, and $C$ conditioned on the root visible nodes can be understood as generated by \begin{align*} P(A&{=}a,B{=}b,C{=}c|X{=}x,Y{=}y,Z{=}z,S{=}s)\\ & =\expec*{ \hat{U}^{\dagger}_s \hat{A}^a_x \hat{B}^b_y \hat{C}^c_z \hat{U}_s}_{\rho_{AS}} =\expec*{\hat{A}^a_x \hat{U}^{\dagger}_s \hat{B}^b_y \hat{C}^c_z \hat{U}_s}_{\rho_{AS}}. \end{align*} This interpretation can be made without loss of generality, since the subspace $S$ of the complete Hilbert space $AS$ can be understood as containing the subspaces corresponding to $B$ and $C$. As in the exogenous case, an $n^\text{th}$-order inflation of a causal structure with nonexogenous quantum variables requires taking $n$ copies of the unobserved root nodes and of the unobserved nodes with only visible parents. Each unitary operator $\hat{U}_s$ in the original causal structure gives rise to operators of the form $\hat{O}^{\{S^j\}|U}_{s}$ in the inflated graph, where $j$ denotes the copy of the Hilbert space where $\hat{U}_s$ acts. The unitary or outcome operators associated to the descendants of any such ``unitary node'' (for instance, $B$ and $C$, in Fig.~\ref{fig:Exog}) inherit the copy label $j$ of the Hilbert space $S^j$. With this last prescription, the symmetry relabeling rule [Eq.~\eqref{eq:symconstraint}] still holds. However, the projection rules [Eqs. \eqref{rule1} and \eqref{rule2}] hold only if the noncommuting variable $k$ in question corresponds to an outcome variable in the original graph. If $k$ corresponds to a unitary variable, then the operator $\hat{O}^{\boldsymbol{s}|k}_{m}$ must be subject to the constraints \begin{equation} \hat{O}^{\boldsymbol{s}|k}_{m}(\hat{O}^{\boldsymbol{s}|k}_{m})^\dagger=(\hat{O}^{\boldsymbol{s}|k}_{m})^\dagger\hat{O}^{\boldsymbol{s}|k}_{m}=\boldsymbol{\mathbb{1}}. \end{equation} The commutation rule \eqref{commutation:copies} remains valid upon qualifying that the Hilbert spaces listed in $\boldsymbol{s}_1\cup\boldsymbol{s}_2$ must be simultaneously coexisting in the original graph. For example, in Fig.~\ref{fig:NonExog}, the operators corresponding to the Hilbert spaces associated to the outcome variables $B$ and $C$ coexist after the transformation $U_s$ is applied over system $S$. It follows that the corresponding measurement operators $O^{\boldsymbol{s}|B}_{b|y}$ and $O^{\boldsymbol{s}'|C}_{c|z}$ commute. Finally, rule \eqref{consistent} expressing consistency with identifiable monomials must also be amended to take into account that descendants of a unitary variable must be bracketed by the corresponding unitary and its adjoint. Note that the aforementioned operator and statistical constraints are all polynomial, and, thus, they can all be enforced in the framework of NPO theory. Interruption, classical exogenization, and the treatment for quantum exogenous variables hereby presented cover all possible nontrivial causal influences in arbitrary quantum causal structures composed of preparations, transformations, and measurements as described in Sec.~\ref{sec:structures}. Quantum inflation is, therefore, a technique of full applicability to bound the quantum correlations achievable in general causal scenarios. \section{SDP FOR CLASSICAL COMPATIBILITY}\label{sec:classical} The quantum inflation technique can be easily adapted for solving the problem of causal compatibility with an arbitrary \emph{classical} causal structure. It is known that any correlation achievable with only classical latent variables can be realized in terms of commuting measurements acting on a quantum state~\cite{baccari2017classical}. Therefore, in order to detect correlations incompatible with classical structures, one must generalize the commutation relations in the original quantum inflation method to the constraint that any pair of measurement operators commutes. That is, \begin{equation*} \hat{O}^{\boldsymbol{s}_1|k_1}_{i_1|m_1} \!\!\cdot \hat{O}^{\boldsymbol{s}_2|k_2}_{i_2|m_2} = \hat{O}^{\boldsymbol{s}_2|k_2}_{i_2|m_2} \!\!\cdot \hat{O}^{\boldsymbol{s}_1|k_1}_{i_1|m_1}, \end{equation*} for all $\boldsymbol{s}_1$, $\boldsymbol{s}_2$, $k_1$, $k_2$, $m_1$, $m_2$, $i_1$, and $i_2$. This generalization defines a hierarchy of constraints that classical correlations compatible with a given causal structure must satisfy. Contrary to the quantum case, the NPO hierarchy with commuting operators associated to a fixed inflation level is guaranteed to converge at a finite level. In fact, for NPO hierarchy levels higher than $N\cdot m\cdot(d{-}1)$---where $N$ is the number of parties, $m$ is the number of settings per party, and $d$ is the number of outcomes per measurement---application of the commutation relations allows one to reduce any product of the operators involved into one of shorter length. For a fixed inflation level, the problem solved at the highest level of the NPO hierarchy is analogous to the linear program solved in classical inflation~\cite{wolfe2016inflation} at the same inflation level. In contrast with the original classical inflation technique, the classical variant of the quantum inflation technique described in this work uses semidefinite programming and exhibits far more efficient scaling with the inflation hierarchy than the original linear programming approach~\cite{navascues2017inflation}. One must note that this gain in efficiency comes at the expense of introducing further relaxations in the problem. Nevertheless, this classical variant of quantum inflation is capable of recovering a variety of seminal results of classical causal compatibility, such as the incompatibility of the so-called W and GHZ distributions (described in the results sections) with classical realizations in the triangle scenario. It also identifies the distribution described by Fritz~\cite{fritz2012bell}, known to have a quantum realization in the triangle scenario, as incompatible with classical realizations. For all these results, the relaxed SDP formulation is far less memory demanding than the raw linear programming formulation. Furthermore, the SDP approach is the only method that can be used when using inflation to assess causal compatibility in the presence of terminal nodes which can take continuous values. In conclusion, not only can quantum inflation be leveraged to obtain results for networks with classical sources, but we argue that it is the most suitable technique to be used for addressing causal compatibility with classical realizations in large networks. \section{APPLICATIONS TO QUANTUM CORRELATIONS IN NETWORKS}\label{sec:results} We illustrate in this section various problems akin to quantum information science where quantum inflation provides a means to its solution or to approximations of it. We focus here on broad classes of problems (determining whether a distribution can be generated in a quantum network, finding witnesses of network nonlocality, and characterizing the quantum correlations achievable in a particular network) that underlie many practical problems and which we illustrate in concrete examples of relevance. Except those in Secs.~\ref{sec:SimpleTriangle}~and~\ref{sec:Bilocality}, all the results described are novel, and quantum inflation outperforms alternative methods for characterizing quantum network correlations.\footnote{In the particular case in Sec.~\ref{sec:SimpleTriangle}, we still answer an open problem, although we later find that the same result can also be derived by using nonfanout classical inflations of the triangle scenario. Note that nonfanout classical inflations yield GPT-valid---and, hence, also quantum-valid---constraints~\cite{wolfe2016inflation}.} Moreover, to date, quantum inflation is the only technique capable of making strong quantitative statements about genuine multipartite quantum nonlocality under local operations and shared randomness (as illustrated in Ref.~\cite{Schmid2020LOSR}), in that it is \emph{the} natural framework for studying the device-independent analog of genuine network multipartite entanglement~\cite{navascues2020gnme}. \subsection{Quantum causal compatibility} We begin by showing examples of specific probability distributions that we are able to identify as incompatible with various tripartite quantum causal networks. While quantum inflation applies to networks with observed variables of arbitrary cardinality, we hereafter consider scenarios involving exclusively two-output observed variables. We adopt the standard notations and label these outputs as $\{0,1\}$, unless otherwise specified. \subsubsection{The triangle scenario} \label{sec:SimpleTriangle} \begin{figure}[t] \centering \includegraphics[scale=0.45]{TriangleNoSettings.pdf} \caption{The quantum triangle scenario, without settings. Each of the observable variables $A$, $B$, and $C$ are dependent only on the sources of bipartite entanglement. This figure is essentially a reproduction of Fig.~\ref{fig:TriangleNoSettings}, the only difference being some added specificity regarding the quantum nature of the latent nodes.} \label{fig:TriangleNoSettingsQ} \end{figure} We start with the simplest version of the triangle scenario consisting of three parties that are influenced in pairs by bipartite latent variables, as depicted in Fig.~\ref{fig:TriangleNoSettingsQ}. The first example we study in this scenario is the so-called W distribution. This distribution is defined by the task of all parties outputting the outcome $0$ except one, which should output $1$. Explicitly, it is \begin{equation} P_\text{W}(a,b,c)\coloneqq\begin{cases} \frac{1}{3} & a+b+c=1, \\ 0 & \text{otherwise.} \end{cases} \label{wdistribution} \end{equation} The W distribution is proven in Ref.~\cite{wolfe2016inflation} not to be realizable in the triangle scenario when the latent variables are classical. Additionally, it is easy to see that it is realizable with tripartite classical randomness. However, the question of whether the W distribution is realizable in the quantum triangle scenario remained open. It can be shown that $P_\text{W}$ does not admit a second-order quantum inflation, and a witness that certifies this incompatibility can be found in Eq.~\eqref{eq:Wwitness}. Therefore, a quantum realization of the W distribution in the triangle scenario is impossible. Quantum inflation is robust and certifies that, when mixing the W distribution with white noise, the resulting distribution $P_{\text{W},v}(a,b,c)\coloneqq v P_\text{W}(a,b,c)+(1-v)/8$ does not have a quantum realization in the triangle for all visibilities $v$ higher than $3(2-\sqrt{3})\approx0.8039$. This result is obtained by solving the NPO program associated to a second-order inflation and the set of monomials $\mathcal{L}_2$ (see Appendix~\ref{app:sets} for the definition of this set), restricted to operators of length ${\leq}\,3$. \subsubsection{The triangle scenario with settings}\label{sec:Mermin} \begin{figure}[t] \centering \includegraphics[scale=0.45]{TriangleWithSettings.pdf} \caption{The quantum triangle scenario with settings, sometimes denoted $\mathcal{Q}^{\triangle}$ for brevity. Each of the observable variables $A$, $B$, and $C$ are now dependent not only on the sources of bipartite entanglement, but on additional observable classical variables $X$, $Y$, and $Z$ representing measurement choices.} \label{fig:TriangleWithSettings} \end{figure} One can also consider more complicated networks that include additional observable variables to encode for choices of discrete measurement settings. Figure~\ref{fig:TriangleWithSettings} shows this type of network for the case of the triangle scenario. In this setup we study the Mermin-GHZ distribution, defined by $P_{\text{Mermin}}(a,b,c|x,y,z)\coloneqq$ \begin{align}\label{eq:MerminBox} \begin{cases} 1/8 & x+y+z=0 {\mod{}} \;\; 2,\\ \left(1+(-1)^{a+b+c}\right) /8 & x+y+z=1, \\ \left(1-(-1)^{a+b+c}\right) /8 & x+y+z=3. \end{cases} \end{align} Quantum inflation also allows one to prove that the Mermin-GHZ distribution is not compatible with a quantum realization in the triangle scenario with inputs, by showing that $P_\text{Mermin}$ does not admit a second-order quantum inflation; such incompatibility is certified by the violation of Eq.~\eqref{eq:merminwitness}. Additionally, its noisy version $P_{\text{Mermin},v}\coloneqq v P_\text{Mermin}+(1-v)/8$ can be proven not to have a quantum realization for any visibility $v$ higher than $\sqrt{2/3}\approx 0.8165$. \subsubsection{The tripartite-line scenario}\label{sec:Bilocality} Quantum inflation is organized as an infinite hierarchy of necessary conditions. There are, however, situations in which it recovers the quantum boundary at a finite step. An example of these situations is provided by the tripartite-line scenario in Fig.~\ref{fig:TripartiteLine}, which underlies phenomena such as entanglement swapping. The tripartite-line scenario constitutes the essential causal unit employed in quantum repeaters and long-distance entanglement distribution networks. The main characteristic of this structure is that there is no causal connection between the extreme variables $A$ and $C$. As a consequence of this characteristic, all correlations realizable in the tripartite-line scenario satisfy the following factorization relation \begin{equation} \sum_b P_\text{obs}(a,b,c|x,y,z)=P_\text{obs}(a|x)P_\text{obs}(c|z). \label{eq:linecompatible} \end{equation} \begin{figure}[t] \centering \includegraphics[scale=0.45]{BilocalityQ.pdf} \caption[]{\label{fig:TripartiteLine} The tripartite-line causal scenario, where two causally independent parties $A$ and $C$ each share some quantum entanglement with a central party $B$, sometimes denoted $\mathcal{Q}^{{\protect\text{\scalebox{2}[1]{\rotatebox{90}{\faShareAlt}}}}}$ for brevity. This figure is a reproduction of Fig.~\ref{fig:Bilocality}.} \label{fig:BilocalityCopy} \end{figure} This scenario is thoroughly studied in the literature~\cite{branciard2010bilocality,branciard2012bilocality}. In fact, it is known that the probability distribution \begin{equation} {P_{\text{2PR}}(a,b,c|x,y,z)\coloneqq\left[1+(-1)^{a+b+c+xy+yz}\right]/8}, \end{equation} despite satisfying the constraint of Eq.~\eqref{eq:linecompatible}, cannot be realized in the tripartite-line scenario in terms of classical or quantum latent variables. However, it is known that its mixture with white noise, \mbox{$P_{\text{2PR},v}\coloneqq vP_{\text{2PR}}+(1-v)/8$}, can be realized if the visibility parameter $v$ is sufficiently small~\cite{branciard2012bilocality}. $P_{\text{2PR},v}$ admits a realization in terms of quantum latent variables for any $0 \,{\leq}\, v \,{\leq}\, 1/2$ and in terms of classical latent variables for any $0 \,{\leq}\, v \,{\leq}\, 1/4$. Quantum inflation correctly recovers that all $P_{\text{2PR},v}$ with visibility $v\,{>}\,1/2$ are incompatible with the quantum tripartite-line scenario. It does so by certifying that, for any $v\,{>}\,1/2$, the corresponding $P_{\text{2PR},v}$ does not admit a second-order inflation, and this infeasibility is found already at the NPO hierarchy level corresponding to the set $\mathcal{S}_2$ (see Appendix~\ref{app:sets} for a definition of this monomial set). That is, in this scenario, a finite order of quantum inflation, namely, the second, already singles out the whole region of quantum violation. Furthermore, we can also contrast against realizations in terms of classical latent variables by following the predicament in Sec.~\ref{sec:classical}, that is, by imposing that all operators in the problem commute. This classical version of quantum inflation, when analyzing compatibility with a third-order inflation, solving the NPO problem associated to the corresponding set of monomials $\mathcal{L}_1$ (its definition can be found in Appendix~\ref{app:sets}), witnesses that all $P_{\text{2PR},v}$ with visibility $v\,{>}\,0.328$ cannot be realized in terms of classical hidden variables. Lower values of this bound can, in principle, be achieved by considering higher inflation orders and larger monomial sets. The required computational capabilities for solving these problems, however, fall outside those provided by standard tabletop computers. We defer the interested reader to Sec.~\ref{sec:conclusions} for a brief discussion on the computational cost of implementing quantum inflation, and to Ref.~\cite[Chap. 5]{alexThesis} for a fuller analysis. \begin{figure}[t] \centering \includegraphics[scale=0.3]{bilocality_bounds.pdf} \caption{ Summary of results recoverable with quantum inflation in the tripartite-line scenario in Fig.~\ref{fig:Bilocality} (orange dashed lines). $\mathcal{Q}^\protect\text{\scalebox{2}[1]{\rotatebox{90}{\faShareAlt}}}$ and $\mathcal{L}^\protect\text{\scalebox{2}[1]{\rotatebox{90}{\faShareAlt}}}$ denote, respectively, the sets of quantum and classical correlations that can be generated in the tripartite-line scenario. Quantum inflation correctly recovers that all $P_{\text{2PR},v}$ with visibility $v\,{>}\,1/2$ are incompatible with the quantum tripartite line scenario already at the NPO hierarchy finite level $\mathcal{S}_2$ when assessing compatibility with a second-order inflation. When imposing that all measurements commute, it witnesses that all $P_{\text{2PR},v}$ with visibility $v\,{>}\,0.328$ cannot be realized in terms of classical hidden variables.} \label{fig:line_results} \end{figure} \subsection{Witnesses of quantum causal incompatibility}\label{sec:witness} A feature of semidefinite programming that has been widely employed in quantum information theory is the fact that the solution certificates of SDPs can be interpreted as Bell-like inequalities or witnesses that are capable of identifying correlations not attainable using the considered resources~\cite{npa2,baccari2017classical}. The certificates obtained when using quantum inflation can have a similar interpretation as witnesses of quantum causal incompatibility. For instance, the certificate that provides the value of ${v_\text{max}=6-3\sqrt{3}\approx 0.8039}$ for the W distribution in the quantum triangle scenario gives rise to the inequality \begin{align} \nonumber&\textbf{W's Certificate}\\ &\begin{psmallmatrix*}[l] -2P_\text{inf}(a^{\{A'_1,A''_1\}}{=}0) \\ + P_\text{inf}(a^{\{A'_1,A''_1\}}{=}0,a^{\{A'_2,A''_2\}}{=}0) \\ - 2 P_\text{inf}(a^{\{A'_1,A''_1\}}{=}0,b^{\{B'_1,B''_1\}}{=}0) \\ + 4 P_\text{inf}(a^{\{A'_1,A''_1\}}{=}0,b^{\{B'_2,B''_2\}}{=}0) \\ - 4 P_\text{inf}(a^{\{A'_1,A''_1\}}{=}0,b^{\{B'_1,B''_1\}}{=}0, \\ \hskip 1.87cm a^{\{A'_2,A''_2\}}{=}0,b^{\{B'_2,B''_2\}}{=}0) \\ + 2 P_\text{inf}(a^{\{A'_1,A''_1\}}{=}0,a^{\{A'_2,A''_2\}}{=}0,b^{\{B'_1,B''_1\}}{=}0) \\ + 2 P_\text{inf}(a^{\{A'_1,A''_1\}}{=}0,b^{\{B'_1,B''_1\}}{=}0,b^{\{B'_2,B''_2\}}{=}0) \\ - 2 P_\text{inf}(a^{\{A'_1,A''_2\}}{=}0,b^{\{B'_1,B''_2\}}{=}0,c^{\{C'_1,C''_2\}}{=}0) \\ + [A\rightarrow B\rightarrow C\rightarrow A] + [A\rightarrow C\rightarrow B\rightarrow A] \end{psmallmatrix*} \leq 0, \label{eq:Wcert} \end{align} where ${+[A\rightarrow B\rightarrow C\rightarrow A]}$ and ${+[A\rightarrow C\rightarrow B\rightarrow A]}$ mean repeating every term in the sum under the cyclic and anticyclic permutations of subsystems, respectively---thereby implicitly tripling the coefficients of any cyclic-invariant terms. This certificate is defined in terms of a quantum distribution compatible with a second-order inflation of the triangle scenario. Now, by using the rules of Eq.~\eqref{consistent} for consistency with identifiable monomials, this certificate can be transformed into a witness of tripartite distributions whose violation signals the distribution as being incompatible with a realization in the triangle scenario with quantum latent variables (note that we switch to the expectation-value picture\footnote{This result is obtained by performing the substitutions $p(i=0)=\frac{1}{2}(1+\expec*{I})$, and $p(i=0,j=0)=\frac{1}{4}(1+\expec*{I}+\expec*{J}+\expec*{IJ})$.}): \begin{align} \nonumber&\textbf{W's Witness}\\ &\begin{psmallmatrix*}[l] \expec*{A} + \expec*{A}^2 \!-\! \expec*{A}\expec*{AB}\!-\!\expec*{A}\expec*{AC} \\ -\! 2\expec*{BC} \!+\! \expec*{B}\expec*{C} \!-\! \expec*{BC}^2 \!-\! \expec*{A}\expec*{B}\expec*{C} \\ + [A\rightarrow B\rightarrow C\rightarrow A] + [A\rightarrow C\rightarrow B\rightarrow A] \end{psmallmatrix*} \leq 3. \label{eq:Wwitness} \end{align} In fact, the W distribution of Eq.~\eqref{wdistribution} attains a value of $3+\nicefrac{8}{9}$ for this witness. Remarkably, the witness obtained is polynomial in the elements of the probability distribution. This result is in stark contrast with witnesses obtained through other techniques, which are either linear in the elements of the probability distribution or in the variables' entropies. Exploiting SDP duality also enables us to obtain a polynomial witness for the infeasibility of the Mermin-GHZ distribution box discussed in Sec.~\ref{sec:Mermin}, namely, \begin{samepage} \begin{align} \nonumber&\textbf{Mermin Box Polynomial Witness}\\ &\begin{psmallmatrix*}[c] \begin{psmallmatrix*}[l] \expec{A_0B_0C_0}{}^2\\ +\expec{A_0B_1C_1}{}^2\\ +\expec{A_1B_0C_1}{}^2\\ +\expec{A_1B_1C_0}{}^2 \end{psmallmatrix*} +3 \begin{psmallmatrix*}[l] \expec{A_1B_1C_1}{}^2 \\ +\expec{A_0B_0C_1}{}^2\\ +\expec{A_0B_1C_0}{}^2\\ +\expec{A_1B_0C_0}{}^2 \end{psmallmatrix*} \\ +2\begin{psmallmatrix*}[l] \expec{A_0B_1C_1} \left(\expec{A_1B_0C_1}-\expec{A_0B_0C_0}\right)\\ +\expec{A_1B_0C_1} \left(\expec{A_1B_1C_0}-\expec{A_0B_0C_0}\right)\\ +\expec{A_1B_1C_0} \left(\expec{A_0B_1C_1}-\expec{A_0B_0C_0}\right)\\ \end{psmallmatrix*} \\ +6 \begin{psmallmatrix*}[l] \expec{A_0B_0C_1} \left(\expec{A_1B_0C_0}-\expec{A_1B_1C_1}\right)\\ + \expec{A_0B_1C_0} \left(\expec{A_0B_0C_1}-\expec{A_1B_1C_1}\right) \\ + \expec{A_1B_0C_0} \left(\expec{A_0B_1C_0}-\expec{A_1B_1C_1}\right) \end{psmallmatrix*} \end{psmallmatrix*}\leq 32. \label{eq:merminwitness} \end{align}\end{samepage} We apply this witness to the 45 nonlocal extremal points of the tripartite nonsignaling scenario~\cite{tripartiteNS} and notice that it recognizes 15 out of these 45 points as not realizable in the quantum triangle scenario.\footnote{In the ordering of Ref.~\cite{tripartiteNS}, the boxes incompatible with the quantum triangle scenario are numbers 2, 13, 21, 22, 27, 29, 30, 31, 34, 36, 39, 41, 43, 44, and 46.} \subsection{Optimization in quantum causal scenarios}\label{sec:opt} As explained in Sec.~\ref{sec:details}, the constraints~\eqref{rules}, \eqref{commutation:copies}, \eqref{eq:symconstraint}, and \eqref{consistent} characterize relaxations of the set of quantum correlations compatible with a given causal structure. This characterization can be employed to easily bound optimal values of polynomials of the measurement operators in the problem via NPO theory~\cite{npo}. We provide in what follows several examples of this procedure. \subsubsection{Optimization of linear functionals}\label{sec:results:optim:linear} As a first application, we derive upper bounds to the maximum value that certain Bell-like operators can achieve in the quantum triangle scenario. The results herein are obtained by considering second-order inflations, solving the associated NPO problems with the set of monomials $\mathcal{S}_2\cup\mathcal{L}_1$. Including the identity operator, we find that each party has nine possible operators at this SDP level, such that the resulting moment matrix involved in the calculations has size $873\,{\times}\,873$. \begin{align} \nonumber&\textbf{Mermin's Inequality~\cite{Mermin1990}}\\ \label{eq:mermin} &\begin{psmallmatrix*}[l] \expec*{A_1 B_0 C_0}\\+\expec*{A_0 B_1 C_0}\\+\expec*{A_0 B_0 C_1}\\-\expec*{A_1 B_1 C_1} \end{psmallmatrix*} \leq \begin{cases} 2 & \mathcal{L}^\triangle,\;\;\mathcal{L}^\bell \\ 3.085^* & \mathcal{Q}^\triangle \\ 4 & \mathcal{Q}^\bell,\;\;\mathcal{NS}^\triangle,\;\;\mathcal{NS}^\bell \end{cases}, \\\nonumber&\textbf{Svetlichny's Inequality~\cite{Svetlichny1987}}\\ \label{eq:svet} &\begin{psmallmatrix*}[l] \expec*{A_1 B_0 C_0}\\+\expec*{A_0 B_1 C_0}\\+\expec*{A_0 B_0 C_1}\\-\expec*{A_1 B_1 C_1}\\ -\expec*{A_0 B_1 C_1}\\-\expec*{A_1 B_0 C_1}\\-\expec*{A_1 B_1 C_0}\\+\expec*{A_0 B_0 C_0} \end{psmallmatrix*} \leq \begin{cases} 4 & \mathcal{L}^\triangle,\;\;\mathcal{L}^\bell\\ 4.405^* & \mathcal{Q}^\triangle \\ 4\sqrt{2} & \mathcal{Q}^\bell\\ 8 & \mathcal{NS}^\triangle,\;\;\mathcal{NS}^\bell \end{cases}. \end{align} In Eqs.~\eqref{eq:mermin} and~\eqref{eq:svet}, the triangle $\triangle$ denotes the causal triangle scenario, while $\bell$ refers to the standard tripartite Bell scenario where all parties receive shares of a joint quantum state. Clearly, for any set $\mathcal X=\{\mathcal L, \mathcal Q, \mathcal{NS}\}$, the bound obtained in $\mathcal X^{\triangle}$ is smaller than or equal to the one obtained in $\mathcal X^{\bell}$. The asterisk means that the values given are upper bounds; that is, quantum inflation shows that Mermin's and Svetlichny's inequalities cannot exceed $3.085$ or $4.405$, respectively, in the quantum triangle scenario, but, at the moment, it is unknown whether those values are attainable. It is known that both the algebraic maximum of $4$ for Mermin's inequality and the algebraic maximum of $8$ for Svetlichny's inequality can be achieved in the triangle structure, if one considers that the latent nodes distribute nonsignaling resources (see, for instance,~\cite[Sec.~III~C]{TripartiteViaPR}). This result means that no difference between the triangle and the Bell scenarios can be identified with these two inequalities when the latent variables represent nonsignaling resources, i.e., $\max_{\mathcal{NS}^\triangle}=\max_{\mathcal{NS}^\bell}$ for these two inequalities. Consequently, our finding here that $\max_{\mathcal{Q}^\triangle}<\max_{\mathcal{Q}^\bell}$ for these two inequalities cannot be recovered by means of the GPT-valid (nonfanout) variant of the inflation method considered in Ref.~\citep[Sec.~V~D]{wolfe2016inflation}. In a similar manner, the maximum values attainable by any linear function in the classical triangle and Bell scenarios also coincide, because, even though $\mathcal{L}^\triangle\subsetneq \mathcal{L}^\bell$, the \emph{extremal} correlations in $\mathcal{L}^\bell$ are also members of the set $\mathcal{L}^\triangle$, as the local deterministic strategies are product correlations. Remarkably, we see a divergence in linear-function optimization over $\triangle$ and $\bell$ when considering quantum latent variables. In the quantum triangle scenario, it is not possible to saturate such inequalities up to the bounds attainable in the quantum Bell scenario. This constraint has the implication that having access to tripartite quantum resources allows for improved performance in information tasks relative to having access to arbitrary bipartite quantum states and unlimited shared randomness~\cite{navascues2020gnme}. \begin{figure}[b] \begin{center} \hfill \subfigure[t][\label{fig:TriangleWithSettingsSR}] {\centering \includegraphics[scale=0.38]{TriangleWithSettingsSR} } \hfill \subfigure[t][\label{fig:BilocalityQSR}] {\centering \includegraphics[scale=0.38]{BilocalityQSR.pdf} } \hfill \end{center} \caption{(a) The quantum triangle scenario with settings and shared randomness, sometimes denoted $\mathcal{Q}^{\triangle+\text{SR}}$ for brevity. (b) The quantum tripartite-line scenario with shared randomness, sometimes denoted $\mathcal{Q}^{{\protect\text{\scalebox{2}[1]{\rotatebox{90}{\faShareAlt}}}}+\text{SR}}$ for brevity. Such ``hybrid'' DAGs denote the presence of quantum sources along with the presence of a classical source of shared randomness. The classical latent node is denoted $\Lambda$, and is depicted in white text on a dark red background to distinguish it from the other quantum latent nodes. Though $\mathcal{Q}^{\triangle+\text{SR}}$ is inequivalent to $\mathcal{Q}^\triangle$ depicted in Fig.~\ref{fig:TriangleWithSettings}, and similarly $\mathcal{Q}^{{\protect\text{\scalebox{2}[1]{\rotatebox{90}{\faShareAlt}}}}+\text{SR}}$ is inequivalent to $\mathcal{Q}^{\protect\text{\scalebox{2}[1]{\rotatebox{90}{\faShareAlt}}}}$ depicted in Fig.~\ref{fig:BilocalityCopy}, nevertheless both causal structures in each pair are equivalent up to \emph{linear}-function optimization.} \label{fig:SRDAGs} \end{figure} Recall that, while polynomial functions may differ over the triangle scenarios with and without shared randomness, \emph{linear}-function optimization is independent of the presence or absence of shared randomness.\footnote{Linear-function optimization problems are agnostic to the presence or absence of shared randomness only when there are no additional constraints on $P_\text{obs}$, as is the case with our maximizing the Mermin or Svetlichny functionals here. However, constrained optimization is \emph{not} agnostic to the presence or absence of shared randomness, even if the objective function is linear in $P_\text{obs}$. In the absence of shared randomness, constraints on $P_\text{obs}$ are incorporated into the quantum inflation semidefinite program via Eq.~\eqref{consistent}, i.e., the rule regarding consistency with identifiable monomials. However, Eq.~\eqref{consistent} does not hold in the presence of shared randomness; it is replaced by the weaker Eq.~\eqref{consistentSR}. The cryptography example in Sec.~\ref{sec:cryptography} explicitly demonstrates the dramatic impact of adding shared randomness to a linear-function optimization problem involving constraints on $P_\text{obs}$.} That is, even though $\mathcal{Q}^\triangle\subsetneq \mathcal{Q}^{\triangle+\text{SR}}\subsetneq \mathcal{Q}^{\bell}$, it is the case that $\mathcal{Q}^{\triangle+\text{SR}}$ is the convex hull of $\mathcal{Q}^\triangle$. The results above, thus, demonstrate that the Mermin-GHZ box of Eq.~\eqref{eq:MerminBox} is not achievable in $\mathcal{Q}^{\triangle+\text{SR}}$, a result relevant to Ref.~\cite{Schmid2020LOSR}. The values 3.085 and 4.405 given for $\mathcal{Q}^\triangle$ in~Eqs.~\eqref{eq:mermin} and \eqref{eq:svet} represent upper bounds to the real maximum values achievable. We can readily establish lower bounds of $2\sqrt{2}$ and $4$, respectively, by considering explicit bipartite quantum correlations for Alice and and Bob and taking Charlie to always answer $+1$. It is an open question whether, when increasing the inflation and NPO hierarchies, one will find that the values for $\mathcal{Q}^\triangle$ will collapse to those lower bounds. It should be noted that the quantum inflation technique can readily be adapted to witness the incompatibility of a given distribution with a causal structure involving \emph{classical shared randomness} in addition to quantum latent nodes, such as the quantum triangle scenario with settings and shared randomness or the quantum tripartite-line scenario with shared randomness depicted in Fig.~\ref{fig:SRDAGs}. In particular, Eqs.~\eqref{rules}--\eqref{eq:symconstraint} hold regardless of the presence or absence of shared randomness. However, Eq.~\eqref{consistent} is valid only in the absence of shared randomness. The analog of Eq.~\eqref{consistent} for hybrid causal structures with shared randomness simply replaces higher-degree monomials with degree-1 monomials, i.e., \begin{align} &\expec*{\prod_{k}\hat{O}^{\vec{\boldsymbol{1}}_{k}|k}_{i_{k}|m_{k}}}_\rho={P_\text{obs}}{\left(\bigcap_k (i_{k}|m_{k},k)\right)}. \label{consistentSR} \end{align} \subsubsection{Optimization of nonlinear functionals}\label{sec:results:nonlinear} Quantum inflation can also be used to optimize nonlinear witnesses $f$. The essential idea can be seen already in Sec.~\ref{sec:witness}, where Eq.~\eqref{consistent} relates linear functions in an inflation to polynomials in the corresponding original scenario. Note that, for this optimization to be possible, in general one must consider at least an order-$q$ inflation when optimizing a polynomial of degree $q$. Consider, for instance, minimizing the $2$-norm between a distribution ${P_\text{obs}(a,b,c)}$ achievable in the quantum triangle scenario and that of the W distribution, that is: \begin{align}\begin{split} f(P_\text{obs})\equiv \sum_{a,b,c=0,1} & \abs*{P_\text{obs}(a,b,c) -P_\text{W}(a,b,c)}^2\\ =\sum_{a,b,c=0,1} & \begin{psmallmatrix*}[l] P_\text{obs}(a,b,c)^2+P_\text{W}(a,b,c)^2\\ \quad -2P_\text{obs}(a,b,c)P_\text{W}(a,b,c) \end{psmallmatrix*}, \end{split}\end{align} where one can readily verify that ${\sum_{a,b,c} P_\text{W}(a,b,c)^2 = 1/3}$. One can estimate the minimum value of this function using second-order inflation or higher, via Eq.~\eqref{consistent}. Explicitly, the constraints from Eq.~\eqref{consistent} that apply to this problem are \begin{align*} &P_\text{obs}(a,b,c)^2 = \expec*{E^{1,1}_aE^{2,2}_aF^{1,1}_bF^{2,2}_bG^{1,1}_cG^{2,2}_c}, \\\text{and } &P_\text{obs}(a,b,c)P_\text{W}(a,b,c) = P_\text{W}(a,b,c)\expec*{E^{1,1}_aF^{1,1}_bG^{1,1}_c}. \end{align*} While obtaining nontrivial bounds on $f(P_\text{obs})$ is, in principle, possible, in practice, it appears to require levels of the NPO hierarchy too computationally expensive. \section{Applications to quantum cryptography in networks}\label{sec:cryptography} In this section, we showcase a concrete application of quantum inflation: the security analysis of multipartite quantum key distribution protocols where the parties not all share a joint quantum state but are instead arranged in a network. Because entangled systems can be transmitted only over relatively short distances and only a small number of parties can practically share an entangled state distributed by a single source, multisource networks are a promising solution for long-distance quantum key distribution. However, the fact that the underlying causal structure is no longer the Bell scenario has a profound impact in the associated security proofs~\cite{lee2018crypto}. Imagine that two parties, $A$ and $C$, attempt to establish a secret key. They are too far apart, so they employ a quantum repeater $B$ in order to establish correlations. However, a malicious party $E$ may be eavesdropping what in reality are tripartite sources that leak one of the subsystems generated,\footnote{These ``third subsystems'' need not strictly be additional particles generated at each source but can, for instance, be the fields surrounding them~\cite{thinh2016vacuumleakage}. Eve is allowed to perform a joint measurement on her two shares, one received from each source (call them $E'$ and $E''$, using the notation in Sec.~\ref{sec:simple}), producing the value of the random variable $E$.} as in Fig.~\ref{fig:eavesdrop}. The $ABC|XZ$ marginal within the eavesdropped quantum repeater scenario is essentially a special case of the tripartite-line scenario in Fig.~\ref{fig:Bilocality}. An important question to answer is how reliably can $E$ guess the key generated by $A$ and $C$ by manipulating the leaked subsystems. \begin{figure}[!b] \begin{center} \hfill \subfigure[t][\label{fig:eavesdrop}] {\centering \includegraphics[scale=0.38]{EavesdroppedRepeater.pdf} } \hfill \subfigure[t][\label{fig:eavesdropSR}] {\centering \includegraphics[scale=0.38]{EavesdroppedRepeaterSR.pdf} } \hfill \end{center} \caption[]{(a) $A$ and $C$ employ the repeater $B$ in order to generate a secret shared key. While $A$ and $C$ have a choice of which measurement to perform in the states they receive---denoted by $X$ and $Z$---$B$ performs a four-outcome Bell state measurement. Unbeknowns to $A$, $B$, and $C$, a fourth party $E$ may be eavesdropping the sources in an attempt to extract information about the secret key that $A$ and $C$ are establishing. (b) The eavesdropped network scenario with shared randomness. Some tripartite distributions which are cryptographically secure under the assumption of no shared randomness become insecure if hidden dependence on shared randomness cannot be excluded on physical grounds.} \label{fig:crypto} \end{figure} Reference~\cite{lee2018crypto} tackles this problem, finding a trade-off between the violation of previously known network inequalities and the amount of information that $E$ can infer about the outcomes of $A$ and $C$ upon performing a measurement, under the assumption that the eavesdropper is bounded only by nonsignaling constraints. Since no quantum constraints are considered, the obtained bounds on the information achievable by the eavesdropper are very conservative. In fact, if $A$, $B$, and $C$ observe statistics compatible with a quantum entanglement swapping experiment, the information bounds derived in Ref.~\cite{lee2018crypto} turn out to be trivial. To derive tighter bounds for the more realistic case of quantum eavesdroppers, one needs to use tools bounding the set of allowed quantum correlations in the considered network, something that quantum inflation provides. In the following, we analyze the same scenario using the semidefinite relaxations of the set of quantum correlations achievable in the scenario in Fig.~\ref{fig:eavesdrop} provided by quantum inflation,\footnote{This scenario can, in principle, also be numerically characterized via the scalar extension method in Ref.~\cite{Pozas2019}.} finding tighter bounds on the eavesdropper predictability on the measurement outcomes by the honest parties $A$ and $C$. We are interested in bounding how much information $E$ can infer about $A$'s and $C$'s outcomes in the network in Fig.~\ref{fig:eavesdrop} from their choice of measurements. We follow Ref.~\cite{lee2018crypto} and estimate this information via the total variation distance $\Delta_{\text{E},\text{E{\textbar}AC}}$ between the distribution of $E$'s outcome with and without conditioning on the inputs and outputs of $A$ and $C$, that is, \begin{align} \Delta_{\text{E},\text{E{\textbar}AC}}^{a,c,x,z}\coloneqq \frac{1}{2}\sum_{e=1}^{\abs{E}}\left|P_{\text{E{\textbar}ACXZ}}(e|a,c,x,z)-P_{\text{E}}(e)\right|, \end{align} when parties $A$, $B$, and $C$ observe some specific probability distribution $P_{\text{ABC{\textbar}XZ}}(a,b,c|x,z)$. For the sake of example, we focus on bounding the total variation distance conditioned upon ${a{=}c{=}x{=}z{=}0}$, i.e., $\Delta_{\text{E},\text{E{\textbar}AC}}^{0,0,0,0}$. That is, we want to maximize $\Delta_{\text{E},\text{E{\textbar}AC}}^{0,0,0,0}$ over all the probability distributions $\left\{P_\text{ABCE{\textbar}XZ}\right\}$ that can be quantumly realized in the network in Fig.~\ref{fig:eavesdrop}, and whose marginal on $A$, $B$, and $C$ matches the given $P_{\text{ABC{\textbar}XZ}}$. Superficially, it might appear that the unspecified cardinality of $|E|$ constitutes an obstacle to exploring the space of all $\left\{P_\text{ABCE{\textbar}XZ}\right\}$ compatible with the network in Fig.~\ref{fig:eavesdrop}. We bypass this concern, however, by exploiting an alternative formulation of total variation distance~\cite{Levin2017}, namely, \begin{align}\begin{split} \Delta_{\text{E},\text{E{\textbar}AC}}^{a,c,x,z}&= P_{\text{E{\textbar}ACXZ}}({\boldsymbol{0}}^\star|a,c,x,z)-P_{\text{E}}({\boldsymbol{0}}^\star)\,,\\ \end{split}\end{align} where ${\boldsymbol{0}}^\star$ is the \emph{bin} (coarse graining over a subset of possible values of $E$) which maximizes \mbox{$P_{\text{E{\textbar}ACXZ}}({\boldsymbol{0}}^\star|a,c,x,z)-P_{\text{E}}({\boldsymbol{0}}^\star)$}, i.e., \begin{align}\begin{split} {\boldsymbol{0}}^\star &\coloneqq \bigvee e'\: : \:P_{\text{E{\textbar}ACXZ}}(e'|a,c,x,z)\geq P_{\text{E}}(e')\,. \end{split}\end{align} Note that ${\boldsymbol{0}}^\star$ is an implicit function of the values $\{a,c,x,z\}$ which identify the particular total variation distance $\Delta_{\text{E},\text{E{\textbar}AC}}^{a,c,x,z}$. Since we are concerned only about binning $E$ into $e\in {\boldsymbol{0}}^\star$ versus $e\notin {\boldsymbol{0}}^\star$, we can effectively model $E$ as dichotomic for the purposes of optimization, allowing us to set up the following SDP: \begin{align}\begin{split}\label{eq:cryptoSDP} \max \quad & \frac{P_{\text{ACE{\textbar}XZ}}({\boldsymbol{0}}^\star,0,0|0,0)}{P_{\text{AC{\textbar}XZ}}(0,0|0,0)}-P_{\text{E}}({\boldsymbol{0}}^\star) \\&=\frac{\expec*{A^{1}_{0|0}C^{1}_{0|0}E^{1,1}_{{\boldsymbol{0}}^\star}}}{P_{\text{AC{\textbar}XZ}}(0,0|0,0)}-\expec*{E^{1,1}_{{\boldsymbol{0}}^\star}} \\ \text{s.t.} \quad & \Gamma^{(n,I)}\succeq 0, \text{ and Eqs.~\eqref{rules}, \eqref{commutation:copies}, \eqref{eq:symconstraint}.}\\ &\text{Eq.~\eqref{consistent} is also imposed, but only on} \\&\text{the marginal }P_{\text{ABC{\textbar}XZ}},\text{ i.e. excluding} \\&\text{identifiable monomials involving \(E\).} \end{split}\end{align} Note that we distinguish between \emph{identifiable monomials}---which are defined by the order of inflation via Eq.~\eqref{consistent}---versus \emph{known probabilities}---which may be defined by a \emph{partial} specification of the global probability distribution over the observable nodes in a given causal structure. That is, one may find that a \emph{strict subset} of all identifiable monomials are preassigned numerical values when tackling constrained optimization problems, such as is the case with Eq.~\eqref{eq:cryptoSDP}. In Eq.~\eqref{eq:cryptoSDP}, $\Gamma^{(n,I)}$ is the moment matrix associated to the set of operators $\left\{A^{i}_{a|x},B^{j,k}_b,C^{l}_{c|z},E^{m,o}_e\right\}$ with $1\leq i,j,k,l,m,o\leq I$, for some $I^\text{th}$-order inflation\footnote{Recall that, in the eavesdropped repeater of Fig.~\ref{fig:eavesdrop}, the indices $i$, $j$, and $m$ correspond to copies of the state $\rho_{ABE}$ and the indices $k$, $l$, and $o$ correspond to copies of the state $\rho_{BCE}$.} and some NPO hierarchy level $n$. In Fig.~\ref{fig:cryptoresults}, we depict upper bounds for $\Delta_{\text{E},\text{E{\textbar}AC}}^{0,0,0,0}$ when the parties $A$, $B$, and $C$ measure the standard distribution in repeater networks (see Appendix~\ref{app:crypto} for its definition) with some visibility $v$. Importantly, when $A$, $B$, and $C$ observe the distribution corresponding to the sources sending noiseless singlets (i.e., ${v{=}1}$), we certify that the distance between the distributions cannot exceed \emph{zero}, and, thus, there is no better strategy for $E$ to guess $A$'s and $C$'s outcomes than making a uniformly random guess. Thus, for ${v{=}1}$, we prove that the key established between $A$ and $C$ is completely secure, as expected. Note that, in contrast with Ref.~\cite{lee2018crypto}, we allow $E$ to be a quantum eavesdropper, meaning that Eve is allowed to perform a joint entangled measurement on her subsystems of both $\rho_{ABE}$ and $\rho_{BCE}$. \begin{figure}[t] \includegraphics[width=\columnwidth]{Peac-Pe_vs_v.pdf} \caption{Upper bounds to the total variation distance ${\Delta_{\text{E},\text{E{\textbar}AC}}^{0,0,0,0}\coloneqq {P_{\text{E{\textbar}ACXZ}}({\boldsymbol{0}}^\star|0,0,0,0)-P_{\text{E}}({\boldsymbol{0}}^\star)}}$ when the parties $A$, $B$, and $C$ observe the distribution depicted in Eq.~\eqref{eq:cryptodistribution} with singlet visibility $v$. The solid curve tracks the upper bound in the eavesdropped repeater network depicted in Fig.~\ref{fig:eavesdrop}, whereas the dashed line tracks the worst case bound, when all the parties are coordinated through classical shared randomness, as in Fig.~\ref{fig:eavesdropSR}. The computations for the eavesdropped repeater network are carried out by considering its second-order quantum inflation and the moment matrix generated by operator sequences associated to the corresponding local level $\mathcal{L}_1$ not exceeding length two. This computation results in a moment matrix of size $857\times857$. On the other hand, the bound ${\Delta_{\text{E},\text{E{\textbar}AC}}^{a,c,x,z}\leq \min \{1,\; 2(2-\mathcal{R})\}}$ offered by Ref.~\cite{lee2018crypto} merely implies the trivial ${\Delta_{\text{E},\text{E{\textbar}AC}}^{0,0,0,0}\leq 1}$ for this example, as $2(2-\mathcal{R})$ evaluates to $2(2-v\sqrt{2})$, and $1\leq 2(2-v\sqrt{2})$ for all $v\in[0,1]$.} \label{fig:cryptoresults} \end{figure} For comparison, imagine if it were impossible to ensure the absence of any classical shared randomness between the parties. Dropping the no-shared-randomness assumptions means that we now consider the network underlying the process to be that of Fig.~\ref{fig:eavesdropSR}. In that causal scenario, we can readily establish that ${\max_P\: \Delta^{0,0,0,0}_{\text{E},\text{E{\textbar}AC}}=3/4}$ when $P_{\text{ABC{\textbar}XZ}}$ is the standard distribution in repeater networks~\eqref{eq:cryptodistribution}, for any visibility $v$. This result follows from the fact that such $P_{\text{ABC{\textbar}XZ}}$ can be simulated classically with tripartite shared randomness; i.e., $P_{\text{ABC{\textbar}XZ}}$ does not violate any tripartite Bell inequality. Since $P_{\text{AC{\textbar}XZ}}$ \emph{could} be a deterministic function of $\Lambda$, it follows that there exists a causal model for Fig.~\ref{fig:eavesdropSR} in which the eavesdropper $E$ can perfectly predict the outcomes of $A$, $B$, and $C$ leveraging her access to $\Lambda$. Perfect predictability (i.e., \emph{zero} security) leads to $P_{\text{E{\textbar}ACXZ}}({\boldsymbol{0}}^\star|0,0,0,0)=1$ and $P_\text{E}({\boldsymbol{0}}^\star)=P_\text{AC}(0,0)$ and, more generally, to the absolute maximal possible total variation distance $\Delta_{\text{E},\text{E{\textbar}AC}}^{a,c,x,z}=1-P_{\text{AC{\textbar}XZ}}(0,0|0,0)=3/4$. In summary, our analysis demonstrates the practical value for quantum cryptography applications of being able to bound the quantum correlations achievable in networks by means of quantum inflation. It also highlights the critical role that network structure assumptions play in establishing security proofs, as just the addition of shared randomness transforms the distribution from being perfectly secure to completely insecure. \section{Bounding Causal Effects under Quantum Confounding}\label{sec:mediationanalysis} We now turn to explore an application of quantum inflation unrelated to quantum information theory. It is the quantum version of \emph{mediation analysis}, which uses observational data and a promise of causal structure to estimate causal relationships and predict counterfactual intervention. Informally, mediation analysis quantifies the relative strengths of different causal pathways which could play a role in establishing some observed correlations. While this aspect has not been explored in the context of quantum mechanics (with the very recent exception of Ref.~\cite{Quantifying2020}), mediation analysis is a widespread tool in medical and biochemical studies~\cite{huang2016mediation,hutton2018mediation,sohn2019microbiome}. To quantify causal strengths in disciplines concerned with microscopic phenomena, it is crucial to account for causes mediated by quantum carriers, something possible using quantum inflation. Reichenbach's common causal principle states that all nonspurious statistical correlations must admit some causal explanation, and this principle can be generalized to include quantum causal explanations as well~\cite{Wood2015,Cavalcanti2014RCCP,Allen2017RCCP,WolfeBellQuantified}. Often, however, one may wish to distinguish between various causal possibilities for establishing statistical correlation. Moreover, even knowledge of the true causal structure is still inferior to a complete understanding of functional relationships between observable variables. \begin{figure}[b] \begin{center} \centering\includegraphics[scale=0.43]{ExampleForCausalPathways.pdf} \end{center} \caption[]{A graph admitting multiple causal explanations for correlation between $A$ and $B$. \label{fig:ExampleForCausalPathways} } \end{figure} Consider the multiple possible causal explanations for correlation between variables $A$ and $B$ in Fig.~\ref{fig:ExampleForCausalPathways}. We have {\setlength{\parindent}{0em} \begin{compactitem}[\textbullet\hspace{1em}] \item the \emph{direct effect} of $A$ on $B$, associated with the \emph{edge} ${A\to B}$, \item the \emph{indirect effect} of $A$ on $B$, associated with the \emph{direct path} ${A\to Y\to B}$, \item the \emph{common dependence} of $A$ and $B$ on $X$, associated with the \emph{forking path} ${A\leftarrow X\to B}$, and \item the common dependence of $A$ and $B$ on $U$, associated with the forking path ${A\leftarrow X\leftarrow U\to B}$. \end{compactitem} } Of course, in reality, the true causal explanation of a correlation typically involves \emph{all} these routes. The subfield of causal inference known as \term{mediation analysis} provides definitions of effect strength parameters for quantifying the relative significance of different causal pathways~\cite{janzing2013,miles2015partial,malinsky2019potential,bhattacharya2020semiparametric}. Such measures are generally intended to distinguish between \begin{compactitem}[\textbullet\hspace{1em}] \item the \emph{total causal effect} of $A$ on $B$, associated with \emph{all} paths originating at $A$ and terminating at $B$, and \item everything else, namely the \emph{total common cause dependence} shared between $A$ and $B$, associated with \emph{all} their common ancestors. \end{compactitem} Latent \term{confounding} is the possibility of partially explaining a pair of variables' observed correlation in terms of the functional dependence on their unobserved common causes. Estimating (or identifying) the strength of causal effects in the presence of latent confounding is the subject of extensive research~\cite{shpitser2016,shpitser2018identification,stensrud2019separable,malinsky2019potential,bhattacharya2020semiparametric,Cai2007,kang2012inequality,miles2015partial}; our contribution in this section is to unlock the possibility of effect estimation in the presence of quantum latent confounding by using quantum inflation. The most well-studied measure of effect strength is the \term{average causal effect} (ACE) which quantifies how much one variable $B$ functionally depends on another $A$. It is defined as the variation in the expectation value of $B$ under intervention of different values for $A$. Formally, \begin{align}\begin{split} &{\operatorname{ACE}}[a_1,a_2,B]\coloneqq \expec{B\textbf{ do } a^\#_1{\shortto} B}-\expec{B\textbf{ do } a^\#_2{\shortto} B} \\&\text{with}\qquad{\operatorname{ACE}}[A,B]\coloneqq\displaystyle\max\limits_{a_1, a_2} \;\;{\operatorname{ACE}[a_1,a_2,B]}. \end{split}\end{align} Note that the distribution of $B$ under \emph{intervention} on $A$ has a meaning distinct from conditioning on $A$. When $A$ and $B$ share some common causal ancestry, typically \begin{align} P(B\vert\braces{A{=}a})\neq P(B\textbf{ do } \braces{A^\#{=}a}{\shortto} B), \end{align} where the notation $\braces{A^\#{=}a}{\shortto} B$ indicates that the value of $A$ \emph{as seen by $B$} is been artificially set to $a$, independent of the actual value of $A$ that may be observed. For a review of do-conditionals and distinction between passive (observational) and active (interventional) conditioning, we refer the reader to Refs.~\cite{shpitser2016,shpitser2018identification,stensrud2019separable,malinsky2019potential}. The fundamental lemmas of mediation analysis constrain the possible values of interventional do-conditionals from knowledge of both the underlying causal structure and the distribution under passive observation. Every do-conditional can be expressed in terms of extending the original distribution to a particular interruption of the original graph. When estimating the do-conditional ${\braces{\boldsymbol{A}^\#{=}\boldsymbol{a}^\#}{\shortto}\boldsymbol{B}}$, the interrupted graph $\mathcal{G'}$ is formed by replacing the ${\boldsymbol{A}{\to} \boldsymbol{B}}$ edge set in $\mathcal{G}$ with ${\boldsymbol{A}^\#{\to} \boldsymbol{B}}$, such that $\mathcal{G'}$ contains the additional variables $\boldsymbol{A}^\#$. Whenever $P_{\boldsymbol{ABC}}$ is defined over the observed variables ${\{\boldsymbol{A},\boldsymbol{B},\boldsymbol{C}\}}$, then the extended distribution $P'_{\boldsymbol{ABC}\vert\boldsymbol{A}^\#}$ further pertains to the variables $\boldsymbol{A}^\#$ as well. \begin{figure*}[t] \begin{center} \subfigure[\label{fig:ExampleForIdentifiability}] {\centering \begin{minipage}[t]{0.21\textwidth} \centering\includegraphics[scale=0.45]{ExampleForIdentifiability.pdf}\end{minipage} } \subfigure[\label{fig:TheIdentifiableCase}] {\centering \begin{minipage}[t]{0.23\textwidth} \centering\includegraphics[scale=0.45]{TheIdentifiableCase.pdf}\end{minipage} } \subfigure[\label{fig:NoGoSameDistrict}] {\centering \begin{minipage}[t]{0.26\textwidth} \includegraphics[scale=0.45]{NoGoSameDistrict.pdf} \end{minipage} } \hskip 0.1in \subfigure[\label{fig:NoGoKiteCase}] {\centering \begin{minipage}[t]{0.23\textwidth} \centering\includegraphics[scale=0.45]{NoGoKiteCase.pdf}\end{minipage} } \end{center} \caption[]{ A survey of hypothetical interventions on edges emanating from the node $X$ in a pedagogically motivated example causal structure. % \\(a)~The example causal structure without any interventions.% \\(b)\phantom{~}The do-conditional ${P}{\left(\textit{ABCDX} \textbf{ do } \braces{X^\#{=}x^\#}{\shortto}\{BC\}\right)}$ where both edges ${X\to B}$ and ${X\to C}$ are intervened upon with the same value of $X$ being sent down both intervened edges. This do-conditional is identifiable and has a unique value computable from observational statistics alone, namely ${{P}{(\textit{ABCD}X{=}x \textbf{ do } \braces{X^\#{=}x^\#}{\shortto}\{BC\})}\,=\,{P(\textit{ABCD}X{=}x)P(BC \vert A,X{=}x^\#)}/{P(BC \vert A,X{=}x)}}.$ \\(c)~The do-conditional ${P}{\left(\textit{ABCDX} \textbf{ do } \braces{X^\#{=}x^\#}{\shortto}D\right)}$ where the edge ${X\to D}$ is intervened upon. This do-conditional is nonidentifiable (as $X$ and $D$ share a latent parent) and, hence, is interesting to estimate using quantum inflation. \\(d)~The do-conditional ${P}{(\textit{ABCDX} \textbf{ do } \braces{X^\#{=}x^\#_1}{\shortto}B,\braces{X^\#{=}x^\#_2}{\shortto}C)}$ where the pair of edges ${X\to B}$ and ${X\to C}$ are intervened upon with a different value of $X$ being sent down the two intervened edges. This do-conditional is nonidentifiable (as $B$ and $C$ share a latent parent) and, hence, is interesting to estimate using quantum inflation. % \label{fig:interventionexamples} } \end{figure*} The fundamental principle of mediation analysis is that every viable do-conditional constitutes some extended distribution or suitable marginal thereof. Accordingly, the potential range of a do-conditional is defined by variation over all \emph{valid extensions} of the original distributions. Note that the interrupted graph $\mathcal{G}'$ representing the intervention on $\mathcal{G}$ has a vertex set consisting of all nodes of $\mathcal{G}$---say, $\boldsymbol{ABC}$---along with the auxiliary intervention variables $\boldsymbol{A}^\#$. When the do-conditional pertains only to a \emph{marginal} of the interrupted graph $\mathcal{G}'$, the do-conditional $P'$ refers to a strict subset of the observed variables in $\mathcal{G}'$. Without loss of generality, therefore, we consider characterizing the set of do-conditionals of the form $P_{\boldsymbol{AB}\textbf{ do } \boldsymbol{A}^\#\shortto \boldsymbol{B}}$ which are compatible with some observed distribution $P_{\boldsymbol{ABC}}$ relative to the intervention $\boldsymbol{A}^\#\shortto \boldsymbol{B}$ depicted in $\mathcal{G'}$.\par \medskip \begin{samepage} \noindent\textbf{Fundamental Lemma of Mediation Analysis:} \begin{align}\nonumber &{P_{\boldsymbol{AB}\textbf{ do } \boldsymbol{A}^\#\shortto \boldsymbol{B}} \in \textsf{CompatibleDoConditionals}_{\mathcal{G'}}\big[P_{\boldsymbol{ABC}}\big]}\\\nonumber &\text{iff}\quad\exists_{P'}\::\:\:{P'_{\boldsymbol{ABC}\vert\boldsymbol{A}^\#} \in \textsf{ValidExtensions}_{\mathcal{G'}}\big[P_{\boldsymbol{ABC}}\big]}\\ &\quad\text{such that} \\\nonumber &P_{\boldsymbol{AB}\textbf{ do } \boldsymbol{A}^\#\shortto \boldsymbol{B}}(\boldsymbol{ab}\textbf{ do }\boldsymbol{a}^\#) =\sum_{\boldsymbol{c}}P'_{\boldsymbol{ABC}\vert\boldsymbol{A}^\#}({\boldsymbol{abc}\vert\boldsymbol{a}^\#}). \end{align} \end{samepage} Recall that $P'_{\boldsymbol{ABC}\vert\boldsymbol{A}^\#}$ is said to be valid extension of the original distribution $P_{\boldsymbol{ABC}}$ to $\mathcal{G}'$ only if it is compatible with the interrupted graph and recovers the original distribution under postselection. That is, \begin{align}\begin{split} &{P'_{\boldsymbol{ABC}\vert\boldsymbol{A}^\#} \in \textsf{ValidExtensions}_{\mathcal{G'}}\big[P_{\boldsymbol{ABC}}\big]}\\ &\text{when}\quad{P_{\boldsymbol{ABC}}(\boldsymbol{abc})=P'_{\boldsymbol{ABC}\vert\boldsymbol{A}^\#}(\boldsymbol{abc} \;\;\vert\,\boldsymbol{a})}\\ &\text{ and}\quad{P'_{\boldsymbol{A}\boldsymbol{B}\boldsymbol{C}\vert\boldsymbol{A}^\#}\in \textsf{CompatibleDistributions}\big[\mathcal{G'}\big]}. \end{split}\label{eq:mediation} \end{align} which pretty much recapitulates Eq.~\eqref{eq:interruption}, except here we distinguish between the nodes pertinent to the conditional ($\boldsymbol{AB}$) and all other observed nodes ($\boldsymbol{C}$). For the purposes of this work, we emphasize that mediation analysis explicitly maps the problem of bounding causal effects to the problem of causal compatibility relative to an interrupted graph. In particular, mediation analysis implies that the quantum inflation technique can provide upper and lower bounds for the \emph{quantum} ACE, i.e., can constrain causal effects in the presence of quantum confounding. For instance, quantum ACE can be lower (respectively, upper) bounded by minimizing (respectively, maximizing) ${{\operatorname{ACE}}[a_1,a_2,B]}$ over extended distributions which are quantum compatible with the graph interruption corresponding to replacing the edge $A\to B$ with the edge ${A^\#{\to} B}$. An important result in mediation analysis is that some do-conditionals are constrained to a single point value (called \emph{identifiable}) regardless of the particular observed statistics. The criteria for determining identifiable do-conditionals (and efficient algorithms for computing their values) is the subject of Refs.~\cite{shpitser2016,shpitser2018identification,stensrud2019separable,malinsky2019potential,bhattacharya2020semiparametric}. Nonidentifiable do-conditionals can typically be constrained only to lie within certain numerical spans~\cite{Cai2007,kang2012inequality,miles2015partial}.\footnote{Fine-tuned instances of the observable distribution can constrain a nonidentifiable do-conditional to the point where it can take only some extremal fixed value.} Visual examples of some identifiable and nonidentifiable do-conditionals are provided in Fig.~\ref{fig:interventionexamples}. We note that the criteria for determining identifiability are valid independent of the (non)classicality of the latent variables. Consequently, quantum and classical mediation analysis can differ only in terms of the inequalities they imply for ranges of nonidentifiable do-conditionals. Reference~\cite{Chaves2017} highlights such a quantum-classical gap regarding the nonidentifiable do-conditional of the instrumental scenario. \citet{Chaves2017} explicitly construct a quantum causal model for the instrumental scenario where the quantum average causal effect is zero even though the resulting observational distribution would necessarily imply a strictly positive classical ACE. To illustrate the utility of quantum inflation for mediation analysis, consider the quantum triangle scenario supplemented by a directed edge ${A\to B}$, illustrated in Fig.~\ref{fig:TriangleNoSettingsPlus}. The GHZ distribution \begin{equation} P_\text{GHZ}(a,b,c)\coloneqq\begin{cases} \frac{1}{2} & a{=}b{=}c \\ 0 & \text{otherwise} \end{cases} \label{GHZdistribution} \end{equation} is compatible with this graph. To achieve this correlation, however, we anticipate that $B$ must \emph{functionally} depend on $A$. However, ${P_{\boldsymbol{B}\textbf{ do } \boldsymbol{A}^\#\shortto \boldsymbol{B}}}$ is not identifiable, as $A$ and $B$ share an unobserved common parent. We employ the quantum inflation technique to verify that the ${\operatorname{ACE}[A,B]=1}$ for the GHZ distribution without assuming classicality, thus teaching us that the quantum ACE is \emph{not} less than the classical ACE in this example. This result means that, when reproducing the GHZ distribution in the quantum triangle scenario with signaling per Fig.~\ref{fig:TriangleNoSettingsPlus}, the functional dependence of $B$ on the signal from $A$ cannot be reduced relative to the strong dependence of $B$ on $A$ required to reproduce the GHZ distribution in the classical triangle scenario with signaling. This result is in stark contrast to the example in Ref.~\cite{Chaves2017}, where an instrumental scenario correlation requires reduced functional dependence between the observable variables when the latent node is quantum versus when it is classical. \begin{figure}[t] \begin{center} \subfigure[\label{fig:TriangleNoSettingsPlus}] {\centering \begin{minipage}[t]{0.48\linewidth} \centering\includegraphics[scale=0.5]{TriangleNoSettingsPlus.pdf}\end{minipage} }\hfill \subfigure[\label{fig:TriangleNoSettingsPlusInterrupted}] {\centering \begin{minipage}[t]{0.49\linewidth} \centering\includegraphics[scale=0.5]{TriangleNoSettingsPlusInterrupted.pdf}\end{minipage} } \end{center} \caption[]{ % (a)~The triangle scenario supplemented with a directed edge from $A\to B$. (b)~The relevant interrupted graph used to both define and compute the ACE of $A$ on $B$. % \label{fig:triangleintervention} } \end{figure} Authors' note: Following the initial publication of the manuscript on the arXiv, the authors became aware of the related work in Ref.~\cite{Quantifying2020} which explores quantifying direct causal influence in the quantum Instrumental scenario. \section{CONCLUSIONS}\label{sec:conclusions} We introduced the quantum inflation technique, a systematic method to discern whether an observable distribution is compatible with a causal explanation involving quantum degrees of freedom. The technique is of general applicability, in that it can be employed to analyze correlations achievable by any quantum causal structure with, potentially, visible-to-visible, latent-to-visible, visible-to-latent, or latent-to-latent connections. Furthermore, we discussed how a slight modification allows also to study causal realizations in terms of classical latent variables. We used quantum inflation to study correlations achievable in different quantum causal structures. First, we proved that the W and Mermin-GHZ distributions cannot be generated in the triangle scenario with quantum latent variables, bounded their noise resistance, and showed how quantum inflation is capable of recovering known results in the entanglement swapping scenario. Moreover, exploiting the dual formulation of semidefinite programs, we derived polynomial quantum causal witnesses for the triangle scenario with and without inputs. Second, we showed how quantum inflation can be employed as a tool for constrained polynomial optimization. We illustrated this fact in a variety of ways. We bounded the maximum values achievable by Mermin's and Svetlichny's inequalities in the quantum triangle scenario, finding significant gaps relative to the values achievable when one has access to arbitrary three-way entanglement. We also bounded the amount of information that an eavesdropper can obtain when two distant parties generate secret key using a quantum repeater. Finally, we illustrated the applicability of quantum inflation for mediation analysis in the presence of quantum common causes. The implementation of quantum inflation synthesizes two different hierarchies: the one of inflations and, for each inflation, the NPO hierarchy used to determine whether a distribution admits such an inflation. While asymptotic convergence has been proven for the latter; that of the former is an open question. Nevertheless, we have identified situations in which tight results can be obtained at finite steps of the hierarchies. Moreover, recent results~\cite{bowles2020bounding} show that a convergent NPO hierarchy can be defined for the analysis of quantum correlations in sequential Bell scenarios. Given that many nonexogenous causal structures can be mapped to networks linking such sequential scenarios (though not all, as shown in Appendix~\ref{app:nonexog}), Ref.~\cite{bowles2020bounding}'s proof becomes an interesting alternative to quantum inflation for analyzing such special cases. The number of copies of a given operator increases polynomially with the quantum inflation hierarchy level, where the exponent is given by the number of sources that feed the original operator. Moreover it is known~\cite{npa2} that, for a fixed inflation level, the complexity of each level in the corresponding NPO hierarchy, $\mathcal{S}_n$, is exponential in the level index $n$. For these reasons, in terms of practical applicability, standard tabletop computers are typically incapable of handling inflation and NPO hierarchy levels beyond 3. The optimal choice of which hierarchy to prioritize under scarce computational resources appears to vary depending on the particular problem at hand. We direct the reader to Ref.~\cite[Chap. 5]{alexThesis} for a fuller discussion on the impacts of varying the different hierarchy level choices and an account of some intuitions in this matter. Despite this computational load, the SDPs associated to quantum inflation present a high degree of symmetry, and it is expected that exploiting these symmetries explicitly will reduce the computational barriers currently associated with high levels of the inflation hierarchy. Quantum inflation can find an application in many fields. Clear first applications are generalizations of entanglement theory and quantum information protocols to networks~\cite{navascues2020gnme,Schmid2020LOSR}. From a more general perspective, and due to the central role that causality has in science, we expect quantum inflation to become a fundamental tool for analyzing causality in any situation where a quantum behavior is presumed. \vspace{-10pt} \begin{acknowledgments} We acknowledge useful discussions with Stefano Pironio, Rob Spekkens, David Schmid, and T.C. Fraser. This work is supported by Fundaci\'o Obra Social ``la Caixa'' (LCF/BQ/ES15/10360001), the ERC through the AdG CERQUTE and the CoG QITBOX, the European Union's Horizon 2020 research and innovation programm---Grant Agreement No. 648913---the AXA Chair in Quantum Information Science, the Government of Spain (FIS2020-TRANQI and Severo Ochoa CEX2019-000910-S), Fundacio Cellex, Fundacio Mir-Puig, Generalitat de Catalunya (CERCA, AGAUR SGR 1381), and the Austrian Science fund (FWF) stand-alone project P 30947. This research was supported by Perimeter Institute for Theoretical Physics. Research at Perimeter Institute is supported in part by the Government of Canada through the Department of Innovation, Science and Economic Development Canada and by the Province of Ontario through the Ministry of Colleges and Universities. This publication was made possible through the support of a grant from the John Templeton Foundation. The opinions expressed in this publication are those of the authors and do not necessarily reflect the views of the John Templeton Foundation. \end{acknowledgments} \bibliographystyle{apsrev4-2-wolfe} \nocite{apsrev41Control} \setlength{\bibsep}{2pt plus 2pt minus 1pt}
\section{Introduction} High-dimensional factor models find many applications in finance, economics, and genomics, or more generally high-dimensional data where the dependence of measurements can be attributed to a relatively small number of common factors \citep{FWZZ18}. Determining the number of factors is an important issue in applications of factor models. The methods are typically based on eigenvalues or rank of the loading matrix. For example, \cite{Lewbel1991} and \cite{KLZ2019} obtained the number of factors by testing the rank of the loading matrix. There are rich literatures on eigenvalues based methods for selecting the number of common factors, which have been studied from three different perspectives. The first one is through model selection. \cite{BaiNg2002} proposed three PC and three IC criteria by using the penalties to determine the number of common factors. \cite{HL2007} developed an information criterion to determine the number of common factors in the general dynamic model. \cite{LiLiShi2017} proposed the information criteria similar to \cite{BaiNg2002} to determine the number of common factors when the number of factors increases with the sample size. \cite{SuWang2017} used the BIC information criterion to determine the number of common factors for time-varying factor models. The second perspective is through hypothesis testing or confidence intervals. \cite{Onatski2009} proposed a test statistic $T_{ON}=\max\limits_{r_{\min}<i\leq r_{\max}} (\hat{\lambda}_i-\hat{\lambda}_{i+1})/(\hat{\lambda}_{i+1}- \hat{\lambda}_{i+2})$ to test the number of common factors where $\hat{\lambda}_i$ is the $i$th largest eigenvalue of the estimated covariance matrix, and $r_{\min}$ and $ r_{\max}$ are pre-specified lower and upper bounds of the number of common factors and estimated the number of factors by $$ \hat{K}_{ON}=\arg\max\limits_{r_{\min}<i\leq r_{\max}} (\hat{\lambda}_i-\hat{\lambda}_{i+1})/(\hat{\lambda}_{i+1}- \hat{\lambda}_{i+2}). $$ \cite{Kapetanios2010} used the statistic $\tau_i(\hat{\lambda}_{i}-\hat{\lambda}_{r_{\max}+1})$ to test the number of common factors where $\tau_i$ is the normalized constant. \cite{PanYao2008} used the Ljung-Box-Pierce portmanteau test statistic to determine the number of common factors. Based on a confidence interval of the largest non-spiked eigenvalue of the estimated covariance matrix, \cite{CHP2017} proposed an algorithm to determine the number of common factors under the convergence regime that the dimension and the sample size tend to infinity proportionally. The third perspective is through estimation. \cite{Onatski2010} used the maximum eigengap to determine the number of common factors and proposed the eigenvalue difference criterion as follows: $$ \hat{K}_{ED}=\max\{i\leq r_{\max}: \hat{\lambda}_i-\hat{\lambda}_{i+1}\geq s\}, $$ with $s$ being a given threshold. \cite{Onatski2010} stated that the difference between ED and Bai-Ng criteria is that the threshold of ED is sharp and the threshold of Bai-Ng criteria has more freedom. \cite{Wang2012} and \cite{LamYao2012} proposed to use the ratios of two adjacent eigenvalues to determine the number of factors, which estimates $K$ by \begin{equation}\label{hatr} \hat{K}_{ER}=\arg\max\limits_{1\leq i\leq r_{\max}}\hat{\lambda}_{i}/\hat{\lambda}_{i+1}. \end{equation} \cite{AH2013} proposed also ``ER" method independently, in addition to the ``GR" method: $$ \hat{K}_{GR}=\arg\max\limits_{1\leq i\leq r_{\max}}\log(V_{i-1}/V_i)/\log(V_i/V_{i+1}), $$ with $V_i=\sum_{j=i+1}^{p}\hat{\lambda}_{j}$. The aforementioned methods are all based on the eigenvalues of the covariance matrix, which is assumed to admit the sum of a low-rank matrix and a sparse matrix. Let ${\bf B}=(b_{ij})$ be a $p\times K$ dimensional matrix with $K<p$ that represents the factor loading matrix and ${\rm diag}(\nu_{1}^2,\cdots ,\nu_{p}^2)$ be the diagonal matrix that represents the variances of idiosyncratic noises. Then, the covariance matrix of observed high-dimensional data is given by \begin{equation}\label{Sigma} \bm{\Sigma}={\bf B}\bB^T+{\rm diag}(\nu_{1}^2,\cdots ,\nu_{p}^2), \end{equation} where $T$ denotes the transpose of a vector or a matrix. A drawback of the covariance based methods is that it does not take into account the scales of the observed variables. For this reason, the existing methods can easily be inconsistent. For example, even for the simplest factor model (\ref{Sigma}) with the population covariance matrix $\bm{\Sigma}={\bf B}\bB^T+{\rm diag}(\underbrace{1,\cdots ,1}_{K},\nu_{K+1}^2,1\cdots ,1)$ where ${\bf B}^T=({\bf B}_1^T, {\bf 0}_{K\times(p-K)})$, ${\bf B}_1$ is of $K\times K$ dimension and ${\rm rank}({\bf B}_1)=K$, under some mild conditions of ${\bf B}_1$ and $\nu_{K+1}^2$, we can show that \begin{eqnarray} P(\hat{K}_{ON}\geq K+1)\rightarrow1,&& P(\hat{K}_{ED}\geq K+1)\rightarrow1,\nonumber\\ P(\hat{K}_{ER}\geq K+1)\rightarrow1,&& P(\hat{K}_{GR}\geq K+1)\rightarrow1,\label{zero} \end{eqnarray} but in fact, the true number of common factors is $K$. The proof of (\ref{zero}) will be given in Appendix B. The correlation matrix clearly overcomes the scaling drawback of the covariance matrix. The $p\times p$ dimensional correlation matrix of $\bm{\Sigma}$ is given by \begin{equation}\label{cormatrix} {\bf R}=[{\rm diag}(\bm{\Sigma})]^{-1/2}\bm{\Sigma}[{\rm diag}(\bm{\Sigma})]^{-1/2}, \end{equation} where ${\rm diag}(\bm{\Sigma})$ is the diagonal matrix by replacing the off-diagonal elements of $\bm{\Sigma}$ by zeros. Using the sample correlation matrix for factor analysis will overcome the aforementioned disadvantages of using sample covariance matrix. In fact, when the dimension is fixed and the sample size tends to infinity, \cite{Guttman1954}, \cite{Kaiser1960, Kaiser1961} and \cite{JW2007} (page 491) have established a lower bound: the number of the eigenvalues satisfying $\max\{j: \hat{\lambda}_j>1, j \in \{1,\cdots,p\}\}$ is smaller than or equal to the number of the common factors. But the existing literatures haven't shown that they are indeed the same under certain conditions. Moreover, their estimation techniques $$ \hat{K}_u=\max\{j: \hat{\lambda}_j>1, j \in [p]\} \quad \mbox{where} \quad [p] = \{1, \cdots, p\} $$ can not be consistent in the high dimensional setting since sample correlation matrices are inconsistent. Can such a simple, tuning parameter-free method be modified so that it is consistent for high dimensional factor models? This paper gives an affirmative answer via some high-dimensional adjustments of threshold parameters, leveraging on the random matrix theory. The main contributions of this paper are as follows: \begin{itemize} \item Firstly, we establish the concise relationship between the eigenvalues of population correlation matrices and the number of common factors, that is, give the condition under which \begin{equation}\label{true} K=\max\{j: \lambda_j({\bf R})>1, j \in [p]\} \end{equation} where $\lambda_1({\bf R})\geq\lambda_2({\bf R})\geq\cdots \geq\lambda_p({\bf R})$ are the eigenvalues of correlation matrix ${\bf R}$ and $K$ is the true number of common factors. In factor analysis, the eigenvalues of correlation matrix are frequently used to evaluate the contributions of selected factors. Since $\sum_{j=1}^{p}\lambda_j({\bf R})=p$, some of eigenvalues of ${\bf R}$ are greater than 1 and the remaining eigenvalues of ${\bf R}$ are equal to or less than 1. It has been shown \citep{Guttman1954, Kaiser1960, Kaiser1961} that the number of common factors is less than or equal to the number of ${\bf R}$'s eigenvalues greater than 1. One of contributions is to show that they are indeed the same. The results presented in Table \ref{Khat} illustrate this point where $\{b_{\ell j}, \ell\in[p], j\in [K-1]\}$ are i.i.d. from the uniform distribution ${\rm U}(-1, 1)$, $\nu_{1}^2=\ldots=\nu_{p}^2=\sigma^2$, $b_{1K},\cdots ,b_{pK}$ are i.i.d. from $U(-1, 1)$ in Scenario 1 and $b_{1K}=\cdots =b_{pK}=0$ in Scenario 2. \begin{table}[!h] \caption{Number of eigenvalues of ${\bf R}$ satisfying $\lambda_j({\bf R})>1$}\label{Khat} \renewcommand{\arraystretch}{1.0}\doublerulesep 0.15pt \tabcolsep 0.2in \begin{center} \begin{tabular}{cc|ccc|ccc} \hline & &\multicolumn{3}{c|}{Scenario 1} &\multicolumn{3}{c}{Scenario 2}\cr & &$\sigma^2=1$&2&3&$\sigma^2=1$&2&3\cr \hline $K$&$p$&\multicolumn{3}{c|}{{\rm rank}({\bf B})=K}&\multicolumn{3}{c}{{\rm rank}({\bf B})=K-1}\cr 5 &50 &5 &5 &5 &4 &4 &4\cr &100 &5 &5 &5 &4 &4 &4\cr &&&&&&\cr 10 &50 &10 &10 &10 &9 &9 &9\cr &100 &10 &10 &10 &9 &9 &9\cr \hline \end{tabular} \end{center} \end{table} \item Secondly, we propose a bias corrected estimator $\hat{\lambda}^{C}_i$ for $\lambda_i(R)$, which in general differs from the $i^{th}$ largest eigenvalue ${\hat{\lambda}}_i$ of sample correlation matrix and develop a new estimator for the number of common factors as follows: \begin{equation}\label{Khat0} \hat{K}^C =\max\{j: \hat{\lambda}^{C}_j>s,~~j\in[r_{\max}]\}, \qquad s=1+\sqrt{p/(n-1)} \end{equation} under the regime $\rho_{n-1}=p/(n-1)\rightarrow \rho\in (0, \infty)$, where $p$ is the dimension and $n$ is the sample size. Our newly proposed method $\hat{K}^C$ does not depend on any tuning parameter and is even simpler than the eigenvalue ratio method $\hat{K}_{ER}$ or $\hat{K}_{ED}$ which involves the tuning parameter $s$. On the other hand, by (\ref{true}), a naive method is $$ \hat{K}_u=\max\{j: \hat{\lambda}_j>1, j \in [p]\}. $$ but this method overestimates $K$ when $n$ and $p$ are of the same order. Let $p/(n-1)\rightarrow \rho$ and \begin{eqnarray*} \mathcal{F}(v_0)&=&\{{\bf R}:~~{\bf R}~\mbox{is the correlation matrix (\ref{R}) of the observed vector }\\ & &\qquad\quad\mbox{in the factor model}~(\ref{factorm})~\mbox{and}~\lambda_K({\bf R})>v_0\}, \end{eqnarray*} where $v_0$ is a positive constant, representing signal strength. We will show that the optimal lower bounds for the signal strength $v_0$ and threshold $s$ are $$ v_0=1+\sqrt{\rho},\quad s=1+\sqrt{p/(n-1)} $$ in the following sense. {\bf Minimum signal strength $v_0$}: We will show (i). When $v_0<1+\sqrt{\rho}$, there exists ${\bf R}\in\mathcal{F}(v_0)$ where no method based on the eigenvalues of the sample correlation matrix can give a consistent estimate of $K$. (ii). When $v_0=1+\sqrt{\rho}$, our method $\hat{K}^C$ can consistently estimate $K$. {\bf Optimal threshold $s$}. Let $\hat{K}^C(s)$ emphasize the dependence of $\hat{K}^C$ on a general $s$. We will prove $$ \left\{ \begin{array}{cc} P(\hat{K}^C(s)=K)\rightarrow 1,&\forall~{\bf R}\in\mathcal{F}(\nu_0)~\mbox{if}~s=1+\sqrt{p/(n-1)},\\ P(\hat{K}^C(s)>K)\rightarrow 1,&\exists~{\bf R}\in\mathcal{F}(\nu_0)~\mbox{if}~s<1+\sqrt{p/(n-1)},\\ P(\hat{K}^C(s)<K)\rightarrow 1,&\exists~{\bf R}\in\mathcal{F}(\nu_0)~\mbox{if}~s>1+\sqrt{p/(n-1)},\\ \end{array} \right. $$ In other words, the threshold $s=1+\sqrt{p/(n-1)}$ is optimal. We have conducted extensive simulations to compare our method with those in \citet{BaiNg2002}, \citet{Onatski2005, Onatski2010}, \citet{LamYao2012}, \citet{AH2013}. {Simulation results show that in most of our testing cases, our estimation method outperforms the competing ones. Even in the remaining cases considered in this paper, our estimation method has comparable performance to other competing methods.} \item Thirdly, we derive the asymptotic properties of the largest $K$ sample eigenvalues of the sample correlation matrix in high dimensional factor models. This is an important contribution to random matrix theories. The results may be used for other inference problems in high dimensional factor models. \end{itemize} The arrangement of this paper is as follows: Section \ref{Model} reviews the factor model, defines the common factors in detail and establishes the relationship between the number of common factors and the eigenvalues of the population correlation matrix. Section \ref{Correlation} proposes an estimation technique of the number of common factors based on a study on the random matrix theory of sample correlation matrix and demonstrates the convergence of the proposed estimator for the number of common factors. Section \ref{Signals} investigates the optimality of the proposed estimator in high dimensional factor model. Section \ref{Simu} presents extensive simulation results. Section \ref{ES} conducts two empirical studies. Section \ref{Conclusion} concludes. Most of technical proofs are given in the appendix. \section{High Dimensional Factor Model}\label{Model} We now briefly review the factor model. In the factor model, the observable variable ${\bf y}$ can be decomposed as \begin{equation}\label{factorm} {\bf y}=\bm{\alpha}+{\bf B}{\bf f}+\bm{\epsilon}, \end{equation} where ${\bf y}=(y_1,\cdots ,y_p)^T$ is the $p$-dimensional observable vector, ${\bf f}=(f_1,\cdots ,f_K)^T$ is the $K$-dimensional latent factor vector, $\bm{\epsilon}=(\epsilon_1,\cdots ,\epsilon_p)^T$ is the $p$-dimensional error vector, $\bm{\alpha}$ is the $p$-dimensional intercept vector and ${\bf B}$ is the $p\times K$ dimensional loading matrix. Following \citet{BaiNg2002}, define the number of factors as ${\rm rank}({\bf B})$. We impose the following conditions. \begin{itemize} \item {\bf Condition C1:} The factors $f_1,\ldots,f_K$ are mutually independent; the factor vector $(f_1,\cdots ,f_K)$ is independent of the error vector $(\epsilon_1,\ldots,\epsilon_p)$; \item {\bf Condition C2:} ${\rm E}({\bf f})={\bf 0}_K, {\rm Cov}({\bf f})={\bf I}_K$; \item {\bf Condition C3:} ${\rm E}(\bm{\epsilon})={\bf 0}_p, {\rm Cov}(\bm{\epsilon})={\bm{\Psi}}>{\bf 0}_{p\times p}$ where ${\bm{\Psi}}$ may be not diagonal (but sparse); \item {\bf Condition C4:} $p>K$ and the loading matrix ${\bf B}$ is of full column rank, i.e., ${\rm rank}({\bf B})=K$. \end{itemize} Write ${\bf B}=({\bf b}_1,\cdots ,{\bf b}_K)$ and ${\bf b}_j=(b_{1j},\cdots ,b_{pj})^T$ is a $p$-dimensional column vector for $j \in [K]$. If there is at most one coefficient $b_{\ell j}\not=0$ with $\ell\in[p]$ for some $j\in[K]$, that is, $f_j$ is only related to $y_j$ and not related to $y_1,..,y_{j-1},y_{j+1},\cdots ,y_p$, we can put $f_j$ in $\epsilon_j$. Thus, without loss of generality, we will define the common factor as follows: {\bf Definition of Common Factors:} If there are at least two coefficients $b_{\ell_1 j}, b_{\ell_2 j}\not=0$ with $\ell_1, \ell_2\in[p]$ for some $j\in[K]$, call the factor $f_j$ as a common factor. This paper focuses on determining the number of common factors under Conditions C1-C2-C3-C4-C5 where {\bf Condition C5:} For every $j\in[K]$, there are at least two coefficients $b_{\ell_1 j}, b_{\ell_2 j}\not=0$ with $\ell_1, \ell_2\in[p]$. Conditions C1-C2-C3 have been frequently imposed \citep{BaiNg2002, JW2007}. They are related to identifiability and moment conditions. Although they are often used, Conditions C4-C5 are not explicitly written. Condition C4 shows that ${\bf B}$ is of full column rank, that is, ${\rm rank}({\bf B})=K$. Condition C5 shows that every factor $f_j$ has an impact on at least two observed variables. By definition (\ref{factorm}) of the factor model, we have $$\bm{\Sigma}={\rm Cov}({\bf y})={\bf B}\bB^T+{\bm{\Psi}}.$$ Let the $(j, j)$ entry of $\bm{\Sigma}$ be $\sigma_{jj}$ for $j \in [p]$. Then by (\ref{cormatrix}), the population correlation matrix of ${\bf y}$ in the factor model is \begin{equation}\label{R} {\bf R}={\bf Q}\bQ^T={\bf Q}_1{\bf Q}_1^T+{\bf Q}_2{\bf Q}_2^T, \end{equation} where ${\rm diag}(\bm{\Sigma})={\rm diag}(\sigma_{11},\cdots ,\sigma_{pp})$ and \begin{equation}\label{Q} \begin{array}{lll} &&{\bf Q}=[{\rm diag}(\bm{\Sigma})]^{-1/2}({\bf B}, {\bm{\Psi}}^{1/2})=({\bf Q}_1, {\bf Q}_2),\\ &&{\bf Q}_1=[{\rm diag}(\bm{\Sigma})]^{-1/2}{\bf B},\quad{\bf Q}_2=[{\rm diag}(\bm{\Sigma})]^{-1/2}{\bm{\Psi}}^{1/2}. \end{array} \end{equation} In fact, ${\bf Q}_1{\bf Q}_1^T$ and ${\bf Q}_2{\bf Q}_2^T$ include the information of the factors $f_1,\cdots ,f_K$ and errors $\epsilon_1,\cdots ,\epsilon_p$ on ${\bf y}$, respectively. \begin{comment} The goal of this subsection is to establish the relationship between the number of the population correlation matrix ${\bf R}$'s eigenvalues greater than 1 and the number of the common factors $K$. \cite{Guttman1954} first gave the lower bound of the number of common factors by using the eigenvalues of correlation matrix. Some other lower bounds were studied in \citep{Kaiser1960, Kaiser1961}. Our result strengths the statement significantly and shows that $$K=\max\{j: \lambda_j({\bf R})>1, j \in [p]\},$$ where $\lambda_1({\bf R})\geq\lambda_2({\bf R})\geq\cdots \geq\lambda_p({\bf R})$ are the eigenvalues of the correlation matrix ${\bf R}$. \end{comment} Let $\|{\bf M}\|_{F}$ denote the Frobenius norm of a matrix or a vector ${\bf M}$ and $\|{\bf M}\|=\sqrt{\lambda_1({\bf M}{\bf M}^T)}$ the operator norm. The following theorem shows how to determine the number of factors from the population correlation matrix. \begin{thm}\label{thm0} Under Conditions C1-C2-C3-C4-C5, if $\|[{\rm diag}(\bm{\Sigma})]^{-1}{\bm{\Psi}}\|\leq1$, we have $$ \lambda_j({\bf R})\leq1,\quad j=K+1,\ldots,p. $$ In addition, we have \begin{equation}\label{K} K=\max\{j: \lambda_j({\bf R})>1, j \in [p]\}, \end{equation} when $p$ is large enough and there exists three non-negative constants $\delta_1>\delta_2+\delta_3\geq0$, $\delta_3<0.5$ satisfying \begin{eqnarray} &&\|[{\rm diag}(\bm{\Sigma})]^{-1/2}{\bf B}\|^2_{F}=O(p^{\delta_1}),\quad K=O(p^{\delta_3}),\nonumber\\ &&\|{\bf B}^T[{\rm diag}(\bm{\Sigma})]^{-1}{\bf B}\|\cdot\|\{{\bf B}^T[{\rm diag}(\bm{\Sigma})]^{-1}{\bf B}\}^{-1}\|=O(p^{\delta_2}),\label{Con}\\ &&\|[{\rm diag}(\bm{\Sigma})]^{-1}{\bm{\Psi}}\|\leq1.\nonumber \end{eqnarray} \end{thm} Theorem \ref{thm0} gives a sufficient condition to ensure that the number of ${\bf R}$'s eigenvalues greater than 1 is equal to the number of common factors. Note that \eqref{Con} imposes a restriction on the condition number of the matrix ${\bf B}^T[{\rm diag}(\bm{\Sigma})]^{-1}{\bf B}$. Without loss of generality, assume ${\rm diag}(\bm{\Sigma})={\bf I}_p$. Then ${\bf R}={\bf B}\bB^T+{\bm{\Psi}}$ and the conditions (\ref{Con}) become $$ K=O(p^{\delta_3}),~\|{\bm{\Psi}}\|\leq1,~\|{\bf B}\|^2_{F}=O(p^{\delta_1}),~\|{\bf B}^T{\bf B}\|\cdot\|({\bf B}^T{\bf B})^{-1}\|=O(p^{\delta_2}). $$ \begin{comment} Now, we will show that the conditions (\ref{Con}) hold for the three scenarios in simulation studies in Section 5. As an illustration, we only consider Scenario 3 where $K$ is fixed, $\{b_{\ell j}, \ell\in[p], j\in[K]\}$ are iid from $N(0, 1)$ and $\nu_{1}^2=\cdots =\nu_{p}^2=36$. We have ${\rm diag}(\bm{\Sigma})={\rm diag}(\sum_{j=1}^5b_{1j}^2+36,\cdots,\sum_{j=1}^5b_{pj}^2+36)$, \begin{eqnarray*} &&[{\rm diag}(\bm{\Sigma})]^{-1}\Psi={\rm diag}\left(\frac{36}{\sum_{j=1}^5b_{1j}^2+36},\cdots,\frac{36}{\sum_{j=1}^5b_{pj}^2+36}\right),\\ &&[{\rm diag}(\bm{\Sigma})]^{-1/2}{\bf B}=\left(\frac{b_{\ell j}}{\sqrt{\sum_{i=1}^5b_{\ell i}^2+36}}\right)_{\ell\in[p], j\in[K]}. \end{eqnarray*} It is not difficult to prove that $p^{-1}{\bf B}^T[{\rm diag}(\bm{\Sigma})]^{-1}{\bf B}$ tends to an diagonal matrix when $p$ tends to infinity. Then we have $\|[{\rm diag}(\bm{\Sigma})]^{-1/2}{\bf B}\|^2_{F}=O(p)$, $\|{\bf B}^T[{\rm diag}(\bm{\Sigma})]^{-1}{\bf B}\|\cdot\|\{{\bf B}^T[{\rm diag}(\bm{\Sigma})]^{-1}{\bf B}\}^{-1}\|=O(1)$ and $\|[{\rm diag}(\bm{\Sigma})]^{-1}{\bm{\Psi}}\|<1$. \par\noindent \begin{comment} {\bf Example 1.} When the number $K$ of the common factors is fixed, we have $K=O(1)$. When $K=\log p$ in the factor model (\ref{factorm}), the condition $K\leq O(p^{\epsilon_3})$ is naturally satisfied with $\epsilon_3$ being a very small positive constant. \par\noindent {\bf Example 2.} The errors $\epsilon_1,\cdots ,\epsilon_p$ are independent in the factor model (\ref{factorm}). That is, ${\bm{\Psi}}$ is a diagonal matrix or ${\bm{\Psi}}={\rm diag}({\bm{\Psi}})$. Then ${\bm{\Psi}}\leq {\bf R}$ leads to $${\bm{\Psi}}={\rm diag}({\bm{\Psi}})\leq{\rm diag}({\bf R})$$ meaning that all the eigenvalues of ${\bm{\Psi}}$ are not larger than one, i.e., $\|{\bm{\Psi}}\|\leq1$. \par\noindent {\bf Example 3.} ${\bm{\Psi}}$ is sparse requiring $\|{\bm{\Psi}}-{\rm diag}({\bm{\Psi}})\|=o(\|{\rm diag}({\bm{\Psi}})\|)$ where $\|{\rm diag}({\bm{\Psi}})\|\leq c_0<1$. Then \begin{eqnarray*} \|{\bm{\Psi}}\|&=&\|{\rm diag}({\bm{\Psi}})+{\bm{\Psi}}-{\rm diag}({\bm{\Psi}})\|\\ &\leq&\|{\rm diag}({\bm{\Psi}})\|+\|{\bm{\Psi}}-{\rm diag}({\bm{\Psi}})\|\\ &\leq&\|{\rm diag}({\bm{\Psi}})\|(1+o(1))\\ &\leq&c_0(1+o(1))\leq 1, \end{eqnarray*} as $p$ is large. Thus as $p$ is large, $\|{\bm{\Psi}}\|\leq 1$. \par\noindent {\bf Example 4.} When the contribution $\|{\bm{\Psi}}^{1/2}\|$ of the errors $\epsilon_1,\cdots ,\epsilon_p$ can't completely dominate the contribution $\|{\bf B}\|_F$ of the factors in the factor model (\ref{factorm}), i.e. $\|{\bf B}\|_F<<\|{\bm{\Psi}}^{1/2}\|_F$ doesn't hold, then $\|{\bf B}\|^2_{F}=O(p^{\epsilon_1})$ is satisfied because $$p={\rm tr}({\bf R})={\rm tr}({\bf B}\bB^T)+{\rm tr}({\bm{\Psi}})=\|{\bf B}\|_F^2+\|{\bm{\Psi}}^{1/2}\|_F^2.$$ \par\noindent {\bf Example 5}. $\|{\bf B}^T{\bf B}\|\cdot\|({\bf B}^T{\bf B})^{-1}\|=O(p^{\epsilon_2})$ is used to justify the level of the multi-collinearity of the loading matrix ${\bf B}$. If ${\bf B}$ is not extremely multi-collinear, then $\|{\bf B}^T{\bf B}\|\cdot\|({\bf B}^T{\bf B})^{-1}\|=O(p^{\epsilon_2})$ is easily satisfied. Especially, when $\lambda_1({\bf B}^T{\bf B})$ and $\lambda_K({\bf B}^T{\bf B})$ have the same order of $p$, $\|{\bf B}^T{\bf B}\|\cdot\|({\bf B}^T{\bf B})^{-1}\|=O(p^{\epsilon_2})$ holds. \end{comment} \section{Properties of sample correlation matrix under factor model}\label{Correlation} Let ${\bf y}_1, \ldots, {\bf y}_n$ be an i.i.d. sample of size $n$ from (\ref{factorm}): $$ {\bf y}_i=\bm{\alpha}+{\bf B}{\bf f}_i+\bm{\epsilon}_i,~i\in[n] = \{1,\cdots,n\}. $$ Then the sample covariance matrix and sample correlation matrix are \begin{equation}\label{hatSigma} \begin{array}{l c l} \hat{\bm{\Sigma}}_n & =& n^{-1}\sum\limits_{i=1}^{n}({\bf y}_i-\bar{{\bf y}})({\bf y}_i-\bar{{\bf y}})^T,\\ \hat{{\bf R}} & = & [\mbox{diag}(\hat{\bm{\Sigma}}_n)]^{-1/2}\hat{\bm{\Sigma}}_n[\mbox{diag}(\hat{\bm{\Sigma}}_n)]^{-1/2}, \end{array} \end{equation} where $\bar{{\bf y}}=n^{-1}\sum_{i=1}^{n}{\bf y}_i$ is the sample mean. Let the empirical spectral distributions ({\it ESD}) of ${\hat{\bf R}}$ and ${\bf R}$ be $F_n(t)$ and $H_{p-K}(t)$ as follows: \begin{equation}\label{Fnt} F_n(t)=\frac{1}{p-K}\sum_{j=K+1}^{p}1{(\lambda_j({\hat{\bf R}})\leq t)},~~H_{p-K}(t)=\frac{1}{p-K}\sum_{j=K+1}^{p}1{(\lambda_j({\bf R})\leq t)}, \end{equation} for any real number $t$ with $1(\cdot)$ being an indicator function. \subsection{Spectral properties of sample correlation matrix} {In order to estimate the number of common factors, we first derive some fundamental results in random matrix theories: the Stieltjes equation of the limiting spectral distribution ({\it LSD}) $F(t)$ of the ESD $F_n(t)$ and the almost sure convergence of sample spiked eigenvalues $\lambda_1({\hat{\bf R}}),\cdots ,\lambda_K({\hat{\bf R}})$ of ${\hat{\bf R}}$ . There are some existing literatures on the spectral properties of ${\hat{\bf R}}$ when ${\bf R}$ is of special structures. Bao, Pan and Zhou (2011) derived the Tracy-Widom law of the maximum eigenvalue of ${\hat{\bf R}}$ as ${\bf R}={\bf I}_p$ and $p/n\rightarrow \rho\in (0, \infty)$. \cite{el2007spectral} established the LSD of ${\hat{\bf R}}$ for the elliptical distribution as $p/n\rightarrow \rho\in (0, \infty)$ with the bounded spectral norm $\|{\bf R}\|$. \cite{GHPY2017} obtained the central limit theorem of ${\hat{\bf R}}$ for the case ${\bf R}={\bf I}_p$ and $p/n\rightarrow \rho\in (0, \infty)$. However, for the general factor model (\ref{factorm}), the population correlation matrix is not ${\bf I}_p$. Theorem \ref{thm1} below gives the Stieltjes equation of the LSD of ${\hat{\bf R}}$ for general case. For convergence of sample spiked eigenvalues $\lambda_1({\hat{\bf R}}),\cdots ,\lambda_K({\hat{\bf R}})$, we have not found the related literatures and Theorem \ref{thm2} below fills the void. In order to derive Theorems \ref{thm1}-\ref{thm2}, additional assumptions are needed. {\bf Assumption (a)}. Letting ${\bf x}_i=(x_{1i},\cdots ,x_{p+K,i})^T=(f_{1i},\cdots, f_{Ki}, e_{1i},\cdots, e_{pi})^T$, $(e_{1i},\cdots ,e_{pi})=(\epsilon_{1i},\cdots ,\epsilon_{pi})\bm{\Psi}^{-1/2}$, $\{x_{ji}, j\in[p+K], i\in[n]\}$ are independent random variables satisfying: \begin{equation}\label{(Linde)} \frac1{n(p+K)\eta_n^4}\sum_{j=1}^{p+K}\sum_{i=1}^n{\rm E}|x_{ji}^4|1{(|x_{ji}|>\eta_n\sqrt{n})}\to0, \end{equation} where $0<K\eta_n\to0$ and $K\eta_n\log n\rightarrow+\infty$. {\bf Assumption (b)}. $\sup\limits_{j \in [p+K]}{\rm E}(|x_{j1}|^{6+\delta_0})$ is bounded for all $p, K$ for some $\delta_0 > 0$. {\bf Assumption (c)}. The ratio of dimension to sample size $\rho_n=p/n\to \rho\in(0, \infty)$ as $n\to\infty$. {\bf Assumption (d)}. The number of common factors satisfies $K=o(p^{1/6})$. {\bf Assumption (e)}. $\|[{\rm diag}(\bm{\Sigma})]^{-1}{\bm{\Psi}}\|\leq1$ and the limiting spectral distribution $H(t)$ of the ESD $H_{p-K}(t)$ from the eigenvalues $\lambda_{K+1}({\bf R}),\cdots ,\lambda_p({\bf R})$ of ${\bf R}$ exists. \begin{rem}\label{rem41}The assumption (\ref{(Linde)}) is the Lindeberg condition. By Theorem \ref{thm0}, it is known that $\lambda_j({\bf R})\leq 1$ for $j=K+1,\cdots ,p$ if $\|[{\rm diag}(\bm{\Sigma})]^{-1}{\bm{\Psi}}\|\leq1$. Thus, the support set of $H(t)$ is in $[0, 1]$. \end{rem} \begin{lem}\label{lemmax} For the high dimensional factor model (\ref{factorm}) satisfying Conditions C1-C2-C3-C4-C5, under Assumptions (a)-(b)-(c)-(d)-(e), we have $$ \max\limits_{j \in [p]}|\hat{\sigma}_{jj}-1|=o_{a.s.}(1), $$ where $\hat{\sigma}_{jj}=n^{-1}\sum_{i=1}^n{\bf e}_j^T{\bf Q}({\bf x}_i-\bar{{\bf x}})({\bf x}_i-\bar{{\bf x}})^T{\bf Q}^T{\bf e}_j$ with $\bar{{\bf x}}=n^{-1}\sum_{i=1}^n{\bf x}_i$, ${\bf Q}$ being defined in (\ref{Q}) and ${\bf e}_j$ is the $j$th column of ${\bf I}_p$. \end{lem} The proof of Lemma~\ref{lemmax} is given in Appendix D. As we impose weak moment conditions, we need to use the truncation tricks and hence the proof is somewhat lengthy. For $z\in\cal{C}^{+}$, let the Stieltjes transform be \begin{eqnarray} m_n(z)&=&(p-K)^{-1}\sum_{j=K+1}^p(\lambda_j({\hat{\bf R}})-z)^{-1}=\int\frac{1}{t-z}dF_n(t),\nonumber\\ \underline{m}_n(z)&=&\int\frac{1}{t-z}d\underline{F}_n(t)=-(1-\rho_{K,n-1})z^{-1}+\rho_{K,n-1} m_n(z),\label{mnz}\\ m(z)&=&\int\frac{1}{t-z}dF(t),~~\underline{m}(z)=\int\frac{1}{t-z}d\underline{F}(t)=-(1-\rho)z^{-1}+\rho m(z),\nonumber \end{eqnarray} where $F_n(z)$ is defined in (\ref{Fnt}), $\rho_{K,n-1}=(p-K)/(n-1)$, $\underline{F}_n(x)=(1-\rho_{K,n-1})1(x>0)+\rho_{K,n-1} F_n(x)$, $\underline{F}(x)=(1-\rho)1(x>0)+\rho F(x)$ and $\cal{C}^{+}$ denotes the upper plane of the two-dimensional complex space. Then $\underline{m}(z)$ and $m(z)$ satisfy the equations \eqref{um} and \eqref{psi}. \begin{thm}\label{thm1} For the high dimensional factor model (\ref{factorm}) satisfying Conditions C1-C2-C3-C4-C5 and Assumptions (a)-(b)-(c)-(d)-(e), we have $$ |m_n(z)-m(z)|=o_{a.s.}(1),\quad |\underline{m}_n(z)-\underline{m}(z)|=o_{a.s.}(1), $$ \begin{equation}\label{um} z=-\frac{1}{\underline{m}(z)}+\rho\int\frac{tdH(t)}{1+t\underline{m}(z)}=-\underline{m}^{-1}(z)\psi(-\underline{m}^{-1}(z)), \end{equation} where $z\in\cal{C}^{+}$ and \begin{equation}\label{psi} \quad\psi(x)=1+\rho\int\frac{t}{x-t}dH(t). \end{equation} \end{thm} \subsection{Bias correction of sample eigenvalues} Let ${\hat{\lambda}}_j=\lambda_j({\hat{\bf R}})$ and $\lambda_j=\lambda_j({\bf R})$ for $j\in[p]$. For any given $j$ , define \begin{eqnarray*} m_{n, j}(z)&=&(p-j)^{-1}[\sum_{\ell=j+1}^p({\hat{\lambda}}_{\ell}-z)^{-1}+((3{\hat{\lambda}}_j+{\hat{\lambda}}_{j+1})/4-z)^{-1}],\\ \underline{m}_{n, j}(z)&=&-(1-\rho_{j, n-1})z^{-1}+\rho_{j, n-1}m_{n, j}(z),\\ \end{eqnarray*} with $\rho_{j, n-1}=(p-j)/(n-1)$. Let the corrected eigenvalue of ${\hat{\lambda}}_j$ be $$ {\hat{\lambda}}_j^C=-\frac{1}{\underline{m}_{n, j}({\hat{\lambda}}_j)},~j\in[r_{\max}]. $$ The following theorem, whose proof is given in Appendix I, shows that the corrected empirical eigenvalues are consistent. \begin{thm}\label{thm2} For the high dimensional factor model (\ref{factorm}) satisfying Conditions C1-C2-C3-C4-C5 and Assumptions (a)-(b)-(c)-(d)-(e), for $j\in [K]$, if $\lambda_j\geq\lambda_{K+1}({\bf R})(1+\sqrt{\rho})+ \delta$ for some $\delta > 0$, \begin{equation}\label{TRUEE} \frac{\hat{\lambda}_j^C}{\lambda_j}=1+o_p(1)\quad\mbox{and}\quad\frac{{\hat{\lambda}}_j}{\lambda_j}=\psi(\lambda_j)+o_p(1), \end{equation} In particular, if in addition $\lambda_j$ is bounded for $j\in[K]$, we have $$ \hat{\lambda}_j^C=\lambda_j+o_p(1)\quad\mbox{and}\quad{\hat{\lambda}}_j=\lambda_j\psi(\lambda_j)+o_p(1). $$ \end{thm} \begin{rem}\label{rem1} By Remark \ref{rem41} and (\ref{K}), we have $\lambda_j>1$ for $j \in [K]$ under the conditions of Theorem \ref{thm0} and the support of $H(t)$ being in $[0, 1]$. By (\ref{psi}) and (\ref{TRUEE}), if $\lambda_j>\lambda_{K+1}(1+\sqrt{\rho})$ and is bounded, we have $$ {\hat{\lambda}}_j-\lambda_j=\lambda_j\psi(\lambda_j)-\lambda_j=\rho\int\frac{\lambda_jt}{\lambda_j-t}dH(t)+o_p(1),~j \in [K]. $$ In other words, the sample eigenvalue ${\hat{\lambda}}_j$ is not a consistent estimator of $\lambda_j$ for $j \in [K]$. This is due to the inconsistency of the high dimensional sample correlation matrix. On the other hand, from (\ref{TRUEE}), we show that the corrected eigenvalue $\hat{\lambda}^C_j$ is consistent for $j \in [K]$. \end{rem} \section{Minimum signals and optimal threshold}\label{Signals} We will adopt the notation and estimator defined in the introduction. Our aim is to find minimal signal strength $v_0$ for consistent estimation of the number of factors and to give the optimal threshold level for our estimator. \subsection{Minimal signal strength} The following theorem shows the minimal signal strength. \begin{thm}$(${\rm \bf Minimal signal strength $v_0$}$)$. For the high dimensional factor model (\ref{factorm}) satisfying Conditions C1-C2-C3-C4-C5 and Assumptions (a)-(b)-(c)-(d)-(e), and for any estimation method $\hat{K}_{any}$ of the number of common factors by detecting the difference between $\{\lambda_j({\hat{\bf R}}), j\in[K]\}$ and $\{\lambda_j({\hat{\bf R}}), j=K+1, \cdots ,p\}$, it holds that $$ \limsup_{n\rightarrow\infty}\inf_{{\bf R}\in\mathcal{F}(v_0)} P(\hat{K}_{any}=K)<1, $$ if $v_0<1+\sqrt{\rho}$. \end{thm} {\bf Proof}. Let us take $\epsilon$ such that $(1-\epsilon)(1+\sqrt{\rho})>\max\{1, v_0\}$ and ${\bf R}\in\mathcal{F}(v_0)$ such that ${\bf R} = \bm{\Sigma}={\rm diag}({\bf R})$ and $$ \lambda_p({\bf R})=\cdots=\lambda_{K+1}({\bf R})=1-\epsilon<\lambda_{K}({\bf R})=(1-\epsilon)(1+\sqrt{\rho}). $$ Then by (\ref{TRUEE}), we have $\lambda_{K}({\hat{\bf R}})=(1-\epsilon)(1+\sqrt{\rho})^2+o_{p}(1)$ because $H(t)$ is the limit of the empirical distribution function of $\{1-\epsilon,\cdots ,1-\epsilon\}$. By (S.46) in the supplementary material, we have $|\lambda_{K+1}({\hat{\bf R}})-\lambda_{K+1}({\bf S}_n)|=o_{a.s.}(1)$. By Theorem 1.1 of \cite{BaikSilverstein2006}, we have $(1-\epsilon)^{-1}\lambda_{K+1}({\bf S}_n)=(1+\sqrt{\rho})^2+o_{a.s.}(1)$. Thus we have \begin{equation}\label{ex1} \lambda_{K+1}({\hat{\bf R}})=(1-\epsilon)(1+\sqrt{\rho})^2+o_{a.s.}(1). \end{equation} Hence, when $n, p$ are large enough, $\lambda_{K}({\hat{\bf R}})$ and $\lambda_{K+1}({\hat{\bf R}})$ will be indifferentiable. That is, when $n, p$ are large enough, the difference between $\lambda_{K}({\hat{\bf R}})$ and $\lambda_{K+1}({\hat{\bf R}})$ can't be detected by any method. \begin{rem}The above theorem shows that $v_0=1+\sqrt{\rho}$ is the minimal signal strength. Thus, throughout the rest of the paper, we will consider the estimation method in the set of the correlation matrix ${\bf R}$ as follows: \begin{eqnarray*} \mathcal{F}(1+\sqrt{\rho})&=&\{{\bf R}:~~{\bf R}~\mbox{is the correlation matrix (\ref{R}) of the observed vector}\\ & &\qquad\quad\mbox{in the factor model}~(\ref{factorm})~\mbox{and}~\lambda_K({\bf R})>1+\sqrt{\rho}\}. \end{eqnarray*} \end{rem} \subsection{Optimal threshold} Recall our estimation method, \begin{equation}\label{Kt4} \hat{K}^C(s)=\max\{j: \hat{\lambda}^{C}_j>s, j\in [r_{\max}]\}, \end{equation} where $r_{\max}$ is a pre-specified positive integer and the maximum of the empty set is defined as 0. The following theorem establishes the optimal bound of the threshold $s$. \begin{thm}\label{thmL} For the high dimensional factor model (\ref{factorm}) satisfying Conditions C1-C2-C3-C4-C5 and Assumptions (a)-(b)-(c)-(d)-(e), we have \begin{eqnarray} \limsup_{n\rightarrow\infty}\sup\limits_{{\bf R}\in\mathcal{F}(1+\sqrt{\rho})} P(\hat{K}^C(s)>K)=1,~~\mbox{if } s<1+\sqrt{\rho},\label{U1}\\ \limsup_{n\rightarrow\infty}\sup\limits_{{\bf R}\in\mathcal{F}(1+\sqrt{\rho})} P(\hat{K}^C(s)<K)=1,~~\mbox{if } s>1+\sqrt{\rho},\label{U2} \end{eqnarray} where $s$ doesn't depend on $n$ and $p$. \end{thm} {\bf Proof.} To (\ref{U1}), let $(1-\epsilon)(1+\sqrt{\rho})>s$ and ${\bf R}\in\mathcal{F}(1+\sqrt{\rho})$ satisfy $$ \lambda_p({\bf R})=\ldots=\lambda_{K+1}({\bf R})=1-\epsilon <1+\sqrt{\rho}<\lambda_{K}({\bf R}). $$ By (\ref{um}) and (\ref{TRUEE}), we have $\lambda_{K+1}({\hat{\bf R}})={\hat{\lambda}}_{K+1}^C+\rho\frac{{\hat{\lambda}}_{K+1}^C(1-\epsilon)}{{\hat{\lambda}}_{K+1}^C-(1-\epsilon)}+o_p(1),$ because $H(t)$ is the limit of the empirical distribution function of $\{1-\epsilon,\cdots ,1-\epsilon\}$. It then follows from $\lambda_{K+1}({\hat{\bf R}})=(1-\epsilon)(1+\sqrt{\rho})^2+o_p(1)$ that $$ {\hat{\lambda}}_{K+1}^C=(1-\epsilon)(1+\sqrt{\rho})+o_p(1). $$ That is, ${\hat{\lambda}}_{j}^C\geq(1-\epsilon)(1+\sqrt{\rho})+o_p(1),~j \in [K+1].$ By using $(1-\epsilon)(1+\sqrt{\rho})>s$, we conclude that $$ \limsup_{n\rightarrow\infty}\sup_{{\bf R}\in\mathcal{F}(1+\sqrt{\rho})} P(\hat{K}^C(s)>K)=1, $$ when $s<1+\sqrt{\rho}$. To prove (\ref{U2}), let $\bm{\Sigma}={\bf R}\in\mathcal{F}(1+\sqrt{\rho})$ satisfy $$ \lambda_p({\bf R})\leq\cdots\leq\lambda_{K+1}({\bf R})\leq1<1+\sqrt{\rho}<\lambda_{K}({\bf R})<s\leq\cdots \leq\lambda_1({\bf R}). $$ By (\ref{TRUEE}) and $\lambda_K({\bf R})<s$, we have ${\hat{\lambda}}_{K}^C=\lambda_K({\bf R})+o_p(1)<s+o_p(1)$ which means ${\hat{\lambda}}_{j}^C<s,~j=p,\cdots ,K$ in probability. Thus $$ \limsup_{n\rightarrow\infty}\sup\limits_{{\bf R}\in\mathcal{F}(1+\sqrt{\rho})} P(\hat{K}^C(s)<K)=1, $$ if $s>1+\sqrt{\rho}$. \hfill $\blacksquare$ \\ Theorem \ref{thmL} shows that the choices $s<1+\sqrt{\rho}$ and $s>1+\sqrt{\rho}$ are not optimal for the threshold parameter $s$ in our estimation method. The following theorem will show that $s=1+\sqrt{\rho}$ is optimal. \begin{thm}\label{thmE} For the high dimensional factor model (\ref{factorm}) satisfying Conditions C1-C2-C3-C4-C5 and Assumptions (a)-(b)-(c)-(d)-(e), for ${\bf R}\in\mathcal{F}(1+\sqrt{\rho})$, we have when $s=1+\sqrt{\rho}$, \begin{equation}\label{Kt3} P(\hat{K}^C(s)=K)\rightarrow1. \end{equation} \end{thm} {\bf Proof.} For any ${\bf R}\in\mathcal{F}(1+\sqrt{\rho})$, we have $$ \lambda_p({\bf R})\leq\cdots\leq\lambda_{K+1}({\bf R})\leq 1<1+\sqrt{\rho}+\epsilon_0<\lambda_{K}({\bf R})\leq\cdots \leq\lambda_1({\bf R}), $$ for a very small positive constant $\epsilon_0$. By (\ref{um}), we have $\lambda_{K+1}({\hat{\bf R}})={\hat{\lambda}}_{K+1}^C+\rho\int\frac{{\hat{\lambda}}_{K+1}^Ct}{{\hat{\lambda}}_{K+1}^C-t}dH(t)+o_p(1).$ Thus, we have \begin{equation}\label{Kt1} {\hat{\lambda}}_{K+1}^C\leq1+\sqrt{\rho}+o_p(1), \end{equation} because of $\lambda_{K+1}({\hat{\bf R}})\leq(1+\sqrt{\rho})\psi(1+\sqrt{\rho})+o_p(1)$ by Lemma S.6 in the supplementary material. By (\ref{TRUEE}), we have \begin{equation}\label{Kt2} {\hat{\lambda}}_{j}^C\geq1+\sqrt{\rho}+\epsilon_0+o_p(1),~j \in [K]. \end{equation} Thus, by (\ref{Kt1}) and (\ref{Kt2}), when $s=1+\sqrt{\rho}$, we have $$ \lim_{n\rightarrow\infty}P(\hat{K}^C(s)=K)=1. $$ \vskip 0.5cm {\bf Summary of Method:} We propose {$$ \hat{K}=\max\{j: \hat{\lambda}^{C}_j>1+\sqrt{\rho_{n-1}}, j\in [r_{\max}]\},\quad $$} where $\rho_{n-1}=p/(n-1)$. This is a simple and tuning free method. \section{Simulation studies}\label{Simu} We evaluate the finite-sample performance of the proposed method by simulation studies. Because our proposed estimating method is based on the adjusted correlation thresholding, we will label the proposed estimating method as ``ACT". We compare our $ACT$ method with 13 existing methods: ``$PC_1$", ``$PC_2$",``$PC_3$",``$IC_1$", ``$IC_2$" and ``$IC_3$" in \citet{BaiNg2002}, ``$ON_1$", ``$ON_2$" and ``$ON_3$" in Onasti (2005), ``$NON$" in \citet{Onatski2010}, ``$ER$" and ``$GR$" in \citet{AH2013}. Due to the similarity of simulation results, we only present $PC_3$, $IC_3$, $ON_2$, $ER$, $GR$ and $ACT$. The sample sizes are taken to be $n=150, 300$ and the dimension is $p=100, 300, 500, 1000$. Recall the factor model ${\bf y}={\bf B}{\bf f}+\bm{\epsilon}$ in (\ref{factorm}). For the Gaussian population, assume that $\epsilon_i$'s are iid from $N(0, \nu_i^2)$ and $f_1,\cdots ,f_K$ are iid from $N(0, 1)$. For the uniform population, assume that $\epsilon_i$ are iid from Unif$(0, 2\sqrt{3\nu_i^2})$ and $f_1,\cdots ,f_K$ are iid from Unif$(0, 2\sqrt{3})$. We set the true number of common factors $K=5$. For every case, we conduct 1000 replications to summarize the empirical percentages of {true estimation,} overestimation, underestimation of the number of common factors, and the average number of common factors. We consider the following four cases for the factor loading matrix ${\bf B}=(b_{\ell j})_{\ell\in[p], j\in[K]}$. They can be verified to satisfy the imposed conditions, in particular, those in Theorem~\ref{thm0}. \begin{itemize} \item [\bf Case] 1: Let $b_{\ell j}=\sqrt{3p^{-1/2}}$ for $\ell, j\in[K]$ and $b_{\ell j}=a_{\ell j}\sqrt{3(p-j)^{-1}}$ for $\ell\in\{K+1,\cdots ,p\}, j\in[K]$ and $a_{\ell j}=-1$ if $\ell=K j$ or $a_{\ell j}=1$ if $\ell \not=K j$. Assume that $\nu_{1}^2=\cdots =\nu_{p}^2=0.55^2$. The model is from \cite{Harding2013}. \item [\bf Case] 2: Let $b_{\ell j}$ be iid from $N(0, 1)$ and $\nu_{1}^2,\cdots ,\nu_{p}^2$ be iid from Unif$(0, 180)$. \item [\bf Case] 3: Let $b_{\ell j}$ be iid from $N(0, 1)$ and $\nu_{1}^2=\cdots =\nu_{p}^2=36$. The model is used in \cite{BaiNg2002} and \cite{Onatski2010}. \item [\bf Case] 4: Let $b_{jj}=1$, $b_{\ell j}$ be iid from $N(0, 0.04)$ for $j\not=\ell$ and $\nu_{1}^2,\cdots ,\nu_{p}^2$ be iid from Unif$(0, 5.5)$. \end{itemize} The simulation results for Cases 1--4 with $n=300$ are presented respectively in Tables \ref{table2}--\ref{table5}. The results for the cases with $n = 150$ are similar and are omitted. From these tables, we can see that except for very few settings, ``ACT" behaves very well for almost all parameter setups. Even for these few settings, the percentiles of true estimation of ``ACT" are also similar to those of ``ER" and ``GR". \begin{table}[htbp] \caption{Percentages of the estimated number of common factors for Case 1 with $n=300$ in 1000 simulations: ``TRUE", ``OVER" and ``UNDER" truly estimates, overestimates and underestimates the number of common factors, respectively. ``AVE" is the average of the estimated number of common factors.} \renewcommand{\arraystretch}{0.56}\doublerulesep 0.01pt\tabcolsep 0.18in {\small\begin{center} \begin{tabular}{cc|cccccc} \hline \hline $p$& &$PC_3$ &$IC_3$ &$ON_2$ &$ER$ &$GR$ &ACT \cr \hline & &\multicolumn{6}{c}{Gaussian population}\cr \hline 100 &TRUE &99.8 &87.6 &100 &41.8 &75.7 &100\cr &OVER &0 &0 &0 &0 &0 &0\cr &UNDER &0.2 &12.4 &0 &58.2 &24.3 &0\cr &AVE &5 &4.88 &5 &2.87 &4.37 &5\cr \hline 300 &TRUE &92.0 &55.9 &99.9 &4.2 &8.7 &100\cr &OVER &0 &0 &0.1 &0 &0 &0\cr &UNDER &8,0 &44.1 &0 &95.8 &91.3 &0\cr &AVE &4.92 &4.56 &5 &2.09 &2.56 &5\cr \hline 500 &TRUE &0 &0 &100 &0 &0.2 &99.6\cr &OVER &0 &0 &0 &0 &0 &0.4\cr &UNDER &100 &100 &0 &100 &99.8 &0\cr &AVE &3.88 &3.52 &5 &1.78 &1.96 &5\cr \hline 1000&TRUE &0 &0 &79.1 &0 &0 &89.0\cr &OVER &0 &0 &0 &0 &0 &1.9\cr &UNDER &100 &100 &20.9 &100 &100 &9.1\cr &AVE &1.81 &1.33 &4.79 &1.34 &1.38 &4.93\cr \hline & &\multicolumn{6}{c}{Uniform population}\cr \hline 100 &TRUE &99.9 &90.3 &99.9 &44.7 &81.2 &100\cr &OVER &0 &0 &0.1 &0 &0 &0\cr &UNDER &0.1 &9.7 &0 &55.3 &18.8 &0\cr &AVE &5 &4.9 &5 &2.97 &4.52 &5\cr \hline 300 &TRUE &93.3 &62.0 &100 &4.2 &9.0 &100\cr &OVER &0 &0 &0 &0 &0 &0\cr &UNDER &6.7 &38.0 &0 &95.8 &91.0 &0\cr &AVE &4.93 &4.62 &5 &2.07 &2.55 &5\cr \hline 500 &TRUE &0 &0 &99.9 &0.1 &0.3 &99.2\cr &OVER &0 &0 &0.1 &0 &0 &0.8\cr &UNDER &100 &100 &0 &99.9 &99.7 &0\cr &AVE &3.92 &3.55 &5 &1.75 &1.97 &5.01\cr \hline 1000&TRUE &0 &0 &83.3 &0 &0 &89.8\cr &OVER &0 &0 &0.1 &0 &0 &1.5\cr &UNDER &100 &100 &16.6 &100 &100 &8.7\cr &AVE &1.82 &1.29 &4.84 &1.32 &1.37 &4.93\cr \hline \end{tabular} \end{center}\label{table2}} \end{table} \begin{table}[htbp] \caption{Percentages of the estimated number of common factors for Case 2 with $n=300$ in 1000 simulations: ``TRUE", ``OVER" and ``UNDER" truly estimates, overestimates and underestimates the number of common factors, respectively. ``AVE" is the average of the estimated number of common factors.} \renewcommand{\arraystretch}{0.56}\doublerulesep 0.01pt\tabcolsep 0.18in \begin{center} \begin{tabular}{cc|cccccc} \hline \hline $p$& &$PC_3$ &$IC_3$ &$ON_2$ &$ER$ &$GR$ &$ACT$\cr \hline & &\multicolumn{6}{c}{Gaussian population}\cr \hline 100 &TRUE &0 &0 &0.1 &4.2 &4.4 &64.3\cr &OVER &0 &0 &0 &6.6 &7.3 &0.10\cr &UNDER &100 &100 &99.9 &89.2 &88.3 &35.6\cr &AVE &1.18 &1 &1.53 &2.29 &2.37 &4.58\cr \hline 300 &TRUE &47.0 &1.7 &31.2 &27.0 &28.2 &98.9\cr &OVER &0 &0 &0.1 &0.4 &0.4 &1.1\cr &UNDER &53.0 &98.3 &68.7 &72.6 &71.4 &0\cr &AVE &4.42 &2.81 &4.17 &3.01 &3.07 &5.01\cr \hline 500 &TRUE &0 &0 &98.8 &88.9 &89.7 &98.9\cr &OVER &0 &0 &0 &0 &0 &1.1\cr &UNDER &100 &100 &1.2 &11.1 &10.3 &0\cr &AVE &2.44 &1.16 &4.99 &4.76 &4.78 &5.01\cr \hline 1000&TRUE &0 &0 &99.9 &99.9 &99.9 &99.1\cr &OVER &0 &0 &0.1 &0 &0 &0.9\cr &UNDER &100 &100 &0 &0.1 &0.1 &0\cr &AVE &1.17 &1 &5 &5 &5 &5.01\cr \hline & &\multicolumn{6}{c}{Uniform population}\cr \hline 100 &TRUE &0 &0 &0.1 &5.0 &5.4 &60.7\cr &OVER &0 &0 &0.1 &8.4 &9.0 &0.4\cr &UNDER &100 &100 &99.8 &86.6 &85.6 &38.9\cr &AVE &1.17 &1 &1.57 &2.38 &2.45 &4.54\cr \hline 300 &TRUE &48.4 &1.4 &37.8 &31.7 &33.7 &99.4\cr &OVER &0 &0 &0 &0.3 &0.4 &0.6\cr &UNDER &51.6 &98.6 &62.2 &68.0 &65.9 &0\cr &AVE &4.45 &2.83 &4.27 &3.16 &3.25 &5.01\cr \hline 500 &TRUE &0 &0 &99.4 &91.0 &91.6 &99.1\cr &OVER &0 &0 &0.1 &0 &0 &0.9\cr &UNDER &100 &100 &0.5 &9.0 &8.4 &0\cr &AVE &2.44 &1.13 &5 &4.81 &4.83 &5.01\cr \hline 1000&TRUE &0 &0 &99.9 &100 &100 &99.0\cr &OVER &0 &0 &0.1 &0 &0 &1.0\cr &UNDER &100 &100 &0 &0 &0 &0\cr &AVE &1.12 &1 &5 &5 &5 &5.01\cr \hline \end{tabular} \end{center}\label{table3} \end{table} \begin{table}[htbp] \caption{Percentages of the estimated number of common factors for Case 3 with $n=300$ in 1000 simulations: ``TRUE", ``OVER" and ``UNDER" truly estimates, overestimates and underestimates the number of common factors, respectively. ``AVE" is the average of the estimated number of common factors.} \renewcommand{\arraystretch}{0.56}\doublerulesep 0.01pt\tabcolsep 0.18in \begin{center} \begin{tabular}{cc|cccccc} \hline \hline $p$& &$PC_3$ &$IC_3$ &$ON_2$ &$ER$ &$GR$ &$ACT$\cr \hline & &\multicolumn{6}{c}{Gaussian population}\cr \hline 100 &TRUE &0 &0 &0.1 &5.5 &5.8 &0\cr &OVER &0 &0 &0 &9.6 &9.7 &0\cr &UNDER &100 &100 &99.9 &84.9 &84.5 &100\cr &AVE &1 &1 &1.27 &2.51 &2.54 &1.06\cr \hline 300 &TRUE &0 &0 &1.1 &4.2 &4.6 &5.4\cr &OVER &0 &0 &0 &0.8 &0.9 &0\cr &UNDER &100 &100 &98.9 &95 &94.5 &94.6\cr &AVE &1 &1 &2.85 &2.1 &2.14 &2.91\cr \hline 500 &TRUE &0 &0 &32.5 &26.0 &27.3 &71.3\cr &OVER &0 &0 &0 &0.2 &0.2 &2.8\cr &UNDER &100 &100 &67.5 &73.8 &72.5 &25.9\cr &AVE &1 &1 &4.2 &2.92 &2.97 &4.74\cr \hline 1000&TRUE &0 &0 &99.6 &92.3 &92.7 &96.2\cr &OVER &0 &0 &0 &0 &0 &3.8 \cr &UNDER &100 &100 &0.4 &7.7 &7.3 &0 \cr &AVE &1 &1 &5 &4.81 &4.83 &5.04\cr \hline & &\multicolumn{6}{c}{Uniform population}\cr \hline 100 &TRUE &0 &0 &0 &5.0 &5.1 &0\cr &OVER &0 &0 &0 &6.8 &7.0 &0\cr &UNDER &100 &100 &100 &88.2 &87.9 &100\cr &AVE &1 &1 &1.27 &2.33 &2.35 &1.08\cr \hline 300 &TRUE &0 &0 &0.5 &5.2 &5.5 &4.6\cr &OVER &0 &0 &0 &1.2 &1.3 &0.10\cr &UNDER &100 &100 &99.5 &93.6 &93.2 &95.30\cr &AVE &1 &1 &2.87 &2.25 &2.28 &2.92\cr \hline 500 &TRUE &0 &0 &37.3 &31.5 &32.6 &76.10\cr &OVER &0 &0 &0.1 &0.2 &0.2 &1.10\cr &UNDER &100 &100 &62.6 &68.3 &67.2 &22.80\cr &AVE &1 &1 &4.26 &3.08 &3.13 &4.76\cr \hline 1000&TRUE &0 &0 &99.8 &94.5 &94.7 &96.8\cr &OVER &0 &0 &0.1 &0 &0 &3.2\cr &UNDER &100 &100 &0.1 &5.5 &5.3 &0\cr &AVE &1 &1 &5 &4.88 &4.88 &5.03\cr \hline \end{tabular} \end{center}\label{table4} \end{table} \begin{table}[htbp] \caption{Percentages of the estimated number of common factors for Case $4$ with $n=300$ in 1000 simulations: ``TRUE", ``OVER" and ``UNDER" truly estimates, overestimates and underestimates the number of common factors, respectively. ``AVE" is the average of the estimated number of common factors.} \renewcommand{\arraystretch}{0.56}\doublerulesep 0.01pt\tabcolsep 0.18in \begin{center} \begin{tabular}{cc|cccccc} \hline \hline $p$& &$PC_3$ &$IC_3$ &$ON_2$ &$ER$ &$GR$ &$ACT$\cr \hline & &\multicolumn{6}{c}{Gaussian population}\cr \hline 100 &TRUE &0.2 &0 &0.7 &3.9 &4.6 &98.20\cr &OVER &0 &0 &0 &1.9 &2.4 &0.20\cr &UNDER &99.8 &100 &99.3 &94.2 &93 &1.60\cr &AVE &2.4 &1 &2.85 &2.14 &2.21 &4.99\cr \hline 300 &TRUE &99.5 &81.7 &97.8 &81.6 &83 &99.3\cr &OVER &0.1 &0 &0.1 &0 &0 &0.7\cr &UNDER &0.4 &18.3 &2.1 &18.4 &17.0 &0\cr &AVE &5 &4.81 &4.98 &4.55 &4.6 &5.01\cr \hline 500 &TRUE &63.9 &18.5 &100 &99.9 &99.9 &99.4\cr &OVER &0 &0 &0 &0 &0 &0.6\cr &UNDER &36.1 &81.5 &0 &0.1 &0.1 &0\cr &AVE &4.63 &3.81 &5 &5 &5 &5.01\cr \hline 1000&TRUE &4.9 &0.1 &99.9 &100 &100 &99.5\cr &OVER &0 &0 &0.1 &0 &0 &0.5\cr &UNDER &95.1 &99.9 &0.0 &0 &0 &0\cr &AVE &3.6 &2.54 &5 &5 &5 &5\cr \hline & &\multicolumn{6}{c}{Uniform population}\cr \hline 100 &TRUE &0.3 &0 &1.3 &4.7 &5.0 &96.0\cr &OVER &0 &0 &0 &2.4 &2.8 &0.5\cr &UNDER &99.7 &100 &98.7 &92.9 &92.2 &3.5\cr &AVE &2.32 &1 &2.87 &2.21 &2.28 &4.97\cr \hline 300 &TRUE &99.6 &88.1 &98.8 &87.7 &88.7 &99.6\cr &OVER &0 &0 &0.1 &0 &0 &0.4\cr &UNDER &0.4 &11.9 &1.1 &12.3 &11.3 &0\cr &AVE &5 &4.88 &4.99 &4.73 &4.76 &5\cr \hline 500 &TRUE &67.1 &18.1 &99.8 &99.8 &99.8 &99.7\cr &OVER &0 &0 &0.2 &0 &0 &0.3\cr &UNDER &32.9 &81.9 &0 &0.2 &0.2 &0\cr &AVE &4.66 &3.85 &5 &5 &5 &5\cr \hline 1000&TRUE &6.4 &0.2 &99.9 &100 &100 &99.3\cr &OVER &0 &0 &0.1 &0 &0 &0.7\cr &UNDER &93.6 &99.8 &0 &0 &0 &0\cr &AVE &3.71 &2.54 &5 &5 &5 &5.01\cr \hline \end{tabular} \end{center}\label{table5} \end{table} \section{Empirical Studies}\label{ES} This section analyzes two real data on economics and finance to demonstrate our proposed estimation method ACT. {\bf Example 1} (Macroeconomic time series): We use the monthly macroeconomic datasets from March, 1960 to December, 2014 used by \cite{MichNg}. Series 64, 66, 101 and 130 are removed because of missing observations. Following \cite{MichNg}, outliers are removed where an outlier is defined as an observation that deviates from the sample mean by more than ten interquantile ranges. After the datasets are cleaned, the data dimension is $p=123$ and the sample size is $n=583$. \cite{MichNg} used $PC_2$ to select nine factors by using the sample covariance matrix whose nine largest eigenvalues are $3.91\times10^{11}$, $1.20\times10^{10}$, $4.77\times10^{9}$, $3.06\times10^{9}$, $7.25\times10^8$, $3.60\times10^8$, $1.38\times10^{8}$ and $2.83\times10^7$ and $9.00\times10^6$. However, the marginal variances of these 123 time series vary widely from $2.80\times10^{-4}$ to $1.80\times10^{11}$, which jeopardizes the fidelity of the covariance matrix based methods. Our estimation method ACT selects six factors by using the sample correlation matrix whose top nine eigenvalues are $73.10$, $17.81$, $10.22$, $7.00$, $4.80$, $1.97$, $1.53$, $1.17$, $1.06$. In terms percent of variance explained by the selected factors, the 9 selected factors explain 99.99\% of total variation, whereas the 6 selected factors explain 99.95\% of total variation. This is mainly due to the leading eigenvalue which is an order of magnitude larger than the rest. If we look at the standardized variables (the eigenvalues from the correlation matrix), the selected 9 factors explain 96.49\% of total variations whereas the selected 6 factors explain 93.43\%. We now examine whether the number of factors that influences the equity market has changed before and after financial crisis. As an illustration, we use the stationarily transformed macroeconomic time series \citep{MichNg} {\bf Transformed Macro Data Before the Financial Crisis:} We now use the stationarily transformed \citep{MichNg} monthly macroeconomic datasets from January, 1960 to December, 2007 with sample size $n=576$ and $p=123$. Using $PC_2$ as in \cite{MichNg}, nine factors are selected. The nine largest eigenvalues for the sample covariance are $2.28\times10^4$, $13.06$, $1.53$, $0.88$, $0.74$, $0.40$, $0.32$, $0.24$, $0.18$. Again, the marginal sample variances for these $123$ transformed series vary widely from $8.47\times10^{-7}$ to $2.28\times10^{4}$. On the other hand, our estimation method ACT selects 10 factors by using the sample correlation matrix. The 10 largest eigenvalues of the sample correlation matrix are $18.37$, $8.55$, $7.66$, $6.16$, $5.86$, $4.01$, $3.76$, $3.53$, $2.89$, $2.56$. The variances explained by 9 selected and 10 selected factors are both around 99.99\% due to a very spike top eigenvalue. In terms of percentage of variance explained by the standardized variables, ten factors explain 51.53\% whereas nine factors explain 49.45\%. \begin{comment} Figure \ref{fig0} shows $\sqrt{\sigma_{jj}}, j=1,...,p$ where $\sigma_{jj}$ is the sample variance of the $j$th series after economic crisis. \begin{figure} \centerline{ \begin{minipage}{1.0\textwidth} \centerline{\includegraphics[height=6cm, width=10cm]{Figs/BeforeIncluding.png}} \end{minipage}} \caption{Graphical display of $\sqrt{\sigma_{jj}}, j=1,...,p$ where $\sigma_{jj}$ is the sample variance of the $j$th series {\color{blue}before} economic crisis.} \label{fig0} \end{figure} \end{comment} {\bf Transformed Macro Data After the Financial Crisis:} The period covers the data from January, 2010 to October, 2018 with the sample size is $n=106$ and $p=123$. Again, $PC_2$ selects 9 factors. The 9 largest eigenvalues are $5.68\times10^4$, $2.77$, $0.86$, $0.35$, $0.17$, $0.11$, $0.08$, $0.08$, $0.03$. Again, the marginal sample variances vary largely from $5.35\times10^{-7}$ to $5.74\times10^{4}$. In contrast, our estimation method ACT chooses 7 factors. The 9 largest eigenvalues of correlation matrix are $16.48$, $12.20$, $9.23$, $5.75$, $5.68$, $5.27$, $4.22$, $3.82$ and $3.53$. Moreover, nine selected factors explain 53.83\% total variation in 123 series, whereas 7 factors explain 47.85\% total variation in 123 series, which is similar to pre-crisis period by using the same method. \begin{comment} Figure \ref{fig00} shows $\sqrt{\sigma_{jj}}, j=1,...,p$ where $\sigma_{jj}$ is the sample variance of the $j$th series after economic crisis. \begin{figure} \centerline{ \begin{minipage}{1.0\textwidth} \centerline{\includegraphics[height=6cm, width=10cm]{Figs/AfterIncluding.png}} \end{minipage}} \caption{Graphical display of $\sqrt{\sigma_{jj}}, j=1,...,p$ where $\sigma_{jj}$ is the sample variance of the $j$th series {\color{blue}after} economic crisis.} \label{fig00} \end{figure} {\bf Not-Transformed Macro Data Before Crisis:} We use the monthly macroeconomic datasets from {\color{blue}January, 1960 to December, 2007} used by \cite{MichNg}. Series 64, 66, 101 and 130 are removed because they have missing observations. After the datasets are cleaned, the data dimension is $p=123$ and the sample size is $n=576$. \cite{MichNg} used $PC_2$ to select nine factors by using the sample covariance matrix which explains $99.99\%$ total variation in $123$ series whose nine largest eigenvalues are $3.64\times10^{11}$, $1.20\times10^{10}$, $4.63\times10^9$, $1.95\times10^9$, $7.084\times10^8$, $2.41\times10^8$, $3.29\times10^8$, $2.14\times10^7$ and $7.26\times 10^6$. Here, the diagonal elements of sample covariance matrix, that is, the sample variances $\hat{\sigma}_{11},\cdots,\hat{\sigma}_{pp}$ of the $123$ series, varies largely from $2.83\times10^{-4}$ to $1.70\times 10^{11}$. Our estimation method ACT selected six factors by using the sample correlation matrix which explains $93.79\%$ total variation in $123$ series with the {\color{blue}six} largest eigenvalues being $73.83$, $18.29$, $10.28$, $6.25$, $4.85$, $1.86$. {\bf Not-Transformed Macro Data After Crisis:} We use the monthly macroeconomic datasets from {\color{blue}January, 2010 to October, 2018} used by \cite{MichNg}. Series 64, 66, 101 and 130 are removed because they have missing observations. After the datasets are cleaned, the data dimension is $p=123$ and the sample size is $n=106$. $PC_2$ to select nine factors by using the sample covariance matrix which explains $99.99\%$ total variation in $123$ series whose nine largest eigenvalues are $3.45\times10^{11}$, $1.84\times10^{10}$, $2.51\times10^9$, $2.93\times10^8$, $1.56\times10^8$, $9.28\times10^7$, $7.18\times10^7$, $2.68\times10^7$, $8.92\times10^6$. Here, the diagonal elements of sample covariance matrix, that is, the sample variances $\hat{\sigma}_{11},\cdots,\hat{\sigma}_{pp}$ of the $123$ series, varies largely from $1.18\times10^{-4}$ to $3.08\times 10^{11}$. Our estimation method ACT selected {\color{blue}four} factors by using the sample correlation matrix which explains $91.31\%$ total variation in $123$ series with the six largest eigenvalues being $82.47$, $17.06$, $8.46$, $4.31$. \end{comment} {\bf Example 2} (100 Fama-French portfolios): We now estimate the number of factors using the excess returns of Fama-French 100 portfolios. The data can be downloaded from the data library of Professor Kenneth French's website. Again, we divide the data into two periods: before and after financial crisis. {\bf Before the Financial Crisis:} Following \cite{FanZhangYu2012}, we use the daily returns of 100 industrial portfolios formed on the basis of size and book-to-market ratio from January 2, 1998 to December 31, 2007. We note that the $71$th and $100$th portfolios have very large variances that possibly jeopardize the covariance matrix based methods. $PC_3$, $IC_3$, $ON_2$, $ER$ and $GR$ estimate the number of factors as $10$, $10$, $6$, $3$ and $3$, respectively. The largest 10 eigenvalues of the sample covariance matrix are $1824.45$, $885.13$, $117.39$, $9.74$, $5.38$, $3.17$, $2.31$, $2.14$, $1.86$, $1.59$. Ten factors explain $98.86\%$ total variation in the $100$ portfolios; four factors (suggested by ACT) explain $98.29\%$ total variation in $100$ portfolios. On the other hand, ACT selects four factors. The largest 10 eigenvalues of sample correlation matrix are $65.81$, $5.74$, $2.57$, $1.95$, $1.10$, $0.97$, $0.90$, $0.83$, $0.72$, $0.63$. Ten factors explain $81.26\%$ total variation, whereas four factors explain $76.09\%$ total variation in $100$ portfolios, in the standardized variables. \begin{table}[htbp] \caption{Percent $R^2$ of well-known risk factors explained by PC-factors} \begin{center} \begin{tabular}{c|cccc} \hline &Rm-Rf &SMB & HML & Momentum \cr Before crisis (4 selected factors) & 0.953 & 0.931 & 0.829 & 0.141 \cr Before crisis (3 selected factors)& 0.947 & 0.813 & 0.821 & 0.132 \cr After crisis (3 selected factors) & 0.982 & 0.891 & 0.917 & 0.155 \cr \hline \end{tabular} \end{center}\label{table6} \end{table} The well-known risk factors for equity markets are Fama-French factors \citep{fama1993common,fama2015five} and the momentum factor \citep{carhart1997persistence}. To examine how these known factors can be explained by the unsupervised learning method (PCA with number of factors selected by ACT), we regress each known risk factor on the four principal component factors and report the coefficients of determination $R^2$ in Table~\ref{table6}. As comparison, we also regress these Fama-French factors on the 3 selected factors and report the result in the same table. First of all, the well-known Fama-French factors (Rm-Rf is the market factor; SMB is the size factor; HML is the value factor; these three factors are nearly uncorrelated) are explained very well by the factors learned from the principal components. Regarding PC-factors as true factors (subject to learning or estimation errors), the results lend further support that the Fama-French factors are three most important factors, spanning essentially the same space as the first three PC-factors (regressing on first 3 PCs yields similar results). Such a confirmation of Fama-French factors appears new. On the other hand, the momentum factors can not be explained well by the first four principal components, which is a surprise. Figure 1 depicts how well these four well-known equity risk factors can be explained by the four principal components. As expected, the four principal components explain the Fama-French factors better than the first four principal components. On the other hand, the Carhart's momentum factor is not supported by the principal components. \begin{figure \centerline{ \begin{minipage}{0.35\textwidth} \centerline{\includegraphics[height=4cm, width=4cm]{BeforeMktRF.png}} \end{minipage} \begin{minipage}{0.35\textwidth} \centerline{\includegraphics[height=4cm,width=4cm]{BeforeSMB.png}} \end{minipage} } \centerline{ \begin{minipage}{0.35\textwidth} \centerline{\includegraphics[height=4cm, width=4cm]{BeforeHML.png}} \end{minipage} \begin{minipage}{0.35\textwidth} \centerline{\includegraphics[height=4cm,width=4cm]{BeforeMomentum.png}} \end{minipage} } \caption{Graphical display for every observable factor v.s. its fitted values by regressing every observable factor on the four principal component factors before economic crisis.} \label{fig1} \end{figure} \begin{comment} \begin{figure} \centerline{ \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm, width=6.2cm]{Figs/newBeforeMktRF.png}} \end{minipage} \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm,width=6cm]{Figs/newBeforeSMB.png}} \end{minipage} } \centerline{ \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm, width=6cm]{Figs/newBeforeHML.png}} \end{minipage} \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm,width=6cm]{Figs/newBeforeMomentum.png}} \end{minipage} } \caption{Graphical display for every observable factor and its fitted values v.s. date by regressing every observable factor on our {\color{blue}four} principal component factors before economic crisis.} \label{fig10} \end{figure} \end{comment} We measure the difference between four given risk factors and four learned factors by using their projection matrix. Let $A$ be a $n\times 4$ matrix formed by the time series of the four known factors and $B$ be an $n\times 4$ matrix formed the four principal component factors. Define the projection matrix as $P_A=A (A^TA)^{-1} A^T$ and $P_B=B (B^TB)^{-1} B^T$. We then measure the difference between the space spanned by the four well-known factors and four learned PC-factors by using the Operator norm and Frobenius norm. For our data, they are $$\|P_A - P_B\|_2=0.973,\quad \|P_A - P_B\|_F=1.591.$$ In a similar vein, we measure the difference between the 3 Fama-French factors (A) and the three principal factors (B) by using the projection matrices. They are $$ \|P_A-P_B\|_2 = 0.481, \quad \|P_A-P_B\|_F=0.949. $$ {\bf After the Financial Crisis:} We extrac the data from January 4, 2010 to April 30, 2019. The covariance matrix based methods $PC_3$, $IC_3$, $ON_2$, $ER$ and $GR$ estimate number of factors as $6$, $6$, $6$, $1$ and $1$, respectively. On the other hand, ACT selects three factors which explain $85.90\%$ total variation in $100$ portfolios with three largest eigenvalues being $80.62$, $3.22$ and $2.06$ based on the sample correlation matrix. The $R^2$ of each the four well-known risk factors determined by three principal component factors is depicted in Table~\ref{table6}. Again, this confirms once more that the famous Fama-French factors aligned well with the first 3 principal components. Indeed, the differences between the two spaces are $$\|P_A - P_B\|_2=0.406,\quad\|P_A - P_B\|_F=0.708,$$ smaller than what it is before the financial crisis. On the other hand, the momentum factors are still not explained well by the PC factors. \begin{comment} \begin{figure} \centerline{ \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm, width=5cm]{Figs/AfterMktRF.png}} \end{minipage} \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm,width=5cm]{Figs/AfterSMB.png}} \end{minipage} } \centerline{ \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm, width=5cm]{Figs/AfterHML.png}} \end{minipage} \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm,width=5cm]{Figs/AfterMomentum.png}} \end{minipage} } \caption{Graphical display for every observable factor v.s. its fitted values by regressing every observable factor on our {\color{blue}three} principal component factors after economic crisis.} \label{fig2} \end{figure} \begin{figure} \centerline{ \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm, width=5cm]{Figs/newAfterMktRF.png}} \end{minipage} \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm,width=5cm]{Figs/newAfterSMB.png}} \end{minipage} } \centerline{ \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm, width=5cm]{Figs/newAfterHML.png}} \end{minipage} \begin{minipage}{0.5\textwidth} \centerline{\includegraphics[height=6cm,width=5cm]{Figs/newAfterMomentum.png}} \end{minipage} } \caption{Graphical display for every observable factor and its fitted values v.s. date by regressing every observable factor on our {\color{blue}three} principal component factors after economic crisis.} \label{fig20} \end{figure} Although ACT selects three factors, we still use {\color{blue}four principal component factors} which explain $86.71\%$ total variation in $100$ portfolios with {\color{blue}four} largest eigenvalues being $80.62$, $3.22$, $2.06$ and $0.81$. For each observable factor (regarded as a response variable), we regress it on our {\color{blue}four principal component factors.} \begin{itemize} \item Regarding the Fama-French factor $R_m-R_f$ as a response variable, $R^2=0.990$; \item Regarding the Fama-French factor $SMB$ as a response variable, $R^2=0.860$; \item Regarding the Fama-French factor $HML$ as a response variable, $R^2=0.917$; \item Regarding the momentum factor as a response variable, $R^2=0.156$. \end{itemize} Let $A$ be a $n\times 4$ matrix formed by factor scores of {\color{blue}four} observable factors. Let $B$ be a $n\times 4$ matrix formed by factor scores of our {\color{blue}four} principal component factors. Then the matrix norms of $P_A-P_B$ are as follows: $$\|P_A - P_B\|_2=0.99,\quad\|P_A - P_B\|_F=1.51.$$ \end{comment} \section{Conclusions}\label{Conclusion} Based on the sample correlation matrix, this paper discovers the equality between the number of eigenvalues exceeding one and the number of latent factors. To utilize such a relationship, we study the random matrix theory based on the sample correlation in order to correct the biases in estimating the top eigenvalues and to take into account of estimation errors in eigenvalue estimation. This gives rise naturally to the adjusted correlation thresholding (ACT) for determining the number of common factors in high dimensional factor models. The estimation method overcomes the disadvantages of using the sample covariance matrix which allows observable variables incomparable in their scales. Simulation studies show that our proposed estimation method outperforms competing methods in the literature. This paper considers the iid samples from the static factor model. But in practice, people also care about the dynamic factor model. Our future work will establish the relationship between the population correlation matrix and the number of common factors in the dynamic factor models, and propose estimating the number of factors in the high dimensional dynamic factor model. \bigskip \begin{center} {\large\bf SUPPLEMENTARY MATERIAL} \end{center} \begin{description} \item[Title:] Supplementary material for ``Estimating Number of Factors by Adjusted Eigenvalues Thresholding". The material includes 8 lemmas and their proofs, and the proofs of Lemma 1 and Theorem 1, 2, 3. (SuppleFileFactor.pdf) \item[R codes for ACT:] R codes are used for simulation studies in Section~\ref{Simu} and empirical studies in Section~\ref{ES} (simuexam zipped file). \item[Data sets:] Data sets are used in empirical studies in Section~\ref{ES}. (data zipped file) \end{description}
\section{Introduction \label{sec:Introduction}} Collective modes in superfluids and superconductors play a pivotal role in understanding gauge invariance in a many-particle context~\citep{Schrieffer,Rickayzen,Parks}. These modes comprise amplitude and phase fluctuations of the order parameter~\citep{Arseev_2006,Anderson_2016}, and in the context of neutral superfluids the presence of the phase mode is evinced as a longitudinal sound oscillation~\citep{Anderson_1958,Rickayzen_1959,Nambu_1960}. Observation of the amplitude mode in a condensed-matter context, while possible, is rather challenging~\citep{Pekker_Varma_2015}. Some particular cases where this mode was indeed observed include systems with emergent Lorentz invariance~\citep{Pollet_Prokofev_2012,Bloch_2012,Sherman_2015} and superconductors coupled to either charge-density waves~\citep{Littlewood_Varma_1981,Browne_Levin_1983} or optical modes~\citep{Matsunaga1145,shimano_higgs}. Collective modes in general provide non-trivial examples of the rich physics associated with broken symmetries and non-trivial ordering~\citep{RevModPhys.87.457,Zha_1995}. In contrast, the Meissner effect is conventionally understood as a ``transverse'' response~\citep{PinesNozieres2,Martin_1967}, where ``longitudinal'' collective modes are not thought to participate. This issue was addressed, partly clarified, in Ref.~\citep{Millis_1987}. There it was shown that in nonuniform superfluids the ``longitudinal'' collective modes can possibly appear in what are termed -- in the context of uniform systems -- ``transverse'' response functions. In addition, Ref.~\citep{Boyack_2017} provided an explicit calculation of the electromagnetic (EM) response of the Fulde-Ferrell (FF) superfluid, which consists of finite-momentum Cooper pairs, and showed that the amplitude mode gives a significant contribution to the superfluid density. These issues motivate the current work, where we investigate the superfluid response for systems with nonuniform pairing, such as $p$-wave superfluids~\citep{Hoyos_Moroz_Son_2014,Ariad_2015} and superconductors~\citep{Yakovenko_2008,Yakoveko_2009}, and we provide a more general understanding on the type of superconductor where collective modes can contribute to the Meissner response. We define a uniform superfluid or superconductor to be one where the order parameter two-point function is both translation and rotation invariant. A nonuniform system is one that is not uniform, and as such it violates either one or both of the conditions above. In the case of uniform $s$-wave superconductors, gauge invariance and the uniformity of the gap establishes that there is no collective-mode contribution to the Meissner effect~\citep{AGDBook}. When isotropy is broken, however, this argument needs to be revisited~\citep{Millis_1987}. \textcolor{black}{Phase fluctuations of the order parameter must be included to derive a gauge-invariant EM response~\citep{Anderson_2016}. On top of this, one can also consider amplitude fluctuations of the order parameter, and these have been shown~\citep{Anderson_2016} to be necessary to satisfy a thermodynamic sum rule, namely the compressibility sum rule~\citep{Guo_Chien_He_2013,PinesNozieres1}. }Of particular interest is the response in $p$-wave superfluids~\citep{Ariad_2015,Hoyos_Moroz_Son_2014,Yakovenko_2008,Yakoveko_2009} and also in systems with other pairing symmetries~\citep{Sharapov_2001}. A complete calculation of the EM response for a $p$-wave system, in the presence of Coulomb and amplitude and phase\textcolor{black}{{} fluctuations of the order parameter, has not been, to the best of our knowledge, presented in the literature, and the question of the Meissner response for such a system was unaddressed in Ref.~\citep{Millis_1987}. In this paper we show that collective modes do not contribute to the Meissner effect in neither} uniform\textcolor{black}{{} }$s$-\textcolor{black}{wave nor nonuniform }$p$-wave \textcolor{black}{superconductors}. More generally, our results show that collective modes do not contribute to the Meissner effect, independent of the pairing symmetry, in any superconductor that does not display an external wavevector scale (e.g. finite-momentum pairing). In order to derive this result, we develop a method for computing the gauge-invariant EM response of an electronic system with multiple collective modes present. Our analysis is based on an extension of the path-integral formulation of Ref.~\citep{Anderson_2016} and matrix linear-response approaches of Refs.~\citep{Kulik1981,Arseev_2006,Guo_Chien_He_2013}. One of our central results is to demonstrate how these collective modes can be incorporated in comprehensive and illuminating EM response tensors using singular-value decompositions. For pedagogical purposes we consider several examples of application, including the Coulomb screening in a normal metal and phase fluctuations in the EM response of a superfluid. We demonstrate the power of our formulation by obtaining the manifestly gauge-invariant EM response tensor for superconductors with amplitude, phase, and Coulomb fluctuations present. More generally, our results are applicable to a variety of scenarios beyond the scope of this work. They are relevant in any situation where energy scales compete, leading to intertwined ordering~\citep{RevModPhys.87.457}, or where symmetries provide multi-dimensional order parameters. The study of the concomitant contribution of distinct collective modes to the EM response tensor provides a direct method to access signatures of broken symmetries and non-trivial ordering. The paper is organized as follows: in Sec.~\ref{sec:Responses} we outline general formulae for the electromagnetic susceptibility tensors; a careful derivation of these formulae is provided in Appendix~\ref{sec:tensor}. Following this, Sec.~\ref{sec:Applications} provides a set of applications of these formulae, including: Coulomb screening, phase fluctuations in a superfluid, the gapping of phase modes in a superconductor by Coulomb screening, and finally the mixing of phase modes with amplitude-Higgs modes in a charged superconductor. This section contains our algebraic approach to screening by use of singular-value decompositions. Finally, Sec.~\ref{sec:Meissner} addresses our discussions regarding the Meissner effect and we conclude in Sec.~\ref{sec:Conclusions}. Appendices~\ref{sec:Qmunu}-\ref{sec:Det_SVD} provide further details on several relevant calculations. \section{Electromagnetic response tensor \label{sec:Responses}} The starting point of our analysis is a fermionic system subject to a set of collective fluctuating degrees of freedom. The latter are described by a set of generalized coordinates, denoted by $\boldsymbol{\Delta}$, which should be thought of as a vector of Hubbard-Stratonovich decoupling fields. In the presence of an external EM probe $A$, we consider the dynamics of the EM response at the mean-field level, which is defined by the following conditions for each component $\Delta_{a}$ of $\boldsymbol{\Delta}$ : \begin{equation} \left.\frac{\delta S_{\text{eff}}\left[\boldsymbol{{\bf \Delta}},A\right]}{\delta{\bf \Delta}_{a}\left(x\right)}\right|_{\boldsymbol{\Delta}=\boldsymbol{{\bf \Delta}}_{\textrm{mf}}\left[A\right]}=0.\label{eq:MF} \end{equation} Here, $S_{\text{eff}}$ is the effective action for the fluctuating degrees of freedom, in the presence of the external EM probe, obtained after integration over the fermionic degrees of freedom~\footnote{We assume that the procedure of integrating out the fermions is well defined.}. The solutions to the mean-field equations, $\boldsymbol{\Delta}_{\text{mf}}\left[A\right]$, are no longer arbitrary fluctuating degrees of freedom to be functionally integrated over, but rather they are functions determined by the external EM probe~\citep{Ambegaokar_Kadanoff_1961,Arseev_2006,Anderson_2016}. As a result, the mean-field EM response tensor reads \begin{equation} K_{\textrm{mf}}^{\mu\nu}(x,y)=\left.\frac{\delta^{2}S_{\text{eff}}\left[\boldsymbol{{\bf \Delta}}_{\textrm{mf}}\left[A\right],A\right]}{\delta A_{\mu}\left(x\right)\delta A_{\nu}\left(y\right)}\right|_{A=0}. \end{equation} Note that $K^{\mu\nu}\left(x,y\right)=K^{\nu\mu}\left(y,x\right)$. In this paper imaginary time will be used and thus $A^{\mu}=\left(A_{0},\mathbf{A}\right)=\left(iA_{t},\mathbf{A}\right)$. To evaluate these derivatives it is necessary to use a functional chain rule and differentiate all terms with dependence on the vector potential. This manipulation, together with an application of the mean-field equations in Eq.~(\ref{eq:MF}), is presented in Appendix~\ref{sec:tensor}; the result is a matrix form for the mean-field-level EM response, namely, \begin{align} K_{\textrm{mf}}^{\mu\nu}\left(x,y\right)= & Q^{\mu\nu}\left(x,y\right)-\int_{z,z'}\biggl\{ R^{\mu a}\left(x,z\right)\nonumber \\ & \times\left[S^{-1}\left(z,z'\right)\right]^{ab}R^{b\nu}\left(z',y\right)\biggr\},\label{eq:EM_resp} \end{align} where \begin{align} Q^{\mu\nu}\left(x,y\right) & =\left.\frac{\delta^{2}S_{\text{eff}}\left[\boldsymbol{{\bf \Delta}},A\right]}{\delta A_{\mu}\left(x\right)\delta A_{\nu}\left(y\right)}\right|_{A=0,\boldsymbol{{\bf \Delta}}=\boldsymbol{{\bf \Delta}}_{\textrm{mf}}[0]},\label{eq:Qdef}\\ R^{\mu a}\left(x,y\right) & =R^{a\mu}\left(y,x\right)\nonumber \\ & =\left.\frac{\delta^{2}S_{\text{eff}}\left[\boldsymbol{{\bf \Delta}},A\right]}{\delta A_{\mu}\left(x\right)\delta{\bf \Delta}_{a}\left(y\right)}\right|_{A=0,\boldsymbol{{\bf \Delta}}=\boldsymbol{{\bf \Delta}}_{\textrm{mf}}[0]},\label{eq:Rdef} \end{align} and \begin{equation} S^{ab}\left(x,y\right)=\left.\frac{\delta^{2}S_{\text{eff}}\left[\boldsymbol{{\bf \Delta}},A\right]}{\delta{\bf \Delta}_{a}\left(x\right)\delta{\bf \Delta}_{b}\left(y\right)}\right|_{A=0,\boldsymbol{{\bf \Delta}}=\boldsymbol{{\bf \Delta}}_{\textrm{mf}}[0]}.\label{eq:Sdef} \end{equation} Here, the derivatives with respective to the gauge field $A$ act only on the explicit vector-potential dependence. In the second contribution of Eq.~(\ref{eq:EM_resp}), we emphasize that the matrix $S^{ab}$ must be computed first, as in Eq.~(\ref{eq:Sdef}), and then inverted before being inserted into Eq.~(\ref{eq:EM_resp}). In other words, Eq.~(\ref{eq:EM_resp}) does not involve the inverse of each matrix element of Eq.~(\ref{eq:Sdef}), but rather the elements of the inverse of the matrix itself. This expression contains several insightful properties. First, it manifestly decouples into two contributions which correspond, respectively, to the bubble and collective-mode linear responses. Second, this expression is reparameterization covariant, i.e., it does not change form under a basis transformation of $\boldsymbol{\Delta}$. This means that all fluctuations are considered symmetrically, in an unbiased manner. In the context of superconductivity, for example, Eq.~(\ref{eq:EM_resp}) can be equally used for considering fluctuations in the real and imaginary part of the superconducting pairing strength~\citep{Kulik1981}, or for fluctuations in the radial and phase degrees of freedom, as we shall do later in the paper. Third, by writing this expression in real space it affords greater generality and can thus be used, for example, in the presence of either impurities or defects occurring in collective-mode order parameters. For a translation-invariant system, the momentum-space representation is more tractable and reads \begin{equation} K_{\text{mf}}^{\mu\nu}\left(q\right)=Q^{\mu\nu}\left(q\right)-R^{\mu a}\left(q\right)\left[S^{-1}\left(q\right)\right]^{ab}R^{b\nu}\left(q\right),\label{eq:Em_in_q} \end{equation} where, for example, \begin{equation} Q^{\mu\nu}\left(x,y\right)=Q^{\mu\nu}\left(x-y\right)=\int_{q}e^{-iq\cdot\left(x-y\right)}Q^{\mu\nu}\left(q\right). \end{equation} We use the short-hand notation $\int_{q}=TL^{d}\sum_{i\Omega_{m}}\int\frac{d{\bf q}}{\left(2\pi\right)^{d}}$, where $L$ is a length scale, $d$ is the number of spatial dimensions, $T$ is the temperature, and $\Omega_{m}$ is a bosonic Matsubara frequency. Natural units $c=\hbar=k_{B}=1$ are used throughout the paper. \section{General applications \label{sec:Applications}} In this section we present several applications of Eq.~(\ref{eq:Em_in_q}). For the benefit of the reader, in the following subsections we take a pedagogical approach and start with a rather detailed calculation of the application of Eq.~(\ref{eq:EM_resp}) in two familiar scenarios: \ref{subsec:ScreeningCoulomb}-Electrostatic screening and \ref{subsec:SCPhase}-gauge-invariant response in superfluids due to phase fluctuations. With the mathematical procedures well established, we will then move on at a progressively faster pace: in \ref{subsec:ChargedSCPhase} we study the next simplest possible scenario -- a superconductor with phase fluctuations -- and here we introduce the concept of folding the effects of competing fluctuations using singular-value decompositions. The d$\acute{\text{e}}$nouement of this section is \ref{subsec:ChargedSCPhaseAmplitude}, where we put all this methodology together to compute the EM response tensor in the non-trivial case of concomitantly fluctuating Coulomb and superconducting phase and amplitude degrees of freedom. To clarify our terminology, a superconductor is a charged system with Coulomb interactions present and a superfluid is a neutral system. \subsection{Screening due to electrostatic interactions\label{subsec:ScreeningCoulomb}} Consider an interacting electronic system in $D=d+1$ spacetime dimensions with an action given by \begin{align} S\left[A\right]= & -\int d^{D}xd^{D}x'\psi_{\sigma}^{\dagger}\left(x\right)\mathcal{G}_{0}^{-1}\left[A\right]\left(x,x'\right)\psi_{\sigma}\left(x'\right)\nonumber \\ & +\frac{e^{2}}{2}\int d^{D}xd^{D}x'\delta n\left(x\right)V\left(x-x'\right)\delta n\left(x'\right)\nonumber \\ & +ie\int d^{D}xA_{t}\left(x\right)n_{0}, \end{align} where $\delta n\left(x\right)=\psi_{\sigma}^{\dagger}\left(x\right)\psi_{\sigma}\left(x\right)-n_{0}$, with $n_{0}$ the constant background density, $\sigma=\downarrow,\uparrow$ is a spin index (summed if repeated) and the inverse Green's function is \begin{equation} \mathcal{G}_{0}^{-1}\left[A\right]\left(x,x'\right)=-\left(\partial_{\tau}-ieA_{t}\left(x\right)+h\left(\hat{\mathbf{p}}-e\mathbf{A}\right)\right)\delta\left(x-x'\right). \end{equation} The single-particle Hamiltonian, denoted by $h\left({\bf p}\right)$, is kept general at this stage. For concreteness, we assume instantaneous interactions: $V\left(x-x'\right)=V\left(\mathbf{x}-\mathbf{x}'\right)\delta\left(\tau-\tau'\right)$. Throughout the paper we shall interchangeably refer to electronic density fluctuations as Coulomb fluctuations. The generating functional for electromagnetic response is then \begin{equation} \mathcal{Z}\left[A\right]=\int\mathcal{D}\left[\psi^{\dagger},\psi\right]e^{-S\left[A\right]}. \end{equation} We are interested in how nonuniform charge distributions affect the EM response of this system. Thus it is natural to consider decoupling the electrostatic interaction terms via a Hubbard-Stratonovich decomposition as \begin{equation} \mathcal{Z}\left[A\right]\sim\int\mathcal{D}\varphi e^{-S_{\text{eff}}\left[\varphi,A\right]}, \end{equation} Defining $\beta=1/T$ and $\mathcal{G}^{-1}\left[\varphi,A\right]=\mathcal{G}^{-1}\left[A_{t}+\varphi,\mathbf{A}\right]$, the effective action is \begin{align} S_{\text{eff}}\left[\varphi,A\right]= & \int d^{D}xd^{D-1}x'\frac{\varphi\left(\mathbf{x},\tau\right)\varphi\left(\mathbf{x}',\tau\right)}{2V\left(\mathbf{x}-\mathbf{x}'\right)}\nonumber \\ & +ie\int d^{D}x\left(A_{t}\left(x\right)+\varphi\left(x\right)\right)n_{0}\nonumber \\ & -\textrm{Tr}\ln\left(-\beta\mathcal{G}_{0}^{-1}\left[\varphi,A\right]\right). \end{align} The capitalized trace denotes a trace over all space-time/momentum-frequency and internal (uncapitalized trace) degrees of freedom: \begin{equation} \textrm{Tr}\ln\left(-\beta\mathcal{G}_{0}^{-1}\left[\varphi,A\right]\right)=\int d^{D}x\text{tr}\left\langle x\left|\ln\left(-\beta\mathcal{G}_{0}^{-1}\left[\varphi,A\right]\right)\right|x\right\rangle .\label{eq:trace_eff} \end{equation} In this language, we obtain the building blocks for Eq.~(\ref{eq:EM_resp}) (which are tantamount to undressed polarization tensors). In fact, due to translation invariance, we can focus on the expressions in momentum space used in Eq.~(\ref{eq:Em_in_q}). For instance, \begin{align} Q^{\mu\nu}\left(q\right) & \equiv\left.\frac{\delta^{2}S_{\text{eff}}\left[\varphi,A\right]}{\delta A_{\mu}\left(-q\right)\delta A_{\nu}\left(q\right)}\right|_{A,\varphi=0}\nonumber \\ & =-\left.\frac{\delta^{2}\textrm{Tr}\ln\left(-\beta\mathcal{G}_{0}^{-1}\left[\varphi,A\right]\right)}{\delta A_{\mu}\left(-q\right)\delta A_{\mu}\left(q\right)}\right|_{A,\varphi=0}. \end{align} Similarly, noticing that $A_{0}=iA_{t}$ and that all terms involving $\varphi$ appear in the Green's function as $iA_{t}+i\varphi$ , one finds \begin{align} R^{\mu\varphi}\left(q\right) & \equiv\left.\frac{\delta^{2}S_{\text{eff}}\left[\varphi,A\right]}{\delta A_{\mu}\left(-q\right)\delta\varphi\left(q\right)}\right|_{A,\varphi=0}=iQ^{\mu0}\left(q\right),\\ S^{\varphi\varphi}\left(q\right) & =\left.\frac{\delta^{2}S_{\text{eff}}\left[\boldsymbol{{\bf \Delta}},A\right]}{\delta\varphi\left(-q\right)\delta\varphi\left(q\right)}\right|_{A,\varphi=0}\nonumber \\ & =V^{-1}\left(q\right)-Q^{00}\left(q\right).\label{eq:Sfifi} \end{align} Conveniently, all building blocks can be expressed in terms of the undressed polarization tensor $Q^{\mu\nu}\left(q\right)$. An in-depth analysis of these expressions is provided in Appendix~\ref{sec:Qmunu}. Applying Eq.~(\ref{eq:Em_in_q}) now becomes a simple matter (we drop the $q$-dependence label for simplicity): \begin{align} K_{\text{mf}}^{\mu\nu} & =Q^{\mu\nu}-\left(iQ^{\mu0}\right)\left(V^{-1}-Q^{00}\right)^{-1}\left(iQ^{0\nu}\right)\nonumber \\ & =Q^{\mu\nu}+\frac{Q^{\mu0}VQ^{0\nu}}{1-VQ^{00}}\equiv\widetilde{Q}^{\mu\nu}.\label{eq:Coulomb_scre} \end{align} The last definition will be used throughout later sections of the paper. The above result reproduces the screening effect of Coulomb fluctuations. In particular, the RPA charge-charge susceptibility~\citep{PinesNozieres1} is obtained: \begin{equation} K_{\text{mf}}^{00}=\frac{Q^{00}}{1-VQ^{00}}. \end{equation} \subsection{EM response for superfluids (with no amplitude fluctuations)\label{subsec:SCPhase}} Another simple application of Eq.~(\ref{eq:Em_in_q}) concerns the gauge-invariant EM response tensor for superfluids with phase fluctuations of the order parameter. In superfluids where the mean-field order parameter takes on a finite vacuum expectation value the global U(1) symmetry is spontaneously broken. To restore gauge-invariance, the phase fluctuations of the order parameter must be included. In this section we consider a superfluid where the amplitude of the order parameter is rigidly pinned down to its mean-field value, but allow the phase to depend on the external EM probe. It is straightforward to analyze this scenario with our present approach. Consider a set of non-relativistic spin-$\frac{1}{2}$ particles, with free Hamiltonian $h\left(\mathbf{p}\right)=\mathbf{p}^{2}/\left(2m\right)-\mu$, interacting instantaneously with each other via an attractive, translation-invariant, but possibly anisotropic potential $g\left(\mathbf{x}-\mathbf{x}^{\prime}\right)$. In the presence of an external probe field $A$, the action reads \begin{align} S\left[A\right]= & -\int d^{D}xd^{D}x'\psi_{\sigma}^{\dagger}\left(x\right)\mathcal{G}_{0}^{-1}\left[A\right]\left(x,x'\right)\psi_{\sigma}\left(x'\right)\nonumber \\ & -\int d^{D}xd^{D}x'\psi_{\uparrow}^{\dagger}\left(x\right)\psi_{\downarrow}^{\dagger}\left(x'\right)g\left(x-x^{\prime}\right)\psi_{\downarrow}\left(x'\right)\psi_{\uparrow}\left(x\right)\nonumber \\ & +ie\int d^{D}xA_{t}n_{0}. \end{align} Here, $g\left(x-x^{\prime}\right)=g\left(\mathbf{x}-\mathbf{x}^{\prime}\right)\delta\left(\tau-\tau^{\prime}\right)$. Preparing again for the mean-field treatment of the problem, we now perform a Hubbard-Stratonovich decomposition in the Cooper channel to arrive at the generating functional \begin{equation} \mathcal{Z}\left[A\right]\sim\int\mathcal{D}\left[\Delta,\Delta^{*}\right]\mathcal{D}\left[\psi^{\dagger},\psi\right]e^{-S_{\text{bos}}}e^{-S_{\text{el}}}, \end{equation} where the bosonic contribution to the action is \begin{equation} S_{\text{bos}}=ie\int d^{D}xA_{t}n_{0}+\int d^{D}xd^{D-1}x^{\prime}\frac{\left|\Delta\left(\mathbf{x},\mathbf{x}^{\prime},\tau\right)\right|^{2}}{g\left(\mathbf{x}-\mathbf{x}^{\prime}\right)} \end{equation} and the electronic contribution is \begin{align} S_{\text{el}}= & -\int d^{D}xd^{D}x^{\prime}\psi_{\sigma}^{\dagger}\left(x\right)\mathcal{G}_{0}^{-1}\left[A\right]\left(x,x^{\prime}\right)\psi_{\sigma}\left(x^{\prime}\right)\nonumber \\ & -\int d^{D}xd^{D-1}x^{\prime}\left[\psi_{\uparrow}^{\dagger}\left(\mathbf{x},\tau\right)\Delta\left(\mathbf{x},\mathbf{x}^{\prime},\tau\right)\psi_{\downarrow}^{\dagger}\left(\mathbf{x}^{\prime},\tau\right)+\text{h.c.}\right]. \end{align} Before integrating out the fermions, remember that the symmetry of the interaction potential $g\left(\mathbf{x}-\mathbf{x}^{\prime}\right)$ is decisive in determining the symmetry structure of the pairing field. Due to the homogeneity of the problem (in the absence of strong driving external EM fields), it is advantageous to use relative and center-of-mass coordinates to describe the pairing field: \begin{equation} \Delta\left(\mathbf{x},\mathbf{x}^{\prime},\tau\right)\to\Delta\left(\mathbf{x}-\mathbf{x}^{\prime},\frac{\mathbf{x}+\mathbf{x}^{\prime}}{2},\tau\right). \end{equation} We ignore spin-orbit coupling. In this case, spherical anisotropy in the pairing potential can be captured in a gradient expansion of $\Delta$ \begin{align} & \Delta\left(\mathbf{x}-\mathbf{x}^{\prime},\frac{\mathbf{x}+\mathbf{x}^{\prime}}{2},\tau\right)\nonumber \\ & =\left|\Delta_{s}\left(\frac{\mathbf{x}+\mathbf{x}^{\prime}}{2},\tau\right)\right|e^{i\Phi_{s}\left(\frac{\mathbf{x}+\mathbf{x}^{\prime}}{2},\tau\right)}\delta\left(\mathbf{x}-\mathbf{x}^{\prime}\right)\label{eq:pairing_exp}\\ & +\left|\Delta_{p}\left(\frac{\mathbf{x}+\mathbf{x}^{\prime}}{2},\tau\right)\right|e^{i\Phi_{p}\left(\frac{\mathbf{x}+\mathbf{x}^{\prime}}{2},\tau\right)}\left(\partial_{x}+i\partial_{y}\right)\delta\left(\mathbf{x}-\mathbf{x}^{\prime}\right)+...,\nonumber \end{align} where we favor an amplitude-phase coordinate choice. In general, the pairing potential will select only one term in Eq.~(\ref{eq:pairing_exp}); the structure we chose for the interaction, in fact, favors opposite-spin pairing by construction. Nevertheless, we can remain fairly general and write \begin{align} S_{\text{bos}} & =ie\int d^{D}xA_{t}n_{0}+\int d^{D}x\frac{\left|\Delta\left(\mathbf{x},\tau\right)\right|^{2}}{2\widetilde{g}},\label{eq:SC_bos_act} \end{align} where $\widetilde{g}$ is a renormalized value for $g$, and \begin{align} S_{\text{el}}= & -\int d^{D}xd^{D}x^{\prime}\psi_{\sigma}^{\dagger}\left(x\right)\mathcal{G}_{0}^{-1}\left[A\right]\left(x,x^{\prime}\right)\psi_{\sigma}\left(x^{\prime}\right)\nonumber \\ & -\int d^{D}x\left[\Delta\left(\mathbf{x},\tau\right)\psi_{\uparrow}^{\dagger}\left(\mathbf{x},\tau\right)\hat{D}\psi_{\downarrow}^{\dagger}\left(\mathbf{x},\tau\right)+\text{h.c.}\right],\label{eq:SC_exp_act} \end{align} where $\Delta\left(\mathbf{x},\tau\right)=\rho\left(x\right)e^{i\theta\left(x\right)}$ for a general amplitude and phase and $\hat{D}$ corresponds to a differential operator that depends on the symmetry channel. In Appendix~\ref{sec:Pairing_app} we consider an explicit application of this to a spinless $p$-wave problem. We are now ready to integrate out the fermions; introducing a Nambu doubled spinor $\Psi=\left(\psi_{\uparrow},\psi_{\downarrow},\psi_{\uparrow}^{\dagger},\psi_{\downarrow}^{\dagger}\right)^{T}$, the electronic part of the action becomes \begin{equation} S_{\text{el}}=-\frac{1}{2}\int d^{D}xd^{D}x'\Psi^{\dagger}\left(x\right)\mathcal{G}^{-1}\left[A\right]\left(x,x'\right)\Psi\left(x'\right) \end{equation} where the (inverse) Nambu-space Green's function is \begin{widetext} \begin{align} \mathcal{G}^{-1}\left[A\right]\left(x,x'\right) & =-\left(\begin{array}{cc} \left[\partial_{\tau}-ie\widetilde{A}_{t}+\left(\frac{\left[\hat{\mathbf{p}}-e\widetilde{\mathbf{A}}\right]^{2}}{2m}-\mu\right)\right] & -\rho\left(x\right)i\sigma_{y}\hat{D}\\ \rho\left(x\right)i\sigma_{y}\hat{D}^{\dagger} & \left[\partial_{\tau}+ie\widetilde{A}_{t}-\left(\frac{\left[\hat{\mathbf{p}}+e\widetilde{\mathbf{A}}\right]^{2}}{2m}-\mu\right)\right] \end{array}\right)\delta\left(x-x'\right),\label{eq:SC_GF} \end{align} \end{widetext} $\sigma_{y}$ acts on the spin degrees of freedom, and we have rotated away the superconducting phase, which is conveniently absorbed by the gauge fields as $\widetilde{A}_{\mu}=A_{\mu}-\frac{1}{2e}\partial_{\mu}\theta$. The generating functional thus becomes \begin{equation} \mathcal{Z}\left[A\right]\sim\int\mathcal{D}\left[\Delta,\Delta^{*}\right]e^{-S_{\mathrm{eff}}\left[\Delta,\Delta^{*},A\right]}, \end{equation} where the effective action is (dropping the $A$-dependence label) \begin{eqnarray} S_{\text{eff}}\left[\Delta,\Delta^{*},A\right] & = & S_{\text{bos}}-\frac{1}{2}\textrm{Tr}\ln\left(-\beta\mathcal{G}^{-1}\right), \end{eqnarray} with $S_{\mathrm{bos}}$ as in Eq.~(\ref{eq:SC_bos_act}) and one should keep in mind the factor of $\frac{1}{2}$ due to Nambu doubling. At this point we consider the mean-field response. In this section, we will neglect fluctuations of the superconducting amplitude, setting $\rho\left(x\right)\to\rho_{0}$. It is then possible to use the relationship between $\widetilde{A}_{\mu}$ and $A_{\mu}$ to write \begin{eqnarray} \frac{\delta S_{\text{eff}}\left[\theta,A\right]}{\delta\theta\left(x\right)} & = & \int dy\frac{\delta S_{\text{eff}}\left[\theta,A\right]}{\delta\partial_{\alpha}\theta\left(y\right)}\frac{\delta\partial_{\alpha}\theta\left(y\right)}{\delta\theta\left(x\right)}\nonumber \\ & = & -\partial_{\alpha}\frac{\delta S_{\text{eff}}\left[\theta,A\right]}{\delta\partial_{\alpha}\theta\left(x\right)}\nonumber \\ & = & \frac{1}{2e}\partial_{\alpha}\frac{\delta S_{\text{eff}}\left[\theta,A\right]}{\delta A_{\alpha}\left(x\right)}. \end{eqnarray} The factor of $2e$ can be safely absorbed as it will drop out from the correlation functions; we will omit it from now on. This allows us to once again write all the momentum-space tensors in terms of the undressed polarization tensors $Q^{\mu\nu}$, namely, \begin{align} R^{\mu\theta}\left(q\right) & =iQ^{\mu\beta}\left(q\right)q_{\beta},\\ R^{\theta\nu}\left(q\right) & =-iq_{\alpha}Q^{\alpha\nu}\left(q\right),\\ S^{\theta\theta}\left(q\right) & =q_{\lambda}Q^{\lambda\sigma}\left(q\right)q_{\sigma}. \end{align} At the mean-field level $\theta$ is a constant and drops out from the Green's functions. Notice that the Green's functions appearing in $Q^{\mu\nu}\left(q\right)$ in this case correspond to Eq.~(\ref{eq:SC_GF}) with $\widetilde{A}_{\mu}=0$ and $\rho\left(x\right)\to\rho_{0}$. Implementing Eq.~(\ref{eq:Em_in_q}), the EM response is then \begin{align} K_{\text{mf}}^{\mu\nu} & =Q^{\mu\nu}-\left(iQ^{\mu\beta}q_{\beta}\right)\left(q_{\lambda}Q^{\lambda\sigma}q_{\sigma}\right)^{-1}\left(-iq_{\alpha}Q^{\alpha\nu}\right)\nonumber \\ & =Q^{\mu\nu}-\frac{Q^{\mu\beta}q_{\beta}q_{\alpha}Q^{\alpha\nu}}{q_{\lambda}Q^{\lambda\sigma}q_{\sigma}}\equiv\Pi^{\mu\nu}.\label{eq:phase_scre} \end{align} This is the general form of the EM response tensor for a neutral superfluid, independent of the pairing symmetry. The gapless fluctuating phase degree of freedom is crucial to ensure gauge invariance, which the form above manifestly obeys: $q_{\mu}K_{\text{mf}}^{\mu\nu}\left(q\right)=K_{\text{mf}}^{\mu\nu}\left(q\right)q_{\nu}=0$. Setting $q_{\lambda}Q^{\lambda\sigma}q_{\sigma}=0$ recovers the well-known result of Anderson and Bogoliubov~\citep{Anderson_1958b,Bogoliubov1958,*BogoliubovBook}: the EM response has a pole corresponding to a long-wavelength sound mode (with speed $c_{s}=v_{F}/\sqrt{3}$ at $T=0$) induced by phase fluctuations of the order parameter. \subsection{EM response for superconductors (with no amplitude fluctuations)\label{subsec:ChargedSCPhase}} With the previous results established, for our first non-trivial application of Eq.~(\ref{eq:Em_in_q}) we consider a charged superconductor with both phase and Coulomb fluctuations present. This problem was also considered in Ref.~\citep{Yakovenko_2008}, in the context of the EM response of a $p$-wave superconductor, via sequential functional integration of the Coulomb and phase degrees of freedom. It is natural to ask what the form of the EM response would be if this procedure were performed in the opposite order, and this will be addressed in what follows. In our case, the results from the previous sections allow the response to be written as \begin{align} K_{\text{mf}}^{\mu\nu}= & Q^{\mu\nu}-\left(\begin{array}{c} iQ^{\mu0}\\ iq_{\beta}Q^{\mu\beta} \end{array}\right)^{T}\nonumber \\ & \times\left(\begin{array}{cc} V^{-1}-Q^{00} & -Q^{0\beta}q_{\beta}\\ q_{\alpha}Q^{\alpha0} & q_{\lambda}Q^{\lambda\sigma}q_{\sigma} \end{array}\right)^{-1}\left(\begin{array}{c} iQ^{0\nu}\\ -iq_{\alpha}Q^{\alpha\nu} \end{array}\right)\nonumber \\ = & Q^{\mu\nu}-\frac{1}{\left(V^{-1}-Q^{00}\right)q_{\lambda}\widetilde{Q}^{\lambda\sigma}q_{\sigma}}\left(\begin{array}{c} Q^{\mu0}\\ q_{\beta}Q^{\mu\beta} \end{array}\right)^{T}\nonumber \\ & \times\left(\begin{array}{cc} -q_{\lambda}Q^{\lambda\sigma}q_{\sigma} & q_{\beta}Q^{0\beta}\\ q_{\alpha}Q^{\alpha0} & V^{-1}-Q^{00} \end{array}\right)\left(\begin{array}{c} Q^{0\nu}\\ q_{\alpha}Q^{\alpha\nu} \end{array}\right).\label{eq:AB1} \end{align} The Coulomb-screened EM response tensor $\widetilde{Q}^{\lambda\sigma}$ of Sec.~\ref{subsec:ScreeningCoulomb} naturally appears here in the denominator. While Eq.~(\ref{eq:AB1}) treats the Coulomb- and phase-screened responses of a charged superconductor in a symmetric fashion, the present form is not totally satisfactory. In particular, gauge invariance is not manifest, and it may be advantageous to recover similar results found in the previous section, as well as the polaritonic resonances of the EM response. To accomplish this, we have to ``bias'' the above expression towards either a Coulomb-screened type of object or a phase-screened type of object. An analogy from the process of Ref.~\citep{Yakovenko_2008} would be to consider integrating out first either the electrostatic Coulomb field or the phase degree of freedom. Let us make this procedure more explicit. With a few manipulations, we may explicitly rewrite $Q^{\mu\nu}$ in terms of its Coulomb-screened version $\widetilde{Q}^{\mu\nu}$ so that Eq.~(\ref{eq:AB1}) then has the form \begin{align} K_{\text{mf}}^{\mu\nu}= & \widetilde{Q}^{\mu\nu}-\frac{q_{\alpha}q_{\beta}}{q_{\lambda}\widetilde{Q}^{\lambda\sigma}q_{\sigma}}\nonumber \\ & \times\left(\begin{array}{c} Q^{\mu0}\\ Q^{\mu\beta} \end{array}\right)^{T}\left(\begin{array}{cc} \frac{Q^{\alpha0}Q^{0\beta}}{\left(V^{-1}-Q^{00}\right)^{2}} & \frac{Q^{0\beta}}{V^{-1}-Q^{00}}\\ \frac{Q^{\alpha0}}{V^{-1}-Q^{00}} & 1 \end{array}\right)\left(\begin{array}{c} Q^{0\nu}\\ Q^{\alpha\nu} \end{array}\right).\label{eq:Coulomb_biasing} \end{align} The $2\times2$ matrix appearing in the EM response now has zero determinant: it is a singular matrix, which can be expressed using a singular-value decomposition (SVD). Consider the following matrix \begin{equation} M=\left(\begin{array}{cc} ab & a\\ b & 1 \end{array}\right). \end{equation} Define the matrices $U,V$, and $D$ by \begin{equation} U=\left(\begin{array}{cc} a & \frac{a}{\left|a\right|}\\ 1 & -\left|a\right| \end{array}\right),V=\left(\begin{array}{cc} b^{*} & \frac{b^{*}}{\left|b\right|}\\ 1 & -\left|b\right| \end{array}\right),D=\left(\begin{array}{cc} 1 & 0\\ 0 & 0 \end{array}\right). \end{equation} The matrix $M$ can then be written as $M=UDV^{\dagger}.$ By matching the coefficients $a$ and $b$ with the coefficients in Eq.~(\ref{eq:Coulomb_biasing}), one obtains \begin{equation} K_{\mathrm{mf}}^{\mu\nu}=\widetilde{Q}^{\mu\nu}-\frac{\widetilde{Q}^{\mu\beta}q_{\beta}q_{\alpha}\widetilde{Q}^{\alpha\nu}}{q_{\lambda}\widetilde{Q}^{\lambda\sigma}q_{\sigma}}\equiv\widetilde{\Pi}^{\mu\nu}. \end{equation} Here we have ``biased'' the matrix expression in Eq.~(\ref{eq:Coulomb_biasing}) into the simpler equation above. It assumes the form of an EM response tensor in the presence of phase fluctuations, as in Eq.~(\ref{eq:phase_scre}), but now the EM polarization tensors are substituted by their Coulomb-screened versions: $Q^{\mu\nu}\to\widetilde{Q}^{\mu\nu}$. This expression is manifestly gauge invariant as in Eq.~(\ref{eq:phase_scre}). Interestingly, this biasing process can easily be done in the reverse manner. In performing similar manipulations to arrive at Eq.~(\ref{eq:Coulomb_biasing}), if we had first exchanged $Q^{\mu\nu}$ for $\Pi^{\mu\nu}$, instead of $\widetilde{Q}^{\mu\nu}$, then it is a simple exercise to show that by an analogue SVD the EM response tensor obtained reads \begin{equation} K_{\mathrm{mf}}^{\mu\nu}=\Pi^{\mu\nu}+\frac{\Pi_{0}^{\mu0}V\Pi^{0\nu}}{1-V\Pi^{00}}. \end{equation} This expression assumes a Coulomb-screened form, where each tensor participating has been replaced by its ``phase-screened'' version: $Q^{\mu\nu}\rightarrow\Pi^{\mu\nu}$. Evidently, since each $\Pi^{\mu\nu}$ is gauge invariant by itself, the whole expression above is gauge invariant again. Naturally, both expressions for $K_{\mathrm{mf}}^{\mu\nu}$ above are equivalent. Thus, we have introduced a process of folding the effects of each fluctuating field via an SVD of the response tensors. This process clearly biases the form of $K_{\mathrm{mf}}^{\mu\nu}$, although it brings simplification. The denominators of the final form of these response tensors contain the polaritonic resonances of the dielectric functions~\citep{Kulik1981,Guo_Chien_He_2013,Garate_2013}. Equating the two denominators equal to zero \begin{equation} q_{\lambda}\widetilde{Q}^{\lambda\sigma}q_{\sigma}=0=1-V\Pi^{00}, \end{equation} one obtains the well-known Carlson-Goldman (CG) mode~\citep{Carlson_Goldman_1973,Carlson_Goldman_1975,Kulik1981}, where plasmons dress the phase fluctuation poles, gapping the phase modes of charged superconductors. At $T=0$ this results in solely a (double) plasmon mode, whereas in the vicinity of $T\sim T_{c}$ there is a soft mode (which was originally~\citep{Carlson_Goldman_1973,Carlson_Goldman_1975} termed the CG mode) and a plasmon mode~\citep{Kulik1981}. Note that the exact relation between the two denominators is: $q_{\lambda}\widetilde{Q}^{\lambda\sigma}q_{\sigma}\left(1-VQ^{00}\right)=q_{\lambda}Q^{\lambda\sigma}q_{\sigma}\left(1-V\Pi^{00}\right)$. \subsection{EM response for superconductors (with amplitude fluctuations)\label{subsec:ChargedSCPhaseAmplitude}} Returning to Eq.~(\ref{eq:SC_GF}), we now include the fluctuations in $\rho\left(x\right)$. Contrary to the phase and Coulomb responses, the amplitude part cannot be written solely in terms of the unscreened EM response bubble $Q^{\mu\nu}\left(q\right)$. The additional objects which must be defined for calculating the EM response functions read as follows \begin{align} \left.\frac{\delta^{2}S_{\textrm{eff}}\left[{\bf \Delta},A\right]}{\delta\rho\left(-q\right)\delta\rho\left(q\right)}\right|_{A=0,\boldsymbol{\Delta}=\boldsymbol{\Delta}_{\text{mf}}\left[0\right]} & \equiv S^{\rho\rho}\left(q\right),\\ \left.\frac{\delta^{2}S_{\textrm{eff}}\left[{\bf \Delta},A\right]}{\delta\rho\left(-q\right)\delta\theta\left(q\right)}\right|_{A=0,\boldsymbol{\Delta}=\boldsymbol{\Delta}_{\text{mf}}\left[0\right]} & \equiv S^{\rho\theta}\left(q\right)=iq_{\beta}R^{\rho\beta}\left(q\right), \end{align} and similarly \begin{align} \left.\frac{\delta^{2}S_{\textrm{eff}}\left[{\bf \Delta},A\right]}{\delta\rho\left(-q\right)\delta A_{\mu}\left(q\right)}\right|_{A=0,\boldsymbol{\Delta}=\boldsymbol{\Delta}_{\text{mf}}\left[0\right]} & \equiv R^{\rho\mu}\left(q\right),\\ \left.\frac{\delta^{2}S_{\textrm{eff}}\left[{\bf \Delta},A\right]}{\delta\rho\left(-q\right)\delta\varphi\left(q\right)}\right|_{A=0,\boldsymbol{\Delta}=\boldsymbol{\Delta}_{\text{mf}}\left[0\right]} & \equiv S^{\rho\varphi}\left(q\right)=iR^{\rho0}\left(q\right). \end{align} Also note that just as $V^{-1}\left(q\right)$ contributed to $S^{\varphi\varphi}\left(q\right)$ {[}c.f. Eq.~(\ref{eq:Sfifi}){]}, the ``mass'' contribution for $\rho\left(x\right)$ in the Hubbard-Stratonovich field in Eq.~(\ref{eq:SC_bos_act}) implies that $\widetilde{g}^{-1}$ contributes to $S^{\rho\rho}\left(q\right)$. The EM response tensor now becomes \begin{widetext} \begin{equation} K_{\text{mf}}^{\mu\nu}\left(q\right)=Q^{\mu\nu}-\left(\begin{array}{ccc} R^{\mu\rho} & iQ^{\mu0} & iQ^{\mu\beta}\end{array}q_{\beta}\right)\left(\begin{array}{ccc} S^{\rho\rho} & iR^{\rho0} & iR^{\rho\beta}q_{\beta}\\ iR^{0\rho} & V^{-1}-Q^{00} & -Q^{0\beta}q_{\beta}\\ -iq_{\alpha}R^{\alpha\rho} & q_{\alpha}Q^{\alpha0} & q_{\alpha}Q^{\alpha\beta}q_{\beta} \end{array}\right)^{-1}\left(\begin{array}{c} R^{\rho\nu}\\ iQ^{0\nu}\\ -iq_{\alpha}Q^{\alpha\nu} \end{array}\right). \end{equation} \end{widetext}The SVD approach can also be implemented for this situation. First note that, with some manipulation and SVD biasing, the determinant can be reduced to two possible forms. The calculation is outlined in Appendix~\ref{sec:Det_SVD} and results in \begin{align} \det S\left(q\right) & =\left(V^{-1}-\overline{Q}^{00}\right)S^{\rho\rho}q_{\alpha}\widetilde{\overline{Q}}^{\alpha\beta}q_{\beta}\nonumber \\ & =\left(V^{-1}-Q^{00}\right)\widetilde{S}^{\rho\rho}q_{\alpha}\overline{\widetilde{Q}}^{\alpha\beta}q_{\beta},\label{eq:detS} \end{align} where tilde variables are screened as in Eq.~(\ref{eq:Coulomb_scre}); for example, \begin{equation} \widetilde{S}^{\rho\rho}=S^{\rho\rho}+\frac{R^{\rho0}VR^{0\rho}}{1-VQ^{00}}. \end{equation} Similarly, the process of ``folding'' the amplitude fluctuations also leads to ``screened''-like tensors -- the ones with bars on top. Repeating the calculation in Eq.~(\ref{eq:Coulomb_scre}), now with only the amplitude contributions, one verifies, \begin{equation} \overline{Q}^{\alpha\beta}\equiv Q^{\alpha\beta}-\frac{R^{\alpha\rho}R^{\rho\beta}}{S^{\rho\rho}}.\label{eq:Qbar} \end{equation} Finally, tensors with both bars and tildes are interpreted to mean first evaluate the tensors with respect to the outer screening symbol and then with respect to the inner screening type. To be concrete, as an example we have \begin{equation} \overline{\widetilde{Q}}^{\alpha\beta}=\widetilde{Q}^{\alpha\beta}-\frac{\widetilde{R}^{\alpha\rho}\widetilde{R}^{\rho\beta}}{\widetilde{S}^{\rho\rho}}. \end{equation} From the two ways of writing the determinant above, and noticing that \begin{align} & \left(V^{-1}-Q^{00}\right)S^{\rho\rho}+R^{\rho0}R^{0\rho}\nonumber \\ = & \left(V^{-1}-\overline{Q}^{00}\right)S^{\rho\rho}\nonumber \\ = & \left(V^{-1}-Q^{00}\right)\widetilde{S}^{\rho\rho}, \end{align} we find an important identity: \begin{equation} q_{\alpha}\widetilde{\overline{Q}}^{\alpha\beta}q_{\beta}=q_{\alpha}\overline{\widetilde{Q}}^{\alpha\beta}q_{\beta}.\label{eq:QtildeQtilde} \end{equation} Using these expressions we can now perform the SVD process as in the previous sections, the only requirement is to choose a biasing order in which we want to take into account the influence of each type of fluctuation. For example, taking into account the inversion of the matrix $S\left(q\right)$ and the determinant above, we obtain \begin{widetext} \begin{align} K_{\text{mf}}^{\mu\nu}\left(q\right)= & Q^{\mu\nu}-\frac{q_{\alpha}q_{\beta}}{q_{\lambda}\widetilde{\overline{Q}}^{\lambda\sigma}q_{\sigma}}\nonumber \\ & \times\left(\begin{array}{c} R^{\mu\rho}\\ Q^{\mu0}\\ Q^{\mu\beta} \end{array}\right)^{T}\left(\begin{array}{ccc} \frac{\left(V^{-1}-Q^{00}\right)\widetilde{Q}^{\alpha\beta}}{\left(V^{-1}-\overline{Q}^{00}\right)S^{\rho\rho}} & \frac{Q^{\alpha\beta}R^{\rho0}-Q^{\alpha0}R^{\rho\beta}}{\left(V^{-1}-\overline{Q}^{00}\right)S^{\rho\rho}} & -\frac{\left(V^{-1}-Q^{00}\right)\widetilde{R}^{\rho\beta}}{\left(V^{-1}-\overline{Q}^{00}\right)S^{\rho\rho}}\\ \frac{Q^{\alpha\beta}R^{0\rho}-R^{\alpha\rho}Q^{0\beta}}{\left(V^{-1}-\overline{Q}^{00}\right)S^{\rho\rho}} & -\frac{\overline{Q}^{\alpha\beta}}{\left(V^{-1}-\overline{Q}^{00}\right)} & \frac{\overline{Q}^{0\beta}}{\left(V^{-1}-\overline{Q}^{00}\right)}\\ -\frac{\left(V^{-1}-Q^{00}\right)\widetilde{R}^{\alpha\rho}}{\left(V^{-1}-\overline{Q}^{00}\right)S^{\rho\rho}} & \frac{\overline{Q}^{\alpha0}}{\left(V^{-1}-\overline{Q}^{00}\right)} & 1 \end{array}\right)\left(\begin{array}{c} R^{\rho\nu}\\ Q^{0\nu}\\ Q^{\alpha\nu} \end{array}\right). \end{align} Now we focus on the first term $Q^{\mu\nu}$. Introducing the effects of amplitude fluctuations first (``bar'' variables) and subsequently the regular screening from Coulomb fluctuations (``tilde'' variables), a straightforward calculation and simplification using the relations in Eq.~(\ref{eq:QtildeQtilde}) results in \begin{align} K_{\text{mf}}^{\mu\nu}= & \widetilde{\overline{Q}}^{\mu\nu}-\frac{q_{\alpha}q_{\beta}}{q_{\lambda}\widetilde{\overline{Q}}^{\lambda\sigma}q_{\sigma}}\nonumber \\ & \times\left(\begin{array}{c} R^{\mu\rho}\\ Q^{\mu0}\\ Q^{\mu\beta} \end{array}\right)^{T}\left(\begin{array}{ccc} \frac{\widetilde{R}^{\alpha\rho}\widetilde{R}^{\rho\beta}}{\left(\widetilde{S}^{\rho\rho}\right)^{2}} & -\frac{\overline{Q}^{\alpha0}\widetilde{R}^{\rho\beta}}{\left(V^{-1}-\overline{Q}^{00}\right)\widetilde{S}^{\rho\rho}} & -\frac{\widetilde{R}^{\rho\beta}}{\widetilde{S}^{\rho\rho}}\\ -\frac{\widetilde{R}^{\alpha\rho}\overline{Q}^{0\beta}}{\left(V^{-1}-\overline{Q}^{00}\right)\widetilde{S}^{\rho\rho}} & \frac{\overline{Q}^{\alpha0}\overline{Q}^{0\beta}}{\left(V^{-1}-\overline{Q}^{00}\right)^{2}} & \frac{\overline{Q}^{0\beta}}{\left(V^{-1}-\overline{Q}^{00}\right)}\\ -\frac{\widetilde{R}^{\alpha\rho}}{\widetilde{S}^{\rho\rho}} & \frac{\overline{Q}^{\alpha0}}{\left(V^{-1}-\overline{Q}^{00}\right)} & 1 \end{array}\right)\left(\begin{array}{c} R^{\rho\nu}\\ Q^{0\nu}\\ Q^{\alpha\nu} \end{array}\right). \end{align} \end{widetext} This matrix is now of the form \begin{equation} M=\left(\begin{array}{ccc} ab & -ad & -a\\ -bc & cd & c\\ -b & d & 1 \end{array}\right), \end{equation} where \begin{eqnarray} a=\frac{\widetilde{R}^{\rho\beta}}{\widetilde{S}^{\rho\rho}} & ,\ & b=\frac{\widetilde{R}^{\alpha\rho}}{\widetilde{S}^{\rho\rho}},\nonumber \\ c=\frac{\overline{Q}^{0\beta}}{V^{-1}-\overline{Q}^{00}} & ,\ & d=\frac{\overline{Q}^{\alpha0}}{V^{-1}-\overline{Q}^{00}}. \end{eqnarray} It displays two linearly dependent rows, thus suggesting the singular-value decomposition. Performing the SVD and simplifying the result gives \begin{align} K_{\text{mf}}^{\mu\nu} & =\widetilde{\overline{Q}}^{\mu\nu}-\frac{\widetilde{\overline{Q}}^{\mu\beta}q_{\beta}q_{\alpha}\widetilde{\overline{Q}}^{\alpha\nu}}{q_{\lambda}\widetilde{\overline{Q}}^{\lambda\sigma}q_{\sigma}}\equiv\widetilde{\overline{\Pi}}^{\mu\nu}.\label{eq:all_in} \end{align} Setting $q_{\lambda}\widetilde{\overline{Q}}^{\lambda\sigma}q_{\sigma}=0$ gives the collective mode dispersion for the polaritons induced by simultaneous Coulomb, phase, and amplitude fluctuations. Again, gauge invariance in the SVD-simplified EM response in Eq.~(\ref{eq:all_in}) is manifest: \begin{align} q_{\mu}K_{\text{mf}}^{\mu\nu} & =q_{\mu}\widetilde{\overline{Q}}^{\mu\nu}-\frac{q_{\mu}\widetilde{\overline{Q}}^{\mu\beta}q_{\beta}q_{\alpha}\widetilde{\overline{Q}}^{\alpha\nu}}{q_{\lambda}\widetilde{\overline{Q}}^{\lambda\sigma}q_{\sigma}}=0. \end{align} As in the previous section, other equivalent forms for the EM response can be obtained by reversing the order in the SVD processes. For example, $K_{\text{mf}}^{\mu\nu}=\widetilde{\overline{\Pi}}^{\mu\nu}=\overline{\widetilde{\Pi}}^{\mu\nu}$. \section{The Meissner effect in the presence of collective modes \label{sec:Meissner}} \subsection{Kubo formula} In this section we calculate the superfluid density for superfluid and superconducting systems with amplitude, phase, and Coulomb fluctuations incorporated. It was shown in the previous section that the EM response for a system with all these three types of fluctuations can be compactly written as in Eq.~(\ref{eq:all_in}). Here we will use this formula to study the Meissner response for both $s$- and $p$-wave systems. The Kubo formula for the superfluid density tensor is~\citep{AGDBook} \begin{equation} \frac{e^{2}}{m}n_{s}^{xx}=\lim_{{\bf q}\rightarrow0}K_{\text{mf}}^{ii}\left(\Omega=0,{\bf q}\right), \end{equation} with no implicit index summation. It is crucial that the static limit, $\Omega=0$, is taken before the long-wavelength limit ${\bf q}\rightarrow0$ is considered. This particular order of limits is appropriate for a thermodynamic quantity, whereas the converse procedure is apt for the calculation of optical properties, namely the DC electrical conductivity for instance. For nonuniform systems, the limit ${\bf q}\rightarrow0$ must also be carefully specified. To ascertain the appropriate definition, recall that in the presence of an external EM vector potential $A_{\nu}$, the EM current is $J^{\mu}\left(x\right)=\int_{x^{\prime}}K^{\mu\nu}\left(x,x^{\prime}\right)A_{\nu}\left(x^{\prime}\right)$. The continuity equation is $\partial_{\mu}J^{\mu}=0$; this statement enforces conservation of global particle number (global U(1) symmetry) for a neutral superfluid, whereas for a charged system it enforces conservation of charge. In terms of the response kernel, this equation becomes $\left(\partial_{\mu}K^{\mu\nu}\right)A_{\nu}=0.$ The solution to this equation, for an arbitrary $A_{\nu}$, is to require a gauge-invariant EM response: $\partial_{\mu}K^{\mu\nu}=0$, which in momentum space reads $q_{\mu}K^{\mu\nu}=0$. As shown in the previous section, the SVD approach enables this to be manifestly satisfied. To compute $n_{s}$ it is convenient to work in the gauge where $\partial_{\mu}A_{\mu}=0$ (Lorenz gauge), which reduces to the Coulomb gauge $\nabla\cdot{\bf A}=0$ in the static limit. The momentum-space form of the Coulomb gauge is ${\bf q}\cdot{\bf A}=0$. In deriving the superfluid density $n_{s}^{ii}$, only the $i$th component of the vector field must be non-vanishing: $A_{i}\neq0$. The Coulomb gauge condition then reduces to $q_{i}A_{i}=0$, demanding $q_{i}=0$. The other momentum components go to zero only in the limit. Thus, the appropriate Kubo formula for $n_{s}^{ii}$ is \begin{equation} \frac{e^{2}}{m}n_{s}^{xx}=\lim_{q_{k}\neq q_{i}\rightarrow0,q_{i}=0}K_{\text{mf}}^{ii}\left(\Omega=0,{\bf q}\right). \end{equation} This Kubo formula explains why the superfluid density is often termed a ``transverse'' response~\citep{AGDBook,PinesNozieres1}. In the particular case of nonuniform superfluids, however, the appellation ``transverse'' loses its significance. The importance of computing the superfluid density in the appropriate limiting fashion was discussed in\textcolor{red}{{} }Ref.~\citep{Boyack_2017}, where it was shown that for the Fulde-Ferrell superfluid the amplitude collective mode contributes to the superfluid density. A general argument for why collective modes do not need to be considered in the superfluid density response of uniform superfluids is as follows~\citep{AGDBook}. In the presence of the external vector potential $A$, the order parameter can be expanded to quadratic order in $A$ as \begin{equation} \Delta\left[A\right]=\Delta\left[A=0\right]+\Delta^{\left(1\right)}\left[A\right]+\mathcal{O}\left(A^{2}\right), \end{equation} Since the order parameter $\Delta$ is a scalar, whereas the vector potential $A$ is a vector, $\Delta$ can depend only on scalar-valued functions of $A$. For a uniform superfluid, the only such scalar quantity is $\nabla\cdot{\bf A}$. In the Coulomb gauge, where $\nabla\cdot{\bf A}=0$, it follows that $\Delta^{\left(1\right)}=0$. Thus, collective modes do not contribute to the superfluid density in a uniform superfluid. In the case of a nonuniform superfluid, there are potentially other scalar quantities that depend on ${\bf A}$ and thus $\Delta^{\left(1\right)}$ need not be zero. The next section provides an explicit calculation of the superfluid density for $s$- and $p$-wave superfluids with amplitude, phase, and Coulomb interactions. \subsection{Explicit superfluid density calculation} First consider the case of a uniform $s$-wave superfluid. Without loss of generality, since the system is uniform we only need to study the response in one direction, say $\hat{x}$. Using the formalism developed in the previous sections, the superfluid density is given by \begin{align} \frac{e^{2}}{m}n_{s}^{xx} & =\lim_{q_{x}=0,q_{y}\rightarrow0}\left[\widetilde{\overline{Q}}^{xx}-\frac{\widetilde{\overline{Q}}^{xi}q_{i}q_{j}\widetilde{\overline{Q}}^{jx}}{q_{k}\widetilde{\overline{Q}}^{kl}q_{l}}\right]\nonumber \\ & =\lim_{q_{x}=0,q_{y}\rightarrow0}\left[\widetilde{\overline{Q}}^{xx}-\frac{\widetilde{\overline{Q}}^{xy}\widetilde{\overline{Q}}^{yx}}{\widetilde{\overline{Q}}^{yy}}\right].\label{eq:Rhosxx} \end{align} In the small-momentum limit, $R^{\rho j}\left(0,\mathbf{q}\to0\right)=0$; this is because in this limit the tensor structure requires $R^{\rho j}\left(0,{\bf q}\rightarrow0\right)\sim q^{j}\rightarrow0$. Thus, the generalized response functions are \begin{align} \widetilde{\overline{Q}}^{xj} & =\overline{Q}^{xj}+\frac{\overline{Q}^{x0}\overline{Q}^{0j}}{V^{-1}-\overline{Q}^{00}}=Q^{xj}. \end{align} As a result, the superfluid density is \begin{equation} \frac{e^{2}}{m}n_{s}^{xx}=\lim_{q_{x}=0,q_{y}\rightarrow0}Q^{xx}. \end{equation} This proves that without any particular assumptions about particle-hole symmetry, i.e., whether or not the amplitude and Coulomb mode decouple $\left(R^{\rho0}\neq0\right)$~\citep{Levin_2000}, the superfluid density for an $s$-wave system has no contributions from amplitude, phase, or Coulomb collective modes. This is an explicit proof of the argument presented in the previous section. Now consider a spinless-$\left(p+ip\right)$ superfluid in two spatial dimensions. The $x$ and $y$ responses are equivalent, thus we again need only to consider the former. The superfluid density is as given in Eq.~(\ref{eq:Rhosxx}). Again $R^{\rho j}\left(0,\mathbf{q}\to0\right)=0$ remains true, and thus \begin{equation} \frac{e^{2}}{m}n_{s}^{xx}=\lim_{q_{x}=0,q_{y}\rightarrow0}Q^{xx}. \end{equation} This particular limit is computed as shown below. After performing the Matsubara frequency summation, the response function is~\citep{Yakovenko_2008,Guo_Chien_He_2013}: \begin{widetext} \begin{align} Q^{ij}\left(i\Omega_{m},{\bf q}\right) & =\frac{e^{2}}{2}\int\frac{d^{2}\mathbf{p}}{\left(2\pi\right)^{2}}\frac{\mathbf{p}^{i}}{m}\frac{\mathbf{p}^{j}}{m}\left[\left(1+\frac{\xi_{\mathbf{p}}^{+}\xi_{\mathbf{p}}^{-}+\Delta_{0}^{2}\mathbf{p}_{+}\cdot\mathbf{p}_{-}/p_{F}^{2}}{E_{\mathbf{p}}^{+}E_{\mathbf{p}}^{-}}\right)\frac{E_{\mathbf{p}}^{+}-E_{\mathbf{p}}^{-}}{\left(E_{\mathbf{p}}^{+}-E_{\mathbf{p}}^{-}\right)^{2}-\left(i\Omega_{m}\right)^{2}}\left[f\left(E_{\mathbf{p}}^{+}\right)-f\left(E_{\mathbf{p}}^{-}\right)\right]\right.\nonumber \\ & \left.-\left(1-\frac{\xi_{\mathbf{p}}^{+}\xi_{\mathbf{p}}^{-}+\Delta_{0}^{2}\mathbf{p}_{+}\cdot\mathbf{p}_{-}/p_{F}^{2}}{E_{\mathbf{p}}^{+}E_{\mathbf{p}}^{-}}\right)\frac{E_{\mathbf{p}}^{+}+E_{\mathbf{p}}^{-}}{\left(E_{\mathbf{p}}^{+}+E_{\mathbf{p}}^{-}\right)^{2}-\left(i\Omega_{m}\right)^{2}}\left[1-f\left(E_{\mathbf{p}}^{-}\right)-f\left(E_{\mathbf{p}}^{+}\right)\right]\right]+\frac{ne^{2}}{m}\delta^{ij}, \end{align} \end{widetext}where ${\bf p}_{\pm}={\bf p}\pm{\bf q}/2$, $\xi_{\mathbf{p}}^{\pm}\equiv\xi_{\mathbf{p}\pm\mathbf{q}/2},E_{\mathbf{p}}^{\pm}\equiv E_{\mathbf{p}\pm\mathbf{q}/2}$, with $\xi_{\mathbf{p}}=\mathbf{p}^{2}/\left(2m\right)-\mu,E_{\mathbf{p}}=\sqrt{\xi_{\mathbf{p}}^{2}+\Delta_{0}^{2}\mathbf{p}^{2}/p_{F}^{2}}$, and $n$ is the total number density. Taking the appropriate frequency and momentum limits results in \begin{align} \frac{e^{2}}{m}n_{s}^{xx}= & e^{2}\left[\frac{n}{m}+\int\frac{d^{2}\mathbf{p}}{\left(2\pi\right)^{2}}\left(\frac{p^{x}}{m}\right)^{2}\frac{\partial f\left(E_{\mathbf{p}}\right)}{\partial E_{\mathbf{p}}}\right]\nonumber \\ = & e^{2}\int\frac{d^{2}\mathbf{p}}{\left(2\pi\right)^{2}}\left(\frac{p^{x}}{m}\right)^{2}\frac{\Delta_{0}^{2}\mathbf{p}^{2}/p_{F}^{2}}{E_{\mathbf{p}}^{2}}\nonumber \\ & \times\left[\frac{1-2f\left(E_{\mathbf{p}}\right)}{2E_{\mathbf{p}}}+\frac{\partial f\left(E_{\mathbf{p}}\right)}{\partial E_{\mathbf{p}}}\right]. \end{align} In general, for a superfluid system with only one external momentum, namely the momentum ${\bf q}$ of the external vector potential ${\bf A}$, the EM response can be decomposed into terms comprised of $\delta^{ij}$ and $q^{i}q^{j}/{\bf q}^{2}$. In the limit ${\bf q}\rightarrow0$, as defined above, it \textcolor{black}{follows} that the off-diagonal terms vanish and thus the superfluid density reduces to the standard undressed bubble term. \textcolor{black}{Unless there are other $\textit{external}$ vectors that can couple to the vector potential, the superfluid density always reduces to the undressed bubble term. This statement is a generalization of the analysis in the previous section, which considered only uniform superfluids; here we extend the veracity of the previous proof to include all kinds of superfluids without other $\textit{external}$ vectors that couple to the vector potential. } \subsection{Transverse and longitudinal responses} In Ref.~\citep{Millis_1987} the EM response for nonuniform superfluids without amplitude fluctuations was derived. This particular article highlighted that for such superfluids the collective modes are, in general, no longer solely ``longitudinal'', and moreover these modes can be important in what are conventionally termed ``transverse'' response functions in the case of uniform systems. In this section we show that our generalized formula reproduces the particular case considered in Ref.~\citep{Millis_1987}, namely, a neutral system with only phase fluctuations of the order parameter. Using Eq.~(\ref{eq:all_in}), the response function for such a system, in the static limit, is given by \begin{equation} K_{\text{mf}}^{ij}\left(0,{\bf q}\right)=Q^{ij}\left(0,{\bf q}\right)-\frac{Q^{ia}\left(0,{\bf q}\right)q_{a}q_{b}Q^{bj}\left(0,{\bf q}\right)}{q_{c}Q^{cd}\left(0,{\bf q}\right)q_{d}}.\label{eq:Kresp} \end{equation} The undressed EM response (for a spin-$\frac{1}{2}$ system with $e=1$) reads~\citep{AGDBook,Guo_Chien_He_2013} \begin{align} Q^{ij}\left(0,{\bf q}\right)= & 2\sum_{p}\left(\frac{p^{i}}{m}\frac{p^{j}}{m}\right)\left[G\left(i\omega_{n},{\bf p}_{+}\right)G\left(i\omega_{n},{\bf p}_{-}\right)\right.\nonumber \\ & \left.+F^{*}\left(i\omega_{n},{\bf p}_{+}\right)F\left(i\omega_{n},{\bf p}_{-}\right)\right]+\frac{n}{m}\delta^{ij},\label{eq:QResp} \end{align} The non-bold momenta are four-vectors $p^{\mu}=\left(i\omega_{n},{\bf p}\right)$ with $\omega_{n}$ a fermionic Matsubara frequency. For simplicity, let us focus on a system with a general momentum-angle-dependent gap $\Delta_{\mathbf{p}}\equiv\Delta\left(\hat{\mathbf{p}}\right)$. The single-particle and anomalous Green's functions are~\citep{AGDBook,Guo_Chien_He_2013} \begin{eqnarray} G\left(i\omega_{n},{\bf p}\right) & = & -\frac{i\omega_{n}+\xi_{\mathbf{p}}}{\omega_{n}^{2}+\xi_{\mathbf{p}}^{2}+\left|\Delta_{\mathbf{p}}\right|^{2}},\\ F\left(i\omega_{n},{\bf p}\right) & = & \frac{\Delta_{\mathbf{p}}}{\omega_{n}^{2}+\xi_{\mathbf{p}}^{2}+\left|\Delta_{\mathbf{p}}\right|^{2}}. \end{eqnarray} A generic static correlation function for a uniform system has the form \begin{equation} K^{ij}\left(0,{\bf q}\right)=\chi_{L}\frac{q^{i}q^{j}}{\mathbf{q}^{2}}+\chi_{T}\left(\delta^{ij}-\frac{q^{i}q^{j}}{\mathbf{q}^{2}}\right).\label{eq:Corr_Func} \end{equation} Here, $\chi_{T}$ and $\chi_{L}$ denote the transverse and longitudinal part of the full response function, respectively. By taking the dot product with $q^{i}$ and $q^{j}$, the longitudinal part is \begin{equation} \chi_{L}=\frac{q^{i}K^{ij}q^{j}}{q^{2}}. \end{equation} The longitudinal part of the total response gives zero contribution to the Meissner effect: the full response is purely transverse. In the small-momentum limit the collective-mode part of the response (the second term in Eq.~(\ref{eq:Kresp})) is purely longitudinal, and thus it gives zero contribution to the superfluid density. Let $i=j$ in Eq.~(\ref{eq:Corr_Func}) and take the trace to obtain $\sum_{i}K^{ii}=\chi_{L}+2\chi_{T}.$ Therefore the transverse part is \begin{equation} \chi_{T}=\frac{1}{2}\left(\sum_{i}K^{ii}-\chi_{L}\right). \end{equation} Let $\left(m/n\right)\chi_{T}\equiv\chi_{T}^{\prime}$. Using Eq.~(\ref{eq:QResp}), this becomes \begin{align} \chi_{T}^{\prime}\left(q\right)= & \frac{1}{mn}\sum_{p}p^{2}\sin^{2}\left(\theta\right)\left[G\left(i\omega_{n},{\bf p}_{+}\right)G\left(i\omega_{n},{\bf p}_{-}\right)\right.\nonumber \\ & \left.+F^{*}\left(i\omega_{n},{\bf p}_{+}\right)F\left(i\omega_{n},{\bf p}_{-}\right)\right]+1. \end{align} We drop the $q$ dependence in the argument of $\chi_{T}$ from now on. To evaluate this quantity we invoke standard Fermi-liquid theory and assume a constant density of states near the Fermi-surface. Using this approximation, the transverse response then becomes~\citep{AGDBook} \begin{align} \chi_{T}^{\prime}= & 1+T\frac{3}{4}\sum_{\omega_{n}}\int_{0}^{\pi}d\theta\sin^{3}(\theta)\int_{-\infty}^{\infty}d\xi\nonumber \\ & \times\frac{\left(i\omega_{n}+\xi_{+}\right)\left(i\omega_{n}+\xi_{-}\right)+\left|\Delta_{\mathbf{p}}\right|^{2}}{\left(\omega_{n}^{2}+\xi_{+}^{2}+\left|\Delta_{\mathbf{p}}\right|^{2}\right)\left(\omega_{n}^{2}+\xi_{-}^{2}+\left|\Delta_{\mathbf{p}}\right|^{2}\right)}. \end{align} Here, $\xi_{\pm}=\xi\pm\frac{1}{2}qv_{F}\cos\left(\theta\right)$ with $v_{F}=p_{F}/m$ the Fermi speed, and we have also used $k_{F}^{3}=3\pi^{2}n$. As discussed in Ref.~\citep{AGDBook}, the result of performing the Matsubara frequency summation followed by the $\xi$ integration leads to the correct normal-state result. However, performing this procedure in the reverse order leads to a different answer, in contradiction to the absence of a normal-state Meissner effect. To circumvent this problem, the method employed is to add and subtract the normal-state density expression. This enables performing the integration over $\xi$ first, which results in \begin{equation} \chi_{T}^{\prime}=\frac{3\pi}{4}T\sum_{\omega_{n}}\int_{-1}^{1}\frac{dx}{\sqrt{\omega_{n}^{2}+\left|\Delta_{\mathbf{p}}\right|^{2}}}\frac{\left(1-x^{2}\right)\left|\Delta_{\mathbf{p}}\right|^{2}}{\omega_{n}^{2}+\left|\Delta_{\mathbf{p}}\right|^{2}+\frac{1}{4}q^{2}v_{F}^{2}x^{2}}.\label{eq:Transverse_Resp} \end{equation} For comparison, the EM current given in Ref.~\citep{Millis_1987} reads \begin{equation} {\bf J}\left({\bf q}\right)=\int dS_{p}R\left(\hat{{\bf p}}\right)\hat{{\bf p}}\left[\hat{{\bf p}}\cdot{\bf A}\left({\bf q}\right)-\hat{{\bf p}}\cdot\hat{{\bf q}}\phi\left(q\right)\right], \end{equation} with the function $R\left(\hat{{\bf p}}\right)\equiv R\left(\hat{{\bf p}};0,\hat{{\bf q}}\right)$ given by \begin{equation} R\left(\hat{{\bf p}};0,\hat{{\bf q}}\right)=T\sum_{\omega_{n}}\frac{1}{\sqrt{\omega_{n}^{2}+\left|\Delta_{\mathbf{p}}\right|^{2}}}\frac{\left|\Delta_{\mathbf{p}}\right|^{2}}{\omega_{n}^{2}+\left|\Delta_{\mathbf{p}}\right|^{2}+\frac{1}{4}q^{2}v_{F}^{2}x^{2}} \end{equation} and $\phi\left(q\right)$ given by \begin{equation} \phi\left(q\right)=\frac{\int dS_{l}R\left(\hat{{\bf l}}\right)\hat{{\bf l}}\cdot\hat{{\bf q}}\hat{{\bf l}}\cdot{\bf A}\left({\bf q}\right)}{\int dS_{k}R\left(\hat{{\bf k}}\right)\left(\hat{{\bf k}}\cdot\hat{{\bf q}}\right)^{2}}. \end{equation} It is straightforward to check that this expression conserves particle number: ${\bf q}\cdot{\bf J}=0$. The corresponding response kernel is thus \begin{eqnarray} K^{ij}\left(\Omega=0,{\bf q}\right) & = & Q^{ij}-\frac{Q^{ia}q_{a}q_{b}Q^{bj}}{q_{c}Q^{cd}q_{d}}, \end{eqnarray} where $Q^{ij}\left(0,{\bf q}\right)\equiv\int dS_{p}\hat{p}^{i}R\left(\hat{{\bf p}};0,{\bf q}\right)\hat{p}^{j}$, with $dS_{p}$ the measure on the Fermi surface. Furthermore, the transverse part of the response is~\footnote{In Ref.~\citep{Millis_1987} the prefactor of $1/m$ in the EM vertices was omitted. Furthermore, the explicit form for $dS_{p}$ was unspecified. The definition given in Ref.~\citep{Millis_1987} is that, up to a constant, it is the angle-dependent density of states. Using this definition, we accordingly find $\int dS_{p}\sin^{2}\left(\theta\right)f\left(\theta\right)\sim\frac{mp_{F}}{\pi^{2}}p_{F}^{2}\int\frac{d\theta d\phi}{4\pi}\sin^{3}\left(\theta\right)f\left(\theta\right)=\frac{3}{2}\frac{n}{m}m^{2}\int dx\left(1-x^{2}\right)f\left(x\right)$. The factor of $m^{2}$ drops out once the vertices are appropriately restored. There is an additional factor of $\pi$ that also must be restored. Nevertheless, our result is in exact agreement with Eq.~(37.15) of Ref.~\citep{AGDBook} for the $s$-wave case (accounting for the differences in definition of response kernel.). } \begin{align} \chi_{T}^{\prime} & =\frac{3\pi}{4}\int_{-1}^{1}dx\left(1-x^{2}\right)R\left(\hat{{\bf p}};0,{\bf q}\right)\nonumber \\ & =\frac{3\pi}{4}T\sum_{\omega_{n}}\int_{-1}^{1}\frac{dx}{\sqrt{\omega_{n}^{2}+\left|\Delta_{\mathbf{p}}\right|^{2}}}\frac{\left(1-x^{2}\right)\left|\Delta_{\mathbf{p}}\right|^{2}}{\omega_{n}^{2}+\left|\Delta_{\mathbf{p}}\right|^{2}+\frac{1}{4}q^{2}v^{2}x^{2}}.\label{eq:Transverse_Resp2} \end{align} Therefore, we have shown that Eq.~(\ref{eq:Transverse_Resp}), which followed from our generalized formula for phase fluctuations, agrees with Eq.~(\ref{eq:Transverse_Resp2}). To finish, consider a two-dimensional superfluid where the current and vector potential are parallel: $J^{x}=K^{xx}A_{x},J^{y}=K^{yy}A_{y}.$ The ratio of the EM kernels is \begin{equation} \frac{\lambda_{x}^{2}}{\lambda_{y}^{2}}=\frac{K^{xx}}{K^{yy}}. \end{equation} In Ref.~\citep{Millis_1987}, where the effects from phase collective modes were the focus, it was pointed out that in the case of a dipolar superfluid this quantity is not unity. The analysis in this section shows that, in the static and long-wavelength limit, the full response is purely transverse, and thus there is no collective-mode contribution to the above ratio. The reason for its departure from unity~\citep{Millis_1987} is merely because the undressed bubble contributions are distinct for the dipolar superfluid. \section{Conclusions~\label{sec:Conclusions}} The rich physics associated with superfluids and superconductors is most perceptible in the collective fluctuations of the order parameter. These modes show that superconductors are more than just gapped fluids of condensed electron-electron pairs. Rather, superconductors are systems replete with collective excitations due to coherent many-particle effects. Historically these modes were first studied in the context of restoring gauge invariance in a superconductor. More recently, however, a bevy of literature has studied these excitations in more general settings, and one particularly important problem has been understanding their role in the Meissner effect. The antecedent literature to the present work suggested that collective modes may be ignored in $s$-wave systems, but must be accounted for if the order parameter is anisotropic ($p$-wave, $d$-wave, etc). In this paper we have extended this analysis by developing a general method for computing the electromagnetic response in systems with multiple collective modes. We have shown that, in fact, collective modes do not contribute to the Meissner effect in neither uniform nor nonuniform superconductors. An exception to this scenario comes about when external wavevector scales exist, as in Fulde-Ferrell finite-momentum paired superconductors. The by-product of our study was to show that through singular-value decompositions, the electromagnetic response in a system with multiple collective modes present can naturally be computed by folding the various response tensors into dressed constituents. With all details we provided, we anticipate that this methodology will also prove useful in other contexts such as charge-density waves and quantum magnetism. \section{acknowledgments} RB and PLSL contributed equally to this work. We thank Shinsei Ryu and Joseph Maciejko for helpful discussions and suggestions. RB is supported by the Theoretical Physics Institute at the University of Alberta. PLSL is supported by the Canada First Research Excellence Fund. \begin{widetext}
\section{Introduction} Data-driven approaches for the analysis of complex dynamical systems---be it methods to approximate transfer operators for computing metastable or coherent sets, methods to learn physical laws, or methods for optimization and control---have been steadily gaining popularity over the last years. Algorithms such as DMD~\cite{Schmid10, TRLBK14}, EDMD~\cite{WRK15, KKS16}, SINDy~\cite{BrPrKu16}, and their various kernel- \cite{WRK15, SP15, KSM19}, tensor- \cite{KGPS18, GKES19, CSBR19}, or neural network-based \cite{LDBK17, LKB17, MPWN18} extensions and generalizations have been successfully applied to a plethora of different problems, including molecular and fluid dynamics, meteorology, finance, as well as mechanical and electrical engineering. An overview of different applications can be found, e.g., in \cite{KBBP16}. Similar methods, developed mainly for reversible molecular dynamics problems, have been proposed in \cite{NKPMN14}. Most of the aforementioned techniques turn out to be strongly related, with the unifying concept being Koopman operator theory \cite{Ko31, LaMa94, BMM12}. In what follows, we will focus mainly on the generator of the Koopman operator and its properties and applications. SINDy~\cite{BrPrKu16} constitutes a milestone for data-driven discovery of dynamical systems. Because of the close relationship between the vector field of a deterministic dynamical system and its Koopman generator, SINDy is a special case of the framework we will introduce in this study. In \cite{Kaiser17, Kaiser18}, an extension of SINDy to determine eigenfunctions of the Koopman generator was presented. The discovered eigenfunctions are then used for control, resulting in the so-called KRONIC framework. Another extension of SINDy was derived in \cite{BNC18}, allowing for the identification of parameters of a stochastic system using Kramers--Moyal formulae. A different avenue towards system identification was taken in~\cite{MauGon16, MauGon17}. Here, the Koopman operator is first approximated with the aid of EDMD, and then its generator is determined using the matrix logarithm. Subsequently, the right-hand side of the differential equation is extracted from the matrix representation of the generator. The relationship between the Koopman operator and its generator was also exploited in \cite{RiTK17} for parameter estimation of stochastic differential equations. A method for computing eigenfunctions of the Koopman generator was proposed in~\cite{Gia19}, where the diffusion maps algorithm is used to set up a Galerkin-projected eigenvalue problem with orthogonal basis elements. Two efficient methods for computing the generator of the adjoint Perron--Frobenius operator based on Ulam's method and spectral collocation were presented in \cite{FrJuKo13}. Provided that a model of the system dynamics is available, the computation of trajectories can be replaced by evaluations of the right-hand side of the system, which is often orders of magnitude faster. The purpose of this study is to present a general framework to compute a matrix approximation of the Koopman generator, both for deterministic and stochastic systems, and to explore a range of applications. The main contributions of this work are: \begin{enumerate}[wide, itemindent=\parindent, itemsep=0ex, topsep=0.5ex] \item We reformulate standard EDMD in such a way that it can be used to approximate the generator of the Koopman operator---as well as its eigenvalues, eigenfunctions, and modes---from data without resorting to trajectory integration. Exploiting duality, this can be extended naturally to the generator of the Perron--Frobenius operator. \item We illustrate that the governing equations of deterministic as well as stochastic dynamical systems can be obtained from empirical estimates of the generator. Furthermore, we highlight relationships with related system identification techniques such as the Koopman lifting approach \cite{MauGon16}, SINDy \cite{BrPrKu16}, and KRONIC \cite{Kaiser17}, which focus mainly on identifying ordinary differential equations. \item Lastly, we explore two powerful applications of the approximated Koopman generator. We show that gEDMD can be used to identify coarse-grained models based on data of the full system, which is a highly relevant topic across different research fields, like molecular dynamics simulations for instance. Moreover, we apply the Koopman generator to control dynamical systems, providing flexible and efficient model predictive control strategies. \end{enumerate} The efficacy of the resulting methods will be demonstrated with the aid of guiding examples and illustrative benchmark problems. The remainder of this paper is structured as follows: In Section~\ref{sec:Koopman operator}, we introduce the Koopman operator and its generator for different kinds of dynamical systems. We then derive an extension of EDMD for the approximation of the Koopman generator, named gEDMD, in Section~\ref{sec:gEDMD}. Furthermore, relationships with other methods are described. Section~\ref{sec:Further applications} explores additional applications of the proposed methods, namely coarse-graining and the application to control problems. Open questions and future work are discussed in Section~\ref{sec:Conclusion}. \section{The Koopman operator and its generator} \label{sec:Koopman operator} In what follows, let $ \mathbb{X} $ be the state space, e.g., $ \mathbb{X} \subset \R^d $, and $ f \in L^{\infty}(\mathbb{X}) $ a real-valued observable of the system. \subsection{Deterministic dynamical systems} Given an ordinary differential equation of the form $ \dot{x} = b(x) $, where $ b \colon \R^d \to \R^d $, the so-called \emph{Koopman semigroup} of operators $ \{\ts \mathcal{K}^t \ts\} $ is defined as \begin{equation*} (\mathcal{K}^t f)(x) = f(\Phi^t(x)), \end{equation*} where $ \Phi^t $ is the flow map, see \cite{LaMa94, BMM12, KKS16}. That is, if $ x(t) $ is a solution of the initial value problem with initial condition $ x(0) = x_0 $, then $ \Phi^t(x_0) = x(t) $. The infinitesimal generator $ \mathcal{L} $ of the semigroup, defined as \begin{equation*} \mathcal{L} f = \lim_{t \rightarrow 0} \frac{1}{t} \left(\mathcal{K}^t f - f \right), \end{equation*} is given by \begin{equation*} \mathcal{L} f = \frac{\mathrm{d}}{\mathrm{d}t} f = b \cdot \nabla_x f = \sum_{i=1}^d b_i \ts \pd{f}{x_i}, \end{equation*} see, e.g., \cite{LaMa94}. Thus, if $ f $ is continuously differentiable, then $ u(t, x) = \mathcal{K}^t f(x) $ satisfies the first-order partial differential equation $ \pd{u}{t} = \mathcal{L} u $. The adjoint operator $ \mathcal{L}^* $, i.e., the generator of the Perron--Frobenius operator, is given by \begin{equation*} \mathcal{L}^* f = -\sum_{i=1}^d \pd{(b_i \ts f)}{x_i}. \end{equation*} \begin{example} \label{ex:Simple example} Throughout the paper, we will use the simple system \begin{equation*} \begin{split} \dot{x}_1 &= \gamma \ts x_1, \\ \dot{x}_2 &= \delta \ts (x_2 - x_1^2), \end{split} \end{equation*} taken from~\cite{BBPK16}, as a guiding example. In addition to the trivial eigenfunction $ \varphi_1(x) = 1 $ with corresponding generator eigenvalue $ \lambda_1 = 0 $, we obtain $ \varphi_2(x) = x_1 $ and $ \varphi_3(x) = \frac{2 \gamma - \delta}{\delta} x_2 + x_1^2 $ with corresponding generator eigenvalues $ \lambda_2 = \gamma $ and $ \lambda_3 = \delta $, respectively. Moreover, products of eigenfunctions are again eigenfunctions. \xqed{$\triangle$} \end{example} \subsection{Non-deterministic dynamical systems} Similarly, the definition of the Koopman operator can be generalized to stochastic differential equations \begin{equation} \label{eq:SDE} \mathrm{d}X_t = b(X_t) \ts \mathrm{d}t + \sigma(X_t) \ts \mathrm{d}W_t \end{equation} as described, e.g., in \cite{Hol08}, resulting in \begin{equation} \label{eq:stochastic_koopman_op} (\mathcal{K}^t f)(x) = \mathbb{E}[f(\Phi^t(x))]. \end{equation} Here, $ \mathbb{E}[\,\cdot\,] $ denotes the expected value, $ b \colon \R^d \to \R^d $ is the drift term, $ \sigma \colon \R^d \to \R^{d \times s} $ the diffusion term, and $ W_t $ an $ s $-dimensional Wiener process. Given a twice continuously differentiable function $ f $, it can be shown using It\^{o}'s lemma that the infinitesimal generator of the stochastic Koopman operator is then characterized by \begin{equation} \label{eq:generator_SDE} \mathcal{L} f = b \cdot \nabla_x f + \frac{1}{2} a : \nabla_x^2 f = \sum_{i=1}^d b_i \ts \pd{f}{x_i} + \frac{1}{2} \sum_{i=1}^d \sum_{j=1}^d a_{ij} \ts \pd{^2 f}{x_i \ts \partial x_j}, \end{equation} where $ a = \sigma \ts \sigma^\top $ and $ \nabla_x^2 $ denotes the Hessian. Properties of the generator associated with non-deterministic dynamical systems are studied in \cite{CMM19}. The function $ u(t, x) = \mathcal{K}^t f(x) $ satisfies the second-order partial differential equation $ \pd{u}{t} = \mathcal{L} u $, which is called the \emph{Kolmogorov backward equation} \cite{Met07}. The adjoint operator in this case is \begin{equation*} \mathcal{L}^* f = -\sum_{i=1}^d \pd{(b_i \ts f)}{x_i} + \frac{1}{2} \sum_{i=1}^d \sum_{j=1}^d \pd{^2 (a_{ij} \ts f)}{x_i \ts \partial x_j} \end{equation*} so that $ \pd{u}{t} = \mathcal{L}^* u $ becomes the \emph{Fokker--Planck equation} or \emph{Kolmogorov forward equation}~\cite{LaMa94}. If $\mu$ is a stationary measure for the process $X_t$, the Koopman operator can be extended from $L^\infty_\mu(\mathbb{X})$ to the Hilbert space $L^2_\mu(\mathbb{X})$ with inner product $\innerprod{f}{g}_\mu = \int_\mathbb{X} f(x) \ts g(x) \ts \mathrm{d}\mu(x)$ \cite{BAXTER1995}. We will frequently consider this situation in what follows. An important class of stochastic differential equations are those which are reversible with respect to a measure $\mu$, which is necessarily a stationary measure in this case. The Koopman operator becomes self-adjoint on $L^2_\mu(\mathbb{X})$ in the reversible setting. Reversible systems can be characterized by the diffusion $\sigma$ and a scalar potential $F \colon \R^d \to \R$, from which the drift is then obtained by \begin{equation*} b = -\frac{1}{2} a \ts \nabla F + \frac{1}{2} \nabla \cdot a, \end{equation*} where the divergence in the second term is applied to each column of $a$ \cite{Pav14}. The generator of a reversible stochastic differential equation is a self-adjoint and typically unbounded operator on a suitable dense subspace of $L^2_\mu(\mathbb{X})$. \begin{remark} \label{rem:overdamped_langevin} For systems of the form $ \mathrm{d}X_t = -\nabla V(X_t) \ts \mathrm{d}t + \sqrt{2 \beta^{-1}} \ts \mathrm{d}W_t $, which play an important role in molecular dynamics, we obtain \begin{equation*} \mathcal{L} f = -\nabla V \cdot \nabla f + \beta^{-1} \Delta f \quad \text{and} \quad \mathcal{L}^* f = \nabla V \cdot \nabla f + \Delta V \ts f + \beta^{-1} \Delta f. \end{equation*} Here, $ V $ describes the potential and $ \beta $ is the inverse temperature. The resulting dynamics are reversible with invariant measure $\mu(x) \sim \exp(-\beta \ts V(x))$. The generator $\mathcal{L}$ is self-adjoint on $L^2_\mu(\mathbb{X})$ and it can be shown that, assuming suitable growth conditions on the potential, the spectrum of $\mathcal{L}$ is discrete \cite{BAKRY2013}. \end{remark} \begin{example} \label{ex:Ornstein Uhlenbeck} We will use the one-dimensional Ornstein--Uhlenbeck process, given by the stochastic differential equation \begin{equation*} \mathrm{d}X_t = -\alpha \ts X_t \ts \mathrm{d}t + \sqrt{2 \beta^{-1}} \ts \mathrm{d}W_t, \end{equation*} which is of the above form with $ V(x) = \frac{1}{2} \ts \alpha \ts x^2 $, as a second guiding example. The parameter $ \alpha $ is the friction coefficient. The generator becomes self-adjoint in the space $ L^2(\rho) $ weighted by the invariant density \begin{equation*} \rho(x) = \frac{1}{\sqrt{2 \pi \alpha^{-1} \beta^{-1}}} \exp\left(-\alpha \ts \beta \ts \frac{x^2}{2}\right) \end{equation*} and the eigenvalues $ \lambda_\ell $ and eigenfunctions $ \varphi_\ell $ are given by \begin{equation*} \lambda_\ell = -\alpha \ts (\ell-1), \quad \varphi_\ell(x) = \frac{1}{\sqrt{(\ell-1)!}} \ts H_{\ell-1}\left(\sqrt{\alpha \beta} \ts x\right), \quad \ell = 1, 2, \dots, \end{equation*} where $ H_\ell $ denotes the $ \ell $th probabilists' Hermite polynomial \cite{Pav14}. That these functions are indeed eigenfunctions can be verified easily using recurrence relations for the Hermite polynomials, i.e., $ H_{\ell+1}(x) = x H_\ell(x) - H_\ell^\prime(x) $. \xqed{$\triangle$} \end{example} \subsection{Galerkin approximation} Given a set of basis functions $ \{\ts \psi_i \ts\}_{i=1}^n $, where $ \psi_i \colon \R^d \to \R $, a Galerkin approximation $ \mathbf{L} $ of the generator $ \mathcal{L} $ can be obtained by computing the matrices $ A, G \in \R^{n \times n} $ with \begin{equation} \label{eq:Galerkin_matrices} \begin{split} A_{ij} &= \innerprod{\mathcal{L} \ts \psi_i}{\psi_j}_\mu, \\ G_{ij} &= \innerprod{\psi_i}{\psi_j}_\mu, \end{split} \end{equation} where $ \mu $ is a given measure. The matrix representation $ L $ of the projected operator $ \mathbf{L} $ is then given by $ L^\top = A \ts G^{-1} $. We define $ \psi(x) = [\psi_1(x), \dots, \psi_n(x)]^\top $. That is, for a function $ f(x) = \sum_{i=1}^n c_i \ts \psi_i(x) = c^\top \psi(x) $, it holds that $ (\mathbf{L} f)(x) = (L \ts c)^\top \psi(x) $, where $ c = [c_1, \dots, c_n]^\top \in \R^n $. It follows that an eigenvector $ \xi_\ell $ of $ L $ corresponding to the eigenvalue $ \lambda_\ell $ contains the coefficients for the eigenfunctions of $ \mathbf{L} $ since defining $ \varphi_\ell(x) = \xi_\ell^\top \psi(x) $ yields \begin{equation*} (\mathbf{L} \varphi_\ell)(x) = (L \ts \xi_\ell)^\top \psi(x) = \lambda_\ell \ts \xi_\ell^\top \psi(x) = \lambda_\ell \ts \varphi_\ell(x). \end{equation*} In many applications, the reciprocals of the generator eigenvalues (or their approximations) are also of interest, as they can be interpreted as decay time scales of dynamical processes in the system. We will refer to them as \textit{implied time scales} \begin{equation*} t_\ell := \frac{1}{\lambda_\ell}. \end{equation*} \begin{example} \label{ex:OrnUhl1} For the Ornstein--Uhlenbeck process and a basis comprising monomials of order up to $ n - 1 $, i.e., $ \psi(x) = [1, x, \dots, x^{n-1}]^\top $, we can compute the matrix $ L $ analytically. Note that $ \mathcal{L} \psi_k $ is again in the subspace spanned by $ \{\ts \psi_i \ts\}_{i=1}^n $. In particular, for $ k \ge 3 $, we have \begin{equation*} (\mathcal{L} \psi_k)(x) = -\alpha \ts (k-1) \ts x^{k-1} + \beta^{-1} (k-1)(k-2) \ts x^{k-3} \end{equation*} and the matrix $ L \in \R^{n \times n} $ is of the form \begin{equation*} \renewcommand{\tabcolsep}{15cm} \kbordermatrix{ & 1 & x & x^2 & x^3 & x^4 & x^5 & x^6 & \dots \\ 1 & 0 & & 2\ts\beta^{-1} & & & & & \\ x & & -\alpha & & 6\ts\beta^{-1} & & & & \\ x^2 & & & -2\ts\alpha & & 12\ts\beta^{-1} & & & \\ x^3 & & & & -3\ts\alpha & & 20\ts\beta^{-1} & & \\ x^4 & & & & & -4\ts\alpha & & 30\ts\beta^{-1} & \\[-0.9ex] x^5 & & & & & & -5\ts\alpha & & \ddots \\ x^6 & & & & & & & -6\ts\alpha & \\ \vdots & & & & & & & & \ddots }, \end{equation*} where the row and column labels correspond to the respective basis functions. The eigenvalues of the generator are given by $ \lambda_\ell = -\alpha \ts (\ell-1) $, for $ \ell = 1, \dots, n $, and the resulting eigenfunctions whose coefficients are given by the eigenvectors are the (transformed) probabilists' Hermite polynomials as described above. An approach to compute Hermite polynomials by solving an eigenvalue problem, resulting in a similar matrix representation, is also described in~\cite{Aboites17}. \xqed{$\triangle$} \end{example} Since we in general cannot compute the required integrals analytically, the aim is to estimate them from data using, e.g., Monte Carlo integration. More details regarding different types of Galerkin approximations and other methods for the approximation of transfer operators from data can be found in \cite{KKS16, KNKWKSN18}. \begin{remark} Issues pertaining to non-compactness or continuous spectra of Koopman operators associated with systems of high complexity are beyond the scope of this paper. Although such cases can theoretically be handled, the numerical analysis is often challenging and typically requires regularization, which is, for instance, implicitly given by Galerkin projections \cite{Gia19}. This is discussed in detail in the aforecited work by Giannakis. Moreover, the projected generator does in general not result in a rate matrix, see \cite{SS13, SS15} for details on Galerkin discretizations of transfer operators and their properties. \end{remark} \section{Infinitesimal generator EDMD} \label{sec:gEDMD} EDMD \cite{WKR15, KKS16} was developed for the approximation of the Koopman or Perron--Frobenius operator from data. However, it can be reformulated to compute also the associated infinitesimal generators. We will call the resulting method gEDMD. \subsection{Deterministic dynamical systems} Let us first consider the deterministic case, which---albeit derived in another way and with different applications in mind---has already been studied in \cite{Kaiser17, Kaiser18} so that we only briefly summarize and extend these results and then generalize them to the non-deterministic setting. Detailed relationships with other methods can be found in Section~\ref{ssec:Relationships with other methods}. We now assume that we have $ m $ measurements of the states of the system, given by $ \{\ts x_l \ts\}_{l=1}^m $, and the corresponding time derivatives, given by $ \{\ts \dot{x}_l \ts\}_{l=1}^m $. The derivatives might also be estimated from data, cf.~\cite{BrPrKu16}. \subsubsection{Generator approximation} Similar to the Galerkin projection described above, we then choose a set of basis functions, also sometimes called \emph{dictionary}, defined by $ \{\ts \psi_i \ts\}_{i=1}^n $, and write this again in vector form as $ \psi(x) = [\psi_1(x), \dots, \psi_n(x)]^\top $. Additionally, we define \begin{equation*} \dot{\psi}_k(x) = (\mathcal{L} \psi_k)(x) = \sum_{i=1}^d b_i(x) \ts \pd{\psi_k}{x_i}(x). \end{equation*} For all data points and basis functions, this can be written in matrix form as \begin{equation*} \Psi_X = \begin{bmatrix} \psi_1(x_1) & \dots & \psi_1(x_m) \\ \vdots & \ddots & \vdots \\ \psi_n(x_1) & \dots & \psi_n(x_m) \end{bmatrix} \quad \text{and} \quad \dot{\Psi}_X = \begin{bmatrix} \dot{\psi}_1(x_1) & \dots & \dot{\psi}_1(x_m) \\ \vdots & \ddots & \vdots \\ \dot{\psi}_n(x_1) & \dots & \dot{\psi}_n(x_m) \end{bmatrix}, \end{equation*} where $ \Psi_X, \dot{\Psi}_X \in \R^{n \times m} $. The partial derivatives of the basis functions required for $ \dot{\psi}_k(x_l) $ can be precomputed analytically.\!\footnote{Alternatively, automatic differentiation or symbolic computing toolboxes could be utilized.} Note that we additionally need $ b(x_l) $ which is simply~$ \dot{x}_l $. If the time derivatives cannot be measured directly, they can be approximated using, e.g., finite differences. We now assume there exists a matrix $ M $ such that $ \dot{\Psi}_X = M \Psi_X $. Since this equation in general cannot be satisfied exactly, we solve it in the least squares sense---analogously to the derivation of EDMD---by minimizing $ \norm{\smash{\dot{\Psi}_X - M \Psi_X}}_F $, resulting in \begin{equation*} M = \dot{\Psi}_X \Psi_X^+ = \big(\dot{\Psi}_X \Psi_X^\top\big) \big(\Psi_X \Psi_X^\top\big)^+ = \widehat{A} \ts \widehat{G}^+, \end{equation*} with \begin{equation*} \widehat{A} = \frac{1}{m} \sum_{l=1}^m \dot{\psi}(x_l) \ts \psi(x_l)^\top \quad \text{and} \quad \widehat{G} = \frac{1}{m} \sum_{l=1}^m \psi(x_l) \ts \psi(x_l)^\top. \end{equation*} We call this approach gEDMD. The advantage is that the generator might be sparse even when the Koopman operator for the time-$ t $ map is not. \begin{remark} The sparsification approach proposed for SINDy, see \cite{BrPrKu16}, can be added in the same way to gEDMD in order to minimize the number of spurious nonzero entries caused, for instance, by the numerical approximation of the time derivatives or by noisy data. \end{remark} The convergence to the Galerkin approximation in the infinite data limit will be shown for the non-deterministic case, the deterministic counterpart follows as a special case. The matrix $ M $ is thus an empirical estimate of $ L^\top $ and we write $ M = \widehat{L}^\top = \widehat{A} \ts \widehat{G}^+ $. Accordingly, exploiting duality, the matrix representation of the adjoint operator $ \mathcal{L}^* $, the generator of the Perron--Frobenius operator, is given by $ M^* = (\widehat{L}^*)^\top = \widehat{A}\ts^\top \widehat{G}^{+} $. A detailed derivation for standard EDMD, which can be carried over to gEDMD, can be found in \cite{KKS16}. The convergence of the standard EDMD approximation to the Koopman operator as the number of basis functions goes to infinity is discussed in \cite{KoMe18}. Whether the results can be extended to gEDMD will be studied in future work. \begin{example} \label{ex:Simple example generator} Let us again consider the system defined in Example~\ref{ex:Simple example} using monomials up to order $ 8 $. We set $ \gamma = -0.8 $ and $ \delta = -0.7 $ and generate $ 1000 $ uniformly distributed test points in $ [-2, 2] \times [-2, 2] $. Then gEDMD results in eigenvalues and (rescaled) eigenfunctions \begin{equation*} \arraycolsep=10pt \def1.3{1.3} \begin{array}{ll} \lambda_1 \approx 0, & \varphi_1(x) \approx 1, \\ \lambda_2 \approx -0.7 = \delta, & \varphi_2(x) = 1.286 \ts x_2 + 1.000 \ts x_1^2 \approx \frac{2\gamma - \delta}{\delta} x_2 + x_1^2, \\ \lambda_3 \approx -0.8 = \gamma, & \varphi_3(x) \approx x_1. \end{array} \end{equation*} The subsequent eigenfunctions are products of the above eigenfunctions, we obtain, for instance, $ \lambda_6 \approx -1.6 = 2 \ts \gamma $ with $ \varphi_6(x) = 1.000 \ts x_1^2 \approx \varphi_3(x)^2 $. Note that the ordering of the eigenvalues, which are typically sorted by decreasing values, and associated eigenfunctions depends on the values of $ \gamma $ and $ \delta $. \xqed{$\triangle$} \end{example} \subsubsection{System identification} \label{ssec:systemidentification} With the aid of the full-state observable $ g(x) = x $, it is possible to reconstruct the governing equations of the underlying dynamical system. Note that $ \mathbb{X} $ needs to be bounded here---and for the identification of stochastic differential equations introduced below---so that $ g $ is (component-wise) contained in $ L^{\infty}(\mathbb{X})$. Let $ \xi_\ell $ be the $ \ell $th eigenvector of $ \widehat{L} $ and $ \Xi = [\xi_1, \dots, \xi_n] $. Furthermore, assume that $ B \in \mathbb{R}^{n \times d} $ is the matrix such that $ g(x) = B^\top \ts \psi(x) $. This can be easily accomplished by adding the observables $ \{ \ts x_i \ts \}_{i=1}^d $ to the dictionary. In order to obtain the Koopman modes for the full-state observable, define $ \varphi(x) = [\varphi_1(x), \dots, \varphi_n(x)]^\top = \Xi^\top \psi(x) $. Then \begin{align*} g(x) = B^\top \ts \psi(x) = B^\top \ts \Xi^{-\top} \varphi(x). \end{align*} The column vectors of the matrix $ V = B^\top \ts \Xi^{-\top} $ are the Koopman modes $ v_\ell $. We obtain \begin{equation*} (\mathcal{L} g)(x) = b(x) \approx \sum_{\ell=1}^n \ts \lambda_\ell \ts \varphi_\ell(x) v_\ell, \end{equation*} where the generator is applied component-wise. This allows us to decompose a system into different frequencies. The derivation of the modes is equivalent to the standard EDMD case, see \cite{KKS16, WKR15} for more details. Instead of representing the system in terms of the eigenvalues, eigenfunctions, and modes of the generator, we can also express it directly in terms of the basis functions, i.e., \begin{equation*} (\mathcal{L} g)(x) = b(x) \approx (L B)^\top \ts \psi(x), \end{equation*} which is then equivalent to SINDy, see Section~\ref{ssec:Relationships with other methods}. \begin{example} \label{ex:systemidentification} Using the eigenvalues $ \lambda_\ell $ and corresponding eigenfunctions $ \varphi_\ell(x) $ as determined in Example~\ref{ex:Simple example generator}, we can reconstruct the dynamical system from Example~\ref{ex:Simple example}. Only the Koopman modes $ v_2 = [0, \, 0.778]^\top \approx [0, \, \frac{\delta}{2\gamma - \delta}]^\top $, $ v_3 = [1, \, 0]^\top $, and $ v_6 = [0, \, -0.778]^\top \approx [0, \, -\frac{\delta}{2\gamma - \delta}]^\top $ are required for the reconstruction, the other modes are numerically zero. That is, \begin{equation*} b(x) \approx \lambda_2 \ts \varphi_2(x) \ts v_2 + \lambda_3 \ts \varphi_3(x) \ts v_3 + \lambda_6 \ts \varphi_6(x) \ts v_6 \approx \begin{bmatrix} \gamma \ts x_1 \\ \delta \ts (x_2 - x_1^2) \end{bmatrix}. \end{equation*} Expressing the system directly in terms of the basis functions results in the same representation, the governing equations are hence identified correctly in both cases. \xqed{$\triangle$} \end{example} \begin{remark} \label{rem:thresholding} In the above example, we assumed that the derivatives for the training data are known or can be computed with sufficient accuracy. If the derivatives, however, are noisy or inaccurate, the resulting matrix representations of the operators often become nonsparse and additional techniques such as denoising, total-variation regularization, or iterative hard thresholding might be required to eliminate spurious nonzero entries, see also~\cite{BrPrKu16} and references therein. In order to model the presence of noise, we replace $ b(x_l) $ by $ b(x_l) + \eta $, where $ \eta $ is sampled from a Gaussian distribution with standard deviation $ \varsigma $. By adding the iterative hard thresholding procedure proposed in~\cite{BrPrKu16} to gEDMD, which step by step removes entries larger than a given threshold $ \delta $ and then recomputes the coefficients, we can eliminate unwanted entries. The results, however, depend strongly on the chosen threshold as shown in Figure~\ref{fig:thresholding}. The smaller the signal-to-noise ratio, the larger the threshold needs to be to eliminate spurious nonzero entries, but a too large threshold will also eliminate the actual coefficients. The error here is defined to be the average difference between the true and the estimated coefficients after 10 iterations of the hard thresholding algorithm. \begin{figure} \centering \includegraphics[width=0.45\textwidth]{pics/Thresholding} \caption{Recovery error as a function of the standard deviation $ \varsigma $ for different thresholds~$ \delta $. If no thresholding is used, the results coincide with the $ \delta = $ 1e--4 case. The results show that for inaccurate estimates of the derivatives additional techniques are required to obtain suitable representations of the system. Provided that the cut-off value is chosen judiciously, the hard thresholding approach enables us to recover the correct dynamics even in the presence of noise.} \label{fig:thresholding} \end{figure} \end{remark} \subsubsection{Conservation laws} \label{ssec:conservationdeterministic} A function $E \colon \mathbb{R}^d \rightarrow \mathbb{R}$ is said to be a \emph{conserved quantity} if it remains constant for all~$t$ and all initial values, i.e., $\frac{\mathrm{d}}{\mathrm{d}t}E = \nabla E \cdot b = 0$, which immediately implies that $ E $ is an eigenfunction of the Koopman generator corresponding to the eigenvalue $ \lambda = 0 $; such invariants have already been considered in Koopman's original paper \cite{Ko31}. Similarly, eigenfunctions of the Perron--Frobenius generator associated with $ \lambda = 0 $ represent invariant densities. Conservation laws play an important role in physics and engineering, but are in principle hard to discover. The relationship between conservation laws and Koopman eigenfunctions has recently been exploited in \cite{Kaiser17, Kaiser18}, where conserved quantities are learned from data. In the same way, we can apply gEDMD to find non-trivial eigenfunctions corresponding to $ \lambda = 0 $. \subsection{Non-deterministic dynamical systems} \label{sec:gEDMD_stochastic} Let us now extend these results to stochastic differential equations of the form \eqref{eq:SDE}. Given a set of training data $ \{\ts x_l \ts\}_{l=1}^m $ as above, we assume that $ \{\ts b(x_l) \ts\}_{l=1}^m $ and $ \{\ts \sigma(x_l) \ts\}_{l=1}^m $ are known or can be estimated. \subsubsection{Generator approximation} Let \begin{equation} \label{eq:definition_dpsi_k} \mathrm{d}\psi_k(x) = (\mathcal{L} \psi_k)(x) = \sum_{i=1}^d b_i(x) \ts \pd{\psi_k}{x_i}(x) + \frac{1}{2} \sum_{i=1}^d \sum_{j=1}^d a_{ij}(x) \ts \pd{^2 \psi_k}{x_i \ts \partial x_j}(x) \end{equation} and \begin{equation*} \mathrm{d}\Psi_X = \begin{bmatrix} \mathrm{d}\psi_1(x_1) & \dots & \mathrm{d}\psi_1(x_m) \\ \vdots & \ddots & \vdots \\ \mathrm{d}\psi_k(x_1) & \dots & \mathrm{d}\psi_k(x_m) \end{bmatrix}. \end{equation*} That is, in addition to the first derivatives of the basis functions, we now also need the second derivatives, which can again be precomputed analytically. Solving the resulting minimization problem, this leads to the least-squares approximation \begin{equation*} M = \mathrm{d}\Psi_X \Psi_X^+ = \big(\mathrm{d}\Psi_X \Psi_X^\top\big) \big(\Psi_X \Psi_X^\top\big)^+ = \widehat{A} \ts \widehat{G}^+, \end{equation*} with \begin{equation*} \widehat{A} = \frac{1}{m} \sum_{l=1}^m \mathrm{d}\psi(x_l) \ts \psi(x_l)^\top \quad \text{and} \quad \widehat{G} = \frac{1}{m} \sum_{l=1}^m \psi(x_l) \ts \psi(x_l)^\top. \end{equation*} As above, we obtain $ M = \widehat{L}^\top = \widehat{A} \ts \widehat{G}^+ $ as an empirical estimate of the generator and $ M^* = (\widehat{L}^*)^\top = \widehat{A}\ts^\top \widehat{G}^{+} $ as an estimate of the adjoint operator. \begin{proposition} \label{prop:convergence_gedmd} In the infinite data limit, gEDMD converges to the Galerkin projection of the generator onto the space spanned by the basis functions $ \{\ts \psi_i \ts\}_{i=1}^n $. \end{proposition} \begin{proof} The proof is equivalent to the counterpart for standard EDMD, see \cite{WKR15, KKS16}. Letting $ m $ go to infinity, we obtain \begin{alignat*}{4} \widehat{A}_{ij} &= \frac{1}{m} \sum_{l=1}^m \mathrm{d}\psi_i(x_l) \ts \psi_j(x_l) &&\underset{\scriptscriptstyle m \rightarrow \infty}{\longrightarrow} \int (\mathcal{L} \psi_i)(x) \ts \psi_j(x) \ts \mathrm{d}\mu(x) &&= \innerprod{\mathcal{L} \psi_i}{\psi_j}_\mu &&= A_{ij}, \\ \widehat{G}_{ij} &= \frac{1}{m} \sum_{l=1}^m \psi_i(x_l) \ts \psi_j(x_l) &&\underset{\scriptscriptstyle m \rightarrow \infty}{\longrightarrow} \int \psi_i(x) \ts \psi_j(x) \ts \mathrm{d}\mu(x) && = \innerprod{\psi_i}{\psi_j}_\mu &&= G_{ij}, \end{alignat*} where $ x_l \sim \mu $. That is, the matrices $ \widehat{A} $ and $ \widehat{G} $ are empirical estimates of the matrices $ A $ and $ G $, respectively. \end{proof} \begin{remark} If the drift and diffusion coefficients of the stochastic differential equation~\eqref{eq:SDE} are not known, they can be approximated via finite differences. In fact, by the Kramers--Moyal formulae, \begin{alignat*}{2} b(x) &= \lim_{t \to 0} b^t(x) &&:= \lim_{t \to 0} \mathbb{E}\left[ \frac{1}{t} (X_t - x) \relmiddle| X_0 = x \right], \\ a(x) &= \lim_{t \to 0} a^t(x) &&:= \lim_{t \to 0} \mathbb{E}\left[ \frac{1}{t} (X_t - x)(X_t - x)^\top \relmiddle| X_0 = x \right]. \end{alignat*} These expressions can be evaluated pointwise by spawning multiple short trajectories from each data point $x_l$, and then estimating the expectations above via Monte Carlo. Alternatively, if a single ergodic simulation at time step $t$ is available, we can also replace the definition of $\mathrm{d}\psi_k$ in \eqref{eq:definition_dpsi_k} by \begin{equation*} \mathrm{d}\psi_k(x_l) = \frac{1}{t} (x_{l+1} - x_{l}) \cdot \nabla \psi_k(x_l) + \frac{1}{2\ts t}\left[(x_{l+1} - x_l)(x_{l+1} - x_l)^\top\right] : \nabla^2 \psi_k(x_l). \end{equation*} It was shown in \cite{BNC18} that in the infinite data limit \begin{equation*} \lim_{m \to \infty} \widehat{A}_{ij} = \innerprod{b^t \cdot \nabla \psi_i + \frac{1}{2} a^t : \nabla^2 \psi_i}{\psi_j}_\mu. \end{equation*} In this case, gEDMD converges to a Galerkin approximation of the differential operator with drift and diffusion coefficients $b^t$ and $a^t$. \end{remark} \begin{remark} \label{rem:gedmd_reversible} If the stochastic dynamics \eqref{eq:SDE} are reversible with respect to the measure~$\mu$, we only require first-order derivatives of the basis. In this case, the Galerkin matrix $A$ in~\eqref{eq:Galerkin_matrices} can be expressed as \begin{equation*} A_{ij} = \innerprod{\mathcal{L}\psi_i}{\psi_j}_\mu = -\frac{1}{2}\int \nabla \psi_i \ts \sigma \ts \sigma^\top \nabla \psi_j^\top \, \mathrm{d}\mu, \end{equation*} where the drift coefficient enters only implicitly via the invariant measure $\mu$, see \cite{Zhang:2016aa}. Using the gradient matrix $\nabla \Psi \in \mathbb{R}^{n \times d}$, where each row corresponds to the gradient of a basis function, the empirical estimator $\widehat{A}$ for $A$ is then defined as follows: \begin{align*} \widehat{A} &= -\frac{1}{2m} \sum_{l=1}^m \mathrm{d}\psi(x_l) \ts \mathrm{d}\psi(x_l)^\top, \end{align*} with $ \mathrm{d}\psi(x_l) = \nabla \Psi(x_l) \ts \sigma(x_l) $. \end{remark} \begin{example} Let us first compute eigenfunctions of the generator. We assume that $ \{\ts b(x_l) \ts\}_{l=1}^m $ and $ \{\ts \sigma(x_l) \ts\}_{l=1}^m $ are known and not estimated from data. \begin{enumerate}[wide, itemindent=\parindent, itemsep=0ex, topsep=0.5ex] \item We consider again the Ornstein--Uhlenbeck process defined in Example~\ref{ex:Ornstein Uhlenbeck}. For the numerical experiments, we set $ \alpha = 1 $ and $ \beta = 4 $ and select a basis comprising monomials of order up to and including ten. Using only $ 100 $ uniformly generated test points in $ \mathbb{X} = [-2, 2] $, we obtain the Koopman eigenfunctions shown in Figure~\ref{fig:OU_gEDMD}(a), which are virtually indistinguishable from the analytical solution. Standard EDMD would typically need more test points for such an accurate approximation of the dominant eigenfunctions, see~\cite{KNKWKSN18} for details.\!\footnote{Note that although the definition of the Ornstein--Uhlenbeck process is slightly different in \cite{KNKWKSN18}, the systems are in fact identical.} The results for the Perron--Frobenius generator using monomials are not as good, see Figure~\ref{fig:OU_gEDMD}(b). Replacing monomials by a basis containing Gaussian functions the results improve considerably as shown in Figure~\ref{fig:OU_gEDMD}(c). This illustrates that it is crucial to select suitable basis functions, which are, however, generally not known in advance. The sparsity patterns of the generator approximation using EDMD and gEDMD are compared in Figure~\ref{fig:OU_gEDMD}(d--f), showing that EDMD leads to less sparse matrices with additional spurious nonzero entries. \xqed{$\triangle$} \begin{figure} \centering \begin{minipage}{0.32\textwidth} \centering \subfiguretitle{(a)} \includegraphics[width=\textwidth]{pics/OU_gEDMD_K} \end{minipage} \begin{minipage}{0.32\textwidth} \centering \subfiguretitle{(b)} \includegraphics[width=\textwidth]{pics/OU_gEDMD_P1} \end{minipage} \begin{minipage}{0.32\textwidth} \centering \subfiguretitle{(c)} \includegraphics[width=\textwidth]{pics/OU_gEDMD_P2} \end{minipage} \\[1ex] \begin{minipage}{0.32\textwidth} \centering \subfiguretitle{(d)} \includegraphics[width=0.95\textwidth]{pics/OU_K1} \end{minipage} \begin{minipage}{0.32\textwidth} \centering \subfiguretitle{(e)} \includegraphics[width=0.95\textwidth]{pics/OU_K2} \end{minipage} \begin{minipage}{0.32\textwidth} \centering \subfiguretitle{(f)} \includegraphics[width=0.95\textwidth]{pics/OU_K3} \end{minipage} \caption{Eigenfunctions of (a) the Koopman generator and (b) the Perron--Frobenius generator associated with the Ornstein--Uhlenbeck process computed using gEDMD with monomials of order up to ten. The dashed lines represent the analytically computed eigenfunctions. (c) Eigenfunctions of the Perron--Frobenius generator, where the basis now comprises 30 Gaussian functions. (d) Sparsity pattern of $ \widehat{L} $ computed with gEDMD, (e) sparsity pattern of $ \widehat{K}_\tau $ computed with EDMD, and (f) sparsity pattern of $ \exp(\tau \widehat{L}) $, where $ \tau $ is the lag time used for EDMD.} \label{fig:OU_gEDMD} \end{figure} \item We construct a more complicated example by defining $ V(x) = (x_1^2 - 1)^2 + x_2^2 $, which represents the renowned double-well potential, but then, instead of using isotropic noise, add a state-dependent diffusion term to obtain a stochastic differential equation of the form~\eqref{eq:SDE}, with \begin{equation*} b(x) = -\nabla V(x) = \begin{bmatrix} 4 \ts x_1 - 4 \ts x_1^3 \\ -2 \ts x_2 \end{bmatrix} \quad \text{and} \quad \sigma(x) = \begin{bmatrix} 0.7 & x_1 \\ 0 & 0.5 \end{bmatrix}. \end{equation*} The system exhibits metastable behavior, where the rare transitions are the jumps between the two wells. The potential and the two dominant eigenfunctions of the Perron--Frobenius generator computed with the aid of gEDMD are shown in Figure~\ref{fig:Double well}. Here, we generated $ 30\ts000 $ test points in $ \mathbb{X} = [-2, 2] \times [-1, 1] $ and selected a basis comprising $ 300 $ radial basis functions (whose centers are the midpoints of a regular box discretization) with bandwidth $ \sigma = 0.2 $. \xqed{$\triangle$} \begin{figure} \centering \begin{minipage}{0.32\textwidth} \centering \subfiguretitle{(a)} \includegraphics[width=\textwidth]{pics/DoubleWellPotential} \end{minipage} \begin{minipage}{0.32\textwidth} \centering \subfiguretitle{(b)} \includegraphics[width=\textwidth]{pics/DoubleWell_gEDMD_P1} \end{minipage} \begin{minipage}{0.32\textwidth} \centering \subfiguretitle{(c)} \includegraphics[width=\textwidth]{pics/DoubleWell_gEDMD_P2} \end{minipage} \caption{(a)~Double-well potential. (b)~First and (c)~second eigenfunction of the Perron--Frobenius generator. Due to the non-isotropic noise the wells are tilted. The second eigenfunction clearly separates the two wells. In all plots, blue corresponds to small and yellow to large values.} \label{fig:Double well} \end{figure} \end{enumerate} \end{example} \subsubsection{System identification} \label{sec:non_deterministic_sys_id} As for deterministic systems, we can utilize the generator approximation also for system identification. In order to determine $ b $, we simply plug in the full-state observable $ g $ again. In addition to the drift term, we need to identify the diffusion term. This can be accomplished as follows: Note that for $ \psi_k(x) = x_i \ts x_j $, it holds that \begin{equation*} (\mathcal{L} \psi_k)(x) = b_i(x) \ts x_j + b_j(x) \ts x_i + a_{ij}(x). \end{equation*} Since we already obtained a representation of $ b $ in the previous step, we can subtract the first two terms to obtain $ a_{ij} $. Here, we have to assume that both $ b_i $ and $ b_j $ can be written in terms of the basis functions and that, furthermore, also the functions multiplied by $ x_j $ or $ x_i $, respectively, are contained in the space spanned by $ \{\ts \psi_i \ts\}_{i=1}^n $. For instance, if $ b $ contains monomials of degree $ p $, then the dictionary must also contain monomials of degree $ p+1 $. For other types of basis functions, we have to make sure that the aforementioned requirement is satisfied as well. \begin{example} Let us illustrate the recovery of $ b $ and $ a $ from the generator representation. \begin{enumerate}[wide, itemindent=\parindent, itemsep=0ex, topsep=0.5ex] \item For the Ornstein--Uhlenbeck process, we immediately obtain $ b(x) = (\mathcal{L} \psi_2)(x) = -\alpha \ts x $ and $ a(x) = (\mathcal{L} \psi_3)(x) - 2 \ts b(x) \ts x = 2 \ts \beta^{-1} $, see the matrix representation of the generator in Example~\ref{ex:OrnUhl1}, which implies $ \sigma(x) = \sqrt{2 \ts \beta^{-1}} $. Thus, the system is identified correctly. \item For the double-well problem, we generate $ 8000 $ random points in $ \mathbb{X} = [-2, 2] \times [-1, 1] $ and use the exact values for $ b(x) $ and $ \sigma(x) $. We then obtain an approximation of the generator whose first six columns for a dictionary comprising monomials up to order four are given by \begin{equation*} \kbordermatrix{ & 1 & x_1 & x_2 & x_1^2 & x_1 \ts x_2 & x_2^2 \\ 1 & 0 & 0 & 0 & 0.49 & 0 & 0.25 \\ x_1 & 0 & 4 & 0 & 0 & 0.5 & 0 \\ x_2 & 0 & 0 & -2 & 0 & 0 & 0 \\ x_1^2 & 0 & 0 & 0 & 9 & 0 & 0 \\ x_1 \ts x_2 & 0 & 0 & 0 & 0 & 2 & 0 \\ x_2^2 & 0 & 0 & 0 & 0 & 0 & -4 \\ x_1^3 & 0 & -4 & 0 & 0 & 0 & 0 \\ x_1^2 \ts x_2 & 0 & 0 & 0 & 0 & 0 & 0 \\ x_1 \ts x_2^2 & 0 & 0 & 0 & 0 & 0 & 0 \\ x_2^3 & 0 & 0 & 0 & 0 & 0 & 0 \\ x_1^4 & 0 & 0 & 0 & -8 & 0 & 0 \\ x_1^3 \ts x_2 & 0 & 0 & 0 & 0 & -4 & 0 \\ x_1^2 \ts x_2^2 & 0 & 0 & 0 & 0 & 0 & 0 \\ x_1 \ts x_2^3 & 0 & 0 & 0 & 0 & 0 & 0 \\ x_2^4 & 0 & 0 & 0 & 0 & 0 & 0 }. \end{equation*} We can see that $ b $ is recovered correctly by the columns two and three. Furthermore, for the entries of the matrix $ a $, we obtain \begin{alignat*}{2} a_{11}(x) &= (\mathcal{L}\psi_4)(x) - 2 \ts b_1(x) \ts x_1 &&= 0.49 + x_1^2, \\ a_{12}(x) &= (\mathcal{L}\psi_5)(x) - b_1(x) \ts x_2 - b_2(x) \ts x_1 &&= 0.5 \ts x_1, \\ a_{22}(x) &= (\mathcal{L}\psi_6)(x) - 2 \ts b_2(x) \ts x_2 &&= 0.25, \end{alignat*} which is indeed $ \sigma \sigma^\top $. Note that using only monomials of order up to three would allow us to recover $ b $ but not $ a $. \xqed{$\triangle$} \end{enumerate} \end{example} \begin{remark} It is worth noting that: \begin{enumerate}[wide, itemindent=\parindent, itemsep=0ex, topsep=0.5ex] \item Although we presented only systems composed of monomials (mainly for the sake of illustration), the proposed method allows for arbitrary dictionaries containing twice continuously differentiable functions. \item We identify $ a = \sigma \ts \sigma^\top $ and not $ \sigma $ itself. If it is necessary to evaluate $ \sigma $, e.g., when using the identified system to generate new trajectories, we can obtain it, for instance, by a Cholesky decomposition of $ a $, see also \cite{Zhang:2016aa}. Note, however, that $ \sigma $ is not uniquely defined. \item The method relies on accurate estimates of the drift and diffusion terms. Noisy data will lead to nonsparse solutions, which can then be improved by applying iterative hard thresholding again, see Remark~\ref{rem:thresholding}. We now add noise with variance $ \varsigma = 0.1 $ to the drift and diffusion terms. After sparsifying the estimated matrix approximation of the Koopman generator with a threshold $ \delta = 0.1 $, we obtain \begin{equation*} b(x) = \begin{bmatrix} 4.00057 \ts x_1 - 4.00012 \ts x_1^3 \\ -1.99998 \ts x_2 \\ \end{bmatrix} \end{equation*} and \begin{align*} a_{11}(x) &= 0.50035 + 0.99901 \ts x_1^2 - 0.00016 \ts x_1^4, \\ a_{12}(x) &= 0.49729 \ts x_1 - 0.00250 \ts x_1 \ts x_2 + 0.00097 \ts x_1^3 \ts x_2, \\ a_{22}(x) &= 0.25648 + 0.00720 \ts x_2^2. \end{align*} Note that the noise is picked up by the diffusion term which might thus be overestimated. Nevertheless, the coefficients are still close to the exact solution. Instead of eliminating small coefficients of $ (\mathcal{L}\psi_k)(x) $, we could apply iterative hard thresholding to the coefficients of $ a_{ij}(x) $ to find a parsimonious representation of $ a(x) $. \end{enumerate} \end{remark} This method to discover the drift and diffusion terms of stochastic differential equations suffers from the same shortcomings as SINDy: The validity of the learned model depends crucially on whether or not both $ b $ and $ a $ can be expressed in terms of the basis functions and also on the availability of accurate estimates of the derivatives. Ideally, the resulting model is parsimonious, minimizing model complexity while simultaneously enabling accurate predictions without overfitting. Nonsparse solutions typically indicate that the expressivity of the dictionary is not sufficient or that the data is too noisy. Adding more basis functions or increasing the size of the data set might alleviate such problems. However, positing that the model comprises only a few simple terms, the method presented here allows for the identification of the governing equations of stochastic dynamical systems. Additionally, the approximation of the generator is an important problem in itself. The eigenvalues and eigenfunctions contain information about time scales and metastable sets and can be used for model reduction and control. This will be described in more detail in Section~\ref{sec:Further applications}. \subsubsection{Conservation laws} If $E$ is a conserved quantity of a non-deterministic system, then the definition of the Koopman operator \eqref{eq:stochastic_koopman_op} and the partial differential equation $ \pd{u}{t} = \mathcal{L} u $ imply that $\mathcal{L} E = 0$, just as in the deterministic case. Hence, conserved quantities can also be approximated by extracting non-trivial eigenfunctions associated with $\lambda = 0$ using gEDMD. The same precautions as discussed in Section \ref{ssec:conservationdeterministic} apply. \begin{remark} For a stochastic dynamical system in the sense of Stratonovich, i.e., \begin{equation*} \mathrm{d}X_t = b(X_t) \ts \mathrm{d}t + \sigma(X_t) \circ \mathrm{d}W_t, \end{equation*} a sufficient condition for $E$ to be conserved is \begin{equation*} \nabla E^\top \left [ b + \sum_{i=1}^s \sigma_i \right] = 0, \end{equation*} which is similar to the deterministic case. Here, $\sigma_i$ denotes the $i$th column of $\sigma$. This result follows directly from the chain rule of Stratonovich calculus, see \cite{FaLe09, ZhZhHoSo16}. \end{remark} \begin{example} Consider the noisy Duffing oscillator, i.e., for $\alpha, \beta, \varepsilon \in \mathbb{R}$ we have a Stratonovich stochastic differential equation with \begin{equation*} b(x) = \begin{bmatrix} x_2 \\ -\alpha x_1 -\beta x_1^3 \end{bmatrix} \quad \text{and} \quad \sigma(x) = \varepsilon \ts b(x). \end{equation*} To apply gEDMD, we convert it to an It\^o stochastic differential equation using the drift correction formula to correct the noise-induced drift, which is defined componentwise as \begin{equation*} c_i(x) = \sum_{j=1}^d \sum_{k = 1}^s \frac{\partial \sigma_{ik}}{\partial x_j}(x) \ts \sigma_{jk}(x), \quad i = 1,\dotsc, d, \end{equation*} see \cite{St66}. We obtain the It\^o stochastic differential equation \begin{equation*} \mathrm{d}X_t = \big(b(X_t) + \tfrac{1}{2} \ts c(X_t)\big) \ts \mathrm{d}t + \sigma(X_t) \ts \mathrm{d}W_t \quad\text{with}\quad c(x) = \varepsilon^2 \begin{bmatrix} b_2(x) \\ \left(-\alpha -3\ts\beta x_1^2\right) b_1(x) \end{bmatrix}. \end{equation*} Setting $\alpha = -1.1$, $\beta = 1.1$, $\varepsilon = 0.05$, choosing a dictionary that contains monomials, and applying gEDMD, the multiplicity of the eigenvalue $\lambda = 0$ is two and we obtain a conserved quantity of the form \begin{equation*} E(x) \approx \tfrac{\alpha}{2} x_1^2 + \tfrac{\beta}{4} x_1^4 + \tfrac{1}{2}x_2^2 + c, \end{equation*} where $c \in \mathbb{R}$ is an arbitrary constant. \xqed{$\triangle$} \end{example} \subsection{Relationships with other methods} \label{ssec:Relationships with other methods} We will now point out similarities and differences between the methods presented above and other well-known approaches for systems identification and generator approximation. \subsubsection{SINDy} SINDy \cite{BrPrKu16} was designed to learn ordinary differential equations from simulation or measurement data. Just like gEDMD, it requires a set of states and the corresponding time derivatives. Defining $ \dot{X} = [\dot{x}_1, \dot{x}_2, \dots, \dot{x}_m] $, SINDy minimizes the cost function $ \norm{\smash{\dot{X} - M_{\scriptscriptstyle S} \Psi_X}}_F$, i.e., $ M_{\scriptscriptstyle S} = \dot{X} \Psi_X^+ $. Here, we omit the sparsification constraints, which can be added in the same way to gEDMD as described above. Recall that we assume that the full-state observable is given by $ g(x) = B^\top \psi(x) $. SINDy can thus be seen as a special case of gEDMD since \begin{equation*} \dot{x} = B^\top \dot{\psi}(x) \approx B^\top M \psi(x) = \underbrace{B^\top \dot{\Psi}_X}_{\dot{X}} \Psi_X^+ \psi(x) = \underbrace{\dot{X} \Psi_X^+}_{M_{\scriptscriptstyle S}} \psi(x) = M_{\scriptscriptstyle S} \ts \psi(x). \end{equation*} \subsubsection{Koopman lifting technique} The Koopman lifting technique \cite{MauGon16, MauGon17} uses the infinitesimal generator $ \mathcal{L} $ for system identification. While tailored mainly to ordinary differential equations, extensions to stochastic differential equations with isotropic noise are also considered. First, the Koopman operator for a fixed lag time $ \tau $ is estimated from trajectory data with the aid of standard EDMD. Then an approximation of the generator is obtained by taking the matrix logarithm, i.e., \begin{equation*} \widehat{L} = \tfrac{1}{\tau} \log \widehat{K}_\tau, \end{equation*} where $ \widehat{K}_\tau $ is the matrix representation of the Koopman operator with respect to the chosen basis $ \psi $ (and lag time $ \tau $). The last step is to estimate the governing equations in the same way as illustrated in Example~\ref{ex:systemidentification} for gEDMD. The Koopman lifting technique does not require the time-derivatives of the states or the partial derivatives of the basis functions, but only pairs of time-lagged data. However, the non-uniqueness of the matrix logarithm can cause problems and a sufficiently small sampling time $ \tau $ is needed to ensure that the (possibly complex) eigenvalues lie in the strip $ \left\{ z \in \mathbb{C} : \vert \Im(z) \vert < \pi \right\} $, where $ \Im $ denotes the imaginary part. Roughly speaking, only an infinite sampling rate allows us to capture the entire spectrum of frequencies \cite{MauGon17}. Our approach generalizes to arbitrary systems of the form \eqref{eq:SDE}, but the estimation of the diffusion term can be carried over to the lifting technique as well. This could be a valuable alternative, e.g., when only trajectory data is available. If the exact derivatives for the training data are known, then gEDMD is in general more accurate than the lifting approach. If, on the other hand, the derivatives for gEDMD have to be approximated from trajectory data, then the accuracy depends on the order of the finite-difference approximation and the step size, while the accuracy of the lifting approach depends on the lag time and the matrix logarithm implementation. \subsubsection{KRONIC} KRONIC \cite{Kaiser17, Kaiser18}, which stands for \emph{Koopman reduced order nonlinear identification and control}, is a data-driven method for discovering Koopman eigenfunctions, which are then used for control and the detection of conservation laws. The approach is based on SINDy and assumes that an eigenvalue is known a priori (or simultaneously learns the eigenvalue and corresponding eigenfunction). In our notation, the resulting problem can be written as \begin{equation*} \left( \lambda_\ell \Psi_X^\top - \dot{\Psi}_X^\top \right) \xi_\ell = 0, \end{equation*} which, multiplying from the left by $ \Psi_X $ and assuming that $ \Psi_X \Psi_X^\top $ is regular, becomes the gEDMD eigenvalue problem. This operator formulation is briefly mentioned in \cite{Kaiser17} as well. Thus, for deterministic systems, despite their different derivations, gEDMD and KRONIC are strongly related. \section{Further applications} \label{sec:Further applications} In addition to identifying fast and slow modes, governing equations, or conservation laws, the Koopman generator has further applications that we will briefly demonstrate. \subsection{Coarse-grained dynamics and gEDMD} \subsubsection{Galerkin approximation} \label{sec:cg_gedmd} In what follows, we describe how models of the Koopman generator can be used to identify reduced order models of a (possibly high-dimensional) stochastic dynamical system. To get started, we recapitulate the model reduction formalism introduced by \cite{Legoll:2010aa,Zhang:2016aa}. Assume the stochastic process given by \eqref{eq:SDE} possesses a unique invariant density $\mu$, and let $\xi \colon \R^d \to \R^p$ be a coarse-graining function which maps $\R^d$ to a lower-dimensional space $\R^p$. The coarse-graining map induces a reduced probability measure with density $\nu$ on $\R^p$. Consider the space $L^2_\nu$ of square-integrable functions of the reduced variables $z$. In fact, $L^2_\nu$ is an infinite-dimensional subspace of $L^2_\mu$, if each function $f \in L^2_\nu$ is identified with the function $f \circ \xi \in L^2_\mu$. Let $\mathcal{P}$ be the orthogonal projection onto $L^2_\nu$. Define a coarse-grained generator as \begin{equation} \label{eq:projected_generator} \mathcal{L}^\xi = \mathcal{P}\mathcal{L}\mathcal{P}. \end{equation} Given suitable assumptions on the original process \eqref{eq:SDE}, $\mathcal{L}^\xi$ is again the infinitesimal generator of a stochastic dynamics on $\mathbb{R}^p$, with invariant density $\nu$ and effective drift and diffusion coefficient $b^\xi,\, a^\xi$ \cite{Legoll:2010aa,Zhang:2016aa}. First, we show that for a basis set of functions defined only on $\mathbb{R}^p$, gEDMD converges to a Galerkin approximation of the coarse-grained generator $\mathcal{L}^\xi$: \begin{proposition} Let $\mathbb{V} = \mathrm{span}\{\psi_k \}_{k=1}^n$ be a subspace of $L^2_\nu$. Then gEDMD applied to the functions $\widetilde{\psi}_k = \psi_k \circ \xi$ converges to the Galerkin projection of $\mathcal{L}^\xi$ onto $\mathbb{V}$. Here, \eqref{eq:definition_dpsi_k} needs to be updated by \begin{align*} \mathrm{d}\widetilde{\psi}_k(x) &= b(x) \ts \nabla_x \ts \xi(x) \ts \nabla_z \psi_k^\top(\xi(x)) + \frac{1}{2}(a(x) : H^\xi(x)) \ts \nabla_z \psi_k^\top(\xi(x)) \\ & ~~+ \frac{1}{2 }\nabla^2_z \psi_k(\xi(x)) : \left[ \nabla \xi(x)^\top a(x) \nabla \xi(x)\right], \end{align*} where $\nabla_x \ts \xi \in \mathbb{R}^{d \times p}$ is the Jacobian of $\xi$, and $H^\xi \in \mathbb{R}^{d \times d \times p}$ is the tensor of Hessian matrices for each component of $\xi$. The Frobenius inner product between $a$ and $H^\xi$ is applied to the first two dimensions of $H^\xi$. \end{proposition} \begin{proof} The expression for $\mathrm{d}\widetilde{\psi}_k(x)$ follows from the chain rule. It was already shown in \cite{Zhang:2016aa} that \begin{equation*} \begin{split} \innerprod{\psi_i}{\psi_j}_\nu &= \innerprod{\psi_i\circ \xi}{\psi_j\circ \xi}_\mu, \\ \innerprod{\smash{\mathcal{L}^\xi \psi_i}}{\psi_j}_\nu &= \innerprod{\mathcal{L}(\psi_i\circ \xi)}{\psi_j\circ \xi}_\mu. \end{split} \end{equation*} Thus, Proposition \ref{prop:convergence_gedmd} implies that \begin{alignat*}{2} \widehat{A}_{ij} &\rightarrow \innerprod{\mathcal{L}\widetilde{\psi}_i}{\widetilde{\psi}_j}_\mu &&= \innerprod{\mathcal{L}^\xi \psi_i}{\psi_j}_\nu, \\ \widehat{G}_{ij} &\rightarrow \innerprod{\widetilde{\psi}_i}{\widetilde{\psi}_j}_\mu &&= \innerprod{\psi_i}{\psi_j}_\nu. \tag*{\qedhere} \end{alignat*} \end{proof} In summary, data of the original process, sampling the distribution $\mu$, can be used to learn a matrix representation of the coarse-grained generator \eqref{eq:projected_generator}. This matrix approximation can then be used to perform system identification, simulation, and control of the coarse-grained system the same way as described in Section \ref{sec:gEDMD_stochastic}. \subsubsection{Separate Identification} For a reversible stochastic differential equation~\eqref{eq:SDE}, we present an alternative approach to identify the parameters of the corresponding coarse-grained system. The method is related to spectral matching as introduced in \cite{NBC19}. The authors of~\cite{Zhang:2016aa} have shown that reversibility of the full process implies the dynamics generated by~\eqref{eq:projected_generator} are also reversible. Recalling that reversible dynamics are characterized by a scalar potential and the diffusion field, the basic idea is simply to estimate these two terms separately. The resulting framework, which we will call \textit{separate identification}, consists of four steps, which are only partially dependent on each other: \paragraph{Force Matching} The scalar potential $F^\xi$ of the coarse-grained dynamics can be estimated by an established technique called \textit{force matching} \cite{IZEKOV2005,NOID2008}. It is based on the fact that the gradient of $F^\xi$ solves the following minimization problem \cite{CLV2008}: \begin{align} \label{eq:force_matching_problem} \nabla_z F^\xi &= \mathrm{argmin}_{g\in (L^2_\nu)^p} \int_{\mathbb{R}^d} \| g(\xi(x)) - f^\xi_{lmf}(x)\|^2\,\mathrm{d}\mu(x), \\ \label{eq:definition_lmf} f^\xi_{lmf} &= -\nabla_x F \cdot G^\xi + \nabla_x \cdot G^\xi, \\ G^\xi &= \nabla_x \xi \left[(\nabla_x \xi)^T \nabla_x \xi\right]^{-1}, \end{align} where the minimization is over all square-integrable vector fields $g$ of the reduced variables~$z$, and the divergence is applied separately to each column of $G^\xi$ in (\ref{eq:definition_lmf}). The vector field $f^\xi_{lmf}$ is called \textit{local mean force}, while $F$ is the scalar potential of the full process. \paragraph{Application of gEDMD} The second step consists of applying gEDMD to estimate a finite-dimensional model of the coarse-grained generator $\mathcal{L}^\xi$ as described in Section \ref{sec:cg_gedmd}, using a basis of functions $\{\ts \psi_i \ts\}_{i=1}^n$ defined on the reduced space $\R^p$. In particular, we obtain an estimate of the Galerkin matrix \begin{align*} \widehat{A}_{ij} &= \innerprod{\mathcal{L}^\xi \psi_i}{\psi_j}_\nu. \end{align*} \paragraph{Learning the diffusion field} As already discussed in Remark \ref{rem:gedmd_reversible}, matrix elements of the reduced generator are given by \begin{equation} \label{eq:generator_matrix_reversible_2} \innerprod{\mathcal{L}^\xi \psi_i}{\psi_j}_\nu = -\frac{1}{2} \int \nabla_z \psi_i\, a^\xi \, \nabla_z \psi_j\,\mathrm{d}\nu. \end{equation} It follows that the effective diffusion can be learned by matching it to the generator matrix $\widehat{A}$ via \eqref{eq:generator_matrix_reversible_2}. Let $a^\xi(\theta)$ be a parametric model for the effective diffusion. Then the optimal set of parameters can be found by minimizing the Frobenius norm error \begin{align} \label{eq:minimization_problem_diffusion} E(\theta) &= \|\hat{A} - A(\theta) \|^2_F, \\ A(\theta)_{ij} &= -\frac{1}{2} \int \nabla_z \psi_i \, a^\xi(\theta) \, \nabla_z \psi_j\,\mathrm{d}\nu. \end{align} \paragraph{Determination of the drift} Using the relationship between drift and diffusion of a reversible system, inserting estimates for $F^\xi$ and $a^\xi$ into \eqref{eq:rev_drift_diffusion_potential} below completes the definition of the reduced model \begin{equation} \label{eq:rev_drift_diffusion_potential} b^\xi = -\frac{1}{2} a^\xi \ts \nabla F^\xi + \frac{1}{2} \nabla \cdot a^\xi. \end{equation} The above formulation seems advantageous compared to the direct system identification described in Section \ref{sec:non_deterministic_sys_id} for several reasons: \begin{itemize}[wide, itemindent=\parindent, itemsep=0ex, topsep=0.5ex] \item Separate basis sets can be used to calculate the Galerkin matrix, the potential, and the diffusion. Specifically, constraints on each of these (such as positive definiteness of the diffusion) can be incorporated into each basis individually. Moreover, learning of the potential and the diffusion can also be accomplished using nonlinear models. \item The coordinate functions $z_i$ and $z_i \ts z_j$, as well as the products of the coordinate functions with the effective drift, are no longer required to be contained in the basis set. \item Both force matching and \eqref{eq:minimization_problem_diffusion} are regression problems, allowing for the use of model validation techniques like cross-validation. \item The dynamics obtained by combining the learned potential and diffusion via \eqref{eq:rev_drift_diffusion_potential} are automatically reversible. \item By diagonalizing the generator matrix corresponding to $A(\theta)$ above, the spectrum of the learned dynamics can be calculated directly and compared to the spectrum of the generator matrix corresponding to $A$, providing a further means of model validation. \end{itemize} On the other hand, the direct system identification is more general since the reconstruction via the local mean force may fail to yield good approximations of the effective drift in cases where some parts of the dynamics orthogonal to the low-dimensional manifold defined by the reaction coordinate are slow. \subsubsection{Example 1: Lemon-slice potential} We consider overdamped Langevin dynamics (see Remark \ref{rem:overdamped_langevin}) at inverse temperature $\beta = 1$ in the following two-dimensional potential $V$, expressed in polar coordinates: \begin{equation*} V(r, \varphi) = \cos(k \ts \varphi) + \sec(0.5 \ts \varphi) + 10(r-1)^2 + \frac{1}{r}. \end{equation*} For $k = 4$, a contour of the potential is shown in Figure~\ref{fig:2d_lemon_slice}(a) below. Because of the two singular terms, the system's state space does not include the set $\{(x_1, x_2):\, x_1 \leq 0,\, x_2 = 0 \}$, enabling us to map the two-dimensional state space to polar coordinates unambiguously. The polar angle $\varphi$ is a suitable reaction coordinate, so we choose $\xi(x_1, x_2) = \varphi(x_1, x_2)$. Due to the simplicity of the system, all relevant quantities can be calculated analytically. Using the full-state partition function $Z$ and two numerical constants $C_1, C_2$, see \cite{Nueske2019}, the invariant distribution, the effective drift and the effective diffusion along $\varphi$ are given by \begin{align*} \nu(\varphi) &= \frac{C_2}{Z} \exp\left(-\left[\cos(k \ts \varphi) + \sec(0.5 \ts \varphi) \right]\right), \\ b^\varphi(\varphi) &= \frac{C_1}{C_2}\left[k\sin(k \ts \varphi) - 0.5 \tan(0.5 \ts \varphi)\sec(0.5 \ts \varphi)\right], \\ a^\varphi(\varphi) &= \frac{2 \ts C_1}{C_2}. \end{align*} We apply coarse-grained gEDMD with a basis set of Legendre polynomials up to degree~20, scaled to fit the domain $[-\pi,\pi]$. In this example and the next, we use exact expressions for the drift and diffusion coefficient, as the parameters of the full system are usually known in the context of model reduction. From the generator matrix, we obtain estimates of the effective drift and diffusion as described in Section \ref{sec:non_deterministic_sys_id}. Moreover, we also apply separate identification to learn the scalar potential and the diffusion. To this end, we use a basis set of periodic Gaussian functions centered at equidistant points between $\varphi = -2.8$ and $\varphi = 2.8$. The bandwidth of these Gaussians is determined by cross-validation, and is found to be $0.1$ for force matching and $2.0$ for the diffusion. We also enforce positivity of the diffusion by applying positivity constraints to the regression problem \eqref{eq:minimization_problem_diffusion}. We see in Figure~\ref{fig:2d_lemon_slice}(b) and \ref{fig:2d_lemon_slice}(c) that both methods provide accurate representations of the effective parameters. However, the diffusion estimated from \eqref{eq:minimization_problem_diffusion} is virtually indistinguishable from the analytical solution, while the representation obtained from the polynomial basis is more oscillatory. We also verify that gEDMD correctly captures the slow dynamics in this example. We diagonalize the generator matrix obtained from the polynomial basis, and compute the first three implied time scales by taking reciprocals of the first three nontrivial eigenvalues (leaving out the zero eigenvalue). We compare these time scales to those extracted from a Markov state model (MSM) \cite{Prinz2011} inferred directly from the data. We find in Figure~\ref{fig:2d_lemon_slice}(d) that the time scales are in very good agreement. As described above, we also use the generator matrix corresponding to the optimal $ A(\theta) $ to estimate the first three implied time scales, and find them to match almost perfectly as well. \begin{figure} \centering \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(a)} \vspace*{0.6ex} \includegraphics[width=0.87\textwidth]{pics/LS1} \end{minipage} \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(b)} \includegraphics[width=0.9\textwidth]{pics/LS2} \end{minipage} \\[0.5ex] \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(c)} \includegraphics[width=0.9\textwidth]{pics/LS3} \end{minipage} \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(d)} \includegraphics[width=0.9\textwidth]{pics/LS4} \end{minipage} \caption{Application of gEDMD with 21 Legendre polynomials to one-dimensional coarse-graining of the two-dimensional lemon-slice potential. (a) Visualization of the potential. (b)~Estimates of the effective drift along the polar angle $\varphi$ obtained directly from the generator matrix (blue), and by combining the solutions of \eqref{eq:minimization_problem_diffusion} and \eqref{eq:force_matching_problem} via \eqref{eq:rev_drift_diffusion_potential} (red). The analytical reference is shown in yellow. (c) Estimates of the effective diffusion along the polar angle $ \varphi $ obtained directly from the generator matrix (blue), and by learning the diffusion via \eqref{eq:minimization_problem_diffusion} using a Gaussian basis set (red), compared to the analytical reference in yellow. (d)~Estimates of the three slowest implied time scales using a Markov state model (yellow), diagonalization of the generator matrix (blue), and diagonalization of the generator matrix corresponding to the optimal diffusion (red).} \label{fig:2d_lemon_slice} \end{figure} \subsubsection{Example 2: Alanine dipeptide} As a more complex example, we derive a coarse-grained model from molecular dynamics simulations of alanine dipeptide, which has been used as a test case in numerous previous studies. The data set is the same as in reference \cite{Wang2019} and comprises one million snapshots of Langevin dynamics saved every $1\,\mathrm{ps}$. As is well-known, the positional component of Langevin dynamics behaves approximately like an overdamped process, see Remark \ref{rem:overdamped_langevin}, up to a re-scaling of time. Hence, we apply gEDMD assuming the original process is overdamped, and we extract this effective unit of time by comparing the first two implied time scales obtained from gEDMD and from a reference Markov state model. The slowest dynamics of alanine dipeptide are captured by a single internal molecular coordinate, called $\phi$-dihedral angle, which we choose to be the coarse-graining coordinate. Figure \ref{fig:ala2}(a) shows the empirical coarse-grained energy $F^\phi$, and an approximation obtained by applying force matching. The basis set for force matching consists of 57 periodic Gaussians of bandwidth 1.2, centered at equidistant points between -2.8 and 2.8. The slowest dynamical process corresponds to the transition across the highest barrier in this energy landscape. We apply gEDMD with the first 26 Legendre polynomials scaled to fit the domain $[-2.7, 2.7]$. From the generator matrix, we extract the effective drift and diffusion, which are depicted by blue lines in Figures \ref{fig:ala2}(b) and \ref{fig:ala2}(c). As a comparison, we also compute an estimate of the effective diffusion by minimization of \eqref{eq:minimization_problem_diffusion}, including positivity constraints, with a set of 29 Gaussians of bandwidth 0.8, where the optimal bandwidth was determined by cross-validation. The resulting estimate of the diffusion is far less oscillatory than the direct estimate using the generator matrix, while the corresponding drift obtained from~\eqref{eq:rev_drift_diffusion_potential} is similar to the direct estimate. Finally, we verify that gEDMD accurately reproduces the spectral properties of the original dynamics. As we can see in Figure \ref{fig:ala2}(d), after re-scaling the first two time scales provided by gEDMD by the effective time unit described above, they agree well with the results of an MSM analysis. The same is true for the time scales calculated based on the generator matrix corresponding to the optimal diffusion obtained by solving \eqref{eq:minimization_problem_diffusion}. \begin{figure}[htb] \centering \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(a)} \includegraphics[width=0.9\textwidth]{pics/AD1} \end{minipage} \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(b)} \includegraphics[width=0.9\textwidth]{pics/AD2} \end{minipage} \\[0.5ex] \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(c)} \includegraphics[width=0.9\textwidth]{pics/AD3} \end{minipage} \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(d)} \vspace*{0.5ex} \includegraphics[width=0.9\textwidth]{pics/AD4} \end{minipage} \caption{Coarse-grained gEDMD along the $\phi$-angle coordinate of alanine dipeptide, using a basis set of 26 Legendre polynomials (a) Effective energy $F^\phi$, as estimated by histogramming the molecular dynamics simulation data (black), and by applying force matching with a Gaussian basis set (blue). (b)~Estimates of the effective drift obtained directly from the generator matrix (blue), and by combining the solutions of \eqref{eq:minimization_problem_diffusion} and \eqref{eq:force_matching_problem} via \eqref{eq:rev_drift_diffusion_potential} (red). (c)~Estimates of the effective diffusion obtained directly from the generator matrix (blue), and by learning the diffusion via \eqref{eq:minimization_problem_diffusion} using a Gaussian basis set (red). (d)~Estimates of the two slowest implied time scales using a Markov state model (yellow), diagonalization of the generator matrix (blue), and diagonalization of the generator matrix corresponding to the optimal diffusion (red).} \label{fig:ala2} \end{figure} \subsection{Control} \label{subsec:Control} The predictive capabilities of the Koopman operator have also raised interest in the control community, where the aim is to determine a system input $u$ such that the non-autonomous control system $\dot{x} = b(x,u)$ behaves in a desired way, which results in the following control problem: \begin{equation} \label{eq:OCP} \begin{aligned} \min_{u \in L^2([t_0,t_e], \R)} J(x,u) &= \min_{u \in L^2([t_0,t_e], \R)} \int_{t_0}^{t_e} \big\| x(t) - x^{\mathsf{ref}}(t) \big\|_2^2 + \alpha \|u(t)\|_2^2\ \textrm{d}t \\ \mbox{s.t.}\qquad\qquad \dot{x}(t) &= b(x(t),u(t)), \\ x(t_0) &= x_0. \end{aligned} \end{equation} In this formulation, the goal is to track a desired state over the control horizon $[t_0, t_e]$, and $\alpha \in \R^{>0}$ is a small number penalizing the control cost. In order to achieve a feedback behavior, problem \eqref{eq:OCP} is embedded into a model predictive control (MPC) \cite{GP17} scheme, where it has to be solved repeatedly over a relatively short horizon while the system (the plant) is running at the same time. The first part $[t_0, t_0 + h]$ of the optimal control $u$ is then applied to the plant, and \eqref{eq:OCP} has to be solved again on a shifted horizon $[t_0 + h, t_e + h]$. Since the real-time requirements in MPC are often very hard to satisfy, a promising approach is to replace the system dynamics by a surrogate model, and one possibility is to use the Koopman operator or its generator for prediction. Introducing the variable $z=\psi(f(x))$, we obtain a linear system via the approximation $\mathbf{L}$ of the generator: \begin{equation*} \dot{z}(t) \approx \mathbf{L} z(t). \end{equation*} However, as we see above, the Koopman operator is only defined for autonomous systems. Hence, a transformation has to be used (the exception being control-affine systems, where only the autonomous part needs to be modeled). In \cite{PBK15}, the control system was autonomized by introducing an augmented state $\widehat{x} = (x,u)^\top$, and DMD was performed on the augmented system. The same approach was also used in combination with MPC in \cite{KM18a}. This state augmentation significantly increases the data requirements (all combinations of states and control inputs should be covered), such that an alternative transformation was proposed in \cite{PK19,PK18} by restricting $u(t)$ to a finite set of inputs $\{u^1, \ldots, u^{n_c}\}$. This way, the control system can be replaced by a finite set of autonomous systems $b_{u^i}(x) = b(x,u^i)$ for which the corresponding generators $\{L_{u^1},\ldots,L_{u^{n_c}}\}$ can be approximated. The control task is thus to determine the optimal right-hand side in each time step instead of computing a continuous input $u$: \begin{equation}\label{eq:OCP_Gen} \begin{aligned} \min_{u \in L^2([t_0,t_e], \{u^1, \ldots, u^{n_c}\})} &\int_{t_0}^{t_e} \big\|z(t) - z^{\mathsf{ref}}(t) \big\|_2^2 + \alpha \|u(t)\|_2^2\ \textrm{d}t \\ \mbox{s.t.}\qquad\qquad \dot{z}(t) &= \mathbf{L}_{u(t)} z(t), \\ z(t_0) &= \psi(f(x_0)). \end{aligned} \end{equation} Note that the quantization (i.e., the switching control) is encoded in the function space the control $u$ lives in. For a more detailed description, the reader is referred to \cite{PK19}. Regardless of the approach, a drawback of Koopman operator based surrogate models is that the control freedom is limited by the finite lag time. While larger lag times are often beneficial for the approximation of the dynamics, this is counterproductive for control, as the control frequency is strongly limited. This issue is overcome by the generator approach~\eqref{eq:OCP_Gen} since we can choose arbitrary time steps here, and results on mixed integer optimal control problems (see, e.g., \cite{SBD12}) suggest that fast switches allow for solutions of any desired accuracy. Moreover, the continuous-time generator model is much better suited for switching time optimization approaches. Therein, the combinatorial problem of selecting the optimal right-hand side is replaced by a continuous optimization problem for the time instances $\tau_j$ at which the right-hand side is switched from the input $u^i$ to $u^{i+1}$: \begin{equation}\label{eq:STO_Gen} \begin{aligned} \min_{\tau \in \R^p} &\int_{t_0}^{t_e} \big\|z(t) - z^{\mathsf{ref}}(t) \big\|_2^2 + \alpha \|u(t)\|_2^2\ \textrm{d}t \\ \mbox{s.t.}\qquad\qquad \dot{z}(t) &= \mathbf{L}_{u^i} z(t), \qquad \mbox{for}~t\in[\tau_{j-1}, \tau_{j}), \\ t_0 &= \tau_0 \leq \tau_1 \leq \ldots \leq \tau_p \leq t_e, \\ i &= 1 + j~\mbox{mod}~n_c, \\ z(t_0) &= \psi(f(x_0)). \end{aligned} \end{equation} By fixing the number $p$ of switches, this reformulation of \eqref{eq:OCP_Gen} is now a continuous, finite-dimensional optimization problem for the switching times with a given switching sequence (cf.~\cite{EWD03} for details), and both open and closed-loop control schemes (using MPC in the latter case) can be constructed. Problem~\eqref{eq:STO_Gen} was also used in combination with the Koopman operator in \cite{PK19}, but the discrete-time system prohibits arbitrary switching points which results in a reduced performance. Using the generator solves this problem and additionally, there even exist efficient second-order methods for this problem class \cite{SOBG17}. In what follows, we present examples for the two extensions for MPC based on the Koopman generator. For the deterministic case, we use the 1D viscous Burgers equation with varying lag times in an MPC framework (Problem~\eqref{eq:OCP_Gen}) and for the non-deterministic case, we control the expected value of an Ornstein--Uhlenbeck process using both MPC (Problem~\eqref{eq:OCP_Gen}) and open loop switching time control (Problem~\eqref{eq:STO_Gen}). \subsubsection{Partial differential equations} \begin{figure} \centering \begin{minipage}{0.49\textwidth} \centering \subfiguretitle{(a)} \includegraphics[width=0.85\textwidth]{pics/BurgersChi} \end{minipage} \begin{minipage}{0.49\textwidth} \centering \subfiguretitle{(b)} \includegraphics[width=0.9\textwidth]{pics/BurgersY} \end{minipage} \\[1ex] \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(c)} \includegraphics[width=\textwidth]{pics/BurgersU} \end{minipage} \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(d)} \includegraphics[width=0.85\textwidth]{pics/BurgersJ} \end{minipage} \caption{Control of the Burgers equation using the Koopman generator and switching control. (a) The shape function used for the distributed control term. (b) The optimal state (colored) and the reference trajectories (black) for $h = 0.05$. (c) The optimal switching sequence as a function of the time step $h$. (d) The tracking error as a function of the time step $h$. } \label{fig:Burgers_control} \end{figure} Consider the 1D Burgers equation with distributed control \begin{align*} \dot{y}(t,x) - \nu \Delta y(t,x) + y(t,x) \nabla y(t,x) &= u(t) \chi(x). \end{align*} Here, $y$ denotes the state depending on space $x$ and time $t$, and the system is controlled by a shape function $\chi$ (see Figure~\ref{fig:Burgers_control} (a)) that can be scaled by the input $u\in\{-0.025, 0.075\}$. The objective is to track a sinusoidal reference trajectory (shown in black in (b)), and we do this by solving problem \eqref{eq:OCP_Gen} in an MPC framework. To this end, we approximate the Koopman generator using a relatively coarse ``full state observable'' (a grid of 25 equidistantly distributed points in space) and monomials up to order two. The data is collected from one trajectory with a piecewise constant input signal $u(t) \in \{ -0.025, 0.075\}$. It is then divided into two data sets corresponding to the constant inputs $0.025$ and $-0.075$, respectively. The time derivative $\dot{y}$ is computed via finite differences. We see in (c) and (d) that with decreasing time steps $h$ (over which the input $u$ is constant) that the control performance increases significantly. While the time step $h=0.5$ corresponds to a solution that can be obtained by a Koopman operator approximation as well, the generator framework allows us to decrease the time steps and thereby the error by two orders of magnitude. Note that we can formally also decrease the lag time for the Koopman operator to increase the performance. In our experiments, the results were of comparable quality, and this is likely due to the high robustness of the MPC algorithm, which can cope well with small model inaccuracies. However, an advantage of the generator approach is that we can choose the time step adaptively---in contrast to the Koopman operator approach, where a change in the lag time requires a different data set and new computations. This can be beneficial in terms of computational efficiency and is thus particularly important for long control horizons (see, e.g., \cite{KWBS12}), due to which real-time capability may otherwise be jeopardized. \subsubsection{Stochastic differential equations} In the case of non-deterministic systems, the generator approach allows for a very elegant solution of \emph{stochastic control problems}. In stochastic (or \emph{robust}) control (see \cite{BM07,Mes16} for introductions), the goal is very often to steer the expected value to some desired value. In many situations, determining this expected value (e.g., via Monte Carlo methods) is numerically challenging. As the Koopman generator for stochastic systems describes the evolution of the expected value, see~\eqref{eq:stochastic_koopman_op}, problem \eqref{eq:OCP_Gen} can be used to solve a control problem for the expected value using a deterministic linear system. To this end, we replace the computation of the initial value by an average over the recent past: \[z_0 = \frac{1}{h} \int_{t_0-h}^{t_0} z(t) \ts \textrm{d}t.\] We again consider the Ornstein--Uhlenbeck process from Example~\ref{ex:Ornstein Uhlenbeck}, with the only difference that we now add a control input: \begin{equation*} \mathrm{d}X_t = -\alpha \ts (X_t - u) \ts \mathrm{d}t + \sqrt{2 \beta^{-1}} \ts \mathrm{d}W_t, \end{equation*} with $\alpha = 1$ and $\beta = 2$. We compute two generator approximations corresponding to $u=-5$ and $u=5$ using monomials up to order 12. Figure~\ref{fig:OU_control}(a) shows the trajectories of the two systems and the predictions using the corresponding generators, and we see that the expected values are accurately predicted. We set $h = 0.05$ as a discretization for the control $u$ as well as the length of the input that is applied to the plant in each loop. The MPC controller based on~\eqref{eq:OCP_Gen} with the modified initial condition $z_0$ yields very good performance, as is shown for a tracking problem with a piecewise constant reference value in Figure~\ref{fig:OU_control}(b). The corresponding optimal control is shown in Figure~\ref{fig:OU_control}(c), and Figure~\ref{fig:OU_control}(d) shows that continuously varying inputs can be approximated equally well. Finally, we use the switching time reformulation \eqref{eq:STO_Gen} in an open loop fashion in order to track a $\tanh$ profile over 20 seconds. The results are shown in Figures~\ref{fig:OU_control}(e) and \ref{fig:OU_control}(f), where the optimal input with $p = 200$ switches is shown in (e) and the corresponding dynamics are shown in (f). We observe a remarkable performance, as the optimal trajectory of the generator model and the expected value of the controlled Ornstein--Uhlenbeck process (computed as the mean over 1000 simulations) are almost indistinguishable. To summarize, the generator approach yields highly efficient control schemes both for open and closed-loop control, as the linear system for the prediction of the expected value requires no further sampling of multiple noisy trajectories. \begin{figure}[h!] \centering \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(a)} \vspace*{0.5ex} \includegraphics[width=0.9\textwidth]{pics/OUc_Trajectories} \end{minipage} \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(b)} \includegraphics[width=0.9\textwidth]{pics/OUc_xOpt_step} \end{minipage} \\[1ex] \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(c)} \vspace*{0.3ex} \includegraphics[width=0.9\textwidth]{pics/OUc_uOpt_step} \end{minipage} \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(d)} \vspace*{0.5ex} \includegraphics[width=0.9\textwidth]{pics/OUc_xOpt_sine} \end{minipage} \\[1ex] \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(e)} \vspace*{0.3ex} \includegraphics[width=0.9\textwidth]{pics/OUc_uOpt_STO} \end{minipage} \begin{minipage}[t]{0.49\textwidth} \centering \subfiguretitle{(f)} \vspace*{0.5ex} \includegraphics[width=0.9\textwidth]{pics/OUc_xOpt_STO} \end{minipage} \caption{Control of the expected value of the Ornstein--Uhlenbeck process. (a) Simulation and generator prediction for $u=5$ and $u=-5$, respectively. (b) Tracking of a piecewise constant reference trajectory using MPC based on Problem~\eqref{eq:OCP_Gen}. (c) The corresponding optimal input signal. (d) MPC based tracking of a continuous reference trajectory. (e)~Solution of Problem \eqref{eq:STO_Gen} with $p=200$ for the reference trajectory $x_{ref} = \mbox{tanh}(t-10)$, see (f). (f) The corresponding optimal trajectories of the generator model ($z$, blue line), of three realizations of the Ornstein--Uhlenbeck process ($x_1$ to $x_3$, dotted lines), and of the expected value of the controlled process ($E(x)$, dashed orange line).} \label{fig:OU_control} \end{figure} \section{Conclusion} \label{sec:Conclusion} We presented an extension of standard EDMD to approximate the generator of the Koopman or Perron--Frobenius operator from data and highlighted several important applications pertaining to model reduction, system identification, and control. We illustrated that this approach can be used to obtain a decomposition into eigenvalues, eigenfunctions, and modes and, furthermore, that SINDy emerges as a special case. The proposed methods were implemented in Python, the gEDMD code and some of the above examples are available at \url{https://github.com/sklus/d3s/}. Open questions include the convergence of gEDMD if not only the number of data points but also the number of basis functions tends to infinity. It is also unclear which part of the spectrum is approximated if the generator does not possess a pure point spectrum. Furthermore, is it possible to learn coarse-grained dynamics by only considering the dominant terms of the decomposition of the system's equations into eigenvalues, eigenfunctions, and modes (cf.\ Example~\ref{ex:systemidentification} and also \cite{NBC19})? Another interesting application of gEDMD would be to compute committor functions or hitting times. Extensions to non-autonomous systems will be considered in future work. \section*{Acknowledgements} S.~K., J.~N., and C.~S were funded by Deutsche Forschungsgemeinschaft (DFG) through grant CRC 1114 (Scaling Cascades in Complex Systems, project ID: 235221301) and through Germany's Excellence Strategy (MATH\texttt{+}: The Berlin Mathematics Research Center, EXC-2046/1, project ID: 390685689). F.~N.\ was partially funded by the Rice University Academy of Fellows. F.~N.\ and C.~C.\ were supported by the National Science Foundation (CHE-1265929, CHE-1738990, CHE-1900374, PHY-1427654) and the Welch Foundation (C-1570). C.~C.\ also acknowledges funding from the Einstein Foundation Berlin. S.~P.\ acknowledges support by the DFG Priority Programme 1962. {\small{}\bibliographystyle{unsrturl}
\section{Introduction} The maximum average degree (abbreviated as $\mathrm{mad}$) of a graph is a heavily studied notion. Multiple results show that a lower or upper bound on $\mathrm{mad}$ implies an existence of a particular partition of vertices of $G$, e.g., \cite{Borodin2011, Chen, Dross, Kopreski}. Another class of results consider edge partitions, including \cite{Planar10, Planar9, Planar11}. In these directions, particular attention has been paid to planar graphs, where, due to the inequality $(\mathrm{mad}(G)-2)(g(G)-2) < 4$, an upper bound on $\mathrm{mad}$ can be inferred from a lower bound on the girth. A graph parameter $f(G)$ will be called \emph{partitionable} if for every undirected simple graph $G$ and positive real numbers $a$ and $b$ such that $f(G) < a+b$, the vertex set $V(G)$ can be partitioned into $A$ and $B$ so that $f(G[A]) < a$ and $f(G[B]) < b$. It is quite simple to prove that degeneracy, maximum degree and minimum degree are all partitionable parameters. However it is an open problem whether $\mathrm{mad}$ is partitionable. Such result would agree exactly with or even improve many existing results, for example mentioned in~\cite{Dross, Kopreski}. We answer this question positively for cases $a=1$ and $a=2$. It is a consequence of a following theorem which is the main result of this paper. \begin{theorem} \label{mainres} For every undirected simple graph $G$ and a positive integer $k$ such that $\mathrm{mad}(G) \geq k$ there exists $S \subseteq V(G)$ such that $G[S]$ is $(k-1)$-degenerate and $\mathrm{mad}(G - S) \le \mathrm{mad}(G) - k$. Moreover such $S$ can be computed in polynomial time. \end{theorem} Up to our knowledge this is the first theorem of a kind where we are given a graph with bounded value of its $\mathrm{mad}$ where we partition its vertex set into some parts so that their values of $\mathrm{mad}$ are smaller, however they need not be bounded by absolute constant. This is opposed to all results where every resulting part induces a forest or is an independent set or has maximum degree $1$, etc. Our results can be applied as a tool for directly deriving many results for some specific sparse graph classes, for example planar graphs with constraints on girth. It seems that our results do not show as much expressive power as it is possible to get on such restrictive graph classes (where arguments specifically adjusted to the researched restricted graph classes can be used), which is a price for deriving them from a more general theorem. However, our results can be seen as a nice way of unifying these results and there are cases where using our results improves the state of the art. Our results imply a positive answer for the open problem presented in \cite{EDU} (problem 2 from final remarks) what in turn implies sub-exponential bound on the diameter of reconfiguration graphs of colourings for graphs with any bounded maximum average degree. The rest of the paper is organized as follows. In Section \ref{Prelims}, we introduce a few useful notions. In Section \ref{main}, we state our main result and provide its proof. In Section \ref{conclusions}, we present some direct consequences of our results and conclude this paper. \section{Preliminaries} \label{Prelims} Theorems proved in this paper will be about simple undirected graphs, however multiple directed graphs will show up throughout the proofs. Undirected edge between vertices $u$ and $v$ will be denoted as $uv$. Directed edge from $u$ to $v$ will be denoted as $\overrightarrow{uv}$. If $G$ is a graph and $A$ is a subset of its vertices then by $G[A]$ we denote subgraph of $G$ induced on vertices of $A$. Length of the shortest cycle in a graph $G$ is called girth and will be denoted as $g(G)$. If $G$ is a forest we set that $g(G) = \infty$. $\Delta(G)$ denotes maximum degree of a vertex. The maximum average degree of a given graph $G$ is defined as follows: $$\mathrm{mad}(G) := \max_{H \subseteq G, H \neq \emptyset} \frac{2|E(H)|}{|V(H)|}.$$ We assume that $\mathrm{mad}$ of a graph with an empty vertex set is $-\infty$. We say that undirected graph $G$ is $k$-degenerate if each of its subgraphs contains a vertex of degree at most~$k$. Degeneracy of a graph is the smallest value of $k$ such that this graph is $k$-degenerate. Let us note that class of $0$-degenerate graphs is exactly the same class of graphs as graphs with ${\mathrm{mad}(G) < 1}$, because both are just edgeless graphs. Moreover class of $1$-degenerate graphs is exactly the same class of graphs as graphs with $\mathrm{mad}(G) < 2$, because both are just forests. \section{Proof of Theorem \ref{mainres}} \label{main} In order to prove Theorem \ref{mainres} we are going to investigate flow network that allows to determine value of $\mathrm{mad}$ in polynomial time. Example of such network can be found in \cite{FlowNetwork}, however we are going to use one adjusted to our own use. \begin{figure}[b] \centering \begin{minipage}{.2\textwidth} \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=1.6cm, thick,main node/.style={circle,draw,minimum size=0.6cm,inner sep=0pt]}] \node[main node] (1) {$x$}; \node[main node] (2) [right of=1] {$z$}; \node[main node] (3) [below right of=1] {$y$}; \node[main node] (4) [below of=3] {$u$}; \path[-] (1) edge node {} (2) (1) edge node {} (3) (2) edge node {} (3) (3) edge node {} (4); \end{tikzpicture} \end{minipage} \begin{minipage}{.35\textwidth} \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=1.6cm, thick,main node/.style={circle,draw,minimum size=0.6cm,inner sep=0pt]}] \node[main node] (1) {$s$}; \node[main node] (3) [below of=1] {$v_{xz}$}; \node[main node] (2) [left of=3] {$v_{xy}$}; \node[main node] (4) [right of=3] {$v_{yz}$}; \node[main node] (5) [right of=4] {$v_{yu}$}; \node[main node] (6) [below of=2] {$x$}; \node[main node] (7) [below of=3] {$y$}; \node[main node] (8) [below of=4] {$z$}; \node[main node] (9) [below of=5] {$u$}; \node[main node] (10) [below of=7] {$t$}; \path[->] (1) edge [left] node {$1$} (2) (1) edge [left] node {$1$} (3) (1) edge [right] node {$1$} (4) (1) edge [right] node {$1$} (5) (2) edge [left] node {$\infty$} (6) (2) edge [above, near start] node {$\infty$} (7) (3) edge [above, near start] node {$\infty$} (6) (3) edge [above, near start] node {$\infty$} (8) (4) edge [above, near start] node {$\infty$} (7) (4) edge [near end] node {$\infty$} (8) (5) edge [above, near start] node {$\infty$} (7) (5) edge [right] node {$\infty$} (9) (6) edge [left] node {$c$} (10) (7) edge [left] node {$c$} (10) (8) edge [right] node {$c$} (10) (9) edge [right] node {$c$} (10); \end{tikzpicture} \end{minipage} \centering \caption{Example of graph $G$ and flow network $F(G,c)$ corresponding to it.} \label{network} \end{figure} Let us define a flow network $F(G,c)$ for given undirected graph $G$ and any nonnegative real number $c$. The network will consist of one node for each $v \in V(G)$, one node for each $e \in E(G)$ denoted as $v_e$ and two special nodes $s$ and $t$, respectively source and sink. There will be three layers of directed edges in $F(G,c)$: \begin{itemize} \item The first layer -- Edges of capacity one from $s$ to each node $v_e$. \item The second layer -- Edges of infinite capacity from each $v_e$ where $e=uw \in E(G)$ to $u$ and to $w$. \item The third layer -- Edges of capacity $c$ from each $v \in V(G)$ to $t$. \end{itemize} \begin{lemma}\label{flow} For any graph $G$ and any real number $c$, maximum flow between $s$ and $t$ in $F(G,c)$ is equal to $|E(G)|$ if and only if $2c \ge \mathrm{mad}(G)$. \end{lemma} \begin{proof} By max-flow min-cut theorem we know that maximum flow in a graph $G$ is equal to the minimum cut, so we are going to investigate structure of $s-t$ cuts in this graph. We refer to cuts as sets of edges. Since edges in second layer have infinite capacity they surely do not belong to any minimum cut. If no edge from third layer belongs to the cut then all edges from first layer must belong to it and this is a cut of weight $|E(G)|$, so if maximum flow is smaller than $|E(G)|$ then there exists a minimum cut with some edges in third layer. Let us fix some minimal cut $C \subseteq E(F(G, c))$ and let us assume that $ W \subseteq V(G)$ is a nonempty subset of all vertices of $V(G)$ such that edges $\overrightarrow{wt}$ for all $w \in W$ belong to $C$. Let $H = G[W]$. If $e \not\in E(H)$ then $\overrightarrow{sv_e}$ has to belong to $C$. Observe that all mentioned edges, that is $\overrightarrow{wt}$ for $w \in W$ and $\overrightarrow{sv_e}$ for $e \not\in E(H)$ already form an $s-t$ cut. Its weight is $c|V(H)| + |E(G)| - |E(H)|$. If this value is less than $|E(G)|$ then we know that maximum flow in this graph is less than $|E(G)|$. However if for any $H$ this value is not smaller than $|E(G)|$ then we know that maxflow in this graph is $|E(G)|$. We get that maxflow in this graph is smaller than $|E(G)|$ if and only if there exists $H \subseteq G$ such that $c|V(H)| + |E(G)| - |E(H)| < |E(G)| \Leftrightarrow c|V(H)| < |E(H)| \Leftrightarrow c < \frac{|E(H)|}{|V(H)|}$. Maximum value of $\frac{|E(H)|}{|V(H)|}$ equals $\frac{\mathrm{mad}(G)}{2}$, so we get that maxflow in $F(G, c)$ is equal to $|E(G)|$ is and only if $c \ge \frac{\mathrm{mad}(G)}{2}$, as desired. \end{proof} Let us note that by using Lemma \ref{flow}, observing that $\mathrm{mad}(G) = \frac{a}{b}$ for some $a, b \in \mathbb{Z}$ and $a \le n^2, b \le n$ and knowing that we can compute maximum flow in polynomial time, we can conclude that $\mathrm{mad}(G)$ can be computed in polynomial time. Let us fix any graph $G$ and denote $F := F(G,\frac{\mathrm{mad}(G)}{2})$. Let us define a directed graph $G_f$ for a given $s-t$ flow $f$ in $F$ of capacity $|E(G)|$ by directing some of edges from $G$ and discarding the rest. Flow $f$ routes one unit of flow through each $v_{uw}$. Node $v_{uw}$ has two outgoing edges to $u$ and to $w$. If $f$ sends more than $\frac{1}{2}$ unit of flow to $w$ then in $G_f$ we put directed edge $\overrightarrow{uw}$, similarly if $f$ sends more than $\frac{1}{2}$ unit of flow to $u$ we put edge $\overrightarrow{wu}$. Otherwise if $f$ sends exactly $\frac{1}{2}$ unit to both $u$ and $w$ we simply discard this edge. \begin{lemma}\label{acyclic} There exists flow $f$ of capacity $|E(G)|$ in $F$ such that $G_f$ is acyclic. Moreover, it can be determined in polynomial time. \end{lemma} \begin{proof} From Lemma \ref{flow} we know that there exists at least one flow $f$ between $s$ and $t$ of capacity $|E(G)|$. Let us take $f$ such that number of edges in $G_f$ is as small as possible. Suppose there is a cycle in $G_f$ on vertices $c_1, c_2, \ldots, c_k$ respectively. Denote $c_{k+1} := c_1$ as we are dealing with a cycle. Let $x$ be minimum of amounts of flow that $f$ sends through some edge $\overrightarrow{v_{u_iu_{i+1}}u_{i+1}}$ for some valid $i$. From definition of $G_f$ we deduce that $x > \frac{1}{2}$. Let us define $f'$ by decreasing flow $f$ on edges $\overrightarrow{v_{u_iu_{i+1}}u_{i+1}}$ and increasing it on edges $\overrightarrow{v_{u_iu_{i+1}}u_{i}}$ by $x - \frac{1}{2}$. Amount of flow leaving and entering each vertex remains unchanged hence $f'$ still restricts capacities. Flow $f'$ for at least one vertex $v_{u_iu_{i+1}}$ sends exactly $\frac{1}{2}$ unit of flow through both edges outgoing from it, so at least one edge on the cycle is no longer present in $G_{f'}$ and edges outside the cycle remain unchanged when compared to $G_f$. It contradicts the assumption that $G_f$ has the smallest possible number of edges what concludes proof of existence of such $f$. In~order to compute such $f$ in polynomial time let us take any $f$ of capacity $|E(G)|$ in $F$ (let us remind that we can determine value of $\mathrm{mad}(G)$ in the polynomial time which is used in construction of $F$). If $G_f$ contains some cycle we can detect this cycle, determine the value of $x$ and adjust values of units that flow sends through mentioned edges accordingly. Number of edges in $G_{f'}$ is strictly smaller than in $G_f$, so we will not do this more than $|E(G)|$ times, what gives us algorithm performing a polynomial number of operations. In~order to omit dealing with rational numbers we can multiply all capacities in $F$ by $2b$, where $\mathrm{mad}(G) = \frac{a}{b}$ for some coprime integers $a, b$. That concludes description of polynomial algorithm determining the desired~$f$. \end{proof} Let us fix $f$ from the above lemma. We will present an algorithm in which: \begin{itemize} \item the routine $NoInEdges(H_f)$ returns any vertex from directed acyclic graph $H_f$ which has no incoming edges (as the graph is acyclic there always exists at least one such vertex) \item the routine $KNeighborhood(H, S, k)$ given graph $H$, subset of its vertices $S$ and integer $k$ returns set of all vertices from $H$ outside of $S$ adjacent to at least $k$ vertices from $S$. \end{itemize} \begin{algorithm} \begin{algorithmic} \caption{} \label{alg} \Function {Solve} {$H, H_f, k$} \State $S \gets \emptyset$ \While {$H_f \neq \emptyset$} \State $x \gets NoInEdges(H_f)$ \State $S \gets S \cup \{ x \}$ \State $H_f \gets H_f - \{ x \} - KNeighborhood(H, S, k)$ \EndWhile \EndFunction \Return $S$ \end{algorithmic} \end{algorithm} \begin{theorem} \label{algo} Function $Solve(G, G_f, k)$ returns $(k - 1)$-degenerate set $S$ such that $\mathrm{mad}(G-S) \le {\mathrm{mad}(G) - k}$. \end{theorem} \begin{proof} First we argue the algorithm will return $(k - 1)$-degenerate set. In each iteration $x$ picked by algorithm is adjacent to at most $k - 1$ already picked vertices. So $S$ is $(k-1)$-degenerate indeed. To show that $mad(G - S) \le mad(G) - k$ we just have to find a flow $f'$ in graph $F' := F(G - S,\frac{mad(G)}{2} - \frac{k}{2})$ of capacity $E(G - S)$ thanks to Lemma \ref{flow}. Observe that $F'$ is a subgraph of $F$ with capacities of edges on the third layer reduced by $\frac{k}{2}$. Flow $f'$ has to saturate all edges from the first layer in order to have capacity $E(G - S)$. On the second layer we define $f'$ using $f$, for each edge from the second layer of $F'$ flow $f'$ will send exactly the same amount of flow as $f$ on corresponding edge in $F$. Now we just have to argue that amount of flow sent by $f'$ to any node between second and third layer in $F'$ is bounded by $\frac{mad(G)}{2} - \frac{k}{2}$ i.e.\ capacity of edge going from that node to sink. Each such node corresponds to vertex from $G - S$, so let us take arbitrary vertex $u \in G - S$. During execution of the algorithm vertex $u$ has been removed from $H_f$ as incident to some $k$ vertices already picked to $S$. Denote them $x_1, \ldots, x_k$ and let us consider arbitrary $x_i$. When the algorithm picked $x_i$ from $H_f$, there were no incoming edges to $x_i$. In particular in $H_f$ there was no edge $\overrightarrow{ux_i}$. At that time $u$ still belonged to $H_f$, so there was no edge $\overrightarrow{ux_i}$ even in $G_f$. Since $u$ and $x_i$ are adjacent in $G$, there was either an edge $\overrightarrow{x_iu}$ in $G_f$ which means that flow $f$ sends more than $\frac{1}{2}$ unit of flow from $v_{ux_i}$ to $u$ in $F$ or there was no $\overrightarrow{x_iu}$ and $\overrightarrow{ux_i}$ which means that flow $f$ sends exactly $\frac12$ unit of flow from $v_{ux_i}$ to $u$ in $F$. Through node $u$ in $F$ flow $f$ sends at most $\frac{mad(G)}{2}$ units of flow and for every $1 \le i \le k$ at least $\frac{1}{2}$ unit of flow comes from $v_{ux_i}$ to $u$. Therefore flow going through $u$ is decreased by at least $\frac{1}{2}$ unit per each $x_i$ in $F'$ what implies that $f'$ sends at most $\frac{mad(G)}{2} - \frac{k}{2}$ units of flow to vertex $u$ in $F'$. \end{proof} What is more, procedure $Solve(G, G_f, k)$ can be trivially implemented in a polynomial time. Theorem \ref{mainres} directly follows from Theorem \ref{algo}. \filbreak \begin{samepage} As two notable special cases we mention following corollaries: \begin{theorem} \label{IndSet} For every undirected simple graph $G$ there exists $I \subseteq V(G)$ such that $I$ is an independent set and $\mathrm{mad}(G - I) \le \mathrm{mad}(G) - 1$. Moreover such $I$ can be computed in polynomial time. \end{theorem} \begin{theorem} \label{Forest} For every undirected simple graph $G$ there exists $F \subseteq V(G)$ such that $G[F]$ is a forest and $\mathrm{mad}(G - F) \le \mathrm{mad}(G) - 2$. Moreover such $F$ can be computed in polynomial time. \end{theorem} \end{samepage} \section{Conclusions and open problems} \label{conclusions} As already mentioned, our result is a positive answer for the open problem presented in \cite{EDU}, namely problem~2 from final remarks which in turn implies sub-exponential bound on the diameter of reconfiguration graphs of colourings for graphs with any bounded maximum average degree. However this bound has already been improved in \cite{Feghali} to the polynomial bound depending on value of $\mathrm{mad}(G)$. Our results imply many results for some specific classes of graphs as a direct consequence and here we mention a few of them. Following folklore fact will come in handy in deriving some of the consequences: \begin{fact}\label{fakcik} For every planar graph $G$ we have $(\mathrm{mad}(G) - 2)(g(G) - 2) < 4$. \end{fact} Based on Theorem \ref{IndSet}, we are able to improve Theorem 1 from \cite{Dross} and one of its consequences. \begin{theorem}[\cite{Dross}] Let $M$ be a real number such that $M <3$. Let $d>0$ be an integer and let $G$ be a graph with $\mathrm{mad}(G)< M$. If $d>\frac{2}{3-M}-2$, then $V(G)$ can be partitioned into $A \uplus B$ such that $G[A]$ is an independent set and $G[B]$ is a forest with maximum degree at most $d$. \end{theorem} By using Theorem \ref{IndSet} and direct calculation, we are able to strengthen this to the following theorem: \begin{theorem} \label{DrossRekt} Let $M$ be a real number such that $M <3$. Let $d>0$ be an integer and let $G$ be a graph with $\mathrm{mad}(G)< M$. If $d>\frac{2}{3-M}-2$, then $V(G)$ can be partitioned into $A \uplus B$ such that $G[A]$ is an independent set and $G[B]$ is a forest whose connected components have size at most $d + 1$. \end{theorem} Authors of \cite{Dross} use their theorem and Fact \ref{fakcik} to deduce the following corollary: \begin{corollary} For every planar graph $G$ with $g(G) \ge 10$, the vertex set $V(G)$ can be partitioned into $A \uplus B$ such that $A$ is an independent set and $G[B]$ is a forest with maximum degree $2$. \end{corollary} We are able to strengthen this to the following corollary: \begin{corollary} For every planar graph $G$ with $g(G) \ge 10$, the vertex set $V(G)$ can be partitioned into $A \uplus B$ such that $A$ is an independent set and $G[B]$ is a forest whose connected components have size at most $3$. \end{corollary} Borodin et al. proved in \cite{YETANOTHERBORODIN} that vertex set of any planar graph with $g(G) \ge 7$ admits a $(\mathcal{I}, \Delta_4)$-partition, i.e. partition into an independent set and a set that induces graph with maximum degree at most $4$. Dross et al. proved in \cite{Dross} that vertex set of any planar graph with $g(G) \ge 7$ admits a $(\mathcal{I}, \mathcal{F}_3)$-partition, i.e. into an independent set and a set that induces forest of max degree at most $5$. In Corollary \ref{planar7} we add another partition result for the class of planar graphs with girth at least $7$. \begin{corollary} \label{planar7} For every planar graph $G$ with $g(G) \ge 7$, the vertex set $V(G)$ can be partitioned into $A \uplus B$ such that $A$ is an independent set and $G[B]$ is a forest where every connected component has at most~$9$ vertices. \end{corollary} \begin{proof} Since $g(G) \ge 7$ we deduce that $\mathrm{mad}(G) < 1 + \frac95$, so based on Corollary \ref{IndSet} we get that there exist $A$ and $B$ such that $V(G) = A \uplus B$, $A$ is an independent set and $\mathrm{mad}(G[B]) < \frac95$. It can be readily verified that class of graphs with value of their $\mathrm{mad}$ smaller than $\frac95$ is class of graphs which are forests with connected components of size at most $9$. \end{proof} Apart from that, based on Theorems \ref{IndSet} and \ref{Forest} and Fact \ref{fakcik} we are able to deduce following corollaries: \begin{corollary} \label{3lasy} For every planar graph $G$, the vertex set $V(G)$ can be partitioned into $A \uplus B \uplus C$ such that $G[A], G[B], G[C]$ are forests. \end{corollary} \begin{proof} Every planar graph satisfies $\mathrm{mad}(G) < 6$, so using Corollary \ref{Forest} we can partition $V(G)$ into $A$ and $D$ such that $\mathrm{mad}(G[A]) < 2$ and $\mathrm{mad}(G[D]) < 4$ and then using Corollary \ref{Forest} again we can partition $D$ into $B$ and $C$ such that $\mathrm{mad}(G[B]) < 2$ and $\mathrm{mad}(G[C]) < 2$. Hence $G[A], G[B], G[C]$ are forests. \end{proof} \begin{corollary} \label{2lasy} For every planar graph $G$ without triangles, the vertex set $V(G)$ can be partitioned into $A \uplus B$ such that $G[A], G[B]$ are forests. \end{corollary} \begin{proof} Based on Fact \ref{fakcik} we know that if $G$ has no triangles then $g(G) \ge 4 \Rightarrow g(G) - 2 \ge 2 \Rightarrow \mathrm{mad}(G) < 4$. Therefore using Corollary \ref{Forest} we deduce that there exist $A, B$ such that $V(G) = A \uplus B$ and $G[A], G[B]$ are forests. \end{proof} \begin{corollary}\label{slabe1} For every planar graph $G$ without cycles of length $3$ and $4$, the vertex set $V(G)$ can be partitioned into $A \uplus B$ such that $G[A]$ is a forest and $\Delta(G[B]) \le 1$. \end{corollary} \begin{proof} Since $g(G) \ge 5$ we deduce that $\mathrm{mad}(G) < 2 + \frac{4}{3}$, so based on Corollary \ref{Forest} we get that there exist $A$ and $B$ such that $V(G) = A \uplus B$ and $\mathrm{mad}(G[A]) < 2$ and $\mathrm{mad}(G[B]) < \frac43$. Therefore $G[A]$ is a forest and $\Delta(G[B]) \le 1$, because if $G[B]$ contains a vertex with degree $\ge 2$ then this vertex together with its two neighbours induce a graph with $\mathrm{mad}$ at least $\frac43$. \end{proof} \begin{corollary}\label{slabe2} For every planar graph $G$ with $g(G) \ge 6$ its vertex set $V(G)$ can be partitioned into $A \uplus B$ such that $G[A]$ is a forest and $B$ is an independent set. \end{corollary} \begin{proof} Since $g(G) \ge 6$ we deduce that $\mathrm{mad}(G) < 3$, so based on either Corollary \ref{Forest} or Corollary \ref{IndSet} we get that there exist $A$ and $B$ such that $V(G) = A \uplus B$ and $\mathrm{mad}(G[A]) < 2$ and $\mathrm{mad}(G[B]) < 1$. Therefore $G[A]$ is a forest and $B$ is an independent set. \end{proof} However, Corollaries \ref{3lasy}, \ref{2lasy}, \ref{slabe1} and \ref{slabe2} have already been proven and even improved before. Corollary \ref{3lasy} has been proven in \cite{Chartrand1968} and later improved in \cite{LinArbo}. Improved version of Corollary \ref{2lasy} has been proven in \cite{VertexArbo}. Improved version of both Corollaries \ref{slabe1} and \ref{slabe2} has been proven in \cite{Girth5}. As a main open problem in this area we recall the following one: \begin{conjecture} For every graph $G$ and positive real numbers $c_1, c_2$ if $\mathrm{mad}(G) < c_1 + c_2$ then there exists a~partition of vertex set $V(G) = A \uplus B$ such that $\mathrm{mad}(G[A]) < c_1$ and $\mathrm{mad}(G[B]) < c_2$. \end{conjecture} Our results show that this conjecture is true for $c_2 \in \{1, 2\}$. Moreover since for positive $k$ we have that $k$-degenerate graphs fulfill $\mathrm{mad}(G) < 2k$ we can deduce that for every integer $k \ge 2$ and a graph $G$ that satisfies $\mathrm{mad}(G) < c_1 + k$ there exists a partition of vertex set $V(G) = A \uplus B$ such that $\mathrm{mad}(G[A]) < c_1$ and $\mathrm{mad}(G[B]) < 2k-2$. \section*{Acknowledgements} Majority of this research has been conducted during Structural Graph Theory workshop in Gu\l{}towy, Poland, in June~2019. Thanks to the organizers and to the other workshop participants for creating a productive working atmosphere. We would also like to thank Bartosz Walczak for discussions on this topic.
\section{Introduction} The \emph{Optimal Power Flow} (OPF) problem determines the generator dispatch of minimal cost that meets the demands while satisfying the physical and engineering constraints of the power system \cite{OPF}. The OPF (aka AC-OPF) is a non-convex non-linear optimization problem and the building bock of many applications, including security-constrained OPFs (Monticelli et al.~\citeyear{monticelli:87}), optimal transmission switching \cite{OTS}, capacitor placement \cite{baran:89}, expansion planning (Verma et al.~\citeyear{verma:16}), and security-constrained unit commitment \cite{wang:08}. Typically, generation schedules are updated in intervals of 5 minutes \cite{Tong:11}, possibly using a solution to the OPF solved in the previous step as a starting point. In recent years, the integration of renewable energy in sub-transmission and distribution systems has introduced significant stochasticity in front and behind the meter, making load profiles much harder to predict and introducing significant variations in load and generation. This uncertainty forces system operators to adjust the generators setpoints with increasing frequency in order to serve the power demand while ensuring stable network operations. However, the resolution frequency to solve OPFs is limited by their computational complexity. To address this issue, system operators typically solve OPF approximations such as the linear DC model (DC-OPF). While these approximations are more efficient computationally, their solution may be sub-optimal and induce substantial economical losses, or they may fail to satisfy the physical and engineering constraints. Similar issues also arise in expansion planning and other configuration problems, where plans are evaluated by solving a massive number of multi-year Monte-Carlo simulations at 15-minute intervals \cite{pachenew,Highway50}. Additionally, the stochasticity introduced by renewable energy sources further increases the number of scenarios to consider. Therefore, modern approaches recur to the linear DC-OPF approximation and focus only on the scenarios considered most pertinent \cite{pachenew} at the expense of the fidelity of the simulations. To address these challenges, this paper studies how to approximate OPFs using a Deep Neural Network (DNN) approach. The main goal of the OPF is to find generator setpoints, i.e., the amount of real power and the voltage magnitude for each generator. Approximating the OPF using DNNs can thus be seen as an empirical risk minimization problem. However, the resulting setpoints must also satisfy the physical and engineering constraints that regulate power flows, and these constraints introduce significant difficulties for machine learning-based approaches, as shown in \cite{ng2018statistical,deka:2019}. To address these difficulties, this paper presents a DNN approach to the OPF (OPF-DNN) that borrows ideas from Lagrangian duality and models the learning task as the Lagrangian dual of the empirical risk minimization problem under the OPF constraints. Note also that the AC-OPF is an ideal application for machine learning, since it must be solved almost continuously. Hence significant data is available to train deep learning networks and improve them over time. The contributions of this paper can be summarized as follows. (1) It proposes an approach (OPF-DNN) that uses a DNN to predict the generator setpoints for the OPF; (2) It exploits the physical and engineering constraints in a Lagrangian framework using violation degrees; (3) It enhances the prediction accuracy by leveraging the availability of a solution to a related OPF (e.g., the solution to a closely related historical instances, which is almost always available); (4) It recasts the OPF prediction as the Lagrangian dual of the empirical risk minimization under constraints, using a subgradient method to obtain a high-quality solution. OPF-DNN is evaluated on realistic medium-sized power system benchmarks: The computational results show significant improvements in accuracy and efficiency compared to the ubiquitous DC model. In particular, OPF-DNN provides accuracy improvements of up to two orders of magnitude and efficiency speedups of several orders of magnitude. \emph{These results may open new avenues for power system analyses and operations under significant penetration of renewable energy}. \def\bm{\left(}{\bm{\left(}} \def\bm{\right)}{\bm{\right)}} \newcommand{\vect}[1]{{\bm{\left(}{#1}\bm{\right)}}} \section{Preliminaries} The paper uses the following notations: \emph{Variables} are denoted by calligraph lowercase symbols, \emph{constants} by dotted symbols, and \emph{vectors} by bold symbols. The hat notation $\hat{\bm{x}}$ describes the prediction of a value $\bm{x}$ and $\|\!\cdot\!\|$ denotes the $L2$-norm. The power flow equations are expressed in terms of complex \emph{powers} of the form $S \!=\! (p \!+\! jq)$, where $p$ and $q$ denote active and reactive powers, \emph{admittance} of the form $Y \!=\! (g \!+\! jb)$, where $g$ and $b$ denote the conductance and susceptance, and \emph{voltages} of the form $V \!=\! (v \angle \theta)$, with magnitude $v$ and phase angle $\theta$. \begin{model}[!t] {\footnotesize \caption{AC Optimal Power Flow (AC-OPF)} \label{model:ac_opf} \vspace{-6pt} \begin{flalign} &{\mathcal{O}}(\dot{\bm{p}}^d, \dot{\bm{q}}^d) = \textstyle \bm{\argmin}_{\bm{p^g},\bm{v}}\;\; \sum_{i \in {\cal N}} \text{cost}(p^g_i) && \label{ac_obj} \\ &\mbox{\bf subject to:} \notag\\ % &\hspace{6pt} \dot{v}^{\min}_i \leq v_i \leq \dot{v}^{\max}_i && \!\!\!\!\!\forall i \in {\cal N} \label{con:2a} \tag{2a}\\ &\hspace{6pt} \text{ -- }\dot{\theta}^\Delta_{ij} \leq \theta_i \text{ -- } \theta_j \leq \dot{\theta}^\Delta_{ij} && \!\!\!\!\!\forall (ij) \in {\cal E} \label{con:2b}\!\!\!\!\! \tag{$\bar{2b}$}\\ &\hspace{6pt} \dot{p}^{g\min}_i \leq p^g_i \leq \dot{p}^{g\max}_i && \!\!\!\!\!\forall i \in {\cal N} \label{con:3a} \tag{$\bar{3a}$}\\ &\hspace{6pt} \dot{q}^{g\min}_i \leq q^g_i \leq \dot{q}^{g\max}_i && \!\!\!\!\!\forall i \in {\cal N} \label{con:3b} \tag{3b}\\ &\hspace{6pt} (p_{ij}^f)^2 + (q_{ij}^f)^2 \leq \dot{S}^{f\max}_{ij} && \!\!\!\!\!\forall (ij) \in {\cal E} \label{con:4} \tag{$\bar{4}$}\\ &\hspace{6pt} p_{ij}^f \!=\! \dot{g}_{ij} v_i^2 \text{--} v_i v_j (\dot{b}_{ij} \!\sin(\theta_i \text{--} \theta_j) + \dot{g}_{ij} \!\cos(\theta_i \text{--} \theta_j)\!) && \!\!\!\!\!\forall (ij)\!\in\! {\cal E} \label{con:5a} \tag{$\bar{5a}$}\\ &\hspace{6pt} q_{ij}^f \!=\! \text{--} \dot{b}_{ij} v_i^2 \text{--} v_i v_j (\dot{g}_{ij} \!\sin(\theta_i \text{--} \theta_j) \text{--} \dot{b}_{ij} \!\cos(\theta_i \text{--} \theta_j)\!) && \!\!\!\!\!\forall (ij)\!\in\! {\cal E} \label{con:5b} \tag{5b}\\ &\hspace{6pt} p^g_i \text{ -- } \dot{p}^d_i = \textstyle \sum_{(ij)\in {\cal E}} p_{ij}^f && \!\!\!\!\!\forall i\in {\cal N} \label{con:6a} \tag{$\bar{6a}$}\\ &\hspace{6pt} q^g_i \text{ -- } \dot{q}^d_i = \textstyle \sum_{(ij)\in {\cal E}} q_{ij}^f && \!\!\!\!\!\forall i\in {\cal N} \label{con:6b} \tag{6b}\\ &\textbf{output:}~~(\bm{p}^g, \bm{v}) \text{ -- The system operational parameters} \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \notag \end{flalign} \vspace{-12pt} } \end{model} \setcounter{equation}{6} \subsection{Optimal Power Flow} The \emph{Optimal Power Flow (OPF)} determines the least-cost generator dispatch that meets the load (demand) in a power network. A power network is viewed as a graph $({\cal N}, {\cal E})$ where the nodes $\cal N$ represent the set of $n$ \emph{buses} and the edges $\cal E$ represent the set of $e$ \emph{transmission lines}. The OPF constraints include physical and engineering constraints, which are captured in the AC-OPF formulation of Model~\ref{model:ac_opf}. The model uses $\bm{p}^g$, and $\bm{p}^d$ to denote, respectively, the vectors of active power generation and load associated with each bus and $\bm{p}^f$ to describe the vector of active power flows associated with each transmission line. Similar notations are used to denote the vectors of reactive power $\bm{q}$. Finally, the model uses $\bm{v}$ and $\bm{\theta}$ to describe the vectors of voltage magnitude and angles associated with each bus. The OPF takes as inputs the loads $(\dot{\bm{p}}^d\!, \dot{\bm{q}}^d)$ and the admittance matrix $\dot{\bm{Y}}$, with entries $\dot{g}_{ij}$ and $\dot{b}_{ij}$ for each line $(ij) \!\in\! {\cal E}$; It returns the active power vector $\bm{p}$ of the generators, as well the voltage magnitude $\bm{v}$ at the generator buses. The objective function \eqref{ac_obj} captures the cost of the generator dispatch, and is typically expressed as a quadratic function. Constraints \eqref{con:2a} and \eqref{con:2b} restrict the voltage magnitudes and the phase angle differences within their bounds. Constraints \eqref{con:3a} and \eqref{con:3b} enforce the generator active and reactive output limits. Constraints \eqref{con:4} enforce the line flow limits. Constraints \eqref{con:5a} and \eqref{con:5b} capture \emph{Ohm's Law}. Finally, Constraint \eqref{con:6a} and \eqref{con:6b} capture \emph{Kirchhoff's Current Law} enforcing flow conservation. \begin{model}[!t] {\small \caption{The Load Flow Model} \label{model:load_flow} \vspace{-6pt} \begin{flalign} \mbox{\bf minimize:}& \;\; \| \bm{p}^g - \hat{\bm{p}}^g \|^2 + \| \bm{v} - \hat{\bm{v}} \|^2 \label{load_flow_obj} \\ % \mbox{\bf subject to:} & \;\; \eqref{con:2a}-\eqref{con:6b} \notag \end{flalign} } \vspace{-12pt} \end{model} \paragraph{The DC Relaxation} The DC model is a ubiquitous linear approximation to the OPF \cite{Wood96}. It ignores reactive power and assumes that the voltage magnitudes are at their nominal values (1.0 in per unit notation). The model uses only the barred constraints in Model~\ref{model:ac_opf}. Constrains \eqref{con:4} considers only the active flows and hence can be trivially linearized and Constraints \eqref{con:5a} becomes \mbox{$p_{ij}^f = -\dot{b}_{ij} (\theta_i - \theta_j)$}. The quadratic objective is also replaced by a piecewise linear function. Being an approximation, a DC solution $\hat{\bm{p}}^g$ may not satisfy the AC model constraints. As result, prior to being deployed, one typically solves a \emph{load flow optimization}, described in Model \ref{model:load_flow}. It is a least squares minimization problem that finds the closest AC-feasible solution to the approximated one. \subsection{Deep Learning Models} Supervised Deep Learning (SDL) can be viewed as the task of approximating a complex non-linear mapping from labeled data. Deep Neural Networks (DNNs) are deep learning architectures composed of a sequence of layers, each typically taking as inputs the results of the previous layer \cite{lecun2015deep}. Feed-forward neural networks are basic DNNs where the layers are fully connected and the function connecting the layer is given by $$ \bm{o} = \pi(\bm{W} \bm{x} + \bm{b}), $$ where $\bm{x} \!\in\! \mathbb{R}^n$ and is the input vector, $\bm{o} \!\in\! \mathbb{R}^m$ the output vector, $\bm{W} \!\in\! \mathbb{R}^{m \times n}$ a matrix of weights, and $\bm{b} \!\in\! \mathbb{R}^m$ a bias vector. The function $\pi(\cdot)$ is often non-linear (e.g., a rectified linear unit (ReLU)). \section{OPF Learning Goals} The goal of this paper is to learn the OPF mapping ${\cal O}: \mathbb{R}^{2n} \to \mathbb{R}^{2n}$: Given the loads $\vect{\bm{p}^d, \bm{q}^d}$, predict the setpoints $\vect{\bm{p}^g, \bm{v}}$ of the generators, i.e., their active power and the voltage magnitude at their buses. The input of the learning task is a dataset ${\cal D} \!=\! \{(\bm{x}_\ell,\bm{y}_\ell)\}_{\ell\!=\!1}^N$, where $\bm{x}_\ell \!\!=\!\! (\bm{p}^d, \bm{q}^d)$ and $\bm{y}_\ell \!=\! (\bm{p}^g, \bm{v})$ represent the $\ell^{th}$ observation of load demands and generator setpoints which satisfy $\bm{y}_\ell \!=\! {\cal O}(\bm{x}_\ell)$. The output is a function $\hat{\cal O}$ that ideally would be the result of the following optimization problem \begin{flalign*} \mbox{\bf minimize:} & \;\; \sum_{\ell=1}^N {\cal L}_o(\bm{y}_\ell,\hat{\cal O}(\bm{x}_\ell)) \\ \mbox{\bf subject to:} & \;\; {\cal C}(\bm{x}_\ell,\hat{\cal O}(\bm{x}_\ell)) \end{flalign*} \noindent where the loss function is specified by \begin{equation} \label{basic_loss} {\cal L}_o(\bm{y}, \hat{\bm{y}}) = \underbrace{\| \bm{p}^g - \hat{\bm{p}}^g \|^2}_{{\cal L}_p(\bm{y}, \hat{\bm{y}})}{\!} + \underbrace{\| \bm{v} - \hat{\bm{v}} \|^2}_{{\cal L}_v(\bm{y}, \hat{\bm{y}})}{\!} \end{equation} and ${\cal C}(\bm{x},\bm{y})$ holds if there exist voltage angles $\bm{\theta}$ and reactive power generated $\bm{q}^g$ that produce a feasible solution to the OPF constraints with $\bm{x} = (\bm{p}^d, \bm{q}^d)$ and $\bm{y} = (\bm{p}^g, \bm{v})$. One of the key difficulties of this learning task is the presence of the complex nonlinear feasibility constraints in the OPF. The approximation $\hat{\cal O}$ will typically not satisfy the problem constraints. As a result, like in the case of the DC model discussed earlier, the validation of the learning task uses a load flow computation that, given a prediction $\hat{\bm{y}}\!=\!\hat{\cal O}(\bm{x}_\ell)$, computes the \mbox{closest feasible generator setpoints}. \section{Baseline Deep Learning Model} The baseline model for this paper assumes that function $\hat{\cal O}$ is given by a feed-forward neural network, whose architecture is part of the final network outlined in Figure \ref{fig:dlopf} and discussed in detail later. While this baseline model is often accurate for many regression problems, the experimental results show that it has low fidelity for complex AC-OPF tasks. More precisely, a load flow computation on the predictions of this baseline model to restore feasibility produces generator setpoints with substantial errors. The rest of the paper shows how to improve the accuracy of the model by exploiting the problem structure. \section{Capturing the OPF Constraints} To capture the OPF constraints, this paper uses a Lagrangian relaxation approach based on constraint violations \cite{Fontaine:14} used in generalized augmented Lagrangian relaxation \cite{Hestenes:69}. The Lagrangian relaxation of an optimization problem \begin{flalign*} \mbox{\bf minimize:} & \;\; f(\bm{x}) \\ \mbox{\bf subject to:} & \;\; h(\bm{x}) = 0\\ &\;\; g(\bm{x}) \leq 0 \end{flalign*} \noindent is given by \begin{flalign*} \mbox{\bf minimize:} & \;\; f(\bm{x}) + \lambda_h h(\bm{x}) + \lambda_g g(\bm{x}) \end{flalign*} \noindent where $\lambda_h$ and $\lambda_g \geq 0$ are the Lagrangian multipliers. In contrast, the violation-based Lagrangian relaxation is \begin{flalign*} \mbox{\bf minimize:} & \;\; f(\bm{x}) + \lambda_h |h(\bm{x})| + \lambda_g \max(0,g(\bm{x})) \end{flalign*} \noindent with $\lambda_h,\lambda_g \geq 0$. In other words, the traditional Lagrangian relaxation exploits the satisfiability degrees of constraints, while the violation-based Lagrangian relaxation is expressed in terms of violation degrees. The satisfiability degree of a constraint measures how well the constraint is satisfied, with negative values representing the slack and positive values representing violations, while the violation degree is always non-negative and represents how much the constraint is violated. More formally, the satisfiability degree of a constraint $c \!:\! \mathbb{R}^n \to {\it Bool}$ is a function $\sigma_c\!:\! \mathbb{R}^n \to \mathbb{R}$ such that $\sigma_c(\bm{x}) \leq 0 \equiv c(\bm{x})$. The violation degree of a constraint $c\!:\! \mathbb{R}^n \to {\it Bool}$ is a function $\nu_c\!:\! \mathbb{R}^n \to \mathbb{R^+}$ such that $\sigma_c(\bm{x}) \equiv 0 \equiv c(\bm{x})$. For instance, for a linear constraints $c(\bm{x})$ of type $A\bm{x} \geq b$, the \emph{satisfiability degree} is defined as \begin{equation*} \sigma_c(\bm{x}) \equiv \bm{b} - A\bm{x} \end{equation*} and the \emph{violation degrees} for inequality and equality constraints are specified by \begin{equation*} \nu^{\geq}_c(\bm{x}) = \max\left(0, \sigma_c(\bm{x})\right) \qquad \nu^{=}_c(\bm{x}) = \left| \sigma_c(\bm{x}) \right|. \end{equation*} \noindent Although the resulting term is not differentiable (but admits subgradients), computational experiments indicated that violation degrees are more appropriate for predicting OPFs than satisfiability degrees. Observe also that an augmented Lagrangian method uses both the satisfiability and violation degrees in its objective. \begin{figure*}[!t] \centering\includegraphics[width=0.9\linewidth]{framework_v34.pdf} \caption{\label{fig:dlopf} The OPF-DNN Model: Each layer is fully connected with ReLU activation. White boxes correspond to input tensors, dark, colored, boxes correspond to output layers. Loss components and violation degrees are shown as white rectangles.} \end{figure*} \smallskip To define the violation degrees of the AC-OPF constraints, the baseline model needs to extended to predict the reactive power dispatched $\bm{q}^g$ and the voltage angles $\bm{\theta}$ of the power network. Given the predicted values $\hat{\bm{v}}, \hat{\bm{\theta}}, \hat{\bm{p}}^g,$ and $\hat{\bm{q}}^g$, the satisfiability degree of the OPF constraints can be expressed as: This section extends the homonym section of the main paper by reporting the complete set of satisfiability and violation degrees of the OPF constraints. Given the predicted values $\hat{\bm{v}}, \hat{\bm{\theta}}, \hat{\bm{p}}^g,$ and $\hat{\bm{q}}^g$, the satisfiability degree of the OPF constraints are expressed as follows: {\small \begin{flalign*} \sigma_{2a}^L(\hat{v}_i) &= (\dot{v}^{\min}_i - \hat{v}_i) &\!\!\!\!\!\! \forall i \in {\cal N}\\ \sigma_{2a}^R(\hat{v}_i) &= (\hat{v}_i - \dot{v}^{\max}_i) &\!\!\!\!\!\! \forall i \in {\cal N}\\ \sigma_{2b}^L(\hat{\theta}_{ij}) &= ((\hat{\theta}_j - \hat{\theta}_i) - \dot{\theta}^{\Delta}_{ij}) &\!\!\!\!\!\! \forall (ij) \in {\cal E}\\ \sigma_{2b}^R(\hat{\theta}_{ij}) &= ((\hat{\theta}_i - \hat{\theta}_j) -\dot{\theta}^{\Delta}_{ij}) &\!\!\!\!\!\! \forall (ij) \in {\cal E}\\ \sigma_{3a}^L(\hat{p_i}^g) &= \dot{p}^{g\min}_i - \hat{p}{}^g_i &\!\!\!\!\!\! \forall i \in {\cal N}\\ \sigma_{3a}^R(\hat{p_i}^g) &= \hat{p}^g_i - \dot{p}^{\max}_i &\!\!\!\!\!\! \forall i \in {\cal N}\\ \sigma_{3b}^L(\hat{q_i}^g) &= \dot{q}^{g\min}_i - \hat{q}{}^g_i &\!\!\!\!\!\! \forall i \in {\cal N}\\ \sigma_{3b}^R(\hat{q_i}^g) &= \hat{q}^g_i - \dot{q}^{\max}_i &\!\!\!\!\!\! \forall i \in {\cal N}\\ \sigma_4(\tilde{p}^f_{ij}, \tilde{q}^f_{ij}) &= (\tilde{p}^f_{ij})^2 + (\tilde{q}^f_{ij})^2 - \dot{S}^{\max}_{ij} &\!\!\!\!\!\! \forall (ij) \in {\cal E}\\ \sigma_{5a}(\tilde{{p}}^f_{ij}, {p}^f_{ij}) &= \tilde{p}^f_{ij} - p_{ij}^f &\!\!\!\!\!\! \forall (ij) \in {\cal E}\\ \sigma_{5b}(\tilde{{q}}^f_{ij}, {q}^f_{ij}) &= \tilde{q}^f_{ij} - q^f_{ij} &\!\!\!\!\!\! \forall (ij) \in {\cal E}\\ \sigma_{6a}(\hat{p}^g_i, \dot{p}^d_i, \tilde{\bm{p}}^f) &= \sum_{(ij)\in {\cal E}} \tilde{p}^f_{ij} - (\hat{p}^g_i \!-\! \dot{p}^d_i) &\!\!\!\!\!\! \forall i \in {\cal N}\\ \sigma_{6b}(\hat{q}^g_i, \dot{q}^d_i, \tilde{\bm{q}}^f) &= \sum_{(ij)\in {\cal E}} \tilde{q}^f_{ij} - (\hat{q}^g_i \!-\! \dot{q}^d_i) &\!\!\!\!\!\! \forall i \in {\cal N} \end{flalign*} } \noindent where $\sigma_{2a}^L$ and $\sigma_{2a}^R$ correspond to Constraints \eqref{con:2a} and capture the distance of the predictions $\hat{v}_i$ from exceeding the voltage bounds. The functions $\sigma_{2b}^{L}$ and $\sigma_{2b}^{R}$ correspond to Constraints \eqref{con:2b} and express how much the difference between two voltage angles exceeds the bound. Similarly, $\sigma_{3a}^{L}$, $\sigma_{3a}^{R}$, and $\sigma_{3b}^{L}$, $\sigma_{3b}^{R}$, relate to Constraints \eqref{con:3a} and \eqref{con:3b}, respectively, and describe the distance of the predicted generator active and reactive dispatch from their bounds. Function $\sigma_4$ corresponds to Constraints \eqref{con:4} and captures the distance of the power flow on line $(ij)$ from its bound. Therein, $\tilde{p}^f_{ij}$ and $\tilde{q}^f_{ij}$ are, respectively, the active and reactive power flow for line $(ij) \in {\cal E}$. Notice that $\tilde{p}^f_{ij}$ and $\tilde{q}^f_{ij}$ are not predicted directly, as an output of the DNN. Instead, they are computed using the predicted quantities $\hat{v}_i, \hat{v}_j, \hat{\theta}_i$, and $\hat{\theta}_j$ according to Constraints \eqref{con:5a} and \eqref{con:5b}. The quantities ${p}^f_{ij}$ and ${q}^f_{ij}$ correspond to the ground truths values. Functions $\sigma_{5a}$ and $\sigma_{5b}$ measure the deviation of the predicted flow (based on the other predicted quantities) to the ground truth values according to the Ohm's Law (Constraints (5a) and (5b)). Finally, the functions $\sigma_{6a}$ and $\sigma_{6b}$ relate to the Kirchhoff Current Law (Constraints \eqref{con:6a} and \eqref{con:6b}) and express the violation of flow conservation at a bus. The violation degrees associated to the satisfiability degree above are defined as follows: {\small \begin{flalign*} \nu_{2a}(\hat{\bm{v}}) &= \frac{1}{n} \sum_{i \in {\cal N}} \left(\nu_c^{\geq}\big(\sigma_{2a}^L(\hat{v}_i)\big) + \nu_c^{\geq}\big(\sigma_{2a}^R(\hat{v}_i)\big) \right)\\ \nu_{2b}(\hat{\bm{\theta}}) &= \frac{1}{e} \sum_{(ij) \in {\cal E}} \left(\nu_c^{\geq}\big(\sigma_{2b}^L(\hat{\theta}_{ij})\big) + \nu_c^{\geq}\big(\sigma_{2b}^R(\hat{\theta}_{ij})\big) \right)\\ \nu_{3a}(\hat{\bm{p}}) &= \frac{1}{n} \sum_{i \in {\cal N}} \left(\nu_c^{\geq}\big(\sigma_{3a}^L(\hat{p}_i)\big) + \nu_c^{\geq}\big(\sigma_{3a}^R(\hat{p}_i)\big) \right)\\ \nu_{3b}(\hat{\bm{q}}) &= \frac{1}{n} \sum_{i \in {\cal N}} \left(\nu_c^{\geq}\big(\sigma_{3b}^L(\hat{q}_i)\big) + \nu_c^{\geq}\big(\sigma_{3b}^R(\hat{q}_i)\big) \right)\\ \nu_{4}(\tilde{\bm{p}}^f\!, \tilde{\bm{q}}^f) &= \frac{1}{e} \sum_{(ij) \in {\cal E}} \nu_c^{\geq}\big(\sigma_{4}(\tilde{p}_{ij}^f, \tilde{q}_{ij}^f)\big)\\ \nu_{5a}(\tilde{\bm{p}}^f\!, \bm{p}^f) &= \frac{1}{e} \sum_{(ij) \in {\cal E}} \nu_c^{=}\big(\sigma_{5a}(\tilde{p}_{ij}^f, {p}_{ij}^f)\big)\\ \nu_{5b}(\tilde{\bm{q}}^f\!, \bm{q}^f) &= \frac{1}{e} \sum_{(ij) \in {\cal E}} \nu_c^{=}\big(\sigma_{5a}(\tilde{q}_{ij}^f, {q}_{ij}^f)\big)\\ \nu_{6a}(\hat{\bm{p}}^g\!, \dot{\bm{p}}^d\!, \bm{p}^f) &= \frac{1}{e} \sum_{(ij) \in {\cal E}} \nu_c^{=}\big(\sigma_{6a}(\hat{p}^g_i, \dot{p}^d_i, \tilde{\bm{p}}^f)\big)\\ \nu_{6b}(\hat{\bm{q}}^g\!, \dot{\bm{q}}^d\!, \bm{q}^f) &= \frac{1}{e} \sum_{(ij) \in {\cal E}} \nu_c^{=}\big(\sigma_{6b}(\hat{q}^g_i, \dot{q}^d_i, \tilde{\bm{q}}^f)\big). \end{flalign*} } where $n$ and $e$ denote the number of buses and transmission lines, respectively. These functions capture the average deviation by which the prediction violates the associated constraint. The violations degrees define penalties that will be used to enrich the DNN loss function to encourage their satisfaction. Prior describing the DNN objective, we introduce a further extension that exploits yet another aspect of the structure of the OPF. \section{Exploiting Existing Solutions} The solving of an OPF (or a load flow) rarely happens in a cold-start: OPFs are typically solved in the context of an existing operating point and/or with the availability of solutions to similar instances (\emph{hot-start}). As a result, the learning task can exploit this existing configuration, which is called the \emph{hot-start state} in this paper. The hot-start state is a tuple $\bm{s}_0=\vect{\bm{p}^d_0,\bm{q}^d_0,\bm{p}^g_0, \bm{q}^g_0,\bm{v}_0,\bm{\theta}_0}$, describing the load, the generation, and the voltages that are solutions to a related OPF. The learning can then use a new, enriched, training dataset, defined as follows: {\small \begin{align*} {\cal D} \!=\! \Big\{ \!\!&\big( (\overbrace{\bm{p}_0^d, \bm{q}_0^d, \bm{p}^g_0, \bm{q}^g_0, \bm{v}_0, \bm{\theta}_0, \bm{p}^d, \bm{q}^d}^{\bm{x}_1})_1, \overbrace{(\bm{p}^g, \bm{q}^g, \bm{v}, \bm{\theta}}^{\bm{y}_1})_1\big), \ldots,\\ &\big((\underbrace{\bm{p}_0^d, \bm{q}_0^d, \bm{p}^g_0, \bm{q}^g_0, \bm{v}_0, \bm{\theta}_0, \bm{p}^d, \bm{q}^d}_{\bm{x}_N})_N, \underbrace{(\bm{p}^g, \bm{q}^g, \bm{v}, \bm{\theta}}_{\bm{y}_N})_N\big) \Big\}. \end{align*} } The elements $\bm{x}_\ell \!\in\! \mathbb{R}^{8n}$ are vectors describing the hot-start state $\bm{s}_0$ (e.g., the configuration in the previous timestep) and the current loads $(\bm{p}^d, \bm{q}^d)$. The elements $\bm{y}_\ell \!\in\! \mathbb{R}^{4n}$ are vectors describing the optimal generator and voltage settings for input data $\bm{x}_\ell$. The collection of the elements $\{\bm{x}_\ell\}_{\ell=1}^N$ is denoted by ${\cal X}$ and the elements $\{\bm{y}_\ell\}_{\ell=1}^N$ by ${\cal Y}$. The goal remain that of learning a mapping $\hat{\cal O}$. Note that, despite some proximity of loads in subsequent states, the OPF non linearities often cause severe variations in the operational parameters outputs. Therefore, as confirmed by our experimental results, the learning mechanism cannot rely exclusively on the information encoded in the hot-start state. \section{Objective} It is now possible to define the final loss function used to train the OPF-DNN. First, the loss is augmented to consider the predictions of voltage phase angles and the reactive power of generators, since these are required to compute the violation degrees associated with the OPF constraints. The resulting loss function ${\cal L}_o(\bm{y}, \hat{\bm{y}})$ is: \begin{flalign} \label{obj_advanced} \underbrace{\| \bm{v} - \hat{\bm{v}} \|}_{{\cal L}_v(\bm{y}, \hat{\bm{y}})}{\!}^2 + \underbrace{\| \bm{\theta} - \hat{\bm{\theta}} \|}_{{\cal L}_\theta(\bm{y}, \hat{\bm{y}})}{\!}^2 + \underbrace{\| \bm{p}^g - \hat{\bm{p}}^g \|}_{{\cal L}_p(\bm{y}, \hat{\bm{y}})}{\!}^2 + \underbrace{\| \bm{q}^g - \hat{\bm{q}}^g \|}_{{\cal L}_q(\bm{y}, \hat{\bm{y}})}{\!}^2. \end{flalign} It minimizes the mean squared error between the optimal voltage and generator settings $\bm{y}$ and the predicted ones $\hat{\bm{y}}$. Moreover, the objective function includes the Lagrangian relaxation based on the OPF physical and engineering constraints violation degrees. Given the set ${\cal C}$ of OPF constraints, the associated loss is captured by the expression \begin{flalign*} {\cal L}_c(\bm{x}, \hat{\bm{y}}) &= \sum_{c \in {\cal C}} \lambda_c \nu_c(\bm{x},\hat{\bm{y}}). \end{flalign*} The model loss function sums these two terms, i.e., \[ {\cal L}(\bm{x},\bm{y},\hat{\bm{y}}) = {\cal L}_o(\bm{y}, \hat{\bm{y}}) + {\cal L}_c(\bm{x}, \hat{\bm{y}}). \] \section{The Network Architecture} The network architecture is outlined in Figure \ref{fig:dlopf}. The input layers on the left process the tensor of loads $(\bm{p}^d_0, \bm{q}^d_0)$ of the hot-start state $\bm{s}_0$ and the input loads $(\bm{p}^d, \bm{q}^d)$. The network has 4 basic units, each following a decoder-encoder structure and composed by a number of fully connected layers with ReLU activations. Each subnetwork predicts a target variable: voltage magnitudes $\hat{\bm{v}}$, phase angles $\hat{\bm{\theta}}$, active power generations $\hat{\bm{p}}^g$, and reactive power generations $\hat{\bm{q}}^g$. Each sub-network takes as input the corresponding tensor in the hot-start state $\bm{s}_0$ (e.g., the sub-network responsible for predicting the voltage magnitude $\hat{\bm{v}}$ takes as input $\bm{v}_0$), as well as the last hidden layer of its input subnetwork, that processes the load tensors. The predictions for the voltage magnitude $\hat{\bm{v}}$ and angle $\hat{\bm{\theta}}$ are used to compute the load flows $(\tilde{\bm{p}}^f, \tilde{\bm{q}}^f\!)$, as illustrated on the bottom of the Figure. The components of the losses are highlighted in the white boxes and a full description of the network architecture is provided in the Appendix. \section{Lagrangian Duality} Let $\hat{\cal O}[\bm{w}]$ be the resulting OPF-DNN with weights $\bm{w}$ and let ${\cal L}[\bm{\lambda}]$ be the loss function parametrized by the Lagrangian multipliers $\bm{\lambda} = \{\lambda_c\}_{c \in {\cal C}}$. The training aims at finding the weights $\bm{w}$ that minimize the loss function for a given set of Lagrangian multipliers, i.e., it computes \[ {\it LR}(\bm{\lambda}) = \min_{\bm{w}} {\cal L}[\bm{\lambda}](\bm{x},\bm{y},\hat{\cal O}[\bm{w}](\bm{x})). \] It remains to determine appropriate Lagrangian multipliers. This paper proposes the use of Lagrangian duality to obtain the optimal Lagrangian multipliers when training the OPF-DNN, i.e., it solves \[ {\it LD} = \max_{\bm{\lambda}} {\it LR}(\bm{\lambda}). \] The Lagrangian dual is solved through a subgradient method that computes a sequence of multipliers $\bm{\lambda}^1,\ldots,\bm{\lambda}^k,\ldots$ by solving a sequence of trainings ${\it LR}(\bm{\lambda}^0),\ldots,{\it LR}(\bm{\lambda}^{k-1}),\ldots$ and adjusting the multipliers using the violations, i.e., \begin{align} \bm{w}^{k+1} &= \argmin_{\bm{w}} {\cal L}[\bm{\lambda}^k](\bm{x},\bm{y},\hat{\cal O}[\bm{w}^k](\bm{x})) \label{eq:L1} \tag{L1}\\ \bm{\lambda}^{k+1} &= \vect{\lambda^k_c + \rho\,\nu_c(\bm{x},\hat{\cal O}[\bm{w}^{k+1}](\bm{x})) \;|\; c\in {\cal C}}. \label{eq:L2} \tag{L2} \end{align} \noindent In the implementation, step \eqref{eq:L1} is approximated using a Stochastic Gradient Descent (SGD) method. Importantly, this step does not recomputes the training from scratch but uses a hot start for the weights $\bm{w}$. The overall training scheme is presented in Algorithm \ref{alg:learning}. It takes as input the training dataset $({\cal X}, {\cal Y})$, the optimizer step size $\alpha > 0$ and the Lagrangian step size $\rho > 0$. The Lagrangian multipliers are initialized in line \ref{line:1}. The training is performed for a fixed number of epochs, and each epoch optimizes the weights using a minibatch of size $b$. After predicting the voltage and generation power quantities (line \ref{line:4}), the objective and constraint losses are computed (lines \ref{line:6} and \ref{line:7}). The latter uses the Lagrangian multipliers $\bm{\lambda}^k$ associated with current epoch $k$. The model weights are updated in line \ref{line:8}. Finally, after each epoch, the Lagrangian multipliers are updated following step \eqref{eq:L2} described above (lines \ref{line:9} and \ref{line:10}). \begin{algorithm}[!t] \caption{Learning Step} \label{alg:learning} \setcounter{AlgoLine}{0} \SetKwInOut{Input}{input} \Input{$({\cal X}, {\cal Y}):$ Training data\\ $\alpha, \rho:$ Optimizer and Lagrangian step sizes, reps.\!\!\!\!\!\!\!\!\!\!} \label{line:1} $\bm{\lambda}^0 \gets 0 \;\; \forall c \in {\cal C}$\\ \For{epoch $k = 0, 1, \ldots$} { \label{line:2} \ForEach{$(\bm{x}, \bm{y}) \!\gets\! \mbox{minibatch}({\cal X}, {\cal Y})$ of size $b$}{ \label{line:3} $\hat{\bm{y}} \gets \hat{\cal O}[\bm{w}](\bm{x})$\\ \label{line:4} ${\cal L}_o(\hat{\bm{y}}, \bm{y}) \gets \frac{1}{b} \sum_{\ell \in [b]} {\cal L}_v(\bm{y}_\ell, \hat{\bm{y}}_\ell) + {\cal L}_\theta(\bm{y}_\ell, \hat{\bm{y}}_\ell)+$\!\!\!\!\\ \nonl $\hspace*{87pt} {\cal L}_p(\bm{y}_\ell, \hat{\bm{y}}_\ell) + {\cal L}_q(\bm{y}_\ell, \hat{\bm{y}}_\ell)$\\ \label{line:6} ${\cal L}_c(\bm{x},\hat{\bm{y}}) \gets \frac{1}{b} \sum_{\ell \in [b]} \sum_{c \in {\cal C}} \lambda_c^k \nu_c(\bm{x}_\ell,\hat{\bm{y}}_\ell) $\\ \label{line:7} $\omega \gets \omega - \alpha \nabla_{\omega} ({\cal L}_o(\hat{\bm{y}}, \bm{y}) + {\cal L}_c(\bm{x},\hat{\bm{y}}))\!\!\!\!$ \label{line:8} } \ForEach{$c \in {\cal C}$} { \label{line:9} $\lambda^{k+1}_c \gets \lambda^k + \rho \nu_c(\bm{x},\hat{\bm{y}})$ \label{line:10} } } \end{algorithm} \begin{table*}[!t] \centering \resizebox{0.65\linewidth}{!} { \begin{tabular}{l|rrrrr |rr rr rr} \toprule \multicolumn{6}{l}{} & \multicolumn{2}{c}{$\Delta_{1\%}~p^d$} & \multicolumn{2}{c}{$\Delta_{2\%}~p^d$} & \multicolumn{2}{c}{$\Delta_{3\%}~p^d$} \\ \cmidrule(r){7-8} \cmidrule(r){9-10} \cmidrule(r){11-12} \multicolumn{1}{l}{\textbf{Test Case}} & $|{\cal N}|$ & $|{\cal E}|$ & $l$ & $g$ & \multicolumn{1}{r}{$|({\cal X}, {\cal Y})|$} &$(\%)$ & MW &$(\%)$ & MW &$(\%)$ & MW\\ \midrule \textbf{14\_ieee }& 14& 40& 11 & 2 & 395806 &2.05& 5.3 &2.59& 6.7 &3.15 & 8.2 \\ \textbf{30\_ieee }& 30& 82& 21 & 2 & 273506 &2.47& 7.0 &2.94& 8.3 &3.36 & 9.5 \\ \textbf{39\_epri }& 39& 92& 21 & 10 & 287390 &2.49&156.3 &2.94& 183.9 &3.42 & 213.9 \\ \textbf{57\_ieee }& 57& 160& 42 & 4 & 269140 &2.65&33.2 &3.19& 39.9 &3.67 & 45.9 \\ \textbf{73\_ieee\_rts}& 73& 240& 51 & 73 & 373142 &2.72&233.2 &3.28& 281.2 &3.80 & 324.9 \\ \textbf{89\_pegase }& 89& 420& 35 & 12 & 338132 &2.50&204.0 &3.06& 250.1 &3.53 & 288.0 \\ \textbf{118\_ieee }& 118& 372& 99 & 19 & 395806 &3.03&128.6 &3.50& 148.8 &3.98 & 169.1 \\ \textbf{162\_ieee\_dtc}& 162& 568& 113& 12 & 237812 &3.10&296.5 &3.54& 337.9 &4.04 & 385.9 \\ \textbf{189\_edin }& 189& 412& 41 & 35 & 69342 &2.85&39.1 &3.27& 44.8 &3.72 & 50.9 \\ \textbf{300\_ieee }& 300& 822& 201& 57 & 235732 &3.25&775.9 &3.78& 902.8 &4.22 & 1007.0 \\ \bottomrule \end{tabular} } \caption{The Power Networks Adopted as Benchmarks. \label{tbl:dataset} \end{table*} \section{Experiments} This section evaluates the predictive accuracy of OPF-DNN and compares it to the AC model and its linear DC approximation. It also analyzes various design decisions in detail. \paragraph{Data sets} The experiments examine the proposed models on a variety of mid-sized power networks from the NESTA library \cite{Coffrin14Nesta}. The ground truth data are constructed as follows: For each network, different benchmarks are generated by altering the amount of nominal load $\bm{x} \!=\! (\bm{p}^d, \bm{q}^d)$ within a range of $\pm 20\%$. The loads are thus sampled from the distributions $\bm{x}'=(\bm{p}^d{}', \bm{q}^d{}') \sim \text{Uniform}(0.8\bm{x}, 1.2\bm{x})$. Notice that the resulting benchmarks have load demands that vary by a factor of up to $20\%$ of their nominal values: Many of them become congested and significantly harder computationally than their original counterparts. A network value that constitutes a dataset entry $(\bm{x}', \bm{y}')$ is a feasible OPF solution obtained by solving the AC-OPF problem \mbox{detailed in Model~\ref{model:ac_opf}}. When the learning step exploits an existing hot-start state $\bm{s}_0$, the training test cases have the property that the total active loads $\| \bm{p}^d_0 \|_1$ in $\bm{s}_0$ are within 1, 2, and 3\% of the total active loads $\| \bm{p}^d \|_1$. Note that, while the aggregated loads follow this restriction, the individual loads may have greater variations. Those are illustrated in Table \ref{tbl:dataset} for the 1\% ($\Delta_{1\%} p^d$), 2\% ($\Delta_{2\%} p^d$) and 3\% ($\Delta_{3\%} p^d$) cases, where the average variations are expressed both in percentage of the total load and in absolute values (MWs). As can be seen, the variations are significant. The table also describes the dataset sizes, including the number of buses $|{\cal N}|$ and transmission lines $|{\cal E}|$ of the networks. The column titled $l$ and $g$ denote, respectively, the number of load and generator buses of the networks. The data are normalized using the per unit (pu) system so that all quantities are close to 1. The experiments use a $80/20$ train-test split and report results on the test set. \paragraph{Settings} The experiments examine the OPF-DNN models whose features are summarized in Table \ref{tbl:models}. ${\cal M}_{\text{B}}$ refers to the baseline model: It minimizes the loss function ${\cal L}_o$ described in Equation \eqref{basic_loss}. ${\cal M}_{\text{C}}$ exploits the problem constraints and minimizes the loss: ${\cal L}_o + \sum_{c \in {\cal C}} \lambda_c \nu_c$, with ${\cal L}_o$ defined in Equation \eqref{obj_advanced} and all $\lambda_c$ set to $1$. The suffix $S$ is used for the models that exploit a hot-start state, and $D$ is used for the model that exploit the Lagrangian dual scheme. In particular, ${\cal M}_{\text{C}}^{\text{D}}$ extends ${\cal M}_{\text{C}}$ by learning the Lagrangian multipliers $\lambda_c$ using the Lagrangian dual scheme described in Algorithm \ref{alg:learning}. ${\cal M}_{\text{CS}}$ uses the same loss function as ${\cal M}_{\text{C}}$, but it adopts the architecture outlined in Figure \ref{fig:dlopf}. ${\cal M}_{\text{CS}}^{\text{L}}$ sets the Lagrangian weights as trainable parameters and learns them during the training cycle. Finally, ${\cal M}_{\text{CS}}^{\text{D}}$ extends ${\cal M}_{\text{CS}}$ by learning the Lagrangian multipliers $\lambda_c$ using the Lagrangian dual scheme (see Algorithm \ref{alg:learning}). The latter model is also denoted with OPF-DNN in the paper. The details of the models architectures and loss functions are provided in the appendix. All the models that exploit a hot-start state are trained over datasets using states differing by at most $1\%$. The section also reports a comparison of the DNN-OPF model trained over hot-start state datasets using states differing by at most $1$, $2$, and $3\%$. \begin{table}[!tb] \centering \resizebox{\linewidth}{!} { \begin{tabular}{l|cccccc} \toprule \multicolumn{1}{l}{\textbf{Model}} & {${\cal M}_{\text{B}}$} & {${\cal M}_{\text{C}}$} & {${\cal M}_{\text{C}}^{\text{D}}$} & {${\cal M}_{\text{CS}}$} & {${\cal M}_{\text{CS}}^{\text{L}}$} & {${\cal M}_{\text{CS}}^{\text{D}}$} \\ \midrule Exploit \textbf{C}onstraints & $\Box$ & $\text{\rlap{$\checkmark$}}\Box$ & $\text{\rlap{$\checkmark$}}\Box$ &$\text{\rlap{$\checkmark$}}\Box$ &$\text{\rlap{$\checkmark$}}\Box$ & $\text{\rlap{$\checkmark$}}\Box$ \\ Exploit hot-start \textbf{S}tate & $\Box$ & $\Box$ & $\Box$ &$\text{\rlap{$\checkmark$}}\Box$ &$\text{\rlap{$\checkmark$}}\Box$ & $\text{\rlap{$\checkmark$}}\Box$ \\ Train \textbf{L}agrangian weights & $\Box$ & $\Box$ & $\Box$ & $\Box$ &$\text{\rlap{$\checkmark$}}\Box$ & $\Box$ \\ Lagrangian \textbf{D}ual update & $\Box$ & $\Box$ & $\text{\rlap{$\checkmark$}}\Box$ & $\Box$ & $\Box$ & $\text{\rlap{$\checkmark$}}\Box$ \\ \bottomrule \end{tabular} } \caption{The DNN Models Adopted.} \label{tbl:models} \end{table} The models were implemented using the Julia package PowerModels.jl \cite{Coffrin:18} with the nonlinear solver IPOPT \cite{wachter06on} for solving the nonlinear AC model and its the DC approximation. The DDN models were implemented using PyTorch \cite{paszke:17} with Python 3.0. The training was performed using NVidia Tesla V100 GPUs and and 2GHz Intel Cores. The AC and DC-OPF models were solved using the same CPU cores. Training each network requires less than 2GB of RAM. The training uses the Adam optimizer with learning rate ($\alpha\!=\!0.001$) and $\beta$ values $(0.9, 0.999)$ and was performed for $80$ epochs using batch sizes $b=64$. Finally, the Lagrangian step size $\rho$ is set to $0.01$. \subsection{Prediction Errors} \def\textbf{\textbf} \begin{table*}[t] \centering \small \resizebox{0.9\linewidth}{!} { \begin{tabular}{llrrrrr|llrrrrr} \toprule \textbf{Test case} & \textbf{Model} & $\hat{\bm{p}}^g$ & $\hat{\bm{q}}^g$ & $\hat{\bm{v}}$& $\hat{\bm{\theta}}$& $\tilde{\bm{p}}^f$ & \textbf{Test case} & \textbf{Model} & $\hat{\bm{p}}^g$ & $\hat{\bm{q}}^g$ & $\hat{\bm{v}}$& $\hat{\bm{\theta}}$& $\tilde{\bm{p}}^f$ \\ \midrule \multirow{5}{*}{\textbf{14\_ieee}} & ${\cal M}_{\text{B}}$ &5.7820 &11.004 &0.7310 &1.4050 &1.9070 &\multirow{5}{*}{\textbf{89\_pegase}}& ${\cal M}_{\text{B}}$ &0.2516&0.2250&90.689&37.176&3133.4\\ & ${\cal M}_{\text{C}}$ &6.1396 &11.315 &1.2790 &1.4100 &0.4640 && ${\cal M}_{\text{C}}$ &0.3589&0.2320&77.295&7.9760&42.962\\ & ${\cal M}_{\text{C}}^{\text{D}}$ &5.5698 &7.1120 &6.0682 &0.0500 &0.4970 && ${\cal M}_{\text{C}}^{\text{D}}$ &0.3549&0.3361&2.8380&17.921&24.529\\ & ${\cal M}_{\text{CS}}$ &0.2756 &0.6980 &0.1180 &0.1480 &0.1050 && ${\cal M}_{\text{CS}}$ &0.1074&0.0860&9.4168&0.8240&6.4130\\ & ${\cal M}_{\text{CS}}^{\text{L}}$&0.2703 &0.7450 &0.1860 &0.0760 &0.1690 && ${\cal M}_{\text{CS}}^{\text{L}}$&0.1014&0.0830&10.199&0.9120&9.3560\\ & ${\cal M}_{\text{CS}}^{\text{D}}$&\textbf{0.0234}&\textbf{0.0470} &\textbf{0.0050} &\textbf{0.0070} &\textbf{0.0530} && ${\cal M}_{\text{CS}}^{\text{D}}$&\textbf{0.0797}&\textbf{0.0770}&\textbf{0.0862}&\textbf{0.0530}&\textbf{5.0160}\\ \hline \multirow{5}{*}{\textbf{30\_ieee}} & ${\cal M}_{\text{B}}$ &3.3465&2.0270&14.699&4.3400&27.213&\multirow{5}{*}{\textbf{118\_ieee}}& ${\cal M}_{\text{B}}$ &0.2150&2.9910&7.1520&4.2600&38.863\\ & ${\cal M}_{\text{C}}$ &3.1289&1.3380&2.7346&1.5930&1.6820&& ${\cal M}_{\text{C}}$ &0.1810&3.2570&6.9150&4.6520&6.4730\\ & ${\cal M}_{\text{C}}^{\text{D}}$ &3.1230&1.1096&0.1596&0.2590&2.3000&& ${\cal M}_{\text{C}}^{\text{D}}$ &0.1787&1.0840&10.002&0.2160&2.8100\\ & ${\cal M}_{\text{CS}}$ &0.3052&0.1104&0.3130&0.0580&0.2030&& ${\cal M}_{\text{CS}}$ &0.0380&0.6900&0.1170&1.2750&0.6640\\ & ${\cal M}_{\text{CS}}^{\text{L}}$&0.2900&0.3200&0.3120&0.0600&0.1600&& ${\cal M}_{\text{CS}}^{\text{L}}$&0.0380&0.6870&0.1380&1.2750&0.6100\\ & ${\cal M}_{\text{CS}}^{\text{D}}$&\textbf{0.0055}&\textbf{0.0320}&\textbf{0.0070}&\textbf{0.0041}&\textbf{0.0620}&& ${\cal M}_{\text{CS}}^{\text{D}}$&\textbf{0.0340}&\textbf{0.6180}&\textbf{0.0290}&\textbf{0.2070}&\textbf{0.4550}\\ \hline \multirow{5}{*}{\textbf{39\_epri}} & ${\cal M}_{\text{B}}$ &0.2299&1.2600&98.726&58.135&202.67&\multirow{5}{*}{\textbf{162\_ieee}}& ${\cal M}_{\text{B}}$ &0.2310&1.2070&9.1810&5.4800&82.076\\ & ${\cal M}_{\text{C}}$ &0.2180&1.2790&17.104&2.5940&80.064&& ${\cal M}_{\text{C}}$ &0.2820&1.6120&7.1210&5.3620&14.706\\ & ${\cal M}_{\text{C}}^{\text{D}}$ &0.2216&1.2610&2.7346&4.0730&41.395&& ${\cal M}_{\text{C}}^{\text{D}}$ &0.2772&0.9873&6.8359&1.1950&15.456\\ & ${\cal M}_{\text{CS}}$ &0.0559&0.1080&2.2350&0.2880&1.8360&& ${\cal M}_{\text{CS}}$ &0.0750&0.3760&0.1760&0.3720&0.7520\\ & ${\cal M}_{\text{CS}}^{\text{L}}$ &0.0533&0.1440&2.2010&0.2040&2.2000&& ${\cal M}_{\text{CS}}^{\text{L}}$&0.0750&0.3690&0.1750&0.3950&0.6750\\ & ${\cal M}_{\text{CS}}^{\text{D}}$ &\textbf{0.0024}&\textbf{0.0720}&\textbf{0.0280}&\textbf{0.0100}&\textbf{1.2660}&& ${\cal M}_{\text{CS}}^{\text{D}}$&\textbf{0.0710}&\textbf{0.2440}&\textbf{0.0770}&\textbf{0.3660}&\textbf{0.4920}\\ \hline \multirow{5}{*}{\textbf{57\_ieee}} & ${\cal M}_{\text{B}}$ &2.3255&1.6380&5.1002&1.5680&14.386&\multirow{5}{*}{\textbf{189\_edin}}& ${\cal M}_{\text{B}}$ &0.4979&0.1160&42.295&5.2970&4371.1\\ & ${\cal M}_{\text{C}}$ &2.2658&1.4850&3.5402&2.0890&2.8850&& ${\cal M}_{\text{C}}$ &0.5748&0.0890&18.577&3.9640&24.918\\ & ${\cal M}_{\text{C}}^{\text{D}}$ &2.2708&1.5138&9.5861&0.0680&1.6170 && ${\cal M}_{\text{C}}^{\text{D}}$ &0.4081&0.0711&7.3091&3.2220&15.774\\ & ${\cal M}_{\text{CS}}$ &0.1308&0.3320&0.2150&0.0430&0.2410&& ${\cal M}_{\text{CS}}$ &0.1178&0.0190&1.9913&0.7040&3.8470\\ & ${\cal M}_{\text{CS}}^{\text{L}}$&0.1340&0.3300&0.2110&0.0360&0.2280&& ${\cal M}_{\text{CS}}^{\text{L}}$&0.1178&0.0180&2.4300&0.4960&3.5810\\ & ${\cal M}_{\text{CS}}^{\text{D}}$&\textbf{0.0170}&\textbf{0.0231}&\textbf{0.0150}&\textbf{0.0080}&\textbf{0.1520}&& ${\cal M}_{\text{CS}}^{\text{D}}$&\textbf{0.0907}&\textbf{0.0110}&\textbf{0.0982}&\textbf{0.3330}&\textbf{1.6520}\\ \hline \multirow{5}{*}{\textbf{73\_ieee}} & ${\cal M}_{\text{B}}$ &0.2184&0.0380&18.414&5.0550&106.08& \multirow{5}{*}{\textbf{300\_ieee}} & ${\cal M}_{\text{B}}$ &0.0838&0.0900&28.025&12.137&125.47\\ & ${\cal M}_{\text{C}}$ &0.0783&0.0360&2.8074&1.2500&7.8630&& ${\cal M}_{\text{C}}$ &0.0914&0.0860&14.727&7.7450&34.133\\ & ${\cal M}_{\text{C}}^{\text{D}}$ &0.0775&0.5302&2.7038&0.3880&6.2980&& ${\cal M}_{\text{C}}^{\text{D}}$ &0.0529&0.0491&11.096&7.3830&27.554\\ & ${\cal M}_{\text{CS}}$ &0.0061&0.0160&0.2192&0.1190&0.4890&& ${\cal M}_{\text{CS}}$ &0.0174&0.0240&3.1130&7.2330&26.905\\ & ${\cal M}_{\text{CS}}^{\text{L}}$&0.0063&0.0150&0.3156&0.1260&0.4160&& ${\cal M}_{\text{CS}}^{\text{L}}$&0.0139&0.0240&0.2180&4.6480&2.0180\\ & ${\cal M}_{\text{CS}}^{\text{D}}$&\textbf{0.0050}&\textbf{0.0101}&\textbf{0.0235}&\textbf{0.1180}&\textbf{0.3300}&& ${\cal M}_{\text{CS}}^{\text{D}}$&\textbf{0.0126}&\textbf{0.0190}&\textbf{0.0610}&\textbf{2.5670}&\textbf{1.1360}\\ \bottomrule \end{tabular} } \caption{Prediction Errors (\%).} \label{tbl:prediction_errors} \end{table*} This section first analyzes the prediction error of the DNN models. Table \ref{tbl:prediction_errors} reports the average L1 distance between the predicted generator active $\hat{\bm{p}}^g$ and reactive $\hat{\bm{q}}^g$ power, voltage magnitude $\hat{\bm{v}}$ and angles $\hat{\bm{\theta}}$ and the original quantities. It also reports the errors of the predicted flows $\tilde{\bm{p}}^f$ (which use the generator power and voltage predictions) and are important to assess the fidelity of the predictions. The distances are reported in percentage: $\frac{\|\hat{\bm{x}} - \bm{x}\|_1}{\|\bm{x}\|_1} \!\times\! 100$, for quantity $\bm{x}$, and best results are highlighted in bold. For completeness, the results report an extended version of model ${\cal M}_{\text{B}}$, that allow us to predict quantities $\bm{\theta}$ and $\bm{q}^d$. The latter were obtained by extending ${\cal M}_{\text{B}}$ network using two additional layers, Out-$\bm{\theta}$ and Out-$\bm{q}^g$ for, respectively, predicting the voltage angles and the reactive generator power, analogously to those in model ${\cal M}_{\text{C}}$. Additionally, its loss function was extended as: \begin{align*} {\cal L}_o(\bm{y}, \hat{\bm{y}}) &= \| \bm{v} - \hat{\bm{v}}\|^2 + \| \bm{\theta} - \hat{\bm{\theta}}\|^2 \\ &+ \| \bm{p}^g - \hat{\bm{p}}^g\| ^2 + \| \bm{q}^g - \hat{\bm{q}}^g\| ^2. \end{align*} The prediction errors for quantities $\bm{p}^g$ and $\bm{v}$ did not degrade in this extended version with respect to those predicted by the simple ${\cal M}_{\text{B}}$ network. A clear trend appears: The prediction errors decrease with the increasing of the model complexity. In particular, model ${\cal M}_{\text{C}}$, which exploits the problem constraints, predicts much better voltage quantities and power flows than ${\cal M}_{\text{B}}$. The use of the Lagrangian Duals, in model $\cal{M}_{\text{CS}}$, further improve the predictions, especially those associated to the voltage magnitude and angles and power flows. ${\cal M}_{\text{CS}}$, which exploits the problem constraints and a hot-start state, improves ${\cal M}_{\text{C}}$ predictions by one order of magnitude in most of the cases. {\em Finally, the use of the Lagrangian dual to find the best weights (${\cal M}_{\text{CS}}^{\text{D}}$) further improves ${\cal M}_{\text{CS}}$ predictions by up to an additional order of magnitude.} \smallskip Figure \ref{fig:prediction_errors1} and \ref{fig:prediction_errors2} further illustrate the importance of modeling the problem constraints and exploiting a hot-start state. The figures illustrate the prediction errors on the operational parameters $\bm{v}$ and $\bm{p}^g$, as well as on the angle magnitude $\bm{\theta}$ and the power flows $\bm{p}^f$, at the varying of the load demands in the power networks (from -20\% to 20\% of the aggregated nominal load values). The reason for the differences in the $x$-axis range in the various networks, is due to that, the increased load values may produce congested scenarios that cannot be accommodated. The plots are in log-10 scale and clearly indicate that the models exploiting the problem structure better generalize to the different network settings. \begin{figure*}[!h] \centering \includegraphics[width=0.5\linewidth]{legend_5}\\ \footnotesize{NESTA case 14\_ieee}\\ \includegraphics[width=0.24\linewidth]{nesta14_ML_perc_error_vm} \includegraphics[width=0.24\linewidth]{nesta14_ML_perc_error_pg} \includegraphics[width=0.24\linewidth]{nesta14_ML_deg_error_va} \includegraphics[width=0.24\linewidth]{nesta14_ML_error_flow}\\ \footnotesize{NESTA case 30\_ieee}\\ \includegraphics[width=0.24\linewidth]{nesta30_ML_perc_error_vm} \includegraphics[width=0.24\linewidth]{nesta30_ML_perc_error_pg} \includegraphics[width=0.24\linewidth]{nesta30_ML_deg_error_va} \includegraphics[width=0.24\linewidth]{nesta30_ML_error_flow}\\ \footnotesize{NESTA case 39\_epri}\\ \includegraphics[width=0.24\linewidth]{nesta39_ML_perc_error_vm} \includegraphics[width=0.24\linewidth]{nesta39_ML_perc_error_pg} \includegraphics[width=0.24\linewidth]{nesta39_ML_deg_error_va} \includegraphics[width=0.24\linewidth]{nesta39_ML_error_flow}\\ \footnotesize{NESTA case 57\_ieee}\\ \includegraphics[width=0.24\linewidth]{nesta57_ML_perc_error_vm} \includegraphics[width=0.24\linewidth]{nesta57_ML_perc_error_pg} \includegraphics[width=0.24\linewidth]{nesta57_ML_deg_error_va} \includegraphics[width=0.24\linewidth]{nesta57_ML_error_flow} \\ \footnotesize{NESTA case 73\_ieee\_rts}\\ \includegraphics[width=0.24\linewidth]{nesta73_ML_perc_error_vm} \includegraphics[width=0.24\linewidth]{nesta73_ML_perc_error_pg} \includegraphics[width=0.24\linewidth]{nesta73_ML_deg_error_va} \includegraphics[width=0.24\linewidth]{nesta73_ML_error_flow} \caption{Prediction Errors (\%) at the varying of the nominal network loads.} \label{fig:prediction_errors1} \end{figure*} \begin{figure*}[!h] \centering \includegraphics[width=0.5\linewidth]{legend_5} \footnotesize{NESTA case 89\_pegase}\\ \centering \includegraphics[width=0.24\linewidth]{nesta89_ML_perc_error_vm} \includegraphics[width=0.24\linewidth]{nesta89_ML_perc_error_pg} \includegraphics[width=0.24\linewidth]{nesta89_ML_deg_error_va} \includegraphics[width=0.24\linewidth]{nesta89_ML_error_flow} \footnotesize{NESTA case 118\_ieee}\\ \centering \includegraphics[width=0.24\linewidth]{nesta118_ML_perc_error_vm} \includegraphics[width=0.24\linewidth]{nesta118_ML_perc_error_pg} \includegraphics[width=0.24\linewidth]{nesta118_ML_deg_error_va} \includegraphics[width=0.24\linewidth]{nesta118_ML_error_flow} \footnotesize{NESTA case 162\_ieee\_dtc}\\ \centering \includegraphics[width=0.24\linewidth]{nesta162_ML_perc_error_vm} \includegraphics[width=0.24\linewidth]{nesta162_ML_perc_error_pg} \includegraphics[width=0.24\linewidth]{nesta162_ML_deg_error_va} \includegraphics[width=0.24\linewidth]{nesta162_ML_error_flow} \footnotesize{NESTA case 189\_edin}\\ \centering \includegraphics[width=0.24\linewidth]{nesta189_ML_perc_error_vm} \includegraphics[width=0.24\linewidth]{nesta189_ML_perc_error_pg} \includegraphics[width=0.24\linewidth]{nesta189_ML_deg_error_va} \includegraphics[width=0.24\linewidth]{nesta189_ML_error_flow} \footnotesize{NESTA case 300\_ieee}\\ \centering \includegraphics[width=0.24\linewidth]{nesta300_ML_perc_error_vm} \includegraphics[width=0.24\linewidth]{nesta300_ML_perc_error_pg} \includegraphics[width=0.24\linewidth]{nesta300_ML_deg_error_va} \includegraphics[width=0.24\linewidth]{nesta300_ML_error_flow} \caption{Prediction Errors (\%) at the varying of the nominal network loads.} \label{fig:prediction_errors2} \end{figure*} \begin{table*}[!h] \centering \small \resizebox{0.99\linewidth}{!} { \begin{tabular}{l l|rrrrrrr|rrrrrrrr} \toprule \multicolumn{2}{l}{\textbf{Test case}} & {DC}& ${\cal M}_{\text{B}}$& ${\cal M}_{\text{C}}$& ${\cal M}_{\text{C}}^{\text{D}}$& ${\cal M}_{\text{CS}}$& ${\cal M}_{\text{CS}}^{\text{L}}$& ${\cal M}_{\text{CS}}^{\text{D}}$ & {DC}& {${\text{LF}_S}$} & ${\cal M}_{\text{B}}$& ${\cal M}_{\text{C}}$& ${\cal M}_{\text{C}}^{\text{D}}$& ${\cal M}_{\text{CS}}$& ${\cal M}_{\text{CS}}^{\text{L}}$& ${\cal M}_{\text{CS}}^{\text{D}}$\\ \midrule \multirow{2}{*}{\textbf{14\_ieee}} & $\bm{p}^g$ & 2.4020 & 5.7048 & 6.0474 &5.5056 & 0.2131 & 0.2052 & \textbf{0.0233}& 0.1359 &4.3518 & 1.1061 & 0.8154 &0.8314 & 0.2649 & 0.2571 & \textbf{0.0003}\\ & $\bm{v}$ & 1.8352 & 0.9174 & 0.8636 &0.3169 & 0.0937 & 0.0944 & \textbf{0.0017}& 3.0365 &0.3450 & 0.3075 & 0.7808 &0.6916 & 0.1516 & 0.2170 & \textbf{0.0018}\\ \multirow{2}{*}{\textbf{30\_ieee}} & $\bm{p}^g$ & 2.6972 & 2.0793 & 1.9688 &1.7344 & 0.1815 & 0.1320 & \textbf{0.0007}& 0.1907 &13.504 & 2.1353 & 1.8268 &1.5523 & 0.2735 & 0.2853 & \textbf{0.0058}\\ & $\bm{v}$ & 1.2929 & 83.138 & 0.4309 &0.2869 & 0.0944 & 0.0728 & \textbf{0.0037}& 3.4931 &0.4829 & 6.2996 & 2.7458 &0.2270 & 0.4299 & 0.4168 & \textbf{0.0086}\\ \multirow{2}{*}{\textbf{39\_epri}} & $\bm{p}^g$ & 0.0731 & 0.2067 & 0.1700 &0.0857 & 0.0516 & 0.0488 & \textbf{0.0005}& 0.2163 &2.1260 & 0.1350 & 0.1467 &0.1160 & 0.0140 & 0.0155 & \textbf{0.0023}\\ & $\bm{v}$ & 1.1086 & 95.944 & 4.2008 &22.921 & 0.3273 & 0.3131 & \textbf{0.0222}& 1.7251 &0.8573 & 6.8089 & 3.1999 &6.7880 & 2.3860 & 2.3476 & \textbf{0.0313}\\ \multirow{2}{*}{\textbf{57\_ieee}} & $\bm{p}^g$ & 0.3354 & 0.9733 & 0.7507 &0.8837 & 0.1166 & 0.1165 & \textbf{0.0076} & \textbf{0.0112}&4.7722 & 1.2882 & 1.2378 &1.4518 & 0.1710 & 0.1752 & 0.0206\\ & $\bm{v}$ & 0.9091 & 4.0504 & 2.5770 &0.4038 & 0.1771 & 0.1650 & \textbf{0.0384} & 0.2825 &1.2243 & 1.5682 & 1.1176 &0.4724 & 0.2772 & 0.2626 & \textbf{0.0482}\\ \multirow{2}{*}{\textbf{73\_ieee\_rts}} & $\bm{p}^g$ & 0.0204 & 0.2078 & 0.0482 &0.0214 & 0.0054 & \textbf{0.0053} & \textbf{0.0053}& 0.0304 &5.2103 & 0.1144 & 0.0543 &0.0239 & 0.0081 & 0.0082 & \textbf{0.0077}\\ & $\bm{v}$ & 0.1528 & 14.074 & 0.1995 &0.4470 & 0.0611 & 0.0599 & \textbf{0.0337} & 4.1537 &0.1496 & 4.8500 & 2.8951 &0.2525 & 0.2488 & 0.3433 & \textbf{0.0516}\\ \multirow{2}{*}{\textbf{89\_pegase}} & $\bm{p}^g$ & 0.1641 & 0.1440 & 0.2228 &0.2166 & \textbf{0.0420} & 0.0443 & 0.0486 & 3.0662 &7.3622 & 0.1834 & 0.2524 &0.2623 & 0.0900 & 0.1035 & \textbf{0.0827}\\ & $\bm{v}$ & 3.8584 & 86.795 & 73.506 &56.519 & 5.6660 & 6.4734 & \textbf{1.2492} &\textbf{1.1776} &0.6913 &4.1315 & 4.0437 &4.0373 & 3.9890 & 3.9410 & 1.2610\\ \multirow{2}{*}{\textbf{118\_ieee}} & $\bm{p}^g$ & 0.2011 & 0.1071 & 0.0359 &0.0216 & 0.0043 & 0.0056 & \textbf{0.0038} & 0.5865 &3.8034 & 0.1353 & 0.1557 &0.1050 & 0.0372 & 0.0391 & \textbf{0.0368}\\ & $\bm{v}$ & 1.9971 & 3.4391 & 0.8995 &0.0791 & 0.0956 & 0.0920 & \textbf{0.0866} & 2.2780 &0.9772 & 4.5972 & 6.0326 &0.4303 & 0.1599 & 0.1768 & \textbf{0.1335}\\ \multirow{2}{*}{\textbf{162\_ieee\_dtc}} & $\bm{p}^g$ & 0.6727 & 0.1054 & 0.0673 &0.1442 & 0.0587 & 0.0571 & \textbf{0.0558} & 0.6917 &17.873 & 0.1648 & 0.2389 &0.1575 & 0.0977 & 0.0981 & \textbf{0.0954}\\ & $\bm{v}$ & 3.7718 & 3.6372 & 6.7930 &4.2568 & 0.3276 & 0.3202 & \textbf{0.2565} & 0.5820 &1.4595 &0.4378 & 0.6922 &0.5824 & \textbf{0.2846} & 0.2906 & 0.2921\\ \multirow{2}{*}{\textbf{189\_edin}} & $\bm{p}^g$ & 1.0514 & 0.2694 & 0.3742 &0.1915 & 0.0951 & 0.0966 & \textbf{0.0438} & 0.9891 &3.9627 & 0.3669 & 0.5026 &0.3999 & 0.1194 & 0.1202 & \textbf{0.0869}\\ & $\bm{v}$ & 5.5054 & 39.188 & 3.5797 &10.661 & 1.6986 & 2.4568 & \textbf{0.1041} & 0.4561 &0.4525 & 1.8800 & 1.3474 &1.6144 & 0.3469 & 0.4621 & \textbf{0.0882}\\ \multirow{2}{*}{\textbf{300\_ieee}} & $\bm{p}^g$ & 0.1336 & 0.0447 & 0.0339 &0.0241 & 0.0091 & 0.0096 & \textbf{0.0084} & 0.1717 &14.813 & 0.0644 & 0.0766 &0.0476 & 0.0204 & 0.0205 & \textbf{0.0175}\\ & $\bm{v}$ & 3.8526 & 31.698 & 10.292 &4.0253 & 0.2383 & 2.2161 & \textbf{0.1994} & 0.6854 &1.5737 & 2.9985 & 2.1296 &2.3136 & 1.1553 & 0.2539 & \textbf{0.2196}\\ \cmidrule(r){1-9} \cmidrule(l){10-16} \multirow{2}{*}{\textbf{Total Avg. (\%)}} & $\bm{p}^g$ & 0.7751 & 0.9843 & 0.9719 & 0.8829 & 0.0777 & 0.0721 & \textbf{0.0198} & 0.6090 &0.8214 & 0.5694 & 0.5307 & 0.4948 & 0.1096 & 0.1123 & \textbf{0.0356} \\ & $\bm{v}$ & 2.4284 & 36.2881 & 10.3342 & 9.9916 & 0.8780 & 1.2264 & \textbf{0.1995} & 1.7870 &0.9818 & 3.3879 & 2.4985 & 1.7409 & 0.9429 & 0.8712 & \textbf{0.2136} \\ \bottomrule \end{tabular} } \caption{Average distances (\%) for the active power (top rows) and voltage magnitude (bottom rows) of the Load Flow solutions w.r.t. the corresponding predictions (left table) and w.r.t.~the AC-OPF solutions (right table).} \label{tbl:load_flow} \end{table*} \subsection{Load Flow Analysis} Having assessed the predictive capabilities of OPF-DNN, the next results focus on evaluating its practicality by simulating the prediction results in an operational environment. The idea is to measure how much the predictions need to be adjusted in order to satisfy the operational and physical constraints. The experiments perform a load flow (Model \ref{model:load_flow}) on the predicted $\hat{\bm{p}}^g$ and $\hat{\bm{v}}$ values. In addition to comparing the DNN model variants, the results also report the deviations of the linear DC model from an AC-feasible solution. The DC model is widely used in power system industry. The results also reports the performance of a baseline load flow model ${\text{LF}_S}$ that finds a feasible solution using the hot-start state $\bm{s}_0$ as reference point in its objective function. These results highlight the value of learning in OPF-DNN: The reference point alone is not sufficient to find high quality solutions. The results are tabulated in Table \ref{tbl:load_flow}. The left table reports the L1 distances, in percentage, of the predictions $\hat{\bm{p}}^g$ and $\hat{\bm{v}}$ to the solutions $\bm{p}^g$ and $\bm{v}$ of the load flows. Trends similar to the previous section are observed, with ${\cal M}_{\text{CS}}^{\text{D}}$ being substantially more accurate than all other DNN versions. The table also shows that ${\cal M}_{\text{CS}}^{\text{D}}$ is up to two orders of magnitude more precise than the DC model. The right table reports the L1 distances of the load flow solutions to the optimal AC-OPF solutions. The results follow a similar trend, with the OPF-DNN model (${\cal M}_{\text{CS}}^{\text{D}}$) being at least one order of magnitude more precise than the DC model and the baseline ${\text{LF}_S}$ model. The bottom rows of the table show the average results over all the power network adopted in the experimental analysis. Note that the very high accuracy of OPF-DNN may render the use of a load flow optimization, to restore feasibility, unnecessary. \emph{These results are significant: They suggest that OPF-DNN has the potential to replace the DC model as an AC-OPF approximation and deliver generator setpoints with greater fidelity.} \begin{table}[!t] \centering \small \resizebox{\linewidth}{!} { \begin{tabular}{l|rrrrrr} \toprule \multicolumn{1}{l}{\textbf{Test Case}} & \textbf{DC}& ${\text{LF}_S}$ & \textbf{${\cal M}_{\text{B}}$}& \textbf{${\cal M}_{\text{C}}$}& \textbf{${\cal M}_{\text{CS}}$}& \textbf{${\cal M}_{\text{CS}}^{\text{D}}$}\\ \midrule \textbf{14\_ieee} &5.1792&4.5246&0.7562&0.6290&0.2614&\textbf{0.0007}\\ \textbf{30\_ieee} &7.9894&8.2411&2.9447&2.1316&0.5433&\textbf{0.0180}\\ \textbf{39\_epri} &0.9094&2.2869&0.1901&0.0752&0.0537&\textbf{0.0003}\\ \textbf{57\_ieee} &1.7758&3.8445&1.1115&1.0609&0.2025&\textbf{0.0527}\\ \textbf{73\_ieee\_rts} &2.6846&1.4581&9.4364&3.2399&0.5143&\textbf{0.4586}\\ \textbf{89\_pegase} &1.5089&2.6287&0.3284&0.3274&0.3347&\textbf{0.1494}\\ \textbf{118\_ieee} &4.7455&1.0389&1.0973&1.1897&\textbf{0.5300}&0.5408\\ \textbf{162\_ieee\_dtc} &6.2090&4.2094&0.5021&0.8360&0.3162&\textbf{0.2845}\\ \textbf{189\_edin} &9.9803&7.5561&5.3851&2.7770&0.7135&\textbf{0.3177}\\ \textbf{300\_ieee} &4.7508&6.6394&1.9543&1.1576&0.3233&\textbf{0.3011}\\ \cmidrule(r){1-7} {\textbf{Total Avg. (\%)}} & 4.5733 & 4.2428 & 2.3706 & 1.3424 & 0.3793 & \textbf{0.2124}\\ \bottomrule \end{tabular} } \caption{Load Flow vs.~AC-OPF cost distances (\%).} \label{tbl:opf_cost} \end{table} \subsection{Solution Quality and Runtime} The next results compare the accuracy and runtime of the proposed DNN models, the DC approximation, and the load flow baseline ${\text{LF}_S}$, against the \emph{optimal} AC-OPF solutions. The solution quality is measured by first finding the closest AC feasible solution to the predictions returned by the DC or by the DNN models. Then, the cost of the dispatches are compared to the original ones. Table \ref{tbl:opf_cost} reports the average L1-distances of the dispatch costs. The last row reports the average distances across all the test cases. The analysis of the DNN variants exhibits the same trends as before, with the networks progressively improving the results as they exploit the problem constraints (${\cal M}_{\text{C}}$), a hot-start state (${\cal M}_{\text{CS}}$), and use the Lagrangian dual (${\cal M}_{\text{CS}}^{\text{D}}$). \begin{table}[!t] \centering \small \resizebox{0.85\linewidth}{!} { \begin{tabular}{l|rrrr} \toprule \multicolumn{1}{l}{\textbf{Test Case}}& \textbf{AC}& {${\text{LF}_S}$} & \textbf{DC}& \textbf{OPF-DNN}\\ \midrule \textbf{14\_ieee} &0.0332 &0.0430&0.0075&0.0000\\ \textbf{30\_ieee} &0.1023 &0.0755&0.0148&0.0000\\ \textbf{39\_epri} &0.2169 &0.0968&0.0232&0.0000\\ \textbf{57\_ieee} &0.3288 &0.1394&0.0359&0.0000\\ \textbf{73\_ieee\_rts} &0.3081 &0.2979&0.0496&0.0000\\ \textbf{89\_pegase} &1.4503 &0.6014&0.0601&0.0000\\ \textbf{118\_ieee} &0.4207 &0.7819&0.0785&0.0001\\ \textbf{162\_ieee\_dtc} &1.8909 &0.7393&0.2016&0.0000\\ \textbf{189\_edin} &4.0081 &0.4490&0.0865&0.0001\\ \textbf{300\_ieee} &8.0645 &1.4850&0.2662&0.0001\\ \hline \textbf{Avg speedup}& $1$x & $2.76$x & $15.2$x& $>\!10^4$x\\ \bottomrule \end{tabular} } \caption{Average runtime in seconds.} \label{tbl:runtime} \end{table} Table \ref{tbl:runtime} illustrates the average time required to find an AC OPF solution, the AC load flow with a reference solution, a linear DC approximation, and a prediction using OPF-DNN (${\cal M}_{\text{CS}}^{\text{D}}$) on the test dataset. Recall that the dataset adopted uses a load stress value of up to 20\% of the nominal loads and hence the test cases are often much more challenging than their original counterparts. The last row of the table reports the average speedup of the models compared to the AC OPF. \emph{Observe that OPF-DNN finds dispatches whose costs are at least one order of magnitude closer to the AC solution than those returned by the DC approximation, while being several order of magnitude faster}. \subsection{Hot-Start Robustness Analysis} Finally, the last results analyze the robustness of the DNN-OPF model when trained using test cases whose hot-start states differ from the input state by 1\%, 2\%, and 3\% in the total active loads. Table \ref{tbl:SA_pred_errs} reports the average L1 distances (in percentage) between the predicted generator power $\hat{\bm{p}}^g$, voltage magnitude $\hat{\bm{v}}$, voltage angles $\hat{\bm{\theta}}$ and the original quantities. It also reports the errors of the predicted flows $\tilde{\bm{p}}^f$ which use the generator power and voltage predictions. Table \ref{tbl:SA_load_flow} illustrates the load flow results. The left table reports the L1 distances, in percentage, of the predictions $\hat{\bm{p}}^g$, and $\hat{\bm{v}}$, to the solutions $\bm{p}^g$, and $\bm{v}$ of the load flows. The right table reports the L1 distances of the load flow solutions to the optimal AC-OPF solutions. Finally, Table \ref{tbl:SA_opf_cost} compares the accuracy of the OPF-DNN models and the DC approximation against the optimal AC OPF solutions. Observe that DNN-OPF is insensitive, in general, to the different hot-start datasets adopted during its training. \emph{These results are significant as they indicate that the DNN-OPF predictions may be robust to different hot-start range accuracies, such as those that may arise in networks with high penetration of renewable energy sources.} \begin{table*}[!t] \centering \small \resizebox{0.8\linewidth}{!} { \begin{tabular}{llrrrr|llrrrr} \toprule \textbf{Test case} & \textbf{Dataset} & $\hat{\bm{p}}^g$ & $\hat{\bm{v}}$& $\hat{\bm{\theta}}$& $\tilde{\bm{p}}^f$ & \textbf{Test case} & \textbf{Dataset} & $\hat{\bm{p}}^g$ & $\hat{\bm{v}}$& $\hat{\bm{\theta}}$& $\tilde{\bm{p}}^f$ \\ \midrule \multirow{3}{*}{\textbf{14\_ieee}} & {$\Delta_{1\%}~p^d$} &0.0234&0.0050 &0.0070 &0.0530 & \multirow{3}{*}{\textbf{89\_pegase}}& {$\Delta_{1\%}~p^d$} &0.0797&0.0862&0.0530&5.0160\\ & {$\Delta_{2\%}~p^d$} &0.0530&0.0090 &0.0160 &0.0800 && {$\Delta_{2\%}~p^d$} &0.1380&0.1330&0.1630&5.7420\\ & {$\Delta_{3\%}~p^d$} &0.0760&0.0070 &0.0200 &0.0880 && {$\Delta_{3\%}~p^d$} &0.0690&0.1140&0.2480&5.3680\\ \hline \multirow{3}{*}{\textbf{30\_ieee}} & {$\Delta_{1\%}~p^d$} &0.0055&0.0070&0.0041&0.0620 &\multirow{3}{*}{\textbf{118\_ieee}}& {$\Delta_{1\%}~p^d$} &0.0340&0.0290&0.2070&0.4550\\ & {$\Delta_{2\%}~p^d$} &0.0480&0.0140&0.0170&0.0990 && {$\Delta_{2\%}~p^d$} &0.0360&0.1450&0.1120&0.4390\\ & {$\Delta_{3\%}~p^d$} &0.0030&0.0160 &0.0080 &0.2120 && {$\Delta_{3\%}~p^d$} &0.0070&0.0210&0.0590&0.3030\\ \hline \multirow{3}{*}{\textbf{39\_epri}} & {$\Delta_{1\%}~p^d$} &0.0024&0.0280&0.0100&1.2660 &\multirow{3}{*}{\textbf{162\_ieee}}& {$\Delta_{1\%}~p^d$} &0.0710&0.0770&0.3660&0.4920\\ & {$\Delta_{2\%}~p^d$} &0.0140&0.0110&0.0130&0.9400 && {$\Delta_{2\%}~p^d$} &0.0700&0.2040&0.2640&0.6610\\ & {$\Delta_{3\%}~p^d$} &0.0140&0.0130&0.0160&1.5100 && {$\Delta_{3\%}~p^d$} &0.0680&0.3660&0.2400&0.6500\\ \hline \multirow{3}{*}{\textbf{57\_ieee}} & {$\Delta_{1\%}~p^d$} &0.0170&0.0150&0.0080&0.1520 &\multirow{3}{*}{\textbf{189\_edin}}& {$\Delta_{1\%}~p^d$} &0.0907&0.0982&0.3330&1.6520\\ & {$\Delta_{2\%}~p^d$} &0.0001&0.0150&0.0080&0.3870 && {$\Delta_{2\%}~p^d$} &0.0150&0.2960&0.0690&2.6160\\ & {$\Delta_{3\%}~p^d$} &0.0410&0.0290&0.0090&0.1890 && {$\Delta_{3\%}~p^d$} &0.0780&0.4040&0.1480&1.9180\\ \hline \multirow{3}{*}{\textbf{73\_ieee}} & {$\Delta_{1\%}~p^d$} &0.0050&0.0235&0.1180&0.3300 &\multirow{3}{*}{\textbf{300\_ieee}} & {$\Delta_{1\%}~p^d$} &0.0126&0.0610&2.5670&1.1360\\ & {$\Delta_{2\%}~p^d$} &0.0050&0.0235&0.1180&0.3300 && {$\Delta_{2\%}~p^d$} &0.0220&0.1810&0.8110&1.6890\\ & {$\Delta_{3\%}~p^d$} &0.0010&0.0150&0.0170&0.2670 && {$\Delta_{3\%}~p^d$} &0.0260&0.2270&0.9980&1.9300\\ \bottomrule \end{tabular} } \caption{OPF-DNN hot-start robustness analysis: Prediction errors (\%).} \label{tbl:SA_pred_errs} \end{table*} \begin{table*}[!h] \centering \small \resizebox{0.7\linewidth}{!} { \begin{tabular}{l l|rrrr|rrrr} \toprule \multicolumn{2}{l}{\textbf{Test case}} & \multicolumn{1}{c}{DC}& \multicolumn{3}{c|}{${\cal M}_{\text{CS}}^{\text{D}}$} & \multicolumn{1}{c}{DC}& \multicolumn{3}{c}{${\cal M}_{\text{CS}}^{\text{D}}$}\\ \cmidrule(r){4-6} \cmidrule(r){8-10} \multicolumn{2}{l}{\textbf{Dataset}} & & {$\Delta_{1\%}~p^d$} & {$\Delta_{2\%}~p^d$} & {$\Delta_{3\%}~p^d$} & & {$\Delta_{1\%}~p^d$} & {$\Delta_{2\%}~p^d$} & {$\Delta_{3\%}~p^d$} \\ \midrule \multirow{2}{*}{\textbf{14\_ieee}} & $\bm{p}^g$ & 2.4020 & 0.0233 &0.0534 & 0.0764& 0.1359 & 0.0003 & 0.0000 & 0.0000 \\ & $\bm{v}$ & 1.8352 & 0.0017 &0.0113 & 0.0034& 3.0365 & 0.0018 & 0.0005 & 0.0005 \\ \multirow{2}{*}{\textbf{30\_ieee}} & $\bm{p}^g$ & 2.6972 & 0.0007 &0.0461 & 0.0019& 0.1907 & 0.0058 & 0.0060 & 0.0030 \\ & $\bm{v}$ & 1.2929 & 0.0037 &0.0055 & 0.0019& 3.4931 & 0.0086 & 0.0037 & 0.0126 \\ \multirow{2}{*}{\textbf{39\_epri}} & $\bm{p}^g$ & 0.0731 & 0.0005 &0.0140 & 0.0105& 0.2163 & 0.0023 & 0.0039 & 0.0089 \\ & $\bm{v}$ & 1.1086 & 0.0222 &0.0100 & 0.0686& 1.7251 & 0.0313 & 0.0039 & 0.0776 \\ \multirow{2}{*}{\textbf{57\_ieee}} & $\bm{p}^g$ & 0.3354 & 0.0076 &0.0136 & 0.0410& 0.0112 & 0.0206 & 0.0000 & 0.0000 \\ & $\bm{v}$ & 0.9091 & 0.0384 &0.0031 & 0.0222& 0.2825 & 0.0482 & 0.0145 & 0.0219 \\ \multirow{2}{*}{\textbf{73\_ieee\_rts}} & $\bm{p}^g$ & 0.0204 & 0.0053 &0.0003 & 0.0010& 0.0304 & 0.0077 & 0.0005 & 0.0014 \\ & $\bm{v}$ & 0.1528 & 0.0337 &0.0024 & 0.0063& 4.1537 & 0.0516 & 0.0169 & 0.0208 \\ \multirow{2}{*}{\textbf{89\_pegase}} & $\bm{p}^g$ & 0.1641 & 0.0486 &0.1275 & 0.0551& 3.0662 & 0.0827 & 0.1820 & 0.0870 \\ & $\bm{v}$ & 3.8584 & 1.2492 &0.9275 & 0.2549& 1.1776 & 1.2610 & 1.0323 & 0.1774 \\ \multirow{2}{*}{\textbf{118\_ieee}} & $\bm{p}^g$ & 0.2011 & 0.0038 &0.0189 & 0.0010& 0.5865 & 0.0368 & 0.0393 & 0.0068 \\ & $\bm{v}$ & 1.9971 & 0.0866 &0.0642 & 0.0050& 2.2780 & 0.1335 & 0.1637 & 0.0200 \\ \multirow{2}{*}{\textbf{162\_ieee\_dtc}} & $\bm{p}^g$ & 0.6727 & 0.0558 &0.0661 & 0.0630& 0.6917 & 0.0954 & 0.0682 & 0.0479 \\ & $\bm{v}$ & 3.7718 & 0.2565 &0.4336 & 0.6034& 0.5820 & 0.2921 & 0.3724 & 0.4342 \\ \multirow{2}{*}{\textbf{189\_edin}} & $\bm{p}^g$ & 1.0514 & 0.0438 &0.0107 & 0.0183& 0.9891 & 0.0869 & 0.0206 & 0.0887 \\ & $\bm{v}$ & 5.5054 & 0.1041 &0.1623 & 0.1337& 0.4561 & 0.0882 & 0.1699 & 0.3075 \\ \multirow{2}{*}{\textbf{300\_ieee}} & $\bm{p}^g$ & 0.1336 & 0.0084 &0.0121 & 0.0124& 0.1717 & 0.0175 & 0.0209 & 0.0247 \\ & $\bm{v}$ & 3.8526 & 0.1994 &0.1623 & 0.2507& 0.6854 & 0.2196 & 0.0991 & 0.1575 \\ \cmidrule(r){1-6} \cmidrule(l){7-10} \multirow{2}{*}{\textbf{Total Avg. (\%)}} & $\bm{p}^g$ & 0.7751 & 0.0198 & 0.0363 & 0.0281 & 0.6090 & 0.0356 & 0.0341 & 0.0268\\ & $\bm{v}$ & 2.4284 & 0.1996 & 0.1782 & 0.1350 & 1.7870 & 0.2136 & 0.1877 & 0.1230\\ \bottomrule \end{tabular} } \caption{Sensitivity analysis of the average errors for the active power (top rows) and voltage magnitude (bottom rows) of the load flow solutions w.r.t. the corresponding DC solution or DNN predictions (left table) and w.r.t. the AC-OPF solutions (right table), at varying of the distance between the loads in the previous state $\textbf{s}_0$ and the current load observation. } \label{tbl:SA_load_flow} \end{table*} \begin{table}[!h] \centering \resizebox{0.8\linewidth}{!} { \begin{tabular}{l|rrrr} \toprule \multicolumn{1}{l}{\textbf{Test case}} & {DC}& \multicolumn{3}{c}{${\cal M}_{\text{CS}}^{\text{D}}$} \\ \cmidrule(r){2-5} \multicolumn{1}{l}{\textbf{Dataset}} & & {$\Delta_{1\%}~p^d$} & {$\Delta_{2\%}~p^d$} & {$\Delta_{3\%}~p^d$} \\ \midrule \textbf{14\_ieee} &5.1792&0.0007&0.0001&0.0001 \\ \textbf{30\_ieee} &7.9894&0.0180&0.0028&0.0078 \\ \textbf{39\_epri} &0.9094&0.0003&0.0000&0.0027 \\ \textbf{57\_ieee} &1.7758&0.0527&0.0000&0.0001 \\ \textbf{73\_ieee\_rts} &2.6846&0.4586&0.0663&0.0356 \\ \textbf{89\_pegase} &1.5089&0.1494&0.1273&0.0237 \\ \textbf{118\_ieee} &4.7455&0.5408&0.3913&0.1620 \\ \textbf{162\_ieee\_dtc} &6.2090&0.2845&0.2704&0.1535 \\ \textbf{189\_edin} &9.9803&0.3177&0.1064&0.3500 \\ \textbf{300\_ieee} &4.7508&0.3011&0.6430&0.6226 \\ \cmidrule(r){1-5} {\textbf{Total Avg. (\%)}} & 4.5733 & 0.2124 & 0.1608 &0.1358 \\ \bottomrule \end{tabular} } \caption{Sensitivity analysis of the LoadFlow OPF solution costs distances from optimal AC-OPF cost (in percentage) at varying of the distance between the loads in the previous state $\textbf{s}_0$ and the current load observation. } \label{tbl:SA_opf_cost} \end{table} \section{Related Work} Within the energy research landscape, DNN architectures have mainly been adopted to predict exogenous factors affecting renewable resources, such as solar or wind. For instance, Anwar et al.~\citeyear{Anwar:16} uses a DNN-based system to predict wind speed and adopt the predictions to schedule generation units ahead of the trading period, and Boukelia et al.~\citeyear{Boukelia:17} studied a DDN framework to predict the electricity costs of solar power plants coupled with a fuel backup system and energy storage. \citep{Chatziagorakis:16} studied the control of hybrid renewable energy systems, using recurrent neural networks to forecast weather conditions. Another power system area in which DNNs have been adopted is that of \emph{security assessment}: \citep{Ince:16} proposed a convolutional neural network (CNN) model for real-time power system fault classification to detect faulted power system voltage signals. \citep{Arteaga:19} proposed a convolutional neural network to identify safe vs.~unsafe operating points to reduce the risks of a blackout. \citep{donnot:hal-02268886} use a ResNet architecture to predict the effect of interventions that reconnect disconnected transmission lines in a power network. In terms of OPF prediction, the literature is much sparser. The most relevant work uses a DNN architecture to learn the set of active constraints (e.g., those that, if removed, would improve the value of the objective function) at optimality in the linear DC model \cite{ng2018statistical,deka:2019}. Once the set of relevant active constraints are identified, exploiting the fact that the DC OPF is a linear program, one can run an exhaustive search to find a solution that satisfies the active constraints. While this strategy is efficient when the number of active constraints is small, its computational efficiently decreases drastically when its number increases due to the combinatoric nature of the problem. Additionally, this strategy applies only to the linear DC approximation. This work departs from these proposals and predicts the optimal setpoints for the network generators and bus voltages in the AC-OPF setting. Crucially, the presented model actively exploits the OPF constraints during training, producing reliable results that significantly outperform classical model approximations (e.g., DC-OPF). This work also provides a compelling alternative to real-time OPF tracking~\cite{tang17realtime,liu18coordinate}: OPF-DNN always converges instantly with very high accuracy and can be applied to a wider class of applications. \section{Conclusions} The paper studied a DNN approach for predicting the generators setpoint in optimal power flows. The AC-OPF problem is a non-convex non-linear optimization problem that is subject to a set of constraints dictated by the physics of power networks and engineering practices. The proposed OPF-DNN model exploits the problem constraints using a Lagrangian dual method as well as a related hot-start state. The resulting model was tested on several power network test cases of varying sizes in terms of prediction accuracy, operational feasibility, and solution quality. The computational results show that the proposed OPF-DNN model can find solutions that are up to several order of magnitude more precise and faster than existing approximation methods (e.g., the commonly adopted linear DC model). These results may open a new avenue in approximating the AC-OPF problem, a key building block in many power system applications, including expansion planning and security assessment studies which typically requires a huge number of multi-year simulations based on the linear DC model. Current work aims at improving the (currently naive) implementation to test the approach on very large networks whose entire data sets are significantly larger than the GPU memory. \smallskip\noindent\textbf{Acknowledgments} This research is partly supported by NSF Grant 1709094. \fontsize{9.0pt}{10.0pt} \selectfont \bibliographystyle{aaai}
\section{Introduction} \label{sec:intro} Our current understanding of the Universe's properties, evolution, and present-day composition has reached a degree of maturity unthinkable of only fifty years ago. This concordance picture tells us of an accelerating cosmic expansion at recent times---well accommodated by a cosmological constant, $\Lambda$---and of a large-scale structure (LSS) formed through accretion of inhomogeneities in the distribution of matter---mainly constituted by cold dark matter. This is the widely known $\Lambda$CDM\ model, which has proven itself successful in describing the majority of the observations. Undoubtedly, the cosmic microwave background (CMB) has hitherto been cosmology's treasure cove, and the \textit{Planck}\ satellite final data release provided us with the tightest constraints on cosmological parameters \citep{2018arXiv180706209P}. However, most of the available information has been extracted by now---albeit the future of CMB studies is still bright, with the prospects of taming uncertainties on polarisation measurements down to the cosmic variance limit \citep[see e.g.][]{2016arXiv161002743A,Hazumi:2019lys,2019JCAP...02..056A}. Hence, there is nowadays a high level of expectations for LSS observational campaigns. Indeed, the LSS is potentially even more informative that the CMB, thanks to its three-dimensional nature (compared to the thin redshift slice around the last-scattering surface), and the study of the cosmic web can teach us about the nonlinear behaviour of gravity as well. One of the main probes of the LSS is the clustering of galaxies, as it has been convincingly demonstrated in many an instance \citep[e.g.][]{2012PhRvD..86j3518P,2012MNRAS.423.3430B,2015MNRAS.449..848H,10.1093/mnras/stx721,2017A&A...604A..33P}. This field of research is nowadays entering a new era with the construction of a series of futuristic experiments. The forthcoming galaxy surveys will be game-changing probes of the LSS, observing from millions to billions of sources at different wavelengths and exploiting various techniques. A few examples of LSS experiments that will take data in the near future are: the European Space Agency's satellite \textit{Euclid}\ \citep{Laureijs2011,Amendola2013,Amendola2016}, the Large Synoptic Survey Telescope \citep{Abate:2012za}, or the Dark Energy Survey Instrument \citep{Aghamousa:2016zmz}, in the optican/near-IR band; and the Square Kilometre Array (SKA, \citealt{Maartens2015,Abdalla2015,SKA1_2018}) and its precursors, at radio frequencies. For the aforementioned reasons, in a companion paper (\citealt{Tanidis:2019teo}; hereafter, Paper I) we set forth on a path to develop a unified pipeline for LSS data analysis with power spectra in harmonic space. We deem this a worthwhile purpose, urged by the consideration that the range of scales and redshifts probed by forthcoming surveys likely calls for a change of paradigm in the treatment of the data and the theoretical modelling. In the present paper, we focus on one of the SKA precursors, the Evolutionary Map of the Universe \citep[EMU,][]{norris2011} radio-continuum survey on the Australian SKA Pathfinder (ASKAP) telescope. Unlike the photometric (optical/near-IR) and the spectroscopic (optical/near-IR or \textsc{Hi}-line galaxy survey in the radio) experiments, radio continuum surveys like EMU have the advantage of being able to scan very quickly large areas of the sky by averaging over all frequencies, thus increasing the signal-to-noise ratio of each source. Despite the fact that the deep and fast scanning in redshift space can detect a large number of galaxies, including also very faint sources, their redshift estimation is quite poor. Given the insufficient redshift information, the angular tomographic clustering is usually adopted to analyse radio continuum galaxy catalogues, instead of the more usual three-dimensional Fourier-space power spectrum. In this paper, we move past the Fisher matrix approach hitherto employed, to a full likelihood-based analysis. We particularly turn our interest to the investigation of the cosmological information encoded in the weak lensing effect of magnification bias on the density fluctuations of the galaxy field \citep[see][for a seminal review on gravitational lensing]{2001PhR...340..291B}. This effect is widely known and is due to the weak lensing contribution caused by the underlying matter field. It induces a modulation in the clustering signal across redshift bins, inducing a correlation between background and foreground sources. The paper is outlined as follows. In \autoref{sec:Apower spectrum}, we introduce the harmonic-space angular power spectrum \tcijl{i}{j} with and without the magnification bias correction, and implement it in the publicly available \texttt{CosmoSIS}\ code \citep{Zuntz2015}. In \autoref{sec:EMU_distribution}, we present the EMU survey specifications and simulation results used to construct the tomographic redshift bins that will be later applied in the analysis. In \autoref{sec:cuts}, we perform a comparison test between our Limber approximated \texttt{CosmoSIS}\ code version and the full solution obtained with \texttt{CLASS}\ \citep{Lesgourgues2011,Blas2011,DiDio2013}. In \autoref{sec:cosmo_theory}, we present the theoretical models considered, while the likelihood for the forecast is presented in \autoref{sec:like}. In \autoref{sec:results}, we examine in detail the Bayesian analysis of an idealistic and two realistic scenarios for the cosmological models considered, and we also show that the redshift-space distortions (RSDs) correction to the density field has negligible effect in our case. Finally, in \autoref{sec:conclusion}, we present our concluding remarks. \section{Galaxy clustering in harmonic space} \label{sec:Apower spectrum} Here, we describe how to construct the galaxy clustering (tomographic) angular power spectrum, \tcl{i}{j}, including contributions from density fluctuations, RSDs, and magnification bias. To ensure the robustness of our cosmological results, we use only linear scales \citep[see][for a study on nonlinearities in angular spectra]{Jalilvand:2019brk} in a region where the Limber approximation holds true \citep{1953ApJ...117..134L,1992ApJ...388..272K}. In the following analysis, we implement this framework in a modified version of the \texttt{CosmoSIS}\ package. The treatment in our analysis follows closely that of Paper I, to which we refer the reader for any clarification. Let us start from the linear Fourier-space matter power spectrum, \begin{equation} P_{\rm lin}(k,z)= \frac{8\pi^2}{25}H_0^{-4}\Omega_{\rm m}^{-2}g_\infty^{-2}D^2(z)T^2(k)\mathcal P_\zeta(k)k, \label{eq:matter} \end{equation} where $\Omega_{\rm m}$ is the total matter fraction in the Universe, and $H_0$ the Hubble constant at present. Furthermore, we take advantage of the fact that scale and redshift dependence can be considered separately when the anisotropic stress is not present, as in general relativity after radiation domination. Thus, a scale-dependent transfer function $T(k)$ and a redshift-dependent growth factor $D(z)$ can be defined, while $g_\infty=\lim_{z\to\infty}(1+z)D(z)\simeq1.27$. (Normalisations require $D(z)=1$ at $z=0$ and $T(k)=1$ for $k\to0$.) The term $\mathcal P_\zeta(k)=A_{\rm s}(k/k_0)^{n_{\rm s}-1}$ is the dimensionless primordial curvature power spectrum, with $A_{\rm s}$ being the amplitude and $n_{\rm s}$ the spectral index. Hereafter, we shall often use the shorthand notation $P_{\rm lin}(k)\equiv D^{-2}(z)P_{\rm lin}(k,z)=\mathcal T^2(k)\mathcal P_\zeta(k)$, which represents linear matter power spectrum at present; we also define $\mathcal T(k)=(4/5)\piH_0^{-2}\Omega_{\rm m}^{-1}g_\infty^{-1}T(k)k^{1/2}$. \subsection{Galaxy number counts and magnification bias} It is well known that light ray paths experience deflections by the intervening matter distribution lying on the line-of-sight direction. This induces distortions in the images of distant objects; such distortions, in the weak lensing limit, are usually decomposed into a `convergence' $\kappa$ and a `shear' $\gamma$. The former---a surface mass density integrated along the line of sight---is responsible for changing the apparent size of a distant galaxy's image, whilst the latter---a complex, spin-2 quantity---stretches an observed galaxy's shape in different directions, making for instance ellipses out of circles \citep[see][for some beautiful and intuitive illustrations of lensing distortions]{Clarkson:2016ccm}. In turn, convergence and shear are jointly responsible for the magnification, \begin{equation} \mu=\left|(1-\kappa)^2-|\gamma|^2\right|^{-1}. \end{equation} Cosmic magnification has been first measured by cross-correlating high-redshift quasars with the low-redshift galaxies observed by the Sloan Digital Sky Survey \citep{Scranton_2005}, and later with galaxy-dust and galaxy-mass correlations by \cite{10.1111/j.1365-2966.2010.16486.x}. The same effect was detected with normal galaxy samples using the Canada-France-Hawaii-Telescope Legacy Survey measurements \citep{Hildebrandt}. Furthermore, the magnification bias has been proposed as a probe for the investigation of the primordial magnetic fields \citep{Camera_2014}. Besides being a lensing observable per se \citep[e.g.][]{VanWaerbeke:2009fb}, magnification contributes to the observed correlation of galaxy number counts \citep{Yoo2010,ChallinorandLewis2011,BonvinDurrer2011}. The effect of magnification on the observed clustering is due to foreground galaxies effectively acting as lenses for sources in the background. On the one hand, images of a fixed set of sources are distributed over a larger solid angle, thus reducing the number density by a factor $\mu^{-1}$. On the other hand, the magnification allows for the observation of fainter sources, as the flux threshold is likewise lowered by the $\mu^{-1}$ factor. Now, if $N_{\rm g}$ is the \textit{comoving} number density of galaxies above a certain flux threshold $F^\ast$ (or, equivalently, below some magnitude threshold $m^\ast$), we can define, \begin{align} \mathcal Q&=-\left.\frac{\partial\ln N_{\rm g}}{\partial\ln F}\right|_{F^\ast} \nonumber \\ &=\frac52\left.\frac{\partial\log_{10} N_{\rm g}}{\partial m}\right|_{m^\ast}.\label{eq:magbias} \end{align} Hence, in the weak lensing regime where $\mu\approx 1+2\kappa$, it can be seen that the fluctuations in galaxy number counts, $\delta_{\rm g}$, get a further contribution from lensing. This is modulated by $\mathcal Q$, for which reason is called `magnification bias'.\footnote{An alternative notation is also known in the literature, with $s=2\mathcal Q/5$.} Specifically, \begin{equation} \delta_{\rm g}=b\,\delta+\frac{(n^i\partial_i)^2}{\mathcal H}V+2(1-\mathcal Q)\kappa,\label{eq:delta_g} \end{equation} where $b$ is the linear galaxy bias, $\delta$ is the matter density contrast (expressed in the comoving-synchronous gauge), $\mathcal H$ is the conformal Hubble factor, $V$ is the velocity potential, $n^i$ denotes a galaxy's line-of-sight direction, and the calculation is performed in the longitudinal gauge. The first term in \autoref{eq:delta_g} is the usual Newtonian density fluctuations, the second term is RSDs, and the last is the magnification contribution. The inclusion of the lensing magnification in cross and auto-correlations of galaxy clustering and cosmic shear has been studied with Fisher analysis \citep{10.1093/mnras/stt2060,Villa:2017yfg,Thiele:2019fcu,VanessaBohm}, where it has already been suggested that the ignorance of the magnification bias may induce a bias in the cosmological parameter estimation. Here, we test this hypothesis by performing a full likelihood mock data analysis. \subsection{The observed galaxy number count angular power spectrum} The galaxy number count angular spectrum on linear scales can be written as \begin{equation} C^{\rm g}_{\ell}(z_i,z_j)=4\upi\int\mathrm{d}\ln k\,\mathcal P_\zeta(k)\mathcal W_\ell^{\rm g}(k;z_i)\mathcal W_\ell^{\rm g}(k;z_j), \label{eq:Cl_fullsky} \end{equation} with the redshift-integrated kernels given by \begin{multline} \mathcal W^{\rm g}_\ell(k;z_i)=\mathcal T(k)\int\mathrm{d}\chi\,D(\chi)\Big\{b(\chi)n^i(\chi)j_\ell(k\chi)\\ -f(\chi)n^i(\chi)j^{\prime\prime}_\ell(k\chi)+2\left[\mathcal Q(\chi)-1\right]w_\ell^{\kappa,i}(k,\chi)j_\ell(k\chi)\Big\}, \label{eq:weight_func} \end{multline} where $\chi$ is the comoving distance to redshift $z$, $j_\ell$ the $\ell$th-order spherical Bessel function, $f\equiv-(1+z)\mathrm{d}\ln D/\mathrm{d} z$ is the growth rate, \begin{equation} w_\ell^{\kappa,i}(k,\chi)=\frac{3\omH_0^2}{2k^2}\left[1+z(\chi)\right]\ell(\ell+1)\tilde n^i(\chi) \label{eq:convergence} \end{equation} is the lensing weight for the galaxy redshift distribution in the $i$th redshift bin, $n^i(\chi)$, and we have defined \begin{equation} \tilde n^i(\chi)=\int_\chi^\infty\mathrm{d}\chi^\prime\,\frac{\chi^\prime-\chi}{\chi^\prime\chi}n^i(\chi^\prime). \end{equation} Note that, unless otherwise stated, $\int\mathrm{d} z\,n^i(z)=1$ and $n^i(\chi)\mathrm{d}\chi=n^i(z)\mathrm{d} z$ hold true. If we compare \autoref{eq:weight_func} to \autoref{eq:delta_g}, the effect of projecting in harmonic space becomes clear: \begin{itemize} \item Each different contribution to the fluctuations in the galaxy number density, $\delta_{\rm g}$, is modulated by a peculiar quantity---the bias for the matter density contrast, the growth rate for the RSDs, and the magnification bias for the lensing convergence. \item Each contribution is weighted by the galaxy distribution in the redshift bin considered---note that lensing convergence is an integrated effect, weighted by a geometric factor, so that the source redshift distribution does not enter explicitly the third term of \autoref{eq:weight_func}, but is integrated along the line of sight via \autoref{eq:convergence}.\footnote{In fact, the convergence is the Laplacian of the gravitational potential on the image plane, which accounts for the terms in front of $\tilde n^i(\chi)$ in \autoref{eq:convergence}: the first two are due to the Poisson equation to go from the potential to the density, and the third one is the Laplacian in harmonic space.} \item Each contribution is projected according to its specific spherical Bessel function---e.g.\ for RSDs it is derived twice, because it is a projected radial derivative. \end{itemize} If we are interested in constraining standard cosmological parameters, the lowest multipoles, corresponding to ultra-large scales, are of little interest \citep{Camera:2014sba,Lorenz:2017iez}. This allows us to resort to the Limber approximation, thus getting rid of the integration of the spherical Bessel functions, which is computationally expensive and highly oscillating, thus inducing numerical instabilities. It is worth noting, however, that there are nowadays publicly available routines implementing fast Fourier transforms, such as \texttt{AngPow}\ \citep{Camp}, which can be applied for the computation of tomographic power spectra beyond the Limber approximation in the case one was interested to the largest scales or wanted to reduce the multipole cuts for cross-bin correlations, \citep[see also][]{Chisari_2019}. The Limber approximation works well for $\ell\gg1$, and the spherical Bessel functions are replaced by a Dirac Delta, viz.\ \begin{equation} j_\ell(k\chi)\underset{\ell\gg1}{\longrightarrow}\sqrt{\frac{\upi}{2\ell+1}}\delta_{\rm D}\left(\ell+\frac{1}{2}-k\chi\right). \end{equation} By implementing this into \autoref{eq:Cl_fullsky}, we get: \begin{multline} C^{\rm g,den+mag}_{\ell\gg1}(z_i,z_j)= \\ \int\mathrm{d}\chi\,\frac{W^i_{\rm g}(\chi)W^j_{\rm g}(\chi)}{\chi^2}P_{\rm lin}\left(k=\frac{\ell+1/2}{\chi}\right), \label{eq:Cldenmag_Limber} \end{multline} with \begin{equation} W^i_{\rm g}(\chi)=W^i_{\rm g,den}(\chi)+W^i_{\rm g,RSD}(\chi)+W^i_{\rm g,mag}(\chi).\label{eq:W_tot} \end{equation} Here, we have split the contributions into three separate window functions: the standard one, for density fluctuations, \begin{equation} W^i_{\rm g,den}(\chi)=n^i(\chi)b(\chi)D(\chi); \label{eq:W_den} \end{equation} the one for RSDs, found in Paper I to be \begin{multline} W^i_{\rm g,RSD}(\chi)=\frac{2\ell^2+2\ell-1}{(2\ell-1)(2\ell+3)}\left[n^ifD\right](\chi) \\ -\frac{(\ell-1)\ell}{(2\ell-1)\sqrt{(2\ell-3)(2\ell+1)}}\left[n^ifD\right]\left(\frac{2\ell-3}{2\ell+1}\chi\right)\\ -\frac{(\ell+1)(\ell+2)}{(2\ell+3)\sqrt{(2\ell+1)(2\ell+5)}}\left[n^ifD\right]\left(\frac{2\ell+5}{2\ell+1}\chi\right); \label{eq:W_RSD} \end{multline} and that of magnification bias,\footnote{Note that the multipole factors in \autoref{eq:W_mag} are usually omitted in the literature when describing magnification in the Limber approximation, as easy to see that they cancel each other out in the limit $\ell\gg1$.} \begin{multline} W^i_{\rm g,mag}(\chi)=\\\frac{3\ell(\ell+1)}{(\ell+1/2)^2} \omH_0^2\left[1+z(\chi)\right]\chi^2\tilde n^i(\chi)\left[\mathcal Q(\chi)-1\right]D(\chi) \label{eq:W_mag} \end{multline} \section{Survey specifications} \label{sec:EMU_distribution} As mentioned in \autoref{sec:intro}, we decide to focus on radio continuum surveys, because they are an ideal test case for magnification, thanks to their unrivalled depth. The NRAO VLA Sky Survey \citep[NVSS,][]{Condon_1998} has been the primary source of data for previous cosmological analyses based on radio continuum galaxies \citep[e.g.][]{PhysRevLett.88.021302,refId0,Boughn,Nolta_2004,PhysRevD.76.043510,Raccanelli,PhysRevD.78.043519,PhysRevD.78.123507,10.1111/j.1365-2966.2011.19200.x,Rubart,PhysRevD.89.023511,Nusser_2015,PlanckXXI}. The potentiality of oncoming radio continuum surveys for cosmology has also been extensively studied in recent years \citep{10.1111/j.1365-2966.2012.20634.x,10.1111/j.1365-2966.2012.22073.x,Raccanelli_2015,Bertacca_2011,Jarvis:2015asa,10.1093/mnras/stv040,10.1093/mnras/stu1015,10.1093/mnras/sty1029,Scelfo_2018,Ballardini_2018,Bernal_2019}. For the present analysis, we adopt the specifications of the Evolutionary Map of the Universe (EMU). EMU is a deep radio-continuum full-sky survey \citep{norris2011} at ASKAP \citep{johnston2007,Johnston2008}, whose goal is to detect extragalactic objects in the continuum across the entire southern sky, up to $\delta=+30^\circ$. Even though ASKAP was designed as a precursor to the SKA, the large field of view, accurate pointing and angular resolution, and sensitive phased-array feeds will render it the foremost radio survey instrument in the frequency range around 1 GHz during the next decade. The EMU survey, covering such a wide area, and going much deeper than previous large-area radio continuum surveys, will be able to map the large-scale distribution of matter over a larger volume than has previously been possible, and so will be ideal to investigate extensions of the $\Lambda$CDM\ model \citep{10.1111/j.1365-2966.2012.20634.x,10.1111/j.1365-2966.2012.22073.x,Bernal_2019}. EMU will cover an area of $30,000\,\mathrm{deg}^2$ with a sensitivity of $10\,\mu {\rm Jy}$ per beam rms, and a resolution of $\sim10\,\mathrm{arcsec}$, over the frequency range of 800-1400 MHz. To estimate the redshift distribution $n(z)$ of active galactic nuclei and star-forming galaxies, a 10-sigma detection limit of 100 $\mu {\rm Jy}$ is assumed, and galaxies are sampled from the mock catalogues generated by the SKA Simulated Skies (S-cubed)\footnote{http://s-cubed.physics.ox.ac.uk/} simulations down to that limit. The distribution of redshifts and magnitudes from these mocks are used to estimate the overall $n(z)$, and also the magnification bias, $\mathcal Q(z)$. Under the assumption that additional external data will be available for the redshifts of part of EMU galaxies (e.g.\ cross-identifications, \citealt{McAlpine:2012cu}; Bayesian hierarchical models, \citealt{Harrison:2017pcu}; or so-called clustering redshifts, \citealt{Menard:2013aaa}), we here scrutinise two binning scenarios. The former, in which we assume we can differentiate only between low- and high-redshift galaxies (divide set at $z=1$), is more conservative; the latter sees five redshift bins, four of which of width $\Delta z=1$ below $z=2$, and the fifth collecting all the galaxies above. The expected numbers for these settings are given in \autoref{tab:2bins} and \autoref{tab:5bins}. \begin{table} \centering \caption{Estimated number densities, galaxy bias, and magnification bias for EMU sources grouped in 2 redshift bins.} \begin{tabular}{c c c c c c} \hline Bin & $z_{\rm min}$ & $z_{\rm max}$ & \# of gal. ($\times10^6$) & bias & mag. bias \\ \hline 1 & 0.0 & 1.0 & 10.68 & 0.833 & 1.050 \\ 2 & 1.0 & 6.0 & 11.58 & 2.270 & 1.298 \\ \hline \end{tabular} \label{tab:2bins} \end{table} \begin{table} \centering \caption{Same as \autoref{tab:2bins}, but for EMU sources grouped in 5 redshift bins.} \begin{tabular}{c c c c c c} \hline Bin & $z_{\rm min}$ & $z_{\rm max}$ & \# of gal. ($\times10^6$) & bias & mag. bias \\ \hline 1 & 0.0 & 0.5 & 5.55 & 1.000 & 0.953 \\ 2 & 0.5 & 1.0 & 5.13 & 1.124 & 1.273 \\ 3 & 1.0 & 1.5 & 4.43 & 1.920 & 1.569 \\ 4 & 1.5 & 2.0 & 2.70 & 3.250 & 1.176 \\ 5 & 2.0 & 6.0 & 4.05 & 4.046 & 0.964 \\ \hline \end{tabular} \label{tab:5bins} \end{table} We discussed above that radio continuum surveys lack information in redshift and therefore the most realistic representation of the galaxy sampling in redshift space is that of residing in Gaussian bins. However, we decide to consider the case of sharp top-hat bins which are not correlated in redshift. We apply this mostly for the sake of fully exploring the potential of magnification. The magnification bias is expected to induce a correlation even between uncorrelated redshift bins, in a sense that the lower-$z$ bins are the `lenses' and the high-$z$ bins the `sources'. Thus, it is worth investigating magnification in this case, too, implemented at least at the $\Lambda$CDM\ scenario. Given that $\mathrm{d} N$ is the number of galaxies inside a bin of width $\mathrm{d} z$, the redshift distribution of sources is $N(z)=\mathrm{d} N/\mathrm{d} z$.\footnote{The number of sources has also been calculated in very narrow 32 redshift bins, which are not shown here for clarity.} Then, the $N(z)$ points are fitted with a 7th order polynomial, $n(z)$, by which we denote the total number counts of sources with redshift. The distribution of sources residing in the $i$th bin thus is $n^i(z)$, and the angular number counts of galaxies reads \begin{equation} \bar n^i=\int\mathrm{d} z\,n^i(z), \label{eq:n_i} \end{equation} Therefore, the total number counts of galaxies is simply $\bar n=\sum_i{\bar n^i}$.\footnote{Note again that $n^i(z)$ is normalised to unity in the equations of the previous section, like \autoref{eq:weight_func}, \autoref{eq:W_den}, \autoref{eq:W_RSD}, and \autoref{eq:W_mag}, meaning that it as to be read as $n^i(z)/\bar n^i$.} The final, fitted redshift distributions, convolved with the bins, are shown in \autoref{fig:distribution}. \begin{figure*} \centering \includegraphics[width=0.45\textwidth,trim={2cm 9cm 4cm 7cm},clip]{EMU2TH.pdf}\includegraphics[width=0.45\textwidth,trim={2cm 9cm 4cm 7cm},clip]{EMU2G.pdf}\\\includegraphics[width=0.45\textwidth,trim={2cm 9cm 4cm 9.5cm},clip]{EMU5TH.pdf}\includegraphics[width=0.45\textwidth,trim={2cm 9cm 4cm 9.5cm},clip]{EMU5G.pdf} \caption{The EMU galaxy redshift distribution for top-hat (left panels) and Gaussian (right panels) binning. The top and bottom panels present the 2 and the 5 bins, respectively.} \label{fig:distribution} \end{figure*} Top-hat bins (left panels of \autoref{fig:distribution}) have been modelled as \begin{equation} n^i(z)=\frac{1}{2}\left\{1-\tanh\left[\frac{|z-\bar z_i|-\sigma}{r\sigma}\right]\right\}, \end{equation} where $\bar z_i$ is the centre of the $i$th bin, $\sigma$ the half top-hat width, and $r$ the smoothing edge, which we fix to 0.03. The smearing ensures the numerical stability in the integration over the bin. Instead, to model Gaussian bins, we consider the ranges $z_{\rm min}$ and $z_{\rm max}$ of \autoref{tab:2bins} and \autoref{tab:5bins}, and definde \begin{multline} n^i(z)=\\ \frac12 n(z) \left[\operatorname{erfc}\left(\frac{z^i_{\rm min}-z}{\sqrt2 \sigma(z^i_{\rm min})}\right)-\operatorname{erfc}\left(\frac{z^i_{\rm max}-z}{\sqrt2 \sigma(z^i_{\rm max})}\right) \right]. \end{multline} Note that, in this latter case, we introduce a redshift dependence of the scatter of the distribution, $\sigma(z)$. Specifically, we adopt a quite large uncertainty, $\sigma(z)=0.1(1+z)$. The Gaussian bins are shown in the right panels of \autoref{fig:distribution}. \section{Cosmological models} \label{sec:cosmo_theory} In this work, we will investigate the vanilla $\Lambda$CDM\ model and two of its most popular extensions: the case of a dynamical dark energy component and a phenomenological modified gravity model. All the model parameters are summarised in \autoref{tab:params}. For $\Lambda$CDM, we present the constraints for the parameter set $\{\Omega_{\rm m},\,h,\,\sigma_8\}$ alone, whilst the other parameters are fixed to their fiducial values. \subsection{Dark energy} \label{sec:DE} The first extension to the $\Lambda$CDM\ model is a dynamical dark energy model (DE, hereafter), where the dark energy equation of state is not constant throughout the cosmic history, but it is rather allowed to evolve with time. According to \citep{doi:10.1142/S0218271801000822,PhysRevLett.90.091301}, by Taylor expanding an evolving dark energy equation of state and keeping only the first order term we have \begin{equation} w_{\rm DE}(z)=w_0+w_a\frac{z}{1+z}. \end{equation} Therefore, we add to the $\Lambda$CDM\ model the parameter set both $w_0$ and $w_a$. \subsection{Modified gravity} \label{sec:MG} An alternative explanation for the late-time accelerated cosmic expansion is offered by modified gravity theories (MG, hereafter). This approach sees the effects we ascribe to dark energy (and even dark matter) are in fact due to our wrong interpretation of the data in a regime where general relativity no longer holds \citep{Clifton:2011jh}. For the purpose of our paper, we assume a popular phenomenological parameterisation accounting for the peculiar effect of modified gravity on structure formation \citep{Amendola:2007rr,Zhao:2010dz,PhysRevD.92.023003}. Specifically, we can assume a modified Poisson equation \begin{equation} \nabla^2\Phi=4\pi GQ a^2 \bar\rho\delta , \end{equation}\label{eq:MG1} where $Q$ is in principle a function of space and time, and acts as an effective gravitational constant. Moreover, the two metric potentials can be different, and the function $R$ describes the ratio of the two, viz.\ \begin{equation} R = \frac{\Psi}{\Phi}. \end{equation}\label{eq:MG2} Thus, we add as free parameters the two present-values of these quantities, $Q_0$ and $R_0$. In fact, given that they are degenerate, it is very convenient to define the derived parameter $\Sigma_0=Q_0(1+R_0)/2$, and therefore use the parameter set $\{Q_0,\,\Sigma_0\}$ instead, along with the parameters of the $\Lambda$CDM\ model. \begin{table*} \centering \caption{Prior ranges and fiducial values on the nuisance and cosmological parameters ($\Lambda$CDM\ best-fit of \citealt{Ade2015}). Some parameters are purposely allowed to have wider or narrower prior ranges due to the difference in the constraining power of the results depending on the number of the bins considered. (When two sets of values are present, values in parentheses refer to the 5 bin case, as opposite to those outside that are relative to the 2 bin case.)} \begin{tabularx}{\textwidth}{Xllll} \hline Parameter description & Parameter symbol & Fiducial value & Prior type & Prior range \\ \hline \hline Present-day fractional matter density & $\Omega_{\rm m}$ & 0.3089 & Flat & $[0.1,0.6]$\\ Dimensionless Hubble parameter & $h$ & 0.6774 & Flat for 2(5) bins & $[0.3,1.0]$$([0.5, 1.0])$\\ Amplitude of clustering$^\ddag$ & $\sigma_8$ & 0.8159 & Flat for 2(5) bins & $[0.4,1.4]$$([0.5,1.2])$\\ \hline Present-day fractional baryon density & $\Omega_{\rm b}$ & 0.0486 & -- & --\\ Slope of the primordial curvature power spectrum & $n_{\rm s}$ & 0.9667 & -- & --\\ Amplitude of the primordial curvature power spectrum$^\ddag$ & $\ln(10^{10}A_{\rm s})$ & $3.064$ & -- & --\\ Optical depth to reionisation & $\tau_{\rm re}$ & 0.066 & -- & --\\ \hline Bias amplitude parameter for the whole redshift range$^\P$ & $\alpha_{\rm EMU}$ & 1.0 & Flat & $[0.4,1.6]$ \\ \hline Free bias amplitude in each redshift bin$^\S$ & $b_i$ $i=1\ldots2(5)$ & See \autoref{tab:2bins}(\autoref{tab:5bins}) & Flat for 2(5) bins & $[0.1,3.5]$$([0.1,9.0])$ \\ \hline Present-day dark energy equation of state & $w_0$ & $-1.0$ & Flat & $[-3.0,2.0]$ \\ Dark energy evolution parameter & $w_a$ & 0.0 & Flat & $[-6.0,4.0]$ \\ \hline Modified gravity parameter & $Q_0$ & 1.0 & Flat & $[0.0,8.0]$ \\ Modified gravity parameter & $R_0$ & 1.0 & Flat & $[-1.0,8.0]$ \\ \hline \end{tabularx}\label{tab:params} \raggedright\footnotesize{$^\ddag$ Instead of setting the prior on the parameter $A_{\rm s}$ accounting for the matter perturbations amplitude, we opt for $\sigma_8$, following the convention in LSS.\\ $^\P$ The prior range reported on the parameter is applied in the `realistic' scenario alone (notation mirrors Paper I).\\ $^\S$ The prior range reported on the parameter is applied in the `conservative' scenario alone.} \end{table*} \section{Methodology} \label{sec:like} To forecast constraints on cosmological parameters, we follow a likelihood-based approach. The first step is to estimate the covariance matrix, $\bm\Gamma_{\ell\ell^\prime}$, for our observable, namely the galaxy clustering power spectrum in harmonic space given in \autoref{eq:Cldenmag_Limber}. We use the analytical form of the Gaussian covariance matrix, as already implemented in \texttt{CosmoSIS}, with the following entries \begin{multline} \Gamma^{ij,kl}_{\ell\ell^\prime}=\\ \frac{\delta_{\rm K}^{\ell\ell^\prime}}{2\ell\Delta\ell f_{\rm sky}}[\widetilde C^{\rm g}_\ell(z_i,z_k)\widetilde C^{\rm g}_\ell(z_j,z_l) +\widetilde C^{\rm g}_\ell(z_i,z_l)\widetilde C^{\rm g}_\ell(z_j,z_k)],\label{eq:covmat} \end{multline} where $f_{\rm sky}$ the fraction of the sky covered by the survey, $\Delta \ell$ the multipole range, $\delta_{\rm K}$ the Kronecker symbol, and \begin{equation} \widetilde C^{\rm g}_\ell = C^{\rm g}_\ell + \frac{\delta_{\rm K}^{ij}}{\bar n^i}, \label{eq:noise} \end{equation} is the observed signal---namely, signal plus shot noise, with $\bar n^i$ defined in \autoref{eq:n_i}.\footnote{In the denominator of \autoref{eq:covmat} we use the notation of \citet{JoachimiBridle2010} and keep $2\ell$ instead of $(2\ell+1)$. This makes no difference for our results, since we are at the Limber limit allowing scales $\ell\gg1$. Also, the analysis is based on the effect of neglecting the magnification bias and therefore such a choice can be accepted safely at the cost of no loss of generality.} We employ $N_\ell=20$ multipole bins (see \autoref{sec:cuts} for the range adopted), and for all redshift and multipole bin values we construct the full data vector ${\bm d}_\ell=[{\bm C}^{\rm g}_\ell]$, as well as the theory vector ${\bm t}_\ell({\bm \theta})$, which is a function of the parameter set, $\bm\theta$. With all the above one can construct the $\chi^2$ as \begin{equation} \chi^2 =\sum_{\ell,\ell^\prime=\ell_{\rm min}}^{\ell_{\rm max}} [{\bm d}_\ell - {\bm t}_\ell({\bm \theta})]^{\sf T} (\bm\Gamma_{\ell\ell^\prime})^{-1} [{\bm d}_\ell - {\bm t}_\ell({\bm \theta})], \label{eq:chi2} \end{equation} which is to be minimised for some specific values of the parameters. Matrix transposition and inversion are denoted by `${\sf T}$' and `$-1$', respectively. \subsection{Multipole cuts} \label{sec:cuts} Since Limber approximation is valid only at $\ell \gg 1$, we have derived the $\ell_{\rm min}$\ below which we can trust no longer the angular power spectra values computed via \autoref{eq:Cldenmag_Limber}. To do so, we compare results computed by our modified \texttt{CosmoSIS}\ code with the full solution of the \texttt{CLASS}\ Boltzmann solver and keep only the multipoles where the relative error between the two codes is below 5\% (see Paper I). We make this chose since this percentage offset is within the standard deviation of the signal measurement. Additionally, we apply an upper cut at $\ell_{\rm max}= \chi(\bar z_i) k_{\rm max}$, since we ignore the nonlinear scales in our analysis. Here, $\bar z_i$ is the centre of the $i$th redshift bin, whilst the maximum wavenumber is chosen to be $k_{\rm max}=\pi / (2R_{\rm min})$, where $R_{\rm min}$ is the radius of a sphere inside which the over-density fluctuations at $z=0$ have a value \begin{equation} \sigma^2(R)=\frac{1}{2\pi^2}\int{\mathrm{d} k}\,k^2P_{\rm lin}(k)\left|W(k R)\right|^2, \label{eq:highmul} \end{equation} with the spherical top-hat function being $W(x)=3j_1(x)/x$. The matter density variance is chosen to be $\sigma^2(R_{\rm min})=1$, yielding $k_{\rm max}=0.25\,\,h\,{\rm Mpc}^{-1}$. The $\ell_{\rm min}$\ and $\ell_{\rm max}$\ cuts are applied to each bin pair according to the all the configurations of the EMU distribution (see again \autoref{fig:distribution}), and are shown in \autoref{tab:multipoles}, where RSDs do not appear explicitly because we found that their inclusion does not affect the value of $\ell_{\rm min}$. (On the other hand, $\ell_{\rm max}$\ does not depend on the terms included in \autoref{eq:Cldenmag_Limber}, as it is only a function of $k_{\rm max}$ and the central redshift of the bin.) \begin{table*} \centering \caption{The $\ell_{\rm min}$ and $\ell_{\rm max}$ values for all the EMU bin configurations. The former is specified as the point where the relative error between \texttt{CosmoSIS}\ and \texttt{CLASS}\ angular power spectra measurements is below 5\%, while the latter in the limit where $\ell_{\rm max}=k_{\rm max} \chi(\bar z_i)$ with $\bar z_i$ the centre of the $i$th bin.} \begin{tabular}{ccccccccccccc} \hline \multicolumn{6}{c}{2 redshift bins} && \multicolumn{6}{c}{5 redshift bins} \\ \cline{1-6}\cline{8-13} \multicolumn{5}{c}{$\ell_{\rm min}$} & \multicolumn{1}{c}{$\ell_{\rm max}$} && \multicolumn{5}{c}{$\ell_{\rm min}$} & \multicolumn{1}{c}{$\ell_{\rm max}$} \\ \cline{1-5}\cline{8-12} \multicolumn{2}{c}{Top-hat} && \multicolumn{2}{c}{Gaussian} &&& \multicolumn{2}{c}{Top-hat} && \multicolumn{2}{c}{Gaussian} & \\ w/o mag & w/ mag && w/o mag & w/ mag &&& w/o mag & w/ mag && w/o mag & w/ mag & \\ \hline \hline 3 & 2 && 2 & 2 & 480 && 2 & 2 && 2 & 2 & 257 \\ 10 & 12 && 10 & 10 & 1718 && 6 & 6 && 8 & 8 & 673 \\ $-$ & $-$ && $-$ & $-$ & $-$ && 17 & 18 && 11 & 11 & 982 \\ $-$ & $-$ && $-$ & $-$ & $-$ && 24 & 25 && 10 & 10 & 1215 \\ $-$ & $-$ && $-$ & $-$ & $-$ && 24 & 25 && 9 & 9 & 1813 \\ \hline \end{tabular} \label{tab:multipoles} \end{table*} \section{Results and discussion} \label{sec:results} Let us summarise again here the cosmological parameter sets for the three different cosmological models, $\bm \theta_\textrm{$\Lambda$CDM}=\{\Omega_{\rm m},\,h,\,\sigma_8\}$, ${\bm \theta_{\rm DE}}=\bm \theta_\textrm{$\Lambda$CDM}\cup\{w_0,\,w_a \}$ and ${\bm\theta_{\rm MG}}=\bm \theta_\textrm{$\Lambda$CDM}\cup\{Q_0,\,\Sigma_0 \}$. In our forecasting analysis, we use the Bayesian sampler \texttt{Multinest}\ \citep{FHB2009}. We forecast cosmological parameter constraints using both the incomplete $C^{\rm g,den}_{\ell\gg1}$ and the correct $C^{\rm g,den+mag}_{\ell\gg1}$ spectra for the different binning configurations of EMU, fitting the mock data using a likelihood of the form described in \autoref{sec:like}. Note that for the moment we neglect RSDs in the modelling of the synthetic data. The reason for this will be come clear afterwards, and we discuss the issue in \autoref{sec:RSD}. The mock-data vector ${\bm d}_\ell$ is thus constructed assuming the density perturbations and the magnification bias described in \autoref{sec:Apower spectrum}, according to the fiducial cosmology given in \autoref{tab:params}. Additionally, we need to add a number of extra nuisance parameters to our analysis, that will be marginalised over, in addition to the cosmological parameters of interest. These nuisance parameters model our ignorance on some underlying quantity such as the galaxy bias, and depend also upon the binning strategy adopted. We introduce three cases: \begin{enumerate} \item An idealistic scenario, where the galaxy bias is perfectly known, keeping its fiducial values as in \autoref{tab:2bins} and \autoref{tab:5bins}; \item A realistic scenario, with an single bias amplitude parameter spanning the whole redshift range, which is taken as a free parameter; \item A realistic, yet conservative scenario, allowing for a free galaxy bias parameter per each redshift bin. \end{enumerate} Let us finally remark that the magnification bias for each redshift bin keeps its fiducial value as in \autoref{tab:2bins} and \autoref{tab:5bins}, and it remains fixed throughout the analysis and for all the scenarios. Moreover, we choose to take the means of the posterior distribution instead of the best-fit values to allow for safer conclusions in the case of highly non-Gaussian posterior distributions (see Paper I). The results are presented and discussed thoroughly in the next subsections where we uniformly opt to show the constraints on the derived parameter \begin{equation} S_8=\sigma_8 \sqrt{\frac{\Omega_{\rm m}}{0.3}}, \end{equation} which is better constrained than $\sigma_8$, and is not correlated with $\Omega_{\rm m}$. In all plots the means of the posterior along with the 68\% marginal errors for each parameter are shown. \subsection{Constraints on $\mathbf\Lambda$CDM} \label{sec:TH_Lamblda} In \autoref{fig:LCDM} we present the $68\%$ marginal confidence intervals and the means on $\{S_8,\,h\}$ for 2 and 5 Gaussian bins---a binning scenario closer to reality. As a general remark, we shall see that whether we consider the realistic or the conservative scenarios, the constraining power that we get from the correct model (i.e.\ den+mag) is comparable. This is true for both binning configurations, and as we will see in the following sections, this feature remains the same in the cases of extensions of the $\Lambda$CDM\ model. \begin{figure*} \centering \includegraphics[width=0.45\textwidth,trim={3.6cm 9cm 4cm 9.5cm},clip]{LCDM_S8_Gaussian.pdf}\includegraphics[width=0.45\textwidth,trim={3.6cm 9cm 4cm 9.5cm},clip]{LCDM_h_Gaussian.pdf} \caption{EMU mean and 68\% confidence intervals on the derived $S_8$ (left) and $h$ (right) cosmological parameter for Gaussian binning as a function of the number of nuisance parameters for the $\Lambda$CDM\ model. Note the different colours accounting for the number of bins and the combination of density and magnification in the theory vector.} \label{fig:LCDM} \end{figure*} Results for top-hat bins are very similar to those obtained with more realistic Gaussian bins, so we report the corresponding figure and tables in \autoref{Top-hat bins}, limiting ourselves to point out that the main difference between Gaussian and top-hat binning is that the latter sees mildly biased estimates for $h$ even in the 5-bin, 1-nuisance parameter case. This is mainly due to the slightly tighter constraints obtained with top-hat bins in this configuration, meaning that the observable is more sensitive to the Hubble constant thanks to the better redshift resolution. Besides this, on a general ground, we see no further, major difference between top-hat and Gaussian bins. This has to be attributed to the fact that the bins considered for the EMU distribution are quite wide regardless of the top-hat or Gaussian bin choice. Nonetheless, the offsets in the parameter estimates obtained with Gaussian bins are always a bit more pronounced compared to top-hat bins. That is, Gaussian bins, given the poor redshift estimate, are wider than the sharp top-hats, and so have more sources with a significantly different dynamical time, along the line of sight in the same redshift bin. As a result, the wider the bin is, the larger the magnification bias is, inducing a larger offset in the results when excluded. \subsection{Two Gaussian bins} In the case where the galaxy bias is perfectly known---the idealistic scenario, marked by `0 nuisance parameters' on abscissas of \autoref{fig:LCDM}---it is evident that when we fit the mock data with the complete model (blue error bar), the input reference values are well within the $68\%$ error interval calculated on both parameter, $S_8$ and $h$. On the other hand, when we assume the incomplete model (cyan error bar), namely ignoring the magnification contribution in the theory vector, the estimates of $\{S_8,\,h\}$ are clearly biased with respect to the input reference. Then, in the realistic scenario we introduce a free galaxy bias parameter $\alpha_{\rm EMU}$ for the whole redshift range (`1 nuisance parameters' mark on the $x$-axis). The results presented on the cosmological set $\{S_8,\,h\}$ are then obtained after marginalising over this nuisance parameter. Interestingly, now the results on $S_8$ are different. That is, even with the incorrect model $S_8$ becomes totally unconstrained (cyan error bar). The reason for this is that the galaxy density field is highly sensitive to the galaxy bias. As a result, there is a degeneracy between the galaxy bias and the amplitude of matter fluctuations, $S_8$. Nonetheless, when we consider magnification, too (blue error bar), we lift this degeneracy considerably, and the error bar shrinks. Now, we examine the conservative scenario, where we allow for a nuisance bias parameter for each redshift bin, $b_i$, in the range $[0.1,3.5]$ to be marginalised over (`2 nuisance parameters' tick). Constraints on $S_8$ is quite similar to those of the realistic scenario, with the incomplete model yielding a degenerate $S_8$ (cyan error bar) estimate, in turn mitigated by the incorporation of the magnification bias (blue error bar) for the same reasons mentioned above. On the contrary, we see no deviance in the $h$ for the wrong model (cyan error bar). This is probably due to the fact that we use a larger number of nuisance parameters, leading to an overall broadening of the confidence intervals. The findings for the case of 2 Gaussian bins are quantitatively summarised in \autoref{tab:results_EMU2G_LCDM}. \begin{table*} \centering \caption{Means and corresponding $68\%$ marginal error intervals on cosmological parameters for the EMU radio continuum galaxy survey applying 2 Gaussian bins with the $\Lambda$CDM\ model.} \begin{tabular}{lllcllcll} \hline \multicolumn{9}{c}{2 Gaussian bins ($\Lambda$CDM)} \\ \hline & \multicolumn{2}{c}{Ideal scenario} && \multicolumn{2}{c}{Realistic scenario} && \multicolumn{2}{c}{Conservative scenario} \\ \cline{2-3}\cline{5-6}\cline{8-9} & \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} \\ \hline \hline $S_8$ & $0.962\pm0.045$ & $0.830\pm0.044$ && $1.04\pm0.34$ & $0.82\pm0.12$ && $0.88\pm0.25$ & $0.81\pm0.12$ \\ $h$ & $0.502\pm0.059$ & $0.686\pm0.096$ && $0.481\pm0.066$ & $0.69\pm0.12$ && $0.68\pm0.14$ & $0.68\pm0.14$ \\ \hline \end{tabular} \label{tab:results_EMU2G_LCDM} \end{table*} \subsection{Five Gaussian bins} Let us now turn to the results obtained with 5 bins. Starting from the idealistic case, where the galaxy bias is known exactly, it is clear that there is no bias on any cosmological parameter of interest when using the wrong model (yellow error bar). After marginalising over the normalisation bias parameter for the whole redshift range (realistic scenario), a degeneracy between this $\alpha_{\rm EMU}$ and $S_8$ appears (yellow error bar), in a similar fashion to the 2 bin analysis with density only. In agreement with the previous results, the correction of the magnification effect yields more stringent constraints (red error bar). Also, $h$ estimated with the incomplete model (yellow error bar) stays consistent with the fiducial cosmology for both the realistic and the conservative case. It is worth noting that the picture changes in the conservative case (now allowing this prior range $[0.1,9.0]$) concerning the estimate on $S_8$ with the wrong model (yellow error bar). In detail, this estimate is biased for more than $68\%$ below the reference value. However, the inclusion of magnification corrects for this bias completely (red error bar). The last result on $S_8$ may seem a bit unexpected, as it is evident from the analysis with the 2 bins that both the realistic and the conservative scenarios yield comparable results on $S_8$ that are quite degenerate, yet not biased, with the density-only model.\footnote{It is worth mentioning that this degeneracy is also shown on $\sigma_8$ for the cases of photometric and \textsc{Hi}-galaxy surveys (see Paper I), when one tries to fit mock data simulated assuming both density and RSDs, against spectra including density fluctuations only.} To understand this, let us draw the reader's attention to the galaxy bias fiducial values of \autoref{tab:5bins}, chosen for the reference cosmology to produce the mock data, it is evident that these values are quite large. This is normal since the EMU survey as a radio continuum experiment probes very high redshifts, where the galaxy bias is expected to be rather large. In addition to this, we have already proved that an incomplete model chosen to fit the correct data can sometimes be insufficient to describe it successfully, leading to a misplaced/biased peak of the posterior. This, along with the fact that the galaxy bias extends to high values, leads the incomplete model to make erroneous overestimates of the galaxy bias nuisance parameters, which are counterbalanced by a rather low and therefore biased measurement on $\sigma_8$, which is of course imprinted on $S_8$ as well. Despite this peculiar result for the incomplete model in the conservative scenario for the 5 bins, generally the biased estimates with the wrong model are those in the analysis with 2 very wide bins described in the previous subsection. This leads to the conclusion that the magnification contributing to the galaxy clustering is very significant, and it may not be neglected when wide redshift bins are chosen. This makes sense, too, since the magnification bias of \autoref{eq:W_mag} is an integrated effect, implying that the wider the redshift range of the sources who are inside the bin, the more enhanced the effect of the magnification will be, leading to important biases when it is not considered. By comparing the results with the 2-bin case, one can easily appreciate that the constraints obtained with the five narrower bins are tighter, especially on $h$. This can be attributed to the fact that the parameter's effect on the power spectrum can be determined through an accurate determination of its redshift dependence, which is more precise with narrower redshift bins. The findings for the case of 5 Gaussian bins are quantitatively summarised in \autoref{tab:results_EMU5G_LCDM}. \begin{table*} \centering \caption{Same as \autoref{tab:results_EMU2G_LCDM}, but for the case of 5 Gaussian bins.} \begin{tabular}{lllcllcll} \hline \multicolumn{9}{c}{5 Gaussian bins ($\Lambda$CDM)} \\ \hline & \multicolumn{2}{c}{Ideal scenario} && \multicolumn{2}{c}{Realistic scenario} && \multicolumn{2}{c}{Conservative scenario} \\ \cline{2-3}\cline{5-6}\cline{8-9} & \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} \\ \hline \hline $S_8$ & $0.826\pm0.027$ & $0.827\pm0.026$ && $0.83\pm0.20$ & $0.818\pm0.099$ && $0.62\pm0.11$ & $0.75\pm0.11$ \\ $h$ & $0.699\pm0.059$ & $0.684\pm0.057$ && $0.698\pm0.057$ & $0.680\pm0.055$ && $0.683\pm0.075$ & $0.669\pm0.072$ \\ \hline \end{tabular} \label{tab:results_EMU5G_LCDM} \end{table*} \subsection{Constraints on dark energy} Let us know move to the first extension to $\Lambda$CDM\ considered, namely dynamical dark energy as in \autoref{sec:DE}. The $68\%$ marginal confidence intervals and means on the cosmological set $\{S_8,\,h,\,w_0,\,w_a\}$ are presented in \autoref{fig:w0waCDM}, \autoref{tab:results_EMU2G_w0waCDM}, and \autoref{tab:results_EMU5G_w0waCDM}. \begin{figure*} \centering \includegraphics[width=0.45\textwidth,trim={3.6cm 9cm 4cm 7cm},clip]{w0waCDM_S8.pdf}\includegraphics[width=0.45\textwidth,trim={3.6cm 9cm 4cm 7cm},clip]{w0waCDM_h.pdf}\\\includegraphics[width=0.45\textwidth,trim={3.6cm 9cm 4cm 9.5cm},clip]{w0waCDM_w0.pdf}\includegraphics[width=0.45\textwidth,trim={3.6cm 9cm 4cm 9.5cm},clip]{w0waCDM_wa.pdf} \caption{Same as \autoref{fig:LCDM}, but for the dark energy parameter set.} \label{fig:w0waCDM} \end{figure*} \begin{table*} \centering \caption{Same as \autoref{tab:results_EMU2G_LCDM}, but for dark energy.} \begin{tabular}{lllcllcll} \hline \multicolumn{9}{c}{2 Gaussian bins (DE)} \\ \hline & \multicolumn{2}{c}{Ideal scenario} && \multicolumn{2}{c}{Realistic scenario} && \multicolumn{2}{c}{Conservative scenario} \\ \cline{2-3}\cline{5-6}\cline{8-9} & \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} \\ \hline \hline $S_8$ & $0.78\pm0.10$ & $0.883\pm0.083$ && $0.92\pm0.30$ & $0.84\pm0.10$ && $0.77\pm0.25$ & $0.82\pm0.10$ \\ $h$ & $0.68\pm0.16$ & $0.61\pm0.13$ && $0.66\pm0.13$ & $0.58\pm0.13$ && $0.74\pm0.15$ & $0.66\pm0.12$ \\ $w_0$ & $0.10\pm0.66$ & $-0.96\pm0.63$ && $0.02\pm0.67$ & $-1.22\pm0.66$ && $0.48\pm0.55$ & $-0.84\pm0.78$ \\ $w_a$ & $-2.8\pm1.5$ & $-0.8\pm1.8$ && $-2.2\pm1.4$ & $-0.6\pm1.4$ && $-2.4\pm1.1$ & $-1.2\pm1.6$ \\ \hline \end{tabular} \label{tab:results_EMU2G_w0waCDM} \end{table*} \begin{table*} \centering \caption{Same as \autoref{tab:results_EMU5G_LCDM}, but for dark energy.} \begin{tabular}{lllcllcll} \hline \multicolumn{9}{c}{5 Gaussian bins (DE)} \\ \hline & \multicolumn{2}{c}{Ideal scenario} && \multicolumn{2}{c}{Realistic scenario} && \multicolumn{2}{c}{Conservative scenario} \\ \cline{2-3}\cline{5-6}\cline{8-9} & \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} \\ \hline \hline $S_8$ & $0.840\pm0.035$ & $0.839\pm0.037$ && $0.87\pm0.22$ & $0.812\pm0.098$ && $0.593\pm0.085$ & $0.73\pm0.13$ \\ $h$ & $0.610\pm0.068$ & $0.666\pm0.080$ && $0.605\pm0.060$ & $0.663\pm0.086$ && $0.716\pm0.087$ & $0.632\pm0.072$ \\ $w_0$ & $-0.35\pm0.26$ & $-0.97\pm0.25$ && $-0.33\pm0.24$ & $-0.94\pm0.26$ && $0.02\pm0.67$ & $-0.64\pm0.44$ \\ $w_a$ & $-1.64\pm0.70$ & $-0.14\pm0.68$ && $-1.68\pm0.66$ & $-0.22\pm0.74$ && $-2.2\pm1.5$ & $-1.6\pm1.6$ \\ \hline \end{tabular} \label{tab:results_EMU5G_w0waCDM} \end{table*} Generally speaking, we find the same behaviour of constraints on $S_8$ and $h$ as for $\Lambda$CDM, but there are a couple of points which nonetheless differ from the $\Lambda$CDM\ results. The former is that in this parameterisation, the density-alone model for the 5 bins yields a slightly biased result on $h$ in the realistic scenario. The latter concerns that, in particular, the idealistic case constraints are a bit weaker than the $\Lambda$CDM\ ones. This, of course, is due to the addition of the parameter set $\{w_0,\,w_a\}$, resulting in a larger statistical uncertainty in the posterior, keeping even the constraints for the wrong model and the 2 wide bins, consistent within 1$\sigma$ from the reference cosmology. Apart from that, regardless of the binning, a correct modelling yields comparable results for the realist and the conservative case, within $68\%$ from the fiducial values. If we now focus on $\{w_0,\,w_a\}$, which constitutes one of the main points of our paper. It is evident that for any binning applied in the density-only model, since the reconstructed results are always biased on both parameters whether we introduce nuisance parameters to be marginalised over or not. In detail, we see that the picture of the analysis with the 2 bins is independent of the status of knowledge of the galaxy bias. The same is true for the 5 bins, apart form the conservative case where we get weakened results. It is worth noticing again that from the two configurations, the 5-bin choice yields better constraints. Indeed, after having a look at the mean values estimated by the incomplete model, we can really appreciate that the bias is more pronounced with the wider bins (cyan error bars compared to yellow ones). Generally, it is obvious that the correct model (blue in the 2-bin and red in the 5-bin case) always accepts the fiducial values $w_0=-1$ and $w_a=0$ within the $68\%$ marginal error. Given these results, we infer that fitting the mock data with the complete model containing the same full information (density fluctuations and magnification) does not point to a spurious dark energy extension of the $\Lambda$CDM\ model, which would not otherwise be the case if we ignored the magnification. This demonstrates the fact that the inclusion of the magnification bias on the galaxy density field is indispensable, in order to avoid misinterpretation of the results on the cosmological parameter estimation. \subsection{Constraints on modified gravity} Finally, \autoref{fig:QSCDM}, \autoref{tab:results_EMU2G_Q0S0CDM}, and \autoref{tab:results_EMU5G_Q0S0CDM} present the parameter constraints on the modified gravity model parameters $\{S_8,\,h,\,Q_0,\,\Sigma_0\}$. \begin{figure*} \centering \includegraphics[width=0.45\textwidth,trim={3.6cm 9cm 4cm 7cm},clip]{QSCDM_S8.pdf}\includegraphics[width=0.45\textwidth,trim={3.6cm 9cm 4cm 7cm},clip]{QSCDM_h.pdf}\\\includegraphics[width=0.45\textwidth,trim={3.6cm 9cm 4cm 9.5cm},clip]{QSCDM_Q0.pdf}\includegraphics[width=0.45\textwidth,trim={3.6cm 9cm 4cm 9.5cm},clip]{QSCDM_S0.pdf} \caption{Same as \autoref{fig:LCDM}, but for the modified gravity parameter set.} \label{fig:QSCDM} \end{figure*} \begin{table*} \centering \caption{Same as \autoref{tab:results_EMU2G_LCDM}, but for modified gravity.} \begin{tabular}{lllcllcll} \hline \multicolumn{9}{c}{2 Gaussian bins (MG)} \\ \hline & \multicolumn{2}{c}{Ideal scenario} && \multicolumn{2}{c}{Realistic scenario} && \multicolumn{2}{c}{Conservative scenario} \\ \cline{2-3}\cline{5-6}\cline{8-9} & \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} \\ \hline \hline $S_8$ & $0.897\pm0.080$ & $0.842\pm0.062$ && $0.97\pm0.30$ & $0.83\pm0.11$ && $0.84\pm0.22$ & $0.82\pm0.11$ \\ $h$ & $0.60\pm0.12$ & $0.69\pm0.12$ && $0.59\pm0.16$ & $0.70\pm0.13$ && $0.70\pm0.13$ & $0.70\pm0.13$ \\ $Q_0$ & $0.85\pm0.23$ & $0.77\pm0.30$ && $0.88\pm0.23$ & $0.80\pm0.29$ && $0.74\pm0.32$ & $0.73\pm0.38$ \\ $\Sigma_0$ & $0.89\pm0.12$ & $0.89\pm0.15$ && $0.91\pm0.12$ & $0.91\pm0.15$ && $0.90\pm0.15$ & $0.91\pm0.19$ \\ \hline \end{tabular} \label{tab:results_EMU2G_Q0S0CDM} \end{table*} \begin{table*} \centering \caption{Same as \autoref{tab:results_EMU5G_LCDM}, but for modified gravity.} \begin{tabular}{lllcllcll} \hline \multicolumn{9}{c}{5 Gaussian bins (MG)} \\ \hline & \multicolumn{2}{c}{Ideal scenario} && \multicolumn{2}{c}{Realistic scenario} && \multicolumn{2}{c}{Conservative scenario} \\ \cline{2-3}\cline{5-6}\cline{8-9} & \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} && \multicolumn{1}{c}{den} & \multicolumn{1}{c}{den+mag} \\ \hline \hline $S_8$ & $0.829\pm0.043$ & $0.828\pm0.037$ && $0.82\pm0.20$ & $0.83\pm0.095$ && $0.591\pm0.085$ & $0.75\pm0.10$ \\ $h$ & $0.711\pm0.088$ & $0.700\pm0.077$ && $0.712\pm0.086$ & $0.705\pm0.080$ && $0.713\pm0.087$ & $0.700\pm0.086$ \\ $Q_0$ & $0.83\pm0.23$ & $0.83\pm0.23$ && $0.83\pm0.23$ & $0.84\pm0.22$ && $0.75\pm0.32$ & $0.78\pm0.33$ \\ $\Sigma_0$ & $0.93\pm0.12$ & $0.92\pm0.12$ && $0.92\pm0.12$ & $0.92\pm0.11$ && $0.90\pm0.15$ & $0.92\pm0.16$ \\ \hline \end{tabular} \label{tab:results_EMU5G_Q0S0CDM} \end{table*} We see that for the 2-bins and for both the wrong (cyan error bar) and the correct (blue error bar) model, the results on $\{S_8,\,h\}$ are always within $68\%$ from the fiducial values, and once again the same pattern follows, with the degeneracy on $S_8$ and its alleviation after magnification is added in the realistic and the conservative case, which again give comparable results. When it comes to the narrower 5 bins, we have a similar behaviour with the exception that the constraints are more stringent, and there is a biased underestimation of the $S_8$ with the incomplete model (yellow error bar) in the conservative case. Also, the constraining power here for both binning scenarios on the set $\{S_8,\,h\}$ is similar to the case of dark energy. Concerning the modified gravity parameters $\{Q_0,\,\Sigma_0\}$, if any of these two parameters deviates from unity, this would indicate that the $\Lambda$CDM\ model possibly needs to be replaced by a modified theory of gravity. Nonetheless, we can see for both binning configurations and both models that the results are comparable, while all the estimates are unbiased with respect to the fiducial input value. In addition, the narrower 5 redshift bins yield slightly tighter constraints than the 2-bin case. Overall, we can conclude that even after ignoring the magnification correction in galaxy clustering, we are not able to see a biased result on the $\{Q_0,\,\Sigma_0\}$ that would, incorrectly of course, imply that the vanilla $\Lambda$CDM\ model is not the complete theory to describe the mock data \subsection{Including redshift-space distortions} \label{sec:RSD} At last, we examine the impact of RSDs in the analysis. In Paper I, we have already presented results that show, for optical/near-IR and radio \textsc{Hi}-line galaxy surveys, that if one neglects RSDs when fitting against the data, one can induce biases in the cosmological parameter estimation. In this case, we create the mock data including all terms in \autoref{eq:W_tot}. We focus on the idealistic scenario, where the galaxy bias is perfectly known, as if no deviation from the results described above is found in this case, we even less expect to see any for the realistic and conservative cases. We constrain the parameter set $\{\Omega_{\rm m},\,h,\sigma_8\}$ with four different constructions of the theory vector: $i)$ density only; $ii)$ density and magnification (these two corresponding to what discussed in the previous subsections); $iii)$ density and RSDs; $iv)$ and density, RSDs, and magnification. \autoref{fig:RSD} presents the results for the four different models considered. The left panels show the constraints on the set $\{S_8,\,h\}$ for the 2-bin case. It is clear that there are biased estimates when the theory model includes the density fluctuations alone or the density along with the RSDs correction, neglecting in both cases the magnification bias. On the contrary, the theory model that contains the full information (density, RSDs and magnification) as the mock data is well within $68\%$ from the reference fiducial values, and so does the model which considers the density field and the magnification flux, but ignoring now RSDs. As for the results of the 5-bin case shown in the right panels, it is obvious that the constraints are better on both $S_8$ and $h$, while there are no biased estimates at all with any of the three incomplete models tested. \begin{figure*} \centering \includegraphics[width=0.45\textwidth,trim={4cm 9cm 4cm 7cm},clip]{all_S8_2G.pdf}\includegraphics[width=0.45\textwidth,trim={4cm 9cm 4cm 7cm},clip]{all_S8_5G.pdf}\\\includegraphics[width=0.45\textwidth,trim={4cm 9cm 4cm 9.5cm},clip]{all_h_2G.pdf}\includegraphics[width=0.45\textwidth,trim={4cm 9cm 4cm 9.5cm},clip]{all_h_5G.pdf} \caption{EMU mean and 68\% constraints on the derived $S_8$ (top) and $h$ (bottom), cosmological parameter for 2 (left) and 5 (right) Gaussian bins in a $\Lambda$CDM\ model where the galaxy bias is known exactly. Note that the data to be fitted are constructed incorporating both RSDs and the magnification bias correction on the galaxy density field in a $\Lambda$CDM\ fiducial cosmology (vertical dashed line).} \label{fig:RSD} \end{figure*} The above results, lead to the conclusion that the inclusion or the ignorance of the RSDs correcting term on the galaxy number counts, cannot affect our analysis at any extend, and can be safely ignored in our study. The reason behind this is the very large width of the redshift bins. Even when subdividing the redshift galaxy distribution into 5 bins, they are still quite wide in the redshift space, thus leading to a washing out of the RSD effect. Oppositely, narrower bins call for the inclusion of RSDs (see Paper I). On the other hand, this test provides a further confirmation that in the case of radio continuum surveys like EMU, the magnification bias ought to be included in the modelling, in order to avoid potential biases in the cosmological parameter estimation. \section{Conclusions} \label{sec:conclusion} In the current work we have aimed to assess the effect of correctly including the weak lensing effect of magnification bias in galaxy number counts in a fully likelihood-based parameter estimation analysis. We have not only investigate standard $\Lambda$CDM\ parameters, as well compelling extensions such as dynamical dark energy and a phenomenological parameterisation to modified gravity. To maximise the impact of magnification---which, being lensing, is an integrated effect---we have focussed the analysis on the specifications of deep radio continuum surveys using the Evolutionary Map of the Universe as a reference, for which we chose both two (very wide) and five (narrower yet broad) redshift bins. Moreover, we have restricted the harmonic-space angular power spectrum to the Limber approximation and the linear scales, and according to that, applied cuts on the multipole range. Then, we have created mock data including the magnification in the galaxy clustering and fit it with two theory vector constructions: one correctly including magnification bias, and another neglecting lensing. In addition to that, we introduced a number of scenarios regarding the knowledge we have on the galaxy bias: \begin{enumerate} \item An idealistic scenario where the galaxy bias is perfectly known; \item A pessimistic scenario where a free normalisation galaxy bias parameter is introduced at the whole redshift range; \item A conservative scenario that allows for a nuisance galaxy bias parameter for each bin. \end{enumerate} Considering all these cases, we summarise here the most important results obtained with the different cosmological models: \begin{itemize} \item[] \textit{$\varLambda$CDM} -- Here, the results we obtained with both binning configurations (Gaussian and top-hat) are comparable since the bins are always wide enough. In detail, we saw that there are biased estimates for the parameters $\{S_8,\,h\}$ when the galaxy bias is know exactly and if we neglect the magnification effect. This bias is not seen when we include nuisance parameters, but it is evident that the wrong theoretical model yields unconstrained results on the normalisation of the power spectrum $\sigma_8$ which is degenerate with galaxy bias. We lift this bias when we consider the magnification flux which is independent on the galaxy bias. Another point is that when the narrower binning is chosen, the parameters are more constrained due to the better redshift precision on the power spectrum. In addition to that, we appreciate in this case that there is a biased measurement in the conservative case with the incomplete model on $S_8$ owing to the overestimate of the nuisance galaxy bias parameters. This is also true for the following cosmological models that we examined. The results from now on were obtained adopting the more realistic case for the Gaussian redshift bins. \item[] \textit{DE} -- Regarding the constraints on this CPL Dark Energy model, the biased estimates are not seen when we include the wrong theory vector in the 2-bin case, except the biased result on $h$ in the pessimistic scenario with the 5-bins. Overall, as in the $\Lambda$CDM\ model, there are better constraints with the narrow binning over the wide one, and also degeneracy on $S_8$ which is alleviated with the magnification flux in the pessimistic and the conservative scenarios. As for the results on $\{w_0,\,w_a\}$, in the all the cases and the scenarios considered, the estimates with the incomplete model are biased. In the wide binning, the bias is slightly more enhanced since the magnification flux as a lensing effect becomes more important. \item[] \textit{MG} -- When we examine the Modified Gravity model, the results on $\{S_8,\,h\}$ are similar to those of the CPL, but with the only bias now seen only for the 5-bin conservative case on $S_8$. There are no biases on any parameter out of the set $\{Q_0,\,\Sigma_0\}$ \end{itemize} In the final test we considered, we proved that the inclusion of the RSD correction in the galaxy clustering is not important in the case of radio continuum surveys like EMU, since the very poor redshift knowledge leads to the dilution of the effect. All the above results stress the importance that for the radio continuum surveys, the incorporation of the magnification flux is is necessary on the one hand, to avoid biases on the estimated parameters, and on the other hand, to break the degenerate relation between $\sigma_8$ and the galaxy bias. Also these biased estimates tend to increase when very wide bins are considered, a results that demonstrates the fact that the magnification effect becomes more important with time. \iffalse \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{2THideal_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2THideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2THideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m}\\ \includegraphics[width=0.33\textwidth]{5THideal_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5THideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5THideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \caption{Constraints on cosmological parameters for the idealistic case in the $\Lambda$CDM\ model, i.e.\ no nuisance parameters. Outer and inner contours respectively correspond to 95\% and 68\% confidence levels in the joint 2D parameter space. \textit{Top panels:} (\textit{Bottom panels:}) parameter estimation from the EMU 2 top-hat bins (5 Top-hat bins) deep radio survey with the blue and green contours accounting for the complete and the incomplete model respectively. The white cross indicates the fiducial cosmology.} \label{fig:main_idealTH} \end{figure*} \subsubsection{Gaussian bins} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{2Gideal_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2Gideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2Gideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m}\\ \includegraphics[width=0.33\textwidth]{5Gideal_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5Gideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5Gideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \caption{Same as \autoref{fig:main_idealTH} but for Gaussian bins and the ideal scenario in the $\Lambda$CDM\ model} \label{fig:main_idealG} \end{figure*} \subsection{Realistic scenario in the $\Lambda$CDM\ model} \subsubsection{Top-hat bins} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{2THrealistic_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2THrealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2THrealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m}\\ \includegraphics[width=0.33\textwidth]{5THrealistic_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5THrealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5THrealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \caption{Same as \autoref{fig:main_idealTH} (Top-hat bins) but for the realistic scenario in the $\Lambda$CDM\ model} \label{fig:main_realisticTH} \end{figure*} \subsubsection{Gaussian bins} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{2Grealistic_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2Grealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2Grealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m}\\ \includegraphics[width=0.33\textwidth]{5Grealistic_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5Grealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5Grealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \caption{Same as \autoref{fig:main_idealTH} but for Gaussian bins and the realistic scenario in the $\Lambda$CDM\ model} \label{fig:main_realisticG} \end{figure*} \subsection{Conservative scenario in the $\Lambda$CDM\ model} \subsubsection{Top-hat bins} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{2THcons_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2THcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2THcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m}\\ \includegraphics[width=0.33\textwidth]{5THcons_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5THcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5THcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \caption{Same as \autoref{fig:main_idealTH} (Top-hat bins) but for the conservative scenario in the $\Lambda$CDM\ model} \label{fig:main_consTH} \end{figure*} \subsubsection{Gaussian bins} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{2Gcons_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2Gcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{2Gcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m}\\ \includegraphics[width=0.33\textwidth]{5Gcons_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5Gcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{5Gcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \caption{Same as \autoref{fig:main_idealG} but for Gaussian bins and the conservative scenario in the $\Lambda$CDM\ model} \label{fig:main_consG} \end{figure*} \subsection{Ideal scenario in the DE model} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{w0wa2Gideal_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{w0wa2Gideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\\ \includegraphics[width=0.33\textwidth]{w0wa2Gideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \includegraphics[width=0.33\textwidth]{w0wa2Gideal_2D_cosmological_parameters--wa_cosmological_parameters--w} \caption{The constraints for 2 Gaussian bins for the ideal scenario in the DE model} \label{fig:main_ideal2Gw0wa} \end{figure*} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{w0wa5Gideal_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{w0wa5Gideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\\ \includegraphics[width=0.33\textwidth]{w0wa5Gideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \includegraphics[width=0.33\textwidth]{w0wa5Gideal_2D_cosmological_parameters--wa_cosmological_parameters--w} \caption{The constraints for 5 Gaussian bins for the ideal scenario in the DE model} \label{fig:main_ideal5Gw0wa} \end{figure*} \subsection{Realistic scenario in the DE model} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{w0wa2Grealistic_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{w0wa2Grealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\\ \includegraphics[width=0.33\textwidth]{w0wa2Grealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \includegraphics[width=0.33\textwidth]{w0wa2Grealistic_2D_cosmological_parameters--wa_cosmological_parameters--w} \caption{The constraints for 2 Gaussian bins for the realistic scenario in the DE model} \label{fig:main_realistic2Gw0wa} \end{figure*} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{w0wa5Grealistic_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{w0wa5Grealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\\ \includegraphics[width=0.33\textwidth]{w0wa5Grealistic_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \includegraphics[width=0.33\textwidth]{w0wa5Grealistic_2D_cosmological_parameters--wa_cosmological_parameters--w} \caption{The constraints for 5 Gaussian bins for the realistic scenario in the DE model} \label{fig:main_realistic5Gw0wa} \end{figure*} \subsection{Conservative scenario in the DE model} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{w0wa2Gcons_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{w0wa2Gcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\\ \includegraphics[width=0.33\textwidth]{w0wa2Gcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \includegraphics[width=0.33\textwidth]{w0wa2Gcons_2D_cosmological_parameters--wa_cosmological_parameters--w} \caption{The constraints for 2 Gaussian bins for the conservative scenario in the DE model} \label{fig:main_cons2Gw0wa} \end{figure*} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{w0wa5Gcons_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{w0wa5Gcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\\ \includegraphics[width=0.33\textwidth]{w0wa5Gcons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \includegraphics[width=0.33\textwidth]{w0wa5Gcons_2D_cosmological_parameters--wa_cosmological_parameters--w} \caption{The constraints for 5 Gaussian bins for the conservative scenario in the DE model} \label{fig:main_cons5Gw0wa} \end{figure*} \subsection{Ideal scenario in the MG model} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{MG_2G_ideal_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{MG_2G_ideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\\ \includegraphics[width=0.33\textwidth]{MG_2G_ideal_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \includegraphics[width=0.33\textwidth]{MG_2G_ideal_2D_modified_{\rm g}ravity--mgsfix_modified_{\rm g}ravity--mgqfix} \caption{The constraints for 2 Gaussian bins for the ideal scenario in the MG model} \label{fig:main_ideal2GMG} \end{figure*} \subsection{Realistic scenario in the MG model} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{MG_2G_real_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{MG_2G_real_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\\ \includegraphics[width=0.33\textwidth]{MG_2G_real_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \includegraphics[width=0.33\textwidth]{MG_2G_real_2D_modified_{\rm g}ravity--mgsfix_modified_{\rm g}ravity--mgqfix} \caption{The constraints for 2 Gaussian bins for the realistic scenario in the MG model} \label{fig:main_realistic2GMG} \end{figure*} \subsection{Conservative scenario in the MG model} \begin{figure*} \centering \includegraphics[width=0.33\textwidth]{MG_2G_cons_2D_cosmological_parameters--omega_m_cosmological_parameters--h0}\includegraphics[width=0.33\textwidth]{MG_2G_cons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--h0}\\ \includegraphics[width=0.33\textwidth]{MG_2G_cons_2D_cosmological_parameters--sigma8_input_cosmological_parameters--omega_m} \includegraphics[width=0.33\textwidth]{MG_2G_cons_2D_modified_{\rm g}ravity--mgsfix_modified_{\rm g}ravity--mgqfix} \caption{The constraints for 2 Gaussian bins for the conservative scenario in the MG model} \label{fig:main_conservative2GMG} \end{figure*} \fi \section*{Acknowledgements} KT and SC acknowledge support from the `Departments of Excellence 2018-2022' Grant (L.\ 232/2016) awarded by the Italian Ministry of Education, University and Research (\textsc{miur}). SC is funded by \textsc{miur} through Rita Levi Montalcini project `\textsc{prometheus} -- Probing and Relating Observables with Multi-wavelength Experiments To Help Enlightening the Universe's Structure'. \bibliographystyle{mnras}
\section{Missing proofs.} \label{sec:missing-proofs} \begin{proof}[Proof of Proposition~\ref{prop:symmetry}] Now, consider any optimal, persuasive signaling scheme $(\phi, p)$, and any optimal dual $\lambda$. For a permutation $\pi:[n]\rightarrow [n]$, let $\pi(\theta)$ denote the state of nature $[\theta_{\pi(1)},\ldots, \theta_{\pi(n)}]$, $\pi(p)$ denote the prices $p(\pi^{-1}(1)),\ldots,p(\pi^{-1}(n))$. Let $\pi(\lambda)$ denote the dual variables with $\pi(\lambda)(i,j) = \lambda(\pi^{-1}(i),\pi^{-1}(j))$. Finally, let $\pi(\phi)$ denote the signaling scheme that on state of nature $\theta$, recommends action $i$ with probability $\phi_{\pi(\theta)}(\pi^{-1}(i))$. Now we just want to confirm that $(\pi(\phi), \pi(P))$ and $\pi(\lambda)$ form another optimal primal/dual pair for any permutation $\pi$ (because $\mu_\nstate$ is symmetric). Let's first compute the probability that $\pi(\phi)$ recommends action $\pi(i)$. By symmetry of $\mu_\nstate$, the states $\theta$ and $\pi^{-1}(\theta)$ occur with the same probability. On state $\theta$, $\phi$ recommends action $i$ with probability $\phi_{\theta}(i)$. On state $\pi^{-1}(\theta)$, $\pi(\phi)$ recommends action $\pi(i)$ with probability $\phi_{\pi(\pi^{-1}(\theta))}(\pi^{-1}(\pi(i))) = \phi_{\theta}(i)$ (this is just chasing through the definition of $\pi(\phi)$). Therefore, because $\theta$ and $\pi^{-1}(\theta)$ occur with the same probability, \emph{$\pi(\phi)$ recommends action $\pi(i)$ with the same probability $\phi$ recommends action $i$}. This immediately means that the total payment made in $\phi$ and $\pi(\phi)$ is identical because $(\phi,p)$ pays $p(i)$ whenever $\phi$ recommends action $i$, and $(\pi(\phi),\pi(p))$ pays $p(\pi^{-1}(\pi(i))) = p(i)$ whenever $\pi(\phi)$ recommends action $\pi(i)$, and these two probabilities are the same for all $i$. Now we also want to claim that the above calculations show that the sender reward is identical under $\phi$ and $\pi(\phi)$ (assuming the receiver takes the recommended action). To see this, observe again that if we couple the events where the state of nature $\theta$ is drawn for $\phi$, and state $\pi^{-1}(\theta)$ is drawn for $\pi(\phi)$, then $\phi$ recommends action $i$ with type $\theta_i$ with probability $\phi_{\theta}(i)$, and $\pi(\phi)$ recommends action $\pi(i)$ with type $\theta_{\pi^{-1}(\pi(i))} = \theta_i$ with probability $\phi_{\theta}(i)$. So in fact for every state of nature, the expected sender reward on state $\theta$ under $\phi$ is the same as the expected sender reward on state $\pi^{-1}(\theta)$ under $\pi(\phi)$. Next, we want to claim that the receiver's expected payoff for taking action $\pi(j)$ when $\pi(i)$ is recommended by $\pi(\phi)$ is exactly the same as their expected payoff for taking action $j$ when $i$ is recommended by $\phi$. We can write the expected payoff for taking action $j$ when $i$ is recommended (times the probability that $i$ is recommended by $\phi$) as: $$\sum_{\theta} \mu_\nstate \phi_{\theta}(i) \rpay{j} = \sum_{\theta} \mu_\nstate \pi(\phi)_{\pi^{-1}(\theta)}(\pi(i)) r_{\pi(\theta)}(\pi(j)).$$ The RHS now computes exactly the expected payoff for taking action $\pi(j)$ when $\pi(i)$ is recommended (times the probability that $\pi(i)$ is recommended by $\pi(\phi)$). So if $\phi$ is persuasive, then $\pi(\phi)$ is persuasive as well. Finally, we want to claim that for the dual solution $\pi(\lambda)$, $(\pi(\phi),P)$ is optimal and satisfies complementary slackness. First, observe by the work above that the expected reward for the receiver for taking action $j$ when $i$ is recommended by $\phi$ is exactly the same as the expected reward for receiver for taking action $\pi(j)$ when $\pi(i)$ is recommended by $\pi(\phi)$. Combined with the fact that $\lambda(i,j) > 0 \Rightarrow$ the receiver is indifferent between following the recommendation and taking action $j$ when $\phi$ recommends $i$, and that $\pi(\lambda)(\pi(i),\pi(j)) = \lambda(\pi(\pi^{-1}(i)),\pi(\pi^{-1}(j)) )= \lambda(i,j)$, we immediately conclude that $\pi(\lambda)(\pi(i),\pi(j)) > 0 \Rightarrow$ the receiver is indifferent between following the recommendation and taking action $\pi(j)$ when $\pi(\phi)$ recommends $\pi(i)$. So complementary slackness is satisfied. Finally, observe that: $$r_{\pi^{-1}(\theta)}^{\pi(\lambda)}(\pi(i)) = \sum_{j \neq i} \pi(\lambda)(\pi(i),\pi(j))\cdot (r_{\pi^{-1}(\theta)}(\pi(i)) - r_{\pi^{-1}(\theta)}(\pi(j)) )= \sum_{j \neq i} \lambda(i,j) \cdot (\rpay{i} - \rpay{j}) = \dualr{i}$$ So if on state $\theta$, $i$ maximizes $\spay{i} + \dualr{i}$, then on state $\pi^{-1}(\theta)$, $\pi(i)$ maximizes $\spay{\pi(i)} + r^{\pi(\lambda)}_{\pi^{-1}(\theta)}(\pi(i))$, and $\pi(\phi)$ is indeed optimal for the Lagrangian problem induced by dual solution $\pi(\lambda)$. All together, this shows that $(\pi(\phi),\pi(P))$ is still persuasive and optimal, as is the dual $\pi(\lambda)$. We conclude by observing that the scheme that samples $\pi$ uniformly at random and then implements $(\pi(\phi),\pi(P))$ is therefore optimal and persuasive, as is the dual that averages $\pi(\lambda)$ over all $\pi$. It is easy to see that both primal and dual are symmetric as per the definitions. \end{proof} \begin{proof}[Proof of Proposition~\ref{prop:optimal bb with externalities}] Similar to \ref{eq:LP-binary-nopayments}, we find the optimal scheme with payments through linear programming. We add the budget-balance constraint to the previous program. The optimal signaling scheme satisfying Definition~\ref{def:budget-balance} is the solution of this LP: \begin{align*} \max~~~ &\sum_{\theta\in\Theta}\sum_{S\subseteq [N]}\mu_{\theta}\BScheme{S}\Ffun{S} &\customlabel{eq:LP-binary-payments-1}{\textit{(LP-Budget-Balanced-1)}}\\ &\sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\ni i}\BScheme{S}(\util{i}{S}+\pay{i}{1})\geq \sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\ni i}\BScheme{S}\util{i}{S\setminus \{i\}}, & \forall i\in[N], \\ &\sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\notni i}\BScheme{S}(\util{i}{S}+\pay{i}{0})\geq \sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\notni i}\BScheme{S}\util{i}{S\cup\{i\}}, & \forall i\in[N] \\ &\sum_{i\in [N]}\sum_{\theta\in\Theta }\left(\sum_{S\ni i}\mu_{\theta}\BScheme{S}\pay{i}{1}+\sum_{S\notni i}\mu_{\theta}\BScheme{S}\pay{i}{0}\right)=0&~\\ &\sum_{S\subseteq[N]}\BScheme{S}=1, ~~\forall \theta\in\Theta~~~~~~~~~\BScheme{S}\geq 0, \forall S\subseteq [N], \theta\in\Theta& \end{align*} For a given signaling scheme $\{\BScheme{S},\pay{i}{.}\}$, we introduce new variables $Q_i(1)$ and $Q_i(0)$ to be equal to the expected payment of agent $i$ for actions $1$ and $0$ respectively, where the expectation is taken over the randomness in the nature and the scheme, i.e., \begin{equation} Q_i(1)\triangleq \sum_{\theta\in\Theta }\sum_{S\ni i}\mu_{\theta}\BScheme{S}\pay{i}{1}~~,~~Q_i(0)\triangleq \sum_{\theta\in\Theta }\sum_{S\notni i}\mu_{\theta}\BScheme{S}\pay{i}{0} \end{equation} We then simplify \ref{eq:LP-binary-payments-1} by rewriting it with variables $\{\BScheme{S},Q_i(.)\}$, i.e., \begin{align} \max~~~ &\sum_{\theta\in\Theta}\sum_{S\subseteq [N]}\mu_{\theta}\BScheme{S}\Ffun{S}&\customlabel{eq:LP-binary-payments-2}{\textit{(LP-Budget-Balanced-2)}}\nonumber\\ &\sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\ni i}\BScheme{S}\util{i}{S}+Q_i(1)\geq \sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\ni i}\BScheme{S}\util{i}{S\setminus \{i\}},~~~~~~~~~\forall i\in[N]\label{eq:lp-binary-cons1}\\ &\sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\notni i}\BScheme{S}\util{i}{S}+Q_i(0)\geq \sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\notni i}\BScheme{S}\util{i}{S\cup\{i\}},~~~~~~~~~\forall i\in[N] \label{eq:lp-binary-cons2}\\ &\sum_{i\in [N]}\left(Q_i(1)+Q_i(0)\right)=0~\label{eq:lp-binary-cons3}\\ &\sum_{S\subseteq[N]}\BScheme{S}=1, ~~\forall \theta\in\Theta~~~~~~~~~\BScheme{S}\geq 0, \forall S\subseteq [N], \theta\in\Theta \end{align} To reveal the structure of the optimal scheme, we use the method of Lagrangian multipliers, \'a la Section~\ref{sec:nopayment}, and move the group of constraints \ref{eq:lp-binary-cons1}, \ref{eq:lp-binary-cons2} and \ref{eq:lp-binary-cons3} using dual variables $\{\alpha_i\}$,$\{\beta_i\}$ and $\gamma$ to the objective respectively. By rearranging the terms, this partial Lagrangian function $\mathcal{L}$ will be equal to \begin{align} \mathcal{L}_{\alpha,\beta,\gamma}\left(\phi,Q(1),Q(0)\right)&=\ex{\theta}{\sum_{S}\BScheme{S}\Ffun{S}}\nonumber\\ &+\ex{\theta}{\sum_{i}\alpha_i\sum_{S\ni i}\BScheme{S}\Gfun{i}{S}}-\ex{\theta}{\sum_{i}\beta_i\sum_{S\notni i}\BScheme{S}\Gfun{i}{S\cup\{i\}}}\nonumber\\ &+\sum_{i}(\gamma-\alpha_i)Q_i(1)+\sum_{i}(\gamma-\beta_i)Q_i(0)\label{eq:lagrangian-binary} \end{align} Define $\mathcal{S}_N$ to be the simplex over all subsets of $[N]$. Strong duality implies that the optimal primal-dual solutions of \ref{eq:LP-binary-payments-2} are the solutions of the following min-max program: \begin{multline*} \max_{{Q}(1),{Q}(0)\in\mathbb{R}^n,\forall \theta:{\phi}_\theta\in\mathcal{S}_N}\left(\min_{{\alpha},{\beta}\in\mathbb{R}_+^n,\gamma\in\mathbb{R} }\mathcal{L}_{\alpha,\beta,\gamma}\left(\phi,Q(1),Q(0)\right)\right)\\ =\min_{{\alpha},{\beta}\in\mathbb{R}_+^n,\gamma\in\mathbb{R} }\left(\max_{{Q}(1),{Q}(0)\in\mathbb{R}^n,\forall \theta:{\phi}_\theta\in\mathcal{S}_N}\mathcal{L}_{\alpha,\beta,\gamma}\left(\phi,Q(1),Q(0)\right)\right) \end{multline*} By looking at the partial Lagrangian function $\mathcal{L}$ in \eqref{eq:lagrangian-binary}, $\forall i:\alpha^*_i=\beta^*_i=\gamma^*$, simply because otherwise one can make $Q_i(1)$ (or $Q_i(0)$) converging to either $+\infty$ or $-\infty$ to maximize the objective, and make the objective unbounded, contradicting the fact that the linear program is bounded. Therefore: \begin{align} \mathcal{L}_{\alpha^*,\beta^*,\gamma^*}&\left(\phi,Q(1),Q(0)\right)=\ex{\theta}{\sum_{S}\BScheme{S}\Ffun{S}} \\ &\qquad+\gamma^*\ex{\theta}{\sum_{i}\left(\sum_{S\ni i}\BScheme{S}\Gfun{i}{S}-\sum_{S\ni i}\BScheme{S}\Gfun{i}{S\cup\{i\}}\right)}\nonumber\\ &=\ex{\theta}{\sum_{S}\BScheme{S}\Ffun{S}}+\gamma^*\ex{\theta}{\sum_{S}\left(\sum_{i\in S}\BScheme{S}\Gfun{i}{S}-\sum_{i\notin S}\BScheme{S}\Gfun{i}{S\cup\{i\}}\right)}\nonumber\\ &=\ex{\theta}{\sum_{S}\BScheme{S}\left(\Ffun{S}+\gamma^*\left(\sum_{i\in S}\Gfun{i}{S}-\sum_{i\notin S}\Gfun{i}{S\cup\{i\}}\right) \right)}\label{eq:lagrangian-binary-after} \end{align} As the optimal signaling scheme ${\phi}^*$ should maximize \ref{eq:lagrangian-binary-after}, therefore for every state $\theta$ the scheme should recommend the set $S^*_\theta$ such that \begin{equation*} S_\theta^* = \underset{S}{\argmax}~\left(\Ffun{S}+\gamma^*\left(\sum_{i\in S}\Gfun{i}{S}-\sum_{i\notin S}\Gfun{i}{S\cup\{i\}}\right) \right) \end{equation*} To compute the payments, let $x^*_i=\pr{\theta}{i\in S^*_\theta}$. Now, to have a payment rule whose expectation is equal to $\mathbf{Q}(.)$, we can define the payments as \begin{equation} p^{*(i)}(1)=\frac{Q_i(1)}{x^*_i}\cdot\mathbb{I}\{i \in S_\theta^*\},~~p^{*(i)}(0)=\frac{Q_i(0)}{1-x^*_i}\cdot\mathbb{I}\{i \notin S_\theta^*\} \end{equation} Finally, it is clear that any signaling scheme without payments is a feasible solution for \ref{eq:LP-binary-payments-1}, and hence the sender's expected payoff in the above scheme (i.e. with allocation $\{S^*_\theta\}$ and payments ${p}^*(1),{p}^*(0)$) is no smaller than the expected payoff of the sender in the optimal scheme without payments, which completes the proof. \end{proof} \input{binary-set-external} \section{Reduced forms in i.i.d. signaling} \label{appendix:reduced form} By making use of ideas related to reduced forms in Bayesian auctions and Border's theorem~\cite{B-91,M-84,MR-84}, we can simplify the LP for the independent setting. These ideas have already appeared in~\cite{DX-16}, but we reproduce them here for completeness. Let $B^\theta \in \{ 0,1 \}^{n \times m}$ be an $n$ by $m$ matrix such that $B_{ij}^\theta = 1$ iff $\theta_i = j$ (action $i$ has type $j$). Define $\signi{i} = \sum_{\theta \in \Theta}\mu_\nstate \scheme{i} B^{\theta}$, that is $\signijk{i}{j}{k}$ is the joint probability that action $j$ has type $k$ and the scheme outputs action $i$. $\mathcal{M} = \left( \signi{1}, \dots, \signi{n} \right) \in \mathbb{R}^{n \times m \times n}$ is the \emph{signature} or \emph{reduced form} of $\phi_\nstate$. $\mathcal{M}$ is realizable if there exists a signaling scheme $\phi_\nstate$ with $\mathcal{M}$ as its signature. We write $\mathcal{P}_s$ for the polytope of realizable signatures (see \cite{DX-16} for more details and properties of these reduced forms). The program for this special case, using the same change of variables as in the general case, is: \begin{align*} \max~~~&\sum_{i \in [n]} \sum_{k \in [m]} \signijk{i}{i}{k}\sipay{i}{k} -\sum_{i\in [n]}P(i)&\customlabel{eq:Lp-independent-payments}{\textit{(LP-Independent-with-Payments)}}\\ &P(i)+ \sum_{k \in [m]} \signijk{i}{i}{k}\ripay{i}{k} \geq \sum_{k \in [m]} \signijk{i}{j}{k}\ripay{i}{k} , & \text{ for } i,j \neq i \in [n] \\ &\mathcal{M} \in \mathcal{P}_s, ~~~\text{and}~~~P \in\mathcal{P} & \end{align*} While these notations are helpful to identify the computational hardness of signaling problems, as in \cite{DH-17,DX-16}, we never use them in our treatment, and we only mention them here for completeness. \subsection{Budget balanced payments under externalities } As explored in Section~\ref{sec:payment}, adding monetary payments to the signaling problem, whether payments are positive or negative, is a natural idea to boost the performance of signaling schemes. It is expected that by adding arbitrary payments, one can increase the expected sender's utility, as we have seen in Section~\ref{sec:examples-contrast}; however, it is not clear what happens if we allow restricted payments, e.g. payments that are budget-balanced. A general and mathematically interesting setting to study this question is the general multi-agent signaling with externalities. We seek to find a simple characterization for the optimal scheme, and understand its properties. In the same setting, we also study arbitrary payments and show how one can modify the previous budget balanced scheme to find the optimal scheme with arbitrary payments. This model is again mathematically interesting, but perhaps not as natural as the budget-balanced. Here is the surprising upshot of the story: with the help of Lagrangian duality we can design signaling schemes with payments that have a simple form (in contrast to the optimal scheme without payments), are budget-balanced in expectation (i.e. zero total payment in expectation), and sender's expected payoff~\footnote{ When the scheme is budget-balanced, there is no difference between expected utility and expected payoff of the sender.} is no smaller than that of the optimal signaling without payments. Also, as we explained in Section~\ref{sec:examples-contrast}, somewhat surprisingly, it is possible that the sender's expected utility strictly increases by a budget-balanced scheme. \begin{definition} \label{def:budget-balance} A \emph{budget-balanced signaling scheme} for the multi-agent binary-actions with externalities setting is a pair of an \emph{allocation rule} $\{\BScheme{S}\}_{S\subseteq [N]}$ and a \emph{payment rule} $\{\pay{i}{a}\}_{i\in[N], a\in\{0,1\}}$ satisfying: \begin{align*} &\forall \theta\in \Theta: \sum_{S\subseteq [N] }\BScheme{S}=1, ~~\forall S\subseteq[N],\theta\in\Theta:\BScheme{S}\geq 0~~~~~&\textit{[feasibility]}\\ &\sum_{i\in [N]}\sum_{\theta\in\Theta }\left(\sum_{S\ni i}\mu_{\theta}\BScheme{S}\pay{i}{1}+\sum_{S\notni i}\mu_{\theta}\BScheme{S}\pay{i}{0}\right)=0,~~~~~&\textit{[budget-balance]} \end{align*} where $\pay{i}{a}$ is the payment to receiver $i$ in state $\theta$, when the receiver takes action $a$. \end{definition} \begin{proposition}[Optimal budget-balanced signaling with externalities]\label{prop:optimal bb with externalities} In multi-agent binary-action with externalities setting, there exists a persuasive signaling scheme such that: \begin{enumerate}[leftmargin=*] \item It is budget-balanced as in Definition~\ref{def:budget-balance} (but may charge negative payments), \item It maximizes the ``total virtual payoff". That is, there exists a parameter $\gamma^*\geq 0$ such that for every state of nature $\theta$ the scheme recommends action $1$ to a subset of agents $S^*_\theta$ that maximizes $\Ffun{S}+\gamma^*\left(\sum_{i\in S}\Gfun{i}{S}-\sum_{i\notin S}\Gfun{i}{S\cup \{i\}}\right)$, where $\Gfun{i}{S}=\util{i}{S}-\util{i}{S\setminus \{i\}}$, \item The expected total payoff of the sender is no smaller than the expected total payoff of the sender under any budget-balance persuasive scheme (with or without payments). \end{enumerate} \label{thm:budget-balance} \end{proposition} One can show a similar characterization for the optimal signaling scheme with arbitrary payments. In fact, because the payments are now unrestricted, the corresponding dual constraints are going to be equalities. This fact results in the following generalization of Proposition~\ref{prop:general arbitrary binary actions} for the special case of $N=1$. \begin{proposition}[Optimal signaling with externalities and arbitrary payments]\label{prop:general-binary-external-arbitrary} In the multi-agent binary-action with externalities setting, the optimal signaling scheme with arbitrary payments maximizes the total payoff, i.e. for every state $\theta$ the scheme recommends action $1$ to a subset of agents $S^*_\theta$ that maximizes $\Ffun{S}+\left(\sum_{i\in S}\Gfun{i}{S}-\sum_{i\notin S}\Gfun{i}{S\cup \{i\}}\right)$, where $\Gfun{i}{S}=\util{i}{S}-\util{i}{S\setminus \{i\}}$. \end{proposition} \section{ Computing optimal signaling with positive externalities}\label{sec: computation plus externalities} As the LP for binary signaling has exponentially many variables, one might wonder how hard it is to compute the optimal signaling scheme. In this section, we show a formal reduction from computing the optimal signaling scheme with positive externalities (and without payments\footnote{For the remaining of the section, we set the payments to be zero.}) to the optimization of a special class of set functions. Our reduction extends one direction of the reduction in~\cite{DH-17}, and uses techniques similar in spirit to~\cite{CDW-12,CDW-13,DW-15}. The positive externality simply means that an agent switching from action $0$ to $1$ cannot harm any other agent. More formally, we have the following property. \begin{definition} \label{def:positive} A profile of utility functions $\{\util{i}{.}\}$ has \emph{positive externalities} if and only if for every state of the nature $\theta\in\Theta$, and for every $S\subseteq[N]$, $i\in S$, and $j\neq i, j\in S$ we have: \begin{align*} \Gfun{i}{S}\geq \Gfun{i}{S\setminus \{j\}} \end{align*} where again, $\Gfun{i}{S}=\util{i}{S}-\util{i}{S\setminus \{i\} }$. \end{definition} We quickly observe that under this property, it is in fact without loss to drop the constraints \ref{eq:cons-2} from the linear program \ref{eq:LP-binary-nopayments} in Section~\ref{sec:binary-lp}. \begin{lemma} \label{lem:drop-cons} Suppose $\mathcal{P}=\vec{0}$. Under positive externalities, there exists an optimal solution for the linear program~\ref{eq:LP-binary-nopayments} that also solves the same LP without constraints \ref{eq:cons-2}. \end{lemma} \begin{proof} Consider any optimal solution to the LP without \ref{eq:cons-2} when $\mathcal{P}=\vec{0}$. If all constraints in \ref{eq:cons-2} happen to be satisfied anyway, then we're done. If not, we claim that we can satisfy \ref{eq:cons-2} without harming the quality of the solution or persuasiveness. Observe that if \ref{eq:cons-2} is not satisfied by some optimal solution $\{\BScheme{S}\}$, then there exists $i,\theta,$ and $T$ such that $i\in T$, $\Gfun{i}{T}>0$ and $\BScheme{T\setminus\{i\}}>0$. Consider modifying $\{\BScheme{S}\}$ by moving all mass from $\BScheme{T\setminus\{i\}}$ to $\BScheme{T}$ instead. Observe that: \begin{itemize} \item This only makes the sender weakly happier, as the sender's payoff function is monotone. \item This only makes receiver $i$ strictly happier, as we had $\Gfun{i}{T} > 0$. \item If $j\neq i, j\in T$ was recommended action $1$, then this recommendation still remains persuasive, due to the marginal cross-monotonicity property. \item if $j\neq i, j\in T$ was recommended action $0$ and this action is not persuasive anymore, modify $\{\BScheme{S}\}$ by recommending action $1$ to her instead. \end{itemize} Now, repeat the above process until there is no constraint in \ref{eq:cons-2} violated. This process terminates in finite time, because once a person is recommended action $1$ this recommendation remains persuasive until the end, and at each iteration we either terminate or make progress by recommending action $1$ to least one more person. Furthermore, this process only makes the sender's expected payoff higher, completing the proof. \end{proof} Applying Lemma~\ref{lem:drop-cons}, the final primal-dual LP (without payments) can be simplified as: \begin{align*} \max &\sum_{\theta\in\Theta}\sum_{S\subseteq [N]}\mu_{\theta}\BScheme{S}\Ffun{S} &\min &\sum_{\theta\in\Theta}y_\theta \\ &\sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\ni i}\BScheme{S}\Gfun{i}{S}\geq 0,~~~\forall i\in[N] &~~&y_\theta-\sum_{i\in S}\alpha_i\Gfun{i}{S}\mu_{\theta}\geq \Ffun{S}\mu_{\theta},&\forall S\subseteq [N], \theta\in\Theta \\ &\sum_{S\subseteq[N]}\BScheme{S}=1, ~~~~~~~~~~~~~~~~~~~~~\forall \theta\in\Theta &~~&\alpha_i\geq 0,&\forall i\in[N] \\ &\BScheme{S}\geq 0, ~~~~~~~~~~~~~~~~~\forall S\subseteq [N], \theta\in\Theta &~~&& \end{align*} We also need to define \emph{convex cones} over the space of set functions before describing our result. \begin{definition} Any subset $\mathcal{C}$ of $\mathbb{R}^\Omega$, where $\Omega\triangleq 2^{[N]}$, is a \emph{cone} if and only if for each set function $h\in\mathcal{C}$ and scalar $\alpha\in\mathbb{R}_{+}$, $\alpha\cdot h\in\mathcal{C}$. Moreover, given set functions $f_1(.),\ldots,f_m(.)$, the \emph{conic hull} of these functions is defined as $\textsc{cone}(f_1,\ldots,f_m)\triangleq \{f:2^{[N]}\rightarrow \mathbb{R}: f=\sum_{i=1}^{m}w_i\cdot f_i, w_i\geq 0\}$, which indeed is a cone in $\mathbb{R}^\Omega$. \end{definition} Given these definitions, we formally prove the following proposition. \begin{proposition} [BP with externalities~$\Rightarrow$~Set optimization ] \label{thm:opt-to-sig} Let $\mathcal{C}\subseteq {\mathbb{R}^\Omega}$ be a cone of set functions, and suppose there is polynomial time algorithm that returns $\argmax_{S\subseteq [N]}h(S)$ for every set function $h\in \mathcal{C}$. Then, there exists a polynomial time algorithm that computes the optimal signaling scheme for every instance of Bayesian persuasion with externalities satisfying the following: \begin{enumerate} \item For every state of the nature $\theta\in \Theta$, $f^{\theta}\in\mathcal{C},~g_i^{\theta}\in\mathcal{C}$ for all $i\in[N]$, and \item For every state of the nature $\theta\in \Theta$, $f^\theta$ is monotone non-decreasing and agents have positive externalities as in Definition~\ref{def:positive}. \end{enumerate} \end{proposition} \begin{proof} Consider the primal linear program of optimal signaling. By using linear programming duality, solving the primal LP is reduced to solving its dual. Moreover, because of the equivalence between optimization and separation, solving the dual program is reduced to finding a separation oracle for the following set of dual constraints: $$ y_\theta-\sum_{i\in S}\alpha_i\Gfun{i}{S}\mu_{\theta}\geq \Ffun{S}\mu_{\theta},~~~\forall S\subseteq [N], \theta\in\Theta $$ Clearly $\Gfun{i}{S}=\util{i}{S}-\util{i}{S\setminus\{i\}}=0$ for $i\notin S$, and hence $\sum_{i\in S}\alpha_i\Gfun{i}{S}=\sum_{i\in [N]}\alpha_i\Gfun{i}{S}$. By dividing both sides of the constraint by $\mu_{\theta}$, the separation problem for every $\theta\in\Theta$ is equivalent to finding $S^*=\argmax_{S\subseteq[N]} \sum_{i\in [N]}\alpha_i\Gfun{i}{S}+ \Ffun{S}$ for given $\alpha_i$'s. Also, $\alpha_i\geq 0$, and hence $\sum_{i\in [N]}\alpha_i\Gfun{i}{S}+ \Ffun{S}\in \textsc{cone}({f^\theta,g_1^{\theta},\ldots,g_{N}^\theta}) \subseteq \mathcal{C}$. So, given access to the algorithm that solves the set function optimization over $\mathcal{C}$ in polynomial time, we can find $S^*$ in polynomial time. Given this separation oracle, we can now solve the persuasion problem in polynomial time. \end{proof} \section{Optimal Multi-agent Signaling with Externalities and Payments} \label{sec:binary} In this section, we study Bayesian persuasion for multiple receivers with binary actions and general externalities through the lens of duality. Our model is a natural extension of the model recently introduced in~\cite{AB-16}, and further developed in~\cite{DH-17}. We refer the reader to Section~\ref{sec:prelim} for notation and definitions. Missing proofs can be found in Appendix~\ref{sec:missing-proofs}. In Appendix~\ref{sec: computation plus externalities} we study optimal signaling with positive externalities: when no payments are allowed, and sender and receiver utility functions lie in some cone of set functions $\mathcal C$, we use duality to exhibit a polynomial time reduction from optimal signaling to the optimization problem for set functions in $\mathcal C$. \subsection{Linear programming formulation} \label{sec:binary-lp} Similar to all other Bayesian persuasion problems, one can formulate finding the optimal signaling scheme with payments as a linear program, but this time with exponentially many variables (again, $\mathcal{P}$ is the set of feasible payments): \begin{talign*} \max~~~ &\sum_{\theta\in\Theta}\sum_{S\subseteq [N]}\mu_{\theta}\BScheme{S}\left(\Ffun{S}+\sum_{i\in S}\pay{i}{1}+\sum_{i\notin S}\pay{i}{0}\right)&\customlabel{eq:LP-binary-nopayments}{\textit{(LP-Binary)}}\\ &\sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\ni i}\BScheme{S}\left(\util{i}{S}+\pay{i}{1}\right)\geq \sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\ni i}\BScheme{S}\util{i}{S\setminus \{i\}}, & \forall i\in[N], \\ &\sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\notni i}\BScheme{S}\left(\util{i}{S}+\pay{i}{0}\right)\geq \sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\notni i}\BScheme{S}\util{i}{S\cup\{i\}}, & \forall i\in[N] \\ &\sum_{S\subseteq[N]}\BScheme{S}=1, ~~\forall \theta\in\Theta~~~~~~~~~\BScheme{S}\geq 0, \forall S\subseteq [N], \theta\in\Theta \\ &\{\pay{i}{a}\}_{i\in[N], a\in\{0,1\}}\in\mathcal{P} \end{talign*} The first two sets of constraints in this LP are essentially persuasion constraints, i.e. if a receiver is in the recommended set $S$ she is better off picking action $1$ and if a receiver is not in the recommended set $S$ she is better off picking action $0$. For notation brevity, we rewrite the persuasiveness constraints as: \begin{align*} \customlabel{eq:cons-1}{(*)}&~~~~~~~~~~\sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\ni i}\BScheme{S}\left(\Gfun{i}{S}+\pay{i}{1}\right)\geq 0,&\forall i\in[N] \\ \customlabel{eq:cons-2}{(**)}&~~~~~~~~~~\sum_{\theta\in\Theta}\mu_{\theta}\sum_{S\notni i}\BScheme{S}\left(\Gfun{i}{S\cup\{i\}}-\pay{i}{0}\right)\leq 0,&\forall i\in[N] \end{align*} where $\Gfun{i}{S}\triangleq \util{i}{S}-\util{i}{S\setminus\{i\}}$. Note that $\Gfun{i}{S}=0$ for $i\notin S$. \input{binary-payments} \section{Conclusion} We augment Bayesian persuasion by introducing payments, in single and multi-receiver settings. We obtain a number of results, all enabled via Lagrangian duality. For symmetric, single-receiver persuasion with no payments we show that a detail-free, ex-post Pareto optimal scheme is optimal. In the same setting, if arbitrary payments are allowed, the optimal scheme does not even depend on the prior: it always recommends the action that maximizes the sender utility plus $\frac{n}{n-1}$ times the receiver utility, where $n$ is the number of actions. When payments are restricted to be non-negative we prove a dichotomy: the optimal scheme is either the arbitrary-payment signaling scheme or the optimal no-payment scheme. When there are multiple receivers with binary actions and externalities, we prove that a simple scheme is optimal under a budget balanced constraint on the payments. Finally, in the same setting, when no payments are allowed, when the sender and receiver utility functions lie in some cone of set functions $\mathcal C$, we use duality to give a polynomial time reduction from optimal signaling to the optimization problem for set functions in $\mathcal C$. Our work focuses on characterizing optimal schemes in the simplest cases beyond the tools of prior work. Notably, our tools gain the most traction where there is a ``canonical'' optimal dual (i.e. when the optimal Lagrangian multipliers are independent of the underlying distribution). Compare this to single-dimensional settings in auction design where the payment identity/monotonicity implies a canonical optimal dual as well~\cite{Myerson81}. The clear direction for future work is to consider more general settings, possibly through the lens of ``simple versus optimal'' persuasion schemes (aligned with similar work in mechanism design). That is, rather than targeting optimal dual solutions (which are likely unwieldy too far beyond the canonical settings studied her), perhaps approximately optimal dual solutions will yield tractable insight for proving approximation results. Results of this form are limited without making use of duality, but do exist. For example,~\citet{DX-16} provides an \emph{even} simpler signaling scheme for a single receiver with a symmetric prior that guarantees a $(1-1/e)$-approximation. Another general direction for future work is to further explore the interplay between payments and persuasion. \subsection{Symmetric actions} Here, we draw conclusions for the symmetric setting with payments. Again getting initial traction from a canonical form for the optimal dual. Recall by Corollary~\ref{cor:symmetryLagrange}, the Lagrangian in this setting is given by: \[ \textstyle \mathcal{L}_{\lambda}(\phi,P) = \sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i} \left( \spay{i} + n \lambda \rpay{i} \right) + \sum_{i\in[n]} P(i) \left( (n-1) \lambda - 1 \right) - \lambda C. \] \subsection*{Arbitrary payments} When arbitrary payments are allowed, i.e. $\mathcal{P} = \mathbb{R}$, then the multiplier $(n-1)\lambda - 1$ of the payment variable $P(i)$ must be equal to zero for all $i$. Otherwise the Lagrangian would be unbounded. This immediately implies that for the optimal dual, we have $\lambda = \frac{1}{n-1}$, and the Lagrangian becomes \[ \textstyle \mathcal{L}_{\lambda}(\phi,P) = \sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i} \left( \spay{i} + \frac{n}{n-1} \rpay{i} \right) - \frac{1}{n-1} C. \] The proof of the following proposition then immediately follows. \begin{proposition} In the single sender, single receiver setting with symmetric actions and arbitrary payments, the optimal scheme recommends, on every state of nature $\theta$, the action $i$ that maximizes $\spay{i} + \frac{n}{n-1} \rpay{i}$ (and pays the optimal payments). \end{proposition} \subsection*{Non-negative payments: a dichotomy} When payments are restricted to be non-negative, it is no longer the case that $\lambda$ is pinned down completely (in particular, $\lambda$ must certainly be $\leq \frac{1}{n-1}$, or else setting $P(i) = +\infty$ would result in an unbounded Lagrangian, but it is indeed possible to have $\lambda < \frac{1}{n-1}$). Our next result shows that the optimal scheme in this scenario is essentially either the optimal scheme without any payments, or the optimal scheme for arbitrary payments (because the payments are already non-negative) \begin{proposition} In the single sender, single receiver setting with independent and identically distributed actions and non-negative payments, the optimal scheme is either (1) the optimal no-payment scheme, or (2) recommends the action $i$ that maximizes $\spay{i} + \frac{n}{n-1} \rpay{i}$ (and pays the optimal non-negative payments). \end{proposition} \begin{proof} Let $\lambda^* \in [0, \frac{1}{n-1}]$ be the $\lambda$ guaranteed by Corollary~\ref{cor:symmetryLagrange}. Then there is an optimal scheme $(\phi^*, P^*)$ that maximizes $\mathcal{L}_{\lambda^*}(\phi, P)$ over all feasible $(\phi, P)$. If $\lambda^* < \frac{1}{n-1}$, then $(n-1)\lambda^* - 1$ is strictly negative, and hence the multiplier of each payment variable $P(i)$ is strictly negative. Therefore, every scheme that maximizes $\mathcal{L}_{\lambda^*}(\phi, P)$ must have $P(i) = 0$ for all actions $i$. Hence, the scheme $\phi$ is in fact feasible and persuasive for the no-payments case, and must be the optimal scheme without payments (as every scheme without payments is also feasible for non-negative payments, and $\phi$ is optimal among all schemes with non-negative payments). If $\lambda^* = \frac{1}{n-1}$, then we immediately observe that this is exactly the same Lagrangian as for arbitrary payments, and therefore the second part of the proposition follows. \end{proof} \section{Illustrative Examples}\label{sec:examples} Here, we work through two illustrative examples to highlight the role of different payment models in Bayesian persuasion. Our examples shed some insights on the payment choices. We formalize these insights in the later sections. \subsection{A tempting but false argument}\label{sec:tempting} Initially, it may seem that the optimal scheme with arbitrary payments must recommend an action in $\argmax_i\{\spay{i} + \rpay{i}\}$ for all $\theta \in \Theta$ (and pay the optimal payments). In fact, the following argument seems to confirm this intuition. Consider an optimal persuasive signaling scheme $\phi$ and assume (towards a contradiction) that there is some state of nature $\theta$ where $\phi$ does \emph{not} recommend an element of $\arg \max_i\{\spay{i} + \rpay{i}\}$. Let $j$ denote the action recommended, and $i$ denote an element in the argmax. Modify $\phi$ by moving all the probability mass from $\phi_{\theta}(j)$ to $\phi_{\theta}(i)$, i.e. recommend action $i$ in state $\theta$, and increase $P(i)$ by $\mu_\nstate \cdot \phi_{\theta}(j) \cdot (\rpay{j}-\rpay{i})$. Let $\phi'$ be the new signaling scheme. The following two observations are immediate. First, the sender's payoff under $\phi'$ is strictly larger than the sender's payoff under $\phi$. This is because the sender pays an additional $\mu_\nstate \phi_{\theta}(j) (\rpay{j} - \rpay{i})$, and gets additional payoff $\mu_\nstate \phi_{\theta}(j) (\spay{i}-\spay{j})$; the total change in sender payoff is $\mu_\nstate \phi_{\theta}(j) \left(\spay{i} + \rpay{i} - \spay{j} - \rpay{j}\right) > 0$, by the hypothesis about action $i$. Second, the receiver's payoff under $\phi'$ is equal to the receiver's payoff under $\phi$. The receiver gets an additional $\mu_\nstate \phi_{\theta}(j) (\rpay{j}-\rpay{i})$ in payment, and gets additional payoff $\mu_\nstate \phi_{\theta}(j)(\rpay{i} - \rpay{j})$. Note that one of these terms might be negative. Therefore, the sender's payoff in $\phi'$ is strictly improved, while the receiver is just as happy, i.e., it seems like we have reached a contradiction to the optimality of $\phi$. The catch is that $\phi'$ \emph{is not necessarily persuasive!} Since payments in Bayesian persuasion are quite different than payments in (say) auctions, we find it educational to present here a concrete example that confirms that the scheme described is suboptimal.\footnote{The proofs of our theorems of course provide confirmation themselves, but since the intuition is especially jarring for those unfamiliar with Bayesian persuasion, the example should be instructive.} Consider the following. There are two actions, $A$ and $B$. Each action gives the receiver payoff $0$ or $1$, uniform and iid. Identically for the sender payoff. In other words, there are four possible action types $(0,0), (0,1), (1,0)$ and $(1,1)$, encoding the receiver and sender payoffs respectively. We will compare the following two schemes: (1) Recommend a uniformly random action in $\arg \max_i \{ \spay{i} + \rpay{i} \}$, and pay the optimal payments (the scheme suggested above), (2) Recommend a uniformly random action that maximizes $\spay{i} + 2\rpay{i}$, and pay the optimal payments (the optimal scheme, as suggested by Proposition~\ref{prop:general arbitrary binary actions}). Towards analyzing the first scheme, observe that conditioned on action $A$ having type $(1,1)$, it is recommended with probability $7/8$: it is always recommended unless $B$ has type $(1,1)$, in which case it is recommended with probability $1/2$. Conditioned on action $A$ having type $(0,1)$ or $(1,0)$, it is recommended with probability $1/2$, and conditioned on having type $(0,0)$ it is recommended with probability $1/8$. The expected receiver payoff for taking the recommendation, conditioned on action $A$ being recommended, is $(7/8+1/2+0+0)/2 = 11/16$. The expected receiver payoff for taking action $B$ when $A$ was recommended is $5/16$. Therefore, the optimal payments are $-6/16$ for each action. The sender's expected payoff when the recommendation is followed is also $11/16$, so the total sender utility (accounting for payments) is $17/16$. Let's analyze the second scheme. The difference between the two schemes is that the second one tie-breaks in favor of $(0,1)$ over $(1,0)$. So, conditioned on action $A$ having type $(1,1)$, it's still recommended with probability $7/8$. Conditioned on having type $(0,1)$, it's recommended with probability $5/8$, type $(1,0)$ is recommended with probability $3/8$, and type $(0,0)$ is recommended with probability $1/8$. The expected receiver payoff, conditioned on action $A$ being recommended, is now $(7/8 + 5/8+0+0)/2 = 3/4$. The expected payoff for taking action $B$ when $A$ was recommended is then $1/4$. This means that the optimal payments are $-1/2$ for each action. The sender's expected payoff when the recommendation is followed is $(7/8+0 + 3/8+0)/2 = 5/8$. The sender's total utility is $9/8$, indeed better than $17/16$. \subsection{Contrasting payment schemes} \label{sec:examples-contrast} The following example demonstrates how negative payments can be quite counterintuitive in Bayesian persuasion, and how various constraints on payments differ. Consider an instance with one sender and one receiver that has two possible actions 0 and 1. Suppose that $\Theta=\{0,1\}$, that the two states are equiprobable, and that the payoff functions of the sender and the receiver satisfy: $s_\theta(0)=-r_\theta(0)={1-\theta}$ and $s_\theta(1)=-r_\theta(1)={1+\theta}$. The payoffs of the sender and the receiver always sum up to zero, so this is a zero-sum persuasion game. The optimal signaling without payments is to not reveal any information to the receiver. To see this, observe that the receiver must get payoff at least $-1/2$, as they can guarantee this by ignoring the sender's signal and taking action $0$. Thus, the sender cannot get utility strictly bigger than $1/2$, which they can guarantee by recommending action $0$. This scheme is in fact optimal even when the sender is allowed to use non-negative payments. To see this, observe that the receiver's utility is again at least $-1/2$: they can always take action $0$ regardless of the recommendation, and be paid a non-negative amount. Again, the sender cannot get utility strictly bigger than $1/2$. Next, consider the following scheme with negative payments, as suggested by Proposition~\ref{prop:general arbitrary binary actions}: always recommend action $0$ and charge $1$. This scheme is persuasive, because the receiver's expected payoff for taking action $1$ is $-3/2$. This gives the sender expected utility equal to $3/2$. Finally, consider the following budget balanced scheme, recommended by Proposition~\ref{thm:budget-balance}. When $\theta = 1$, recommend action $1$ with probability $q$. When $\theta = 0$, recommend action $0$ deterministically. The receiver payoff for taking action $1$, conditioned on it being recommended, is $-2$. The receiver payoff for taking action $0$, conditioned on $1$ being recommended, is $0$. Therefore, the sender must pay $2$ to make this persuasive, for an expected total payment of $2 \cdot q \cdot 1/2 = q$. Conditioned on action $0$ being recommended, the receiver payoff for taking action $0$ is $(-0.5)/(1-q/2)$, while her payoff for taking action $1$ is $(-0.5 -(1-q))/(1-q/2)$. The sender can charge $(1-q)/(1-q/2)$ and remain persuasive, for a total expected charge of $1-q$. The total sender payoff (not counting payments) is then $2 \cdot q \cdot 1/2 + 0 \cdot (1-q) \cdot 1/2 + 1 \cdot 1/2 = q+1/2$. Accounting for payments, the sender pays $q$, and charges $(1-q)$, for an additional payoff of $1-2q$. The sender's total utility is $3/2 - q$. If $q = 0$, we recover the optimal scheme with possibly negative payments. If $q = 1/2$, then the total expected payment is $0$, and the scheme is budget balanced. In this case, the expected sender utility is $1$, strictly bigger than the optimal expected utility with non-negative payments. The above example highlights the following concepts. First, the purpose of negative payments is to get extra payoff out of ``strictly persuasive'' schemes. Second, depending on the context, negative payments might not always be well motivated. For example, if the setup is such that a sender is making a non-binding recommendation to a receiver, then in the above examples the receiver would simply choose not to engage in the recommendation and always take action $0$. On the other hand, if the sender acts as a ``gatekeeper'' to the actions, e.g. because the actions are which event to attend that the sender is hosting or which fund to invest in that the sender manages, then negative payments are well motivated. Third, all three payment methods considered in this paper are distinct. \subsection{The general setting with payments} \label{sec:payment-general} Recall Equation~\ref{eq:Lagrange equation:main}, where we had the Langrangian function for an arbitrary polytope $\mathcal{P}$: \begin{equation*} \textstyle \mathcal{L}_{\lambda} (\phi,P) = \sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i} \left( \spay{i} + \rpay{i} \sum_{j \neq i} \dual{i}{j} - \sum_{j \neq i} \dual{i}{j} \rpay{j} \right) + \sum_{i\in[n]} P(i) \left( \sum_{j \neq i} \dual{i}{j} - 1 \right). \end{equation*} Also recall that for every choice $\lambda$ of the Lagrange multipliers, $\max_{\phi,P}\mathcal{L}_{\lambda}(\phi,P)$ is an upper bound to the performance of the optimal persuasive scheme. Strong duality further implies that this bound is tight for some choice of the Lagrange multipliers. Observe that if payments are allowed to be arbitrary, then $ \max_{\phi,P} \mathcal{L}_{\lambda}(\phi,P)$ is unbounded whenever the coefficient for $P(i)$ is non-zero for any $i$ (as we can simply set $P(i)$ to be $+\infty$ or $-\infty$. Therefore, we certainly have $\sum_{j \neq i} \lambda(i,j) = 1$ in the optimal dual, for all actions $i$. This means that for each action $i$, the dual variables $\lambda(i,.)$ form a distribution over actions other than $i$. The simplified Lagrangian becomes \[ \mathcal{L}_{\lambda}(\phi,P) = \sum_{\theta \in \Theta} \sum_{i \in [n]} \mu_\nstate \scheme{i} \left( \spay{i} + \rpay{i} - \mathbb{E}_{j\sim\lambda(i,.)} [ \rpay{j} ] \right). \] For every choice of Lagrange multipliers $\lambda(i,j)$, the scheme $\phi$ that maximizes $\mathcal{L}_{\lambda}(\phi,P)$ recommends, for every state of nature $\theta$, the action that maximizes $\spay{i} + \rpay{i} - \mathbb{E}_{j\sim\lambda(i,.)} [ \rpay{j} ]$. \begin{observation}\label{obs:duality} The optimal persuasive scheme $\phi$ recommends, at each state of nature $\theta$, the action that maximizes $s_\theta(i) + \rpay{i} - \mathbb{E}_{j\sim\lambda^*(i,.)} [ \rpay{j} ]$, where $\lambda^*$ is the optimal Lagrange multiplier. \end{observation} Observation~\ref{obs:duality} provides a general framework to reason about optimal signaling schemes with arbitrary payments. We repeat now a connection to optimal auction design: In optimal auction design, there are some cases where the optimal dual is ``canonical,'' and doesn't depend on the input distribution (e.g. single-dimensional)~\citep{Myerson81}. In such settings, one can identify simple structure of the optimal mechanism. The case is similar in signaling: some cases admit a canonical optimal dual that doesn't depend on the input distribution. In these cases, we obtain simple characterizations of the optimal scheme. \subsection{Two actions, arbitrary payments} \label{sec:binary general payments} In the $n=2$ case of only two actions, Observation~\ref{obs:duality} immediately allows us to derive the simple structure of the optimal signaling scheme. \begin{proposition}\label{prop:general arbitrary binary actions} When $n=2$, for every distribution $\mu_\nstate$, the optimal persuasive scheme with possibly negative payments always recommends the action $i$ that maximizes $\spay{i} + 2\rpay{i}$ (and pays the optimal payments). \end{proposition} \begin{proof} Observe that there are only two Lagrange multipliers, $\lambda(0,1)$ and $\lambda(1,0)$, and are both equal to $1$ in the optimal dual (by Observation~\ref{obs:duality}). Therefore, the Lagrangian can be further simplified: \begin{talign*} \mathcal{L}_{\lambda}(\phi,P) &= \sum_{\theta \in \Theta} \sum_{i \in [2]} \mu_\nstate \scheme{i} \left( \spay{i} + \rpay{i} - \sum_{j \neq i} \rpay{j} \right) \\ &= \sum_{\theta \in \Theta} \sum_{i \in [2]} \mu_\nstate \scheme{i} \left( \spay{i} + 2\rpay{i} - \sum_{j \in [2]} \rpay{j} \right). \end{talign*} Observe that the term $\sum_{j \in [2]} \rpay{j}$ does not depend on the action selected at all. So in order to maximize $\mathcal{L}_{\lambda}(\phi,P)$, the scheme must recommend the action maximizing $\spay{i} + 2\rpay{i}$ for every state of nature $\theta$. \end{proof} \section{Introduction} \label{sec:intro} There are two primary ways of influencing the actions of strategic agents: through providing incentives and through influencing beliefs. The former is the domain of traditional \emph{mechanism design}, and involves the promise of payments or goods contingent on behavior. The latter is the domain of \emph{information design}, or \emph{persuasion}, and involves the selective provision of information pertaining to the payoffs and costs of various actions. There are striking similarities and parallels between the two worlds, both in terms of the domains in which they are studied --- for example in auctions~\citep{emeksignaling,DIR14,daskalakis_information} and routing \citep{bhaskar_signaling} --- as well in the mathematical models and techniques used to characterize and compute optimal policies (e.g. \citep{DX-16,DH-17,kolotilin_privateinfo}). Combining the approaches and techniques of mechanism design and persuasion leads to a more powerful toolkit for the design of economic systems, and this paper takes a step in that direction. We work with two models of persuasion: the Bayesian Persuasion model of \citet{KG-11}, and the multi-receiver private Bayesian persuasion model of \citet{AB-16} (further developed in \cite{babichenko_barman} and \citet{DH-17}) which we generalize to allow externalities. In the spirit of mechanism design and principal-agent problems, we generalize both models by permitting payments, which serve as additional incentive for the receiver(s) of information to behave in accordance with the wishes of the sender (principal). We then explore these models through the lens of \emph{Lagrangian duality}, much in the spirit of the literature applying duality to auction theory and Bayesian mechanism design. In particular, we vary constraints on the payments (arbitrary, nonnegative, budget balanced) and the information/reward structure (symmetric vs asymmetric actions), and derive canonical and/or tractable optimal policies through duality. \paragraph{The Persuasion Models.} In the Bayesian persuasion model, there is a \emph{receiver} who must select one of a number of actions, and a \emph{sender} looking to influence the receiver's choice in order to maximize her own expected payoff. We adopt the perspective of the sender. A \emph{state of nature}, drawn from a common knowledge prior distribution, determines the payoff of each action to each of the sender and the receiver. The sender has an informational advantage over the receiver: access to the realization of the state of nature. The problem facing the sender is that of computing and committing to the optimal \emph{signaling scheme}: a randomized map from states of nature to signals. Once the state is drawn by nature, the signaling scheme is invoked and the corresponding signal is sent to the receiver; she then updates her prior belief and chooses the action maximizing her expected payoff. The multi-receiver private Bayesian persuasion model generalizes the previous model to multiple receivers. There is still a common knowledge prior distribution over states of nature, and a single sender with an informational advantage. We restrict attention to the special case of two actions $\{0,1\}$ for each receiver. The state of nature now determines a set function for the sender and a set function for each of the receivers: each set function maps the set of receivers taking action $1$ to a payoff. A signaling scheme now is a randomized map from states of nature to a signal for each receiver. In both models, a simple revelation principle style argument shows that it suffices to restrict attention to schemes which are \emph{direct} and \emph{persuasive} (see e.g. \cite{KG-11,AB-16}). A direct scheme is one in which signals correspond to action recommendations. Such a scheme is persuasive if it is a Bayes-Nash equilibrium for each receiver to follow the recommendation. \vspace{-3mm} \paragraph{Adding Payments.} We augment each model by allowing a special form of payment contract. In addition to committing to a direct signaling scheme, the sender also commits to a payment $p(i)$ for each action $i$. If the signaling scheme recommends action $i$, and the receiver follows the recommendation, she is then paid $p(i)$ by the sender (or pays the sender $-p(i)$ if $p(i) < 0$). If the receiver deviates from the scheme's recommendation, no payment is exchanged. Since payments are exchanged only when the receiver follows the recommendation, nonnegative payments can be viewed as augmenting the ``persuasiveness'' of the signaling scheme. Negative payments are less natural, although their consideration will be technically instructive. We distinguish three classes of payment contracts: unrestricted (allowing arbitrary positive and negative payments), nonnegative, and budget balanced. For the latter, the sender's expected payment should be zero over states of nature and randomness in the signaling scheme, assuming the receiver(s) follow the recommendations of the scheme. Independent to our work, \citet{cheng_li} also considers adding payments to Bayesian persuasion. They analyze a special case of Bayesian persuasion with two states of nature, and examine how adding a payment contract influences the optimal policy in that scenario. Our approach diverges from this work by considering more general settings of Bayesian persuasion and various classes of payment contracts. \vspace{-3mm} \paragraph{Duality as a Unifying Lens.} Persuasion and auction design share striking parallels. Indeed, both are economic design problems in which the outputs --- recommendation(s) in the case of persuasion and allocations of goods in the case of an auction --- are subjected to incentive constraints which at the surface appear quite similar in the two settings. This is made explicit by \citet{DX-16}, who draw an analogy between persuasion and single-item auctions: actions are analogous to bidders, and recommending an action is analogous to allocating the item. Through this analogy, they were able to leverage techniques from auction theory --- in particular Border's theorem~\citep{B-91} --- to characterize and compute optimal signaling schemes for Bayesian persuasion when action payoffs are i.i.d. This analogy is imperfect, however, as illustrated by the impossibility result of \citet{DX-16} for independent non-identical action payoffs, contrasting the tractability of single-item auctions with independent bidders. Despite being imperfect, however, this similarity is suggestive: if a Border's theorem based approach of optimization of interim rules can be applied to persuasion, why not the ``virtual value'' approach of \citet{Myerson81} as well? Myerson's approach can be viewed through the more general lens of Lagrangian duality, in particular as a consequence of Lagrangifying the incentive constraints. The duality-based approach has been applied to much more general mechanism design settings, producing (often approximate) generalizations of Myerson's virtual-value characterization which have led to simple and approximately optimal mechanisms in a number of multi-parameter settings (e.g. \cite{CDW-16, EdenFFTW17a, EdenFFTW17b, BrustleCWZ17, FULLT18, LiuP18, CaiZ17,haghpanah2015reverse}, and classic results such as \cite{rochet1998ironing}). It is therefore natural that we embark on the same exploration for persuasion, as well as for models (such as ours) which combine the approaches of persuasion and mechanism design. As a best case scenario, we can hope for ``simple'' characterizations of optimal or near-optimal schemes, akin to those derived from duality in mechanism design. Particularly attractive are ``canonical'' characterizations which depend minimally on the details of the instance at hand. \vspace{-3mm} \paragraph{Our Results.} In Section~\ref{sec:lagrange}, we apply Lagrangian duality to Bayesian persuasion, and derive some elementary properties of the primal/dual pair which enable our results to follow. Our first main result is in Section~\ref{sec:nopayment}, and concerns (single-receiver) Bayesian persuasion with a prior distribution which is symmetric across $n$ actions\footnote{We refer the reader to~\cite{dughmi2017algorithmic,DX-16} for some natural examples of persuasion with symmetric actions.}, and no payments are allowed. We show that a single dual variable naturally interpolates between two extreme schemes: at one extreme ($\lambda$ equals zero) we get the (non-persuasive) scheme which always recommends the sender's ex-post preferred action, at the other extreme ($\lambda$ very large) we get the (persuasive) scheme which recommends the receiver's ex-post preferred action. Intermediate values of $\lambda$ yield schemes which point-wise optimize the sender payoff plus $n\lambda$ times the receiver's payoff. Moreover, there is a threshold $\lambda^*$ below which the induced scheme is non-persuasive, and above which the scheme is persuasive. This $\lambda^*$ induces the sender-optimal persuasive signaling scheme. This characterization is detail-free, in the sense that it reduces the prior distribution to a relative weighting of receiver to sender payoff, in particular the minimum necessary for persuasiveness. Furthermore, this optimal scheme is \emph{Pareto efficient} in a strong (ex-post) sense: for every state $\theta$, no outcome Pareto dominates the one picked by the scheme. In Section~\ref{sec:payment}, we use duality to characterize Bayesian persuasion schemes with payments. When arbitrary payments are allowed and the prior is symmetric, the optimal signaling scheme is canonical and does not depend on the prior: it always (i.e. in every state of nature) recommends the action that maximizes the sender utility plus $\frac{n}{n-1}$ times the receiver's utility. Payments accompanying this scheme are computed easily via a simple payment identity. Our main result in this section is a \emph{dichotomy} for Bayesian persuasion with a symmetric prior, \emph{but} non-negative payments: the optimal scheme is either the same as the aforementioned arbitrary-payment scheme (in the event that non-negative payments are needed), or else is the optimal no-payment signaling scheme. Finally, with only two actions and an arbitrary prior, we show that when arbitrary payments are allowed, the optimal scheme always recommends the action maximizing sender utility plus twice receiver utility. Again, all of our optimal schemes are ex-post Pareto efficient. We note that the strongest positive results of~\cite{DX-16} (exact polynomial time solvability) hold in the setting of i.i.d. actions. Our results therefore extend and simplify theirs, while lending further insight. In Section~\ref{sec:binary}, we turn our attention to a multi-receiver private persuasion model with externalities. Again, we employ duality to analyze the optimal scheme in this setting. Our first main result shows that, when we allow budget balanced payments, there exists an optimal scheme which is ``simple'' in the following sense: It always recommends an action maximizing a weighted sum of sender utility and the receivers' marginal utility from following the recommendation of the scheme. The relative weighting is determined by a single dual variable. This characterization is interesting when contrasted with the optimal no-payment scheme, which is not as simple in general, and we show is sometimes strictly outperformed (in terms of sender expected utility) by the optimal budget-balanced scheme. Our second main result is a generalization of an algorithmic result of \cite{DH-17} to multi-receiver persuasion with \emph{positive externalities}: when no payments are allowed, and sender and receiver utility functions lie in some cone of set functions $\mathcal C$, we use duality to exhibit a polynomial time reduction from optimal signaling to the optimization problem for set functions in $\mathcal C$. Due to the lack of space, details of this last result are in Appendix~\ref{sec: computation plus externalities}. \section{Lagrangian Duality and Bayesian persuasion} \label{sec:lagrange} In this section, we create a unified analysis toolbox for various Bayesian persuasion problems through the lens of LP duality. Specifically, we use Lagrangian duals to reveal the structures of the optimal signaling, \'a la successful instances of a similar technique in Bayesian mechanism design~\citep{CDW-16}. As a prerequisite, we heavily use linear programming techniques introduced in~\cite{KG-11}, and further improved in \cite{DX-16}, and build a bedrock for the analyses in future sections. \vspace{-3mm} \subsection{LP for general Bayesian persuasion with payments} Linear programming formulations of Bayesian persuasion without payments have been introduced in numerous prior works (e.g.~\cite{DX-16}). We now modify the program slightly to capture payments, by observing that whenever action $i$ is recommended the receiver gets additional payoff $\gpayment{i}$ and the sender loses a payoff $\gpayment{i}$. The following program solves the sender's optimization problem. \begin{align*} \max~~&\sum_{\theta \in \Theta} \sum_{i \in [n] } \mu_\nstate \scheme{i} \left( \spay{i}- \gpayment{i} \right) &\\ &\sum_{\theta \in \Theta} \mu_\nstate\scheme{i} \left( \rpay{i} +\gpayment{i} \right) \geq \sum_{\theta \in \Theta} \mu_\nstate \scheme{i} \rpay{j}, & \forall i,j \neq i \in [n] \\ &\phi_\nstate\in \Delta_n,~\forall \theta\in\Theta,~~~\text{and}~~~{p} \in \mathcal{P} \end{align*} The first set of constraints, also called \emph{persuasiveness constraints}, are similar to \emph{Incentive Compatibility (IC)} constraints from auction design, and ensure that the receiver is best off (in expectation) by following the recommendation and paying the payment. The rest ensure that the scheme is in fact a valid distribution over recommendations, and the payments are feasible. While not yet a linear program, the above program can be made linear by a simple change of variables to expected payments $P(i)$:\footnote{ Recall that $P(i) = \sum_{\theta \in \Theta} \mu_\nstate \phi_{\theta}(i) \gpayment{i}$.} \begin{talign*} \max~~&\sum_{\theta \in \Theta} \sum_{i \in [n] } \mu_\nstate \scheme{i}\spay{i}- \sum_{i\in[n]} P(i) &\customlabel{eq:Lp-general-payments}{\textit{(LP-General-with-Payments)}}\\ &P(i)+\sum_{\theta \in \Theta} \mu_\nstate\scheme{i} \rpay{i} \geq \sum_{\theta \in \Theta} \mu_\nstate \scheme{i} \rpay{j}, & \forall i,j \neq i \in [n] \\ &\phi_\nstate\in \Delta_n,~\forall \theta\in\Theta,~~~\text{and}~~~P \in \mathcal{P} \end{talign*} where we abuse the notation by using $\mathcal{P}$ to denote the feasible polytope of average payments $P$. \vspace{-3mm} \subsection{The partial Lagrangian dual} \label{sec:partial lagrangian} One of the main tools we use in this paper is taking the \emph{partial Lagrangians} of the linear programs of the Bayesian persuasion problem. Basically, similar to \cite{CDW-16}, we do not take a ``complete dual'' of the LP formulation, instead ``Lagrangifying'' only the persuasiveness constraints, and leave all feasibility constraints in the primal.\footnote{ There are significant conceptual differences between ``incentive constraints'' in auction design and ``persuasiveness constraints''. Some of these differences were briefly discussed in Section~\ref{sec:intro}; we will highlight them further in future technical sections.} To take the partial Lagrangians, we apply the method of Lagrangian multipliers by (\emph{a}) introducing dual variables $\dual{i}{j}$ for every pair of actions $i,j \in [n]$ with $i \neq j$, (\emph{b}) multiplying the persuasiveness constraints with duals $\dual{i}{j}$, and (\emph{c}) moving the persuasiveness constraints to the objective. By rearranging the terms we have the following observation. \vspace{-2mm} \begin{observation}\label{obs:lagrangians} Assigning dual variables $\dual{i}{j}$ to the persuasiveness constraint guaranteeing that the receiver prefers to take action $i$ over action $j$ when $i$ is recommended gives the following partial Lagrangian. \begin{align} \mathcal{L}_{\lambda} (\phi,P) = \sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i} &\left( \spay{i} + \rpay{i} \sum_{j \neq i} \dual{i}{j} - \sum_{j \neq i} \dual{i}{j} \rpay{j} \right) + \sum_{i\in[n]} P(i) \left( \sum_{j \neq i} \dual{i}{j} - 1 \right). \label{eq:Lagrange equation:main} \end{align} \end{observation} \noindent We conclude by reminding the reader that the optimal signaling schemes and payments are solutions to the following min-max programs by applying strong duality ($\mathcal{D}$ denotes the appropriate dual feasible polytope): \begin{align} \max_{\forall \theta:\phi_\nstate\in\Delta_n, P\in\mathcal{P}}\left(\min_{\lambda\in \mathcal{D}}\mathcal{L}_{\lambda} (\phi,P)\right)=\min_{\lambda\in \mathcal{D}}\left(\max_{\forall \theta:\phi_\nstate\in\Delta_n, P\in\mathcal{P}}\mathcal{L}_{\lambda} (\phi,P)\right).\label{eq:strongduality} \end{align} \begin{definition}[\emph{Dual-adjusted receiver payoff}] For any assignment of dual variables $\lambda\in\mathcal{D}$, define $\dualr{i} \triangleq \rpay{i} \sum_{j \neq i} \dual{i}{j} - \sum_{j \neq i} \dual{i}{j} \rpay{j}$. \end{definition} We conclude by Proposition~\ref{prop:duality}, which we repeatedly use in Sections~\ref{sec:nopayment},~\ref{sec:payment} and~\ref{sec:binary} to extract various properties of the corresponding optimal policy. \begin{proposition}\label{prop:duality}[\emph{Strong Duality for Bayesian Persuasion}] There exist dual variables $\lambda(.,.)$ such that the optimal signaling scheme, for every state of nature $\theta$, recommends the action maximizing the dual-adjusted receiver payoff, i.e. $\spay{i} + \dualr{i}$. Moreover, if $\dual{i}{j} > 0$, then when action $i$ is recommended, the receiver is indifferent between following the recommendation and taking action $j$ instead (Complementary Slackness).\footnote{ We will not actually make use of complementary slackness in this paper, but include it here for completeness.} \end{proposition} \begin{proof} This is is an immediate consequence of strong duality, plus some observations about the structure of the Bayesian Persuasion LP. Observe first that indeed $\mathcal{L}_{\lambda}(\phi,P) =\sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i}\cdot (\spay{i} + \dualr{i}) + \sum_{i\in[n]} P(i) ( \sum_{j \neq i} \dual{i}{j}- 1 )$. Now, consider the RHS of Equation~\ref{eq:strongduality}. For given dual variables $\lambda$, observe that the right-most term (depending on $P$) does not depend on $\phi$ at all. Observe that the remaining term ($\sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i}\cdot (\spay{i} + \dualr{i})$) is trivial to optimize over all $\phi$ such that $\phi_{\theta} \in \Delta_n$ for all $\theta \in \Theta$: simply recommend the action maximizing $\spay{i} + \dualr{i}$ for all $\theta \in \Theta$. Therefore, when $\lambda$ are the optimal dual variables, the optimal signaling scheme must recommend the action maximizing $\spay{i} + \dualr{i}$ on all states of nature. Complementary slackness follows immediately from strong duality. \end{proof} \subsection{Exploiting symmetries} When viewing actions by their types (recall this means that we view states of nature as a profile $[\theta_1,\ldots, \theta_n]$, with each $\theta_i \in [m]$), some of our results consider symmetric settings, where $\mu_{\theta_1,\ldots, \theta_n} = \mu_{\theta_{\pi(1)},\ldots,\theta_{\pi(n)}}$ for any permutation $\pi:[n]\rightarrow [n]$. It is well-known that symmetric LPs admit symmetric solutions (e.g.~\cite{HB-09}), and this fact has indeed been exploited in prior work on signaling and auctions~\citep{DX-16,CDW-12}. The proof of this is straight-forward, but we sketch it below (and provide a full proof in Appendix~\ref{sec:missing-proofs}). First, we state clearly what we mean by symmetric solutions. \begin{definition}We say that a signaling scheme $(\phi, P)$ is symmetric if $P(i) = P(j)$ for all $i,j$ and for all permutations $\pi$, we have $\phi_{[\theta_1,\ldots, \theta_n]}(i) = \phi_{{[\theta_{\pi(1)},\ldots,\theta_{\pi(n)}]}}(\pi^{-1}(i))$ for all $i, \theta$. We say that a dual solution $\lambda$ is symmetric if $\lambda(i,j) = \lambda(k,\ell)$ for all $i,j, k,\ell$. \end{definition} \begin{proposition}\label{prop:symmetry} Let $\mu_\nstate$ be a symmetric instance of Bayesian Persuasion, with any of the four referenced constraints on payments (none, non-negative, budget-balanced, or arbitrary). Then there exists an optimal symmetric primal and an optimal symmetric dual for $\mu_\nstate$. \end{proposition} \begin{proof}[Proof sketch] The proof is essentially a formalization of the following intuition. First, if a scheme $\phi$ is optimal and persuasive, and $\mu_\nstate$ is symmetric, then we can first ``relabel'' the actions according to any permutation $\pi$ before implementing $\phi$, and it will still be optimal and persuasive. Second, any distribution over optimal, persuasive schemes is still optimal and persuasive. And third, if we consider the scheme that randomly samples a permutation $\pi$ with which to relabel the actions before implementing $\phi$, then this scheme is symmetric. A full proof appears in Appendix~\ref{sec:missing-proofs}. \end{proof} With Proposition~\ref{prop:symmetry} in hand, we can now draw further conclusions regarding the format of the Lagrangian function $\mathcal{L}$ in the special case that $\mu_\nstate$ is symmetric: \begin{corollary}\label{cor:symmetryLagrange} When $\mu_\nstate$ is symmetric, there exists a constant $\lambda$ such that the optimal scheme, on every state of nature $\theta$, selects an action $i$ maximizing $\spay{i} + n\lambda \rpay{i}$. Moreover, for the same $\lambda$ and some constant $C$, the Lagrangian takes the following form: \[ \mathcal{L}_{\lambda}(\phi,P) = \sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i} \left( \spay{i} + n \lambda \rpay{i} \right) + \sum_{i\in[n]} P(i) \left( (n-1) \lambda - 1 \right) - \lambda C. \] \end{corollary} \begin{proof} Consider an optimal and symmetric dual solution, which is guaranteed to exist by Proposition~\ref{prop:symmetry}, in which $\lambda(i,j) = \lambda$ for all $i \neq j$. Then we get the following simplified form for $\mathcal{L}$: \begin{talign*} \mathcal{L}_{\lambda}& (\phi,P) = \sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i} \left( \spay{i} + \rpay{i} \sum_{j \neq i} \lambda - \sum_{j \neq i} \lambda \rpay{j} \right) + \sum_{i\in[n]} P(i) \left( \sum_{j \neq i} \lambda - 1 \right) \\ &= \sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i} \left( \spay{i} + \rpay{i} (n-1) \lambda - \lambda \sum_{j \neq i} \rpay{j} \right) + \sum_{i\in[n]} P(i) \left( (n-1) \lambda - 1 \right) \\ &= \sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i} \left( \spay{i} + n \lambda \rpay{i} \right) + \sum_{i\in[n]} P(i) \left( (n-1) \lambda - 1 \right) - \sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i} \lambda \sum_{j \in [n]} \rpay{j} \\ &= \sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i} \left( \spay{i} + n \lambda \rpay{i} \right) + \sum_{i\in[n]} P(i) \left( (n-1) \lambda - 1 \right) - \lambda C, \end{talign*} Where we have defined $C = \sum_{\theta \in \Theta} \mu_\nstate \phi_{\theta} \sum_{j \in [n]} \rpay{j}$. It is now easy to see that the signaling scheme maximizing $\mathcal{L}_{\lambda}$ necessarily on every state of nature $\theta$ recommends an action maximizing $\spay{i} + n\lambda \rpay{i}$. \end{proof} \section{Preliminaries} \label{sec:prelim} \vspace{-3mm} \paragraph{Bayesian persuasion.} Bayesian persuasion is a game between a sender, also termed as the \emph{principal}, and a receiver, also termed as the \emph{agent}. There is also a set of possible \emph{states of nature} $\Theta$. The true state of nature $\theta\in \Theta$ is drawn from a prior distribution $\mu_\nstate$, known to both the sender and the receiver. The receiver has a set of possible \emph{actions} $[n] = \{ 1,\dots, n \}$ to pick. Based on the action $i$ picked by the receiver and the true state of nature $\theta$, the sender and the receiver gain \emph{payoffs}\footnote{ We use the words ``payoff" and ``reward" interchangeably in this paper.}, denoted by $\spay{i}$ and $\rpay{i}$ respectively. In the Bayesian persuasion game, the sender commits to a \emph{signaling scheme} $\phi$, where in general $\phi$ is a mapping from $\Theta$ to distributions over possible \emph{signals},~$\Sigma$. Then the sender observes $\theta \sim \mu_\nstate$, and sends a signal $\sigma\in\Sigma$ to the receiver, where $\sigma\sim \phi_\theta$ for the observed $\theta$. Given signal $\sigma$, the receiver updates her belief about the state of nature $\theta$, and selects an action $i_r$ that maximizes her expected payoff under this posterior distribution. In this paper, without loss of generality, and by applying the revelation principle~\citep{KG-11}, we focus on signaling schemes for which $\Sigma=[n]$. We use the notation $\scheme{i}$ to denote the probability that the sender recommends action $i$ conditioned on the state of nature being $\theta$. A signaling scheme is said to \emph{implement} $\phi_\nstate$, if it samples signal $i\sim \phi_\nstate$ given the state of nature $\theta$. \vspace{-5mm} \paragraph{Persuasive signaling and optimal Bayesian persuasion.} A signaling scheme is \emph{persuasive} if the receiver is best off following the sender's recommendation, i.e. following the sender's recommendation maximizes the receiver's expected payoff under the receiver's posterior belief about the state of the nature (conditioned on the received signal). In the \emph{optimal Bayesian persuasion problem}, we wish to find, over all persuasive schemes, the one that maximizes the sender's expected payoff. \vspace{-5mm} \paragraph{Action types.} As typical in information structure design, we frequently think of each action as having a ``type'' depending on the state of nature.\footnote{ We refer the reader to \cite{DX-16} for a list examples of Bayesian persuasions and how types are defined in those.} That is, $\theta=[\theta_1,\ldots,\theta_n]$ is a vector in $[m]^n$, for some parameter $m$. Action $i$ has type $\theta_i$, which completely determines the sender and receiver payoffs should action $i$ be selected, independent of $\theta_{-i}$. More clearly, there exist $m$ pairs of payoffs $(\sipay{i}{1},\ripay{i}{1}),\ldots,(\sipay{i}{m},\ripay{i}{m})$ such that when the receiver selects action $i$ with $\theta_i = j$, $\sipay{i}{j}$ is the payoff to the sender and $\ripay{i}{j}$ is the payoff to the receiver. Note that $\spay{i}=\sipay{i}{\theta_i}$ and $\rpay{i}=\ripay{i}{\theta_i}$, and for universality we stick to this notation (see Appendix~\ref{appendix:reduced form}). Distributions in this setting may be \emph{independent}, if $\mu_\nstate = \underset{i}{\times}~\disti{i}$ is a product distribution, where each $\disti{i}$ is a distribution over $[m]$. Distributions in this setting may also be \emph{symmetric}, if $\mu_\nstate$ is invariant under all permutations. Distributions that are both independent and symmetric are \emph{i.i.d}. \vspace{-5mm} \paragraph{Bayesian persuasion with payments.} In this paper, we introduce a natural model of payments into the Bayesian persuasion problem. In addition to recommending an action $i$, the sender is allowed to ``incentivize'' the receiver to take the recommendation with an additional payment $\gpayment{i}$. Mathematically, it also makes sense to consider when payments are allowed to be negative (which corresponds to the sender ``charging'' the receiver $-\gpayment{i}$ in order to follow the recommendation). This certainly could be relevant for practice (e.g. if the sender/receiver can commit to contracts), but the non-negative payment model is clearly more natural. We study four different payment models: \emph{zero payments} (i.e. classic Bayesian persuasion), \emph{non-negative payments} (i.e. when the sender cannot charge the receiver), \emph{budget-balanced payments} (i.e. the payment of the sender is zero in expectation) and \emph{general payments} (i.e. payments are arbitrary real numbers). To unify the notation throughout the paper, we use ${\mathcal{P}}$ to denote the feasible set of payments, which plays the role of a different polytope for each relevant payment model (note that in all four models $\mathcal{P}$ is closed and convex). A signaling scheme is said to \emph{implement} $(\phi_\nstate,p)$ if given the observed state of nature $\theta$, it samples $i\sim \phi_\nstate$ and pays the receiver a (randomized) payment $\gpayment{i}$. Throughout this paper, it will be much more convenient to focus on specifying the \emph{expected payments} for following the recommendation of action $i$, $P(i) \triangleq \sum_{\theta\in\Theta} \mu_\nstate \scheme{i}\gpayment{i}$ for any scheme. We similarly define the implementability of $(\phi_\nstate,P)$.\footnote{ It is also easy to see how to implement payments $\gpayment{i}$ from $P(i)$ and an implementation of $\phi_\nstate$: for a given state $\theta\in \Theta$, sample a payment $\tfrac{P(i)}{\scheme{i}}$ whenever signal $i\sim \phi_\nstate$ is recommended.} \paragraph{Payment identity and optimal payments.} We conclude with an observation about Bayesian persuasion with payments. Similar to auction design, there is a ``payment identity'' capturing which payments will make an implementable signaling scheme persuasive. In contrast to auctions, however, it is easy to see that \emph{every} signaling scheme can be made persuasive with sufficiently high payments. \vspace{-2mm} \begin{observation}\label{obs:payments} Let $\mu_\nstate$ be any distribution over states of nature, and $\phi_\nstate$ be any signaling scheme (not necessarily persuasive). Then there exist thresholds $T_1,\ldots, T_n$ such that $(\phi_\nstate,p)$ is persuasive if and only if $P(i) \geq T_i$ for all $i$. \end{observation} \begin{proof} Let $X_{\phi}(i,j)$ be the receiver's expected utility by taking action $j$ when the scheme $\phi_\nstate$ recommends action $i$. Define $T_i = \max_{j \neq i} \{X_{\phi}(i,j) - X_{\phi}(i,i)\}$. Therefore, $X_{\phi}(i,i) + T_i \geq X_{\phi}(i,j)$ for all $j$, and any scheme that pays $P(i) \geq T_i$ is certainly persuasive when recommending $i$. Moreover, if $P(i) < T_i$, then there exists some $j$ s.t. $X_{\phi}(i,i) + P(i) < X_{\phi}(i,j)$, and the scheme is not persuasive. \end{proof} \vspace{-3mm} \begin{definition} We refer to the $T_1,\ldots, T_n$ guaranteed in Observation~\ref{obs:payments} as the \emph{optimal payments} for $\phi$, and $\max\{0,T_1\},\ldots, \max\{0,T_n\}$ as the \emph{optimal non-negative payments} for $\phi$. \end{definition} \vspace{-6mm} \paragraph{Bayesian persuasion with multiple agents, binary actions and externalities.} In this paper, we formalize a model with externalities, naturally extending the model introduced recently in~\cite{AB-16} and \cite{DH-17} for private persuasion with no externalities. Consider the general setup of Bayesian persuasion with one sender and $N$ receivers, where each receiver can take either action $0$ or action $1$. Using the revelation principle for Bayesian persuasion, we can restrict our attention to direct signaling schemes, where a direct (randomized) scheme can be thought of as a mapping from $\Theta$ to distributions over subsets of $[N]$, indicating to which receivers action $1$ is recommended. We denote such a scheme by $\BScheme{S}$ for every $\theta \in \Theta, S\subseteq [N]$. Given the subset $S$ of receivers taking action $1$, let $\util{i}{S}$ be the payoff of receiver $i$ and $\Ffun{S}$ be sender's payoff. We further assume that $\Ffun{S}$ is a monotone set function. We also allow payments of the form $\{\pay{i}{a}\}_{i\in[N], a\in\{0,1\}}$, where $\pay{i}{a}$ is the payment agent $i$ receives by following action $a$, if it is recommended. We occasionally use the notation $\Gfun{i}{S}\triangleq \util{i}{S}-\util{i}{S\setminus\{i\}}$, which are called \emph{marginal utilities} in this paper. For our computational results, we further assume \emph{positive externalities}, i.e. for every agent $i$, $\Gfun{i}{S}$ can only increase if agent $j\neq i$ switches from action $0$ to $1$. \section{Symmetric Actions and No Payments} \label{sec:nopayment} Here, we consider the standard symmetric setting without payments. We show how to derive structure on the optimal scheme by making use of duality. In any symmetric instance of Bayesian persuasion, there exists an optimal dual solution $\lambda^{*}(i,j)$ such that $\lambda^{*}(i,j)=\lambda^*\geq 0$ for all $i\neq j$ by applying Proposition~\ref{prop:symmetry}. Now, by plugging directly into Corollary~\ref{cor:symmetryLagrange} and observing that $P(i) = 0$ for all $i$, we get that the Lagrangian for the optimal dual takes the following form: \begin{equation}\label{eq: no payment iid} \mathcal{L}_{\lambda}(\phi) = \sum_{\theta\in\Theta,i \in [n]}\mu_\nstate\scheme{i} \left( \spay{i} + n \lambda \rpay{i} \right) - \lambda C. \end{equation} \noindent We immediately conclude that the optimal scheme recommends, for every state $\theta$, an action maximizing $\spay{i} + n\lambda^*\rpay{i}$. With a little more work, we can conclude something stronger about the exact value of $\lambda^*$. \begin{definition}[$\lambda$-scaled welfare maximizer] For a given multiplier $\lambda$, define $\phi^{\lambda}$ to be the scheme with $\phi^{\lambda}_{\theta}(i) = 0$ if $i \notin \arg\max_{j}\{\spay{j} + n\lambda\rpay{j}\}$, and $\phi^{\lambda}_{\theta}(i) = 1/|\{\arg \max_j\{\spay{j}+n\lambda\rpay{j}\}|$ if $i \in \arg\max_{j}\{\spay{j} + n\lambda\rpay{j}\}$. In other words, $\phi^{\lambda}$ recommends a uniformly random action in $\arg\max_{j}\{\spay{j} + n \lambda\rpay{j}\}$. \end{definition} \begin{proposition}\label{prop:symmetricnomoney} Let $\lambda^*$ be the smallest $\lambda \geq 0$ such that the scheme $\phi^{\lambda}$ is persuasive for $\mu_\nstate$. Then $\phi^{\lambda^*}$ is the optimal scheme for $\mu_\nstate$. \end{proposition} \begin{proof} The proof will follow from the following. We claim that the persuasiveness of $\phi^{\lambda}$ is monotone increasing in $\lambda$ (larger $\lambda$ is more persuasive), while the sender payoff is monotone \emph{decreasing} in $\lambda$. Together this immediately concludes that the optimal persuasive scheme is $\phi^{\lambda^*}$. We'll first need a technical lemma. \begin{lemma}\label{lem:symmetric} Let $\phi^1$, $\phi^2$ be symmetric schemes and let $\mu_\nstate$ be symmetric. Let the expected receiver payoff for accepting recommendation $\phi^1$ for $\mu_\nstate$ be at least as large as the expected receiver payoff for accepting recommendation $\phi^2$ for $\mu_\nstate$. Then if $\phi^2$ is persuasive, so is $\phi^1$.\footnote{ Note that this does \emph{not} hold generally, and absolutely requires the symmetry assumptions.} \end{lemma} \begin{proof} First, observe that by symmetry, the expected payoff for any action conditioned on that action being recommended is the same. Moreover, the expected payoff for any action $i$ conditioned on action $j \neq i$ being recommended is also the same (for all $i \neq j$). Therefore, the scheme is persuasive as long as for all actions, the expected payoff conditioned on being recommended exceeds the expected payoff conditioned on not being recommended. This holds if and only if the expected payoff conditioned on being recommended exceeds the unconditional expected payoff. As the unconditional expected payoff for an action is independent of the payoff scheme (denote it by $C$), we conclude that a signaling scheme is persuasive if and only if the expected receiver payoff for following the recommendation exceeds $C$. The lemma immediately follows. \end{proof} \begin{lemma}\label{lemma: monotone symmetric} If $\phi^{\lambda}$ is persuasive, then $\phi^{\lambda+\delta}$ is persuasive, for all $\delta \geq 0$. \end{lemma} \begin{proof} First, observe that $\phi^{\lambda}$ is symmetric for all $\lambda$. Further observe that the receiver's expected payoff for following the recommendation is monotone in $\lambda$: On every state of nature $\theta$, the recommended action maximizes $\spay{i} + n \lambda \rpay{i}$. The proof now immediately follows by Lemma~\ref{lem:symmetric}. \end{proof} \begin{lemma} The sender's expected payoff when the receiver follows $\phi^{\lambda}$ is monotone non-increasing in $\lambda$. \end{lemma} \begin{proof} Simply observe that on every state of nature $\theta$, the recommended action maximizes $\spay{i}+n\lambda\rpay{i}$. As $\lambda$ increases, the sender payoff for the recommended action decreases. \end{proof} The proof of Proposition~\ref{prop:symmetricnomoney} now immediately follows. \end{proof} \section{Optimal Single Agent Signaling with Payments} \label{sec:payment} In this section we study the single receiver Bayesian persuasion game with payments. While we consider our ``main results'' to be the case where payments are constrained to be non-negative, it's instructive to study general (positive or negative) payments. We characterize the optimal signaling scheme with payments in the general setting, drawing similar conclusions to~\cite{CDW-16} for optimal auctions. This is not a main result, but may be of independent interest. An easy corollary of this characterization, however, immediately allows us to claim something interesting in the case of two actions. The optimal scheme, for all states $\theta$, recommends the action $i$ maximizing $\spay{i} + 2\rpay{i}$ (paying the optimal payments), and this holds for any distribution. A deeper application of this characterization lets us characterize the optimal scheme for a single receiver with $n$ symmetric actions. In this setting, we show that the optimal scheme recommends the action $i$ maximizing $\spay{i} + \frac{n}{n-1}\rpay{i}$ (paying the optimal payments).\footnote{ Further recall that the sender/receiver payoffs for action $i$ are completely determined by action $i$'s type. So this can also be phrased as recommending a uniformly random action with type $k$, where $k$ maximizes $\xi_k + \frac{n}{n-1}\rho_k$ over all present types $k$.} When payments are non-negative, we prove that the optimal scheme is always either the optimal scheme without payments at all, or the optimal scheme with arbitrary payments. \input{general-payments} \input{dichotomy}
\subsection{Related Work} With multiple AI frameworks and a wide range of hardware involved in deep learning applications nowadays, it is important yet challenging for compiler-level optimization to efficiently and flexibly harmonize AI algorithms with the underlying hardware and optimize the performance of various deep learning applications. A large body of work has explored this space and achieved good performance. CuDNN \cite{chetlur2014cudnn} provides highly efficient implementations of various deep neural network layers and is considered the standard for accelerating deep learning on Nvidia GPUs. NNPACK \cite{dukhan2016nnpack} and PCL-DNN \cite{das2016distributed} similarly provide accelerations in x86 processors. Latte \cite{truong2016latte} provides a natural abstraction for specifying new layers and applies domain-specific and general computation graph optimization. XLA (Accelerated Linear Algebra) \cite{leary2017xla} optimizes TensorFlow computations in terms of speed, memory usage, and portability via just-in-time (JIT) compilation or ahead-of-time (AOT) compilation. However, the aforementioned approaches perform either graph-level or operator-level optimization during compilation and they are not generic enough to accommodate all AI frameworks and hardware. Based on the structure of Halide \cite{ragan2013halide}, \cite{Chen18} proposes a general end-to-end compilation optimization framework combining Neural Network Virtual Machine (NNVM) \cite{nnvm2017} for computation graph optimization and Tensor Virtual Machine (TVM) \cite{Chen18} for tensor operator optimization. Currently in TVM, a tuning method based on XGBoost \cite{chen2016xgboost} is considered state-of-the-art method for GEMM configuration optimization and has shown superior performance over other methods \cite{Chen18}, \cite{Tianqi2018}. For configuration optimization, the intuitive method is grid search, where all possible configuration candidates are tested sequentially to find the configuration with best performance. It guarantees to find the global optimal configurations, but the number of tested configuration candidates grows exponentially with the dimension of configuration space \cite{bellman2015adaptive}. Therefore, its usage is limited in problems with small search space or in combination with manual search \cite{hinton2012practical,lecun2012efficient,larochelle2007empirical}. Random search is proposed where the configurations are randomly selected to be tested, and is shown empirically and theoretically to be more efficient than grid search for configuration tuning \cite{bergstra2012random}. As an instance of Bayesian optimization, sequential model-based optimization (SMBO) shows its strength in configuration tuning by iteratively updating the underlying expected improvement, exploring new data through an acquisition function, and training a regression model \cite{hutter2011sequential,bergstra2011algorithms,hoffman2014modular}. The general method has been widely adopted and implemented \cite{kandasamy2018neural,snoek2012practical}. From another perspective, a series of evolutionary approaches have been explored, including the broad class of genetic algorithms (GA) \cite{Holland1975,Goldberg1989}, differential evolution \cite{Storn1997}, estimation of distribution algorithms \cite{larranaga2001estimation,bosman2007adapted}, and particle swarm optimization \cite{kennedy2001swarm}. Evolutionary strategies (ES) \cite{rechenberg1994evolutionsstrategie,schwefel1977numerische} have shown to perform efficiently in configuration tuning. Based on the concept, Covariance Matrix Adaptation Evolution Strategy (CMA-ES), first proposed by \cite{hansen2001completely}, has shown excellent performance by smartly update the mean, step size and covariance matrix for each evolution \cite{LoshchilovH16} . Natural Evolution Strategies \cite{wierstra2014natural} applies natural gradients to update configuration search policy so as to achieve high expected fitness and discover the high-performance configuration. Recently, researchers at Google apply deep reinforcement learning with a RNN controller to optimize the configurations of neural network architectures and its components \cite{bello2017neural,mirhoseini2017device,ramachandran2018searching,zoph2016neural,pham2018efficient}. The excellent tuning performance in wide range of applications shows the potential of deep reinforcement learning in the configuration tuning area. \subsection{Problem Formulation} We use TVM~\cite{Chen18} to investigate the performance of matrix tiling for GEMM. TVM facilitates tiling optimization by generating Intermediate Representation (IR) of a particular configuration. Fig.~\ref{fig:gemm_ir} is a simple example IR of GEMM tiling configuration with a blocking factor of 32 on x86 CPU for GEMM with $(m=1024, k=1024, n=1024)$ (short as $(1024,1024,1024)$). \begin{figure}[htb] \centering \vspace{0.5cm} \includegraphics[width=3.3in]{3_GEMM_backgrounds/gemm_ir.png} \caption{IR of GEMM with a blocking factor of 32} \label{fig:gemm_ir} \end{figure} \noindent \textbf{Definition:} Generally, a GEMM tiling configuration can be defined as \begin{equation} \overrightarrow{\xi} = \overrightarrow{\xi_m} \times \overrightarrow{\xi_k} \times \overrightarrow{\xi_n}, \end{equation} where \begin{equation}\label{eqn:m} \overrightarrow{\xi_m} =\{ \left[m_0,\ldots,m_i, \ldots m_{d_m-1} \right] | \Pi_{i=0}^{d_m-1} m_i=m \}, \end{equation} \begin{equation}\label{eqn:k} \overrightarrow{\xi_k} =\{ \left[k_0,\ldots,k_l, \ldots k_{d_k-1} \right] | \Pi_{l=0}^{d_k-1} k_l=k \}, \end{equation} \begin{equation}\label{eqn:n} \overrightarrow{\xi_n} =\{ \left[n_0,\ldots,n_j, \ldots n_{d_n-1} \right] | \Pi_{j=0}^{d_n-1} n_j=n \}. \end{equation} Multiplication of two matrices $A(m\times k)$ and $B(k\times n)$ produces matrix $C(m\times n)$. $d_m$, $d_k$ and $d_n$ are the number of nested loops for each dimension $m$, $k$ and $n$, respectively. $m_i, k_l, n_j$, $\forall i \in [0, d_m)$ $\forall l \in [0, d_k)$ $\forall j \in [0, d_n)$, are the number of iterations of a respective loop. The configuration in Fig.~\ref{fig:gemm_ir} is $m_0=m_1=32$, $k_0=256, k_1=4$, $n_0=n_1=32$, and $d_m=d_k=d_n=2$. We can formulate the optimal tiling configuration search problem into the following optimization problem: \begin{equation}\nonumber \begin{array}{l} \mathop {\min }\limits_{s} ~~{cost}(s ; m,k,n,d_m,d_k,d_n). \end{array} \end{equation} The objective is to find an optimal tiling configuration that has the minimal running time on target hardware. ${cost}$ denotes the running time for the configuration $s$, given the dimension of matrices ($m,k,n$) and the number of the nested loops on each dimension $d_m$, $d_k$, and $d_n$. \subsection{Matrix Multiplication} \begin{figure}[t] \vspace{0.5cm} \centering \begin{subfigure}[b]{0.22\textwidth} \includegraphics[width=\linewidth]{3_GEMM_backgrounds/fc.png} \caption{Fully-Connected Layer} \label{fig:fc} \end{subfigure} \hspace{0.2in} \begin{subfigure}[b]{0.22\textwidth} \includegraphics[width=\linewidth]{3_GEMM_backgrounds/cnn.png} \caption{Convolutional Layer} \label{fig:cnn} \end{subfigure} \caption{Illustration of deep neural network layers} \label{fig:layers} \end{figure} Matrix multiplication is a critical operation in many machine learning algorithms, particularly in the domain of deep learning. Training parameters (weights) of a deep neural network in a vectorized fashion essentially involves multiplication of matrices with various sizes. Fully-Connected (FC) layers (Fig.~\ref{fig:fc}) and convolutional (Conv) layers (Fig.~\ref{fig:cnn}) are building blocks of feed-forward and convolutional neural networks~\cite{Warden15}. It is straightforward to identify matrix multiplication in computing output value of a FC layer: each input has $k$ elements, and FC layer has $n$ neurons each with $k$ weights. An FC layer is the multiplication of a $m \times k$ matrix ($m$ is sample size) and a $k\times n$ matrix. A Conv layer appears to be a specialized operation, but it can be computed with matrix multiplication after rearranging data in a matrix format: each depth-wise (channel) slice of input can be added into an input matrix as a row; similarly each kernel can be added into a kernel matrix as a column. Convolution operation becomes multiplication of those two matrices. When using AlexNet on image classification with ImageNet dataset, vast majority of computation time on forward pass (94.7\% on GPU, and 88.7\% on CPU) is consumed by Conv and FC layers~\cite{Jia14}. \subsection{GEMM and Matrix Tiling} GEMM is a general procedure ubiquitously used in linear algebra, machine learning, statistics, and many other areas and is implemented in the BLAS (Basic Linear Algebra Subprograms) library \cite{BLAS2002}. It multiplies two input matrices to produce an output matrix. The key difference between GEMM in deep learning and regular matrix multiplication is that the input matrices handled in deep learning are normally much larger. For example, a single layer in a typical convolution neural network may require multiplication of a $256 \times 1024$ matrix by a $1024\times 128$ matrix to produce a $256 \times 128$ matrix. Regular three-for-loop (Fig.~\ref{fig:three}) computation requires 34 million ($256 \times 1024 \times 128$) floating point operations (FLOPs). Modern deep neural networks may have hundreds of convolutional layers (e.g. ResNet152~\cite{He15}), and such networks may need several billions of FLOPs to finish operations in all layers for an input image. \begin{figure}[h] \centering \includegraphics[width=2.0in]{3_GEMM_backgrounds/three_for_loop.png} \vspace{-0.1in} \caption{Computing matrix multiplication} \label{fig:three} \end{figure} The time it takes to complete a GEMM computation largely depends on the cache hit rate of memory access. The large sizes of matrices usually forbid the entire matrices being loaded into memory or cache, however, GEMM can optimize memory access by iteratively splitting computation into smaller tiles, often referred to as the \emph{tiling process}. A resulted matrix is initialized with zeros. GEMM uses outer products to compute part of a tile of the result and accumulates it on top of what has been stored in that tile. A tile is loaded from memory into cache and accumulates a new result on top of that. Fig.~\ref{fig:tiling}~\cite{Matthes17} illustrates a tiling strategy of GEMM. \begin{figure}[t] \vspace{-0.5in} \centering \includegraphics[width=3.3in]{3_GEMM_backgrounds/tiling.pdf} \vspace{-0.5in} \caption{An Example of Tiling Strategy} \label{fig:tiling} \end{figure} Original memory access patterns need to be transformed to adapt to the cache policy of a particular hardware. It is not straightforward to decide an optimal tiling strategy because it requires accurate estimate of accessed array regions in loops to match with cache size of target hardware and meet other constraints. An optimal tiling configuration chooses a tile size for each loop to collectively achieve the lowest running time on target hardware. \subsection{Configuration Search Modeling} We model the configuration tuning problem as a Markov Decision Process (MDP), where each configuration is regarded as a unique state. We define a state as follows. \begin{equation} s = \left[ s_m, s_k, s_n, J \right], \end{equation} where $s_m = \left[ m_0, m_1, \ldots, m_{d_m-1} \right] \in \xi_m$, $s_k = \left[ k_0, k_1, \ldots, k_{d_k-1} \right] \in \xi_k$, $s_n = \left[ n_0, n_1, \ldots, n_{d_n-1} \right] \in \xi_n$, and $J$ is a binary number indicating whether the state is legitimate.\footnote{The state configuration satisfies the conditions of Eqns.~\ref{eqn:m}-\ref{eqn:n}, and the numbers must be positive integers. Other constraints can be crafted to limit the search space and accelerate the search.} As in the GEMM application, with similar configuration settings, i.e., the configuration parameters for each dimension of two states are equal or close, the performance of thw two states is more likely to be similar. Taking advantage of the relationship between similar configurations, and considering the constraints of the matrix size in each configuration. We define the action space as follows, \begin{equation} \mathcal{A} = \emph{\{} {s_x[i] \leftarrow 2s_x[i] ~~\text{and}~~ s_x[j] \leftarrow s_x[j]/2 } \emph{\}}, \end{equation} where $ \forall x \in \{m,k,n\}, \forall i, j \in [0, d_x),~\text{and}~ i \neq j $. Accordingly, we define a step function $step$ as the transition from one state to another, \begin{equation}\label{fun:stepfun} s'= step(s,a). \end{equation} With the input of a particular action $a \in \mathcal{A}$, the current state $s$ transitions to state $s'$. \begin{figure*}[t!] \vspace{0.5cm} \centering \includegraphics[scale=0.46]{4_Method/gbfs_pic.jpg} \caption{G-BFS Method: (a) Flow chart; (b) Illustration; (c) Sample search trajectory} \label{fig:gbfs} \end{figure*} In addition, if the agent takes action $a$ and transitions from state $s$ to state $s'$, we define the reward function as follows, \begin{equation} r(s,a) = \frac{1}{{cost}(s'; m,k,n,d_m,d_k,d_n) }. \end{equation} Following MDP model, the agent is expected to determine its policy $\boldsymbol{\pi}$ so as to efficiently approach and discover a state $s^*$ with the lowest running time in the target hardware system. In the following subsections, we will propose two different configuration tuning approaches based on the configuration search model, guided by G-BFS and N-A2C reinforcement learning, respectively, followed by a discussion of their strengths in different scenarios. \subsection{G-BFS Method} The G-BFS method is guided by Greedy Best-First-Search and follows the flowchart in Fig. \ref{fig:gbfs}(a). We initialize an empty priority queue $\mathcal{Q}$ (ordered by increasing cost), an empty list $S_v$ to record all visited states, and a random or hand-crafted starting state $s_0$. We first test (i.e., run the configuration on target hardware) and enque the starting state $s_0$ and record its running time ${cost}(s_0)$ into the priority queue $\mathcal{Q}$. In each iteration, we deque the top configuration candidate $s$ from $\mathcal{Q}$, iterate through all actions $a\in \mathcal{A}$, and collect all corresponding neighbor states as \begin{equation} g(s) = [s'=step(s,a) ~~ \forall a \in \mathcal{A}]. \end{equation} We randomly select $\rho$ ($\rho \in \{1,2,\ldots,len(g(s)) \}$) states from $g(s)$, and test them in hardware. For each state $s'$ from $g(s)$, if $s'$ is legitimate and has not been visited before, we enque $s'$ and its running time ${cost}(s')$ into $\mathcal{Q}$ and add state $s'$ in the visited list $S_v$. If its running time ${cost}(s')$ is smaller than the current minimum running time, we set state $s'$ as the optimal state visited and record its running time as ${cost}_{min}$. The iteration continues until the priority queue is empty or the search time reaches the maximum time $T_{max}$ specified by the user. The current optimal state $s^*$ and its running time ${cost}_{min}$ are returned as tuning results. The summary of the algorithm is shown in Algorithm \ref{alg:gbfs}. \begin{algorithm}[t!] \caption{G-BFS Method} \label{alg:gbfs} \hrule \begin{algorithmic}[1] \vspace{.2cm} \STATE Initialization: $\mathcal{Q}$=PriorityQueue(), $S_v$, $s_0$ \STATE $\mathcal{Q}$.push($({cost}(s_0), s_0)$);\\ \STATE Add $s_0$ in $S_v$;\\ \WHILE{$\mathcal{Q}\neq\O$ and $t_{search} < T_{max}$} \STATE $({cost}(s), s)$ = $\mathcal{Q}$.pop(); \\ \STATE $\mathcal{B}$ = Take $\rho$ neighbors randomly from $g(s)$; \\ \FOR{$s'$ in $\mathcal{B}$} \IF{$s'$ is legitimate and $s' \not\in S_v$} \STATE $\mathcal{Q}$.push($({cost}(s'), s')$); \\ \STATE Add $s'$ in $S_v$;\\ \IF{${cost}_{min} > {cost}(s')$} \STATE ${cost}_{min} = {cost}(s')$; \\ \STATE $s^* = s'$; \ENDIF \ENDIF \ENDFOR \ENDWHILE \STATE Return: Configuration $s^*$ with ${cost}_{min}$. \end{algorithmic} \hrule \end{algorithm} In Fig. \ref{fig:gbfs}(b), we illustrate the exploration in the middle of the tuning process, where the red nodes denote the state currently stored in the priority queue and the grey nodes are the visited states. In subsequent iterations, the method will explore from the $\rho$ most promising red nodes. In Fig. \ref{fig:gbfs}(c), we depict an example of 2-dimensional configuration search with a randomly generated reward function. The proposed G-BFS method is able to correct itself from exploring wrong directions and efficiently expand its neighborhood to the optimal states. Moreover, when $\rho = len(g(s))$, given unlimited tuning time, the algorithm is guaranteed to visit all configuration states. \subsection{N-A2C Method} As the G-BFS method explores only one step from the considered state for each iteration, its performance may be affected when the cost from similar states exhibits large random noise. In the N-A2C method, as shown in Fig. \ref{fig:r_a2c}(a), for each episode, we explore in a $\varsigma$-step neighborhood, and the direction of exploration is guided by the A2C method \cite{bhatnagar2009natural}. The center of the exploration neighborhood is periodically updated with the optimal states ever visited. We summarize the N-A2C method in Algorithm~\ref{alg:r_a2c}. We initialize a random or hand-crafted starting state $s_0$, a fixed-size memory buffer $\mathcal{M}$ to record the latest search information, and an empty hashtable $H_v$ to record all visited states with the associated cost. For the A2C model, both actor and critic initialize their neural networks with random weights. In each episode, from the same starting point, the agent explores $\mathcal{T}$ continuous steps. For each step, the agent follows the $\epsilon$-greedy algorithm, where with probability of $\epsilon$, the agent takes action $a$ guided by the policy $\pi(s)$ generated by the actor's neural network; and with probability of $1-\epsilon$, the agent chooses a random action $a$ from the current state. Based on the current state $s$ and action $a$, we get the next state $s'$ from Eqn.~\ref{fun:stepfun}. If the next state $s'$ has not been visited before, we add $s'$ into collected candidate set $\mathcal{B}_{collect}$. The process iterates until the number of collected states reaches the predefined threshold, and the hardware executes the GEMM computation code generated with the collected configuration candidates. The hashmap $H_v$ and memory buffer $\mathcal{M}$ are then updated with the configuration candidates and the associated running time. The exploration data stored in $\mathcal{M}$ is used to incrementally-train the neural networks of A2C. \begin{figure*}[t!] \centering \vspace{0.5cm} \includegraphics[scale=0.46]{4_Method/n_a2c_pic.jpg} \caption{N-A2C Method: (a) Flow chart; (b) Illustration; (c) Sample search trajectory} \label{fig:r_a2c} \end{figure*} \begin{algorithm}[htb!] \caption{N-A2C Method} \label{alg:r_a2c} \hrule \begin{algorithmic}[1] \vspace{.2cm} \STATE Initialization: {$s_0$, $\mathcal{M}$, $H_v$, ${cost}_{min}$} \FOR{each episode} \WHILE{$len(\mathcal{B}_{collect})< len(\mathcal{B}_{test})$ } \STATE$s = s_0$; \\ \FOR{each step until $\mathcal{T}$ steps} \IF{$rand()<\epsilon$} \STATE $a$ follows $\pi(s)$; \ELSE \STATE $a$ is randomly selected from $\mathcal{A}$; \ENDIF \STATE $s'=step(s,a)$; \\ \IF {$s'$ not in $H_v$} \STATE Add $s'$ in $\mathcal{B}_{collect}$; \ENDIF \STATE $s = s'$; \ENDFOR \ENDWHILE \FOR{$s'$ in $\mathcal{B}_{collect}$} \IF{${cost}_{min} > {cost}(s')$} \STATE ${cost}_{min} = {cost}(s')$; \\ \STATE $s^* = s'$; \\ \STATE $s_0=s^*$; \\ \ENDIF \STATE $H_v[s'] = {cost}(s')$; \\ \STATE Store $(s, a, r(s,a), s')$ to $\mathcal{M}$, where $\forall s$, $\forall a$ satisfying $step(s,a) = s'$; \\ \STATE Train actor's and critic's neural networks with $\mathcal{M}$; \ENDFOR \ENDFOR \STATE Return: Configuration $s^*$ with ${cost}_{min}$. \end{algorithmic} \hrule \end{algorithm} Generally, the proposed N-A2C method is able to efficiently search the optimal GEMM configuration with fixed exploration steps in each episode. Nevertheless, heuristics can be applied. Just like learning-rate decay in training deep neural networks, the exploration step $\mathcal{T}$ can have a decay process, i.e., starting with a large value and gradually reducing to a small number. In addition, the exploration step $\mathcal{T}$ can also increase to explore new configuration neighborhoods. In Fig. \ref{fig:r_a2c}(b), we depict a simple exploration map with the proposed N-A2C method and $\mathcal{T} = 2$. Unlike Fig.~\ref{fig:gbfs}(b), the exploration neighborhood is defined as two steps from current states. In Fig. \ref{fig:r_a2c}(c), we show an example of 2-dimensional configuration with a randomly generated reward function. Due to the large randomness in the example, we set the exploration step $\mathcal{T}$ as 100 and the global optimal state is efficiently discovered with the guidance of the A2C algorithm. \section{Introduction}\label{sec_introduction} \input{1_Introduction/introduction.tex} \section{Related Work}\label{sec_works} \input{2_Related_Works/related_works.tex} \section{Problem Description}\label{sec_problem} In this section, we describe the concepts of matrix multiplication, GEMM, and matrix tiling. We formulate the GEMM tiling optimization problem at the end of the section. \input{3_GEMM_backgrounds/problem_statement.tex} \input{3_GEMM_backgrounds/problem_formula.tex} \section{Methodology}\label{sec_method} \input{4_Method/method.tex} \section{Experimental Results}\label{sec_simulation} \input{5_Simu/simu.tex} \section{Conclusion}\label{sec_conclusion} In this paper, we propose a Greedy Best First Search (G-BFS) method and a Neighborhood Actor Advantage Critic (N-A2C) method for compiler-level GEMM optimization, taking advantage of performance of neighborhood configurations. The G-BFS method, though being lightweight, outperforms the XBboost and RNN methods consistently; and the N-A2C method performs even better for large matrices. Empirical results show that both methods achieve significant performance improvement over state-of-the-art tuning methods such as those using XGBoost and RNN controller. Both methods are general in the sense that they are applicable to other compiler-level tuning tasks and can be used for optimization of other tensor operators with large configuration space. { \begin{spacing}{0.92} \footnotesize \bibliographystyle{icml2019}
\section{Eigenvector invariance after logarithm mapping} \label{Appendix A} The generalized eigenvalue decomposition (GED) is defined as below: \begin{equation} \label{Eq:appendix-A-1} \begin{aligned} \text{GED}(\mathbf{C}^w, \mathbf{C}^m) \Leftrightarrow \mathbf{C}^w\mathbf{F} = \mathbf{C}^{m}\mathbf{F} \mathbf{D} , \end{aligned} \end{equation} where $\mathbf{F}$ represents the generalized eigenvectors and $\mathbf{D}$ is the generalized eigenvalue matrix. For the convenience, we denote the solutions of this GED problem as: \begin{equation} \label{Eq:appendix-A-2} \begin{aligned} \mathbf{F}, \mathbf{D} = \text{GED}(\mathbf{C}^w, \mathbf{C}^m) \end{aligned} \end{equation} Since $ \mathbf{C}^m$ is a SPD matrix which means it is invertible, equation (\ref{Eq:appendix-A-1}) could be expressed as below by left multiplying $ \mathbf{C}^{-m}$ for both sides: \begin{equation} \label{Eq:appendix-A-4} \begin{aligned} \text{GED}(\mathbf{C}^w, \mathbf{C}^m) & \Leftrightarrow \mathbf{C}^{-m} \mathbf{C}^w\mathbf{F} =\mathbf{F} \mathbf{D} \\ & \Leftrightarrow \mathbf{F}, \mathbf{D} = \text{ED}(\mathbf{C}^{-m} \mathbf{C}^w) \\ \end{aligned} \end{equation} By leveraging the SPD property, we can decompose the $\mathbf{C}^{-m}$ into $ \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{-\frac{m}{2}} $, which is as proved below: \begin{equation} \label{Eq:appendix-A-5.pre} \begin{aligned} \mathbf{C}^{-m} & = \mathbf{V}^{m} \left( \mathbf{D}^{m}\right)^{-1} \left( \mathbf{V}^{m}\right)^{\mkern-1.5mu\mathsf{T}} \\ & \overset{\left( \mathbf{D}^{m}\right)^{-1} > 0}{=} \mathbf{V}^{m} \left( \mathbf{D}^{m}\right)^{-\frac{1}{2}} \mathbf{I} \left( \mathbf{D}^{m}\right)^{-\frac{1}{2}} \left( \mathbf{V}^{m}\right)^{\mkern-1.5mu\mathsf{T}} \\ & \overset{ \left( \mathbf{V}^{m}\right)^{\mkern-1.5mu\mathsf{T}} \mathbf{V}^{m} = \mathbf{I} }{=} \mathbf{V}^{m} \left( \mathbf{D}^{m}\right)^{-\frac{1}{2}} \left( \mathbf{V}^{m}\right)^{\mkern-1.5mu\mathsf{T}} \mathbf{V}^{m} \left( \mathbf{D}^{m}\right)^{-\frac{1}{2}} \left( \mathbf{V}^{m}\right)^{\mkern-1.5mu\mathsf{T}} \\ & = \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{-\frac{m}{2}} \\ \end{aligned} \end{equation} Similarly, $ \mathbf{C}^{+\frac{m}{2}} \mathbf{C}^{-\frac{m}{2}} $ can be proved as equivalent to identity matrix $\mathbf{I}$. Hence, based on these ingredients derived by SPD property, equation (\ref{Eq:appendix-A-4}) is further written as: \begin{equation} \label{Eq:appendix-A-5} \begin{aligned} & \mathbf{F}, \mathbf{D} = \text{ED}(\mathbf{C}^{-m} \mathbf{C}^w) \\ &\Leftrightarrow \mathbf{C}^{-m} \mathbf{C}^w\mathbf{F} =\mathbf{F} \mathbf{D} \\ & \Leftrightarrow \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^w \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{\frac{m}{2}} \mathbf{F} = \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{\frac{m}{2}}\mathbf{F} \mathbf{D} \\ & \Leftrightarrow \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^w \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{\frac{m}{2}} \mathbf{F} = \mathbf{C}^{\frac{m}{2}}\mathbf{F} \mathbf{D} \\ & \Leftrightarrow \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^w \mathbf{C}^{-\frac{m}{2}} \mathbf{V} = \mathbf{V}\mathbf{D} \text{, where } \mathbf{V} = \mathbf{C}^{\frac{m}{2}} \mathbf{F} \\ & \Leftrightarrow \mathbf{V}, \mathbf{D} = \text{ED}( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^w \mathbf{C}^{-\frac{m}{2}} ) \end{aligned} \end{equation} Note that as $\mathbf{C}^{-m}\mathbf{C}^w$ is not symmetric, its eigenvalue decomposition is not constrained to be orthogonal. Moreover, since $ \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^w \mathbf{C}^{-\frac{m}{2}}$ is symmetric, the eigenvectors are orthogonal basis, which could be formulated as below: \begin{equation} \label{Eq:appendix-A-5-} \begin{aligned} \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V} &= \mathbf{I} \\ \mathbf{F}^{\mkern-1.5mu\mathsf{T}} \mathbf{F} &\neq \mathbf{I} \\ \mathbf{F}^{\mkern-1.5mu\mathsf{T}} \mathbf{C}^{m}\mathbf{F} &= \mathbf{I} \\ \end{aligned} \end{equation} On the other hand, $ \text{ED}( \mathbf{C}^{-\frac{m}{2}} \mathbf{S}^w \mathbf{C}^{-\frac{m}{2}} ) $ can be solved as: \begin{equation} \label{Eq:appendix-A-6} \begin{aligned} & \text{ED}( \mathbf{C}^{-\frac{m}{2}} \mathbf{S}^w \mathbf{C}^{-\frac{m}{2}} ) \\ & \Leftrightarrow \text{ED}( \mathbf{C}^{-\frac{m}{2}} \left[ \mathbf{C}^{\frac{m}{2}}\text{Logm}\left( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^w \mathbf{C}^{-\frac{m}{2}} \right) \mathbf{C}^{\frac{m}{2}}\right] \mathbf{C}^{-\frac{m}{2}} )\\ & \Leftrightarrow \text{ED}( \text{Logm}\left( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^w \mathbf{C}^{-\frac{m}{2}} \right) ) \\ & \Leftrightarrow \text{ED}\left( \text{Logm}\left(\mathbf{V} \mathbf{D} \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \right) \right) \\ & \Leftrightarrow \text{ED}\left( \mathbf{V} \text{Logm}\left( \mathbf{D} \right) \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \right) \\ & \Rightarrow \mathbf{V}, \text{Logm}\left( \mathbf{D} \right) = \text{ED}\left( \mathbf{V} \text{Logm}\left( \mathbf{D} \right) \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \right) \\ & \Leftrightarrow \mathbf{V}, \text{Logm}\left( \mathbf{D} \right) = \text{ED}( \mathbf{C}^{-\frac{m}{2}} \mathbf{S}^w \mathbf{C}^{-\frac{m}{2}} ) \end{aligned} \end{equation} Based on the results shown in equation (\ref{Eq:appendix-A-5}) and (\ref{Eq:appendix-A-6}), we know: \begin{equation} \label{Eq:appendix-A-7} \begin{aligned} & \mathbf{V}, \text{Logm}\left( \mathbf{D} \right) = \text{ED}( \mathbf{C}^{-\frac{m}{2}} \mathbf{S}^w \mathbf{C}^{-\frac{m}{2}} ) \\ & \Leftrightarrow \mathbf{F}, \text{Logm}\left( \mathbf{D} \right) = \text{ED}(\mathbf{C}^{-m} \mathbf{S}^w) \\ & \Leftrightarrow \mathbf{F}, \text{Logm}\left( \mathbf{D} \right) = \text{GED}(\mathbf{S}^w, \mathbf{C}^{m} ) \end{aligned} \end{equation} By combining the results of equation (\ref{Eq:appendix-A-2}) and equation (\ref{Eq:appendix-A-7}), we have: \begin{equation} \label{Eq:appendix-A-8} \begin{aligned} \mathbf{F}, \mathbf{D} &= \text{GED}(\mathbf{C}^w, \mathbf{C}^{m} ) \\ \mathbf{F}, \text{Logm}\left( \mathbf{D} \right) &= \text{GED}(\mathbf{S}^w, \mathbf{C}^{m} ) \end{aligned} \end{equation} Therefore, as a conclusion, the eigenvectors of GED problem keep invariant after logarithm mapping as long as the projecting matrix is not reference matrix. \section{Proof of Lemmas} \subsection{Lemma 1} \label{GED_approx_lemma1} \textbf{\textit{Lemma 1: Invariant inner product between tangent vectors after affine transformation}} \begin{equation} \begin{aligned} \label{Eq:appendix-B-Lemma-0} <\mathbf{S}_1, \mathbf{S}_2>\mid_{\mathbf{C}_{\text{ref}}} &=<\mathbf{C}_{\text{ref}}^{-\frac{1}{2}}\mathbf{S}_1\mathbf{C}_{\text{ref}}^{-\frac{1}{2}}, \mathbf{C}_{\text{ref}}^{-\frac{1}{2}}\mathbf{S}_2\mathbf{C}_{\text{ref}}^{-\frac{1}{2}}>\mid_{\mathbf{I}}\\ &=\Tr{\mathbf{C}_{\text{ref}}^{-\frac{1}{2}}\mathbf{S}_1\mathbf{C}_{\text{ref}}^{-\frac{1}{2}} \cdot \mathbf{C}_{\text{ref}}^{-\frac{1}{2}}\mathbf{S}_2\mathbf{C}_{\text{ref}}^{-\frac{1}{2}}}, \\ \end{aligned} \end{equation} \textbf{\textit{Proof:}} $<\mathbf{S}_1, \mathbf{S}_2>\mid_{\mathbf{C}_{\text{ref}}} $ represents the inner product between tangent vector $\mathbf{S}_1$ and $\mathbf{S}_2$. Besides, these tangent vectors are projected on the tangent space based on the reference point $\mathbf{C}_{\text{ref}}$. For more details about the proof, please refer to section 4 of \cite{pennec1998uniform} and section 3 of \cite{pennec2006riemannian}. \textbf{Q.E.D.} \subsection{Lemma 2} \label{GED_approx_lemma2} \textbf{\textit{Lemma 2: Equivalence of logarithm mapping}} \begin{equation} \begin{aligned} \label{Eq:appendix-B-Lemma-1-app} \text{Logm}(\mathbf{V}^{\mkern-1.5mu\mathsf{T}}\mathbf{A}\mathbf{V}) = \mathbf{V}^{\mkern-1.5mu\mathsf{T}}\text{Logm}(\mathbf{A})\mathbf{V} \\ \text{, iff } \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V} = \mathbf{I} \text{ and $\mathbf{A}$ is SPD.} \end{aligned} \end{equation} \textbf{\textit{Proof:}} Based on the SPD property of matrix $\mathbf{A}$, we can apply ED to $\mathbf{A}$ and obtain: \begin{equation} \begin{aligned} \label{Eq:appendix-B-Lemma-2} \mathbf{A}\text{ is SPD }\Rightarrow \mathbf{A} &= \mathbf{V}^{A} \mathbf{D}^A \left( \mathbf{V}^{A}\right)^{\mkern-1.5mu\mathsf{T}} \\ &\text{, where } \left( \mathbf{V}^{A}\right)\left( \mathbf{V}^{A}\right)^{\mkern-1.5mu\mathsf{T}} = \mathbf{I} \end{aligned} \end{equation} Moreover, combining above results with $ \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V} = \mathbf{I}$, we have \begin{equation} \begin{aligned} \label{Eq:appendix-B-Lemma-3} \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V} = \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \left( \mathbf{V}^{A}\right) \left( \mathbf{V}^{A}\right)^{\mkern-1.5mu\mathsf{T}} \mathbf{V} = \mathbf{I} \\ \Leftrightarrow \left( \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V}^{A} \right) \left( \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V}^{A} \right)^{\mkern-1.5mu\mathsf{T}} = \mathbf{I} \end{aligned} \end{equation} Therefore, by substituting the results from equation (\ref{Eq:appendix-B-Lemma-2}) and (\ref{Eq:appendix-B-Lemma-3}) into $ \text{Logm}(\mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{A}\mathbf{V})$, we have: \begin{equation} \begin{aligned} \label{Eq:appendix-B-Lemma-4} \text{Logm}(\mathbf{V}^{\mkern-1.5mu\mathsf{T}}\mathbf{A}\mathbf{V}) &\overset{\text{Eq. (\ref{Eq:appendix-B-Lemma-2})}}{=} \text{Logm}(\mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V}^{A} \mathbf{D}^A \left( \mathbf{V}^{A}\right)^{\mkern-1.5mu\mathsf{T}} \mathbf{V}) \\ &= \text{Logm}( \left( \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V}^{A} \right) \mathbf{D}^A \left( \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V}^{A} \right)^{\mkern-1.5mu\mathsf{T}} ) \\ &\overset{\text{Eq. (\ref{Eq:appendix-B-Lemma-3})}}{=} \left( \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V}^{A} \right) \text{Logm}( \mathbf{D}^A ) \left( \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V}^{A} \right)^{\mkern-1.5mu\mathsf{T}} \\ &= \mathbf{V}^{\mkern-1.5mu\mathsf{T}}\left[ \mathbf{V}^{A} \text{Logm}( \mathbf{D}^A )\left( \mathbf{V}^{A}\right)^{\mkern-1.5mu\mathsf{T}} \right] \mathbf{V} \\ &\overset{\text{Eq. (\ref{Eq:appendix-B-Lemma-2})}}{=} \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \text{Logm}( \mathbf{V}^{A} \mathbf{D}^A \left( \mathbf{V}^{A}\right)^{\mkern-1.5mu\mathsf{T}}) \mathbf{V} \\ &\overset{\text{Eq. (\ref{Eq:appendix-B-Lemma-2})}}{=} \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \text{Logm}(\mathbf{A}) \mathbf{V} \\ \end{aligned} \end{equation} \textbf{Q.E.D.} \section{Classification accuracy w.r.t. the number of applied filters} \subsection{Classification accuracy w.r.t. the number of applied filters for all rest six datasets} \label{all_ds_acc} (Please refer to Fig.~\ref{Fig_acc_allds}) \begin{figure*}[!htb] \centering \begin{subfigure}{.48\linewidth} \includegraphics[width=\linewidth]{Score_BNCI2014001_all.pdf} \caption{\centering BNCI2014001} \end{subfigure} \begin{subfigure}{.48\linewidth} \includegraphics[width=\linewidth]{Score_Cho_all.pdf} \caption{\centering Cho} \end{subfigure} \begin{subfigure}{.48\linewidth} \includegraphics[width=\linewidth]{Score_Phy_all.pdf} \caption{\centering Phy} \end{subfigure} \begin{subfigure}{.48\linewidth} \includegraphics[width=\linewidth]{Score_Shin_all.pdf} \caption{\centering Shin} \end{subfigure} \begin{subfigure}{.48\linewidth} \includegraphics[width=\linewidth]{Score_Weibo_all.pdf} \caption{\centering Weibo} \end{subfigure} \begin{subfigure}{.48\linewidth} \includegraphics[width=\linewidth]{Score_Zhou_all.pdf} \caption{\centering Zhou} \end{subfigure} \caption{Classification accuracy w.r.t. the number of applied filters within each data set and the accuracies are computed across all subjects and sessions. The central line is the mean accuracy and the error band shows confidence interval = $68\%$.} \label{Fig_acc_allds} \end{figure*} \subsection{Classification accuracy w.r.t. the number of applied filters for all subjects within data set \textit{Munich Motor Imagery}} \label{Munich_acc_ind} (Please refer to Fig.~\ref{Fig_acc_ind}) \begin{figure*}[!htb] \centering \includegraphics[width=\linewidth]{Score_Munich_ind.pdf} \caption{Classification accuracy w.r.t. the number of applied filters for each subject of data set \textit{Munich Motor Imagery} and the accuracies are computed using ROC-AUC metric and averaged across five folds cross validation.} \label{Fig_acc_ind} \end{figure*} \subsection{Preliminary and Notations} \label{notations} We notate the the raw sensor data as $\mathbf{X}$ $\in$ $\Re^{C \times N \times T} $, where $C$, $N$ and $T$ represents the number of channels (electrodes), samples (length of each trial) and trials respectively. We represent the data of channel $c$ (with $c \in \{1, \cdots, C\}$) as $\mathbf{X}_c$. In addition, the data from the $t$-th trial (with $t \in \{1, \cdots, T\}$) are expressed as $\mathbf{X}^{t}$. Similarly, we use $(\cdot)^{t}$ to express the variables derived from $\mathbf{X}^{t}$. Moreover, the covariance matrices computed from $\mathbf{X}$, i.e., the points lying on the manifold, are denoted as $\mathbf{C}\in \Re^{C \times C \times T} $. The Fr\'{e}chet mean, a generalization of the standard arithmetic mean to other spaces, of the manifold points set $\mathbf{C}$ is expressed as $\mathbf{C}^m$. In the following section, we use $\mathbf{A}$ to denote any symmetric positive definite (SPD) matrix, for which the following property holds true: $\mathbf{v}^T\mathbf{A}\mathbf{v} > 0, \forall \mathbf{v} \neq \mathbf{0}$. We next describe some common operations for manipulating points on the symmetric positive definite (SPD) manifold. Firstly, $\lambda\left( \mathbf{A} \right)$ is used to express the vector of eigenvalues of $\mathbf{A}$. Next, the logarithm for an SPD matrix is defined as: \begin{equation} \label{Eq:2-1} \begin{aligned} \text{Logm}\left( \mathbf{A}\right) = \mathbf{V} \text{log}\left( \mathbf{D}\right) \mathbf{V}^{\mkern-1.5mu\mathsf{T}}, \end{aligned} \end{equation} where $\mathbf{D}$ is the diagonal eigenvalue matrix of $\mathbf{A}$, i.e., $ \mathbf{A} = \mathbf{V} \mathbf{D} \mathbf{V}^{T}$, $\text{log}\left( \cdot \right)$ represents taking the logarithm elementwise for a matrix, and $\mathbf{V}$ is the orthogonal matrix of eigenvectors. The exponential and powers of a SPD matrix are defined in similar fashion, i.e.: \begin{equation} \label{Eq:2-2} \begin{aligned} & \text{Expm}\left( \mathbf{A}\right) = \mathbf{V} \text{exp}\left( \mathbf{D}\right) \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \\ & \mathbf{A}^{p} = \mathbf{V} \mathbf{D}^{p} \mathbf{V}^{\mkern-1.5mu\mathsf{T}}, \text{ }p \in \Re \text{ and } p \neq 0, \end{aligned} \end{equation} where $\text{exp}\left( \cdot \right)$ and $\left( \cdot \right)^{p}$ represent taking logarithm and power of $p$ elementwise within a matrix. Please note that $p$ can also be a fraction, e.g., $p=\frac{1}{2}$ means the square root and $p=-\frac{1}{2}$ denotes the inverse square root. At last, since the vectorization of an SPD matrix is also frequently employed to reduce the computational complexity, it is defined as below: \begin{equation} \label{Eq:2-4} \begin{aligned} \vt{\mathbf{A}} =& \left[\alpha_{1,1}\mathbf{A}_{1,1}, \cdots, \alpha_{i,j}\mathbf{A}_{i,j}, \cdots,\alpha_{C,C}\mathbf{A}_{C,C} \right] \\ &\in \Re^{1\times \frac{C(C+1)}{2}}, \text{ where } 1 \leq j \leq i \leq C. \\ \alpha_{i,j} =& \left[ 1 \text{ if } i=j, \sqrt{2} \text{ else} \right] \end{aligned} \end{equation} An overview of these notations is shown in Table \ref{T1}. \begin{table}[htb!] \caption{\protect \centering The List of Notations}% \label{T1} \centering \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{\textbf{Basic Variables}} \\ \hline $C - $ \text{ \#channels} & $c - $ \text{ $c$-th channel} \\ $T - $ \text{ \#trials} & $t - $ \text{ t-th trial} \\ $N - $ \text{ \#samples} & $K - $ \text{ \#spatial filters} \\ $\mathbf{D} - \text{Diagonal matrix}$ & $\mathbf{I} - \text{Identity matrix}$ \\ $\mathbf{A} - \text{Any SPD matrix}$ & $\mathbf{B} - \text{Any SPD matrix}$ \\ \hline \multicolumn{2}{|c|}{\textbf{Data Related Variables}} \\ \hline \multicolumn{2}{|l|}{$\mathbf{X} \in \Re^{C \times N \times T} - \text{Bandpass filtered trialwise data} $} \\ \multicolumn{2}{|l|}{$\mathbf{C}\in \Re^{C \times C \times T} - \text{Covariance matrices on the manifold}$} \\ \multicolumn{2}{|l|}{$\mathbf{C}^w \in \Re^{C \times C} - \text{Weight covariance matrix on the manifold} $} \\ \multicolumn{2}{|l|}{$\mathbf{C}_{\text{ref}} \in \Re^{C \times C} - \text{Reference point for constructing tangent space} $} \\ \multicolumn{2}{|l|}{$\mathbf{S} \in \Re^{C \times C \times T} - \text{Covariance matrices on the tangent space}$ } \\ \multicolumn{2}{|l|}{$\mathbf{S}^w \in \Re^{C \times C} - \text{Weight matrix on the tangent space} $} \\ \multicolumn{2}{|l|}{$\mathbf{F} \in \Re^{C \times C} - \text{Spatial filters with full rank}$} \\ \multicolumn{2}{|l|}{$\overrightarrow{s^t} \in \Re^{\frac{C(C+1)}{2}\times 1} - \text{Tangent vector of $t$-th trial}$} \\ \multicolumn{2}{|l|}{$\overrightarrow{f} \in \Re^{C \times 1} - \text{Single spatial filter component} $} \\ \multicolumn{2}{|l|}{$\overrightarrow{w} \in \Re^{\frac{C(C+1)}{2} \times 1} - \text{Weight vector on the tangent space} $} \\ \multicolumn{2}{|l|}{$\overrightarrow{\beta} \in \Re^{C \times 1} - \text{Vector of sorted regression coefficient (log-eigenvalue)} $} \\ \hline \multicolumn{2}{|c|}{\textbf{Operators}} \\ \hline \multicolumn{2}{|l|}{$(\cdot)^{t} - \text{Variables from the data of $t$-th trial}$} \\ \multicolumn{2}{|l|}{$\widetilde{(\cdot)}_{\perp \mathbf{F}} - \text{After spatial filtering with }\mathbf{F} $} \\ \multicolumn{2}{|l|}{$(\cdot)^m - \text{Fr\'{e}chet mean}$} \\ \multicolumn{2}{|l|}{$ \overline{(\cdot)} - \text{Arithmetic mean}$} \\ \multicolumn{2}{|l|}{$\text{vec}\left( \cdot \right) - \text{ Vectorizing SPD matrices}$} \\ \multicolumn{2}{|l|}{$\lambda\left( \cdot \right) - \text{ The eigenvalue vector of a matrix }$ } \\ \multicolumn{2}{|l|}{$\text{log}\left( \cdot \right) - \text{Taking logrithm elementwise}$} \\ \multicolumn{2}{|l|}{$\text{Logm}\left( \cdot \right) - \text{Taking logrithm for a matrix based on the } \mathbf{I} $ } \\ \multicolumn{2}{|l|}{$\text{Expm}\left( \cdot \right) - \text{Taking exponential for a matrix based on the } \mathbf{I} $} \\ \multicolumn{2}{|l|}{$\text{Logm}_{\mathbf{A}}\left( \cdot \right) -\text{Taking logrithm for a matrix based on the } \mathbf{A} $} \\ \multicolumn{2}{|l|}{$\text{Expm}_{\mathbf{A}}\left( \cdot \right) - \text{Taking exponential for a matrix based on the } \mathbf{A} $} \\ \hline \end{tabular} \end{table} \subsection{Riemannian Manifold based Methods} Most BCIs use classifiers built on features extracted from the bandpower in physiologically relevant ranges from the recorded channels, often approximated via the variance after spectral filtering. One limitation of this information is that it cannot take correlations between channels into account; in order to overcome this, the Riemannian classification framework is based on the sample covariance matrices \cite{Barachant2010}, which encode both cross-channel information and variance information, and are also theoretically symmetric positive definite. Therefore, in this section, we will introduce several fundamental procedures utilized in Riemannian methods. For a more mathematically exhaustive treatment of Riemannian manifolds, please refer to \cite{boothby1986introduction}. \subsubsection{Riemannian Metric and Distance} Most feature extraction or classification algorithms concentrate on maximally increasing the discriminability of data points. A linear classifier, for example, can be thought of as a one-dimensional projection of a dataset in which the two classes are as far from each other as possible according to a given criterion. One convenient proxy of measuring the discriminability of a set of points is therefore via the inter-point distances. A classifiable dataset corresponds to a dataset in which inter-point distances are low within a class and high between classes. Therefore, a good metric can lead to good models in machine learning tasks. In standard vector algebra, the metric function is usually the standard Euclidean metric, i.e., the squared Euclidean distance between two matrices, and is usually measured by the Frobenius norm of their difference, as shown in the below: \begin{equation} \label{Eq:2-5} \begin{aligned} d_{\text{Euclid}}^2\left( \mathbf{A}, \mathbf{B}\right) = \norm{\mathbf{A} - \mathbf{B}}_{\text{F}}^2 = \Tr{\left(\mathbf{A} - \mathbf{B} \right)^2 }, \end{aligned} \end{equation} where $\mathbf{A} $ and $\mathbf{B} $ are two matrices of the same size and $\norm{\cdot}_{\text{F}}$ represents the Frobenius norm. While this metric can also be used with SPD matrices, it is incapable of adequately capturing the structure of SPD matrices, leading to certain undesirable effects such as the swelling effect \cite{arsigny2006log}. What this means is that naively attempting to use covariance matrices as features in a linear classifier by simply vectorizing the input points often works very poorly. In order to take advantage of the structure inherent to covariance matrices, it is desirable to have a metric that generalizes the properties of the Euclidean metric in standard vector spaces to the SPD manifold. One importance of such property is the idea of geodesic distances -- that the distance between two points is equivalent to the length of the shortest path to get from point A to point B. In vector spaces, this is simply equivalent to the magnitude of the difference between two points, but this is not necessarily true for manifolds. The affine-invariant Riemannian metric is proposed \cite{pennec2006riemannian} and defined as Eq.~(\ref{Eq:2-6}), and has the property of preserving geodesic distances, which is to say that the distance between two points is the length of the shortest path between them upon the SPD manifold. \begin{equation} \label{Eq:2-6} \begin{aligned} d_{\text{AIRM}}^2\left( \mathbf{A}, \mathbf{B} \right) = \norm{ \log\left( \lambda \left( \mathbf{A}^{-\frac{1}{2}} \mathbf{B} \mathbf{A}^{-\frac{1}{2}} \right) \right) }_2^2, \end{aligned} \end{equation} where $\norm{\cdot}_2$ represents the L2 norm. Based on the chosen metric, the expression for the mean of a set of matrices is defined as: \begin{equation} \label{Eq:2-7} \begin{aligned} \mathbf{C}^m =\underset{\mathbf{A} \in \mathbf{C} }{\arg \min} \sum_{t=1}^{T} d_{\text{AIRM}}^2\left( \mathbf{A}, \mathbf{C}^t \right), \end{aligned} \end{equation} where $\mathbf{A} \in \Re^{C \times C}$ and $\mathbf{C} = \left[ \mathbf{C}^1, \cdots, \mathbf{C}^T\right] \in \Re^{C \times C \times T}$. If $\mathbf{C}^m$ is globally unique, then it is named as the Fr\'{e}chet mean of the set of SPD matrices $\mathbf{C}$. Given the metric and a set of points, it is possible to implement purely distance-based classifiers such as k-Nearest Neighbors or Minimum Distance to Riemannian Mean (MDRM) \cite{barachant2011multiclass}. Classifiers based on this metric have shown themselves to be highly effective in particular for BCI data \cite{Barachant2010, Congedo2017, Yger2017}. \subsubsection{Tangent Space} When observing the explicit Riemannian metric defined in Eq.~(\ref{Eq:2-6}), one inconvenient issue is that the length of the shortest path between two manifold points (the geodesic) cannot be derived via simple subtraction and norm computation, as it can with the Euclidean metric. In order to treat SPD matrices in a manner identical to traditional feature vectors, we adopt the tangent space mapping. The tangent space is defined as a finite-dimensional Euclidean space which exists at each point on the manifold and linearizes the curvature of the manifold around that point, which is called the reference point. Simply speaking, it is a way of transforming manifold points such that we can now treat them as standard vectors. However, the distances and angles derived from the tangent space representation of points are only valid within a small neighborhood around the reference point, which means that this transformation only works in a small volume of the manifold. Therefore, to ensure the approximation error is minimized, the Fr\'{e}chet mean of a set $\mathbf{C}$ is adopted as the reference point for that set. To transform points from the manifold to the tangent space at a point and vice versa, the so-called logarithmic and exponential maps are used. Under the affine-invariant Riemannian metric, the logarithm and exponential function pair at a point $\mathbf{A}$ are formulated as following: \begin{equation} \label{Eq:2-8} \begin{aligned} &\mathbf{S}^t= \text{Logm}_{\mathbf{A}}\left( \mathbf{C}^t\right) \\ &\mathbf{C}^t= \text{Expm}_{\mathbf{A}}\left( \mathbf{S}^t\right), \end{aligned} \end{equation} where $\mathbf{S}^t$ is the projected point lying on the tangent space, $\mathbf{C}^t$ is the original manifold point and the operation of $\text{Logm}_{\mathbf{B}}\left( \mathbf{A}\right)$ and $\text{Expm}_{\mathbf{B}}\left( \mathbf{A}\right) $, i.e., the logarithm and exponential of $ \mathbf{A}$ based on another SPD matrix $ \mathbf{B}$, is defined as \cite{pennec2006riemannian, Barachant2010}: \begin{equation} \label{Eq:2-3} \begin{aligned} &\text{Logm}_{\mathbf{B}}\left( \mathbf{A}\right) = \mathbf{B}^{\frac{1}{2}} \text{Logm}\left( \mathbf{B}^{-\frac{1}{2}} \mathbf{A} \mathbf{B}^{-\frac{1}{2}} \right) \mathbf{B}^{\frac{1}{2}} \\ &\text{Expm}_{\mathbf{B}}\left( \mathbf{A}\right) = \mathbf{B}^{\frac{1}{2}} \text{Expm}\left( \mathbf{B}^{-\frac{1}{2}} \mathbf{A} \mathbf{B}^{-\frac{1}{2}} \right) \mathbf{B}^{\frac{1}{2}} \\ \end{aligned} \end{equation} To further simplify operations on the tangent space, the projected points are usually vectorized. Note that this procedure does not alter the location or norm of the points, it simply makes them easier to notate and use. We denote these vectors as tangent vectors and formulate them as follows: \begin{equation} \label{Eq:2-9} \begin{aligned} &\overrightarrow{s^t} = \vt{\mathbf{S}^{t}} \in \Re^{ \frac{C(C+1)}{2} \times 1} , \end{aligned} \end{equation} where $\overrightarrow{s_t}$ is the tangent vectors of $t$-th trial. After obtaining the set of tangent vectors $\mathbf{s}$, standard machine learning algorithms can be applied. \subsubsection{Pros and Cons of Riemannian Methods} As an emerging technique, Riemannian methods have seen an upsurge of interest in the BCI field recently \cite{Congedo2017, Yger2017} due to their rich feature space and robustness to outliers. In particular, Jayaram \textit{et al.} \cite{jayaram2018moabb} have compared Riemannian methods and standard processing pipelines over more than 200 subjects and showed that Riemannian methods are, on average, superior to many other conventional methods. One major pitfall of these methods, however, is their sensitivity to the number of channels. As shown in Eq.~(\ref{Eq:2-9}), the dimension of the tangent vectors increases quadratically with the number of channels $C$. In addition, the computational complexity of the eigenvalue decomposition for matrices grows cubically. Due to these reasons, it becomes infeasible to apply Riemannian methods on data sets with a large number of channels. In addition, since the full covariance matrix is utilized for classification, interpreting the contribution from each channel that is used by the classifier can be a challenge. Therefore, the application of Riemannian methods is still restricted to low-channel situations where interpretability is of lesser importance. \subsection{Spatial Filtering} \label{SF} The novelty of Riemannian methods is not only the adoption of the new metric function but also the extraction of covariance matrix based features instead of variance-based features. Although in traditional EEG-based BCI systems, power (variance)-based methods are much more commonly adopted, they are, unfortunately, significantly affected by poor signal quality. To remove artifacts and noise while reducing the computational complexity, spatial filtering techniques are often used. Since the projection of the underlying neuronal sources to the EEG electrodes can be modeled as a linear transformation \cite{haufe2014interpretation}, with the appropriate projection, it is possible to recover the activity of specific parts of the brain. This both increases signal quality and provides a convenient signal for neuro-feedback. Based on the way the filters are extracted, they can be categorized into fixed weight and data-driven \cite{lotte2014tutorial}. Among the latter, one of the most popular methods is Common Spatial Patterns (CSP) \cite{koles1990spatial, ramoser2000optimal, lotte2007review}, which has had a great impact on BCIs in the past two decades. In addition to increase signal quality, spatial filters are also important in ensuring that features used for machine learning in a BCI are brain-based. Since spatial filters represent a decoding model of brain activity, in which the time-series of interest is distilled from the recorded data, it is possible under some assumptions to recover an encoding model, which shows how the desired source projects to the sensors. This projection, called a spatial pattern, can then be visually validated to confirm that it represents a current source within the brain. While patterns are typically recovered by inverting the filtering matrix, this is only exact when the spatial filtering matrix is full rank. Therefore, for the computation of spatial patterns, we adopted the method proposed in \cite{haufe2014interpretation}, which is a more general way to derive the spatial patterns from linear filters. We next briefly review the mathematics behind CSP, as it is one of the most common and simple methods for generating spatial filters. As formulated below, CSP aims at extracting the signal sources which maximize the variance ratio between two conditions: \begin{equation} \label{Eq:2-10} \begin{aligned} \overrightarrow{f}_{\text{CSP}} =\underset{\overrightarrow{f} \in \Re^{C \times 1} }{\arg \max} \frac{\overrightarrow{f}^{\mkern-1.5mu\mathsf{T}}\overline{\mathbf{C}^{(+)}}\overrightarrow{f}}{\overrightarrow{f}^{\mkern-1.5mu\mathsf{T}}\overline{\mathbf{C}^{(-)}}\overrightarrow{f}}, \end{aligned} \end{equation} where $\overrightarrow{f}_{\text{CSP}} $ represents the optimal CSP filter component, and $\overline{\mathbf{C}^{(+)}}$ and $\overline{\mathbf{C}^{(-)}}$ represents the arithmetic mean covariance matrix of each condition. Obviously, Eq.~(\ref{Eq:2-10}) can be solved by the Generalized Eigenvalue Decomposition (GED) between $\overline{\mathbf{C}^{(+)}}$ and $\overline{\mathbf{C}^{(-)}}$. The spatial filter matrix with shape of $\Re^{C \times K}$ is extracted by selecting the eigenvetors correpsonding to the first $K$ largest GED eigenvalues. While CSP is usually extracted by solving $\text{GED} (\overline{\mathbf{C}^{(+)}}, \overline{\mathbf{C}^{(-)}} )$, it can also be interepreted in a discriminative view, as described by Blankertz \textit{et al}~\cite{Blankertz2008}: \begin{equation} \label{Eq:2-26} \begin{aligned} \mathbf{C}_d &= \overline{\mathbf{C}^{(+)}} - \overline{\mathbf{C}^{(-)}} \text{: discriminative activity} \\ \mathbf{C}_c &= \overline{\mathbf{C}^{(+)}} + \overline{\mathbf{C}^{(-)}} \text{: common activity} \\ \end{aligned} \end{equation} Here the solution of CSP is obtained by maximizing the variance ratios between discriminative and common activity: \begin{equation} \label{Eq:2-27} \begin{aligned} \overrightarrow{f}_{\text{CSP}} =\underset{\overrightarrow{f} \in \Re^{C \times 1} }{\arg \max} \frac{\overrightarrow{f}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}_d\overrightarrow{f}}{\overrightarrow{f}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}_c\overrightarrow{f}} \end{aligned} \end{equation} Thus, the spatial filter matrix of CSP, i.e., \begin{equation} \label{Eq:2-27-add} \begin{aligned} \mathbf{F}_{\text{CSP}} = \left[\overrightarrow{f}_{\text{CSP}, 1}, \cdots, \overrightarrow{f}_{\text{CSP}, c}, \cdots, \overrightarrow{f}_{\text{CSP}, C} \right] \in \Re^{C \times C}, \end{aligned} \end{equation} can be extracted via GED($\mathbf{C}_d$,$\mathbf{C}_c$), where $\overrightarrow{f}_{\text{CSP}, c}$ is the $c$-th spatial filter component of the matrix. \subsection{One-step classification} While one-step classification relies strongly on the assumption that the input points are roughly jointly diagonalizable, and hence that the proposed approximation holds, we have shown in practice that this appears to be the case for sufficiently small numbers of filters. What this suggests is that certain underlying sources can be extracted by static spatial filters, while others do not correspond to static eigenvectors of the covariance matrices. If few enough filters are chosen, the resulting classifier is very close to the tangent space function, but as more are added, the approximation quality degrades. This explains the results in Fig.~\ref{Fig_FQ_acc} in which the only classifier whose quality degraded as a function of filter number was the single-step log-variance classifier. Another major benefit to using one-step classification is that it is a better use of training data. Current spatial filtering-based approaches to classifications need to either re-use data for both spatial filter and classifier fitting, or partition training data into disjoint sets, which reduces the quality of both solutions. When the approximation holds, one-step classification is a much more data-efficient solution. \subsection{One-step classification: Computational complexity analysis and simulation results } \begin{figure}[H] \centering \includegraphics[width=\linewidth]{One_two_compare_table} \caption{Theorectical computational complexity analysis and comparison between the examples of one-step and two-step classification in the testing stage. Note: all listed computational complexity are theoretical, and the practical complexity are usually smaller than the list value due to the adoption of specific algorithm. For instance, the matrix multiplication complexity is theoretically equal to $O(C^3)$ but usually between $O(C^{2.376})$ \cite{coppersmith1990matrix} and $O(C^3)$ in practice.} \label{Fig_Complexity} \end{figure} Considering that one major critique of Riemannian methods in online practice is their inability to scale to high numbers of channels, the computational complexity comparisons between the one-step classification framework and the full Riemannian tangent space method are provided from both the perspectives of theoretical analysis and simulation results. \begin{figure}[htb!] \centering \includegraphics[width=\linewidth]{Time.pdf} \caption{Comparison of classification accuracy and running time in the testing stage for three pipelines: \textit{CSP}, \textit{TSSF\_Var\_1\_step} and \textit{TS\_AIRM}. The values for both accuracy and time are with the format of the mean $\pm$ the standard deviation, which is computed across all sessions within each data set. The comparisons with the largest contrast are noted as bold. The above numbers are obtained from computers with 64GB RAM and an 8-core CPU.} \label{Fig_Time} \end{figure} For a better understanding of simulation results, we first start with the theoretical analysis. As seen from Fig.~\ref{Fig_Complexity}, standard Riemannian methods require operations with a computational complexity of either $O(C^3)$ or $O(\frac{C(C+1)}{2})$. For high numbers of channels, this can be difficult to do for real-time feedback, and to verify that we ran a theoretical runtime analysis using the \textit{Munich Motor Imagery} data set, as it has over 100 channels. The simulation results are shown in Fig.~\ref{Fig_Time}. As seen from these results, standard Riemannian methods are slower than both CSP and TSSF based methods. In particular, the full Riemannian methods is 25 times slower than TSSF based methods with similar performance when observing the results from the data set with 128 channels. As for the accuracy comparison, the superiority of TSSF based methods is already validated, as shown in Fig.~\ref{Fig_CSP_pvalues} in which \textit{TSSF\_Var\_1\_step} has an overall significantly better classification performance than \textit{CSP} when using four or six filters. In summary, by adopting the one-classification, it is no longer impossible to enjoy the robustness and excellent performance of Riemannian methods in an online BCI system with high-dimensional data. One additional advantage is that, by employing fewer features, the model suffers less risk from overfitting. \subsection{How robust is spatial filter order to artifacts?} \label{discuss_artifacts} Another important aspect of our work is the observation that this procedure allows one to easily validate the relevance of the features that a Riemannian classifier is using. By visualizing the spatial filters, it is easy to ensure that artifactual sources are not included in the classifier, which is of crucial importance when a BCI is used for neurofeedback. As shown in Fig.~\ref{Fig_AD_pat}, in which only two filters are applied, the TSSF based methods are clearly better than CSP based, especially for S1, S2, S7, S8, S9, and S10. Correspondingly, we can notice that for these subjects, the patterns based on CSP look much more patchy than TSSF based. As for the subjects that both methods have tied performance, i.e., S4 and S6, their spatial patterns seem almost identical to each other. \begin{figure*}[h!] \centering \includegraphics[width=.9\linewidth]{pat_acc.pdf} \caption{The classification accuracy and the associated spatial patterns of data set \textit{Munich Motor Imagery} when applying the first two spatial filters for all subjects.} \label{Fig_AD_pat} \end{figure*} \begin{figure*}[h!] \centering \begin{subfigure}{.9\linewidth} \includegraphics[width=\linewidth]{CSP_10_vertical.pdf} \caption{\centering Spatial patterns from CSP} \label{Fig_AD_10_pat_CSP} \end{subfigure} \begin{subfigure}{.9\linewidth} \includegraphics[width=\linewidth]{TSSF_10_vertical.pdf} \caption{\centering Spatial patterns from TSSF} \label{Fig_AD_10_pat_TSSF} \end{subfigure} \caption{The associated spatial patterns of data set \textit{Munich Motor Imagery} when applying the first ten spatial filters for S2 and S4. The major conclusion drawn from these two figures is that the TSSF based patterns present a better ordering comparing to the CSP which means the CSP tends to be affected by artifacts.} \label{Fig_AD_10_pat} \end{figure*} We would, however, like to better understand where and how components that are not brain-related enter the spatial filters in these two methods. Therefore, we increase the filter number to ten and compare the spatial patterns from two contrasting subjects in order to verify how the methods are robust to artifacts. The chosen subjects are S2 and S4 because as described in \cite{grosse2009beamforming}, they reflect two extremes of artifact contamination. In S2 55$\%$ of all trials are contaminated by artifacts while only 6.3$\%$ of all trials are affected by artifacts for S4. Therefore, their associated patterns are as shown in Fig.~\ref{Fig_AD_10_pat}. Observing the Fig.~\ref{Fig_AD_10_pat}, S2 Comp 0 and S2 Comp 1 of the spatial pattern of TSSF seems similar to S2 Comp 4 and S2 Comp 6 of CSP. As for the rest CSP patterns of S2, most of them appear to be artifacts while for TSSF patterns of S2, only Comp 8 and Comp 9 look slightly patchy while the rest of the patterns show strong activity around the sensorimotor cortex. Moreover, in S4's patterns, from Comp 0 to Comp 6, the results of CSP and TSSF reflect similar neuronal sources with a slightly different order. However, when looking at the last three patterns of both filters, artifactual sources appear. Overall, the ordering in TSSF is much more informative than that in CSP, although in very low artifact scenarios they are similar. Therefore, we would like to conclude that the associated spatial patterns reflect more neurophysiologically explainable neural sources in TSSF. In contrast, CSP often gets distracted by artifacts, especially when processing data suffering plenty of contamination, e.g., S2 of data set \textit{Munich Motor Imagery}. When considering CSP as a simplified LDA based TSSF, this susceptibility to noise directions makes much more sense. When considering the patterns from the low-artifact subject S4, the patterns from both spatial filtering methods are almost identical with each other, in particular for the first several patterns. \subsection{How many filters lead to optimal performance?} By enlarging the feature space, classification accuracy only increases when useful information is encoded within the additional features. For the case of spatial filtering, the most informative features are usually from the first several spatial filters and afterward, the features are no longer as informative as before, as indicated by the spatial patterns shown in Fig.~\ref{Fig_AD_10_pat}. Therefore, when applying only a few spatial filters, there always exists a positive relationship between the performance and number of applied filters. However, this positive relationship turns into a plateau when further increasing the filter numbers because the additional features are no longer as informative as before, and can even turn negative in cases of overfitting. This initial positive relationship and the subsequent plateau always raises the question of the optimal number of spatial filters, as the optimal scenario for applying spatial filtering techniques is to use the least number of filters to achieve a given level of performance. We argue that TSSF reliably requires less spatial filters than CSP in order to achieve the same level of performance. The arguments are three-fold: First, CSP usually needs more filters than TSSF to reach the plateau in classification accuracy. For instance, as described in Fig.~\ref{Fig_FQ_acc}, TSSF based methods merely require 3 or 4 filters to reach 95\% of its best performance while CSP needs at least 20 components to reach the same level. Although in other datasets, the comparison is not as evident as in \textit{Munich Motor Imagery}, it is still clear that TSSF based methods converge faster as shown in Appendix \ref{all_ds_acc}. Second, the optimal minimum filter number for TSSF appears to be independent of the number of channels in the dataset, possibly reflecting a true biological set of sources conserved across all the data. For all seven datasets, after using six filters or even less, TSSF already reaches the level of its best performance, while for CSP, this number varies from 6 to 20 and shows a roughly positive correlation with the number of channels. Last but not the least, as the figures in Appendix \ref{all_ds_acc} indicate, the best classification performance of the TSSF methods is higher than of the CSP, and so even a suboptimal number of filters can compare with it. For a given task, the truly activated neural area should be conserved across subjects and datasets as indicated by the neurophysiological knowledge, and so it is likely that TSSF more reliably extracts the neurophysiological signals independent of variables like setup and channel number. More specifically speaking, as shown in Fig.~\ref{Fig_AD_10_pat}, the associated spatial patterns when using ten filters of both methods looks pretty similar when processing high-quality data (only 6.3\% trials are contaminated for S4). However, for S2 in which 55\% trials are contaminated, CSP ranks the two most important neural sources as the fifth and seventh components, while TSSF ranks them at the top two components. % From a machine learning point of view, this result is unsurprising if one considers CSP to be a simplified LDA, which does not take second-order information into account, and that our TSSF is done using an SVM in the original tangent space. However, what is surprising is the conservation of the number of necessary sources across the various datasets -- an SVM is sparse in terms of the number of support vectors it uses to build its projection, but these support vectors live in the tangent space. There is no obvious reason that the spatial filters derived from them should also be only informative in 6 out of 128 dimensions. \subsection{The origin of the robustness and discriminability of Riemannian methods} \label{robustness} As shown in Appendix \ref{all_ds_acc}, for all datasets, the accuracies of log-variance based methods usually first rise until reaching a peak and begin to drop after that as the filter number increases. Practically speaking, this is a confirmation of a well-known fact within spatial filtering: more filters are not always good. When approximating the Riemannian tangent space function, we find a similar trend: with very few filters, it is possible to outperform the full Riemannian tangent space classifier sometimes, as evidenced by Sections \ref{stat_analysis} and Fig.~\ref{Fig_FQ_summary}. However, in contrast to CSP, increasing the number of filters does not degrade performance as visibly. This robustness to the number of filters is yet another benefit of TSSF. We might, however, ask why this particular feature exists. Intuitively, in the sense of accuracy, the superiority of covariance-based features should be thanks to the cross-channel covariances. This argument is indeed correct; however, not in the usual way. We normally expect cross-channel power terms to contribute significantly to the decision function on the tangent space such that the Riemannian methods are rather robust. However, this intuitive inference cannot explain the success of diagonal elements-based TSSF features, i.e., \textit{TSSF\_Cov\_1\_step}, \textit{TSSF\_Var\_1\_step} and \textit{TSSF\_Var\_2\_step}, which support the hypothesis that the off-diagonal terms (correlations between spatially filtered signals) are neglectable in comparison with the diagonal entries. After excluding the possibility that off-diagonal terms influence the robustness through direct contribution to the decision function, we might ask how they affect the matrix logarithm operation. Luckily, this can be investigated via comparing the accuracies from \textit{TS\_Cov\_2\_step}, \textit{TS\_Cov\_1\_step} and \textit{TS\_Var\_1\_step}. We begin by reviewing the three compared feature spaces: \begin{enumerate} \item \textit{TS\_Cov\_2\_step}: $\text{vec}\left(\text{Logm}_{\widetilde{\mathbf{C}}^{m}_{\perp \mathbf{F}}}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}}) \right) \in \Re^{\frac{C(C+1)}{2} \times 1} $ \\ \item \textit{TS\_Cov\_1\_step}: $\text{diag} \left( \text{Logm}_{\mathbf{I}}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) \in \Re^{C \times 1} $ \\ \item \textit{TS\_Var\_1\_step}: $ \text{log} \left( \text{diag}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right)\in \Re^{C \times 1} $ \end{enumerate} where $t = 1, 2, \cdots, T.$ By observing the Fig.~\ref{Fig_FQ_acc} and the figures in Appendix \ref{Fig_acc_allds}, \textit{TS\_Cov\_2\_step} and \textit{TS\_Cov\_1\_step} do not significantly differ in classification accuracy. Although in Fig.~\ref{Fig_acc_allds}c and Fig.~\ref{Fig_acc_allds}d, \textit{TS\_Cov\_2\_step} seems a bit better than \textit{TS\_Cov\_1\_step}, it is still impossible to assert that one pipeline is consistently superior to another, in particular considering the poor data quality of these two datasets. This phenomenon also partly validates our previous claim that the contribution from off-diagonal elements to the decision function is neglectable. When comparing between the accuracy of \textit{TS\_Cov\_1\_step} and \textit{TS\_Var\_1\_step}, the differences arise solely from the distinct way the features are computed, as the linear regression coefficients are both the GED log-eigenvalues in both cases. The discrepancy between $\text{diag} \left( \text{Logm}_{\mathbf{I}}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) $ and $ \text{log} \left( \text{diag}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) $ comes from whether the $\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}}$ is diagonal, i.e., the filtered cross-channel power terms are all with zero or not. If they are, both features are equivalent to each other. If not, $ \text{log} \left( \text{diag}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) $ is the approximation of $\text{diag} \left( \text{Logm}_{\mathbf{I}}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) $ and the approximation error depends on how close the diagonal elements of $\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}}$ are to its eigenvalues. Therefore, combined with the Gershgorin circle theorem \cite{gershgorin1931uber}, we know that the differences in classification accuracy and robustness between the two features are related to the filtered cross-channel power terms. In other words, the smaller the cross-channel power of $\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}}$ are, the more discriminative and robust the log-variance based features $ \text{log} \left( \text{diag}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) $ will be. In conclusion, the off-diagonal terms influence the robustness and discriminability of Riemannian methods via affecting the logarithm operation, instead of via a direct contribution to the decision function. In other words, if the correlations between filtered signals are non-zero, then source power is not equal to the log-variance, because the eigenvectors of $\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}}$ are no longer the standard basis. \subsection{Suggestions for the usage of TSSF} After exhaustively benchmarking the TSSF based methods against conventional algorithms, we provide several suggestions to the reader who would like to use the TSSF method: \begin{enumerate} \item \textit{Use the empirical covariance estimator when possible}: Many Riemannian methods recommend regularized covariance estimators such as the Ledoit-Wolfe estimator. However, since diagonal loading cannot be added during online use (as the spatially filtered variances are used), high regularization runs the risk of degrading the approximation. \item \textit{Choose the Riemannian metric carefully}: Most of the theoretical analysis is based on the assumption that the affine-invariant Riemannian metric is utilized. A similar property remains to be validated for other Riemannian metrics. \item \textit{Choice of features}: as discussed before, there are three types of features to be adopted, $\text{vec}\left(\text{Logm}_{\widetilde{\mathbf{C}}^{m}_{\perp \mathbf{F}}}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}}) \right) $, $\text{diag} \left( \text{Logm}_{\mathbf{I}}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) $ and $ \text{log} \left( \text{diag}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) $. As computational complexity of the feature decreases, the signal to noise ratio is affected negatively. Therefore, the concrete choice of features highly depends on the experimental environment, e.g., number of channels, sufficient computing sources, etc. But based on our experience, $\text{diag} \left( \text{Logm}_{\mathbf{I}}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) $ is a good candidate for a task which demands high accuracy, while $ \text{log} \left( \text{diag}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) $ might be a better choice for a strict real-time requirement. \end{enumerate} \subsection{Future Work} This paper covers the fundamental concept and proof of spatial filtering via the tangent space. However, there are still many interesting directions worthy of being explored later on. We will discuss these possible directions from two levels, the extension of the scientific idea and the extension of these proposed algorithms: \begin{enumerate} \item \textit{Unsupervised dimensionality reduction and multi-class TSSF}: TSSF based methods usually perform rather well with few components, which implies there exists an optimal subspace of low dimensionality where the brain projects. In this paper, this optimal subspace is found in a supervised fashion. Whether we can leverage this idea to find an unsupervised dimensionality reduction will be an interesting open question. Moreover, it will also be fascinating to further investigate whether the TSSF can be applied to multi-class classification considering the potential of TSSF in practical application. \item \textit{TSSF in comodulation manner}: The proposed TSSF is currently extracted in a regression-like manner because it is derived from the inner product between a weight vector and a data vector. Whether we can also leverage continuous information encoded within the target variables, just like the source power comodulation (SPoC) method \cite{dahne2014spoc}, will also be very worthwhile to explore. \item \textit{Other choices of the first classifier}: Although the SVM based TSSF methods have indeed achieved a satisfying performance as presented in this paper, no matter from the perspective of classification accuracy or the interpretability, we will not assert that regularized SVM represents a global optimum. On the contrary, it will be very interesting to explore the influence brought by the selection of the classification algorithm on the tangent space. \item \textit{Multiple frequency bands}: In this paper, the features are extracted from the joint $\mu$ and $\beta$ band, i.e., from 8Hz to 32Hz. Hence, it remains a mystery whether the ampler information induced by the filter bank TSSF will outperform current TSSF based methods, just like the enhancement of filter bank CSP \cite{ang2008filter} comparing to CSP. \end{enumerate} \subsection{The Approximation of Standard Riemannian Methods via Spatial Filtering} \label{approx_def} For the tangent space based Riemannian methods, the decision function (or decision boundary) on the tangent space completely determines the classification accuracy, because the predicted labels are entirely based on the output of decision function. In order to unify spatial filtering and tangent space-based methods, one option is to attempt to find filters that can preserve this function. For simplicity, we consider linear functions in the tangent space: \begin{equation} \label{Eq:2-11} \begin{aligned} \hat{y}_t =\overrightarrow{w} ^{\mkern-1.5mu\mathsf{T}} \overrightarrow{s^t}\in \Re^{1 \times 1}, \hskip 0.1cm \forall t = 1, ..., T, \end{aligned} \end{equation} where $\overrightarrow{w}$ is the weight vector on the tangent space and $\hat{y}_t $ represents the predicted label from the decision function for $t$-th trial. One thing that should be noted is that as a constant value, the bias term can be ignored in the above equation since the later proof of equivalence still hold if adding same bias to both sides. Moreover, based on the definition and property of AIRM \cite{pennec2006riemannian}, the inner product on the tangent space can be expressed as the function of manifold points as derived below: \begin{equation} \label{Eq:2-12} \begin{aligned} \hat{y}_t &= \overrightarrow{w} ^{\mkern-1.5mu\mathsf{T}} \overrightarrow{s^t} \\ &=<\mathbf{S}^w, \mathbf{S}^t>\mid_{\mathbf{C}^m} \\ &= <\text{Logm}_{\mathbf{C}^m}(\mathbf{C}^w), \text{Logm}_{\mathbf{C}^m}(\mathbf{C}^t) >\mid_{\mathbf{C}^m}, \hskip 0.1cm \forall t = 1, ..., T, \end{aligned} \end{equation} where $\mathbf{S}^w$ is defined as the weight covariance matrix generated via the reshaping of the tangent space weight vector $\overrightarrow{w}$ into a symmetric matrix, and $\mathbf{C}^w$ is the weight covariance matrix re-projected onto the manifold via the exponential map $\text{Expm}_{\mathbf{C}^m}\left( \mathbf{S}^w \right) $. In addition, we use $(\cdot)\mid_{\mathbf{C}_{\text{ref}}}$ to represent the variable lying on the tangent space which is computed based on the reference point $\mathbf{C}_{\text{ref}}$ and the operation $<\mathbf{S}_1, \mathbf{S}_2>\mid_{\mathbf{C}_{\text{ref}}} $ is defined in below lemma: \textbf{\textit{Lemma 1: Inner products between tangent vectors are invariant to affine transformation}} \begin{equation} \begin{aligned} \label{Eq:Lemma-0-maintext} <\mathbf{S}_1, \mathbf{S}_2>\mid_{\mathbf{C}_{\text{ref}}} &=<\mathbf{C}_{\text{ref}}^{-\frac{1}{2}}\mathbf{S}_1\mathbf{C}_{\text{ref}}^{-\frac{1}{2}}, \mathbf{C}_{\text{ref}}^{-\frac{1}{2}}\mathbf{S}_2\mathbf{C}_{\text{ref}}^{-\frac{1}{2}}>\mid_{\mathbf{I}}\\ &=\Tr{\mathbf{C}_{\text{ref}}^{-\frac{1}{2}}\mathbf{S}_1\mathbf{C}_{\text{ref}}^{-\frac{1}{2}} \cdot \mathbf{C}_{\text{ref}}^{-\frac{1}{2}}\mathbf{S}_2\mathbf{C}_{\text{ref}}^{-\frac{1}{2}}}, \\ \end{aligned} \end{equation} where $\mathbf{S}_1$, $\mathbf{S}_2$ are two matrix-formatted tangent vectors on the tangent space computed at reference point $\mathbf{C}_{\text{ref}}$. For a full proof please refer to Appendix {\ref{GED_approx_lemma1}}. Similarly, the approximated predicted labels from all the manifold points which are passed through a spatial filtering matrix $\mathbf{F}$ are as expressed below: \begin{equation} \label{Eq:2-13} \begin{aligned} y_t^{\text{approx}}\mid_{\mathbf{F}} &= <\widetilde{\mathbf{S}}^w_{\perp \mathbf{F}}, \widetilde{\mathbf{S}}^t_{\perp \mathbf{F}} >\mid_{\widetilde{\mathbf{C}}^m_{\perp \mathbf{F}}} \\ &= < \text{Logm}_{\widetilde{\mathbf{C}}^{m}_{\perp \mathbf{F}} } (\widetilde{\mathbf{C}}^w_{\perp \mathbf{F}}), \text{Logm}_{\widetilde{\mathbf{C}}^{m}_{\perp \mathbf{F}}}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})>\mid_{\widetilde{\mathbf{C}}^m_{\perp \mathbf{F}}} \\ &= < \text{Logm}_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}} (\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^w\mathbf{F}), \\ &\text{\hspace{0.75cm}}\text{Logm}_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}}(\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^t\mathbf{F})>\mid_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}}, \\ \end{aligned} \end{equation} where $y_t^{\text{approx}}\mid_{\mathbf{F}}$ is denoted as $y_t^{\text{approx}}$ thereafter for the convenience of notation and $\widetilde{(\cdot)}_{\perp \mathbf{F}} $ represents the matrix after filtering, e.g., $\widetilde{\mathbf{A}}_{\perp \mathbf{F}} = \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{A}\mathbf{F}$. Note that a property of the AIRM is that, for full-rank filtering matrices $\mathbf{F}$, the Fr\'{e}chet mean of the filtered matrices is the filtered mean of the original matrices, i.e. $\widetilde{\mathbf{C}}^{m}_{\perp \mathbf{F}}= \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F} $. After explicitly formulating the true and approximated decision function, the next problem remained to resolve is the extraction of the spatial filter matrix $\mathbf{F}$. The optimal scenario from the perspective of consequence is that this spatial filter matrix $\mathbf{F}$ can perfectly reconstruct the decision function. Hence, in the next subsection, we provide mathematically rigorous derivation and proof to find the optimal solution of $\mathbf{F}$. \subsection{Optimal Spatial Filter Extraction from the Tangent Space} \label{sec_TSSF} Naively, the goal of spatial filter extraction is to find a filtering matrix that maximally reconstructs the tangent space function, which is shown as follows: \begin{equation} \label{Eq:2-14} \begin{aligned} \mathbf{F}_K^{\ast} = \underset{ \mathbf{F}_K \in \Re^{N \times K}}{\arg \min} \sum^T(\hat{y}_t- y_t^{\text{approx}}\mid_{\mathbf{F}_K} )^2, \end{aligned} \end{equation} where $\mathbf{F}_K^{\ast}$ is the optimal filter matrix composed of $K$ spatial filter components from full filter matrix $\mathbf{F}$. After substituting $\hat{y}_t$ (Eq.~(\ref{Eq:2-12})) and $y_t^{\text{approx}}$ (Eq.~(\ref{Eq:2-13})) into Eq.~(\ref{Eq:2-14}), the objective function of the optimization becomes rather complicated and intractable, even if the cost function in Eq.~(\ref{Eq:2-14}) is only the squared loss. Clearly, the major obstacle for solving this optimization problem lies in the complex formulation of $y_t^{\text{approx}}\mid_{\mathbf{F}_K} $. Considering that $\mathbf{F}_K$ is a subset of $\mathbf{F}$, we first focus on the structure of $y_t^{\text{approx}}$ to see whether it can be simplified in the case that $\mathbf{F}_K$ is full rank. By leveraging \textit{lemma 1}, $y_t^{\text{approx}}$ is solved by substituting \begin{equation} \label{Eq:Lemma-0-subs} \begin{aligned} \mathbf{S}_1 &= \text{Logm}_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}} (\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^w\mathbf{F}) \\ \mathbf{S}_2 &= \text{Logm}_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}} (\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^t\mathbf{F}), \forall t \in \left[1, 2, \cdots, T \right] \\ \mathbf{C}_{\text{ref}} &= \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F} \end{aligned} \end{equation} into \textit{lemma 1} and we can obtain: \begin{equation} \begin{aligned} \label{Eq:Lemma-0-full_substitution} y_t^{\text{approx}} &= < \text{Logm}_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}} (\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^w\mathbf{F}), \text{Logm}_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}}(\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^t\mathbf{F})>\mid_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}} \\ &= \text{Tr} \left( \left( \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F} \right) ^{-\frac{1}{2}}\text{Logm}_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}} (\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^w\mathbf{F}) \left( \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F} \right) ^{-\frac{1}{2}} \cdot \right. \\ &\text{\hspace{1cm}} \left. \left( \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F} \right) ^{-\frac{1}{2}}\text{Logm}_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}} (\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^w\mathbf{F}) \left( \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^t\mathbf{F} \right) ^{-\frac{1}{2}} \right) \\ \end{aligned} \end{equation} After explicitly presenting the solution of $y_t^{\text{approx}}$, it seems rather sophisticated to compute $y_t^{\text{approx}}$. However, we can also notice that in the substitution of Eq.~(\ref{Eq:Lemma-0-subs}), $\mathbf{S}_1$ and $\mathbf{C}_{\text{ref}}$ are constant once a tangent space function is found. Furthermore, if $\mathbf{C}^m$ and $\mathbf{C}^w$ can be jointly diagonalized by a properly chosen $\mathbf{F}$, the matrix multiplications in Eq.~(\ref{Eq:Lemma-0-full_substitution}) will be remarkably simplified, and an eigenvalue decomposition is no longer needed to compute $\mathbf{C}_{\text{ref}}^{-\frac{1}{2}}$, i.e., $ \left( \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^t\mathbf{F} \right) ^{-\frac{1}{2}} $, for test points. If the spatial filters $\mathbf{F}$ are extracted in such a manner, then $y_t^{\text{approx}}$ (Eq.~(\ref{Eq:2-13})) are simplified as: \begin{equation} \label{Eq:2-16} \begin{aligned} y_t^{\text{approx}} &= < \text{Logm}_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}} (\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^w\mathbf{F}), \\ &\text{\hspace{0.75cm}}\text{Logm}_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}}(\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^t\mathbf{F})>\mid_{\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F}} \\ &= < \text{Logm}_{\mathbf{D}^m} (\mathbf{D}^w), \text{Logm}_{\mathbf{D}^m}(\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^t\mathbf{F})>\mid_{\mathbf{D}^m}, \\ \end{aligned} \end{equation} where $\mathbf{D}^m$ is adopted to represent the filtered reference point, which is now diagonal, and $\mathbf{D}^w$ is the filtered weight matrix. In addition, if we can further whiten the filtered reference point, i.e., $ \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F} = \mathbf{D}^m \Rightarrow \mathbf{I}$, then we can not only simplify $\Tr{ \mathbf{C}_{\text{ref}}^{-\frac{1}{2}} \mathbf{S}_1 \mathbf{C}_{\text{ref}}^{-\frac{1}{2}} \cdot \mathbf{C}_{\text{ref}}^{-\frac{1}{2}} \mathbf{S}_2 \mathbf{C}_{\text{ref}}^{-\frac{1}{2}} }$ to $\Tr{ \mathbf{S}_1 \mathbf{S}_2}$, but also the logarithmic map: $ \text{Logm}_{\mathbf{D}^m} (\mathbf{D}^w) \Rightarrow \text{Logm} (\mathbf{D}^w)$. Therefore, by properly choosing $\mathbf{F}$, $y_t^{\text{approx}}$ can be simplified as: \begin{equation} \label{Eq:2-16-b} \begin{aligned} y_t^{\text{approx}} &= < \text{Logm}_{\mathbf{D}^m} (\mathbf{D}^w), \text{Logm}_{\mathbf{D}^m}(\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^t\mathbf{F})>\mid_{\mathbf{D}^m} \\ &= < \text{Logm}_{\mathbf{I}} (\mathbf{D}^w), \text{Logm}_{\mathbf{I}}(\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^t\mathbf{F})>\mid_{\mathbf{I}} \\ &= \Tr{ \text{Logm}_{\mathbf{I}} ( \mathbf{D}^w) \text{Logm}_{\mathbf{I}} ( \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{t}\mathbf{F}) } \\ &= \Tr{ \text{Logm}( \mathbf{D}^w) \text{Logm} (\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{t}\mathbf{F}) } \\ \end{aligned} \end{equation} From here, we make one major assumption that the filtering matrix $\mathbf{F}$ approximately diagonalizes all $\mathbf{C}^t$. If this assumption holds , i.e., $\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{t}\mathbf{F} $ is a diagonally dominant matrix for all $t$, based on the Gershgorin circle theorem \cite{gershgorin1931uber} we know that \begin{equation} \label{Eq:2-16-c} \begin{aligned} \lambda\left( \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{t}\mathbf{F} \right) \approx \text{diag}\left( \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{t}\mathbf{F} \right) = \mathbf{D}^t, \end{aligned} \end{equation} where $\mathbf{D}^t$ represents the diagonal matrix which only contains the diagonal elements of $ \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{t}\mathbf{F}$. Moreover, since $\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{t}\mathbf{F}$ is diagonally dominant, then following approximation can be inferred: \begin{equation} \label{Eq:2-16-c-ii} \begin{aligned} \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{t}\mathbf{F} \overset{}{\approx} \mathbf{D}^t \end{aligned} \end{equation} Therefore, we know: \begin{equation} \label{Eq:2-16-d} \begin{aligned} \text{Logm} (\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{t}\mathbf{F}) \approx \text{Logm} ( \mathbf{D}^t ) \end{aligned} \end{equation} After applying the approximation in Eq.~(\ref{Eq:2-16-d}) into Eq.~(\ref{Eq:2-16-b}), $y_t^{\text{approx}}$ can be simplified as: \begin{equation} \label{Eq:2-16-e} \begin{aligned} y_t^{\text{approx}} &= \Tr{ \text{Logm}( \mathbf{D}^w) \text{Logm} (\mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{t}\mathbf{F}) } \\ &\approx \Tr{ \text{Logm}( \mathbf{D}^w) \text{Logm} (\mathbf{D}^t )} \\ &= \text{log}( \overrightarrow{d^w})^T\text{log}( \overrightarrow{d^t}), \\ \end{aligned} \end{equation} where $\overrightarrow{d_{(\cdot)}}$ represents the diagonal vector of $\mathbf{D}_{(\cdot)}$. We reiterate that one primary assumption in the above simplification is that all $\mathbf{C}^t$ are roughly jointly diagonal, which is a very strong assumption. However, there is evidence for this in the fact that the projection of the physiological sources in the EEG signal to the electrodes is linear: Since the head moves very little with respect to the electrodes within a session, we can assume that the mixing (and hence unmixing) matrices stay relatively constant, even if the actual variances are non-stationary. The key step that enables the simplification from $y_t^{\text{approx}} = <\widetilde{\mathbf{S}}^w_{\perp \mathbf{F}}, \widetilde{\mathbf{S}}^t_{\perp \mathbf{F}} >\mid_{\widetilde{\mathbf{C}}^m_{\perp \mathbf{F}}} $ to $y_t^{\text{approx}} = \text{log}( \overrightarrow{d^w})^{\mkern-1.5mu\mathsf{T}}\text{log}( \overrightarrow{d^t})$ is the simultaneous diagonalization of the weight covariance matrix and the whitening of $\mathbf{C}^{m}$. The generalized eigenvalue decomposition (GED) conveniently solves both goals: \begin{equation} \mathbf{C}^w\mathbf{F} = \mathbf{C}^{m}\mathbf{F} \mathbf{D} \Leftrightarrow \left\{ \begin{array}{l} \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{m}\mathbf{F} = \mathbf{I}\\ \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^w\mathbf{F} = \mathbf{D} \end{array} \right. , \label{Eq:2-17} \end{equation} where the $\mathbf{F}$ is named as tangent space spatial filter (TSSF) and $\mathbf{D}$ is the corresponding eigenvalues. Importantly, to ensure that Eq.~(\ref{Eq:2-17}) will hold, the order of $\mathbf{C}^{m}$ and $\mathbf{C}^{w}$ in the GED equation cannot be switched. Now, since $y_t^{\text{approx}}$ can be drastically simplified as long as $\mathbf{F}$ are extracted with the GED manner, when looking back to the objective function for extracting optimal filters, i.e., $\mathbf{F}_K^{\ast} = \underset{ \mathbf{F}_K \in \Re^{N \times K}}{\arg \max} \sum^T(\hat{y}_t- y_t^{\text{approx}}\mid_{\mathbf{F}_K} )^2 $, the last remaining obstacle is the true predicted label $\hat{y}_t$. We next prove that the equivalence between $\hat{y}_t$ and $y_t^{\text{approx}}$ will hold under some conditions, as seen in \textit{theorem 1}. \textbf{\textit{Theorem 1: Equivalence between true and approximated decision function}} \begin{equation} \label{Eq:theorem-1} \begin{aligned} \hat{y}_t \equiv y_t^{\text{approx}}, &\text{ iff $\mathbf{F}$ is extacted via GED($ \mathbf{C}^w$, $ \mathbf{C}^m$)} \\ &\text{ and full rank.} \end{aligned} \end{equation} \textbf{\textit{Proof:}} For convenience, we first list some properties of linear algebra in the tangent space that will be convenient in the proof. All properties are proved in Appendix \ref{Appendix A}. \begin{enumerate} \label{List_prev} \item $\mathbf{F}, \mathbf{D} = \text{GED}(\mathbf{C}^w, \mathbf{C}^m) = \text{ED}(\mathbf{C}^{-m} \mathbf{C}^w)$, where $\mathbf{F}^{\mkern-1.5mu\mathsf{T}} \mathbf{F} \neq \mathbf{I}$ \item $\mathbf{V}, \mathbf{D} = \text{ED}( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^w \mathbf{C}^{-\frac{m}{2}} ) $, where $ \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V} = \mathbf{I}$ \item $\mathbf{V} = \mathbf{C}^{\frac{m}{2}} \mathbf{F} \Rightarrow \mathbf{F}^{\mkern-1.5mu\mathsf{T}} \mathbf{C}^{m}\mathbf{F} = \mathbf{I}$ \end{enumerate} Furthermore, we would like to quote one significant lemma in which the following equivalence holds based on the property of affine-invariance Riemannian metric. The corresponding proof is shown in Appendix {\ref{GED_approx_lemma2}}. \textbf{\textit{Lemma 2: Equivalence of logarithm mapping}} \begin{equation} \begin{aligned} \label{Eq:appendix-B-Lemma-1} \text{Logm}(\mathbf{V}^{\mkern-1.5mu\mathsf{T}}\mathbf{A}\mathbf{V}) = \mathbf{V}^{\mkern-1.5mu\mathsf{T}}\text{Logm}(\mathbf{A})\mathbf{V} \\ \text{, iff } \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V} = \mathbf{I} \text{ and $\mathbf{A}$ is SPD.} \end{aligned} \end{equation} Since spatial filter $ \mathbf{F}$ and the eigenvalue matrix $ \mathbf{D}$ are extracted via the GED($ \mathbf{C}^w$, $ \mathbf{C}^m$), we have: \begin{equation} \label{Eq:appendix-B-2} \begin{aligned} &\widetilde{\mathbf{C}}^m_{\perp \mathbf{F}} = \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^m\mathbf{F} = \mathbf{I}\\ &\widetilde{\mathbf{C}}^w_{\perp \mathbf{F}} = \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^w\mathbf{F} = \mathbf{D}\\ \end{aligned} \end{equation} On the one hand, Eq.~(\ref{Eq:2-16}) and (\ref{Eq:2-16-b}) show that the approximated decision function can be reformulated as: \begin{equation} \label{Eq:appendix-B-3} \begin{aligned} y_t^{\text{approx}} = \Tr{ \text{Logm} ( \mathbf{D}) \text{Logm} ( \mathbf{F}^{\mkern-1.5mu\mathsf{T}}\mathbf{C}^{t}\mathbf{F} ) } \end{aligned} \end{equation} On the other hand, based on the previous proved and quoted lemmas as well as the definitions, the true decision function can be expressed as: \begin{equation} \label{Eq:appendix-B-4} \begin{aligned} \hat{y}_t &= <\mathbf{S}^w, \mathbf{S}^t>\mid_{\mathbf{C}^m} \\ &\overset{\text{Lemma } 1}{=} <\mathbf{C}^{-\frac{m}{2}}\mathbf{S}^w\mathbf{C}^{-\frac{m}{2}}, \mathbf{C}^{-\frac{m}{2}}\mathbf{S}^t\mathbf{C}^{-\frac{m}{2}}>\mid_{\mathbf{I}} \\ &= \Tr{\mathbf{C}^{-\frac{m}{2}}\mathbf{S}^w\mathbf{C}^{-\frac{m}{2}} \cdot \mathbf{C}^{-\frac{m}{2}}\mathbf{S}^t\mathbf{C}^{-\frac{m}{2}}}\\ &\overset{\text{Eq.~(\ref{Eq:2-8})}}{=} \text{Tr}\left( \mathbf{C}^{-\frac{m}{2}}\left(\text{Logm}_{\mathbf{C}^m}(\mathbf{C}^w) \right) \mathbf{C}^{-\frac{m}{2}} \cdot \right. \\ & \text{\hspace{0.8cm} }\left.\mathbf{C}^{-\frac{m}{2}}\left(\text{Logm}_{\mathbf{C}^m}(\mathbf{C}^t) \right) \mathbf{C}^{-\frac{m}{2}} \right) \\ &\overset{\text{Eq.~(\ref{Eq:2-3})}}{=} \text{Tr}\left( \mathbf{C}^{-\frac{m}{2}}\left(\mathbf{C}^{+\frac{m}{2}} \text{Logm}\left( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{w} \mathbf{C}^{-\frac{m}{2}}\right) \mathbf{C}^{+\frac{m}{2}} \right) \mathbf{C}^{-\frac{m}{2}} \cdot \right. \\ & \text{\hspace{0.8cm} }\left.\mathbf{C}^{-\frac{m}{2}}\left(\mathbf{C}^{+\frac{m}{2}} \text{Logm}\left( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{t} \mathbf{C}^{-\frac{m}{2}}\right) \mathbf{C}^{+\frac{m}{2}} \right) \mathbf{C}^{-\frac{m}{2}} \right) \\ &= \text{Tr}\left(\text{Logm}\left( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{w} \mathbf{C}^{-\frac{m}{2}}\right) \cdot \text{Logm}\left( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{t} \mathbf{C}^{-\frac{m}{2}}\right) \right) \\ \end{aligned} \end{equation} As indicated by point 2) of the list at the beginning of this proof (refer as List 2. in the following context), we know that $\mathbf{V}, \mathbf{D} = \text{ED}( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^w \mathbf{C}^{-\frac{m}{2}} ) $, where $ \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{V} = \mathbf{I}$. Therefore, the results from Eq.~(\ref{Eq:appendix-B-4}) can be further derived as: \begin{equation} \label{Eq:appendix-B-5} \begin{aligned} \hat{y}_t &= \text{Tr}\left(\text{Logm}\left( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{w} \mathbf{C}^{-\frac{m}{2}}\right) \cdot \text{Logm}\left( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{t} \mathbf{C}^{-\frac{m}{2}}\right) \right) \\ &\overset{\text{List } 2).}{=} \text{Tr}\left(\text{Logm}\left( \mathbf{V}\mathbf{D}\mathbf{V}^{\mkern-1.5mu\mathsf{T}}\right) \cdot \text{Logm}\left( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{t} \mathbf{C}^{-\frac{m}{2}}\right) \right) \\ &\overset{\text{Lemma } 2}{=} \text{Tr}\left( \mathbf{V} \text{Logm}\left(\mathbf{D}\right) \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \cdot \text{Logm}\left( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{t} \mathbf{C}^{-\frac{m}{2}}\right) \right) \\ &\underset{\text{invariant}}{\overset{\text{Trace cyclic}}{=}} \text{Tr}\left( \text{Logm}\left(\mathbf{D}\right)\cdot \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \text{Logm}\left( \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{t} \mathbf{C}^{-\frac{m}{2}}\right) \mathbf{V} \right) \\ &\overset{\text{Lemma } 2}{=} \text{Tr}\left( \text{Logm}\left(\mathbf{D}\right)\cdot \text{Logm}\left( \mathbf{V}^{\mkern-1.5mu\mathsf{T}} \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{t} \mathbf{C}^{-\frac{m}{2}} \mathbf{V} \right) \right) \\ &\overset{\text{List } 3).}{=} \text{Tr}\left( \text{Logm}\left(\mathbf{D}\right)\cdot \right. \\ &\text{\hspace{1.4cm}} \left. \text{Logm}\left( \left( \mathbf{C}^{+\frac{m}{2}} \mathbf{F} \right) ^{\mkern-1.5mu\mathsf{T}} \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{t} \mathbf{C}^{-\frac{m}{2}} \left( \mathbf{C}^{+\frac{m}{2}} \mathbf{F} \right)\right) \right) \\ &= \text{Tr}\left( \text{Logm}\left(\mathbf{D}\right)\cdot \text{Logm}\left( \mathbf{F} ^{\mkern-1.5mu\mathsf{T}} \mathbf{C}^{+\frac{m}{2}}\mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{t} \mathbf{C}^{-\frac{m}{2}} \mathbf{C}^{+\frac{m}{2}} \mathbf{F} \right) \right) \\ &= \text{Tr}\left( \text{Logm}\left(\mathbf{D}\right)\cdot \text{Logm}\left( \mathbf{F} ^{\mkern-1.5mu\mathsf{T}} \mathbf{C}^{t} \mathbf{F} \right) \right) \\ &= y_t^{\text{approx}} \end{aligned} \end{equation} Therefore, as a summary, $\hat{y}_t \equiv y_t^{\text{approx}}$, if and only if when $\mathbf{F}$ is extracted via GED($ \mathbf{C}^w$, $ \mathbf{C}^m$) and $\mathbf{F}$ is with full rank. \textbf{Q.E.D} By leveraging this equivalence, the objective function in Eq.~(\ref{Eq:2-14}) can be reformulated as: \begin{equation} \label{Eq:2-15} \begin{aligned} \mathbf{F}_K^{\ast} = \underset{ \mathbf{F}_K \in \Re^{N \times K } }{\arg \min} \sum^T(y_t^{\text{approx}}\mid_{\mathbf{F}}- y_t^{\text{approx}}\mid_{\mathbf{F}_K} )^2 \end{aligned} \end{equation} Since the $\mathbf{F}_K$ is known as the subset of $\mathbf{F}$ which is extracted from the $\text{GED}(\mathbf{C}^w,\mathbf{C}^m)$, the optimization problem in Eq.~(\ref{Eq:2-15}) is then equivalent to the problem of ordering the columns of $\mathbf{F}$. This problem can be tackled by observing the result in Eq.~(\ref{Eq:2-16-e}), which states that as long as the filtered input data $\widetilde{\mathbf{C}}^{t}_{\perp \mathbf{F}}$ is roughly diagonal, the linear functions in the Riemannian tangent space can be approximated by linear functions of the log-variances of the filtered data. More importantly, the coefficients of this approximated linear function are simply the log-eigenvalues after the GED is solved. i.e., $\text{log}( \overrightarrow{d})$. Thus, standard techniques for determining the most important variables in a linear regression problem can be used. For simplicity's sake, we use the absolute values of the regression coefficients as markers of their importance to the function. \paragraph{Intuitive Explanation} One very common and effective technique across domains is whitening data. By decorrelating the different channels, constructed features are often more distinct and predictive. However, whitening has a fundamental flaw, in that there are arbitrarily many whitening matrices that are possible since the covariance of whitened data is invariant to rotations. One explanation for the finding above is that the GED can be decomposed into a whitening transform and a subsequent rotation. The whitening is with respect to the data, and the rotation is chosen based on the weight matrix. Therefore this technique can be considered a particular choice of data whitening that simultaneously preserves the information of a function in the tangent space. \subsection{The Classification based on the TSSF} \label{sec_TSSF_clf} As a feature extraction method, spatial filtering always requires a classifier to deal with the processed features, which often requires an extra optimization step. One method to use the proposed TSSF is like any other feature reduction technique, fitting a classifier after the spatial filtering step. However, another advantage brought by the linear approximation function of TSSF is that this secondary training can be skipped, which means it is possible to further reduce the computational time for TSSF. From Eq.~(\ref{Eq:2-16-e}), we notice that this function is actually a linear regressor using the log-eigenvalues of the GED as the regression weights. Therefore, we can directly input the filtered data into this regressor to obtain the predicted value. This method is named as one-step classification in our paper, and the ordinary way to classify the data is named as two-steps classification, i.e., filtering and classifying. \subsection*{Example 1: Tangent Space Spatial Filter - The Generalization of CSP} \label{example_CSP} As a data-driven spatial filter, it is inevitable to compare the performance of TSSF and CSP, especially considering the great impact of the latter in the BCI field. Instead of merely comparing the performance of both filters, we also prove that CSP is a special case of TSSF. To begin with the proof of their relationship, let us first review the TSSF. The solutions of TSSF are obtained via solving the $\text{GED}(\mathbf{C}^w,\mathbf{C}^m)$ as described in Section \ref{sec_TSSF}. Moreover, the equivalent solution of eigenvectors can also be extracted by solving $\text{GED}(\mathbf{S}^w,\mathbf{C}^m)$, i.e.,: \begin{equation} \label{Eq:2-17-a} \begin{aligned} \mathbf{F}, \mathbf{D} &= \text{GED}(\mathbf{C}^w, \mathbf{C}^m) \\ \mathbf{F}, \text{Logm}\left( \mathbf{D}\right) &= \text{GED}(\mathbf{S}^w, \mathbf{C}^m),\\ \end{aligned} \end{equation} the proof of which can be referred in Section \ref{Appendix A}. Furthermore, when the classifier on the tangent space is specified as the Fisher LDA classifier \cite{bishop2006pattern}, the weight vector on the tangent space is as expressed in Eq.(\ref{Eq:2-18}). The corresponding proof can be found in \cite{bishop2006pattern}. \begin{equation} \label{Eq:2-18} \begin{aligned} \overrightarrow{w}_{\text{LDA}} &= \mathbf{S}_{within}^{-1}( \mathbf{\mu}^{(+)}- \mathbf{\mu}^{(-)}) \\ \mathbf{S}_{within} &= \sum_{a\in\{+, -\} }^{} \sum_{t\in ^{(a)}}^{} \left( \overrightarrow{s^t} - \mathbf{\mu}^{(a)}\right) \left( \overrightarrow{s^t} - \mathbf{\mu}^{(a)}\right)^{\mkern-1.5mu\mathsf{T}}, \end{aligned} \end{equation} where $\mu = \frac{1}{T}\sum_{t=1}^{T} \overrightarrow{s^t} $ and $\mathbf{\mu}^{(a)}, a \in \{+,-\}$ are the within class mean for the tangent vectors and $ \mathbf{S}_{within}$ is the within scatter matrix. Under the special case that the $\mathbf{S}_{within}$ is equal to the identity matrix $\mathbf{I}$, the weight vector of LDA classifier is simplified as: \begin{equation} \label{Eq:2-20} \begin{aligned} \overrightarrow{w}_{\text{LDA}} = \mathbf{\mu}^{(+)}- \mathbf{\mu}^{(-)} \in \Re^{\frac{C\left(C+1 \right) }{2} \times 1} \\ \end{aligned} \end{equation} Based on the reverse operation of $\vt{\cdot}$ (Eq.~(\ref{Eq:2-4})), the equivalent formulation of Eq.~(\ref{Eq:2-20}) in matrix format is: \begin{equation} \label{Eq:2-21} \begin{aligned} \mathbf{S}^{w_{\text{LDA}} } = \overline{\mathbf{S}^{(+)}} - \overline{\mathbf{S}^{(-)}}, \\ \end{aligned} \end{equation} where $\overline{\mathbf{S}^{(\cdot)}}$ is the arithmetic within-class mean for project points on the tangent space. Moreover, assuming the special situation holds in which the between-class Euclidean mean difference of the covariances is the exponential transform of the between-class Euclidean mean difference of tangent space points, i.e., \begin{equation} \label{Eq:2-22} \begin{aligned} \overline{\mathbf{C}^{(+)}} - \overline{\mathbf{C}^{(-)}} = \text{Expm}_{\mathbf{C}^m}\left( \overline{\mathbf{S}^{(+)}} - \overline{\mathbf{S}^{(-)}}\right) \end{aligned} \end{equation} combining the special LDA classifier with the conclusion drawn from equation(\ref{Eq:2-17-a}), the solution of TSSF can be further formulated as: \begin{equation} \label{Eq:2-23} \begin{aligned} \text{GED}(\mathbf{C}^w,\mathbf{C}^m) & \overset{\text{LDA as clf.}}{\Rightarrow} \text{GED}(\mathbf{C}^{w_{\text{LDA}} }, \mathbf{C}^m) \\ &\overset{\text{Eq. (\ref{Eq:2-17-a})}}{=} \text{GED}(\mathbf{S}^{w_{\text{LDA}} }, \mathbf{C}^m) \\ &\overset{\text{Eq. (\ref{Eq:2-21})}}{=} \text{GED}(\overline{\mathbf{S}^{(+)}} - \overline{\mathbf{S}^{(-)}}, \mathbf{C}^m) \\ &\overset{\text{Eq. (\ref{Eq:2-17-a}\& \ref{Eq:2-22})}}{=} \text{GED}(\overline{\mathbf{C}^{(+)}} - \overline{\mathbf{C}^{(-)}}, \mathbf{C}^m) , \\ \end{aligned} \end{equation} where $\text{GED} (\mathbf{A}, \mathbf{B})$ in above equations represents the corresponding eigenvectors, i.e., $\mathbf{V} = \text{GED} (\mathbf{A}, \mathbf{B})$ and $\mathbf{A}\mathbf{V} = \mathbf{B}\mathbf{V}\mathbf{\Gamma}$ ($\mathbf{\Gamma}$ is the matrix of generalized eigenvalues). In addition, if we further replace the Fr\'{e}chet mean $\mathbf{C}^m$ in Eq.~(\ref{Eq:2-23}) with arithmetic mean $\overline{\mathbf{C}^m}$, we will have: \begin{equation} \label{Eq:2-25} \begin{aligned} \text{GED}(\mathbf{C}^w,\mathbf{C}^m) & \overset{\text{Eq. (\ref{Eq:2-23})}}{\Rightarrow} \text{GED}( \overline{\mathbf{C}^{(+)}} - \overline{\mathbf{C}^{(-)}}, \mathbf{C}^m) \\ & \overset{}{\Rightarrow} \text{GED}( \overline{\mathbf{C}^{(+)}} - \overline{\mathbf{C}^{(-)}}, \overline{\mathbf{C}^{m}} ) \\ & \overset{}{\Rightarrow} \text{GED}( \overline{\mathbf{C}^{(+)}} - \overline{\mathbf{C}^{(-)}}, \frac{\overline{\mathbf{C}^{(+)}} + \overline{\mathbf{C}^{(-)}}}{2}) \\ & \underset{\text{invariance}}{ \overset{\text{Scaling }}{\Rightarrow}} \text{GED}( \overline{\mathbf{C}^{(+)}} - \overline{\mathbf{C}^{(-)}},\overline{\mathbf{C}^{(+)}} + \overline{\mathbf{C}^{(-)}}) \\ \end{aligned} \end{equation} By combining the definition of CSP from the discriminative perspective as described in Eq.~(\ref{Eq:2-26}) and the equivalence as shown in Eq.~(\ref{Eq:2-25}), we are able to conclude the relationship between CSP and TSSF as: \begin{equation} \label{Eq:2-28} \begin{aligned} \mathbf{F}_{\text{TSSF}} & \overset{\text{Def.}}{\Rightarrow} \text{GED}(\mathbf{C}^w,\mathbf{C}^m) \\ & \overset{\text{Eq. (\ref{Eq:2-25})}}{\Rightarrow} \text{GED}( \overline{\mathbf{C}^{(+)}} - \overline{\mathbf{C}^{(-)}},\overline{\mathbf{C}^{(+)}} + \overline{\mathbf{C}^{(-)}} ) \\ & \overset{\text{Eq. (\ref{Eq:2-26})}}{\equiv} \text{GED}(\mathbf{C}_d,\mathbf{C}_c) \\ & \overset{\text{Eq. (\ref{Eq:2-27})}}{\Rightarrow} \mathbf{F}_{\text{CSP}} \end{aligned} \end{equation} Namely, CSP is the representation of TSSF when LDA is chosen as the classifier on the tangent space, and the within-class scatter matrix is assumed to be the identity. One important caveat is the exponential relationship of class mean subtraction, as shown in the Eq.~(\ref{Eq:2-23}), which is not necessarily true. % One related work we would like to mention in this example is \cite{Barachant2010_CSP_revisit}, in which Barachant \textit{et al} replaced the arithmetic mean with the Fr\'{e}chet mean in CSP. One crucial component of our equivalence in Section \ref{example_CSP} is the relationship between $\overline{\mathbf{C}^{(\cdot)}}$ and $\overline{\mathbf{S}^{(\cdot)}}$. We assume that they are related by the exponential transform, but that is likely not true if $\overline{\mathbf{C}^{(\cdot)}}$ is computed as the arithmetic mean of the covariance matrices in a given class, due to the swelling effect \cite{arsigny2006log}. Since the Fr\'{e}chet mean is a much better proxy of common activities across trials, the proposed Riemannian CSP is a far better approximation of LDA in the tangent space, and Barachant \textit{et al} also show increased performance and robustness with this alteration. \subsection{Summary of the extraction and application of TSSF} \label{sec:summary} For practitioners interested in using the proposed TSSF framework, we summarize its procedures in this subsection. Generally, the usage of TSSF can be divided into two stages: how to extract spatial filters and how to use the spatially filtered signals for BCIs. Therefore, the corresponding algorithms are introduced below and summarized into pseudocode separately. To link each algorithm's description with its pseudocode, we adopt the abbreviation that A1-1 denotes the Step-1 of Algorithm 1. \subsubsection{Extraction of TSSF} To extract the TSSF, the input data should be bandpass filtered data already epoched into trials, and the choice of the linear model on the tangent space is supposed to be defined beforehand. Subsequently, the covariance matrices are estimated based on the input trialwise EEG signal and their Fr\'{e}chet mean is computed to use as the reference point for the tangent space projection (A1-1 and A1-2). After finding the Fr\'{e}chet mean, all covariance matrices are projected onto the tangent space and vectorized into tangent vectors (A1-3 and A1-4). Afterward, by using these tangent vectors the linear model is trained, the weights are obtained (A1-5) and reshaped into a symmetric matrix, and the equivalent weight covariance matrix on the manifold is computed via the exponential transform (A1-6). Next, the full-rank filter matrix of TSSF, as well as the regression coefficients for one-step classification, are obtained by solving the GED problem (A1-7) and sorting based on the absolute value of the logarithm of the eigenvalues in descending order (A1-8 and A1-9). At last, based on the predefined parameter that how many filter components are needed, the first $K$ components of the full and sorted filter matrix are extracted, and the same is done with the regression coefficients (A1-10). \begin{algorithm}[h!] \SetAlgoLined \KwData{Bandpass filtered trialwise data $\mathbf{X} \in \Re^{C \times N \times T}$, loss function for linear model \textit{L}} \KwResult{TSSF and regression coefficients with K components: \\ \hskip 1.5cm $\mathbf{F}_K \in \Re^{C \times K}, \overrightarrow{\beta}_K \in \Re^{k \times 1}$ } \Begin{ 1. Compute the covariance matrices:\\ $\mathbf{C}^t = \mathbf{X}^t (\mathbf{X}^t) ^{\mkern-1.5mu\mathsf{T}}, \forall t \in [1, \cdots, T]$. 2. Compute the Fr\'{e}chet mean: \\$\mathbf{C}^m =\underset{\mathbf{A} \in \mathbf{C} }{\arg \min} \sum_{t=1}^{T} d_{\text{AIRM}}^2\left( \mathbf{A}, \mathbf{C}^t \right)$ 3. Project onto tangent space:\\ $\mathbf{S}^t= \text{Logm}_{\mathbf{C}^m }\left( \mathbf{C}^t\right)$, $\forall t \in [1, \cdots, T]$ 4. Compute tangent vectors:\\ $\overrightarrow{s^t} = \vt{\mathbf{S}^t}, \forall t \in [1, \cdots, T]$ and $\mathbf{s} = [\overrightarrow{s^1}, \cdots, \overrightarrow{s^T}] \in \Re^{\frac{C(C+1)}{2}\times T}$ 5. Fit linear model:\\ $\overrightarrow{w} = \text{argmin}_{\overrightarrow{w}}L(\mathbf{s}, \overrightarrow{ w })\in \Re^{\frac{C(C+1)}{2} \times 1}$ 6. Project weights onto manifold:\\ $\overrightarrow{w} \overset{\text{unvec}(\cdot) }{\Rightarrow}\mathbf{S}^{w} \overset{\text{Expm}_{\mathbf{C}^m }(\cdot)}{\Rightarrow} \mathbf{C}^{w} \in \Re^{C \times C}$ 7. Solve the Generalized Eigenvalue Decomposition (GED) problem:\\ $\overrightarrow{d},\mathbf{V} = \text{GED} \left(\mathbf{C}^{w}, \mathbf{C}^{m}\right) $ 8. Get the sorted index based on the value of $\overrightarrow{d}$:\\ $\text{inds} = \text{sort}\left( \left| \text{log}(\overrightarrow{d} ) \right| \right) $ 9. Obtain the sorted TSSF and regression coefficients: \\ \hskip 1.5cm $\mathbf{F} = \mathbf{V}[:, \text{inds}] \in \Re^{C \times C}, \overrightarrow{\beta} = \text{log}(\overrightarrow{d}[\text{inds}] ) \in \Re^{C \times 1} $ 10. Extract the first $K$ components:\\ $\mathbf{F}_K = \mathbf{F}[:, :K], \overrightarrow{\beta}_K = \overrightarrow{\beta}[:K]$ } \caption{Extraction of Tangent Space Spatial Filter (TSSF)} \label{Algo-1} \end{algorithm} \subsubsection{Application of TSSF} Once the TSSF are extracted, there are some options regarding how to generate features and use the trained linear model. The first step is to apply the extracted spatial filters onto the trialwise data (A2-1). Subsequently, there are three types of features which can be generated from the filtered data: the log-variance of filtered data (A2-2.a)), the diagonal vector of the logarithm of filtered covariance matrices (A2-2.b)) and the full tangent vector computed based on filtered covariance matrices (A2-2.c)). These three types of features and their descriptions, as well as corresponding abbreviations, are summarized in Table \ref{Feat_table}. \begin{table}[htb!] \centering \begin{tabular}{|c|c|c|} \hline \textbf{Formulation} & \textbf{Description} & \textbf{Abbreviation} \\ \hline $ \text{log} \left( \text{diag}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) $ & Log-variance &Log-var \\ \hline \multirow{2}{*}{$\text{diag} \left( \text{Logm}_{\mathbf{I}}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}})\right) $} & \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Diagonal of logarithm of \\ covariance matrices\end{tabular}} & \multirow{2}{*}{Diag. log-cov} \\ & & \\ \hline \multirow{2}{*}{$\text{vec}\left(\text{Logm}_{\widetilde{\mathbf{C}}^{m}_{\perp \mathbf{F}}}(\widetilde{\mathbf{C}}^t_{\perp \mathbf{F}}) \right) $} & \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Logarithm of covariance\\ matrices\end{tabular}} & \multirow{2}{*}{Log-cov} \\ & & \\ \hline \end{tabular} \caption{Summary of classifiable features} \label{Feat_table} \end{table} After obtaining the classifiable features, the last step is to classify them. As described in Section \ref{sec_TSSF_clf}, two possible classification algorithms can be applied: one-step classification and two-steps classification. One thing that should be noted is that one-step classification can only be applied to the diagonal elements based features, namely features from (A2-2.b)) and (A2-2.c)). For the one-step classification, the inner product between regression coefficients and features are computed, and the label is taken as the sign of the result in binary classification problems. For the two-steps classification, a second classifier is chosen and fitted with the features from the training set (A2-2.b).i)). After that, test data to be classified can be classified by this trained second classifier. \begin{algorithm}[h!] \SetAlgoLined \KwData{Test trialwise data $\mathbf{X} \in \Re^{C \times N \times T}$, Second classifier $\textit{Clf}_2$ if needed} \KwResult{TSSF and regression coefficients: $\mathbf{F}_K \in \Re^{C \times K}, \overrightarrow{\beta}_K \in \Re^{K \times 1}$ } \Begin{ 1. Filter the test data: $\widetilde{\mathbf{X}}_{\perp \mathbf{F}_K} = \mathbf{F}_K^{\mkern-1.5mu\mathsf{T}} \mathbf{X} \in \Re^{K \times N} $ 2. Compute features (several options are provided, only choose one): \hskip 0.5cm a). $ \overrightarrow{e} = \text{log} \left( \text{var} \left( \widetilde{\mathbf{X}}_{\perp \mathbf{F}_K} \right) \right) \in \Re^{K \times 1}$ \hskip 0.5cm b). $\widetilde{\mathbf{X}}_{\perp \mathbf{F}_K} \overset{\text{Cov}(\cdot) }{\Rightarrow} \widetilde{\mathbf{C}}_{\perp \mathbf{F}_K} \overset{ }{\Rightarrow} \overrightarrow{e} = \text{diag}\left( \text{Logm}\left( \widetilde{\mathbf{C}}_{\perp \mathbf{F}_K} \right) \right) \in \Re^{K \times 1}$ \hskip 0.5cm c). $\widetilde{\mathbf{X}}_{\perp \mathbf{F}_K} \overset{\text{Cov}(\cdot) }{\Rightarrow} \widetilde{\mathbf{C}}_{\perp \mathbf{F}_K} \overset{ }{\Rightarrow} \overrightarrow{e} = \text{vec}\left( \text{Logm}\left( \widetilde{\mathbf{C}}_{\perp \mathbf{F}_K} \right) \right) \in \Re^{\frac{K(K+1)}{2} \times 1}$ 3. Return label (several options are provided, only choose one): \hskip 0.5cm a). One-step classificaiton (only applicaple for features from 2.a) or 2.b)): \hskip 1.0cm i). $\hat{y} = \text{sgn}(\overrightarrow{\beta}_K ^{\mkern-1.5mu\mathsf{T}} \overrightarrow{e})$ \hskip 0.5cm b). Two-steps classificaiton (applicaple for all features): \hskip 1.0cm i). Use a set of $\overrightarrow{e}$ from training datasets to fit a second classifier $\textit{Clf}_2$ \hskip 1.0cm ii). Use the fitted classifier to classify the testing datasets and obtain the predicted label. \KwRet predicted label } \caption{Feature generation and classification} \label{Algo-2} \end{algorithm} \subsection{Experimental Setup} Now that we have shown the theoretical validity of tangent space spatial filtering, we move on to our empirical results. We base our experimental setup on a recently released open-source benchmark, which is known as \textit{Mother of all BCI Benchmark (MOABB)} \cite{jayaram2018moabb}. After that, we first fix the experimental paradigm as left-hand versus right-hand motor imagery because the corresponding neurophysiological knowledge, as well as the activated neuronal sources, are well studied. Furthermore, the analysis is restricted to the $\alpha$- and $\beta$-bands (8Hz $\sim$ 32Hz) based on neurophysiological knowledge. Also, all channels are utilized except for the electrooculography (EOG) channel. Based the chosen paradigm, we tried to adopt all eight available datasets in the MOABB, as summarized in Table \ref{T2}; however, as indicated in the Table \ref{T2}, the dataset \textit{BNCI 2014-004} is excluded from the analysis (marked in red in Table \ref{T2}) due to having only three electrodes. \begin{table*}[htb!] \caption{\protect \centering Overview of all adopted datasets with left-hand versus right-hand motor imagery paradigm. The dataset marked in red color has only 3 channels and is hence excluded from this analysis.}% \label{T2} \centering \begin{tabular}{|c|c|c|c|c|c|} \hline {Dataset Name} & {\#Channels} &{\#Subjects} & {\#Sessions} \\ \hline BNCI 2014-001 & 22 & 9 & 2 \\ \textcolor{red}{BNCI 2014-004 } &\textcolor{red}{3} & \textcolor{red}{9} & \textcolor{red}{5} \\ Cho et al. 2017 & 64 & 49 & 1 \\ Munich Motor Imagery & 128 & 10 & 1 \\ Physionet Motor Imagery & 64 & 109 & 1 \\ Shin et al. 2017 & 25 & 29 & 3 \\ Weibo et al. 2014 & 60 & 10 & 1 \\ Zhou et al. 2016 & 14 & 4 & 3 \\ \hline \end{tabular} \end{table*} After the bandpass filtering, the covariance matrices are first estimated from the trial-wise data via the empirical covariance estimator. Subsequently, three algorithms are employed to generate feature: CSP, TSSF, and standard Riemannian tangent space methods. TSSF based features are further subdivided into three types depending on the degree of approximation as summarized in Table \ref{Feat_table}, and two methods, namely one-step and two-steps classification as described in Section \ref{sec_TSSF_clf}. The difference between them is the choice of the second classifier: either fitting a new classifier after spatial filter generation (two-steps) or employing the eigenvalues from the GED solution as linear regression coefficients. These classification methods are summed up in Table \ref{Clf_table}. For CSP and standard Riemannian features, the L2-regularized SVM classifier is used as a classifier. \begin{table}[htb!] \centering \begin{tabular}{|c|c|c|} \hline \textbf{Name} & \textbf{First classifier} & \textbf{Second Classifier} \\ \hline \multirow{3}{*}{One-step} & \multirow{3}{*}{L2 Regularized SVM} & \multirow{3}{*}{\begin{tabular}[c]{@{}c@{}}Linear regression based on \\ the eigenvalue of GED\\ (refer to section \ref{sec_TSSF_clf}) \end{tabular}} \\ & & \\ & & \\ \hline Two-steps & L2 Regularized SVM & L2 Regularized SVM \\ \hline \end{tabular} \caption{Summary of classifiers. For all regularized SVM listed above, the parameters are found by grid search \cite{pedregosa2011scikit}.} \label{Clf_table} \end{table} The motivation of selecting a regularized SVM as the first classifier to generate weight vectors on the tangent space is inspired by the results from \cite{jayaram2018moabb}, in which the combination of regularized SVM and Riemannian methods has been validated as the best among all benchmarked pipelines. For choosing hyperparameters, a grid search \cite{pedregosa2011scikit} is employed to find the optimal value within the range from 0.01 to 100. \begin{figure}[htb!] \centering \includegraphics[width=.96\linewidth]{Flowchart.pdf} \caption{All tested pipelines in this paper. The annotated text above the line linked between classifiers and predictions is the abbreviation of the corresponding pipeline and Reg. SVM is the abbreviation of L2 regularized SVM.} \label{Flow_chart} \end{figure} For better understanding the difference among the multiple variants of TSSF based methods, CSP, and standard Riemannian methods, we summarize all the above steps into a flowchart (Fig.~\ref{Flow_chart}). After the prediction, the scoring metric chosen by us is the ROC-AUC (receiver operating characteristic - area under the curve) metric, and these scores are computed via five-fold cross-validation within each session of every data set. After obtaining scores from different pipelines, the next step is to compare and analyze their performance statistically. In our work, two statistics, the $p$-value and the effect size, are adopted to compare the proposed TSSF against CSP as well as the full Riemannian approach. The $p$-value for the one-sided test is computed across sessions and subjects but within each data set, the null hypothesis of which is that the median accuracy of using one pipeline is not larger than using another pipeline. The effect size is measured by the standardized mean difference (SMD) between the accuracies of the two compared methods. Further details about these statistical tests can be found in \cite{jayaram2018moabb}. \subsection{Statistical performance across datasets} \label{stat_analysis} We select three typical cases of applying spatial filters: two, six, or twelve spatial filters. By observing Fig.~\ref{Fig_FQ_summary_1} we can notice that even when only applying two filters, the p-value of comparison between all TSSF-based pipelines and \textit{CSP} highly significant, and the effect sizes are moderate. Moreover, in the comparisons with the full Riemannian method, the \textit{TSSF\_Cov\_2\_step} even significantly outperforms the full Riemannian method, albeit with a small effect size (0.23). When increasing the filter number to 6, as shown in Fig.~\ref{Fig_FQ_summary_2}, the performance of all TSSF-based pipelines continues to surpass \textit{CSP}. Surprisingly, \textit{TSSF\_Var\_2\_step} also shows significantly better results than the full Riemannian method \textit{TS\_AIRM}, though again with a rather small effect size (0.08). In addition, performance begins to differ among the different TSSF-based pipelines. After increasing the number to 12 (Fig.~\ref{Fig_FQ_summary_3}), although one more TSSF-based pipeline significantly outperforms \textit{TS\_AIRM}, the differences among the TSSF-based pipelines also further enlarge. Observing and comparing these figures from a macro perspective, we can discover several trends: First, CSP is constantly outperformed by all Riemannian based methods. Second, the performances of TSSF-based methods tend to differ from each other, only at large numbers of filters. Third, the difference in performance between one-step and two-steps methods also enlarges as the filter number increases. \subsection{Statistical performance within each data set} In order to go into more detail on how the various algorithms perform, in Fig.~\ref{Fig_FQ_meta}, we show meta-analyses between some individual algorithms which describe the per-dataset performance. We first compare \textit{CSP} against \textit{TSSF\_Var\_2\_step}, as both fit the same secondary classifier. In order to see the benefit of the matrix logarithm-based features as compared to the filtered log-variance features, we further provide the comparison between \textit{TSSF\_Var\_2\_step} and \textit{TSSF\_Cov\_2\_step}. Lastly, we are interested in seeing how the one-step classifier works, and so we also include \textit{TSSF\_Var\_1\_step}. As some datasets only contain 20 or fewer channels, we choose to always use 6 filters. The results are as shown in Fig.~\ref{Fig_FQ_meta}. \begin{figure}[H] \centering \begin{subfigure}{.91\linewidth} \includegraphics[width=\linewidth]{allds_meta_6_TSSF_Var_2_step_CSP.pdf} \caption{\centering Comparison of different spatial filter extraction methods} \label{Fig_FQ_meta_1} \end{subfigure} \end{figure} \begin{figure}[H]\ContinuedFloat \centering \begin{subfigure}{.95\linewidth} \includegraphics[width=\linewidth]{allds_meta_6_TSSF_Var_2_step_TSSF_Cov_2_step.pdf} \caption{\centering Comparison of different feature types} \label{Fig_FQ_meta_2} \end{subfigure} \begin{subfigure}{.95\linewidth} \includegraphics[width=\linewidth]{allds_meta_6_TSSF_Var_2_step_TSSF_Var_1_step.pdf} \caption{\centering Comparison of different classification methods} \label{Fig_FQ_meta_3} \end{subfigure} \caption{Meta analysis of accuracies using different pipelines with 6 filters. Parameters: p-value $p$ and SMD are computed within each dataset. Red \textcolor{red}{$^{\ast}$}, \textcolor{red}{$^{\ast\ast}$} and \textcolor{red}{$^{\ast\ast\ast}$} represent $p<0.05,0.01,0.001$ respectively. Grey diamonds signify the SMD, while grey bars show the confidence interval of the mean.} \label{Fig_FQ_meta} \end{figure} In the comparison of different spatial filter extraction method (Fig.~\ref{Fig_FQ_meta_1}), the TSSF-based method overwhelms CSP with only one exception. In addition, as shown in the Fig.~\ref{Fig_FQ_meta_2}, the features types does not seem to have a significant influence on the feature quality within each data set, even if the log-variance features is with dimension $dim = K=6$ and logarithm of covariance matrices features is $dim = \frac{K(K+1)}{2} = 21$. Although there exists a controversial fact that an overall significance appears in the comparison across datasets with $p=0.0436$, this chance-level p-value is not supported by a significant difference within any individual dataset. In the last sub-figure, Fig.~\ref{Fig_FQ_meta_3}, we can see that while two-step classification is significantly better than one-step classification across datasets, this is heavily influenced by only one data set. \begin{figure*}[t!] \centering \includegraphics[width=\linewidth]{Score_Munich_all.pdf} \caption {Classification accuracy w.r.t. the number of applied filters within Munich Motor Imagery data set and the accuracies are computed across all subjects and sessions. The central line is the mean accuracy and the error band shows confidence interval = $68\%$.} \label{Fig_FQ_acc} \end{figure*} \subsection{Performance w.r.t. the number of applied filters in single data set} Last but not least, we look at how performance changes as a function of the number of applied filters. As a meta-analysis here results in an enormous number of statistical tests on not very much data, we focus on this section of the analysis on a single dataset. For better reflecting the relationship between accuracy and number of applied filters, we choose the data set \textit{Munich Motor Imagery}, which has the highest channels numbers (128). % \begin{figure}[H] \centering \includegraphics[width=0.95\linewidth]{Pvalue_CSP_Munich} \caption{The p-values from the statistical test between all TSSF-based pipelines and CSP w.r.t. to the number of applied filters. The chosen data set is \textit{Munich Motor Imagery} and the null-hypothesis is that the median accuracy of TSSF-based methods is not larger than CSP. Significance threshold is set as 0.05, as indicated by the black straight line.} \label{Fig_CSP_pvalues} \end{figure} From Fig.~\ref{Fig_FQ_acc} we first notice that the accuracies of all TSSF-based features converge to the performance of the standard Riemannian method with merely four filters while CSP needs around 20 filters to reach a stable plateau. Second, except for \textit{TSSF\_Var\_1\_step}, all other TSSF-based methods constantly significantly outperform the \textit{CSP} whatever number of filters is used, as shown in Fig.~\ref{Fig_CSP_pvalues}. Lastly, for all log-variance based TSSF pipelines, their accuracy usually decreases when the number of filters continues to increase. Moreover, this fact can also be observed in other datasets, as indicated in Appendix \ref{all_ds_acc}. In this section, we have comprehensively compared the quality of the features extracted from various ways, and confirmed two things: that Riemannian methods reliably outperform CSP, and that TSSF can approximate--and sometimes even outperform--standard Riemannian methods. As a spatial filtering method, however, the interpretability is always of the highest significance, especially for online purposes, because it is the only way that we can know whether reasonable underlying neuronal sources are utilized. Moreover, the computational efficiency of the spatial filtering method is also vital because the online BCI system usually has a strict requirement for its computational complexity. Therefore, in the next section, we will further discuss these two aspects. \section{Introduction} \input{introduction.tex} \section{Background} \input{background.tex} \section{Methods} \input{methods.tex} \section{Results} \input{results.tex} \section{Discussion} \input{discussion.tex} \section{Conclusion} \input{conclusion.tex} \begin{appendices} \input{appendix_a.tex} \input{appendix_b.tex} \input{appendix_c.tex} \end{appendices} \section*{Acknowledgment} \input{acknowledgment.tex} \printbibliography \end{document}
\section{Jaccard Distance Experiments} In Figure~\ref{fig:std_jaccard_cnn} and Figure~\ref{fig:std_jaccard_lstm} we plot the Jaccard distance plots with CNN models and LSTM models and note that ASWA consistently improves the stability of the interpretations. \begin{figure}[!h] \centering \resizebox{.9\linewidth}{!}{ \includegraphics[width=\linewidth,keepaspectratio]{figures/Diabetes-cnn-jaccard.png} } \caption{Jaccard Distance improvement for Diabetes.} \end{figure} \begin{figure}[!h] \centering \resizebox{.9\linewidth}{!}{ \includegraphics[width=\linewidth,keepaspectratio]{figures/Diabetes-lstm-jaccard.png} } \caption{Jaccard Distance improvement for Diabetes.} \end{figure} \begin{figure}[!h] \centering \resizebox{.9\linewidth}{!}{ \includegraphics[width=\linewidth,keepaspectratio]{figures/sst-cnn-dot.png} } \caption{Entropy improvement for dot Attention based CNN model for SST dataset.} \end{figure} \begin{figure}[!h] \centering \resizebox{.9\linewidth}{!}{ \includegraphics[width=\linewidth,keepaspectratio]{figures/Diabetes-cnn-dot.png} } \caption{Entropy improvement for dot Attention based CNN model for Diabetes dataset.} \end{figure} \section{Results with 100 seeds} We perform attention stability based experiments as mentioned in the paper, but now with 100 seeds, i.e, 100 models initialized with different seeds instead of 10. Figures \ref{fig:sst-100}, \ref{fig:imdb-100}, and \ref{fig:agnews-100} show the entropy of attention based interpretations for different datasets. Experimenting with 100 seeds helps strengthen our claims about the instability of the model and the effectiveness of our proposed algorithms like ASWA and NASWA. \section{Hyperparameter Settings} For training purposes, we use the same model settings for the models as mentioned in the paper \cite{DBLP:journals/corr/abs-1902-10186} (or the Github implementation\footnote{\url{https://github.com/successar/AttentionExplanation}}), our port of the code is made available at: \url{https://github.com/rishj97/ModelStability}. Additional hyper-parameters for replication studies are: \begin{itemize} \item Number of epochs: 20 \item Optimizer: Adam \item Learning rate: 0.001 \end{itemize} The exact seeds used for running the experiments can be found in our code repository. \section{Binary Classification with LSTM based Models} For LSTM based models, we notice (in Figure \ref{fig:lstm-atn-entropy}) similar trends as to the CNN models in terms of the instability of the attention based interpretations. \section{Introduction} There has been a tremendous growth in deep neural network based models that achieve state-of-the-art performance. In fact, most recent end-to-end deep learning models have surpassed the performance of careful human feature-engineering based models in a variety of NLP tasks. However, deep neural network based models are often brittle to various sources of randomness in the training of the models. This could be attributed to several sources including, but not limited to, random parameter initialization, random sampling of examples during training and random dropping of neurons. It has been observed that these models have, more often, a set of \emph{random seeds} that yield better results than others. This has also lead to research suggesting random seeds as an additional hyperparameter for tuning \cite{bengio2012practical}\footnote{\url{http://www.argmin.net/2018/02/26/nominal/}}. One possible explanation for this behavior could be the existence of multiple local minima in the loss surface. This is especially problematic as the loss surfaces are generally non-convex and may have multiple saddle points making it difficult to achieve model stability.% \begin{figure}[h] \centering \resizebox{0.9\linewidth}{!}{ \begin{tabular}{p{\linewidth}}\toprule if high crimes were any more generic it would have a universal \colorbox{pink}{product} code \colorbox{red}{instead} of a title \begin{center}($\Pr{(Y_{{negative}})}=0.99$)\end{center}\\\midrule if \colorbox{magenta}{high} \colorbox{red}{crimes} \colorbox{pink}{were} any more generic it would have a universal product code instead of a title \begin{center}($\Pr{(Y_{{negative}})=0.98}$)\end{center}\\\bottomrule \end{tabular} } \caption{Importance based on attention probabilities for two runs of the same model with \textbf{same parameters and same hyperparameters}, but with \textbf{two different random seeds} (color magnitudes: pink$<$magenta$<$red)} \label{fig:introeg} \end{figure} Recently the NLP community has witnessed a resurgence in interpreting and explaining deep neural network based models~\cite{jain2019analysis,DBLP:journals/corr/abs-1902-10186, alvarez2017causal}. Most of the interpretation based methods involve one of the following ways of interpreting models: a) sample oriented interpretations: where the interpretation is based on changes in the prediction score with either upweighting or perturbing samples~\cite{jain2019analysis,DBLP:journals/corr/abs-1902-10186,koh2017understanding}; b) interpretations based on feature attributions using attention or input perturbation or gradient-based measures;~\cite{ghaeini2018interpreting,feng2018pathologies,bach2015pixel}; c) interpretations using surrogate linear models~\cite{ribeiro2016model} -- these methods can provide local interpretations based on input samples or features. However, the presence of inherent randomness makes it difficult to accurately interpret deep neural models among other forms of pathologies~\cite{feng2018pathologies}. In this paper, we focus on the stability of deep neural models as a function of random-seed based effects. We are especially interested in investigating the hypothesis focusing on model stability: do neural network based models under different random seeds allow for similar interpretations of their decisions? % We claim that for a given model which achieves a substantial performance for a task, the factors responsible for any decisions over a sample should be approximately consistent irrespective of the random seed. In Figure~\ref{fig:introeg}, we show an illustration of this question where we visualize the attention distributions of two CNN based binary classification models for sentiment analysis, trained with the same settings and hyper-parameters, but with \textit{different seeds}. We observe that both models obtain the correct prediction with significantly high confidence. However, we note that both the models attend to completely different sets of words. This is problematic, especially when interpreting these models under the influence of such randomness. We observe that on average $40-60\%$ of the most important interpretable units are different across different random seeds for the same model. % This phenomenon also leads us to the question on the exact nature of interpretability -- are the interpretations specific to an instantiation of the model or are they general to a class of models? We also provide a simple method that can, to a large extent, ameliorate this inherent random behaviour. In Section~\ref{sec:aswa}, we propose an aggressive stochastic weight averaging approach that helps in improving the stability of the models at almost zero performance loss while still making the model robust to random-seed based instability. We also propose an improvement to this model in Section~\ref{ssec:NASWA} which further improves the stability of the neural models. Our proposals significantly improve the robustness of the model, on average by $72\%$ relative to the original model and on Diabetes (MIMIC), a binary classification dataset, by $89\%$ (relative improvement). All code for reproducing and replicating our experiments is released in our repository\footnote{https://github.com/rishj97/ModelStability}. \section{Measuring Model Stability} \label{sec:attnstablity} In this section, we describe methods that we use to measure model stability, specifically --- prediction and interpretation stability. \subsection{Prediction Stability} We measure prediction stability using standard measures of the mean and the standard deviations corresponding to the accuracy of the classification based models on different datasets. We ensure that the models are run with exactly the same configurations and hyper-parameters but with different random seeds. This is a standard procedure that is used in the community to report the performance of the model. \subsection{Interpretation Stability} \label{ssec:attn_stab} For a given task, we train a set of models only differing with random-seeds. For every given test sample, we obtain interpretations using different instantiations of the models. We define a model to be stable if we obtain similar interpretations regardless of different random-seed based instantiations. We use the following metrics to quantify stability: a) \textbf{Relative Entropy quantification ($\mathcal{H}$):} Given two distributions over interpretations, for the same test case, from two different models, it measures the relative entropy between the two probability distributions. Note that, the higher the relative entropy the greater the dissimilarity between the two distributions. \[ \mathcal{H} = \sum_{i{\in}d}{{{\Pr}_{1}} \cdot \log{\frac{\Pr_1}{\Pr_2}}} \] where, $\Pr_1$ and $\Pr_2$ are two attention distributions of the same sample from two different runs of the model and $d$ is the number of tokens in the sample. Given $n$ differently seeded models, for each test instance, we calculate the relative entropy obtained from the corresponding averaged pairwise interpretation distributions. b) \textbf{Jaccard Distance ($\mathcal{J}$):} It measures the dissimilarity between two sets. Here higher values of $\mathcal{J}$ indicate larger variances. We consider top-$n$ tokens which have the highest attention for comparison. Note that, Jaccard distance is over sets of word indices and do not take into account the attention probabilities explicitly. Jaccard distance is defined as: \[ \mathcal{J} = (1 - \frac{A{\cap}B}{A{\cup}B}) * 100 \% \] where, $A$ and $B$ are the sets of most relevant items. We specifically decided to use `most' relevant (top-$n$ items) as the tail of the distribution mostly consists of values close to $0$. \paragraph{Interpretation methods under study:} In this paper we study interpretation stability using the following three interpretation methods: \begin{enumerate} \item \textit{Attention based interpretation:} We focus on attention probabilities as the mode of interpretation and consider the model to be stable if different instantiations of the model leads to similar attention distributions. Our major focus in this paper is attention based interpretation. As we use~\newcite{jain2019analysis} as a testbed for our investigation, we focus heavily on attention. Also, as the attention layer has a linear relationship with the prediction, we consider attention to be more indicative of the model stability. \item \textit{Gradient-based feature importance:} Given a sample, we use the input gradients of the model corresponding to each of the word representations and compute the magnitude of the change as a local explanation. We refer the reader to~\citet{baehrens2010explain} for a good introduction to gradient-based interpretations. As all of our models are differentiable, we use this as an alternative method for interpretation. We follow the standard procedure as followed in~\citet{feng2018pathologies} and note that we do not follow~\citet{DBLP:journals/corr/abs-1902-10186} and do not disconnect the computational graph at the attention module. We obtain probabilistic gradient scores by normalizing over the absolute values of gradient values. \item \textit{LIME based interpretation:} We use locally interpretable model-agnostic interpretations~\cite{ribeiro2016model} that learns a surrogate interpretable model locally around the predictions of the deep neural based model. We obtain LIME based interpretations for every instantiation of the models. We then use Jaccard Distance to measure the divergence. \end{enumerate} We note that, we observe similar patterns across the three interpretation methods and the interpretations consistently differ with random seeds. \section{Reducing Model Instability with an Optimization Lens} We observe that different instantiations of the model can cause the model have different starts on the optimization surface. Further, stochastic sampling might result in different paths. Both of these factors can lead to different local minimas potentially leading to different solutions. With this observation as our background we propose two, closely related, methods to ameliorate divergence: Agressive Stochastic Weight Averaging and Norm-filtered Agressive Stochastic Weight Averaging. We describe these two in the following subsections. \subsection{Aggressive Stochastic Weight Averaging (ASWA)} \label{sec:aswa} Stochastic weight averaging (SWA)~\cite{izmailov2018averaging} works by averaging the weights of multiple points in the trajectory of gradient descent based optimizers. The algorithm typically uses modified learning rate schedules. SWA is itself based on the idea of maintaining a running average of weights in stochastic gradient descent based optimization techniques~\cite{ruppert1988stochastic,polyak1992acceleration}. The principle idea in SWA is averaging the weights that are maximally distant helps stabilize the gradient descent based optimizer trajectory and improves generalization. ~\citet{izmailov2018averaging} use the analysis of~\citet{mandt2017stochastic} to illustrate the stability arguments where they show that, under certain convexity assumptions, SGD iterations can be visualized as sampling from a Gaussian distribution centred at the \emph{minima} of the loss function. Samples from high-dimensional Gaussians are expected to be concentrated \emph{on the surface of the ellipse} and not close to the \emph{mean}. Averaging iterations is shown to stabilize the trajectory and further improve the width of the solutions to be closer to the \emph{mean}. In this paper, we focus on the stability of deep neural models as a function of random-seeds. Our proposal is based on SWA, but we extend it to the extremes and call it \emph{Aggressive Stochastic Weight Averaging}. We assume that, for small batch size, the loss surface is locally convex. We further relax the conditions for the optimizer and assume that the optimizer is based on some version of gradient descent --- this means that our modification is valid even for other pseudo-first-order optimization algorithms including Adam~\cite{kingma2014adam} and Adagrad~\cite{duchi2011adaptive}. We note that, \citet{izmailov2018averaging} suggest using SWA usually after 'pre-'training the model (at least until $75\%$ convergence) and followed by sampling weights at different steps either using large constant or cyclical learning rates. While, SWA is well defined for convex losses~\cite{polyak1992acceleration}, \citet{izmailov2018averaging} connect SWA to non-convex losses by suggesting that the loss surface is~\emph{approximately} convex after convergence. In our setup, we investigate the utility of averaging weights over every iteration (an iteration consists of one batch of the gradient descent). Algorithm~\ref{alg:aswa} shows the implementation pseudo-code for SWA. We note that, unlike~\citet{izmailov2018averaging}, we average our weights at \textit{each batch} update and assign the ASWA parameters to the model at the end of each epoch. That is, we replace the model's weights for the next epoch with the averaged weights. \begin{algorithm}[h] \begin{algorithmic}[1] \Require\\ $e=$ Epoch number\\ $m=$ Total epochs\\ $i=$ Iteration number\\ $n=$ Total iterations\\ $\alpha=$ Learning rate\\ $\mathcal{O}=$ Stochastic Gradient optimizer function \end{algorithmic} $e \gets 0$\; \While{$e < m$}{ {$i \gets 1$} \While{$i \leq n$}{ $W_{swa} \gets W_{swa} + \frac{(W - W_{swa})}{(e*n + i + 1)}$\; $W \gets W - \mathcal{O}(\alpha, W)$\; $i \gets i + 1$ } $W \gets W_{swa}$\; $e \gets e + 1$ } \caption{Aggressive SWA algorithm} \label{alg:aswa} \end{algorithm} In Figure~\ref{fig:stable-preds}, we show an SGD optimizer (with momentum) and the same optimizer \emph{with SWA} over a $3$-dimensional loss surface with a saddle point. We observe that the original SGD reaches the desired minima, however, it almost reaches the saddle point and does a course correction and reaches minima. On the other hand, we observe that SGD with ASWA is very conservative, it repeatedly restarts and reaches the minima without reaching the saddle point. We empirically observe that this is a desired property for the stability of models over runs of the same model that differ only over random instantiations. The grey circles in Figure \ref{fig:stable-preds} highlight this conservative behaviour of SGD with ASWA optimizer, especially when compared to the standard SGD. Further, ~\citet{polyak1992acceleration} show that for convex losses, averaging SGD proposals achieves the highest possible rate of convergence for a variety of first-order SGD based algorithms. \begin{figure}[h] \centering \begin{subfigure}{0.88\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/imgb.png} \caption{Trajectory for Stochastic Gradient Descent} \label{fig:prd_cnn1} \end{subfigure}\par\medskip \begin{subfigure}{0.88\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/imga.png} \caption{Trajectory for Stochastic Gradient Descent with ASWA} \label{fig:prd_cnn2} \end{subfigure} \caption{Trajectory for gradient descent algorithms with red and black arrows on (b) indicating movements from consecutive epochs with restarts. Conservative behaviour of ASWA algorithm helps avoid the saddle point without ever reaching it.} \label{fig:stable-preds} \end{figure} \subsection{Norm-filtered Aggressive Stochastic Weight Averaging (NASWA)} \label{ssec:NASWA} \begin{algorithm}[h] \begin{algorithmic}[1] \Require\\ $e=$ Epoch number\\ $m=$ Total epochs\\ $i=$ Iteration number\\ $n=$ Total iterations\\ $\alpha=$ Learning rate\\ $\mathcal{O}=$ Stochastic Gradient optimizer function\\ $N_s=$ List of previous iterations' norm differences \end{algorithmic} $e \gets 0$\; \While{$e < m$}{ {$i \gets 1$} \While{$i \leq n$}{ $N_{cur} \gets \|W-W_{swa}\|_1$\; $N_{mean} \gets \frac{\sum_{i=1}^{|N_s|} N_s[i]}{|N_s|}$\; \eIf{$N_{cur} > N_{mean}$}{ $W_{swa} \gets W_{swa} + \frac{(W - W_{swa})}{(e*n + i + 1)}$\; $N_{s} \gets [N_{cur}]$\; }{ $N_{s} \gets N_{s} + [N_{cur}]$\; } $W \gets W - \mathcal{O}(\alpha, W)$\; $i \gets i + 1$ } $W \gets W_{swa}$\; $e \gets e + 1$ } \caption{Norm-filtered Aggressive SWA algorithm} \label{alg:naswa} \end{algorithm} We observe that the ASWA algorithm is especially beneficial when the norm difference of the parameters of the model are high. We hypothesise that in general, the norm difference indicates the divergence between optimizers' steps and we observe that the larger the norm difference, the greater the change in the trajectory. Therefore, we propose to maintain a list that stores the norm differences of the previous iterations. If the norm difference of the current iteration is greater than the average of the list, we update the ASWA weights and reinitialize the list with the current norm difference. When the norm difference, however, is less than the average of the list, we just append the current norm difference to the list. After the completion of the epoch, we assign the ASWA parameters to the model. This is shown in Algorithm~\ref{alg:naswa}. We call this approach \emph{Norm-filtered Aggressive Stochastic Weight Averaging}. \section{Experiments} \label{sec:experiemnts} We base our investigation on similar sets of models as~\citet{DBLP:journals/corr/abs-1902-10186}. We also use the code provided by the authors for our empirical investigations for consistency and empirical validation. We describe our models and datasets used for the experiments below. \subsection{Models} We consider two sets of commonly used neural models for the tasks of binary classification and multi-class natural language inference. We use CNN and bi-directional LSTM based models with attention. We follow~\cite{DBLP:journals/corr/abs-1902-10186} and use similar attention mechanisms using a) additive attention~\cite{bahdanau2014neural}; and b) scaled dot product based attention~\cite{vaswani2017attention}. We jointly optimize all the parameters for the model, unlike~\citet{DBLP:journals/corr/abs-1902-10186} where the encoding layer, attention layer and the output prediction layer are all optimized separately. We experiment with several optimizers including Adam~\cite{kingma2014adam}, SGD and Adagrad~\cite{duchi2011adaptive} but most results below are with Adam. % For our ASWA and NASWA based experiments, we use a constant learning rate for our optimizer. Other model-specific settings are kept the same as~\citet{DBLP:journals/corr/abs-1902-10186} for consistency. \begin{table}[h] \centering \resizebox{0.9\linewidth}{!}{ \begin{tabular}{crrr}\toprule \textbf{Dataset} & \textbf{Avg. Length} & \textbf{Train Size} & \textbf{Test size}\\ \midrule IMDB & 179 & 12500 / 12500 & 2184 / 2172\\ Diabetes(MIMIC) & 1858 & 6381 / 1353 & 1295 / 319\\ SST & 19 & 3034 / 3321 & 652/653 \\ Anemia(MIMIC) & 2188 & 1847 / 3251 & 460 / 802\\ AgNews & 36 & 30000 / 30000 & 1900 / 1900\\ ADR Tweets & 20 & 14446 / 1939 & 3636 / 487\\ SNLI & 14 & 182764 / 183187 / 183416 & 3219 / 3237 / 3368\\ \bottomrule \end{tabular}} \caption{Dataset characteristics. Train size and test size show the cardinality for each class. SNLI is a three-class dataset while the rest are binary classification} \label{tbl:dataset} \end{table} \subsection{Datasets} The datasets used in our experiments are listed in Table~\ref{tbl:dataset} with summary statistics. We further pre-process and tokenize the datasets using the standard procedure and follow~\citet{DBLP:journals/corr/abs-1902-10186}. We note that IMDB~\cite{maas2011learning}, Diabetes(MIMIC)~\cite{johnson2016mimic}, Anemia(MIMIC)~\cite{johnson2016mimic}, AgNews~\cite{zhang2015character}, ADR Tweets~\cite{nikfarjam2015pharmacovigilance} and SST~\cite{socher2013recursive} are datasets for the binary classification setup. SNLI~\cite{bowman2015large} is a dataset for the multiclass classification setup. All of the datasets are in English, however we expect the behavior to persist regardless of the language.% \subsection{Settings and Hyperparameters} We use a $300$-dimenstional embedding layer which is initialized with FastText~\cite{joulin2016fasttext} based free-trained embeddings for both CNN and the bi-directional LSTM based models. We use a $128$-dimensional hidden layer for the bi-directional LSTM and a $32$-dimensional filter with kernels of size $\{1,3,5,7\}$ for CNN. For others, we maintain the model settings to resemble the models in~\citet{DBLP:journals/corr/abs-1902-10186}. We train all of our models for 20 Epochs with a constant batch size of 32. We use early stopping based on the validation set using task-specific metrics (Binary Classification: using \texttt{roc-auc}, Multiclass and question answering based dataset: using \texttt{accuracy}). \begin{table}[h] \centering \resizebox{0.9\linewidth}{!}{ \begin{tabular}{crrr}\toprule \textbf{Dataset} & \textbf{CNN(\%)} & \textbf{CNN+ASWA(\%)} & \textbf{CNN+NASWA(\%)}\\ \midrule IMDB & 89.8 ($\pm$0.79) & 90.2 ($\pm$0.25) & 90.1 ($\pm$0.29) \\ Diabetes & 87.4 ($\pm$2.26) & 85.9 ($\pm$0.25) & 85.9 ($\pm$0.38) \\ SST & 82.0 ($\pm$1.01) & 82.5 ($\pm$0.39) & 82.5 ($\pm$0.39) \\ Anemia & 90.6 ($\pm$0.98) & 91.9 ($\pm$0.20) & 91.9 ($\pm$0.19)\\ AgNews & 95.5 ($\pm$0.23) & 96.0 ($\pm$0.11) & 96.0 ($\pm$0.07)\\ Tweet & 84.6 ($\pm$2.65) & 84.4 ($\pm$0.54) & 84.4 ($\pm$0.54) \\\bottomrule \end{tabular}} \caption{Performance statistics obtained from 10 differently seeded CNN based models. Table compares accuracy and its \textbf{standard deviation} for the normally trained CNN model against the ASWA and NASWA trained models, whose deviation drops significantly, thus, indicating increased robustness.} \label{tbl:acc_std} \end{table} \section{Results} In this section, we summarize our findings for $10$ runs of the model with $10$ different random seeds but with identical model settings. \subsection{Model Performance and Stability} We first report model performance and prediction stability. The results are reported in Table~\ref{tbl:acc_std}. \begin{table}[!h] \centering \resizebox{0.9\linewidth}{!}{ \begin{tabular}{crrr}\toprule \textbf{Dataset} & \textbf{LSTM(\%)} & \textbf{LSTM+ASWA(\%)} & \textbf{LSTM+NASWA(\%)}\\ \midrule IMDB & 89.1 ($\pm$1.34) & 90.2 ($\pm$0.32) & 90.3 ($\pm$0.17) \\ Diabetes & 87.7 ($\pm$1.44) & 87.7 ($\pm$0.60) & 87.8 ($\pm$0.55) \\ SST & 81.9 ($\pm$1.11) & 82.0 ($\pm$0.60) & 82.1 ($\pm$0.57) \\ Anemia & 91.6 ($\pm$0.49) & 91.8 ($\pm$0.34) & 91.9 ($\pm$0.36)\\ AgNews & 95.5 ($\pm$0.32) & 96.1($\pm$0.17) & 96.1 ($\pm$0.10)\\ Tweet & 84.7 ($\pm$1.79) & 83.8 ($\pm$0.45) & 83.9 ($\pm$0.45) \\\bottomrule \end{tabular}} \caption{Performance statistics obtained from 10 differently seeded LSTM based models.} \label{tbl:acc_std_lstm} \end{table} We note that the original CNN based models, on an average, have a standard deviation of $\pm 1.5\%$. Which seems standard, however, we note that ADR Tweets~dataset has a very high standard deviation of $\pm 2.65\%$. We observe that ASWA and NASWA are almost always able to achieve higher performance with a very low standard deviation. This suggests that both ASWA and NASWA are extremely stable when compared to the standard model. They significantly improve the robustness, on an average, by $72\%$ relative to the original model and on Diabetes (MIMIC), a binary classification dataset, by $89\%$ (relative improvement). We observe similar results for the LSTM based models in Table~\ref{tbl:acc_std_lstm}. \begin{figure}[h] \centering \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-cnn.png} \caption{CNN models} \label{fig:prd_cnn} \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-lstm.png} \caption{LSTM models} \label{fig:prd_lstm} \end{subfigure} \caption{Prediction's standard deviation for CNN and LSTM based models for all binary classification datasets under consideration. Predictions are bucketed in intervals of size 0.1, starting from 0 (containing predictions from 0 to 0.1), until 0.9} \end{figure} We further analyze the prediction score stability by computing the mean standard deviation over the binned confidence intervals of the models in Figure~\ref{fig:prd_cnn}. We note that on an average, the standard deviations are on the lower side. However, we observe that the mean standard deviation of the bins close to $0.5$ is on the higher side as is expected given the high uncertainty. On the other hand both, ASWA and NASWA based models are relatively more stable than the standard CNN based model. We observe similar behaviours for the LSTM based models in Figure~\ref{fig:prd_lstm}. This suggests that our proposed methods, ASWA and NASWA, are able to obtain relatively better stability without any loss in performance. We also note that both ASWA and NASWA had relatively similar performance over more than $10$ random seeds. \subsection{Attention Stability} \begin{figure}[h] \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/entropy-all.png} \caption{CNN models} \label{fig:atn_cnn} \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/entropy-all-lstm.png} \caption{LSTM models} \label{fig:atn_lstm} \end{subfigure} \caption{Average attention entropy against the bucketed predictions for CNN and LSTM based models. Figure highlights the high entropy between attention based distributions from differently seeded models (especially for the Diabetes-MIMIC datatset), indicating towards model instability.} \end{figure} We now consider the stability of attention distributions as a function of random seeds. We first plot the results of the experiments for \emph{standard} CNN based binary classification models over uniformly binned prediction scores for positive labels in Figure~\ref{fig:atn_cnn}. We observe that, depending on the datasets, the attention distributions can become extremely unstable (high entropy). We specifically highlight the Diabetes(MIMIC) dataset's entropy distribution. We observe similar, but relatively worse results for the LSTM based models in Figure~\ref{fig:atn_lstm}. In general, we would expect the entropy distribution to be close to zero however, this doesn't seem to be the case. This means that using attention distributions to interpret models may not be reliable and can lead to misinterpretations. \begin{figure}[h] \centering \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/jaccard-all-cnn.png} \caption{CNN models} \label{fig:std_jaccard_cnn} \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/jaccard-all-lstm.png} \caption{LSTM models} \label{fig:std_jaccard_lstm} \end{subfigure} \caption{Jaccard distance highlighting instability in attention distributions of CNN and LSTM based models.} \end{figure} \begin{figure}[h] \centering \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-cnn-ASWA.png} \caption{CNN+ASWA} % \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-cnn-NASWA.png} \caption{CNN+NASWA} \end{subfigure}\par\medskip \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-lstm-ASWA.png} \caption{LSTM+ASWA} \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-lstm-NASWA.png} \caption{LSTM+NASWA} \end{subfigure} \caption{Improved prediction stability from ASWA and NASWA for CNN and LSTM based models} \end{figure} \begin{figure}[h] \begin{subfigure}{0.45\linewidth} \centering \includegraphics[width=\linewidth,keepaspectratio]{figures/jaccard-Diabetes-cnn-gradient.png}\hfill \caption{Diabetes} \end{subfigure}\hfill \begin{subfigure}{0.45\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/jaccard-sst-cnn-gradient.png}\hfill \caption{SST} \end{subfigure} \caption{Gradient based interpretations' stability improvement from NASWA on CNN based models. The Jaccard distance is calculated using the top 20\% attentive items.} \label{fig:grad_stab} \end{figure} \begin{figure*} \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=\linewidth,keepaspectratio]{figures/imdb-cnn.png}\hfill \caption{IMDB} \label{sfig:aswa_imdb} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/Diabetes-cnn.png}\hfill \caption{Diabetes} \label{sfig:aswa_diab} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/sst-cnn.png}\hfill \caption{SST} \end{subfigure}\par\medskip \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/Anemia-cnn.png}\hfill \caption{Anemia} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/AgNews-cnn.png}\hfill \caption{AgNews} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/tweet-cnn.png}\hfill \caption{ADR Tweets} \end{subfigure} \caption{Attention stability improvement from ASWA and NASWA on CNN based models.} \label{fig:attn_stab_imp} \end{figure*} \begin{figure*}[!h] \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=\linewidth,keepaspectratio]{figures/snli0-cnn.png}\hfill \caption{Label 0 prediction vs entropy} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/snli1-cnn.png}\hfill \caption{Label 1 prediction vs entropy} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/snli2-cnn.png}\hfill \caption{Label 2 prediction vs entropy} \end{subfigure} \caption{Attention stability improvement from ASWA and NASWA on CNN based model for the SNLI dataset.} \label{fig:snli_cnn_entropy} \end{figure*} We use the top $20\%$ of the most important items (indices) in the attention distribution for each dataset over $10$ runs and plot the Jaccard distances for CNN and LSTM based models in Figure~\ref{fig:std_jaccard_cnn} and Figure~\ref{fig:std_jaccard_lstm}. We again notice a similar trend of unstable attention distributions over both CNN and LSTM based attention distribution. In the following sections for space constraints, we focus on CNN based models with additive attention. Our results on LSTM based models are provided in the attached supplementary material. We note that the observations for LSTM models are, in most cases, similar to the behaviour of the CNN based models. Scaled dot-product based models are also provided in the supplementary material and we notice a similar trend as the additive attention. We now focus on the effect of ASWA and NASWA on binary and multi-class CNN based neural models separately. \paragraph{Binary Classification} In Figure~\ref{fig:attn_stab_imp}, we plot the results of the models with ASWA and NASWA. We observe that both these algorithms significantly improve the model stability and decrease the entropy between attention distributions. For example, in Figure~\ref{sfig:aswa_diab}, both ASWA and NASWA decrease the average entropy by about $60\%$. We further notice that NASWA is slightly better performing in most of the runs. This empirically validates the hypothesis that averaging the weights from divergent weights (when the norm difference is higher than the average norm difference) helps in stabilizing the model's parameters, resulting in a more robust model. \paragraph{Multi-class Classification} In Figure \ref{fig:snli_cnn_entropy}, we plot the entropy between the attentions distributions of the models for the SNLI dataset (CNN based model), separately for \emph{each label} (\emph{neutral}, \emph{contradiction}, and \emph{entailment}). We notice, similar observations as the binary classification models, the ASWA and NASWA algorithms are able to significantly improve the entropy of the attention distributions and increases the robustness of the model with random seeds. \subsection{Gradient-based Interpretations} We now look at an alternative method of interpreting deep neural models and look into the consistency of the gradient-based interpretations to further analyze the model's instability. For this setup, we focus on binary classifier and plot the results on the SST and the Diabetes dataset in particular since they cover the low and the high end of the entropy spectrum (respectively). We notice similar trends of instability in the gradient-based interpretations from model inputs as we did for the attention distributions. Figure \ref{fig:grad_stab} shows that the entropy between the gradient-based interpretations from differently seeded models closely follows the same trend as the attention distributions. This result further strengthens our claim on the importance of model stability and shows that over different runs of the same model with different seeds, we may get different interpretations using gradient-based feature importance. Moreover, Figure \ref{fig:grad_stab} shows the impact of ASWA towards making the gradient-based interpretations more consistent, thus, significantly increasing the stability. \subsection{LIME based Interpretations} We further evaluated the surrogate model based interpretability using LIME~\cite{ribeiro2016model}. LIME obtains a locally linear approximation of the model's behaviour for a given sample by perturbing it and learning a sparse linear model around it. We focus on AgNews and SST based datasets and obtain interpretability estimates using LIME. Once again, we notice a similar pattern of instability as the other two interpretability methods. In Figure~\ref{fig:lime_stab} we present our results from the LIME based interpretations with Jaccard distance as the measure. Note that we measure the Jaccard distance over the top $20\%$ most influential items. We observe once again that NASWA helps in reducing the instability and results in more consistent interpretations. \begin{figure} \begin{subfigure}{0.5\linewidth} \centering \includegraphics[width=\linewidth,keepaspectratio]{figures/jaccard-AgNews-cnn-lime.png}\hfill \caption{AgNews} \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/jaccard-sst-cnn-lime.png}\hfill \caption{SST} \end{subfigure} \caption{LIME based interpretations' stability improvement from NASWA on CNN based models. The Jaccard distance is calculated using the top 20\% attentive items.} \label{fig:lime_stab} \end{figure} In all our experiments, we find that a significant proportion of interpretations are dependent on the instantiation of the model. We also note that we perform experiments over $100$ random seeds for greater statistical power and see similar patterns\footnote{These results are provided in the appendix.}. % \section{Discussion} Recent advances in adversarial machine learning~\cite{neelakantan2015adding,zahavy2016ensemble} have investigated robustness to random initialization based perturbations, however, to our knowledge, no previous study investigates the effect of random-seeds and its connection on model interpretation. Our study analyzed the inherent lack of robustness in deep neural models for NLP. Recent studies cast doubt on the consistency and correlations of several types of interpretations~\cite{doshi2017towards,DBLP:journals/corr/abs-1902-10186,feng2018pathologies}. We hypothesise that some of these issues are due to the inherent instability of the deep neural models to random-seed base perturbations. % Our analysis (in Section~\ref{sec:experiemnts}) leads to the hypothesis that models with different instantiations may use completely different optimization paths. The issue of variance in all black-box interpretation methods over different seeds will continue to persist until the models are fully robust to random-seed based perturbations. Our work however, doesn't provide insights into instabilities of different layers of the models. We hypothesise that it might further uncover the reasons for the relatively lower correlation between different black-box interpretation methods as these are effectively based off on different layers and granularity. There has been some work on using noisy gradients~\cite{neelakantan2015adding} and learning from adversarial and counter-factual examples~\cite{feng2018pathologies} to increase the robustness of deep learning models.~\citet{feng2018pathologies} show that neural models may use redundant features for prediction and also show that most of the black-box interpretation methods may not be able to capture these second-order effects. Our proposals show that aggressively averaging weights leads to better optimization and the resultant models are more robust to random-seed based perturbation. However, our research is limited to increasing consistency in neural models. Our approach further uses first order based signals to boost stability. We posit that second-order based signals can further enhance consistency and increase the robustness.% \section{Conclusions} In this paper, we study the inherent instability of deep neural models in NLP as a function of random seed. We analyze model performance and robustness of the model in the form of attention based interpretations, gradient-based feature importance and LIME based interpretations across multiple runs of the models with different random seeds. Our analysis strongly highlights the problems with stability of models and its effects on black-box interpretation methods leading to different interpretations for different random seeds. We also propose a solution that makes use of weight averaging based optimization technique and further extend it with norm-filtering. We show that our proposed methods largely stabilize the model to random-seed based perturbations and, on average, significantly reduce the standard deviations of the model performance by $72\%$. We further show that our methods significantly reduce the entropy in the attention distribution, the gradient-based feature importance measures and LIME based interpretations across runs. \section*{Acknowledgments} We thank Panos Parpas and Emtiyaz Khan for their feedback on an earlier draft of this paper. We thank the anonymous reviewers for their thorough reviews and constructive comments. Pranava Madhyastha kindly acknowledges the support of Amazon AWS Cloud Credits for Research Award, hardware grant from NVIDIA, Anne O'Neill and the Imperial Corporate Partnership Programme. \section{Reducing Model Instability with an Optimization Lens} We observe that different instantiations of the model can cause the model have different starts on the optimization surface. Further, stochastic sampling might result in different paths. Both of these factors can lead to different local minimas potentially leading to different solutions. With this observation as our background we propose two, closely related, methods to ameliorate divergence: Agressive Stochastic Weight Averaging and Norm-filtered Agressive Stochastic Weight Averaging. We describe these two in the following subsections. \subsection{Aggressive Stochastic Weight Averaging (ASWA)} \label{sec:aswa} Stochastic weight averaging (SWA)~\cite{izmailov2018averaging} works by averaging the weights of multiple points in the trajectory of gradient descent based optimizers. The algorithm typically uses modified learning rate schedules. SWA is itself based on the idea of maintaining a running average of weights in stochastic gradient descent based optimization techniques~\cite{ruppert1988stochastic,polyak1992acceleration}. The principle idea in SWA is averaging the weights that are maximally distant helps stabilize the gradient descent based optimizer trajectory and improves generalization. ~\citet{izmailov2018averaging} use the analysis of~\citet{mandt2017stochastic} to illustrate the stability arguments where they show that, under certain convexity assumptions, SGD iterations can be visualized as sampling from a Gaussian distribution centred at the \emph{minima} of the loss function. Samples from high-dimensional Gaussians are expected to be concentrated \emph{on the surface of the ellipse} and not close to the \emph{mean}. Averaging iterations is shown to stabilize the trajectory and further improve the width of the solutions to be closer to the \emph{mean}. In this paper, we focus on the stability of deep neural models as a function of random-seeds. Our proposal is based on SWA, but we extend it to the extremes and call it \emph{Aggressive Stochastic Weight Averaging}. We assume that, for small batch size, the loss surface is locally convex. We further relax the conditions for the optimizer and assume that the optimizer is based on some version of gradient descent --- this means that our modification is valid even for other pseudo-first-order optimization algorithms including Adam~\cite{kingma2014adam} and Adagrad~\cite{duchi2011adaptive}. We note that, \citet{izmailov2018averaging} suggest using SWA usually after 'pre-'training the model (at least until $75\%$ convergence) and followed by sampling weights at different steps either using large constant or cyclical learning rates. While, SWA is well defined for convex losses~\cite{polyak1992acceleration}, \citet{izmailov2018averaging} connect SWA to non-convex losses by suggesting that the loss surface is~\emph{approximately} convex after convergence. In our setup, we investigate the utility of averaging weights over every iteration (an iteration consists of one batch of the gradient descent). Algorithm~\ref{alg:aswa} shows the implementation pseudo-code for SWA. We note that, unlike~\citet{izmailov2018averaging}, we average our weights at \textit{each batch} update and assign the ASWA parameters to the model at the end of each epoch. That is, we replace the model's weights for the next epoch with the averaged weights. \begin{algorithm}[h] \begin{algorithmic}[1] \Require\\ $e=$ Epoch number\\ $m=$ Total epochs\\ $i=$ Iteration number\\ $n=$ Total iterations\\ $\alpha=$ Learning rate\\ $\mathcal{O}=$ Stochastic Gradient optimizer function \end{algorithmic} $e \gets 0$\; \While{$e < m$}{ {$i \gets 1$} \While{$i \leq n$}{ $W_{swa} \gets W_{swa} + \frac{(W - W_{swa})}{(e*n + i + 1)}$\; $W \gets W - \mathcal{O}(\alpha, W)$\; $i \gets i + 1$ } $W \gets W_{swa}$\; $e \gets e + 1$ } \caption{Aggressive SWA algorithm} \label{alg:aswa} \end{algorithm} In Figure~\ref{fig:stable-preds}, we show an SGD optimizer (with momentum) and the same optimizer \emph{with SWA} over a $3$-dimensional loss surface with a saddle point. We observe that the original SGD reaches the desired minima, however, it almost reaches the saddle point and does a course correction and reaches minima. On the other hand, we observe that SGD with ASWA is very conservative, it repeatedly restarts and reaches the minima without reaching the saddle point. We empirically observe that this is a desired property for the stability of models over runs of the same model that differ only over random instantiations. The grey circles in Figure \ref{fig:stable-preds} highlight this conservative behaviour of SGD with ASWA optimizer, especially when compared to the standard SGD. Further, ~\citet{polyak1992acceleration} show that for convex losses, averaging SGD proposals achieves the highest possible rate of convergence for a variety of first-order SGD based algorithms. \begin{figure}[h] \centering \begin{subfigure}{0.88\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/imgb.png} \caption{Trajectory for Stochastic Gradient Descent} \label{fig:prd_cnn1} \end{subfigure}\par\medskip \begin{subfigure}{0.88\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/imga.png} \caption{Trajectory for Stochastic Gradient Descent with ASWA} \label{fig:prd_cnn2} \end{subfigure} \caption{Trajectory for gradient descent algorithms with red and black arrows on (b) indicating movements from consecutive epochs with restarts. Conservative behaviour of ASWA algorithm helps avoid the saddle point without ever reaching it.} \label{fig:stable-preds} \end{figure} \subsection{Norm-filtered Aggressive Stochastic Weight Averaging (NASWA)} \label{ssec:NASWA} \begin{algorithm}[h] \begin{algorithmic}[1] \Require\\ $e=$ Epoch number\\ $m=$ Total epochs\\ $i=$ Iteration number\\ $n=$ Total iterations\\ $\alpha=$ Learning rate\\ $\mathcal{O}=$ Stochastic Gradient optimizer function\\ $N_s=$ List of previous iterations' norm differences \end{algorithmic} $e \gets 0$\; \While{$e < m$}{ {$i \gets 1$} \While{$i \leq n$}{ $N_{cur} \gets \|W-W_{swa}\|_1$\; $N_{mean} \gets \frac{\sum_{i=1}^{|N_s|} N_s[i]}{|N_s|}$\; \eIf{$N_{cur} > N_{mean}$}{ $W_{swa} \gets W_{swa} + \frac{(W - W_{swa})}{(e*n + i + 1)}$\; $N_{s} \gets [N_{cur}]$\; }{ $N_{s} \gets N_{s} + [N_{cur}]$\; } $W \gets W - \mathcal{O}(\alpha, W)$\; $i \gets i + 1$ } $W \gets W_{swa}$\; $e \gets e + 1$ } \caption{Norm-filtered Aggressive SWA algorithm} \label{alg:naswa} \end{algorithm} We observe that the ASWA algorithm is especially beneficial when the norm difference of the parameters of the model are high. We hypothesise that in general, the norm difference indicates the divergence between optimizers' steps and we observe that the larger the norm difference, the greater the change in the trajectory. Therefore, we propose to maintain a list that stores the norm differences of the previous iterations. If the norm difference of the current iteration is greater than the average of the list, we update the ASWA weights and reinitialize the list with the current norm difference. When the norm difference, however, is less than the average of the list, we just append the current norm difference to the list. After the completion of the epoch, we assign the ASWA parameters to the model. This is shown in Algorithm~\ref{alg:naswa}. We call this approach \emph{Norm-filtered Aggressive Stochastic Weight Averaging}. \section{Experiments} \label{sec:experiemnts} We base our investigation on similar sets of models as~\citet{DBLP:journals/corr/abs-1902-10186}. We also use the code provided by the authors for our empirical investigations for consistency and empirical validation. We describe our models and datasets used for the experiments below. \subsection{Models} We consider two sets of commonly used neural models for the tasks of binary classification and multi-class natural language inference. We use CNN and bi-directional LSTM based models with attention. We follow~\cite{DBLP:journals/corr/abs-1902-10186} and use similar attention mechanisms using a) additive attention~\cite{bahdanau2014neural}; and b) scaled dot product based attention~\cite{vaswani2017attention}. We jointly optimize all the parameters for the model, unlike~\citet{DBLP:journals/corr/abs-1902-10186} where the encoding layer, attention layer and the output prediction layer are all optimized separately. We experiment with several optimizers including Adam~\cite{kingma2014adam}, SGD and Adagrad~\cite{duchi2011adaptive} but most results below are with Adam. % For our ASWA and NASWA based experiments, we use a constant learning rate for our optimizer. Other model-specific settings are kept the same as~\citet{DBLP:journals/corr/abs-1902-10186} for consistency. \begin{table}[h] \centering \resizebox{0.9\linewidth}{!}{ \begin{tabular}{crrr}\toprule \textbf{Dataset} & \textbf{Avg. Length} & \textbf{Train Size} & \textbf{Test size}\\ \midrule IMDB & 179 & 12500 / 12500 & 2184 / 2172\\ Diabetes(MIMIC) & 1858 & 6381 / 1353 & 1295 / 319\\ SST & 19 & 3034 / 3321 & 652/653 \\ Anemia(MIMIC) & 2188 & 1847 / 3251 & 460 / 802\\ AgNews & 36 & 30000 / 30000 & 1900 / 1900\\ ADR Tweets & 20 & 14446 / 1939 & 3636 / 487\\ SNLI & 14 & 182764 / 183187 / 183416 & 3219 / 3237 / 3368\\ \bottomrule \end{tabular}} \caption{Dataset characteristics. Train size and test size show the cardinality for each class. SNLI is a three-class dataset while the rest are binary classification} \label{tbl:dataset} \end{table} \subsection{Datasets} The datasets used in our experiments are listed in Table~\ref{tbl:dataset} with summary statistics. We further pre-process and tokenize the datasets using the standard procedure and follow~\citet{DBLP:journals/corr/abs-1902-10186}. We note that IMDB~\cite{maas2011learning}, Diabetes(MIMIC)~\cite{johnson2016mimic}, Anemia(MIMIC)~\cite{johnson2016mimic}, AgNews~\cite{zhang2015character}, ADR Tweets~\cite{nikfarjam2015pharmacovigilance} and SST~\cite{socher2013recursive} are datasets for the binary classification setup. SNLI~\cite{bowman2015large} is a dataset for the multiclass classification setup. All of the datasets are in English, however we expect the behavior to persist regardless of the language.% \subsection{Settings and Hyperparameters} We use a $300$-dimenstional embedding layer which is initialized with FastText~\cite{joulin2016fasttext} based free-trained embeddings for both CNN and the bi-directional LSTM based models. We use a $128$-dimensional hidden layer for the bi-directional LSTM and a $32$-dimensional filter with kernels of size $\{1,3,5,7\}$ for CNN. For others, we maintain the model settings to resemble the models in~\citet{DBLP:journals/corr/abs-1902-10186}. We train all of our models for 20 Epochs with a constant batch size of 32. We use early stopping based on the validation set using task-specific metrics (Binary Classification: using \texttt{roc-auc}, Multiclass and question answering based dataset: using \texttt{accuracy}). \begin{table}[h] \centering \resizebox{0.9\linewidth}{!}{ \begin{tabular}{crrr}\toprule \textbf{Dataset} & \textbf{CNN(\%)} & \textbf{CNN+ASWA(\%)} & \textbf{CNN+NASWA(\%)}\\ \midrule IMDB & 89.8 ($\pm$0.79) & 90.2 ($\pm$0.25) & 90.1 ($\pm$0.29) \\ Diabetes & 87.4 ($\pm$2.26) & 85.9 ($\pm$0.25) & 85.9 ($\pm$0.38) \\ SST & 82.0 ($\pm$1.01) & 82.5 ($\pm$0.39) & 82.5 ($\pm$0.39) \\ Anemia & 90.6 ($\pm$0.98) & 91.9 ($\pm$0.20) & 91.9 ($\pm$0.19)\\ AgNews & 95.5 ($\pm$0.23) & 96.0 ($\pm$0.11) & 96.0 ($\pm$0.07)\\ Tweet & 84.6 ($\pm$2.65) & 84.4 ($\pm$0.54) & 84.4 ($\pm$0.54) \\\bottomrule \end{tabular}} \caption{Performance statistics obtained from 10 differently seeded CNN based models. Table compares accuracy and its \textbf{standard deviation} for the normally trained CNN model against the ASWA and NASWA trained models, whose deviation drops significantly, thus, indicating increased robustness.} \label{tbl:acc_std} \end{table} \section{Results} In this section, we summarize our findings for $10$ runs of the model with $10$ different random seeds but with identical model settings. \subsection{Model Performance and Stability} We first report model performance and prediction stability. The results are reported in Table~\ref{tbl:acc_std}. \begin{table}[!h] \centering \resizebox{0.9\linewidth}{!}{ \begin{tabular}{crrr}\toprule \textbf{Dataset} & \textbf{LSTM(\%)} & \textbf{LSTM+ASWA(\%)} & \textbf{LSTM+NASWA(\%)}\\ \midrule IMDB & 89.1 ($\pm$1.34) & 90.2 ($\pm$0.32) & 90.3 ($\pm$0.17) \\ Diabetes & 87.7 ($\pm$1.44) & 87.7 ($\pm$0.60) & 87.8 ($\pm$0.55) \\ SST & 81.9 ($\pm$1.11) & 82.0 ($\pm$0.60) & 82.1 ($\pm$0.57) \\ Anemia & 91.6 ($\pm$0.49) & 91.8 ($\pm$0.34) & 91.9 ($\pm$0.36)\\ AgNews & 95.5 ($\pm$0.32) & 96.1($\pm$0.17) & 96.1 ($\pm$0.10)\\ Tweet & 84.7 ($\pm$1.79) & 83.8 ($\pm$0.45) & 83.9 ($\pm$0.45) \\\bottomrule \end{tabular}} \caption{Performance statistics obtained from 10 differently seeded LSTM based models.} \label{tbl:acc_std_lstm} \end{table} We note that the original CNN based models, on an average, have a standard deviation of $\pm 1.5\%$. Which seems standard, however, we note that ADR Tweets~dataset has a very high standard deviation of $\pm 2.65\%$. We observe that ASWA and NASWA are almost always able to achieve higher performance with a very low standard deviation. This suggests that both ASWA and NASWA are extremely stable when compared to the standard model. They significantly improve the robustness, on an average, by $72\%$ relative to the original model and on Diabetes (MIMIC), a binary classification dataset, by $89\%$ (relative improvement). We observe similar results for the LSTM based models in Table~\ref{tbl:acc_std_lstm}. \begin{figure}[h] \centering \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-cnn.png} \caption{CNN models} \label{fig:prd_cnn} \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-lstm.png} \caption{LSTM models} \label{fig:prd_lstm} \end{subfigure} \caption{Prediction's standard deviation for CNN and LSTM based models for all binary classification datasets under consideration. Predictions are bucketed in intervals of size 0.1, starting from 0 (containing predictions from 0 to 0.1), until 0.9} \end{figure} We further analyze the prediction score stability by computing the mean standard deviation over the binned confidence intervals of the models in Figure~\ref{fig:prd_cnn}. We note that on an average, the standard deviations are on the lower side. However, we observe that the mean standard deviation of the bins close to $0.5$ is on the higher side as is expected given the high uncertainty. On the other hand both, ASWA and NASWA based models are relatively more stable than the standard CNN based model. We observe similar behaviours for the LSTM based models in Figure~\ref{fig:prd_lstm}. This suggests that our proposed methods, ASWA and NASWA, are able to obtain relatively better stability without any loss in performance. We also note that both ASWA and NASWA had relatively similar performance over more than $10$ random seeds. \subsection{Attention Stability} \begin{figure}[h] \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/entropy-all.png} \caption{CNN models} \label{fig:atn_cnn} \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/entropy-all-lstm.png} \caption{LSTM models} \label{fig:atn_lstm} \end{subfigure} \caption{Average attention entropy against the bucketed predictions for CNN and LSTM based models. Figure highlights the high entropy between attention based distributions from differently seeded models (especially for the Diabetes-MIMIC datatset), indicating towards model instability.} \end{figure} We now consider the stability of attention distributions as a function of random seeds. We first plot the results of the experiments for \emph{standard} CNN based binary classification models over uniformly binned prediction scores for positive labels in Figure~\ref{fig:atn_cnn}. We observe that, depending on the datasets, the attention distributions can become extremely unstable (high entropy). We specifically highlight the Diabetes(MIMIC) dataset's entropy distribution. We observe similar, but relatively worse results for the LSTM based models in Figure~\ref{fig:atn_lstm}. In general, we would expect the entropy distribution to be close to zero however, this doesn't seem to be the case. This means that using attention distributions to interpret models may not be reliable and can lead to misinterpretations. \begin{figure}[h] \centering \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/jaccard-all-cnn.png} \caption{CNN models} \label{fig:std_jaccard_cnn} \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/jaccard-all-lstm.png} \caption{LSTM models} \label{fig:std_jaccard_lstm} \end{subfigure} \caption{Jaccard distance highlighting instability in attention distributions of CNN and LSTM based models.} \end{figure} \begin{figure}[h] \centering \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-cnn-ASWA.png} \caption{CNN+ASWA} % \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-cnn-NASWA.png} \caption{CNN+NASWA} \end{subfigure}\par\medskip \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-lstm-ASWA.png} \caption{LSTM+ASWA} \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \includegraphics[width=\linewidth,keepaspectratio]{figures/pred-all-lstm-NASWA.png} \caption{LSTM+NASWA} \end{subfigure} \caption{Improved prediction stability from ASWA and NASWA for CNN and LSTM based models} \end{figure} \begin{figure}[h] \begin{subfigure}{0.45\linewidth} \centering \includegraphics[width=\linewidth,keepaspectratio]{figures/jaccard-Diabetes-cnn-gradient.png}\hfill \caption{Diabetes} \end{subfigure}\hfill \begin{subfigure}{0.45\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/jaccard-sst-cnn-gradient.png}\hfill \caption{SST} \end{subfigure} \caption{Gradient based interpretations' stability improvement from NASWA on CNN based models. The Jaccard distance is calculated using the top 20\% attentive items.} \label{fig:grad_stab} \end{figure} \begin{figure*} \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=\linewidth,keepaspectratio]{figures/imdb-cnn.png}\hfill \caption{IMDB} \label{sfig:aswa_imdb} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/Diabetes-cnn.png}\hfill \caption{Diabetes} \label{sfig:aswa_diab} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/sst-cnn.png}\hfill \caption{SST} \end{subfigure}\par\medskip \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/Anemia-cnn.png}\hfill \caption{Anemia} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/AgNews-cnn.png}\hfill \caption{AgNews} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/tweet-cnn.png}\hfill \caption{ADR Tweets} \end{subfigure} \caption{Attention stability improvement from ASWA and NASWA on CNN based models.} \label{fig:attn_stab_imp} \end{figure*} \begin{figure*}[!h] \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=\linewidth,keepaspectratio]{figures/snli0-cnn.png}\hfill \caption{Label 0 prediction vs entropy} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/snli1-cnn.png}\hfill \caption{Label 1 prediction vs entropy} \end{subfigure}\hfill \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/snli2-cnn.png}\hfill \caption{Label 2 prediction vs entropy} \end{subfigure} \caption{Attention stability improvement from ASWA and NASWA on CNN based model for the SNLI dataset.} \label{fig:snli_cnn_entropy} \end{figure*} We use the top $20\%$ of the most important items (indices) in the attention distribution for each dataset over $10$ runs and plot the Jaccard distances for CNN and LSTM based models in Figure~\ref{fig:std_jaccard_cnn} and Figure~\ref{fig:std_jaccard_lstm}. We again notice a similar trend of unstable attention distributions over both CNN and LSTM based attention distribution. In the following sections for space constraints, we focus on CNN based models with additive attention. Our results on LSTM based models are provided in the attached supplementary material. We note that the observations for LSTM models are, in most cases, similar to the behaviour of the CNN based models. Scaled dot-product based models are also provided in the supplementary material and we notice a similar trend as the additive attention. We now focus on the effect of ASWA and NASWA on binary and multi-class CNN based neural models separately. \paragraph{Binary Classification} In Figure~\ref{fig:attn_stab_imp}, we plot the results of the models with ASWA and NASWA. We observe that both these algorithms significantly improve the model stability and decrease the entropy between attention distributions. For example, in Figure~\ref{sfig:aswa_diab}, both ASWA and NASWA decrease the average entropy by about $60\%$. We further notice that NASWA is slightly better performing in most of the runs. This empirically validates the hypothesis that averaging the weights from divergent weights (when the norm difference is higher than the average norm difference) helps in stabilizing the model's parameters, resulting in a more robust model. \paragraph{Multi-class Classification} In Figure \ref{fig:snli_cnn_entropy}, we plot the entropy between the attentions distributions of the models for the SNLI dataset (CNN based model), separately for \emph{each label} (\emph{neutral}, \emph{contradiction}, and \emph{entailment}). We notice, similar observations as the binary classification models, the ASWA and NASWA algorithms are able to significantly improve the entropy of the attention distributions and increases the robustness of the model with random seeds. \subsection{Gradient-based Interpretations} We now look at an alternative method of interpreting deep neural models and look into the consistency of the gradient-based interpretations to further analyze the model's instability. For this setup, we focus on binary classifier and plot the results on the SST and the Diabetes dataset in particular since they cover the low and the high end of the entropy spectrum (respectively). We notice similar trends of instability in the gradient-based interpretations from model inputs as we did for the attention distributions. Figure \ref{fig:grad_stab} shows that the entropy between the gradient-based interpretations from differently seeded models closely follows the same trend as the attention distributions. This result further strengthens our claim on the importance of model stability and shows that over different runs of the same model with different seeds, we may get different interpretations using gradient-based feature importance. Moreover, Figure \ref{fig:grad_stab} shows the impact of ASWA towards making the gradient-based interpretations more consistent, thus, significantly increasing the stability. \subsection{LIME based Interpretations} We further evaluated the surrogate model based interpretability using LIME~\cite{ribeiro2016model}. LIME obtains a locally linear approximation of the model's behaviour for a given sample by perturbing it and learning a sparse linear model around it. We focus on AgNews and SST based datasets and obtain interpretability estimates using LIME. Once again, we notice a similar pattern of instability as the other two interpretability methods. In Figure~\ref{fig:lime_stab} we present our results from the LIME based interpretations with Jaccard distance as the measure. Note that we measure the Jaccard distance over the top $20\%$ most influential items. We observe once again that NASWA helps in reducing the instability and results in more consistent interpretations. \begin{figure} \begin{subfigure}{0.5\linewidth} \centering \includegraphics[width=\linewidth,keepaspectratio]{figures/jaccard-AgNews-cnn-lime.png}\hfill \caption{AgNews} \end{subfigure}\hfill \begin{subfigure}{0.5\linewidth} \centering \includegraphics[width=1.0\linewidth,keepaspectratio]{figures/jaccard-sst-cnn-lime.png}\hfill \caption{SST} \end{subfigure} \caption{LIME based interpretations' stability improvement from NASWA on CNN based models. The Jaccard distance is calculated using the top 20\% attentive items.} \label{fig:lime_stab} \end{figure} In all our experiments, we find that a significant proportion of interpretations are dependent on the instantiation of the model. We also note that we perform experiments over $100$ random seeds for greater statistical power and see similar patterns\footnote{These results are provided in the appendix.}. % \section{Discussion} Recent advances in adversarial machine learning~\cite{neelakantan2015adding,zahavy2016ensemble} have investigated robustness to random initialization based perturbations, however, to our knowledge, no previous study investigates the effect of random-seeds and its connection on model interpretation. Our study analyzed the inherent lack of robustness in deep neural models for NLP. Recent studies cast doubt on the consistency and correlations of several types of interpretations~\cite{doshi2017towards,DBLP:journals/corr/abs-1902-10186,feng2018pathologies}. We hypothesise that some of these issues are due to the inherent instability of the deep neural models to random-seed base perturbations. % Our analysis (in Section~\ref{sec:experiemnts}) leads to the hypothesis that models with different instantiations may use completely different optimization paths. The issue of variance in all black-box interpretation methods over different seeds will continue to persist until the models are fully robust to random-seed based perturbations. Our work however, doesn't provide insights into instabilities of different layers of the models. We hypothesise that it might further uncover the reasons for the relatively lower correlation between different black-box interpretation methods as these are effectively based off on different layers and granularity. There has been some work on using noisy gradients~\cite{neelakantan2015adding} and learning from adversarial and counter-factual examples~\cite{feng2018pathologies} to increase the robustness of deep learning models.~\citet{feng2018pathologies} show that neural models may use redundant features for prediction and also show that most of the black-box interpretation methods may not be able to capture these second-order effects. Our proposals show that aggressively averaging weights leads to better optimization and the resultant models are more robust to random-seed based perturbation. However, our research is limited to increasing consistency in neural models. Our approach further uses first order based signals to boost stability. We posit that second-order based signals can further enhance consistency and increase the robustness.% \section{Conclusions} In this paper, we study the inherent instability of deep neural models in NLP as a function of random seed. We analyze model performance and robustness of the model in the form of attention based interpretations, gradient-based feature importance and LIME based interpretations across multiple runs of the models with different random seeds. Our analysis strongly highlights the problems with stability of models and its effects on black-box interpretation methods leading to different interpretations for different random seeds. We also propose a solution that makes use of weight averaging based optimization technique and further extend it with norm-filtering. We show that our proposed methods largely stabilize the model to random-seed based perturbations and, on average, significantly reduce the standard deviations of the model performance by $72\%$. We further show that our methods significantly reduce the entropy in the attention distribution, the gradient-based feature importance measures and LIME based interpretations across runs.
\section{INTRODUCTION} \label{sec.intro} Quarkonia, mesonic bound states of heavy quark and antiquark, have played a very important role in our understanding of the physics of strong interactions. The experimental signatures of some of these states are distinctive, the most iconic being the dileption peak of the vector quarkonia. In the theoretical side, the heavy quark mass, $M_Q \gg \Lambda_{\scriptscriptstyle \rm QCD}$, leads to simplifications. The earliest insights about properties of quarkonia states were obtained by treating them as nonrelativistic states bound by a color electric potential. The potential suitable for studies of quarkonia has been calculated in detail using numerical Monte Carlo studies on lattice-regularized QCD; see, e.g., Ref. \cite{bali} for a review. The potential remains an important ingredient in a systematic expansion of quarkonia in $1/M_{\scriptscriptstyle Q}$ \cite{pnrqcd}. The dilepton peaks of the vector quarkonia, in particular that of the $J/\psi$, have been extremely important signatures of creation of quark-gluon plasma (QGP) in ultrarelativistic heavy ion collisions (URHIC), following the suggestion three decades ago \cite{satz} that the screening of the color charge inside QGP will lead to dissolution of bound states. This was made more quantitative in follow-up studies \cite{digal}. The early studies used a perturbative Debye-screened form, \beq V^{\rm re}_{\scriptscriptstyle T}(\vec{r}) = - \frac{\alpha(T)}{r} e^{- m_{\scriptscriptstyle D} r} \eeq{debye} which is the free energy of a static $Q \bar{Q}$ pair in perturbative QGP. Here $m_{\scriptscriptstyle D}$ is the Debye mass, $\alpha = \frac{\textstyle 4}{\textstyle 3} \; \frac{\textstyle g^2}{\textstyle 4 \pi}$, and $g$ is evaluated at a scale determined by the temperature $T$. Nonperturbatively, the free energy of $Q-\bar{Q}$ pair in plasma was calculated using lattice QCD \cite{zantow}, which was used as a proxy for an effective finite temperature potential. However, in the early days a proper formalism for potential-based study of quarkonia in QGP was missing. In particular, other thermodynamic quantities can be derived from the free energy, e.g., an ``internal energy'' for the $Q \bar{Q}$ pair \cite{internal}; the use of such quantities have also been explored in the literature \cite{wong}. A theoretical formalism for an ``effective finite temperature potential'', that can be used to study experimentally observed quantities like the dilepton rate, was first provided in ref. \cite{impot}. The starting point is a point-split version of the dilepton current, \beq J^\mu_{\vec{r}}(t,\vec{x}) = \bar{Q}\left(t,\vec{x}+\frac{\vec{r}}{2}\right) \gamma^\mu \; \mathbb{U}\left(t; \vec{x}+\frac{\vec{r}}{2}, \vec{x}-\frac{\vec{r}}{2} \right) Q \left(t,\vec{x}-\frac{\vec{r}}{2}\right), \eeq{pointsplit} where $\mathbb{U}$ is a suitable gauge connection such that $V^\mu$ is gauge invariant, and the angular brackets denote thermal average. Defining the correlation function \beq C_>(t, \vec{r}) = \int d^3x \; \left\langle J^\mu_{\vec{r}}(t,\vec{x}) \, J_{\mu,\vec{r}}(0,\vec{x}) \right\rangle \eeq{cgt} the spectral function $\rho_{\scriptscriptstyle J}(\omega, \vec{r}; T)$ is defined from its Fourier transform, \beq \rho_{\scriptscriptstyle J}(\omega, \vec{r}; T) \ = \ \left(1 \, - \, e^{-\omega/T}\right) \ \int dt \; e^{i \omega t} \; C_>(t, \vec{r}). \eeq{spectral} The dilepton rate is proportional to the spectral function of the point current, $\rho(\omega; T) = \lim_{\vec{r} \to 0} \rho_{\scriptscriptstyle J}(\omega, \vec{r}; T)$. Since we are interested in heavy quarks with $M_{\scriptscriptstyle Q} \gg T, \, \Lambda_{\scriptscriptstyle \rm QCD}$, \eqn{cgt} simplifies. Going to the nonrelativistic notation $Q=\dbinom{\psi}{\chi}$ where $\psi, \ \chi$ are nonrelativistic fields that annihilate a quark and create an antiquark, respectively, and remembering that since $M_{\scriptscriptstyle Q} \gg T$, the thermal states do not include $Q$ fields, the leading ($M_{\scriptscriptstyle Q}^0$) term in an $1/M_{\scriptscriptstyle Q}$ expansion gives \beq C_>(t, \vec{r}) \equiv \int d^3x \, \left\langle \chi^\dagger\left(t,\vec{x} -\frac{\vec{r}}{2}\right) \sigma_k \; \mathbb{U}^\dagger \psi\left(t,\vec{x}+\frac{\vec{r}}{2}\right) \ \psi^\dagger\left(0,\vec{x}+\frac{\vec{r}}{2}\right) \sigma_k \, \mathbb{U} \, \chi \left(0,\vec{x}-\frac{\vec{r}}{2}\right) \right\rangle. \eeq{nrc} If one has a system where the sole interaction term is a potential $V(\vec{r})$ between the quark and the antiquark, then it is easy to show that, to leading order in $1/M_{\scriptscriptstyle Q}$, $C_>(t, \vec{r})$ satisfies \cite{blaizot7} \beq \left( i \, \partial_t \, - \, \frac{\nabla_{\vec{r}}^2}{M_{\scriptscriptstyle Q}} \right) C_>(t, \vec{r}) \ = \ V(\vec{r}) \; C_>(t, \vec{r}) . \eeq{nr} In our theory where the $Q \bar{Q}$ are interacting with the thermal medium, we can then define a potential by equating the left hand side of \eqn{nr} to $V(t, \vec{r}) \; C_>(t, \vec{r})$ (staying within leading order of $1/M_{\scriptscriptstyle Q}$), where the interaction effects are summarized in a time-dependent $V(t, \vec{r})$. An effective thermal potential, $V_{\scriptscriptstyle T}(\vec{r})$, can then be defined in the large $t$ limit, if the limit exists: $V_{\scriptscriptstyle T}(\vec{r}) = \lim_{t \to \infty} V(t, \vec{r})$. The potential $V_{\scriptscriptstyle T}(\vec{r})$ can be obtained by going to the static limit, where, modulo renormalization factor, $C_>(t, \vec{r})$ reduces to a Minkowski-time Wilson loop: \beq W_M(t, \vec{r}) \ = \ \frac{1}{3} \, {\rm Tr} \; \mathbb{P} \, e^{i \int_0^t dt_1 A_0(t_1,\vec{r}/2)} \; \mathbb{U}\left(t; \vec{r}/2, -\vec{r}/2\right) \; \mathbb{P} \, e^{i \int_t^0 dt_2 A_0(t_2, -\vec{r}/2)} \mathbb{U}\left(0; -\vec{r}/2,\vec{r}/2 \right) \eeq{wm} and \eqn{nr} reduces to \beq i \, \partial_t \; \log W_M(t, \vec{r}) \xrightarrow[t \to \infty]{} V_{\scriptscriptstyle T}(\vec{r}), \eeq{pot} which defines our thermal potential \cite{impot,blaizot7}. Using $V_{\scriptscriptstyle T}(\vec{r})$ to calculate $C_>(t, \vec{r})$ from \eqn{nr} will give the resummation of the leading ladder diagrams. A calculation of $V_{\scriptscriptstyle T}(\vec{r})$ in leading order hard thermal loop (HTL) perturbation theory gives \cite{impot} \begin{eqnarray} V_{\scriptscriptstyle T}(\vec{r}) &=& V^{\rm re}_{\scriptscriptstyle T}(\vec{r}) \ - \ i \, V^{\rm im}_{\scriptscriptstyle T}(\vec{r}), \qquad {\rm where} \nonumber \\ V^{\rm im}_{\scriptscriptstyle T}(\vec{r}) &=& \alpha \, T \times \int\limits_0^\infty dz \, \frac{2 z}{\left(z^2+1\right)^2} \left[ 1 - \frac{\sin z x}{z x} \right] \label{htl} \end{eqnarray} and $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ is given in \eqn{debye}. In \eqn{htl} we have absorved a negative sign in the definition of $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$, so that $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ takes positive values. $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ corresponds to the usual physics of Debye screening in medium, such that for sufficiently large screening, the bound states will not form. On the other hand, $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ clearly leads to a broadening of the spectral function peak. It captures the physics of collision with the thermal particles leading to a decoherence of the $Q \bar{Q}$ wavefunction \cite{ar,akamatsu}. For the quark and antiquark far apart, $r \gg T$, $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ reaches a finite limit $\alpha T$ giving the damping rate of the individual quarks \cite{blaizot7}. It is well-known that the perturbative calculation, \eqn{htl}, is not suitable at temperatures $\lesssim$ a few times $T_c$, the deconfinement temperature. The aim of this paper is to make a nonperturbative calculation of an effective thermal potential, using numerical lattice gauge theory techniques. Following the insight of Ref. \cite{impot}, various authors have tried calculating the thermal potential nonperturbatively. In the next section we will outline our strategy. More details, and some discussion on difference from earlier studies, can be found in \scn{results}. The potential description, \eqn{nr}, is of course an approximate description of in-medium quarkonia. First, here the $Q \bar{Q}$ pair is treated as an external probe put in an equilibrium plasma. Then (in the perturbative language) it accounts for a subclass of diagrams. At zero temperature, the justification for this is well-understood. At finite temperature, extra scales come into play, making the picture more complicated. A systematic, effective field theory based study of the interplay of these scales has been made in Ref. \cite{pnrqcdT} in perturbation theory. In the hierarchy of scales \[ M \gg \pi T \gg 1/r_B \gtrsim m_{\scriptscriptstyle D} \sim gT \gg E_B \] one gets the potential \eqn{htl}, where $r_B$ is the radius of the bound state and $E_B$ the binding energy. For the temperatures of interest in heavy ion collision experiments, this hierarchy of scales is hardly satisfied. The effective field theory version, however, is perturbative and therefore cannot be directly used for phenomenology. Instead of going through the nonrelativistic potential route, one could instead try to directly calculate the spectral function by studying the Euclidean $\langle J_\mu J_\mu \rangle$ correlation function and try to extract the spectral function from it. This has been attempted for charmonia \cite{mem} and, using NRQCD, for bottomonia \cite{memnr1,memnr2}. Unfortunately, the extraction of spectral function from the Euclidean correlator is a notoriously difficult problem, and the systematics are large (see \cite{review} for a discussion, and \cite{mocsy} for early comparison of potential model results with results of \cite{mem}). Therefore a nonperturbatively determined potential continues to be important for quarkonia phenomenology; see, e.g., \cite{pheno}. In recent years, there have also been attempts to come out of the picture of external probe in equilibriated plasma, by treating the quarkonia in plasma as an open quantum system \cite{akamatsu,blaizot15,brambilla,miura}. The potential remains an important structure in such frameworks \cite{blaizot15,miura}. The plan of the rest of the paper is as follows. After explaining the calculational methodology in the next section, in \scn{lat} we will give the calculational details. \scn{results} will give our results for the potential. Some phenomenological discussions and implications of the potential obtained will be discussed in \scn{pheno}, and the last section will have a summary and discussion. \section{Nonperturbative study of finite temperature potential} \label{sec.def} The potential $V_{\scriptscriptstyle T}(\vec{r})$ is directly related to the Minkowski space Wilson loop, \eqn{pot}. But in numerical Monte Carlo studies we work in Euclidean space. At zero temperature, it is straightforward to calculate the $Q \bar{Q}$ potential from the Euclidean Wilson loop: \beq W(\tau, \vec{r}) \xrightarrow[\tau \to \infty]{} C(\vec{r}) \, e^{-\tau \, V(\vec{r})} . \eeq{0Tform} At finite temperature, the simple spectral decomposition outlined in \eqn{0Tform} does not work. The first attempt to extract the $Q \bar{Q}$ potential from $W_{\scriptscriptstyle T}(\tau, \vec{r})$ was carried out in Ref. \cite{rhs}. The spectral decomposition of the Minkowski-time loop leads to \cite{rhs} \beq W_{\scriptscriptstyle T}(\tau, \vec{r}) \; = {\int_{- \infty}^\infty d\omega \ e^{-\omega \, \tau} \ \rho(\omega, \vec{r}; T)} \Rrightarrow V_{\scriptscriptstyle T}(\vec{r}) \; = \; - \partial_\tau \, \log \, W_{\scriptscriptstyle T}(\tau, \vec{r}) \; = \; \frac{\int_{- \infty}^\infty d\omega \ \omega \ e^{-\omega \, \tau} \ \rho(\omega, \vec{r}; T)}{\int_{- \infty}^\infty d\omega \ e^{-\omega \, \tau} \ \rho(\omega, \vec{r}; T)} . \eeq{poteucl} Bayesian techniques were used to extract $\rho(\omega, \vec{r}; T)$ from $W_{\scriptscriptstyle T}(\tau, \vec{r})$, and then calculate the potential using \eqn{poteucl}. The reconstruction of $\rho(\omega, \vec{r}; T)$ from $W_{\scriptscriptstyle T}(\tau, \vec{r})$ is a notoriously unstable problem. To make matters worse, the quality of the Wilson loop data deteriorates quickly at large $\tau$ (this problem can be somewhat alleviated with recent numerical techniques \cite{multilevel}). While very impressive technological improvements have occurred in the Bayesian analysis techniques, the results obtained for potential still have stability issues or have large errorbars, especially for $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$. The first calculations \cite{rhs} employed a Bayesian analysis method similar to Maximum entropy and fitted the spectral function peak with a Lorentzian form. The results obtained, however, are substantially different from a later analysis \cite{bkr} which is of similar philosophy but employs a slightly different Bayesian analysis, and fits to a skew-Lorentzian form \cite{br1}. The state-of-the-art for calculations in the gluonic plasma follow a similar methodology and can be seen in Ref. \cite{br2}. Studies have also been carried out for full QGP (i.e. with thermal quarks), both with a Lorentzian form of the spectral function \cite{pw} and using Bayesian reconstruction methods \cite{prw}. While the improvement in the analysis method has been impressive, the results still suffer from stability issues; in particular, it is not easy to disentangle the effects of $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ and $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ in $W_{\scriptscriptstyle T}(\tau, \vec{r})$. In this paper we take a different approach. Let us motivate it by writing \beq W_{\scriptscriptstyle T}(\tau, \vec{r}) \ = \ e^{w(\tau, \vec{r})} \ W_{\scriptscriptstyle T}(\beta/2). \eeq{logdef} The physics of $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ is very similar to that of the zero temperature potential, \eqn{0Tform}. We therefore expect the real part of the potential to come from the part of $w(\tau, \vec{r})$ which has a linear behavior around $\beta/2$: $\tilde{w}(\tau, \vec{r}) \sim - (\tau - \beta/2) V^{\rm re}_{\scriptscriptstyle T}(\vec{r}) + ...$. We isolate the $\tilde{w}$ part by splitting $W_{\scriptscriptstyle T}(\tau, \vec{r})$ as follows: \bea W_{\scriptscriptstyle T}(\tau, \vec{r}) &=& W^a_{\scriptscriptstyle T}(\tau, \vec{r}) \times W^p_{\scriptscriptstyle T}(\tau, \vec{r}), \nonumber \\ W^a_{\scriptscriptstyle T}(\tau, \vec{r}) &=& \sqrt{\frac{W_{\scriptscriptstyle T}(\tau, \vec{r})}{W_{\scriptscriptstyle T}(\beta-\tau, \vec{r})}}, \label{wsplit} \\ W^p_{\scriptscriptstyle T}(\tau, \vec{r}) &=& \sqrt{W_{\scriptscriptstyle T}(\tau, \vec{r}) \times W_{\scriptscriptstyle T}(\beta-\tau, \vec{r})}. \nonumber \eea We find that $B(\tau, \vec{r}) = \log W^a_{\scriptscriptstyle T}(\tau, \vec{r})$ has exactly the behavior we were expecting: $B(\tau, \vec{r}) \sim \left( \frac{\textstyle \beta}{\textstyle 2} \, - \, \tau \right) V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ over a large range of $\tau$ around $\beta/2$. We illustrate this in \fgn{plateau}, where $B(\tau, \vec{r})/(\beta/2-\tau)$ is plotted. We also checked that for configurations below $T_c$, where we can extract the potential from the full wilson loop, $W^a_{\scriptscriptstyle T}(\tau, \vec{r})$ gives the same result but reaches the plateau sooner. In order to understand the behavior of $W^p_{\scriptscriptstyle T}(\tau, \vec{r})$, we write a spectral decomposition for $A(\tau, \vec{r}) \ = \log W^p_{\scriptscriptstyle T}(\tau, \vec{r})$: \beq A(\tau, \vec{r}) \ = \ \int_{- \infty}^\infty d\omega \ \sigma(\omega; T) \ \frac{1}{2} \left( e^{-\omega \tau} \, + \, e^{-\omega (\beta - \tau)} \right) \ \ + \, {\rm \tau-independent \ terms}. \eeq{argsplit} To go to the potential, we follow the usual route of going to real time $\tau \to i t$: \beq i \partial_t A(i t) \ = \ \int_{- \infty}^\infty d\omega \ \sigma(\omega; T) \ \frac{\omega}{2} \left( e^{-i \omega t} \, - \, e^{-\omega \beta} e^{i \omega t} \right) . \eeq{arg2} The potential is obtained in the large time limit of \eqn{arg2}, when the oscillating factors $\exp(\pm i \omega t)$ ensure that only the $\omega \to 0$ contribution to the integral survives. In this limit $\exp(\beta \omega) \to 1$ and it is obvious from \eqn{arg2} that $A(i t)$ leads to an imaginary potential. One can then extract the real and imaginary parts of the potential from $W^a_{\scriptscriptstyle T}(\tau, \vec{r})$ and $W^p_{\scriptscriptstyle T}(\tau, \vec{r})$ respectively \cite{impot}, \bea V^{\rm re}_{\scriptscriptstyle T}(\vec{r}) &=& \lim_{t \to \infty} i \, \partial_t \, \log W^a_{\scriptscriptstyle T}(\tau, \vec{r})|_{\tau \to it} \nonumber \\ -i \, V^{\rm im}_{\scriptscriptstyle T}(\vec{r}) &=& \lim_{t \to \infty} i \, \partial_t \, \log W^p_{\scriptscriptstyle T}(\tau, \vec{r})|_{\tau \to it}. \label{vsplit} \eea The argument above is motivated by perturbative studies of the potential, where the split \eqn{vsplit} has been noted \cite{impot}. Even with \eqn{vsplit}, it is not obvious that the extraction of the potential from the Euclidean correlation function is simple; \eqn{vsplit} involves large Minkowski time, while the nonperturbative data that can be obtained from the lattice is in Euclidean time $\tau \in [0, \beta)$. Successful extraction of potential from \eqn{vsplit} is contingent upon the contribution from the ``potential modes'' dominating the behavior of the correlation functions $A(\tau, \vec{r}), B(\tau, \vec{r})$. Fortunately, this is what was found in the behavior of the nonperturbative data. As we already discussed above and showed in \fgn{plateau}, over a large range of $\tau$, $W^a_{\scriptscriptstyle T}(\tau, \vec{r}) \sim \exp(-c \tau)$, leading to a straightforward extraction of $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ from the slope of the exponent. We actually obtained very similar plateau in all our lattices. See \scn{real} for more discussion. \bef \centerline{\includegraphics[width=7cm]{set3_1.5Tc_re_plateau.eps}\hspace{1cm} \includegraphics[width=7cm]{set3_1.5Tc_im_plateau.eps}} \caption{(Left) ``Local mass'' plot from $W_{\scriptscriptstyle T}(\tau, \vec{r})$ and $W^a_{\scriptscriptstyle T}(\tau, \vec{r})$ for Set 3, 1.5 $T_c$, at three different values of $R=r/a_s$. The results are from smeared Wilson loops. (Right) $\partial_\tau W^p_{\scriptscriptstyle T}(\tau, \vec{r})$ for the same set; the lines show the singular structure contribution (\eqn{imspectral}; see text).} \eef{plateau} One, of course, does not expect such a simple behavior from $A(\tau, \vec{r})$: \eqn{argsplit} rules out a simple linear behavior near $\beta/2$. This is expected: if $W^p_{\scriptscriptstyle T}(\tau, \vec{r})$ had a linear exponential falloff, it would have contributed to a real potential! The large time behavior of $W^p_{\scriptscriptstyle T}(\tau \to it, \vec{r})$ can be inferred from a closer examination of \eqn{arg2}, using the fact that in the limit of large $t$, $\exp(-i \, \omega \, t) \, - \, \exp(i \, \omega \, t \, - \, \omega \, \beta) \longrightarrow - 2 \pi \, i \, \omega \, \delta(\omega)$. Then in order to get a potential $-i \, V^{\rm im}_{\scriptscriptstyle T}(\vec{r}) = \lim_{t \to \infty} i \, \partial_t \, A(it)$ we need \beq \sigma(\omega; T) \ \underset{\omega \to 0}{\thicksim} \ \frac{1}{\omega^2} \; \left( 1 + \mathcal{O}(\omega) \right). \eeq{imspectral} Interestingly, this leading singularity structure gives a very good qualitative description of the $\tau$ dependence of $\partial_\tau A(\tau, \vec{r})$. This is illustrated in the right panel of \fgn{plateau}. The argument in this section is based on the assumption that a thermal potential can be defined using \eqn{pot}. We then make plausibility arguments on the structure of $W_{\scriptscriptstyle T}(\tau, \vec{r})$, and show that the nonperturbative lattice data supports this structure. The arguments leading to \eqn{vsplit} can be made more concrete using Feynman diagrammatic language \cite{blaizot7}: in \apx{pert} we outline this argument. There we also show the results of the leading order HTL perturbation calculation of $W_{\scriptscriptstyle T}(\tau, \vec{r})$ \cite{impot}, which fully supports the structures of $A(\tau, \vec{r})$ and $B(\tau, \vec{r})$ discussed above, and which motivated this nonperturbative study. The $1/\omega^2$ behavior in \eqn{imspectral} comes from the term $\frac{\textstyle \rho(\omega)}{\textstyle \omega^2}$ and a distribution function, $(1 + n_{\scriptscriptstyle B}(\omega)) \xrightarrow{\omega \to 0} \frac{\textstyle T}{\textstyle \omega}$, which follows from the structure of the time-ordered propagator (see \apx{pert} and \eqn{diag}). It is connected to the scattering origin of the imaginary part of the potential, discussed below \eqn{htl}. Our strategy for extraction of the potential is therefore straightforward: we extract $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ from a linear fit to $B(\tau, \vec{r})$ and to get $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$, we expand $\sigma(\omega; T)$ in \eqn{argsplit} in the basis $(1+n_{\scriptscriptstyle B}(\omega)) \left\{1/\omega, \; \omega, ... \right\}$, and extract $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ from the coefficient of the most singular term. As \fgn{plateau} suggests, the leading terms dominate the data around $\beta/2$, allowing us to extract the potential relatively simply. We discuss further details in \scn{results}. \section{Technical details of our study} \label{sec.lat} In this work, we have calculated the $Q \bar{Q}$ potential in a gluonic plasma, for moderately high temperatures $\le 2 T_c$. We have generated lattices with a space-time anisotropic discretization with $\xi = a_s / a_\tau \approx 3$. A convenient algorithm for doing this is given in \cite{klassen}. We follow this reference to estimate the lattice parameters we require. The anisotropy is estimated nonperturbatively from comparison of spatial and temporal Wilson loops \cite{klassen}, while $a_\tau$ is estimated from the string tension calculated from temporal Wilson loops. We use three sets of lattices, with $a_\tau$ ranging between $1/19 T_c$ and $1/45 T_c$. For each set, we change the temperature by changing $N_\tau$, while keeping the spatial volume fixed. For each set, we first make short Monte Carlo runs at closely spaced $N_\tau$ to find the $N_\tau$ for deconfinement transition. The final lattice sets used for the studies above $T_c$ are shown in \tbn{sets}. For much of this paper, we will measure all scales in units of $T_c$. However, for \scn{pheno} we will need to quote physical units. We will do so by taking the string tension $\sigma = (0.44 \; {\rm GeV})^2$. This translates to a transition temperature $\sim$ 280 MeV. The spatial extent of the lattices are 1.44 fm or above. Some more details regarding the runs are given in \apx{sets}. In order to determine the potential, we calculate thermal expectation values of timelike Wilson loops, i.e., the Euclidean time version of $W_M$ in \eqn{pot}. It is well-known that for the spatial connections $\mathbb{U}$ straight thin-link gauge connections are not suitable: they lead to very noisy signals in numerical Monte Carlo studies. To alleviate the problem due to extended spatial connections, we do APE smearing \cite{ape}. This constitutes of a replacement of the elementary gauge links $U_i$, \begin{eqnarray} U_i (\vec{x}, \tau) &\rightarrow& {\rm Proj}_{SU(3)} \ \Bigl\{ \alpha \, U_i(\vec{x}, \tau) \ + \label{ape} \\ &{}& \sum_{\substack{1 \le j \le 3 \\ j \ne i}} \bigl( U_j(\vec{x}, \tau) \, U_i(\vec{x}+a_s \hat{j}, \tau) \, U_j^\dagger(\vec{x}+a_s \hat{i}, \tau) \ + \ U_j^\dagger(\vec{x}-a_s \hat{j}, \tau) \, U_i(\vec{x}-a_s \hat{j}, \tau) \, U_j(\vec{x}-a_s \hat{j}+a_s \hat{i}, \tau) \bigr) \Bigr\} \nonumber \end{eqnarray} iteratively. The spatial connections $\mathbb{U}$ are then constructed from these smeared links. For this work, we have taken $\alpha$ = 2.5. \bet \setlength{\tabcolsep}{10pt} \begin{tabular}{ccccccc} \hline Set & $\beta_s, \ \beta_t$ & $N_s$ & $N_t$ & $T/T_c$ & L(fm) & $a_t$(fm) \\ \hline \multirow{3}{*}{I} & \multirow{3}{*}{2.469, 14.8} & \multirow{3}{*}{16} & 48 & 0.4 & \multirow{3}{*}{1.82} & \multirow{3}{*}{0.038} \\ & & & 24 & 0.8 & & \\ & & & 16 & 1.2 & & \\ \\ \multirow{3}{*}{II} & \multirow{3}{*}{2.53, 15.95} & \multirow{3}{*}{24} & 48 & 0.6 & \multirow{3}{*}{1.73} & \multirow{3}{*}{0.024} \\ & & & 24 & 1.2 & & \\ & & & 20 & 1.5 & & \\ \\ \multirow{5}{*}{III} & \multirow{5}{*}{2.6, 16.98} & \multirow{5}{*}{30} & 72 & 0.63 & \multirow{5}{*}{1.44} & \multirow{5}{*}{0.016} \\ & & & 60 & 0.75 & & \\ & & & 38 & 1.2 & & \\ & & & 30 & 1.5 & & \\ & & & 23 & 2 & & \\ \hline \end{tabular} \caption{Parameter sets for the finite temperature runs.} \eet{sets} Note that \eqn{ape} does not involve the time direction, and the time direction links are not smeared. So time slices and the definition of transfer matrix is not affected by the smearing. We use the multilevel algorithm \cite{multilevel} in the temporal direction: this allows us to get a good signal even for Wilson loops with large time extent. For calculation of the potential at $T=0$, smearing is routinely used, and the potential should be independent of the smearing. In the finite temperature case, the extracted ``potential'' may depend on the details of the connection $\mathbb{U}$; but the actual physical quantity one is interested in, the quarkonia peak in dilepton channel, is independent of it, as it is connected to the point current. We do, however, do a detailed study of the dependence of the potential on the smearing level in the next section. In the literature, the correlator of Coulomb gauge fixed Wilson lines have often been used to extract the potential. The Coulomb gauge fixing can be formally understood as a dressing of the quark fields \cite{weise}: \beq \bar{\psi}(x) \; \psi(y) \vert_{\rm coul.} \equiv \bar{\psi}_{\scriptscriptstyle \Omega}(x) \; \psi_{\scriptscriptstyle \Omega} (y) \eeq{cgf} where $\psi_{\scriptscriptstyle \Omega} (x) = \Omega(x) \psi(x)$ and $\Omega(x)$ is a dressing function such that $\psi_{\scriptscriptstyle \Omega} (x)$ is gauge invariant \cite{weise}. The Coulomb gauge potential has obvious advantages in that the extended spatial links are not there. At $T=0$, it is also easy to argue (and has been well-tested) that the Coulomb gauge potential agrees with the potential extracted from the Wilson loop. For $T > T_c$ such detailed comparison does not exist in the literature. Here we have made such a comparative study. The coulomb gauge is fixed to an accuracy of $10^{-7}$. We have also checked that the results do not change if the accuracy is made $10^{-6}$ or $10^{-9}$ instead. The potential from this Wilson line correlator has also been presented in \scn{results}. In particular for the imaginary part of the potential, we observe differences between this potential and that obtained from the smeared Wilson loop. Since the Wilson loop operator does not involve dressing of the quark field, the connection to the point-point correlator at $\vec{r} \to 0$ is transparent. We use the potential obtained from the Wilson loop for further studies in \scn{pheno}. \section{Potential calculated from Wilson loops} \label{sec.results} In this section we present the details of our extraction of the potential, using \eqn{vsplit}. In \scn{real} we discuss the real part of the potential. The results for the free energy of a $Q \bar{Q}$ pair is given in \scn{free}, and the extraction of $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ is discussed in \scn{imag}. Besides quoting the results for the potential, we also compare the potential at different levels of smearing, and the results for Coulomb gauge. Finally, in \scn{combo} we will discuss the spectral representation \eqn{poteucl}, and touch on issues of direct extraction of spectral function from Euclidean data. \subsection{Real part of the potential} \label{sec.real} As outlined in \scn{def} and \fgn{plateau}, for smeared Wilson loops the extraction of the real part of the potential from $W^a_{\scriptscriptstyle T}(\tau, \vec{r})$ is straightforward. Defining a local potential through $- \partial_\tau \log W^a_{\scriptscriptstyle T}(\tau, \vec{r})$ shows a plateau near $\beta/2$. In the left panel of \fgn{reV-smearing} we show the ``local measurements'' of $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ from Wilson loops at different levels of smearing. The errorbars shown are from a Jackknife analysis, after blocking the data to reduce autocorrelation. As the figure shows, while for a small number of APE smearing steps, the local mass takes time to reach a plateau, on increasing the number of steps a plateau is reached quickly, and we can easily extract the potential using a single exponent fit. While we have shown the local mass for one particular case, the effects are very similar for all our sets. For each smearing level the value obtained from the fit is shown by the horizontal band of the same color. The goodness of the fit, as demonstrated by $\chi^2$, is very good. The figure also shows that varying the number of smearing steps over a large range does not seem to have any statistically significant effect on the value reached at the plateau. \bef \centerline{\includegraphics[width=8cm]{set3_Nt30_vr_smr_R8.eps} \includegraphics[width=8cm]{set3re_Nt30.eps}} \caption{(Left) The ``local measurements'' of $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ at $r=8 a_s$, at $T \sim 1.5 T_c$, for set 3. Shown are results from Wilson loops at different levels of smearing, and Coulomb gauge fixed Wilson lines. The horizontal bands show the result for the potential obtained from a single state fit. (Right) Estimates of $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ for the same set, from Wilson loops at different levels of smearing, and for the Coulomb gauge fixed wilson line.} \eef{reV-smearing} We also show in the figure the local values of the potential obtained from the Coulomb gauge fixed Wilson lines. As the figure shows, the Coulomb gauge data seems to be noisier than the data from Wilson loops. We checked that this is not an artifact of the accuracy at which the Coulomb gauge is fixed. Also the Coulomb gauge results are found to be close to the results from the smeared Wilson loops, but the difference between them is statistically significant. In the right panel of \fgn{reV-smearing} we summarize the fitted value of $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ for this set. At this scale, the dependence of the potential on the smearing level is hardly visible. Similarly, the potential from smeared Wilson loops and that from Coulomb gauge fixed Wilson lines are very close, though they differ at $1 \sigma$ level. As we have discussed in \scn{lat}, we believe that for study of quarkonia property in medium, the potential from the smeared Wilson loop is appropriate. It is satisfactory that $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ becomes practically independent of the level of smearing very soon. Anyway, when quoting a result for $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$, we include, as a systematic error, some variation with the level of smearing: for example, for the set shown in \fgn{reV-smearing} we include the spread in results between smearing levels of 100 and 250 as a systematic error. In what follows, our error bars for $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ include this variation for all sets. Results from lattices at a finite lattice spacing have discretization errors. We can have an idea of the size of the discretization error by comparing the results at different lattice spacings. As \tbn{sets} shows, we have lattices with three different lattice spacings at 1.2 $T_c$, and at 1.5 $T_c$ we have results with two different lattice spacings. In \fgn{cont-real} we show the potentials calculated from lattices at different lattice spacings. Within our error bars the results agree very well, indicating that the cutoff effects are very small at these lattice spacings. We will, therefore, take the results on our finest lattice spacings as a valid estimator of the continuum results. \bef \centerline{\includegraphics[width=8cm]{continuum_1.2Tc_reV.eps} \includegraphics[width=8cm]{continuum_1.5Tc_reV.eps}} \caption{The potential $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ at (left) 1.2 $T_c$, measured on lattices with three different lattice spacings; and (right) at 1.5 $T_c$, at two different lattice spacings.} \eef{cont-real} \fgn{pot-real} summarises our results for $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ at different temperatures. We see that the potentials at the two temperatures below $T_c$ agree completely, indicating that the temperature effect is small even at 0.75 $T_c$. The potentials have the familiar Cornell form, with a dip at small $r$ and a linearly rising part for $r \gtrsim$ 0.5 fm. This behavior changes abruptly on crossing $T_c$: while the short distance part, $\lesssim$ 0.2 fm, remains similar to the form below $T_c$, beyond $r T_c \sim 0.5 \sim$ 0.35 fm the effect of string breaking clearly shows up, and the potential becomes flatter with increasing temperature. \bef \centerline{\includegraphics[width=8cm]{reV.eps}} \caption{$V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ calculated from smeared Wilson loops. The results are from Set 3, which can be taken as a good estimate of the continuum results. \\ } \eef{pot-real} \subsection{Free energy} \label{sec.free} The study of the free energy cost of introducing a $Q \bar{Q}$ pair in the plasma is almost as old as the study of deconfinement transition in QCD. The free energy of $Q \bar{Q}$ pair was calculated from the correlator of Polyakov loops, $\langle L(\vec{r}) \ L^\dag(\vec{0}) \rangle$ \cite{mclerran}. Later, the free energy cost of a singlet $Q \bar{Q}$ pair was connected to the cyclic Wilson loop (for sufficiently smeared loops) \cite{circular}: \beq F(\vec{r}; T) \ = \ -T \, \log W_{\scriptscriptstyle T}(\beta, \vec{r}) \eeq{free} or from Coulomb gauge fixed Circular Wilson lines \cite{nadkarni} (see also \cite{owe}). In leading order perturbation theory, the singlet free energy agrees with $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$. The singlet free energy has been studied in great detail, for both gluonic plasma and the theory with quarks \cite{zantow}, and we do not intend to add to the existing results. Here we will, however, examine the issue of whether the perturbative agreement between the free energy and $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ is also valid nonperturbatively. \bef \centerline{\includegraphics[width=8cm]{set2_Nt20_F.eps}} \caption{Free energy calculated from cyclic Wilson loops at different levels of smearing, and from Coulomb gauge fixed circular Wilson lines, at 1.5 $T_c$ for set 2. The inset highlights the long distance part. The Coulomb gauge result is seen to be close to that obtained from smeared Wilson loop, but with statistically significant difference.} \eef{free} In \fgn{free} we show the singlet free energy calculated from the smeared circular Wilson loop at different levels of smearing, and that from the Coulomb gauge fixed operator. The smearing dependence is similar to what was seen for $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$: the results are quite insensitive to the smearing level used. The Coulomb gauge operator is close to the Wilson loop results, but not exactly identical. In \fgn{free-Vre} we compare the free energy and $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$, extracted from the smeared Wilson loops, at three different temperatures. As discussed before in \scn{real}, the results are expected to be valid continuum results. At all temperatures, we find that $F(\vec{r}; T)$ and $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ are very close to each other. However, at long distances $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ shows slightly less screened behavior than $F(\vec{r}; T)$. \bef \centerline{\includegraphics[width=6cm]{set3_Nt38_free-Vre.eps} \includegraphics[width=6cm]{set3_Nt30_free-Vre.eps} \includegraphics[width=6cm]{set3_Nt23_free-Vre.eps}} \caption{The free energy, \eqn{free}, compared with $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ at 1.2 $T_c$ (left), 1.5 $T_c$ (middle) and 2 $T_c$ (right). The long distance part is highlighted in the inset.} \eef{free-Vre} \subsection{Imaginary part of the potential} \label{sec.imag} As we have discussed in \scn{def}, the behavior of the symmetrized correlation function $W^p_{\scriptscriptstyle T}(\tau, \vec{r})$ is dominated by the most singular behavior in \eqn{imspectral}, which is the term that corresponds to $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$. Encouraged by this, we expand $\sigma(\omega; T)$ in \eqn{argsplit} in a series \beq \sigma(\omega; T) \ = \ \left(1 \, + \, n_{\scriptscriptstyle B}(\omega) \right) \ \left( \frac{c_0}{\omega} \ + \ c_1 \, \omega \ + \ c_2 \, \omega^3 \ + \ ... \right) . \eeq{imseries} where the form of \eqn{imseries} is motivated by the structure of $A(\tau, \vec{r})$ (see \eqn{diag} and the discussion at the end of \scn{def}). $\sigma(\omega; T)$ in \eqn{imseries} has the property that $\sigma(-\omega;T)= e^{\textstyle - \beta \omega} \; \sigma(\omega; T)$ and so the integrand in \eqn{argsplit} is an even function of $\omega$; the even powers of $\omega$ are absent in \eqn{imseries} as they won't contribute to the integral. The imaginary potential $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ is obtained from the coefficient of $1/\omega$ term: $V^{\rm im}_{\scriptscriptstyle T}(\vec{r}) = \frac{\textstyle \pi}{\textstyle \beta} \, c_0$. Putting \eqn{imseries} in \eqn{arg2}, we get the linear series for the ``local mass'': \bea \partial_\tau \; A(\tau, \vec{r}) &=& c_0 \, \tilde{G}_0(\tau) \ + \ \sum_{l=1,2,...} \, c_l \, \tilde{G}_l(\tau) \label{nbseries} \\ \tilde{G}_0 &=& - \frac{\pi}{b} \; \cot \frac{\pi \tau}{\beta} \nonumber \\ \tilde{G}_l &=& \frac{(2 l)!}{\beta^{2 l+1}} \left( \zeta \left( 2 l+1, 1-\frac{t}{\beta} \right) \ - \zeta \left( 2 l+1, \frac{t}{\beta} \right) \right) \nonumber \eea where the generalized $\zeta$ functions $\zeta(s,x) = {\displaystyle \sum_{n=1}^\infty} \frac{\textstyle 1}{\textstyle (x+n)^s}$. Note that this form \eqn{nbseries} is similar to, and could also be motivated by, perturbation theory \cite{impot}. The data near $\beta/2$ gives a very good fit to just two terms in \eqn{nbseries}, and with three terms, almost the entire range of $\tau$ could be fit in all our data sets. In \fgn{im-smear} we show the results for $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ obtained with different levels of smearing. The error bar here includes the variation due to change in number of terms of \eqn{nbseries} in the fit. The dependence on the level of smearing is stronger here, but a plateau can be reached after some levels of smearing. When quoting a result for the imaginary part of the potential in what follows, our error bar encompasses the spread among the different smearing levels in this plateau. \bef \centerline{\includegraphics[width=7.5cm]{set2_im_nb_1.2Tc.eps} \includegraphics[width=7.5cm]{set3_im_nb_1.5Tc.eps}} \caption{The imaginary part of the potential, $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$, for different smearing levels, (left) at 1.2 $T_c$, Set 2, and (right) at 1.5 $T_c$, Set 3.} \eef{im-smear} In \fgn{im-cont} we show the imaginary potential at two different temperatures, obtained on lattices with different cutoffs. While our coarsest lattice, set I, seems to show some lattice spacing dependence, the results from the two finer sets agree very well. We therefore take $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ obtained from our finest lattice as a good approximation to the continuum result. \bef \centerline{\includegraphics[width=7.5cm]{im_cont1.2.eps} \includegraphics[width=7.5cm]{im_cont1.5.eps}} \caption{The imaginary part of the potential, $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$, at 1.2 $T_c$ (left) and at 1.5 $T_c$ (right), at different lattice spacings. The results from different lattice spacings vary very little and so we take the results from our finest lattices as a good approximation to the continuum result.} \eef{im-cont} In \fgn{pot-im} we show our final results for the imaginary potential at three different temperatures. In \scn{pheno} we will use this data as the nonperturbatively evaluated $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$, and explore its physics. We have shown here the results above $T_c$ only; we have, however, run the same analysis strategy on the configurations below $T_c$, and checked that the results are consistent with zero, as expected. \bef \centerline{\includegraphics[width=8.5cm]{imV.eps}} \caption{The imaginary part of the potential, $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$, extracted from set 3, at three different temperatures.} \eef{pot-im} \subsection{Low-$\omega$ structure of the spectral function} \label{sec.combo} Combining the results of \scn{real} and \scn{imag}, we can write the correlation function near the center of the lattice as \beq W_{\scriptscriptstyle T}(\tau, \vec{r}) \ = \ e^{- V^{\rm re}_{\scriptscriptstyle T}(\vec{r}) \left(\tau \, - \, \frac{\beta}{2}\right) \; - \; \frac{\beta}{\pi} \, V^{\rm im}_{\scriptscriptstyle T}(\vec{r}) \, \log \sin \left(\frac{\pi \, \tau}{\beta} \right) - ....} \ W_{\scriptscriptstyle T}(\beta/2, \vec{r}) \eeq{combo} where the higher order terms, \[ .... \ = \ \sum_l c_l \int_\frac{\beta}{2}^\tau \; \tilde{G_l}(\tau) \] do not contribute to the potential. For explaining the Wilson loop data over a substantial range near the center, just $c_1$ is enough, while adding $c_2$ allows us to explain $W_{\scriptscriptstyle T}(\tau, \vec{r})$ over the entire range except a couple of points at the edge. Further insight into the potential can be obtained if we investigate the structure of the low $\omega$ part of $\rho(\omega, \vec{r}; T)$ in \eqn{poteucl}. In order to do this, we take the Fourier transform of the structure of $W_{\scriptscriptstyle T}(\tau, \vec{r})$, \eqn{combo}, continued to real time:$W_{\scriptscriptstyle T}(t=-i \tau, \vec{r})$. This shows a peak structure at low $\omega$, as has been anticipated in various lattice extractions of the potential, e.g., \cite{rhs,bkr,br1,br2,prw}. Interestingly, however, the peak structure is very different from what has been often anticipated. In the literature often a Lorentzian or a Gaussian structure has been assumed for the peak. Instead, we find a structure that is exponentially falling in the low $\omega$ side of the peak, $\sim \exp(\omega/T)$, while in the high $\omega$ side it falls only like a power law. Illustration of the peak structure is shown for a few representative values of $r$ in \fgn{spectralpeak}. Given this peak structure, we could rephrase our discussion of the potential extraction by simply starting from a structure like those shown in \fgn{spectralpeak}, and extracting the potential from them. We checked numerically that the laplace transform of the peak gives a statistically satisfactory description of $W_{\scriptscriptstyle T}(\tau, \vec{r})$ near $\beta/2$. While the direct Bayesian inversions have to grapple with the issue of convergence of the integral in the negative $\omega$ side, here we could easily do the integral by putting a lower cutoff: because of the sharp fall, the effect of the cutoff on the value of the integral is negligible. The addition of the correction terms do not have any significant effect on the position or the half-width of the peak, but modifies the fall-off with $\omega$ away from the position of the peak. \bef \centerline{\includegraphics[width=7.5cm]{rho_cotfn_1.5Tc.eps} \includegraphics[width=7.5cm]{rho-cotfn.eps}} \caption{(Left) The low $\omega$ structure of the spectral function obtained from \eqn{combo}, at 1.5 $T_c$. Results for three representative values of $r$ are shown. (Right) The temperature dependence of the low $\omega$ peak. results for two values of $r$ are shown.} \eef{spectralpeak} Bayesian statistics based studies of the potential proceed without making strong assumptions about the structure of the peak. In fact, some of the Baysian analyses use only very mild information about the peak. We would like to add a note of caution here. If we do not make the assumption \eqn{nbseries}, which is well-motivated by the physics involved in the imaginary potential and also by perturbation theory, it is possible to describe the Wilson loop data by other structures, leading to different $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$. In particular, a very good description of the data is provided by the form \beq W_{\scriptscriptstyle T}(\tau, \vec{r}) \ = \ e^{- V^{\rm re}_{\scriptscriptstyle T}(\vec{r}) \left(\tau \, - \, \frac{\beta}{2} \right) \; - \; \frac{V^{\rm im}_{\scriptscriptstyle T}(\vec{r})}{\pi} \, \int_{\beta/2}^\tau \, \log \, \frac{\beta-\tau}{\tau} - ....} \ W_{\scriptscriptstyle T}(\beta/2, \vec{r}) . \eeq{logform} The spectral peak obtained from this form is considerably different from that shown above; see \fgn{logcot}. A Bayesian analysis, in our opinion, ought to include the broad features of the low $\omega$ peak discussed in the previous paragraph. \bef \centerline{\includegraphics[width=7.5cm]{log-cot.eps}} \caption{The low $\omega$ structure indicated by \eqn{logform} (dotted line) compared with that obtained from \eqn{combo}, at $R$=8, at three different temperatures.} \eef{logcot} \section{Discussion of potentials and quarkonia} \label{sec.pheno} Let us try to analyze in some detail the potentials obtained in \scn{results}. We start with $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$. \fgn{pot-real} shows our estimation of $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ at different temperatures. As is expected for a gluonic plasma, the thermal effects are negligible at temperatures of 0.75 $T_c$ : the potential agrees completely between 0.75 $T_c$ and 0.63 $T_c$. So the potential at our lowest temperature measured for each set can safely be taken to approximate the zero-temperature potential. The potential shows the familiar features of the $1/r$ singularity at short distances and the linear rise at large distances, and gives a good fit to the Cornell form. As we cross $T_c$, the finite temperature potential is close to that at $T$=0 at short distances. But clear temperature effects are seen as $r$ increases: in particular, the linear behavior of the $T=0$ potential gets screened. In perturbation theory one expects, in leading order, a Debye-screened form of $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ which is same as the free energy \cite{impot}, \beq V^{\rm re}_{\rm pert}(\vec{r}, T) \ = \ - \frac{\alpha(T)}{r} e^{- m_{\scriptscriptstyle D} r} - m_{\scriptscriptstyle D} \alpha(T) + C \eeq{vrp} where $m_{\scriptscriptstyle D} = g T$ in leading order and $\alpha(T)$ is the running coupling at the appropriate temperature scale. In \fgn{remod} this form, \eqn{vrp}, is shown at different temperatures, along with the nonperturbatively obtained potential. For drawing the perturbative curve, following \cite{impot}, we have used one-loop formula for the coupling \cite{kajantie}, $\alpha^{-1}(T) \ = \ \frac{\textstyle 33}{\textstyle 8 \pi} \, \log(6.742 \, T/\Lambda_{\overline \scriptscriptstyle \rm MS})$, and $T_c/\Lambda_{\overline \rm MS}$ = 1.10-1.20 \cite{largeN}. The band in the perturbative form in \fgn{remod} corresponds to this range in $T_c/\Lambda_{\overline \rm MS}$. Since we are interested in the $r$ dependence of $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$, the additive renormalization constant $C$ is fixed by matching to the lattice potential at $r T_c$ = 0.5 at $T=2 T_c$. As \fgn{remod} shows, the perturbative form does not explain the potential obtained in \scn{real}. In particular, the long distance part of the potential is not as flat as the screened Debye form predicts: as if a shadow of the string tension rise survives. \bef \centerline{\includegraphics[width=6cm]{ReModel_1.2Tc.eps}\includegraphics[width=6cm]{ReModel_1.5Tc.eps}\includegraphics[width=6cm]{ReModel_2.0Tc.eps}} \caption{The finite temperature potential $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$ at temperatures 1.2 $T_c$ (left), 1.5 $T_c$ (middle) and 2 $T_c$ (right), shown with various models for the potential: perturbative form (\eqn{vrp}), Debye-screened string in 1-d (\eqn{vro}) and in 3-d (\eqn{vrt}).} \eef{remod} Since the long distance part of the $Q \bar{Q}$ potential in QCD vacuum has a linear string tension term, a natural next step would be to try a screened form of the string tension term. The string tension term being entirely nonperturbative, there is, however, no single unique/preferred possibility for the screened form of this term. We will consider here two models for screening that have been discussed in the literature. A linear string tension is obtained in the 1+1 dimensional Schwinger model. Since string is essentially an one-dimensional object, one can assume that the physics of screening of the string term will also be similar to that in the Schwinger model. Such a consideration leads to the potential \cite{kms} \beq V^{\rm re}_{\rm 1D}(\vec{r}, T) \ = \ - \frac{\alpha}{r} \; e^{-m_{\scriptscriptstyle D} r} \ + \ \frac{\sigma}{m_{\scriptscriptstyle D}} \; \left(1 \; - \; e^{- m_{\scriptscriptstyle D} r} \right) \ + \ C^\prime . \eeq{vro} This form of the screened potential can also be obtained by generalizing the timelike gluon propagator to \cite{guo} \beq D(p_0=0, \vec{p}) \ \equiv \ \frac{1}{p^2 \, + \, m_{\scriptscriptstyle D}^2} \ + \ \frac{2 \sigma / \alpha}{(p^2 \, + \, m_{\scriptscriptstyle D}^2)^2} . \eeq{guo} The second term gives a linear string term in the limit $m_{\scriptscriptstyle D} \to 0$. We treat \eqn{guo} here as a purely phenomenological construct to model the screening in string tension term. In perturbation theory, one expects $\alpha$ to be a function of $r$ and $T$. In the Cornell potential, however, one usually treats $\alpha$ as a constant. We follow \cite{kms} and keep $\alpha, \sigma$ fixed to their $T=0$ value, the temperature dependence entering in \eqn{vro} only through $m_{\scriptscriptstyle D}$. The long distance part of the potential $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$, \fgn{pot-real}, is fitted to \eqn{vro} to obtain $m_{\scriptscriptstyle D}, \; C^\prime$. $V^{\rm re}_{\rm 1D}(\vec{r}, T)$ does a good job of explaining the measured potential as shown in \fgn{remod}. We have tried a few fit ranges covering the large distance side of our measured potential. The band in \fgn{remod} shows the variation of the fit parameters on shifting the fit range. The narrowness of the band is evidence for the stability of the fit to the form of \eqn{vro}. The fitted value of $m_{\scriptscriptstyle D}$ obtained from the fits is shown in \tbn{params}; the range corresponds to this change in fit range. \bet \setlength{\tabcolsep}{10pt} \begin{tabular}{crllll} \hline & \multicolumn{2}{c}{$m_{\scriptscriptstyle D}/T$} & & & \\ $T/T_c$ & 1 D & 3 D & $b$ & $a_1$ & $a_2$ \\ \hline 1.2 & 1.18(6) & 1.37(6) & 0.34(1) & -1.23(7) & 1.22(4) \\ 1.5 & 1.34(8) & 1.49(6) & 0.35(3) & -0.87(2) & 1.85(2) \\ 2.0 & 1.46(8) & 1.60(9) & 0.29(2) & -0.8(2) & 2.85(38) \\ \hline \end{tabular} \caption{Various parameter sets related to the potential models discussed in \scn{pheno}. 1D refers to \eqn{vro}, 3D to \eqn{vrt}. $b, \, a_a, \, a_2$ are defined in \eqn{fitpot}.The errors shown include the variation with fit range, and should be treated as a systematic band rather than a statistical $1-\sigma$ band. } \eet{params} A different line of argument to a screened potential is to start with a generalized Gauss' law which gives a linear potential \cite{dixit}. The medium effect then can be incorporated by introducing a medium permittivity \cite{patra}. Using an isotropic permittivity motivated by HTL perturbation theory leads to the potential \cite{brpot} \beq V^{\rm re}_{\rm 3D}(\vec{r}, T) \ = \ - \frac{\alpha}{r} \; e^{-m_{\scriptscriptstyle D} r} \ - \ \frac{\Gamma(1/4)}{2 \pi} \ \frac{\sigma}{\mu} \; \sqrt{x} \; K_{\frac{1}{4}} \left(\frac{x^2}{2} \right) \ + \ C^{\prime \prime} \eeq{vrt} where $\mu^2 = m_{\scriptscriptstyle D} \sqrt{\frac{\textstyle \sigma}{\textstyle \alpha}}$, $x = \mu r$ and $K_{1/4}$ is the modified Bessel function of the second kind \cite{fnote1}. At large $r$, the second term behaves like $\frac{\textstyle \exp(-x^2/2)}{\textstyle \sqrt{x}}$. The results of the fit to this form are also shown in \fgn{remod} and the value of $m_{\scriptscriptstyle D}$ shown in \tbn{params}. The fit to \eqn{vro} is found to be slightly more stable than that to \eqn{vrt}, and so we use it for analysis of quarkonia behavior. However, \eqn{vrt} also approximately captures the $r$ dependence of $V^{\rm re}_{\scriptscriptstyle T}(\vec{r})$; with our data we can not statistically rule out either of the one-dimensional and three-dimensional screening forms. The imaginary part, $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$, turns out to be more difficult to model using the conventional screening forms available in the literature. The perturbative form of the imaginary part, \eqn{htl}, is shown in \fgn{immod} together with our data, for three different temperatures. The parameters used are identical to that for the real part, as detailed below \eqn{vrp}. The data shows very different behavior from that of \eqn{htl}: at short distance, the perturbative result overshoots the data, but it soon saturates, while our nonperturbative data does not show a sign of saturation in the distance scale studied by us. The perturbative result $ V^{\rm im}_{\scriptscriptstyle T}(\vec{r})_{\rm pert}$ behaves $\sim r^2 \log r$ at small $r$, and saturates to $\sim \alpha \ T$ as $r \to \infty$. The nonperturbative data shows a $r^2$ behavior to a much larger distance: in particular, almost the whole range of $r$ explored by us, $r T_c \lesssim 1$, can be fitted to a quadratic behavior at 1.5 $T_c$ and 2 $T_c$. The HTL permittivity that leads to \eqn{htl}, is complex, so as to produce a complex potential. Use of this permittivity in the generalized Gauss' law leads to \cite{brpot} \eqn{vrt} and an imaginary part \bea V^{\rm im}_{\rm 3D}(\vec{r}, T) &=& V^{\rm im}_{\scriptscriptstyle T}(\vec{r})_{\rm pert} \ + \ \alpha \, T \, \left\{ D_{-1/2} \left(\sqrt{2} x \right) \int_0^x dy \; {\rm Re} \, D_{-1/2} \left(i \sqrt{2} y \right) \, y^2 \, g\left(\frac{m_{\scriptscriptstyle D}}{\mu} \, y \right) \right. \label{vit} \\ &+& \left. {\rm Re} D_{-1/2} \left(i \sqrt{2} x \right) \int_x^\infty dy \, D_{-1/2} \left(\sqrt{2} y \right) y^2 \, g \left(\frac{m_{\scriptscriptstyle D}}{\mu} \, y \right) \ - \ D_{-1/2}(0) \, \int_0^\infty dy \; D_{-1/2}\left(\sqrt{2} y \right) \, y^2 \, g\left(\frac{m_{\scriptscriptstyle D}}{\mu} \, y \right) \right\} \nonumber \\ {\rm where} \ g(x) & = & \int_0^\infty dz \; \frac{\textstyle 2 \, z} {\textstyle z^2 \, + \, 1} \ \frac{\textstyle \sin z x}{\textstyle z x}. \nonumber \eea $V^{\rm im}_{\rm 3D}(\vec{r}, T)$ is also shown in \fgn{immod}, with the legend `3D'. Here the value of $m_{\scriptscriptstyle D}$ obtained from \eqn{vrt} is used, and the band corresponds to the range in $m_{\scriptscriptstyle D}$ (\tbn{params}). This form has a similar behaviour $\sim r^2$ at small $r$ to the data. While it is steeper at large $r$ than the perturbative form, it is less steep than our data. If one uses a complex permittivity analogous to the HTL term in conjunction with the modified propagator of \eqn{guo}, one can get the ``complex potential'' for 1D screening, i.e., the imaginary part of \eqn{vro}. The imaginary part reads \cite{guo} \beq V^{\rm im}_{\rm 1D}(\vec{r}, T) \ = \ V^{\rm im}_{\rm pert}(\vec{r}, T) \ + V^{\rm im}_\sigma(\vec{r}, T), \qquad V^{\rm im}_\sigma(\vec{r}, T) \ = \ \frac{4 \sigma T}{m_{\scriptscriptstyle D}^2} \ \int_0^\infty dz \, \frac{2 z}{(z^2+1)^3} \left[ 1 - \frac{\sin z x}{z x} \right] . \eeq{vio} $V^{\rm im}_{\rm 1D}(\vec{r}, T)$ is shown in \fgn{immod} with legend `1D'; the value of $m_{\scriptscriptstyle D}$ is that obtained from \eqn{vro} in \tbn{params}. This form seems to have a higher slope than our data at small $r$ and a smaller slope at large $r$, though at 1.5 $T_c$ it is close to our data in the range of $r$ studied by us. \bef \centerline{\includegraphics[width=6cm]{ImModel_1.2Tc.eps} \includegraphics[width=6cm]{ImModel_1.5Tc.eps} \includegraphics[width=6cm]{ImModel_2.0Tc.eps}} \caption{The imaginary part of the finite temperature potential, $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$, at temperatures 1.2 $T_c$ (left), 1.5 $T_c$ (middle) and 2 $T_c$ (right), shown with various models for the potential: perturbative form (\eqn{htl}), Debye-screened string in 1-d (\eqn{vio}) and in 3-d (\eqn{vit}).} \eef{immod} As \fgn{immod} reveals, none of the simple forms discussed does a good job of modelling our data for the imaginary potential over the range of $r$ studied by us. At small $r$, the numerically calculated potential has a smaller slope than either the screened string forms or the forms \eqn{vio} and \eqn{vit}. At large $r$, on the other hand, it is steeper. Both of these latter forms, in turn, show a much larger imaginary part than the perturbative form at large $r$, with \eqn{vit} comparable to our data at larger values of $r$. We are interested in the ground state quarkonium peaks in the spectral function. While it is most sensitive to the short distance part of the potential, it is also affected by the long distance part, especially as the binding energy becomes less and the state becomes broader. As we mentioned before, in the range $r T_c \lesssim 1$ studied here, our data for $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ grows $\sim r^2$. Of course, on physical principles we expect it to saturate at large $r$. Motivated by \eqn{vio}, we tried to model the imaginary part of the potential by fitting the data to an arbitrary combination of $V^{\rm im}_{\rm pert}(\vec{r}, T)$ and $V^{\rm im}_\sigma(\vec{r}, T)$. We also tried to fit it to a purely quadratic form. Finally, we calculate the spectral function for finite mass quark through integrating \eqn{nr}, with \beq V_{Q \bar{Q}}(\vec{r}, T) \ = \ V^{\rm re}_{\rm 1D}(\vec{r}, T) \ - i \ V^{\rm im}_{\rm fit}(\vec{r}, T), \qquad V^{\rm im}_{\rm fit}(\vec{r}, T) \ = \ \begin{cases} b \, T \, (r T)^2 \\ a_1 \, V^{\rm im}_{\rm pert}(\vec{r}, T) \; + \; a_2 \, V^{\rm im}_\sigma(\vec{r}, T) \end{cases} \eeq{fitpot} where $V^{\rm re}_{\rm 1D}(\vec{r}, T)$ is given in \eqn{vro} and the parameters $b, a_1, a_2$ are given in \tbn{params}. We emphasize that our forms for $V^{\rm im}_{\rm fit}(\vec{r}, T)$ represent purely phenomenological fits of the data; one can take them to correspond to two limiting asymptotic behaviors given the data. We will treat the results for the spectral function obtained with the two forms of $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ in \eqn{fitpot} as a systematic band, and look for features of the band. In the left panel of \fgn{rhoM} we have shown the spectral function obtained this way at 1.5 $T_c$, with the quark mass varying from 1.5 GeV to 6 GeV. At $T=0$, using the unscreened Cornell potential we get a series of sharp peaks. We denote the mass of the 1S state as $M_P$, and normalize the $x$ axis with respect to it in \fgn{rhoM}. At 1.5 $T_c$, even for a quark mass of 6 GeV we only find one peak. Of course, 1.5 $T_c$ here corresponds to a temperature of about 420 MeV. Expectedly, the peak is the sharpest for the heaviest quark, gradually broadening till, for quark masses close to the charm, only a very broad peak structure can be seen. The spectral function for $M_{\scriptscriptstyle Q}$ = 1.5 GeV is also qualitatively different from the others, and is very different from the spectral function obtained directly from $J/\psi$ correlators in \cite{mem}, but in qualitative agreement with a later study \cite{hengtong}. Similar results have been seen in \cite{mocsy}. In the right panel of \fgn{rhoM} we have shown the results for the $\Upsilon$ peak. Quark mass $M_{\scriptscriptstyle Q}$ was tuned to get the 1S meson mass $\sim$ 9.45 GeV. A sharp peak is seen at 1.2 $T_c$, which gradually broadens as the temperature increases. But a peak structure survives all the way to 2 $T_c$. Note that 2 $T_c$ here corresponds to about 560 MeV, setting the scale using the string tension. Also at low temperatures the peak is quite narrow, in comparison to what was found from nonrelativistic bottomonia correlators in \cite{memnr1}. \bef \centerline{\includegraphics[width=7.5cm]{rho1.5Tc_mq.eps} \includegraphics[width=7.5cm]{rho_Mb.eps}} \caption{(Left) the peak of the spectral function $\rho(\omega, \vec{r} \to 0)$ at a temperature of 1.5 $T_c$, for different values of the quark mass. The dashed line coresponds to the quadratic form and the full line, to the two-parameter form of $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ in \eqn{fitpot}. (Right) The spectral function at different temperatures for a quark mass close to the bottom, M(1S)=9.45 GeV. In the $x$ axis, the zero is at $\omega=M_P$, the 1S state mass obtained using the Cornell potential.} \eef{rhoM} \section{Summary} \label{sec.summary} One popular way of studying the medium modification of quarkonia in quark-gluon plasma is through defining an effective ``in-medium'' potential. Theoretically, a suitable potential can be defined \cite{impot,blaizot7} by examining the time dependence of the Minkowski-time Wilson loop, \eqn{pot}. This potential is complex, with the real part of the potential describing the Debye-screened binding of the $Q \bar{Q}$ pair in medium and the imaginary part related to damping of the wavefunction due to interaction with the thermal medium. A nonperturbative extraction of this potential \cite{rhs} involves extracting the low-frequency structure of the spectral function from the Euclidean-time Wilson loop, \eqn{poteucl}. This is in general a very difficult problem. The existing studies in the literature have either progressed through using Bayesian analysis, with their associated, and sometimes hard-to-estimate, systematic errors, or by making ad-hoc assumption about the low-frequency structure. In this work we have introduced a new method of nonperturbative evaluation of the potential. We find that a reorganization of the Euclidean Wilson loop data, motivated by the underlying structure of the finite temperature correlation function (see \apx{pert}), leads to an enormous simplification in the extraction of the peak structure from the Wilson loop. The main ingredients of our method are outlined in \scn{def}, and the details are given in \scn{results}. We have calculated the potential in a gluonic plasma for temperatures $\le 2 T_c$ from smeared Wilson loops, calculated using anisotropic lattice discretization of the gluonic theory. Our results for the potential are summarized in \fgn{pot-real} and \fgn{pot-im}. The real part of the potential, which shows the Cornell form below $T_c$ with no noticable temperature dependence upto 0.75 $T_c$, shows Debye screening on crossing $T_c$, with the screening mass increasing with temperature. The form of the potential is different from the perturbative form at least upto 2 $T_c$, as illustrated in \fgn{remod}. The imaginary part of the potential is zero below $T_c$. Above $T_c$ it rises rapidly, with a spatial dependence $\sim r^2$ till distances $r \lesssim 1/T_c$. Its behaviour is sharply different from the perturbative result, as illustrated in \fgn{immod}. In the course of our study, we have also investigated issues like dependence of the finite-temperature potential on the definition of the operator, which, we feel, have not been properly discussed in the literature. We have examined how the potential depends on the smearing, and compared the potential obtained from smeared Wilson loops with those from Coulomb gauge fixed Wilson line correlators. We have also examined the relation between the real part of the potential and the free energy of a static $Q \bar{Q}$ pair in the plasma; see \fgn{free-Vre}. In \scn{combo} we have discussed the structure of the low energy peak of the spectral function. It is quite different from the Lorentzian structure that has often been assumed in direct extractions of potential from Euclidean wilson loop using \eqn{poteucl}. We have also illustrated, with example, the difficulty of extracting the low energy peak from the Euclidean Wilson loop without putting in additional physics input. Our data for the extracted potential can be found in \scn{results}, in particular in \fgn{pot-real} and \fgn{pot-im}. Moreover, for various purposes it is convenient to have a parametrization of the potential. In \scn{pheno} we have explored various standard forms of a screened potential. As \fgn{remod} shows, for the real part, the form of 1D screening of the string potential seems to give a reasonable description of the data, with parameters given in \tbn{params}. For the imaginary part it is more difficult to find quantitative agreement with a standard screened form. The potential rises $\sim r^2$ till intermediate distances $r T_c \sim 1$. While the potential is expected to saturate as $r \to \infty$, it is difficult to make any statement about that behavior from our data at $r T_c \lesssim 1$. A purely phenomenological generalization of \eqn{vio}, using arbitrary linear combination of $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})_{\rm pert}$ and $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})_\sigma$, seems to give a good description of the data in the range of $r$ explored by us, with coefficients given in \tbn{params}. Since we expect the long distance behavior of $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ to be somewhere between this and the $r^2$ behavior, for a study of quarkonia in the plasma we use both of the forms for $V^{\rm im}_{\scriptscriptstyle T}(\vec{r})$ (see \eqn{fitpot}). The difference in the spectral structure obtained with these two forms is considered as a qualitative systematic band. The spectral function peaks for S-state quarkonia with different quark masses are shown in \fgn{rhoM}. In the left panel, the variation of the spectral function with $M_{\scriptscriptstyle Q}$ is shown. Below $T_c$ the spectral function has a number of narrow peaks corresponding to the nS states; but above $T_c$ only the 1S peak survived even for $M_{\scriptscriptstyle Q}$ = 6 GeV. For $M_{\scriptscriptstyle Q}$ = 1.5 GeV, close to the mass of charm, there is no significant peak structure at this temperature. Of course, the nonrelativistic formalism may not be valid for charmonia at these temperatures. For $M_{\scriptscriptstyle Q}$ = 3 GeV, a clear peak structure is seen at 1.5 $T_c$, with very little shift in the peak position. In the right panel of \fgn{rhoM} the spectral function for 1S bottomonia is shown. While the peak structure weakens with temperature, a clear peak survives till 2 $T_c$, with very little shift in peak position, and reasonably narrow peak, at least till 1.5 $T_c$. While potential by itself does not provide a complete description of medium interaction of quarkonia, it is an important part of a complete description, and can provide useful inputs for more sophisticated studies like direct extraction of spectral functions; they also can provide essential nonperturbative ingredients of an open quantum system analysis of in-medium quarkonia \cite{blaizot15, miura}. Our results are for the quenched theory, and one needs to be careful when applying them for quarkonia phenomenology. They, however, provide benchmarks for comparing with direct extractions of quarkonia spectral functions from euclidean correlators. More importantly, the method we have outlined for the extraction of the potential, \scn{def}, is quite simple and stable, and we expect one should be able to use it to extract reliable potential also from dynamical lattices. {\bf Acknowledgements:} This work was carried out under the umbrella of ILGTI. The computations reported here were performed on the clusters of the Department of Theoretical Physics, TIFR. We would like to thank Ajay Salve and Kapil Ghadiali for technical support. DB would like to thank Rajiv Gavai, Alexander Rothkopf and Peter Petreczky for discussions.
\section{INTRODUCTION} \label{sec:intro} Starting about a decade ago, ground-based telescopes using facility (conventional) adaptive optics (AO) systems revealed the first direct images of young, self-luminous superjovian mass planets orbiting nearby stars \cite{Marois2008,Marois2010,Lagrange2010,Rameau2013,Currie2014}. Follow-up multi-wavelength photometry provided the first constraints on their atmospheric properties, revealing the planets to be redder and cloudier/dustier than substellar objects with the same temperatures and, in some cases, showing evidence for non-equilibrium carbon chemistry\cite{Currie2011,Galicher2011}. Spectra for the first directly-imaged planets revealed evidence for low surface gravities and the presence of multiple molecular species \cite{Barman2011,Currie2014}. Near-infrared (IR) conventional AO systems achieve typical planet-to-star contrasts typically of 10$^{-3}$, $10^{-4}$, and 10$^{-5}$ to 5$\times$10$^{-6}$ at angular separations of 0.25", 0.5" and 1.0"\cite{Brandt2014c}. Most imaged exoplanets discovered with conventional AO lie beyond 0.5". Surveys with these systems are typically sensitive to only the most massive planets (10--15 $M_{\rm J}$) at orbits exterior to those in our own solar system ($a_{\rm p}$ $\gtrsim$ 30--100 au)\cite{Brandt2014a}. Now, \textit{extreme} AO systems like the \textit{Gemini Planet Imager} (GPI) on Gemini-South and \textit{Spectro-Polarimetric High-contrast Exoplanet REsearch instrument} (SPHERE) on the Very Large Telescope (VLT) are able to detect planets at 0.25"--1.0" a factor of 10-100 times fainter in the near-IR \cite{Macintosh2014,Vigan2015}. These deeper contrasts have opened up new exoplanet discovery space, probing planets that are lower mass (down to $\sim$ 2 $M_{\rm J}$) and closer in angular separation ($\rho$ $\sim$ 0.1"--0.4") and physical projected separation ($a_{\rm p}$ $\sim$ 10-15 au) \cite{Macintosh2015,Chauvin2017,Currie2015,Milli2017,Keppler2018}. Integral field spectrographs coupled to GPI and SPHERE have provided new insights into the atmospheric properties of young, jovian planets, including their cloud cover, temperature, and gravities (e.g. \cite{Bonnefoy2016,Chilcote2017,Rajan2017}). Extreme AO surveys have provided new constraints on the frequency of 5--13 $M_{\rm J}$ planets at 10--30 au, suggesting that these companions form a separate population from more massive brown dwarf companions\cite{Nielsen2019}. Despite recent technological advances utilized by these extreme AO systems, only about 20 or so exoplanets have been directly imaged thus far. Direct imaging preferentially detects luminous (massive), wide-separation planets. However, analyses of radial-velocity searches for mature planets suggest that the frequency of planets at the innermost separations probed by the latest extreme AO surveys is small compared to a peak at $\sim$ 2--3 au \cite{Fernandes2019}. Even at wider separations (10--30 au), typical sensitivities are on the order of $\sim$ 3--5 $M_{\rm J}$ \cite{Nielsen2019}. Yet the frequency of gas giant planets comparable to or lower than Jupiter's mass is significantly higher than that of superjovian planets \cite{Fernandes2019}. The yield of direct imaging surveys appears to be biased towards stars more massive than the Sun. Directly detecting planets on smaller orbits, with lower masses, and around a wider range of stellar masses requires significantly better performance at small angular separations, a higher-fidelity AO correction at wider separations, and better performance for optically fainter stars. Here, we provide an update on the performance and early science obtained with the Subaru Coronagraphic Extreme Adaptive Optics project (SCExAO) at the Subaru Telescope on Maunakea \cite{Jovanovic2015}. SCExAO employs improvements in wavefront control hardware and software improving its performance at small angular separations and for faint guide stars. It will mature key advances in wavefront control and coronagraphy needed to move beyond recent exoplanet direct imaging capabilities to those capable of imaging an Earth with ELTs. \begin{figure}[ht] \begin{center} \centering \includegraphics[scale=0.4,clip]{WFC_loops.png} \end{center} \caption { \label{fig:wfcloops} Current schematic of SCExAO. Note that the coronagraphic low-order loop is not in normal operation; the MKIDs camera (MEC) is undergoing commissioning. } \end{figure} \section{SCExAO Design and Performance} The standard mode of SCExAO science operation is shown in Figure \ref{fig:wfcloops}. The system takes in and further sharpens partially-corrected light from Subaru's facility AO system (A0-188) as input, which typically achieves $\sim$ 30--40\% Strehl at 1.6 $\mu m$. SCExAO’s main wavefront control loop includes a 2,000-element MEMS deformable mirror from Boston MicroMachines driven by a modulated Pyramid wavefront sensor using an OCAM$^{2}$K camera from First-Light Imaging operating over a 600--900 nm bandpass. The loop can run at speeds up to 3.5 kHz. However, currently in normal science operations it operates at 2 kHz for bright stars coupled with predictive wavefront control (see below) to decrease wavefront sensor noise error. For very faint stars($I$ $>$ 9), we typically run the loop at 1 kHz. The loop can correct for up to 1200 modes of dynamic aberrations. Figure \ref{fig:strehl} presents the AO performance of SCExAO as a function of atmospheric conditions and $I$-band magnitude. For extremely bright stars ($I$ = 1--5), SCExAO can deliver excellent AO corrections, with estimated Strehl ratios (at 1.6 $\mu m$) of 0.9-0.94 for slightly above average to top-quartile seeing conditions on Maunakea (left panel). Estimated Strehl ratios drop to $\sim$ 0.75-0.8 for much fainter stars ($I$ $\sim$ 7-8), or below for below-average conditions, although in the former case some of the estimated drop may be due to noise in the estimate of the wavefront correction residuals. Under the best conditions ($\theta$ $\sim$ 0.2"-0.5"), SCExAO can deliver sharp AO corrections for stars as faint as R $\sim$ 11.4--12, such as LkCa 15 or V819 Tau (right panel). Corrected starlight is fed into different optical/near-infrared (IR) science instruments. For most exoplanet imaging programs, the near-IR integral field spectrograph CHARIS is used. CHARIS operates in two modes. The primary workhorse configuration is its low resolution (R $\sim$ 20) ‘broadband mode’ covering the three major near-IR bandpasses (J, H, and K) simultaneously, which makes the instrument well-suited for exoplanet discovery and coarse spectral characterization. A higher-resolution (R $\sim$ 70) mode in J, H, or K allows for more detailed, follow-up characterization. For broadband mode, we typically use a Lyot coronagraph with a $\sim$ 0.1" occulting spot; for $H$ band the vector vortex coronagraph is used. Satellite spots placed at 15.5 $\lambda$/D are used for spectrophotometric calibration and image registration. The CHARIS Data Reduction Pipeline converts raw data into data cubes\cite{Brandt2017}. There is currently no standardized, public pipeline for subsequent data reduction steps (e.g. image registration, PSF subtraction). However, T.C. has developed data reduction tools for these steps that will likely separately become part of a supported pipeline component\cite{Currie2018a,Currie2018b}. Other collaborators have successfully carried out at least many data reduction steps using the public PyKLIP package\cite{Wang2015} or their own proprietary codes\cite{Marois2014,Gerard2019}. \begin{figure}[ht] \begin{center} \centering \includegraphics[scale=0.65,clip]{strehlquality.png} \end{center} \caption { \label{fig:strehl} (left) Plot of Strehl ratio -- as estimated from the residual wavefront error -- vs. guide star $I$ band magnitude. (right) SCExAO PSF for LkCa 15 at $K$ band, an optically faint star revealing numerous Airy rings. } \end{figure} As shown in \ref{fig:rawcontrast}, the raw contrast achieved with SCExAO/CHARIS under very good correction (S.R. $\sim$ 0.9) is roughly flat between $\sim$ 0.3" and 0.6" at $\approx$ 10$^{-4}$, $\sim$ 3$\times$10$^{-4}$ at 0.25", and $\sim$ 2$\times$10$^{-5}$ at 0.8". At small separations, SPHERE achieves deeper raw contrast\cite{Beuzit2019}, plausible due to its more optimal choice of coronagraphs to suppress halo light compared to our use of a standard Lyot coronagraph, among other possible factors. After using advanced post-processing, it achieves contrasts of $\sim$ 10$^{-5}$ at 0.25" and 10$^{-6}$ at 0.5" over 1 hour-long sequences and under good conditions. These values are comparable to typical contrasts achieved with the Gemini Planet Imager in $H$ band. Improvements in wavefront control and coronagraphy will likely lead to substantial gains in contrast at small separations. \begin{figure}[ht] \begin{center} \centering \includegraphics[scale=0.35,clip]{SCExAO_rawContrast.png} \end{center} \caption { \label{fig:rawcontrast} Raw 5-$\sigma$ broadband contrast obtained for stars at S.R. $\sim$ 0.75 and $\sim$ 0.9 (corrected for finite sample sizes) but without fully masking residual light from satellite spots. Towards the highest Strehl ratios, the raw contrast curve is nearly flat from 0.3"--0.6". The curves are computed by measuring, at each radius, the surface brightness standard deviation (assumed here to be the noise), and multiplying it by 5. } \end{figure} Figure \ref{fig:hr8799comp} uses observations of HR 8799 to illustrate the practical performance gain for SCExAO/CHARIS over conventional AO facilties. SCExAO/CHARIS yields a $\sim$ 23-$\sigma$ detection of HR 8799 e -- invisible in the Keck/NIRC2 data -- and much stronger detections of the outer two planets HR 8799 cd. While spectral differential imaging does result in a contrast gain, a key advantage of SCExAO/CHARIS appears to be the relatively strong temporal correlation of the halo, making post-processing with angular differential imaging (ADI; \cite{Marois2006}) more effective\cite{Gerard2019}. \begin{figure}[ht] \begin{center} \centering \includegraphics[scale=0.675,clip]{hr8799compare.png} \end{center} \caption { \label{fig:hr8799comp} (left) SCExAO/CHARIS HR 8799 image (wavelength-collapsed) compared to Keck/NIRC2 $H$ band image (right), showing stronger detections of HR 8799 cd and detection of HR 8799 e. HR 8799 b lies outside CHARIS's field of view. The CHARIS data were reduced first using advanced PSF subtraction\cite{Currie2012b} to remove the halo in angular differential imaging (ADI) and then simple classical spectral different imaging (a median-combination of channels magnified by wavelength). The Keck/NIRC2 data were reduced in ADI only. } \end{figure} \section{Early SCExAO/CHARIS Science Results} The first year of full science operations for SCExAO and CHARIS has yielded seven peer-reviewed publications\cite{Currie2018a,Currie2018b,Currie2019a,Goebel2018,AsensioTorres2019,Rich2019,Gerard2019} providing new insights about massive exoplanets, planet candidates, protoplanetary and debris disks, brown dwarfs and low-mass stars, and the efficacy of advanced coronagraphy and PSF subtraction methods. Here, we focus on two systems -- $\kappa$ Andromedae and LkCa 15 -- for which SCExAO/CHARIS data provided new key insights about (proposed) planetary companions. \subsection{SCExAO Observations of $\kappa$ And} The directly-imaged low-mass companion to the B9V star $\kappa$ Andromedae ($\kappa$ And b; \cite{Carson2013}) is an object whose properties were better constrained with SCExAO/CHARIS data. Depending on whether the system $\kappa$ And was a young star with an age (i.e. 30--40 $Myr$) comparable to moving groups like the Columba association or an older, $\sim$ 200 $Myr$-old one, $\kappa$ And b could have a planet-like mass or one consistent with low-mass brown dwarfs\cite{Carson2013,Hinkley2013}. Interferometric observations of the star favor a young age\cite{Jones2016}. A spectrum could better determine whether $\kappa$ And b bears a greater resemblance to young, planet-mass brown dwarfs or intermediate-aged more massive brown dwarfs. \begin{figure}[ht] \begin{center} \centering \includegraphics[scale=0.5,clip]{kappaand_charis.png} \end{center} \caption { \label{fig:kapandimage} SCExAO/CHARIS image of $\kappa$ And b from \cite{Currie2018a}. } \end{figure} SCExAO/CHARIS data yielded an exceptionally high SNR JHK spectrum of $\kappa$ And b and achieved deep contrast limits down to 0.25" ($\sim$ 12.5 au) despite only 14 minutes of integration time (Figure \ref{fig:kapandimage}). The shape of $\kappa$ And b's spectrum was best matched by young L0--L1 dwarfs (Figure \ref{fig:kapandspec}). The $H$-band peak of $\kappa$ And b showed strong evidence for the companion being a low gravity object, consistent with a planetary mass. \begin{figure}[ht] \begin{center} \centering \includegraphics[scale=0.7,clip]{kapandb_char.png} \end{center} \caption { \label{fig:kapandspec} Spectral characterization of $\kappa$ And b with SCExAO/CHARIS, constraining spectral type (left) and gravity (right). } \end{figure} Recent spectral energy distribution modeling of the CHARIS spectrum along with complementary photometry at $Y$ band and in the thermal infrared constrain its temperature to be 1700--1900 $K$ and favor a surface gravity of log(g) $\sim$ 4.0--4.5 (Uyama et al. 2019, submitted). Orbital modeling of $\kappa$ And b astrometry suggests that the companion has a high eccentricity and a semimajor axis greater than $\sim$ 75 au. As $\kappa$ And b is at a separation where forming massive planets by core accretion is exceptionally difficult, it likely formed through other means, such as gravitational instability\cite{Boss1997}. \subsection{SCExAO Observations of LkCa 15} The infant Sun-like star LkCa 15 has long been regarded as a key laboratory for studying planet formation. The star's massive, gaseous protoplanetary disk contains multiple dust components, where a sub-au scale hot disk and cold outer disk are responsible for most of the system's broadband infrared emission \cite{Espaillat2007}. The spatially resolved cavity separating these two dominant components\cite{Andrews2011} is a tell-tale sign that much of the disk material has already been incorporated into massive, still-forming ``protoplanets”. Two studies using sparse aperture masking interferometry and a separate $H_{\rm \alpha}$ imaging identified up to three protoplanets orbiting LkCa 15\cite{Kraus2012,Sallum2015} (LkCa 15 'bcd'). However, recent polarimetric imaging reveal additional dust material at separations comparable to LkCa 15 bcd, whose scattered light signal could possibly be misinterpreted as planets. SCExAO/CHARIS observations from September 2017 were of sufficient quality to directly detect planets or disk material around LkCa 15, despite the star's faint optical brightness. \begin{figure}[ht] \begin{center} \centering \includegraphics[scale=0.7,clip]{lkca15scexaoresults.png} \end{center} \caption { \label{fig:lkca15results} Image of LkCa 15 obtained with SCExAO/CHARIS on September 7, 2017 (left), forward-modeled image for a two-component disk from a theoretical model (middle), and forward-modeled image for three planets derived from previous aperture masking data. } \end{figure} SCExAO/CHARIS data and complementary Keck/NIRC2 data spatially resolved the inner regions of LkCa 15 over same wavelengths where LkCa 15 bcd were originally identified. However, they showed that emission attributed LkCa 15 bcd predominantly comes from the arc-like forward-scattering peak of the inner disk component previously seen in polarimetry\cite{Currie2019a}(Figure \ref{fig:lkca15results}). The emission has the same brightness previously attributed to planets around LkCa 15 in \cite{Sallum2015}. Forward-models of LkCa 15 bcd are inconsistent with the SCExAO/CHARIS and Keck/NIRC2 data. However, scattered light disk models generally reproduced the morphology of emission seen by both instruments. Complementary data taken with the Keck Observatory helped establish that this arc-like structure is static over time and therefore better consistent with a fixed structure like a disk than orbiting planets. Unpublished data appear consistent with a disk interpretation for most of the emission seen around LkCa 15 at small angles (Figure \ref{fig:lkca15new}). SCExAO/HiCIAO K-band data obtained in 2016 likewise show a continuous arc of emission. Using archival Keck/NIRC2 data, we have also successfully resolved the inner and outer disk components at $M_{\rm s}$ ($\lambda_{\rm o}$ $\sim$ 4.67 $\mu m$). In both data sets, we find no direct evidence for protoplanets around LkCa 15. Irrespective of our evidence that emission around LkCa 15 is static, claiming evidence for orbiting protoplanets from aperture masking data is challenging. Astrometric error bars reported for LkCa 15 `bcd' are large. It is possible that variable $u--v$ coverage between epochs can induce apparent astrometric offsets when a binary model is assumed in the image reconstruction process (C. Cacares 2019, in prep.). The choice of calibrators, and whether or not they have circumstellar material, is also important. As our previous study notes, previous aperture masking data for LkCa 15 is not faithful reproducing the spatial structure of emission at small angles\cite{Currie2019a}. In other systems with previously claimed protoplanets like HD 169142, structures within the disk could themselves be orbiting\cite{Gratton2019}. Distinguishing between planet and disk also requires a forward-model of each emission source through the data. \begin{figure}[ht] \begin{center} \centering \includegraphics[scale=0.9,clip]{lkca15new.png} \end{center} \caption { \label{fig:lkca15new} Unpublished SCExAO/HiCIAO and Keck/NIRC2 images of LkCa 15. Both data sets show evidence for two separate disk components but not directly-imaged planets.} \end{figure} Despite the above cautions, it is still possible that future observations will reveal a set of orbiting protoplanets, perhaps even at the locations previously proposed for LkCa 15 'bcd'. Such companions, though, would be significantly fainter than previously reported: e.g. at a contrast of $\sim$ 10$^{-3}$ instead of $\sim$ 10$^{-2}$. Obtaining accurate photometry and astrometry will be challenging given the appearance of such companions against a bright inner disk. \section{Future Plans for SCExAO} \begin{figure} [ht] \begin{center} \centering \includegraphics[scale=1,clip]{predcontrol.png} \end{center} \caption { \label{fig:pred} On-sky SCExAO PSF without (left) and with (right) predictive control. The images are of the same star and are averages of 54 consecutive 0.5s images taken 3 minutes apart (26s total). } \end{figure} \subsection{Technical Advances} A detailed overview of recent and upcoming technical improvements to SCExAO is discussed in Lozi et al. \cite{Lozi2018}: a subset of these upgrades are discussed below, particularly focusing on wavefront sensing/control advances and new science modes. \begin{itemize} \item \textbf{Predictive Wavefront Control} -- We have now successfully implemented ``predictive control" using empirical orthogonal functions\cite{Males2018}. Predictive control allows us to reduce the servo lag error in the wavefront sensing error budget, improving contrast at small angular separations. Figure \ref{fig:pred} shows a demonstration of predictive control, where it yields a factor of $\sim$ 3 improvement in contrast at small angular separations. \item \textbf{CRED-2 Detector} - We have replaced SCExAO's internal short-wave infrared camera (170 Hz, 100 e$^{-}$ read noise) with a new CRED-2 detector from First-Light, which can run in excess of 1 kHz in subframe mode, with low, $<$ 30 e$^{-}$ read noise and utilized for focal-plane wavefront control. The CRED-2 allows precise alignment of a coronagraph using both focal plane and pupil plane viewing modes. The CRED-2 can also be used to obtain broadband science images at wavelengths adjacent to those being used by CHARIS. \item \textbf{MEC} - A more fundamental advance is MEC, an 20,000 pixel MKIDS-based detector built by the University of California-Santa Barbara. MEC is a noiseless, ultra-cooled photon-counting detector able to measure the energy and wavelength of every photon. This capable makes MEC a powerful tool for reducing chromatic effects in the speckle halo and for driving fast, focal-plane wavefront sensing and control (e.g. speckle nulling). \item \textbf{New Focal-Plane Wavefront Sensing Techniques} -- In addition to speckle nulling, additional focal-plane techniques may be tested to allow SCExAO to achieve a far deeper, sustained dark hole than previously possible. In particular, in collaboration with NASA-Ames Research Center, the SCExAO team is developing and eventually planning to implement (on sky) \textit{Linear Dark Field Control}, which uses the linear response of perturbations in the bright, uncorrected region to maintain a dark hole originally dug through focal-plane wavefront sensing techniques\cite{Miller2017}. See SPIE paper 11117-65 for more details\cite{Currie2019}. \item\textbf{Integral Field Polarimetry with CHARIS} -- Recently commissioned, CHARIS's ``integral field polarimetry" mode splits light into two polarizations over a 1.2"x2.4" field for 22 separate spectral channels covering J through K. This new mode allows us to detect small-scale emission from protoplanetary and debris disks and yield both total intensity and polarized intensity spectra to get a wavelength-dependent polarization fraction. Its utility for planet detection around young stars is key. Specifically, it can allow us to measure both total and polarized intensity will help us to determine whether candidate point source-like features in disks are highly polarized. Having total intensity IFS data for any point sources detected will also be critical to help characterize these sources, to assess whether their spectra look like substellar objects or CPD-dominated objects. \end{itemize} On a slightly longer timescale, the key advance will be to replace the facility AO system -- which uses a curvature wavefront sensor driving a DM with only 188 actuators -- with a much faster (2 kHz) and far higher-order DM (64x64 actuators) driven by a Pyramid wavefront sensor. Effectively, this two-stage SCExAO will allow the current wavefront sensor/DM loop to focus on speckle control/digging a much deeper dark hole and thus enabling a much larger planet discovery phase space. SCExAO is also maturing near-infrared wavefront sensing capabilities to better target optically faint stars and reduce non-common path aberrations. \begin{figure} \begin{center} \centering \includegraphics[scale=0.85,clip]{scexao_psi.png} \end{center} \caption { \label{fig:psi} Contrast curve in $J$-band for a successor instrument to SCExAO put on the TMT -- the \textit{Planetary Systems Imager} (PSI) -- using three different assumptions about its performance at small angular separations. Systems like SCExAO help mature wavefront sensing/control methods and coronagraphy needed to achieve these performances. Under optimistic performance scenarios ($\sim$ 10$^{-6}$ raw contrast and $\sim$ 3$\times$10$^{-8}$ contrast after post-processing at $\sim$ 1.5--2 $\lambda$/D), TMT/PSI could image rocky, Earth sized planets with an Earth-like insolation around about 20-25 nearby M stars. } \end{figure} \subsection{An Exoplanet Survey with SCExAO/CHARIS and the Path to Imaging Reflected-Light Planets with ELTs} Our current plan is to carry out an exoplanet direct imaging survey using an upgraded SCExAO and the CHARIS integral field spectrograph once the system has achieved significantly deeper contrasts than demonstrated by GPI or SPHERE (e.g. 10$^{-6}$ at 0.2", 10$^{-7}$ at wide separations). SCExAO performs substantially better in good seeing conditions. Therefore, one option is to conduct the survey in queue mode with other programs, for instance the current InfraRed Doppler (IRD) instrument conducting a near-IR precision radial-velocity survey of the nearest low-mass stars. Current, blind surveys with GPI and SPHERE have resulted in a small yield of new exoplanet and low-mass brown dwarf discoveries, which limits the sample of companions with diverse properties, and thus prevents us from better mapping out the atmospheric evolution of supermassive jovian planets. However, target selection could be modified to substantially increase yields. For instance, targeted searches could prioritize stars showing evidence for a gravitational pull from an unseen substellar companion. The Hipparcos-GAIA Catalog of Accelerations (HGCA) \cite{Brandt2018} provides a current master list of stars showing clear dynamical evidence for stellar to substellar companions. Upcoming GAIA data releases will identify more weakly accelerating stars hosting lower-mass planets. From a limited retargeting of bright, nearby HGCA stars we have already identified at least one new substellar companion using SCExAO/CHARIS. Focusing on the sample on stars already showing evidence for companions will prevent us from deriving strong, unbiased statistics on exoplanet frequency in exchange for a much higher yield of detections to better constrain planet atmosphere evolution. Instruments like SCExAO as well as other upcoming systems like the \textit{Keck Planet Imager and Characterizer} (KPIC) and MagAO-X mature key wavefront sensing and control technology that will be implemented on ELTs to directly image rocky planets in reflected light around the nearest stars. Habitable zone Earth-sized planets have contrasts of $\sim$ 10$^{-7}$--10$^{-8}$ but lie at angular separations of $\sim$ 0.01"--0.1" around M stars at $\sim$ 5 $pc$ or $\sim$ 1--5 $\lambda$/D for facilities like the \textit{Thirty Meter Telescope} (TMT) and \textit{Giant Magellan Telescope} (GMT) (Figure \ref{fig:psi}). Key contributors to the wavefront error budget and thus limiting raw contrast at small angular separations include errors due to optical path length differences (between that of the wavefront sensor and science instrument wavelengths), AO servo lag and wavefront sensor noise, and scintillation (conversion of phase errors to amplitude modulation) which are predicted to operate at the 10$^{-3}$--10$^{-4}$, 10$^{-5}$, and 10$^{-6}$ contrast levels, respectively within 3--5 $\lambda$/D \cite{Guyon2018}. Advances being matured on SCExAO address each of these terms in the error budget. For instance, focal-plane wavefront sensing/control being matured with SCExAO can help reduce optical path length errors; predictive control reduces the AO servo lag contribution. Contrast curves in Figure \ref{fig:psi} depict a range of performances for the \textit{Planetary Systems Imager} -- coarsely conceived as a successor to systems like SCExAO -- on TMT depending on the system's efficacy with reducing each of these errors assuming a factor of $\sim$ 30 for speckle suppression from post-processing. In the pessimistic case where substantial non-common path and servo lag/wavefront sensor noise contributions remain, TMT/PSI would detect perhaps one Earth-analogue around a nearby low-mass star but many more super Earths and warm Neptunes. For an optimistic case where TMT/PSI is able to substantially eliminate non-common path, servo lag, and wavefront sensor noise contributions, Earth-sized habitable zone planets could be detectable around nearly two-dozen M stars. \acknowledgments T.C. is supported by a NASA Senior Postdoctoral Fellowship and NASA/Keck grant LK-2663-948181. We emphasize the pivotal cultural role and reverence that the summit of Maunakea has always had within the Hawaiian community. We are most fortunate to conduct scientific observations from this mountain.
\section*{Introduction} This note is dedicated to introducing Higgs bundles and the Hitchin fibration, with a view towards their appearance within different branches of mathematics and physics, focusing in particular on the role played by the \textit{integrable system} structure carried by their moduli spaces. On a compact Riemann surface $\Sigma$ of genus $g\geq 2$, Higgs bundles are pairs $(E,\Phi)$ where \begin{itemize} \item $E$ is a holomorphic vector bundle on $\Sigma$; \item the Higgs field $\Phi: E\rightarrow E \otimes K$ is a holomorphic section, for $K:=T^*\Sigma$. \end{itemize} Since their origin in the late 80's in work of Hitchin and Simpson, Higgs bundles manifest as fundamental objects which are ubiquitous in contemporary mathematics, and closely related to theoretical physics. For $\ensuremath{G_{\mathbb{C}}}$ a complex semisimple Lie group, the {\it Dolbeault moduli space} of $G_\mathbb{C}$-Higgs bundles $\mathcal{M}_{G_\mathbb{C}}$ has a hyperk\"ahler structure, and via different complex structures it can be seen as different moduli spaces: \begin{itemize} \item Via the non-abelian Hodge correspondence developed by Corlette, Donaldson, Simpson and Hitchin, and in the spirit of Uhlenbeck-Yau's work for compact groups, the moduli space is diffeomorphic as a real manifold to the {\it De Rahm moduli space} $\mathcal{M}_{dR}$ of flat connections on a smooth complex bundle \item Via the Riemann-Hilbert correspondence there is an analytic correspondence between the de Rham space and the {\it Betti moduli space} $\mathcal{M}_{B}$ of surface group representations. \end{itemize} Some prominent examples where these moduli spaces appear in mathematics and physics are: \begin{itemize} \item Through the Hitchin fibration, $\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}}$ give examples of hyperk\"ahler manifolds which are {\it integrable systems}, leading to remarkable applications in physics which we shall discuss later on. \item Building on the work of Hausel and Thaddeus relating Higgs bundles to {\it Langlands duality}, Donagi and Pantev presented $\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}}$ as a fundamental example of mirror symmetry for CY manifolds. \item Within the work of Kapustin and Witten, Higgs bundles were used to obtain a physical derivation of the {\it geometric Langlands correspondence} through mirror symmetry and soon after, Ng\^{o} found Higgs bundles to be key ingredients when proving the Fundamental Lemma, which led him to the Fields Medal a decade ago. \end{itemize} Higgs bundles and Hitchin systems have been an increasingly vibrant area, and thus there are several expository articles some of which we shall refer to: from the Notices' article ``What is a Higgs bundle?'' \cite{whatis}, to several graduate notes on Higgs bundles (e.g., the author's recent \cite{PCMI}), to more advance reviews such as Ng\^{o}'s 2010 ICM Proceedings article \cite{chau2010endoscopy}. Hoping to avoid repeating material nicely covered in other reviews, whilst still attempting to engage the reader into learning more about the subject, we shall take this opportunity to focus on some of the recent work done by leading young members of the community\footnote{As in other similar reviews, the number of references is limited to twenty, and thus we shall refer the reader mostly to survey articles where precise references can be found.}. \section*{Higgs bundles} Higgs bundles arise as solutions to self-dual Yang-Mills equations, a non-abelian generalization of Maxwell's equations which recurs through much of modern physics. Recall that instantons are solutions to Yang-Mills self-duality equations in Euclidean 4d space, and when these equations are reduced to Euclidean 3d space by imposing translational invariance in one dimension, one obtains monopoles as solutions. Higgs bundles were introduced by Hitchin in \cite{N1} as solutions of the so-called {\it Hitchin equations}, the 2-dimensional reduction of the Yang-Mills self-duality equations, given by\begin{eqnarray} F_A+ [\Phi,\Phi^*]=0,\label{equation1}\\ ~{~}~ ~\overline{\partial}_{A}\Phi=0,\label{equation2}\end{eqnarray} where $F_A$ is the curvature of a unitary connection $\nabla_A=\partial_{A}+\overline{\partial}_{A}$ associated to the $\overline{\partial}$-connection $\overline{\partial}_{A}$ on a principal $\ensuremath{G_{\mathbb{C}}}$ bundle $P$. Concretely, principal $\ensuremath{G_{\mathbb{C}}}$-Higgs bundles are pairs $(P,\Phi)$, where \begin{itemize}\item $P$ is a principal $\ensuremath{G_{\mathbb{C}}}$-bundle, and \item $\Phi$ a holomorphic section of ${\rm ad}(P)\otimes K$ \end{itemize} Throughout these notes, we shall refer to {\it classical Higgs bundles} as the Higgs bundles described in the Introduction, and consider $\ensuremath{G_{\mathbb{C}}}$-Higgs bundles in their vector bundle representation, through which they can be seen as classical Higgs bundles satisfying some extra conditions reflecting the nature of the group $\ensuremath{G_{\mathbb{C}}}$. For instance when considering $\ensuremath{G_{\mathbb{C}}}=SL(n,\mathbb{C})$, a $\ensuremath{G_{\mathbb{C}}}$-Higgs bundle $(E,\Phi)$ is composed of a holomorphic rank $n$ vector bundle $E$ with trivial determinant $\Lambda^nE\cong \mathcal{O}$, and a Higgs field satisfies ${\rm Tr}(\Phi)=0$, for which we shall write $\Phi \in H^0(\Sigma, {\rm End}_0(E)\otimes K)$. \smallskip \noindent \textbf{Example 1}.~Choosing a square root of $K$, consider the vector bundle $E=K^{1/2}\oplus K^{-1/2}$. Then, a family of $SL(2,\mathbb{C})$-Higgs bundles $(E,\Phi_a)$ parametrized by quadratic differentials $a\in H^{0}(\Sigma, K^2)$ is given by \begin{eqnarray}\left(E=K^{1/2}\oplus K^{-1/2}, \Phi_a=\left(\begin{array}{cc}0&a\\1&0\end{array}\right)\right). \label{example} \end{eqnarray} One may also consider $G$-Higgs bundles, for $G$ a real form of $G_\mathbb{C}$, which in turn correspond to the Betti moduli space of representations into $G$. \noindent \textbf{Example 2.} $SL(2,\mathbb{R})$-Higgs bundles are pairs \[\left(E=L\oplus L^*, \Phi=\left(\begin{array}{cc}0&\beta\\\gamma&0\end{array}\right)\right),\]for $L$ a line bundle on $\Sigma$. Hence, in {\it Example 1.} one has a family $(E,\Phi_a)$ of $SL(2,\mathbb{R})$-Higgs bundles. \smallskip In order to define the moduli space of Higgs bundles, one needs to incorporate the notion of stability. For this, recall that holomorphic vector bundles $E$ on $\Sigma$ are topologically classified by their rank $rk(E)$ and their degree $deg(E)$, though which one may define their {\it slope} as $\mu(E):= deg(E)/ rk(E).$ Then, a vector bundle $E$ is {\em stable} ({\em or semi-stable}) if for any proper, non-zero sub-bundle $F\subset E$ one has $\mu(F)<\mu(E)$ (or $\mu(F)\leq \mu(E)$). It is {\em polystable} if it is a direct sum of stable bundles whose slope is $\mu(E)$. One can generalize the stability condition to Higgs bundles $(E,\Phi)$ by considering $\Phi$-{\em invariant subbundle} $F$ of $E$, a vector subbundle $F$ of $E$ for which $\Phi(F)\subset F\otimes K$. Then, a Higgs bundle $(E,\Phi)$ is said to be {\em stable} ({\em semi-stable}) if for each proper $\Phi$-invariant $F\subset E$ one has $\mu(F)<~\mu(E)~(equiv. \leq)$. Then, the moduli space $\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}}$ of stable $\ensuremath{G_{\mathbb{C}}}$-Higgs bundles up to holomorphic automorphisms of the pairs can be constructed (also denoted $\mathcal{M}_{Dol}$). Going back to Hitchin's equations, one of the most important characterisations of stable Higgs bundles is given in the work of Hitchin and Simpson, and which carries through to more general settings: If a Higgs bundle $(E,\Phi)$ is stable and $\text{deg} ~E = 0$, then there is a unique unitary connection $A$ on $E$, compatible with the holomorphic structure, satisfying \eqref{equation1}-\eqref{equation2}. Finally, Hitchin showed that the moduli space of Higgs bundles is a hyperk\"ahler manifold with natural symplectic form $\omega$ defined on the infinitesimal deformations $(\dot A,\dot \Phi)$ of a Higgs bundle $(E,\Phi)$ by \begin{equation}\label{ch2:2.1} \omega((\dot{A}_{1},\dot{\Phi}_{1}),(\dot{A}_{2},\dot{\Phi}_{2}))=\int_{\Sigma}\text{tr}(\dot{A}_{1}\dot{\Phi}_{2}-\dot{A}_{2}\dot{\Phi}_{1}), \end{equation} where $\dot A \in \Omega^{0,1}(\text{End}_{0} E)$ and $\dot\Phi\in \Omega^{1,0}(\text{End}_0 E)$. Moreover, he presented a natural way of studying the moduli spaces $\mathcal{M}_{\ensuremath{G_{\mathbb{C}}}}$ of $ \ensuremath{G_{\mathbb{C}}}$-Higgs bundles through what is now called {\it the Hitchin fibration}, which we shall consider next. \newpage \section*{Integrable systems} Given $\{p_{1}, \ldots, p_k\}$ a homogeneous basis for the algebra of invariant polynomials on the Lie algebra $\mathfrak{g}_{c}$ of $ \ensuremath{G_{\mathbb{C}}}$, we denote by $d_{i}$ the degree of $p_i$. The {\it Hitchin fibration}, introduced in \cite{N2}, is then given by \begin{eqnarray} h~:~ \mathcal{M}_{ \ensuremath{G_{\mathbb{C}}}}&\longrightarrow&\mathcal{A}_{ \ensuremath{G_{\mathbb{C}}}}:=\bigoplus_{i=1}^{k}H^{0}(\Sigma,K^{d_{i}}), \nonumber \\ (E,\Phi)&\mapsto& (p_{1}(\Phi), \ldots, p_{k}(\Phi)).\nonumber \end{eqnarray} where the map $h$ is referred to as the {\it Hitchin~map}: it is a proper map for any choice of basis and makes the moduli space into an integrable system. In what follows we shall restrict our attention to $GL(n,\mathbb{C})$-Higgs bundles, which are those Higgs bundles introduced in the first paragraph of these notes, and whose Hitchin fibration is depicted in Figure \ref{fibration}. \begin{figure}[h] \centering \includegraphics[width=0.4\textwidth]{Schaposnik_2019_Higgs_FIG1.jpg} \caption{The Hitchin fibration.} \label{fibration} \end{figure} The generic fibre of the Hitchin fibration --- appearing in violet in Figure \ref{fibration} --- is an abelian variety, leading to what is refer to as the \textit{abelianization} of the moduli space of Higgs bundles, and which can be seen geometrically by considering eigenvalues and eigenspaces of the Higgs field. Indeed, a Higgs bundle $(E,\Phi)$ defines a ramified cover of the Riemann surface given by its eigenvalues and obtained through its characteristic equation: \begin{eqnarray}S=\{{\rm det}(\Phi-\eta)=0\} \subset {\rm Tot}K.\label{spectral}\end{eqnarray} % This cover allows one to construct the \textit{spectral data} associated to $(E,\Phi)$, which provides a geometric description of the moduli space of Higgs bundles, and is given by \begin{itemize} \item the spectral curve $\pi:S\rightarrow \Sigma$, defining a point in the Hitchin base, since the coefficients of $\{{\rm det}(\Phi-\eta)=0\}$ give a basis of invariant polynomials for the Lie algebra, and \item a line bundle on $S$, defining a point in the Hitchin fibre and obtained as the eigenspace of $\Phi$. \end{itemize} For classical Higgs bundles, the smooth fibres are ${\rm Jac}(S)$, and for $\eta$ the tautological section of $\pi^*K$, one recovers $(E,\Phi)$ up to isomorphism from the curve $(S, L\in {\rm Jac}(S))$ by taking $E=\pi_*L$ and $\Phi=\pi_* \eta$. When considering $\ensuremath{G_{\mathbb{C}}}$-Higgs bundles, one has to require appropriate conditions on the spectral curve and the line bundle reflecting the nature of $\ensuremath{G_{\mathbb{C}}}$. This approach originates in the work of Hitchin and of Beauville, Narasimhan and Ramanan (see \cite{PCMI} for references), and we shall describe here an example to illustrate the setting. Consider $SL(n,\mathbb{C})$-Higgs bundles, for which the coefficient in \eqref{spectral} corresponding to ${\rm Tr}(\Phi)=0$, and the generic fibres of the Hitchin fibration are isomorphic to Prym varieties ${\rm Prym}(S,\Sigma)$. \smallbreak \noindent \textbf{Example 3.}~For rank two Higgs bundles, we return to the example in the previous page in which the Hitchin fibration is over $ H^0(\Sigma, K^2)$, and the Hitchin map is $h:(E,\Phi)\mapsto {\rm det}(\Phi).$ Then, the family $(E,\Phi_a)$ gives a section of the Hitchin fibration: a smooth map from the Hitchin base to the fibres, known as \textit{the Hitchin section}. Moreover, this comprises a whole component of the moduli space of real $SL(2,\mathbb{R})$-Higgs bundles seen inside $\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}}$, and provides an example of a {\it Hitchin component}, also called a {\it Teichmuller component} of real Higgs bundles.\smallskip In the early 90's Hitchin showed that these components for higher rank split groups $G$, so-called {\it Hitchin components}, are homeomorphic to a vector space of dimension $dim(G)(2g - 2)$ and conjectured that they should parametrize geometric structures --- recall that the Teichm\"uller space $\mathcal{T}(S)$ of the underlying surface $S$ of $\Sigma$ is the space of marked conformal classes of Riemannian metrics on $S$. These spaces presented the first family of {\it higher Teichm\"uller spaces} within the Betti moduli space of reductive surface group representations $Rep^+(\pi_1(\Sigma),G)$, which leads us to applications of Higgs bundles within {\it Higher Teichmuller Theory}. \newpage \section*{Higher Teichm\"uller theory} The Hitchin component of $G$-Higgs bundles, or equivalently of surface group representations, can be defined as the connected component of the Betti moduli space $Rep^+(\pi_1(\Sigma),G)$ containing Fuchsian representations in $G$, which are representations obtained by composing a discrete and faithful representation $\rho:\pi_1(\Sigma) \rightarrow PSL(2, \mathbb{R})$ with the unique (up to conjugation) irreducible representation $PSL(2, \mathbb{R})\rightarrow G$. Moreover, as mentioned in the previous section, these representations, called {\it Hitchin representations}, are considered the first example of higher Teichm\"uller space for surfaces: a subset of the set of representations of discrete groups into Lie groups of higher ranks consisting entirely of discrete and faithful elements. In order to give the above geometric description of Hitchin representations, Labourie introduced the notion of {\it Anosov representations}, which can be thought of as a generalization of convex-co-compact representations to Lie groups $G$ of higher real rank\footnote{For example, for representations in $SL(2,\mathbb{C})$, these are quasi-Fuchsian representations.}. As beautifully described in Wienhard's 2018 ICM Proceedings article \cite{Anna}, higher Teichm\"uller theory recently emerged as a new field in mathematics, closely related to Higgs bundles (see also \cite{Fanny,BrianSigma} for further references). There are two types of higher Teichm\"uller spaces, giving the only known examples of components which consist entirely of Anosov representations for surfaces: \begin{itemize} \item[{\bf (I)}] the space of Hitchin representations into a real split simple Lie group $G$; and \item[{\bf (II)}] the space of maximal representations into a Hermitian Lie group $G$. \end{itemize} Recall that a representation $\rho : \pi_1(\Sigma) \rightarrow G$ is maximal if it maximizes the {\it Toledo invariant} $T(\rho)$, a topological invariant defined for any simple Lie group $G$ of Hermitian type as \begin{eqnarray} \frac{1}{2\pi}\int_{\Sigma}f^*\omega \end{eqnarray} for $\omega$ the 2-form on the Riemannian symmetric space $X$ of $G$ induced through the imaginary part of the $G$-invariant Hermitian form on $X$, and for $f:\tilde \Sigma \rightarrow X$ the {\it developing map}, any $\rho$-equivariant smooth map. \smallskip \noindent \textbf{Example 4.} The Toledo invariant can be expressed in terms of Higgs bundles. For example for $SL(2,\mathbb{R})$-Higgs bundles $(L\oplus L^*,\Phi)$, the Toledo invariant is $2 \deg(L)$ and satisfies $0\leq|2 \deg(L)|\leq 4g-4$. Hence, the family $(E,\Phi_a)$ from Example 1 is maximal. \smallskip The existence of spaces other than those in {\bf (I)} and {\bf (II)} with similar properties to Teichm\"uller space is currently a topic of significant investigation --- examples are the spaces of $\theta$-positive representations conjectured by Guichard-Wienhard to be potential candidates, and recently shown to exist in \cite{BrianInv}. Whilst Anosov representations give a clear link between discrete and faithful representations and geometric structures, there is no known Higgs bundle characterization of Anosov representations, and very little is known about which explicit geometric structures correspond to these spaces. For instance, work of Choi and Goldman shows that the holonomy representations of convex projective structures are the Hitchin representations when $G=PSL(3,\mathbb{R})$. This brings us to one of the fundamental problems in modern geometry: the classification of geometric structures admitted by a manifold $M$. Recall that a model geometry is a pair $(G, X)$ where $X$ is a manifold ({\it model space}) and $G$ is a Lie group acting transitively on $X$ ({\it group of symmetries}). Then, a $(G,X)$-structure on a manifold $M$ is a maximal atlas of coordinate charts on $M$ with values in $X$ such that the transition maps are given by elements of $G$. When describing the geometric structures arising through Anosov representations, Higgs bundles have become a key tool through their appearance in relation to higher Teichm\"uller spaces. An example of this is how the Hitchin system was fundamental when showing that maximal representations to $PO(2,q)$ give rise to $(G, X)$-manifolds for at least two choices of $X$: when $X$ is the space of null geodesics (photons) in a particular Einstein manifold and when $X=\mathbb{P}(\mathbb{R}^{2+q})$ (e.g. see \cite{BrianSigma}). For an excellent review of the theory of geometric structures, the reader should refer to Kassel's 2018 ICM Proceedings article \cite{Fanny}. \newpage \section*{Harmonic metrics} Equivariant harmonic maps play an important role in the non-abelian Hodge correspondence mentioned before (and beautifully reviewed in \cite{whatis}), and thus we shall dedicate this section to look into some of the advances made in this direction. In our setting, from the work of Corlette and Donaldson, any reductive representation $\rho: \pi_1(\Sigma)\rightarrow G_\mathbb{C}$ has associated a $\rho$-equivariant harmonic map $f$ from the universal cover $\tilde{\Sigma}$ of $\Sigma$ to the corresponding symmetric space of $G_\mathbb{C}$, which in turn defines a Higgs bundle $(E,\Phi)$. Recall that a map $f:\tilde{\Sigma}\rightarrow M$ is called $\rho$-equivariant if $f(\gamma \cdot x)= \rho(\gamma)\cdot f(x)$ for all $x\in \tilde \Sigma$ and $\gamma \in \pi_1(\Sigma)$. Moreover, such a map induces the $\rho$-equivariant map $df$, leading to the \textit{energy density} defined as \begin{eqnarray} e(f)=\frac{1}{2}<df,df>: \tilde \Sigma \rightarrow \mathbb{R},\label{density} \end{eqnarray} which is also $\rho$-equivariant and descends to $\Sigma$. Then, the \textit{energy} of $f$ is defined as \begin{eqnarray} E(f)=\int _{M}e(f)d {\rm Vol}, \label{energy} \end{eqnarray} which is finite since $\Sigma$ is compact. The map $f$ is said to be \textit{harmonic} if it is a critical point of the energy functional $E(f)$ in \eqref{energy}. Conversely, through the work of Hitchin and Simpson, a polystable Higgs bundle admits a hermitian metric on the bundle such that the associated Chern connection $A$ solves the Hitchin equations \eqref{equation1}-\eqref{equation2}, and such a metric is called harmonic. Moreover, the harmonic metric induces an irreducible representation $\rho: \pi_1(\Sigma)\rightarrow G_\mathbb{C}$ and a $\rho$-equivariant harmonic map into the corresponding symmetric space, and these two directions together give the celebrated non-abelian Hodge correspondence. Understanding the geometric and analytic properties of the harmonic maps arising from Hitchin's equations \eqref{equation1}-\eqref{equation2} is of significant importance. For instance, one may ask how do those metrics behave at the boundaries of the moduli space, or how do the energy densities of the corresponding harmonic maps at different points of the Hitchin fibration determine each other (the reader may be interested in the reviews \cite{qiongling} and \cite{Laura}, and references therein). \newpage From Hitchin's work, the moduli space of Higgs bundles has a natural $\mathbb{C}^*$-action $\lambda \cdot (E,\Phi) = (E,\lambda \Phi),$ whose fixed point sets allow one to study different aspects of the topology and the geometry of the space, as done in \cite{N2} (see also \cite{SteveSigma,BrianSigma}). Moreover, as shown by Simpson, the the fixed points by this action are complex variations of Hodge structure (VHS). Recall that a VHS is a $\mathbb{C}^{\infty}$ vector bundle $V$ with decomposition $V = \bigoplus_{p+q=w}V^{p,q}$, and a flat connection, satisfying the axioms of Griffiths transversality and existence of a polarization. From the above, one may ask how the energy density of harmonic maps changes along the $\mathbb{C}^*$-flow on the moduli space of Higgs bundles. Whilst this remains a challenging open question in the area, a better understanding might come from the following conjectural picture of Dai-Li described in Figure \ref{Li}, and through which the harmonic map of a fixed point set of the $\mathbb{C}^*$ action on $\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}}$ gives rise to two other related harmonic maps. \begin{figure}[h] \centering \includegraphics[width=0.35\textwidth]{Schaposnik_2019_Higgs_FIG2.jpg}\caption{The nilpotent cone in red over the 0, and the points $A,B$ and $C$, lying over the fixed point set of the $\mathbb{C}^*$ action and of the Hitchin section respectively.}\label{Li} \end{figure} Here, given a point $A$ within the Hitchin fibration, one can immediately determine the point $B$ to be the limit of the $\mathbb{C}^*$-flow $\lambda \cdot A$ as $\lambda \rightarrow 0$ in the nilpotent cone, and the point $C$ to be the intersection point of the Hitchin fiber containing $A$ and the Hitchin section. Then Dai-Li's conjecture states that the energy densities defined as in Eq.\eqref{density} of the corresponding harmonic maps $f_A, f_B, f_C : \tilde{\Sigma} \rightarrow \mathbb{N}$ satisfy \begin{eqnarray}e(f_B) < e(f_A) < e(f_C).\label{li}\end{eqnarray} As evidence for the above conjecture, one can consider the integral version (through Eq.\eqref{energy}), for which Hitchin showed that $E(f_B) < E(f_A)$, but where the other corresponding inequality in \eqref{li} remains open. \newpage \section*{Limiting structures} The study of $\rho$-equivariant harmonic metrics and higher Teichm\"uller theory through Higgs bundles has received much attention in recent years and brings us to one of the most important conjectures in the area. This conjecture, due to Labourie, states that for each Hitchin representation $\rho$ there is a unique conformal structure $X_\rho$ on the underlying surface $S$ in which the $\rho$-equivariant harmonic metric is a minimal immersion. In particular, Labourie showed that for all Anosov representations such a conformal structure exists, but the difficultly lies in proving uniqueness --- the conjecture has been established only for Lie groups of rank two (\cite{MR3583351,BrianSigma}). To understand this problem, it becomes fundamental to study the deformation of conformal structures on surfaces and the corresponding harmonic metric. Some of these deformations can be see through the hyperk\"ahler structure of the moduli space, though which it has a $\mathbb{C}\mathbb{P}^1$-worth of complex structures labelled by a parameter $\xi\in \mathbb{C}^\times$. Indeed, we can think of a hyperk\"ahler manifolds as a manifold whose tangent space admits an action of three complex structures $I$, $J$ and $K$ satisfying the quaternionic equations and compatible with a single metric. In our case, $I$ arises from the complex structure $I$ on the Riemann surface $\Sigma$, while $J$ is from the complex structure on the group $\ensuremath{G_{\mathbb{C}}}$. In this setting, one has the following spaces: \begin{itemize} \item $\xi=0$ gives the moduli space of Higgs bundles, \item $\xi\in\mathbb{C}^\times$ gives the moduli space of flat connections\begin{eqnarray} \nabla_\xi=\xi^{-1}\Phi+\bar\partial^h_A+ \partial^h_A+\xi\Phi^{^*h};\label{Laura1} \end{eqnarray} \item finally, taking $\xi=\infty$ gives the moduli space of so-called ``anti-Higgs bundles'' \end{itemize} The hyperk\"ahler metric on Hitchin moduli space is expected to be of type ``{\it quasi-ALG}'' which is some expected generalization of ALG. Indeed, a far reaching open question is the understanding of the behaviour of the metrics at the boundaries of the space. For instance taking the limit of Hitchin's solutions along a ray in the Hitchin base \[\lim_{t\rightarrow \infty}(\bar\partial_A,t\Phi,h_t).\] Almost a decade ago Gaiotto-Moore-Neitzke gave a conjectural description of the hyperk\"ahler metric on $\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}}$, which surprisingly suggests that much of the asymptotic geometry of the moduli space can be derived from the abelian spectral data described before. Recent progress has been made by Mazzeo-Swoboda-Weiss-Witt, Dumas-Neitzke and Fredrickson but the global picture remains open (for a survey of the area, see \cite{Laura}). Finally, one further type of limiting structure we would like to mention is that of opers, appearing as certain limits of Higgs bundles in the Hitchin components. To see this, note that for a solution of \eqref{equation1}-\eqref{equation2} in the $SL(n, \mathbb{C})$-Hitchin section, one can add a real parameter $R>0$ to \eqref{Laura1} to obtain a natural family of connections with $SL(n,\mathbb{R})$ monodromy \begin{eqnarray} \nabla(\xi,R):=\xi^{-1}R\Phi+\bar\partial_A+ \partial^h_A+\xi R\Phi^{^*h}. \end{eqnarray} Some years ago Gaiotto conjectured that the space of opers should be obtained as the $\hbar$-conformal limit of the Hitchin section: taking $R \rightarrow 0$ and $\xi\rightarrow 0$ simultaneously while holding the ratio $\hbar= \xi/R$ fixed. The conjecture was recently established for general simple Lie groups by Dumistrescu-Fredrickson-Kydonakis-Mazzeo-Mulase-Neitzke, who also conjectured that that this oper is the {\it quantum curve} in the sense of Dumitrescu-Mulase, a quantization of the spectral curve $S$ of the corresponding Higgs bundle by {\it topological recursion} (see references and details in \cite{Olivia}). More recently, Collier-Wentworth showed that the above conformal limit exists in much more generality and gives a correspondence between (Lagrangian) strata for every stable VHS --- and not only the Hitchin components. Specifically, they constructed a generalization of the Hitchin section by considering stable manifolds $\mathcal{W}^0(E_0,\Phi_0)$ arising from each VHS $(E_0,\Phi_0)$ given by \begin{eqnarray} \{(E,\phi)\in \ensuremath{\mathcal{M}_{G_{\mathbb{C}}}} ~|~ \lim_{t\rightarrow 0} t\cdot (E,\Phi)=(E_0,\Phi_0)\}. \end{eqnarray} The equivalent correspondence is then obtained by identifying a subcomplex of the deformation complex at a VHS with a corresponding slice in the space of Higgs bundles which parametrizes $\mathcal{W}^0(E_0,\Phi_0)$. \newpage \section*{Correspondences} The appearance of Higgs bundles as parameter spaces for geometric structures is an example of the study of correspondences between solutions to Hitchin's equations \eqref{equation1}-\eqref{equation2} and different mathematical objects. In what follows we shall restrict our attention to a few correspondences between Higgs bundles and two classes of mathematical objects: quiver varieties and hyperpolygons (e.g.~see references in \cite{VicSigma,SteveSigma}). Recall that a quiver $Q=(V,A,h,t)$ is an oriented graph, consisting of a finite vertex set $V$, a finite arrow set $A$, and head and tail maps $h,t:A\rightarrow V$. % A Nakajima representation of a quiver $Q$ can be written as families $W:=((W_v), \phi_a, \psi_a)$ for $a\in A$ and $v\in V$, where $W_v$ is a finite dimensional vector space. The map $\phi_a: W_{t(a)}\rightarrow W_{h(a)}$ is a linear map for all $a\in A$, and $\psi_a$ is in the cotangent space to $Hom(W_{t(a)},W_{h(a)})$ at $\phi_a$. In particular, a \emph{hyperpolygon} is a representation of the \emph{star-shaped} quiver, an example of which appears in Figure \ref{hyper}. \begin{figure}[h!] \centering \includegraphics[width=0.18\textwidth]{Schaposnik_2019_Higgs_FIG3.png} \caption{A star-shaped quiver. }\label{hyper}\end{figure} For the star-shaped quiver in Figure \ref{hyper}, for which the dimensions of $W_v$ are indicated in each vertex, the vector space $T^*{\rm Rep}(Q)$ of representations of $Q$ is \begin{eqnarray} T^* {\rm Rep}(Q) &=& T^*\left(\bigoplus_{i=1}^n {\rm Hom}(\mathbb{C}, \mathbb{C}^r)\right)\nonumber\\ &\cong& T^* \left({\rm Hom}(\mathbb{C}^n, \mathbb{C}^r)\right) =T^*( \mathbb{C}^{n\times r}).\nonumber \end{eqnarray} Konno showed that hyperpolygon spaces are hyperk\"ahler analogs of polygon spaces. Moreover, through the work of Fisher-Rayan, the space of hyperpolygons as in Figure \ref{hyper} may be identified with a moduli space of certain rank $r$ parabolic Higgs bundles on $\mathbb{P}^1$. In this setting, one has to puncture $\mathbb{P}^1$ along a positive divisor $D$ and then regard the Higgs field as being valued in $\mathcal{O}(q) = K\otimes \mathcal{O}(D)$, with poles along $D$ and satisfying certain conditions on its residues at the poles. This takes us to a generalization of Higgs bundles on higher genus surfaces obtained by allowing the Higgs field to have poles, leading to the moduli spaces of tame or parabolic Higgs bundles (for logarithmic singularities) initiated by Simpson \cite{simpson92}, or of wild Higgs bundles (for higher order poles) initiated by Boalch --- see references in \cite{SIGMA} to learn more about these other settings. Understanding the more general appearance of parabolic (and wild) Higgs bundles on higher genus Riemann surfaces in terms of hyperpolygons remains an open question. In a different direction, given a fixed Riemann surface $\Sigma$ and a homomorphism between two Lie groups $\Psi : G_\mathbb{C} \rightarrow G_\mathbb{C}',$ there is a naturally induced map between representation spaces modulo conjugation \[\Psi : Rep(\Sigma, G_\mathbb{C}) \rightarrow Rep(\Sigma, G_\mathbb{C}'),\] It follows from the non-abelian Hodge correspondence that there must be a corresponding induced map between the Higgs bundle moduli spaces, but this does not transfer readily to the induced map on Higgs bundles, in particular since the image might be over the singular locus of the base. When the maps arise through isogenies, together with Bradlow and Branco, the author obtained a description of the map for spectral data in terms of fibre products of spectral curves \cite{PCMI}, but of much interest is the understanding of other maps arising in this manner. Finally, when considering compactifications of the moduli space, one may ask how do the moduli spaces transform when the base Riemann surface $\Sigma$ changes (for instance, when degenerating the surface $\Sigma$ as in Figure \ref{deg}), a question closely related to the relation between Higgs bundles and singular geometry, which we shan't touch upon here --- see \cite{SIGMA} for a survey and open problems in this direction. \begin{figure}[h] \centering \includegraphics[width=0.34\textwidth]{Schaposnik_2019_Higgs_FIG4.png} \caption{A degeneration of the Riemann surface.}\label{deg}\end{figure} \newpage \section*{Mirror symmetry and branes} One of the most interesting correspondences of Hitchin systems arises through mirror symmetry. For $^L G_\mathbb{C}$ the Langlands dual group of $G_\mathbb{C}$, there is an identification of the Hitchin basis $\mathcal{A}_{G_\mathbb{C}} \simeq \mathcal{A}_{^L G_\mathbb{C}}$. Then, through the famous SYZ conjecture, mirror symmetry should manifest as a duality between the spaces of Higgs bundles for Langlands dual groups fibred over the same base via the Hitchin fibration. The two moduli spaces $\mathcal{M}_{G_\mathbb{C}}$ and $\mathcal{M}_{^L G_\mathbb{C}}$ are then torus fibrations over a common base and as first observed by Hausel-Thaddeus for $SL(n,\mathbb{C})$ and $PGL(n,\mathbb{C})$, and shown by Donagi and Pantev for general pairs of Langlands dual reductive groups, their non-singular fibres are dual abelian varieties. Kapustin and Witten gave a physical interpretation of this in terms of S-duality, using it as the basis for their approach to the geometric Langlands program. The appearance of Higgs bundles (and flat connections) within string theory and the geometric Langlands program has led researchers to study the {\it derived category of coherent sheaves} and the {\it Fukaya category} of these moduli spaces. Therefore, it has become fundamental to understand Lagrangian submanifolds of the moduli space of Higgs bundles supporting holomorphic sheaves ($A$-branes), and their dual objects ($B$-branes). By considering the support of branes, we shall refer to a submanifold of a hyperk\"ahler manifold as being of type $A$ or $B$ with respect to each of the complex structures $(I,J,K)$ Hence one may study branes of the four possible types: $(B,B,B), (B,A,A), (A,B,A)$ and $(A,A,B)$, whose dual partner is predicted by Kontsevich's homological mirror symmetry to be: \begin{eqnarray} (B,A,A) \longleftrightarrow (B,B,B) \label{uno}\\ (A,A,B) \longleftrightarrow (A,A,B)\\ (A,B,A) \longleftrightarrow (A,B,A) \end{eqnarray} In views of the SYZ conjecture, it is crucial to obtain the duality between branes within the Hitchin fibration, and in particular between those completely contained within the irregular fibres, and this has remained a very fruitful direction of research for decades. In 2006 Gukov, Kapustin and Witten introduced the first studies of branes of Higgs bundles in relation to the Geometric Langlands Program and electromagnetic duality where the $(B,A,A)$-branes of real $G$-Higgs bundles were considered. These branes, which correspond to surface group representations into the real Lie group $G$, may intersect the regular fibres of the Hitchin fibration in very different ways (see \cite{OBW,PCMI} for references): \begin{itemize} \item {\it Abelianization --- zero-dimensional intersection.} When $G$ is a split real form, the author showed that the $(B,A,A)$-brane intersects the Hitchin fibration in torsion two points. \item {\it Abelianization --- positive dimensional intersection.} Moreover, we can also show that for other groups such as $SU(n,n)$, the intersection has positive dimension but may still be described solely in terms of abelian data. \item {\it Cayley/Langlands type correspondences.} Surprisingly, many spaces of Higgs bundles corresponding to non-abelian real gauge theories do admit abelian parametrizations via auxiliary spectral curves, as shown with Baraglia through Cayley/Langlands type correspondences for the groups $G=SO(p+q,p)$ and $G=Sp(2p+2q,2p)$. \item {\it Nonabelianization. }Together with Hitchin we initiated the study of branes which don't intersect the regular locus, through the {\it nonabelianization of Higgs bundles}, which characterized the branes for $G=SL(n,\mathbb{H}),~SO(n,\mathbb{H})$ and $Sp(n,n)$ in terms of non-abelian data given by spaces of rank 2 vector bundles on the spectral curves. \end{itemize} Moreover, it has been conjectured (Baraglia-Schaposnik) that the Langlands dual in \eqref{uno} to the above $(B,A,A)$-branes should correspond to the $(B,B,B)$-branes of Higgs bundles with structure group the {\it Nadler group} \cite{OBW}. More generally, branes of Higgs bundles have shown to be notoriously difficult to compute in practice, and very few broad classes of examples are known --- e.g. see \cite{PCMI} for a partial list of examples. In the next section we shall describe a family of branes obtained by the author and Baraglia by imposing symmetries to the solutions of \eqref{equation1}-\eqref{equation2} --- see \cite{OBW} and references therein. \newpage \section*{Higgs bundles and 3-manifolds} By considering actions on the Riemann surface $\Sigma$ and on the Lie group $\ensuremath{G_{\mathbb{C}}}$, one can induce actions on the moduli space of Higgs bundles and on the Hitchin fibration, and study their fixed point sets. Indeed, together with Baraglia we defined the following: \begin{itemize} \item Through the Cartan involution $\theta$ of a real form $G$ of $G_\mathbb{C}$ one obtains $ i_1(\bar \partial_A, \Phi)=(\theta(\bar \partial_A),-\theta( \Phi)). $ \item A real structure $f : \Sigma \to \Sigma$ on $\Sigma$ induces $ i_2(\bar \partial_A, \Phi) = (f^*(\rho(\bar \partial_A)), -f^*( \rho(\Phi) )). \label{i2} $ \item Lastly, by looking at $i_3 = i_1 \circ i_2$, one obtains $ i_3(\bar \partial_A, \Phi)=(f^* \sigma(\bar \partial_A),f^*\sigma( \Phi)). $ \end{itemize} The fixed point sets of $i_1,i_2,i_3$ are branes of type $(B,A,A),(A,B,A)$ and $(A,A,B)$ respectively. The topological invariants can be described using $KO$, $KR$ and equivariant $K$-theory \cite{OBW}. In particular, the fixed points of $i_1$ give the $(B,A,A)$-brane of $G$-Higgs bundles mentioned in the previous section, an example of which appears in Figure \ref{realslice}, and which one can study via the monodromy action on the Hitchin fibration (e.g. see \cite{PCMI}). \begin{figure}[h] \centering \includegraphics[width=0.45\textwidth]{Schaposnik_2019_Higgs_FIG5.jpg} \caption{A real slice fixed by $i_1$ of the moduli space of $SL(2,\mathbb{C})$-Higgs bundles, from two different angles, obtained through Hausel's 3d prints of slices of $\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}}$.} \label{realslice}\end{figure} The fixed points of the involution $i_2$ are representations of the orbifold fundamental group of certain 3-manifold obtained through $f$ bounding $\Sigma$. Recall that a real structure (or anti-conformal maps) on a compact connected Riemann surface $\Sigma$ is an anti-holomorphic involution $f : \Sigma \to \Sigma$. The classification of real structures on compact Riemann surfaces is a classical result of Klein, who showed that all such involutions on $\Sigma$ may be characterised by two integer invariants $(n,a)$: the number $n$ of disjoint union of copies of the circle embedded in $\Sigma$ fixed by $f$; and $a\in \mathbb{Z}_2$ determining whether the complement of the fixed point set has one ($a=1$) or two ($a=0$) components, e.g. see Figure \ref{hola}. \begin{figure}[h] \centering \includegraphics[width=0.45\textwidth]{Schaposnik_2019_Higgs_FIG6.jpg} \caption{A genus 2 Riemann surface and its fixed point sets under an anti-holomorphic involution with invariants $(n,a)=(3,0)$.}\label{hola}\end{figure} A real structure $f$ on the Riemann surface $\Sigma$ induces involutions on the moduli space of representations $\pi_1(\Sigma) \to \ensuremath{G_{\mathbb{C}}}$, of flat connections and of $\ensuremath{G_{\mathbb{C}}}$-Higgs bundles on $\Sigma$, and the fixed points sets define $(A,B,A)$-branes of Higgs bundles. These branes can be shown to be real integrable systems, given by (possibly singular) Lagrangian fibrations. From a representation theoretic point of view, one may ask which interesting representations these branes correspond to, a question closely related to the understanding of \textit{which representations of $\pi_1(\Sigma)$ extend to $\pi_1(M)$ for $M$ a 3-manifold whose boundary is $\Sigma$}. Whilst this question in its full generality remains an important open problem, we can consider some particular cases in which the answer becomes clear from the perspective of Higgs bundles. For this, as seen in \cite{OBW} and references therein, we considered the 3-manifolds \begin{eqnarray}M= \frac{\Sigma \times [-1,1]}{ (x,t)\mapsto (f(x),-t)},\label{mani}\end{eqnarray} for which $\partial M = \Sigma$ (e.g. a handle body). In this setting, together with Baraglia, we were able to show that a connection solving the Hitchin equations \eqref{equation1}-\eqref{equation2} on $\Sigma$ extends over $M$ given in \eqref{mani} as a flat connection iff the Higgs bundle $(E,\Phi)$ is fixed by $i_2$ and the class $[E] \in \tilde{K}^0_{\mathbb{Z}_2}(\Sigma)$ in reduced equivariant $K$-theory is trivial. This is, the Higgs bundles which will extend are only those whose vector bundle is preserved by the list of the involution $i_2$, and for which the action of $i_2$ over the fibres of $E$ is trivial when restricted to each fixed circle (as those circles in Figure \ref{hola}). \newpage \section*{Global topology} The computation of topological invariants of Higgs bundle moduli spaces has received vast attention from researchers who have tackled this problem with a diverse set of mathematical tools --- see \cite{Hausel2011GlobalTO} and \cite{SteveSigma} and references therein. One of the main questions considered for Higgs bundles and their generalizations is what the Poincar\'e polynomial $P(\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}},t)$ of the space is. A useful fact is that the total space of the Hitchin fibration deformation retracts onto the nilpotent cone $h^{-1}(0)$ via the gradient flow of the moment map of the $C^*$-action introduced in the harmonic metrics section. Hence, the cohomology ring localises to the fixed-point locus inside $h^{-1}(0)$: as first seen in the work of Hitchin, the Poincar\'e series that generates the Betti numbers of the rational cohomology $H^\bullet(\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}}, \mathbb{Q})$ are a weighted sum of the Poincar\'e series of the connected components of the fixed-point locus, which is essentially Morse theory. \smallbreak \noindent{\bf Example 5.} As shown by Hitchin, for the $SL(2,\mathbb{C})$-Higgs bundles in {\it Example 1}, when the genus of $\Sigma$ is $g = 2$, the Poincar\'e series is \begin{eqnarray} 1+t^2+4t^3+2t^4+34t^5+2t^6. \end{eqnarray} \smallbreak Using Morse theory, it has only been possible to compute Poincar\'e polynomials for low rank groups, and extending this to higher rank has been a challenging open problem for some time. More recently, interesting alternative techniques have been used to access the higher-rank Poincar\'e polynomials by Mozgovoy, Schiffmann, Mellit, and others. One may further ask about the structure of the ring $H^\bullet(\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}}, \mathbb{Q})$ itself: for instance Heinloth recently proved that the intersection pairing in the middle dimension for the smooth moduli space vanishes in all dimensions for $G_\mathbb{C}=PGL(n,\mathbb{C})$; and Cliff-Nevins-Shen proved that that the Kirwan map from the cohomology of the moduli stack of $G$-bundles to the moduli stack of semistable $G$-Higgs bundles fails to be surjective. One of the most important cohomological conjectures in the area is de-Cataldo-Hausel-Migliorini's {\it P=W conjecture}, which gives a correspondence between the weight filtration and the perverse filtration on the cohomology of $\mathcal{M}_B$ and $\mathcal{M}_{Dol}$, respectively, obtained via non-abelian Hodge theory. Only certain special cases are known, e.g., for rank 2 Higgs bundles, shown by de-Cataldo-Hausel-Migliorini's (see \cite{Hausel2011GlobalTO}), and for certain moduli spaces of wild Higgs bundles, proven recently by Shen-Zhang and Szabo. Inspired by the SYZ conjecture mentioned before, Hausel-Thaddeus conjectured that mirror moduli spaces of Higgs bundles present an agreement of appropriately defined Hodge numbers: \begin{eqnarray} h^{p,q}(\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}} )=h^{p,q} (\mathcal{M}_{^LG_\mathbb{C}} ).\label{hola} \end{eqnarray} Very recently, the first proof of this conjecture was established for the moduli spaces of $SL(n,\mathbb{C})$ and $PGL(n,\mathbb{C})$-Higgs bundles by Groechenig-Wyss-Ziegler in \cite{groechenig2017mirror}, where they established the equality of stringy Hodge numbers using p-adic integration relative to the fibres of the Hitchin fibration, and interpreted canonical gerbes present on these moduli spaces as characters on the Hitchin fibres. Further combinatorial properties of $\ensuremath{\mathcal{M}_{G_{\mathbb{C}}}}$ can be glimpsed through their twisted version, consisting of Higgs bundles $(E, \Phi)$ on $\Sigma$ with $\Phi: E\to E\otimes\mathcal L$, where $\Sigma$ now has any genus, $L$ is a line bundle with $\deg(L)>\deg(K)$, but without any punctures or residues being fixed. The corresponding moduli spaces carry a natural $\mathbb{C}^*$-action but but are not hyperk\"ahler and there is no immediate relationship to a character variety. Hence, there is no obvious reason for the Betti numbers to be invariant with regards to the choice of deg(E), which would normally follow from non-abelian Hodge theory. However, the independence holds in direct calculations of the Betti numbers in low rank, and was recently shown for $GL(n,\mathbb{C})$ and $SL(n,\mathbb{C})$-Higgs bundles by Groechenig-Wyss-Ziegler in \cite{groechenig2017mirror}. This suggests that some topological properties of Hitchin systems are independent of the hyperk\"ahler geometry (see references in \cite{Hausel2011GlobalTO,SteveSigma} for more details). Finally, it should be mentioned that an alternative description of the Hitchin fibration can be given through Cameral data, as introduced by Donagi and Gaitsgory, and this perspective presents many advantages, in particular when considering correspondences arising from mirror symmetry and Langlands duality, as those mentioned in previous sections studied by Donagi-Pantev. \newpage \section*{Acknowledgements} The author is partially supported by the NSF grant DMS-1509693, the NSF CAREER Award DMS-1749013, and by the Alexander von Humboldt Foundation. This material is based upon work supported by the NSF under Grant No. DMS1440140 while the author was in residence at the Mathematical Sciences Research Institute in Berkeley, California, during the Fall 2019 semester. Finally, the author would like to thank Steve Bradlow, Laura Fredrickson, Tamas Hausel, Nigel Hitchin, Qiongling Li, Sara Maloni, Du Pei, James Unwin, Richard Wentworth, Anna Wienhard, and very especially Steve Rayan for useful comments on a draft of the manuscript.
\chapter{Introduction} In the beginning of this thesis, we introduce the reader to the basic theoretical concepts, in which our problem is based.We study the supercurrent of Josephson junctions, in which the region between the two superconductors is an intermediate layer of a metal with Rashba spin-orbit interaction, in the presence of barriers with magnetization on the interfaces. \section{Theory of Superconductivity} \par The phenomenon of superconductivity was discovered by Heike Kamerlingh Onnes in Netherlands, in 1911. He was the first to observe that, in certain material and in temperatures below a specific critical value T$_{c}$ , the electrical resistance becomes exactly zero \cite{bok}. After this first observation, hundreds of materials that become superconducting were discovered, with various critical temperatures. The highest temperature superconductor discovered ,until now,is the hydrogen sulfide (H$_{2}$S), with T$_{c}$=203K, but at extremely high pressures \cite{hs}. \par In 1933, Walther Meissner and Robert Ochsenfeld discovered that, inside every superconductor the magnetic field becomes zero: \textbf{B}=0 , making the superconductor a perfect diamagnet. This phenomenon, the expulsion of the magnetic field inside a superconductor, is called the Meissner effect. The explanation of this effect was given by the brothers Fritz and Heinz London, who proved that the magnetic field inside a superconductor has an exponential decay from the surface, with a decay length $\lambda$ , called London penetration depth. In order for this to happen, the superconductor sets up electric currents on its surface, whose magnetic field cancels the applied magnetic field within the superconductor. \par The phenomenon of superconductivity was theoretically explained in 1957, 46 years after it's discovery, by Bardeen, Cooper, and Schrieffer \cite{schr}. They developed the first microscopic theory of superconductivity, named the BCS theory, and received the Nobel Prize in Physics for it, in 1972. They proposed that the electrons of a superconductor that are near the Fermi surface attract indirectly through the crystal lattice, which is described as an exchange of phonons. This attraction overcomes the Coulomb repulsion and the electron form pairs, called Cooper pairs. Cooper pairs feel no scattering and so the supercurrent occurs. In T$>$T$_{c}$ though, the thermal vibration energy of the lattice becomes greater than the pairing energy of the electrons and so the Cooper pair breaks and there is no longer superconducting phenomenon. \section{The Josephson Effect } \par In 1962 Brian David Josephson predicted theoretically that two superconductors that are coupled by a weak link, which link may consist of a normal metal ,an insulator, or a constriction that weakens the superconductivity in general, can still let the supercurrent flow through them \cite{JJ}.This macroscopic phenomenon was given the name Josephson effect. This process can be described as a quantum tunneling effect of the Cooper pair of electrons. \bigskip \begin{center} \includegraphics[scale=2]{jjthesis.png} Figure 1.1: Tunneling effect of the Cooper pair through a weak link \cite{hyp} \end{center} \newpage \par Josephson proved that, for a short junction, the supercurrent, the current that flows through the junction when the voltage V=0, and the phase difference $\phi$ across the junction , which is the difference in the phase factor between the order parameter of the two superconductors, are connected through the relation: \begin{equation} I_{s}=I_{c}sin(\phi) \end{equation} where I$_{c}$ is the supercurrent amplitude (with no external voltage applied) and $\phi$=$\chi$$_{2}$ -$\chi$$_{1}$, where $\chi$$_{i}$ is the phase of each superconductor.This phenomenon is known as the DC Josephson effect. There also exists the AC Josephson effect, but it will not concern us in this thesis. \par The DC Josephson effect is described by a process known as Andreev reflection, named after Alexander F. Andreev \cite{andr}. This reflection is a particle scattering which occurs at the interfaces between the superconductor S and a normal metal N and explains how a normal current in the N side becomes a supercurrent in the S. Andreev proposed that an electron which approaches incidentally the interface from the N side can form a Cooper pair on the S side, and so it passes through the superconductor, with another electron with opposite momentum and spin and, at the same moment, reflect a hole inside the N region. \bigskip \begin{center} \includegraphics[scale=0.2]{jjthesis3.png} Figure 1.2:The Andreev reflection process schematically \cite{hypp} \end{center} \newpage \section{The two-dimensional electron gas (2DEG) } \par A two-dimensional electron gas (2DEG), is an electron gas that freely moves in two dimensions, while in the third dimension it is tightly confined and thus this dimension is ignored. 2DEGs are mostly found in semiconductor structures ,such as transistors. The type of 2DEG we study in this thesis, is a 2DEG which also has a Rashba spin-orbit coupling, also referred as the Rashba effect \cite{rshb}. This Rashba effect is described by the Rashba Hamiltonian: \begin{equation} H_{R}=\alpha(\vec{\sigma} \times \vec{p})\cdot \hat{z} \end{equation} where $\alpha$ is the Rashba coupling, $\vec{p}$ is the momentum and $\vec{\sigma}$ is the Pauli matrix vector, while $\hat{z}$ is the unit vector that is in the direction perpendicular to the two-dimensional plane.The study of spin-orbit coupling (SOC) and related effects is one of the most active fields in mesoscopic physics. \section{Previous work on the subject} \par Since the discovery of the Josephson effect, there has been a continuously growing interest in the fundamental physics and applications of this effect. The achievements in Josephson-junction technology have made it possible to develop a variety of sensors for detecting ultralow magnetic fields and weak electromagnetic radiation, as well as the fabrication of ultrafast digital rapid single flux quantum (RSFQ) circuits \cite{lkr,dev}. Josephson junctions of different types have been studied, with the most important of them the superconductor-normal metal-superconductor (S/N/S) and the superconductor-ferromagnet-superconductor (S/F/S) junctions, which we will discuss in the following, as well as the (S/2DEG/S) junction, which is studied in this thesis. \par The understanding of the physics behind the Josephson effect was quite challenging. A.F.Andreev explained the phenomenon in 1964 establishing the concept of the so-called Andreev reflection, which includes another form of charge transport. A quasiparticle located in the weak link cannot penetrate directly from a normal metal into a superconductor if its energy is smaller than the superconducting energy gap. However, an electron with momentum k impinging on one of the interfaces can be converted into a hole moving in the opposite direction, generating a Cooper pair in the superconductor. This hole is consequently Andreev reflected at the second interface and is converted back to an electron, leading to the destruction of a Cooper pair (Fig. 1.3). As a result of this cycle, a pair of correlated electrons is transferred from one superconductor to another, creating a supercurrent flow across the junction. \begin{center} \includegraphics[scale=0.6]{ARef} Figure 1.3:The cycle of the Andreev reflection \cite{snss} \end{center} \par The Andreev reflection amplitudes depend on the corresponding quasiparticles' phases $\chi_{1,2}$ and so, the resulting current depends on the phase difference $\phi=\chi_{1}-\chi_{2}$ of the two superconductors. Due to the electron-hole interference in the quantum well, formed by the pairing potentials of the superconducting electrodes, current carrying standing waves with quantized energy appear in the weak-link region The corresponding quantum states are referred to as Andreev bound states, which has been studied extensively \cite{klk}. \begin{center} \includegraphics[scale=0.6]{ABoundS} \begin{flushleft} Figure 1.4:Energy-phase relation for Andreev bound states in a short weak link: Tunneling limit (low transparency, solid lines), ballistic regime (dotted line), intermediate case (dashed lines) \cite{snss}. \end{flushleft} \end{center} \par In the general case, the supercurrent I($\chi$), which is the sum of the partial currents transported via Andreev bound states, can be decomposed into a Fourier series\cite{tnk}: \begin{equation} I(\phi)=\pd{E(\phi)}{\phi}=\sum_{n\geq1}(I_{n}sin(n\phi)+J_{n}cos(n\phi)) \end{equation} where I$_{n}$ and J$_{n}$ are coefficients to be determined. Also, J$_{n}$ vanishes if time-reversal symmetry is not broken. \par An interesting case is the junction with $I_{c}<0$, which is called the $\pi$-junction \cite{blv,sp1,sp2,sp3}. Such a junction has an energy minimum at $\chi=\pi$, providing a phase shift of $\pi$ in the ground state. $\pi$-junction may be used as a phase inverter in superconducting digital circuits (SQUIDS) \cite{trz,qb}, and are proposed as candidates for engineering a quantum two-level system, or qubit, which is the basic element of a quantum computer. \par A lot of study has been done for the S/N/S junction (see for example \cite{bj,snss}). In the clean limit, in which the mean free path of an electron is larger than the distance between the superconducting electrodes, only a small number of electrons from the S metals moving almost perpendicular to the SN interface could penetrate from S into N and finally from N into the second electrode, thus providing a Josephson coupling in the structure. In these junctions, the current-phase relation transforms from the sinusoidal form as T$\rightarrow$Tc, to a saw-toothed curve, at low T. \par There is also a continuously growing interest in charge and spin transport in contacts between superconductors and ferromagnets (S/F/S junction) (see \cite{frst,brev}). The most important feature of these junction was the ability to create a crossover from the 0 to $\pi$ state (0-$\pi$ transition). The first experimental observations of this effect were reported by Ryazanov et al., in 2000 \cite{rzN}. In an SF bilayer correlated electrons and holes, having opposite spin directions, are under the exchange field of a ferromagnet. This results in an energy shift between these quasiparticles and the creation of a nonzero momentum Q of Cooper pairs. As a result, the amplitude of superconducting correlations oscillates spatially in the ferromagnetic metal as cos(Qx) \cite{zp}. The sign change of this amplitude is equivalent to periodic 0-$\pi$ phase jumps for certain lengths of the ferromagnet. This transition can be achieved either by decreasing the temperature \cite{rzN}, or by changing the magnetization directions of the layers \cite{flt}. \par For low-temperature electronics it is quite natural to combine the technology of modern superconductors with that of semiconductors. One of the practical realizations of such a combined approach is to couple two superconducting electrodes by a 2D electron gas (S/2DEG/S junction) \cite{MRS}. In addition, it was shown experimentally that the strength of the Rashba coupling can be controlled by a gate voltage \cite{NT,gv}. In this kind of junctions, the combined effects of topology and electronic correlations can be used to investigate unconventional Josephson effects, such as the anomalous Josephson effect ($I(\phi=0)\ne0$), which we will also examine in the following chapters. In this case, the corresponding ground state of the junction is found at a phase $\phi_{0}\ne\{0,\pi\}$, where the Josephson current is zero. In addition, for a strong Rashba interaction, the projection of electron spin is strongly correlated with the direction of motion, and so, left- and right-moving electrons with the same energy always have opposite spin projections. This fact leads to the phenomenon of direction-dependent critical current. Also, the combined effect of Rashba and spin-flip interactions \cite{sp4,sp5} leads to phenomena which would otherwise require a magnetic field that is too large to be sustained by the superconducting leads, in an S/F/S junction \cite{MNt}. \section{Organization of Thesis} \par In chapter 2 we will approach the Josephson junction problem as a 2-D quantum scattering system and solve the problem analytically, making use of the Bogoliubov-de Gennes (BdG) equations \cite{BdG}. We will construct the matching matrix from the boundary conditions of the problem and, by calculating it's determinant, we will calculate the supercurrent with a method named the Furusaki-Tsukada method \cite{FTM}. This method finds the supercurrent by summing analytically all the contributions from the Andreev reflection. \par In chapter 3, we will study our junction numerically. What will mostly concern us in this thesis is the current-phase relation as a function of the spin-orbit interaction on the 2DEG and the magnetization of the interfaces. \par Following, in chapters 4 and 5, we will study how the Critical current and the Zero-phase current, respectively, differs, for different geometries and spin-orbit amplitudes. \par Finally, in the conclusion section, we will summarize our most significant results and we will draw some conclusions. We will also discuss further expansion of this Thesis subject. \newpage \chapter{Analytical approach of the problem} To begin with, we consider a clean 2-D ballistic S/2DEG/S Josephson junction, as shown in figure 2.1 below. It consists of two identical superconductors on the sides, interrupted by a 2DEG with Rashba spin-orbit coupling. In the region between each superconductor and the 2DEG exist very thin interface barriers at x=0 and x=d (the black regions referred as IF in the figure). The barriers are in the z-y plane and have both normal scattering and spin-flip effect, due to their magnetization. \begin{center} \includegraphics[scale=0.7]{sxhmagtp2} Figure 2.1:Schematic of the S/2DEG/S junction \end{center} \newpage \section{ Bogoliubov-de Gennes equations} \par BdG equations are a generalization of the BCS theory, in which space dependent quantities are introduced. At first, they introduce a space dependent pairing potential ,for the Cooper pair of electrons: $\Delta=\Delta(r)$. Next, they use a "mean field" approximation to describe, finally, the "Schroedinger" equation of the components $u(r)$ and $v(r)$ of a spinor $\psi(r)$, which are the amplitudes of the electron and hole part of the quasiparticle excitations correspondingly: \begin{equation} \vec{\Psi}(\vec{r})=\begin{pmatrix} u(\vec{r}) \\ v(\vec{r}) \end{pmatrix} \end{equation} The effective Hamiltonian that acts on this spinor has the form of a matrix: \begin{equation} H=\begin{pmatrix} \hat{H_{0}}&\hat{\Delta}(\vec{r}) \\ \hat{\Delta}^*(\vec{r})&-\hat{H_{0}^*} \end{pmatrix} \end{equation} The pairing potential function of our problem is: \begin{equation} \hat{\Delta}(x)= \begin{cases} i \sigma_{y}\Delta , & \text{$x\in(-\infty,0)$} \\ 0, & \text{$x\in[0,d]$} \\ i \sigma_{y}\Delta e^{i\phi}, & \text{$x\in(d,\infty)$} \end{cases} \end{equation} $\hat{H_{0}}$ is the normal Hamiltonian, which in our problem has the form: \begin{equation} \hat{H_{0}}=-\hbar^2\dfrac{d}{dx}\dfrac{1}{2m(x)}\dfrac{d}{dx}+U(x)+\hat{H}_{RSOC}-\mu \end{equation} with the first term being the kinetic energy, m(x) the effective mass function and $\mu$ the chemical potential.U(x) is the interface potential: \begin{equation} U(x)=[U_{L}-\hat{\vec{\sigma}}\cdotp \vec{N}_{L}]\delta(x)+[U_{R}-\hat{\vec{\sigma}}\cdotp \vec{N}_{R}]\delta(x-d) \end{equation} In the equation above, $U_{\nu}$ represents the normal scattering strength and $\vec{N_{\nu}}$ represents the spin-flip scattering strength ($\nu$=L,R), which is proportional to the magnetization of the interfaces, while $\vec{\sigma}$ is the Pauli matrices vector. \par The term $\hat{H}_{RSOC}$ describes the Rashba spin-orbit coupling (RSOC) in the 2DEG region and is given by the relation: \begin{equation} \hat{H}_{RSOC}=\dfrac{\lambda_{0}}{\hbar}(\sigma_{y}p_{x}-\sigma_{x}p_{y})[\theta(x)-\theta(x-d)] \end{equation} $\lambda_{0}$ is called RSOC constant and defines the amplitude of spin-orbit coupling, $\sigma_{i}$ and $p_{i}$ are the Pauli matrix and momentum vector components, respectively, in the i direction. Lastly, $\theta$(x) is the step function. \section{Eigenfunctions of the junction's layers} \par As mentioned before, in order to calculate the supercurrent of our junction, we have to use the method of Furusaki- Tsukada. To do that, we have to write the wavefunction in each layer, then apply the boundary conditions on the interfaces and finally construct the matching matrix from them. \par We study the problem using the short range potential scattering theory. Thus, we solve the BdG equations separately in each region and match our solutions at the respective boundaries. In order to do that, we first have to find the eigenfunctions of each layer. \bigskip \begin{flushleft} \textbf{{\large 2.2.1 Eigenfunctions of the superconductor}} \end{flushleft} \par Our junctions consists of two superconductors. The left (L) superconductor extends for $x\in(-\infty,0)$, while the right (R) extends for $x\in(d,\infty)$. Thus, the planar wave on the L is described by $e^{(-ik_{eL}x)}$ for electrons and by $e^{(+ik_{hL}x)}$ for the holes. On the R we have the opposite signs, for the transmitted wavefunctions: $e^{(+ik_{eR}x)}$ for electrons and $e^{(-ik_{hR}x)}$ for holes. Our system though is in two dimensions. Because of the translational invariance along the y axis, the momentum in that direction, parallel to the interface, $k_{p}$, is conserved. Thus, the wavefunction in the y direction will by described by $e^{ik_{p}y}$. \par We use the index $\nu$=L,R for left and right superconductor respectively. So, for each superconductor, the total wavefunction will be a linear combination of the eigenfunctions below: \bigskip \begin{equation} \vec{\Psi_{e\uparrow\nu}}=\begin{pmatrix} u_{\nu}(E)e^{i\frac{\chi_{\nu}}{2}}\\0\\0\\v_{\nu}(E)e^{-i\frac{\chi_{\nu}}{2}} \end{pmatrix}e^{\pm ik_{e\nu}x}e^{ik_{p}y} \end{equation} \begin{equation} \vec{\Psi_{e\downarrow\nu}}=\begin{pmatrix} 0\\u_{\nu}(E)e^{i\frac{\chi_{\nu}}{2}}\\-v_{\nu}(E)e^{-i\frac{\chi_{\nu}}{2}}\\0 \end{pmatrix}e^{\pm ik_{e\nu}x}e^{ik_{p}y} \end{equation} \begin{equation} \vec{\Psi_{h\uparrow\nu}}=\begin{pmatrix} 0\\v_{\nu}(E)e^{i\frac{\chi_{\nu}}{2}}\\-u_{\nu}(E)e^{-i\frac{\chi_{\nu}}{2}}\\0 \end{pmatrix}e^{\pm ik_{h\nu}x}e^{ik_{p}y} \end{equation} \begin{equation} \vec{\Psi_{h\downarrow\nu}}=\begin{pmatrix} v_{\nu}(E)e^{i\frac{\chi_{\nu}}{2}}\\0\\0\\u_{\nu}(E)e^{-i\frac{\chi_{\nu}}{2}} \end{pmatrix}e^{\pm ik_{h\nu}x}e^{ik_{p}y} \end{equation} \bigskip In the relations above, E is the energy of the wavefunction and $\chi_{\nu}$ is the phase of the superconducting order parameter. In addition, $k_{q\nu}$ (where q stands for the quasiparticle type: q=e,h) are the wavenumbers and are given from the relation: \begin{equation} k_{q\nu}=\sqrt{\dfrac{2m}{\hbar^2}(\pm \Omega_{\nu} +\mu-U)-k_{p}^2} \end{equation} where $\Omega_{\nu}=sgn(E)\sqrt{E^2-\abs{\Delta_{\nu}}^2}$ and the symbol "sgn" stands for the signature function. The coherence factors, u and v, of the superconductors, are: \begin{equation} u_{\nu}(E)=\sqrt{\dfrac{1}{2}(1+\dfrac{\Omega_{\nu}}{E})} \end{equation} \begin{equation} v_{\nu}(E)=sgn(E)\sqrt{\dfrac{1}{2}(1-\dfrac{\Omega_{\nu}}{E})} \end{equation} \bigskip \begin{flushleft} \textbf{{\large 2.2.2 Eigenfunctions of the 2DEG}} \end{flushleft} \par As mentioned before, the Hamiltonian of the 2DEG is of the form: \begin{equation} \hat{H}_{RSOC}=\dfrac{\lambda_{0}}{\hbar}(\sigma_{y}p_{x}-\sigma_{x}p_{y}) \end{equation} \bigskip The eigenfunctions of this Hamiltonian are: \begin{equation} \vec{\Psi_{e1}}=\dfrac{1}{\sqrt{2}}\begin{pmatrix} e^{\pm i\chi(a1)}\\1\\0\\0 \end{pmatrix}e^{\pm iq_{e1}x}e^{ik_{p}y} \end{equation} \begin{equation} \vec{\Psi_{e2}}=\dfrac{1}{\sqrt{2}}\begin{pmatrix} -e^{\pm i\chi(a2)}\\1\\0\\0 \end{pmatrix}e^{\pm iq_{e2}x}e^{ik_{p}y} \end{equation} \begin{equation} \vec{\Psi_{h1}}=\dfrac{1}{\sqrt{2}}\begin{pmatrix} 0\\0\\-e^{\pm i\chi(b1)}\\1 \end{pmatrix}e^{\mp iq_{h1}x}e^{ik_{p}y} \end{equation} \begin{equation} \vec{\Psi_{h2}}=\dfrac{1}{\sqrt{2}}\begin{pmatrix} 0\\0\\e^{\pm i\chi(b2)}\\1 \end{pmatrix}e^{\mp iq_{h2}x}e^{ik_{p}y} \end{equation} \bigskip In the relations above, the upper sign is for particle moving towards the R direction and the lower is for the L direction, and $q_{pi}$, with p=e,h being the particle index and and i=1,2 being the spin-mode index, are the wavevectors of the particles.We also define $a_{i}$ and $b_{i}$, as the angles between the particle wavevectors and the x axis: \newpage \begin{equation} a_{i}=\arctan{\dfrac{k_{p}}{q_{ei}}} \end{equation} \begin{equation} b_{i}=\arctan{\dfrac{k_{p}}{q_{hi}}} \end{equation} The coefficients $\chi(a_{i})$ and $\chi(b_{i})$ are the angles between the particle wavevectors and the y axis: \begin{equation} \chi(a_{i})=\dfrac{\pi}{2}-a_{i} \end{equation} \begin{equation} \chi(b_{i})=\dfrac{\pi}{2}-b_{i} \end{equation} \bigskip Now, to define the particle wavevectors, we define $k_{F}$ and $k_{R}$ as the Fermi and Rashba wavevector, respectively, given from the relations: \begin{equation} k_{F}=\sqrt{\dfrac{2mE_{F}}{\hbar^2}} \end{equation} \begin{equation} k_{R}=\dfrac{m\lambda_{0}}{\hbar^2} \end{equation} The wavevectors of the electrons are: \begin{equation} q_{ei}=\sqrt{(\sqrt{k^2_{R}+k^2_{F}+\dfrac{2mE}{\hbar^2}}\mp k_{R})^2-k^2_{p}} \end{equation} with the upper sign for i=1 and the lower for i=2. In a similar way, the wavevectors of the holes are: \begin{equation} q_{hi}=\sqrt{(\sqrt{k^2_{R}+k^2_{F}-\dfrac{2mE}{\hbar^2}}\mp k_{R})^2-k^2_{p}} \end{equation} \par So, for the 2DEG, the total wavefunction will be a lineal combination of all the 8 eigenfunctions written above(relations (2.14)-(2.17). \bigskip \begin{center} \includegraphics[scale=0.6]{rashba} Figure 2.2: Schematic of the Rashba effect on the k-space and the Energy \end{center} \section{Constructing the matching matrix from the boundary conditions} \par In this last section of the chapter, we write down the boundary-condition equations in the form of a matrix. This will be the final step in the process of computing the supercurrent. \bigskip \textbf{\begin{flushleft} {\large 2.3.1 The boundary-condition equations} \end{flushleft}} In section 2.2 we found the eigenfunctions in each layer. As mentioned before, the wavefunction of the layer is a linear combination of these wavefunctions. Thus, our whole wavefunction has 16 unknown coefficients: 4 for each superconductor and 8 for the intermediate layer. In order to define those coefficients we have to solve the boundary conditions for each interface. So we have: \bigskip \begin{equation} \Psi(x)|_{x=x_{i}^+}=\Psi(x)|_{x=x_{i}^-} \end{equation} \begin{equation} \hat{v}\Psi(x)|_{x=x_{i}^+}=\hat{v}\Psi(x)|_{x=x_{i}^-}+\hat{U}\Psi(x_{i}) \end{equation} \bigskip where i=1,2 and $x_{1}$=0 for left interface and $x_{2}=d$ for the right. We also make use of the velocity operator: \bigskip \begin{equation} \hat{v}=\begin{pmatrix} -\dfrac{\hbar}{m(x)}\dfrac{d}{dx}&\dfrac{\lambda_{0}}{\hbar}\Theta(x)&0&0\\-\dfrac{\lambda_{0}}{\hbar}\Theta(x)&-\dfrac{\hbar}{m(x)}\dfrac{d}{dx}&0&0\\0&0&\dfrac{\hbar}{m(x)}\dfrac{d}{dx}&-\dfrac{\lambda_{0}}{\hbar}\Theta(x)\\0&0&\dfrac{\lambda_{0}}{\hbar}\Theta(x)&\dfrac{\hbar}{m(x)}\dfrac{d}{dx} \end{pmatrix} \end{equation} \bigskip in which $\Theta(x)$=$\theta(x)-\theta(x-d)$. \bigskip Finally, we define the scattering operator $\hat{U}$ as: \begin{equation} \hat{U}=\begin{pmatrix} \hat{Z}_{\nu}&\hat{0}\\\hat{0}&\hat{Z}^*_{\nu} \end{pmatrix}\begin{pmatrix} 1&0&0&0\\0&1&0&0\\0&0&-1&0\\0&0&0&-1 \end{pmatrix} \end{equation} In the equation above, $\hat{0}$ is a 2x2 matrix with zeroes and $\hat{Z_{\nu}}$ is also a 2x2 matrix of the form: \begin{equation} \hat{Z_{\nu}}=\dfrac{2m(x)}{\hbar^2}[U_{\nu}\hat{I}-\hat{\vec{\sigma}}\cdotp\ \vec{N}_{\nu}] \end{equation} with $U_{\nu}$ and $\hat{N}_{\nu}$ from (2.5). \newpage \textbf{\begin{flushleft} {\large 2.3.2 The matching matrix} \end{flushleft}} Now, we are finally able to construct the matrix. The above equations can be written as: \bigskip \begin{equation} \begin{pmatrix} L_{1}&S_{1}&0&0\\L_{2}&0&S_{2}&0\\0&S'_{1}&0&R_{1}\\0&0&S'_{2}&R_{2} \end{pmatrix}\begin{pmatrix} \alpha\\\beta\\\gamma \end{pmatrix}=B_{ps} \end{equation} \bigskip where $L_{i}$, $S_{i}$, $S'_{i}$, $R_{i}$ (i=1,2) , as well as the elements 0, are all 4x4 matrices. In addition, $\alpha$ and $\gamma$ are 4-component columns, with elements the reflection $\alpha_{ps}$ and transmission $\gamma_{ps}$ coefficients respectively, while $\beta$ is an 8-component column, with elements $\beta_{psi}$. The index p is referred to the particle, s to spin and i to the direction (right going and left going wave). To make the columns, we take all the possible combinations of the above indexes. Also, $B_{ps}$ is a column vector with 16 components that describes the incident wave. \par Now, to define the block matrices, we use the symbol $\hat{1}$ for the unitary 2x2 matrix and $\hat{1}_{a}$ for the matrix below: \begin{equation} \hat{1}_{a}=\begin{pmatrix} 0&-1\\1&0 \end{pmatrix} \end{equation} \par Also. in order to write the matrices below, we have normalized our parameters. All the lengths are normalized on the Fermi wavevector $ k^{-1}_{F}$ and all the energy units over the Fermi energy $E_{F}$. We also use the symbol $m^*$ for the normalized (effective) mass on the 2DEG over the mass of the particles on the superconductors, and $\lambda$, which is the normalized spin-orbit coupling constant: \begin{equation} \lambda=\dfrac{\lambda_{0}k_{F}}{E_{F}} \end{equation} Finally, the current units are normalized over $I_{n}$: \begin{equation} I_{n}=\dfrac{e\Delta}{\hbar} \end{equation} where $\Delta$ is the pair potential, given in (2.3). \bigskip So, $L_{1}$ and $L_{2}$ are the 4x4 matrices: \begin{equation} L_{1}=\begin{pmatrix} u_{L}\hat{1}&v_{L}\hat{1}\\(-ik_{eL}\hat{1}-Z_{L})u_{L}&(ik_{hL}\hat{1}-Z_{L})v_{L} \end{pmatrix}e^{i\frac{\chi _{L}}{2}} \end{equation} \begin{equation} L_{2}=\begin{pmatrix} v_{L}\hat{1}_{a}&u_{L}\hat{1}_{a}\\(-ik_{eL}\hat{1}-Z^*_{L})\hat{1}_{a}v_{L}&(ik_{hL}\hat{1}-Z^*_{L})\hat{1}_{a}u_{L} \end{pmatrix}e^{-i\frac{\chi _{L}}{2}} \end{equation} \bigskip In the matrices above, $k_{q\nu}$, $u_{\nu}$ and $v_{\nu}$ are given from the relations (2.11),(2.12) and (2.13) respectively. Now, before we enter the 2DEG area, we first have to define the following spinors: \bigskip \begin{equation} e_{1\nu}=\begin{pmatrix} \mp ie^{\pm a_{1}}\\ 1 \end{pmatrix}, e_{2\nu}=\begin{pmatrix} \pm ie^{\pm a_{2}}\\ 1 \end{pmatrix} \end{equation} \begin{equation} h_{1\nu}=\begin{pmatrix} \pm ie^{\pm b_{1}}\\ 1 \end{pmatrix}, h_{2\nu}=\begin{pmatrix} \mp ie^{\pm b_{2}}\\ 1 \end{pmatrix} \end{equation} \bigskip where $\nu$=L,R as always, and the upper sign is for $\nu$=L. Also, $a_{i}$ and $b_{i}$ are the angles defined from the relations (2.18) and (2.19). Next, the matrices $S_{1}$ and $S_{2}$ are: \bigskip \begin{equation} S_{1}=\begin{pmatrix} E_{1}&E_{2} \end{pmatrix} \end{equation} \begin{equation} S_{2}=\begin{pmatrix} H_{1}&H_{2} \end{pmatrix} \end{equation} Where : \bigskip \begin{equation} E_{i}=\begin{pmatrix} -e_{iR}&-e_{iL}\\(-\dfrac{iq_{ei}}{m^*}\hat{1}-\lambda\hat{1}_{a})e_{iR}&(\dfrac{iq_{ei}}{m^*}\hat{1}-\lambda\hat{1}_{a})e_{iL} \end{pmatrix} \end{equation} \begin{equation} H_{i}=\begin{pmatrix} -h_{iR}&-h_{iL}\\(\dfrac{iq_{hi}}{m^*}\hat{1}-\lambda\hat{1}_{a})h_{iR}&(-\dfrac{iq_{hi}}{m^*}\hat{1}-\lambda\hat{1}_{a})h_{iL} \end{pmatrix} \end{equation} Above, $q_{ei}$ and $q_{hi}$ are given in (2.25) and (2.26), (i=1,2). \bigskip The matrices $S'_{1}$ and $S'_{2}$ are: \bigskip \begin{equation} S'_{1}=\begin{pmatrix} E'_{1}&E'_{2} \end{pmatrix} \end{equation} \begin{equation} S'_{2}=\begin{pmatrix} H'_{1}&H'_{2} \end{pmatrix} \end{equation} Where : \bigskip \begin{equation} E'_{i}=\begin{pmatrix} e_{iR}e^{iq_{ei}d}&e_{iL}e^{-iq_{ei}d}\\(\dfrac{iq_{ei}}{m^*}\hat{1}+\lambda\hat{1}_{a})e_{iR}e^{iq_{ei}d}&(-\dfrac{iq_{ei}}{m^*}\hat{1}+\lambda\hat{1}_{a})e_{iL}e^{-iq_{ei}d} \end{pmatrix} \end{equation} \begin{equation} H'_{i}=\begin{pmatrix} h_{iR}e^{-iq_{hi}d}&h_{iL}e^{iq_{hi}d}\\(-\dfrac{iq_{hi}}{m^*}\hat{1}+\lambda\hat{1}_{a})h_{iR}e^{-iq_{hi}d}&(\dfrac{iq_{hi}}{m^*}\hat{1}+\lambda\hat{1}_{a})h_{iL}e^{iq_{hi}d} \end{pmatrix} \end{equation} \bigskip Finally, the matrices $R_{1}$ and $R_{2}$ are: \bigskip \begin{equation} R_{1}=-\begin{pmatrix} u_{R}\hat{1}&v_{R}\hat{1}\\(ik_{eR}\hat{1}-Z_{R})u_{R}&(-ik_{hR}\hat{1}-Z_{R})v_{R} \end{pmatrix}e^{i\frac{\chi _{R}}{2}} \end{equation} \begin{equation} R_{2}=-\begin{pmatrix} v_{R}\hat{1}_{a}&u_{R}\hat{1}_{a}\\(ik_{eR}\hat{1}-Z_{R})v_{R}\hat{1}_{a}&(-ik_{hR}\hat{1}-Z_{R})u_{R}\hat{1}_{a} \end{pmatrix}e^{-i\frac{\chi _{R}}{2}} \end{equation} \newpage \section{The Supercurrent} \par Now that we have the matrix of the equation (2.31), we find it's determinant $\Gamma$. $\Gamma$ is a function of the phase $\chi$=$\phi_{R}$-$\phi_{L}$, the energy E and the parallel to the interface momentum $k_{p}$: \begin{equation} \Gamma=\Gamma(\chi,E,k_{p}) \end{equation} \par Next, we set $\phi_{L}$=0 and so $\chi$=$\phi_{R}$. Because we are working for a non-zero temperature T, we have thermal excitations. Thus, we have to use the Matsubara frequency summation method. This method implies that we use discrete imaginary frequencies $i\omega_{n}$, instead of the energy E, and sum over them to find the thermal excitations' contribution. \bigskip So, now,for the supercurrent I we have: \begin{equation} I=-\dfrac{e}{\hbar\beta}\sum_{\omega_{n}}\sum_{k_{p}}\dfrac{1}{\Gamma}\dfrac{\partial\Gamma}{\partial\chi} \end{equation} We now can use the method of Laplace expansion, which makes us find the exact dependence of $\Gamma$ from the phase $\chi$ and so we have: \begin{equation} \Gamma(\chi,\omega_{n},k_{p})=A(\omega_{n},k_{p})cos(2\chi)+B(\omega_{n},k_{p})sin(\chi)+C(\omega_{n},k_{p})cos(\chi)+D(\omega_{n},k_{p}) \end{equation} Thus, the final and most crucial formula, which is the one we use in the next section is: \bigskip \begin{equation} I=\dfrac{e}{\hbar\beta}\sum_{\omega_{n}}\sum_{k_{p}}\dfrac{2Asin(2\chi)-Bcos(\chi)+Csin(\chi)}{Acos(2\chi)+Bsin(\chi)+Ccos(\chi)+D} \end{equation} \bigskip \newpage \chapter{Supercurrent in a S/2DEG/S junction} \par In this chapter we solve numerically the equations of chapter 2 and then we examine the dependence of the supercurrent from the phase $\chi$. At first we study how these relations transform under the change of our other parameters separately. Later on, we focus our study on the (drastic) change of these relations for different interface magnetization geometries. \section{General study of the current-phase \\ relation } \par In this first section of the chapter, we study the general properties of the S/2DEG/S junction. First, we shall observe how the spin-orbit coupling itself affects the current-phase relation. This is shown in figure 3.1 below. In this figure, we display on the y axis the normalized current over $I_{n}$ (relation 2.35). In the x axis is the phase $\chi$ over $\pi$. In addition, for this graph all scattering interfaces are set zero (Z=$Z_{n}$=$Z_{m}$=0) and T=0.1$T_{c}$. We represent each graph by writing it's title on the legend and, next to it inside a parenthesis, the parameters. \par \textit{Comment}: in most of our graphs, we have $m^*$=1 and T=0.1$T_{c}$. So, these parameters are not refereed in the description of our figures. In the rare case we set $m^*$$\ne$1 or T$\ne$0.1$T_{c}$ we write it down, both before and in the description of the figure. Also, in the cases that $Z_{n}$=$Z_{m}$, we use the symbol Z to describe both of them. \begin{center} \includegraphics[scale=0.5]{I_x_LZ0} Figure 3.1: Current-Phase Relation for various $\lambda$ ($k_{F}d$=10, Z=0) \end{center} One can observe that the presence of $\lambda$ makes the curve smoother, more sinusoidal and also decreases it's amplitude, as it increases the misfit at the interfaces. \par Next, we shall see the effect of the temperature (figure 3.2). As we know, the rise of the temperature decreases the gap of the superconductor. \begin{center} \includegraphics[scale=0.5]{I_x_TZ0L01} Figure 3.2: Current-Phase Relation for various $\dfrac{T}{T_{c}}$ ($k_{F}d$=10, $\lambda$=0.1, Z=0 ) \end{center} \bigskip By increasing the temperature, the current decreases drastically and tends to zero as we approach the value $T_{c}$. \par Next up, we shall examine the effect of the scattering barriers. In figure (3.3) we have a junction which includes barriers with increasing normal scattering effect (but not spin-flip): \begin{center} \includegraphics[scale=0.5]{I_x_ZNZM0L01D10} Figure 3.3: Current-Phase Relation for various $Z_{n}$\\ ($k_{F}d$=10, $\lambda$=0.1, $Z_{m}=0$) \end{center} \bigskip As expected, the normal scattering also makes our curve smoother and more sinusoidal, decreasing the current. Generally speaking, the position of the critical current tends to $\chi$=$\dfrac{\pi}{2}$, as the reflection on the interfaces becomes stronger. This happens because the interface reflection creates "misfit", and thus our junction becomes more realistic. \par Another parameter that also creates "misfit" is the difference of the effective mass ($m^*$), between the 2DEG and the superconductor. As mentioned before, 2DEGs are found in semiconductor structures. In semiconductors commonly the effective mass becomes smaller. The dependence of the supercurrent from this $m*$ decrease is shown in figure (3.4). As $m*$ decreases, the misfit becomes rapidly larger. \begin{center} \includegraphics[scale=0.5]{I_x_mbarZ0L01D10} Figure 3.4: Current-Phase Relation for various values of $m^*$\\($k_{F}d$=10, $\lambda$=0.1, Z=0 ) \end{center} \par To end this section, we will examine the dependence of the supercurrent from the normalized length $k_{F}d$ of the 2DEG, which is shown in figure (3.5): \begin{center} \includegraphics[scale=0.5]{I_x_dZn05Zm0L01} Figure 3.5: Current-Phase Relation for various values of $k_{F}d$ \\($\lambda$=0.1, $Z_n$=0.5, $Z_m$=0 ) \end{center} \bigskip \par In the graph above we have applied a scattering barrier without spin-flip. One can see that the current's amplitude slowly decays for longer junctions, without changing it's form. Such a slow decay is expected, as long as the 2DEG's length is quite smaller than the correlation length: $d<<\xi_{0}$. \bigskip \section{The interface magnetization effects I: \\The second harmonic} \par In this section we examine separately how the spin-flipping effect, which appears due to the interfaces' magnetization, changes the current-phase relation we saw before. We will see that, contrary to the previous cases, the spin-flip changes dramatically, not only the amplitude, but also the scheme of this relation's graph. Also, the effect depends on the direction of the two magnetizations and the angle between them. Thus, we have a variety of interesting phenomena including the $\pi$-junction and the Zero-phase current, which we will discuss later. \par To begin with, we plot the zero-phase relation with the magnetizations being in either the X or the Z axis. So, we have the 4 curves seen in figure (3.6). In the legend, the first letter is refereed to the direction of the magnetization of the left interface and the second for the right. \begin{figure} \centering \includegraphics[scale=0.5]{I_x_GeomZXZ05L01d10} Figure 3.6: Current-Phase Relation for various magnetization geometries \\($k_{F}d$=10, $\lambda$=0.1, Z=0.5) \end{figure} \par The most important feature of this graph is that, while for the XZ geometry we have a sine-like curve, in the other 3 geometries our curve is no longer sinusoidal but a second harmonic makes it's appearance. One can imagine that, as this second harmonic dominates the first, we have the process of the 0-$\pi$ transition, which is the transition of a sine-like curve into a (-sine)-like one. As we will see in the following, the second harmonic can also occur for a XZ geometry, but for different values of the parameters. \par In the second harmonic, the transfer of Cooper pairs through the junction involves co-tunneling processes, which is the process of simultaneous tunneling of two or more electrons. A lot of research has been made in understanding this complex quantum-state transition and make it tunable experimentally. \par This transition's process includes two steps, which we present in the next two figures. The first step is shown in figure (3.7) and is the domination of the second harmonic over the 0-junction. In this graph we achieve that by changing the scattering (both normal and magnetic) interfaces' amplitude, for the ZZ geometry: \begin{center} \includegraphics[scale=0.5]{I_x_O_P_ZZZ0L01d10} Figure 3.7: 0-junction to second harmonic due to change of Z \\(ZZ geometry, $k_{F}d$=10, $\lambda$=0.1) \end{center} \newpage \par The second step includes the domination of the $\pi$-junction over the second harmonic. In figure (3.8) we present this process. Again, the parameter we change is the scattering interfaces' amplitude: \bigskip \begin{center} \includegraphics[scale=0.5]{I_x_O_P_ZZZ05L01d10} Figure 3.8: Second harmonic to $\pi$-junction due to change of Z \\(ZZ geometry, $k_{F}d$=10, $\lambda$=0.1) \end{center} \bigskip \par So, the two graphs show the 0-$\pi$ transition process in total. As mentioned before, in those graphs we have also applied a normal scattering interface. The transition's existence is a result of the magnetization and is not depended of the normal scattering, but the presence of it makes the curves smoother and the transition easier to observe. \par The appearance of the second harmonic can also be achieved by changing the value of $\lambda$ or the 2DEG's length $k_{F}d$. The transition in those cases though is very sensitive to the change of these parameters. A convenient way to watch this process in general is by making a 3-D plot of the phase-current relation for a range of values of either of $\lambda$ or $k_{F}$d. Such plots are shown in the figures below: \newpage \begin{center} \includegraphics[scale=0.6]{plot3Dtestlbar} Figure 3.9: 3-D plot of the Current-Phase Relation for $\lambda$$\in$[0,1] \\(ZZ geometry, $k_{F}d$=10, Z=1) \end{center} \bigskip We can plot separately the Current as a function of the phase for \newline $\lambda\in[0.1,0.2]$ and $\lambda\in[0.4,0.5]$ , which are the fields we have the appearance of the second harmonic. Such plots are shown in figure (3.10): \bigskip \begin{center} \includegraphics[scale=0.5]{I_x_LZ1kFd10}\includegraphics[scale=0.5]{I_x_LZ1kFd103} Figure 3.10: Current-Phase Relation in regions with second harmonic \\(ZZ geometry, $k_{F}d$=10, Z=1, Displacement=0.2) \end{center} \begin{center} \includegraphics[scale=0.6]{plot3DtestkfdzzZ1L01} Figure 3.11: 3-D plot of the Current-Phase Relation for $k_{F}d\in$[10,60] \\(ZZ geometry, $\lambda$=0.1 , Z=1) \end{center} \bigskip Again, we plot separately the Current-phase relation for two of the fields we have the appearance of the second harmonic (figure 3.12). \bigskip \begin{center} \includegraphics[scale=0.5]{I_x_kfdZ1L01}\includegraphics[scale=0.5]{I_x_kfdZ1L012} Figure 3.12: Current-Phase Relation in regions with second harmonic \\(ZZ geometry, $\lambda$=0.1 , Z=1, Displacement=0.2) \end{center} \bigskip Figure (3.9) represents the current-phase relation over a range of $\lambda$. From this graph we can see that the 0-junction appears periodically as we change the value of $\lambda$. Between two 0-junctions we have the appearance of the second harmonic, which amplitude though decays rapidly for bigger values of $\lambda$ (as seen in figure 3.10). Also, this amplitude is quite weaker than the amplitude of the 0-junction. Another interesting fact, is that we don't see the appearance of $\pi$ junction in this graph. \par In figure (3.11) we do the same work, for a range of values of $k_{F}$d this time. From the graph's form we see that the dependence from $k_{F}d$ is a more complicated one. If we take a closer look at this graph, we notice that two periods exist in this case. We observe interchange of larger regions (width 10), where the 0-junction is dominant and regions where second harmonic is dominant but interchanges with 0-junction with a small period. We can also notice that, even though the second harmonic appears more frequently , it's amplitude is not as strong as the one of the 0-junction. Thus, when we have the appearance of both of them, the 0-junction is the phenomenon that dominates the other. In addition, $\pi$-junction doesn't seem to occur in this case either. \par Finally, in figures (3.13) and (3.14) we show the corresponding graphs for the other three geometries shown in figure (3.6): \begin{center} \includegraphics[scale=0.4]{plot3DtestkfdxxZ1L01}\includegraphics[scale=0.4]{plot3DtestkfdzxZ1L01} \includegraphics[scale=0.4]{plot3DtestkfdxzZ1L01} Figure 3.13: 3-D plot of the Current-Phase Relation for XX, ZX\& XZ Geometries respectively ($k_{F}d\in$[10,60], $\lambda$=0.1 , Z=1) \end{center} The general behaviour is quite similar to the case of the ZZ geometry. The graphs are of the same form but for each geometry we have a different, but still small, displacement. \par Next we have the graphs for $\lambda$ in figure (3.14): \begin{center} \includegraphics[scale=0.4]{plot3Dtestlbarxx}\includegraphics[scale=0.4]{plot3Dtestlbarzx} \includegraphics[scale=0.4]{plot3Dtestlbarxz} Figure 3.14: 3-D plot of the Current-Phase Relation for XX, ZX\& XZ Geometries respectively ($\lambda\in$[0,1], $k_{F}d$=10 , Z=1) \end{center} \bigskip \par Again the general behavior is similar to the one in figure (3.9). For different geometries we can observe a displacement in the graph. Due to this displacement, we have the appearance of the 0-junction and the second harmonic in different fields of $\lambda$ for a specific $k_{F}d$ and vice versa. \bigskip \section{The interface magnetization effects II: \\ The Y geometry} In section 3.2 we studied magnetization geometries which included the Z and X axis and we saw the conditions under which the second harmonic occurs. \par In this section we study the Y geometry, i.e. junctions with at least one of the magnetization's vectors on the Y axis. We study this geometry separately, because in this case we have the appearance of a variety of new interesting phenomena. The first one is the non-zero Zero-phase current (ZPC), which is the supercurrent that occurs when the phase difference of the two superconductors is zero: $\chi$=0. Another one is the appearance of a bunch of symmetries, which we examine in the following. \par Generally speaking, the current-phase relation is antisymmetric, which is described mathematically as: \begin{equation} I(\chi)=-I(2\pi-\chi) \end{equation} \par When we apply, at least one, Y magnetization, though, this (anti)symmetry no longer occurs: \begin{equation} I(\chi)\ne -I(2\pi-\chi) \quad\text{(Y magnetization)} \end{equation} So, the development of (non-zero) ZPC is a result of the relation (3.2). \par Consequently, we shall examine the current-phase relation for these geometries. We shall begin with the geometries that contain one magnetization on the Y axis and the other on Z, considering all possible combinations, in figures (3.15) and (3.16). \begin{figure} \centering \subfigure[YZ]{\includegraphics[scale=0.6]{I_x_GeomYZZ05L05d10}}\subfigure[-YZ]{\includegraphics[scale=0.6]{I_x_Geom_YZZ05L05d10}} \subfigure[Y-Z]{\includegraphics[scale=0.6]{I_x_GeomYZZ05L05d10}}\subfigure[-Y-Z]{\includegraphics[scale=0.6]{I_x_Geom_YZZ05L05d10}} \\ Figure 3.15: Current-Phase Relation for $\pm$Y$\pm$Z magnetization geometries \\($k_{F}d$=12, $\lambda$=0.6, Z=0.5) \end{figure} \begin{figure} \centering \subfigure[ZY]{\includegraphics[scale=0.6]{I_x_GeomZYZ05L05d10}}\subfigure[Z-Y]{\includegraphics[scale=0.6]{I_x_GeomZ_YZ05L05d10}} \subfigure[-ZY]{\includegraphics[scale=0.6]{I_x_GeomZYZ05L05d10}}\subfigure[-Z-Y]{\includegraphics[scale=0.6]{I_x_GeomZ_YZ05L05d10}} \\ Figure 3.16: Current-Phase Relation for $\pm$Z$\pm$Y magnetization geometries \\($k_{F}d$=12, $\lambda$=0.6, Z=0.5) \end{figure} \par In these figures, one can observe that relation (3.1) no longer applies and also I(0)$\ne$0. For these plots, we have applied a strong spin-orbit coupling constant ($\lambda$=0.6), in order for this "symmetry breaking" to be shown in a more clear way. \par Another interesting thing in that figure is the fact that each one of the graphs (a)-(h) is related to three of the others with a symmetry operation. The graphs we have given the same color ((a)\&(c), (b)\&(d), etc.) are related with the identical symmetry, namely, the phase-current relation is described from the same function. Each of these graphs occurs form the other, after a 180-degree rotation of the Z magnetization (Z $\rightarrow$ -Z). \par The other symmetry operation is the center of inversion and relates graphs which occur from a 180-degree rotation of the Y magnetization (Y $\rightarrow$ -Y). For example, we see that, for the current curves in graphs (a) and (b) or (e) and (f), is true that: \bigskip \begin{equation} I_{1}(\chi)=-I_{2}(2\pi-\chi) \end{equation} \bigskip We can also see this relation in figure (3.17) : \begin{figure}[H] \centering \subfigure[$\pm$YZ]{\includegraphics[scale=0.4]{ISymYZ_YZZ05L05d10}}\subfigure[Z$\pm$Y]{\includegraphics[scale=0.4]{ISymZYZ_YZ05L05d10}} \end{figure} \begin{center} Figure 3.17: Symmetry relations of magnetization geometries YZ,-YZ \& ZY,Z-Y ($k_{F}d$=12, $\lambda$=0.6, Z=0.5) \end{center} \bigskip \par Next, we shall examine the case of X and Y magnetization geometries combination, in a same manner. In figures (3.18) and (3.19) we show the corresponding graphs, which appear to comply with the respective symmetry operations: \bigskip \begin{center} X $\rightarrow$ -X : Identity, \quad Y $\rightarrow$ -Y : Center of inversion \end{center} \begin{figure}[H] \centering \subfigure[YX]{\includegraphics[scale=0.6]{I_x_GeomYXZ05L05d10}}\subfigure[-YX]{\includegraphics[scale=0.6]{I_x_Geom_YXZ05L05d10}} \subfigure[Y-X]{\includegraphics[scale=0.6]{I_x_GeomYXZ05L05d10}}\subfigure[-Y-X]{\includegraphics[scale=0.6]{I_x_Geom_YXZ05L05d10}} \\ Figure 3.18: Current-Phase Relation for $\pm$Y$\pm$X magnetization geometries \\($k_{F}d$=12, $\lambda$=0.6, Z=0.5) \end{figure} \begin{figure}[H] \centering \subfigure[XY]{\includegraphics[scale=0.6]{I_x_GeomXYZ05L05d10}}\subfigure[X-Y]{\includegraphics[scale=0.6]{I_x_GeomX_YZ05L05d10}} \subfigure[-XY]{\includegraphics[scale=0.6]{I_x_GeomXYZ05L05d10}}\subfigure[-X-Y]{\includegraphics[scale=0.6]{I_x_GeomX_YZ05L05d10}} \\ Figure 3.19: Current-Phase Relation for $\pm$X$\pm$Y magnetization geometries \\($k_{F}d$=12, $\lambda$=0.6, Z=0.5) \end{figure} \par Finally, we examine the case in which both of the magnetizations are on the Y axis. We have four combinations this time: \begin{figure}[H] \centering \subfigure[YY]{\includegraphics[scale=0.6]{I_x_GeomYYZ05L05d10}}\subfigure[Y-Y]{\includegraphics[scale=0.6]{I_x_GeomY_YZ05L05d10}} \subfigure[-YY]{\includegraphics[scale=0.6]{I_x_Geom_YYZ05L05d10}}\subfigure[-Y-Y]{\includegraphics[scale=0.6]{I_x_Geom_Y_YZ05L05d10}} \\ Figure 3.20: Current-Phase Relation for Y \& Y magnetization geometries \\($k_{F}d$=12, $\lambda$=0.6, Z=0.5) \end{figure} \newpage \par This time, only the symmetry operation of center of inversion is in effect and occurs if we rotate both magnetizations 180 degrees: \bigskip \begin{center} ($\pm$$Y_{1}$ $\rightarrow$ $\mp$$Y_{1}$) \& ($\pm$$Y_{2}$ $\rightarrow$ $\mp$$Y_{2}$) : Center of inversion \end{center} where in the above, the index 1 stands for the first magnetization and 2 for the second. We show the truth of this relation in the graphs below: \begin{figure}[H] \centering \subfigure[$\pm$Y$\pm$Y]{\includegraphics[scale=0.4]{ISymYY_Y_YZ05L05d10}}\subfigure[$\pm$Y$\mp$Y]{\includegraphics[scale=0.4]{ISym_YYY_YZ05L05d10}} \end{figure} \begin{center} Figure 3.21: Symmetry relations of magnetization geometries YY,-Y-Y \& -YY,Y-Y ($k_{F}d$=12, $\lambda$=0.6, Z=0.5) \end{center} \newpage \chapter{Properties of Critical Current} \par In this chapter we study thoroughly the dependence of the Critical (Maximum) supercurrent from the various parameters of our problem, again focusing on the interface magnetization's role. We also examine the contribution to this quantity, as a function of the parallel to the interface momentum $k_{P}$. \section{General Study} One of the most important topics in every electronics problem is the definition of the conditions under which the current is maximized. So, in this first section of the chapter, we make a general study of the way the critical current I$_{c}$ varies according to the value we give to our parameters. \par Note that for the whole analysis below we consider the absolute value of the critical current. \par To begin with, we examine the effect of the (normalized) temperature $\dfrac{T}{T_{c}}$ in figure 4.1.As expected, I$_{c}$ is a decreasing function of T, which tends to 0 when T$\rightarrow$$T_{c}$. \begin{center} \includegraphics[scale=0.5]{MaxC_TZ0kFd10L01} Figure 4.1: I$_{c}$ as a function of $\frac{T}{T_{c}}$\\ (Z=0, $k_{F}d$=10, $\lambda$=0.1) \end{center} \bigskip \par Next, we shall observe the dependence from the normal scattering interfaces' amplitude Z$_{n}$ (figure 4.2): \begin{center} \includegraphics[scale=0.5]{MaxC_ZnZm0kFd10L01} Figure 4.2: I$_{c}$ as a function of Z$_{n}$\\ (Z$_{m}$=0, $k_{F}d$=10, $\lambda$=0.1) \end{center} \par As seen from the graph above, I$_c$ decreases exponentially as we increase Z$_{n}$. \par Consequently, we shall examine the relation to the 2DEG's length, $k_{F}d$ (figure 4.3): \begin{figure}[H] \includegraphics[scale=0.45]{MaxC_kFdZm0L01} \end{figure} \begin{center} Figure 4.3: I$_{c}$ as a function of $k_{F}d$ for various Z$_{n}$\\ (Z$_{m}$=0, $\lambda$=0.1) \end{center} \bigskip In figure (4.3) we see that I$_{c}$ oscillates with a constant period and a, not strictly, decreasing amplitude, as a function of $k_{F}d$. The peaks appear due to normal scattering processes and sharpen for greater values of $Z_{n}$. \par Finally, we study the dependence from the spin-orbit coupling constant, $\lambda$, in figure (4.4).The curve represents again an oscillation, with two different peaks, which becomes more intense as we increase the value of $\lambda$. The amplitude is not strictly decreasing, also. Another significant feature is the fact that the three curves, which come from different values of Z$_{n}$, tend to overlap for $\lambda \ge 1.5$. \begin{center} \includegraphics[scale=0.45]{MaxC_LZm0kFd10} Figure 4.4: I$_{c}$ as a function of $\lambda$ for various Z$_{n}$\\ (Z$_{m}$=0, $k_{F}d$=10) \end{center} \bigskip \par We can also study the dependence from k$_{F}$d and $\lambda$ from a 3-D plot of ZPC as a function of these parameters. Such plots can be seen in figure (4.5): \begin{center} \includegraphics[scale=0.40]{MaxC_kFd_LZ02} Figure 4.5: 3-D plot of I$_{c} $ as a function of $k_{F}d$ and $\lambda$ \\(Z=0) \end{center} \section{Max Current as a function of $k_{P}$} \par In this section of the chapter, we will study the contribution to the Max current of the various parallel wavevectors $k_{P}$, for different values of our parameters. In such diagrams, the integral of the curve, which is the total contribution of all the parallel wavevectors $k_{P}\in[-k_{F},k_{F}]$, gives us the total I$_{c}$: \begin{equation} \int_{-k_{F}}^{k_{F}} I(k_{P})dk_{P}=I_{c} \end{equation} \ We shall begin our study with showing this contribution graphs for various values of the spin-orbit coupling constant $\lambda$: \begin{center} \includegraphics[scale=0.45]{I_kP_LkFd10Z0} Figure 4.6: I$_{c}$-$k_{P}$ for various $\lambda$ \\(Z=0, $k_{F}d$=10, Displacement=0.5) \end{center} \bigskip \par For $\lambda$=0 we see that every direction contributes equally to the maximum current, as expected. As we raise the value of $\lambda$, the field of k$_{P}$'s which contribute equally becomes smaller and is always for values near k$_{P}$=0. For greater values of the parallel wavevector, the contribution decays, but there exists no cut-off, as in the case of magnetic layers. We can also observe the presence of an increasing number of peaks, which come from resonances due to normal scattering process. \par Next, we may examine how this relation differs when we change the normal scattering interfaces' amplitude, in the presence of a non-zero spin-orbit constant: \begin{center} \includegraphics[scale=0.45]{I_kP_ZnkFd10L01Zm0} Figure 4.7: I$_{c}$-$k_{P}$ for various Z$_{n}$ \\(Z$_{m}$=0, $k_{F}d$=10, $\lambda$=0.1, Displacement=0.4) \end{center} \bigskip \par We can notice that when we raise the scattering, the contribution of the incident wave (k$_{P}$=0) becomes lesser. Now the maximum contribution comes from particles with k$_{P} \approx$0.3. We can also observe an increasing number of peaks for greater $\lambda$, which now become sharper due to scattering. Also, for larger Z$_{n}$ these peaks seem to remain the same. \par Finally, we may study the dependence for the 2DEG's length k$_{F}$d in figure (4.8). We can notice that the change of the length does not change the general behavior of the graph but adds resonant peaks for big values of k$_{P}$. \begin{center} \includegraphics[scale=0.45]{I_kP_kFdL01Z0} Figure 4.8: I$_{c}$-$k_{P}$ for various k$_{F}$d \\(Z=0, $\lambda$=0.1, Displacement=0.5) \end{center} \bigskip \par It is also useful to examine the above dependences from corresponding 3-D plots. Such plots are shown in the figures below: \begin{center} \includegraphics[scale=0.40]{I_kP_L3DkFd10Z0} Figure 4.9: 3-D plot of I$_{c}$ as a function of $k_{P}$ and $\lambda$ \\(Z=0, k$_{F}$d=10) \end{center} \bigskip \begin{center} \includegraphics[scale=0.4]{I_kP_Zn3DL01Zm0kFd102} Figure 4.10: 3-D plot of I$_{c}$ as a function of $k_{P}$ and Z$_{n}$ \\(Z$_{m}$=0, $\lambda$=0.1, k$_{F}$d=10) \end{center} \begin{center} \includegraphics[scale=0.4]{I_kP_kFd3DL01Z0} Figure 4.11: 3-D plot of I$_{c}$ as a function of $k_{P}$ and k$_{F}$d \\(Z=0, $\lambda$=0.1) \end{center} \bigskip \section{The effect of the magnetizations} \par In the previous sections we studied how the Maximum current of the junction varies under the change of the most important parameters of our problem. In our analysis we ignored the magnetic (spin-flip) effects of the interfaces, setting Z$_{m}$=0. These effects we will study in this final section of the chapter. The spin-flip scattering in the interfaces gives our problem significant new capabilities, as we also saw in the respective section of chapter 3, without restricting our study in short values of k$_{F}$d, as in the case of magnetic layers. \par We shall begin our study with showing the dependence of the critical current from the spin-flip scattering strength Z$_{m}$, for our three main magnetization geometries. At first we show this relation for a normal metal junction, for $\lambda$=0, in figure (4.12): \begin{center} \includegraphics[scale=0.45]{MaxC_ZmZn0kFd10L0} Figure 4.12: I$_{c}$-Z$_{m}$ for the three main geometries \\(Z$_{n}$=0, $\lambda$=0, k$_{F}$d=10) \end{center} \bigskip \par From the above figure we can observe that, when $\lambda$=0, the effect of Z$_{m}$ is similar to the effect of Z$_{n}$, shown in figure (4.2): the critical current decays exponentially as we increase the scattering interfaces' strength. Also, another important fact is that the three curves coincide. This is a general feature of the S/N/S junction: the current curve is unchanged when we rotate the whole system by any angle. Thus, only the angle between the two magnetizations, and not their directions, plays role in our study. \par On the contrary, in an S/2DEG/S junction, i.e. when $\lambda \ne 0$, the system is no longer direction-less. This is a consequence of the Hamiltonian's form in the 2DEG region. As seen from relation (1.2), the inclusion of the triple product now gives direction to our system. So, we expect that when $\lambda \ne 0$ the above three geometries will give us different curves. \par In figure (4.13) below we plot the I$_{c}$-Z$_{m}$ relation for those three geometries, for $\lambda$=0.1: \bigskip \begin{center} \includegraphics[scale=0.45]{MaxC_ZmZn0kFd10L01} Figure 4.13: I$_{c}$-Z$_{m}$ for the three main geometries \\(Z$_{n}$=0, $\lambda$=0.1, k$_{F}$d=10) \end{center} We can see that now the three curves show quite different behavior to the change of Z$_{m}$. One can also observe that, at some points, the curves have derivative discontinuities, which result to dips in our graph. In the region of those dips, we have the 0-$\pi$ (or $\pi$-0) transition, we mentioned in the previous chapter. In the figures below, we show the current-phase relation in these regions. Figure (4.14) refers to the peaks in the XX curve. Next we show the corresponding graph for the ZZ curve peak, in figure (4,15). \begin{center} \includegraphics[scale=0.45]{I_xXXZn0L01kFd10}\includegraphics[scale=0.45]{I_xXXZn0L01kFd102} Figure 4.14: Current-Phase relation for various\\ Z$_{m}$ in [1 , 1.6] and Z$_{m}$ in [2 , 3.2] (transition fields) \\(XX Geometry, Z$_{n}$=0, $\lambda$=0.1, k$_{F}$d=10, Displacement=0.2 \& 0.05 respectively) \end{center} \begin{figure} [H] \centering \includegraphics[scale=0.45]{I_xZZZn0L01kFd10} Figure 4.15: Current-Phase relation for \\various Z$_{m}$ in [0.6 , 1.4] (transition field) \\(ZZ Geometry, Z$_{n}$=0, $\lambda$=0.1, k$_{F}$d=10, Displacement=0.5) \end{figure} \bigskip \par These 3 graphs show the process of the transition. The derivative discontinuity appears when the second harmonic becomes stronger and is the harmonic that determines the critical current's amplitude. \par It is also useful to examine the maximum current that occurs for every magnetization geometry, for specific values of our parameters. In order to do so, we will make 3-D plots of the critical current to the magnetizations' directions. We shall examine the cases in which both our magnetizations are on each of the x-y, x-z and y-z planes and 'rotate' separately one from the other. We use the symbols $\theta_{\nu}$ and $\phi_{\nu}$ for the polar and the azimuthal angle of each magnetization respectively ($\nu=L,R$). So, we have: \\x-y plane: $\theta_{L}$=$\theta_{R}$=$90^o$ \& $\phi_{L}$,$\phi_{R}$$\in[0,360^o]$ \\x-z plane: ($\phi_{L}$=$\phi_{R}$=$0$ or $\phi_{L}$=$\phi_{R}$=$180^o$) \& $\theta_{L}$,$\theta_{R}$$\in[0,180^o]$ \\y-z plane: ($\phi_{L}$=$\phi_{R}$=$90^o$ or $\phi_{L}$=$\phi_{R}$=$270^o$) \& $\theta_{L}$,$\theta_{R}$$\in[0,180^o]$ \\Following, we show the corresponding plots. Figure (4.16) represents the x-y plane, figure (4.17) the x-z and figure (4.18) the y-z. \begin{center} \includegraphics[scale=0.5]{I_phi1_phi2XYPLANEL01Zm05Zn0kFd10} Figure 4.16: 3-D plot of I$_{c}$ as a function of $\phi_{L}$ and $\phi_{R}$ \\(XY plane, Z$_{m}$=0.5, Z$_{n}$=0, $\lambda$=0.1, k$_{F}$d=10) \end{center} As seen from the graph, the critical current maximizes when the vectors become parallel: $\phi_{L}$=$\phi_{R}$ , or anti-parallel: $\phi_{L}$=$\phi_{R} \pm\pi$. The minimum values occur when the two vectors are perpendicular:$\phi_{L}$=$\phi_{R} \pm\dfrac{\pi}{2}$. This is the general behavior, which is interrupted by weaker, but not insignificant, oscillations. We also observe that $I_{c}(\phi_{L},\phi_{R})=I_{c}(\phi_{R},\phi_{L})$. \par It is also useful to make a Fourier fitting for these graphs, in order to show the explicit dependence from the magnetization angles. So, for figure (4.16) we have: \begin{equation} \centering I_{c}\approx 0.988+0.068cos(\phi_{L}-\phi_{R})-0.023cos(\phi_{L}+\phi_{R})+0.021cos(2(\phi_{L}+\phi_{R})) \end{equation} \bigskip \par Next, we have the plots for the x-z plane in figure (4.17). In this figure, (4.17.a) diagram corresponds to $\phi_{\nu}$=0, while (4.17.b) to $\phi_{\nu}$=180$^o$. This time, the maximum values occur when $\theta_{L}=\theta_{R} \pm\pi$, and the minimum for $\theta_{L}=\theta_{R}$. In addition, we have the symmetry relation: \\$I_{c}(\theta_{L},\theta_{R},\phi_{\nu}=0)=I_{c}(\theta_{R},\theta_{L},\phi_{\nu}=\pi)$. \begin{center} \includegraphics[scale=0.5]{I_theta1_theta2XZPLANEL01Zm05Zn0kFd10} (4.17.a):$\phi_{\nu}$=0 \includegraphics[scale=0.5]{I_theta1_theta2_XZPLANEL01Zm05Zn0kFd10} (4.17.b):$\phi_{\nu}$=180$^o$ \bigskip Figure 4.17: 3-D plots of I$_{c}$ as a function of $\theta_{L}$ and $\theta_{R}$ \\(XZ plane, Z$_{m}$=0.5, Z$_{n}$=0, $\lambda$=0.1, k$_{F}$d=10) \end{center} \par The Fourier fittings for these graphs are: \begin{equation} a: I_{c}\approx 1-0.097cos(\theta_{L}-\theta_{R})+0.1sin(\theta_{L}-\theta_{R})-0.154cos(\theta_{L}+\theta_{R}) \end{equation} \begin{equation} b: I_{c}\approx 1-0.097cos(\theta_{L}-\theta_{R})-0.1sin(\theta_{L}-\theta_{R})-0.154cos(\theta_{L}+\theta_{R}) \end{equation} \par Finally, in figure (4.18) we show the graphs for the y-z plane. Graph (4.18.a) correspond to $\phi_{\nu}=90^o$ and (4.18.b) correspond to $\phi_{\nu}=270^o$. Again, the maximum values appear when $\theta_{L}=\theta_{R} \pm\pi$, and the minimum for $\theta_{L}=\theta_{R}$. Also, the two graphs are symmetric to the change $\theta_{L}\leftrightarrow\theta_{R}$ and identical: $I_{c}(\theta_{L},\theta_{R})=I_{c}(\theta_{R},\theta_{L}),\phi_{\nu}=\dfrac{\pi}{2},\dfrac{3\pi}{2}$ \\$I_{c}(\theta_{L},\theta_{R},\phi_{\nu}=\dfrac{\pi}{2})=I_{c}(\theta_{L},\theta_{R},\phi_{\nu}=\dfrac{3\pi}{2})$. \begin{center} \includegraphics[scale=0.45]{I_theta1_theta2YZPLANEL01Zm05Zn0kFd10} (4.18.a):$\phi_{\nu}$=90$^o$ \includegraphics[scale=0.45]{I_theta1_theta2_YZPLANEL01Zm05Zn0kFd10} (4.18.b):$\phi_{\nu}$=270$^o$ \bigskip Figure 4.18: 3-D plots of I$_{c}$ as a function of $\theta_{L}$ and $\theta_{R}$\\(YZ plane, Z$_{m}$=0.5, Z$_{n}$=0, $\lambda$=0.1, k$_{F}$d=10) \end{center} \par The Fourier fitting for both of these graphs is: \begin{equation} I_{c}\approx 1.022-0.109cos(\theta_{L}-\theta_{R})-0.167cos(\theta_{L}+\theta_{R})-0.004cos(2(\theta_{L}+\theta_{R})) \end{equation} \par We must note that, in all the above fittings (relations (4.2)-(4.5)), only the terms which are a function of the difference of the corresponding angles ($f(\phi_{L}-\phi_{R})$ or $f(\theta_{L}-\theta_{R})$), as well as the constant terms, appear when we set $\lambda=0$. The other terms (which are of the form $g(\phi_{L}+\phi_{R})$ or $g(\theta_{L}+\theta_{R})$) appear due to the 2DEG, which as we mentioned before makes the system direction-dependent. \chapter{Properties of the Zero-phase Current} \par In this chapter we study thoroughly the dependence of the Zero-phase supercurrent (ZPC) from the various parameters of our problem, again focusing on the interface magnetization's role. We also examine the contribution to this quantity, as a function of the parallel to the interface momentum $k_{P}$. \section{General Study} As mentioned before, the ZPC is the supercurrent that occurs when the phase difference of the two superconductors is zero: $\chi$=0. Thus, ZPC=I(0). In the previous chapter, we saw that ZPC $\ne$ 0, in the case we apply at least one magnetization on the Y axis. So, next we shall study how this ZPC is related with our parameters, in the case of a YY geometry. \par To begin with, we examine the effect of the (normalized) temperature $\dfrac{T}{T_{c}}$ in figure 5.1. As expected, the ZPC is a decreasing function of T, which tends to 0 when T$\rightarrow$$T_{c}$. Of course, the Critical current vanishes as well in these temperatures. \begin{figure}[H] \centering \includegraphics[scale=0.7]{ABC} Figure 5.1: ZPC as a function of $\frac{T}{T_{c}}$\\ (YY geometry, $k_{F}d$=10, $\lambda$=0.5, Z=0.5) \end{figure} \bigskip \par Next, we shall observe the dependence from the scattering interfaces' amplitude (figure 5.2). We set $Z_{n}=Z_{m}=Z$ for this graph. We can see that the ZPC increases steadily, until it reaches a critical value of Z ($Z_{c}$$\approx$0.8), and then, it appears to decay exponentially for greater values of Z. This form has a physical explanation: we have seen that the appearance of the ZPC is an effect of the interface spin-flip scattering. For Z=0, I(0)=0. So, when we increase Z from 0 to greater values, the ZPC increases. When we apply a strong scattering interface though, the damping effect reduces the current's amplitude. So, we expect that for Z$>>$1, I$\rightarrow$0, in general. Thus, the ZPC will have a maximum for an interim value of Z. \begin{figure}[H] \centering \includegraphics[scale=0.7]{DEF} Figure 5.2: ZPC as a function of Z\\ (YY geometry, $k_{F}d$=10, $\lambda$=0.5) \end{figure} \bigskip \par Following, we shall study the relation to the 2DEG's length, $k_{F}d$ (figure 5.3). In this figure we see that the ZPC oscillates with a constant period and not strictly decreasing amplitude, as a function of $k_{F}d$. The maximum peaks are sharp for small values of the length, while for greater values they become widened and a second peak weaker peak appears next to the maximum. \begin{figure}[H] \centering \includegraphics[scale=0.7]{GHI} Figure 5.3: ZPC as a function of $k_{F}d$\\ (YY geometry, $\lambda$=0.5, Z=0.5) \end{figure} \bigskip \par Finally, we examine the dependence from the spin-orbit coupling constant, $\lambda$, in figure (5.4). The curve represents again an oscillation, which amplitude now, though, increases for small values of $\lambda$ and then, for $\lambda$ $\geqslant$ $\lambda_{c}$ ($\lambda_{c}\approx0.62$) it becomes a decreasing function of $k_{F}d$. Similar to the case of Z (figure 5.2), we expect such a general behavior, as we know that I(0)=0 for $\lambda$=0 and $\lambda$$>>$1 (due to mismatch), and also I(0)$\ne$0, for $\lambda$ $\in$(0,1). \begin{figure}[H] \centering \includegraphics[scale=0.7]{JKL} Figure 5.4: ZPC as a function of $\lambda$\\ (YY geometry, $k_{F}d$=10, Z=0.5) \end{figure} \bigskip \section{ZPC as a function of $k_{P}$} \par In this second part of the chapter, we will study the contribution to ZPC of the various parallel wavevectors $k_{P}$, for different values of our parameters. In such diagrams, the integral of the curve, which is the total contribution of all the parallel wavevectors $k_{P}\in[-k_{F},k_{F}]$, gives us the total ZPC: \begin{equation} \int_{-k_{F}}^{k_{F}} I(k_{P})dk_{P}=I(\chi=0) \end{equation} \ We shall begin our study with showing this contribution graphs for various scattering interfaces' amplitude ($Z=Z_{n}=Z_{m}$), again for YY geometry: \begin{center} \includegraphics[scale=0.45]{I_kP_ZYYL05kFd10}\includegraphics[scale=0.45]{I_kP_ZYYL05kFd102} Figure 5.5: ZPC-$k_{P}$ for various Z \\(YY geometry, $\lambda$=0.5, $k_{F}d$=10) \end{center} \bigskip \par We see that all the curves have a similar pattern: the contribution becomes important only for $k_{P} > 0.5$, where we have two strong peaks. The peaks become sharper when we increase the scattering amplitude, as expected, and also their amplitude follows the relation shown in figure (5.2). For values of $k_{P}$ near 0, we have no contribution, which means that a particle with perpendicular momentum cannot contribute to the appearance of the ZPC. We can also observe two other weaker and negative peaks for $k_{P}\approx\pm0.4$. This means that particles with that values of $k_{P}$ backscatter and thus, they lower the value of I(0). \par Next, we may observe how this relation differs when we change the spin-orbit coupling constant $\lambda$: \begin{center} \includegraphics[scale=0.45]{I_kP_LYYZ05kFd10}\includegraphics[scale=0.45]{I_kP_LYYZ05kFd102} Figure 5.6: ZPC-$k_{P}$ for various $\lambda$ \\(YY geometry, Z=0.5, $k_{F}d$=10) \end{center} \bigskip \par In this graphs, the values of $k_{P}$ we saw that contribute in figure (5.5), i.e. the peaks, now seem to broaden and also oscillate in amplitude with $\lambda$. We examine this periodical behavior in figure (5.7) below: \begin{center} \includegraphics[scale=0.5]{I_kP_LkFd10Z05YY} Figure 5.7: 3-D plots of ZPC-$k_{P}$ for $\lambda \in [0,1]$ \\(YY geometry, Z=0.5, $k_{F}d$=10) \end{center} From this graphs we can see that the mentioned behaviour of the various $k_{P}s$ is a periodical function of $\lambda$. The most significant feature is that the peaks' amplitude, which appear near $k_{P} \approx \pm0.85$, seems to maximize periodically, with a constant period $\Delta\lambda \approx 0.17$. These peaks are the same with the ones we saw in figure (5.4). We can also observe that, the range of the contributing $k_{P}$ is an increasing function of $\lambda$, which tends to become constant for greater values of $\lambda$. \par Next, we may examine the dependence from $k_{F}d$ in a similar way: \begin{center} \includegraphics[scale=0.7]{I_kP_kFdYYZ05L05} Figure 5.8: ZPC-$k_{P}$ for various $k_{F}d$ \\(YY geometry, Z=0.5, $\lambda$=0.5, Displacement=0.05) \end{center} \newpage Following we have the 3-D graph: \begin{center} \includegraphics[scale=0.6]{I_kP_kFdL05Z05YY} Figure 5.9: 3-D plots of ZPC-$k_{P}$ for $k_{F}d \in [10,60]$ \\(YY geometry, Z=0.5, $\lambda$=0.5) \end{center} Again the dependence is periodical, and the form is quite more complicated than before. \par Finally, we shall study the corresponding graphs for the various magnetization symmetries that we studied in section 3.3. In figure 5.11 below, we plot the ZPC-k$_{P}$ relation for symmetric geometries.As expected, when the two Current-phase graphs are related with the Center of inversion symmetry, the respective ZPC-k$_{P}$ graphs are antisymmetric. \newpage \begin{center} \includegraphics[scale=0.4]{I_kP_symYX-YX}\includegraphics[scale=0.4]{I_kP_symYY-Y-Y} \includegraphics[scale=0.4]{I_kP_symYZ-YZ} Figure 5.10: ZPC-$k_{P}$ for various geometries \\($k_{F}d$=12,$\lambda$=0.6, Z=0.5) \end{center} \bigskip \section{The effect of the magnetizations} \par In the previous sections we studied the ZPC's dependence of our problem's various parameters, focusing on the basic magnetization geometries. Now, we shall examine the behaviour of the ZPC to the magnetizations' directions. \par At first, we will study the ZPC that occurs, when both magnetizations are on one of the three basic planes, x-y and y-z planes, and "rotate" separately one from the other (the x-z plane does not include a y component and thus, the ZPC in that case will be zero). So, we will have a 3-D plot in which the independent variables will be the two angles (polar or azimuthal, according to the plane), while the dependent one will be the ZPC. \par So, for the x-y plane we have: $\theta_{L}$=$\theta_{R}$=$90^o$ \& $\phi_{L}$,$\phi_{R}$$\in[0,360^o]$, where $\theta_{\nu}$ and $\phi_{\nu}$ are the polar and the azimuthal angle of each magnetization ($\nu=L,R$). \par For the y-z plane: ($\phi_{L}$=$\phi_{R}$=$90^o$ or $\phi_{L}$=$\phi_{R}$=$270^o$) \& $\theta_{L}$,$\theta_{R}$$\in[0,180^o]$. \bigskip \par In the figures following we represent the corresponding graphs: \begin{center} \includegraphics[scale=0.4]{ZPC_phi1_phi2lb06Z05kFd12XYplane}\includegraphics[scale=0.4]{ZPC_phi1_phi2lb06Z05kFd12XYplane2} Figure 5.11: 3-D plot of ZPC as a function of $\phi_{L}$ \& $\phi_{R}$, x-y plane \\($\lambda$=0.6, Z=0.5, $k_{F}d$=12) \end{center} \par In this figure, we can see that the maximum appears for the Y-Y geometry and the minimum for the -YY. We can also observe that the inversion of the two angles changes the sign of the ZPC: $\phi_{L}\leftrightarrow\phi_{R}\Rightarrow ZPC\rightarrow-ZPC$. \par Next, we have the graphs for the YZ plane. The left column is for $\phi_{\nu}=90^o$ and the right for $\phi_{\nu}=270^o$: \newpage \begin{center} \includegraphics[scale=0.4]{ZPC_theta1_theta2lb06Z05kFd12YZplane}\includegraphics[scale=0.4]{ZPC_theta1_theta2lb06Z05kFd12YZplane3} \includegraphics[scale=0.4]{ZPC_theta1_theta2lb06Z05kFd12YZplane2}\includegraphics[scale=0.4]{ZPC_theta1_theta2lb06Z05kFd12YZplane4} Figure 5.12: 3-D plot of ZPC as a function of $\theta_{L}$ \& $\theta_{R}$, y-z plane \\($\lambda$=0.6, Z=0.5, $k_{F}d$=12) \end{center} \par The first thing to observe in this figure, is the fact that the two graphs are antisymmetric: $ZPC_{1}(\theta_{1},\theta_{2})=-ZPC_{2}(\theta_{1},\theta_{2})$. In addition, the ZPC remains unchanged under the transformation of each (or both) of the angles: $\theta_{i}\rightarrow\pi-\theta_{i} (i=1,2)$. The maximum (minimum) for the first (second) set of graphs, appears for the Y-Z \& YZ geometries and the minimum (maximum) for ZY \& -ZY. \chapter*{Conclusions} \addcontentsline{toc}{chapter}{Conclusions} In the epilogue of this thesis we will summarize the most significant results of our work and discuss further possible expansions of this work. So first, we solved the Bogoliubov-de Gennes equations for an S/2DEG/S junction with two thin insulating and spin active interfaces, in the clean, ballistic limit. Next, we studied the current-phase relation of the junction for various values of the system's parameters (temperature, effective mass, spin-orbit coupling constant, junction's length, normal scattering strength, spin-flip scattering strength and direction). We also studied the dependence of the critical current of the junction from these parameters and examined the conditions under which it maximizes, as well as the contribution to this value for the different directions of the incident particles' wavevectors. Finally, we observed which conditions allow the appearance of the zero phase difference supercurrent of the junction, as well as how it varies to the change of our parameters. \par More specifically, in chapter 3, we saw that when the spin-flip scattering interfaces' strength is set 0, the current phase relation is sine-like and decreases uniformly if we raise the values of the temperature, the length of the junction, the spin-orbit constant or the normal scattering strength, as well as if we decrease the effective mass. When the interfaces become spin active, the current-phase relation is no longer sinusoidal and a second harmonic appears. The amplitude of the second harmonic oscillates to the change of the spin-orbit constant and the junction's length. In addition, if we change the normal scattering amplitude, we can achieve a tunable 0-$\pi$ transition, as well. We also found that specific changes in the interfaces' magnetization geometries lead to the appearance of symmetries in the respective current-phase relations. \par Following, in chapter 4 we found that the critical current of the junction rapidly vanishes as we raise the temperature or the normal scattering strength, as expected, while it decays in a slower rate to the increase of the junction's length or the spin-orbit constant, also showing oscillations which become sharpened for larger normal scattering strengths and spin-orbit constants. We also observed that, in general, the particles with almost incident wavevector directions are the ones that contribute mostly to the critical current. In addition, we saw that, for spin-active interfaces, the critical current depends not only from the difference, but from the sum of the magnetization angles, as well, with complicated expressions, due to the presence of the spin-orbit coupling. \par Finally, in chapter 5, we found that, in order for the zero phase difference supercurrent to be non-zero, we must apply at least one of the two interface magnetizations on the y axis. The ZPC becomes maximized for specific values of the scattering strength (both normal \& spin-flip), the junction's length and the spin-orbit constant, while it also oscillates to the increase of these last two parameters. Another important notice, is that, contrary to the case of the critical current, only the particles with wavevectors almost parallel to the interface contribute to the ZPC, while the contribution of the incident wavevectors is zero in all the cases. We also studied the dependence of the ZPC from the interfaces' magnetization directions and found the general behavior as well as a number of symmetry relations. \par There is a number of issues that we need to expand further in order to get a clearer understanding of the topic. First of all, we need to understand the theoretical background of the symmetry relations we discussed in chapter 3, which can be accomplished using the scattering amplitudes method. Another issue that needs further explanation is the oscillating behavior of the supercurrent as a function of the junction's length and the spin-orbit constant, as well as the 0-$\pi$ transition that we showed in chapter 3. In addition, we could also explain the current's dependence from the magnetizations' angles, seen in chapter 4, using again the scattering amplitudes method. Finally, we need to explain the appearance of the ZPC, seen in chapter 5, as well as it's dependence from the various parameters that we studied in the same chapter. \medskip \bibliographystyle{apsrev}
\section{Introduction} \label{section:Introduction} \par The properties of molecular crystals depend not only on their constituents but also the relative arrangement of the molecules inside the unit cell. Properties such as the stability \cite{griesser2008conformational,nyman2015static,hoja2018first}, electronic conductivity \cite{bredas2007charge,jurchescu2009effects,matsukawa2010polymorphs,diao2014understanding,yang2018large}, solubility and bioavailability \cite{ritonavir,disappearing}, have all been observed to vary as a function of the molecular crystal solid state form. The molecules comprising these crystals are held together by weak intermolecular interactions \cite{reilly2015van,hermann2017first} and thus can commonly be experimentally synthesized in multiple forms \cite{stahly2007diversity,lee2011crystal}. This phenomena, known as polymorphism, has been of great importance to pharmaceutical research and for the design of high performance organic electronics \cite{jurchescu2009effects,schrier2011,diao2016polymorphism}. \par The field of crystal structure prediction (CSP) is devoted to the prediction of the solid state forms of a molecule \cite{blind1_2000, blind2_2002, blind3_2005, blind4_2007, blind5_2011, blind6_2016, price2014predicting}. CSP requires algorithms that can efficiently generate new structures in order to sample the high dimensional configuration space associated with molecular crystals \cite{day2011current,price2014predicting}. Random, and quasi-random, sampling of the configuration space has been established as a critical component of CSP workflows within the Cambridge Crystallographic Data Centre (CCDC) CSP blind test \cite{blind1_2000, blind2_2002, blind3_2005, blind4_2007, blind5_2011, blind6_2016}. Most of the groups that participated in the sixth CSP blind test used a random crystal structure generation method \cite{DayCSP, PickardCSP, karamertzanis2005, karamertzanis2007, Eijck2000structure}. Random crystal structure generation methods identified four of the five, chemically diverse target systems in the sixth blind test, demonstrating their importance for CSP \cite{blind6_2016}. \par Random crystal structure generation methods for CSP follow a similar procedure. First a space group \cite{wonderatschek2004international} is chosen for the new structure. Second, random unit cell parameters commensurate with the space group's crystal system are generated. Third, the molecule positions and orientation of each independent molecule are randomly sampled within the asymmetric unit. Finally, the symmetry operations of the space group are applied to the asymmetric unit generating all molecules in the unit cell. The generated structures are subsequently relaxed using either a system specific force field \cite{mooij1999transferable, price2010modelling, zhang2018harnessing} or a fully \textit{ab initio} approach \cite{li2018genarris, zilka2017ab, PickardCSP}. The success of random structure generation stems comes from unbiased and diverse sampling covering the potential energy surface, followed by a structural relaxation to the nearest local minima, hopefully converging to all experimentally observed polymorphs \cite{PickardCSP,karamertzanis2005,DayCSP}. \par Despite their overall similarity,, structure generation methods from the sixth blind test differ in subtle ways. Structure parameters may be sampled using either a uniformly random number generator \cite{li2018genarris, PickardCSP}, or quasi-random, low discrepancy sequences \cite{DayCSP,karamertzanis2005,karamertzanis2007}. Structure generation may be performed over all space groups \cite{li2018genarris}, or using only the most common space groups \cite{karamertzanis2005, day2011current} observed in the Cambridge Structural Database (CSD) \cite{allen2002cambridge, groom2016cambridge}. A critical component of the generation procedure is approximating the volume of the molecular crystal before generation. Several methods have been proposed, such as adding up atomic volumes \cite{PickardCSP}, using the morphology of the molecule \cite{DayCSP,pidcock2004novel}, or relaxing a few handmade structures \cite{karamertzanis2005,Eijck2000structure}. It has been demonstrated that random CSP methods may be sensitive to the choice of unit cell volume \cite{DayCSP}. Therefore, it's important to use an accurate volume estimation method. Additionally, structures with reasonable densities are typically closer to their respective local minima making structure relaxations more efficient. Lastly, most random crystal structure generation packages are only capable of generating structures in general Wyckoff positions and rely on the serendipitous generation of structures with molecules occupying special positions. However, analysis of the CSD has shown that molecules with internal symmetry often occupy special Wyckoff positions \cite{pidcock2003database}. \par Here we present a new version of Genarris \cite{li2018genarris}, an open source Python package that performs random structure generation for homomolecular molecular crystals of semi-rigid molecules with no bond rotational degrees of freedom using general and special Wyckoff positions. Genarris 2.0 offers several improvements over the previous version. The parallelization model has been changed from Python multiprocessing to MPI for Python (mpi4py) \cite{dalcin2008mpi} to enable more efficient utilization of many cores and seamless sequential execution of user-defined workflows. A new machine learning method for volume estimation, based on a topological molecular descriptor, provides accurate volume predictions across a chemically diverse dataset from the CSD. The speed of structure generation has been significantly increased by developing a new hierarchical scheme for intermolecular distance checks. New settings have been implemented to improve structure generation for systems with strong hydrogen bonds. The performance of new the features in Genarris 2.0 is demonstrated for glycine, which contains relatively strong intermolecular hydrogen bonds, and benzene, a symmetric molecule occupying special Wykckoff position with an inversion center. \section{Code description} \label{section:Code Description} Genarris 2.0 is written in Python 3, with the exception of the new structure generation function, Pygenarris, which is written in C and automatically compiled and installed into Genarris 2.0 as a Python library. Genarris only requires standard Python libraries to install on any machine (i.e. numpy, sci-kit learn, mpi4py, spglib, pymatgen,and ASE, PyTorch). Genarris 2.0 is parallelized with MPI, using mpi4py (Sec.~\ref{subsection:Parallelization}). Pygenarris has additional built in OpenMP support. For energy evaluations and geometry relaxations, Genarris currently interfaces with the electronic structure package FHI-aims \cite{blum2009ab}. It may be adapted to interface with any other electronic structure, force field, or machine learning package that accepts an MPI communicator as an argument. \begin{figure}[h] \centering \includegraphics[width=0.35\textwidth]{raw_pool_workflow.pdf} \caption{The workflow of Genarris 2.0} \label{fig:raw_pool} \end{figure} The workflow of Genarris 2.0 is depicted in Figure \ref{fig:raw_pool}. It begins by estimating the crystal unit cell volume. Given the desired number of molecules per unit cell (Z), the estimate is obtained by relaxing the single molecule geometry and applying a machine-learned model trained on a dataset of experimental structures from the Cambridge Structural Database (CSD) (Sec.~\ref{subsection:Unit cell volume estimation}). Crystal structure generation begins by determining all compatible space groups given the molecular geometry within a user-defined symmetrization tolerance (Sec.~\ref{subsection:Structure generation}). Genarris moves sequentially through this list of space groups, generating a user-defined number of structures per allowed space group and checking them to ensure that no two molecules are unphysically close to each other (Sec.~\ref{subsubsection:Structure checks}). If the user-defined maximum number of consecutive failed generation attempts for a space group is reached, Genarris will proceed to the next space group on the list. Once a ``raw" pool of physically reasonable, random structures is generated, a user-defined sequence of energy evaluation, clustering, and selection steps may be performed to produce a smaller curated pool of structures, which can be used, e.g., as an initial population for a genetic algorithm \cite{curtis2018gator,curtis2018evolutionary}. For clustering, Genarris uses the affinity propagation (AP) machine learning algorithm \cite{frey2007clustering}. Two types of feature vectors are available in Genarris 2.0, the relative coordinate descriptor (RCD) \cite{li2018genarris} and a radial distribution function (RDF), implemented in PyTorch, similar to that described by Ref. \cite{RDF_1}. Three workflows for down selection have been proposed previously \cite{li2018genarris}. Here, a new ``Robust" workflow is proposed (Sec.~\ref{subsection:Clustering and down-selection}). Lastly, full geometry relaxation may be performed for the final pool of structures. Genarris 2.0 automatically executes all the procedures in the user-defined procedure list in the order specified. A single input file contains the user defined settings for all desired procedures. This includes the number of cores to be used for each procedure, as different procedures scale differently (see Sec.~\ref{subsection:Parallelization}). Genarris can infer some parameters from previous sections of the workflow. For example, the output file containing the relaxed geometry of the single molecule becomes the default molecule path of subsequent sections if it exists. The user may reorder the procedures as long as the dependencies are satisfied (e.g., feature vector calculation must be performed prior to clustering). If Genarris is restarted, it determines which step in the procedure list was not completed and resumes from that point. Restarts for generation are implemented by parsing the geometry output file for the last generated space group, and continuing from there. Finished RCD calculations are output as files which permits easy restarts. Restarts for RDF calculations are unnecessary because they take less than a minute for several thousand structures. Genarris supports restarts of FHI-aims jobs by first determining which of them are incomplete and then automatically relaunching them from the last relaxation step. \subsection{Parallelization} \label{subsection:Parallelization} Genarris 2.0 is parallelized using the message passing interface (MPI) paradigm via the mpi4py package. MPI enables immediate cross-platform portability without code changes. The structure generation function in Genarris 2.0 determines the number of allowed space groups for the given molecule, $n$, and accepts as input the number of structures to generate for each of these space groups. Hence, structure generation and subsequent structure checks (Sec.~\ref{subsection:Structure generation}) are embarrassingly parallelized over the total number of structures desired, $N$, with the problem size (maximum number of usable cores) for the generation and structure check procedures equal to $N/n$. For clustering (see Sec.~\ref{subsection:Clustering and down-selection}), both the RCD and RDF feature vector calculations are embarrassingly parallelized with problem size $N$. The number of clusters produced by the affinity propagation (AP) algorithm \cite{frey2007clustering} is nearly-directly correlated with its \textit{preference} hyperparameter value, but its functional form is not known \textit{a priori}. Therefore, a parallelized version of the standard binary search algorithm has been implemented to output a specified number of clusters $C$ within a tolerance $tol$. The \textit{preference} range is initially wide ($[-1000,1000]$). This range is evenly partitioned into $R$ \textit{preference} values, where $R$ is the number of total MPI ranks available. Each rank executes AP with its assigned value of \textit{preference} and reports the number of clusters obtained to the root rank. The root rank sets the \textit{preference} range upper (lower) bound to the \textit{preference} that returned the lowest (highest) number of clusters above (below) the target number of clusters. The root then partitions the updated \textit{preference} range and assigns each rank its new \textit{preference} value. The procedure is repeated until a \textit{preference} value is found, which yields $C\pm tol$ clusters. The communication required in each iteration is less expensive than an AP call by orders of magnitude, therefore it does not significantly affect the scaling. Because \textit{preference} and the number of clusters are only \textit{nearly}-directly correlated, fail-safes have been implemented. For example, if the current \textit{preference} range fails to yield a number of clusters within $C\pm tol$, then the \textit{preference} range is widened by a random amount. In addition, the user may have the program output the closest number of clusters to $C$ within a desired number of iterations. The memory usage is kept manageable by writing and accessing the affinity and distance matrices via memory maps so that each rank does not make a redundant copy. Genarris currently interfaces with FHI-aims for energy evaluations and geometry relaxations. It may be adapted to interface with any other electronic structure, force field, or machine learning package that accepts an MPI communicator as an argument. FHI-aims is compiled as a shared library and made an importable Python library through the standard f2py function. The Python communicator is then converted into a Fortran communicator via the py2f method. Thus, Genarris 2.0 allows all ranks to be utilized by FHI-aims. In addition, the world communicator may be split into a user-defined number of sub-communicators, each of which performs an FHI-aims calculation concurrently. This enables massive parallelization of the steps involving energy evaluations and geometry relaxations. The master-slave paradigm is used to allow efficient and automated management of these tasks. The world root (master) rank is not passed into FHI-aims. Rather, it keeps track of which structures have completed and assigns uninitiated structures to root ranks of sub-communicators, which proceed to run FHI-aims. \subsection{Unit cell volume estimation} \label{subsection:Unit cell volume estimation} \par The solid form volume of a molecule is defined as the volume of the unit cell divided by Z, the number of molecules contained in the unit cell. Accurate prediction of the solid form volume of an input molecule is critical for generating structures with reasonable unit cell volumes. To this end, a machine learned model using a Monte Carlo volume estimation scheme and a topological molecular fingerprint constructed based on atomic neighborhoods was developed. The model was trained on a dataset obtained from the CSD using the Conquest program \cite{conquest}. A chemically diverse dataset was compiled, containing molecules with 5 to 260 atoms comprising the organic elements, H, C, N, O, all the halogens, F, Cl, Br, and I, as well as B, P, S, Si, Te, and Se. The accuracy of the machine learned model is within the range of polymorph density differences as identified from 2,173 unique, homomolecular polymorph pairs from the CSD. \subsubsection{Dataset construction} \par The dataset used for training the volume estimation model was obtained from the CSD using the Conquest program \cite{conquest}. The search was performed over entries of the 2017 version of the CSD for structures of homomolecular organic crystals, characterized at room temperature, under standard pressure, and containing the text phrase `polymorph'. As described elsewhere \cite{van2005searching, cruz2015facts, kersten2018survey}, all polymorphic compounds in the CSD are flagged with the tag `polymorph'. All duplicate structures were identified using the COMPACK program \cite{chisholm2005compack} and removed to prevent bootstrapping of the underlying distribution. This yielded 3,768 individual entries in the dataset and 2,173 unique polymorph pairs, which is similar in size to previous statistical studies of homomolecular polymorphs \cite{cruz2015facts,kersten2018survey}. \par The expected variance of the percent difference in the solid form volume of a molecule due to polymorphism was calculated using this dataset. All unique pairs of polymorphs were identified and the percent difference between each polymorph density was calculated. The percent difference of densities is equivalent to that of the solid form molecular volume because the molecular weight remains constant for these systems. The distribution of percent differences is plotted in Figure \ref{fig:polymorph_volume}. The distribution has a standard deviation of 2.95\% with respect to the solid form volume of the molecule, consistent with numerous previous reports of molecular crystal density estimation \cite{burger1979polymorphism, ammon1998new, hofmann2002fast, ye2008new}. This indicates that polymorphs which can exist under the same temperature and pressure conditions could posses significant volume differences owing to the complex nature of the relatively weak intermolecular interactions that govern the lattice energy of homomolecular crystals. Thus, the distribution presented in Figure 2 places a lower bound on the expected accuracy of estimated solid form molecular volumes. \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{polymorph_volume_change.pdf} \caption{Histogram of the percent difference of polymorph density for 2,173 unique pairs of polymorphs in a dataset obtained from the CSD. The standard deviation of the distribution is displayed in the top left corner.} \label{fig:polymorph_volume} \end{figure} \subsubsection{Monte Carlo volume estimation} \par Volume estimation is performed by placing a sphere with a van der Waals (vdW) radius \cite{bondi1964van} at the position of each atom in the molecule \cite{gavezzotti1983volumes,pacios1994arvomol}. A Monte Carlo method is then used evaluate the volume occupied by the spheres. First, a three-dimensional box encompassing the molecule is defined. Points within the box are sampled randomly and determined if they fall within at least one of the atomic vdW spheres. The ratio between the number of sampled points and the number of points found within a sphere multiplied by the volume of the three-dimensional box is the estimated volume of the molecule. The Monte Carlo volume estimation is deemed to be converged when the estimated volume changes by less than $10^{-3}$ after $10^6$ new points are samples. \par The ratio between the experimental molecular solid form volume and the Monte Carlo volume estimate for the polymorph dataset was found to be 1.47, indicating that the Monte Carlo method systematically underestimates the true solid form volume. Using this linear relationship to predict the solid form volume of the molecule achieves a standard deviation of 4.72\% error with respect to the dataset (Figure \ref{fig:model_performance}). To improve the accuracy of the volume estimation model, specific information about the chemical environment of the atoms in the molecule must be included. To this end, a molecular topological fragment representation has been developed. \subsubsection{Molecular topological fragment model} \par We present a topological molecular fingerprint representation for predicting solid form molecular volume within the accuracy of polymorph density differences. The representation is based on molecular fragments determined through analysis of the CSD dataset. The fact that the fragments are not predefined enables an unbiased choice of fragments such that they can represent any structural class. The complexity of the model increases with the size and chemical diversity of the dataset making this representation amenable to large datasets as well as datasets comprising a restricted chemical space. Moreover, representation is invariant to permutations of the atom indexing. The molecular topological fragment representation can be used to predict any molecular property of interest with linear and non-linear regression or classification models and can also be used to compute chemical similarity between molecules using metrics such as the Tanimoto coefficient \cite{maggiora2013molecular}. The Genarris 2.0 source code includes a model construction Python class, enabling users to quickly build topological fingerprints for a training dataset, regularize the model, evaluate the accuracy on a target dataset, and output graphs of predicted values versus target values to asses the performance of the model. \par The molecular topological fragment representation is built by constructing a unique string representation for every atom in the molecule. Given an atomic environment, the string is deterministic and does not coincide with another distinct atomic neighborhood. The bonding of the molecule is calculated and used to construct a graph comprised of nodes and edges corresponding to atoms and bonds. Then, the atomic neighborhood strings are constructed for every atom in the molecule. The atom's bonded neighbors are identified and concatenated into a string. The string is sorted first by terminal elements in alphabetical order, then by the atom itself if it is non-terminal, and finally the elements the atom is bonded to are given in alphabetical order. All unique neighborhoods across the dataset are collected and sorted in alphabetical order. This ordering is used to index the vector representation of the molecules. For a given molecule, the value of the vector at each index corresponds to the number of each type of fragments present in the molecule. An example of vector representations for glycine and benzene is seen in Table 1. The representation described here is similar to other fragment based representations seen in chemical informatics \cite{rogers2010extended, hansen2015machine}. \vspace{-0.5 cm} \begin{center} \captionof{table}{Example of vector representations constructed for a dataset containing benzene and glycine using the molecular topological fragment model.} \begin{tabular}{| c c c c c c c c |} \hline Fragment & HC & HCCC & HHCCN & HHHNC & HN & OC & OOCC \\ \hline Benzene & 6 & 6 & 0 & 0 & 0 & 0 & 0 \\ Glycine & 2 & 0 & 1 & 1 & 3 & 2 & 1 \\ \hline \end{tabular}{} \end{center}{} \par To construct a predictive model for solid form molecular volumes, the volume predicted by the Monte Carlo method was concatenated to the topological fragment representation vector of each molecule. The coefficients for a linear model were then calculated using Bayesian ridge regression as implemented in scikit-learn \cite{pedregosa2011scikit}. The regularization parameter was optimized using a grid search method and five-fold cross validation. The number of features contained in the model was constrained by removing features that did not occur at least thirty times in the dataset. Thirty was identified as the optimal number using a five-fold cross validation scheme. This left 64 unique molecular fragments in the model. \par The distribution of errors obtained using the topological fragment model is displayed in Figure \ref{fig:model_performance}. It is shown that the fragment based model significantly reduces the error in the predicted solid state molecular volumes compared to the Monte Carlo volume estimation. Furthermore, the fragment based model achieves an error of similar magnitude to the volume differences between polymorphs found in the CSD. Thus, the topological fragment model developed here achieves an accuracy within the error one could expect from polymorph density differences. \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{model_performance_vertical.pdf} \caption{Percent error of the predicted solid form volume for the described dataset from the CSD for a linear model using Monte Carlo volumes and a linear model using Monte Carlo volumes in green and the topological fragment representation of the molecules in orange.} \label{fig:model_performance} \end{figure} \subsection{Structure generation} \label{subsection:Structure generation} The generation process begins by identifying all space groups compatible with the number of molecules in the unit cell. This task is easy for general Wyckoff positions whose multiplicity must equal the desired number of molecules per cell. To determine whether a molecule can occupy special Wyckoff positions, its symmetry must be considered. Genarris 2.0 detects compatible space groups automatically within a given numerical tolerance. Once the compatible space groups are found, Genarris 2.0 attempts generation of crystal structures sequentially, starting from the lowest space group number. If Genarris is unable to generate a structure within the maximum attempt limit specified by the user, then it proceeds to the next space group. A random volume is drawn from a Gaussian distribution whose mean and standard deviation are the predicted volume and three times the prediction error of our volume estimation method (see Sec.~\ref{subsection:Unit cell volume estimation}). The volume is redrawn after a successful generation or after a user-specified number of failed attempts. Subsequently, using this volume, a unit cell of the desired lattice system is constructed randomly as shown in Figure \ref{fig:special_position_generation}. If the attempted position is a general Wyckoff position, then the molecule's orientation is sampled randomly and placed randomly inside the unit cell. The space group symmetry operations are then applied to generate the remaining molecules in the unit cell. Special positions, with the exception of inversion centers, require alignment of the molecule and their treatment is described in Sec.~\ref{subsubsection:Generation in Special Positions of Space Groups}. The attempted structures that pass the intermolecular distance checks, as described in Sec.~\ref{subsubsection:Structure checks}, are added to the raw pool. \subsubsection{Generation in special positions of space groups} \label{subsubsection:Generation in Special Positions of Space Groups} \begin{figure} \centering \includegraphics[width=1\textwidth]{special_position_generation.pdf} \caption{Flowchart of crystal structure generation in Genarris 2.0. Molecules are placed in general Wyckoff positions with a random orientation. In contrast, special positions require specific orientations of the molecule to be compatible with the site symmetry} \label{fig:special_position_generation} \end{figure} Special Wyckoff positions are left invariant under at least one symmetry operation of the space group in addition to the identity operation. For each space group, the International Table of Crystallography \cite{hahn1983international} lists the special positions whose multiplicity is lower than that of the general position. Only molecules with appropriate symmetry can occupy a special position. Since most molecules do not have higher order symmetries, molecular crystals with molecules on special positions are infrequent. According to an analysis of the CSD \cite{pidcock2003database}, in 70.1\% of the molecular crystals, molecules occupy general positions, and in the remaining structures molecules occupy special positions. Among the special positions, two-fold rotation ($2$), mirror planes ($m$), and inversion centers ($\bar{1}$) are the most frequent. Genarris 2.0 generates molecular crystals with molecules on special positions by checking all possible orientations of the molecule with respect to the symmetry directions of the crystal system \cite{hahn1983international}, as shown in the flowchart in Figure \ref{fig:special_position_generation}. At the start of generation, the program finds all possible molecular axes that may be associated with a symmetry element. For this purpose, first the center of mass of the molecule is shifted to the origin. Then, all atoms of the same element that are farthest from the center of mass are selected. The possible symmetry elements of the molecule would map any of these atoms onto itself or onto another. The axes corresponding to these symmetry elements are obtained by calculating the averages and cross products of the position vectors of the selected atoms. A list of potential molecular axes is constructed. To keep the length of the list minimal, parallel vectors are deleted. Once the potential molecular axes are identified, the code proceeds to check the compatibility of molecule placement at a special position with the specified number of molecules in a unit cell. The molecule's center of mass is placed in a special position such that one of the molecular axes is oriented along one of the viewing directions of the crystal system. Then, the symmetry operations of the space group are applied. If the number of overlapping molecules generated is equal to the order of the site, the special Wyckoff position is regarded as compatible. If not, different molecular axes and viewing directions are considered. All combinations of molecular symmetry axes and viewing directions are examined and compatible ones are stored for subsequent generation attempts. Once a molecule is placed in a compatible special position, its geometry is slightly adjusted (within a user-defined tolerance) by averaging over the atomic positions of all the overlapping molecules occupying the same site. Depending on the site symmetry of the special position, the allowed degrees of freedom are randomized. For example, on a general position or an inversion center, the molecule can be freely rotated about its center of mass. A molecule placed on a two-fold axis can be freely rotated about the axis. \subsection{Structure checks} \label{subsubsection:Structure checks} Attempted structures are checked to avoid unphysically close intermolecular contacts. Checking the distance between every atom of a molecule and every atom of all neighboring molecules, including its own periodic replicas, has a scaling of $O(N^2)$, where $N$ is the number of atoms in the unit cell. This is found to be the bottleneck of structure generation. To improve the efficiency, Genarris 2.0 performs a series of three hierarchical structure checks. Failed structures are discarded at each stage, such that fewer structures undergo the more rigorous and computationally expensive checks. The threshold for allowed close contacts between two atoms is called the cutoff distance and is defined based on a specific radius fraction, $s_r$, of the sum of atomic van der Waals radii \cite{li2018genarris}. The crystal structure is deemed unphysical and rejected if the distance, $d$, between two atoms belonging to different molecules is such that \begin{equation} d < s_r(r_A+r_B) \end{equation} where $r_A$ and $r_B$ are the van der Waals radii of atom A and atom B, respectively. This ensures the quality of the generated structures. The default value of $s_r$ is $0.85$. Based on statistical analysis of structures extracted from the CSD, this is a reasonable setting for all but the strong hydrogen bonds. For these cases, special settings have been implemented in Genarris 2.0, as described in Sec.~\ref{Hbonds}. For this value of $s_r$ and the target unit cell volume determined as described in Sec.~\ref{subsection:Unit cell volume estimation}, random generation of crystal structures may require a large number of attempts (a few thousand to millions) before it passes all three stages of structure checks and is accepted into the pool. Therefore, the new hierarchical structure check procedure is a significant efficiency improvement in Genarris 2.0. The details of each stage are explained below. \subsubsection{Stage I: Fast screening without periodic boundary conditions} For preliminary screening, periodic boundary conditions are completely ignored and only intermolecular distances in the unit cell are evaluated. Because distances are computed using the Euclidean norm, this stage is the fastest. If the centers of mass of a pair of molecules in a cell are much farther than twice the molecule length, defined as the maximum distance between two atoms of a molecule, then those pairs are ignored as these molecules cannot overlap. We find that most of the unphysical structures generated are rejected at this stage. The structures that pass this screening proceed to the second stage of structure checks. \begin{figure} \centering \includegraphics[width=0.9\textwidth]{stage2.png} \caption{A two dimensional representation of Stage II approximate distance evaluation under periodic boundary conditions. a) An oblique lattice in Cartesian coordinates. The star denotes the point whose distance to the nearest lattice point we need to find. b) Once the lattice is converted from real space into the fractional basis, it is easy to find the box that bounds the point. c) The nearest lattice point is likely to be one of the real space points that map to the green points.} \label{fig:tier2} \end{figure} \subsubsection{Stage II: Distance checks with periodic replicas} In this step, the distances of a molecule from other molecules in the unit cell as well as its own periodic images are checked against the cutoff distance. An approximate minimum image convention is implemented for non-orthogonal cells. To accelerate the distance checks, non-orthogonal cells undergo a lattice reduction. Let \textbf{a} = $[a_x, 0, 0]$, \textbf{b} = $[b_x, b_y, 0]$, and \textbf{c} = $[c_x, c_y, c_z]$ be the lattice vectors in a Cartesian coordinate system. It is possible to choose a less oblique lattice which satisfies: $a_x, b_y ,c_z > 0$; $|b_x|, |c_x|\leq a_x/2$; and $|c_y|\leq b_y/2$. The Stage II algorithm is illustrated in Figure \ref{fig:tier2}. First, the atom positions are expressed in fractional coordinates. Then, the distance between two atoms is computed in fractional space and translated to the ``origin cube", spanned by the vectors $[1,0,0], [0,1,0], [0,0,1]$. Finally, the minimum Cartesian distance of this point from the corners of the origin cube is calculated. For orthogonal cells, the closest point in fractional space necessarily corresponds to the closest point in real Cartesian space. However, for an oblique triclinic lattice a different lattice point may be closer to this point. Therefore, if a non-orthogonal structure passes Stage II, it proceeds to Stage III for a more rigorous check. \subsubsection{Stage III: Rigorous checks for non-orthogonal cells} Complete structure checks require exact evaluation of distances under minimum image convention. For non-orthogonal cells, this problem is a three-dimensional case of the well-studied closest vector problem \cite{cvp2002}. If the lattice is translated such that one of the two points coincides with the origin, we need to find the distance $d$ to the nearest lattice point of the position vector $\mathbf{x}$ of the second point. That is, \begin{equation} d^2= \min_\mathbf{n} | \mathbf{L}^T \mathbf{n}- \mathbf{x}|^2 , \end{equation} where $\mathbf{n} = [n_x, n_y ,n_z]$; $n_x, n_y ,n_z \in \mathbb{Z}^3$; and $\mathbf{L}=[\mathbf{a}, \mathbf{b}, \mathbf{c}]^T$. This problem is encountered in communication theory, where the received signal over a communication line is decoded by finding the nearest lattice point \cite{rogers2016overcoming}. One popular approach is the Finck and Pohst sphere decoder \cite{fincke1985improved, hassibi2005sphere} method, where the closest lattice point is found using a tree search and the depth of the tree corresponds to the dimension of the problem. Genarris 2.0 uses a version of the sphere decoder to compute the exact distance under minimum image convention for non-orthogonal cells. The distance estimate obtained from Stage II is used as the initial sphere radius for the sphere decoder algorithm. This step is the slowest, but only few non-orthogonal structures that pass Stage I and Stage II reach Stage III. Hence, the overall efficiency is not compromised. \subsubsection{Intermolecular cutoff distances} \label{Hbonds} \par Choosing appropriate intermolecular cutoff distances is critical for generating physically reasonable structures. In Genarris 2.0, cutoff distances are a function of the elements participating in the intermolecular interaction. For vdW interactions, cutoff distances are implemented using an $s_r$ of 0.85. An $s_r$ of 0.85 was determined to be a physically reasonable value based on our statistical analysis of intermolecular contacts in a data extracted from CSD and presented in Figure \ref{fig:h_bond} as well as an earlier analysis \cite{rowland1996intermolecular}. However, for hydrogen bonds, the intermolecular distance may be considerably shorter than the $s_r$ value used for weaker intermolecular interactions \cite{rowland1996intermolecular, steiner2002hydrogen}. Hence, new settings for the allowed interatomic distances for hydrogen bonds have been implemented in Genarris 2.0. \par Hydrogen bonds among the most important intermolecular interactions in both naturally occurring and artificially engineered molecular crystals \cite{steiner2002hydrogen}. Intermolecular hydrogen bonds are denoted as XH$\cdots$Y where X is the donor, which is covalently bonded to the hydrogen, and Y is the acceptor, which belongs to a different molecule than X. The cutoff distance between H and Y implemented in Genarris 2.0 depends on the identity of atoms X and Y. However, these cutoff distances are applicable to any functional group pair that would participate in an intermolecular hydrogen bond for homomolecular crystals. \begin{figure}[h] \centering \includegraphics[width=0.8\textwidth]{all_interaction_plots.pdf} \caption{Plots of the number of observations as a function of distance for intermolecular contact distances mined from the CSD and gathered from the IsoStar program. Each histogram is labeled with its hydrogen bond and the number of interactions obtained from IsoStar are labeled N. Drawn on the histograms are vertical lines at the distance corresponding to the sum of the vdW radii, a vdW cutoff of 0.85, and the new hydrogen bond cutoff distances.} \label{fig:h_bond} \end{figure} \pagebreak \begin{center} \captionof{table}{New cutoff distances implemented in Genarris for intermolecular hydrogen bonds. The cutoff distances are compared to the sum of the van der Waals radii for the intermolecular interactions using the specific radius ($s_r$) fraction defined in Sec.~\ref{subsubsection:Structure checks}.} \begin{tabular}{|c| p{45mm} | p{35mm} | c |} \hline \textbf{Contact Type} & \centering \textbf{Cutoff Distance} ($\AA^3$) & \centering \textbf{Sum of van der Waals radii} ($\AA^3$) & \textbf{$s_r$} \\ \hline OH$\cdots$O & \centering 1.5 & \centering 2.72 & 0.55 \\ OH$\cdots$N & \centering 1.6 & \centering 2.75 & 0.58 \\ NH$\cdots$O & \centering 1.6 & \centering 2.72 & 0.59 \\ NH$\cdots$N & \centering 1.7 & \centering 2.75 & 0.62 \\ \hline \end{tabular} \end{center} \par Table 2 displays the newly implemented contact distances for hydrogen bonds, in which oxygen or nitrogen are the donor and acceptor. These values were determined based on the existing literature \cite{gilli2009nature}, as well as statistical searches of the CSD using the IsoStar program \cite{bruno1997isostar}. The IsoStar program provides distributions of nonbonded, intermolecular distances between pairs of functional groups. The central and contact functional groups were chosen across the available pK$_a$ range \cite{gilli2008predicting} for each type of hydrogen bond in order to develop general three body cutoff distances for all relevant hydrogen bonds. The results of the IsoStar searches are shown in Figure \ref{fig:h_bond}. For hydrogen bonds involving oxygen and nitrogen as the donor and acceptor, the sum of the vdW radii multiplied by the default $s_r$ value of 0.85 (red dashed lines) exceeds a large number of non-bonded interaction distances, illustrated by the left-most peak of the bimodal distributions. Using the default $s_r$ value, structures with strong hydrogen bonds, such as glycine, would be deemed unphysical and discarded. With the new settings listed in Table 2, they would be considered physically reasonable. For hydrogen bonds involving halogens \cite{brammer2001understanding}, or those with carbon as the donor atom \cite{steiner1996c}, the default $s_r$ value of 0.85 is still appropriate. \subsection{Clustering and down-selection} \label{subsection:Clustering and down-selection} Once a ``raw" pool of physically reasonable, random structures is generated, Genarris 2.0 offers the option of performing a user-defined sequence of clustering, energy evaluation, and down selection steps in order to form a smaller curated pool of structures. Here, we use the Robust workflow, as shown in Figure~\ref{fig:Clustering}. \begin{figure}[h] \centering \includegraphics[width=0.23\textwidth]{clustering.pdf} \caption{The clustering and down-selection steps of the ``Robust" workflow of Genarris 2.0.} \label{fig:Clustering} \end{figure} For the purpose of clustering via the affinity propagation (AP) machine learning algorithm \cite{frey2007clustering}, a feature vector describing the molecular packing is calculated for each structure. The relative coordinate descriptor (RCD) \cite{li2018genarris} and a radial distribution function (RDF) \cite{RDF_1,RDF_2,RDF_3} descriptor are implemented in Genarris 2.0. The \textit{preference} hyperparameter of AP is automatically tuned by Genarris 2.0 to produce the desired number of clusters within a user-defined tolerance, as described in Sec.~\ref{subsection:Parallelization}. The default number of clusters for this step is $10\%$ of the the number of structures in the raw pool. For the exemplar of each cluster, a single point energy (SPE) evaluation is performed using FHI-aims with the settings described in Sec.~\ref{section:DFT settings} below. Then, AP clustering is performed again with the target number of clusters set to 10\% of the reduced pool and the lowest energy structure is selected out of each cluster. Finally, the remaining structures are fully relaxed with FHI-aims as described in Sec.~\ref{section:DFT settings}. This constitutes the final pool of structures output by Genarris 2.0 using the Robust workflow. \section{DFT settings} \label{section:DFT settings} Genarris 2.0 interfaces with the FHI-aims electronic structure code \cite{blum2009ab} for geometry relaxation of the single molecule and of the structures in the final pool, as well as for single point energy (SPE) evaluations within the Robust workflow used here. All invocations of FHI-aims in this work used the Perdew-Burke-Ernzerhof (PBE) generalized gradient approximation \cite{perdew1996generalized} and the Tkatchenko-Scheffler (TS) pairwise dispersion correction \cite{tkatchenko2009accurate} with \textit{lower-level} numerical settings, which correspond to the light/tier1 settings of FHI-aims. SPE calculations for crystals were done self-consistently with a $1\times 1\times 1$ k-point grid for fast screening. Geometry relaxations of the final pool were performed using a $3\times 3\times 3$ k-point grid. Additionally, no constraints were placed on the lattice. All relaxations were done under ambient conditions except for the case of the high-pressure $Z=2$ polymorph of benzene, where the pressure was set to $25$ kbar to reflect the experimental conditions. \section{Case studies} \subsection{Benzene} \begin{figure}[h] \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.9\textwidth]{benzene_2mpc/ben_2mpc_vol.pdf} \caption{Unit cell volume histograms obtained at each step of the Robust workflow for benzene with $Z=2$. The solid green line denotes the unit cell volume of the experimental structure and the dashed orange line shows the volume predicted by our model.} \label{fig:ben_2mpc_vol} \end{minipage} \hfill \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.865\textwidth]{benzene_4mpc/ben_4mpc_vol.pdf} \caption{Unit cell volume distributions obtained at each step of the Robust workflow for benzene with $Z=2$. The green line denotes the unit cell volume of the experimental structure and the dashed orange line shows the volume predicted by our model.} \label{fig:ben_4mpc_vol} \end{minipage} \end{figure} \begin{figure}[h] \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.86\textwidth]{benzene_2mpc/ben_2mpc_spg.pdf} \caption{Space group distribution histograms obtained at each step of the Robust workflow for benzene with $Z=2$. The green arrow points to the space group of the experimental structure, $P2_1/c$ (14)} \label{fig:ben_2mpc_spg} \end{minipage} \hfill \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.86\textwidth]{benzene_4mpc/ben_4mpc_spg.pdf} \caption{Space group distribution histograms obtained at each step of the Robust workflow for benzene with $Z=4$. The green arrow points to the space group of the experimental structure, $Pbca$ (61).} \label{fig:ben_4mpc_spg} \end{minipage} \end{figure} \begin{figure}[h] \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.85\textwidth]{benzene_2mpc/ben_2mpc_lat.jpg} \caption{Lattice parameter distributions obtained at each step of the Robust workflow for benzene with $Z=2$. The green cross denotes the experimental structure.} \label{fig:ben_2mpc_lat} \end{minipage} \hfill \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.85\textwidth]{benzene_4mpc/ben_4mpc_lat.jpg} \caption{Lattice parameter distributions obtained at each step of the Robust workflow for benzene with $Z=4$. The green cross denotes the experimental structure.} \label{fig:ben_4mpc_lat} \end{minipage} \end{figure} With the chemical formula of $C_6H_6$, benzene is one of the simplest aromatic hydrocarbons. It is a highly symmetric molecule with a $6/mmm$ point group which allows special positions with 20 different site symmetries. Two known polymorphs of benzene are \cite{ciabini2007triggering}: a) $Z = 4$ and space group $Pbca$ (61) under ambient pressure and b) $Z = 2$ and space group $P2_1/c$ (14) under high pressure. In both structures, benzene occupies a special position with an inversion center ($\bar{1}$). Figures \ref{fig:ben_2mpc_vol} and \ref{fig:ben_4mpc_vol} show the volume histograms obtained at each step of the Robust workflow for benzene with $Z=2$ and $Z=4$, respectively. The experimental volume and the predicted volume are indicated by solid green line and dashed orange line, respectively. Raw pools of about $6000$ structures were generated for both $Z = 2$ and $Z = 4$ with predicted volumes of $243$ $\AA^3$ and $487$ $\AA^3$, and volume standard deviations of $18$ $\AA^3$ and $37$ $\AA^3$, respectively. The volume of the experimental structures were $206$ $\AA^3$ and $471$ $\AA^3$, respectively. Our prediction for $Z=4$ is much closer to the experimental volume than for $Z=2$ because the latter forms under pressure of $25$ kbar whereas the volume estimation model was trained on structures obtained under ambient pressure. Nevertheless, Figure \ref{fig:ben_2mpc_vol} shows noteworthy density about the experimental volume throughout the workflow progression. The resulting volume distributions in Figures \ref{fig:ben_2mpc_vol} and \ref{fig:ben_4mpc_vol} are approximately Gaussian until the relaxation step. For $Z=2$, relaxation under pressure resulted in volume contraction, whereas some $Z=4$ structures expanded beyond the initial volume range. Figures \ref{fig:ben_2mpc_spg} and \ref{fig:ben_4mpc_spg} show the space group distributions obtained at each step of the Robust workflow for benzene with $Z=2$ and $Z=4$, respectively. Space groups with general Wyckoff positions are colored in blue and space groups with special Wyckoff positions are colored in orange. Genarris 2.0 attempts to generate a uniform space group distribution. We find that the generated space group distributions are approximately uniform with significant number of structures in the experimental space group for both $Z=2$ and $Z=4$. Some space groups may be very difficult or impossible to generate within the given physical constraints. For example, for $Z=4$, space groups like $P2/m$ (10), $Pmm2$ (25), and $Pmmm$ (47) which have mirror planes are harder to generate as molecules that touch the planes overlap with their own mirror image \cite{pidcock2003database}. In contrast, space groups with glide planes and screws axes are easier to generate because symmetry-equivalent molecules are translated in space. Some structures can have a higher site symmetry on a special position than we attempted to generate, resulting in overpopulation of some space groups. For example, for $Z=2$, space group $P6/mmm$ (191) has a relatively large occupation as shown in panel (a) of Figure \ref{fig:ben_2mpc_spg}. Many of these structures were discarded in the subsequent selection steps. Figures \ref{fig:ben_2mpc_lat} and \ref{fig:ben_4mpc_lat} show the lattice parameter distributions obtained at each step of the Robust workflow for benzene with $Z = 2$ and $Z = 4$, respectively. For the energy-based selection and final relaxation steps, the color scale corresponds to relative energies with respect to the lowest energy structure in the final relaxed pool. The lattice parameter distribution of the raw pools resembles the shape of the surface $|a||b||c| =$ constant (an approximate relation given that benzene is able to assume many lattice types), indicating approximately uniform sampling of the lattice parameter space. Down-selection based on energy tends to filter out very elongated structures whose $c$ parameter is significantly longer than $a$ and $b$, indicating that these are relatively unstable for benzene. In fact, the experimental unit cells are not elongated. Panels (f) and (g) of Figure \ref{fig:ben_2mpc_lat} shows that relaxation under pressure resulted in a distribution characterized by a few clusters, suggesting that pressure may have restricted the physically feasible regions. For $Z=2$, the experimental structure, indicated by a green X, is found in the final relaxed pools for both the RCD and RDF runs. For $Z=4$, the final pool was more diverse in lattice parameter space as seen in panels (f) and (g) of Figure \ref{fig:ben_4mpc_lat} and the experimental structure was found only in the RDF run. It should be noted that the goal of Robust workflow is not necessarily to find the experimental structure but to adequately sample the configuration space. \subsection{Glycine} \begin{figure} [h] \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.85\textwidth]{glycine_2mpc/gly_2mpc_vol.pdf} \caption{Unit cell volume distributions obtained at each step of the Robust workflow for glycine with $Z=2$. The green line denotes the unit cell volume of the experimental structure and the dashed orange line shows the volume predicted by our model.} \label{fig:gly_2mpc_vol} \end{minipage} \hfill \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.85\textwidth]{glycine_3mpc/gly_3mpc_vol.pdf} \caption{Unit cell volume distributions obtained at each step of the Robust workflow for glycine with $Z=3$. The green line denotes the unit cell volume of the experimental structure and the dashed orange liwith ne shows the volume predicted by our model.} \label{fig:gly_3mpc_vol} \end{minipage} \end{figure} \begin{figure}[h] \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.85\textwidth]{glycine_4mpc/gly_4mpc_vol.pdf} \caption{Unit cell volume distributions obtained at each step of the Robust workflow for glycine with $Z=4$. The green line denotes the unit cell volume of the experimental structure and the dashed orange line shows the volume predicted by our model.} \label{fig:gly_4mpc_vol} \end{minipage} \hfill \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.85\textwidth]{glycine_2mpc/gly_2mpc_spg.pdf} \caption{Space group distribution histograms obtained at each step of the Robust workflow histogram for glycine with $Z=2$. The green arrow points to the space group of the experimental structure, $P2_1$ (4).} \label{fig:gly_2mpc_spg} \end{minipage} \end{figure} \begin{figure}[h] \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.85\textwidth]{glycine_3mpc/gly_3mpc_spg.pdf} \caption{Space group distribution histograms obtained at each step of the Robust workflow for glycine with $Z=3$. The green arrow points to the space group of the experimental structure, $P3_1$ (144).} \label{fig:gly_3mpc_spg} \end{minipage} \hfill \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.85\textwidth]{glycine_4mpc/gly_4mpc_spg.pdf} \caption{Space group distribution histograms obtained at each step of the Robust workflow for glycine with $Z=4$. The green arrow points to the space group of the experimental structure, $P2_1/n$ (14).} \label{fig:gly_4mpc_spg} \end{minipage} \end{figure} \begin{figure}[h] \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.85\textwidth]{glycine_2mpc/gly_2mpc_lat.jpg} \caption{Lattice parameter distributions obtained at each step of the Robust workflow for glycine with $Z=2$. The green cross denotes the experimental structure.} \label{fig:gly_2mpc_lat} \end{minipage} \hfill \begin{minipage}{0.48\textwidth} \centering \includegraphics[width=0.85\textwidth]{glycine_3mpc/gly_3mpc_lat.jpg} \caption{Lattice parameter distributions obtained at each step of the Robust workflow for glycine with $Z=3$. The green cross denotes the experimental structure.} \label{fig:gly_3mpc_lat} \end{minipage} \end{figure} \begin{figure}[h] \centering \includegraphics[width=0.5\textwidth]{glycine_4mpc/gly_4mpc_lat.jpg} \caption{Lattice parameter distributions obtained at each step of the Robust workflow for glycine with $Z=4$.} \label{fig:gly_4mpc_lat} \end{figure} Glycine is the simplest proteinogenic amino acid. It is achiral and forms a zwitterion in the solid state. Therefore, the zwitterionic form of glycine was used in the single molecule relaxation step. Under ambient conditions, glycine has three common polymorphs: a) $\alpha$-glycine with $Z=4$ and space group $P2_1/n$ (14), b) $\beta$-glycine with $Z=2$ and space group $P2_1$ (4), and c) $\gamma$-glycine with $Z=3$ and space group $P3_1$ (144)/ $P3_2$ (145) \cite{boldyreva2003structural}. The structures belonging to the two space groups are enantiomorphic forms of the chiral $\gamma$-glycine crystal. Experimentally, it has been found that the relative thermodynamic stability of the polymorphs at room temperature follows $\gamma > \alpha > \beta $ with Gibbs free energy difference ($\Delta G$) of $0.16$ kJ/mol between $\gamma$-glycine and $\alpha$-glycine \cite{boldyreva2003polymorphism}. At temperatures higher than $440$ K, $\alpha$-glycine becomes more stable than $\gamma$-glycine. The crystal structure and relative stabilities of the glycine polymorphs have been studied extensively, using different computational methods \cite{chisholm2005ab, day2005beyond, marom2013many, zhu2012constrained, lund2015crystal, sabatini2012structural, rodriguez2019structural}. Glycine is known for its ability to form strong intermolecular hydrogen bonds, owing to which it crystallizes in a relatively dense molecular solid. Figures \ref{fig:gly_2mpc_vol}, \ref{fig:gly_3mpc_vol}, and \ref{fig:gly_4mpc_vol} show the volume histograms for $Z=2$, $Z=3$, and $Z=4$, respectively, at each step of the Robust workflow. The experimental volume and the predicted volume are indicated by solid green and dashed orange lines, respectively. The predicted volume per molecule for glycine is $79 \AA^3$, which is close to the experimental value for all polymorphs. About 5000 structures with mean unit cell volume and standard deviation of $(159, 238, 318)$ $\AA^3$ and $(12, 18, 24)$ $\AA^3$, respectively, were generated for the $Z = (2,3,4)$ polymorphs. The generated raw pool for $Z=3$ is approximately Gaussian centered on the predicted volume. Whereas for $Z=2$ and $Z=4$, the mean of the distribution is larger than the predicted volume. This is because the $Z=3$ is much easier to generate as two out of the three space groups that are allowed have screw axes. The new settings for hydrogen-bonded systems helped generate much dense structures that are close to the predicted volume. Panels (d) and (e) in Figures \ref{fig:gly_2mpc_vol}, \ref{fig:gly_3mpc_vol}, and \ref{fig:gly_4mpc_vol} show that energy-based selection and the final relaxation favor structures near the experimental volume. Figures \ref{fig:gly_2mpc_spg}, \ref{fig:gly_3mpc_spg}, and \ref{fig:gly_4mpc_spg} show the space group distribution for each step of the Robust workflow for glycine with $Z=2$, $Z=3$, and $Z=4$, respectively. The raw pools for all cases show almost uniform space group distribution. For $Z=4$, space groups $P2/m$ (10) and $Pmm2$ (25) are missing because they contain mirror planes that are hard to generate \cite{pidcock2003database}. There are a significant number of structures in the experimental space group in the raw pool and subsequently selected pools for all the cases. Relaxation of the final pool may break existing symmetries or create new ones as there are no constraints imposed. This resulted in additional space groups with a different $Z$ or $Z'$. For example, space group $Cmc2_1$ (36) and space group $P1$ were created after geometry optimization for glycine with $Z=2$ as shown in panels (f) and (g) of Figure \ref{fig:gly_2mpc_spg}. Figures \ref{fig:gly_2mpc_lat}, \ref{fig:gly_3mpc_lat}, and \ref{fig:gly_4mpc_lat} show the lattice parameter distributions obtained at each stage of the Robust workflow for glycine with $Z$ = $2$, $3$, and $4$, respectively. For the energy-based selection and final relaxation steps, the color scale corresponds to relative energies with respect to the lowest energy structure in the final relaxed pool. For $Z=2$ and $Z=4$, the lattice parameter space is well-sampled and diverse regions are obtained upon down-selection. For $Z = 3$, the generated structures are concentrated in distinct regions of the lattice parameter space because there are only three compatible space groups, all of which are in the hexagonal crystal family. For the $Z=2$ case, the experimental structure of $\beta$-glycine was found in the final relaxed pool for both RDF and RCD runs. Similarly, $\gamma$-glycine was found in both runs with $Z=3$. Although $\alpha$-glycine was not found for both the runs, a few structures with similar packing motif, same space group, or similar lattice parameters of experimental structure were found in the final pool. We note that the goal of the Robust workflow is not necessarily to find the experimental structure but to produce an initial population for a structure search algorithm, such as a genetic algorithm. \section{Conclusion} \label{section:Conclusion} In summary, we have presented a new version of the molecular crystal random structure generator, Genarris, with several new features and demonstrated its application to benzene and glycine. The new MPI parallelization scheme has made Genarris 2.0 significantly faster than the previous version, more portable, and able to scale better on high performance computing architectures. The new machine learning method for volume estimation has been demonstrated to reliably predict the volumes of the polymorphs of benzene and glycine. The somewhat larger deviation from the experimental volume for the high-pressure polymorph of benzene was expected, considering that the model was trained on crystal structures obtained at ambient pressure. For all polymorphs of benzene and glycine, the new structure generation function has successfully generated structures in the target volume range with approximately uniform space group distributions and has adequately sampled the possible range of lattice parameters. The new capability to generate structures with molecules occupying special Wyckoff positions has proven to be instrumental for benzene. The updated structure check settings for strong hydrogen bonds have been particularly useful for glycine. Thus, Genarris 2.0 is expected to deliver a significantly better performance than the previous version for symmetric molecules and for molecules capable of forming strong hydrogen bonds. A new “Robust” workflow has been implemented for clustering and down-selection of the raw pool of random structures to form a small curated population of low-energy structures with diverse crystal packing motifs. Although this workflow is intended for producing an initial population for other structure search algorithms (such as genetic algorithms), not as a structure prediction method, the experimental structures of both polymorphs of benzene and of the beta and gamma forms of glycine were found in the final relaxed pools. For alpha glycine, the final pools contained several structures in the same space group, with similar lattice parameters, or with similar packing motifs, which should be sufficient for a genetic algorithm to generate the experimental structure. Genarris 2.0 offers the user full flexibility to design and easily implement new workflows by sequentially executing a user-defined list of procedures. For example, to generate datasets for training machine learning models, the user may wish to perform energy evaluations for a larger number of structures from the raw pool. To perform crystal structure prediction, the user may wish to fully relax a larger number of structures. Thus, Genarris 2.0 is a useful random structure generator for homomolecular crystals of semi-rigid molecules with no rotatable bonds, which can be applied to generate initial populations for structure search algorithms or to generate datasets for machine learning or as a standalone crystal structure prediction method. \section*{Acknowledgements} Work at CMU was funded by the National Science Foundation (NSF) Division of Materials Research through grant DMR-1554428. An award of computer time was provided by the Innovative and Novel Computational Impact on Theory and Experiment (INCITE) program. This research used resources of the Argonne Leadership Computing Facility, which is a DOE Office of Science User Facility supported under Contract DE-AC02-06CH11357 and of the National Energy Research Scientific Computing Center (NERSC), a U.S. Department of Energy Office of Science User Facility operated under Contract No. DE-AC02-05CH11231. Dr. William Paul Huhn from ALCF is thanked for his help with compiling and importing FHI-aims as a Python library. \nocite{*} \bibliographystyle{model1a-num-names.bst}
\section{Introduction} \saeed{we cannot show that $\mathbb{E}[u(t,\mathbf{c}\odot \mathbf{x}^\ast)]=0$. But simulations show it's good enough, no increase in the signal mean value, i.e. in turn its power. This is not now mentioned at all. if a reviewer asks for it, then a proof might be unreachable. I started a note in my notebook } \saeed{bring back dissertation and saeedLater comments once at least} \saeed{it's necessary to show that the begiining point in seach is not important! otherwise I even have to mentine dhwat $\mathcal{M}'$ I have used!} Orthogonal Frequency Division Multiplexing (OFDM) is a well-known multicarrier waveform which has been used in the major wireless communication systems. A main drawback of OFDM scheme is the high dynamic range of its signal envelope, which causes nonlinear distortion at the output of the power amplifier \cite{Pun2007}. In order to avoid the distortion, the so-called power back-off needs to be applied in the power amplifier. Consequently, the power amplifier operates with a low energy efficiency. Especially for mobile equipments where battery life is limited and power amplifiers cannot have a large linear range due to cost constraints, the problem is more pressing~\cite{Ekstrom2006}. It is therefore critical to reduce the required power back-off. The problem is commonly formulated as the minimization of a metric which captures the physical phenomenon and determines the power back-off. The classical metric is the ratio of the peak instantaneous signal power to the average power over consecutive signal segments referred to as Peak-to-Average-Power-Ratio (PAPR) \cite{Pun2007}. An alternative metric called Cubic Metric (CM), which is based on the energy in the nonlinear distortion, was more recently proposed and reported to predict the required back-off more accurately \cite{CMmotorola2004}. \saeedDissertation{ In evaluation of a distortion-less method for PAPR reduction, three factors are considered: rate loss, computational complexity and the reduction gain. When potentials of a novel method are being investigated, we look at the achievable reduction gain versus rate loss regardless of the complexity. Computational complexity becomes important when the method is considered for practical purposes. Then modifications are usually required for a lower complexity which might cause degradation in performance. That is, a trade-off in complexity versus reduction gain must be done for a specific rate loss. The new paradigm allows for choice of the intermediate metric as an extra degree of freedom in achieving better point in the reduction gain, complexity and rate loss space. In this paper all these three factors will be addressed. However, evaluation of the computational complexity depends on technologies and requirements of the day. Therefore, a sound treatment of this aspect requires a separate piece and type of work and we suffice to a crude evaluation. } The PAPR reduction problem has been tackled by several approaches, which can be broadly categorized into two groups. Methods based on deliberately introduced distortion constitute one category, with Clipping and Filtering \cite{armstrong2002} as a well-known example. The second category consists of the distortionless methods which typically provide PAPR reduction at the expense of some reserved resources which incurs rate loss, such as Selected Mapping (SLM) \cite{543811}, Tone Reservation (TR) and Tone Injection (TI) \cite{Tellado:2000}. The methods differ significantly at least in terms of reduction gain, rate loss, transmission power and complexity. A comparison of the pros and cons requires a separate study as provided, for instance, in \cite{1421929}. A refreshed and fundamental review of the problem is as well provided in \cite{gerhard2013SPM}. The CM reduction problem, on the other hand, has received limited attention compared to PAPR. In particular, very few of the already known methods from PAPR reduction research are examined for CM reduction, such as in~\cite{Behravan2011}, \cite{ZhuDescClip2013} and \cite{SiohanCM2006} for TR, Clipping and Filtering and SLM, respectively. It will be emphasized in this paper that CM has a more amenable mathematical structure, which indicates that there is room to improve on the performance and complexity of the back-off reduction problem by considering CM instead of PAPR, besides its reportedly higher accuracy. Sign Selection is a promising distortionless approach based on altering the signs of the data symbols to reduce the PAPR, which has shown potentials for considerable reduction performance at the price of a rate loss equivalent to one bit per complex data symbol for each utilized sign variable \cite{Sharif2004constantPMEPR, Afrasiabi2015derandomized,TellamburaGuidedSS2018,Sharif2009sign, tellamburaCrossEntropy2008}. Considering $N$ subcarriers, there are $2^N$ possible sign combinations, which implies an exponential complexity order for the optimal sign selection. This has motivated research for competing suboptimal solutions. Some proposals with noticeable performance include the application of the method of Conditional Probabilities in \cite{Sharif2004constantPMEPR, Afrasiabi2015derandomized}, a sign selection method guided by clipping noise in \cite{TellamburaGuidedSS2018}, a greedy algorithm in \cite{Sharif2009sign} and a cross-entropy-based algorithm in \cite{tellamburaCrossEntropy2008}. In this work, the method of Conditional Expectations (CE Method), originally proposed in fields of discrete mathematics and graph theory \cite{MitzenmacherUpfal2005}, is used to treat the Sign Selection problem to develop a simple algorithm with a competitive performance for both PAPR and CM reduction requiring only $\frac{N}{2}$ sign bits. The core idea of the CE method is to treat the optimization variables, i.e. the signs of the complex data symbols, as random variables. This artificial randomness is then employed to optimize the signs using conditional expectations. In addition to a direct application of the method to PAPR, a surrogate function referred to as Sum-Exp (SE) is proposed to gain indirect PAPR reduction. Unlike the other metrics, SE has no physical interpretation and is not directly related to power back-off. However, it will be shown that its reduction results in the reduction of the PAPR with lower complexity. The CE method is also applied to CM reduction, where the benefit of the mathematical tractability of CM in deriving low complexity closed-form expressions is demonstrated. As a rather uncommon characteristic among the solutions of the Sign Selection problem in the literature, an increasing reduction gain in PAPR and CM for increasing number of subcarriers is shown by simulations, which implies a roughly constant back-off for a large range of $N$. Furthermore, the CE method allows the analysis of the reduction performance by providing upper-bounds on reduced PAPR and CM values for any combination of the data symbols. \paragraph*{Notation} A random variable $X$ is distinguished from a realization $x$ by using upper and lower case letters, respectively. Vectors are shown by bold-face letters. For a vector $\mathbf{x}$, the notation $x_{m:n}$ is the compact form for $[x_m, x_{m+1},\ldots, x_n]$. The expected value of $Y$ with respect to the random variable $X$ is denoted by $\mathbb{E}_X[Y]$, where the subscript may be omitted if clear from the context. Cardinality of a set $\mathcal{S}$ is denoted by $|\mathcal{S}|$. \section{Preliminaries} \label{sec:pre} In this section, the OFDM signal model as well as the definitions of the metrics PAPR, SE and CM are first presented. Then the Sign Selection problem is formalized and discussed. \subsection{Signal Model} Consider an OFDM scheme with $N$ subcarriers. Let $\mathcal{M}$ be the set of the complex-valued constellation points. The data symbols that modulate the subcarriers are equiprobably and independently generated with zero mean, which implies that $\sum_{x\in\mathcal{M}} x=0$. Accordingly, the random vector $\mathbf{B}\in \mathcal{M}^N$ denotes the vector of data symbols in an OFDM symbol. Denoting the frequency separation of the first and the last subcarriers as $F_s$, the baseband continuous-time signal model for an OFDM symbol is \begin{equation} u(t, \mathbf{B})=\frac{1}{\sigma_b\sqrt{N}}\sum_{k=0}^{N-1} B_k e^{i \frac{2\pi}{N} F_s k t} \quad\quad t\in[0,T), \label{eq:ofdmContSymbolDef} \end{equation} where $T=\frac{N}{F_s}$ and the signal power is normalized by $\sigma_b=\sqrt{\mathbb{E}[|u(t,\mathbf{B})|^2]}$. With the sampling frequency $L F_s$, where $L> 1$ is the oversampling factor, the discrete-time signal model for an OFDM symbol is \begin{align} s (n, \mathbf{B})\!&= u(\frac{n}{L F_s},\mathbf{B}) =\!\frac{1}{\sigma_b \sqrt{N}}\sum_{k=0}^{N-1} \!B_k e^{i \frac{2\pi}{LN} k n} \ \ n=0,1,\ldots, LN\!-\!1. \label{eq:ofdmSymbolDef} \end{align} The oversampling is necessary for reliable measurement of PAPR and CM from the discrete-time signal~\cite{WunderPeakValue2003, KimCubicMetric2016}. \subsection{Peak to Average Power Ratio (PAPR)} \begin{definition} The PAPR metric is a function of the random data vector $\mathbf{B}\in\mathcal{M}^N$ and is defined as \begin{equation} \theta_N(\mathbf{B}) = \max_{n=0,1,\ldots,LN-1} |s(n,\mathbf{B})|^2, \label{eqn:PAPRdef} \end{equation} where $s(n,\mathbf{B})$ is given in \eqref{eq:ofdmSymbolDef} and $L >1$ is the oversampling factor. \end{definition} It will be seen that the maximum operator in the definition of the PAPR makes the required derivations of the CE Method difficult. Here we propose the Sum-Exp (SE) metric, which will be shown to be a suitable objective function to replace PAPR such that a desirable indirect PAPR reduction is gained by SE reduction. \begin{definition} The SE metric is a function of the random data vector $\mathbf{B}\in\mathcal{M}^N$ and is defined as \begin{align} \zeta_N(\mathbf{B})= \sum_{n=0}^{LN-1} e^{\kappa |s(n,\mathbf{B})|^2}, \label{eqn:SEdef} \end{align} where $s(n,\mathbf{B})$ is given in \eqref{eq:ofdmSymbolDef}, $\kappa\geq 1$ is an adjustable parameter and $L >1$ is the oversampling factor. \end{definition} \saeedDissertation{best text found so far is the note ``Basic properties of the soft maximum" by John Cook} The SE metric is obtained from the \emph{log-sum-exp} function of the squared magnitude of the signal samples, i.e. $\log \sum_{n=0}^{LN-1} e^{|s(n,\mathbf{B})|^2}$, which is a well-known approximation of the maximum function \cite{Boyd} since \begin{align*} \max_{i=0,\ldots,LN-1} |s(n,\mathbf{B})|^2 \leq \log \sum_{i=0}^{LN-1} e^{|s(n,\mathbf{B})|^2} \leq \max_{i=0,\ldots,LN-1} |s(n,\mathbf{B})|^2 + \log LN. \end{align*} The first inequality is strict unless $LN=1$ and approaches an equality as the maximum becomes larger relative to the rest of the samples, while the second inequality holds when all values are equal. That is, the approximation improves when the spread of the amplitudes of the signal samples is larger. Therefore, high ratio of the peak power to the average power of the OFDM signal implies that log-sum-exp is likely to be an acceptable approximation for PAPR. Furthermore, it motivates the introduction of the scaling factor $\kappa \geq 1$ to modify the log-sum-exp function as $\frac{1}{\kappa}\log \sum_{i=0}^{LN-1} e^{\kappa|s(n,\mathbf{B})|^2}$ to increase the spread. The SE metric is obtained from the modified log-sum-exp function by omitting the monotonically increasing $\log$ function as well as the constant~$\kappa^{-1}$. \saeedDissertation{ this LSE is no more an approximation of the PAPR. But it keeps a good correlation in a scatter plot. That might be the way to justify that the algorithm finally works. } \subsection{Cubic Metric (CM)} CM \cite{CMmotorola2004} is based on the assumption of a third-order (cubic) polynomial model for the input-output relation of the power amplifier. That is, the output signal $v_o(t)$ for a passband input signal $v(t)$ is assumed to be \begin{equation*} v_o(t)=g_1 v(t) + g_3 v^3(t), \quad t\in\mathbb{R}, \end{equation*} where the linear gain $g_1$ and the non-linear gain $g_3$ are constant and related to the amplifier design. While PAPR is based only on the peaks of the instantaneous power, CM directly captures the energy in the distortion term $v^3(t)$ and is calculated as \begin{equation*} \mathrm{CM}_\mathrm{dB}= \frac{\mathrm{RCM}_\mathrm{dB}[v(t)]-\mathrm{RCM}_\mathrm{dB}[v_\mathrm{ref}(t)]}{K_\mathrm{slp}}+K_\mathrm{bw}, \end{equation*} where the subscript $\mathrm{dB}$ refers to the value in logarithmic scale and the Raw Cubic Metric (RCM) of a signal is defined as \begin{equation} \mathrm{RCM}_\mathrm{dB}[v(t)]= 20 \log_{10}\left( \mathrm{rms}\!\left[\left(\frac{v(t)}{\mathrm{rms}[v(t)]}\right)^3 \right]\right). \label{eqn:RCMdef} \end{equation} The reference signal $v_\mathrm{ref}(t)$, the slope factor $K_\mathrm{slp}$ and the bandwidth scaling factor $K_\mathrm{bw}$ \cite{CMmotorola} are independent of $v(t)$ and are not discussed here. The Root Mean Square (RMS) of a signal $v(t)$ over a large enough interval $U\subset \mathbb{R}$ is $\mathrm{rms}[v(t)]=\sqrt{\frac{1}{U} \int_U v^2(t) dt}$. Consider that reduction of CM for $v(t)$ is essentially equivalent to reduction of its RCM. In addition, CM and RCM are constants calculated for the whole continuous-time passband signal, whereas practical reduction algorithms operate over individual discrete-time baseband OFDM symbols. Therefore, the discrete-time baseband version of the RCM of an OFDM symbol is actually used for CM reduction, as done in \cite{Behravan2011,ZhuDescClip2013,SiohanCM2006}, which is referred to as Symbol RCM (SRCM) in this paper. \begin{definition} SRCM is a function of the random data vector $\mathbf{B}\in\mathcal{M}^N$ and is defined as \begin{align} \eta_{\scriptscriptstyle N}(\mathbf{B})=\frac{1}{LN} \sum_{n=0}^{LN-1} |s(n,\mathbf{B})|^6, \label{eqn:SRCM} \end{align} where $s(n,\mathbf{B})$ is given in \eqref{eq:ofdmSymbolDef} and $L>1$ is the oversampling factor. \end{definition} \saeedDissertation{a new note as a picture in the same folder about the passband to baseband conversion. saying that we should filter out the harmonics} In order to show the relation of RCM and SRCM, we shall first briefly discuss the baseband representation of $v^3(t)$. Let the baseband equivalent representation of $v(t)$ be $h(t)=\sum_{m=-\infty}^{\infty} u(t-mT,\mathbf{B}_m)$ as a function of complex data symbols $\mathbf{B}_m\in\mathcal{M}^N$ pertaining to consecutive OFDM symbols. By a suitable choice of the normalization factor, it follows from the standard procedure of passband to baseband conversion \cite{Benedetto1999} that $\mathrm{rms}[v(t)]=\mathrm{rms}[|h(t)|]= 1$. \saeedDissertation{technically it's not an equality as rms was not defined as ensemble average} Ignoring the scaling factors, it can as well be shown that $h^\ast(t)|h(t)|^2$ is the baseband representation of the frequency component of $v^3(t)$ at the carrier frequency \cite{Benedetto1999}, where $h^{\ast}(t)$ is the complex conjugate of $h(t)$. Consequently, $\mathrm{RCM}[v(t)]=(\mathrm{rms}[v^3(t)])^2=A \left(\mathrm{rms}[|h(t)|^3]\right)^2$ for some scalar $A$ gives the RCM in terms of the baseband continuous signal. Next, the discrete-time version of $h(t)$ is $h(n)= \sum_{m=-\infty}^{\infty} s(n-mLN,\mathbf{B}_m)$. Replacing the summation with an integral in calculation of the RMS of a discrete-time signal, we have $\mathrm{rms}[|h(t)|^3]\simeq \mathrm{rms}[|h(n)|^3]$ given adequate oversampling. Finally, RCM can be written as \begin{align} \mathrm{RCM}[v(t)]&\simeq \lim_{K\to\infty} \frac{1}{K} \sum_{n=0}^{K} |h(n)|^6 \nonumber \\ &= \lim_{M\to\infty} \frac{1}{2MLN}\sum_{m=-M}^{M-1} \sum_{n=0}^{LN-1}|s(n-mLN,\mathbf{B}_m)|^6 \nonumber \\ &= \lim_{M\to\infty} \frac{1}{2M}\sum_{m=-M}^{M-1} \eta_{\scriptscriptstyle N}(\mathbf{B}_m). \label{eqn:RCM-SRCM} \end{align} Therefore, RCM of the OFDM signal is the average of the SRCM values of the underlying OFDM symbols. \saeedDissertation{ \begin{align} \mathrm{RCM}[v(t)]&\simeq \mathbb{E} [\eta_{\scriptscriptstyle N}(\mathbf{B})], \end{align} The equation follows from the independence of the data vectors $\mathbf{B}_m$. \saeedDissertation{CM was proposed \cite{CMmotorola2004} when signals more complicated than the voice signals were required to be handled by the transmitter. It was reported that CM predicts the required power de-rating better than PAPR. Application of the polynomial model for the input-output relationship of a nonlinear device is well-known, as well as the fact the major part of the nonlinear distortions added to the amplified signal is due to the third order term in this model. Namely, the cubic polynomial model for output of the power amplifier for the input passband signal $v(t)$ is $v_o(t)=g_1 v(t) + g_3 v^3(t)$, where the linear and non-linear gains are constant and dependent only on the amplifier design.} \saeedDissertation{To make the reduction algorithm applicable to the metric, firstly it must be rewritten in baseband discrete-time domain. Let $u(t)$ in \eqref{eq:ofdmContSymbolDef} be the baseband equivalent of $v(t)$, i.e., $v(t)=\sqrt{2}\mathrm{Re}\{u(t)e^{2\pi F_c t}\}$. It can be shown that $\frac{3}{\sqrt{2}^3}u(t)|u(t)|^2$ is the baseband equivalent of $v^3(t)$. \saeedDissertation{ find my notes in the same folder.} This representation ensures that the energy in the baseband equivalent and the passband signal is the same.} \saeedDissertation{Note that $\tilde{v}_\mathrm{rms}$ cannot be generally omitted as it depends on the the changes to the signal segment. But in the case of sign changes $\frac{1}{T}\int_0^T |\tilde{v}(t)|^2$ remains unchanged. but considering its role it might be redundant in general. hum?} \subsection{The Sign Selection Problem} As introduced before, Sign Selection refers to altering the signs of the data symbols in an OFDM symbol in order to reduce a desired metric, such as PAPR and CM. Therefore, for the constellation $\mathcal{M}$, $\log_2 |\mathcal{M}|-1$ bits per transmitted data symbol carry information and one bit is determined by the adopted Sign Selection algorithm. To perform the bit-to-symbol mapping in the transmitter, initially consider taking independently and equiprobably distributed random sign bits to complete the $\log_2 |\mathcal{M}|$-bit blocks. This formulation helps analytical derivations in later sections and will be shortly shown not to affect the solution. For the resulting vector of complex data symbols $\mathbf{b}\in\mathcal{M}^N$, the Sign Selection approach seeks a solution $\mathbf{x}^\ast$ for the problem \begin{equation} \min_{\mathbf{x}\in\{-1,1\}^N} f(\mathbf{b}\odot\mathbf{x}), \label{eqn:optimizationProblem} \end{equation} where $f(\cdot)\geq 0$ is a metric defined on the OFDM symbol and $\odot$ denotes element-wise multiplication of vectors. Accordingly, $\mathbf{b}\odot\mathbf{x}^\ast$ will be the transmitted symbols. Considering that the solution space of~\eqref{eqn:optimizationProblem} grows exponentially with $N$, the objective of this paper is to derive an efficient algorithm to obtain a suboptimal solution. \begin{figure}[t] \centering \includegraphics[width=0.3\columnwidth]{constChoice} \caption{A non-unique choice of $\mathcal{C}$ from $\mathcal{M}$ for the 16-QAM constellation.} \label{fig:choiceOfConst} \end{figure} Now we justify that the random sign bits used to complete the $\log_2 |\mathcal{M}|$-bit blocks do not alter the minimization problem. Assume that the constellation $\mathcal{M}$ is symmetric such that for each point $y\in\mathcal{M}$, the negated value $-y$ is in the set. Let $\mathcal{C}\subset\mathcal{M}$ be a non-unique choice of $\frac{|\mathcal{M}|}{2}$ points of $\mathcal{M}$ such that if $y\in\mathcal{C}$, then $-y\notin\mathcal{C}$. A sample choice of $\mathcal{C}$ for 16-QAM is shown in Fig.~\ref{fig:choiceOfConst}. For every $\mathbf{c} \in \mathcal{C}^N$, let $\Omega_\mathbf{c}=\{\mathbf{c} \odot \mathbf{x}, \mathbf{x}\in\{-1,1\}^N\}$. The space of the data vectors $\mathcal{M}^N$ can be partitioned into the sets $\Omega_\mathbf{c}$ for $\mathbf{c}\in\mathcal{C}^N$ such that \begin{equation} \mathcal{M}^N=\cup_{\mathbf{c}\in\mathcal{C}^N}\ \Omega_\mathbf{c} \end{equation} and $\Omega_\mathbf{c} \cap \Omega_{\mathbf{c}'}=\varnothing$ when $\mathbf{c}\neq \mathbf{c}'$. Therefore, every $\mathbf{b}$ in \eqref{eqn:optimizationProblem} belongs to a partition $\Omega_\mathbf{d}$ such that $\mathbf{d}\in\mathcal{C}^N$ and $\mathbf{b}=\mathbf{d}\odot\mathbf{v}$ for some $\mathbf{v}\in\{-1,1\}^N$. Having all possible sign vectors as the solution space, it is clear that the Sign Selection problem always seeks the minimum of the partition which contains $\mathbf{b}$. Formally, $\min_{\mathbf{x}\in\{-1,1\}^N} f(\mathbf{b}\odot\mathbf{x})=\min_{\mathbf{x}\in\Omega_\mathbf{d}} f(\mathbf{x})$ for every $\mathbf{b}\in\Omega_\mathbf{d}$. Notice that although the starting vector $\mathbf{b}\in\Omega_\mathbf{d}$ does not affect the solution of~\eqref{eqn:optimizationProblem} for the partition $\Omega_\mathbf{d}$, it may change the suboptimal solution provided by a proposed algorithm. The (bit-to-)symbol mapping in the transmitter and the decoding in the receiver are based on a predetermined $\mathcal{C}$. On the transmitter side, the data symbols are obtained by mapping $\log_2 |\mathcal{M}|-1$ bits to a point in $\mathcal{C}$. On the receiver side, the decoding of the symbol of each subcarrier is performed by choosing $c\in\mathcal{C}$ when one of $\pm c\in\mathcal{M}$ is detected and reversing the symbol mapping accordingly. Notice that the decoding adds no complexity to the receiver. Besides, the choice of $\mathcal{C}$ plays a role only in the symbol mapping and decoding and is otherwise immaterial to the Sign Selection problem. Particularly, it can be shown that the partitioning described before is independent of $\mathcal{C}$. \saeedDissertation{\begin{proof} (i) Let $\mathbf{b}_i=[b_{11} b_{12} \ldots b_{1N}]^T\in\mathcal{M}'^N$. For any $\mathbf{b}_j\neq \mathbf{b}_i$, at least for one element we have $b_{iq}\neq b_{jq}$ and by definition, $b_{iq}\neq-b_{jq}$. Therefore, there exists no choice of $\mathbf{x}_1,\mathbf{x}_2\in\{-1,1\}^N$ such that $b_{iq} x_{1q}=b_{jq} x_{2q}$. Therefore, $\mathbf{b}_i \odot \mathbf{x}_1\neq \mathbf{b}_j \odot \mathbf{x}_2$ for all $\mathbf{x}_1,\mathbf{x}_2\in\{-1,1\}^N$, which means that $\Omega_i \cap \Omega_j=\emptyset$. (ii)$|\Omega|=|\mathcal{M}|^N$ and $|\Omega_i|=2^N$ for all i's. $|\cup_i \Omega_i|=\sum_i |\Omega_i|=|\mathcal{M}'|^N 2^N=|\Omega|$. \end{proof}} \saeedDissertation{The pairings in M are fixed. There are simply $|\mathcal{M}|/2$ of them. Choice of $M'$ is only important for the decoding, so we know with which data symbol a pair is associated. So the solution is independent of the choice of M'. This is a property of the sign selection problem! and it doesn't say it's indept of the data vector in the partition. so make the problem statement based on b. define M' after that! this way I can remove the c thing totally! you also mention in the bit to symbol mapping that we indeed choose M' and have a c there. then it's like we did another coin flip to get the b. which changes the initial point in the partition. it'll be seen in the CE method that it does not depend in the initial point. but this can't be said in general} \saeedDissertation{we finally need to work with the problem $\min \ f(\mathbf{b}\odot\mathbf{x})$ so that lemma 1 works! but in the general case of algorithm I and any any objective function $f$ that gives the suboptimal solution $\mathbf{x}^\ast$ for the problem $\min \ f(\mathbf{c}\odot \mathbf{x})$ and $\mathbf{y}^\ast$ for the problem $\min \ f(\mathbf{c}\odot \mathbf{v} \odot \mathbf{y})$ for any $\mathbf{v}$, we cannot say that $f(\mathbf{c}\odot \mathbf{v} \odot \mathbf{y})= f(\mathbf{c}\odot \mathbf{x})$. can we? I'm not sure. so skip and do the proof for the specific solution given by the CE method later when it is presented. after a few hours of confusion, which might have been stupid, I couldn't show it for the CE method too! that is, I can't show that changing the beginning point does not affect the decision rules or the final reduced value! The other solution was to deal with the problem directly in proof of lemma 1. again I couldn't show an equivalent. the problem is basically with the expectation. So made a trick. looks good. :D maybe the same trick could solve the previous problems iwth the proof too!} \saeedDissertation{ It turned out that it holds by simulation that the mean of the signal is roughly zero. There is a section on it in the code (v4). The remark below is nonsense as the CE method ignores any sign previously assigned. it is not clear if we can prove that $\mathbb{E}[C_k X^\ast_k(\mathbf{C}]=0$. Anyways note that $X^\ast_k$ is a function of all data symbols $\mathbf{C}$ and not only $C_k$. This is an issue for other sign selection methods too, it's basically not addressed! \begin{remark} \saeed{revise}Consider the bit to symbol mapping outcome as $\mathbf{c}\in\mathcal{M}'^N$. It will be seen later that it is convenient to have the outcome in the zero-mean space $\mathcal{M}^N$\saeed{spot and mention where}. This can be seen as an extra coin flip for each data symbol: $\mathbf{C}=\mathbf{c}\odot \mathbf{V}$ where $\mathbf{V}\in\{-1,1\}^N$, which is merely a random change in initial point in the search space.\saeed{not in search space!} Then $\mathbf{v}\odot\mathbf{x}^\ast$ is the solution for $\mathbf{c}$. \saeedLater{this was far more elaborated in early versions} \end{remark}} As the final comment, sign selection clearly incurs rate loss. Consider the generalized scheme where $N_s\leq N$ signs are used in the sign selection. That is, $N_s$ data symbols carry $\log_2 |\mathcal{M}|-1$ bits of information and the remaining $N-N_s$ data symbols are mapped from $\log_2 |\mathcal{M}|$ bits to $\mathcal{M}$. The incurred amount of rate loss, i.e. the ratio of the bits used for Sign Selection to the total number of bits in an OFDM symbol, is \begin{align} R= \frac{N_s }{N \log_2 |\mathcal{M}|} = \frac{N_s}{N} \log_{|\mathcal{M}|} 2. \label{eqn:rateLoss} \end{align} Evidently, the rate loss is inversely proportional to the constellation size $|\mathcal{M}|$. \saeedLater{How do we know that $\mathbb{E}[s(t,\mathbf{C}\odot \mathbf{x}^\ast(\mathbf{C}))]=0$ and how necessary is it? Elaborate in report 8.} \section{Method of Conditional Expectations} \label{sec:algorithm} The CE Method \saeed{spencer?}\cite{MitzenmacherUpfal2005} is represented here for obtaining a suboptimal solution to the Sign Selection problem for reduction of an arbitrary metric $f(.)\geq 0$. For a given data vector $\mathbf{b}\in\mathcal{M}^N$, a random vector of sign variables $\mathbf{X}\in \{-1,1\}^N$ is initially assumed with equiprobable and independent elements, which are then sequentially decided and fixed. Consider the $j^\mathrm{th}$ iteration where the random signs $X_{0:j-1}$ are fixed to $x^\ast_{0:j-1}$. The expected values of $f(\mathbf{b}\odot\mathbf{X})$ conditioned on $X_{0:j-1}=x^\ast_{0:j-1}$ with $X_j=1$ and $X_j=-1$ are compared and the sign that yields the smaller expectation is chosen as $x_j^\ast$. Formally, a sub-optimal solution to the minimization problem stated in \eqref{eqn:optimizationProblem} can be obtained by sequentially choosing the sign variables as \begin{align} x_j^\ast &= \begin{cases} \underset{x_0\in\{\pm1\}}{\mathrm{arg\ min}} \ \mathbb{E} [f(\mathbf{b}\odot\mathbf{X})|X_0=x_0] & j=0 \\ \underset{x_j\in\{\pm1\}}{\mathrm{arg\ min}} \ \mathbb{E} [f(\mathbf{b}\odot\mathbf{X})|X_{0:j-1}=x^\ast_{0:j-1},X_j=x_j] & j=1,\ldots,N-1. \end{cases} \label{eqn:CEGeneralRule} \end{align} The decision rule given in \eqref{eqn:CEGeneralRule} is based on introducing random sign variables and then reducing the conditional expectation of the original objective function. The justification that~\eqref{eqn:CEGeneralRule} leads to a desirable suboptimal solution of \eqref{eqn:optimizationProblem} is explained partly here for the general metric $f$ and will be concluded in Section~\ref{sec:analysis} for PAPR and SRCM. For the $j^\mathrm{th}$ sign decision, let \begin{equation} g_j^\pm(\mathbf{b})= \begin{cases} \mathbb{E} [f(\mathbf{b}\odot\mathbf{X})|X_0=\pm1] & j=0 \\ \mathbb{E} [f(\mathbf{b}\odot\mathbf{X})|X_{0:j-1}=x^\ast_{0:j-1},X_j=\pm1] & j=1\ldots,N-1. \end{cases} \label{eqn:gDefinition} \end{equation} Following the decision criterion in \eqref{eqn:CEGeneralRule}, we have \begin{align*} \mathbb{E} &[f(\mathbf{b}\odot\mathbf{X})|X_{0:j} =x^\ast_{0:j}]=\min\ \{g_j^+(\mathbf{b}), g_j^{-}(\mathbf{b})\}, \end{align*} whereas for the $(j-1)$-th step with $j\geq1$, it holds that \begin{align*} \mathbb{E} [f(\mathbf{b}\odot\mathbf{X}) | X_{0:j-1}=x^\ast_{0:j-1}] &=g_j^+(\mathbf{b}) \mathbb{P}(X_j=1|X_{0:j-1}=x^\ast_{0:j-1}) \nonumber \\ & \quad \quad \quad \quad +g_j^-(\mathbf{b}) \mathbb{P}(X_j=-1|X_{0:j-1}=x^\ast_{0:j-1}) \nonumber \\ & =g_j^+(\mathbf{b}) \mathbb{P}(X_j=1) + g_j^-(\mathbf{b}) \mathbb{P}(X_j=-1) \nonumber \\ & =\frac{1}{2}(g_j^+(\mathbf{b}) + g_j^-(\mathbf{b})) \nonumber \\ & \geq \min\{g_j^+(\mathbf{b}) , g_j^-(\mathbf{b})\}. \end{align*} Therefore, \begin{equation*} \mathbb{E}[f(\mathbf{b}\odot\!\mathbf{X})|X_{0:j}\!=\!x^\ast_{0:j}]\!\leq\! \mathbb{E}[f(\mathbf{b}\odot\!\mathbf{X})|X_{0:j-1}\!=\!x^\ast_{0:j-1}] \end{equation*} for $j=1,\ldots, N-1$. This shows that for a given $\mathbf{b}$, the non-increasing sequence of the conditional expectations begins with the \emph{initial expectation} $\mathbb{E}_\mathbf{X}[f(\mathbf{b}\odot\mathbf{X})]$ and ends with $f(\mathbf{b}\odot\mathbf{x}^\ast)=\mathbb{E} [f(\mathbf{b}\odot\mathbf{X})|\mathbf{X}=\mathbf{x}^\ast]$ where no randomness is left. That is, the last conditional expectation coincides with a metric value such that \begin{align} f(\mathbf{b}\odot\mathbf{x}^\ast) \leq \mathbb{E}_\mathbf{X}[f(\mathbf{b}\odot\mathbf{X})]. \label{eqn:CEguarantee} \end{align} \saeed{present this as a lemma?} This justifies that the decision criterion given in \eqref{eqn:CEGeneralRule} leads to a value of the original metric $f$ with the property stated above. Proving the reduction and the upper-bound on the reduced values is not known for the general case of the arbitrary metric $f$ and will be treated in Section~\ref{sec:analysis} specifically for PAPR and CM. Calculation of the conditional expectations required at each step is a major step in development of the algorithm and will be discussed in Section~\ref{sec:CE-calc}. \saeedDissertation{say that we simply set $x^\ast_{0:N_f-1}$ as the sign of data symbols taken from $\mathcal{M}'$. this will hopefully keep a good consistency throughout the paper. then update the inequality guaranteed by the CE method to one which includes $N_f$.} \saeedDissertation{do some work on the location of the signs, at least first or second half of subcarriers and their equivalence. } \saeedDissertation{ \begin{lemma} The solution is independent of the initial data vector in a partition. is this a property of the sign selection problem or the CE Method? I guess we can't claim that this is a property of any suboptimal solution of the SS problem. But it is a common property of the methods I know now. This is important as it determines where this lemma should be put. \end{lemma} from this lemma we need: 1) the decision rule, hence the CEs, updated using a given data vector which is from M and not M'. so we can do the proofs. NO we are okay with the updated SS problem. this is good to mention as a property. Finally I decided I don't use the lemma anywhere and I don't have time to write it :D the original problem in proof of Lemma1 is solved by the reformulation the SS problem} \section{Calculation of the Conditional Expectations} \label{sec:CE-calc} For a given vector of data symbols $\mathbf{b}$, the decision for $x^\ast_j$ requires calculation of $g^\pm_j(\mathbf{b})$ in~\eqref{eqn:gDefinition} which is compactly rewritten as \begin{align} g_j^\pm(\mathbf{b})=\mathbb{E} [f(\mathbf{b}\odot\mathbf{Y}^\pm_j)], \label{eqn:gDef2} \end{align} where \begin{equation*} \mathbf{Y}^\pm_j=[x^\ast_0,x^\ast_1,\ldots,x^\ast_{j-1},\pm1,X_{j+1},\ldots,X_{N-1}]^T \end{equation*} encapsulates the decided signs, the new sign variable set to $+1$ or $-1$ and the remaining random sign variables. The obvious way of calculating the conditional expectations for practically any metric $f$ is to use the empirical average $\hat{g}^\pm_j(\mathbf{b},\mathbf{X}^{1:Q})$ to estimate $g_j^\pm(\mathbf{b})$, which is \begin{equation} \hat{g}^\pm_j(\mathbf{b},\mathbf{X}^{1:Q})=\frac{1}{Q} \sum_{l=1}^{Q} f\left(\mathbf{b}\odot \psi_{j}^\pm(\mathbf{X}^l)\right) \label{eq:estimatorGeneral} \end{equation} where $Q$ is the number of realizations of the random sign vector used for the estimation and \begin{equation} \psi_{j}^\pm(\mathbf{X}^l)=[x_0^\ast, \ldots, x_{j-1}^\ast, \pm 1, X^l_{0}, \ldots, X^l_{N-j-2}]^T, \label{eq:psiDef} \end{equation} where the random variables $X^l_k\in\{-1,1\}, l=1,2,\ldots,Q, k=0,1,\ldots,N-j-2$ are independent and equiprobable. Deriving more efficient ways of calculating the conditional expectations $g^\pm_j(\mathbf{b})$ is a pivotal part of the proposed method. The PAPR metric does not lend itself well to mathematical manipulations to obtain closed-form expressions. Consequently, the conditional expectations are estimated by the sample average as in~\eqref{eq:estimatorGeneral}, which will be further discussed. On the contrary, the definitions of SRCM and SE together with the statistical properties of the signal samples $s(n,\mathbf{b}\odot\mathbf{Y}^\pm_j)$ make it possible to derive closed-form expressions for $g^\pm_j(\mathbf{b})$. These results depend on convergence of the signal samples in distribution to a Gaussian random variable, proof of which is not trivial due to the specific signal model imposed by the Sign Selection problem. This will be clarified in the second part of this section before treating the calculations for SE and SRCM. \subsection{PAPR metric} \label{sec:PAPR} As mentioned before, the available method for calculation of the conditional expectations of PAPR is to perform estimation as specified in~\eqref{eq:estimatorGeneral}. It is apt to study the estimator in terms of a relation between the amount of the required numerical computations, which is proportional to $Q$, and the performance. Although such analysis for PAPR was not reached, authors have presented interesting results in \cite{afrasiabiWSA2016} for the closely related metric \begin{equation} \phi_N(\mathbf{b}) = \sqrt{\theta_N(\mathbf{b})}, \end{equation} which is referred to as Crest Factor (CF). This is a valid alternative as firstly CF has the same physical meaning and practical significance and secondly its relation with PAPR is monotonically increasing. In addition, simulations show almost identical PAPR reduction gained by reduction of CF. Accordingly, consider $g_j^\pm(\mathbf{b})$ in \eqref{eqn:gDef2} for $f(\mathbf{b}\odot\mathbf{Y}^\pm_j)=\phi_N(\mathbf{b}\odot\mathbf{Y}^\pm_j)$. The sample average with $Q$ realizations of the sign vector is \begin{equation} \hat{g}^\pm_j(\mathbf{b},\mathbf{X}^{1:Q})=\frac{1}{Q} \sum_{l=1}^{Q} \phi_N\left(\mathbf{b}\odot \psi_{j}^\pm(\mathbf{X}^l)\right) \label{eq:estimator} \end{equation} where $\psi_{j}^\pm(\mathbf{X}^l)$ and the random vectors $\mathbf{X}^l, l=1,2,\ldots,Q$ were defined in \eqref{eq:psiDef}. \saeedDissertation{our results are for using same sign samples for both, otherwise it's considerably poorer for large N!} It is clear that $\mathbb{E}[\hat{g}^\pm_j(\mathbf{b},\mathbf{X}^{1:Q})]=g^\pm_j(\mathbf{b})$. Consequently, $\lim_{Q\to\infty} \hat{g}^\pm_j(\mathbf{b},\mathbf{X}^{1:Q})=g^\pm_j(\mathbf{b})$ as the variance of $\theta_N(\mathbf{b}\odot \psi_{j}^\pm(\mathbf{X}^l))$ is finite. \saeedDissertation{, although not known for finite $N$. saeed: but would having the variance do good characterisation?} In order to obtain a relation between the reliability of the estimation and $Q$, McDiarmid's concentration inequality \cite{mcdiarmid1998} was employed to bound the probability of deviation of the estimate from its true value as stated in the following theorem \cite{afrasiabiWSA2016}. \saeedDissertation{Concentration inequalities have as well been shown to be useful for characterizing ... in [].} The proof is provided in Appendix~\ref{app:mcdiarmidProof} for completeness. \saeed{think about verifying the theorem by simulation in the last section} \begin{theorem} \label{thm:mcdiarmid} Consider the sample average $\hat{g}^{\pm}_j(\mathbf{b}, \mathbf{X}^{1:Q})$ given in~\eqref{eq:estimator} as an estimate of the conditional expectation $g^{\pm}_j(\mathbf{b})$ given in~\eqref{eqn:gDef2} with $f(\mathbf{b}\odot\mathbf{Y}^\pm_j)=\phi_N(\mathbf{b}\odot\mathbf{Y}^\pm_j)$. For any $\mathbf{b}\in\mathcal{M}^N$ and $\epsilon\geq 0$, \begin{equation*} \mathbb{P} (|\hat{g}^{\pm}_j(\mathbf{b},\mathbf{X}^{1:Q})- g^{\pm}_j(\mathbf{b}) |\geq \epsilon) \leq 2 \exp\!\left(\!-2\epsilon^2\frac{ Q}{d^2} \frac{N}{(N-j-1)}\right), \label{eq:estimation-deviation} \end{equation*} where $d=2 \sigma_b^{-1}\max_{x\in\mathcal{M}} |x|$. \end{theorem} An interesting result of Theorem~\ref{thm:mcdiarmid} is that the upperbound on the probability of deviation is independent of $N$. This is further clarified as follows. A lower bound on the required $Q$ which guarantees the probability of deviation by $\epsilon$ from the true value to be less than $p$ can be deduced within the context of Theorem~\ref{thm:mcdiarmid} as \begin{align*} Q_\circ &= -\frac{d^2 \log \frac{p}{2}}{2\epsilon^2} \frac{N-j-1}{N}. \end{align*} In particular, it indicates that $Q_\circ$ is proportional to the ratio of the number of the remaining sign variables to the total number of them. Equivalently, \begin{align} Q_\circ &\approx -\frac{d^2 \log \frac{p}{2}}{2\epsilon^2} (1-\rho), \label{eqn:Qrel} \end{align} where $\rho=\frac{j}{N}$ and the approximation is due to $\frac{N-1}{N}\approx 1$ for large $N$. However, establishing a connection between the probability of error in sign decision and $Q$ is challenging and needs further research. \saeedDissertation{It can be seen that the relation of $Q$ with $p^{-1}$ is logarithmic, making it rather insensitive to it. The major component is $\epsilon$. However, using the relation to obtain probability of error in sign decisions as a function of $Q$ is a tedious task, since for instance no information is available on $g^+_j-g^-_j$.} \saeedDissertation{ Remainder of this section not clear to be useful. The above analysis on the estimations can be related to sign decision as follows. Without loss of generality, assume that $g_{j}^{+}(\mathbf{b}) <g_{j}^{-}(\mathbf{b})$ and let $g_{j}^{\ast}(\mathbf{b})=g_{j}^{+}( \mathbf{b})$ denote the lower expectation, i.e. the one belonging to the desired sign. The other case follows from re-labeling. Furthermore, let $\hat{g}_{j}^{\ast}\left( \mathbf{b}\right) =\min\{\hat{g}_{j}^{+}\left( \mathbf{b}\right) ,\hat{g}_{j}^{-}\left( \mathbf{b}\right) \}$. Here we show that the following bound holds for $\alpha\geq 0$.% \begin{align} \mathbb{P}\left( \left\vert \hat{g}_{j}^{\ast}\left( \mathbf{b}\right) -g_{j}^{\ast}\left( \mathbf{b}\right) \right\vert \geq\alpha\right) \! < \!4 \exp\!\left(\!-\alpha^2\frac{2 Q}{d^2_{\max}} \frac{N}{(N-j)}\right) \end{align} Assume that $|\hat{g}_{j}^{\pm}\left( \mathbf{b}\right) -g_{j}^{\pm}\left(\mathbf{b}\right) |<\alpha$. There are two cases: \begin{enumerate} \item $\hat{g}_{j}^{+}\left( \mathbf{b}\right) \leq\hat{g}_{j}^{-}\left( \mathbf{b}\right) $: here the estimates follow the true order so that $\hat{g}_{j}^{\ast }\left( \mathbf{b}\right) =\hat{g}_{j}^{+}\left( \mathbf{b}\right) $. Hence% \[ g_{j}^{\ast}\left( \mathbf{b}\right) -\alpha<\hat{g}_{j}^{\ast}\left( \mathbf{b}\right) <g_{j}^{\ast}\left( \mathbf{b}\right) +\alpha. \] \item $\hat{g}_{j}^{+}\left( \mathbf{b}\right) >\hat{g}_{j}^{-}\left( \mathbf{b}\right) $: here the estimates follow NOT the true order so that $\hat{g}_{j}^{\ast }\left( \mathbf{b}\right) =\hat{g}_{j}^{-}\left( \mathbf{b}\right) $. We have% \[ \hat{g}_{j}^{-}\left( \mathbf{b}\right) >g_{j}^{-}\left( \mathbf{b}\right) -\alpha\geq g_{j}^{+}\left( \mathbf{b}\right) -\alpha=g_{j}^{\ast}\left( \mathbf{b}\right) -\alpha \] and \[ \hat{g}_{j}^{-}\left( \mathbf{b}\right) <\hat{g}_{j}^{+}\left( \mathbf{b}\right) <g_{j}% ^{+}\left( \mathbf{b}\right) +\alpha=g_{j}^{\ast}\left( \mathbf{b}\right) +\alpha. \] \end{enumerate} Hence $|\hat{g}_{j}^{\pm}\left( \mathbf{b}\right) -g_{j}^{\pm}\left( \mathbf{b}\right) |<\alpha$ implies $|\hat{g}_{j}^{\ast}\left( \mathbf{b}\right) -g_{j}^{\ast}\left( \mathbf{b}\right) |<\alpha$. Therefore,% \begin{align} \mathbb{P}\left( \left\vert \hat{g}_{j}^{\ast}\left( \mathbf{b}\right) -g_{j}^{\ast }\left( \mathbf{b}\right) \right\vert \geq\alpha\right) &\leq \mathbb{P}\left( \left\vert \hat{g}_{j}^{+}\left( \mathbf{b}\right) -g_{j}^{+}\left( \mathbf{b}\right) \right\vert \geq\alpha\right) \nonumber\\ &+\mathbb{P}\left( \left\vert \hat{g}% _{j}^{-}\left( \mathbf{b}\right) -g_{j}^{-}\left( \mathbf{b}\right) \right\vert \geq\alpha\right) \end{align} which gives the desired result using \eqref{eq:estimation-deviation}. (why $\leq$?)} \subsection{Distribution of $s(n,\mathbf{b}\odot\mathbf{Y}^\pm_j)$} \saeedLater{one way to justify the approximations taken from limits of sequences could be that those sequences have decreasing ``variance"? decreasing distance to the limit, to be precise. otherwise, a limit never says that we're always approaching when N grows. } We begin with characterizing the distribution of the continuous-time OFDM symbol $u(t, \mathbf{b}\odot \mathbf{Y}^\pm_j)$ in Theorem~\ref{thm:convergence}, which is required for performance analysis in Section~\ref{sec:analysis}. The distribution of the discrete-time version $s(n,\mathbf{b}\odot\mathbf{Y}^\pm_j)$ follows automatically, as stated in Corollary~\ref{cor:normalDist}, which is used in the derivation of the conditional expectations of SRCM and SE. As the first step, the following Lemma gives the covariance functions of the samples of the OFDM signal for a given~$\mathbf{b}$ and iteration $j$ of the CE Method as $N\to\infty$. Let \begin{align} \hat{u}_r(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) &\! =\! u_r(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) - \mathbb{E}[u_r(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)], \nonumber \\ \hat{u}_i(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) &\! =\! u_i(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) - \mathbb{E}[u_i(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)], \label{eqn:centeredSamples} \end{align} where subscripts $r$ and $i$ denote the real and imaginary parts respectively. \begin{lemma} \label{lem:variances} Consider $j=\rho N$ where $0\leq\rho\leq 1$ is a rational number. For $\mathbf{B}$ randomly distributed in $\mathcal{M}^N$, let the variances and covariances of $u_r(t,\mathbf{B}\odot \mathbf{Y}^\pm_j)$ and $u_i(t, \mathbf{B}\odot \mathbf{Y}^\pm_j)$ with respect to $\mathbf{Y}^\pm_j$ as $N\to\infty$ and at any time instances $t_1, t_2\in [0,T)$ be denoted as \begin{align*} R^j_{rr}(\tau,\mathbf{B})&=\lim_{N\to\infty}\mathbb{E}_{\mathbf{Y}^\pm_j}[\hat{u}_r(t_1, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j) \hat{u}_r(t_2, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)], \nonumber \\ R^j_{ri}(\tau,\mathbf{B})&=\lim_{N\to\infty}\mathbb{E}_{\mathbf{Y}^\pm_j}[\hat{u}_r(t_1, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j) \hat{u}_i(t_2, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)], \nonumber \\ R^j_{ii}(\tau,\mathbf{B})&=\lim_{N\to\infty}\mathbb{E}_{\mathbf{Y}^\pm_j}[\hat{u}_i(t_1, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j) \hat{u}_i(t_2, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)], \end{align*} where $\tau=t_2-t_1\in(-T,T)$. Then \begin{align*} &R^j_{rr}(\tau)= R^j_{ii}(\tau)= \frac{\sigma_b^2}{2}(\mathrm{sinc} (2F_s\tau)- \rho \mathrm{sinc} (2F_s\tau \rho)), \nonumber\\ &R^j_{ri}(\tau)= \begin{dcases} \frac{\sigma_b^2}{2} \frac{1}{2\pi F_s \tau} (\frac{1}{\rho}\cos(2\pi F_s \rho \tau)\!-\! \cos(2\pi F_s \tau)) &\!\!\!\! \tau\neq 0 \\ 0 &\!\!\!\! \tau=0 \end{dcases}, \end{align*} with probability one. That is, the result holds for any $\mathbf{B}$ as $N\to\infty$ which is emphasized by omitting the argument $\mathbf{B}$ from the notation. Clearly, $R^j_{ri}(\tau)=R^j_{ir}(-\tau)$. \end{lemma} The proof is given in Appendix~\ref{app:variances}. The following theorem characterizes the distribution of the OFDM signal. \begin{theorem} \label{thm:convergence} For $\mathbf{B}$ randomly distributed in $\mathcal{M}^N$ and $j=\rho N$ as specified in Lemma~\ref{lem:variances}, consider $\hat{u}(t,\mathbf{B}\odot \mathbf{Y}^\pm_j)$ as defined in \eqref{eqn:centeredSamples} at any set of time instances $\{t_1,t_2,\ldots,t_K\}\in [0,T)^K, K>1$. Omitting $\mathbf{B}\odot \mathbf{Y}^\pm_j$ to save space, the vector \begin{equation} [\hat{u}_r(t_1), \hat{u}_i(t_1), \hat{u}_r(t_2), \hat{u}_i(t_2), \ldots, \hat{u}_r(t_{K}), \hat{u}_i(t_{K})]^T \label{eqn:cramerWoldSeq1} \end{equation} converges in distribution, as $N\to\infty$, to the vector \begin{equation} [x_1, y_1, x_2, y_2, \ldots, x_{K}, y_{K}]^T \label{eqn:cramerWoldSeq2} \end{equation} of jointly Gaussian random variables with $\mathbb{E}[x_m x_n]=R^j_{rr}(t_n-t_m)$, $\mathbb{E}[y_m y_n]=R^j_{ii}(t_n-t_m)$ and $\mathbb{E}[x_m y_n]=R^j_{ri}(t_n-t_m)$ as given in Lemma~\ref{lem:variances}. \end{theorem} \begin{proof} The proof follows a standard procedure and is only outlined here. It essentially consists of the application of the Cramer-Wold theorem \cite{billingsley1999} to the vector in \eqref{eqn:cramerWoldSeq1} which requires that every linear combination of the elements of the vector in \eqref{eqn:cramerWoldSeq1} converges in distribution to the same linear combination of the corresponding elements of the vector in \eqref{eqn:cramerWoldSeq2}. This can be verified by the Lindeberg condition. In this procedure, the existence of the covariances of the linear combination is shown in Lemma~\ref{lem:variances}. \end{proof} From Theorem~\ref{thm:convergence}, the following result is immediate for the discrete-time OFDM signal at iteration $j$. \begin{corollary} \label{cor:normalDist} For any given~$\mathbf{b}\in\mathcal{M}^N$, $n=0,1,\ldots,LN-1$ and $j=\rho N$ as defined in Lemma~\ref{lem:variances}, it holds that \begin{equation*} \begin{bmatrix} s_r(n, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)- \mu_r(n,\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) \\ s_i(n, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)- \mu_i(n,\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) \end{bmatrix} \xrightarrow{d} \mathcal{N}(0,\frac{1}{2}(1-\rho) I), \label{eqn:jointNormalS} \end{equation*} where $\xrightarrow{d}$ denotes convergence in distribution, $I$ is a $2\times2$ identity matrix and \begin{align*} \mu_r(n,\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)&\!=\!\frac{1}{\sigma_b\sqrt{N}}\mathrm{Re}\left\{ \pm b_j e^{i\frac{2\pi}{LN}jn}\! +\sum_{k=0}^{j-1} b_k x_k^\ast e^{i\frac{2\pi}{LN}kn} \right\}, \nonumber \\ \mu_i(n,\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)&\!=\!\frac{1}{\sigma_b\sqrt{N}}\mathrm{Im}\left\{ \pm b_j e^{i\frac{2\pi}{LN}jn}\!+\sum_{k=0}^{j-1} b_k x_k^\ast e^{i\frac{2\pi}{LN}kn} \right\}. \end{align*} \end{corollary} \begin{remark} \label{rmk:sameInTheLimit} A pivotal result which enables the analytical derivations in the remainder of this paper is that at every iteration of the algorithm, the distribution of $\hat{u}(t,\mathbf{b}\odot\mathbf{Y}^\pm_j)$ in the limit is independent of $\mathbf{b}$. In addition, the distribution of $u(t,\mathbf{b}\odot\mathbf{X})$, i.e. prior to any sign decision, is identical to that of $u(t,\mathbf{B})$ as $N\to\infty$. \end{remark} \begin{remark} \label{remarkApprox} In the following sections, the asymptotically Gaussian distribution shown in Corollary~\ref{cor:normalDist} is used to approximate the distribution of $s(n,\mathbf{b}\odot\mathbf{Y}_j^\pm)$ for the finite but large enough number of random sign variables, i.e. $N-j-1$ at iteration $j$. This can be used to derive closed-form expressions of the sign decision criterion \eqref{eqn:CEGeneralRule} only for $j=0,1,\ldots,N-N_e-1$. The number of the excluded signs $N_e$, for which the approximation is unacceptable, will be determined based on simulations in Section~\ref{sec:perf}. \end{remark} \subsection{SE Metric} \label{sec:LSEcalc} By substituting $\zeta_N(\mathbf{b}\odot\mathbf{Y}^\pm_j)$ for $f(\mathbf{b}\odot\mathbf{Y}^\pm_j)$ in \eqref{eqn:gDef2}, we have \begin{align} g^{\pm}_j(\mathbf{b})= \sum_{n=0}^{LN-1} \mathbb{E} \left[e^{ \kappa |s(n,\mathbf{b}\odot\mathbf{Y}^\pm_j)|^2}\right]. \label{eqn:CEsForSE} \end{align} It was shown in Corollary~\ref{cor:normalDist} that the real and imaginary components of $s(n,\mathbf{b}\odot \mathbf{Y}^\pm_j)$ are Gaussian and independent in the limit with equal variances. For $j=\rho N$, let $\delta_j^2=R_{rr}(0)=R_{ii}(0)=\frac{1}{2}(1-\rho)$ as obtained in Lemma~\ref{lem:variances}. Here we apply the approximation suggested in Remark~\ref{remarkApprox} for $j=0, \ldots, N-N_e-1$. Specifically, the real and imaginary parts of \begin{equation} z(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)=\delta_j^{-1} s(n, \mathbf{b}\odot \mathbf{Y}^\pm_j), \ j=0,\ldots,N-N_e-1 \label{eqn:Zdef} \end{equation} have approximately unit variances with accordingly scaled expected values. Therefore, $|z(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)|^2$ for large enough $N-j$ is approximately a non-central $\chi^2$-distributed random variable with two degrees of freedom. Consider the moment generating function of $|z(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)|^2$ which is \begin{align*} M^\pm_{j,n}(t)&= \mathbb{E}\left[e^{t |z(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)|^2}\right] \\ &=e^{\lambda^\pm_{j,n} t (1-2t)^{-1}} (1-2t)^{-1} \quad 2t<1, \end{align*} where the non-centrality parameter $\lambda^\pm_{j,n}$ is \begin{equation*} \lambda^\pm_{j,n}=\delta_j^{-2 }\left(\mu_r^2(n,\mathbf{b}\odot \mathbf{Y}^\pm_j)+\mu_i^2(n,\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)\right), \end{equation*} and $\mu_r$ and $\mu_i$ were given in Corollary~\ref{cor:normalDist}. It can be seen that the terms in~\eqref{eqn:CEsForSE} are identical to the definition of $M^\pm_{j,n}(\kappa\delta_j^2)$. Consequently, \begin{align} g^{\pm}_j(\mathbf{b})=(\kappa\delta_j^2)^{-1}\beta \sum_{n=0}^{LN-1} e^{\beta \lambda^\pm_{j,n}},\quad j=0,\ldots,N-N_e-1, \label{eqn:LSEcalc} \end{align} where $\beta=\kappa\delta_j^2(1-2\kappa\delta_j^2)^{-1}$. \saeedDissertation{ It is worth mentioning that in derivations for both SRCM and LSE we have used a standard chi-squared variable, hence the same $\lambda_n$, but in SRCM it was possible to establish the connection between the original quantity to be calculated and the MGF by a scalar. Here since we are not working with expected value of the r.v. itself, but it's exp, we have to do the job by choosing $\gamma$.} Finally, a closed-form decision rule can be obtained as \begin{align} x_j^\ast=-\mathrm{sign} \left[\sum_{n=0}^{LN-1} \left(e^{\beta \lambda^+_{j,n}} - e^{\beta \lambda^-_{j,n}}\right)\right], \quad j=0,\ldots,N-N_e-1. \label{eqn:LSErule} \end{align} The number of the last sign decisions which do not follow the closed-form expression in \eqref{eqn:LSEcalc}, i.e. $N_e$, will be determined in Section~\ref{sec:perf}. A sample average must be inevitably used instead for signs $j=N-N_e, \ldots, N-1$ as in~\eqref{eq:estimatorGeneral}. \saeedLater{sth wrong here. LSE with the log is quite good, for very large or small $N$, it gives a very good approximation with a tiny MSE. but it's not the case at all without the log. why? and then why the algorithm works without the log?!!!} \begin{algorithm}[t] \caption{Implementation of the CE Method for CM reduction by Sign Selection. \saeed{make connections to between equations derived and the calculations here} \saeed{make it for SE as it comes first and is more general}} \label{alg:ce-cm} \begin{algorithmic}[1] \REQUIRE $b_0, \ldots, b_{N_f-1}$: data symbols with $\log_2 |\mathcal{M}|$-bit mapping \\ $b_{N_f}, \ldots, b_{N-1}$: data symbols with $(\log_2 |\mathcal{M}| - 1$)-bit mapping \\ \STATE $\mathbf{x}^\ast \gets [1, 1, \ldots, 1]_{N\times 1}$ \STATE $\mathbf{n} \gets [0, 1, 2,\ldots, LN-1]$ \STATE $\mathbf{h} \gets \sum_{j=0}^{N_f-1} b_j \exp(i 2\pi j \frac{\mathbf{n}}{LN})$ \\\COMMENT{Element-wise operations on arrays are assumed in this pseudocode.} \FOR {$j = N_f$ to $N-1$} \STATE $\mathbf{p} \gets \mathbf{h}+ b_j \exp(i 2\pi j \frac{\mathbf{n}}{LN}) \STATE $\mathbf{m} \gets \mathbf{h}- b_j \exp(i 2\pi j \frac{\mathbf{n}}{LN}) \STATE $x_j^\ast \gets -\mathrm{sign}(\mathrm{sum}(|\mathbf{p}|^6\! + 18|\mathbf{p}|^4 +72|\mathbf{p}|^2 -|\mathbf{m}|^6\! - 18|\mathbf{m}|^4\! - 72|\mathbf{m}|^2))$ \IF{$x_j^\ast=1$} \STATE $\mathbf{h} \gets \mathbf{p}$ \ELSE \STATE $\mathbf{h}\gets \mathbf{m}$ \ENDIF \ENDFOR \RETURN $\mathbf{x}^\ast$ \end{algorithmic} \end{algorithm} \subsection{Cubic Metric} \label{sec:CM} Replacing $f(\mathbf{b}\odot\mathbf{Y}^\pm_j)$ with $\eta_{\scriptscriptstyle N}(\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)$ in \eqref{eqn:gDef2}, we have \cite{AfrasiabiSPAWC2019} \begin{equation} g_j^\pm(\mathbf{b})=\frac{1}{LN} \sum_{n=0}^{LN-1} \mathbb{E} \left[\left|s(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)\right|^6\right]. \label{eqn:CMexpCompact} \end{equation} The expected values are the third moments of $|s(n,\mathbf{b}\odot \mathbf{Y}^\pm_j)|^2$. Following the approximation mentioned in Remark~\ref{remarkApprox}, they can be obtained from the third derivative of the moment generating function of the $\chi^2$ random variable $|z(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)|^2$ as defined in~\eqref{eqn:Zdef}. That is, \begin{equation*} \mathbb{E} \left[\left|s(n, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)\right|^6\right]= \delta_j^6 \ \frac{d^3 M^\pm_{j,n}(t)}{dt^3}\Big|_{t=0}, \ j=0,\ldots,N-N_e-1. \label{eqn:expSinZ} \end{equation*} Obtaining the derivative and substituting it in \eqref{eqn:CMexpCompact}, we have \cite{AfrasiabiSPAWC2019} \begin{align*} g_j^\pm(\mathbf{b})\!= \!\frac{\sigma^6}{LN} \!\sum_{n=0}^{LN-1}\!\! \left[(\lambda^\pm_{j,n})^3 \!+ \!18(\lambda^\pm_{j,n})^2 + 72\lambda^\pm_{j,n}+ \!48\right], \quad j=0,\ldots,N-N_e-1, \end{align*} and the decision rule in \eqref{eqn:CEGeneralRule} can be written in closed form as \begin{align} x_j^\ast&= -\mathrm{sign}\left(\sum_{n=0}^{LN-1} \left[(\lambda^+_{j,n})^3 + 18(\lambda^+_{j,n})^2 + 72\lambda^+_{j,n} -(\lambda^-_{j,n})^3 - 18(\lambda^-_{j,n})^2 - 72\lambda^-_{j,n}\right] \right) \label{eqn:finalRule} \end{align} for $j=0,\ldots,N-N_e-1$. For the sign variables $j=N-N_e, \ldots, N-1$, consider using sample averages as in~\eqref{eq:estimatorGeneral} with a high $Q$, which was the number of realizations of the random sign variables to calculate the conditional expectations. \saeed{The following to the last chapter?}Simulations have shown that the CE Method delivers the same performance for several nonzero values of $N_e$ as for $N_e=0$. That is, using accurate sample averages for the final sign variables does not improve the performance. The application of the CE Method to the Sign Selection problem essentially leads to the explicit sign decision criteria derived in this section for PAPR and its substitute SE as well as for the SRCM. For better readability, the pseudocode for SRCM reduction is shown in Algorithm~\ref{alg:ce-cm}, where the expected values required for obtaining $\lambda_{j,n}^\pm$ are constructed by adding the contribution of one subcarrier at each iteration (see lines 5 and 6). \section{Performance analysis} \label{sec:analysis} \saeed{compare this with the upperbounds from other papers? how?} The CE Method guarantees \eqref{eqn:CEguarantee}, which is rewritten here for convenience: \saeedDissertation{use the updated one for pruned CE} \begin{equation*} f(\mathbf{b}\odot\mathbf{x}^\ast) \leq \mathbb{E} [f(\mathbf{b}\odot\mathbf{X})], \label{eq:CEprincipleB} \end{equation*} for a given $\mathbf{b}$. \saeedDissertation{It implies that \begin{equation} \mathrm{Pr}(f(\mathbf{b}\odot\mathbf{x}^\ast)>\rho) \leq \mathrm{Pr}(\mathbb{E}_\mathbf{X} [f(\mathbf{c}\odot\mathbf{X})]>\rho). \label{eqn:CEguaranteedB} \end{equation} That is, the CCDF of the reduced metric is smaller or equal to that of the initial expectation.} In order to characterize $f(\mathbf{b}\odot\mathbf{x}^\ast)$, one approach can be to establish a relation between the distribution of the initial expectation $\mathbb{E}_\mathbf{X} [f(\mathbf{B}\odot\mathbf{X})]$ and that of the uncoded metric values $f(\mathbf{B}), \mathbf{B}\in\mathcal{M}^N$. The analysis will be done for PAPR and SRCM with the help of some useful results from the literature. Concerning the SE metric, a relevant analysis would include a relation between SE reduction and the resulting indirect PAPR reduction, which requires further research. \subsection{PAPR metric} \begin{theorem} \label{thm:PAPRupper} For any $\mathbf{b}\in\mathcal{M}^N$, the reduced PAPR value $\theta_N(\mathbf{b}\odot\mathbf{x}^\ast)$ obtained by the CE Method is bounded in the limit as \begin{align*} \lim_{N\to\infty} \frac{\theta_N(\mathbf{b}\odot\mathbf{x}^\ast) - a_N}{b_N} \leq \gamma, \end{align*} where $b_N=\frac{1}{2}$, $a_N= 2 \log N + \log \log N + \log \frac{\pi}{3}$ and $\gamma \approx 0.577$ is the Euler constant. \saeedDissertation{include $N_f$. proof is easy, see the notebook} \end{theorem} \begin{proof} Consider the PAPR of the continuous-time OFDM symbols $u(t,\mathbf{b})$ given in~\eqref{eq:ofdmContSymbolDef} which is defined as \begin{align*} \xi_N(\mathbf{b})=\max_{t\in[0,T)} |u(t,\mathbf{b})|^2. \end{align*} Clearly, for any finite oversampling factor $L$, \begin{align*} \theta_N(\mathbf{b})\leq \xi_N(\mathbf{b}). \end{align*} Therefore, It directly follows from~\eqref{eqn:CEguarantee} that \begin{align*} \frac{\theta_N(\mathbf{b}\odot\mathbf{x}^\ast) - a_N}{b_N} \leq \mathbb{E}_\mathbf{X} \left[\frac{\xi_N(\mathbf{b}\odot\mathbf{X}) - a_N}{b_N} \right] \end{align*} for any $N$. Therefore \cite{Rudin1987}, \begin{align} \lim_{N\to\infty} \frac{\theta_N(\mathbf{b}\odot\mathbf{x}^\ast) - a_N}{b_N} \leq \lim_{N\to\infty} \mathbb{E}_\mathbf{X} \left[\frac{\xi_N(\mathbf{b}\odot\mathbf{X}) - a_N}{b_N} \right]. \label{eq:PAPRupperIntermStep} \end{align} In order to obtain the right hand side limit, recall that the covariance functions of $u(t,\mathbf{b}\odot\mathbf{X})$, as emphasized in Remark~\ref{rmk:sameInTheLimit}, was shown to be identical to that of $u(t,\mathbf{B})$ as $N\to\infty$. In addition, Extreme Value Theory \cite{leadbetter1988} has been employed in \cite{WeiKelly2002} to obtain the asymptotic distribution of $\xi_N(\mathbf{B})$ as \begin{align*} \lim_{N\to\infty} \mathbb{P} \left( \frac{\xi_N(\mathbf{B}) - b_N}{a_N} \leq w \right) = e^{-e^{-w}}. \end{align*} That is, the appropriately shifted and scaled variable $\xi_N(\mathbf{B})$ has Gumbel distribution in the limit. Consequently, the results of \cite{WeiKelly2002} hold for the asymptotic distribution of $u(t,\mathbf{b}\odot\mathbf{X})$ as well and \begin{align*} \lim_{N\to\infty} \mathbb{P} \left( \frac{\xi_N(\mathbf{b}\odot \mathbf{X}) - b_N}{a_N} \leq w \right) = e^{-e^{-w}}. \end{align*} Finally, the expected value of a random variable with the Gumbel distribution is \begin{align*} \lim_{N\to\infty} \mathbb{E}_\mathbf{X} \left[\frac{\xi_N(\mathbf{b}\odot\mathbf{X}) - a_N}{b_N} \right]=\gamma, \end{align*} which is the right hand side of~\eqref{eq:PAPRupperIntermStep}. This completes the proof. \end{proof} The asymptotic result in Theorem~\ref{thm:PAPRupper} shows an upperbound for $\theta_N(\mathbf{B}\odot\mathbf{x}^\ast)$ when shifted by $a_N$ which grows with $N$. This implies an approximate inequality for finite but large $N$, as stated below. \begin{remark} For large enough $N$, Theorem~\ref{thm:PAPRupper} implies the upperbound \begin{align} \theta_N(\mathbf{b}\odot\mathbf{x}^\ast) \leq \log N + \frac{1}{2} \log \log N + K \label{eqn:upperPAPR} \end{align} for any $\mathbf{b}\in\mathcal{M}^N$, where $K=\frac{1}{2} \log \frac{\pi}{3}+ \gamma \simeq 0.59$. \end{remark} Since the upperbound of Theorem~\ref{thm:PAPRupper} holds for every $\mathbf{b}\in\mathcal{M}^N$, it is equivalently an upperbound on the worst-case reduced PAPR value, i.e. $\theta_{N}^{\mathrm{max}}=\max_{\mathbf{b}\in\mathcal{M}^N} \theta_N(\mathbf{b}\odot\mathbf{x}^\ast)$. Except for relatively small $N$, it is not feasible to observe $\theta_N^{\max}$ in the actual performance investigation by computer simulations or in practice. Instead, it is common to measure the \emph{effective reduced PAPR} $\theta_N^{\mathrm{eff}}$ which is defined according to \begin{equation} \mathbb{P}\{\theta_N(\mathbf{B}\odot\mathbf{x}^\ast)> \theta_N^{\mathrm{eff}}\}=0.001. \label{eq:effPAPRdef} \end{equation} Although it can intuitively be expected that $\theta_{N}^{\mathrm{eff}}$ is much smaller than $\theta_N^{\max}$, a formal relation is not available. \saeedLater{isn't what gerhard alwyas says that the PAPR for large N deviates arbitrarily small from log N in contradiction with that maximum PAPR is always N? log N and N don't get close, do they?} \subsection{Cubic Metric} \saeed{See comments of review 2 of the conf version} The following theorem was previously presented by the authors in \cite{AfrasiabiSPAWC2019}, which obtains a constant upperbound on the reduced SRCM value. \begin{theorem} \label{thm:SRCMupperbound} The reduced SRCM value $\eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{x}^\ast)$ obtained by the CE Method is bounded in the limit as \begin{align} \lim_{N\to\infty}\eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{x}^\ast) \leq 6 \label{eq:SRCMupper} \end{align} for any $\mathbf{b}\in\mathcal{M}^N$. \saeedDissertation{$N_f$} \end{theorem} \begin{proof} \saeedLater{we don't need this, we can build the result on the fixed c case in the same manner, reyleigh and ...} As stated in~\eqref{eqn:CEguarantee}, the CE Method guarantees that \begin{equation} \eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{x}^\ast) \leq \mathbb{E}_\mathbf{X} [\eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{X})]. \label{eq:CEguaranteeCM} \end{equation} From the definition of SRCM in~\eqref{eqn:SRCM}, we have $\mathbb{E}[\eta_{\scriptscriptstyle N}(\mathbf{b})]=\frac{1}{LN}\sum_{n=0}^{LN-1} \mathbb{E}[|s(n,\mathbf{b})|^6]$. In addition, it can be concluded from Remark~\ref{rmk:sameInTheLimit} that the distribution of the discrete-time signal $s(n,\mathbf{b}\odot\mathbf{X})$ in the limit is the same as that of $s(n,\mathbf{B})$. Therefore, \begin{equation} \lim_{N\to\infty} \mathbb{E}_\mathbf{X} [\eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{X})] = \lim_{N\to\infty} \mathbb{E} [\eta_{\scriptscriptstyle N}(\mathbf{B})]. \label{eqn:Elim} \end{equation} The distribution of $\eta_{\scriptscriptstyle N}(\mathbf{B})$ is studied in \cite{KimCubicMetric2016}, where it is shown that \begin{equation*} \lim_{N\to\infty}\mathbb{E}[\eta_{\scriptscriptstyle N}(\mathbf{B})] = 6. \label{eqn:RCMlimit} \end{equation*} Considering \eqref{eq:CEguaranteeCM}, \eqref{eqn:Elim} and that an inequality between two sequences is preserved in their limits \cite{Rudin1987}, we have \begin{align*} \lim_{N\to\infty}\eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{x}^\ast) \leq \lim_{N\to\infty}\mathbb{E}[\eta_{\scriptscriptstyle N}(\mathbf{B})], \end{align*} which completes the proof. \end{proof} \saeedDissertation{\begin{corollary} Let $\mathrm{RCM}^\ast$ belong to the OFDM signal with reduced SRCM for individual OFDM symbols according to the proposed algorithm. Then $\mathrm{RCM}^\ast \leq \mathrm{RCM}$ as $N\to\infty$. \end{corollary} \begin{proof} As seen before, we have $\mathrm{RCM}^2=\mathbb{E} [\eta_{\scriptscriptstyle N}(\mathbf{B})]=6$ as $N\to\infty$. The same derivation holds for the SRCM-reduced OFDM signal, i.e. $h_r(n)= \sum_{m=0}^{\infty} s(n-mLN,\mathbf{C}_m \odot \mathbf{x}_m^\ast))$, where $\mathbf{x}^\ast_m$ is the solution obtained for $\mathbf{C}_m$. Therefore, it follows from Theorem~\ref{thm:SRCMupperbound} that \begin{align*} \lim_{N\to\infty} \mathbb{E}[\eta_{\scriptscriptstyle N}(\mathbf{C} \odot \mathbf{x}^\ast)]\leq \lim_{N\to\infty }\mathbb{E}[\eta_{\scriptscriptstyle N}(\mathbf{B})], \end{align*} which completes the proof. \end{proof}} Recall that the reduction of RCM is the actual objective sought in reduction of SRCM and that CM is related to RCM by some constants. Clearly, Theorem~\ref{thm:SRCMupperbound} shows an upperbound on the largest or worst-case reduced SRCM. Being equal to the average of the reduced SRCM values, RCM can be expected to be much smaller than the upperbound unless the distribution of $\eta_{\scriptscriptstyle N}(\mathbf{B}\odot\mathbf{x}^\ast)$ is highly concentrated. Similar to the relation of the effective reduced PAPR and the upperbound, further characterization of RCM reduction is not available. \section{Simulation Results and Discussion} \label{sec:perf} In this section, the performance of the CE method in reducing PAPR and CM is examined via simulation results. The performance here refers to the reduction in the metrics of interest achieved by the suboptimal solution to the Sign Selection problem, including the indirect PAPR reduction gained by applying the proposed method to the SE metric. \saeedDissertation{High dynamic range of the signal, represented by PAPR, CM or any alternative metric, causes distortion in output signal of the power amplifier. The final assessment of the distortion is by the performance degradation in detection, e.g. bit error rate (BER), and the out-of-band (OOB) radiation, e.g. adjacent channel leakage ratio (ACLR). However, in this work no deliberate distortion, for instance by clipping and filtering type of work, is introduced. Therefore, the relation between the reduction gained in PAPR or CM to the improvement on performance and OOB radiation does not contribute to the problem statement of the paper and is out of the scope. The results of this work are presented by comparing CCDF curves of the metrics. For convenience, \emph{effective PAPR} defined as the PAPR value for which the CCDF equals~$10^{-3}$ is reported in some cases.} \subsection{PAPR reduction} The Complementary Cumulative Distribution Function (CCDF) of $\theta_N(\mathbf{B})$, i.e. $\mathbb{P}(\theta_N(\mathbf{B})>y) $, with $\mathbf{B}\in\mathcal{M}^N$ is commonly used to represent the \emph{uncoded PAPR}, i.e. the PAPR of an unprocessed signal. Accordingly, the reduction performance is reported by the CCDF of $\theta_N(\mathbf{B}\odot\mathbf{x}^\ast)$ for $\mathbf{B}\in \mathcal{M}^N$. To report the performance in the text, the \emph{effective PAPR} is used which is the PAPR value where CCDF equals 0.001. \paragraph{Choice of $Q$} To investigate the reliability of the estimations required in the sign selection rule for PAPR given in \eqref{eq:estimator}, the reduction performance gained by several values of $Q$ for $N=64$ is depicted in Fig.~\ref{fig:64-reduction-Q}. It was observed that the difference for $Q\geq 100$ was insignificant. Consequently, $Q=100$ has been used in the rest of the simulations. As a side note, a very low value of $Q=5$ was included in the figure to show the unexpectedly acceptable reduction that it provides. \saeedDissertation{this same sign thing has to be visited again. why would it make a difference?} \begin{figure}[tb] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{CEforPAPRforQ} \caption{} \label{fig:64-reduction-Q} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{CEforPAPRrefined} \caption{} \label{fig:paprCE} \end{subfigure} \caption{a) Reduction performance of the CE method for PAPR for various number of shots~$Q$, as defined in~\eqref{eq:estimator}, to show the reliability of estimation for~$N=64$ and~16-QAM.\saeedDissertation{only $Q=5$ is done same sign.} b) Reduction performance of the CE method for PAPR with 16-QAM and~$Q=100$, including analytical upperbound of~\eqref{eqn:upperPAPR} on the worst-case reduced PAPR value.} \end{figure} \saeedDissertation{ estimated CCDF curves for the initial expectation for several number of subcarriers are shown in Fig.~\ref{fig:initExpTheory}. It can be seen that the initial expectation becomes more densely concentrated about $\mu=\lim_{N\to\infty}\mathbb{E}[f(\mathbf{C}\odot\mathbf{X})]$ as $N$ increases. The other factor that affects the distribution is the modulation order. For QPSK, the initial expectation stays roughly equal to $\mu$. For a higher constellation size, the distribution spreads out. However, even for high number of points, such as 256-QAM, the distribution is still fairly concentrated. This evaluation confirms the asymptotic result obtained for the initial expectation in \eqref{eq:initExpTheory} for PAPR. with two other figures commented!} \paragraph{Dependence on $N$} The PAPR reduction performance of the algorithm is shown in Fig.~\ref{fig:paprCE} for $N=64$ and 1024 subcarriers, including its pruned version which will be shortly introduced. The simulation results are depicted only for 16-QAM as similar results were observed for other constellations. \saeed{not all?} A significant reduction gain of roughly 5.5~dB, equivalently an effective PAPR of 6.5~dB, was observed for $N=1024$. A noticeable characteristic of the method, evident from the simulations, is that the change in the reduced effective PAPR is relatively small by increasing~$N$ from~$64$ to~1024. The analytic upper bound on the worst-case reduced PAPR, as shown in Theorem~\ref{thm:PAPRupper} and given in~\eqref{eqn:upperPAPR}, is included in Fig.~\ref{fig:paprCE}. The proof of Theorem~\ref{thm:PAPRupper} relies on the extremal value theory to analyze the expected value of the uncoded PAPR, i.e. $\mathbb{E}[\theta_N(\mathbf{B})]$ as $N\to\infty$. The usefulness of this asymptotic result for $\mathbb{E}[\theta_N(\mathbf{B})]$ with finite $N$ can be asserted as~\eqref{eqn:upperPAPR} is almost equal to a diligently calculated empirical average of $\theta_N(\mathbf{B})$ for $N$ as small as 64. Refer to the discussion in Section~\ref{sec:analysis} regarding the relationship between the upperbound and the effective reduced PAPR. \saeedDissertation{ \begin{remark} \label{rmk:PAPRanalytic} A prediction of the amount of reduction in the effective PAPR from the upperbound is not available. Nonetheless, the reduced effective PAPR must be much smaller that the upperbound unless the distribution of the reduced PAPR values is considerably concentrated. This matches the observation made from the curves in Fig.~\ref{fig:paprCE} that the distance of the upperbound from the effective PAPR increases as the accuracy of the asymptotic result, i.e. the value of $N$, increases. The upperbound, which is the expected value of the uncoded OFDM signal, is smaller than the uncoded effective PAPR. Therefore, the existence of such upperbound implies that the reduction gain increases by $N$. \saeed{see if you can turn it into a theorem or sth} \end{remark}} \paragraph{Pruned Sign Selection and Rate loss} It has been observed through simulations that the impact of a sign decision increases for the sign variables with higher indices. That is, the reduction steps in the trajectory of the conditional expectations, as the algorithm performs sign decisions for $x_0$ to $x_{N-1}$, become statistically larger. This motivates pruning the sign bits whose contribution is insignificant. Formally, in the \emph{pruned Sign Selection}, $x^\ast_{0:N_f-1}$ are set as the signs of the first $N_f$ symbols which fully carry data and the sign bits of $N-N_f$ last symbols are determined by~\eqref{eqn:CEGeneralRule}. The pruned algorithm with $N_f=\frac{N}{2}$, as shown in Fig.~\ref{fig:paprCE}, causes negligible degradation in the reduction performance while reducing the rate loss of the Sign Selection approach. Evident from \eqref{eqn:rateLoss}, the rate loss is inversely related to the constellation size $|\mathcal{M}|$. Accordindly, the rate loss is $\frac{1}{12}, \frac{1}{8}$ and $\frac{1}{4}$ for $N_f=\frac{N}{2}$ and 64-QAM, 16-QAM and QPSK respectively. Obviously, a lower rate loss implies a smaller number of sign selections, hence a lower computational complexity. \saeed{it's linearly related, you may wanna say that} \saeedDissertation{ In comparison to randomized methods, the reduction gain behaves fundamentally different. Here we pick the famous method Selected Mapping (SLM). A short description... Recall that algorithms such as SLM are proposed mainly as practical methods with relatively low computational complexity. Therefore, the comparison made here is unfair, unless targeted only on showing the difference between randomized and derandomized paradigms. Fig... shows the performance for a low and high number of phase vectors. It can be seen that no matter how much resources or computation is spent, SLM has basic limitations.} \saeedDissertation{ The analysis provides, equivalently, upperbound on reduced PAPR and minimum PAPR reduction using \eqref{eq:finalTheoryCDF} and~\eqref{eq:initExpTheory}. For instance, taking $0.001$ as the important probability level, we have the minimum reductions gathered in Table~\ref{tbl:minRed} for several values of $N$. As seen in Fig.~\ref{fig:initExpTheory}, the approximation is quite reliable even for $N$ as small as 64. } \saeedDissertation{a table commented} \paragraph{Indirect PAPR reduction by SE Metric} As discussed in Section~\ref{sec:LSEcalc}, the first $N-N_e$ signs decisions for reduction of the SE metric can be done by the rule in \eqref{eqn:LSErule} and the last $N_e$ are done by \eqref{eq:estimatorGeneral}, where the latter is based on the estimation of the conditional expectations. The choice of $N_e$ depends on $Q$, i.e. the number of the realizations of the random sign vector used in the estimation. For a given $Q$, a number of the early decisions are done more accurately using closed-form expressions of \eqref{eqn:LSErule}. When the number of remaining signs is low enough, the accuracy of the estimation overcomes. This intuition was evaluated for SE by examining the reduction performance for $N=64$ \saeedDissertation{ , $\kappa=5$} and $Q=10,100, 10000$ for $N_e=0, 5, 10$ and $20$. The relatively small $N$ was chosen on purpose to have a smaller number of total random variables. It was observed that the effective PAPR reduces from roughly 8.5~dB for $N_e=0$ to 6.8~dB for $N_e=10$ which was better than both $5$ and $20$ with effective PAPR of roughly 7.1 and 7 dB. In addition, going from $Q=10$ to $Q=10000$ showed insignificant effect. As a conclusion, $N_e=10$ and $Q=100$ were selected. \saeedDissertation{The adjustment parameter $\kappa$ introduced in Section~\ref{sec:LSEcalc} was motivated by the observation that having $\kappa$ improved the PAPR reduction for the practical range of $N$. For instance, the reduced effective PAPR moves from 7.5~dB to 6.5~dB for $N=64$\saeedDissertation{,$k_e=N-10$} and $\kappa=10$. With the same value of $\kappa$, 8.2~dB improved to 6.8~dB for $N=1024$. Therefore, $\kappa=10$ has been used in the simulations.} The indirect PAPR reduction achieved by reduction of the SE metric is shown in Fig.~\ref{fig:LSEperf} for $N=64$ and 1024. Although increasing the parameter $\kappa$ improves the SE metric in theory, numerical computations limit its value. Thus, $\kappa=10$ was chosen. It can be seen that the indirect PAPR reduction is as strong as the direct one showing a relatively small degradation. The pruning idea works as well, showing that only a slight loss in gain occurs when rate loss is halved. \saeedLater{would it make a difference it we use same signs for those last signs as in PAPR?} \begin{figure}[tb] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{LSEreduction} \caption{} \label{fig:LSEperf} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{CEforPAPRcomp} \caption{} \label{fig:perfComp} \end{subfigure} \caption{a) Indirect PAPR reduction by pruned application of the CE method to SE for 16-QAM with $\kappa=10, N_e=10 ,Q=100$. b) Reduction performance of the CE method applied to PAPR (CE-PAPR) and SE (CE-SE) compared to Greedy Algorithm~\cite{Sharif2009sign} and Selected Mapping (SLM). $N=1024$ unless stated otherwise.} \end{figure} \paragraph{Comparison} It is a rather common characteristic of the PAPR reduction methods in the literature that the reduced PAPR grows larger as $N$ increases. The CE method differs in this regards such that, as mentioned before, the reduced effective PAPR increases only slightly by $N$. Among the Sign Selection methods, a competitive proposal referred to as the Greedy Algorithm \cite{Sharif2009sign} was chosen for comparison. The well-known Selected Mapping (SLM) \cite{543811} with sign flips as phase rotations was also included, which can as well be seen as a Sign Selection method. The results are gathered in Fig.~\ref{fig:perfComp}, where it can be seen that the Greedy Algorithm performs better for $N=64$ but falls behind for $N=1024$. The performance of SLM depends on the number of independent mappings of the signal denoted by $S$. For the considerably large $S=1000$, the reduction gained by SLM is far lower. As a matter of fact, the performance of SLM can be shown to improve only slightly by increasing $S$ indicating its inherent limitation. The gap becomes larger for higher $N$. \begin{figure}[tb] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{CMreduction} \caption{} \label{fig:CMreduction} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{CMreduction2} \caption{} \label{fig:CMreduction2} \end{subfigure} \caption{a) Reduction performance by pruned CE method applied to SRCM for 16-QAM, including the analytical upperbound on the worst-case reduced metric value. b) Comparison of the SRCM reduction performance of CE Method and SLM with $S=100$.} \end{figure} \subsection{Cubic Metric} Reduction performance for SRCM is shown in Fig.~\ref{fig:CMreduction} for $N=64$ and 1024 to cover a wide range of subcarrier numbers. As shown in the figure, the performance of the pruned algorithm with $N_f=\frac{N}{2}$, i.e. using the second half of sign bits, is only slightly degraded compared to the $N_f=0$ case. This reconfirms the result seen before in PAPR reduction that the proposed algorithm provides almost the same reduction by half the full rate loss, i.e. $\frac{1}{2}\log_{|M|} 2$. The analytical upperbound of Theorem~\ref{thm:SRCMupperbound} is as well included in Fig.~\ref{fig:CMreduction}. The upperbound on the worst-case reduced SRCM is the expected value of the uncoded SRCM, i.e. $\mathbb{E}[\eta_N(\mathbf{B})]$ as $N\to\infty$. The reliability of this asymptotic result was observed as it matches very closely with the empirical average of $\eta_N(\mathbf{B})$ particularly when $N$ is larger than 64. Similar to the PPAR reduction, the simulation results show a growing reduction gain as $N$ increases. The difference in the SRCM case is that the upperbound is independent of $N$, therefore the reduced effective SRCM decreases, which implies the growing reduction gain. Recall that the main metric of interest is CM which is calculated from RCM by knowing hardware-related constants. Therefore, we suffice to reporting RCM, which is the expected value of SRCM as in~\eqref{eqn:RCM-SRCM}. RCM is reduced roughly from 7.7~dB to 4.5~dB for both $N=64$ and $1024$. That is, a surprising result of nearly 3.2~dB reduction practically regardless of $N$. For $N=512$, which is the case studied in \cite{CMmotorola} with available $K_\mathrm{slp}$ and $K_\mathrm{bw}$, the CM is reduced to 2.87~dB. The available values are presented in Table~\ref{tbl:CMperf}. Due to the scarcity of research on CM reduction, we sufficed to the well-known SLM method~\cite{543811} for comparison. The result is shown in Fig.~\ref{fig:CMreduction2} for the relatively large $S=100$. For both cases of $N=64$ and $1024$, performance of the proposed algorithm is significantly better than~SLM. \begin{table}[bt] \centering \caption{RCM Reduction Performance.} \begin{tabular}{|l|c|c|c|c|c|} \hline $N$ & original RCM & original CM & reduced RCM & reduced CM \\ \hline 64 & 7.7 dB& -& 4.5 dB& - \\ 512 & 7.8 dB& 4.8 dB&4.5 dB & 2.87 dB\\ 1024 & 7.8 dB& - & 4.5 dB& -\\ \hline \end{tabular} \label{tbl:CMperf} \end{table} \section{Conclusion} The Method of Conditional Expectations was proposed to find a suboptimal solution to the Sign Selection problem. This investigation led to three particular observations. Firstly, using the conditional expectations as the core element of the sign selection rules provides room for reducing complexity of the algorithm. In particular, proposal of the SE metric as a surrogate function to PAPR led to closed-form expressions for sign selection rule and negligible loss in performance. A similar observation was done for CM which inherently has a tractable definition. This motivates creativity in developing surrogate functions to replace the metrics with physical significance, i.e. PAPR and CM. Secondly, the structure of the CE Method permits derivation of a meaningful upperbound on the largest reduced metric value, such that it actually guarantees a minimum reduction on the effective metric value. Thirdly, the actual performance observed by simulations show a remarkable reduction which is persistent as $N$ increases. In addition, the reduction gain deteriorates only slightly when reducing the number of used sign bits to half, which implies a significantly lower rate loss. \appendices \section{Proof of Theorem~\ref{thm:mcdiarmid}} \label{app:mcdiarmidProof} Recall the random vectors $\mathbf{X}^l\in \{-1,1\}^{N-j-1}, l=1,\ldots,Q$ with independent elements as used in the definition of $\hat{g}_j^\pm(\mathbf{b},\mathbf{X}^{1:Q})$ in~\eqref{eq:estimator}. Suppose that the real-valued function $\hat{g}_j^+$ satisfies \begin{equation} \left|\hat{g}_j^+(\mathbf{b},\mathbf{v}^{1:Q})-\hat{g}_j^+(\mathbf{b},\mathbf{z}^{1:Q})\right|\leq d_{m,k} \label{eq:McDiarmid-diff-1} \end{equation} when vectors $\mathbf{v}^l, \mathbf{z}^l \in\{-1,1\}^{N-j-1}, l=1, 2, \ldots, Q$ disagree only at $v^m_k=-z^m_k$. Then for any $\epsilon \geq 0$, McDiarmid's \emph{independent bounded differences} inequality \cite[p. 206]{mcdiarmid1998} holds as \begin{equation*} \mathbb{P}\left(\left|\hat{g}_j^+(\mathbf{b},\mathbf{X}^{1:Q})- g_j^+(\mathbf{b})\right|\geq \epsilon\right) \leq 2 e^{-2\epsilon^2(\sum_{m,k} d_{m,k}^2)^{-1}}, \end{equation*} where $g_j^+(\mathbf{b})=\mathbb{E}[\hat{g}_j^+(\mathbf{b},\mathbf{X}^{1:Q})]$. The bounded differences of \eqref{eq:McDiarmid-diff-1} on $\hat{g}^+_j$ can be shown as follows. \begin{align} \left|\hat{g}^+_j(\mathbf{b},\mathbf{v}^{1:Q})-\hat{g}^+_j(\mathbf{b},\mathbf{z}^{1:Q})\right| &=\left|\frac{1}{Q} \sum_{l=1}^Q \left[\theta_N\left(\mathbf{b}\odot\psi_{j}^+(\mathbf{v}^l)\right)-\theta_N\left(\mathbf{b}\odot\psi_{j}^+(\mathbf{z}^l)\right) \right] \right| \nonumber \\ &\leq \frac{1}{Q} \sum_{l=1}^{Q} \left| \max_n \left|s\left(n,\mathbf{b}\odot\psi_{j}^+(\mathbf{v}^l)\right)\right| - \max_n \left|s\left(n,\mathbf{b}\odot\psi_{j}^+(\mathbf{z}^l)\right)\right| \right| \nonumber \\ &\leq \frac{1}{Q} \sum_{l=1}^{Q} \max_n \left| s\left(n,\mathbf{b}\odot\psi_{j}^+(\mathbf{v}^l)\right) - s\left(n,\mathbf{b}\odot\psi_{j}^+(\mathbf{z}^l)\right) \right| \nonumber \\ & = \frac{1}{Q} \frac{1}{ \sqrt{N}\sigma_b}2|b_m| \leq \frac{1}{Q} \frac{1}{ \sqrt{N}} d \end{align} where \begin{equation*} \left|\max_n |p(n)| - \max_n |q(n)| \right|\leq\max_n |p(n)-q(n)| \end{equation*} is used and $d= 2\sigma_b^{-1}\max_{x\in\mathcal{M}} |x|$. Therefore, $\sum_{m,k} d_{m,k}^2 = Q\frac{N-j-1}{N}d$, which completes the proof for $\hat{g}^+_j$. Similar steps can be taken to proof the result for $\hat{g}^-_j$. \section{Proof of Lemma \ref{lem:variances}} \label{app:variances} \saeedDissertation{I didn't take this path: Recall from the Sign Selection problem statement that $\mathbb{E}[\mathbf{B}]\neq 0$ for $\mathbf{B}\in \mathcal{M}^N$ with any choice of $\mathcal{M}'$. In this proof, however, it is necessary to have zero expected value for the data symbols. Consider $\mathbf{G}=\mathbf{B}\odot \mathbf{V}$ for a random $\mathbf{V}\in\{-1,1\}^N$. Clearly, $\mathbb{E}[\mathbf{G}]=0$. Replacing $C$ with $G$ in the derivations throughout the paper does not alter the decision rules and the solution $\mathbf{x}^\ast$ obtained for a realization of $\mathbf{B}$ will remain the same.\saeed{yes? and why if so? and doesn't make the whole thing just trivial?}} \saeed{from $j+1$?} \subsection{ $R_{ri}(\mathbf{B},\tau)$ a Gaussian random variable} We begin the proof by analyzing $R^j_{ri}(\tau,\mathbf{B})$ at iteration $j$ of the CE Method and for the random vector of data symbols $\mathbf{B}\in\mathcal{M}^N$ which was defined in Lemma~\ref{lem:variances} and is rewritten here as \begin{equation} R^j_{ri}(\tau,\mathbf{B})= \lim_{N\to\infty} h^{ri}_N(\mathbf{B},t_1,t_2), \label{eq:riCorrDef} \end{equation} where $\tau=t_2-t_1$ and \begin{equation} h^{ri}_N(\mathbf{B},t_1,t_2)= \mathbb{E}_{\mathbf{Y}^\pm_j} [\hat{u}_r(t_1, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)\hat{u}_i(t_2, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)]. \label{eq:hriNdef} \end{equation} Based on the definition of the signal $u$ in \eqref{eq:ofdmContSymbolDef}, \begin{align} h^{ri}_N(\mathbf{B},t_1,t_2)&= \frac{1}{N\sigma_b^2} \mathbb{E}_{X_{j+1:N-1}} \left[ \sum_{k_1=j+1}^{N-1} \sum_{k_2=j+1}^{N-1} X_{k_1}\mathrm{Re} \{B_{k_1} e^{i\omega_{k_1} t_1}\} X_{k_2}\mathrm{Im} \{B_{k_2} e^{i\omega_{k_2} t_2}\} \right] \nonumber \\ &=\!\frac{1}{N\sigma_b^2} \sum_{k=j+1}^{N-1} \!\mathrm{Re} \{B_k e^{i\omega_k t_1}\} \mathrm{Im} \{B_k e^{i\omega_k t_2}\}, \label{eqn:rawDefHri} \end{align} where $\omega_k=\frac{2\pi}{N}F_s k$ and the independence of the random sign variables $X_{j+1:N-1}$ in $\mathbf{Y}^\pm_j$ is used. At this juncture, the relation of $j$ and $N$ must be reviewed. Consider two cases: If $j$ remains constant while $N$ grows, it can be easily seen from the following derivations that the desired quantities are identical in the limit, i.e. as $N\to\infty$, to the case where no sign decision is made by the CE Method. The second case is when $j$ grows with $N$, which needs attention and is the assumption in Lemma~\ref{lem:variances}. Specifically, as introduced in Lemma~\ref{lem:variances}, $j=\rho N$ where $0\leq \rho\leq 1$ is a constant rational number. Since the summands in~\eqref{eqn:rawDefHri} are independent, it is straightforward to apply the Central Limit Theorem to show that $h^{ri}_N(\mathbf{B},t_1,t_2)$ converges in distribution to a Gaussian random variable as $N\to\infty$. That is, \begin{equation} R^j_{ri}(\tau,\mathbf{B}) \sim \mathcal{N}\left(\mu_{ri}(\tau),\sigma^2_{ri}\right), \end{equation} where \begin{equation} \mu_{ri}(\tau)= \lim_{N\to\infty} \mathbb{E}\left[h^{ri}_N(\mathbf{B},t_1,t_2)\right] \label{eq:muDef} \end{equation} and \begin{equation} \sigma^2_{ri}= \lim_{N\to\infty} \mathbb{E}\left[\left(h^{ri}_N(\mathbf{B},t_1,t_2)\right)^2\right] - \left(\mu_{ri}(\tau)\right)^2. \end{equation} Next we derive $\mu_{ri}(\tau)$ and show that $\sigma_{ri}^2=0$, which implies that $R^j_{ri}(\tau,\mathbf{B})$ is equal to $\mu_{ri}(\tau)$ with probability one. \subsection{Convergence of $\mu_{ri}(\tau)$} Given the independence of the data symbols, we have \begin{align*} \mathbb{E}[h^{ri}_N(\mathbf{B},t_1,t_2)] & = \frac{1}{2N} \sum_{k=j+1}^{N-1} a_k, \end{align*} where \begin{align*} a_k= \cos(\omega_k t_1) \sin(\omega_k t_2) + \sin(\omega_k t_1) \cos(\omega_k t_2). \end{align*} Consequently, \begin{align} \mathbb{E}[ h^{ri}_N(\mathbf{B}, t_1,t_2)] &= \frac{1}{2N} \sum_{k=j+1}^{N-1} \sin(\omega_k \tau) \nonumber \\ &=\frac{1}{2N} \sum_{k=0}^{N-1} \sin(\omega_k \tau) - \frac{1}{2} \frac{j}{N} \frac{1}{j} \sum_{k=0}^{j} \sin(\omega_k \tau). \label{eqn:twoSeriesForJ} \end{align} where $\tau=t_2-t_1$. Consider the series \begin{equation} \alpha_M= \frac{1}{2M} \sum_{k=0}^{M-1} \sin\left(\frac{2\pi}{M} k F_s \tau\right) \end{equation} which can be shown to converge as \begin{equation*} \lim_{M\to\infty} \alpha_M = \frac{1}{4\pi F_s \tau} \left(1-\cos(2\pi F_s \tau)\right), \quad \tau \neq 0. \end{equation*} Recall that $j=\rho N$, where $\rho=\frac{m}{p}$ is an irreducible fraction, dictates that $N$ grows as $N=m,2m,\ldots$ with $m\in\mathbb{N}$. Consequently, the first series in \eqref{eqn:twoSeriesForJ}, i.e. \begin{equation*} \beta_N= \frac{1}{2N} \sum_{k=0}^{N-1} \sin(\frac{2\pi}{N} k F_s \tau), \quad N=m,2m,\ldots \end{equation*} is a subsequence of $\{\alpha_M\}$, which readily shows that \cite{Rudin1987} \begin{equation*} \lim_{N\to\infty} \beta_N = \lim_{M\to\infty} \alpha_M. \end{equation*} Rewriting $\frac{2\pi}{N}$ as $\frac{2\pi}{j} \frac{j}{N}=\frac{2\pi}{j} \rho$, the second series in \eqref{eqn:twoSeriesForJ} can be written as \begin{equation*} \zeta_j=\frac{1}{j} \sum_{k=0}^{j} \sin(\frac{2\pi}{j} \rho F_s k \tau),\quad j=p,2p,\ldots. \end{equation*} Then $\zeta_j$ is a subsequence of a sequence similar to $\{\alpha_M\}$ and consequently \begin{equation*} \lim_{j\to\infty} \zeta_j = \frac{1}{4\pi F_s \rho \tau} (1-\cos(2\pi F_s \rho \tau)), \quad \tau\neq 0 \end{equation*} Therefore, \eqref{eqn:twoSeriesForJ} converges. Substituting the limit in \eqref{eq:muDef}, we have \begin{align} &\mu_{ri}(\tau) = \begin{dcases} \frac{1}{4\pi F_s \tau} \left(\frac{1}{\rho}\cos(2\pi F_s \, \rho\,\tau)\!-\! \cos(2\pi F_s \tau)\right) & \tau\neq 0 \\ 0 & \tau=0 \end{dcases} \end{align} where the case of $\tau=0$ is trivial. \subsection{Convergence of $\sigma_{ri}^2$ to zero} Consider that \begin{align*} \left(h^{ri}_N(\mathbf{B},t_1,t_2)\right)^2 &=\frac{1}{N^2 \sigma_b^4} &\Bigg( \sum_{k=j}^{N-1} \Big[B_k^r \cos(\omega_k t_1) -B_k^i \sin(\omega_k t_1)\Big] \Big[B_k^r \sin(\omega_k t_2) -B_k^i \cos(\omega_k t_2)\Big] \Bigg)^2 \end{align*} where $B_k^r=\mathrm{Re}[B_k]$ and $B_k^i=\mathrm{Im}[B_k]$. By some manipulations which are omitted for the sake brevity, we have \begin{align} \mathbb{E} \left[\left(h^{ri}_N(\mathbf{B},t_1,t_2)\right)^2\right] =&\ \frac{1}{N^2 \sigma_b^4} \Bigg(\frac{\sigma_b^4}{4}\Big(\sum_{k=j}^{N-1} a_k \Big)^2 - \frac{\sigma_b^4}{4}\sum_{k=j}^{N-1} a_k^2 \nonumber \\ & + \gamma \sum_{k=j}^{N-1} \left[ \left(\cos(\omega_k t_1) \sin(\omega_k t_2)\right)^2 + \left(\cos(\omega_k t_2) \sin(\omega_k t_1)\right)^2\right] \nonumber \\ & - \frac{\sigma_b^4}{2} \sum_{k=j}^{N-1} \cos(\omega_k t_1) \cos(\omega_k t_2) \sin(\omega_k t_1) \sin(\omega_k t_2) \Bigg), \label{eq:EhriN2} \end{align} and $\gamma=\mathbb{E}[(B^r_k)^4]$. Notice that all summands in the four summations of \eqref{eq:EhriN2} are bounded. For instance, $\frac{1}{N^2} \sum_{k=j}^{N-1} a_k^2 \leq \frac{1}{N} A$ with $a_k^2\leq A$ for some $A \geq 0$. Consequently, the non-negative series $\frac{1}{N^2} \sum_{k=j}^{N-1} a_k^2$ converges to zero. By the same argument, the third and fourth summations in \eqref{eq:EhriN2} vanish in the limit too. That is, \begin{align} \lim_{N\to\infty} \mathbb{E}\left[\left(h^{ri}_N(\mathbf{B},t_1,t_2)\right)^2\right] =\lim_{N\to\infty} \Bigg(\frac{1}{2 N}\sum_{k=j}^{N-1} a_k \Bigg)^2. \end{align} It was already shown in derivation of $\mu_{ri}(\tau)$ that $\frac{1}{N}\sum_{k=j}^{N-1}a_k$ converges. Therefore, \cite{Rudin1987} \begin{align*} \lim_{N\to\infty} \Bigg(\frac{1}{2 N}\sum_{k=j}^{N-1} a_k \Bigg)^2 = \Bigg( \lim_{N\to\infty} \frac{1}{2 N}\sum_{k=j}^{N-1} a_k \Bigg)^2 =\Big(\mu_{ri}(\tau)\Big)^2. \end{align*} Finally, \begin{align} \sigma_{ri}^2&=\lim_{N\to\infty} \Bigg(\frac{1}{2 N}\sum_{k=j}^{N-1} a_k \Bigg)^2 - \Big(\mu_{ri}(\tau)\Big)^2=0. \label{eq:sigmaRIzero} \end{align} Consequently, we have shown that $R_{ri}(\mathbf{B},\tau)$ is an \emph{almost surely constant} random variable and $R_{ri}(\mathbf{B},\tau)=\mu_{ri}(\tau)$ with probability one. This completes the proof for $R_{ri}(\mathbf{B}, \tau)$. \subsection{$R_{rr}(\mathbf{B}, \tau)$ and $R_{ii}(\mathbf{B}, \tau)$} Similarly, for $R_{rr}(\mathbf{B}, \tau)$ we have \begin{align} h^{rr}_N(\mathbf{B},t_1,t_2)&= \mathbb{E} \left[\hat{u}_r(t_1, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j) \ \hat{u}_r(t_2, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)\right] =\frac{1}{N\sigma_b^2} \sum_{k=j}^{N-1} \mathrm{Re} \{b_k e^{i\omega_k t_1}\} \mathrm{Re} \{b_k e^{i\omega_k t_2}\} \nonumber \end{align} with \begin{align} \mu_{rr}(\tau)&= \lim_{N\to\infty} \mathbb{E}\left[h^{rr}_N(\mathbf{B},t_1,t_2)\right] \nonumber \\ &= \frac{1}{2}\lim_{N\to\infty} \frac{1}{N} \sum_{k=j}^{N-1} \cos(\omega_k \tau) \nonumber \\ &= \frac{1}{2}\left(\mathrm{sinc} (2F_s\tau)- \rho \mathrm{sinc} (2F_s\tau \rho)\right). \end{align} Following the steps taken to derive \eqref{eq:sigmaRIzero}, we have \begin{equation*} \sigma^2_{rr}= \lim_{N\to\infty} \mathbb{E}\left[\left(h^{rr}_N(\mathbf{B},t_1,t_2)\right)^2\right] - \left(\mu_{rr}(\tau)\right)^2=0, \end{equation*} which implies that $R_{rr}(\mathbf{B},\tau)=\mu_{rr}(\tau)$ with probability one and completes the proof. Finally, the derivations for $R_{ii}(\mathbf{B}, \tau)$ are identical to that of $R_{rr}(\mathbf{B}, \tau)$. \saeedDissertation{ For $R_{ii}(\tau)$ we have \begin{align*} h^{ii}_N(\mathbf{b},t_1,t_2)&= \mathbb{E} [u_i(t_1)u_i(t_2)] \\ &=\frac{1}{N} \sum_{k=0}^{N-1} \mathrm{Im} \{c_k e^{i\frac{2\pi}{N}F_s k t_1}\} \mathrm{Im} \{c_k e^{i\frac{2\pi}{N}F_s k t_2}\} \nonumber \end{align*} with \begin{align*} \mathbb{E}[h_{ii}(\mathbf{B},t_1,t_2)]&= \lim_{N\to\infty} \mathbb{E}[h^{ii}_N(\mathbf{B},t_1,t_2)] \\ &= \frac{\sigma_b^2}{2}\lim_{N\to\infty} \frac{1}{N} \sum_{k=j}^{N-1} \cos(\frac{2\pi}{N} F_s k \tau) \end{align*} which is the same as derivations for $R_{rr}(\tau)$ .} \saeedLater{Question: Would it not be simpler to go with $\mathbb{E}_\mathbf{C\odot\mathbf{X}}[]= \mathbb{E}_\mathbf{B} \mathbb{E}_\mathbf{X}[]$ from scratch?} \saeedLater{Triangular array} \bibliographystyle{IEEEtran} \section{Introduction} \saeed{we cannot show that $\mathbb{E}[u(t,\mathbf{c}\odot \mathbf{x}^\ast)]=0$. But simulations show it's good enough, no increase in the signal mean value, i.e. in turn its power. This is not now mentioned at all. if a reviewer asks for it, then a proof might be unreachable. I started a note in my notebook } \saeed{bring back dissertation and saeedLater comments once at least} \saeed{it's necessary to show that the begiining point in seach is not important! otherwise I even have to mentine dhwat $\mathcal{M}'$ I have used!} Orthogonal Frequency Division Multiplexing (OFDM) is a well-known multicarrier waveform which has been used in the major wireless communication systems. A main drawback of OFDM scheme is the high dynamic range of its signal envelope, which causes nonlinear distortion at the output of the power amplifier \cite{Pun2007}. In order to avoid the distortion, the so-called power back-off needs to be applied in the power amplifier. Consequently, the power amplifier operates with a low energy efficiency. Especially for mobile equipments where battery life is limited and power amplifiers cannot have a large linear range due to cost constraints, the problem is more pressing~\cite{Ekstrom2006}. It is therefore critical to reduce the required power back-off. The problem is commonly formulated as the minimization of a metric which captures the physical phenomenon and determines the power back-off. The classical metric is the ratio of the peak instantaneous signal power to the average power over consecutive signal segments referred to as Peak-to-Average-Power-Ratio (PAPR) \cite{Pun2007}. An alternative metric called Cubic Metric (CM), which is based on the energy in the nonlinear distortion, was more recently proposed and reported to predict the required back-off more accurately \cite{CMmotorola2004}. \saeedDissertation{ In evaluation of a distortion-less method for PAPR reduction, three factors are considered: rate loss, computational complexity and the reduction gain. When potentials of a novel method are being investigated, we look at the achievable reduction gain versus rate loss regardless of the complexity. Computational complexity becomes important when the method is considered for practical purposes. Then modifications are usually required for a lower complexity which might cause degradation in performance. That is, a trade-off in complexity versus reduction gain must be done for a specific rate loss. The new paradigm allows for choice of the intermediate metric as an extra degree of freedom in achieving better point in the reduction gain, complexity and rate loss space. In this paper all these three factors will be addressed. However, evaluation of the computational complexity depends on technologies and requirements of the day. Therefore, a sound treatment of this aspect requires a separate piece and type of work and we suffice to a crude evaluation. } The PAPR reduction problem has been tackled by several approaches, which can be broadly categorized into two groups. Methods based on deliberately introduced distortion constitute one category, with Clipping and Filtering \cite{armstrong2002} as a well-known example. The second category consists of the distortionless methods which typically provide PAPR reduction at the expense of some reserved resources which incurs rate loss, such as Selected Mapping (SLM) \cite{543811}, Tone Reservation (TR) and Tone Injection (TI) \cite{Tellado:2000}. The methods differ significantly at least in terms of reduction gain, rate loss, transmission power and complexity. A comparison of the pros and cons requires a separate study as provided, for instance, in \cite{1421929}. A refreshed and fundamental review of the problem is as well provided in \cite{gerhard2013SPM}. The CM reduction problem, on the other hand, has received limited attention compared to PAPR. In particular, very few of the already known methods from PAPR reduction research are examined for CM reduction, such as in~\cite{Behravan2011}, \cite{ZhuDescClip2013} and \cite{SiohanCM2006} for TR, Clipping and Filtering and SLM, respectively. It will be emphasized in this paper that CM has a more amenable mathematical structure, which indicates that there is room to improve on the performance and complexity of the back-off reduction problem by considering CM instead of PAPR, besides its reportedly higher accuracy. Sign Selection is a promising distortionless approach based on altering the signs of the data symbols to reduce the PAPR, which has shown potentials for considerable reduction performance at the price of a rate loss equivalent to one bit per complex data symbol for each utilized sign variable \cite{Sharif2004constantPMEPR, Afrasiabi2015derandomized,TellamburaGuidedSS2018,Sharif2009sign, tellamburaCrossEntropy2008}. Considering $N$ subcarriers, there are $2^N$ possible sign combinations, which implies an exponential complexity order for the optimal sign selection. This has motivated research for competing suboptimal solutions. Some proposals with noticeable performance include the application of the method of Conditional Probabilities in \cite{Sharif2004constantPMEPR, Afrasiabi2015derandomized}, a sign selection method guided by clipping noise in \cite{TellamburaGuidedSS2018}, a greedy algorithm in \cite{Sharif2009sign} and a cross-entropy-based algorithm in \cite{tellamburaCrossEntropy2008}. In this work, the method of Conditional Expectations (CE Method), originally proposed in fields of discrete mathematics and graph theory \cite{MitzenmacherUpfal2005}, is used to treat the Sign Selection problem to develop a simple algorithm with a competitive performance for both PAPR and CM reduction requiring only $\frac{N}{2}$ sign bits. The core idea of the CE method is to treat the optimization variables, i.e. the signs of the complex data symbols, as random variables. This artificial randomness is then employed to optimize the signs using conditional expectations. In addition to a direct application of the method to PAPR, a surrogate function referred to as Sum-Exp (SE) is proposed to gain indirect PAPR reduction. Unlike the other metrics, SE has no physical interpretation and is not directly related to power back-off. However, it will be shown that its reduction results in the reduction of the PAPR with lower complexity. The CE method is also applied to CM reduction, where the benefit of the mathematical tractability of CM in deriving low complexity closed-form expressions is demonstrated. As a rather uncommon characteristic among the solutions of the Sign Selection problem in the literature, an increasing reduction gain in PAPR and CM for increasing number of subcarriers is shown by simulations, which implies a roughly constant back-off for a large range of $N$. Furthermore, the CE method allows the analysis of the reduction performance by providing upper-bounds on reduced PAPR and CM values for any combination of the data symbols. \paragraph*{Notation} A random variable $X$ is distinguished from a realization $x$ by using upper and lower case letters, respectively. Vectors are shown by bold-face letters. For a vector $\mathbf{x}$, the notation $x_{m:n}$ is the compact form for $[x_m, x_{m+1},\ldots, x_n]$. The expected value of $Y$ with respect to the random variable $X$ is denoted by $\mathbb{E}_X[Y]$, where the subscript may be omitted if clear from the context. Cardinality of a set $\mathcal{S}$ is denoted by $|\mathcal{S}|$. \section{Preliminaries} \label{sec:pre} In this section, the OFDM signal model as well as the definitions of the metrics PAPR, SE and CM are first presented. Then the Sign Selection problem is formalized and discussed. \subsection{Signal Model} Consider an OFDM scheme with $N$ subcarriers. Let $\mathcal{M}$ be the set of the complex-valued constellation points. The data symbols that modulate the subcarriers are equiprobably and independently generated with zero mean, which implies that $\sum_{x\in\mathcal{M}} x=0$. Accordingly, the random vector $\mathbf{B}\in \mathcal{M}^N$ denotes the vector of data symbols in an OFDM symbol. Denoting the frequency separation of the first and the last subcarriers as $F_s$, the baseband continuous-time signal model for an OFDM symbol is \begin{equation} u(t, \mathbf{B})=\frac{1}{\sigma_b\sqrt{N}}\sum_{k=0}^{N-1} B_k e^{i \frac{2\pi}{N} F_s k t} \quad\quad t\in[0,T), \label{eq:ofdmContSymbolDef} \end{equation} where $T=\frac{N}{F_s}$ and the signal power is normalized by $\sigma_b=\sqrt{\mathbb{E}[|u(t,\mathbf{B})|^2]}$. With the sampling frequency $L F_s$, where $L> 1$ is the oversampling factor, the discrete-time signal model for an OFDM symbol is \begin{align} s (n, \mathbf{B})\!&= u(\frac{n}{L F_s},\mathbf{B}) =\!\frac{1}{\sigma_b \sqrt{N}}\sum_{k=0}^{N-1} \!B_k e^{i \frac{2\pi}{LN} k n} \ \ n=0,1,\ldots, LN\!-\!1. \label{eq:ofdmSymbolDef} \end{align} The oversampling is necessary for reliable measurement of PAPR and CM from the discrete-time signal~\cite{WunderPeakValue2003, KimCubicMetric2016}. \subsection{Peak to Average Power Ratio (PAPR)} \begin{definition} The PAPR metric is a function of the random data vector $\mathbf{B}\in\mathcal{M}^N$ and is defined as \begin{equation} \theta_N(\mathbf{B}) = \max_{n=0,1,\ldots,LN-1} |s(n,\mathbf{B})|^2, \label{eqn:PAPRdef} \end{equation} where $s(n,\mathbf{B})$ is given in \eqref{eq:ofdmSymbolDef} and $L >1$ is the oversampling factor. \end{definition} It will be seen that the maximum operator in the definition of the PAPR makes the required derivations of the CE Method difficult. Here we propose the Sum-Exp (SE) metric, which will be shown to be a suitable objective function to replace PAPR such that a desirable indirect PAPR reduction is gained by SE reduction. \begin{definition} The SE metric is a function of the random data vector $\mathbf{B}\in\mathcal{M}^N$ and is defined as \begin{align} \zeta_N(\mathbf{B})= \sum_{n=0}^{LN-1} e^{\kappa |s(n,\mathbf{B})|^2}, \label{eqn:SEdef} \end{align} where $s(n,\mathbf{B})$ is given in \eqref{eq:ofdmSymbolDef}, $\kappa\geq 1$ is an adjustable parameter and $L >1$ is the oversampling factor. \end{definition} \saeedDissertation{best text found so far is the note ``Basic properties of the soft maximum" by John Cook} The SE metric is obtained from the \emph{log-sum-exp} function of the squared magnitude of the signal samples, i.e. $\log \sum_{n=0}^{LN-1} e^{|s(n,\mathbf{B})|^2}$, which is a well-known approximation of the maximum function \cite{Boyd} since \begin{align*} \max_{i=0,\ldots,LN-1} |s(n,\mathbf{B})|^2 \leq \log \sum_{i=0}^{LN-1} e^{|s(n,\mathbf{B})|^2} \leq \max_{i=0,\ldots,LN-1} |s(n,\mathbf{B})|^2 + \log LN. \end{align*} The first inequality is strict unless $LN=1$ and approaches an equality as the maximum becomes larger relative to the rest of the samples, while the second inequality holds when all values are equal. That is, the approximation improves when the spread of the amplitudes of the signal samples is larger. Therefore, high ratio of the peak power to the average power of the OFDM signal implies that log-sum-exp is likely to be an acceptable approximation for PAPR. Furthermore, it motivates the introduction of the scaling factor $\kappa \geq 1$ to modify the log-sum-exp function as $\frac{1}{\kappa}\log \sum_{i=0}^{LN-1} e^{\kappa|s(n,\mathbf{B})|^2}$ to increase the spread. The SE metric is obtained from the modified log-sum-exp function by omitting the monotonically increasing $\log$ function as well as the constant~$\kappa^{-1}$. \saeedDissertation{ this LSE is no more an approximation of the PAPR. But it keeps a good correlation in a scatter plot. That might be the way to justify that the algorithm finally works. } \subsection{Cubic Metric (CM)} CM \cite{CMmotorola2004} is based on the assumption of a third-order (cubic) polynomial model for the input-output relation of the power amplifier. That is, the output signal $v_o(t)$ for a passband input signal $v(t)$ is assumed to be \begin{equation*} v_o(t)=g_1 v(t) + g_3 v^3(t), \quad t\in\mathbb{R}, \end{equation*} where the linear gain $g_1$ and the non-linear gain $g_3$ are constant and related to the amplifier design. While PAPR is based only on the peaks of the instantaneous power, CM directly captures the energy in the distortion term $v^3(t)$ and is calculated as \begin{equation*} \mathrm{CM}_\mathrm{dB}= \frac{\mathrm{RCM}_\mathrm{dB}[v(t)]-\mathrm{RCM}_\mathrm{dB}[v_\mathrm{ref}(t)]}{K_\mathrm{slp}}+K_\mathrm{bw}, \end{equation*} where the subscript $\mathrm{dB}$ refers to the value in logarithmic scale and the Raw Cubic Metric (RCM) of a signal is defined as \begin{equation} \mathrm{RCM}_\mathrm{dB}[v(t)]= 20 \log_{10}\left( \mathrm{rms}\!\left[\left(\frac{v(t)}{\mathrm{rms}[v(t)]}\right)^3 \right]\right). \label{eqn:RCMdef} \end{equation} The reference signal $v_\mathrm{ref}(t)$, the slope factor $K_\mathrm{slp}$ and the bandwidth scaling factor $K_\mathrm{bw}$ \cite{CMmotorola} are independent of $v(t)$ and are not discussed here. The Root Mean Square (RMS) of a signal $v(t)$ over a large enough interval $U\subset \mathbb{R}$ is $\mathrm{rms}[v(t)]=\sqrt{\frac{1}{U} \int_U v^2(t) dt}$. Consider that reduction of CM for $v(t)$ is essentially equivalent to reduction of its RCM. In addition, CM and RCM are constants calculated for the whole continuous-time passband signal, whereas practical reduction algorithms operate over individual discrete-time baseband OFDM symbols. Therefore, the discrete-time baseband version of the RCM of an OFDM symbol is actually used for CM reduction, as done in \cite{Behravan2011,ZhuDescClip2013,SiohanCM2006}, which is referred to as Symbol RCM (SRCM) in this paper. \begin{definition} SRCM is a function of the random data vector $\mathbf{B}\in\mathcal{M}^N$ and is defined as \begin{align} \eta_{\scriptscriptstyle N}(\mathbf{B})=\frac{1}{LN} \sum_{n=0}^{LN-1} |s(n,\mathbf{B})|^6, \label{eqn:SRCM} \end{align} where $s(n,\mathbf{B})$ is given in \eqref{eq:ofdmSymbolDef} and $L>1$ is the oversampling factor. \end{definition} \saeedDissertation{a new note as a picture in the same folder about the passband to baseband conversion. saying that we should filter out the harmonics} In order to show the relation of RCM and SRCM, we shall first briefly discuss the baseband representation of $v^3(t)$. Let the baseband equivalent representation of $v(t)$ be $h(t)=\sum_{m=-\infty}^{\infty} u(t-mT,\mathbf{B}_m)$ as a function of complex data symbols $\mathbf{B}_m\in\mathcal{M}^N$ pertaining to consecutive OFDM symbols. By a suitable choice of the normalization factor, it follows from the standard procedure of passband to baseband conversion \cite{Benedetto1999} that $\mathrm{rms}[v(t)]=\mathrm{rms}[|h(t)|]= 1$. \saeedDissertation{technically it's not an equality as rms was not defined as ensemble average} Ignoring the scaling factors, it can as well be shown that $h^\ast(t)|h(t)|^2$ is the baseband representation of the frequency component of $v^3(t)$ at the carrier frequency \cite{Benedetto1999}, where $h^{\ast}(t)$ is the complex conjugate of $h(t)$. Consequently, $\mathrm{RCM}[v(t)]=(\mathrm{rms}[v^3(t)])^2=A \left(\mathrm{rms}[|h(t)|^3]\right)^2$ for some scalar $A$ gives the RCM in terms of the baseband continuous signal. Next, the discrete-time version of $h(t)$ is $h(n)= \sum_{m=-\infty}^{\infty} s(n-mLN,\mathbf{B}_m)$. Replacing the summation with an integral in calculation of the RMS of a discrete-time signal, we have $\mathrm{rms}[|h(t)|^3]\simeq \mathrm{rms}[|h(n)|^3]$ given adequate oversampling. Finally, RCM can be written as \begin{align} \mathrm{RCM}[v(t)]&\simeq \lim_{K\to\infty} \frac{1}{K} \sum_{n=0}^{K} |h(n)|^6 \nonumber \\ &= \lim_{M\to\infty} \frac{1}{2MLN}\sum_{m=-M}^{M-1} \sum_{n=0}^{LN-1}|s(n-mLN,\mathbf{B}_m)|^6 \nonumber \\ &= \lim_{M\to\infty} \frac{1}{2M}\sum_{m=-M}^{M-1} \eta_{\scriptscriptstyle N}(\mathbf{B}_m). \label{eqn:RCM-SRCM} \end{align} Therefore, RCM of the OFDM signal is the average of the SRCM values of the underlying OFDM symbols. \saeedDissertation{ \begin{align} \mathrm{RCM}[v(t)]&\simeq \mathbb{E} [\eta_{\scriptscriptstyle N}(\mathbf{B})], \end{align} The equation follows from the independence of the data vectors $\mathbf{B}_m$. \saeedDissertation{CM was proposed \cite{CMmotorola2004} when signals more complicated than the voice signals were required to be handled by the transmitter. It was reported that CM predicts the required power de-rating better than PAPR. Application of the polynomial model for the input-output relationship of a nonlinear device is well-known, as well as the fact the major part of the nonlinear distortions added to the amplified signal is due to the third order term in this model. Namely, the cubic polynomial model for output of the power amplifier for the input passband signal $v(t)$ is $v_o(t)=g_1 v(t) + g_3 v^3(t)$, where the linear and non-linear gains are constant and dependent only on the amplifier design.} \saeedDissertation{To make the reduction algorithm applicable to the metric, firstly it must be rewritten in baseband discrete-time domain. Let $u(t)$ in \eqref{eq:ofdmContSymbolDef} be the baseband equivalent of $v(t)$, i.e., $v(t)=\sqrt{2}\mathrm{Re}\{u(t)e^{2\pi F_c t}\}$. It can be shown that $\frac{3}{\sqrt{2}^3}u(t)|u(t)|^2$ is the baseband equivalent of $v^3(t)$. \saeedDissertation{ find my notes in the same folder.} This representation ensures that the energy in the baseband equivalent and the passband signal is the same.} \saeedDissertation{Note that $\tilde{v}_\mathrm{rms}$ cannot be generally omitted as it depends on the the changes to the signal segment. But in the case of sign changes $\frac{1}{T}\int_0^T |\tilde{v}(t)|^2$ remains unchanged. but considering its role it might be redundant in general. hum?} \subsection{The Sign Selection Problem} As introduced before, Sign Selection refers to altering the signs of the data symbols in an OFDM symbol in order to reduce a desired metric, such as PAPR and CM. Therefore, for the constellation $\mathcal{M}$, $\log_2 |\mathcal{M}|-1$ bits per transmitted data symbol carry information and one bit is determined by the adopted Sign Selection algorithm. To perform the bit-to-symbol mapping in the transmitter, initially consider taking independently and equiprobably distributed random sign bits to complete the $\log_2 |\mathcal{M}|$-bit blocks. This formulation helps analytical derivations in later sections and will be shortly shown not to affect the solution. For the resulting vector of complex data symbols $\mathbf{b}\in\mathcal{M}^N$, the Sign Selection approach seeks a solution $\mathbf{x}^\ast$ for the problem \begin{equation} \min_{\mathbf{x}\in\{-1,1\}^N} f(\mathbf{b}\odot\mathbf{x}), \label{eqn:optimizationProblem} \end{equation} where $f(\cdot)\geq 0$ is a metric defined on the OFDM symbol and $\odot$ denotes element-wise multiplication of vectors. Accordingly, $\mathbf{b}\odot\mathbf{x}^\ast$ will be the transmitted symbols. Considering that the solution space of~\eqref{eqn:optimizationProblem} grows exponentially with $N$, the objective of this paper is to derive an efficient algorithm to obtain a suboptimal solution. \begin{figure}[t] \centering \includegraphics[width=0.3\columnwidth]{constChoice} \caption{A non-unique choice of $\mathcal{C}$ from $\mathcal{M}$ for the 16-QAM constellation.} \label{fig:choiceOfConst} \end{figure} Now we justify that the random sign bits used to complete the $\log_2 |\mathcal{M}|$-bit blocks do not alter the minimization problem. Assume that the constellation $\mathcal{M}$ is symmetric such that for each point $y\in\mathcal{M}$, the negated value $-y$ is in the set. Let $\mathcal{C}\subset\mathcal{M}$ be a non-unique choice of $\frac{|\mathcal{M}|}{2}$ points of $\mathcal{M}$ such that if $y\in\mathcal{C}$, then $-y\notin\mathcal{C}$. A sample choice of $\mathcal{C}$ for 16-QAM is shown in Fig.~\ref{fig:choiceOfConst}. For every $\mathbf{c} \in \mathcal{C}^N$, let $\Omega_\mathbf{c}=\{\mathbf{c} \odot \mathbf{x}, \mathbf{x}\in\{-1,1\}^N\}$. The space of the data vectors $\mathcal{M}^N$ can be partitioned into the sets $\Omega_\mathbf{c}$ for $\mathbf{c}\in\mathcal{C}^N$ such that \begin{equation} \mathcal{M}^N=\cup_{\mathbf{c}\in\mathcal{C}^N}\ \Omega_\mathbf{c} \end{equation} and $\Omega_\mathbf{c} \cap \Omega_{\mathbf{c}'}=\varnothing$ when $\mathbf{c}\neq \mathbf{c}'$. Therefore, every $\mathbf{b}$ in \eqref{eqn:optimizationProblem} belongs to a partition $\Omega_\mathbf{d}$ such that $\mathbf{d}\in\mathcal{C}^N$ and $\mathbf{b}=\mathbf{d}\odot\mathbf{v}$ for some $\mathbf{v}\in\{-1,1\}^N$. Having all possible sign vectors as the solution space, it is clear that the Sign Selection problem always seeks the minimum of the partition which contains $\mathbf{b}$. Formally, $\min_{\mathbf{x}\in\{-1,1\}^N} f(\mathbf{b}\odot\mathbf{x})=\min_{\mathbf{x}\in\Omega_\mathbf{d}} f(\mathbf{x})$ for every $\mathbf{b}\in\Omega_\mathbf{d}$. Notice that although the starting vector $\mathbf{b}\in\Omega_\mathbf{d}$ does not affect the solution of~\eqref{eqn:optimizationProblem} for the partition $\Omega_\mathbf{d}$, it may change the suboptimal solution provided by a proposed algorithm. The (bit-to-)symbol mapping in the transmitter and the decoding in the receiver are based on a predetermined $\mathcal{C}$. On the transmitter side, the data symbols are obtained by mapping $\log_2 |\mathcal{M}|-1$ bits to a point in $\mathcal{C}$. On the receiver side, the decoding of the symbol of each subcarrier is performed by choosing $c\in\mathcal{C}$ when one of $\pm c\in\mathcal{M}$ is detected and reversing the symbol mapping accordingly. Notice that the decoding adds no complexity to the receiver. Besides, the choice of $\mathcal{C}$ plays a role only in the symbol mapping and decoding and is otherwise immaterial to the Sign Selection problem. Particularly, it can be shown that the partitioning described before is independent of $\mathcal{C}$. \saeedDissertation{\begin{proof} (i) Let $\mathbf{b}_i=[b_{11} b_{12} \ldots b_{1N}]^T\in\mathcal{M}'^N$. For any $\mathbf{b}_j\neq \mathbf{b}_i$, at least for one element we have $b_{iq}\neq b_{jq}$ and by definition, $b_{iq}\neq-b_{jq}$. Therefore, there exists no choice of $\mathbf{x}_1,\mathbf{x}_2\in\{-1,1\}^N$ such that $b_{iq} x_{1q}=b_{jq} x_{2q}$. Therefore, $\mathbf{b}_i \odot \mathbf{x}_1\neq \mathbf{b}_j \odot \mathbf{x}_2$ for all $\mathbf{x}_1,\mathbf{x}_2\in\{-1,1\}^N$, which means that $\Omega_i \cap \Omega_j=\emptyset$. (ii)$|\Omega|=|\mathcal{M}|^N$ and $|\Omega_i|=2^N$ for all i's. $|\cup_i \Omega_i|=\sum_i |\Omega_i|=|\mathcal{M}'|^N 2^N=|\Omega|$. \end{proof}} \saeedDissertation{The pairings in M are fixed. There are simply $|\mathcal{M}|/2$ of them. Choice of $M'$ is only important for the decoding, so we know with which data symbol a pair is associated. So the solution is independent of the choice of M'. This is a property of the sign selection problem! and it doesn't say it's indept of the data vector in the partition. so make the problem statement based on b. define M' after that! this way I can remove the c thing totally! you also mention in the bit to symbol mapping that we indeed choose M' and have a c there. then it's like we did another coin flip to get the b. which changes the initial point in the partition. it'll be seen in the CE method that it does not depend in the initial point. but this can't be said in general} \saeedDissertation{we finally need to work with the problem $\min \ f(\mathbf{b}\odot\mathbf{x})$ so that lemma 1 works! but in the general case of algorithm I and any any objective function $f$ that gives the suboptimal solution $\mathbf{x}^\ast$ for the problem $\min \ f(\mathbf{c}\odot \mathbf{x})$ and $\mathbf{y}^\ast$ for the problem $\min \ f(\mathbf{c}\odot \mathbf{v} \odot \mathbf{y})$ for any $\mathbf{v}$, we cannot say that $f(\mathbf{c}\odot \mathbf{v} \odot \mathbf{y})= f(\mathbf{c}\odot \mathbf{x})$. can we? I'm not sure. so skip and do the proof for the specific solution given by the CE method later when it is presented. after a few hours of confusion, which might have been stupid, I couldn't show it for the CE method too! that is, I can't show that changing the beginning point does not affect the decision rules or the final reduced value! The other solution was to deal with the problem directly in proof of lemma 1. again I couldn't show an equivalent. the problem is basically with the expectation. So made a trick. looks good. :D maybe the same trick could solve the previous problems iwth the proof too!} \saeedDissertation{ It turned out that it holds by simulation that the mean of the signal is roughly zero. There is a section on it in the code (v4). The remark below is nonsense as the CE method ignores any sign previously assigned. it is not clear if we can prove that $\mathbb{E}[C_k X^\ast_k(\mathbf{C}]=0$. Anyways note that $X^\ast_k$ is a function of all data symbols $\mathbf{C}$ and not only $C_k$. This is an issue for other sign selection methods too, it's basically not addressed! \begin{remark} \saeed{revise}Consider the bit to symbol mapping outcome as $\mathbf{c}\in\mathcal{M}'^N$. It will be seen later that it is convenient to have the outcome in the zero-mean space $\mathcal{M}^N$\saeed{spot and mention where}. This can be seen as an extra coin flip for each data symbol: $\mathbf{C}=\mathbf{c}\odot \mathbf{V}$ where $\mathbf{V}\in\{-1,1\}^N$, which is merely a random change in initial point in the search space.\saeed{not in search space!} Then $\mathbf{v}\odot\mathbf{x}^\ast$ is the solution for $\mathbf{c}$. \saeedLater{this was far more elaborated in early versions} \end{remark}} As the final comment, sign selection clearly incurs rate loss. Consider the generalized scheme where $N_s\leq N$ signs are used in the sign selection. That is, $N_s$ data symbols carry $\log_2 |\mathcal{M}|-1$ bits of information and the remaining $N-N_s$ data symbols are mapped from $\log_2 |\mathcal{M}|$ bits to $\mathcal{M}$. The incurred amount of rate loss, i.e. the ratio of the bits used for Sign Selection to the total number of bits in an OFDM symbol, is \begin{align} R= \frac{N_s }{N \log_2 |\mathcal{M}|} = \frac{N_s}{N} \log_{|\mathcal{M}|} 2. \label{eqn:rateLoss} \end{align} Evidently, the rate loss is inversely proportional to the constellation size $|\mathcal{M}|$. \saeedLater{How do we know that $\mathbb{E}[s(t,\mathbf{C}\odot \mathbf{x}^\ast(\mathbf{C}))]=0$ and how necessary is it? Elaborate in report 8.} \section{Method of Conditional Expectations} \label{sec:algorithm} The CE Method \saeed{spencer?}\cite{MitzenmacherUpfal2005} is represented here for obtaining a suboptimal solution to the Sign Selection problem for reduction of an arbitrary metric $f(.)\geq 0$. For a given data vector $\mathbf{b}\in\mathcal{M}^N$, a random vector of sign variables $\mathbf{X}\in \{-1,1\}^N$ is initially assumed with equiprobable and independent elements, which are then sequentially decided and fixed. Consider the $j^\mathrm{th}$ iteration where the random signs $X_{0:j-1}$ are fixed to $x^\ast_{0:j-1}$. The expected values of $f(\mathbf{b}\odot\mathbf{X})$ conditioned on $X_{0:j-1}=x^\ast_{0:j-1}$ with $X_j=1$ and $X_j=-1$ are compared and the sign that yields the smaller expectation is chosen as $x_j^\ast$. Formally, a sub-optimal solution to the minimization problem stated in \eqref{eqn:optimizationProblem} can be obtained by sequentially choosing the sign variables as \begin{align} x_j^\ast &= \begin{cases} \underset{x_0\in\{\pm1\}}{\mathrm{arg\ min}} \ \mathbb{E} [f(\mathbf{b}\odot\mathbf{X})|X_0=x_0] & j=0 \\ \underset{x_j\in\{\pm1\}}{\mathrm{arg\ min}} \ \mathbb{E} [f(\mathbf{b}\odot\mathbf{X})|X_{0:j-1}=x^\ast_{0:j-1},X_j=x_j] & j=1,\ldots,N-1. \end{cases} \label{eqn:CEGeneralRule} \end{align} The decision rule given in \eqref{eqn:CEGeneralRule} is based on introducing random sign variables and then reducing the conditional expectation of the original objective function. The justification that~\eqref{eqn:CEGeneralRule} leads to a desirable suboptimal solution of \eqref{eqn:optimizationProblem} is explained partly here for the general metric $f$ and will be concluded in Section~\ref{sec:analysis} for PAPR and SRCM. For the $j^\mathrm{th}$ sign decision, let \begin{equation} g_j^\pm(\mathbf{b})= \begin{cases} \mathbb{E} [f(\mathbf{b}\odot\mathbf{X})|X_0=\pm1] & j=0 \\ \mathbb{E} [f(\mathbf{b}\odot\mathbf{X})|X_{0:j-1}=x^\ast_{0:j-1},X_j=\pm1] & j=1\ldots,N-1. \end{cases} \label{eqn:gDefinition} \end{equation} Following the decision criterion in \eqref{eqn:CEGeneralRule}, we have \begin{align*} \mathbb{E} &[f(\mathbf{b}\odot\mathbf{X})|X_{0:j} =x^\ast_{0:j}]=\min\ \{g_j^+(\mathbf{b}), g_j^{-}(\mathbf{b})\}, \end{align*} whereas for the $(j-1)$-th step with $j\geq1$, it holds that \begin{align*} \mathbb{E} [f(\mathbf{b}\odot\mathbf{X}) | X_{0:j-1}=x^\ast_{0:j-1}] &=g_j^+(\mathbf{b}) \mathbb{P}(X_j=1|X_{0:j-1}=x^\ast_{0:j-1}) \nonumber \\ & \quad \quad \quad \quad +g_j^-(\mathbf{b}) \mathbb{P}(X_j=-1|X_{0:j-1}=x^\ast_{0:j-1}) \nonumber \\ & =g_j^+(\mathbf{b}) \mathbb{P}(X_j=1) + g_j^-(\mathbf{b}) \mathbb{P}(X_j=-1) \nonumber \\ & =\frac{1}{2}(g_j^+(\mathbf{b}) + g_j^-(\mathbf{b})) \nonumber \\ & \geq \min\{g_j^+(\mathbf{b}) , g_j^-(\mathbf{b})\}. \end{align*} Therefore, \begin{equation*} \mathbb{E}[f(\mathbf{b}\odot\!\mathbf{X})|X_{0:j}\!=\!x^\ast_{0:j}]\!\leq\! \mathbb{E}[f(\mathbf{b}\odot\!\mathbf{X})|X_{0:j-1}\!=\!x^\ast_{0:j-1}] \end{equation*} for $j=1,\ldots, N-1$. This shows that for a given $\mathbf{b}$, the non-increasing sequence of the conditional expectations begins with the \emph{initial expectation} $\mathbb{E}_\mathbf{X}[f(\mathbf{b}\odot\mathbf{X})]$ and ends with $f(\mathbf{b}\odot\mathbf{x}^\ast)=\mathbb{E} [f(\mathbf{b}\odot\mathbf{X})|\mathbf{X}=\mathbf{x}^\ast]$ where no randomness is left. That is, the last conditional expectation coincides with a metric value such that \begin{align} f(\mathbf{b}\odot\mathbf{x}^\ast) \leq \mathbb{E}_\mathbf{X}[f(\mathbf{b}\odot\mathbf{X})]. \label{eqn:CEguarantee} \end{align} \saeed{present this as a lemma?} This justifies that the decision criterion given in \eqref{eqn:CEGeneralRule} leads to a value of the original metric $f$ with the property stated above. Proving the reduction and the upper-bound on the reduced values is not known for the general case of the arbitrary metric $f$ and will be treated in Section~\ref{sec:analysis} specifically for PAPR and CM. Calculation of the conditional expectations required at each step is a major step in development of the algorithm and will be discussed in Section~\ref{sec:CE-calc}. \saeedDissertation{say that we simply set $x^\ast_{0:N_f-1}$ as the sign of data symbols taken from $\mathcal{M}'$. this will hopefully keep a good consistency throughout the paper. then update the inequality guaranteed by the CE method to one which includes $N_f$.} \saeedDissertation{do some work on the location of the signs, at least first or second half of subcarriers and their equivalence. } \saeedDissertation{ \begin{lemma} The solution is independent of the initial data vector in a partition. is this a property of the sign selection problem or the CE Method? I guess we can't claim that this is a property of any suboptimal solution of the SS problem. But it is a common property of the methods I know now. This is important as it determines where this lemma should be put. \end{lemma} from this lemma we need: 1) the decision rule, hence the CEs, updated using a given data vector which is from M and not M'. so we can do the proofs. NO we are okay with the updated SS problem. this is good to mention as a property. Finally I decided I don't use the lemma anywhere and I don't have time to write it :D the original problem in proof of Lemma1 is solved by the reformulation the SS problem} \section{Calculation of the Conditional Expectations} \label{sec:CE-calc} For a given vector of data symbols $\mathbf{b}$, the decision for $x^\ast_j$ requires calculation of $g^\pm_j(\mathbf{b})$ in~\eqref{eqn:gDefinition} which is compactly rewritten as \begin{align} g_j^\pm(\mathbf{b})=\mathbb{E} [f(\mathbf{b}\odot\mathbf{Y}^\pm_j)], \label{eqn:gDef2} \end{align} where \begin{equation*} \mathbf{Y}^\pm_j=[x^\ast_0,x^\ast_1,\ldots,x^\ast_{j-1},\pm1,X_{j+1},\ldots,X_{N-1}]^T \end{equation*} encapsulates the decided signs, the new sign variable set to $+1$ or $-1$ and the remaining random sign variables. The obvious way of calculating the conditional expectations for practically any metric $f$ is to use the empirical average $\hat{g}^\pm_j(\mathbf{b},\mathbf{X}^{1:Q})$ to estimate $g_j^\pm(\mathbf{b})$, which is \begin{equation} \hat{g}^\pm_j(\mathbf{b},\mathbf{X}^{1:Q})=\frac{1}{Q} \sum_{l=1}^{Q} f\left(\mathbf{b}\odot \psi_{j}^\pm(\mathbf{X}^l)\right) \label{eq:estimatorGeneral} \end{equation} where $Q$ is the number of realizations of the random sign vector used for the estimation and \begin{equation} \psi_{j}^\pm(\mathbf{X}^l)=[x_0^\ast, \ldots, x_{j-1}^\ast, \pm 1, X^l_{0}, \ldots, X^l_{N-j-2}]^T, \label{eq:psiDef} \end{equation} where the random variables $X^l_k\in\{-1,1\}, l=1,2,\ldots,Q, k=0,1,\ldots,N-j-2$ are independent and equiprobable. Deriving more efficient ways of calculating the conditional expectations $g^\pm_j(\mathbf{b})$ is a pivotal part of the proposed method. The PAPR metric does not lend itself well to mathematical manipulations to obtain closed-form expressions. Consequently, the conditional expectations are estimated by the sample average as in~\eqref{eq:estimatorGeneral}, which will be further discussed. On the contrary, the definitions of SRCM and SE together with the statistical properties of the signal samples $s(n,\mathbf{b}\odot\mathbf{Y}^\pm_j)$ make it possible to derive closed-form expressions for $g^\pm_j(\mathbf{b})$. These results depend on convergence of the signal samples in distribution to a Gaussian random variable, proof of which is not trivial due to the specific signal model imposed by the Sign Selection problem. This will be clarified in the second part of this section before treating the calculations for SE and SRCM. \subsection{PAPR metric} \label{sec:PAPR} As mentioned before, the available method for calculation of the conditional expectations of PAPR is to perform estimation as specified in~\eqref{eq:estimatorGeneral}. It is apt to study the estimator in terms of a relation between the amount of the required numerical computations, which is proportional to $Q$, and the performance. Although such analysis for PAPR was not reached, authors have presented interesting results in \cite{afrasiabiWSA2016} for the closely related metric \begin{equation} \phi_N(\mathbf{b}) = \sqrt{\theta_N(\mathbf{b})}, \end{equation} which is referred to as Crest Factor (CF). This is a valid alternative as firstly CF has the same physical meaning and practical significance and secondly its relation with PAPR is monotonically increasing. In addition, simulations show almost identical PAPR reduction gained by reduction of CF. Accordingly, consider $g_j^\pm(\mathbf{b})$ in \eqref{eqn:gDef2} for $f(\mathbf{b}\odot\mathbf{Y}^\pm_j)=\phi_N(\mathbf{b}\odot\mathbf{Y}^\pm_j)$. The sample average with $Q$ realizations of the sign vector is \begin{equation} \hat{g}^\pm_j(\mathbf{b},\mathbf{X}^{1:Q})=\frac{1}{Q} \sum_{l=1}^{Q} \phi_N\left(\mathbf{b}\odot \psi_{j}^\pm(\mathbf{X}^l)\right) \label{eq:estimator} \end{equation} where $\psi_{j}^\pm(\mathbf{X}^l)$ and the random vectors $\mathbf{X}^l, l=1,2,\ldots,Q$ were defined in \eqref{eq:psiDef}. \saeedDissertation{our results are for using same sign samples for both, otherwise it's considerably poorer for large N!} It is clear that $\mathbb{E}[\hat{g}^\pm_j(\mathbf{b},\mathbf{X}^{1:Q})]=g^\pm_j(\mathbf{b})$. Consequently, $\lim_{Q\to\infty} \hat{g}^\pm_j(\mathbf{b},\mathbf{X}^{1:Q})=g^\pm_j(\mathbf{b})$ as the variance of $\theta_N(\mathbf{b}\odot \psi_{j}^\pm(\mathbf{X}^l))$ is finite. \saeedDissertation{, although not known for finite $N$. saeed: but would having the variance do good characterisation?} In order to obtain a relation between the reliability of the estimation and $Q$, McDiarmid's concentration inequality \cite{mcdiarmid1998} was employed to bound the probability of deviation of the estimate from its true value as stated in the following theorem \cite{afrasiabiWSA2016}. \saeedDissertation{Concentration inequalities have as well been shown to be useful for characterizing ... in [].} The proof is provided in Appendix~\ref{app:mcdiarmidProof} for completeness. \saeed{think about verifying the theorem by simulation in the last section} \begin{theorem} \label{thm:mcdiarmid} Consider the sample average $\hat{g}^{\pm}_j(\mathbf{b}, \mathbf{X}^{1:Q})$ given in~\eqref{eq:estimator} as an estimate of the conditional expectation $g^{\pm}_j(\mathbf{b})$ given in~\eqref{eqn:gDef2} with $f(\mathbf{b}\odot\mathbf{Y}^\pm_j)=\phi_N(\mathbf{b}\odot\mathbf{Y}^\pm_j)$. For any $\mathbf{b}\in\mathcal{M}^N$ and $\epsilon\geq 0$, \begin{equation*} \mathbb{P} (|\hat{g}^{\pm}_j(\mathbf{b},\mathbf{X}^{1:Q})- g^{\pm}_j(\mathbf{b}) |\geq \epsilon) \leq 2 \exp\!\left(\!-2\epsilon^2\frac{ Q}{d^2} \frac{N}{(N-j-1)}\right), \label{eq:estimation-deviation} \end{equation*} where $d=2 \sigma_b^{-1}\max_{x\in\mathcal{M}} |x|$. \end{theorem} An interesting result of Theorem~\ref{thm:mcdiarmid} is that the upperbound on the probability of deviation is independent of $N$. This is further clarified as follows. A lower bound on the required $Q$ which guarantees the probability of deviation by $\epsilon$ from the true value to be less than $p$ can be deduced within the context of Theorem~\ref{thm:mcdiarmid} as \begin{align*} Q_\circ &= -\frac{d^2 \log \frac{p}{2}}{2\epsilon^2} \frac{N-j-1}{N}. \end{align*} In particular, it indicates that $Q_\circ$ is proportional to the ratio of the number of the remaining sign variables to the total number of them. Equivalently, \begin{align} Q_\circ &\approx -\frac{d^2 \log \frac{p}{2}}{2\epsilon^2} (1-\rho), \label{eqn:Qrel} \end{align} where $\rho=\frac{j}{N}$ and the approximation is due to $\frac{N-1}{N}\approx 1$ for large $N$. However, establishing a connection between the probability of error in sign decision and $Q$ is challenging and needs further research. \saeedDissertation{It can be seen that the relation of $Q$ with $p^{-1}$ is logarithmic, making it rather insensitive to it. The major component is $\epsilon$. However, using the relation to obtain probability of error in sign decisions as a function of $Q$ is a tedious task, since for instance no information is available on $g^+_j-g^-_j$.} \saeedDissertation{ Remainder of this section not clear to be useful. The above analysis on the estimations can be related to sign decision as follows. Without loss of generality, assume that $g_{j}^{+}(\mathbf{b}) <g_{j}^{-}(\mathbf{b})$ and let $g_{j}^{\ast}(\mathbf{b})=g_{j}^{+}( \mathbf{b})$ denote the lower expectation, i.e. the one belonging to the desired sign. The other case follows from re-labeling. Furthermore, let $\hat{g}_{j}^{\ast}\left( \mathbf{b}\right) =\min\{\hat{g}_{j}^{+}\left( \mathbf{b}\right) ,\hat{g}_{j}^{-}\left( \mathbf{b}\right) \}$. Here we show that the following bound holds for $\alpha\geq 0$.% \begin{align} \mathbb{P}\left( \left\vert \hat{g}_{j}^{\ast}\left( \mathbf{b}\right) -g_{j}^{\ast}\left( \mathbf{b}\right) \right\vert \geq\alpha\right) \! < \!4 \exp\!\left(\!-\alpha^2\frac{2 Q}{d^2_{\max}} \frac{N}{(N-j)}\right) \end{align} Assume that $|\hat{g}_{j}^{\pm}\left( \mathbf{b}\right) -g_{j}^{\pm}\left(\mathbf{b}\right) |<\alpha$. There are two cases: \begin{enumerate} \item $\hat{g}_{j}^{+}\left( \mathbf{b}\right) \leq\hat{g}_{j}^{-}\left( \mathbf{b}\right) $: here the estimates follow the true order so that $\hat{g}_{j}^{\ast }\left( \mathbf{b}\right) =\hat{g}_{j}^{+}\left( \mathbf{b}\right) $. Hence% \[ g_{j}^{\ast}\left( \mathbf{b}\right) -\alpha<\hat{g}_{j}^{\ast}\left( \mathbf{b}\right) <g_{j}^{\ast}\left( \mathbf{b}\right) +\alpha. \] \item $\hat{g}_{j}^{+}\left( \mathbf{b}\right) >\hat{g}_{j}^{-}\left( \mathbf{b}\right) $: here the estimates follow NOT the true order so that $\hat{g}_{j}^{\ast }\left( \mathbf{b}\right) =\hat{g}_{j}^{-}\left( \mathbf{b}\right) $. We have% \[ \hat{g}_{j}^{-}\left( \mathbf{b}\right) >g_{j}^{-}\left( \mathbf{b}\right) -\alpha\geq g_{j}^{+}\left( \mathbf{b}\right) -\alpha=g_{j}^{\ast}\left( \mathbf{b}\right) -\alpha \] and \[ \hat{g}_{j}^{-}\left( \mathbf{b}\right) <\hat{g}_{j}^{+}\left( \mathbf{b}\right) <g_{j}% ^{+}\left( \mathbf{b}\right) +\alpha=g_{j}^{\ast}\left( \mathbf{b}\right) +\alpha. \] \end{enumerate} Hence $|\hat{g}_{j}^{\pm}\left( \mathbf{b}\right) -g_{j}^{\pm}\left( \mathbf{b}\right) |<\alpha$ implies $|\hat{g}_{j}^{\ast}\left( \mathbf{b}\right) -g_{j}^{\ast}\left( \mathbf{b}\right) |<\alpha$. Therefore,% \begin{align} \mathbb{P}\left( \left\vert \hat{g}_{j}^{\ast}\left( \mathbf{b}\right) -g_{j}^{\ast }\left( \mathbf{b}\right) \right\vert \geq\alpha\right) &\leq \mathbb{P}\left( \left\vert \hat{g}_{j}^{+}\left( \mathbf{b}\right) -g_{j}^{+}\left( \mathbf{b}\right) \right\vert \geq\alpha\right) \nonumber\\ &+\mathbb{P}\left( \left\vert \hat{g}% _{j}^{-}\left( \mathbf{b}\right) -g_{j}^{-}\left( \mathbf{b}\right) \right\vert \geq\alpha\right) \end{align} which gives the desired result using \eqref{eq:estimation-deviation}. (why $\leq$?)} \subsection{Distribution of $s(n,\mathbf{b}\odot\mathbf{Y}^\pm_j)$} \saeedLater{one way to justify the approximations taken from limits of sequences could be that those sequences have decreasing ``variance"? decreasing distance to the limit, to be precise. otherwise, a limit never says that we're always approaching when N grows. } We begin with characterizing the distribution of the continuous-time OFDM symbol $u(t, \mathbf{b}\odot \mathbf{Y}^\pm_j)$ in Theorem~\ref{thm:convergence}, which is required for performance analysis in Section~\ref{sec:analysis}. The distribution of the discrete-time version $s(n,\mathbf{b}\odot\mathbf{Y}^\pm_j)$ follows automatically, as stated in Corollary~\ref{cor:normalDist}, which is used in the derivation of the conditional expectations of SRCM and SE. As the first step, the following Lemma gives the covariance functions of the samples of the OFDM signal for a given~$\mathbf{b}$ and iteration $j$ of the CE Method as $N\to\infty$. Let \begin{align} \hat{u}_r(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) &\! =\! u_r(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) - \mathbb{E}[u_r(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)], \nonumber \\ \hat{u}_i(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) &\! =\! u_i(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) - \mathbb{E}[u_i(t, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)], \label{eqn:centeredSamples} \end{align} where subscripts $r$ and $i$ denote the real and imaginary parts respectively. \begin{lemma} \label{lem:variances} Consider $j=\rho N$ where $0\leq\rho\leq 1$ is a rational number. For $\mathbf{B}$ randomly distributed in $\mathcal{M}^N$, let the variances and covariances of $u_r(t,\mathbf{B}\odot \mathbf{Y}^\pm_j)$ and $u_i(t, \mathbf{B}\odot \mathbf{Y}^\pm_j)$ with respect to $\mathbf{Y}^\pm_j$ as $N\to\infty$ and at any time instances $t_1, t_2\in [0,T)$ be denoted as \begin{align*} R^j_{rr}(\tau,\mathbf{B})&=\lim_{N\to\infty}\mathbb{E}_{\mathbf{Y}^\pm_j}[\hat{u}_r(t_1, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j) \hat{u}_r(t_2, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)], \nonumber \\ R^j_{ri}(\tau,\mathbf{B})&=\lim_{N\to\infty}\mathbb{E}_{\mathbf{Y}^\pm_j}[\hat{u}_r(t_1, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j) \hat{u}_i(t_2, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)], \nonumber \\ R^j_{ii}(\tau,\mathbf{B})&=\lim_{N\to\infty}\mathbb{E}_{\mathbf{Y}^\pm_j}[\hat{u}_i(t_1, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j) \hat{u}_i(t_2, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)], \end{align*} where $\tau=t_2-t_1\in(-T,T)$. Then \begin{align*} &R^j_{rr}(\tau)= R^j_{ii}(\tau)= \frac{\sigma_b^2}{2}(\mathrm{sinc} (2F_s\tau)- \rho \mathrm{sinc} (2F_s\tau \rho)), \nonumber\\ &R^j_{ri}(\tau)= \begin{dcases} \frac{\sigma_b^2}{2} \frac{1}{2\pi F_s \tau} (\frac{1}{\rho}\cos(2\pi F_s \rho \tau)\!-\! \cos(2\pi F_s \tau)) &\!\!\!\! \tau\neq 0 \\ 0 &\!\!\!\! \tau=0 \end{dcases}, \end{align*} with probability one. That is, the result holds for any $\mathbf{B}$ as $N\to\infty$ which is emphasized by omitting the argument $\mathbf{B}$ from the notation. Clearly, $R^j_{ri}(\tau)=R^j_{ir}(-\tau)$. \end{lemma} The proof is given in Appendix~\ref{app:variances}. The following theorem characterizes the distribution of the OFDM signal. \begin{theorem} \label{thm:convergence} For $\mathbf{B}$ randomly distributed in $\mathcal{M}^N$ and $j=\rho N$ as specified in Lemma~\ref{lem:variances}, consider $\hat{u}(t,\mathbf{B}\odot \mathbf{Y}^\pm_j)$ as defined in \eqref{eqn:centeredSamples} at any set of time instances $\{t_1,t_2,\ldots,t_K\}\in [0,T)^K, K>1$. Omitting $\mathbf{B}\odot \mathbf{Y}^\pm_j$ to save space, the vector \begin{equation} [\hat{u}_r(t_1), \hat{u}_i(t_1), \hat{u}_r(t_2), \hat{u}_i(t_2), \ldots, \hat{u}_r(t_{K}), \hat{u}_i(t_{K})]^T \label{eqn:cramerWoldSeq1} \end{equation} converges in distribution, as $N\to\infty$, to the vector \begin{equation} [x_1, y_1, x_2, y_2, \ldots, x_{K}, y_{K}]^T \label{eqn:cramerWoldSeq2} \end{equation} of jointly Gaussian random variables with $\mathbb{E}[x_m x_n]=R^j_{rr}(t_n-t_m)$, $\mathbb{E}[y_m y_n]=R^j_{ii}(t_n-t_m)$ and $\mathbb{E}[x_m y_n]=R^j_{ri}(t_n-t_m)$ as given in Lemma~\ref{lem:variances}. \end{theorem} \begin{proof} The proof follows a standard procedure and is only outlined here. It essentially consists of the application of the Cramer-Wold theorem \cite{billingsley1999} to the vector in \eqref{eqn:cramerWoldSeq1} which requires that every linear combination of the elements of the vector in \eqref{eqn:cramerWoldSeq1} converges in distribution to the same linear combination of the corresponding elements of the vector in \eqref{eqn:cramerWoldSeq2}. This can be verified by the Lindeberg condition. In this procedure, the existence of the covariances of the linear combination is shown in Lemma~\ref{lem:variances}. \end{proof} From Theorem~\ref{thm:convergence}, the following result is immediate for the discrete-time OFDM signal at iteration $j$. \begin{corollary} \label{cor:normalDist} For any given~$\mathbf{b}\in\mathcal{M}^N$, $n=0,1,\ldots,LN-1$ and $j=\rho N$ as defined in Lemma~\ref{lem:variances}, it holds that \begin{equation*} \begin{bmatrix} s_r(n, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)- \mu_r(n,\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) \\ s_i(n, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)- \mu_i(n,\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j) \end{bmatrix} \xrightarrow{d} \mathcal{N}(0,\frac{1}{2}(1-\rho) I), \label{eqn:jointNormalS} \end{equation*} where $\xrightarrow{d}$ denotes convergence in distribution, $I$ is a $2\times2$ identity matrix and \begin{align*} \mu_r(n,\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)&\!=\!\frac{1}{\sigma_b\sqrt{N}}\mathrm{Re}\left\{ \pm b_j e^{i\frac{2\pi}{LN}jn}\! +\sum_{k=0}^{j-1} b_k x_k^\ast e^{i\frac{2\pi}{LN}kn} \right\}, \nonumber \\ \mu_i(n,\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)&\!=\!\frac{1}{\sigma_b\sqrt{N}}\mathrm{Im}\left\{ \pm b_j e^{i\frac{2\pi}{LN}jn}\!+\sum_{k=0}^{j-1} b_k x_k^\ast e^{i\frac{2\pi}{LN}kn} \right\}. \end{align*} \end{corollary} \begin{remark} \label{rmk:sameInTheLimit} A pivotal result which enables the analytical derivations in the remainder of this paper is that at every iteration of the algorithm, the distribution of $\hat{u}(t,\mathbf{b}\odot\mathbf{Y}^\pm_j)$ in the limit is independent of $\mathbf{b}$. In addition, the distribution of $u(t,\mathbf{b}\odot\mathbf{X})$, i.e. prior to any sign decision, is identical to that of $u(t,\mathbf{B})$ as $N\to\infty$. \end{remark} \begin{remark} \label{remarkApprox} In the following sections, the asymptotically Gaussian distribution shown in Corollary~\ref{cor:normalDist} is used to approximate the distribution of $s(n,\mathbf{b}\odot\mathbf{Y}_j^\pm)$ for the finite but large enough number of random sign variables, i.e. $N-j-1$ at iteration $j$. This can be used to derive closed-form expressions of the sign decision criterion \eqref{eqn:CEGeneralRule} only for $j=0,1,\ldots,N-N_e-1$. The number of the excluded signs $N_e$, for which the approximation is unacceptable, will be determined based on simulations in Section~\ref{sec:perf}. \end{remark} \subsection{SE Metric} \label{sec:LSEcalc} By substituting $\zeta_N(\mathbf{b}\odot\mathbf{Y}^\pm_j)$ for $f(\mathbf{b}\odot\mathbf{Y}^\pm_j)$ in \eqref{eqn:gDef2}, we have \begin{align} g^{\pm}_j(\mathbf{b})= \sum_{n=0}^{LN-1} \mathbb{E} \left[e^{ \kappa |s(n,\mathbf{b}\odot\mathbf{Y}^\pm_j)|^2}\right]. \label{eqn:CEsForSE} \end{align} It was shown in Corollary~\ref{cor:normalDist} that the real and imaginary components of $s(n,\mathbf{b}\odot \mathbf{Y}^\pm_j)$ are Gaussian and independent in the limit with equal variances. For $j=\rho N$, let $\delta_j^2=R_{rr}(0)=R_{ii}(0)=\frac{1}{2}(1-\rho)$ as obtained in Lemma~\ref{lem:variances}. Here we apply the approximation suggested in Remark~\ref{remarkApprox} for $j=0, \ldots, N-N_e-1$. Specifically, the real and imaginary parts of \begin{equation} z(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)=\delta_j^{-1} s(n, \mathbf{b}\odot \mathbf{Y}^\pm_j), \ j=0,\ldots,N-N_e-1 \label{eqn:Zdef} \end{equation} have approximately unit variances with accordingly scaled expected values. Therefore, $|z(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)|^2$ for large enough $N-j$ is approximately a non-central $\chi^2$-distributed random variable with two degrees of freedom. Consider the moment generating function of $|z(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)|^2$ which is \begin{align*} M^\pm_{j,n}(t)&= \mathbb{E}\left[e^{t |z(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)|^2}\right] \\ &=e^{\lambda^\pm_{j,n} t (1-2t)^{-1}} (1-2t)^{-1} \quad 2t<1, \end{align*} where the non-centrality parameter $\lambda^\pm_{j,n}$ is \begin{equation*} \lambda^\pm_{j,n}=\delta_j^{-2 }\left(\mu_r^2(n,\mathbf{b}\odot \mathbf{Y}^\pm_j)+\mu_i^2(n,\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)\right), \end{equation*} and $\mu_r$ and $\mu_i$ were given in Corollary~\ref{cor:normalDist}. It can be seen that the terms in~\eqref{eqn:CEsForSE} are identical to the definition of $M^\pm_{j,n}(\kappa\delta_j^2)$. Consequently, \begin{align} g^{\pm}_j(\mathbf{b})=(\kappa\delta_j^2)^{-1}\beta \sum_{n=0}^{LN-1} e^{\beta \lambda^\pm_{j,n}},\quad j=0,\ldots,N-N_e-1, \label{eqn:LSEcalc} \end{align} where $\beta=\kappa\delta_j^2(1-2\kappa\delta_j^2)^{-1}$. \saeedDissertation{ It is worth mentioning that in derivations for both SRCM and LSE we have used a standard chi-squared variable, hence the same $\lambda_n$, but in SRCM it was possible to establish the connection between the original quantity to be calculated and the MGF by a scalar. Here since we are not working with expected value of the r.v. itself, but it's exp, we have to do the job by choosing $\gamma$.} Finally, a closed-form decision rule can be obtained as \begin{align} x_j^\ast=-\mathrm{sign} \left[\sum_{n=0}^{LN-1} \left(e^{\beta \lambda^+_{j,n}} - e^{\beta \lambda^-_{j,n}}\right)\right], \quad j=0,\ldots,N-N_e-1. \label{eqn:LSErule} \end{align} The number of the last sign decisions which do not follow the closed-form expression in \eqref{eqn:LSEcalc}, i.e. $N_e$, will be determined in Section~\ref{sec:perf}. A sample average must be inevitably used instead for signs $j=N-N_e, \ldots, N-1$ as in~\eqref{eq:estimatorGeneral}. \saeedLater{sth wrong here. LSE with the log is quite good, for very large or small $N$, it gives a very good approximation with a tiny MSE. but it's not the case at all without the log. why? and then why the algorithm works without the log?!!!} \begin{algorithm}[t] \caption{Implementation of the CE Method for CM reduction by Sign Selection. \saeed{make connections to between equations derived and the calculations here} \saeed{make it for SE as it comes first and is more general}} \label{alg:ce-cm} \begin{algorithmic}[1] \REQUIRE $b_0, \ldots, b_{N_f-1}$: data symbols with $\log_2 |\mathcal{M}|$-bit mapping \\ $b_{N_f}, \ldots, b_{N-1}$: data symbols with $(\log_2 |\mathcal{M}| - 1$)-bit mapping \\ \STATE $\mathbf{x}^\ast \gets [1, 1, \ldots, 1]_{N\times 1}$ \STATE $\mathbf{n} \gets [0, 1, 2,\ldots, LN-1]$ \STATE $\mathbf{h} \gets \sum_{j=0}^{N_f-1} b_j \exp(i 2\pi j \frac{\mathbf{n}}{LN})$ \\\COMMENT{Element-wise operations on arrays are assumed in this pseudocode.} \FOR {$j = N_f$ to $N-1$} \STATE $\mathbf{p} \gets \mathbf{h}+ b_j \exp(i 2\pi j \frac{\mathbf{n}}{LN}) \STATE $\mathbf{m} \gets \mathbf{h}- b_j \exp(i 2\pi j \frac{\mathbf{n}}{LN}) \STATE $x_j^\ast \gets -\mathrm{sign}(\mathrm{sum}(|\mathbf{p}|^6\! + 18|\mathbf{p}|^4 +72|\mathbf{p}|^2 -|\mathbf{m}|^6\! - 18|\mathbf{m}|^4\! - 72|\mathbf{m}|^2))$ \IF{$x_j^\ast=1$} \STATE $\mathbf{h} \gets \mathbf{p}$ \ELSE \STATE $\mathbf{h}\gets \mathbf{m}$ \ENDIF \ENDFOR \RETURN $\mathbf{x}^\ast$ \end{algorithmic} \end{algorithm} \subsection{Cubic Metric} \label{sec:CM} Replacing $f(\mathbf{b}\odot\mathbf{Y}^\pm_j)$ with $\eta_{\scriptscriptstyle N}(\mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)$ in \eqref{eqn:gDef2}, we have \cite{AfrasiabiSPAWC2019} \begin{equation} g_j^\pm(\mathbf{b})=\frac{1}{LN} \sum_{n=0}^{LN-1} \mathbb{E} \left[\left|s(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)\right|^6\right]. \label{eqn:CMexpCompact} \end{equation} The expected values are the third moments of $|s(n,\mathbf{b}\odot \mathbf{Y}^\pm_j)|^2$. Following the approximation mentioned in Remark~\ref{remarkApprox}, they can be obtained from the third derivative of the moment generating function of the $\chi^2$ random variable $|z(n, \mathbf{b}\odot \mathbf{Y}^\pm_j)|^2$ as defined in~\eqref{eqn:Zdef}. That is, \begin{equation*} \mathbb{E} \left[\left|s(n, \mathbf{b}\!\odot\! \mathbf{Y}^\pm_j)\right|^6\right]= \delta_j^6 \ \frac{d^3 M^\pm_{j,n}(t)}{dt^3}\Big|_{t=0}, \ j=0,\ldots,N-N_e-1. \label{eqn:expSinZ} \end{equation*} Obtaining the derivative and substituting it in \eqref{eqn:CMexpCompact}, we have \cite{AfrasiabiSPAWC2019} \begin{align*} g_j^\pm(\mathbf{b})\!= \!\frac{\sigma^6}{LN} \!\sum_{n=0}^{LN-1}\!\! \left[(\lambda^\pm_{j,n})^3 \!+ \!18(\lambda^\pm_{j,n})^2 + 72\lambda^\pm_{j,n}+ \!48\right], \quad j=0,\ldots,N-N_e-1, \end{align*} and the decision rule in \eqref{eqn:CEGeneralRule} can be written in closed form as \begin{align} x_j^\ast&= -\mathrm{sign}\left(\sum_{n=0}^{LN-1} \left[(\lambda^+_{j,n})^3 + 18(\lambda^+_{j,n})^2 + 72\lambda^+_{j,n} -(\lambda^-_{j,n})^3 - 18(\lambda^-_{j,n})^2 - 72\lambda^-_{j,n}\right] \right) \label{eqn:finalRule} \end{align} for $j=0,\ldots,N-N_e-1$. For the sign variables $j=N-N_e, \ldots, N-1$, consider using sample averages as in~\eqref{eq:estimatorGeneral} with a high $Q$, which was the number of realizations of the random sign variables to calculate the conditional expectations. \saeed{The following to the last chapter?}Simulations have shown that the CE Method delivers the same performance for several nonzero values of $N_e$ as for $N_e=0$. That is, using accurate sample averages for the final sign variables does not improve the performance. The application of the CE Method to the Sign Selection problem essentially leads to the explicit sign decision criteria derived in this section for PAPR and its substitute SE as well as for the SRCM. For better readability, the pseudocode for SRCM reduction is shown in Algorithm~\ref{alg:ce-cm}, where the expected values required for obtaining $\lambda_{j,n}^\pm$ are constructed by adding the contribution of one subcarrier at each iteration (see lines 5 and 6). \section{Performance analysis} \label{sec:analysis} \saeed{compare this with the upperbounds from other papers? how?} The CE Method guarantees \eqref{eqn:CEguarantee}, which is rewritten here for convenience: \saeedDissertation{use the updated one for pruned CE} \begin{equation*} f(\mathbf{b}\odot\mathbf{x}^\ast) \leq \mathbb{E} [f(\mathbf{b}\odot\mathbf{X})], \label{eq:CEprincipleB} \end{equation*} for a given $\mathbf{b}$. \saeedDissertation{It implies that \begin{equation} \mathrm{Pr}(f(\mathbf{b}\odot\mathbf{x}^\ast)>\rho) \leq \mathrm{Pr}(\mathbb{E}_\mathbf{X} [f(\mathbf{c}\odot\mathbf{X})]>\rho). \label{eqn:CEguaranteedB} \end{equation} That is, the CCDF of the reduced metric is smaller or equal to that of the initial expectation.} In order to characterize $f(\mathbf{b}\odot\mathbf{x}^\ast)$, one approach can be to establish a relation between the distribution of the initial expectation $\mathbb{E}_\mathbf{X} [f(\mathbf{B}\odot\mathbf{X})]$ and that of the uncoded metric values $f(\mathbf{B}), \mathbf{B}\in\mathcal{M}^N$. The analysis will be done for PAPR and SRCM with the help of some useful results from the literature. Concerning the SE metric, a relevant analysis would include a relation between SE reduction and the resulting indirect PAPR reduction, which requires further research. \subsection{PAPR metric} \begin{theorem} \label{thm:PAPRupper} For any $\mathbf{b}\in\mathcal{M}^N$, the reduced PAPR value $\theta_N(\mathbf{b}\odot\mathbf{x}^\ast)$ obtained by the CE Method is bounded in the limit as \begin{align*} \lim_{N\to\infty} \frac{\theta_N(\mathbf{b}\odot\mathbf{x}^\ast) - a_N}{b_N} \leq \gamma, \end{align*} where $b_N=\frac{1}{2}$, $a_N= 2 \log N + \log \log N + \log \frac{\pi}{3}$ and $\gamma \approx 0.577$ is the Euler constant. \saeedDissertation{include $N_f$. proof is easy, see the notebook} \end{theorem} \begin{proof} Consider the PAPR of the continuous-time OFDM symbols $u(t,\mathbf{b})$ given in~\eqref{eq:ofdmContSymbolDef} which is defined as \begin{align*} \xi_N(\mathbf{b})=\max_{t\in[0,T)} |u(t,\mathbf{b})|^2. \end{align*} Clearly, for any finite oversampling factor $L$, \begin{align*} \theta_N(\mathbf{b})\leq \xi_N(\mathbf{b}). \end{align*} Therefore, It directly follows from~\eqref{eqn:CEguarantee} that \begin{align*} \frac{\theta_N(\mathbf{b}\odot\mathbf{x}^\ast) - a_N}{b_N} \leq \mathbb{E}_\mathbf{X} \left[\frac{\xi_N(\mathbf{b}\odot\mathbf{X}) - a_N}{b_N} \right] \end{align*} for any $N$. Therefore \cite{Rudin1987}, \begin{align} \lim_{N\to\infty} \frac{\theta_N(\mathbf{b}\odot\mathbf{x}^\ast) - a_N}{b_N} \leq \lim_{N\to\infty} \mathbb{E}_\mathbf{X} \left[\frac{\xi_N(\mathbf{b}\odot\mathbf{X}) - a_N}{b_N} \right]. \label{eq:PAPRupperIntermStep} \end{align} In order to obtain the right hand side limit, recall that the covariance functions of $u(t,\mathbf{b}\odot\mathbf{X})$, as emphasized in Remark~\ref{rmk:sameInTheLimit}, was shown to be identical to that of $u(t,\mathbf{B})$ as $N\to\infty$. In addition, Extreme Value Theory \cite{leadbetter1988} has been employed in \cite{WeiKelly2002} to obtain the asymptotic distribution of $\xi_N(\mathbf{B})$ as \begin{align*} \lim_{N\to\infty} \mathbb{P} \left( \frac{\xi_N(\mathbf{B}) - b_N}{a_N} \leq w \right) = e^{-e^{-w}}. \end{align*} That is, the appropriately shifted and scaled variable $\xi_N(\mathbf{B})$ has Gumbel distribution in the limit. Consequently, the results of \cite{WeiKelly2002} hold for the asymptotic distribution of $u(t,\mathbf{b}\odot\mathbf{X})$ as well and \begin{align*} \lim_{N\to\infty} \mathbb{P} \left( \frac{\xi_N(\mathbf{b}\odot \mathbf{X}) - b_N}{a_N} \leq w \right) = e^{-e^{-w}}. \end{align*} Finally, the expected value of a random variable with the Gumbel distribution is \begin{align*} \lim_{N\to\infty} \mathbb{E}_\mathbf{X} \left[\frac{\xi_N(\mathbf{b}\odot\mathbf{X}) - a_N}{b_N} \right]=\gamma, \end{align*} which is the right hand side of~\eqref{eq:PAPRupperIntermStep}. This completes the proof. \end{proof} The asymptotic result in Theorem~\ref{thm:PAPRupper} shows an upperbound for $\theta_N(\mathbf{B}\odot\mathbf{x}^\ast)$ when shifted by $a_N$ which grows with $N$. This implies an approximate inequality for finite but large $N$, as stated below. \begin{remark} For large enough $N$, Theorem~\ref{thm:PAPRupper} implies the upperbound \begin{align} \theta_N(\mathbf{b}\odot\mathbf{x}^\ast) \leq \log N + \frac{1}{2} \log \log N + K \label{eqn:upperPAPR} \end{align} for any $\mathbf{b}\in\mathcal{M}^N$, where $K=\frac{1}{2} \log \frac{\pi}{3}+ \gamma \simeq 0.59$. \end{remark} Since the upperbound of Theorem~\ref{thm:PAPRupper} holds for every $\mathbf{b}\in\mathcal{M}^N$, it is equivalently an upperbound on the worst-case reduced PAPR value, i.e. $\theta_{N}^{\mathrm{max}}=\max_{\mathbf{b}\in\mathcal{M}^N} \theta_N(\mathbf{b}\odot\mathbf{x}^\ast)$. Except for relatively small $N$, it is not feasible to observe $\theta_N^{\max}$ in the actual performance investigation by computer simulations or in practice. Instead, it is common to measure the \emph{effective reduced PAPR} $\theta_N^{\mathrm{eff}}$ which is defined according to \begin{equation} \mathbb{P}\{\theta_N(\mathbf{B}\odot\mathbf{x}^\ast)> \theta_N^{\mathrm{eff}}\}=0.001. \label{eq:effPAPRdef} \end{equation} Although it can intuitively be expected that $\theta_{N}^{\mathrm{eff}}$ is much smaller than $\theta_N^{\max}$, a formal relation is not available. \saeedLater{isn't what gerhard alwyas says that the PAPR for large N deviates arbitrarily small from log N in contradiction with that maximum PAPR is always N? log N and N don't get close, do they?} \subsection{Cubic Metric} \saeed{See comments of review 2 of the conf version} The following theorem was previously presented by the authors in \cite{AfrasiabiSPAWC2019}, which obtains a constant upperbound on the reduced SRCM value. \begin{theorem} \label{thm:SRCMupperbound} The reduced SRCM value $\eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{x}^\ast)$ obtained by the CE Method is bounded in the limit as \begin{align} \lim_{N\to\infty}\eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{x}^\ast) \leq 6 \label{eq:SRCMupper} \end{align} for any $\mathbf{b}\in\mathcal{M}^N$. \saeedDissertation{$N_f$} \end{theorem} \begin{proof} \saeedLater{we don't need this, we can build the result on the fixed c case in the same manner, reyleigh and ...} As stated in~\eqref{eqn:CEguarantee}, the CE Method guarantees that \begin{equation} \eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{x}^\ast) \leq \mathbb{E}_\mathbf{X} [\eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{X})]. \label{eq:CEguaranteeCM} \end{equation} From the definition of SRCM in~\eqref{eqn:SRCM}, we have $\mathbb{E}[\eta_{\scriptscriptstyle N}(\mathbf{b})]=\frac{1}{LN}\sum_{n=0}^{LN-1} \mathbb{E}[|s(n,\mathbf{b})|^6]$. In addition, it can be concluded from Remark~\ref{rmk:sameInTheLimit} that the distribution of the discrete-time signal $s(n,\mathbf{b}\odot\mathbf{X})$ in the limit is the same as that of $s(n,\mathbf{B})$. Therefore, \begin{equation} \lim_{N\to\infty} \mathbb{E}_\mathbf{X} [\eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{X})] = \lim_{N\to\infty} \mathbb{E} [\eta_{\scriptscriptstyle N}(\mathbf{B})]. \label{eqn:Elim} \end{equation} The distribution of $\eta_{\scriptscriptstyle N}(\mathbf{B})$ is studied in \cite{KimCubicMetric2016}, where it is shown that \begin{equation*} \lim_{N\to\infty}\mathbb{E}[\eta_{\scriptscriptstyle N}(\mathbf{B})] = 6. \label{eqn:RCMlimit} \end{equation*} Considering \eqref{eq:CEguaranteeCM}, \eqref{eqn:Elim} and that an inequality between two sequences is preserved in their limits \cite{Rudin1987}, we have \begin{align*} \lim_{N\to\infty}\eta_{\scriptscriptstyle N}(\mathbf{b}\odot\mathbf{x}^\ast) \leq \lim_{N\to\infty}\mathbb{E}[\eta_{\scriptscriptstyle N}(\mathbf{B})], \end{align*} which completes the proof. \end{proof} \saeedDissertation{\begin{corollary} Let $\mathrm{RCM}^\ast$ belong to the OFDM signal with reduced SRCM for individual OFDM symbols according to the proposed algorithm. Then $\mathrm{RCM}^\ast \leq \mathrm{RCM}$ as $N\to\infty$. \end{corollary} \begin{proof} As seen before, we have $\mathrm{RCM}^2=\mathbb{E} [\eta_{\scriptscriptstyle N}(\mathbf{B})]=6$ as $N\to\infty$. The same derivation holds for the SRCM-reduced OFDM signal, i.e. $h_r(n)= \sum_{m=0}^{\infty} s(n-mLN,\mathbf{C}_m \odot \mathbf{x}_m^\ast))$, where $\mathbf{x}^\ast_m$ is the solution obtained for $\mathbf{C}_m$. Therefore, it follows from Theorem~\ref{thm:SRCMupperbound} that \begin{align*} \lim_{N\to\infty} \mathbb{E}[\eta_{\scriptscriptstyle N}(\mathbf{C} \odot \mathbf{x}^\ast)]\leq \lim_{N\to\infty }\mathbb{E}[\eta_{\scriptscriptstyle N}(\mathbf{B})], \end{align*} which completes the proof. \end{proof}} Recall that the reduction of RCM is the actual objective sought in reduction of SRCM and that CM is related to RCM by some constants. Clearly, Theorem~\ref{thm:SRCMupperbound} shows an upperbound on the largest or worst-case reduced SRCM. Being equal to the average of the reduced SRCM values, RCM can be expected to be much smaller than the upperbound unless the distribution of $\eta_{\scriptscriptstyle N}(\mathbf{B}\odot\mathbf{x}^\ast)$ is highly concentrated. Similar to the relation of the effective reduced PAPR and the upperbound, further characterization of RCM reduction is not available. \section{Simulation Results and Discussion} \label{sec:perf} In this section, the performance of the CE method in reducing PAPR and CM is examined via simulation results. The performance here refers to the reduction in the metrics of interest achieved by the suboptimal solution to the Sign Selection problem, including the indirect PAPR reduction gained by applying the proposed method to the SE metric. \saeedDissertation{High dynamic range of the signal, represented by PAPR, CM or any alternative metric, causes distortion in output signal of the power amplifier. The final assessment of the distortion is by the performance degradation in detection, e.g. bit error rate (BER), and the out-of-band (OOB) radiation, e.g. adjacent channel leakage ratio (ACLR). However, in this work no deliberate distortion, for instance by clipping and filtering type of work, is introduced. Therefore, the relation between the reduction gained in PAPR or CM to the improvement on performance and OOB radiation does not contribute to the problem statement of the paper and is out of the scope. The results of this work are presented by comparing CCDF curves of the metrics. For convenience, \emph{effective PAPR} defined as the PAPR value for which the CCDF equals~$10^{-3}$ is reported in some cases.} \subsection{PAPR reduction} The Complementary Cumulative Distribution Function (CCDF) of $\theta_N(\mathbf{B})$, i.e. $\mathbb{P}(\theta_N(\mathbf{B})>y) $, with $\mathbf{B}\in\mathcal{M}^N$ is commonly used to represent the \emph{uncoded PAPR}, i.e. the PAPR of an unprocessed signal. Accordingly, the reduction performance is reported by the CCDF of $\theta_N(\mathbf{B}\odot\mathbf{x}^\ast)$ for $\mathbf{B}\in \mathcal{M}^N$. To report the performance in the text, the \emph{effective PAPR} is used which is the PAPR value where CCDF equals 0.001. \paragraph{Choice of $Q$} To investigate the reliability of the estimations required in the sign selection rule for PAPR given in \eqref{eq:estimator}, the reduction performance gained by several values of $Q$ for $N=64$ is depicted in Fig.~\ref{fig:64-reduction-Q}. It was observed that the difference for $Q\geq 100$ was insignificant. Consequently, $Q=100$ has been used in the rest of the simulations. As a side note, a very low value of $Q=5$ was included in the figure to show the unexpectedly acceptable reduction that it provides. \saeedDissertation{this same sign thing has to be visited again. why would it make a difference?} \begin{figure}[tb] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{CEforPAPRforQ} \caption{} \label{fig:64-reduction-Q} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{CEforPAPRrefined} \caption{} \label{fig:paprCE} \end{subfigure} \caption{a) Reduction performance of the CE method for PAPR for various number of shots~$Q$, as defined in~\eqref{eq:estimator}, to show the reliability of estimation for~$N=64$ and~16-QAM.\saeedDissertation{only $Q=5$ is done same sign.} b) Reduction performance of the CE method for PAPR with 16-QAM and~$Q=100$, including analytical upperbound of~\eqref{eqn:upperPAPR} on the worst-case reduced PAPR value.} \end{figure} \saeedDissertation{ estimated CCDF curves for the initial expectation for several number of subcarriers are shown in Fig.~\ref{fig:initExpTheory}. It can be seen that the initial expectation becomes more densely concentrated about $\mu=\lim_{N\to\infty}\mathbb{E}[f(\mathbf{C}\odot\mathbf{X})]$ as $N$ increases. The other factor that affects the distribution is the modulation order. For QPSK, the initial expectation stays roughly equal to $\mu$. For a higher constellation size, the distribution spreads out. However, even for high number of points, such as 256-QAM, the distribution is still fairly concentrated. This evaluation confirms the asymptotic result obtained for the initial expectation in \eqref{eq:initExpTheory} for PAPR. with two other figures commented!} \paragraph{Dependence on $N$} The PAPR reduction performance of the algorithm is shown in Fig.~\ref{fig:paprCE} for $N=64$ and 1024 subcarriers, including its pruned version which will be shortly introduced. The simulation results are depicted only for 16-QAM as similar results were observed for other constellations. \saeed{not all?} A significant reduction gain of roughly 5.5~dB, equivalently an effective PAPR of 6.5~dB, was observed for $N=1024$. A noticeable characteristic of the method, evident from the simulations, is that the change in the reduced effective PAPR is relatively small by increasing~$N$ from~$64$ to~1024. The analytic upper bound on the worst-case reduced PAPR, as shown in Theorem~\ref{thm:PAPRupper} and given in~\eqref{eqn:upperPAPR}, is included in Fig.~\ref{fig:paprCE}. The proof of Theorem~\ref{thm:PAPRupper} relies on the extremal value theory to analyze the expected value of the uncoded PAPR, i.e. $\mathbb{E}[\theta_N(\mathbf{B})]$ as $N\to\infty$. The usefulness of this asymptotic result for $\mathbb{E}[\theta_N(\mathbf{B})]$ with finite $N$ can be asserted as~\eqref{eqn:upperPAPR} is almost equal to a diligently calculated empirical average of $\theta_N(\mathbf{B})$ for $N$ as small as 64. Refer to the discussion in Section~\ref{sec:analysis} regarding the relationship between the upperbound and the effective reduced PAPR. \saeedDissertation{ \begin{remark} \label{rmk:PAPRanalytic} A prediction of the amount of reduction in the effective PAPR from the upperbound is not available. Nonetheless, the reduced effective PAPR must be much smaller that the upperbound unless the distribution of the reduced PAPR values is considerably concentrated. This matches the observation made from the curves in Fig.~\ref{fig:paprCE} that the distance of the upperbound from the effective PAPR increases as the accuracy of the asymptotic result, i.e. the value of $N$, increases. The upperbound, which is the expected value of the uncoded OFDM signal, is smaller than the uncoded effective PAPR. Therefore, the existence of such upperbound implies that the reduction gain increases by $N$. \saeed{see if you can turn it into a theorem or sth} \end{remark}} \paragraph{Pruned Sign Selection and Rate loss} It has been observed through simulations that the impact of a sign decision increases for the sign variables with higher indices. That is, the reduction steps in the trajectory of the conditional expectations, as the algorithm performs sign decisions for $x_0$ to $x_{N-1}$, become statistically larger. This motivates pruning the sign bits whose contribution is insignificant. Formally, in the \emph{pruned Sign Selection}, $x^\ast_{0:N_f-1}$ are set as the signs of the first $N_f$ symbols which fully carry data and the sign bits of $N-N_f$ last symbols are determined by~\eqref{eqn:CEGeneralRule}. The pruned algorithm with $N_f=\frac{N}{2}$, as shown in Fig.~\ref{fig:paprCE}, causes negligible degradation in the reduction performance while reducing the rate loss of the Sign Selection approach. Evident from \eqref{eqn:rateLoss}, the rate loss is inversely related to the constellation size $|\mathcal{M}|$. Accordindly, the rate loss is $\frac{1}{12}, \frac{1}{8}$ and $\frac{1}{4}$ for $N_f=\frac{N}{2}$ and 64-QAM, 16-QAM and QPSK respectively. Obviously, a lower rate loss implies a smaller number of sign selections, hence a lower computational complexity. \saeed{it's linearly related, you may wanna say that} \saeedDissertation{ In comparison to randomized methods, the reduction gain behaves fundamentally different. Here we pick the famous method Selected Mapping (SLM). A short description... Recall that algorithms such as SLM are proposed mainly as practical methods with relatively low computational complexity. Therefore, the comparison made here is unfair, unless targeted only on showing the difference between randomized and derandomized paradigms. Fig... shows the performance for a low and high number of phase vectors. It can be seen that no matter how much resources or computation is spent, SLM has basic limitations.} \saeedDissertation{ The analysis provides, equivalently, upperbound on reduced PAPR and minimum PAPR reduction using \eqref{eq:finalTheoryCDF} and~\eqref{eq:initExpTheory}. For instance, taking $0.001$ as the important probability level, we have the minimum reductions gathered in Table~\ref{tbl:minRed} for several values of $N$. As seen in Fig.~\ref{fig:initExpTheory}, the approximation is quite reliable even for $N$ as small as 64. } \saeedDissertation{a table commented} \paragraph{Indirect PAPR reduction by SE Metric} As discussed in Section~\ref{sec:LSEcalc}, the first $N-N_e$ signs decisions for reduction of the SE metric can be done by the rule in \eqref{eqn:LSErule} and the last $N_e$ are done by \eqref{eq:estimatorGeneral}, where the latter is based on the estimation of the conditional expectations. The choice of $N_e$ depends on $Q$, i.e. the number of the realizations of the random sign vector used in the estimation. For a given $Q$, a number of the early decisions are done more accurately using closed-form expressions of \eqref{eqn:LSErule}. When the number of remaining signs is low enough, the accuracy of the estimation overcomes. This intuition was evaluated for SE by examining the reduction performance for $N=64$ \saeedDissertation{ , $\kappa=5$} and $Q=10,100, 10000$ for $N_e=0, 5, 10$ and $20$. The relatively small $N$ was chosen on purpose to have a smaller number of total random variables. It was observed that the effective PAPR reduces from roughly 8.5~dB for $N_e=0$ to 6.8~dB for $N_e=10$ which was better than both $5$ and $20$ with effective PAPR of roughly 7.1 and 7 dB. In addition, going from $Q=10$ to $Q=10000$ showed insignificant effect. As a conclusion, $N_e=10$ and $Q=100$ were selected. \saeedDissertation{The adjustment parameter $\kappa$ introduced in Section~\ref{sec:LSEcalc} was motivated by the observation that having $\kappa$ improved the PAPR reduction for the practical range of $N$. For instance, the reduced effective PAPR moves from 7.5~dB to 6.5~dB for $N=64$\saeedDissertation{,$k_e=N-10$} and $\kappa=10$. With the same value of $\kappa$, 8.2~dB improved to 6.8~dB for $N=1024$. Therefore, $\kappa=10$ has been used in the simulations.} The indirect PAPR reduction achieved by reduction of the SE metric is shown in Fig.~\ref{fig:LSEperf} for $N=64$ and 1024. Although increasing the parameter $\kappa$ improves the SE metric in theory, numerical computations limit its value. Thus, $\kappa=10$ was chosen. It can be seen that the indirect PAPR reduction is as strong as the direct one showing a relatively small degradation. The pruning idea works as well, showing that only a slight loss in gain occurs when rate loss is halved. \saeedLater{would it make a difference it we use same signs for those last signs as in PAPR?} \begin{figure}[tb] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{LSEreduction} \caption{} \label{fig:LSEperf} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{CEforPAPRcomp} \caption{} \label{fig:perfComp} \end{subfigure} \caption{a) Indirect PAPR reduction by pruned application of the CE method to SE for 16-QAM with $\kappa=10, N_e=10 ,Q=100$. b) Reduction performance of the CE method applied to PAPR (CE-PAPR) and SE (CE-SE) compared to Greedy Algorithm~\cite{Sharif2009sign} and Selected Mapping (SLM). $N=1024$ unless stated otherwise.} \end{figure} \paragraph{Comparison} It is a rather common characteristic of the PAPR reduction methods in the literature that the reduced PAPR grows larger as $N$ increases. The CE method differs in this regards such that, as mentioned before, the reduced effective PAPR increases only slightly by $N$. Among the Sign Selection methods, a competitive proposal referred to as the Greedy Algorithm \cite{Sharif2009sign} was chosen for comparison. The well-known Selected Mapping (SLM) \cite{543811} with sign flips as phase rotations was also included, which can as well be seen as a Sign Selection method. The results are gathered in Fig.~\ref{fig:perfComp}, where it can be seen that the Greedy Algorithm performs better for $N=64$ but falls behind for $N=1024$. The performance of SLM depends on the number of independent mappings of the signal denoted by $S$. For the considerably large $S=1000$, the reduction gained by SLM is far lower. As a matter of fact, the performance of SLM can be shown to improve only slightly by increasing $S$ indicating its inherent limitation. The gap becomes larger for higher $N$. \begin{figure}[tb] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{CMreduction} \caption{} \label{fig:CMreduction} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\columnwidth]{CMreduction2} \caption{} \label{fig:CMreduction2} \end{subfigure} \caption{a) Reduction performance by pruned CE method applied to SRCM for 16-QAM, including the analytical upperbound on the worst-case reduced metric value. b) Comparison of the SRCM reduction performance of CE Method and SLM with $S=100$.} \end{figure} \subsection{Cubic Metric} Reduction performance for SRCM is shown in Fig.~\ref{fig:CMreduction} for $N=64$ and 1024 to cover a wide range of subcarrier numbers. As shown in the figure, the performance of the pruned algorithm with $N_f=\frac{N}{2}$, i.e. using the second half of sign bits, is only slightly degraded compared to the $N_f=0$ case. This reconfirms the result seen before in PAPR reduction that the proposed algorithm provides almost the same reduction by half the full rate loss, i.e. $\frac{1}{2}\log_{|M|} 2$. The analytical upperbound of Theorem~\ref{thm:SRCMupperbound} is as well included in Fig.~\ref{fig:CMreduction}. The upperbound on the worst-case reduced SRCM is the expected value of the uncoded SRCM, i.e. $\mathbb{E}[\eta_N(\mathbf{B})]$ as $N\to\infty$. The reliability of this asymptotic result was observed as it matches very closely with the empirical average of $\eta_N(\mathbf{B})$ particularly when $N$ is larger than 64. Similar to the PPAR reduction, the simulation results show a growing reduction gain as $N$ increases. The difference in the SRCM case is that the upperbound is independent of $N$, therefore the reduced effective SRCM decreases, which implies the growing reduction gain. Recall that the main metric of interest is CM which is calculated from RCM by knowing hardware-related constants. Therefore, we suffice to reporting RCM, which is the expected value of SRCM as in~\eqref{eqn:RCM-SRCM}. RCM is reduced roughly from 7.7~dB to 4.5~dB for both $N=64$ and $1024$. That is, a surprising result of nearly 3.2~dB reduction practically regardless of $N$. For $N=512$, which is the case studied in \cite{CMmotorola} with available $K_\mathrm{slp}$ and $K_\mathrm{bw}$, the CM is reduced to 2.87~dB. The available values are presented in Table~\ref{tbl:CMperf}. Due to the scarcity of research on CM reduction, we sufficed to the well-known SLM method~\cite{543811} for comparison. The result is shown in Fig.~\ref{fig:CMreduction2} for the relatively large $S=100$. For both cases of $N=64$ and $1024$, performance of the proposed algorithm is significantly better than~SLM. \begin{table}[bt] \centering \caption{RCM Reduction Performance.} \begin{tabular}{|l|c|c|c|c|c|} \hline $N$ & original RCM & original CM & reduced RCM & reduced CM \\ \hline 64 & 7.7 dB& -& 4.5 dB& - \\ 512 & 7.8 dB& 4.8 dB&4.5 dB & 2.87 dB\\ 1024 & 7.8 dB& - & 4.5 dB& -\\ \hline \end{tabular} \label{tbl:CMperf} \end{table} \section{Conclusion} The Method of Conditional Expectations was proposed to find a suboptimal solution to the Sign Selection problem. This investigation led to three particular observations. Firstly, using the conditional expectations as the core element of the sign selection rules provides room for reducing complexity of the algorithm. In particular, proposal of the SE metric as a surrogate function to PAPR led to closed-form expressions for sign selection rule and negligible loss in performance. A similar observation was done for CM which inherently has a tractable definition. This motivates creativity in developing surrogate functions to replace the metrics with physical significance, i.e. PAPR and CM. Secondly, the structure of the CE Method permits derivation of a meaningful upperbound on the largest reduced metric value, such that it actually guarantees a minimum reduction on the effective metric value. Thirdly, the actual performance observed by simulations show a remarkable reduction which is persistent as $N$ increases. In addition, the reduction gain deteriorates only slightly when reducing the number of used sign bits to half, which implies a significantly lower rate loss. \appendices \section{Proof of Theorem~\ref{thm:mcdiarmid}} \label{app:mcdiarmidProof} Recall the random vectors $\mathbf{X}^l\in \{-1,1\}^{N-j-1}, l=1,\ldots,Q$ with independent elements as used in the definition of $\hat{g}_j^\pm(\mathbf{b},\mathbf{X}^{1:Q})$ in~\eqref{eq:estimator}. Suppose that the real-valued function $\hat{g}_j^+$ satisfies \begin{equation} \left|\hat{g}_j^+(\mathbf{b},\mathbf{v}^{1:Q})-\hat{g}_j^+(\mathbf{b},\mathbf{z}^{1:Q})\right|\leq d_{m,k} \label{eq:McDiarmid-diff-1} \end{equation} when vectors $\mathbf{v}^l, \mathbf{z}^l \in\{-1,1\}^{N-j-1}, l=1, 2, \ldots, Q$ disagree only at $v^m_k=-z^m_k$. Then for any $\epsilon \geq 0$, McDiarmid's \emph{independent bounded differences} inequality \cite[p. 206]{mcdiarmid1998} holds as \begin{equation*} \mathbb{P}\left(\left|\hat{g}_j^+(\mathbf{b},\mathbf{X}^{1:Q})- g_j^+(\mathbf{b})\right|\geq \epsilon\right) \leq 2 e^{-2\epsilon^2(\sum_{m,k} d_{m,k}^2)^{-1}}, \end{equation*} where $g_j^+(\mathbf{b})=\mathbb{E}[\hat{g}_j^+(\mathbf{b},\mathbf{X}^{1:Q})]$. The bounded differences of \eqref{eq:McDiarmid-diff-1} on $\hat{g}^+_j$ can be shown as follows. \begin{align} \left|\hat{g}^+_j(\mathbf{b},\mathbf{v}^{1:Q})-\hat{g}^+_j(\mathbf{b},\mathbf{z}^{1:Q})\right| &=\left|\frac{1}{Q} \sum_{l=1}^Q \left[\theta_N\left(\mathbf{b}\odot\psi_{j}^+(\mathbf{v}^l)\right)-\theta_N\left(\mathbf{b}\odot\psi_{j}^+(\mathbf{z}^l)\right) \right] \right| \nonumber \\ &\leq \frac{1}{Q} \sum_{l=1}^{Q} \left| \max_n \left|s\left(n,\mathbf{b}\odot\psi_{j}^+(\mathbf{v}^l)\right)\right| - \max_n \left|s\left(n,\mathbf{b}\odot\psi_{j}^+(\mathbf{z}^l)\right)\right| \right| \nonumber \\ &\leq \frac{1}{Q} \sum_{l=1}^{Q} \max_n \left| s\left(n,\mathbf{b}\odot\psi_{j}^+(\mathbf{v}^l)\right) - s\left(n,\mathbf{b}\odot\psi_{j}^+(\mathbf{z}^l)\right) \right| \nonumber \\ & = \frac{1}{Q} \frac{1}{ \sqrt{N}\sigma_b}2|b_m| \leq \frac{1}{Q} \frac{1}{ \sqrt{N}} d \end{align} where \begin{equation*} \left|\max_n |p(n)| - \max_n |q(n)| \right|\leq\max_n |p(n)-q(n)| \end{equation*} is used and $d= 2\sigma_b^{-1}\max_{x\in\mathcal{M}} |x|$. Therefore, $\sum_{m,k} d_{m,k}^2 = Q\frac{N-j-1}{N}d$, which completes the proof for $\hat{g}^+_j$. Similar steps can be taken to proof the result for $\hat{g}^-_j$. \section{Proof of Lemma \ref{lem:variances}} \label{app:variances} \saeedDissertation{I didn't take this path: Recall from the Sign Selection problem statement that $\mathbb{E}[\mathbf{B}]\neq 0$ for $\mathbf{B}\in \mathcal{M}^N$ with any choice of $\mathcal{M}'$. In this proof, however, it is necessary to have zero expected value for the data symbols. Consider $\mathbf{G}=\mathbf{B}\odot \mathbf{V}$ for a random $\mathbf{V}\in\{-1,1\}^N$. Clearly, $\mathbb{E}[\mathbf{G}]=0$. Replacing $C$ with $G$ in the derivations throughout the paper does not alter the decision rules and the solution $\mathbf{x}^\ast$ obtained for a realization of $\mathbf{B}$ will remain the same.\saeed{yes? and why if so? and doesn't make the whole thing just trivial?}} \saeed{from $j+1$?} \subsection{ $R_{ri}(\mathbf{B},\tau)$ a Gaussian random variable} We begin the proof by analyzing $R^j_{ri}(\tau,\mathbf{B})$ at iteration $j$ of the CE Method and for the random vector of data symbols $\mathbf{B}\in\mathcal{M}^N$ which was defined in Lemma~\ref{lem:variances} and is rewritten here as \begin{equation} R^j_{ri}(\tau,\mathbf{B})= \lim_{N\to\infty} h^{ri}_N(\mathbf{B},t_1,t_2), \label{eq:riCorrDef} \end{equation} where $\tau=t_2-t_1$ and \begin{equation} h^{ri}_N(\mathbf{B},t_1,t_2)= \mathbb{E}_{\mathbf{Y}^\pm_j} [\hat{u}_r(t_1, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)\hat{u}_i(t_2, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)]. \label{eq:hriNdef} \end{equation} Based on the definition of the signal $u$ in \eqref{eq:ofdmContSymbolDef}, \begin{align} h^{ri}_N(\mathbf{B},t_1,t_2)&= \frac{1}{N\sigma_b^2} \mathbb{E}_{X_{j+1:N-1}} \left[ \sum_{k_1=j+1}^{N-1} \sum_{k_2=j+1}^{N-1} X_{k_1}\mathrm{Re} \{B_{k_1} e^{i\omega_{k_1} t_1}\} X_{k_2}\mathrm{Im} \{B_{k_2} e^{i\omega_{k_2} t_2}\} \right] \nonumber \\ &=\!\frac{1}{N\sigma_b^2} \sum_{k=j+1}^{N-1} \!\mathrm{Re} \{B_k e^{i\omega_k t_1}\} \mathrm{Im} \{B_k e^{i\omega_k t_2}\}, \label{eqn:rawDefHri} \end{align} where $\omega_k=\frac{2\pi}{N}F_s k$ and the independence of the random sign variables $X_{j+1:N-1}$ in $\mathbf{Y}^\pm_j$ is used. At this juncture, the relation of $j$ and $N$ must be reviewed. Consider two cases: If $j$ remains constant while $N$ grows, it can be easily seen from the following derivations that the desired quantities are identical in the limit, i.e. as $N\to\infty$, to the case where no sign decision is made by the CE Method. The second case is when $j$ grows with $N$, which needs attention and is the assumption in Lemma~\ref{lem:variances}. Specifically, as introduced in Lemma~\ref{lem:variances}, $j=\rho N$ where $0\leq \rho\leq 1$ is a constant rational number. Since the summands in~\eqref{eqn:rawDefHri} are independent, it is straightforward to apply the Central Limit Theorem to show that $h^{ri}_N(\mathbf{B},t_1,t_2)$ converges in distribution to a Gaussian random variable as $N\to\infty$. That is, \begin{equation} R^j_{ri}(\tau,\mathbf{B}) \sim \mathcal{N}\left(\mu_{ri}(\tau),\sigma^2_{ri}\right), \end{equation} where \begin{equation} \mu_{ri}(\tau)= \lim_{N\to\infty} \mathbb{E}\left[h^{ri}_N(\mathbf{B},t_1,t_2)\right] \label{eq:muDef} \end{equation} and \begin{equation} \sigma^2_{ri}= \lim_{N\to\infty} \mathbb{E}\left[\left(h^{ri}_N(\mathbf{B},t_1,t_2)\right)^2\right] - \left(\mu_{ri}(\tau)\right)^2. \end{equation} Next we derive $\mu_{ri}(\tau)$ and show that $\sigma_{ri}^2=0$, which implies that $R^j_{ri}(\tau,\mathbf{B})$ is equal to $\mu_{ri}(\tau)$ with probability one. \subsection{Convergence of $\mu_{ri}(\tau)$} Given the independence of the data symbols, we have \begin{align*} \mathbb{E}[h^{ri}_N(\mathbf{B},t_1,t_2)] & = \frac{1}{2N} \sum_{k=j+1}^{N-1} a_k, \end{align*} where \begin{align*} a_k= \cos(\omega_k t_1) \sin(\omega_k t_2) + \sin(\omega_k t_1) \cos(\omega_k t_2). \end{align*} Consequently, \begin{align} \mathbb{E}[ h^{ri}_N(\mathbf{B}, t_1,t_2)] &= \frac{1}{2N} \sum_{k=j+1}^{N-1} \sin(\omega_k \tau) \nonumber \\ &=\frac{1}{2N} \sum_{k=0}^{N-1} \sin(\omega_k \tau) - \frac{1}{2} \frac{j}{N} \frac{1}{j} \sum_{k=0}^{j} \sin(\omega_k \tau). \label{eqn:twoSeriesForJ} \end{align} where $\tau=t_2-t_1$. Consider the series \begin{equation} \alpha_M= \frac{1}{2M} \sum_{k=0}^{M-1} \sin\left(\frac{2\pi}{M} k F_s \tau\right) \end{equation} which can be shown to converge as \begin{equation*} \lim_{M\to\infty} \alpha_M = \frac{1}{4\pi F_s \tau} \left(1-\cos(2\pi F_s \tau)\right), \quad \tau \neq 0. \end{equation*} Recall that $j=\rho N$, where $\rho=\frac{m}{p}$ is an irreducible fraction, dictates that $N$ grows as $N=m,2m,\ldots$ with $m\in\mathbb{N}$. Consequently, the first series in \eqref{eqn:twoSeriesForJ}, i.e. \begin{equation*} \beta_N= \frac{1}{2N} \sum_{k=0}^{N-1} \sin(\frac{2\pi}{N} k F_s \tau), \quad N=m,2m,\ldots \end{equation*} is a subsequence of $\{\alpha_M\}$, which readily shows that \cite{Rudin1987} \begin{equation*} \lim_{N\to\infty} \beta_N = \lim_{M\to\infty} \alpha_M. \end{equation*} Rewriting $\frac{2\pi}{N}$ as $\frac{2\pi}{j} \frac{j}{N}=\frac{2\pi}{j} \rho$, the second series in \eqref{eqn:twoSeriesForJ} can be written as \begin{equation*} \zeta_j=\frac{1}{j} \sum_{k=0}^{j} \sin(\frac{2\pi}{j} \rho F_s k \tau),\quad j=p,2p,\ldots. \end{equation*} Then $\zeta_j$ is a subsequence of a sequence similar to $\{\alpha_M\}$ and consequently \begin{equation*} \lim_{j\to\infty} \zeta_j = \frac{1}{4\pi F_s \rho \tau} (1-\cos(2\pi F_s \rho \tau)), \quad \tau\neq 0 \end{equation*} Therefore, \eqref{eqn:twoSeriesForJ} converges. Substituting the limit in \eqref{eq:muDef}, we have \begin{align} &\mu_{ri}(\tau) = \begin{dcases} \frac{1}{4\pi F_s \tau} \left(\frac{1}{\rho}\cos(2\pi F_s \, \rho\,\tau)\!-\! \cos(2\pi F_s \tau)\right) & \tau\neq 0 \\ 0 & \tau=0 \end{dcases} \end{align} where the case of $\tau=0$ is trivial. \subsection{Convergence of $\sigma_{ri}^2$ to zero} Consider that \begin{align*} \left(h^{ri}_N(\mathbf{B},t_1,t_2)\right)^2 &=\frac{1}{N^2 \sigma_b^4} &\Bigg( \sum_{k=j}^{N-1} \Big[B_k^r \cos(\omega_k t_1) -B_k^i \sin(\omega_k t_1)\Big] \Big[B_k^r \sin(\omega_k t_2) -B_k^i \cos(\omega_k t_2)\Big] \Bigg)^2 \end{align*} where $B_k^r=\mathrm{Re}[B_k]$ and $B_k^i=\mathrm{Im}[B_k]$. By some manipulations which are omitted for the sake brevity, we have \begin{align} \mathbb{E} \left[\left(h^{ri}_N(\mathbf{B},t_1,t_2)\right)^2\right] =&\ \frac{1}{N^2 \sigma_b^4} \Bigg(\frac{\sigma_b^4}{4}\Big(\sum_{k=j}^{N-1} a_k \Big)^2 - \frac{\sigma_b^4}{4}\sum_{k=j}^{N-1} a_k^2 \nonumber \\ & + \gamma \sum_{k=j}^{N-1} \left[ \left(\cos(\omega_k t_1) \sin(\omega_k t_2)\right)^2 + \left(\cos(\omega_k t_2) \sin(\omega_k t_1)\right)^2\right] \nonumber \\ & - \frac{\sigma_b^4}{2} \sum_{k=j}^{N-1} \cos(\omega_k t_1) \cos(\omega_k t_2) \sin(\omega_k t_1) \sin(\omega_k t_2) \Bigg), \label{eq:EhriN2} \end{align} and $\gamma=\mathbb{E}[(B^r_k)^4]$. Notice that all summands in the four summations of \eqref{eq:EhriN2} are bounded. For instance, $\frac{1}{N^2} \sum_{k=j}^{N-1} a_k^2 \leq \frac{1}{N} A$ with $a_k^2\leq A$ for some $A \geq 0$. Consequently, the non-negative series $\frac{1}{N^2} \sum_{k=j}^{N-1} a_k^2$ converges to zero. By the same argument, the third and fourth summations in \eqref{eq:EhriN2} vanish in the limit too. That is, \begin{align} \lim_{N\to\infty} \mathbb{E}\left[\left(h^{ri}_N(\mathbf{B},t_1,t_2)\right)^2\right] =\lim_{N\to\infty} \Bigg(\frac{1}{2 N}\sum_{k=j}^{N-1} a_k \Bigg)^2. \end{align} It was already shown in derivation of $\mu_{ri}(\tau)$ that $\frac{1}{N}\sum_{k=j}^{N-1}a_k$ converges. Therefore, \cite{Rudin1987} \begin{align*} \lim_{N\to\infty} \Bigg(\frac{1}{2 N}\sum_{k=j}^{N-1} a_k \Bigg)^2 = \Bigg( \lim_{N\to\infty} \frac{1}{2 N}\sum_{k=j}^{N-1} a_k \Bigg)^2 =\Big(\mu_{ri}(\tau)\Big)^2. \end{align*} Finally, \begin{align} \sigma_{ri}^2&=\lim_{N\to\infty} \Bigg(\frac{1}{2 N}\sum_{k=j}^{N-1} a_k \Bigg)^2 - \Big(\mu_{ri}(\tau)\Big)^2=0. \label{eq:sigmaRIzero} \end{align} Consequently, we have shown that $R_{ri}(\mathbf{B},\tau)$ is an \emph{almost surely constant} random variable and $R_{ri}(\mathbf{B},\tau)=\mu_{ri}(\tau)$ with probability one. This completes the proof for $R_{ri}(\mathbf{B}, \tau)$. \subsection{$R_{rr}(\mathbf{B}, \tau)$ and $R_{ii}(\mathbf{B}, \tau)$} Similarly, for $R_{rr}(\mathbf{B}, \tau)$ we have \begin{align} h^{rr}_N(\mathbf{B},t_1,t_2)&= \mathbb{E} \left[\hat{u}_r(t_1, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j) \ \hat{u}_r(t_2, \mathbf{B}\!\odot\! \mathbf{Y}^\pm_j)\right] =\frac{1}{N\sigma_b^2} \sum_{k=j}^{N-1} \mathrm{Re} \{b_k e^{i\omega_k t_1}\} \mathrm{Re} \{b_k e^{i\omega_k t_2}\} \nonumber \end{align} with \begin{align} \mu_{rr}(\tau)&= \lim_{N\to\infty} \mathbb{E}\left[h^{rr}_N(\mathbf{B},t_1,t_2)\right] \nonumber \\ &= \frac{1}{2}\lim_{N\to\infty} \frac{1}{N} \sum_{k=j}^{N-1} \cos(\omega_k \tau) \nonumber \\ &= \frac{1}{2}\left(\mathrm{sinc} (2F_s\tau)- \rho \mathrm{sinc} (2F_s\tau \rho)\right). \end{align} Following the steps taken to derive \eqref{eq:sigmaRIzero}, we have \begin{equation*} \sigma^2_{rr}= \lim_{N\to\infty} \mathbb{E}\left[\left(h^{rr}_N(\mathbf{B},t_1,t_2)\right)^2\right] - \left(\mu_{rr}(\tau)\right)^2=0, \end{equation*} which implies that $R_{rr}(\mathbf{B},\tau)=\mu_{rr}(\tau)$ with probability one and completes the proof. Finally, the derivations for $R_{ii}(\mathbf{B}, \tau)$ are identical to that of $R_{rr}(\mathbf{B}, \tau)$. \saeedDissertation{ For $R_{ii}(\tau)$ we have \begin{align*} h^{ii}_N(\mathbf{b},t_1,t_2)&= \mathbb{E} [u_i(t_1)u_i(t_2)] \\ &=\frac{1}{N} \sum_{k=0}^{N-1} \mathrm{Im} \{c_k e^{i\frac{2\pi}{N}F_s k t_1}\} \mathrm{Im} \{c_k e^{i\frac{2\pi}{N}F_s k t_2}\} \nonumber \end{align*} with \begin{align*} \mathbb{E}[h_{ii}(\mathbf{B},t_1,t_2)]&= \lim_{N\to\infty} \mathbb{E}[h^{ii}_N(\mathbf{B},t_1,t_2)] \\ &= \frac{\sigma_b^2}{2}\lim_{N\to\infty} \frac{1}{N} \sum_{k=j}^{N-1} \cos(\frac{2\pi}{N} F_s k \tau) \end{align*} which is the same as derivations for $R_{rr}(\tau)$ .} \saeedLater{Question: Would it not be simpler to go with $\mathbb{E}_\mathbf{C\odot\mathbf{X}}[]= \mathbb{E}_\mathbf{B} \mathbb{E}_\mathbf{X}[]$ from scratch?} \saeedLater{Triangular array} \bibliographystyle{IEEEtran}
\section*{Introduction} The concept of Freiman ideals appeared the first time in \cite{HZ}. Based on a famous theorem from additive number theory, due to Freiman \cite{F1}, it was proved in \cite{HMZ} that if $I\subset S$ is an equigenerated monomial ideal, then $\mu(I^2)\geq \ell(I)\mu(I)-{\ell(I)\choose 2}$. Here $\mu(I)$ denotes the least number of generators of the ideal $I$ and $\ell(I)$ the analytic spread of $I$. The assumption that $I$ be equigenerated is essential. Indeed, in \cite{EHM} it has been shown that for every integer $m\geq 6$, there exists a monomial ideal $I\subset K[x, y]$ such that $\mu(I) = m$ and $\mu(I^2) = 9$. In \cite{HZ} an equigenerated monomial $I$ is called {\em Freiman} if $\mu(I^2)= \ell(I)\mu(I)-{\ell(I)\choose 2}$. In the same paper we characterized Freiman ideals for special classes of principal Borel ideals and Veronese type ideals. One purpose of this paper is to give a full classification of Freiman ideals for all principal Borel ideals and all Veronese type ideals with constant bound, thereby generalizing the results of \cite{HZ}. In \cite{HHZ}, subsequent to paper \cite{HZ}, a more systematic treatment of Freiman ideals was presented. Among several other characterizations of the Freiman property, it was shown in \cite{HHZ} that $I$ is a Freiman ideal if and only if the fiber cone of $I$ has a $2$-linear resolution. This is a particularly nice property which implies that the defining ideal of the fiber cone of $I$ is generated by quadrics. In the present paper we use this characterization of Freiman ideals. There is a remarkable property of equigenerated monomial ideals, called sortability, which guarantees that the defining relations of their fiber cone is generated by the so-called sorting relations. The sorting relations are quadratic binomials and form a Gr\"obner basis with respect to a suitable monomial order. Sortable sets of monomials have been introduced by Sturmfels \cite{St}. Some basic properties of sortable ideals are discussed in \cite{EH}. In Section $1$ we associated with a sortable ideal $I$ a finite simple graph $G_{I,s}$, whose edges correspond to the sortable pairs of the monomial generators of $I$, and prove in Theorem~\ref{main} that a sortable ideal $I$ is Freiman, if and only if $G_{I,s}$ is chordal. This will be our main tool to give in the following sections a complete characterization of Freiman principal Borel ideals and of Freiman ideals of Veronese type with constant bound. \section{Sortability and the Freiman property} The aim of this section is to analyze what it means that a sortable monomial ideal is a Freiman ideal. Let $K$ be a field and $S=K[x_1,\ldots,x_n]$ be the polynomial ring over $K$ in $n$ indeterminates. Let $d$ be a positive integer, $S_d$ the $K$-vector space generated by the monomials of degree $d$ in $S$, and take two monomials $u,v\in S_d$. We write $uv=x_{i_1}x_{i_2}\cdots x_{i_{2d}}$ with $1\leq i_1\leq i_2\leq \cdots \leq i_{2d}\leq n$, and define $$u'=x_{i_1}x_{i_3}\cdots x_{i_{2d-1}},\quad \text{and} \quad v'=x_{i_2}x_{i_4}\cdots x_{i_{2d}}.$$ The pair $(u',v')$ is called the {\it sorting} of $(u,v)$. In this way we obtain a map \[ \sort: S_d\times S_d \to S_d\times S_d,\ (u, v)\mapsto (u', v'). \] This map is called the sorting operator. For example, if $u=x_1x_3^{2}$ and $v=x_2^2x_3$, then $\sort(u,v)= (x_1x_2x_3, x_2x_3^2)$. A pair $(u,v)$ is called to be {\em sorted} if $\sort(u,v)=(u,v)$ or $\sort(u,v)=(v,u)$, otherwise it is called to {\em unsorted}. Notice that $\sort(u,v)=\sort(v,u)$. \begin{Definition} \label{HHF}{\em A subset $B\subset S_d$ of monomials is called {\em sortable} if $\sort(B\times B)\subset B\times B$.} \end{Definition} Let $I$ be an equigenerated monomial ideal. The unique minimal set of monomial generators of $I$ is denoted by $G(I)$. We call $I$ a {\em sortable ideal}, if $G(I)$ is a sortable set. The defining ideal $J$ of the fiber cone $F(I)$ of a sortable ideal $I$ has very nice Gr\"obner basis. Indeed, let $R$ be the polynomial ring $K[t_v\; | \; v \in G(I)]$, and $\phi: R \to F(I)$ be the $K$-algebra homomorphism which maps $t_v$ to $v$ for all $v \in G(I)$. We denote by $J$ the kernel of $\phi$. Then $F(I)=R/J$. Obviously, the quadratic binomials $f_{(u,v)}=t_ut_v-t_{u^\prime}t_{v^\prime}$ with $(u,v)$ unsorted belong to $J$. In \cite{DN}, De Negri noticed the following fact which easily follows from a theorem of Sturmfels \cite{St} (see also \cite[Theorem 6.16]{EH}), and which is crucial for this paper. \begin{Theorem}\label{algebra} Let $I$ be a sortable ideal. Then there exists a monomial order $<$ on $R$ such that $\ini_<(f_{(u,v)})=t_ut_v$ for all unsorted pairs $(u,v)$ with $u,v\in G(I)$. Moreover, the set of binomials $\MG=\{f_{(u,v)}\:\; (u,v)\text{ is unsorted }\}$ is a Gr\"obner basis of the toric ideal $J$. \end{Theorem} With a sortable ideal $I$ we attach two graphs, namely the {\em sorted graph} $G_{I,s}$ of $I$, and the {\em unsorted graph} $G_{I,u}$ of $I$. The vertex sets of both graphs is $G(I)$. Its edge sets are \[ E(G_{I,s})=\{\{u,v\}\: \text{$u\neq v$, $(u,v)$ is sorted}\}, \] and \[ E(G_{I,u})=\{\{u,v\}\: \text{$u\neq v$, $(u,v)$ is unsorted}\}. \] Theorem~\ref{algebra} implies that $\ini_<(J)$ is the edge ideal of $G_{I,u}$, where $J$ is the defining toric ideal of the fiber cone $F(I)$ of $I$. Then For a graph $G$ we denote by $G^c$ the {\em complementary graph} of $G$, which is the graph with the same vertex set as that of $G$ and with \[ E(G^{c})=\{\{u,v\}\\:\; \{u,v\}\not\in E(G)\}. \] Obviously one has $(G_{I,u})^c=G_{I,s}$. \medskip \cite{F1} one has that $h_2\geq 0$, see \cite[Corollary 2.6]{HMZ}. The ideal $I$ is called a {\em Freiman ideal} if $h_2=0$. Freiman ideals are characterized by the following result shown in \cite[Theorem 1.3]{HHZ}. \begin{Theorem} \label{characterize} Let $I$ be any equigenerated monomial ideal. Then $I$ is a Freiman ideal if and only if $F(I)$ is Cohen-Macaulay and the defining ideal of $F(I)$ has a $2$-linear resolution. \end{Theorem} Now we are ready to prove the main result of this section. \begin{Theorem} \label{main} Let $I$ be a sortable ideal. Then $I$ is Freiman if and only if the sorted graph $G_{I,s}$ of $I$ is chordal. In particular, if $G_{I,s}$ contains an induced $t$-cycle with $t\geq 4$, then $I$ is not Freiman. \end{Theorem} \begin{proof} Let $I$ be sortable, and let $J$ be the defining toric ideal of $F(I)$. By Theorem~\ref{algebra}, $\ini_<(J)$ is squarefree. By \cite{St} (see also \cite[Corollary 4.26]{HHO}) this implies that $F(I)$ is normal. Then by a theorem of Hochster \cite{Ho} it follows that $F(I)$ is Cohen-Macaulay. As observed before, $\ini_<(J)$ is the edge ideal of $G_{I,u}$ and that $G_{I,u}^c=G_{I,s}$. Now we apply a famous and well-known theorem of Fr\"oberg \cite{F} and deduce that $\ini_<(J)$ has a $2$-linear resolution, due to the fact that $G_{I,s}$ is chordal by assumption. This implies that $J$ has $2$-linear resolution as well, see for example \cite[Theorem 3.3.4]{HH}. Thus $I$ is Freiman by Theorem~\ref{characterize}. Conversely, assume that $I$ is Freiman. Then $J$ has a $2$-linear resolution. Since $\ini_<(J)$ is squarefree, it follows from \cite[Corollary 2.7]{CV} that $\ini_<(J)$ has a $2$-linear resolution as well. Again applying the theorem of Fr\"oberg it follows that $G_{I,s}$ is chordal. \end{proof} In the following sections we apply this theorem to special classes of monomial ideals. \section{Freiman principal Borel ideals} A monomial ideal $I\subset S$ is called {\em strongly stable}, if for all $v\in G(I)$ and all $j\in \supp(v)$ it follows that $x_i(v/x_j)\in I$ for all $i<j$. Given monomials $v_1,\ldots,v_m\in S$, there exists a unique smallest strongly stable ideal, denoted $B(v_1,\ldots,v_m)$, which contains monomials $v_1,\ldots,v_m$. The monomial ideal $I$ is called a {\em principal Borel ideal} if $I=B(v)$ for some monomial $v\in S$. \begin{Example} \label{National Day}{\em Let $I=B(v)$, where $v=x_3^2$, then $G(I)=\{x_1^2,x_1x_2,x_1x_3,x_2^2,x_2x_3,x_3^2\}$. The edge set of the sorted graph of $I$ is \begin{eqnarray*} &&\{\{x_1^2,x_1x_2\},\{x_1^2,x_1x_3\},\{x_1x_2,x_1x_3\}, \{x_1x_2,x_2^2\},\{x_1x_2,x_2x_3\},\\ &&\{x_1x_3,x_2x_3\},\{x_1x_3,x_3^2\}, \{x_2^2,x_2x_3\},\{x_2x_3,x_3^2\}\}. \end{eqnarray*} } \end{Example} The following theorem characterizes all Freiman ideals among the principal Borel ideals. \begin{Theorem}\label{ $0$-spreadprincipalBore} Let $d\geq 2$ and $n\geq 3$ be two integers, and $S=K[x_1,\ldots,x_n]$ the polynomial ring over $K$ in $n$ indeterminates. Let $u$ be a monomial of degree $d$ in $S$. Then \begin{enumerate} \item[(a)] If $d=2$, then $B(u)$ is Freiman if and only if $u$ is a minimal monomial generator of $(x_1,x_2,x_3)^2$, or $x_1(x_4,\ldots,x_n)$, or $x_2(x_4,\ldots,x_n)$. \item[(b)] If $d=3$, then $B(u)$ is Freiman if and only if $u$ is a minimal monomial generator of $x_1(x_1,x_2,x_3)^2$, or $x_1(x_1,x_2)x_i$ with $i>3$, or $x_2^2(x_2,\ldots,x_n)$. \item[(c)] If $d\geq 4$, then $B(u)$ is Freiman if and only if $u=x_{1}^{d-2}x_{3}^2$, or $u$ is a minimal monomial generators of $x_1^{d-1}(x_1,\ldots,x_n)$, or $x_{1}^{d-r-1}x_{2}^{r}(x_i,\ldots,x_n)$ where $1\leq r\leq d-1$ and $i\geq 2$. \end{enumerate} \end{Theorem} \begin{proof} (a) is shown in \cite[Theorem 4.2 (a)]{HZ}. (b) Let $v\in S$ be a monomial. Then \begin{eqnarray} \label{fact} \text{$B(v)$ is Freiman if and only if $B(x_1^kv)$ is Freiman.} \end{eqnarray} We will use this fact several times in the proof. By applying (\ref{fact}) and the result in (a), we obtain that $B(u)$ is Freiman if $u$ is a minimal monomial generator of $x_1(x_1,x_2,x_3)^2$, or $x_1(x_1,x_2)x_i$ with $i>3$, and by \cite[Theorem 4.2 (b)]{HZ}, we see that $B(u)$ is Freiman if $u$ is a minimal monomial generator of $x_2^2(x_2,\ldots,x_n)$. It remains to be shown that $B(u)$ is not Freiman if $u$ is different from the monomials listed (b). Then $u$ is a minimal monomial generator of the following ideals: (i) $x_1(x_4,\ldots,x_n)^2$, or (ii) $x_1x_3(x_4,\ldots,x_n)$, or (iii) $x_2(x_3,\ldots,x_n)^2$, or (iv) $(x_3,\ldots,x_n)^3$. By (\ref{fact}) we have to show that $B(u)$ is not Freiman if $u$ is a minimal monomial generator of the following ideals: (i) $(x_4,\ldots,x_n)^2$, or (ii) $x_3(x_4,\ldots,x_n)$, or (iii) $x_2(x_3,\ldots,x_n)^2$, or (iv) $(x_3,\ldots,x_n)^3$. For case (i) or (ii), $B(u)$ is not Freiman by (a). For case (iii) or (iv), the elements $u_1=x_1x_2^2$, $u_2=x_1^2x_2$, $u_3=x_1^2x_3$, $u_4=x_1x_3^2$, $u_5=x_2x_3^2$ and $u_6=x_2^2x_3$ are the vertices of an induced $6$-cycle of $G_{B(u),s}$. Indeed, $(u_i,u_{i+1})$ for $i=1,\ldots, 5$ and $(u_1,u_6)$ are sorted pairs, while the pairs corresponding to the chords of the $6$-cycle are not sorted. This show that it is is an induced $6$-cycle. Hence $B(u)$ is not Freiman by Theorem~\ref{main}. (c) Suppose first that $u=x_{1}^{d-2}x_{3}^2$, or $u$ is a minimal monomial generator of $x_1^{d-1}(x_1,\ldots,x_n)$, or $x_{1}^{d-r-1}x_{2}^{r}(x_i,\ldots,x_n)$ where $1\leq r\leq d-1$ and $i\geq 2$. By (\ref{fact}) it is enough to consider the case $u=x_{3}^2$, or $u$ is a minimal monomial generator of $(x_2,\ldots,x_n)$, or $x_{2}^{r}(x_i,\ldots,x_n)$ where $1\leq r\leq d-1$ and $i\geq 2$. It follows from \cite[Theorem 3.3 and Theorem 4.2]{HZ} that $B(u)$ is Freiman. Now we will prove that $B(u)$ is not Freiman if $u$ is different from the monomials listed (c). Then $u$ is a minimal monomial generator of $x_1^{a}x_2^{b}(x_3,\ldots,x_n)^{d-(a+b)}$ where $0\leq a+b\leq d-2$. By applying (\ref{fact}) we have to show that if $u$ is a minimal monomial generator of the following ideals: (i) $x_2^{d-\ell}(x_3,\ldots,x_n)^{\ell}$ with $\ell\geq 2$, or (ii) $x_3(x_3,\ldots,x_n)^{\ell}$ with $\ell=2,\ldots,d-1$, or (iii) $(x_3,\ldots,x_n)^{\ell}$ with $\ell=3,\ldots,d$, then $B(u)$ is not Freiman. In all these cases, the elements $x_1^{d-2}x_2^2$, $x_1^{d-1}x_2$, $x_1^{d-1}x_3$, $x_1^{d-2}x_3^2$, $x_1^{d-3}x_2x_3^2$ and $x_1^{d-3}x_2^2x_3$ are the vertices of an induced $6$-cycle of $G_{B(u),s}$. Hence $B(u)$ is not Freiman, as desired. \end{proof} \section{Freiman ideals of Veronese type with constant bound} Given positive integers $n$, $d$ and a sequence $\ab$ of integers $1\leq a_1\leq \cdots \leq a_n\leq d$ with $\sum_{i=1}^na_i>d$, one defines the monomial ideal $I_{\ab,n,d}\subset S=K[x_1,\ldots,x_n]$ with \[ G(I_{\ab,n,d})=\{x_1^{b_1}x_2^{b_2}\cdots x_n^{b_n}\; \mid \; \sum_{i=1}^nb_i=d \text{ and $b_i\leq a_i$ for $i=1,\ldots,n$}\}. \] In this section we only consider the case that $a_i=k$ for $i=1,\ldots,n$, and denote the corresponding Veronese type ideal with constant bound $k$ by $I_{k,n,d}$. Note that $I_{k,n,d}=I_{d,n,d}$ if $k>d$. Therefore, we may always assume that $k\leq d$. \medskip \begin{Lemma} \label{specialk} The ideal $I_{k,n,d}$ is sortable. \end{Lemma} \begin{proof} Let $u,v\in G(I_{k,n,d})$, and let $\sort(u,v)= (u',v')$. Let $uv=x_{i_1}x_{i_2}\ldots x_{i_{2d}}$. Let $j$ be an integer with $1\leq j\leq n$, and let $\ell_1\leq \ell_2$ be the integer with the property that $i_\ell=j$ if and only if $\ell_1\leq \ell \leq \ell_2$. Then $\ell_2-\ell_1+1\leq 2k$. Let $u'=x_1^{c_1}\cdots x_n^{c_n}$. Then $c_j=|\{\ell\:\; \ell_1\leq \ell \leq \ell_2 \text{ and } \ell \text{ is odd}\}|$. It follows that $c_j\leq k$ for all $j$, and this implies that $u'\in G(I_{k,n,d})$, Similarly, $v'\in G(I_{k,n,d})$. \end{proof} Since $I_{k,n,d}$ is sortable, we may apply Theorem~\ref{main} to check which of the ideals $I_{k,n,d}$ are Freiman. \medskip In the following proofs we will use \begin{Lemma} \label{variable} Let $A=K[x_1,\ldots,x_n]$ and $B=A[y]$ be polynomial rings over a field $K$. Let $I=(u_1,\ldots, u_m)\subset A$ be a monomial ideal generated in degree $d$, and $J\subset B $ a monomial ideal generated in degree $d+1$ with $(yu_1,\ldots, yu_m)\subset J$. If $I$ is not Freiman, then $J$ is not Freiman. \end{Lemma} \begin{proof} Since $I$ is not Freiman, there exists an induced $t$-cycle $C_t$ with $t\geq 4$ of $G_{I,s}$. Let $\{u_{i_1},\ldots, u_{i_t}\}$ be the vertex set of $C_{t}$, then $yu_{i_1},\ldots, yu_{i_t}\in J$. It follows that the elements $yu_{i_1},\ldots, yu_{i_t}$ form the vertices of an induced $t$-cycle of $G_{J,s}$. Therefore, $J$ is not Freiman. \end{proof} The following theorem classifies the Freiman ideals of the form $I_{1,n,d}$. \begin{Theorem} \label{specialk} The ideal $I_{1,n,d}$ is Freiman, if and only if one of the following conditions holds: \begin{enumerate} \item[(a)] $n=2$ and $d=1$. \item[(b)] $n\geq 3$ and $d=1$, or $d=n-1$. \end{enumerate} \end{Theorem} \begin{proof} If $d=1$ or $d=n-1$, then the sorted graph $G_{I_{1,n,d},s}$ is a complete graph. Thus Theorem \ref{main} implies that $I_{1,n,d}$ is Freiman. It remains to be shown that $I_{1,n,d}$ is not Freiman if $n\geq 4$ and $2\leq d\leq n-2$. In this case, the elements $(\prod\limits_{j=4}^{d+1}x_{n-j})x_{n-3}x_{n-2}$, $(\prod\limits_{j=4}^{d+1}x_{n-j})x_{n-3}x_n$, $(\prod\limits_{j=4}^{d+1}x_{n-j})x_{n-1}x_n$, and $(\prod\limits_{j=4}^{d+1}x_{n-j})x_{n-2}x_{n-1}$, are the vertices of an induced $4$-cycle of $G_{I_{1,n,d},s}$, where $\prod\limits_{j=4}^{d+1}x_{n-j}=1$ if $d=2$. It follows that $I_{1,n,d}$ is not Freiman. \end{proof} Next we consider the case $k=2$. \begin{Theorem} \label{k=2} The ideal $I_{2,n,d}$ is Freiman if and only if one of the following conditions holds: \begin{enumerate} \item[(a)] $n=2$ and $d=2$, or $d=3$. \item[(b)] $n=3$ and $d=2$, or $d=4$, or $d=5$. \item[(c)] $n\geq 4$ and $d=2n-1$. \end{enumerate} \end{Theorem} \begin{proof} (a ) By a simple computation shows that $I_{2,n,d}$ is Freiman if $d=2$ or $d=3$. (b) Since the graphs $G_{I_{2,3,2},s}$, $G_{I_{2,3,4},s}$ and $G_{I_{2,3,5},s}$ are chordal, as can be seen easily, the ideals $I_{2,3,2}$, $I_{2,3,4}$ and $I_{2,3,5}$ are Freiman. If $d=3$, then the elements $x_1x_2^2,x_1^2x_2,x_1^2x_3,x_1x_3^2,x_2x_3^2$ and $x_2^2x_3$ are the vertices of an induced $6$-cycle of $G_{I_{2,3,3},s}$. It follows that $I_{2,3,3}$ is not Freiman. (c) If $d=2n-1$, then $I_{2,n,d}=(x_1\prod\limits_{j=2}^{n}x_j^2,\ldots,x_i\prod\limits_{\begin{subarray}{l} j=1\\ j\neq i \end{subarray}}^{n}x_j^2,\ldots,x_n\prod\limits_{j=1}^{n-1}x_j^2)$. Thus $G_{I_{2,n,d},s}$ is a complete graph. Hence $I_{2,n,d}$ is Freiman. Next we prove that $I_{2,n,d}$ is not Freiman if $d\neq 2n-1$. We apply induction on $n$. First, we consider the case $n=4$. Then $d=2,3,4,5$ or $6$, If $d=2$, then the elements $x_1x_2$, $x_1x_4$, $x_3x_4$ and $x_2x_3$ are the vertices of an induced $4$-cycle of $I_{2,4,2}$. If $d=3$, then the elements $x_1^2x_2$, $x_1^2x_4$, $x_1x_3x_4$ and $x_1x_2x_3$ are the vertices of an induced $4$-cycle of $I_{2,4,3}$. If $d=4$, then the elements $x_1^2x_2^2$, $x_1^2x_2x_4$, $x_1x_2x_3x_4$ and $x_1x_2^2x_3$ are the vertices of an induced $4$-cycle of $I_{2,4,4}$. If $d=5$, then the elements $x_1^2x_2^2x_3$, $x_1^2x_2x_3x_4$, $x_1x_2x_3^2x_4$ and $x_1x_2^2x_3^3$ are the vertices of an induced $4$-cycle of $I_{2,4,5}$. Finally, if $d=6$, then the elements $x_1^2x_2^2x_3x_4$, $x_1^2x_2x_3x_4^2$, $x_1x_2x_3^2x_4^2$ and $x_1x_2^2x_3^3x_4$ are the vertices of an induced $4$-cycle of $I_{2,4,6}$. This shows that $I_{2,n,d}$ for $d=2,\ldots, 6$ is not Freiman. Let $n\geq 5$. By the induction hypothesis we know that $I_{2, n-1,d}$ is not Freiman for $d=2,\ldots,2n-4$. Therefore, by Lemma~\ref{variable}, it follows that $I_{2, n,d}$ is not Freiman for $d=2,\ldots,2n-4$. Hence remains to be shown that $I_{2,n,d}$ is not Freiman for $d=2n-3$ and $d=2n-2$. The ideal $I_{2,n-1,2n-4}$ is not Freiman for $n=5$ as shown before, and if $n>5$, $I_{2,n-1,2n-4}$ is not Freiman by the induction hypothesis. Hence there exists an induced $t$-cycle $C_t$ of length $t\geq 4$ in $G_{I_{2,n-1,2n-4},s}$. Let $\{u_{i_1},\ldots, u_{i_t}\}\subset K[x_1,\ldots,x_{n-1}]$ be the vertex set of $C_{t}$. If $d=2n-3$, then the elements $u_{i_1}x_n,\ldots, u_{i_t}x_n$ are the vertices of an induced $t$-cycle of $G_{I_{2,n,2n-3},s}$. Hence $I_{2,n,2n-3}$ is not Freiman. Finally, if $d=2n-2$, then the elements $u_{i_1}x_n^2,\ldots, u_{i_t}x_n^2$ are the vertices of an induced $t$-cycle of $G_{I_{2,n,2n-2},s}$. Hence $I_{2,n,2n-2}$ is not Freiman. This completes the proof. \end{proof} The next theorem treats the case $k\geq 3$. \begin{Theorem} \label{k=3} Let $k\geq 3$. The ideal $I_{k,n,d}$ is Freiman if and only if one of the following conditions holds: \begin{enumerate} \item[(a)] $n=2$ and $d=k,\ldots,2k-1$. \item[(b)] $n=3$ and $d=3k-2$ or $d=3k-1$. \item[(c)] $n\geq 4$ and $d=kn-1$. \end{enumerate} \end{Theorem} \begin{proof} (a) The graph $G_{I_{2,n,d},s}$ is path graph for $d=k,\ldots,2k-1$. Hence $I_{2,n,d}$ is Freiman. (b) For $d=3k-2$ the graph $G_{I_{k,3,d},s}$ has 6 vertices, and for and $d=3k-1$ it has 4 vertices. It can be checked that both graphs are chordal. Hence $I_{k,3,d}$ is Freiman for $d=3k-2$ or $d=3k-1$. It remains to be shown that $I_{k,3,d}$ is not Freiman if $d=k,\ldots, 3k-3$. If $d=k$, then $I_{k,3,d}$ is not Freiman by \cite[Theorem 3.3]{HZ}. If $k+1\leq d\leq 2k-1$, then the elements $x_1^{k-1}x_{2}^{d-k+1},x_1^{k}x_{2}^{d-k},x_1^{k}x_{2}^{d-k-1}x_{3}, x_1^{k-1}x_{2}^{d-k-1}x_{3}^{2},\\ x_1^{k-2}x_{2}^{d-k}x_{3}^{2}, x_1^{k-2}x_{2}^{d-k+1}x_{3}$ are the vertices of an induced $6$-cycle of $G_{I_{k,3,d},s}$, and if $2k\leq d\leq 3k-3$, then the elements $x_1^{k-1}x_{2}^{k}x_{3}^{d-2k+1},x_1^{k}x_{2}^{k-1}x_{3}^{d-2k+1}, x_1^{k}x_{2}^{k-2}x_{3}^{d-2k+2}, \\ x_1^{k-1}x_{2}^{k-2}x_{3}^{d-2k+3}, x_1^{k-2}x_{2}^{k-1}x_{3}^{d-2k+3}, x_1^{k-2}x_{2}^{k}x_{3}^{d-2k+2}$ are the vertices of an induced $6$-cycle of $G_{I_{k,3,d},s}$. Hence, in both cases, $I_{k,3,d}$ is not Freiman by Theorem \ref{main}. (c) If $d=kn-1$, then $I_{k,n,d}=(x_1^{k-1}\prod\limits_{j=2}^{n}x_j^k,\ldots,x_i^{k-1}\prod\limits_{\begin{subarray}{l} j=1\\ j\neq i \end{subarray}}^{n}x_j^k,\ldots,x_n^{k-1}\prod\limits_{j=1}^{n-1}x_j^k)$. It follows that $G_{I_{k,n,d},s}$ is a complete graph. Hence $I_{k,n,d}$ is Freiman. It remains to show that $I_{k,3,d}$ is not Freiman if $k+1\leq d\leq kn-2$. If $k+1\leq d\leq 2k$, then the elements $x_1^{k}x_2^{d-k},x_1^{k}x_2^{d-k-1}x_4,x_1^{k-1}x_2^{d-k-1}x_3x_4$ and $x_1^{k-1}x_2^{d-k}x_3$ are the vertices of an induced $4$-cycle of $G_{I_{k,n,d},s}$, if $2k+1\leq d\leq 3k-1$, then the elements $x_1^{k}x_2^{k}x_3^{d-2k},x_1^{k}x_2^{k-1}x_3^{d-2k}x_4, x_1^{k-1}x_2^{k-1}x_3^{d-2k+1}x_4, x_1^{k-1}x_2^{k}x_3^{d-2k+1}$ are the vertices of an induced $4$-cycle of $G_{I_{k,n,d},s}$, and if $3k\leq d\leq 4k-2$, then the elements $x_1^{k}x_2^{k}x_3^{k-1}x_4^{d-3k+1},x_1^{k}x_2^{k-1}x_3^{k-1}x_4^{d-3k+2}, x_1^{k-1}x_2^{k-1}x_3^{k}x_4^{d-3k+2},x_1^{k-1}x_2^{k}x_3^{k}x_4^{d-3k+1}$ are the vertices of an induced $4$-cycle of $G_{I_{k,n,d},s}$. Now we consider the case $(m-1)k-1\leq d\leq mk-2$ for any $5\leq m\leq n$. In this case the elements $x_1^{k}x_2^{k}x_3^{k-1}x_4^{k-1}(\prod\limits_{j=5}^{m-1}x_j^k)x_m^{d-(m-1)k+2}, x_1^{k}x_2^{k-1}x_3^{k-1}x_4^{k}(\prod\limits_{j=5}^{m-1}x_j^k)x_m^{d-(m-1)k+2},\\ x_1^{k-1}x_2^{k-1}x_3^{k}x_4^{k}(\prod\limits_{j=5}^{m-1}x_j^k)x_m^{d-(m-1)k+2}, x_1^{k-1}x_2^{k}x_3^{k}x_4^{k-1}(\prod\limits_{j=5}^{m-1}x_j^k)x_m^{d-(m-1)k+2}$ are the vertices of an induced $4$-cycle of $G_{I_{k,n,d},s}$. Thus, in all cases, $I_{k,n,d}$ is not Freiman. \end{proof} \medskip \hspace{-6mm} {\bf Acknowledgments} \vspace{3mm} \hspace{-6mm} This research is supported by the National Natural Science Foundation of China (No.11271275) and by foundation of the Priority Academic Program Development of Jiangsu Higher Education Institutions. \medskip \vspace{0.5cm}
\section{Introduction} Despite having been discovered more than fifty years ago, from a theoretical point of view gamma-ray bursts (GRBs) still represent one of the most challenging transient sources of high-energy photons in the Universe. Even if some of the observational features can be explained within the context of the standard fireball model developed by \cite{Rees1992,Meszaros1993,Rees1994}, there are still many important missing pieces of the GRB complex puzzle (see \citealt{Meszaros2019, Zhang2019, Kumar2015, Piran1999, Piran2004}). The physical origin of the prompt emission, for example, is still under debate. Although the synchrotron process has been proposed as the emission mechanism responsible of the observed radiation \citep{Rees1994, Sari1996, Sari1998}, for a long time the predictions of the spectral shape from a population of accelerated electrons cooling via the synchrotron process have been thought to be inconsistent with the shape of the typical observed GRB prompt emission spectra \citep{Preece1998, Ghisellini2000, Kaneko2006, Ghirlanda2009, Nava2011, Gruber2014}. For many years, this inconsistency has been the major argument against the synchrotron interpretation of the GRB prompt emission spectra. Only recently, new observational evidences were found in support of the synchrotron interpretation \citep{Oganesyan2017,Oganesyan2018,Oganesyan2019, Ravasio2018, Ravasio2019}. Extending the investigations down to X-ray and optical bands, a remarkable consistency of the observed GRB prompt spectra and synchrotron predictions has been discovered when electron cooling is taken into account. \cite{Burgess2018} also showed that most of the time-resolved spectra of single-pulse \fe\ GRBs can be successfully fitted by the synchrotron model. The extension of the energy range towards higher energies (> 100 MeV) played a fundamental role in the understanding of the nature of the high energy component produced by these powerful transient sources. The Large Area Telescope (LAT) \citep{Atwood2009} on board the \fe\ satellite detected and characterized the high energy emission of several GRBs \citep{Ajello2019}. The long lasting high energy (100 MeV-100 GeV) emission has been interpreted (see \citealt{Nava2018} for a review) as due to the external shock afterglow of the burst \citep{Kumar2009, Kumar2010, Ghisellini2010, Beniamini2015}. However, the characterization of the transition from the prompt to the afterglow dominance is hampered by evidences of a superposition of these two emission components early on in the burst. GRB 190114C, the first GRB detected by the MAGIC telescopes \citep{Mirzoyan2019} with high significance, opened a new window on the interpretation of the high and very high energy emission (VHE, above 100\,GeV). The analysis of the spectrum at lower energies showed a clear example of the mixture of the prompt and the afterglow components in the same energy band. Using \fe\ Gamma-Ray Burst monitor (GBM) + Large Area Telescope (LAT) and the Neil Gehrels Swift Observatory (hereafter \sw) X-Ray telescope (XRT) + Burst Alert Telescope (BAT) data, \citet{Ravasio2019b} have shown the rise of an additional non-thermal component in the keV-MeV energy range in the very early phases ($\sim 5$\,s after trigger time) of the prompt emission. This component, fitted by a power law $dN/dE\propto E^{\Gamma_{\rm PL}}$ with slope $\Gamma_{\rm PL} \sim -2$, was interpreted as the synchrotron emission from the afterglow of the burst. The difficulties in interpreting the VHE emission of GRB190114C as synchrotron from relativistic electrons \citep{Guilbert1983}, led to ascribe its origin to synchrotron self-compton (SSC) \citep{Derishev2019, Fraija2019, Ravasio2019b, Wang2019}. Recently, GRB 180720B was claimed to be detected at VHE by the H.E.S.S. telescope \citep{CTASymposium}. This GRB is also one of the brightest bursts ever detected by the \fe\ satellite, with a fluence $f= 2.99 \cdot 10^{-4}$ erg cm$^{-2}$ in the energy range 10 - 1000\,keV \citep{Roberts2018}. Its keV--MeV prompt emission spectrum has been analysed, together with other 9 long bright GRBs, in \citet{Ravasio2019} who showed the consistency of the spectral shape with synchrotron emission. It has also been detected by LAT and reported in the LAT GRB catalogue of \citet{Ajello2019}. Therefore, GRB180720B is another interesting event for studying its spectral energy distribution (SED) extending from keV to GeV energies and possibly unveil the transition from the prompt to the afterglow dominance and constrain the physical parameters of the emission process. This paper is based on the study of the evolution of the spectrum of GRB~180720B during the first 500\,s after trigger time, from an analysis of the data of \fe\ (LAT+GBM) and \sw\ (BAT+XRT) satellite. In particular, we extract the light curves and analyse the spectra in order to study the temporal evolution of the spectral energy distribution and the consistency with the synchrotron emission, shown in \S \ref{sec:results}. Interpreting the peak of the LAT light curve as due to the onset of the deceleration of the jet, we derive an estimate of the bulk Lorentz factor $\Gamma_0$ in the cases of a uniform density profile and of a stellar wind density profile for the circum-burst medium (\S \ref{sec:gamma0}). We discuss the theoretical implications of our results and summarise the conclusions in \S \ref{sec:discussion} and \S \ref{sec:conclusions}. \section{Data reduction and analysis}\label{sec:data_analysis} On 20 July 2018 at 14:21:39 UT, \fe/GBM triggered GRB 180720B \citep{Roberts2018}, which was also detected by \sw/BAT \citep{GCN_Swift} and \fe/LAT \citep{GCN_LAT}. The burst was also detected by Konus-Wind \citep{Frederiks2018}, by the CALET Gamma-Ray Burst Monitor \citep{GCN_CALET} and in the X-ray band by MAXI/GSC \citep{GCN_MAXI} and by NuSTAR \citep{GCN_NuSTAR}. GRB~180720B was observed by an intensive follow-up campaign. \sw/XRT began observing the source 86.5 seconds after the BAT trigger. \cite{GCNottico} detected a bright optical counterpart, 73 seconds after the trigger using the 1.5-m Kanata telescope. They measured an R-band apparent magnitude of $m\sim 9.4$ which corresponds to an optical flux $E F(E) \sim 1.4$ keV cm$^{-2}$ s$^{-1}$ at a central frequency of about $4 \times 10^{14}$ Hz. Several other optical ground telescopes observed this burst \citep{GCNottico22979, GCNottico22983, GCNottico22985, GCNottico22988, GCNottico23004, GCNottico23017, GCNottico23020, GCNottico23021, GCNottico23023, GCNottico23024, GCNottico23033, GCNottico23040}. The redshift was measured with the instrument X-shooter on VLT UT2 telescope \citep{Vreeswijk2018}, with the value $z=0.654$. In the radio band, both the Arcminute Microkelvin Imager Large Array (AMI-LA) at 15.5 GHz \citep{GCN_radio1} and the Giant Metrewave radio Telescope at 1.4 GHz \citep{GCN_radio2} observed the field and detected the source. In order to study the transition from the prompt to the afterglow emission in GRB~180720B, we considered five time intervals: 0--35\,s, 35--70\,s, 70--120\,s, 120--200\,s and 200--500\,s (see Fig. \ref{fig:timeline}). These time intervals have been identified with different colors (red, yellow, green, blue and purple, respectively) and this color-code has been used also in Fig.~\ref{fig:lc_GBM} and \ref{fig:lc_lat}. The choice of this subdivision is due both to the different starting times of the observations in different bands and to the variability of the light curves and spectral features of LAT high energy data. In particular, as Fig. \ref{fig:lc_GBM} shows, the first time interval (0-35\,s) includes the main emission event of the GRB. Furthermore, until 35 s the high energy LAT spectrum presents a different behaviour with respect to the rest of the burst (see lower panel in Fig.~\ref{fig:lc_lat}). This aspect will be discussed in \S \ref{sec:results} in more detail. The second time interval (35-70\,s) includes a secondary emission event visible in the GBM light curves (Fig. \ref{fig:lc_GBM}). The third one (70-120\,s) encompasses the peak of the LAT light curve (upper panel in Fig. \ref{fig:lc_lat}) and the last two intervals (120-200\,s and 200-500\,s) follow its decay. In Fig.~\ref{fig:timeline}, for each time interval we mark the instruments we use for the analysis. In the following sections we describe the main data source and the standard procedures adopted for the the data extraction. \begin{figure} \includegraphics[width=\columnwidth]{timeline.pdf} \caption{Time intervals and corresponding instruments providing the spectra used for the spectral analysis of GRB 180720B. The color code corresponding to the sequence of time intervals is used for the following figures but Fig.~\ref{fig:sed1} and Fig.~\ref{fig:sed1_cornerplot}. } \label{fig:timeline} \end{figure} \subsection{\fe/LAT} The LAT instrument on board \fe\ is composed by a tracker and a calorimeter sensitive to $\gamma$--ray photons in the energy range between $30$\,MeV and $300$\,GeV \citep{Ackermann2013}. Data extraction and analysis have been performed with \texttt{gtburst} which is distributed as part of the official \texttt{Fermitools} software\footnote{\url{https://fermi.gsfc.nasa.gov/ssc/data/}\label{Fermiwebsite}}. LAT data were extracted within a temporal window extending 900\,s after the trigger time and filtered selecting photons with energies in the 100\,MeV -- 100\,GeV range, within a region of interest (ROI) of $12^\circ$ centered on the burst position provided by \sw/BAT \citep{Barthelmy2018}. A further selection of photons with a zenith angle from the spacecraft axis $<100^\circ$ was applied in order to reduce the contamination of photons coming from the Earth limb. The highest photon energy is 4.9\,GeV and the corresponding photon has been detected by LAT 137 s after the GBM trigger. These values are consistent with what reported by the \fe/LAT Collaboration \citep{GCN_LAT}. \subsection{\fe/GBM}\label{sec:fermi_gbm} The GBM detector onboard \fe\ is composed of 12 sodium iodide (NaI, 8\,keV -- 1\,MeV) and two bismuth germanate (BGO, 200\,keV -- 40\,MeV) scintillation detectors \citep{Meegan2009}. We analysed the data from the two NaI detectors and the BGO detector with the highest count rates, namely NaI\#6, NaI\#8 and BGO\#1. For each detector, we retrieved the data and the most updated response matrix files from the \fe\ website\textsuperscript{\ref{Fermiwebsite}}. Spectra were extracted with \texttt{gtburst}: we selected energy channels in the range 8–900\,keV for NaI detectors, and 0.3–40\,MeV for the BGO detector, and excluded channels in the 30–40\,keV range due to the presence of the Iodine K-edge at 33.17\,keV\footnote{\url{https://fermi.gsfc.nasa.gov/ssc/data/analysis/GBM_caveats.html}}. The background was modelled over pre- and post-burst time intervals with a polynomial whose order is selected automatically by \texttt{gtburst}. We also fitted the first two time intervals by combining the GBM with the LAT Low Energy events (LLE) data \citep{Pelassa2010}. LAT-LLE data were retrieved from the \fe\ LLE Catalog\footnote{\url{https://heasarc.gsfc.nasa.gov/W3Browse/fermi/fermille.html}} and reduced with a similar procedure as for the GBM data through \texttt{gtburst}. The LLE spectra analysed cover the energy range 30-100\,MeV \citep[e.g.][]{Ajello2019}. \subsection{\sw} The Burst Alert Telescope (BAT) on-board \sw\ \citep{Gehrels2004} is a coded aperture mask which triggers GRBs by imaging photons in the energy range 15--350\,keV. We downloaded BAT event files from the \sw\ archive\footnote{\url{http://heasarc.gsfc.nasa.gov/cgi-bin/W3Browse/swift.pl}}. BAT spectra have been extracted with the {\tt batbinevt} task of {\sc heasoft} package (v6.25) and corrected for systematic errors (with the {\tt batupdatephakw} and {\tt batphasyserr} tasks). The response matrices have been computed by the {\tt batdrmgen} tool for the time intervals before, during and after the \sw\ slew. The X--Ray Telescope (XRT) focuses photons in the 0.3--10\,keV energy range \citep{Wells2004}. We downloaded the XRT event files from \sw/XRT archive\footnote{\url{http://www.swift.ac.uk/archive/}}. The source and background XRT spectra have been extracted with {\tt xselect} and standard procedures \citep{Romano_06} have been adopted to correct for the pile-up of X--ray photons. We have generated the corresponding ancillary response files by the {\tt xrtmkarf} task. The energy channels of XRT below 0.5\,keV and above 10\,keV have been excluded. To include the XRT spectra to the joint broad-band spectral modeling, we have grouped the energy channels by the {\it grppha} tool to have at least 20 counts per bin. \subsection{Spectral analysis}\label{sec:spec_analysis} Throughout the paper we refer to the GBM trigger time. The LAT data have been extracted and analysed for all the five time intervals defined in Fig.~\ref{fig:timeline}. We used \texttt{gtburst} performing an unbinned likelihood analysis and assuming a power law model for the source photon spectrum\footnote{\url{https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/gtburst.html}}. We included the \texttt{P8R3\_TRANSIENT020E\_2} instrument response function, a galactic model template and an isotropic template for particle background to take into account the background emission from the Milky Way, extra-galactic diffuse gamma-rays, unresolved extragalactic sources, residual (misclassified) cosmic-ray emission and other extragalactic sources\footnote{\url{https://fermi.gsfc.nasa.gov/ssc/data/analysis/documentation/Cicerone/Cicerone.pdf}}. For the other instruments we used XSPEC (v12.10.0c) to perform a joint spectral analysis which combined any of the data sets of BAT, XRT, GBM or LLE in all the time intervals. In order to account for inter-calibration uncertainties between the different instruments, we introduced multiplicative factors in the fitting models. We left these factors free to vary except for the detector with the highest count rates, i.e. NaI\#6, whose factor has been frozen to 1. Inspecting the results of the fits the calibration factors between the GBM detectors agree within $\sim 15$\% and those between the GBM and the LLE amount to $\sim 35$\%. The first three time intervals are fitted with a physical model for the synchrotron emission from relativistic electrons. We considered relativistic electrons injected with an energy distribution $dN(\gamma)/d\gamma \propto \gamma^{-p}$ between $\gamma_{\rm min}$ and $\gamma_{\rm max}$ and solved the continuity equation accounting for synchrotron losses. The spectral shape at any time $t$ is determined by the ratio between $\gamma_{\rm min}$ and the electron cooling energy $\gamma_{\rm c}$, and by the value of $p$. In addition to the spectral shape, the model spectrum is specified by two other parameters that determine respectively the energy $E_{\rm m}$ of the photons emitted by electrons of energy $\gamma_{\rm min}$, and the normalization $F_m$ of the $F(E)$ spectrum evaluated at $E_{\rm m}$. Such a model is not present in the XSPEC library and this way to parametrize the model is appropriate for the implementation in XSPEC. Therefore we built table model spectra for different combination of the free parameters and implemented them in XSPEC. From the value of $E_{\rm m}$ and the ratio $\gamma_{\rm min}/\gamma_{\rm c}$ we can derive also the cooling energy $E_{\rm c}$ of the photons emitted by the electrons cooled down to $\gamma_{\rm c}$ using the relation $E_{\rm c} = E_{\rm m} \left(\gamma_{\rm c}/\gamma_{\rm min} \right)^2$. So the four free parameters can be redefined to be $E_{\rm c}$, $E_{\rm m}$, $p$ and the normalization $F_m$. Confidence ranges on these parameters were then derived within XSPEC, through the built-in Markov Chain Monte Carlo algorithm (\texttt{chain} command). The results of the spectral analysis of all the data used in this work are reported in Table~\ref{tab:params}. The four free parameters defined above are also associated to the five physical quantities describing the emitting region, namely the comoving magnetic field $B^\prime$, the total number of emitting electrons $N_{\rm e}$, the bulk Lorentz factor $\Gamma$ and the values of $\gamma_{\rm c}$ and $\gamma_{\rm min}$. We derive the value of the bulk Lorentz factor $\Gamma$ from the onset of the afterglow (see \S \ref{sec:gamma0}). The other four physical quantities can be constrained using this value of $\Gamma$ and the results of the spectral fitting (\S \ref{sec:discussion}). \begin{figure} \includegraphics[width=\columnwidth]{GBM_prompt_lc.pdf} \caption{Background-subtracted light curves of GRB 180720B, detected by NaI\#6 (8--900\,keV, top), BGO\#1 (0.3--40\,MeV, middle), and LAT–LLE (30--100\,MeV, bottom). Different time intervals are highlighted with different colors, according to the color code used in Fig.~\ref{fig:timeline}. } \label{fig:lc_GBM} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{LAT_afterglow_lc.pdf} \caption{\textit{Top}: LAT light curve. The energy flux is integrated over the 100\,MeV -- 100\,GeV energy range. Colored square symbols correspond to the time intervals defined in \ref{fig:timeline}; gray circles show the results of the analysis with a higher time resolution. \textit{Bottom}: Photon indices of the power law model used for the LAT data analysis. Same color coding and symbols of the top panel.} \label{fig:lc_lat} \end{figure} \section{Results}\label{sec:results} Fig.~\ref{fig:lc_GBM} shows the light curves (counts s$^{-1}$) of GRB 180720B detected by three different instruments sensitive to increasing photon energies from top to bottom, NaI (8--900\,keV), BGO (0.3--40\,MeV) and LLE (30--100\,MeV). These light curves show a main event lasting $\sim 35$ s with numerous overlapping pulses and a very bright peak at $t \simeq 15$ s, followed by another peak at $t \simeq 50$\,s. The pulses show the typical fast rise exponential decay (FRED) shape. The observed burst duration $T_{90}$ is 49\,s in the energy range 50-300 keV \citep{Roberts2018}. Fig.~\ref{fig:lc_lat} shows the light curve (top panel) and the photon index evolution (lower panel) obtained from the analysis of the LAT data in the energy range 100 MeV - 100 GeV. The colour-coded symbols correspond to the five time intervals defined in Fig.~\ref{fig:timeline} while the grey points show the results of the analysis of the LAT data on a finer temporal binning using equally-spaced logarithmic temporal bins, except for the first and last time bins, which are longer to have higher photon statistics. The delay between the first photon detected by LAT in the 100 MeV -- 100\,GeV range and the GBM trigger is approximately 5\,s. To fit the LAT spectrum in each time interval we use a power law model. The results are resumed in Table~\ref{tab:params}. The lower panel of Fig.~\ref{fig:lc_lat} shows the evolution of the power law photon spectral index. The spectrum of the emission detected by LAT up to 35\,s (shown by the first two grey symbols or by the combined red square symbol) is characterized by a soft spectrum with spectral index $\Gamma_{\rm PL}< -3$. From 35\,s onward, the LAT photon index sets on the constant value $\sim -2$. This spectral change is confirmed also by a finer time-resolved analysis (grey points). The softer spectrum $\Gamma_{\rm PL}\sim -4$ of the first time interval suggests that up to $\sim35$\,s the emission detected by LAT is the spectral tail of the prompt emission spectrum extending into the LAT energy range. On the other hand, the harder spectral slope $\sim$ -2 of the long--lived LAT emission after 35\,s is a common feature of LAT GRBs \citep{Ajello2019, Nava2018} and we interpret it as the emission produced by the external forward shock. As shown in Fig.~\ref{fig:lc_lat} the spectral index of $\sim$--2 remains constant until 900\,s, i.e. long after the prompt emission has ceased. This can be an indication that in LAT we are observing the transition from the prompt to the afterglow emission phases. The LAT light curve (top panel of Fig.~\ref{fig:lc_lat}) is derived by integrating the spectrum over the energy range 100\,MeV -- 100\,GeV in each temporal bin. The light curve peaks at $t_{\rm peak}\sim78$\,s (observed frame): we interpret this as the onset time of the afterglow emission and infer the bulk Lorentz factor of the outflow in \S \ref{sec:gamma0}. From the spectral analysis we can infer that the LAT light curve, in the 0--35\,s time interval, is possibly the superposition of a dominant prompt emission soft tail and a rising harder afterglow components. To characterize the time profile of only the afterglow component, we thus consider the light curve beyond 35\,s. We fit it with a smoothly-joint double power law \citep[see e.g.][]{Ghirlanda2010}: \begin{equation*} R(t) = \frac{A(t/t_\mathrm{b})^{\alpha}}{1+(t/t_\mathrm{b})^{\alpha+\beta}} \end{equation*} where the free parameters are the rise and decay slopes $\alpha$ and $\beta$ respectively, the characteristic time $t_\mathrm{b}$ and the normalization factor $A$. The best--fit parameters are $A=(3.8 \pm 0.4) \times10^{-7}$\,erg\,s$^{-1}$\,cm$^{-2}$, $\alpha=2.4\pm 0.7$, $\beta=2.2\pm0.2$ and $t_\mathrm{b}=76.5\pm8.0$\,s. The peak of the light curve is given by $t_\mathrm{peak} = t_\mathrm{b} (\alpha/\beta)^{1/(\alpha+\beta)} \sim 78$\,s. This fit is shown by the dashed line in the top panel of Fig.~\ref{fig:lc_lat}. The LAT flux rises consistently with $\sim t^2$, that is the expected behaviour in case of synchrotron emission (in the fast cooling regime) from the external shock prior to the deceleration radius in a constant ambient medium \citep[e.g.][]{Sari1999}. The flux decay follows a $\sim t^{-2}$ trend which is somewhat unusual\footnote{\cite{Ackermann2013} and \cite{Ajello2019} reported an average temporal decay index around $-1$ for LAT GRB light curves.}, but consistent with what derived by \cite{Ajello2019} ($-1.88 \pm 0.15$). After 78 s, the LAT flux is a significant fraction of the total emission and characterized by a nearly flat spectrum in $E F(E)$. This implies that at this time the LAT flux can be considered a proxy of the bolometric flux. \cite{Ghisellini2010} and \cite{Ackermann2013} studied the theoretical temporal evolution of the observed bolometric flux emitted by a fireball expanding in a homogeneous interstellar medium. They found that the flux decays as $\sim t^{-1}$ in the adiabatic regime and as $\sim t^{-10/7}$ in the radiative regime. The decay slope we find is steeper than both these theoretical predictions. This unusual behavior has been investigated by \cite{Panaitescu2017}, who found that the LAT light curves of bright bursts (with $>10^{-4}$\,ph\,s$^{-1}$) tend to show a steeper temporal decay at early stages. \subsection{Spectral evolution} Fig.~\ref{fig:sed} shows the evolution of the SED up to 500 seconds. This plot shows the SED obtained from the combined analysis of the XRT, GBM and LAT/LLE data when available (first three SED) together with the independent analysis of the LAT data (for all the five time intervals). Since the photon with the highest energy detected by LAT is $\sim5$\,GeV, we represent the LAT SEDs limited over the 0.1--10\,GeV energy range. The shaded regions corresponding to each SED show the 68\% confidence interval on the model fits. These are obtained by combining the errors on the best fit parameters and accounting for their covariance through a Monte Carlo sampling of the parameter space. In the following sections, we describe the evolution of the SEDs of GRB 180720B. \begin{figure} \includegraphics[scale=0.47]{SED.pdf} \caption{Evolution of the spectral energy distribution of GRB~180720B. Each curve corresponds to a specific time interval and it has been rescaled for presentation purposes by the scaling factor reported in the figure. For reference, the top labels mark the instruments providing data in the corresponding energy ranges.} \label{fig:sed} \end{figure} \subsubsection{SED I (0-35 sec): evidence of synchrotron prompt spectrum} The first SED, corresponding to the time interval 0--35 seconds, is represented in red in Fig.~\ref{fig:sed} and shows a spectrum which extends from 10\,keV all through the LAT energy range with a single emission component. The independent analysis of the LAT data (as discussed above) with a power law results in a soft emission component with slope $\Gamma_{\rm PL}=-3.87 \pm 0.71$. A similar spectral slope value is obtained from the analysis of the LLE data in the 30--100\,MeV range. These spectral results are reported in Table \ref{tab:params}. We fitted the GBM (NaI+BGO) and LLE data together with the synchrotron model we implemented in XSPEC. The spectral parameters are reported in Table~\ref{tab:params}. The best fit model is shown in Fig.~\ref{fig:sed1} by the solid black line and the shaded yellow region represents the 68\% confidence interval. The corner plot of the posterior distributions of the parameters of the fit is shown in Fig.~\ref{fig:sed1_cornerplot}, where no strong residual correlation between the free parameters is evident. The residuals of the fit (bottom panel of Fig.~\ref{fig:sed1}) show that the model properly fits the data over almost the entire spectral range. Systematic residuals are present below $\sim$30\,keV over a narrow energy range. The nature of such residuals could be due to poorly calibrated response and/or to the break evolution within the considered time bin \citep{Ravasio2019}. The energy spectrum ($F(E) = E N(E)$) shows a slope $F(E) \propto E^{1/3}$ before the energy break $E_{\rm b} \sim E_{\rm c}$ and a slope $F(E)\propto E^{-1/2}$ between the break and the peak energy $E_{\rm p} \sim E_{\rm m}$. These results, similar to what recently found in other GRBs detected by \sw\ and \fe\ with either empirical (e.g. \citealt{Zheng2012, Oganesyan2017, Oganesyan2018, Ravasio2018, Ravasio2019}) or with physically motivated synchrotron models \citep{Zhang_2016, Burgess2018, Oganesyan2019}, suggest that the emission is in the fast cooling regime \citep{Kumar2008, Daigne2011, Beniamini2013}, even if the cooling is not complete. The best fit model returns a steep slope $p\sim 4.8$ of the injected electron distribution. In empirical models (e.g. Band model) this corresponds to a spectral photon index $\beta =-p/2 -1 \sim -3.4$ which is consistent with the value obtained from the independent fit of the LLE data alone. The implication of the relatively steep $p$ value found will be discussed in \S \ref{sec:discussion}. \begin{figure*} \centering \includegraphics[width=\textwidth]{fit_0-35.pdf} \caption{Spectrum corresponding to the 0-35 s time interval. The GBM and LLE data are fitted jointly with the model (shown by the solid line) of synchrotron emission from relativistic electrons. The shaded yellow region represents the 68\% confidence region of the best fit model. The bottom panel shows the data--to--model residuals. The best fit spectral parameters are reported in Table\ref{tab:params}.} \label{fig:sed1} \end{figure*} \begin{figure} \centering \includegraphics[width=\columnwidth]{cornerplot_0-35.pdf} \caption{Corner plot of the free parameters of the synchrotron model used to fit the SED I. The posterior distributions and their correlations in the two dimensional plots are shown. } \label{fig:sed1_cornerplot} \end{figure} \begin{table*} \centering \caption{Best-fit parameters for each different model used in the five SEDs reported in Fig.~\ref{fig:sed} of GRB 180720B. The first column reports the time interval over which the spectrum has been integrated, the second column the detector whose data have been used to build the SED along with the energy range and the third column represents the different models used to fit that data. From the fourth column onwards: energy flux computed in the energy range reported in the second column, photon energy corresponding to the electron cooling Lorentz factor $E_\mathrm{c}$, photon energy corresponding to the electron injection Lorentz factor $E_\mathrm{m}$, electron energy distribution slope $p$ (corresponding high-energy photon index $\beta = -p/2 -1$ in parentheses), power law photon index of the LLE/LAT data, fit p-value where available. } \label{tab:params} \begin{adjustbox}{max width=\textwidth} \begin{tabular}{ccccccccccc} \hline\hline \multicolumn{1}{c}{\multirow{2}{*}{Time interval}} & \multicolumn{1}{c}{\multirow{2}{*}{Data}} & \multicolumn{1}{c}{\multirow{2}{*}{Model}} & \multicolumn{1}{c}{Flux} & \multicolumn{1}{c}{$E_{\rm c}$} & \multicolumn{1}{c}{$E_{\rm m}$} & \multicolumn{1}{c}{\multirow{2}{*}{$p(\beta)$}} & \multicolumn{1}{c}{\multirow{2}{*}{$\Gamma_{\rm PL}$}} & \multicolumn{1}{c}{\multirow{2}{*}{Prob}} \\ & & & [$\rm 10^{-7} erg / s\, cm^{2}$] & [keV] & [keV] & & & & & \\ \hline \multirow{8}{*}{0-35 s} & GBM & \multirow{2}{*}{Sync} & \multirow{2}{*}{$136_{-1.}^{+3.}$} & \multirow{2}{*}{$81_{-10}^{+13}$} & \multirow{2}{*}{$1894_{-230}^{+54}$} & \multirow{2}{*}{$4.79_{-0.23}^{+0.81} (-3.39_{-0.40}^{+0.12})$} & \multirow{2}{*}{-} & \multirow{2}{*}{0.92}\\ & [10 keV - 40 MeV] & & & & & & & \vspace{0.1cm} \\ & LLE & \multirow{2}{*}{PL} & \multirow{2}{*}{$1.73_{-0.26}^{+0.16}$} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{$-3.44_{-0.21}^{+0.18}$} & \multirow{2}{*}{0.96} \\ & [30 - 100 MeV] & & & & & & & \vspace{0.1cm} \\ & GBM+LLE & \multirow{2}{*}{Sync} & \multirow{2}{*}{$143_{-3}^{+2}$} & \multirow{2}{*}{$81_{-6}^{+6}$} & \multirow{2}{*}{$1883_{-106}^{+39}$} & \multirow{2}{*}{$4.76_{-0.11}^{+0.36}$ $(-3.38_{-0.18}^{+0.06})$} & \multirow{2}{*}{-} & \multirow{2}{*}{0.96} \\ & [10 keV - 100 MeV] & & & & & & & \vspace{0.1cm} \\ & LAT & \multirow{2}{*}{PL} & \multirow{2}{*}{$0.34_{-0.10}^{+0.10}$} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{$-3.87_{-0.71}^{+0.71}$} & \multirow{2}{*}{-} \\ & [100 MeV - 100 GeV] & & & & & & & \\ \hline \multirow{4}{*}{35-70 s} & GBM+LLE & \multirow{2}{*}{Sync} & \multirow{2}{*}{$13.0_{-2.4}^{+0.14}$} & \multirow{2}{*}{$25_{-7}^{+3}$} & \multirow{2}{*}{$520_{-66}^{+30}$} & \multirow{2}{*}{$3.38_{-0.06}^{+1.65}$ $(-2.69_{-0.83}^{+0.03})$} & \multirow{2}{*}{-} & \multirow{2}{*}{0.82} \\ & [10 keV - 100 MeV] & & & & & & & \vspace{0.1cm} \\ & LAT & \multirow{2}{*}{PL} & \multirow{2}{*}{$1.41_{-0.49}^{+0.49}$} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{$-2.3_{-0.21}^{+0.21}$} & \multirow{2}{*}{-} \\ & [100 MeV - 100 GeV] & & & & & & & \\ \hline \multirow{4}{*}{70-120 s} & XRT+BAT+GBM+LLE & \multirow{2}{*}{Sync} & \multirow{2}{*}{$7.26_{-0.8}^{+0.21}$} & \multirow{2}{*}{-} & \multirow{2}{*}{$43.55_{-7.9}^{+10.48}$} & \multirow{2}{*}{$2.08_{-0.04}^{+0.19}$ $(-2.04_{-0.02}^{+0.1})$} & \multirow{2}{*}{-} & \multirow{2}{*}{0.92} \\ &[0.5 keV - 100 MeV] & & & & & & & \vspace{0.1cm} \\ & LAT & \multirow{2}{*}{PL} & \multirow{2}{*}{$1.64_{-0.56}^{+0.56}$} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{$-2.17_{-0.17}^{+0.17}$} & \multirow{2}{*}{-} \\ & [100 MeV - 100 GeV] & & & & & & & \\ \hline \multirow{4}{*}{120-200 s} & XRT+BAT+GBM & \multirow{2}{*}{PL} & \multirow{2}{*}{$1.38_{-0.15}^{+0.20}$} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{$-1.91 \pm 0.05$} & \multirow{2}{*}{0.98} \\ & [0.5 keV - 40 MeV] & & & & & & & \vspace{0.1cm} \\ & LAT & \multirow{2}{*}{PL} & \multirow{2}{*}{$0.96_{-0.34}^{+0.34}$} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{$-2.06_{-0.16}^{+0.16}$} & \multirow{2}{*}{-} \\ & [100 MeV - 100 GeV] & & & & & & & \\ \hline \multirow{4}{*}{200-500 s} & XRT+BAT & \multirow{2}{*}{PL} & \multirow{2}{*}{$0.06 \pm 0.01$} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{$-1.86 \pm 0.03$} & \multirow{2}{*}{0.33} \\ & [0.5 - 150 keV] & & & & & & & \vspace{0.1cm} \\ & LAT & \multirow{2}{*}{PL} & \multirow{2}{*}{$0.21_{-0.08}^{+0.08}$} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{$-2.08_{-0.17}^{+0.17}$} & \multirow{2}{*}{-} \\ & [100 MeV - 100 GeV] & & & & & & & \\ \hline \hline\end{tabular} \end{adjustbox} \end{table*} \subsubsection{SED II (35-70 sec): transition between prompt and afterglow emission} The second SED, represented in yellow in Fig.~\ref{fig:sed}, shows the presence of two emission components. The spectrum below 100\,MeV (obtained combining GBM and LLE data up to 100\,MeV) is still fitted by the synchrotron model albeit with a harder slope of the electron energy distribution $p \sim 3.4$. The values of the peak and break energies are a factor $\sim$ 2 smaller than those of SED I. The LAT data show a harder spectrum than in the previous SED ($\Gamma_{\rm PL} = -2.3 \pm 0.2$). Note that in the following time intervals the photon index of the LAT spectrum is even harder, settling around $\Gamma_{\rm PL} \sim -2$ (as reported in Fig.~\ref{fig:lc_lat}). This suggests that we are observing the rise of the afterglow emission component at very high energies which is characterized by a typical photon index $\Gamma_{\rm PL} \sim -2$. The superposition of this harder emission component with the peaked prompt emission spectrum as seen by the GBM can account for the harder $p$ value obtained from the fit of the GBM+LLE data with the synchrotron model. In conclusion, the SED in the time interval 35-70 s shows the coexistence of two different components: the prompt synchrotron emission dominates in the GBM+LLE energy range; above 100 MeV the LAT spectrum flux is inconsistent with the low energy spectrum flux and this could indicate that the afterglow component is rising and contributing at higher energies. \subsubsection{SED III, IV, V: evidence of afterglow emission} The time interval of the green SED from 70 s to 120 s contains the peak of the LAT light curve ($t_{\rm peak} \sim 78$ s, Fig.~\ref{fig:lc_lat}) and represents the moment when the afterglow begins to dominate the observed emission. This fact is also supported by the weak signal in the BAT and GBM energy range and by the absence of bumps in the GBM lightcurves (see Fig. \ref{fig:lc_GBM}). At this epoch, X--ray data from \sw/XRT ranging from 0.5 keV to 10 keV are also available, allowing to extend the analysis to lower energies. We use the synchrotron model to fit the combined data of XRT+BAT+GBM+LLE. The best fit is a synchrotron spectrum in fast cooling, with $E_c$ constrained to be below 0.5 keV, $E_{\rm m} \sim 44$\,keV and a high energy slope which is consistent with the LAT spectrum (see also Table~\ref{tab:params}). The spectrum shows no evidence of a break down to the XRT energy range. Therefore, under the assumption that the emission is still in the fast cooling regime, at this epoch we expect that the cooling energy $E_{\rm c}$ is very low, less than 0.5 keV. Furthermore, if we extrapolate the spectrum down to the optical range with a power law $N(E) \propto E^{-3/2}$ (dashed green line in Fig.~\ref{fig:sed}), it is marginally consistent with the optical detection reported by \citealt{GCNottico}. In the remaining two SEDs from 120\,s up to 500\,s the afterglow emission is dominant. Indeed data from X-rays up to GeV are well fitted by a single power law function with $\Gamma_{\rm PL} \sim -2$, which is the expected value of the synchrotron afterglow spectral photon index \citep{Burrows2005, Zhang2006}. \section{Estimate of the bulk Lorentz factor $\Gamma_0$}\label{sec:gamma0} The light curve of the LAT flux (Fig.~\ref{fig:lc_lat} top panel) shows a peak at $\sim$ 80\,s from the trigger. After 35-40 s, the prompt emission is already too weak to contribute substantially to the observed emission in the LAT energy range. Indeed, the spectral slope of the LAT emission changes from soft to hard (Fig.~\ref{fig:lc_lat} bottom panel). If the long--lasting LAT emission is synchrotron radiation from the external shock, we can derive the bulk Lorentz factor just prior the deceleration phase, conventionally $\Gamma_0$, from the interpretation of the peak of the LAT light curves as the deceleration time. The different derivation of $\Gamma_0$ proposed in the literature have been summarised and compared recently in \citet{Ghirlanda2018} where it has been shown that the different methods differ at most by a factor of 2. We therefore choose the equation derived by \citet{Nava2013} : \begin{equation} \Gamma_{0} = \left[\frac{(17-4s)(9-2s)3^{2-s}}{2^{10-2s}\pi(4-s)} \left(\frac{E_0}{n_0 m_{p}c^{5-s}}\right)\right]^{1/(8-2s)} t_{{\rm p}, z}^{-\frac{3-s}{8-2s}} \label{n13} \end{equation} Here $t_{{\rm p},z}$ is the rest frame onset time, i.e. $t_{{\rm p},z} = t_{\rm p}/(1+z)$ and $m_{p}$ is the proton mass. The kinetic energy of the fireball is inferred as $E_0 = E_{\rm iso}(1-\eta)/\eta$, i.e. the left--over of the prompt emission ($\eta$ is the efficiency of conversion of the initial energy into radiation during the prompt phase, typically assumed to be of few tens percent). The radial density profile is parametrized as $n = n_0 R^{-s}$, where $R$ is the distance from the central engine. We consider the uniform density ($s=0$) case and the scenario of a stellar wind density profile ($s=2$). In the wind case $n_0=\dot M_{\rm w}/(4\pi v_{\rm w} m_{p})$, where $\dot M_{\rm w}$ is the rate of mass loss and $v_{\rm w}$ is the wind speed. Assuming a redshift $z=0.654$ as reported in \cite{Vreeswijk2018}, an isotropic equivalent energy $E_{\rm iso} = 6\times 10^{53}$\,erg \citep{Frederiks2018}, $\eta=0.2$, $t_{\rm p}=80$\,s, we estimate $\Gamma_0 = 312~(234)$ for $n_0=1~(10)$\,cm$^{-3}$ in the case of a constant external medium density ($s=0$ in Eq.~\ref{n13}). For a wind medium ($s=2$ in Eq.~\ref{n13}), assuming a wind mass--loss rate $\dot M_{\rm w}=10^{-5} \; \rm{M_\odot \; yr^{-1}}$, we obtain $\Gamma_0 = 153~(86)$ for $v_{\rm w}=10^2~(10^{3})$\,km s$^{-1}$. Such values are consistent with the distributions of $\Gamma_0$ in both scenarios obtained from the analysis of a large sample of bursts with measured onset time \citep{Ghirlanda2018}. \section{Discussion}\label{sec:discussion} \subsection{Prompt emission} The synchrotron model presented in this work provides an acceptable fit of the prompt emission spectra of GRB~180720B in the energy range between 10\,keV and 100\,MeV. Under the assumption of one-shot electron acceleration, we can derive the physical parameters of the emission region, i.e. the magnetic field $B'$, the minimum energy of the injected non--thermal distribution of relativistic electrons $\gamma_{\rm min}$ and the total number of electrons $N_e$ contributing to the observed emission, from the spectral properties obtained from the fit, in particular the cooling energy $E_{\rm c}$, the injection energy $E_{\rm m}$, and the flux density at the cooling energy $F_{\rm c}$. Following \cite{Kumar2008} (see also \citealt{Beniamini2013}) we use the set of equations from \cite{Oganesyan2019}: \begin{equation} E_{\rm c} = \frac{27 \pi \, e \, h \, m_e \, c \, (1+z)}{\sigma_T^2 \, B'^3 \, t_{\rm c}^2 \, \Gamma } \end{equation} \begin{equation} E_{\rm m} = \frac{3 \, e \, h \, B' \, \gamma_{\rm min}^2 \, \Gamma }{4 \pi \, m_e \, c \, (1+z)} \end{equation} \begin{equation} F_{\rm c} = \frac{\sqrt{3} \, e^3 \, B' \, N_e \, \Gamma \, (1+z) }{4 \pi d_L^2 \, m_e \, c^2 } \end{equation} where $d_L$ is the luminosity distance of the GRB, $t_{\rm c}$ is the cooling time of electrons losing their energy via synchrotron radiation (neglecting synchrotron self Compton for simplicity) and $\Gamma$ is the bulk Lorentz factor. $F_{\rm c}$ is the flux at $E_{\rm c}$. Therefore, we can find the unknowns $B'$, $\gamma_{\rm min}$ and $N_e$ in terms of the observables: \begin{align} B' &= \left( \frac{27 \pi \, e \, h \, m_e \, c \, (1+z)}{\sigma_T^2 \, E_{\rm c} \, t_{\rm c}^2 \, \Gamma } \right)^{1/3} \nonumber \\ &\simeq 10 \; E_{\rm c,2}^{-1/3} \, t_{\rm c}^{-2/3} \, \Gamma_{2}^{-1/3} \, (1+z)^{1/3} \; \rm G \end{align} \begin{align} \gamma_{\rm min} &= \left( \frac{4 \pi \, m_e \, c \, E_{\rm m} \, (1+z)}{3 \, h \, e \, B' \, \Gamma } \right)^{1/2} \nonumber \\ &\simeq 6.3 \times 10^5 \; E_{\rm m,3}^{1/2} \, B'^{-1/2} \, \Gamma_{2}^{-1/2} \, (1+z)^{1/2} \end{align} \begin{align} N_e &= \frac{4 \pi d_L^2 \, m_e \, c^2 \, F_{\rm c}}{\sqrt{3} \, e^3 \, B' \, \Gamma \, (1+z) } \nonumber \\ &\simeq 10^{50} \; F_{\rm c,\rm mJy} \, B'^{-1} \, \Gamma_{2}^{-1} \, d_{L,28}^2 \, (1+z)^{-1} \end{align} where $E_{\rm c}$ has been expressed in units of $10^2$\,keV, $E_{\rm m}$ in units of $10^3$\,keV, $\Gamma$ in units of 100, $F_{\rm c}$ in mJy and $d_L$ in units of $10^{28}$ cm. The fit of the spectrum corresponding to SED I (see Fig.~\ref{fig:sed1}) returns a cooling energy $E_{\rm c} \sim 81$\,keV and an injection energy $E_{\rm m} \sim 1880$\,keV. We derive also the flux at the cooling energy $F_{\rm c} \sim 6$ mJy. The integration time of 35\,s of SED I corresponds to the time (in the observer frame) needed by the injected electrons to cool down to $\gamma_{\rm c}$. The emission of these electrons produces a spectral break at an observed energy similar to the cooling energy $\sim E_{\rm c}$. Therefore, we use $E_{\rm c}=81$\,keV and $t_{\rm c}=35$\,s in Eq.~5. We assume the value of $\Gamma=\Gamma_0 \sim 300$ as estimated in the previous section for a homogeneous medium. Recalling that the redshift of GRB~180720B is $z = 0.654$, we find $B' \sim 1$ G, $\gamma_{\rm min} \sim 10^6$ and $N_e \sim 10^{51}$. These values are consistent with the ranges estimated by \cite{Oganesyan2019} for a sample of 21 \sw GRBs. The best fit value from SED I for the electron spectral index is $p=4.8$ (Fig.~\ref{fig:sed1}). This in turn produces a soft photon spectrum ($\beta \sim -3.4$) at high energies as confirmed by the independent fit of the high energy spectrum with a single powerlaw. Mildly relativistic shocks, produced e.g. by the dissipation of the kinetic energy of different colliding shells (internal shock scenario \citealt{Rees1994}), can hardly produce large values of $p$ and $\gamma_{\rm min}$. An efficient shock, as expected in low magnetized\footnote{ the magnetization $\sigma$ is defined as the ratio between the energy densities in magnetic field and in particles respectively, evaluated in the comoving frame of the emission region.} plasma \citep[e.g.][]{Sironi2011, Sironi2015b}, can accelerate particles to large $\gamma_{\rm min}$, but typically converts a fraction (around 10\%) of the kinetic energy into a hard ($p\sim 2-2.4$) non thermal electron energy distribution \citealt{Heavens1988, Rees1994, Kennel1984}. Magnetic reconnection, \citep{Spruit2001, Drenkhahn2002} as also recently shown by Particle In Cell simulations \citep{Sironi2014, Sironi2015a, Petropoulou2019}, can produce a steep electron energy distributions (i.e. $p\sim 4-5$) if the burst outflow has a high pair-proton number ratio ($\kappa \sim 200$) and a moderate magnetization parameter $\sigma\sim 1$. However, with such parameter values, the electrons can only attain a moderately large $\gamma_e \sim 10^2-10^3$. Different combinations of the leading parameters, though, could reconcile these values with those estimated in our analysis. If we compare the first SED I (0-35 s) with the second SED II (35-70 s), we find that the value of $p$ decreases from $p \sim 4.8$ to $p \sim 3.4$, thus corresponding to a harder electron energy distribution producing the synchrotron spectrum of SED II. However, we cannot exclude that also in SED II the value of $p$ is uncommonly large, due to the contamination of the high energy part of the spectrum by the harder spectral component arising in the LAT energy range. In conclusion, the acceleration mechanism responsible for the injection of non-thermal electrons must be really efficient in accelerating electrons to very high energies, but also it should give rise to a steep electron energy distribution. We note that the large values of $\gamma_{\rm m}$ and $\gamma_{\rm c}$ ensure that the self Compton emission occurs in the Klein--Nishina regime thus limiting the IC component \citep{Oganesyan2019}. \subsection{LAT constraints on emission at 10 h} The H.E.S.S. telescope detected high-energy photons ($\sim 300$\,GeV) from GRB~180720B at $\sim 10.5$\,h after the trigger time. \cite{Wang2019} report a H.E.S.S. flux of $5\times 10^{-11}$\,erg\,cm$^{-2}$\,s$^{-1}$ in the energy range 100-440\,GeV. This very high energy emission can be the Synchrotron Self-Compton (SSC) component \citep{Meszaros1994,Waxman1997,Wei1998}. However, no detection by \fe/LAT was reported at this epoch. By analysing the LAT data from 8 to 12 hours after the trigger, we obtain\footnote{We assume that the spectral index of the LAT emission component is -2 as observed before.} a 1 $\sigma$ upper limit of $8.5\times 10^{-10}$\,erg\,cm$^{-2}$\,s$^{-1}$ (integrated in the 0.1--100\,GeV energy range). This value agrees with the upper limit found by \cite{Wang2019}. By extrapolating the LAT light curve of Fig.~\ref{fig:lc_lat} at $t \sim 10.5$ h, we predict a 0.1--100\,GeV flux of $\sim 5 \times 10^{-13}$\,erg\,cm$^{-2}$\,s$^{-1}$ if the flux decays $\propto t^{-2.2}$ (as found in the first 500 seconds). Instead, if after $\sim 500$\,s the flux temporal decay becames shallower (e.g. $\propto t^{-1}$, consistently with the X--ray data\footnote{\url{https://www.swift.ac.uk/xrt_curves/00848890/}}), the flux at 10.5 hours would be $\sim 8 \times 10^{-11}$ erg cm$^{-2}$ s$^{-1}$. Therefore, the true LAT flux at around 10\,h should be between $\sim 5 \times 10^{-13}$ \,erg\,cm$^{-2}$\,s$^{-1}$ and the upper limit $8.5\times 10^{-10}$ erg cm$^{-2}$ s$^{-1}$. We note if the flux decays $\propto t^{-1}$, its value at 10.5 hours is similar to the one detected by H.E.S.S. at higher energies. In conclusion, the LAT data are insufficient to unveil the nature of the emission component detected by H.E.S.S.. \section{Summary and Conclusions}\label{sec:conclusions} In this paper we have studied both the prompt and the very early afterglow emission of GRB~180720B. The spectral evolution of the burst up to 500\,s after the trigger time is shown in Fig.~\ref{fig:sed}. The SED evolution (Fig.~\ref{fig:sed}) shows the emergence of the afterglow component in the LAT energy range and the progressive turning off of the prompt emission (which dominates up to 70 - SED I and II - in the 0.01--1 MeV energy range). The LAT light curve shows a peak which we interpret as due to the deceleration of the outflow (Fig.~\ref{fig:lc_lat}). The peak time provides an estimate of the bulk Lorentz factor $\Gamma_0 \sim 300~(150)$ for a homogeneous (wind-like) circumburst medium. The SED of the first three time intervals were fitted (through XSPEC) with a physical model of synchrotron emission from a relativistic population of injected electrons. From the SED accumulated over the first 35 sec, we find that the emitting electrons should be injected with a steep powerlaw energy distribution with $p \sim 4.8$. From the spectral features of the first 35\,s SED, we were able to estimate the intrinsic physical parameters of the emission region during the prompt phase. In particular, the comoving magnetic field $B' \sim 1$\,G, the minimum electron Lorentz factor $\gamma_{\rm min} \sim 10^6$ and the total number of electrons $N_e \sim 10^{51}$. Large values of $\gamma_{\rm min}$ and $p$ require an efficient acceleration mechanism and a "soft" energy distribution of accelerated particles which challenge current understanding of particle acceleration through mildly relativistic shocks or magnetic reconnection. We also find that \fe/LAT did not detect any emission at the epoch (10.5 hours) of the claimed H.E.S.S. detection and derive an upper limit on the LAT flux (0.1--100 GeV) which is above the flux reported by H.E.S.S. (in the 100--440 GeV energy range). The extrapolation of the LAT light curve at 10.5 hours gives a 0.1--100 GeV flux consistent with the flux level detected by H.E.S.S.. LAT data therefore do not allow us to unveil the nature of the emission component detected $>$100 GeV. \begin{acknowledgements} This research has made use of data obtained through the High Energy Astrophysics Science Archive Research Center Online Service, provided by the NASA/Goddard Space Flight Center, and specifically this work made use of public \fe/GBM data and of data supplied by the UK Swift Science Data Centre at the University of Leicester. We also would like to thank for support the implementing agreement ASI-INAF n. 2017-14-H.0. We acknowledge the PRIN INAF CTA-SKA project ''Towards the SKA and CTA era: discovery, localisation, and physics of transient sources" and the PRIN-MIUR project "Figaro" for financial support. \end{acknowledgements} \bibliographystyle{aa}
\section{Introduction} The determination of proton structure via the parton distribution functions (PDFs) is an integral part of the LHC physics programme~\cite{Gao:2017yyd,Kovarik:2019xvh}. In particular, as we enter the high precision LHC era, in terms of both theory and experiment, a detailed control over all uncertainties associated with the PDFs is essential. An area of particular phenomenological relevance is the determination of the gluon PDF at high $x$, which can for example play an important role in predictions for new heavy BSM states via gluon--initiated production, but until more recently has suffered from a relative lack of direct constraints, resulting in rather large PDF uncertainties. However, with the advent of high precision LHC data at higher masses and transverse momenta this situation has in principle changed rather dramatically. As discussed in~\cite{JetFit,NNPDF,Boughezal:2017nla}, the inclusion of inclusive jet, $Z$ boson transverse momentum, and differential top quark pair production in PDF fits places important constraints on the high $x$ gluon that were lacking in earlier PDF fits. In all cases, these benefit from cutting edge high precision theory calculations at NNLO in QCD~\cite{Currie:2016bfm,Gehrmann-DeRidder:2016jns,Boughezal:2015ded,Czakon:2015owf}. On the other hand, the inclusion of such processes in PDF fits is not without issues. In the case of jet production, it is well known~\cite{JetFit,Aad:2014vwa,decor} that the ATLAS jet production data at 7 and 8 TeV cannot be well fit across all rapidity bins. For the $Z$ boson transverse momentum distribution, issues with fitting the 7 TeV (normalized) data ~\cite{Aad:2014xaa}, and the CMS 8 TeV data~\cite{Khachatryan:2015oaa} in the highest rapidity bin have been reported~\cite{Boughezal:2017nla}, while more generally in this study an additional source of uncorrelated error, assumed to be due to residual theoretical uncertainties and possible underestimated experimental errors, has to be introduced to achieve a good fit. For differential top quark pair production, the first study of its inclusion in PDF fits was presented in~\cite{Guzzi:2014wia} with approximate NNLO theory and later in~\cite{NNPDF}, where the full NNLO calculation was used in the context of a global fit with rather encouraging results. Here, 8 TeV data from ATLAS~\cite{ATLAS_lep_jet}, and CMS~\cite{CMS_lep_jet}, both in the lepton + jet channel, were considered. These data were presented differentially in the top quark pair invariant mass, $m_{t\overline{t}}$, and rapidity, $y_{t\overline{t}}$, and the individual top quark/antiquark transverse momentum, $p_\perp^t$, and rapidity, $y_t$. However, as the corresponding statistical correlations across these different distributions were not then available, only one of these distributions from each dataset could be included at once. In all of the above cases, the data were corrected back to the top quark parton level. This situation has changed quite recently, with the ATLAS collaboration providing the corresponding statistical correlations for their 8 TeV data~\cite{ATL-PHYS-PUB-2018-017}, while the systematic errors were provided in the original data. This therefore allows a simultaneous fit to all four distributions to be performed for the first time, in principle providing a greater discriminating power in the determination of the high $x$ gluon. However, as discussed in~\cite{ATL-PHYS-PUB-2018-017}, when even two distribution are fit simultaneously within the context of the ATLAS PDF fit, only a very poor fit quality can be achieved, while a similar observation has been made by the MMHT~\cite{LHLtalkATLAS,Thorne:2019mpt} and CT~\cite{Hou:2019gfw} collaborations. This therefore casts doubt on the reliability of including such data in PDF fits. It should in particular be emphasised that this issue is not bypassed by fitting to one individual distribution alone, which would artificially mask the issues in fitting the complete dataset, while also risking introducing a bias into the fit, through the particular choice of distribution that is made. Further study of the above effects is clearly essential, and indeed in~\cite{ATL-PHYS-PUB-2018-017}, the source of this poor fit quality was traced to a small subset of dominant two--point systematic uncertainties associated with the choice of Monte Carlo generator or input parameters, used in the data unfolding to the parton--level results which are included in the PDF fit. A rather significant improvement in the fit quality, with a relative stability in the resultant gluon, was then observed by introducing some decorrelation in a given systematic error between distributions, reminiscent of the studies\cite{JetFit,decor} for the case of jet production. On the other hand, this study was only performed within the ATLAS PDF framework, fitting to a limited dataset and with a rather restrictive parametrisation, while only fits to only two distributions were made rather than the complete set of four. In this paper, we therefore present the first consistent fit to the full ATLAS dataset, within the global MMHT framework. We study in detail the variation in the fit quality that comes from fitting individual datasets in comparison to the combination, the effect that introducing some degree of decorrelation in the two--point experimental systematics has, and the impact of this on the resultant gluon PDF. We consider the impact of including the NNLO QCD and NLO EW corrections to the top quark production matrix elements on the gluon, finding that these are rather smaller than those due to the prescription for treating the experimental systematic correlations. As we will discuss, this is equally true if an individual distribution alone is fit to, which in effect implicitly assumes a complete decorrelation of all systematics within distributions. We in addition consider the ATLAS data in the dilepton channel, finding that here a good fit to the individual distributions can be achieved. While a fit to the total dataset can not be performed, as the corresponding statistical correlations are not available, this suggests a more reliable fit might be achieved here. Finally, we consider the CMS lepton + jet data, taking the rapidity distributions, $y_t$ and $y_{tt}$, for concreteness. We find that a fair description can be achieved in the latter case, while the fit quality is rather poor in the former. The outline of this paper is as follows. In Section~\ref{sec:datasets} we describe the datasets we include in the fit. In Section~\ref{sec:ATLAS} we describe the fit to the ATLAS lepton + jet data, including a detailed studied of the impact of the decorrelation of systematic errors and the impact on the gluon PDF. In Section~\ref{sec:dilepton} we describe the fit to the ATLAS dilepton data. In Section~\ref{sec:CMS} we describe the fit to the CMS lepton + jet data. In Section~\ref{sec:comb} we describe a combined fit to all three datasets. Finally, in Section~\ref{sec:conc} we conclude. \section{Data Sets and Theoretical Calculation}\label{sec:datasets} We consider ATLAS 8 TeV data on differential top quark production in lepton + jet~\cite{ATLAS_lep_jet} and dilepton~\cite{ATLAS_dilep} channels. The lepton + jet data are presented as single differential distributions with respect to a number of parton--level kinematic variables. The four which are useful for this analysis are: the average transverse momentum of the $t(\bar{t})$-quark ($p_T$), the invariant mass of the $t\bar{t}$ pair ($M_{tt}$), the average rapidity of the $t(\bar{t})$-quark ($y_t$) and the rapidity of the $t\bar{t}$ pair ($y_{tt}$). Correlations between individual systematic errors are available both within and between distributions, as well as a full statistical correlation matrix. For the dilepton dataset, this is again presented as single differential distributions with respect to two relevant kinematic variables for PDF fitting, namely the rapidity and invariant mass of the $t\bar{t}$ pair, however the systematic and statistical correlations are not available between these distributions. In this study we will consider individual fits to the two cases. We in addition consider the CMS 8 TeV in the lepton + jets channel~\cite{CMS_lep_jet}, which are given in terms of the same kinematic variables as in the ATLAS case. These data are presented as normalized distributions, which we simply multiply by the total cross section measured in the same channel~\cite{cms_total}, taking the statistical, systematic and luminosity errors associated with this as fully correlated between all bins. The statistical correlation matrix within each distribution is provided, but not across distributions. Therefore, as in the ATLAS dilepton case, only a single distribution at a time can be fit. For the theoretical input, predictions at NNLO in QCD for the ATLAS lepton + jets and CMS data are provided in~\cite{Czakon:2017dip} as fastNLO grids \cite{Kluge:2006xs}, while EW K--factors are evaluated using the predictions of~\cite{NNLOxEW}, as provided using the PDF4LHC15LUXqed~\cite{Manohar:2016nzj} set. As the K--factors should be relatively insensitive to the PDF set used, this should provide a good estimate for the current case. For the ATLAS dilepton data, NLO QCD Applgrids~\cite{Carli:2010rw}, NNLO QCD K--factors and EW NLO K--factors were supplied by the ATLAS collaboration~\cite{k_facs}. As NNLO grid files for the CMS dilepton data are not currently available, we do not consider these in what follows. \section{Lepton + Jets Channel at ATLAS}\label{sec:ATLAS} We first consider the ATLAS data at 8 TeV, in the lepton + jet channel, using the recently provided full statistical correlation matrix~\cite{ATL-PHYS-PUB-2018-017}. As discussed in the introduction, significant issues in achieving a good fit to these data have been found by ATLAS, with similar observation made by CT and MMHT. We analyse this in detail below. \subsection{Fitting within the MMHT framework} As a baseline, we use the MMHT14 PDF set~\cite{mmht}, but including the final HERA I + II combination data~\cite{HERA} along with some new total $t\bar{t}$ cross section data, and finally including some minor improvements to the fitting code. When we add in the ATLAS data to this, we remove the corresponding total cross section measurement to avoid double counting, though the effect of this is rather small. In the fit we use the figure of merit: \begin{equation} \chi^2 = \sum_{i,j=1}^{N_{\text{data}}} \left( D_i-T_i-\sum_{\alpha = 1}^{N_\text{sys}} \beta_{i,\alpha} \lambda_\alpha \right) \left( \text{cov}_{\text{stat}} \right)_{ij}^{-1} \left( D_j-T_j-\sum_{\gamma = 1}^{N_\text{sys}} \beta_{j,\gamma} \lambda_\gamma \right) + \sum_{\alpha = 1}^{N_{\text{sys}}} \lambda_\alpha^2, \label{chi2 eq} \end{equation} where $D_i$ and $T_i$ are the data and theory predictions, $\beta_{i,\alpha}$ are the systematic errors, $\text{cov}_{\text{stat}}$ is the statistical covariance matrix and $\lambda_{\alpha}$ are the nuisance parameters, due to the experimental correlated systematic errors. Here we have symmetrized the systematic errors and have shifted the central values of the data points accordingly to account for this. While in principle one can minimise the above $\chi^2$ analytically, by profiling with respect to these nuisance parameters, we have kept them explicit here to aid the discussion which follows. The $\chi^2$ per data point after fitting, for the combined fit to all four distributions, as well as various individual fits to be discussed further below, is shown in Table~\ref{chi2 1}. We can see immediately that the fit quality in the combined case is extremely poor, with a $\chi^2$ of $\sim$ 7 per point. If we consider instead a subset of two distributions, as in the ATLAS study~\cite{ATL-PHYS-PUB-2018-017}, the fit quality is better but still very poor. To be concrete, we show the result of a fit to the $p_T$ and $M_{tt}$ distributions, though for other choices the results are rather similar. We also show results excluding the statistical correlations, to asses their impact, and find that these can play an important role, but that even excluding them artificially, the fit quality is still poor. Finally, we find that even fitting to the distributions individually, while a good description of the $p_T$ and $M_{tt}$ cases is possible, the fit to the rapidity variables is still rather poor, with a $\chi^2$ $\sim 3$ per point. This is consistent with the results of the ATLAS study~\cite{ATL-PHYS-PUB-2018-017}, as well as CT~\cite{Hou:2019gfw}, but interestingly not with the NNPDF study of~\cite{NNPDF}, where a good description of all individual distributions was found. Here, the impact of statistical correlations within the distributions, which were not available for the NNPDF study, is seen to be minimal, and so cannot explain this difference. We now consider the impact on the gluon itself, shown in Fig.~\ref{pdf 1} for fits to different distributions, both individual and in combination. Broadly speaking, we can see that as expected the data has a noticeable impact on the high $x$ gluon, both in terms of the central value and uncertainty. However, on closer inspection we can see that the impact of the individual fits on the gluon is somewhat different, with the rapidity variables tending to decrease the gluon at high $x$, while the $p_T$ and $M_{tt}$ tend to pull in the opposite direction. While the resulting gluon PDFs in all cases agree within their error bands, indicating that there is no strong tension between them, nonetheless a difference in the overall pulls is clear. This difference in trend is also observed in the ATLAS study~\cite{ATL-PHYS-PUB-2018-017}. \begin {table} \begin{center} \begin{tabular}{|c|c|c|} \hline Distribution& Statistics Correlated & Statistics Uncorrelated \\ \hline $p_T$ & 0.53 & 0.50 \\ \hline $y_t$ & 3.12 & 3.16 \\ \hline $y_{tt}$ & 3.51 & 3.51 \\ \hline $M_{tt}$ & 0.70 & 0.60 \\ \hline $p_T+M_{tt}$ & 5.73 & 2.47 \\ \hline Combined & 7.00 & 3.28 \\ \hline \end{tabular} \caption{$\chi^2/N_{\rm data}$ values for fits to different distributions within the ATLAS 8 TeV lepton + jet data, as well as for the combined fit to all four distributions. The left (right) columns correspond to the case that the statistical correlations are included (excluded).} \label{chi2 1} \end{center} \end{table} \begin{figure} \centering \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/ytt_compare.png} \end{subfigure} ~ \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/yt_compare.png} \end{subfigure} \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/mtt_compare.png} \end{subfigure} ~ \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/pt_mtt_compare.png} \end{subfigure} \caption{Impact of the ATLAS 8 TeV lepton + jet data on the gluon PDF. Results for fits to individual distributions as well as the combined $p_T+M_{tt}$ case are shown, while the result from a combined fit to all four distributions is shown for comparison in all cases.} \label{pdf 1} \centering \end{figure} \subsection{Understanding the poor fit quality: the role of correlated systematic errors}\label{decor sec} In the previous section we observed a very poor fit quality to the ATLAS 8 TeV lepton + jet data when two or more distributions were fit simultaneously. Here, we wish to try and understand this effect further. In particular, as discussed in the ATLAS analysis~\cite{ATL-PHYS-PUB-2018-017}, the experimental uncertainties for this dataset are completely dominated by the experimental systematic errors. For the rapidity distribution the three largest sources of systematic error are $\sim 3 -6 $ \% (hard--scattering model), $\sim 6-9$ \% (ISR/FSR) and $\sim 3$ \% (parton shower model), depending on the distribution and rapidity bin, while the statistical uncertainty is only $\sim 0.6 -1.3$ \%. We will return to these systematic errors shortly, but for now simply note that the fit quality will naturally be driven by the precise treatment of the correlations in these errors. In particular, as we will see it is the correlation across different distributions that drives the observed deterioration in fit quality. To investigate the above effect further, we first follow the study of~\cite{JetFit} and evaluate the variation in the preferred values of the corresponding systematic shifts in \eqref{chi2 eq} when fitting to the different distributions individually. Any significant tension between these values will then indicate that when fitting the distributions in combination, some deterioration in the fit quality will occur, and moreover that a less restrictive degree of correlation between the distribution for the corresponding shift may be preferred by the data/theory comparison. However it should be stressed that this can clearly only be taken as a guide, as one must of course also consider whether it is reasonable to consider a different correlation scenario for the corresponding shift, or whether this is already precisely determined by the experimental analysis, with no further decorrelation being possible. The result is shown in Fig.~\ref{tension}, and we find that the jet energy scale (4) and ISR/FSR (40) errors provide the largest source of tension. As the correlation in the former may reasonably be assumed to be well determined experimentally, we will not consider this further. On the other hand, in the latter case this is less clear, as we shall now discuss (see also~\cite{ATL-PHYS-PUB-2018-017}). \begin{figure} \centering \begin{subfigure}{0.5\textwidth} \includegraphics[width=\textwidth]{Plots/tension_plot.png} \end{subfigure} \caption{The tension between shifts for the ATLAS 8 TeV lepton + jet data, between the individual distributions. This is calculated as $(1/6)\sum_{j=1}^{4}\sum_{l>j}^{4}(\lambda_{i,j}-\lambda_{i,l})$ where $\lambda_{i,j}$ is the $i^\text{th}$ nuisance parameter calculated when fitting the $j^\text{th}$ distribution.} \label{tension} \centering \end{figure} In fact, further investigation reveals that the errors relating to the hard-scattering model and the parton shower are very similar to the ISR/FSR error for most bins, as well as being the largest systematic errors, as mentioned above. This suggests that there is some redundancy in our analysis, with the large tension in one of these errors masking the tension in the others. Thus is reasonable to consider all three of these errors as a potential source of tension. Now, the important point here is that in all three cases these are 2--point errors evaluated using two choices of Monte Carlo (MC) generator or generator inputs. In particular, a given choice of MC generator and input parameters must be taken to unfold the observed data back to the parton--level distributions which we use for our PDF fits. To evaluate the systematic uncertainty due to this choice, a second generator/set of input parameters is used to unfold MC signal events generated with the default MC. The difference between this result and parton--level signal is then assigned to be the systematic uncertainty in each bin. More specifically, in the case of the hard scattering the default signal is generated with \texttt{MC@NLO} + \texttt{Herwig} and the unfolding is performed with \texttt{POWHEG}+\texttt{Herwig}, while for the parton shower the difference is between \texttt{POWHEG}+\texttt{Herwig} and \texttt{POWHEG}+\texttt{Pythia}, and for ISR/FSR a variation in the input parameters of \texttt{POWHEG}+\texttt{Pythia} is taken. Now, crucially in all cases the correlation in the systematic error is also taken from this procedure, with it being assumed that any correction factor evaluated by this two--point procedure should be applied in a fully correlated way across all bins. To some extent this is a reasonable assumption: if a different choice of MC generator/input parameters for the unfolding leads to a larger parton--level result at larger $m_{t\overline{t}}$ and $p_t$, say, then there may well be physics or kinematic reasons for these effects to be correlated. However, there is clearly some uncertainty in this degree of correlation, and indeed if one performed the same study as above with a third choice of MC/input parameters, there is no reason to assume that in all cases the corresponding correction would always lie within the correlation two--point band. More specifically, when determining the systematic errors, it is assumed that the result of a potential third MC or choice of input parameters would be perfectly describable by taking some particular value of the single $\lambda_\alpha$ shift assigned to this error source. Put another way, the effect of this is constrained to be a linear combination of the two baselines used to evaluate the systematic error, with the combination being the same across all bins. This may not necessarily be the case, and indeed given the issues with fit quality observed above, which as we will see are to a large extent driven by these correlated systematics, it is reasonable to investigate the effect of loosening the assumed correlation scenarios for these. \begin{figure} \centering \begin{subfigure}{0.5\textwidth} \includegraphics[width=\textwidth]{Plots/all_decor_sets.png} \end{subfigure} \caption{Impact of the ATLAS 8 TeV lepton + jet data on the gluon PDF. The result of the default to the combined dataset is shown, as well as decorrelating the parton shower systematic uncertainty between the four distributions.} \label{decor sets pdf} \centering \end{figure} \begin {table} \begin{center} \begin{tabular}{|c|c|c|} \hline Distribution& p.s. correlated & p.s. decorrelated \\ \hline Combined & 7.00 & 1.80 \\ \hline $p_\perp^t + M_{tt}$ & 5.73 & 0.66 \\ \hline \end{tabular} \caption{$\chi^2/N_{\rm data}$ values for fits to the ATLAS 8 TeV lepton + jet data, including decorrelation of the parton shower systematic uncertainty described in the text.} \label{Table:decor} \end{center} \end{table} A further related issue is the assumption implied in \eqref{chi2 eq} that the corresponding systematic uncertainties are standard symmetric Gaussian sources of error. As the discussion above makes clear, these two--point systematic uncertainties, as well as not providing a well defined degree of correlation, are in addition expected to be inherently non--Gaussian. For example, there is no particular reason to associate a 1--$\sigma$ uncertainty, as opposed to a smaller or larger allowed variation, with the uncertainty bands calculated in the above way. These error sources can in addition be rather asymmetric. While the parton shower and hard scattering errors are provided by ATLAS after symmetrisation, the ISR/FSR error does have some degree of asymmetry, particularly in the high invariant mass bins (though less so in the for example the rapidity distributions, where already we see a poor individual fit quality). In the latter case we choose to simply symmetrize, as described above, but this is only one possible choice. More generally, it would be desirable to investigate the impact of different assumptions about the above effects, and of including a non--Gaussian probability distribution for these error sources. From a practical point of view this makes a direct application of \eqref{chi2 eq} much less tractable, as a simple analytic minimisation with respect to the corresponding nuisance parameters is not possible. A full analysis of these issues is beyond the scope of the current study, but is clearly important in the future. \begin{figure} \centering \begin{subfigure}{0.5\textwidth} \includegraphics[width=\textwidth]{Plots/compare_others.png} \end{subfigure} \caption{As in Fig.~\ref{pdf 1}, for fits to different distributions taken in the literature: $y_t$ and $p_T+M_{tt}$ (with decorrelation of the parton shower systematic error), as well as the combined fit.} \label{pdf 2} \centering \end{figure} Here, we therefore concentrate solely on the question of correlation, and in particular investigate the effect of loosening the correlation in the systematic error associated with parton shower, guided by the discussion above, and following the choice made in the ATLAS analysis~\cite{ATL-PHYS-PUB-2018-017}. We in particular consider the same combined fit to the four distributions as before, including all statistical correlations, but now completely decorrelating the parton shower systematic error within the four distributions. That is, we split this source of uncertainty into four sources, which each only contributing in a given individual distribution, while keeping all correlations within the distributions for now untouched. The result is shown in Table~\ref{Table:decor}, and we can see that the effect is dramatic, leading to a factor of $\sim 4$ decrease in the $\chi^2$. This confirms the discussion above, showing that indeed the assumed degree of correlation in these two--point systematics has a significant impact on the fit quality. In Fig.~\ref{decor sets pdf} we show the impact this has on the corresponding gluon. We can see that there is some non--negligible difference in the result, such that the gluon is not completely stable under different treatments of the systematic correlations. Moreover, we can see that now the pull on the gluon is in fact close to the pull from the individual fits to the rapidity variables, see Fig.~\ref{pdf 1}, suggesting these distributions are having a more dominant effect after the decorrelation. We summarise the situation, directly comparing to choices that have been made in the literature, in Fig.~\ref{pdf 2}. Here we show the impact of fits to difference distributions, namely the individual rapidity $y_t$, the combined $p_T+M_{tt}$ (including parton shower decorrelation), and the fit to all four distributions, on the same plot. A rather large spread in results is observed, emphasising the need for further investigation. \begin{figure} \centering \begin{subfigure}{0.5\textwidth} \includegraphics[width=\textwidth]{Plots/ytt_shift.png} \end{subfigure} \caption{Values for individual shift parameters ($\lambda_i$ in Eq.~\eqref{chi2 1}) for the parton shower error when fitting the $y_{tt}$ distribution of the ATLAS 8 TeV lepton + jet data, while decorrelating the error between each data point.} \label{shifts} \centering \end{figure} Given that the rapidity distributions appear to be driving the gluon impact after decorrelating across distributions, it is worth investigating the fit these distributions individually further. In particular, given that the individual fit quality to these is rather poor, see Table~\ref{chi2 1}, we should investigate the impact of the above correlations within the rapidity distributions on the extracted gluon. According to the arguments above, it is equally possible that the degree of correlation taken within the rapidity distribution, as well as across distributions, for the two--point MC uncertainties may be overly restrictive. To investigate this, we will consider the $y_{t\bar{t}}$ distribution, though similar results are found for $y_{t}$. We first allow the parton--shower uncertainty to be completely uncorrelated across the bins of the rapidity distribution, with one corresponding nuisance parameter per bin, that are each allowed to shift independently. The result is shown in Fig.~\ref{shifts}, and we can see that rather a smooth shape in the shifts is preferred. While in all cases the magnitude of the shift is $\sim 1$, indicating that the shifts are not being pushed particularly outside the $1\sigma$ bands corresponding to the magnitude of the systematic errors in each bin, the shape is clearly quite different from that required by the default correlation prescription. Motivated by this, we allow for a degree of decorrelation within the rapidity distribution, following the approach of~\cite{decor}, where a similar decorrelation was introduced for various sources of experimental systematic and theoretical uncertainty within the rapidity and $p_\perp$ bins of the ATLAS 8 TeV inclusive jet data. In particular, we split the parton shower error into two components for each bin, with the first error following some function of the distribution variable, and the other chosen such that they add in quadrature to the original error. We choose two simple approaches, a linear function with the errors given by: \begin{align} \beta_i^{(1)} &= \left( \frac{y_{tt,i}-y_{tt,\text{min}}}{y_{tt,\text{max}}-y_{tt,\text{min}}}\right) \beta_i^{\text{tot}}, & \beta_i^{(2)} &= \left[ 1 - \left( \frac{y_{tt,i}-y_{tt,\text{min}}}{y_{tt,\text{max}}-y_{tt,\text{min}}}\right)^2 \right]^{\frac{1}{2}} \beta_i^{\text{tot}} \end{align} and a trigonometric function given by: \begin{align} \beta_i^{(1)} &= \cos \left[ \pi \left( \frac{y_{tt,i}-y_{tt,\text{min}}}{y_{tt,\text{max}}-y_{tt,\text{min}}}\right)\right] \beta_i^{\text{tot}} , & \beta_i^{(2)} &= \sin \left[ \pi\left( \frac{y_{tt,i}-y_{tt,\text{min}}}{y_{tt,\text{max}}-y_{tt,\text{min}}}\right)\right] \beta_i^{\text{tot}}. \end{align} We note that the trigonometric decorrelation has the advantage of naturally adding in quadrature to the magnitude of the original error, while allowing some additional freedom in the relative sign of the shift across the distribution. Although it may seem preferable to instead use a factor of $\pi/2$ in the arguments for sine and cosine to preserve symmetry, the above choice provides a better description of the desired shifts and a higher quality fit. The results of the fit to the $y_{tt}$ distribution are shown in Table~\ref{Table:decor}. We can see that the effect of the trigonometric decorrelation is significant, reducing the $\chi^2$ per point to $\sim 1$, over a factor of 3 lower than in the default case. For the linear case the effect is rather less pronounced, though some reduction is seen, suggesting that the trigonometric decorrelation allows for the data to be fit more consistently within our framework. This is demonstrated in Fig.~\ref{shifts}, where it can be seen that this decorrelation more closely represents the shifts seen in the completely decorrelated case. In Fig.~\ref{decor_ytt} we show the impact on the gluon PDF for the trigonometric case. We can see that some shift in the central value of the gluon occurs, albeit within PDF uncertainties. More significantly, the resultant gluon uncertainty is rather larger, and indeed very similar to the uncertainty on the baseline set. It would therefore appear that by allowing for a weaker degree of correlation, much of the constraining power of this particular distribution that appeared to be present in the default case (albeit with a rather poor fit quality, raising questions about the reliability of this) has been washed out. In essence, by allowing a greater freedom in the correlation of the systematic error associated with parton shower, to a large extent it appears that the data can be fit simply by shifts of the corresponding nuisance parameters, resulting in the end in a rather small constraining power on the gluon itself. We note that for this effect to occur it is not necessary for the original fit quality to be bad; even if the original fit quality is good, nonetheless if the correlations taken for such dominant sources of systematic error are too constraining this may still result in an artificially large constraint on the corresponding gluon PDF. \begin {table} \begin{center} \begin{tabular}{|c|c|c|} \hline Distribution& p.s. correlated & p.s. decorrelated \\ \hline $y_{t\overline{t}}$ (linear) & 3.51 & 2.62 \\ \hline $y_{t\overline{t}}$ (trig.) & 3.51 & 1.02 \\ \hline Combined ($y_{t\overline{t}}$ (trig.)) & 7.00 & 1.62 \\ \hline \end{tabular} \caption{$\chi^2/N_{\rm data}$ values for fits to the ATLAS 8 TeV lepton + jet rapidity distributions, including decorrelation of the parton shower systematic uncertainty described in the text.} \label{Table:decory} \end{center} \end{table} Finally, we should consider the impact of this within a fit to the combined distributions, that is by decorrelating the parton shower error between each set and along the $y_{tt}$ distribution using the trigonometric decorrelation. The result, shown in Table~\ref{Table:decory}, is a $\chi^2$ of 1.62 per point, only marginally better than correlating solely between sets. The impact on the gluon is shown in Fig.~\ref{decor_ytt} (b), where we see a relatively small shift in the central value, but again an increase in the corresponding PDF uncertainty to the level of the baseline set. Thus again in this case the constraining power of the data appears to be somewhat washed out. We note that the fit quality of 1.62 per point is still relatively poor, being driven by the fact that the $y_t$ distribution is also not well described, see Table~\ref{chi2 1}. We have investigated the effect of introducing the same decorrelation as above to the $y_t$ distribution, and indeed find an improvement in the fit, while the gluon is quite similar to Fig.~\ref{decor_ytt}. Simply omitting this rapidity distribution gives a similar result to this. \begin{figure} \centering \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/ytt_decor_all_trig.png} \caption{} \label{decor_ytt} \end{subfigure} ~ \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/all_decor_all_trig.png} \caption{} \label{decor_all_ytt} \end{subfigure} \caption{Fits to the $y_{tt}$ distribution and all distributions together along with different decorrelation procedures along $y_{tt}$, compared to fits with no decorrelation.} \label{ytt decor pdfs} \centering \end{figure} \subsection{Theoretical precision} In the previous section, we have observed that the degree of correlation taken for the dominant two--point systematic errors (taking the parton shower as a test case) can have a rather large effect on the extracted gluon from the fit to the ATLAS lepton + jet data. This is clearly a cause of concern, in particular in light of the high precision being aimed for in the PDF fit. In particular, as discussed in the introduction, we can perform a fit using cutting edge NNLO in QCD theoretical predictions for the parton--level top quark pair production process~\cite{Czakon:2015owf}, and including NLO EW corrections on top of this. The theoretical precision in these predictions is therefore high, but while one would be tempted to claim a similar degree of precision in the corresponding PDF extraction, the above results cast some doubt on this, at least for the ATLAS lepton + jet data. To investigate this point further, we evaluate the impact of including NNLO QCD and NLO EW corrections to the top quark pair production matrix element on the extracted gluon PDF. To be specific, we will evaluate the top quark pair production cross section at NLO, NNLO and NNLO$\times$EW order, while keeping all other fit settings the same, i.e. we in particular use NNLO PDFs throughout, in order to isolate the effect of these corrections. The impact on the fit quality is shown in Table~\ref{tab:chiorder}, and one can see that the NNLO QCD corrections lead to a better description of the data in comparison to the NLO, as we would hope for, while interestingly the EW corrections leads to some deterioration in the fit quality. On the other hand, the impact of these effects on the extracted gluon PDF when fitting to the $m_{tt}$ and $y_{tt}$ distributions is shown in Figs.~\ref{mtt_theory} and ~\ref{ytt_theory}, and is seen to be rather small; for the other distributions the difference is smaller still. Further, in Fig.~\ref{theory decor pdfs}, we compare the impact on the gluon of the theoretical precision in the cross section calculation to the treatment of the parton shower error in the data, for the case that all four distributions are fit simultaneously. We in particular show the result of a fit including NNLO$\times$EW corrections, with and without decorrelation, as well as the result of a fit including NLO corrections alone, and with no decorrelation. We can see that the difference between the NLO and NNLO$\times$EW cases is indeed rather smaller than the difference between the NNLO$\times$EW case with decorrelation to the case without. Thus if we are to extract the gluon PDF from such data with an accuracy to match the high precision provided by the NNLO$\times$EW calculation of the underlying cross section, it will be crucial to have a clearer understanding of these dominant two--point systematic uncertainties and the uncertainty on their correlation. \begin {table} \begin{center} \begin{tabular}{|c|c|c|c|} \hline Distribution & NLO & NNLO & NNLO+EW \\ \hline $p_T$ & 0.65 & 0.36 & 0.53\\ \hline $y_t$ & 2.99 & 2.98 & 3.12 \\ \hline $y_{tt}$ & 4.06 & 3.30 & 3.51 \\ \hline $M_{tt}$ & 1.33 & 0.57 & 0.70\\ \hline All & 7.88 & 6.61 & 7.00 \\ \hline \end{tabular} \caption{$\chi^2/N_{\rm data}$ values for fits to different distributions within the ATLAS 8 TeV lepton + jet data, using NLO, NNLO and NNLO+EW theory for the top quark pair production cross section.} \label{tab:chiorder} \end{center} \end{table} \begin{figure} \centering \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/mtt_theory.png} \caption{} \label{mtt_theory} \end{subfigure} ~ \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/ytt_theory.png} \caption{} \label{ytt_theory} \end{subfigure} \caption{Impact of the ATLAS 8 TeV lepton + jet data on the gluon PDF, for different levels of precision in the theoretical prediction for the top quark pair production cross section, when fitting the $M_{tt}$ (left) and $y_{tt}$ (right) distributions.} \label{theory pdfs} \centering \end{figure} \begin{figure} \centering \begin{subfigure}[b]{0.5\textwidth} \includegraphics[width=\textwidth]{Plots/all_theory.png} \end{subfigure} \caption{Extracted gluon from a fit to the ATLAS 8 TeV lepton + jet data (all four distributions), from a fit including NNLO$\times$EW in the cross section with (`decorrelated') and without (`standard') decorrelation of the parton shower systematic error, and from a fit with pure NLO in the cross section calculation, without decorrelation.} \label{theory decor pdfs} \centering \end{figure} \section{Dilepton Channel at ATLAS}\label{sec:dilepton} \begin {table} \begin{center} \begin{tabular}{|c|c|} \hline Distribution & $\chi^2/N_{\rm data}$ \\ \hline $M_{tt}$ & 0.06 \\ \hline $y_{tt}$ & 0.66 \\ \hline \end{tabular} \caption{$\chi^2/N_{\rm data}$ values for fits to the ATLAS 8 TeV dilepton data.} \label{Table:dilep} \end{center} \end{table} In the preceding sections, we have considered a fit the ATLAS 8 TeV data collected in the lepton + jet channel, however data in the dilepton channel~\cite{ATLAS_dilep} at 7 and 8 TeV are also available, of which we fit to the higher precision latter dataset. Unfortunately, the statistical and systematic correlations are not provided across distributions, and hence a complete study cannot be performed. We therefore instead consider fit to the $y_{tt}$ and $M_{tt}$ distributions individually. The results are shown in Table~\ref{Table:dilep}, with the fit quality found to be very good, consistent with~\cite{ATL-PHYS-PUB-2018-017}, and indeed in the $M_{tt}$ case in particular the fit quality is anomalously low, suggesting that the experimental errors may be overestimated. The impact on the gluon PDF is shown in Fig.~\ref{dilep}, and are seen to be broadly consistent within errors, though the rapidity prefers a somewhat lower gluon. In both cases some reduction in the PDF uncertainty at higher $x$ is seen, comparable in size with the same distributions in the lepton + jet channels. Indeed, it is interesting to note that the $y_{tt}$ distribution has a similar pull to the individual and combined decorrelated fits for the lepton + jet channel. We can therefore see that the issues present in the lepton + jet case are not apparent in the dilepton channel. Indeed, this may be natural in light of the fact that the impact of the type of two point MC uncertainties present in the lepton + jet case should be somewhat smaller in this cleaner channel. On the other hand, given that the most significant issues in the lepton + jet case came about when one considered a combined fit to all available distributions, it is difficult to make a firm statement without performing a combined fit to the $y_{tt}$ and $M_{tt}$ distributions. On the other hand, the fact that the fit quality is rather low in the case of the rapidity, and anomalously low in the case of the $M_{tt}$ distribution warrants some further investigation. \begin{figure} \centering \begin{subfigure}{0.5\textwidth} \includegraphics[width=\textwidth]{Plots/dilep.png} \end{subfigure} \caption{Impact of the ATLAS 8 TeV dilepton data on the gluon PDF, for the $y_{tt}$ and $M_{tt}$ distributions.} \label{dilep} \centering \end{figure} \section{Lepton + jets channel at CMS}\label{sec:CMS} The final data set to be considered in this analysis is the lepton + jets channel measured by CMS~\cite{CMS_lep_jet}. While statistical correlations are provided within each distribution, they are not available across the different distributions, and hence fits can only be performed on these individually. Further to these correlations, we note that CMS provide a break-down for each systematic error in each bin into individual sources, which as in~\cite{NNPDF,Hou:2019gfw} we treat as a set of correlated errors across the individual distribution, one for each source. However, with our findings from the ATLAS case in mind, we compare to the case that these systematic errors are instead treated as uncorrelated. We note in particular that the values for the errors given in the breakdown are all positive, this strongly calls into question their interpretation as a correlated source of errors across the bins of a normalized distributions. The data are only presented as normalized distributions, and hence we multiply by the corresponding total cross section measurement~\cite{Khachatryan:2016mqs} to translate to the absolute case here. We treat the total systematic, statistical and luminosity uncertainty as additional sources of correlated systematic in all cases. Finally, as in~\cite{Sirunyan:2017azo} we remove the final bin in each distribution so that the covariance matrices corresponding to these normalised distributions are non--singular. The results of these fits are shown in Table \ref{Table:cms}. The fit quality is fair in the case of the $y_{tt}$ distribution, while for the others it is noticeably worse, particularly for the $M_{tt}$. Interestingly, if we assume the systematic errors as uncorrelated we see a dramatic improvement in the fits to $p_\perp$, $y_t$ and $M_{tt}$, with some improvement in $y_{tt}.$ We leave a more detailed analysis of these effects for further study, in particular given the possible questions about the precise degree of correlation one should assume. The impact on the gluon PDF is shown in Fig.~\ref{cms}. We can see that all distributions have an impact at high $x$, with the $y_{tt}$ distribution having a larger constraining power. We also note that, in all cases, the pull is in the same direction as the ATLAS rapidity distributions, see Figs.~\ref{pdf 1} and \ref{dilep}. \begin {table} \begin{center} \begin{tabular}{|c|c|c|} \hline Distribution & Correlated & Uncorrelated \\ \hline $p_{\perp}$ & 3.14 & 1.49 \\ \hline $y_{t}$ & 2.71 & 1.25 \\ \hline $y_{tt}$ & 1.70 & 1.39 \\ \hline $M_{tt}$ & 5.81 & 2.97\\ \hline \end{tabular} \caption{$\chi^2/N_{\rm data}$ values for fits to the CMS 8 TeV lepton + jets data with the systematic errors taken as correlated and uncorrelated, as described in the text.} \label{Table:cms} \end{center} \end{table} \begin{figure} \centering \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/CMS_pt_mtt.png} \end{subfigure} ~ \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/CMS_yt_ytt.png} \end{subfigure} \caption{Impact of the CMS 8 TeV lepton+jets data on the gluon PDF.} \label{cms} \centering \end{figure} \section{Combining data sets}\label{sec:comb} Finally we move on to combining the data sets already discussed into a final fit. We take the combination chosen by ATLAS in \cite{ATL-PHYS-PUB-2018-017}, namely the $M_{tt}$ and $p_\perp^t$ distributions, with the parton shower error decorrelated, from the lepton + jets channel and the $y_{tt}$ distribution from the dilepton channel (henceforth referred to as ATLAS default). On top of this, we add in the CMS distributions measured through the lepton + jets channel individually. The results for these are presented in Table \ref{Table:final}. The `ATLAS default' combination was chosen so as to be in line with the choice made by ATLAS in~\cite{ATL-PHYS-PUB-2018-017}, and as such a direct comparison of the corresponding PDF impact can be made as shown in Fig.~\ref{atlas comp}. Here we see that at high-$x$, the $t\bar{t}$ data causes the two baseline PDF sets (which themselves fit to rather different datasets) to converge. While they still disagree with each other in terms of error bands at rather high $x$, this is certainly encouraging to see. \begin{figure} \centering \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/atlas_comp.png} \end{subfigure} \caption{Impact of the ATLAS default combination on the MMHT14 and ATLAS-epWZ~\cite{Aaboud:2016btc} PDF sets.} \label{atlas comp} \centering \end{figure} \begin {table} \begin{center} \begin{tabular}{|c|c|c|c|c|} \hline & $p_\perp^t + M_{tt}$ ATLAS & $y_{tt}$ ATLAS & CMS & \\ Distribution & lepton+jets (0.66) & dilepton (0.66) & lepton+jets & Total \\ \hline ATLAS default & 0.74 & 1.26 & N/A & 0.87 \\ \hline ATLAS default + CMS $p_{\perp}$ & 0.83 & 0.93 & 3.13 (3.14) & 1.45\\ \hline ATLAS default + CMS $y_{t}$ & 0.74 & 1.27 & 2.71 (2.17) & 1.44\\ \hline ATLAS default + CMS $y_{tt}$ & 0.90 & 0.63 & 1.79 (1.70) & 1.13 \\ \hline ATLAS default + CMS $M_{tt}$ & 0.86 & 0.85 & 5.87 (5.81) & 2.02\\ \hline \end{tabular} \caption{$\chi^2/N_{\rm data}$ breakdown for combined fits to ATLAS and CMS $t\bar{t}$ data. The fourth column corresponds to the relevant rapidity distribution from CMS that is used in the fit. The numbers in brackets indicate the $\chi^2/N_{\rm data}$ when this distribution is fit individually.} \label{Table:final} \end{center} \end{table} \begin{figure} \centering \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/ATLAS_CMS_pt.png} \end{subfigure} ~ \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/ATLAS_CMS_yt.png} \end{subfigure} \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/ATLAS_CMS_ytt.png} \end{subfigure} ~ \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{Plots/ATLAS_CMS_mtt.png} \end{subfigure} \caption{Impact of combining the default ATLAS combination of $p_T$ and $M_{tt}$ distributions with the parton shower error decorrelated from the lepton+jets channel and the $y_{tt}$ distribution from the dilepton with the CMS rapidity distributions on the gluon PDF.} \label{atlas default} \centering \end{figure} The `ATLAS default' combination results in a deterioration in the ATLAS dilepton $y_{tt}$ distribution, however this is reduced upon adding in the CMS data in most cases, suggesting a good description of the ATLAS data can be achieved in conjunction with the CMS data. Interestingly this is not the case for the CMS $y_t$ distribution. The impact of these final fits on the gluon is shown in Fig.~\ref{atlas default}, where we can see clearly that the ATLAS default combination provides good constraints on the high-$x$ gluon as expected. The CMS data further improves on the constraints imposed, with the $y_{tt}$ distribution having a stronger impact as before, while the others have very minimal constraining power. Considering the dynamically determined tolerances (see~\cite{Martin:2009iq} for a detailed description), we find that three eigenvector directions are constrained by the ATLAS dilepton and one by the ATLAS lepton + jets data in most of the fits to the ATLAS default combination, i.e. both with and without the CMS data. The only exception to this is the fit to the CMS $y_{tt}$ distribution, which confines three directions with the ATLAS dilepton confining another three, further demonstrating the constraining power of this distribution from CMS. Finally, we note that in all fits presented here, both individual and combined, no significant deterioration is observed in the fit quality to other data sets present in the fit, indicating that the $t\bar{t}$ data sets has no obvious tension with these. \section{Summary and Outlook}\label{sec:conc} In this paper we have investigated in detail the effect of including LHC differential top quark production data within the global MMHT fit framework. Data for this have been provided by ATLAS and CMS in both the lepton + jet and dilepton decay channels, corrected back to the top quark parton level. These are then presented differentially in terms of various kinematic variables, namely the top quark pair invariant mass, $m_{t\overline{t}}$, and rapidity, $y_{t\overline{t}}$, and the individual top quark/antiquark transverse momentum, $p_\perp^t$, and rapidity, $y_t$. Such data are in particular a sensitive probe of the gluon PDF at high $x$. The main focus of this paper has been on the ATLAS 8 TeV data presented in the lepton + jet channel, which is currently the only dataset for which the corresponding statistical and systematic error correlations have been provided across all distributions. The reason we concentrate on this is that it provides in principle the most constraining overall dataset, allowing all distributions to be fit at the same time without introducing the potential bias of choosing a particular distribution to fit. Moreover, this allows us to test whether full consistent dataset can in fact be described by the NNLO parton--level theory entering the PDF fit in a way that can only be partially done by considering individual distributions. We find, consistent with the ATLAS internal analysis, that only a very poor fit quality can be achieved to the full ATLAS dataset. This raises questions about the reliability of including such data in PDF fits, and in particular in simply choosing one distribution to fit, which would simply mask the underlying issues rather than resolving them. With this in mind we investigate the causes of this poor quality in detail, finding that it is dominated by the correlation prescription provided for the dominant sources of experimental error, namely two--point MC errors associated with the data unfolding back to parton--level; specifically due to the MC generator/input parameters used for the underlying hard scattering process, for the resulting parton shower and for ISR and FSR effects. We then discuss how the correlations provided for these errors across and within the different distributions may well be overly restrictive, and find that with some fairly mild loosening of these correlations, a significantly better fit quality can be achieved. Unfortunately, this has a non--negligible impact on the central value and uncertainties of the extracted high--$x$ gluon, resulting in particular in a rather smaller reduction in the corresponding PDF uncertainties after this decorrelation is introduced. Moreover, we explicitly compare this effect on the gluon with that of either excluding the NNLO QCD or NLO EW corrections to the top quark cross section, and find that it is significantly larger. Therefore, caution is required in claiming such data as it stands as a high precision probe of the gluon PDF. We have in addition considered both the ATLAS 7 and 8 TeV data in the dilepton channel and the CMS 8 TeV data in the lepton + jet channel. In the former case we find a very good fit quality, with a reasonable impact on the gluon PDF from the top quark rapidity that is in fact rather similar to the pull from the corresponding distribution in the lepton + jet channel. This might indicate that the somewhat cleaner dilepton channel, for which the impact from the dominant systematic errors in the lepton + jet case should be smaller, may be a more promising channel to consider. However, it should be emphasised that as here the full experimental correlations across distributions have not been provided, there is a potential danger that similar underlying issues might be masked by the fits to individual distributions that we must necessarily perform. For the CMS data we have considered the 8 TeV lepton + jets channel, using the same distributions as in the ATLAS case. We find a reasonable description of the $y_{tt}$ distribution can be achieved, while the fit quality is poor for the others. These results are however highly sensitive to the treatment of the systematic error correlations. This is again found to be sensitive to the precise degree of correlation one assumes in the underlying systematic errors, though we have not studied this in detail here. Again, as the statistical correlations between the distributions are not available, we cannot perform a full analysis, including all distributions simultaneously. In summary, we have found that the prescription for treating the correlated systematic errors in the case of the most comprehensive ATLAS lepton + jet data on differential top quark pair production plays a significant role in the overall constraining power of this dataset, which is in fact greater than the impact of either NNLO QCD or NLO EW corrections on the extracted gluon PDF. While we consider the above data explicitly, it should be emphasised that this effect is not limited to the ATLAS lepton + jet case, but may simply be masked in the other considered ATLAS and CMS datasets, where full correlations across distributions are not provided. We have introduced some reasonable procedures for decorrelating the dominant two--point MC uncertainties to judge the (rather large) impact on the fit, but this is clearly just a first step, rather than a firm prescription. Rather, a more complete understanding from both the experimental and theoretical point of view of the precision we can ascribe to the determined correlations of these uncertainties will be essential in the future. Moreover, the current common approach of fitting to an individual distribution risks introducing bias in the fit, and arguably will mask rather than resolve the above issues. Certainly, if the assumptions about the understanding of these correlations are too strong, we have found evidence that this may lead to an unreliable PDF determination, making a more conservative approach desirable. Alternatively, it might be that considering the relatively cleaner dilepton channel and/or alternative kinematic variables, perhaps say at the level of the decayed leptons rather than the corrected parton-level top quarks, might provide a cleaner probe of the gluon PDF. \section*{Acknowledgements} We thank Amanda Cooper--Sarkar and Robert Thorne for useful discussions. We thank Emanuele Nocera and C.-P. Yuan for providing information about the NNPDF and CT fits, and in particular the treatment of the systematic errors for the CMS data. S.~B. acknowledges financial support from the UK Science and Technology Facilities Council. L.~H.~L thanks the Science and Technology Facilities Council (STFC) for support via grant award ST/L000377/1.
\section{Introduction} Directed acyclic graphs (DAGs) represent the dependence structure among multiple variables and are used in a wide range of fields and applications \citep{korb2010}. Directed edges may be interpreted as causal relationships: for example, the edge $X\rightarrow Y$ in a graph can be interpreted as $X$ being causal to $Y$ (under assumptions that may be specific to the scientific problem). It has been of great interest to learn the structure of the DAG, such that we can understand the relationships among the variables. On the other hand, data often contain different amounts of information for different edges. Just because two edges (e.g., $X\rightarrow Y$ and $X\rightarrow Z$) are inferred to be in the DAG, it does not mean that the two edges are necessarily supported by equally strong evidence. It is therefore of interest to also quantify the level of uncertainty in the inferred graph, preferably for each individual edge. Many methods have been developed to infer DAGs and largely fall into three main classes \citep{koller2009}: the constraint-based methods, the score-based learning methods, and the hybrid methods. Constraint-based methods start with a fully connected graph, conduct a series of marginal and conditional independence tests among pairs of nodes, and remove the edge if the test does not reject the null hypothesis of independence between the two nodes \citep{scutari2009, colombo2014}. A major benefit of these algorithms is their efficiency and scalability to large graphs. On the other hand, these algorithms typically do not adjust for multiple testing and can be sensitive to how nodes (i.e., variables) are ordered \citep{colombo2014, badsha2019}. Score-based learning methods move through the graph space according to a score computed for the graph given the data. Non-Bayesian methods may take a hill climbing \citep{russell2009, margaritis2003} approach to maximize the score, which is typically based on likelihood or penalized likelihood. Bayesian methods sample directly from a closed-form posterior distribution \citep{schwaller2015, leday2018} or, more often, use a Markov Chain Monte Carlo (MCMC) algorithm \citep{friedman2003, giudici2003, goudie2016, grzegorczyk2008, he2013, kuipers2017, kuipers2018, madigan1995, mohammadi2015} for inference, moving through graph space by proposing new graph structures, scoring them, and determining whether to stay at the current structure or move to the proposed structure. The score-based Bayesian MCMC methods vary in how they move around in graph space but each of them calculates the posterior probability of the graph. They can be further broken down into two different classes the structure-based algorithms and the order-based algorithms. The structure-based algorithms search the space of DAGs \citep{madigan1995, goudie2016}, considering different combinations of edges and edge directions, { and sampling the DAGs based on the posterior distribution}. The order-based algorithms search the space of node orderings \citep{friedman2003, kuipers2018}. These methods require that a parent node must appear after the child node in the node ordering. The space of node orderings is much smaller than the graph space because one ordering can represent multiple DAGs. However, this method may introduce bias into the inference when certain DAGs are over represented. Kuipers and Moffa \citep{kuipers2017} proposed a variation based on the order of node partitions, which are more succinct representations of a DAG than node orderings. A partition divides the nodes into subsets and can group multiple node orderings of the same DAG into one partition. Hybrid methods have been proposed to combine the strengths of the constraint- and scored-based approaches. For example, a non-Bayesian hybrid method is the max-min hill-climbing algorithm \citep{tsamardinos2006}. It first applies the PC algorithm (named after developers Peter Spirtes and Clark Glymour) \citep{spirtes2000, kalisch2012} to infer a candidate graph, and then performs a greedy hill-climbing search for graphs similar to the candidate graph. Bayesian hybrid methods have also been proposed to address the speed issue of the MCMC methods. In summary, Bayesian methods for DAGs have the advantage of quantifying the uncertainty in the inference, although they are typically unable to deal with larger graphs or are not as fast as non-Bayesian methods. Here, we propose a novel Bayesian approach, namely baycn (BAYesain Causal Network), for inferring a DAG. Our method also defines three states for an edge, namely present with one direction ($X \rightarrow Y$), present with the opposite direction ($X \leftarrow Y$), and absent. We specify the prior probabilities of these states and estimate their posterior probabilities. Whether the posterior probability for an edge state is large enough depends on the corresponding prior. In other words, if the data are informative about an edge, then the posterior probabilities of this edge should be substantially different from the prior. For example, if the prior probability is 0.05 for an edge state, then a posterior probability of 0.3 indicates support from the data for this state, even though 0.3 is not typically considered a large posterior. We develop a Metropolis-Hastings MCMC algorithm that samples the space of edge states. It removes directed cycles when moving between graphs, and accounts for Markov equivalence, which refers to different DAGs having the same likelihood. Our method can be used either as a hybrid or as a stand-alone score-based method. As a hybrid method, we can use the graph inferred by other more efficient graph inference methods as input; the input graph may contain false edges or undirected edges but can help reduce the search space to a more manageable size. We perform simulation to examine the performance of our method, and compare with other Bayesian methods for DAGs. We also apply our method to investigate an important problem in genetics involving the target genes of genetic variants. A genetic variant is a location on the genome that has different genotypes in the population, and many of them regulate the expression of certain genes \citep{lappalainen2013,gtex2017}. When a variant is identified to potentially regulate multiple genes, which ones are more likely to be the direct targets, and which ones the indirect targets? A DAG inferred for such a variant-gene set will provide insights into the regulation mechanism. \section{Model} \subsection{The Bayesian graphical model} A graph $\mathcal{G} = (\bold V, \; \bold E)$ is a set of vertices (nodes) $\bold V = \{1, 2, ..., b\}$ and edges $\bold E \subseteq \bold V \times \bold V$, where $\bold V \times \bold V$ is the set of all ordered pairs of nodes, such as $(j, k)$, which denotes an edge pointing from node $j$ to node $k$ where $j, k \in \bold V$. The structure (or topology) of the graph is typically represented by the adjacency matrix $\bold A$ of dimension $b \times b$: $A_{\scriptstyle {j k}} = 1$ and $A_{\scriptstyle {k j}} = 0$ represent an edge from node $j$ to node $k$, and $A_{\scriptstyle {j k}} = 0$ and $A_{\scriptstyle {k j}} = 1$ represent an edge from node $k$ to node $j$. If $A_{\scriptstyle {j k}} = A_{\scriptstyle {k j}} = 0$ there is no edge between nodes $j$ and $k$. We introduce an alternate representation of the graph to directly describe the states of individual edges with the vector $\bold S = (S_1, S_2, \dots, S_m)$, where $m$ is the number of edges. Each edge is in one of three possible states: \begin{align*} S_i = \begin{cases} 0, & \text{if $A_{jk}=1$ and $A_{kj}=0$ where $j<k$;} \\ 1, & \text{if $A_{kj}=1$ and $A_{jk}=0$ where $j<k$;} \\ 2, & \text{if $A_{jk}=A_{kj}=0$,} \end{cases} \notag \end{align*} such that \begin{align} \sum^2_{k=0} \Pr(S_i=k) \equiv p_k = 1. \label{eqn:edge.prob.sum} \end{align} Note that the state 2 represents the absence of the edge. With a slight abuse of notation, we draw connections to the adjacency matrix and define \begin{align} \Pr (S_{jk}=0) \equiv \Pr (A_{jk}=1) \; \text{and} \; \Pr (S_{jk}=1) \equiv \Pr (A_{kj}=1), \end{align} where $S_{jk}$ with the double subscript represents the state of the edge between nodes $j$ and $k$. Under this notation, \begin{align} \Pr (S_{jk}=2) = 1 - \Pr (A_{jk}=1) - \Pr (A_{kj}=1). \end{align} Incidentally, if $\Pr(S_i=0)=\Pr(S_i=1)=0.5$, then the $i$th edge is bidirected with the two directions being equally likely. When data are available at all the nodes, the set of nodes $\bold V$ corresponds to a random vector $\bold T = (T_1, T_2, ..., T_b)^T$. We aim to infer the posterior edge state probability $\Pr (S_i \; | \; \bold T)$ for all edges. Similar to Equation (\ref{eqn:edge.prob.sum}), the posterior probabilities of the three states for an edge also add up to 1. If $\Pr (S_i = 2 \; | \; \bold T) > 0.5$, then the data do not support the presence of this edge; in other words, this is a false edge. Alternatively, if $\Pr (S_i = 0 \; | \; \bold T) = \Pr (S_i = 1 \; | \; \bold T) = 0.4$, the data support the presence of this edge but there is not enough information to determine the direction. The probability of the graph can be written as a product of conditional probabilities where each node is conditioned on its parents \begin{align} \Pr (\bold T \; | \; \bold S, \boldsymbol \theta) = \prod_{j = 1}^b \Pr (T_j \; | \; pa (T_j), \boldsymbol \theta_j) \end{align} where $pa (T_j)$ are the parents of $T_j$, $\boldsymbol{\theta}_j$ is the parameter vector for the distribution of $T_j$, and $\boldsymbol \theta = \{\boldsymbol \theta_1, \dots, \boldsymbol \theta_b\}$. If $pa (T_j) = \emptyset$ the probability is reduced to a marginal probability $\Pr (T_j \; | \; \boldsymbol \theta_j)$. We assume normality for the data at each node: \begin{align} T_j &\sim \text{N}(\mu_j, \sigma^2_j), \\ \mu_j &= \beta_0 + \sum_{k \in pa (T_j)} \beta_k T_k, \label{eq:lm} \end{align} where $\mu_j$ is the mean and $\sigma^2_j$ the variance. If the node $T_j$ does not have any parents then $\mu_j = \beta_0$. \subsection{Markov equivalence} \label{sec:me} Two graphs are Markov equivalent if they have the same likelihood \citep{verma1990}. A set of Markov equivalent graphs form a Markov equivalence class. For example, the graphs $T_1 \rightarrow T_2 \rightarrow T_3$, $T_1 \leftarrow T_2 \rightarrow T_3$, and $T_1 \leftarrow T_2 \leftarrow T_3$ are Markov equivalent and all represent marginal dependence between $T_1$ and $T_3$ (i.e., $T_1 \not\!\perp\!\!\!\!\perp T_3$) and conditional independence given $T_2$ (i.e., $T_1 \perp\!\!\!\!\perp T_3 \; | \; T_2$). By contrast, the graph $T_1 \rightarrow T_2 \leftarrow T_3$, also known as a v structure, has no Markov equivalent graphs. In this graph $T_1$ and $T_3$ are marginally independent (i.e., $T_1 \perp\!\!\!\!\perp T_3$) and conditionally dependent given $T_2$ (i.e., $T_1 \not\!\perp\!\!\!\!\perp T_3 \; | \; T_2$). The probability of the edge states for each edge in a graph need to account for Markov equivalence (see examples in Figure~\ref{fig:m1m2}). \subsection{The Metropolis-Hastings MCMC algorithm} \label{sec:MHalg} We have developed a Metropolis-Hastings algorithm that proposes changes to edge states. The input is the binary adjacency matrix of a candidate graph and the data at the nodes. The candidate graph may be a fully connected graph, where all nodes are connected. A more efficient approach is to run a fast graph inference algorithm to produce a candidate graph and use it as the input, even if this graph may contain false edges. We will use the graph skeleton as the candidate graph, where the edges are undirected, and the adjacency matrix is therefore symmetric. At the $t$th iteration, the key steps of the Metropolis-Hastings algorithm are: \setlist{nolistsep} \begin{enumerate}[noitemsep] \item \label{item:proposal} Generate a proposal graph $\bold S^\prime_{\scriptstyle (t)}$ from the current graph $\textbf{S}_{(t-1)}$. When $t=1$, the current graph is randomly generated from the candidate graph in the input. \item \label{item:cycles} Check for and remove directed cycles in $\bold S^\prime_{\scriptstyle (t)}$. \item \label{item:ratio} Calculate the acceptance probability $\alpha_{\scriptstyle (t)}$ \begin{equation} \label{eq:alpha} \alpha_{\scriptstyle (t)} = \min \bigg\{ \frac{\Pr (\bold S^\prime_{\scriptstyle (t)}) \Pr (\bold T \; | \; \bold S^\prime_{\scriptstyle (t)}, \boldsymbol \theta_{\scriptstyle (t)}) \Pr (\bold S_{\scriptstyle (t - 1)} \; | \; \bold S^\prime_{\scriptstyle (t)})}{\Pr (\bold S_{\scriptstyle (t - 1)}) \Pr (\bold T \; | \; \bold S_{\scriptstyle (t - 1)}, \boldsymbol \theta_{\scriptstyle (t - 1)}) \Pr (\bold S^\prime_{\scriptstyle (t)} \; | \; \bold S_{\scriptstyle (t - 1)})}, \; 1 \bigg\}, \end{equation} where $\Pr (\textbf{S})$ is the prior probability of the graph, $\Pr (\textbf{T} \; | \; \textbf{S}, \boldsymbol \theta)$ the graph likelihood, and $\Pr (\textbf{S} \; | \; \textbf{S}')$ the transition probability. \item \label{item:ar} Generate a random probability $u$ from the uniform distribution U$(0, 1)$. \\ Accept the proposal and set $\bold S_{\scriptstyle (t)} = \bold S^\prime_{\scriptstyle (t)}$ if $u < \alpha_{\scriptstyle (t)}$; or stay at the current graph and set $\bold S_{\scriptstyle (t)} = \bold S_{\scriptstyle (t-1)}$ otherwise. \end{enumerate} To generate the proposal graph in step \ref{item:proposal}, we first determine the number of edges to change states by sampling from a binomial distribution B$(m,1/m)$, where $m$ is the number of edges in the network and $1/m$ is the ``success" probability. For each of the selected edges, we then sample from a Bernoulli distribution with probability $p$ to decide which edge state to change to. Since we do not allow for the edge to remain at the same state, $p$ is determined by that of the other two possible edge states. For example, if an edge in state 0 is selected to change states, and if the prior probability for the three edge states are $p_0 = 0.05$, $p_1 = 0.05$, and $p_2 = 0.9$, then the probability of switching to state 1 is $p = 0.05/(0.05 + 0.9)$. This MCMC algorithm generates a sample of graphs represented by edge states. For each edge, the relative frequencies of the three states in the MCMC sample provide an estimate of the posterior probabilities of edge states $\Pr (S_i \; | \; \bold T)$. Through changes in edge states, our algorithm can sample from multiple Markov equivalent graphs and thus produce posterior probabilities that account for Markov equivalence. With sufficient data, the posterior probabilities of edge states should be the same asymptotically as expected under Markov equivalence. \subsection{Identifying and removing directed cycles} In a directed cycle, one can follow the directed edges and return to the starting node (e.g., $T_1 \rightarrow T_2 \rightarrow T_3 \rightarrow T_1$). Directed cycles can have a higher likelihood than the true graph, a graph with directed edges but no cycles, and therefore should be removed during the MCMC iterations when generating a proposal graph. We have developed a ``cycle finder" algorithm (Supplementary Section S1) to find all directed cycles (including overlapping cycles, as well as multiple disjoint ones) in a graph, and a ``cycle remover" algorithm (Supplementary Section S2) to move out of directed cycles such that the proposed graph is free of directed cycles. It is plausible that when proposing a new graph, our MCMC algorithm may propose a graph with one or more directed cycles, try to move out of these directed cycles only to generate a graph with different directed cycles. Therefore, our algorithm may need to repeatedly identify and remove directed cycles in one MCMC iteration. However, since we focus on relatively small graphs in this paper, this scenario is rather unlikely. Recall that our algorithm next calculates the acceptance probability for the proposed graph relative to the current one. Although the (repeated) removal of directed cycles enters the calculation of the transition probability between the current and proposed graph, the probabilities involving the cycles are in the end canceled in the calculation of the acceptance ratio. Let $\bold D$ be a vector of indices of the edges that {\it differ} between the current graph $\textbf{S}$ and proposed graph $\textbf{S}^{\boldsymbol \prime}$ and $\bold C$ be an integer vector where the element $c_j$ represents the number of edges that {\it can} change state for the edge represented by $d_j$ (see examples in Supplementary Section S3). These two vectors have the same length, denoted by $h$. The probability of moving from $\bold S$ to $\bold S^{\boldsymbol \prime}$, i.e., $\Pr (\bold S \rightarrow \bold S^{\boldsymbol \prime})$, is the product of the probabilities of changes at individual edges in $\bold D$, and each of these probabilities further consists of two probabilities: the probability that an edge in the graph is chosen to change states, which is $1/c_j$, and the probability of edge $d_j$ changing from its current state $S_{d_j}$ to the state $S_{d_j}^{\prime}$, denoted by $\Pr (S_{d_j} \rightarrow S_{d_j}^{\prime})$. Therefore, \begin{align} \Pr (\bold S \rightarrow \bold S^{\boldsymbol \prime}) & = \prod_{j = 1}^{h} \frac{1}{c_j} \Pr (S_{d_j} \rightarrow S_{d_j}^{\prime}) = \prod_{j = 1}^{h} \frac{1}{c_j} \prod_{j = 1}^{h} \Pr (S_{d_j} \rightarrow S_{d_j}^{\prime}). \label{eq:transition} \end{align} We prove that the transition probabilities do not depend on the path taken from the current graph to the proposed graph (the process of introducing and removing directed cycles) but only on the edges that have different states between the two graphs. \begin{theorem} When calculating the acceptance probability, $\alpha$, the transition probability between the current and proposed graph, $\Pr (\bold S \rightarrow \bold S^{\boldsymbol \prime})$ and $\Pr (\bold S^{\boldsymbol \prime} \rightarrow \bold S)$, depends only on the edges whose states are different between the two graphs. \end{theorem} \begin{proof} See Supplementary Section S4 for the proof and S3 for examples. \end{proof} \section{Relationships to existing MCMC methods} We compare baycn to four existing Bayesian MCMC methods for inferring DAGs: two structure-based methods and two order-based methods (Table~\ref{tab:methods}). The structure-based methods, which include a Gibbs sampler \citep{goudie2016} and MC$^3$ \citep{madigan1995, goudie2016}, are similar to baycn and sample the graph space based on edges. The Gibbs sampler considers a DAG as a set of parent nodes and moves through the graph space by proposing new parents for a subset of nodes. At each iteration of the MC$^3$ algorithm a proposal graph is selected from all neighbor graphs, each of which has one edge more or less than the current graph. The order-based methods include order MCMC a method based on node orderings \citep{friedman2003, kuipers2018} and partition MCMC which is based on node partitions \citep{kuipers2017}. A DAG leads to one distinct node partition, but one node partition may correspond to multiple DAGs. On the other hand, a node partition may imply multiple node orderings and is a more succinct representation of a DAG than a node ordering. These methods propose a new order or partition by moving one node in the current order or by splitting or joining the current partition. Our method differs from these existing methods in two ways. First, although all the Bayesian methods directly or indirectly estimate the posterior probabilities of the adjacency matrix, our method requires that the prior probabilities of the edge states are specified (for example, $p_0 = 0.05$, $p_1 = 0.05$, and $p_2 = 0.9$). With this specification, we can assess if the data support an edge state by examining how much the posterior has changed from the prior. The other methods do not specify such a prior, thus making it difficult to interpret the posterior probabilities. Second, baycn, Gibbs and MC$^3$ explore only among the edges in the candidate graph, whereas the two order-based methods allow for inclusion of other edges. \begin{sidewaystable} \caption{\label{tab:methods} Summary of our method and four other Bayesian methods for inference of DAGs.} \begin{tabu}spread 0pt{@{} >{\raggedright\arraybackslash}p{2.5cm} >{\raggedright\arraybackslash}p{3.5cm} >{\raggedright\arraybackslash}p{3.5cm} >{\raggedright\arraybackslash}p{3.5cm} >{\raggedright\arraybackslash}p{3.5cm} >{\raggedright\arraybackslash}p{3.5cm} @{}} \toprule & baycn & Gibbs \citep{goudie2016} & MC$^3$ \citep{madigan1995} & order MCMC \citep{friedman2003, kuipers2018} & partition MCMC \citep{kuipers2017} \\ \midrule Input & Data matrix, adjacency matrix, prior on edge states & Data matrix, a list of edges to always/never consider can be specified, prior on graph space & Data matrix, a list of edges to always/never consider can be specified, prior on graph space & Data matrix, edges to be considered, the parameters to calculate the graph score & Data matrix, edges to be considered, parameters to calculate the graph score \\ \\ Output & Posterior probabilities of three edge states & Posterior probabilistic adjacency matrix & Posterior probabilistic adjacency matrix & Posterior probabilistic adjacency matrix & Posterior probabilistic adjacency matrix \\ \\ Type of Sampling & Edges and edge directions & Edges and edge directions & Edges and edge directions & Node orderings & Node partitions \\ \\ MCMC Move & Select a subset of edges and change their states & Select a subset of nodes and change their parent nodes & Add or remove an edge & Move a node to a new position & Split an existing partition or merge two partitions \\ \bottomrule \end{tabu} \end{sidewaystable} \section{Simulation study} \label{sec:simulation} \subsection{Data simulation} We simulated data under seven different topologies with different numbers of nodes, edges and v structures (Figures \ref{fig:m1m2} and \ref{fig:largerGN}). Graphs M1 (not a v structure and having two other Markov equivalent graphs; Figure \ref{fig:m1m2}a) and M2 (a v structure; Figure \ref{fig:m1m2}b) are among the building blocks of more complex DAGs. Both GN4 and GN5 (Figure \ref{fig:largerGN}a) contain M1 and M2 as subgraphs, and their skeletons allow for directed cycles. The Supplementary Figures S3 and S5 show examples of the Markov equivalence classes for topologies GN4 and GN5. These graphs test the ability of baycn to find and remove directed cycles from the inferred graph. The multi-parent graph (Figure \ref{fig:largerGN}c) contains three v structures. Graph GN11 (Figure \ref{fig:largerGN}d) contains one v structure but more edges with Markov equivalent edges. Graph GN8 (Figure \ref{fig:largerGN}e) is more complex than previous graphs, containing two v structures and allowing for three overlapping directed cycles. \begin{figure}[H] \centering \includegraphics[width = 0.85 \columnwidth]{m1m2.pdf} \caption{Two graphs used in simulation studies and expected probabilities for each accounting for Markov equivalence. (a) M1 has two other Markov equivalent graphs. The direction of the orange edges cannot be uniquely determined. (b) M2 is a v structure and can be uniquely determined.} \label{fig:m1m2} \end{figure} For all of our simulations we generated data for each node under a normal distribution with the mean following a linear model (Equation~\ref{eq:lm}). For simplicity, we set all the variance to one, all the intercept $\beta_0$ to zero and all other $\beta$s to take the same value. The signal in the data is primarily reflected in the latter, which we refer to as the signal strength. The signal strength has three values 0.2 (weak signal), 0.5 (moderate signal), and 1 (strong signal). We also consider three sample sizes: 100, 200 and 600. For each topology we simulated 25 data sets under each of the nine different combinations of signal strength and sample size. \begin{figure}[H] \includegraphics[width = \textwidth]{largerGN_2.pdf} \caption{Five additional graphs used in simulation studies. The subgraphs consisting of orange edges have Markov equivalent graphs and cannot be uniquely determined.} \label{fig:largerGN} \end{figure} \subsection{Performance assessment of methods} We assess the performance and compare methods using the following metrics: \begin{enumerate} \item The edge-wise Mean Squared Error (eMSE): for an edge $j$, we calculate the MSE between the expected and posterior probabilities of the three states: \begin{equation} \label{eq:emse} \text{eMSE}_j = \frac{1}{3} \sum_{k = 0}^2 \big[\Pr (S_j=k) - \Pr (S_j=k \; | \; \bold T) \big]^2, \end{equation} where $\Pr (S_j=k)$ is the expected probability under Markov equivalence. This metric informs us which edges are more accurately inferred and which ones are not. \item The MSE for the whole graph based on three possible edge states: this is the eMSE averaged over all $m$ edges in the graph: \begin{align} \label{eq:mse1} \text{MSE}_1 = \frac{1}{m} \sum_{j = 1}^m \text{eMSE}_j = \frac{1}{3m} \sum_{j = 1}^m \sum_{k = 0}^2 \big[\Pr (S_j=k) - \Pr (S_j=k \; | \; \bold T) \big]^2. \end{align} \item The MSE between the expected and posterior probabilistic adjacency matrix on all $m$ edges. This metric is essentially the same as MSE$_1$, but makes it easy to compare with other Bayesian methods. \begin{align}\label{eq:mse2} \text{MSE}_2 = \frac{1}{2m} \sum_{\substack{(j,k) \; \text{or} \\ \; (k,j) \in \bold E}} \bigg\{ \big[\Pr (A_{jk}=1) - \Pr (A_{jk}=1 \; | \; \bold T) \big]^2 + \big[\Pr (A_{kj}=1) - \Pr (A_{kj}=1 \; | \; \bold T) \big]^2 \bigg\}. \end{align} For baycn, we use the posterior probability for state 0 and state 1 in place of $\Pr (A_{jk}=1 \; | \; \bold T)$ and $\Pr (A_{kj}=1 \; | \; \bold T)$ respectively. \item The MSE between the expected and posterior probabilistic adjacency matrix on all $(b^2 - b)/2$ possible edges among the $b$ nodes in the graph. \begin{align} \label{eq:mse3} \text{MSE}_3 = \frac{1}{b^2 - b} \sum_{j = 1}^b \sum_{k = 1}^b \big[\Pr (A_{jk}=1) - \Pr (A_{jk}=1 \; | \; \bold T) \big]^2. \end{align} This metric is helpful to assess how likely a method is to infer edges outside the candidate graph. If the candidate graph is the skeleton of the true graph, then this metric quantifies the extent to which false positive edges are inferred. \item Precision and power for the whole graph. Precision (i.e., $1 - \text{FDR}$) measures how many of the inferred edges are in the true graph, and is the ratio of the number of true edges in the inferred graph over the total number of edges in the inferred graph. Power measures how many of the inferred edges are true edges, and is the ratio of the number of true edges in the inferred graph over the total number of edges in the true graph. To calculate these metrics for simulated data, we apply a cutoff of 0.5 to the posterior probability of edge presence (i.e., the sum of the probability of both directions). These metrics ignore the nuances in the probabilities, but are easy to interpret as percentages and provide a quick indication of the inference accuracy. \end{enumerate} \subsection{Results using the true graph skeleton as the candidate graph} \label{sec:tgs} For all the topologies, we ran baycn once per simulated data set and used a burn-in of 20\%. For M1, M2, GN4, GN5, and multi-parent topologies, we ran baycn for 30,000 iterations with a step size of 120. For GN8 and GN11, we ran baycn for $5 \times 10^4$ iterations with a step size of 200. We used the probability $(p_0, p_1, p_2) = (0.05, 0.05, 0.9)$ as the prior for edge states. We assess the performance with MSE$_1$ (Equation ~\ref{eq:mse1}). In general, the performance of baycn depends on the signal strength $\beta$, the sample size $N$, and the complexity of the graph. As expected, for each topology MSE$_1$ decreases as both $N$ and $\beta$ increase (Table \ref{tab:mse1}). Between the signal strength and sample size, the former has a larger effect on MSE$_1$, because for all seven topologies the MSE is much lower for a strong signal and small sample size than for a weak signal and large sample size. A close examination of the graphs inferred for different values of MSE$_1$ shows that an MSE$_1$ of below 0.1 typically corresponds to accurate inference: the direction of all the edges is correctly inferred, and the relative magnitude of the posterior probabilities of the three states for any edge is similar to that of the expected probabilities. Using this guideline, we observe that baycn performs well on GN4 and GN5 even with a weak signal, as long as the sample size is large, indicating that baycn can find and remove directed cycles from the graph. In GN11 baycn can also correctly identify the edge directions in smaller subgraphs separated by a v structure. For both M2 and multi-parent topologies that contain one or more v structures, MSE$_1$ is nearly perfect at moderate to strong levels of $\beta$ but is larger at a weak signal than that for any other topology with the same sample size. This is consistent with our observation that it is generally difficult for existing graph inference algorithms to correctly identify v structures with a weak signal \citep{badsha2019, badsha2018r}. Additionally, for all combinations of $N$ and $\beta$, except for topologies M2 and multi-parent with a weak signal, baycn performs the worst on GN8, the most complex topology in our simulation, suggesting that the complexity of the graph strongly influences the performance of baycn. \begin{table} \centering \caption{\label{tab:mse1} Performance of baycn on all the graphs in simulation. Features of the graphs, such as the number of edges and v structures, are listed. The mean and standard deviation of MSE$_1$ (Equation \ref{eq:mse1}), sample size $N$, and signal strength $\beta$ are also listed. For each simulation scenario we generated 25 independent data sets and ran baycn once on each data set.} \begin{tabu}spread 0pt{@{} l l l l l l l l l l @{}} \toprule & & & & \multicolumn{6}{c}{MSE} \\ \cmidrule(lr){5-10} & & \#v & & \multicolumn{2}{c}{$\beta = 0.2$} & \multicolumn{2}{c}{$\beta = 0.5$} & \multicolumn{2}{c}{$\beta = 1$} \\ \cmidrule(lr){5-6} \cmidrule(lr){7-8} \cmidrule(lr){9-10} Topology & \#edges & structures & $N$ & mean & sd & mean & sd & mean & sd \\ \midrule M1 & 2 & 0 & 100 & 0.1796 & 0.0949 & 0.0127 & 0.0353 & 0.0011 & 0.0016 \\ & & & 200 & 0.0734 & 0.074 & 0.0014 & 0.0015 & 0.0012 & 0.0013 \\ & & & 600 & 0.0237 & 0.0326 & 0.001 & 0.0009 & 0.0008 & 0.0007 \\ \addlinespace M2 & 2 & 1 & 100 & 0.3384 & 0.1081 & 0.0909 & 0.0919 & 0 & 0 \\ & & & 200 & 0.2688 & 0.0881 & 0.0597 & 0.082 & 0 & 0 \\ & & & 600 & 0.1323 & 0.0735 & 0 & 0 & 0 & 0 \\ \addlinespace GN4 & 4 & 1 & 100 & 0.2731 & 0.0711 & 0.0674 & 0.0417 & 0.01 & 0.0276 \\ & & & 200 & 0.167 & 0.0554 & 0.0755 & 0.0639 & 0.0046 & 0.0142 \\ & & & 600 & 0.0839 & 0.0259 & 0.0503 & 0.0602 & 0.0069 & 0.0182 \\ \addlinespace GN5 & 5 & 1 & 100 & 0.2687 & 0.0785 & 0.0396 & 0.0465 & 0.0022 & 0.0023 \\ & & & 200 & 0.1562 & 0.049 & 0.0171 & 0.0235 & 0.002 & 0.0031 \\ & & & 600 & 0.0684 & 0.0338 & 0.0114 & 0.0483 & 0.002 & 0.0024 \\ \addlinespace Mulit-parent & 3 & 3 & 100 & 0.3361 & 0.0961 & 0.0486 & 0.0698 & 0 & 0 \\ & & & 200 & 0.237 & 0.0812 & 0.0032 & 0.0135 & 0 & 0 \\ & & & 600 & 0.1418 & 0.0625 & 0 & 0.0002 & 0 & 0 \\ \addlinespace GN11 & 10 & 1 & 100 & 0.2266 & 0.0513 & 0.0353 & 0.0225 & 0.0042 & 0.0031 \\ & & & 200 & 0.139 & 0.0431 & 0.0121 & 0.0162 & 0.0066 & 0.0041 \\ & & & 600 & 0.0613 & 0.0197 & 0.0047 & 0.0043 & 0.0046 & 0.0039 \\ \addlinespace GN8 & 8 & 2 & 100 & 0.2932 & 0.0437 & 0.0656 & 0.028 & 0.0191 & 0.0366 \\ & & & 200 & 0.1945 & 0.0449 & 0.0868 & 0.0528 & 0.0432 & 0.0694 \\ & & & 600 & 0.1155 & 0.0541 & 0.067 & 0.0661 & 0.0201 & 0.0457 \\ \bottomrule \end{tabu} \end{table} \subsection{Identification of false positive edges and the choice of priors} \label{sec:falseedges} For this assessment we include a false edge in M1, M2 and GN4, and two false edges in the larger GN11 (Supplementary Figure S9). These false edges lead to the possibility of generating one or more directed cycles in the graph during MCMC, making the identification of false edges more challenging. We used the same data generated in the previous section for these topologies (without false edges) and ran baycn with the candidate graph being the true graph skeleton plus the false edges. We calculated eMSE (Equation \ref{eq:emse}) to assess the edge-wise performance. We explored the impact of three edge-state priors on the inference, with an increasing probability of the edge being absent: prior 1: $(p_0, p_1, p_2) = (1/3, 1/3, 1/3)$; prior 2 $(p_0, p_1, p_2) = (0.25, 0.25, 0.5)$, and prior 3: $(p_0, p_1, p_2) = (0.05, 0.05, 0.9)$ (previously used in Section~\ref{sec:tgs}). Once again using $\text{MSE}<0.1$ as the criterion for correct inference, we observed that baycn can identify false positive edges under prior 3, which assigns a large prior probability to absence (Supplementary Tables S1 - S4). In all four graphs the eMSE for the false edges decreases as $p_2$ increases. On the other hand, the edge probabilities of the true edges are generally estimated correctly under all three priors and for different signal strengths or sample sizes, even when the false edges are not properly identified and have a large eMSE (Supplementary Tables S1 - S4). The impact of the prior on the true edges is more complex: in M1 and M2 the eMSE for true edges decreases as $p_2$ increases, whereas in GN4 and GN11 the eMSE for the true edges follows an opposite trend in some cases. This may be due to the amount of information in the data and the expected edge state probabilities. With sufficient information in the data, it does not matter much which prior is used, the posterior probabilities for the true edges are close to the expected ones. However, if the information in the data is insufficient but the prior happens to be close to the expectation, then the posterior probabilities will be close to the prior and result in a small eMSE. In summary, this investigation confirms that prior 3 is the prior of choice, as it balances the need to detect false positive edges and to correctly infer the true edges. We have primarily used prior 3 in other simulations. \subsection{Comparison with existing Bayesian MCMC methods} \label{sec:bmop} We compare baycn with other Bayesian methods using the true graph skeleton as the input. We focus on GN4, GN8 and GN11, which have different levels of complexity (Figure \ref{fig:largerGN}; Supplementary Tables S6 and S7). We ran all the methods for 30,000 iterations on GN4 and for 50,000 iterations on GN8 and GN11, all with a burn-in of 20\%. We set the step size in baycn to be 120 for GN4 and 200 for GN8 and GN11. We used the default step size for order and partition MCMC, which is the number of iterations divided by 1,000, and results in the step size being 30 for GN4 and 50 for GN8 and GN11. Gibbs and MC$^3$\xspace use all of the iterations after the burn-in. Using MSE$_2$\xspace (Equation~\ref{eq:mse2}) as the metric, which evaluates the deviation from the expected probabilistic adjacency matrix on true edges, we observed that all five methods have similar MSE$_2$\xspace, with MC$^3$\xspace having larger mean MSE$_2$\xspace and larger variation (Figure \ref{fig:boxplot_mse}a). Since the signal strength is crucial to the performance (Section~\ref{sec:tgs}), we grouped the results by signal strength, and observed that as expected, MSE$_2$\xspace decreases as the signal strength increases for each method in general (Figure \ref{fig:boxplot_mse}b). However, MC$^3$\xspace produced higher MSE$_2$\xspace for two of the three topologies (GN4 and GN8) at $\beta = 1$ than at $\beta = 0.5$, which leads to the large variation for MC$^3$\xspace at $\beta = 1$. Additionally, order and partition MCMC performed worse than others at weak signal. The complexity of the graph also strongly influences the inference accuracy (Section~\ref{sec:tgs}). Grouping the results by topologies, we observed that MSE$_2$\xspace is generally small for GN11, which contains only one v structure despite having the largest number of nodes. MC$^3$\xspace performs worse than others on GN4 and GN8, both of which can easily generate directed cycles during MCMC. baycn and other methods perform similarly on the three topologies, with partition MCMC being slightly worse for GN11. In summary, across different simulation scenarios, baycn and Gibbs show similar and better performance than other methods. Partition and order MCMC are slightly worse in some cases, whereas MC$^3$\xspace is the least accurate and least stable among the five methods. \begin{figure}[H] \includegraphics[width = \textwidth]{horizontal_mse2.pdf} \caption{Boxplots of MSE$_2$\xspace (Equation \ref{eq:mse2}) for baycn and other Bayesian methods for topologies GN4, GN8, and GN11 with varying signal strengths and sample sizes. The true graph skeleton was used as the input. (a) The overall MSE$_2$\xspace grouped by method. (b) MSE$_2$\xspace grouped by method and signal strength $\beta$. (c) MSE$_2$\xspace grouped by method and topology. Also see Supplementary Table S6.} \label{fig:boxplot_mse} \end{figure} Whereas baycn considers only edges in the candidate graph, both order and partition MCMC allow for inclusion of additional edges and can estimate substantial posterior probability for those edges. To assess the overall inclusion of false edges, we also calculated MSE$_3$\xspace on all possible edges in each graph for each method from the simulations above. Results from this evaluation (Supplementary Figure S10 and Table S7) lead to observations similar to those under MSE$_2$\xspace, indicating that although these methods may include false edges, posterior probabilities for these edges are small overall. Although it is more efficient to use baycn with a sparse candidate graph as input, we are interested in whether baycn can run on a fully connected graph and how its performance compares with other methods. We calculated precision, power and MSE$_2$\xspace for this evaluation. Precision is nearly perfect for all the methods in most of the simulation scenarios (Figure \ref{fig:boxplot_pp_mse}). Power is also nearly 100\% for both moderate and strong signals (Figure \ref{fig:boxplot_pp_mse}). However, for data sets with a weak signal ($\beta=0.2$), the power is low especially at a lower sample size (Supplementary Table S5), resulting in a large variation in power with this signal strength for all the methods (Figure \ref{fig:boxplot_pp_mse}). However, order MCMC has even lower power on average and partition MCMC has larger variation than other methods at $\beta=0.2$, as they tend to infer a higher posterior probability for edge absence and therefore infer fewer true edges as present (see examples in Supplementary Tables S9-S11). In terms of the MSE, similar to our observation in Section \ref{sec:tgs}, MSE$_2$ for each method decreases as the signal strength or sample size increases (Supplementary Table S5) and is influenced more by the signal strength than by the sample size. Also similar to the results on power, we observe that order and partition MCMC have higher mean or larger variation than other methods at low signal strength. We also note that Gibbs and MC$^3$\xspace have slightly higher mean MSE$_2$ with a strong signal ($\beta=1$). Our MCMC algorithm is also fast. To compare the runtime, we used the data simulated for GN4, GN8, and GN11 with $\beta = 1$ and $N = 600$. We ran each algorithm once per data set on an Intel Xeon D-1540 2.00 GHz processor with 128 GB of memory (see runtime in Supplementary Table S8). On all three topologies, order MCMC is the fastest, followed closely by baycn and partition MCMC. baycn is approximately three times as fast as MC$^3$\xspace and can be 50 times as fast as Gibbs. On the larger topology GN11, baycn is slightly faster than partition MCMC. \begin{figure}[h] \centering \includegraphics[height = 0.35 \textheight]{boxplot_pp_mse.pdf} \caption{Boxplots of precision, power, and MSE$_2$\xspace (Equation \ref{eq:mse2}) of baycn and other Bayesian methods for GN4 when a fully connected graph was used as the input. Precision, power, and MSE$_2$\xspace are grouped by method and signal strength $\beta$. Also see Supplementary Table S5.} \label{fig:boxplot_pp_mse} \end{figure} \section{Application to genomic data} Genetic variants play an important role in regulating the expression of genes \citep{cheung2009}. Several large genomic consortia have identified widespread genetic variants associated with gene expression \citep{lappalainen2013,gtex2017}. Among them, the GEUVADIS (Genetic European Variation in Disease) project measured gene expression in Lymphoblastoid Cell Lines (LCLs) from a subset of individuals from the 1000 Genomes Project \citep{10002015}, which measured the genotypes of individuals of multiple ethnicities. GEUVADIS identified a large number of genetic variants that are associated with the expression of one or more genes: these variants are termed expression quantitative trait loci (eQTLs), and the associated genes are potential targets of the eQTL. In particular, 62 eQTLs are associated with more than one gene. However, since the association analysis examined one eQTL-gene pair at a time, it is unclear which associated genes are more likely to be the direct targets, and which ones the indirect targets. To address this question, we can infer a DAG for each eQTL and its associated genes: genes are more likely to be direct targets if they are directly connected to the eQTL. We focused on the European sample, which has a decent sample size of 373, and applied baycn to each eQTL-gene set. Since the number of nodes in each graph is small, we used a fully connected graph as the input to baycn with a prior on edge states of $(p_0, p_1, p_2) = (0.05, 0.05, 0.9)$ as this prior balances the ability to identify false positive edges and correctly infer true edges. We also included the constraint that a gene cannot be the parent of an eQTL. We ran baycn once per eQTL-gene set for 30,000 iterations with a burn-in of 20\% and a step size of 120. When determining which edges to include in the inferred graph, we required a posterior probability of $> 0.4$ for edge presence. To validate the graphs inferred from GEUVADIS, we also used data from the GTEx (Genotype-Tissue Expression) consortium, which collects genotype and gene expression data from over 50 tissues from approximately 900 individuals \citep{gtex2017}. We found that data are available for 46 eQTL-gene sets in LCLs from 115 individuals in GTEx. We applied baycn to these data with the same parameter settings as above, and present the results of seven eQTL-gene sets: four sets each involve two genes and three sets each involve three genes. We further examined the effect of confounding variables on the inference. On the one hand, the gene expression data in GEUVADIS and GTEx had been normalized using the PEER method \citep{stegle2012} to remove potential impact of demographic variables, batch effect, and other covariates. On the other hand, gene regulation is a complex process, and genes not included in an eQTL-gene set may also have an impact on the set. To account for this type of confounding, we included Principal Components (PCs) associated with each eQTL-gene set in the DAG inference (Supplementary Section S5). We used a fully connected graph as the input to baycn for each eQTL-gene set that had at least one PC associated with it (excluding the edges between any two PC nodes). On each eQTL-gene-PC set we ran baycn for 50,000 iterations with a burn-in of 20\% and a step size of 200. We used the same priors as above. These analyses show that baycn can identify the regulatory relationship when an eQTL has multiple target genes, while accounting for the effect of confounding variables (Figure \ref{fig:q8}, Supplementary Figures S11-S16). The posterior probabilities estimated by baycn give a detailed description of the relationship among variables which can be used to better understand the regulatory relationship of an eQTL and its target genes (Supplementary Figures S11-S16). In the eQTL-gene set Q8, baycn infers the gene PNP to be a direct target of the eQTL rs11305802 for both GEUVADIS and GTEx (Figure \ref{fig:q8}a, b), consistent with the correlations (0.56 in GEUVADIS and 0.4 in GTEx). In comparison, baycn infers an edge between rs11306802 and the gene RP11-203M5.8 for GEUVADIS but not for GTEx, also consistent with the correlations (0.41 in GEUVADIS and 0.23 in GTEx). Similarly, the edge between TMEM55B and RP11-203M5.8 is inferred to be present in both consortia, also consistent with the correlations, although the direction is ambiguous. Including PCs does not affect the DAG inference for Q8 and has no or small impact on other eQTL-gene sets (compare Supplementary Tables S12-S18 to S19-S23). \begin{figure}[h] \centering \includegraphics[width = \textwidth]{graph_cor_q8_2.pdf} \caption{\label{fig:q8} The graph inferred by baycn and correlation heat maps for eQTL-gene set Q8 from GEUVADIS and GTEx. The numbers in parenthesis indicate the posterior probability of the edge for the direction shown. For undirected edges the posterior probability for each direction is shown. (a) Inferred graph for data from GEUVADIS. (b) Inferred graph for data from GTEx. (c) Inferred graph for data from GEUVADIS with five PCs included in the network as confounding variables. The edges involving PC nodes are shown in grey; the posterior probability for these edges is not included in the graph but can be found in Supplementary Table S19. (d) and (e) Correlation heat maps for the nodes of interest.} \end{figure} \section{Discussion} Here we present our Bayesian approach to DAG inference. We have developed a novel and coherent definition of the edge state and used this definition to represent a DAG. The posterior probabilities of edge states are therefore much easier to interpret than those of existing methods. We have developed an MCMC algorithm for sampling under this representation. Our algorithm deals with directed cycles and accounts for Markov equivalence. We have demonstrated through simulation studies that baycn is fast and can accurately estimate the edge probabilities in general, and that it performs as well as or better than current MCMC methods. With a suitable prior of edge states, baycn can correctly estimate edge probabilities both when the true graph skeleton is the input and when false edges are included in the input. In the method comparison we used two types of MSE to assess the deviation from the expected probabilistic adjacency matrix (MSE$_2$\xspace on only the true edges and MSE$_3$\xspace on all possible edges). MSE$_2$\xspace favors the two order-based methods, as these methods allow for additional edges outside the true skeleton and MSE$_2$\xspace ignores these false positive edges. In comparison, MSE$_3$\xspace favors the structure-based methods, since only the true edges enter the calculation when the true graph skeleton is used as input. Despite this difference, the two MSEs show similar patterns in our simulation studies. We have used a generally conservative cutoff to interpret the posterior probabilities. We used 0.5 as the cutoff value for the posterior probability of edge presence when calculating precision and power in simulation. This value is a natural choice for other Bayesian methods under comparison, since the prior probabilities are generally unspecified. With baycn, 0.5 can be over conservative, especially when prior 3 of $(p_0, p_1, p_2) = (0.05, 0.05, 0.9)$ is used. Under this prior, a posterior probability of say, 0.2, for each of the two directions can already indicate strong evidence for edge presence, even though the edge presence probability is 0.4 in this case. However, precision and power for baycn with such a conservative cutoff are still nearly perfect in most cases and comparable to or better than other methods in other cases. When analyzing real data, we use a slightly lower cutoff of 0.4, as the edges inferred under this cutoff are more consistent with our interpretation of the correlations. \section{Supplementary materials} \begin{description} \item[Supplementary file:] Additional tables, figures, algorithms, and proofs that supplement the main article (supplementaryMaterial.pdf). \item[R code:] The method developed here is implemented in our R package baycn -- \url{https://github.com/evanamartin/baycn} with released versions at \url{https://CRAN.R-project.org/package=baycn}.\\ Other Bayesian methods we compared with are available in the following R packages: \\ order and partition MCMC (the BiDAG package) -- \url{https://CRAN.R-project.org/package=BiDAG}. \\ MC$^3$\xspace and Gibbs (the structmcmc package) -- \url{https://github.com/rjbgoudie/structmcmc}. \item[Simulated data:] Simulated data sets for this paper are available also on GitHub -- \url{https://github.com/evanamartin/baycn_simulations}. \end{description} \section{Acknowledgements} The authors thank Robert J. B. Goudie for helping with the Gibbs sampler implemented in his structmcmc R package and Md. Bahadur Badsha for preparing both the GEUVADIS and GTEx data for analysis. The Genotype-Tissue Expression (GTEx) Project was supported by the Common Fund of the Office of the Director of the National Institutes of Health, and by NCI, NHGRI, NHLBI, NIDA, NIMH, and NINDS. The gene expression data were obtained from the GTEx Portal (\url{https://www.gtexportal.org/home/datasets GTEx_Analysis_2016-01-15_v7_RNASeQCv1.1.8_gene_tpm.gct.gz}) on 10/24/2017, the genotype data were available through dbGaP accession number phs000424.v7. \setcounter{section}{0} \renewcommand{\thesection}{S\arabic{section}} \section*{A Bayesian Approach to Directed Acyclic Graphs with a Candidate Graph \\ \centering Supplementary Materials} Note: All of the references to equations and figures in Sections S1 - S4 refer to equations and figures in the Supplementary Materials file and not in the main text. \section{Identifying directed cycles} \begin{enumerate} \item Find the nodes that are connected to two or more nodes as a cycle contains at least three nodes and each node in a cycle has at least one incoming edge and one outgoing edge. To do so, we use the following steps: \begin{enumerate}[label=\roman*] \item Add the adjacency matrix to its transpose. \item \label{item:drow} Sum each row and delete rows (the row indices are preserved) with a sum less than 2. \item \label{item:dcell} Apply the following rule to the adjacency matrix \[ \forall A_{\scriptscriptstyle j, k} = 1, \begin{cases} A_{\scriptscriptstyle j, k} = 0 \text{ if } k \notin J \\ A_{\scriptscriptstyle j, k} = 1 \text{ if } k \in J, \\ \end{cases} \] where $J$ is the set of remaining row indices in the adjacency matrix. \item Repeat steps ii and iii until $\forall A_{\scriptscriptstyle j, k} = 1$, $k \in J$ or the reduced adjacency matrix has two or fewer rows. \end{enumerate} \item \label{item:branches} Create a tree as deep as possible starting with the node (i.e., root node) whose index is in the first row of the reduced adjacency matrix. To do this we create a branch, which is a vector of node indices, for each of the nodes (i.e., child nodes) connected to the root. For each branch we add the index of the child node to the end of the vector, repeating the process of a child node becoming the parent node, until we add an index that has been added to the branch previously. If a parent node has two or more children a new branch is created for each child node. \item \label{item:trim} Remove the nodes from the branches that do not belong to the cycle. In addition to the nodes that create a cycle a branch may also contain nodes outside the cycle. To remove these nodes, we start at the last node (i.e., the leaf) of the branches created in the previous step and work up the branch until we come to a node index that matches the leaf. Nodes above this node are then removed. For example, a branch may be $(3, 4, 1, 6, 5, 2, 1)$ and the trimmed branch would be $(1, 6, 5, 2, 1)$. \item \label{item:coord} Convert the trimmed branches of a cycle into a vector of adjacency matrix coordinates by pairing up the adjacent nodes in each trimmed branch to produce a vector of edge coordinates. For example, if a trimmed branch is $(1, 6, 5, 2, 1)$ then the adjacency matrix coordinates for the edges between the nodes in the cycle are $\big((1, 6), (6, 5), (5, 2), (2, 1)\big)$. \item \label{item:state} Generate a vector of edge states from the vector of edge coordinates by considering each pair of coordinates and comparing the first number to the second number. If the first number is smaller than the second number the edge state is 0, indicating that the edge points from the node with a smaller index to the node with the larger index. If the first number is larger than the second number the edge state is 1, indicating that the edge points from the node with a larger index to the node with a smaller index. The coordinates vector from the example in Step \ref{item:coord} is $\big((1, 6), (6, 5), (5, 2), (2, 1)\big)$ and the edge states that form a directed cycle are $(0, 1, 1, 1)$. \item Use the vector of edge coordinates from step 4 to create a vector of edge indices. For example, the edge indices for the coordinates $\big((1, 6), (6, 5), (5, 2), (2, 1)\big)$ are $(2, 6, 5, 1)$. \item Define each cycle by the number of edges in the cycle and a decimal number calculated using the vector of edge states (step 5) and the vector of edge indices (step 6). The decimal number for the $j$th cycle is calculated by \begin{equation} \label{eq:decimal} \sum_{k = 1}^m \boldsymbol{1}_{Q_j}(\text{S}_k) \big( \text{S}_k 3^k + k \big), \end{equation} where $$ \boldsymbol{1}_{Q_j}(\text{S}_k) = \begin{cases} 1 & \text{if}\ k \in Q_j \\ 0 & \text{if}\ k \notin Q_j. \end{cases} $$ The vector, $Q_j$, is the set of edges that make up cycle $j$, S$_k$ is the state of edge $k$, and $m$ is the number of edges in the network. For example, Figure \ref{fig:nested} shows a graph with two cycles nested within a larger cycle. If the edges are oriented as shown in the figure the decimal number for the cycle involving edges $(2, 3, 5, 6, 7)$ with states $\bold S = (0, 1, 0, 0, 0)$ is $$ 0 (0 \times 3^1 + 1) + 1 (0 \times 3^2 + 2) + 1 (1 \times 3^3 + 3) + 0 (0 \times 3^4 + 4) + 1 (0 \times 3^5 + 5) + 1 (0 \times 3^6 + 6) + 1 (0 \times 3^7 + 7) = 50, $$ and the decimal number for the cycle involving edges $(1, 3, 4, 5, 6, 7)$ with states $\bold S = (0, 1, 0, 0, 0, 0)$ is $$ 1 (0 \times 3^1 + 1) + 0 (0 \times 3^2 + 2) + 1 (1 \times 3^3 + 3) + 1 (0 \times 3^4 + 4) + 1 (0 \times 3^5 + 5) + 1 (0 \times 3^6 + 6) + 1 (0 \times 3^7 + 7) = 52. $$ Even though the cycles in the example above have four edges in common with the same edge direction for each of these edges we are able to distinguish between them by the number of edges in each cycle and by the decimal number for the cycles. \begin{figure}[H] \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T6) [right = 3cm of T1] {$T_6$}; \node[gene] (T4) [below left = 0.75cm and 0.5cm of T6] {$T_4$}; \node[gene] (T5) [below right = 0.75cm and 0.5cm of T6] {$T_5$}; \draw[-latex, thick] (T1) to node[midway, above] {1} (T2); \draw[-latex, thick] (T1) to node[midway, left] {2} (T3); \draw[-latex, thick] (T6) to node[midway, above] {3} (T1); \draw[-latex, thick] (T2) to node[midway, below] {4} (T3); \draw[-latex, thick] (T3) to node[midway, below] {5} (T4); \draw[-latex, thick] (T4) to node[midway, below] {6} (T5); \draw[-latex, thick] (T5) to node[midway, right] {7} (T6); \end{tikzpicture} \captionsetup{width = 0.9 \linewidth} \caption{A graph with two directed cycles one cycle is made up of edges $\{2, 5, 6, 7, 3\}$ and the other with edges $\{1, 4, 5, 6, 7, 3\}$. The two cycles have four edges in common.} \label{fig:nested} \end{figure} \end{enumerate} \section{Removing directed cycles} \begin{enumerate} \item For the current graph calculate the decimal for each set of edges that could form a directed cycle following Equation (\ref{eq:decimal}). \item Compare the number of edges and the decimal, for each set of edges that could form a directed cycle, to the list of decimals and number of edges for the directed cycles. \item For each directed cycle, randomly select an edge and change it from its current state to a different state according to the prior probability of edge states. \item Repeat steps 1 - 3 until there are no directed cycles in the graph. \end{enumerate} \section{Examples of Theorem 1} \label{sec:examples} \subsection*{\textit{Example 1 -- one directed cycle}} Consider the current graph in Figure \ref{fig:example1}a with states $\bold S = (0, 0, 0, 1, 1)$ and the proposed graph in Figure \ref{fig:example1}c with states $\bold S^{\boldsymbol \prime} = (0, 1, 2, 1, 1)$. Edges \#2 and \#3 have different states between $\bold S$ and $\bold S^{\boldsymbol \prime}$ therefore $\bold D = 2, 3$. There are two different paths to move from $\bold S$ to $\bold S^{\boldsymbol \prime}$. In path 1 there are two steps: i) edge \#2 changes direction which creates a directed cycle between nodes $T_1$, $T_2$, and $T_3$ (Figure \ref{fig:example1}b) and ii) the directed cycle is removed by edge \#3 changing from state 0 to 2. In path 2 edges \#2 and \#3 change states in one step. If the prior on edge states is $p_0 = 0.05$, $p_1 = 0.05$ and $p_2 = 0.9$ then the probabilities for the two paths are $$ \text{path 1: } \Pr (S_{d_2} \rightarrow S_{d_2}^{\prime}) = \frac{0.05}{0.95}, \; \Pr (S_{d_3} \rightarrow S_{d_3}^{\prime}) = \frac{0.9}{0.95}, \; \bold C^1 = 5, 3 $$ and $$ \text{path 2: } \Pr (S_{d_2} \rightarrow S_{d_2}^{\prime}) = \frac{0.05}{0.95}, \; \Pr (S_{d_3} \rightarrow S_{d_3}^{\prime}) = \frac{0.9}{0.95}, \; \bold C^2 = 5, 5. $$ Combining the probabilities from each path we obtain the transition probability of moving to the proposed graph: \begin{equation} \label{eq:cToP} \Pr (\bold S \rightarrow \bold S^{\boldsymbol \prime}) = \frac{1}{5} \frac{1}{3} \frac{0.05}{0.95} \frac{0.9}{0.95} + \frac{1}{5} \frac{1}{5} \frac{0.05}{0.95} \frac{0.9}{0.95} = \Big( \frac{1}{5} \frac{1}{3} + \Big( \frac{1}{5} \Big)^2 \Big) \frac{0.05}{0.95} \frac{0.9}{0.95}. \end{equation} Any directed cycle created when moving from $\bold S$ to $\bold S^{\boldsymbol \prime}$ needs to be created when moving from $\bold S^{\boldsymbol \prime}$ to $\bold S$. Therefore, when moving from $\bold S^{\boldsymbol \prime}$ to $\bold S$ there are also two paths. Path 1 is made up of two steps: i) edge \#3 changes from state 2 to 0 creating a cycle between nodes $T_1$, $T_2$, and $T_3$ and ii) the cycle is removed by changing edge \#2 from state 1 to 0. For path 2 edges \#2 and \#3 both change states in one step. The probabilities for the paths are $$ \text{path 1: } \Pr (S_{d_2}^{\prime} \rightarrow S_{d_2}) = \frac{0.05}{0.95}, \; \Pr (S_{d_3}^{\prime} \rightarrow S_{d_3}) = \frac{0.05}{0.1}, \; \bold C^{1^\prime} = 5, 3 $$ and $$ \text{path 2: } \Pr (S_{d_2}^{\prime} \rightarrow S_{d_2}) = \frac{0.05}{0.95}, \; \Pr (S_{d_3}^{\prime} \rightarrow S_{d_3}) = \frac{0.05}{0.1}, \; \bold C^{2^\prime} = 5, 5. $$ The transition probability of moving back to the current graph is \begin{equation} \label{eq:pToC} \Pr (\bold S^{\boldsymbol \prime} \rightarrow \bold S) = \frac{1}{5} \frac{1}{3} \frac{0.05}{0.95} \frac{0.05}{0.1} + \frac{1}{5} \frac{1}{5} \frac{0.05}{0.95} \frac{0.05}{0.1} = \Big( \frac{1}{5} \frac{1}{3} + \Big( \frac{1}{5} \Big)^2 \Big) \frac{0.05}{0.95} \frac{0.05}{0.1}. \end{equation} The term $\frac{1}{5} \frac{1}{3} + \Big( \frac{1}{5} \Big)^2$ in equations \ref{eq:cToP} and \ref{eq:pToC} cancels out when calculating the acceptance probability, $\alpha$, and we are left with the probability of moving between the states that differ between the current graph (Fig \ref{fig:example1}a) and the proposed graph (Fig \ref{fig:example1}c). More generally, we can apply the same procedure to traverse the paths between any two graphs. \begin{figure}[H] \begin{minipage}[t]{0.33 \textwidth} a) \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and 0.5cm of T2] {$T_4$}; \draw[-latex, thick] (T1) -- (T2) node[midway, above] {1}; \draw[-latex, thick] (T1) -- (T3) node[midway, above] {2}; \draw[-latex, thick] (T2) -- (T3) node[midway, below] {3}; \draw[-latex, thick] (T4) -- (T2) node[midway, below] {4}; \draw[-latex, thick] (T4) -- (T3) node[midway, below] {5}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.33 \textwidth} b) \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and 0.5cm of T2] {$T_4$}; \draw[-latex, thick] (T1) -- (T2) node[midway, above] {1}; \draw[-latex, thick, royalblue] (T3) -- (T1) node[midway, above] {2}; \draw[-latex, thick] (T2) -- (T3) node[midway, below] {3}; \draw[-latex, thick] (T4) -- (T2) node[midway, below] {4}; \draw[-latex, thick] (T4) -- (T3) node[midway, below] {5}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.33 \textwidth} c) \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and 0.5cm of T2] {$T_4$}; \draw[-latex, thick] (T1) -- (T2) node[midway, above] {1}; \draw[-latex, thick, royalblue] (T3) -- (T1) node[midway, above] {2}; \draw[draw = none, royalblue] (T2) -- (T3) node[midway, below] {3}; \draw[-latex, thick] (T4) -- (T2) node[midway, below] {4}; \draw[-latex, thick] (T4) -- (T3) node[midway, below] {5}; \end{tikzpicture} \end{minipage} \caption{The graphs for example 1. a) The current graph. b) An intermediate graph between the current graph and the proposed graph where a directed cycle has been introduced into the network. c) The proposed graph.} \label{fig:example1} \end{figure} \subsection*{\textit{Example 2 -- multiple directed cycles}} We show a second more complex example below. If we start with the graph in Figure \ref{fig:example2}a with states $\bold S = (0, 0, 0, 1, 1)$ and the proposed graph in Figure \ref{fig:example2}d with states $\bold S^{\boldsymbol \prime} = (2, 1, 1, 1, 0)$ there are four edges with different states between the two graphs and $\bold D = 1, 2, 3, 5$. There are three different paths to move from $\bold S$ to $\bold S^{\boldsymbol \prime}$. The steps in path 1 are: i) edges \#2 and \#5 change directions creating two directed cycles, the first cycle is between nodes $T_1$, $T_2$, and $T_3$ and the second cycle is between nodes $T_2$, $T_3$, and $T_4$ (Figure \ref{fig:example2}b), ii) edge \#1 changes from state 0 to 2 removing the first cycle (Figure \ref{fig:example2}c), and iii) edge \#3 changes direction which removes the second cycle (Figure \ref{fig:example2}d). The steps in path 2 are: i) edges \#1, \#2, and \#5 all change states creating one directed cycle between nodes $T_2$, $T_3$, and $T_4$ (Figure \ref{fig:example2}c) and ii) edge \#3 changes direction removing the cycle. In path 3 edges \#1, \#2, \#3, and \#5 all change states in one step. If the prior on edge states is $p_0 = 0.05$, $p_1 = 0.05$, and $p_2 = 0.9$ then the probabilities for the three paths are: $$ \text{path 1:} \Pr (S_{d_1} \rightarrow S_{d_1}^{\prime}) = \frac{0.9}{0.95}, \Pr (S_{d_2} \rightarrow S_{d_2}^{\prime}) = \frac{0.05}{0.95}, \Pr (S_{d_3} \rightarrow S_{d_3}^{\prime}) = \frac{0.05}{0.95}, \Pr (S_{d_5} \rightarrow S_{d_5}^{\prime}) = \frac{0.05}{0.95}, \bold C^1 = 5, 5, 3, 3, $$ $$ \text{path 2:} \Pr (S_{d_1} \rightarrow S_{d_1}^{\prime}) = \frac{0.9}{0.95}, \Pr (S_{d_2} \rightarrow S_{d_2}^{\prime}) = \frac{0.05}{0.95}, \Pr (S_{d_3} \rightarrow S_{d_3}^{\prime}) = \frac{0.05}{0.95}, \Pr (S_{d_5} \rightarrow S_{d_5}^{\prime}) = \frac{0.05}{0.95}, \bold C^2 = 5, 5, 5, 3, $$ and $$ \text{path 3:} \Pr (S_{d_1} \rightarrow S_{d_1}^{\prime}) = \frac{0.9}{0.95}, \Pr (S_{d_2} \rightarrow S_{d_2}^{\prime}) = \frac{0.05}{0.95}, \Pr (S_{d_3} \rightarrow S_{d_3}^{\prime}) = \frac{0.05}{0.95}, \Pr (S_{d_5} \rightarrow S_{d_5}^{\prime}) = \frac{0.05}{0.95}, \bold C^3 = 5, 5, 5, 5. $$ Therefore, the transition probability of moving to the proposed graph is \begin{align} \Pr (\bold S \rightarrow \bold S^{\boldsymbol \prime}) & = \frac{1}{5} \frac{1}{5} \frac{1}{3} \frac{1}{3} \frac{0.9}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95} + \frac{1}{5} \frac{1}{5} \frac{1}{5} \frac{1}{3} \frac{0.9}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95} + \frac{1}{5} \frac{1}{5} \frac{1}{5} \frac{1}{5} \frac{0.9}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95} \nonumber \\ & = \Bigg( \Big( \frac{1}{5} \Big)^2 \Big( \frac{1}{3} \Big)^2 + \Big( \frac{1}{5} \Big)^3 \frac{1}{3} + \Big( \frac{1}{5} \Big)^4 \Bigg) \frac{0.9}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95}. \label{eq:cToP2} \end{align} As in example 1 any directed cycle that is created when moving from $\bold S$ to $\bold S^{\boldsymbol \prime}$ needs to also be created when moving from $\bold S^{\boldsymbol \prime}$ to $\bold S$. There are also three different paths to move back to $\bold S$ from $\bold S^{\boldsymbol \prime}$. In path 1 the steps are: i) edges \#1 and \#3 change states creating two directed cycles the first cycle is between nodes $T_1$, $T_2$, and $T_3$ and the second cycle is between nodes $T_2$, $T_3$, and $T_4$, ii) edge \#2 changes direction removing the first cycle, and iii) edge \#5 changes direction removing the second directed cycle. Path 2 has two steps i) edges \#1, \#2 and \#3 all change state creating a directed cycle between nodes $T_2$, $T_3$, and $T_4$ and ii) edge \#5 changes direction removing the cycle. In path 3 there is only one step where edges \#1, \#2, \#3, and \#5 all change states. The probabilities for these paths are $$ \text{path 1:} \Pr (S_{d_1}^{\prime} \rightarrow S_{d_1}) = \frac{0.05}{0.1}, \Pr (S_{d_2}^{\prime} \rightarrow S_{d_2}) = \frac{0.05}{0.95}, \Pr (S_{d_3}^{\prime} \rightarrow S_{d_3}) = \frac{0.05}{0.95}, \Pr (S_{d_5}^{\prime} \rightarrow S_{d_5}) = \frac{0.05}{0.95}, \bold C^{1^\prime} = 5, 5, 3, 3, $$ $$ \text{path 2:} \Pr (S_{d_1}^{\prime} \rightarrow S_{d_1}) = \frac{0.05}{0.1}, \Pr (S_{d_2}^{\prime} \rightarrow S_{d_2}) = \frac{0.05}{0.95}, \Pr (S_{d_3}^{\prime} \rightarrow S_{d_3}) = \frac{0.05}{0.95}, \Pr (S_{d_5}^{\prime} \rightarrow S_{d_5}) = \frac{0.05}{0.95}, \bold C^{2^\prime} = 5, 5, 5, 3, $$ and $$ \text{path 3:} \Pr (S_{d_1}^{\prime} \rightarrow S_{d_1}) = \frac{0.05}{0.1}, \Pr (S_{d_2}^{\prime} \rightarrow S_{d_2}) = \frac{0.05}{0.95}, \Pr (S_{d_3}^{\prime} \rightarrow S_{d_3}) = \frac{0.05}{0.95}, \Pr (S_{d_5}^{\prime} \rightarrow S_{d_5}) = \frac{0.05}{0.95}, \bold C^{3^\prime} = 5, 5, 5, 5. $$ Therefore, the transition probability of moving back to the current graph is \begin{align} \Pr (\bold S^{\boldsymbol \prime} \rightarrow \bold S) & = \frac{1}{5} \frac{1}{5} \frac{1}{3} \frac{1}{3} \frac{0.05}{0.1} \frac{0.05}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95} + \frac{1}{5} \frac{1}{5} \frac{1}{5} \frac{1}{3} \frac{0.05}{0.1} \frac{0.05}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95} + \frac{1}{5} \frac{1}{5} \frac{1}{5} \frac{1}{5} \frac{0.05}{0.1} \frac{0.05}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95} \nonumber \\ & = \Bigg( \Big( \frac{1}{5} \Big)^2 \Big( \frac{1}{3} \Big)^2 + \Big( \frac{1}{5} \Big)^3 \frac{1}{3} + \Big( \frac{1}{5} \Big)^4 \Bigg) \frac{0.05}{0.1} \frac{0.05}{0.95} \frac{0.05}{0.95} \frac{0.05}{0.95}. \label{eq:pToC2} \end{align} The term $\Big( \frac{1}{5} \Big)^2 \Big( \frac{1}{3} \Big)^2 + \Big( \frac{1}{5} \Big)^3 \frac{1}{3} + \Big( \frac{1}{5} \Big)^4$ in equations \ref{eq:cToP2} and \ref{eq:pToC2} cancels out when calculating the acceptance probability, $\alpha$, and we are left with the probability of moving between the states that differ between the current graph (Fig \ref{fig:example2}a) and the proposed graph (Fig \ref{fig:example2}d). More generally, we can apply the same procedure to traverse the paths between any two graphs. \begin{figure}[H] \begin{minipage}[t]{0.25 \textwidth} a) \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and 0.5cm of T2] {$T_4$}; \draw[-latex, thick] (T1) -- (T2) node[midway, above] {1}; \draw[-latex, thick] (T1) -- (T3) node[midway, above] {2}; \draw[-latex, thick] (T2) -- (T3) node[midway, below] {3}; \draw[-latex, thick] (T4) -- (T2) node[midway, below] {4}; \draw[-latex, thick] (T4) -- (T3) node[midway, below] {5}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.25 \textwidth} b) \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and 0.5cm of T2] {$T_4$}; \draw[-latex, thick] (T1) -- (T2) node[midway, above] {1}; \draw[-latex, thick, royalblue] (T3) -- (T1) node[midway, above] {2}; \draw[-latex, thick] (T2) -- (T3) node[midway, below] {3}; \draw[-latex, thick] (T4) -- (T2) node[midway, below] {4}; \draw[-latex, thick, royalblue] (T3) -- (T4) node[midway, below] {5}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.25 \textwidth} c) \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and 0.5cm of T2] {$T_4$}; \draw[draw = none, royalblue] (T1) -- (T2) node[midway, above] {1}; \draw[-latex, thick, royalblue] (T3) -- (T1) node[midway, above] {2}; \draw[-latex, thick] (T2) -- (T3) node[midway, below] {3}; \draw[-latex, thick] (T4) -- (T2) node[midway, below] {4}; \draw[-latex, thick, royalblue] (T3) -- (T4) node[midway, below] {5}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.25 \textwidth} d) \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and 0.5cm of T2] {$T_4$}; \draw[draw = none, royalblue] (T1) -- (T2) node[midway, above] {1}; \draw[-latex, thick, royalblue] (T3) -- (T1) node[midway, above] {2}; \draw[-latex, thick, royalblue] (T3) -- (T2) node[midway, below] {3}; \draw[-latex, thick] (T4) -- (T2) node[midway, below] {4}; \draw[-latex, thick, royalblue] (T3) -- (T4) node[midway, below] {5}; \end{tikzpicture} \end{minipage}% \caption{a) The current graph. b) An intermediate graph between the current graph and the proposed graph where two directed cycles have been introduced into the graph. c) An intermediate graph where one of the directed cycles has been removed. d) The proposed graph.} \label{fig:example2} \end{figure} \section{Proof of Theorem 1} \begin{theorem} When calculating the acceptance probability, $\alpha$, the transition probability between the current and proposed graph, $\Pr (\bold S \rightarrow \bold S^{\boldsymbol \prime})$ and $\Pr (\bold S^{\boldsymbol \prime} \rightarrow \bold S)$, depends only on the edges whose states are different between the two graphs. \end{theorem} \begin{proof} Recall that $\bold S$ is a vector of edge states representing the current graph $\mathcal{G}$ and $\bold S^{\boldsymbol \prime}$ is a vector of edge states representing the proposal graph $\mathcal{G}^\prime$. Let $\bold D$ be a vector of indices of the edges that {\it differ} between the current graph $\bold S$ and proposed graph $\bold S^{\boldsymbol \prime}$ and $\bold C$ be an integer vector where the element $c_j$ represents the number of edges that {\it can} change state for the edge represented by $d_j$. These two vectors have the same length, denoted by $h$. We will consider two cases: without and with potential directed cycles in the graph. \begin{case} Without potential directed cycles the probability of moving from the current graph to the proposed graph is \begin{align} \Pr (\bold S \rightarrow \bold S^{\boldsymbol \prime}) & = \prod_{j = 1}^{h} \frac{1}{c_j} \Pr (S_{d_j} \rightarrow S_{d_j}^{\prime}) \nonumber \\ & = \prod_{j = 1}^{h} \frac{1}{c_j} \prod_{j = 1}^{h} \Pr (S_{d_j} \rightarrow S_{d_j}^{\prime}). \label{eq:cTopProof} \end{align} We can use the same procedure of deriving the equation for moving back to the current graph from the proposed graph. Therefore, the probability can be broken down in the same way when moving backwards: \begin{align} \Pr (\bold S^{\boldsymbol \prime} \rightarrow \bold S) & = \prod_{j = 1}^{h} \frac{1}{c_j} \prod_{j = 1}^{h} \Pr (S_{d_j}^{\prime} \rightarrow S_{d_j}).\label{eq:pTocProof} \end{align} Since there are no potential directed cycles in the network the value $c_j$ will always be $m$ which is the number of edges in the network. Therefore, $\prod_{j = 1}^{h} \frac{1}{c_j} = \prod_{j = 1}^{h} \frac{1}{m}$ whether going from $\bold S \rightarrow \bold S^{\boldsymbol \prime}$ or $\bold S^{\boldsymbol \prime} \rightarrow \bold S$ and will cancel when calculating the acceptance probability, leaving $\prod_{j = 1}^{h} \Pr (S_{d_j} \rightarrow S_{d_j}^{\prime})$ and $\prod_{j = 1}^{h} \Pr (S_{d_j}^{\prime} \rightarrow S_{d_j})$. \end{case} \begin{case} With potential directed cycles there can be multiple paths when moving from the current graph to the proposed graph. Let $\bold C^k$ be a vector where each $c_j^k$ is the number of edges that can change state in path $k$ when moving from $\bold S$ to $\bold S^{\boldsymbol \prime}$ and $\bold C^{k^\prime}$ be a vector where each $c_j^{k^\prime}$ is the number of edges that can change state in path $k$ when moving from $\bold S^{\boldsymbol \prime}$ to $\bold S$. Using equation (\ref{eq:cTopProof}) the transition probability of moving from the current graph to the proposed graph when there are multiple paths becomes \begin{align} \Pr (\bold S \rightarrow \bold S^{\boldsymbol \prime}) & = \sum_{k = 1}^K \prod_{j = 1}^{h} \frac{1}{c_j^k} \prod_{j = 1}^{h} \Pr (S_{d_j} \rightarrow S_{d_j}^{\prime}) = \prod_{j = 1}^{h} \Pr (S_{d_j} \rightarrow S_{d_j}^{\prime}) \sum_{k = 1}^K \prod_{j = 1}^{h} \frac{1}{c_j^k}. \label{eq:cTopSum} \end{align} Similarly, the transition probability when there are multiple paths of moving back to the current graph from the proposed graph is \begin{align} \Pr (\bold S^{\boldsymbol \prime} \rightarrow \bold S) & = \sum_{k = 1}^K \prod_{j = 1}^{h} \frac{1}{c_j^{k^\prime}} \prod_{j = 1}^{h} \Pr (S_{d_j}^{\prime} \rightarrow S_{d_j}) = \prod_{j = 1}^{h} \Pr (S_{d_j}^{\prime} \rightarrow S_{d_j}) \sum_{k = 1}^K \prod_{j = 1}^{h} \frac{1}{c_j^{k^\prime}}. \label{eq:pTocSum} \end{align} In equations (\ref{eq:cTopSum}) and (\ref{eq:pTocSum}) the summation over $K$ represents the different paths (Section \ref{sec:examples}) to get from one graph to another and the last equality holds because the edges that are different between $\bold S$ and $\bold S^{\boldsymbol \prime}$ do not depend on the path $k$. For each path $k$ \begin{align} \bold C^k & = (c_1^k, c_2^k, c_3^k, \dots, c_h^k) \label{eq:ck1} \\ & = (\underbrace{c_1^k, c_2^k, \dots, c_j^k}_{\text{create cycle(s)}}, \underbrace{c_{j + 1}^k, \dots, c_h^k}_{\text{remove cycle(s)}}) \label{eq:ck2} \\ & = (\underbrace{m, \dots, m}_{\text{$j$}}, c_{j + 1}^k, \dots, c_h^k). \label{eq:ck3} \end{align} The first $j$ elements can create one or more directed cycles. The remaining $h - j$ elements then remove the cycle(s) that were introduced in the network and their values are equal to the number of edges that make up the directed cycle that is being removed. The cycles that are created and removed in any path $k$ from $\bold S$ to $\bold S^{\boldsymbol \prime}$ can also be created and removed when moving from $\bold S^{\boldsymbol \prime}$ to $\bold S$. Therefore, the equations for moving from the proposed graph to the current graph will be the same as Equations \ref{eq:ck1} - \ref{eq:ck3} except for the $^\prime$ symbol indicating that we are moving backwards: \begin{align} \bold C^{k^\prime} & = (c_1^{k^\prime}, c_2^{k^\prime}, c_3^{k^\prime}, \dots, c_h^{k^\prime}) \\ & = (\underbrace{c_1^{k^\prime}, c_2^{k^\prime}, \dots, c_j^{k^\prime}}_{\text{create cycle(s)}}, \underbrace{c_{j + 1}^{k^\prime}, \dots, c_h^{k^\prime}}_{\text{remove cycle(s)}}) \\ & = (\underbrace{m, \dots, m}_{\text{$j$}}, c_{j + 1}^{k^\prime}, \dots, c_h^{k^\prime}), \end{align} and \begin{align} \sum_{k = 1}^K \prod_{j = 1}^{h} \frac{1}{c_j^k} & = \sum_{k = 1}^K \prod_{j = 1}^{h} \frac{1}{c_j^{k^\prime}}. \label{eq:coeff} \end{align} The terms in equation \ref{eq:coeff} will cancel when calculating the acceptance probability and we will be left with $\prod_{j = 1}^{h} \Pr (S_{d_j} \rightarrow S_{d_j}^{\prime})$ and $\prod_{j = 1}^{h} \Pr (S_{d_j}^{\prime} \rightarrow S_{d_j})$. \hfill \proofSymbol \end{case} \end{proof} \section{Principal component analysis on GEUVADIS data} We performed a principal component analysis on the gene expression from all genes in the GEUVADIS data. We next calculated the Pearson correlation between each of the top ten PCs and each of the eQTLs and genes. We then tested all pairwise correlations for statistical significance using the q value method \citep{storey2003} with the FDR = 0.05. The PCs that were significantly associated with an eQTL-gene set were then included in the network as confounding variables. The eQTL-gene sets Q8, Q21, Q23, Q37, and Q50 all have at least one PC associated with them while the eQTL-gene sets Q20 and Q62 do not have any PCs associated with them. \section{Analysis of genomic data} The graphs inferred by baycn are the same for GEUVADIS and GTEx on the eQTL-gene sets Q20 and Q50 while for Q21, Q23, Q37, and Q62 the inference is different between the two consortia. The eQTL-gene sets Q20 (Figure S11) and Q50 (Figure S15) have similar correlation structures (Figures S17 and S21 respectively) between the two consortia which leads to similar posterior probabilities for the inferred edges (Tables S13 and S17 respectively). For both Q23 (Figure S13) and Q37 (Figure S14) no edges are inferred for GTEx. This inference also agrees with the correlation structure of the two data sets (Figures S19 and S20 respectively) as the correlation, for both eQTL-gene sets in GTEx, is close to zero between most variables. Of the five edges inferred in GEUVADIS for Q21 (Figure S12) only two edges (rs147156488 -- FAM27D1 and FAM27D1 -- FAM27A) are inferred for GTEx. Again if we examine the correlation (Figure S18) we can see that the absence of these edges is expected. For Q62 (Figure S16) the only edge inferred for GTEx is between the two genes which is consistent with the near-zero correlation between the eQTL and the two genes. When including PCs in the network the inferred graphs remain largely the same. For both Q37 and Q50 the same edges are inferred with and without PCs and the posterior probability for these edges are nearly identical (compare tables S16 to S22 and S17 to S23). The eQTL-gene set Q21 has one edge less (between rs147156488 and FAM27C) when including the PCs in the network, but the posterior probabilities for the other edges are similar (compare Table S14 to S20). The eQTL-gene set Q23 has the same edges inferred with and without PCs, but the direction of the edge between AGAP9 and AGAP10 is not the same (Figure S13a,c). \newpage \setcounter{figure}{0} \renewcommand{\thefigure}{S\arabic{figure}} \section*{Supplementary figures} \begin{figure}[H] \centering \includegraphics[width = \textwidth]{output.pdf} \caption{An example of the output from baycn. (a) Topology GN4 (b) Edge states and log likelihood for the graph accepted at each iteration of the Metropolis-Hastings algorithm. (c) The proportion of each edge state provides an estimate of the posterior probability of the edge state for each edge in table (b).} \label{fig:output} \end{figure} \begin{figure}[H] \centering \begin{minipage}{0.25 \columnwidth} \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and 0.5cm of T2] {$T_4$}; \draw[-latex, thick, sweetpotato] (T1) -- (T2) node[midway, above] {1}; \draw[-latex, thick] (T1) -- (T3) node[midway, above] {2}; \draw[-latex, thick, sweetpotato] (T2) -- (T4) node[midway, below] {3}; \draw[-latex, thick] (T4) -- (T3) node[midway, below] {4}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.25 \columnwidth} \centering \begin{tabu}spread 0pt{@{} l l l l @{}} \toprule & \multicolumn{3}{c}{Expected} \\ & \multicolumn{3}{c}{Probability} \\ \cmidrule(lr){2-4} Edge & 0 & 1 & 2 \\ \midrule 1 & 0.33 & 0.66 & 0 \\ 2 & 1 & 0 & 0 \\ 3 & 0.66 & 0.33 & 0 \\ 4 & 0 & 1 & 0 \\ \bottomrule \end{tabu} \end{minipage}% \caption{\label{fig:gn4} The true graph and expected probabilities for each edge in topology GN4. The edges in orange can change direction while remaining in the Markov equivalence class of the true graph -- as long as another v structure is not created.} \label{fig:gn4} \end{figure} \begin{figure}[H] \begin{minipage}{0.33 \textwidth} \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and 0.5cm of T2] {$T_4$}; \draw[-latex, thick, sweetpotato] (T1) -- (T2) node[midway, above] {1}; \draw[-latex, thick] (T1) -- (T3) node[midway, above] {2}; \draw[-latex, thick, sweetpotato] (T2) -- (T4) node[midway, below] {3}; \draw[-latex, thick] (T4) -- (T3) node[midway, below] {4}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.33 \textwidth} \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and 0.5cm of T2] {$T_4$}; \draw[-latex, thick, sweetpotato] (T2) -- (T1) node[midway, above] {1}; \draw[-latex, thick] (T1) -- (T3) node[midway, above] {2}; \draw[-latex, thick, sweetpotato] (T2) -- (T4) node[midway, below] {3}; \draw[-latex, thick] (T4) -- (T3) node[midway, below] {4}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.33 \textwidth} \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and 0.5cm of T2] {$T_4$}; \draw[-latex, thick, sweetpotato] (T2) -- (T1) node[midway, above] {1}; \draw[-latex, thick] (T1) -- (T3) node[midway, above] {2}; \draw[-latex, thick, sweetpotato] (T4) -- (T2) node[midway, below] {3}; \draw[-latex, thick] (T4) -- (T3) node[midway, below] {4}; \end{tikzpicture} \end{minipage}% \captionsetup{width = 0.9 \linewidth} \caption{The Markov equivalence class of topology GN4. The edges in orange show all possible combinations of edge directions of the Markov equivalence class. Edge 1 is oriented $T_1 \rightarrow T_2$ in one of the three graphs, giving a proportion of 0.33 for edge state 0. Edge 2 is oriented $T_2 \rightarrow T_4$ in two of the three graphs, giving a proportion of 0.66 for state 0.} \label{fig:gn4me} \end{figure} \begin{figure}[H] \centering \begin{minipage}{0.25 \columnwidth} \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and -0.15cm of T2] {$T_4$}; \node[gene] (T5) [below left = 0.75cm and -0.15cm of T3] {$T_5$}; \draw[-latex, thick, sweetpotato] (T1) -- (T2) node[midway, left] {1}; \draw[-latex, thick, sweetpotato] (T2) -- (T4) node[midway, left] {3}; \draw[-latex, thick, sweetpotato] (T1) -- (T3) node[midway, right] {2}; \draw[-latex, thick] (T3) -- (T5) node[midway, right] {4}; \draw[-latex, thick] (T4) -- (T5) node[midway, below] {5}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.25 \columnwidth} \centering \begin{tabu}spread 0pt{@{} l l l l @{}} \toprule & \multicolumn{3}{c}{Expected} \\ & \multicolumn{3}{c}{Probability} \\ \cmidrule(lr){2-4} Edge & 0 & 1 & 2 \\ \midrule 1 & 0.5 & 0.5 & 0 \\ 2 & 0.75 & 0.25 & 0 \\ 3 & 0.75 & 0.25 & 0 \\ 4 & 1 & 0 & 0 \\ 5 & 1 & 0 & 0 \\ \bottomrule \end{tabu} \end{minipage}% \caption{The true graph and expected probabilities for each edge in topology GN5. The edges in orange can change direction while remaining in the Markov equivalence class of the true graph -- as long as another v structure is not created.} \end{figure} \begin{figure}[H] \begin{minipage}{0.25 \textwidth} \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and -0.15cm of T2] {$T_4$}; \node[gene] (T5) [below left = 0.75cm and -0.15cm of T3] {$T_5$}; \draw[-latex, thick, sweetpotato] (T1) -- (T2) node[midway, left] {1}; \draw[-latex, thick, sweetpotato] (T2) -- (T4) node[midway, left] {3}; \draw[-latex, thick, sweetpotato] (T1) -- (T3) node[midway, right] {2}; \draw[-latex, thick] (T3) -- (T5) node[midway, right] {4}; \draw[-latex, thick] (T4) -- (T5) node[midway, below] {5}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.25 \textwidth} \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and -0.15cm of T2] {$T_4$}; \node[gene] (T5) [below left = 0.75cm and -0.15cm of T3] {$T_5$}; \draw[-latex, thick, sweetpotato] (T1) -- (T2) node[midway, left] {1}; \draw[-latex, thick, sweetpotato] (T2) -- (T4) node[midway, left] {3}; \draw[-latex, thick, sweetpotato] (T3) -- (T1) node[midway, right] {2}; \draw[-latex, thick] (T3) -- (T5) node[midway, right] {4}; \draw[-latex, thick] (T4) -- (T5) node[midway, below] {5}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.25 \textwidth} \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and -0.15cm of T2] {$T_4$}; \node[gene] (T5) [below left = 0.75cm and -0.15cm of T3] {$T_5$}; \draw[-latex, thick, sweetpotato] (T2) -- (T1) node[midway, left] {1}; \draw[-latex, thick, sweetpotato] (T2) -- (T4) node[midway, left] {3}; \draw[-latex, thick, sweetpotato] (T1) -- (T3) node[midway, right] {2}; \draw[-latex, thick] (T3) -- (T5) node[midway, right] {4}; \draw[-latex, thick] (T4) -- (T5) node[midway, below] {5}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.25 \textwidth} \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.5cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.5cm of T1] {$T_3$}; \node[gene] (T4) [below right = 0.75cm and -0.15cm of T2] {$T_4$}; \node[gene] (T5) [below left = 0.75cm and -0.15cm of T3] {$T_5$}; \draw[-latex, thick, sweetpotato] (T2) -- (T1) node[midway, left] {1}; \draw[-latex, thick, sweetpotato] (T4) -- (T2) node[midway, left] {3}; \draw[-latex, thick, sweetpotato] (T1) -- (T3) node[midway, right] {2}; \draw[-latex, thick] (T3) -- (T5) node[midway, right] {4}; \draw[-latex, thick] (T4) -- (T5) node[midway, below] {5}; \end{tikzpicture} \end{minipage}% \captionsetup{width = 0.9 \linewidth} \caption{The Markov equivalence class of topology GN5. The edges in orange show all possible combinations of edge directions of the Markov equivalence class. In two of the four graphs edge 1 is oriented $T_1 \rightarrow T_2$, giving a proportion of 0.5 for edge state 0. In three of the four graphs edge 2 is oriented $T_1 \rightarrow T_3$, giving a proportion of 0.75 for edge state 0. Similarly, edge 3 is oriented $T_2 \rightarrow T_4$ in three of the four graphs, giving a proportion of 0.75 for edge state 0.} \label{fig:gn5me} \end{figure} \begin{figure}[H] \centering \begin{minipage}[c]{0.25 \columnwidth} \centering \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [right = 0.5cm of T1] {$T_2$}; \node[gene] (T3) [right = 0.5cm of T2] {$T_3$}; \node[gene] (T4) [below = 0.75cm of T2] {$T_4$}; \draw[-latex, thick] (T1) -- (T4) node[midway, left] {1}; \draw[-latex, thick] (T2) -- (T4) node[midway, left] {2}; \draw[-latex, thick] (T3) -- (T4) node[midway, left] {3}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.25 \columnwidth} \centering \begin{tabu}spread 0pt{@{} l l l l @{}} \toprule & \multicolumn{3}{c}{Expected} \\ & \multicolumn{3}{c}{Probability} \\ \cmidrule(lr){2-4} Edge & 0 & 1 & 2 \\ \midrule 1 & 1 & 0 & 0 \\ 2 & 1 & 0 & 0 \\ 3 & 1 & 0 & 0 \\ \bottomrule \end{tabu} \end{minipage}% \caption{The true graph and expected probabilities for each edge in the multi-parent topology.} \end{figure} \begin{figure}[H] \centering \begin{minipage}{0.65 \columnwidth} \centering \begin{tikzpicture} \node[gene] (T6) {$T_6$}; \node[gene] (T5) [above left = 0.5cm and 0.25cm of T6] {$T_5$}; \node[gene] (T4) [above left = 0.5cm and 0.25cm of T5] {$T_4$}; \node[gene] (T3) [left = 0.5cm of T4] {$T_3$}; \node[gene] (T2) [below left = 0.75cm and 0.25cm of T3] {$T_2$}; \node[gene] (T1) [below right = 0.75cm and 0.25cm of T2] {$T_1$}; \node[gene] (T7) [above right = 0.5cm and 0.25cm of T6] {$T_7$}; \node[gene] (T8) [above right = 0.5cm and 0.25cm of T7] {$T_8$}; \node[gene] (T9) [right = 0.5cm of T8] {$T_9$}; \node[gene] (T10) [below right = 0.75cm and 0.25cm of T9] {$T_{10}$}; \node[gene] (T11) [below left = 0.75cm and 0.25cm of T10] {$T_{11}$}; \draw[-latex, thick, sweetpotato] (T1) -- (T2) node[near start, left] {1}; \draw[-latex, thick, sweetpotato] (T2) -- (T3) node[midway, left] {2}; \draw[-latex, thick, sweetpotato] (T3) -- (T4) node [midway, above] {3}; \draw[-latex, thick, sweetpotato] (T4) -- (T5) node [midway, left] {4}; \draw[-latex, thick] (T5) -- (T6) node [midway, left] {5}; \draw[-latex, thick] (T7) -- (T6) node [midway, right] {6}; \draw[-latex, thick, sweetpotato] (T7) -- (T8) node [near start, right] {7}; \draw[-latex, thick, sweetpotato] (T8) -- (T9) node [midway, above] {8}; \draw[-latex, thick, sweetpotato] (T9) -- (T10) node [near start, right] {9}; \draw[-latex, thick, sweetpotato] (T10) -- (T11) node [midway, right] {10}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.25 \columnwidth} \centering \begin{tabu}spread 0pt{@{} l l l l @{}} \toprule & \multicolumn{3}{c}{Expected} \\ & \multicolumn{3}{c}{Probability} \\ \cmidrule(lr){2-4} Edge & 0 & 1 & 2 \\ \midrule 1 & 0.2 & 0.8 & 0 \\ 2 & 0.4 & 0.6 & 0 \\ 3 & 0.6 & 0.4 & 0 \\ 4 & 0.8 & 0.2 & 0 \\ 5 & 1 & 0 & 0 \\ \addlinespace 6 & 0 & 1 & 0 \\ 7 & 0.2 & 0.8 & 0 \\ 8 & 0.4 & 0.6 & 0 \\ 9 & 0.6 & 0.4 & 0 \\ 10 & 0.8 & 0.2 & 0 \\ \bottomrule \end{tabu} \end{minipage}% \caption{The true graph and expected probabilities for each edge in topology GN11. The edges in orange can change direction while remaining in the Markov equivalence class of the true graph -- as long as another v structure is not created.} \end{figure} \begin{figure}[H] \centering \begin{minipage}{0.25 \columnwidth} \begin{tikzpicture} \node[gene] (T1) {$T_1$}; \node[gene] (T2) [below left = 0.75cm and 0.25cm of T1] {$T_2$}; \node[gene] (T3) [below right = 0.75cm and 0.25cm of T1] {$T_3$}; \node[gene] (T4) [right = 0.75cm of T1] {$T_4$}; \node[gene] (T5) [below = 0.75cm of T2] {$T_5$}; \node[gene] (T6) [below = 0.75cm of T3] {$T_6$}; \node[gene] (T7) [below = 0.75cm of T6] {$T_7$}; \node[gene] (T8) [below = 0.75cm of T5] {$T_8$}; \draw[-latex, thick, sweetpotato] (T1) to node[near start, left] {1} (T2); \draw[-latex, thick] (T1) to[bend left = 55] node[midway, right] {2} (T6); \draw[-latex, thick] (T1) to[bend right = 50] node[midway, left] {3} (T8); \draw[-latex, thick, sweetpotato] (T2) -- (T3) node[midway, above] {4}; \draw[-latex, thick, sweetpotato] (T2) -- (T5) node[midway, left] {5}; \draw[-latex, thick] (T5) -- (T6) node[midway, above] {6}; \draw[-latex, thick] (T5) -- (T8) node[midway, left] {7}; \draw[-latex, thick] (T6) -- (T7) node[midway, left] {8}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.25 \columnwidth} \centering \begin{tabu}spread 0pt{@{} l l l l @{}} \toprule & \multicolumn{3}{c}{Expected} \\ & \multicolumn{3}{c}{Probability} \\ \cmidrule(lr){2-4} Edge & 0 & 1 & 2 \\ \midrule 1 & 0.25 & 0.75 & 0 \\ 2 & 1 & 0 & 0 \\ 3 & 1 & 0 & 0 \\ 4 & 0.75 & 0.25 & 0 \\ 5 & 0.75 & 0.25 & 0 \\ \addlinespace 6 & 1 & 0 & 0 \\ 7 & 1 & 0 & 0 \\ 8 & 1 & 0 & 0 \\ \bottomrule \end{tabu} \end{minipage}% \caption{The true graph and expected probabilities for each edge in topology GN8. The edges in orange can change direction while remaining in the Markov equivalence class of the true graph -- as long as another v structure is not created.} \end{figure} \begin{figure}[H] \centering \includegraphics[scale = 0.5]{falseEdges.pdf} \caption{The black edges (true edges) were used to simulate the data and the red edges (false edges) were added to the true adjacency matrix as input to baycn.} \end{figure} \begin{figure}[H] \includegraphics[height = 0.4 \textheight]{boxplot_mse3.pdf} \caption{The MSE$_3$ when the true graph skeleton was the input. (a) MSE grouped by method. (b) MSE grouped by method and $\beta$. (c) MSE grouped by method and topology.} \label{fig:boxplot_mse3} \end{figure} \begin{figure}[H] \begin{minipage}{0.5 \linewidth} (a) Q20 GEUVADIS \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs142060986}; \node[draw = none] (T1) [below left = 0.75cm and 0cm of U] {FAM27E1}; \node[draw = none] (T2) [below right = 0.75cm and 0cm of U] {RP11292F9.1}; \draw[-latex, thick] (U) -- (T1) node[near start, left] {\footnotesize (1)\;}; \draw[-latex, thick] (T1) -- (T2) node[midway, below] {\footnotesize (1)}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.5 \linewidth} (b) Q20 GTEx \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs142060986}; \node[draw = none] (T1) [below left = 0.75cm and 0cm of U] {FAM27E1}; \node[draw = none] (T2) [below right = 0.75cm and 0cm of U] {RP11292F9.1}; \draw[-latex, thick] (U) -- (T1) node[near start, left] {\footnotesize (0.95)\;}; \draw[-latex, thick] (T1) -- (T2) node[midway, below] {\footnotesize (0.47)}; \end{tikzpicture} \end{minipage}% \caption{\label{fig:q20} The graph inferred by baycn for eQTL-gene set Q20. The numbers in parenthesis next to the edges indicate the posterior probability for the direction shown. No PCs are associated with this eQTL-gene set. (a) Inferred graph and posterior probabilities from GEUVADIS. (b) Inferred graph with posterior probabilities from GTEx.} \end{figure} \begin{figure}[H] \begin{minipage}[t]{0.333 \linewidth} (a) Q21 GEUVADIS \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs147156488}; \node[draw = none] (T1) [below = 0.75cm of U] {FAM27D1}; \node[draw = none] (T2) [below left = 0.75cm and 0cm of T1] {FAM27C}; \node[draw = none] (T3) [below right = 0.75cm and 0cm of T1] {FAM27A}; \draw[-latex, thick] (U) -- (T1) node[midway, right] {\footnotesize \; (0.55)}; \draw[-latex, thick] (U) -- (T2) node[midway, left] {\footnotesize (0.45) \;}; \draw[thick] (T1) -- (T2) node[near end, right] {\footnotesize \; (0.45, 0.55)}; \draw[-latex, thick] (T1) -- (T3) node[near start, right] {\footnotesize \;(0.495)}; \draw[-latex, thick] (T2) -- (T3) node[midway, below] {\footnotesize (0.525)}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.333 \linewidth} (b) Q21 GTEx \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs147156488}; \node[draw = none] (T1) [below = 0.75cm of U] {FAM27D1}; \node[draw = none] (T2) [below left = 0.75cm and 0cm of T1] {FAM27C}; \node[draw = none] (T3) [below right = 0.75cm and 0cm of T1] {FAM27A}; \draw[-latex, thick] (U) -- (T1) node[midway, right] {\footnotesize (1) \;}; \draw[-latex, thick] (T1) -- (T3) node[near start, right] {\footnotesize \;(0.37)}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.333 \linewidth} (c) Q21 GEUVADIS with PCs \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs147156488}; \node[draw = none] (T1) [below = 0.75cm of U] {FAM27D1}; \node[draw = none] (T2) [below left = 0.75cm and 0cm of T1] {FAM27C}; \node[draw = none] (T3) [below right = 0.75cm and 0cm of T1] {FAM27A}; \node[draw = none] (PC1) [left = 1cm of T1] {PC1}; \node[draw = none] (PC3) [right = 1cm of T1] {PC3}; \draw[-latex, thick] (U) -- (T1) node[midway, right] {\footnotesize \; (1)}; \draw[-latex, thick] (T1) -- (T2) node[near end, right] {\footnotesize \; (1)}; \draw[-latex, thick] (T1) -- (T3) node[near start, right] {\footnotesize \;(0.51)}; \draw[-latex, thick] (T2) -- (T3) node[midway, below] {\footnotesize (0.51)}; \draw[-latex, thick, gray] (U) -- (PC1); \draw[-latex, thick, gray] (U) -- (PC3); \draw[thick, gray] (T1) -- (PC1); \draw[-latex, thick, gray] (T3) -- (PC3); \end{tikzpicture} \end{minipage}% \caption{\label{fig:q21} The graph inferred by baycn for eQTL-gene set Q21 from GEUVADIS and GTEx. The numbers in parenthesis indicate the posterior probability of the edge for the direction shown. For undirected edges the posterior probability for each direction is shown. (a) Inferred graph and posterior probabilities from GEUVADIS. (b) Inferred graph with posterior probabilities from GTEx. (c) Inferred graph with posterior probabilities from GEUVADIS with two PCs included in the network as confounding variables. The edges involving PC nodes are shown in grey; the posterior probability for these edges is not included in the graph but can be found in Table S20.} \end{figure} \begin{figure}[H] \begin{minipage}[t]{0.31 \linewidth} (a) Q23 GEUVADIS \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs150605045}; \node[draw = none] (T1) [below left = 0.75cm and 0cm of U] {AGAP9}; \node[draw = none] (T2) [below right = 0.75cm and 0cm of U] {AGAP10}; \draw[-latex, thick] (U) -- (T1) node[near start, left] {\footnotesize \;(1)\;}; \draw[-latex, thick] (U) -- (T2) node[near start, right] {\footnotesize \;(1)\;}; \draw[-latex, thick] (T2) -- (T1) node[midway, below] {\footnotesize (0.6)}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.31 \linewidth} (b) Q23 GTEx \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs150605045}; \node[draw = none] (T1) [below left = 0.75cm and 0cm of U] {AGAP9}; \node[draw = none] (T2) [below right = 0.75cm and 0cm of U] {AGAP10}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.38 \linewidth} (c) Q23 GEUVADIS with PCs \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs150605045}; \node[draw = none] (T1) [below left = 0.75cm and 0cm of U] {AGAP9}; \node[draw = none] (T2) [below right = 0.75cm and 0cm of U] {AGAP10}; \node[draw = none] (PC1) [left = 1.5cm of U] {PC1}; \node[draw = none] (PC8) [below = 0.25cm of PC1] {PC8}; \draw[-latex, thick] (U) -- (T1) node[near start, left] {\footnotesize \;(1)\;}; \draw[-latex, thick] (U) -- (T2) node[near start, right] {\footnotesize \;(1)\;}; \draw[-latex, thick] (T1) -- (T2) node[midway, below] {\footnotesize (0.720)}; \draw[-latex, thick, gray] (U) -- (PC1); \draw[-latex, thick, gray] (U) -- (PC8); \draw[-latex, thick, gray] (T1) -- (PC1); \draw[thick, gray] (T1) -- (PC8); \end{tikzpicture} \end{minipage}% \caption{\label{fig:q23} The graph inferred by baycn for the eQTL-gene set Q23 from GEUVADIS and GTEx. The numbers in parenthesis indicate the posterior probability of the edge for the direction shown. For undirected edges the posterior probability for each direction is shown. (a) Inferred graph and posterior probabilities from GEUVADIS. (b) Inferred graph with posterior probabilities from GTEx. (c) Inferred graph with posterior probabilities from GEUVADIS with two PCs included in the network as confounding variables. The edges involving PC nodes are shown in grey; the posterior probability for these edges is not included in the graph but can be found in Table S21.} \end{figure} \begin{figure}[H] \begin{minipage}[t]{0.5 \linewidth} (a) Q37 GEUVADIS \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs3858954}; \node[draw = none] (T1) [below = 0.75cm of U] {GOLGA6L20}; \node[draw = none] (T2) [below left = 0.75cm and 0cm of T1] {GOLGA6L19}; \node[draw = none] (T3) [below right = 0.75cm and 0cm of T1] {GOLGA6L9}; \draw[-latex, thick] (U) -- (T1) node[midway, right] {\footnotesize \;(0.96)}; \draw[-latex, thick] (U) -- (T2) node[midway, left] {\footnotesize (0.66) \;}; \draw[-latex, thick] (T1) -- (T2) node[midway, right] {\footnotesize \; (0.655)}; \draw[-latex, thick] (T1) -- (T3) node[midway, right] {\footnotesize \; (0.855)}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.5 \linewidth} (b) Q37 GTEx \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs3858954}; \node[draw = none] (T1) [below = 0.75cm of U] {GOLGA6L20}; \node[draw = none] (T2) [below left = 0.75cm and 0cm of T1] {GOLGA6L19}; \node[draw = none] (T3) [below right = 0.75cm and 0cm of T1] {GOLGA6L9}; \end{tikzpicture} \end{minipage}% \vspace{15pt} \centering \begin{minipage}{0.5 \linewidth} (c) Q37 GEUVADIS with PCs \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs3858954}; \node[draw = none] (T1) [below = 0.75cm of U] {GOLGA6L20}; \node[draw = none] (T2) [below left = 0.75cm and 0cm of T1] {GOLGA6L19}; \node[draw = none] (T3) [below right = 0.75cm and 0cm of T1] {GOLGA6L9}; \node[draw = none] (PC1) [below = 1.5cm of T1] {PC1}; \draw[-latex, thick] (U) -- (T1) node[midway, right] {\footnotesize \;(0.965)\;}; \draw[-latex, thick] (U) -- (T2) node[midway, left] {\footnotesize \;(0.66)\;}; \draw[-latex, thick] (T1) -- (T2) node[midway, right] {\footnotesize \;(0.665)\;}; \draw[-latex, thick] (T1) -- (T3) node[midway, right] {\footnotesize \;(0.825)\;}; \draw[-latex, thick, gray] (T2) -- (PC1); \end{tikzpicture} \end{minipage}% \caption{\label{fig:q37} The graph inferred by baycn for the eQTL-gene set Q37 from both GEUVADIS and GTEx. The numbers in parenthesis indicate the posterior probability of the edge for the direction shown. (a) Inferred graph and posterior probabilities from GEUVADIS. (b) Inferred graph with posterior probabilities from GTEx. (c) Inferred graph with posterior probabilities from GEUVADIS with two PCs included in the network as confounding variables. The edges involving PC nodes are shown in grey; the posterior probability for these edges is not included in the graph but can be found in Table S22.} \end{figure} \begin{figure}[H] \begin{minipage}[t]{0.31 \linewidth} (a) Q50 GEUVADIS \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs7124238}; \node[draw = none] (T1) [below left = 0.75cm and 0cm of U] {SBF2-AS1}; \node[draw = none] (T2) [below right = 0.75cm and 0cm of U] {SWAP70}; \draw[-latex, thick] (U) -- (T2) node[near start, right] {\footnotesize \;(1)\;}; \draw[-latex, thick] (T2) -- (T1) node[midway, below] {\footnotesize (0.88)}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.31 \linewidth} (b) Q50 GTEx \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs7124238}; \node[draw = none] (T1) [below left = 0.75cm and 0cm of U] {SBF2-AS1}; \node[draw = none] (T2) [below right = 0.75cm and 0cm of U] {SWAP70}; \draw[-latex, thick] (U) -- (T2) node[near start, right] {\footnotesize \;(1)\;}; \draw[-latex, thick] (T2) -- (T1) node[midway, below] {\footnotesize (0.83)}; \end{tikzpicture} \end{minipage}% \begin{minipage}[t]{0.38 \linewidth} (c) Q50 GEUVADIS with PCs \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs7124238}; \node[draw = none] (T1) [below left = 0.75cm and 0cm of U] {SBF2-AS1}; \node[draw = none] (T2) [below right = 0.75cm and 0cm of U] {SWAP70}; \node[draw = none] (PC1) [below = 1.75cm of U] {PC1}; \node[draw = none] (PC5) [right = 1cm of U] {PC5}; \draw[-latex, thick] (U) -- (T2) node[near start, right] {\footnotesize \;(1)\;}; \draw[-latex, thick] (T2) -- (T1) node[midway, below] {\footnotesize (0.965)}; \draw[-latex, thick, gray] (U) -- (PC5); \draw[-latex, thick, gray] (T2) -- (PC5); \draw[thick, gray] (T2) -- (PC1); \end{tikzpicture} \end{minipage}% \caption{\label{fig:q50} The graph inferred by baycn for the eQTL-gene set Q50 from both GEUVADIS and GTEx. The numbers in parenthesis indicate the posterior probability of the edge for the direction shown. (a) Inferred graph and posterior probabilities from GEUVADIS. (b) Inferred graph with posterior probabilities from GTEx. (c) Inferred graph with posterior probabilities from GEUVADIS with two PCs included in the network as confounding variables. The edges involving PC nodes are shown in grey; the posterior probability for these edges is not included in the graph but can be found in Table S23.} \end{figure} \begin{figure}[H] \begin{minipage}{0.5 \linewidth} (a) Q62 GEUVADIS \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs9426902}; \node[draw = none] (T1) [below left = 0.75cm and 0cm of U] {S100A6}; \node[draw = none] (T2) [below right = 0.75cm and 0cm of U] {S100A4}; \draw[-latex, thick] (U) -- (T1) node[near start, left] {\footnotesize \;(0.845)\;}; \draw[-latex, thick] (U) -- (T2) node[near start, right] {\footnotesize \;(0.42)\;}; \draw[-latex, thick] (T1) -- (T2) node[midway, below] {\footnotesize (0.72)}; \end{tikzpicture} \end{minipage}% \begin{minipage}{0.5 \linewidth} (b) Q62 GTEx \vspace{10pt} \centering \begin{tikzpicture} \node[draw = none] (U) {rs9426902}; \node[draw = none] (T1) [below left = 0.75cm and 0cm of U] {S100A6}; \node[draw = none] (T2) [below right = 0.75cm and 0cm of U] {S100A4}; \draw[thick] (T1) -- (T2) node[midway, below] {\footnotesize (0.53, 0.47)}; \end{tikzpicture} \end{minipage}% \caption{\label{fig:q62} The graph inferred by baycn for eQTL-gene set Q62. The numbers in parenthesis next to the edges indicate the posterior probability for the direction shown. For undirected edges the posterior probability for each direction is shown. No PCs are associated with this eQTL-gene set. (a) Inferred graph and posterior probabilities from GEUVADIS. (b) Inferred graph with posterior probabilities from GTEx.} \end{figure} \begin{figure}[H] \includegraphics[width = \textwidth]{q20.pdf} \caption{\label{fig:q20_chm} Correlation heat map for all nodes from the eQTL-gene set Q20 from GEUVADIS and GTEx.} \end{figure} \begin{figure}[H] \includegraphics[width = \textwidth]{q21.pdf} \caption{\label{fig:q21_chm} Correlation heat map for all nodes from the eQTL-gene set Q21 from GEUVADIS and GTEx.} \end{figure} \begin{figure}[H] \includegraphics[width = \textwidth]{q23.pdf} \caption{\label{fig:q23_chm} Correlation heat map for all nodes from the eQTL-gene set Q23 from GEUVADIS and GTEx.} \end{figure} \begin{figure}[H] \includegraphics[width = \textwidth]{q37.pdf} \caption{\label{fig:q37_chm} Correlation heat map for all nodes from the eQTL-gene set Q37 from GEUVADIS and GTEx.} \end{figure} \begin{figure}[H] \includegraphics[width = \textwidth]{q50.pdf} \caption{\label{fig:q50_chm} Correlation heat map for all nodes from the eQTL-gene set Q50 from GEUVADIS and GTEx.} \end{figure} \begin{figure}[H] \includegraphics[width = \textwidth]{q62.pdf} \caption{\label{fig:q62_chm} Correlation heat map for all nodes from the eQTL-gene set Q62 from GEUVADIS and GTEx.} \end{figure} \begin{figure}[H] \includegraphics[width = \textwidth]{q8_pcs.pdf} \caption{\label{fig:q8_pcs_chm} Correlation heat map for all nodes from the eQTL-gene set Q8 from GEUVADIS with five PCs.} \end{figure} \begin{figure}[H] \includegraphics[width = \textwidth]{q21_pcs.pdf} \caption{\label{fig:q21_pcs_chm} Correlation heat map for all nodes from the eQTL-gene set Q21 from GEUVADIS with two PCs.} \end{figure} \begin{figure}[H] \includegraphics[width = \textwidth]{q23_pcs.pdf} \caption{\label{fig:q23_pcs_chm} Correlation heat map for all nodes from the eQTL-gene set Q23 from GEUVADIS with two PCs.} \end{figure} \begin{figure}[H] \includegraphics[width = \textwidth]{q37_pcs.pdf} \caption{\label{fig:q37_pcs_chm} Correlation heat map for all nodes from the eQTL-gene set Q37 from GEUVADIS with one PC.} \end{figure} \begin{figure}[H] \includegraphics[width = \textwidth]{q50_pcs.pdf} \caption{\label{fig:q50_pcs_chm} Correlation heat map for all nodes from the eQTL-gene set Q50 from GEUVADIS with two PCs.} \end{figure} \newpage \setcounter{table}{0} \renewcommand{\thetable}{S\arabic{table}} \section*{Supplementary tables} \begin{table}[H] \centering \captionsetup{width = 0.9 \linewidth} \caption{The mean and standard deviation of the edge-wise MSE for each edge in topology M1. We used the data sets previously simulated for M1 and included one false edge with the true edges in the input to baycn. We ran baycn with three different priors on edge states for each data set. The rows in red represent false edges.} \begin{tabu}spread 0pt{@{} l l l l l l l l @{}} \toprule & & \multicolumn{6}{c}{eMSE: Topology M1} \\ \cmidrule(lr){3-8} & & \multicolumn{2}{c}{Prior 1} & \multicolumn{2}{c}{Prior 2} & \multicolumn{2}{c}{Prior 3} \\ \cmidrule(lr){3-4} \cmidrule(lr){5-6} \cmidrule(lr){7-8} $N$ & Edge & mean & sd & mean & sd & mean & sd \\ \midrule 100 & 1 & 0.0109 & 0.006 & 0.0078 & 0.0047 & 0.002 & 0.0026\\ & \color{garnet} 2 & \color{garnet} 0.2853 & \color{garnet} 0.0568 & \color{garnet} 0.1859 & \color{garnet} 0.0618 & \color{garnet} 0.0131 & \color{garnet} 0.0139\\ & 3 & 0.0107 & 0.0061 & 0.0091 & 0.0059 & 0.0014 & 0.0015\\ \addlinespace 200 & 1 & 0.0116 & 0.0067 & 0.0075 & 0.005 & 0.002 & 0.0027\\ & \color{garnet} 2 & \color{garnet} 0.2861 & \color{garnet} 0.0816 & \color{garnet} 0.1953 & \color{garnet} 0.0992 & \color{garnet} 0.03 & \color{garnet} 0.0614\\ & 3 & 0.0109 & 0.0063 & 0.0094 & 0.0046 & 0.0019 & 0.0025\\ \addlinespace 600 & 1 & 0.0127 & 0.0062 & 0.008 & 0.0056 & 0.0008 & 0.001\\ & \color{garnet} 2 & \color{garnet} 0.2665 & \color{garnet} 0.038 & \color{garnet} 0.1593 & \color{garnet} 0.052 & \color{garnet} 0.0095 & \color{garnet} 0.0068\\ & 3 & 0.0139 & 0.0085 & 0.0062 & 0.004 & 0.0016 & 0.0021\\ \bottomrule \end{tabu} \label{tab:m1fe} \end{table} \begin{table}[H] \centering \captionsetup{width = 0.9 \linewidth} \caption{The mean and standard deviation of the edge-wise MSE for each edge in topology M2. We used the data sets previously simulated for M2 and included one false edge with the true edges in the input to baycn. We ran baycn with three different priors on edge states for each data set. The rows in red represent false edges.} \begin{tabu}spread 0pt{@{} l l l l l l l l @{}} \toprule & & \multicolumn{6}{c}{eMSE: Topology M2} \\ \cmidrule(lr){3-8} & & \multicolumn{2}{c}{Prior 1} & \multicolumn{2}{c}{Prior 2} & \multicolumn{2}{c}{Prior 3} \\ \cmidrule(lr){3-4} \cmidrule(lr){5-6} \cmidrule(lr){7-8} $N$ & Edge & mean & sd & mean & sd & mean & sd \\ \midrule 100 & 1 & 0.1366 & 0.0269 & 0.1197 & 0.0199 & 0.0224 & 0.026\\ & \color{garnet} 2 & \color{garnet} 0.4035 & \color{garnet} 0.0368 & \color{garnet} 0.3285 & \color{garnet} 0.0548 & \color{garnet} 0.0656 & \color{garnet} 0.0666\\ & 3 & 0.1461 & 0.025 & 0.1241 & 0.0226 & 0.0232 & 0.028\\ \addlinespace 200 & 1 & 0.1329 & 0.0262 & 0.1215 & 0.0222 & 0.0297 & 0.0354\\ & \color{garnet} 2 & \color{garnet} 0.4111 & \color{garnet} 0.0373 & \color{garnet} 0.3474 & \color{garnet} 0.0612 & \color{garnet} 0.0863 & \color{garnet} 0.0975\\ & 3 & 0.1391 & 0.0227 & 0.1209 & 0.0245 & 0.0317 & 0.0396\\ \addlinespace 600 & 1 & 0.1369 & 0.0207 & 0.1183 & 0.0221 & 0.0236 & 0.0164\\ & \color{garnet} 2 & \color{garnet} 0.4062 & \color{garnet} 0.0347 & \color{garnet} 0.3362 & \color{garnet} 0.0459 & \color{garnet} 0.0647 & \color{garnet} 0.0377\\ & 3 & 0.1378 & 0.028 & 0.1186 & 0.0223 & 0.0224 & 0.0149\\ \bottomrule \end{tabu} \label{tab:m2fe} \end{table} \begin{table}[H] \centering \captionsetup{width = 0.9 \linewidth} \caption{The mean and standard deviation of the edge-wise MSE for each edge in topology GN4. We used the data sets previously simulated for GN4 and included one false edge with the true edges in the input to baycn. We ran baycn with three different priors on edge states for each data set. The rows in red represent false edges.} \begin{tabu}spread 0pt{@{} l l l l l l l l @{}} \toprule & & \multicolumn{6}{c}{eMSE: Topology GN4} \\ \cmidrule(lr){3-8} & & \multicolumn{2}{c}{Prior 1} & \multicolumn{2}{c}{Prior 2} & \multicolumn{2}{c}{Prior 3} \\ \cmidrule(lr){3-4} \cmidrule(lr){5-6} \cmidrule(lr){7-8} $N$ & Edge & mean & sd & mean & sd & mean & sd \\ \midrule 100 & 1 & 0.0101 & 0.0182 & 0.011 & 0.0165 & 0.0418 & 0.0797 \\ & 2 & 0.011 & 0.0204 & 0.0098 & 0.0192 & 0.0431 & 0.0821 \\ & \color{garnet} 3 & \color{garnet} 0.2235 & \color{garnet} 0.1185 & \color{garnet} 0.1368 & \color{garnet} 0.1257 & \color{garnet} 0.0301 & \color{garnet} 0.1031 \\ & 4 & 0.0085 & 0.0148 & 0.0078 & 0.0132 & 0.0462 & 0.0817 \\ & 5 & 0.0087 & 0.0162 & 0.0107 & 0.0203 & 0.0459 & 0.0888 \\ \addlinespace 200 & 1 & 0.0012 & 0.0023 & 0.0019 & 0.0036 & 0.0152 & 0.0414 \\ & 2 & 0.0004 & 0.0013 & 0.0012 & 0.004 & 0.0156 & 0.0462 \\ & \color{garnet} 3 & \color{garnet} 0.2154 & \color{garnet} 0.079 & \color{garnet} 0.1139 & \color{garnet} 0.0669 & \color{garnet} 0.005 & \color{garnet} 0.0083 \\ & 4 & 0.0013 & 0.002 & 0.0023 & 0.0045 & 0.0181 & 0.0432 \\ & 5 & 0.0003 & 0.001 & 0.0013 & 0.0043 & 0.012 & 0.0317 \\ \addlinespace 600 & 1 & 0.0008 & 0.0015 & 0.0009 & 0.001 & 0.0103 & 0.0387\\ & 2 & 0 & 0 & 0 & 0 & 0.0102 & 0.0402\\ & \color{garnet} 3 & \color{garnet} 0.2534 & \color{garnet} 0.1019 & \color{garnet} 0.1544 & \color{garnet} 0.1028 & \color{garnet} 0.0092 & \color{garnet} 0.0201\\ & 4 & 0.0007 & 0.0012 & 0.0012 & 0.0015 & 0.011 & 0.038\\ & 5 & 0 & 0 & 0 & 0 & 0.0112 & 0.0503 \\ \bottomrule \end{tabu} \label{tab:gn4fe} \end{table} \begin{table}[H] \centering \captionsetup{width = 0.9 \linewidth} \caption{The mean and standard deviation of the edge-wise MSE for each edge in topology GN11. We used the data sets previously simulated for GN11 and included two false edges with the true edges in the input to baycn. We ran baycn with three different priors on edge states for each data set. The rows in red represent false edges.} \begin{tabu}spread 0pt{@{} l l l l l l l l @{}} \toprule & & \multicolumn{6}{c}{eMSE: Topology GN11} \\ \cmidrule(lr){3-8} & & \multicolumn{2}{c}{Prior 1} & \multicolumn{2}{c}{Prior 2} & \multicolumn{2}{c}{Prior 3} \\ \cmidrule(lr){3-4} \cmidrule(lr){5-6} \cmidrule(lr){7-8} $N$ & Edge & mean & sd & mean & sd & mean & sd \\ \midrule 100 & 1 & 0.0023 & 0.0035 & 0.003 & 0.0038 & 0.0046 & 0.006\\ & \color{garnet} 2 & \color{garnet} 0.2976 & \color{garnet} 0.1311 & \color{garnet} 0.2084 & \color{garnet} 0.1464 & \color{garnet} 0.0386 & \color{garnet} 0.1027\\ & \color{garnet} 3 & \color{garnet} 0.2931 & \color{garnet} 0.0658 & \color{garnet} 0.2039 & \color{garnet} 0.0851 & \color{garnet} 0.0168 & \color{garnet} 0.0239\\ & 4 & 0.0018 & 0.0028 & 0.0035 & 0.0033 & 0.009 & 0.0104\\ & 5 & 0.0029 & 0.0046 & 0.0037 & 0.0048 & 0.0087 & 0.0116\\ & 6 & 0.0045 & 0.007 & 0.0043 & 0.0064 & 0.0038 & 0.0044\\ & 7 & 0 & 0 & 0 & 0 & 0 & 0\\ & 8 & 0 & 0 & 0 & 0 & 0 & 0\\ & 9 & 0.0009 & 0.0011 & 0.0014 & 0.0023 & 0.0037 & 0.005\\ & 10 & 0.0018 & 0.002 & 0.002 & 0.0025 & 0.0107 & 0.0153\\ & 11 & 0.002 & 0.0019 & 0.0024 & 0.0029 & 0.0097 & 0.0132\\ & 12 & 0.0016 & 0.0018 & 0.0016 & 0.0026 & 0.0044 & 0.0057\\ \addlinespace 200 & 1 & 0.0048 & 0.0046 & 0.0033 & 0.0042 & 0.0029 & 0.0036\\ & \color{garnet} 2 & \color{garnet} 0.286 & \color{garnet} 0.1233 & \color{garnet} 0.1938 & \color{garnet} 0.1334 & \color{garnet} 0.0338 & \color{garnet} 0.0753\\ & \color{garnet} 3 & \color{garnet} 0.3161 & \color{garnet} 0.0676 & \color{garnet} 0.2138 & \color{garnet} 0.0676 & \color{garnet} 0.0188 & \color{garnet} 0.0152\\ & 4 & 0.0032 & 0.0052 & 0.0028 & 0.0038 & 0.0076 & 0.0092\\ & 5 & 0.0026 & 0.0043 & 0.0029 & 0.006 & 0.0069 & 0.0085\\ & 6 & 0.0041 & 0.0056 & 0.0032 & 0.0056 & 0.0039 & 0.0052\\ & 7 & 0 & 0 & 0 & 0 & 0 & 0\\ & 8 & 0 & 0 & 0 & 0 & 0 & 0\\ & 9 & 0.0006 & 0.0009 & 0.0004 & 0.0005 & 0.008 & 0.0137\\ & 10 & 0.0013 & 0.0016 & 0.0007 & 0.0013 & 0.0115 & 0.0148\\ & 11 & 0.0018 & 0.0021 & 0.0014 & 0.002 & 0.0093 & 0.0112\\ & 12 & 0.0021 & 0.0025 & 0.0012 & 0.0018 & 0.0038 & 0.0041\\ \addlinespace 600 & 1 & 0.0069 & 0.0069 & 0.0052 & 0.0058 & 0.0048 & 0.0056\\ & \color{garnet} 2 & \color{garnet} 0.2735 & \color{garnet} 0.0938 & \color{garnet} 0.1783 & \color{garnet} 0.0949 & \color{garnet} 0.0147 & \color{garnet} 0.0231\\ & \color{garnet} 3 & \color{garnet} 0.3436 & \color{garnet} 0.1118 & \color{garnet} 0.2446 & \color{garnet} 0.129 & \color{garnet} 0.0557 & \color{garnet} 0.1172\\ & 4 & 0.0049 & 0.0062 & 0.0028 & 0.003 & 0.0108 & 0.0147\\ & 5 & 0.0024 & 0.0029 & 0.0017 & 0.0021 & 0.0077 & 0.0112\\ & 6 & 0.0027 & 0.003 & 0.0015 & 0.0015 & 0.0024 & 0.0023\\ & 7 & 0 & 0 & 0 & 0 & 0 & 0\\ & 8 & 0 & 0 & 0 & 0 & 0 & 0\\ & 9 & 0.0006 & 0.0008 & 0.0009 & 0.0013 & 0.0031 & 0.0036\\ & 10 & 0.0015 & 0.0018 & 0.0023 & 0.0033 & 0.0058 & 0.0069\\ & 11 & 0.0017 & 0.0021 & 0.0029 & 0.0047 & 0.0066 & 0.0087\\ & 12 & 0.0026 & 0.005 & 0.0022 & 0.0041 & 0.0046 & 0.0047\\ \bottomrule \end{tabu} \label{tab:gn11fe} \end{table} \begin{table}[H] \centering \caption{The mean and standard deviation of precision, power, and MSE$_2$ for topology GN4 when a fully connected graph was the input to each algorithm. When calculating precision and power we considered an edge present if the sum of the probability of the two directions was greater than 0.5.} \begin{tabu}spread 0pt{@{} l l l l l l l l l @{}} \toprule & & & \multicolumn{2}{c}{Precision} & \multicolumn{2}{c}{Power} & \multicolumn{2}{c}{MSE$_2$} \\ \cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(lr){8-9} Method & $N$ & $\beta$ & mean & sd & mean & sd & mean & sd \\ \midrule baycn & 100 & 0.2 & 0.94 & 0.2077 & 0.43 & 0.2654 & 0.2398 & 0.0326 \\ & & 0.5 & 0.982 & 0.0627 & 0.98 & 0.0692 & 0.1235 & 0.0478 \\ & & 1 & 0.9707 & 0.0841 & 1 & 0 & 0.0439 & 0.0387 \\ Gibbs & 100 & 0.2 & 0.942 & 0.206 & 0.5 & 0.2602 & 0.2163 & 0.0303 \\ & & 0.5 & 0.984 & 0.0554 & 1 & 0 & 0.1212 & 0.0299 \\ & & 1 & 0.9093 & 0.1184 & 1 & 0 & 0.0938 & 0.0592 \\ MC$^3$ & 100 & 0.2 & 0.942 & 0.206 & 0.49 & 0.265 & 0.2155 & 0.0312 \\ & & 0.5 & 0.976 & 0.0663 & 1 & 0 & 0.1215 & 0.0329 \\ & & 1 & 0.9093 & 0.1184 & 1 & 0 & 0.0945 & 0.0683 \\ order & 100 & 0.2 & 0.80 & 0.4082 & 0.29 & 0.2126 & 0.315 & 0.0562 \\ & & 0.5 & 0.99 & 0.05 & 0.96 & 0.0935 & 0.1197 & 0.0502 \\ & & 1 & 0.992 & 0.04 & 1 & 0 & 0.0193 & 0.0287 \\ partition & 100 & 0.2 & 0.96 & 0.2 & 0.36 & 0.2051 & 0.2546 & 0.04\\ & & 0.5 & 0.982 & 0.0627 & 0.98 & 0.0692 & 0.1118 & 0.0357\\ & & 1 & 0.976 & 0.0663 & 1 & 0 & 0.0287 & 0.0311\\ baycn & 200 & 0.2 & 0.99 & 0.05 & 0.74 & 0.2222 & 0.1812 & 0.0427\\ & & 0.5 & 0.992 & 0.04 & 1 & 0 & 0.101 & 0.0769\\ & & 1 & 0.984 & 0.0554 & 1 & 0 & 0.0307 & 0.0427\\ Gibbs & 200 & 0.2 & 0.98 & 0.0692 & 0.77 & 0.2155 & 0.1763 & 0.0383\\ & & 0.5 & 0.992 & 0.04 & 1 & 0 & 0.1134 & 0.0555\\ & & 1 & 0.952 & 0.0872 & 1 & 0 & 0.0521 & 0.0476\\ MC$^3$ & 200 & 0.2 & 0.98 & 0.0692 & 0.77 & 0.2155 & 0.1765 & 0.0376\\ & & 0.5 & 0.992 & 0.04 & 1 & 0 & 0.1189 & 0.0619\\ & & 1 & 0.96 & 0.0816 & 1 & 0 & 0.0525 & 0.0452\\ order & 200 & 0.2 & 0.9067 & 0.2809 & 0.48 & 0.2385 & 0.2768 & 0.0782\\ & & 0.5 & 1 & 0 & 1 & 0 & 0.1072 & 0.0721\\ & & 1 & 0.992 & 0.04 & 1 & 0 & 0.011 & 0.0349\\ partition & 200 & 0.2 & 0.9867 & 0.0667 & 0.59 & 0.2026 & 0.2087 & 0.0448\\ & & 0.5 & 0.992 & 0.04 & 1 & 0 & 0.1043 & 0.0646\\ & & 1 & 0.992 & 0.04 & 1 & 0 & 0.012 & 0.0261\\ baycn & 600 & 0.2 & 0.992 & 0.04 & 1 & 0 & 0.133 & 0.0358\\ & & 0.5 & 0.992 & 0.04 & 1 & 0 & 0.0954 & 0.096\\ & & 1 & 0.992 & 0.04 & 1 & 0 & 0.0125 & 0.0102\\ Gibbs & 600 & 0.2 & 0.992 & 0.04 & 0.99 & 0.05 & 0.1274 & 0.0219\\ & & 0.5 & 0.992 & 0.04 & 1 & 0 & 0.0982 & 0.0741\\ & & 1 & 0.992 & 0.04 & 1 & 0 & 0.0163 & 0.0156\\ MC$^3$ & 600 & 0.2 & 0.992 & 0.04 & 0.99 & 0.05 & 0.131 & 0.0225\\ & & 0.5 & 0.992 & 0.04 & 1 & 0 & 0.1098 & 0.093\\ & & 1 & 1 & 0 & 1 & 0 & 0.0153 & 0.0124\\ order & 600 & 0.2 & 1 & 0 & 0.96 & 0.1181 & 0.1395 & 0.0391\\ & & 0.5 & 1 & 0 & 1 & 0 & 0.0909 & 0.0903\\ & & 1 & 1 & 0 & 1 & 0 & 0.002 & 0.0008\\ partition & 600 & 0.2 & 1 & 0 & 0.97 & 0.1099 & 0.1288 & 0.0272\\ & & 0.5 & 1 & 0 & 1 & 0 & 0.0869 & 0.077\\ & & 1 & 1 & 0 & 1 & 0 & 0.0016 & 0.0018\\ \bottomrule \end{tabu} \label{tab:pr} \end{table} \begin{table}[H] \centering \caption{The mean and standard deviation of MSE$_2$ when the true skeleton was used as input. We simulated 25 data sets for each combination of topology, $N$, and $\beta$ and we ran each algorithm once per data set. MSE$_2$ is calculated only from the true edges.} \begin{tabu}spread 0pt{@{} l l l l l l l l l @{}} \toprule & & & \multicolumn{6}{c}{MSE$_2$} \\ \cmidrule(lr){4-9} & & & \multicolumn{2}{c}{GN4} & \multicolumn{2}{c}{GN8} & \multicolumn{2}{c}{GN11} \\ \cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(lr){8-9} Method & $N$ & $\beta$ & mean & sd & mean & sd & mean & sd \\ \midrule baycn & 100 & 0.2 & 0.2305 & 0.0351 & 0.2707 & 0.0294 & 0.1743 & 0.0259 \\ & & 0.5 & 0.0987 & 0.0607 & 0.0951 & 0.0401 & 0.0514 & 0.0322 \\ & & 1 & 0.015 & 0.0414 & 0.0286 & 0.0549 & 0.0064 & 0.0047 \\ Gibbs & 100 & 0.2 & 0.2034 & 0.0292 & 0.2483 & 0.0276 & 0.1504 & 0.0215\\ & & 0.5 & 0.1009 & 0.0286 & 0.0873 & 0.0242 & 0.0439 & 0.03\\ & & 1 & 0.0221 & 0.0357 & 0.0313 & 0.0518 & 0.0005 & 0.0003\\ MC$^3$ & 100 & 0.2 & 0.2039 & 0.0279 & 0.2488 & 0.0283 & 0.1508 & 0.0202 \\ & & 0.5 & 0.1022 & 0.0325 & 0.0888 & 0.027 & 0.0438 & 0.0299 \\ & & 1 & 0.1913 & 0.2189 & 0.1573 & 0.124 & 0.0003 & 0.0002 \\ order & 100 & 0.2 & 0.3144 & 0.0563 & 0.368 & 0.0375 & 0.271 & 0.0336 \\ & & 0.5 & 0.1187 & 0.0436 & 0.0997 & 0.0384 & 0.0657 & 0.0374 \\ & & 1 & 0.0146 & 0.0195 & 0.0309 & 0.0432 & 0.0069 & 0.0023 \\ partition & 100 & 0.2 & 0.2505 & 0.0423 & 0.316 & 0.025 & 0.2067 & 0.0247 \\ & & 0.5 & 0.1125 & 0.0388 & 0.1202 & 0.0478 & 0.0656 & 0.0329 \\ & & 1 & 0.0213 & 0.023 & 0.0393 & 0.05 & 0.0291 & 0.0223 \\ \addlinespace baycn & 200 & 0.2 & 0.1796 & 0.0484 & 0.2129 & 0.0372 & 0.1308 & 0.0269 \\ & & 0.5 & 0.1132 & 0.0958 & 0.1302 & 0.0792 & 0.0182 & 0.0243 \\ & & 1 & 0.0069 & 0.0214 & 0.0649 & 0.1041 & 0.0098 & 0.0062 \\ Gibbs & 200 & 0.2 & 0.1716 & 0.0487 & 0.2071 & 0.0345 & 0.1239 & 0.0248 \\ & & 0.5 & 0.106 & 0.0683 & 0.0871 & 0.031 & 0.0134 & 0.0269 \\ & & 1 & 0.0015 & 0.0052 & 0.0005 & 0.0018 & 0.0004 & 0.0004 \\ MC$^3$ & 200 & 0.2 & 0.1725 & 0.0472 & 0.2071 & 0.035 & 0.1237 & 0.0252 \\ & & 0.5 & 0.1152 & 0.0966 & 0.1083 & 0.0626 & 0.0133 & 0.0268 \\ & & 1 & 0.2132 & 0.2264 & 0.2105 & 0.1217 & 0.0003 & 0.0002 \\ order & 200 & 0.2 & 0.2743 & 0.0793 & 0.2993 & 0.053 & 0.2052 & 0.0459 \\ & & 0.5 & 0.1089 & 0.072 & 0.0857 & 0.032 & 0.0322 & 0.0327 \\ & & 1 & 0.0067 & 0.0182 & 0.0051 & 0.0024 & 0.0087 & 0.004 \\ partition & 200 & 0.2 & 0.2035 & 0.045 & 0.2605 & 0.0325 & 0.1653 & 0.0327 \\ & & 0.5 & 0.1034 & 0.0628 & 0.1136 & 0.0561 & 0.0426 & 0.0259 \\ & & 1 & 0.0075 & 0.0133 & 0.013 & 0.0171 & 0.0327 & 0.0216 \\ \addlinespace baycn & 600 & 0.2 & 0.1235 & 0.0372 & 0.1721 & 0.0813 & 0.0908 & 0.0288 \\ & & 0.5 & 0.0755 & 0.0903 & 0.1005 & 0.0992 & 0.0071 & 0.0064 \\ & & 1 & 0.0104 & 0.0273 & 0.0301 & 0.0686 & 0.0068 & 0.0059 \\ Gibbs & 600 & 0.2 & 0.125 & 0.0272 & 0.1674 & 0.0724 & 0.0864 & 0.0276\\ & & 0.5 & 0.0893 & 0.0835 & 0.0651 & 0.0431 & 0.0006 & 0.0012\\ & & 1 & 0 & 0 & 0 & 0 & 0.0005 & 0.0004\\ MC$^3$ & 600 & 0.2 & 0.1241 & 0.0282 & 0.1683 & 0.0741 & 0.0868 & 0.0274 \\ & & 0.5 & 0.229 & 0.2196 & 0.1316 & 0.1398 & 0.0005 & 0.0013 \\ & & 1 & 0.2311 & 0.2266 & 0.2232 & 0.1151 & 0.0003 & 0.0002 \\ order & 600 & 0.2 & 0.1351 & 0.0397 & 0.1648 & 0.069 & 0.1055 & 0.0382 \\ & & 0.5 & 0.0891 & 0.0898 & 0.0518 & 0.0433 & 0.0146 & 0.0158 \\ & & 1 & 0.0018 & 0.0006 & 0.0038 & 0.0005 & 0.0109 & 0.0052 \\ partition & 600 & 0.2 & 0.1257 & 0.028 & 0.1665 & 0.0615 & 0.1 & 0.0305 \\ & & 0.5 & 0.091 & 0.0803 & 0.0736 & 0.0792 & 0.0394 & 0.02 \\ & & 1 & 0.001 & 0.0015 & 0.0059 & 0.0146 & 0.0477 & 0.0389 \\ \bottomrule \end{tabu} \label{tab:mse} \end{table} \begin{table}[H] \centering \caption{\label{tab:mse3} The mean and standard deviation of the MSE$_3$ when the true skeleton was used as input. We simulated 25 data sets for each combination of topology, $N$, and $\beta$ and we ran each algorithm once per data set. MSE$_3$ is calculated from all possible edges in the network.} \begin{tabu}{@{} l l l l l l l l l @{}} \toprule & & & \multicolumn{6}{c}{MSE$_3$} \\ \cmidrule(lr){4-9} & & & \multicolumn{2}{c}{GN4} & \multicolumn{2}{c}{GN8} & \multicolumn{2}{c}{GN11} \\ \cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(lr){8-9} Method & $N$ & $\beta$ & mean & sd & mean & sd & mean & sd \\ \midrule baycn & 100 & 0.2 & 0.1537 & 0.0234 & 0.0773 & 0.0084 & 0.0317 & 0.0047 \\ & & 0.5 & 0.0658 & 0.0404 & 0.0272 & 0.0115 & 0.0094 & 0.0059 \\ & & 1 & 0.01 & 0.0276 & 0.0082 & 0.0157 & 0.0012 & 0.0008 \\ Gibbs & 100 & 0.2 & 0.1356 & 0.0195 & 0.0709 & 0.0079 & 0.0273 & 0.0039 \\ & & 0.5 & 0.0673 & 0.0191 & 0.0249 & 0.0069 & 0.008 & 0.0055 \\ & & 1 & 0.0147 & 0.0238 & 0.0089 & 0.0148 & 0.0001 & 0.0001 \\ MC$^3$ & 100 & 0.2 & 0.1359 & 0.0186 & 0.0711 & 0.0081 & 0.0274 & 0.0037 \\ & & 0.5 & 0.0681 & 0.0217 & 0.0254 & 0.0077 & 0.008 & 0.0054 \\ & & 1 & 0.1276 & 0.1459 & 0.0449 & 0.0354 & 0 & 0 \\ order & 100 & 0.2 & 0.2097 & 0.0375 & 0.1088 & 0.0124 & 0.051 & 0.007 \\ & & 0.5 & 0.081 & 0.0318 & 0.0302 & 0.0124 & 0.0138 & 0.0083 \\ & & 1 & 0.0125 & 0.0184 & 0.0126 & 0.0129 & 0.002 & 0.0017 \\ partition & 100 & 0.2 & 0.169 & 0.0277 & 0.0949 & 0.0095 & 0.0404 & 0.005 \\ & & 0.5 & 0.0778 & 0.0279 & 0.0381 & 0.0152 & 0.0149 & 0.007 \\ & & 1 & 0.0186 & 0.0195 & 0.0158 & 0.0149 & 0.0073 & 0.004 \\ \addlinespace baycn & 200 & 0.2 & 0.1197 & 0.0323 & 0.0608 & 0.0106 & 0.0238 & 0.0049 \\ & & 0.5 & 0.0755 & 0.0639 & 0.0372 & 0.0226 & 0.0033 & 0.0044 \\ & & 1 & 0.0046 & 0.0142 & 0.0185 & 0.0297 & 0.0018 & 0.0011 \\ Gibbs & 200 & 0.2 & 0.1144 & 0.0325 & 0.0592 & 0.0098 & 0.0225 & 0.0045 \\ & & 0.5 & 0.0707 & 0.0455 & 0.0249 & 0.0089 & 0.0024 & 0.0049 \\ & & 1 & 0.001 & 0.0035 & 0.0001 & 0.0005 & 0.0001 & 0.0001 \\ MC$^3$ & 200 & 0.2 & 0.115 & 0.0315 & 0.0592 & 0.01 & 0.0225 & 0.0046 \\ & & 0.5 & 0.0768 & 0.0644 & 0.0309 & 0.0179 & 0.0024 & 0.0049 \\ & & 1 & 0.1421 & 0.151 & 0.0601 & 0.0348 & 0.0001 & 0 \\ order & 200 & 0.2 & 0.1846 & 0.0527 & 0.0878 & 0.016 & 0.0381 & 0.0086 \\ & & 0.5 & 0.0727 & 0.0479 & 0.0257 & 0.0105 & 0.008 & 0.0073 \\ & & 1 & 0.0068 & 0.0204 & 0.0026 & 0.0039 & 0.003 & 0.0031 \\ partition & 200 & 0.2 & 0.1377 & 0.0305 & 0.077 & 0.0089 & 0.0318 & 0.0064 \\ & & 0.5 & 0.0697 & 0.0414 & 0.0347 & 0.0174 & 0.0106 & 0.0059 \\ & & 1 & 0.0075 & 0.0142 & 0.0064 & 0.0059 & 0.0078 & 0.0046 \\ \addlinespace baycn & 600 & 0.2 & 0.0824 & 0.0248 & 0.0492 & 0.0232 & 0.0165 & 0.0052 \\ & & 0.5 & 0.0503 & 0.0602 & 0.0287 & 0.0283 & 0.0013 & 0.0012 \\ & & 1 & 0.0069 & 0.0182 & 0.0086 & 0.0196 & 0.0012 & 0.0011 \\ Gibbs & 600 & 0.2 & 0.0834 & 0.0181 & 0.0478 & 0.0207 & 0.0157 & 0.005 \\ & & 0.5 & 0.0595 & 0.0557 & 0.0186 & 0.0123 & 0.0001 & 0.0002 \\ & & 1 & 0 & 0 & 0 & 0 & 0.0001 & 0.0001 \\ MC$^3$ & 600 & 0.2 & 0.0828 & 0.0188 & 0.0481 & 0.0212 & 0.0158 & 0.005 \\ & & 0.5 & 0.1527 & 0.1464 & 0.0376 & 0.0399 & 0.0001 & 0.0002 \\ & & 1 & 0.1541 & 0.1511 & 0.0638 & 0.0329 & 0.0001 & 0 \\ order & 600 & 0.2 & 0.0902 & 0.0266 & 0.048 & 0.0193 & 0.0201 & 0.0071 \\ & & 0.5 & 0.0595 & 0.0597 & 0.0162 & 0.0136 & 0.0034 & 0.0041 \\ & & 1 & 0.0013 & 0.0005 & 0.0019 & 0.0035 & 0.003 & 0.0026 \\ partition & 600 & 0.2 & 0.0843 & 0.0189 & 0.0488 & 0.0173 & 0.0198 & 0.0055\\ & & 0.5 & 0.0611 & 0.0534 & 0.0225 & 0.0229 & 0.0087 & 0.0041\\ & & 1 & 0.0012 & 0.0016 & 0.0033 & 0.0054 & 0.0102 & 0.0076\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \centering \caption{\label{tab:runtime} The mean runtime in seconds across 25 data sets. For each topology 25 data sets were generated with $\beta = 1$ and $N = 600$ and each algorithm was run once per data set and the runtime in seconds was recorded. All algorithms were run on an Intel Xeon D-1540 2.00 GHz processor with 128 GB of memory.} \begin{tabu}{@{} l r r r r r @{}} \toprule & \multicolumn{5}{c}{Runtime} \\ \cmidrule(lr){2-6} Topology & baycn & Gibbs & MC$^3$ & order & partition \\ \midrule GN4 & 4.49 & 235.00 & 11.94 & 1.78 & 3.93\\ GN8 & 8.11 & 363.91 & 22.49 & 2.88 & 7.97\\ GN11 & 7.07 & 380.97 & 23.52 & 3.10 & 9.39\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \centering \caption{The posterior probability of the three edge states for baycn and partition MCMC from the first 7 simulated data sets of GN4 (Figure \ref{fig:gn4}) with $N = 100$ and $\beta = 0.2$. The edges in red are the false edges, edge numbers with -v are the edges that make a v structure, and the edge numbers in bold are the edges where baycn inferred a true edge as present but partition MCMC did not.} \begin{tabu}{@{} l l l l l l l l @{}} \toprule & & \multicolumn{6}{c}{GN4: Fully connected graph} \\ \cmidrule(lr){3-8} & & \multicolumn{3}{c}{baycn} & \multicolumn{3}{c}{partition} \\ \cmidrule(lr){3-5} \cmidrule(lr){6-8} data set & Edge & 0 & 1 & 2 & 0 & 1 & 2 \\ \midrule 1 & 1 & 0.08 & 0.045 & 0.875 & 0.032 & 0.04 & 0.928\\ & 2-v & 0.12 & 0.085 & 0.795 & 0.045 & 0.047 & 0.908\\ & \color{garnet} 3 & \color{garnet} 0.025 & \color{garnet} 0.055 & \color{garnet} 0.92 & \color{garnet} 0.03 & \color{garnet} 0.026 & \color{garnet} 0.944\\ & \color{garnet} 4 & \color{garnet} 0.08 & \color{garnet} 0.045 & \color{garnet} 0.875 & \color{garnet} 0.044 & \color{garnet} 0.029 & \color{garnet} 0.928\\ & 5 & 0.265 & 0.21 & 0.525 & 0.173 & 0.117 & 0.709\\ & 6-v & 0.48 & 0.515 & 0.005 & 0.536 & 0.463 & 0.001\\ \addlinespace 2 & 1 & 0.435 & 0.405 & 0.16 & 0.405 & 0.358 & 0.237\\ & 2-v & 0.045 & 0.075 & 0.88 & 0.025 & 0.027 & 0.948\\ & \color{garnet} 3 & \color{garnet} 0.035 & \color{garnet} 0.1 & \color{garnet} 0.865 & \color{garnet} 0.025 & \color{garnet} 0.04 & \color{garnet} 0.935\\ & \color{garnet} 4 & \color{garnet} 0.245 & \color{garnet} 0.32 & \color{garnet} 0.435 & \color{garnet} 0.209 & \color{garnet} 0.289 & \color{garnet} 0.501\\ & \large \textbf{5} & 0.2 & 0.36 & 0.44 & 0.145 & 0.244 & 0.611\\ & 6-v & 0.505 & 0.44 & 0.055 & 0.516 & 0.434 & 0.05\\ \addlinespace 3 & 1 & 0.515 & 0.385 & 0.1 & 0.473 & 0.349 & 0.178\\ & \large \textbf{2-v} & 0.285 & 0.285 & 0.43 & 0.177 & 0.226 & 0.597\\ & \color{garnet} 3 & \color{garnet} 0.19 & \color{garnet} 0.34 & \color{garnet} 0.47 & \color{garnet} 0.161 & \color{garnet} 0.213 & \color{garnet} 0.626\\ & \color{garnet} 4 & \color{garnet} 0.085 & \color{garnet} 0.045 & \color{garnet} 0.87 & \color{garnet} 0.039 & \color{garnet} 0.037 & \color{garnet} 0.924\\ & 5 & 0.25 & 0.435 & 0.315 & 0.204 & 0.363 & 0.433\\ & 6-v & 0.15 & 0.25 & 0.6 & 0.126 & 0.133 & 0.741\\ \addlinespace 4 & 1 & 0.14 & 0.105 & 0.755 & 0.101 & 0.097 & 0.802\\ & 2-v & 0.185 & 0.19 & 0.625 & 0.126 & 0.132 & 0.742\\ & \color{garnet} 3 & \color{garnet} 0.055 & \color{garnet} 0.095 & \color{garnet} 0.85 & \color{garnet} 0.051 & \color{garnet} 0.081 & \color{garnet} 0.868\\ & \color{garnet} 4 & \color{garnet} 0.085 & \color{garnet} 0.06 & \color{garnet} 0.855 & \color{garnet} 0.056 & \color{garnet} 0.047 & \color{garnet} 0.897\\ & \textbf{5} & 0.455 & 0.54 & 0.005 & 0.511 & 0.488 & 0.001\\ & 6-v & 0.185 & 0.18 & 0.635 & 0.105 & 0.121 & 0.774\\ \addlinespace 5 & 1 & 0.16 & 0.175 & 0.665 & 0.142 & 0.152 & 0.706\\ & 2-v & 0.175 & 0.115 & 0.71 & 0.076 & 0.06 & 0.864\\ & \color{garnet} 3 & \color{garnet} 0.09 & \color{garnet} 0.09 & \color{garnet} 0.82 & \color{garnet} 0.047 & \color{garnet} 0.031 & \color{garnet} 0.921\\ & \color{garnet} 4 & \color{garnet} 0.06 & \color{garnet} 0.095 & \color{garnet} 0.845 & \color{garnet} 0.025 & \color{garnet} 0.026 & \color{garnet} 0.949\\ & 5 & 0.075 & 0.06 & 0.865 & 0.036 & 0.052 & 0.911\\ & 6-v & 0.485 & 0.46 & 0.055 & 0.499 & 0.464 & 0.037\\ \addlinespace 6 & 1 & 0.165 & 0.25 & 0.585 & 0.153 & 0.132 & 0.714\\ & 2-v & 0.52 & 0.475 & 0.005 & 0.469 & 0.491 & 0.04\\ & \color{garnet} 3 & \color{garnet} 0.045 & \color{garnet} 0.08 & \color{garnet} 0.875 & \color{garnet} 0.032 & \color{garnet} 0.04 & \color{garnet} 0.928\\ & \color{garnet} 4 & \color{garnet} 0.03 & \color{garnet} 0.025 & \color{garnet} 0.945 & \color{garnet} 0.03 & \color{garnet} 0.029 & \color{garnet} 0.941\\ & 5 & 0.1 & 0.125 & 0.775 & 0.066 & 0.057 & 0.877\\ & 6-v & 0.06 & 0.035 & 0.905 & 0.036 & 0.022 & 0.941\\ \addlinespace 7 & 1 & 0.48 & 0.43 & 0.09 & 0.416 & 0.383 & 0.201\\ & 2-v & 0.065 & 0.085 & 0.85 & 0.05 & 0.045 & 0.905\\ & \color{garnet} 3 & \color{garnet} 0.05 & \color{garnet} 0.05 & \color{garnet} 0.9 & \color{garnet} 0.039 & \color{garnet} 0.06 & \color{garnet} 0.901\\ & \color{garnet} 4 & \color{garnet} 0.11 & \color{garnet} 0.04 & \color{garnet} 0.85 & \color{garnet} 0.059 & \color{garnet} 0.024 & \color{garnet} 0.918\\ & 5 & 0.145 & 0.18 & 0.675 & 0.097 & 0.117 & 0.786\\ & 6-v & 0.16 & 0.2 & 0.64 & 0.13 & 0.116 & 0.754\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \centering \caption{The posterior probability of the three edge states for baycn and partition MCMC from the first 7 simulated data sets of GN4 (Figure \ref{fig:gn4}) with $N = 200$ and $\beta = 0.2$. The edges in red are the false edges, edge numbers with -v are the edges that make a v structure, and the edge numbers in bold are the edges where baycn inferred a true edge as present but partition MCMC did not.} \begin{tabu}{@{} l l l l l l l l @{}} \toprule & & \multicolumn{6}{c}{GN4: Fully connected graph} \\ \cmidrule(lr){3-8} & & \multicolumn{3}{c}{baycn} & \multicolumn{3}{c}{partition} \\ \cmidrule(lr){3-5} \cmidrule(lr){6-8} data set & Edge & 0 & 1 & 2 & 0 & 1 & 2 \\ \midrule 1 & 1 & 0.415 & 0.38 & 0.205 & 0.389 & 0.257 & 0.354\\ & 2-v & 0.425 & 0.515 & 0.06 & 0.419 & 0.459 & 0.122\\ & \color{garnet} 3 & \color{garnet} 0.095 & \color{garnet} 0.045 & \color{garnet} 0.86 & \color{garnet} 0.037 & \color{garnet} 0.032 & \color{garnet} 0.93\\ & \color{garnet} 4 & \color{garnet} 0.075 & \color{garnet} 0.09 & \color{garnet} 0.835 & \color{garnet} 0.037 & \color{garnet} 0.054 & \color{garnet} 0.909\\ & 5 & 0.14 & 0.115 & 0.745 & 0.056 & 0.091 & 0.853\\ & 6-v & 0.605 & 0.395 & 0 & 0.599 & 0.392 & 0.01\\ \addlinespace 2 & 1 & 0.33 & 0.67 & 0 & 0.272 & 0.728 & 0\\ & 2-v & 0.335 & 0.645 & 0.02 & 0.231 & 0.692 & 0.077\\ & \color{garnet} 3 & \color{garnet} 0.03 & \color{garnet} 0.075 & \color{garnet} 0.895 & \color{garnet} 0.015 & \color{garnet} 0.031 & \color{garnet} 0.954\\ & \color{garnet} 4 & \color{garnet} 0.23 & \color{garnet} 0.16 & \color{garnet} 0.61 & \color{garnet} 0.121 & \color{garnet} 0.079 & \color{garnet} 0.8\\ & \large \textbf{5} & 0.37 & 0.34 & 0.29 & 0.204 & 0.172 & 0.623\\ & 6-v & 0.525 & 0.475 & 0 & 0.475 & 0.509 & 0.016\\ \addlinespace 3 & 1 & 0.37 & 0.385 & 0.245 & 0.298 & 0.294 & 0.408\\ & \large \textbf{2-v} & 0.32 & 0.285 & 0.395 & 0.218 & 0.19 & 0.592\\ & \color{garnet} 3 & \color{garnet} 0.025 & \color{garnet} 0.07 & \color{garnet} 0.905 & \color{garnet} 0.02 & \color{garnet} 0.016 & \color{garnet} 0.964\\ & \color{garnet} 4 & \color{garnet} 0.13 & \color{garnet} 0.085 & \color{garnet} 0.785 & \color{garnet} 0.072 & \color{garnet} 0.065 & \color{garnet} 0.863\\ & 5 & 0.335 & 0.535 & 0.13 & 0.349 & 0.43 & 0.221\\ & 6-v & 0.32 & 0.44 & 0.24 & 0.253 & 0.286 & 0.461\\ \addlinespace 4 & 1 & 0.11 & 0.13 & 0.76 & 0.07 & 0.051 & 0.879\\ & \large \textbf{2-v} & 0.415 & 0.29 & 0.295 & 0.3 & 0.181 & 0.519\\ & \color{garnet} 3 & \color{garnet} 0.135 & \color{garnet} 0.07 & \color{garnet} 0.795 & \color{garnet} 0.052 & \color{garnet} 0.046 & \color{garnet} 0.901\\ & \color{garnet} 4 & \color{garnet} 0.115 & \color{garnet} 0.19 & \color{garnet} 0.695 & \color{garnet} 0.076 & \color{garnet} 0.125 & \color{garnet} 0.799\\ & 5 & 0.235 & 0.25 & 0.515 & 0.141 & 0.188 & 0.671\\ & 6-v & 0.385 & 0.525 & 0.09 & 0.378 & 0.461 & 0.161\\ \addlinespace 5 & 1 & 0.51 & 0.48 & 0.01 & 0.498 & 0.47 & 0.032\\ & 2-v & 0.41 & 0.4 & 0.19 & 0.383 & 0.312 & 0.305\\ & \color{garnet} 3 & \color{garnet} 0.035 & \color{garnet} 0.045 & \color{garnet} 0.92 & \color{garnet} 0.019 & \color{garnet} 0.021 & \color{garnet} 0.96\\ & \color{garnet} 4 & \color{garnet} 0.045 & \color{garnet} 0.035 & \color{garnet} 0.92 & \color{garnet} 0.016 & \color{garnet} 0.021 & \color{garnet} 0.963\\ & 5 & 0.505 & 0.485 & 0.01 & 0.484 & 0.494 & 0.022\\ & 6-v & 0.335 & 0.385 & 0.28 & 0.231 & 0.304 & 0.465\\ \addlinespace 6 & 1 & 0.225 & 0.17 & 0.605 & 0.146 & 0.103 & 0.751\\ & 2-v & 0.56 & 0.44 & 0 & 0.591 & 0.403 & 0.006\\ & \color{garnet} 3 & \color{garnet} 0.4 & \color{garnet} 0.48 & \color{garnet} 0.12 & \color{garnet} 0.47 & \color{garnet} 0.367 & \color{garnet} 0.163\\ & \color{garnet} 4 & \color{garnet} 0.03 & \color{garnet} 0.05 & \color{garnet} 0.92 & \color{garnet} 0.021 & \color{garnet} 0.02 & \color{garnet} 0.959\\ & 5 & 0.34 & 0.605 & 0.055 & 0.31 & 0.562 & 0.127\\ & \large \textbf{6-v} & 0.285 & 0.295 & 0.42 & 0.17 & 0.19 & 0.641\\ \addlinespace 7 & \large \textbf{1} & 0.335 & 0.36 & 0.305 & 0.248 & 0.233 & 0.519\\ & \large \textbf{2-v} & 0.27 & 0.235 & 0.495 & 0.166 & 0.157 & 0.677\\ & \color{garnet} 3 & \color{garnet} 0.075 & \color{garnet} 0.035 & \color{garnet} 0.89 & \color{garnet} 0.02 & \color{garnet} 0.019 & \color{garnet} 0.961\\ & \color{garnet} 4 & \color{garnet} 0.105 & \color{garnet} 0.12 & \color{garnet} 0.775 & \color{garnet} 0.059 & \color{garnet} 0.082 & \color{garnet} 0.859\\ & 5 & 0.325 & 0.46 & 0.215 & 0.234 & 0.406 & 0.359\\ & 6-v & 0.425 & 0.575 & 0 & 0.439 & 0.546 & 0.015\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \centering \caption{The posterior probability of the three edge states for baycn and partition MCMC from the first 7 simulated data sets of GN4 (Figure \ref{fig:gn4}) with $N = 600$ and $\beta = 0.2$. The edges in red are the false edges, edge numbers with -v are the edges that make a v structure, and the edge numbers in bold are the edges where baycn inferred a true edge as present but partition MCMC did not.} \begin{tabu}{@{} l l l l l l l l @{}} \toprule & & \multicolumn{6}{c}{GN4: Fully connected graph} \\ \cmidrule(lr){3-8} & & \multicolumn{3}{c}{baycn} & \multicolumn{3}{c}{partition} \\ \cmidrule(lr){3-5} \cmidrule(lr){6-8} data set & Edge & 0 & 1 & 2 & 0 & 1 & 2 \\ \midrule 1 & 1 & 0.61 & 0.39 & 0 & 0.511 & 0.489 & 0\\ & \large \textbf{2-v} & 0.345 & 0.325 & 0.33 & 0.224 & 0.148 & 0.627\\ & \color{garnet} 3 & \color{garnet} 0.065 & \color{garnet} 0.03 & \color{garnet} 0.905 & \color{garnet} 0.02 & \color{garnet} 0.012 & \color{garnet} 0.968\\ & \color{garnet} 4 & \color{garnet} 0.065 & \color{garnet} 0.045 & \color{garnet} 0.89 & \color{garnet} 0.016 & \color{garnet} 0.016 & \color{garnet} 0.968\\ & 5 & 0.405 & 0.595 & 0 & 0.491 & 0.509 & 0\\ & \large \textbf{6-v} & 0.29 & 0.26 & 0.45 & 0.091 & 0.142 & 0.767\\ \addlinespace 2 & 1 & 0.61 & 0.39 & 0 & 0.632 & 0.368 & 0\\ & 2-v & 0.585 & 0.415 & 0 & 0.641 & 0.359 & 0\\ & \color{garnet} 3 & \color{garnet} 0.025 & \color{garnet} 0.055 & \color{garnet} 0.92 & \color{garnet} 0.009 & \color{garnet} 0.014 & \color{garnet} 0.978\\ & \color{garnet} 4 & \color{garnet} 0.05 & \color{garnet} 0.05 & \color{garnet} 0.9 & \color{garnet} 0.017 & \color{garnet} 0.014 & \color{garnet} 0.969\\ & 5 & 0.36 & 0.64 & 0 & 0.424 & 0.576 & 0\\ & 6-v & 0.445 & 0.555 & 0 & 0.401 & 0.589 & 0.01\\ \addlinespace 3 & 1 & 0.63 & 0.37 & 0 & 0.615 & 0.385 & 0\\ & 2-v & 0.465 & 0.465 & 0.07 & 0.379 & 0.384 & 0.237\\ & \color{garnet} 3 & \color{garnet} 0.13 & \color{garnet} 0.095 & \color{garnet} 0.775 & \color{garnet} 0.037 & \color{garnet} 0.034 & \color{garnet} 0.929\\ & \color{garnet} 4 & \color{garnet} 0.095 & \color{garnet} 0.15 & \color{garnet} 0.755 & \color{garnet} 0.019 & \color{garnet} 0.03 & \color{garnet} 0.951\\ & 5 & 0.44 & 0.56 & 0 & 0.426 & 0.574 & 0\\ & 6-v & 0.645 & 0.355 & 0 & 0.54 & 0.46 & 0\\ \addlinespace 4 & 1 & 0.57 & 0.43 & 0 & 0.469 & 0.53 & 0.001\\ & 2-v & 0.555 & 0.39 & 0.055 & 0.368 & 0.431 & 0.201\\ & \color{garnet} 3 & \color{garnet} 0.065 & \color{garnet} 0.065 & \color{garnet} 0.87 & \color{garnet} 0.007 & \color{garnet} 0.01 & \color{garnet} 0.983\\ & \color{garnet} 4 & \color{garnet} 0.085 & \color{garnet} 0.055 & \color{garnet} 0.86 & \color{garnet} 0.007 & \color{garnet} 0.01 & \color{garnet} 0.983\\ & 5 & 0.63 & 0.37 & 0 & 0.505 & 0.495 & 0\\ & 6-v & 0.45 & 0.55 & 0 & 0.495 & 0.505 & 0\\ \addlinespace 5 & 1 & 0.545 & 0.455 & 0 & 0.586 & 0.414 & 0\\ & 2-v & 0.515 & 0.485 & 0 & 0.602 & 0.392 & 0.006\\ & \color{garnet} 3 & \color{garnet} 0.025 & \color{garnet} 0.045 & \color{garnet} 0.93 & \color{garnet} 0.007 & \color{garnet} 0.006 & \color{garnet} 0.986\\ & \color{garnet} 4 & \color{garnet} 0.065 & \color{garnet} 0.04 & \color{garnet} 0.895 & \color{garnet} 0.012 & \color{garnet} 0.01 & \color{garnet} 0.978\\ & 5 & 0.525 & 0.475 & 0 & 0.439 & 0.559 & 0.002\\ & 6-v & 0.355 & 0.645 & 0 & 0.425 & 0.575 & 0\\ \addlinespace 6 & 1 & 0.765 & 0.23 & 0.005 & 0.758 & 0.233 & 0.009\\ & 2-v & 0.645 & 0.355 & 0 & 0.682 & 0.314 & 0.004\\ & \color{garnet} 3 & \color{garnet} 0.15 & \color{garnet} 0.07 & \color{garnet} 0.78 & \color{garnet} 0.02 & \color{garnet} 0.015 & \color{garnet} 0.965\\ & \color{garnet} 4 & \color{garnet} 0.06 & \color{garnet} 0.05 & \color{garnet} 0.89 & \color{garnet} 0.007 & \color{garnet} 0.006 & \color{garnet} 0.986\\ & 5 & 0.33 & 0.67 & 0 & 0.232 & 0.768 & 0\\ & 6-v & 0.375 & 0.625 & 0 & 0.283 & 0.711 & 0.006\\ \addlinespace 7 & 1 & 0.425 & 0.575 & 0 & 0.46 & 0.54 & 0\\ & 2-v & 0.4 & 0.6 & 0 & 0.5 & 0.5 & 0\\ & \color{garnet} 3 & \color{garnet} 0.055 & \color{garnet} 0.06 & \color{garnet} 0.885 & \color{garnet} 0.006 & \color{garnet} 0.012 & \color{garnet} 0.981\\ & \color{garnet} 4 & \color{garnet} 0.06 & \color{garnet} 0.06 & \color{garnet} 0.88 & \color{garnet} 0.012 & \color{garnet} 0.017 & \color{garnet} 0.97\\ & 5 & 0.5 & 0.5 & 0 & 0.569 & 0.431 & 0\\ & 6-v & 0.45 & 0.55 & 0 & 0.534 & 0.46 & 0.006\\ \bottomrule \end{tabu} \end{table} \begin{table} \centering \caption{\label{tab:q8} Posterior probabilities from one run of baycn on the eQTL-gene set Q8 from GEUVADIS and GTEx. A fully connected graph was used as the input to baycn.} \begin{tabu}{@{} l l l l l l l @{}} \toprule & \multicolumn{6}{c}{Posterior Probability: Q8} \\ \cmidrule(lr){2-7} & \multicolumn{3}{c}{GEUVADIS} & \multicolumn{3}{c}{GTEX} \\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} edge & zero & one & two & zero & one & two\\ \midrule rs11305802-TMEM55B & 0.210 & 0.000 & 0.79 & 0.250 & 0.00 & 0.750\\ rs11305802-RP11-203M5.8 & 0.410 & 0.000 & 0.59 & 0.360 & 0.00 & 0.640\\ rs11305802-PNP & 1.000 & 0.000 & 0.00 & 0.990 & 0.00 & 0.010\\ TMEM55B-RP11-203M5.8 & 0.525 & 0.465 & 0.01 & 0.330 & 0.58 & 0.090\\ TMEM55B-PNP & 0.155 & 0.845 & 0.00 & 0.145 & 0.41 & 0.445\\ RP11-203M5.8-PNP & 0.185 & 0.815 & 0.00 & 0.180 & 0.71 & 0.110\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \centering \caption{\label{tab:q20} Posterior probabilities from one run of baycn on the eQTL-gene set Q20 from GEUVADIS and GTEx. A fully connected graph was used as the input to baycn.} \begin{tabu}{@{} l l l l l l l @{}} \toprule & \multicolumn{6}{c}{Posterior Probability: Q20} \\ \cmidrule(lr){2-7} & \multicolumn{3}{c}{GEUVADIS} & \multicolumn{3}{c}{GTEX} \\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} edge & zero & one & two & zero & one & two\\ \midrule rs142060986-RP11292F9.1 & 0 & 0 & 1 & 0.00 & 0.00 & 1.00\\ rs142060986-FAM27E1 & 1 & 0 & 0 & 0.95 & 0.00 & 0.05\\ RP11292F9.1-FAM27E1 & 0 & 1 & 0 & 0.17 & 0.47 & 0.36\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \caption{\label{tab:q21} Posterior probabilities from one run of baycn for eQTL-gene set Q21 from GEUVADIS and GTEx. A fully connected graph was used as input to baycn.} \centering \begin{tabu}{@{} l l l l l l l @{}} \toprule & \multicolumn{6}{c}{Posterior Probability: Q21} \\ \cmidrule(lr){2-7} & \multicolumn{3}{c}{GEUVADIS} & \multicolumn{3}{c}{GTEX} \\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} edge & zero & one & two & zero & one & two\\ \midrule rs147156488-FAM27C & 0.450 & 0.000 & 0.550 & 0.000 & 0.000 & 1.000\\ rs147156488-FAM27A & 0.000 & 0.000 & 1.000 & 0.000 & 0.000 & 1.000\\ rs147156488-FAM27D1 & 0.550 & 0.000 & 0.450 & 1.000 & 0.000 & 0.000\\ FAM27C-FAM27A & 0.525 & 0.010 & 0.465 & 0.055 & 0.040 & 0.905\\ FAM27C-FAM27D1 & 0.450 & 0.550 & 0.000 & 0.055 & 0.035 & 0.910\\ FAM27A-FAM27D1 & 0.015 & 0.495 & 0.490 & 0.100 & 0.370 & 0.530\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \caption{\label{tab:q23} Posterior probabilities from one run of baycn on the eQTL-gene set Q23 from GEUVADIS and GTEx. A fully connected graph was used as the input to baycn.} \centering \begin{tabu}{@{} l l l l l l l @{}} \toprule & \multicolumn{6}{c}{Posterior Probability: Q23} \\ \cmidrule(lr){2-7} & \multicolumn{3}{c}{GEUVADIS} & \multicolumn{3}{c}{GTEX} \\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} edge & zero & one & two & zero & one & two\\ \midrule rs150605045-AGAP9 & 1.0 & 0.0 & 0 & 0.015 & 0.00 & 0.985\\ rs150605045-AGAP10 & 1.0 & 0.0 & 0 & 0.000 & 0.00 & 1.000\\ AGAP9-AGAP10 & 0.4 & 0.6 & 0 & 0.180 & 0.16 & 0.660\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \caption{\label{tab:q37} Posterior probabilities from one run of baycn on the eQTL-gene set Q37 from GEUVADIS and GTEx. A fully connected graph was used as input to baycn.} \centering \begin{tabu}{@{} l l l l l l l @{}} \toprule & \multicolumn{6}{c}{Posterior Probability: Q37} \\ \cmidrule(lr){2-7} & \multicolumn{3}{c}{GEUVADIS} & \multicolumn{3}{c}{GTEX} \\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} edge & zero & one & two & zero & one & two\\ \midrule rs3858954-GOLGA6L19 & 0.660 & 0.000 & 0.34 & 0.020 & 0.00 & 0.980\\ rs3858954-GOLGA6L9 & 0.310 & 0.000 & 0.69 & 0.095 & 0.00 & 0.905\\ rs3858954-GOLGA6L20 & 0.960 & 0.000 & 0.04 & 0.205 & 0.00 & 0.795\\ GOLGA6L19-GOLGA6L9 & 0.030 & 0.040 & 0.93 & 0.045 & 0.07 & 0.885\\ GOLGA6L19-GOLGA6L20 & 0.345 & 0.655 & 0.00 & 0.055 & 0.05 & 0.895\\ GOLGA6L9-GOLGA6L20 & 0.145 & 0.855 & 0.00 & 0.065 & 0.07 & 0.865\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \caption{\label{tab:q50} Posterior probabilities from one run of baycn on the eQTL-gene set Q50 from both GEUVADIS and GTEx. A fully connected graph was used as input to baycn.} \centering \begin{tabu}{@{} l l l l l l l @{}} \toprule & \multicolumn{6}{c}{Posterior Probability: Q50} \\ \cmidrule(lr){2-7} & \multicolumn{3}{c}{GEUVADIS} & \multicolumn{3}{c}{GTEX} \\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} edge & zero & one & two & zero & one & two\\ \midrule rs7124238-SBF2-AS1 & 0.22 & 0.00 & 0.78 & 0.18 & 0.00 & 0.82\\ rs7124238-SWAP70 & 1.00 & 0.00 & 0.00 & 1.00 & 0.00 & 0.00\\ SBF2-AS1-SWAP70 & 0.12 & 0.88 & 0.00 & 0.17 & 0.83 & 0.00\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \caption{\label{tab:q62} Posterior probabilities from one run of baycn on the eQTL-gene set Q62 from both GEUVADIS and GTEx. A fully connected graph was used as input to baycn.} \centering \begin{tabu}{@{} l l l l l l l @{}} \toprule & \multicolumn{6}{c}{Posterior Probability: Q62} \\ \cmidrule(lr){2-7} & \multicolumn{3}{c}{GEUVADIS} & \multicolumn{3}{c}{GTEX} \\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} edge & zero & one & two & zero & one & two\\ \midrule rs9426902-S100A6 & 0.845 & 0.00 & 0.155 & 0.095 & 0.00 & 0.905\\ rs9426902-S100A4 & 0.420 & 0.00 & 0.580 & 0.090 & 0.00 & 0.910\\ S100A6-S100A4 & 0.720 & 0.28 & 0.000 & 0.530 & 0.47 & 0.000\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \caption{\label{tab:q8_pcs} Posterior probabilities from baycn on the eQTL-gene set Q8 from GEUVADIS with five PCs included in the network as confounding variables. A fully connected graph (excluding the edges between PC nodes) was used as the input to baycn. The rows highlighted in yellow indicate the edges between the nodes of interest.} \centering \begin{tabu}{@{} l l l l @{}} \toprule & \multicolumn{3}{c}{Q8 - 5 PCs} \\ \cmidrule(lr){2-4} & \multicolumn{3}{c}{GEUVADIS} \\ \cmidrule(lr){2-4} edge & zero & one & two \\ \midrule \rowcolor{yellow!50} rs11305802-TMEM55B & 0.170 & 0.000 & 0.830\\ \rowcolor{yellow!50} rs11305802-RP11-203M5.8 & 0.805 & 0.000 & 0.195\\ \rowcolor{yellow!50} rs11305802-PNP & 1.000 & 0.000 & 0.000\\ rs11305802-PC1 & 0.240 & 0.000 & 0.760\\ rs11305802-PC2 & 0.195 & 0.000 & 0.805\\ \addlinespace rs11305802-PC6 & 0.255 & 0.000 & 0.745\\ rs11305802-PC7 & 0.125 & 0.000 & 0.875\\ rs11305802-PC9 & 0.370 & 0.000 & 0.630\\ \rowcolor{yellow!50} TMEM55B-RP11-203M5.8 & 0.150 & 0.820 & 0.030\\ \rowcolor{yellow!50} TMEM55B-PNP & 0.330 & 0.670 & 0.000\\ \addlinespace TMEM55B-PC1 & 0.385 & 0.615 & 0.000\\ TMEM55B-PC2 & 0.085 & 0.550 & 0.365\\ TMEM55B-PC6 & 0.015 & 0.055 & 0.930\\ TMEM55B-PC7 & 0.050 & 0.030 & 0.920\\ TMEM55B-PC9 & 0.260 & 0.730 & 0.010\\ \addlinespace \rowcolor{yellow!50} RP11-203M5.8-PNP & 0.760 & 0.240 & 0.000\\ RP11-203M5.8-PC1 & 0.075 & 0.145 & 0.780\\ RP11-203M5.8-PC2 & 0.085 & 0.240 & 0.675\\ RP11-203M5.8-PC6 & 0.315 & 0.685 & 0.000\\ RP11-203M5.8-PC7 & 0.175 & 0.115 & 0.710\\ \addlinespace RP11-203M5.8-PC9 & 0.035 & 0.060 & 0.905\\ PNP-PC1 & 0.190 & 0.715 & 0.095\\ PNP-PC2 & 0.135 & 0.845 & 0.020\\ PNP-PC6 & 0.040 & 0.065 & 0.895\\ PNP-PC7 & 0.565 & 0.180 & 0.255\\ \addlinespace PNP-PC9 & 0.165 & 0.695 & 0.140\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \caption{\label{tab:q21_pc} Posterior probabilities from baycn for eQTL-gene set Q21 from GEUVADIS when two PCs are included in the network as confounding variables. A fully connected graph was used as the input to baycn. The rows highlighted in yellow indicate the edges between the nodes of interest.} \centering \begin{tabu}{@{} l l l l @{}} \toprule & \multicolumn{3}{c}{Q21 - 2 PCs} \\ \cmidrule(lr){2-4} & \multicolumn{3}{c}{GEUVADIS} \\ \cmidrule(lr){2-4} edge & zero & one & two \\ \midrule \rowcolor{yellow!50} rs147156488-FAM27C & 0.000 & 0.000 & 1.000\\ \rowcolor{yellow!50} rs147156488-FAM27A & 0.000 & 0.000 & 1.000\\ \rowcolor{yellow!50} rs147156488-FAM27D1 & 1.000 & 0.000 & 0.000\\ rs147156488-PC1 & 1.000 & 0.000 & 0.000\\ rs147156488-PC3 & 1.000 & 0.000 & 0.000\\ \addlinespace \rowcolor{yellow!50} FAM27C-FAM27A & 0.510 & 0.030 & 0.460\\ \rowcolor{yellow!50} FAM27C-FAM27D1 & 0.000 & 1.000 & 0.000\\ FAM27C-PC1 & 0.250 & 0.030 & 0.720\\ FAM27C-PC3 & 0.180 & 0.140 & 0.680\\ \rowcolor{yellow!50} FAM27A-FAM27D1 & 0.000 & 0.510 & 0.490\\ \addlinespace FAM27A-PC1 & 0.145 & 0.050 & 0.805\\ FAM27A-PC3 & 0.555 & 0.115 & 0.330\\ FAM27D1-PC1 & 0.245 & 0.220 & 0.535\\ FAM27D1-PC3 & 0.160 & 0.125 & 0.715\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \caption{\label{tab:q23_pcs} Posterior probabilities from baycn on the eQTL-gene set Q23 from GEUVADIS with two PCs included in the network as confounding variables. A fully connected graph was used as input to baycn. The rows highlighted in yellow indicate the edges between the nodes of interest.} \centering \begin{tabu}{@{} l l l l @{}} \toprule & \multicolumn{3}{c}{Q23 - 2 PCs} \\ \cmidrule(lr){2-4} & \multicolumn{3}{c}{GEUVADIS} \\ \cmidrule(lr){2-4} edge & zero & one & two \\ \midrule \rowcolor{yellow!50} rs150605045-AGAP9 & 1.000 & 0.000 & 0.000\\ \rowcolor{yellow!50} rs150605045-AGAP10 & 1.000 & 0.000 & 0.000\\ rs150605045-PC1 & 1.000 & 0.000 & 0.000\\ rs150605045-PC8 & 1.000 & 0.000 & 0.000\\ \rowcolor{yellow!50} AGAP9-AGAP10 & 0.720 & 0.280 & 0.000\\ \addlinespace AGAP9-PC1 & 0.595 & 0.385 & 0.020\\ AGAP9-PC8 & 0.495 & 0.455 & 0.050\\ AGAP10-PC1 & 0.065 & 0.065 & 0.870\\ AGAP10-PC8 & 0.035 & 0.080 & 0.885\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \caption{\label{tab:q37_pcs} Posterior probabilities from baycn on the eQTL-gene set Q37 from GEUVADIS with one PC included in the network as a confounding variable. A fully connected graph was used as input to baycn. The rows highlighted in yellow indicate the edges between the nodes of interest.} \centering \begin{tabu}{@{} l l l l @{}} \toprule & \multicolumn{3}{c}{Q37 - 1 PC} \\ \cmidrule(lr){2-4} & \multicolumn{3}{c}{GEUVADIS} \\ \cmidrule(lr){2-4} edge & zero & one & two \\ \midrule \rowcolor{yellow!50} rs3858954-GOLGA6L19 & 0.660 & 0.000 & 0.340\\ \rowcolor{yellow!50} rs3858954-GOLGA6L9 & 0.335 & 0.000 & 0.665\\ \rowcolor{yellow!50} rs3858954-GOLGA6L20 & 0.965 & 0.000 & 0.035\\ rs3858954-PC1 & 0.100 & 0.000 & 0.900\\ \rowcolor{yellow!50} GOLGA6L19-GOLGA6L9 & 0.035 & 0.055 & 0.910\\ \addlinespace \rowcolor{yellow!50} GOLGA6L19-GOLGA6L20 & 0.335 & 0.665 & 0.000\\ GOLGA6L19-PC1 & 0.665 & 0.210 & 0.125\\ \rowcolor{yellow!50} GOLGA6L9-GOLGA6L20 & 0.175 & 0.825 & 0.000\\ GOLGA6L9-PC1 & 0.110 & 0.030 & 0.860\\ GOLGA6L20-PC1 & 0.135 & 0.050 & 0.815\\ \bottomrule \end{tabu} \end{table} \begin{table}[H] \caption{\label{tab:q50_pcs} Posterior probabilities from baycn on the eQTL-gene set Q50 from GEUVADIS with two PCs included in the network as confounding variables. A fully connected graph was used as input to baycn. The rows highlighted in yellow indicate the edges between the nodes of interest.} \centering \begin{tabu}{@{} l l l l @{}} \toprule & \multicolumn{3}{c}{Q50 - 2 PCs} \\ \cmidrule(lr){2-4} & \multicolumn{3}{c}{GEUVADIS} \\ \cmidrule(lr){2-4} edge & zero & one & two \\ \midrule \rowcolor{yellow!50} rs7124238-SBF2-AS1 & 0.195 & 0.000 & 0.805\\ \rowcolor{yellow!50} rs7124238-SWAP70 & 1.000 & 0.000 & 0.000\\ rs7124238-PC1 & 0.135 & 0.000 & 0.865\\ rs7124238-PC5 & 0.465 & 0.000 & 0.535\\ \rowcolor{yellow!50} SBF2-AS1-SWAP70 & 0.035 & 0.965 & 0.000\\ \addlinespace SBF2-AS1-PC1 & 0.035 & 0.020 & 0.945\\ SBF2-AS1-PC5 & 0.015 & 0.040 & 0.945\\ SWAP70-PC1 & 0.550 & 0.415 & 0.035\\ SWAP70-PC5 & 0.280 & 0.720 & 0.000\\ \bottomrule \end{tabu} \end{table} \bibliographystyle{JASA}
\section{Introduction} The dynamics of the actin cytoskeleton determines internal cell structure, cell shape, and cell motility. By accumulating at a cell edge, filamentous actin (F-actin) produces outwards protrusion. Actin assembly is regulated by signaling networks. Central in those networks are the small GTPases, Rac, Cdc42, and Rho. Rac promotes assembly of F-actin, whereas Rho activates myosin motors. The interactions of Rac, Rho, Cdc42, and other molecular players has been modeled in previous work \cite{mori2008wave,Champneys,holmes2012regimes,holmes2016,zmurchok2018coupling,walther2012deterministic,edelstein2013simple,jilkine2011comparison,otsuji2007mass} both in 1D and 2D. These studies made different modelling decisions and ranged from simple \cite{mori2008wave} to detailed \cite{maree2008quantitative}. It is challenging to determine parameter sensitivity and map out regimes of behavior of the more detailed models. This motivates studying minimal models that showcase the possible realms of predicted behavior. It was shown previously that the biology of GTPases permits a single member of this family to spontaneously polarize (i.e. form spatial regions of high vs low activity). This idea was the basis of the wave-pinning model \cite{mori2008wave,mori2011asymptotic}, and depends on the large difference in diffusion of the active (slow) and inactive(fast) forms of a GTPase. Several models have been examined mathematically to describe how a single GTPase coupled to other effectors or influences could results in spatio-temporal patterns. These include a GTPase with sources and sinks \cite{Champneys}, with feedback from F-actin \cite{holmes2012regimes,mata2013model}, with mechanical tension \cite{zmurchok2018coupling} and with effects of changing cell size \cite{buttenschon2019cell}. Many of these were explored in reaction-diffusion (RD) equations within a 1D static single cell domain or with spatially uniform distribution in each of many cells \cite{zmurchok2018coupling}. Some of the behaviors found in such models include, traveling waves, pulses, or oscillating fronts \cite{holmes2012regimes,mata2013model}, or localized peaks and ``solitons'' \cite{Champneys}. Here we have two main purposes: (1) to explore what happens when two distinct minimal models are coupled, and whether this leads to new behavior, (2) to study these systems in 2D domains to determine whether they produce spots or stripes, and (3) to simulate the same models on a deforming 2D domain depicting the shape and motility of a cell. Biological motivation for this work comes from several sources. (A) Waves of actin are observed in a number of experimental systems \cite{inagaki2017}. In some of these, such waves are seen to cause cell edge to cyclically protrude outwards (as the waves impinge on the cell edges). We wondered whether a model for Rac interacting with F-actin could mimic this kind of behavior. (B) The GTPase model generalized by the group of Alan Champneys in \cite{Champneys} converts the polarizing cell behaviour into multiple coexisting peaks. We wondered how such peaks would interact with cell boundaries, and, in particular, whether they would be associated with smaller protrusions such as filopodia. (C) In some cells, notably the embryos of C. elegans, localized Rho-associated actin clusters are seen to ``blink'' (oscillate temporally while maintaining a fixed location) \cite{robin2016excitable}. We asked whether the combined F-actin-Rho model with localized sources could account for such behavior. We first briefly review the three classes of minimal models, show results for the combined model, and then demonstrate the novel 2D behaviors that are observed once these models are simulated in the deforming 2D cell. \begin{figure}[H] \centering \includegraphics[scale=0.4]{figures/schematic.png} \caption{Schematic diagram of the models. The original wave-pinning model consists of GTPase (circles) in the active, (membrane-bound) form, $u$ and inactive form $v$, with positive feedback (curved grey arrow) from $u$ to its own activation (upwards white arrow). The F-actin extension model \cite{holmes2012regimes} includes GTPase activation of F-actin assembly and GTPase inactivation by F-actin (dashed arrow). The source-sink (nonconservative) extension by \cite{Champneys} includes removal of active GTPase and synthesis of inactive GTPase so that the total amount is no longer conserved.} \label{fig:model_schematic} \end{figure} \section{The models} Our model is a system of reaction-diffusion partial differential equations (PDEs) based on the wave pinning model first proposed by \cite{mori2008wave}. The model is extended with a source and sink terms following \cite{Champneys}, and feedback from actin, proposed by \cite{holmes2012regimes}. \subsection{Model equations} The dimensionless form of the model combining both extensions can be written as: \begin{subequations} \begin{align} \pd{u}{t} &= \delta \nabla^2 u +f(u,v,F) - c\theta u ,\\ \pd{v}{t} &= \nabla^2 v -f(u,v,F) +c \alpha ,\\ \pd{F}{t} &= \epsilon (k_n u - k_s F) ,\\ f(u,v,F) &=A(u) v - \left( \eta + s \frac{F}{1+F} \right) u , \quad A(u)= k + \gamma \frac{u^n}{1 + u^n}, \\ \pd{u}{\vec{n}} \bigg|_{\partial \Omega} &= 0, \quad \pd{v}{\vec{n}} \bigg|_{\partial \Omega} = 0, \quad x \in \Omega, \quad t \geq 0. \notag \end{align}\label{sys:combined} \end{subequations} Here $u(x,t)$ and $v(x,t)$ represent the active and inactive GTPase, respectively. $F(x,t)$ represents filamentous actin (F-actin). $\delta \ll 1$ is the diffusion coefficient for the active form, which is slow due to attachment to the membrane. The reaction function $f(u,v,F)$ describes the net rate of GTPase activation, with $A(u)$ representing activation rate. Parameters $k, \gamma, \eta, s$ are the basal activation rate, self-feedback activation, basal inactivation and actin-feedback inactivation rates, respectively. Neumann boundary conditions are used to represent the fact that GTPases and F-actin do not leak out of the cell edges. Setting $c=s=0$ reduces the system to the original wave pinning (WP) model \cite{mori2008wave}, which conserves the total $u+v$ inside the domain. The model has been analyzed in detail elsewhere \cite{mori2011asymptotic}, but we briefly mention its key property: under specific parameter settings, the WP model sustains waves that decelerate and stall in the domain, leading to a stable spatially heterogeneous steady state distribution of $u$ (the ``pinned wave''). When $c=1, s=0$, the system corresponds to the non-conservative (NC) model of \cite{Champneys}. When $c=0, s>0$, we have the actin feedback (AF) model of \cite{holmes2012regimes}. While each of the above models has been studied previously, here we will also be concerned with their union, i.e. the so-called ``combined model'' (CM) with $c=1, s>0$. The four models of interest are then (I) WP, (II) NC, (III) AF, and (IV) CM. These four models all have very distinct characteristic behaviors. We will consider these models in several settings (A) a 1D spatial domain, as previously described in the literature, (B) a static 2D spatial domain where we can distinguish between spots and stripes, and finally (C) a deforming domain whose boundary dynamics is coupled to the evolving solution $u$ (or $F$) of the PDE. \subsection{Geometry} In many previous papers, simulations were restricted to 1D \cite{holmes2012regimes,mata2013model}, but a variety of actin wave models exist in more detailed geometries, including 2D \cite{doubrovinski2011} and 3D \cite{bretschneider2009}. Here, for for simplicity in the 2D static domain case we consider a unit square. For the deforming domain, we use the Cellular Potts Model (CPM) to simulate a dynamic 2D cell. The methods and results are introduced in Sec.~\ref{sec:cpm}. For the ease of analysis and identification of distinct patterns, we first discuss and examine results in a 1D spatial version of the models. We can interpret this 1D geometry in one of two classic ways: (1) as a cross-section along the diameter of a cell. This cross-section neglects any variation in the cell thickness and includes both the intracellular volume (cytosol) and the top and bottom membranes at every point. Neumann (no flux) boundary conditions are used for the endpoints of the interval. (2) Alternatively, another common assumption is a 1D cell perimeter. In this case, the region considered is close to the cell membrane, with periodic boundary conditions. Here we adhere to the first approach. The case of 1D dynamic cell size is considered in \cite{andreassinglecell}. \section{Methods of Analysis} We briefly describe methods used to analyse the models. We use local perturbation analysis (LPA) to study the bifurcation behavior of each model, and compare with results from Turing Linear stability analysis. A full description of these methods is found in the MSc thesis by one of us (YL) \cite{liu2019}. \subsection{Local perturbation analysis} Local perturbation analysis is a method for examining the evolution of a localized perturbation to a homogeneous steady state (HSS) for a fast-slow diffusion-reaction system. It provides a way to systematically detect certain forms of nonlinear instabilities that are not detectable by the more traditional Turing analysis. LPA was first developed by AFM Mar\'ee and V Grieneisen (Cardiff University) \cite{grieneisen_LPA}, and has been used in \cite{edelstein2013simple,holmes2016,holmes2012regimes,mata2013model} and elsewhere to analyze wave pinning and related models. The basic idea of LPA is to take the limit where the slow diffusion coefficients goes to $0$ and the fast diffusion coefficients goes to infinity. We then consider an initial condition where the system is at HSS with a localized perturbation in the form of a spike of infinitesimal width but finite height. The behavior of the PDE can then be captured with an ODE system with ``global variables" representing the levels of the PDE variables away from the spike, and ``local variables" for the slow PDE variables at the spike. For example, using subscript $L$ to denote local variables, the LPA system for our combined model \eqref{sys:combined} is: \begin{subequations} \begin{align} \pd{u}{t} &= f(u,v,F) - c\theta u ,\\ \pd{v}{t} &= -f(u,v,F) +c \alpha ,\\ \pd{F}{t} &= \epsilon (k_n u - k_s F),\\ \pd{u_L}{t} &= f(u_L,v,F_L) - c\theta u_L ,\\ \pd{F_L}{t} &= \epsilon (k_n u_L - k_s F_L) . \end{align}\label{sys:combined_LPA} \end{subequations} In the cases where $c=0$ or $s=0$, we will use mass conservation to remove irrelevant equations and eliminate degeneracy. This allow us to easily produce bifurcation diagrams using AUTO \cite{auto} and delineate parameter regimes. Notice that the LPA system \eqref{sys:combined_LPA} contains the well-mixed system (i.e. the system without local variables), so any features (branches and bifurcations) of the well-mixed system will also be present in the LPA system. Hence we can obtain any information that can be gained by analyzing the well-mixed system through LPA. \subsection{Bifurcation analysis} We refer to branches of equilibria and periodic solutions in the LPA system that are also present in the well-mixed model as ``global" branches, as they correspond to solutions in which the local variables are equal to the global variables and the spike disappears, i.e. a homogeneous solution. The others branches are referred to as ``local" branches; they correspond to some kind of pattern. We classify the parameter regimes into three categories: (a) stable, where only global branches are stable. In this regime, no pattern can arise from localized perturbation; (b) polarizable, where stable global and local branches coexist. In this regime, patterns can form only if the perturbation is sufficiently strong. Finally, (c) unstable, where all global branches are unstable. In this regime even infinitesimal perturbations can lead to pattern formation. In Appendix~\ref{apd:turing_vs_lpa}, we show that this is equivalent to the classical Turing regime. The sets of parameters for each model are listed in Table~\ref{tab:parameters}. For the cases where the total amount of GTPase is conserved, we define the total mass of GTPase in the cell, \[w = \int_\Omega (u+v) dx ,\] as an additional constant parameter. This allow us to eliminate $v$ from the equations by writing it in terms of $u$ and $w$. All bifurcation diagrams follow AUTO's conventions. On one-parameter diagrams, red/black curves indicate positions of stable/unstable equilibria respectively, while green/blue indicate the range of stable/unstable limit cycles. On two-parameter diagrams, red/light blue/dark blue curves trace the position of limit points (fold points)/branch points (transcritical points)/Hopf points, respectively. \section{Results} We next apply the methods to compare the behaviors of the four models of interest. \subsection{Wave pinning (WP) model} Based on extensive previous analysis \cite{mori2011asymptotic,mori2008wave,holmes2016} we highlight the results in Fig.~\ref{fig:lpa_wavepin} and Fig.~\ref{fig:lpa_wavepin_2par} merely for comparison with the extended model variants. Distinct regimes are summarized in Table~\ref{tab:lpa_wavepin_regimes}. We identify $\gamma$ (the magnitude of the only nonlinear term) and $w$ (total concentration) as primary parameters of interest. Extending the earlier study \cite{holmes2016}, we also trace a branch of transcritical bifurcation in two-parameter continuation in Fig.~\ref{fig:lpa_wavepin_2par}. This allows us to identify several new regimes. We verify that LPA predictions in each regime are indeed correct with simulations of the full PDEs. \begin{figure} \centering \vspace{-0.3cm} \begin{subfigure}[h]{0.5\textwidth} \centering \caption{WM, $w=2$} \includegraphics[width=\textwidth]{bif/wavepin/wp_wellmix,w=2,k=1.5,gamma=0.01,n=3,eta=15.png} \end{subfigure}% \begin{subfigure}[h]{0.5\textwidth} \centering \caption{LPA, $w=2$} \includegraphics[width=\textwidth]{bif/wavepin/wp_LPA,w=2,k=1.5,gamma=0.1,n=3,eta=15_labelled_new.png} \end{subfigure} \begin{subfigure}[h]{0.5\textwidth} \centering \caption{WM, $w=3.5$} \includegraphics[width=\textwidth]{bif/wavepin/wp_wellmix,w=3.5,k=1.5,gamma=0.01,n=3,eta=15.png} \end{subfigure}% \begin{subfigure}[h]{0.5\textwidth} \centering \caption{LPA, $w=3.5$} \includegraphics[width=\textwidth]{bif/wavepin/wp_LPA,w=3.5,k=1.5,gamma=0.01,n=3,eta=15_lined_thick_labelled.png} \end{subfigure} \begin{subfigure}[h]{0.5\textwidth} \centering \caption{WM, $w=4$} \includegraphics[width=\textwidth]{bif/wavepin/wp_wellmix,w=4,k=1.5,gamma=0.01,n=3,eta=15.png} \end{subfigure}% \begin{subfigure}[h]{0.5\textwidth} \centering \caption{LPA, $w=4$} \includegraphics[width=\textwidth]{bif/wavepin/wp_LPA,w=4,k=1.5,gamma=0.01,n=3,eta=15_labelled.png} \end{subfigure} \vspace{-0.1cm} \caption[One-parameter bifurcation diagrams of the LPA and well-mixed wave pinning system]{Bifurcation diagrams of the well-mixed (WM) and LPA wave pinning system with respect to the rate of activation parameter $\gamma$. Other parameters as in Table~\ref{tab:parameters}(WP) except $w$. The purple lines are located at bifurcation points separating the distinct regimes. Note that the ``global branches'' (curves in the WM diagrams) also appear in LPA, though their stability can be different in LPA over certain intervals. } \label{fig:lpa_wavepin} \end{figure} \begin{figure} \centering \begin{subfigure}[h]{0.5\textwidth} \centering \caption{WM} \includegraphics[width=\textwidth]{bif/wavepin/wp_wellmix,w=2,k=1.5,gamma=0.01,n=3,eta=15_twoparam.png} \end{subfigure}% \begin{subfigure}[h]{0.5\textwidth} \centering \caption{LPA} \includegraphics[width=\textwidth]{bif/wavepin/wp_LPA,w=2,k=1.5,gamma=0.1,n=3,eta=15_twoparam_auto_labelled.png} \end{subfigure} \begin{subfigure}[h]{0.8\textwidth} \centering \caption{LPA} \includegraphics[width=\textwidth]{bif/wavepin/wp_LPA,w=2,k=1.5,gamma=0.1,n=3,eta=15_twoparam_auto_zoomin_labelled.png} \end{subfigure} \caption[Two-parameter bifurcation plots of the LPA and well-mixed wave pinning system]{Two-parameter bifurcation plots of the wave pinning (WP) model with respect to parameters $w, \gamma$. (a) Well-Mixed (WM) and (b,c) LPA system. Other parameters as in Table~\ref{tab:parameters}(WP). Each curve in these diagrams traces the location of a bifurcation point shown in Fig.~\ref{fig:lpa_wavepin}, and forms the boundary of a parameter regime. The one-parameter bifurcation diagrams in Fig.~\ref{fig:lpa_wavepin} correspond to vertical cross-sections of the diagrams here. The LPA regimes I - VII match with the regimes in Fig.~\ref{fig:lpa_wavepin}(b,d,f). See summary in Table~\ref{tab:lpa_wavepin_regimes}. (c) A zoom into the cusps in (b). (Compare (b) to LPA Fig. 3(a) of \cite{holmes2016} for the same model with different parameter values: our figures agree on the (red) fold curves but ours includes an additional transcritical curve (light blue) separating several distinct regimes.)} \label{fig:lpa_wavepin_2par} \end{figure} \begin{table}[h] \centering \begin{tabular}{l||l|l} Regime & Classification & Description \\ \hline \hline I & Stable & \specialcell{One stable GB, no LB} \\ \hline II & Polarizable & \specialcell{One stable GB, one stable LB\\ located above the GB} \\ \hline III & Polarizable & \specialcell{One stable GB, three stable LBs \\located on both sides of the GB} \\ \hline IV & Polarizable & \specialcell{Two stable GBs, three stable LBs: one above both\\ GBs, one in between, and one below both GBs} \\ \hline V & Polarizable & \specialcell{One stable GB, one stable LB\\ located below the GB} \\ \hline VI & Unstable & \specialcell{The only GB is unstable, two stable LBs\\ located on both sides of the GB} \\ \hline VII & Unstable & \specialcell{Three GBs, all unstable, four stable LBs \\ located on both sides of the GB} \\ \hline \end{tabular} \caption[Summary of the wave pinning model regimes]{Summary of the wave pinning (WP) regimes identified in Fig.~\ref{fig:lpa_wavepin} and \ref{fig:lpa_wavepin_2par}. GB: global branch; LB: local branch. Stable: all stable branches are global branches. Polarizable: there exist both stable global and local branches. Unstable: all global branches are unstable, so some local branches have to be stable.} \label{tab:lpa_wavepin_regimes} \end{table} \subsection{Non-conservative (NC) model} In addition the main bifurcation parameter $\gamma$, we also take $c$, the parameter that controls the magnitude of the source/sink terms. This model possess a unique global equilibrium: \[u_* = \frac{\alpha}{\theta}, \quad \ v_* = \frac{c \alpha + \eta u_*}{A(u_*)}=\frac{c \alpha + \eta u_*}{k + \gamma \frac{u_*^n}{1+u_*^n}} \,.\] Any local branches $u_{L*}$ must satisfy $f(u_{L*},v_*)=0$. After expanding and some manipulations, we obtain \begin{equation} \frac{A(u_{L*})}{A(u_*)}=\frac{u_{L*}}{u_*}. \label{eqn:champ_lpa_local} \end{equation} Since neither $A(u)$ nor $u_*$ involve $c$ and $\eta$, we conclude that the local branches are independent of these parameters. Furthermore, for $\gamma \ll k$, the LHS of \eqref{eqn:champ_lpa_local} $\approx 1$ so $u_{L*}=u_*$, which means that there is no local branch for small $\gamma$. We will show that for $\gamma \gg k$, there are always a high and low local branches. The low branch is $u_L \approx 0$, since with $\gamma \to \infty$ and $u_L =0$, both sides of \eqref{eqn:champ_lpa_local} evaluate to 0. With a bit of further manipulation, we get (in the limit $\gamma \to \infty$): \[h(u_{L_*}) = h(u_*), \quad \text{where \ } h(u)=\frac{u^{n-1}}{1+u^n} \,.\] The function $h(u)$ satisfies $h(0)=0=h(u \to \infty)$, and it has a single peak at $u_{p} \geq 1$ (provided $n \geq 2$). Since we focus on parameters with $\alpha<\theta$, that is $u_* <1$, there exists a point $u_{L*}> u_p > 1$ such that $h(u_{L*})=h(u_*)$, which corresponds to the high local branch. In the bifurcation diagrams in Fig.~\ref{fig:lpa_champ}, we use parameters from Table~\ref{tab:parameters} (CM2) but with $\eta=5$. (These parameters yield visually optimized bifurcation diagrams whose regimes are neither too wide nor too narrow; the same regimes are present for parameters from Table~\ref{tab:parameters}(NC) used for PDE simulations, but the resulting bifurcation diagram is harder to read.) Fig.~\ref{fig:lpa_champ} identifies four distinct regimes in the LPA system whose interpretation is as in the previous section. The location of the branches agrees with earlier analysis. The regimes are summarized in Table~\ref{tab:lpa_champ_regimes}. \begin{figure} \centering \begin{subfigure}[h]{0.5\textwidth} \centering \caption{WM} \includegraphics[width=\textwidth]{bif/champ/champ_wellmix,k=1,gamma=0.01,n=2,eta=5,epsilon_c=1,alpha=1.5,theta=5.5.png} \end{subfigure}% \begin{subfigure}[h]{0.5\textwidth} \centering \caption{LPA} \includegraphics[width=\textwidth]{bif/champ/champ_LPA,k=1,gamma=0.01,n=2,eta=5,epsilon_c=1,alpha=1.5,theta=5.5_lined_thick_labelled.png} \end{subfigure} \begin{subfigure}[h]{0.8\textwidth} \centering \caption{LPA} \includegraphics[width=\textwidth]{bif/champ/champ_LPA,k=1,gamma=0.1,n=2,eta=5,epc=1,alpha=1.5,theta=5.5_twoparam_autotomatlab_labelled.png} \end{subfigure} \caption[Bifurcation diagrams of the LPA and well-mixed non-conservative model]{Bifurcation diagrams for the non-conservative (NC) model, with parameter values from Table~\ref{tab:parameters}(CM2) except $\eta=5$. (a) WM, (b,c) LPA, using bifurcation parameters (a,b) $\gamma$, with $c=1$, (c) $c$ and $\gamma$. A thin polarizable regime II is sandwiched between the stable I and Turing III regimes. The triplet of Hopf bifurcations (not present in WP) does not show up as new behavior in the full PDE simulations. } \label{fig:lpa_champ} \end{figure} In Regime I, no pattern forms, as expected. In Regime II a small perturbation decays, but a sufficiently large perturbation will persist. In the full PDEs, such perturbation leads to the soliton solution shown in Fig.~\ref{fig:sim_champ}(c,d). Both Regime III and IV are unstable, and any perturbation leads to a Turing-type pattern consisting of a series of evenly spaced, static spikes in the full PDE, as in Fig.~\ref{fig:sim_champ}(a,b). The limit cycles in Regime IV suggests that the spikes might oscillate, but this, in fact, does not occur: we found that the PDE behavior is qualitatively indistinguishable in Regime III and IV. This suggests that the Hopf bifurcations in the LPA diagram may not necessarily correspond to actual bifurcations for the full PDE, pointing to a limitation of LPA. \begin{table}[h] \centering \begin{tabular}{l||l|l} Regime & Classification & Description \\ \hline \hline I & Stable & \specialcell{One stable GB, no LB} \\ \hline II & Polarizable & \specialcell{One stable GB, one stable LB\\ located above the GB} \\ \hline III & Unstable & \specialcell{The only GB is unstable, two LBs \\located on both sides of the GB} \\ \hline IV & Unstable & \specialcell{One GB, two LBs all unstable, \\ each enclosed by a periodic orbit} \\ \hline \end{tabular} \caption[Summary of the non-conservative model regimes]{Summary of the non-conservative (NC) model regimes identified in Fig.~\ref{fig:lpa_champ}. Abbreviations as in Table.~\ref{tab:lpa_wavepin_regimes}.} \label{tab:lpa_champ_regimes} \end{table} \subsection{Actin feedback (AF) model} We use mass conservation to eliminate $v$ from the LPA system as before. The strength of actin feedback $s$ and the basal rate of activation $k$ were our bifurcation parameters. LPA for this model was previously discussed in \cite{holmes2012regimes,mata2013model}, but here we traced more bifurcations in greater detail. The results are shown in Fig.~\ref{fig:lpa_actin} and \ref{fig:lpa_actin_twoparam_annotated}. We only distinguish between the regimes separated by fold and transcritical curves and omit the Hopf curves, as explained below. We also ignore some very narrow regimes, to concentrate on six major regimes as summarized in Table.~\ref{tab:lpa_actin_regimes}. One interesting characteristic of these diagrams is the presence of unstable periodic orbits that emerge as subcritical Hopf bifurcations and exist for very narrow parameter ranges. The unstable cycle enlarges until it collides with a saddle point, turning into a homoclinic orbit to the saddle, and then disappearing. This is known as saddle-loop bifurcation, or homoclinic bifurcation (see \cite[Ch.6.2]{kuznetsov}). Parameter regimes where the periodic solutions exist are very narrow. Hence, while Hopf bifurcations occur, they are unlikely to be playing a major role in the biological application of this model. We can compare our results to those of \cite{holmes2012regimes} (Fig.~5, a LPA diagram in $k-s$ plane containing only one of the Hopf curves). The Hopf curve in \cite{holmes2012regimes} corresponds to the dark blue curve on our diagram, which traces the pair of Hopf points on the global branch in Fig.~\ref{fig:lpa_actin}(d)). Furthermore, our diagram (Fig.~\ref{fig:lpa_actin_twoparam_annotated}) traces the fold (red) and transcritical (light blue) bifurcation points and hence identifies a larger number of distinct regimes. Interpreting the LPA diagrams (as in the WP model), we can conclude that a stable local branch in LPA corresponds to a regime of pattern formation in the PDE. Unlike WP, there are multiple possible patterns in this AF model. LPA cannot accurately predict the type of pattern. In particula, the consequence of the subcritical Hopf bifurcations to the full PDE is unclear, possibly suggesting some kind of (quasi-)periodic behavior that we did not fully characterize. In \cite{holmes2012regimes,mata2013model}, a parameter scan of the PDE system was included with the LPA diagrams. As previously noted, PDE regimes are not exactly aligned with LPA regimes since $\delta \ne 0$ in the full PDEs. In summary, in our hands, LPA worked well in identifying no-pattern and WP regimes, but was less useful for predicting the emergence of more complex patterns. Many of those patterns involve interacting waves, which suggests that they are non-linear, non-local phenomena, explaining why LPA cannot account for them. \begin{table}[h] \centering \begin{tabular}{l||l|l} Regime & Classification & Description \\ \hline \hline I & Stable & \specialcell{One stable GB, no LB} \\ \hline II & Polarizable & \specialcell{One stable GB, one stable LB\\ located above the GB} \\ \hline III & Unstable & \specialcell{The only GB is unstable, two stable LBs \\located on both sides of the GB} \\ \hline IV & Unstable & \specialcell{The only GB is unstable, one stable LB\\ located above the GB} \\ \hline V & Polarizable & \specialcell{Two stable GBs, three stable LBs: one above both\\ GBs, one in between, and one below both GBs} \\ \hline VI & Polarizable & \specialcell{One stable GB, three stable LBs \\ located on both sides of the GB} \\ \hline \end{tabular} \caption[Summary of the actin feedback model regimes]{Summary of the actin feedback (AF) model regimes identified in Fig.~\ref{fig:lpa_actin}. For abbreviations see caption of Table.~\ref{tab:lpa_wavepin_regimes}.} \label{tab:lpa_actin_regimes} \end{table} \begin{figure} \centering \begin{subfigure}[h]{0.5\textwidth} \centering \caption{WM, $k=1.5$} \includegraphics[width=\textwidth]{bif/actin/holmes_wellmix,w=2.5,k=1.5,gamma=30,n=3,eta=15.png} \end{subfigure}% \begin{subfigure}[h]{0.5\textwidth} \centering \caption{LPA, $k=1.5$} \includegraphics[width=\textwidth]{bif/actin/holmes_LPA,w=2.5,k=1.5,gamma=30,n=3,eta=15_lined_thick_labelled.png} \end{subfigure} \begin{subfigure}[h]{0.5\textwidth} \centering \caption{WM, $k=6$} \includegraphics[width=\textwidth]{bif/actin/holmes_wellmix,w=2.5,k=6,gamma=30,n=3,eta=15.png} \end{subfigure}% \begin{subfigure}[h]{0.5\textwidth} \centering \caption{LPA, $k=6$} \includegraphics[width=\textwidth]{bif/actin/holmes_LPA,w=2.5,k=6,gamma=30,n=3,eta=15_lined_labelled.png} \end{subfigure} \begin{subfigure}[h]{0.45\textwidth} \centering \caption{LPA} \includegraphics[width=\textwidth]{bif/actin/holmes_LPA,w=2.5,k=6,gamma=30,n=3,eta=15_twoparam_autotomatlab_thick2_nohopf_labelled.png} \end{subfigure} \begin{subfigure}[h]{0.45\textwidth} \centering \caption{LPA} \includegraphics[width=1.0\textwidth]{bif/actin/holmes_LPA,w=2.5,k=6,gamma=30,n=3,eta=15_twoparam_autotomatlab_thick2.png} \end{subfigure} \caption[Bifurcation diagrams of the actin feedback extension]{Bifurcation diagrams of the actin feedback (AF) model with respect to parameter $s$ (a-d) and with respect to $k,s$ in (e,f). (In (e), the Hopf curves are omitted for clarity of the diagram. They are then included in (f).) The narrow regimes are not labelled. The nearly vertical blue curves indicate unstable periodic orbits.} \label{fig:lpa_actin} \end{figure} \begin{figure} \centering \includegraphics[width=1.0\textwidth]{bif/actin/holmes_LPA_all_with_annotation.png} \caption{Same as Fig.~\ref{fig:lpa_actin}(f) with the Hopf curves included, and with an indication of patterns in several regimes. A few Hopf curves lie very close to one of the other curves for most of their length, creating some very narrow regimes. The simulation results from Fig.~\ref{fig:sim_actin} are identified with their corresponding regions on the parameter plane. } \label{fig:lpa_actin_twoparam_annotated} \end{figure} \subsection{Combined model (CM)} The LPA diagrams for the combined model are very complex, and mostly beyond the scope of interpretation (see Appendix \ref{apd:NC_lpa}.) This is unsurprising given the complex behavior exhibited by the PDE. The bifurcation diagram shown in Fig.~\ref{fig:lpa_combined}, which uses parameter values from Table~\ref{tab:parameters}(CM2), contains many limit cycle bifurcations, such as torus and period-doubling. One thing the diagram can provide is the minimum value of $s$ required for any non-static patterns (corresponding to the first triplet of Hopf bifurcation in Fig.~\ref{fig:lpa_combined}). With $s$ below this value, the system behaviour is the same as that of the $s=0$ case, which reduces back to the non-conservative (NC) model. \subsection{Comparison with linear (Turing) stability analysis} Linear stability analysis (LSA) was previously applied by \cite{mori2008wave} and \cite{Champneys} for the wave pinning and non-conservative models respectively. The relative merits of LSA and LPA have been described in \cite{mata2013model,holmes2014efficient} and we briefly summarize some of these in the Appendix. LPA is only valid in the limit of $\delta \to 0$. In this limit, LPA contains the Turing stability properties: a branch that is LPA-unstable is also Turing-unstable. See Fig.~\ref{fig:lpa_turing_comparison}, where we show how the LPA regimes from Fig.~\ref{tab:lpa_champ_regimes}(b) line up with Turing regimes. LPA can detect instabilities that require a perturbation of sufficient magnitude (the polarizable regimes), which cannot be detected by Turing analysis. This means LPA can potentially find more types of pattern. LPA does not predict details of the pattern. We saw this most evidently in the actin feedback (AF) model, where many possible patterns and a large number of parameter regimes exist. Turing analysis predicts pattern initiation, but often fails to specify the final pattern that depends on nonlinear interactions. We give an example of this type for the NC model in Fig.~\ref{fig:turing_zoom}. We also indicate how the ``minimal patch size" idea from \cite{painter2011spatio} can be used to help predict the final pattern using LSA. \section{Numerical simulations} We simulated the model for a static cell in 1D ($0 \leq x \leq 1$) and 2D ($0 \leq x,y \leq 1$), and for a motile cell in two spatial dimensions using the Cellular Potts Model (CPM). The four main parameter sets we used for numerical simulations are summarized in Table~\ref{tab:parameters}. The selection of values for most of these parameters is based on \cite{holmes2012regimes}, with $\alpha, \theta$ coming from \cite{Champneys}, and some modifications guided by LPA and Turing analysis. In contrast to \cite{holmes2012regimes} we use a much larger domain size $L$, corresponding to a larger cell and allowing for more complex patterns to develop. \begin{table}[ht] \centering \begin{tabular}{l|l||c|c|c|c} Parameter & Meaning & WP & NC & AF & CM2 \\ \hline \hline $\delta$ & Diffusion coefficient ratio & \multicolumn{4}{c}{$0.01$} \\ \hline $L$ & Domain length & 1 & \multicolumn{3}{c}{$10$}\\ \hline $k$ & Basal activation rate & \multicolumn{2}{c|}{$1.5L^2$} & $1L^2-6L^2$ & $1L^2$\\ \hline $\gamma$ & Nonlinear activation rate & \multicolumn{4}{c}{$30L^2$}\\ \hline $n$ & Hill coefficient & \multicolumn{3}{c|}{$3$} &2\\ \hline $\eta$ & Inactivation rate & $15L^2$& $5L^2$& $15L^2$& $5.2L^2$\\ \hline $c$ & NC terms on/off & 0& 1& 0&1\\ \hline $\alpha$ & Source strength & \multicolumn{4}{c}{$1.5L^2$}\\ \hline $\theta$ & Sink strength & \multicolumn{3}{c|}{$4.5L^2$} & $5.5L^2$\\ \hline $s$ & Actin feedback strength & \multicolumn{2}{c|}{$0$}& \multicolumn{2}{c}{$0-50L^2$}\\ \hline $\epsilon$ & Actin reaction rate & \multicolumn{4}{c}{$0.1$}\\ \hline $k_n$ & Actin activation rate & \multicolumn{4}{c}{$24L^2$}\\ \hline $k_s$ & Actin inactivation rate & \multicolumn{4}{c}{$7.5L^2$}\\ \hline \end{tabular} \caption[Parameter values for numerical simulations]{The parameters in the combined model, their meanings and values for various simulations. WP: wave pinning; NC: non-conservative extension; AF: actin feedback extension; CM2: one of the parameter sets used for the combined model (CM). All parameters (except $L$) are scaled to be non-dimensional. } \label{tab:parameters} \end{table} \subsection{Simulations in a fixed 1D domain} While 1D simulations for the WP, NC and AF appear in previous works \cite{mori2008wave,Champneys,holmes2012regimes,mata2013model}, we present them here as comparison to the combined model and the 2D case. Results are shown as kymographs, with time on the horizontal axis and is space on the vertical axis. Color indicates the levels of $u$ and $v$ and/or $F$ (if $s>0$). For most simulations, we start at a homogeneous steady state (HSS), and perturb the system either with small global noise or with a localized pulse. The first leads to Turing-type patterns, while the latter can lead to the patterns described by LPA. Fig.~\ref{fig:sim_wavepin} shows the results for the WP model. Observe that for the first two cases (a,c), the initial perturbation decays considerably, but nevertheless this results in formation of a pattern associated with polarization. The random initial condition (e) also results in a polarized steady state. In these simulations, $u$ can vary greatly across the domain while $v$ becomes nearly uniform, as expected given its much faster rate of diffusion. Fig.~\ref{fig:sim_actin} shows the results for the actin feedback (AF) model. The default initial conditions are $u=0$ except $u=4$ for $0 \leq x \leq 0.01$, $v=2.5$, $F=0$. We are not initializing near a stable HSS because doing so usually does not result in patterning. The patterns observed are quite sensitive to initial conditions. In addition to simple wave pinning observed at low $s$ (not shown), the system displays four qualitatively different behaviors: (1) wave pinning with oscillating boundary (WPO), where polarization occurs as in wave pinning, but with an oscillating front position; (2) reflecting pulse (RW), where a single pulse traverses the domain at constant velocity and gets reflected back at the boundary; (3) a single pulse (SP) that is absorbed at a boundary, before the system returns to HSS; (4) a wave train (WT), that originates either at a boundary or in the interior of the domain, propagates with constant velocity and gets absorbed at a boundary. In general, the spatial profile of $F$ lags behind $u$, as expected, since it is a slow variable depending on $u$. The pattern in $v$ is usually opposite that of $u$, i.e, $v$ is high where $u$ is low, and vice versa. Moreover, the gradient of $v$ tends to be much shallower than $u$ due to the faster diffusion of $v$. Some other more complex patterns are shown in Fig.~\ref{fig:sim_actin_weird}. These share some characteristics with the simpler patterns. The patterns shown in (a-c) are similar to (WPO), but the domain is divided into five regions instead of two, with an initial transient reminiscent of (WT). The patterns in (d-f) can be seen as a group of four reflecting pulses (similar to RW) rather than one. Compared to \cite{holmes2012regimes}, we find a richer range of patterns using a similar parameter set (with different scaling). The main difference is that the larger domain used here, $L=10$, allows more space for pattern to develop. (In \cite{holmes2012regimes}, $L=1$, so patterns are more confined and boundary effects are prominent.) Fig.~\ref{fig:sim_champ} shows two typical patterns in the NC model: a static, Turing-type pattern consisting of a series of evenly spaced spikes, and a single spike ``soliton" pattern. The final profiles of these two patterns are shown in Fig.~\ref{fig:sim_champ2}(a,b). The domain length, $L$, must be large enough to support such patterns. If $L$ is too small to support a full period of the pattern, the result would be simple polarization similar to wave pinning (Fig.~\ref{fig:sim_champ2}(c)). Using a higher rate of inactivation $\eta$, or a smaller diffusion ratio $\delta$ can result in spikes that split into two, as shown in Fig.~\ref{fig:sim_champ2}(d). For the combined model, we use parameters from Table~\ref{tab:parameters}(CM2), mostly similar to the NC case. In Fig.~\ref{fig:sim_combined2}, we show the effect of increasing $s$ (strength of actin feedback) on system behavior. With $s$ low enough, the system behavior resembles the $s=0$ case of a static, spatially periodic pattern, as in the NC case. For increasing $s$, the peaks begin to move with constant velocity by themselves, repelling one another when too close. For moderate values of $s$, the peak repulsion is strong enough that peaks reverse their direction of motion if on a collision course (Fig.~\ref{fig:sim_combined2}(a)). At higher $s$, they collide (Fig.~\ref{fig:sim_combined2}(b)). At even higher $s$, we observe a localized standing wave pattern that oscillates rapidly in Fig.~\ref{fig:sim_combined2}(c), and even more prominently in (d). \begin{figure} \centering \vspace{-0.25cm} \begin{subfigure}[h]{0.5\textwidth} \centering \caption{u} \includegraphics[width=\textwidth]{sim/wavepin/wavepin1d_plain_L=1,delta=0.01,k=1.5,gamma=30,n=3,eta=15_leftHighU_u.png} \end{subfigure}~ \begin{subfigure}[h]{0.5\textwidth} \centering \caption{v} \includegraphics[width=\textwidth]{sim/wavepin/wavepin1d_plain_L=1,delta=0.01,k=1.5,gamma=30,n=3,eta=15_leftHighU_v.png} \end{subfigure} \begin{subfigure}[h]{0.5\textwidth} \centering \caption{u} \includegraphics[width=\textwidth]{sim/wavepin/wavepin1d_plain_L=1,delta=0.01,k=1.5,gamma=30,n=3,eta=15_middleHighU_u.png} \end{subfigure}~ \begin{subfigure}[h]{0.5\textwidth} \centering \caption{v} \includegraphics[width=\textwidth]{sim/wavepin/wavepin1d_plain_L=1,delta=0.01,k=1.5,gamma=30,n=3,eta=15_middleHighU_v.png} \end{subfigure} \begin{subfigure}[h]{0.5\textwidth} \centering \caption{u} \includegraphics[width=\textwidth]{sim/wavepin/wavepin1d_plain_L=1,delta=0.01,k=1.5,gamma=30,n=3,eta=15_randicU_u.png} \end{subfigure}~ \begin{subfigure}[h]{0.5\textwidth} \centering \caption{v} \includegraphics[width=\textwidth]{sim/wavepin/wavepin1d_plain_L=1,delta=0.01,k=1.5,gamma=30,n=3,eta=15_randicU_v.png} \end{subfigure} \vspace{-0.15cm} \caption[Wave pinning simulation]{Simulation of the wave pinning model (WP), with parameters from Table~\ref{tab:parameters}(WP). Initial condition: $v=1$, $u=0.102$ with perturbation $u=6$ for (a,b) $0 \leq x \leq 0.1$; (c,d) $0.4 \leq x \leq 0.5$; (e,f) random noise, $u=0.834\cdot \epsilon(x)$. Note that not all initial conditions result in wave pinning: a small perturbation from the HSS will simply decay and no pattern forms. The behaviors shown in (a,b,e,f) correspond to solutions shown in Fig.~2 of \cite{mori2008wave}. } \label{fig:sim_wavepin} \end{figure} \begin{figure} \centering \vspace{-0.25cm} \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$u$, $k=1.5,s=18$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=1500,s=1800_zeroU_u.png} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$v$, $k=1.5,s=18$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=1500,s=1800_zeroU_v.png} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$F$, $k=1.5,s=18$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=1500,s=1800_zeroU_F.png} \end{subfigure} \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$u$, $k=1.5,s=27$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=1500,s=2700_zeroU_u.png} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$v$, $k=1.5,s=27$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=1500,s=2700_zeroU_v.png} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$F$, $k=1.5,s=27$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=1500,s=2700_zeroU_F.png} \end{subfigure} \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$u$, $k=1.5,s=36$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=1500,s=3600_zeroU_u.png} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$v$, $k=1.5,s=36$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=1500,s=3600_zeroU_v.png} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$F$, $k=1.5,s=36$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=1500,s=3600_zeroU_F.png} \end{subfigure} \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$u$, $k=6,s=30$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=600,gamma=3000,n=3,eta=1500,s=3000_zeroU_u.png} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$v$, $k=6,s=30$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=600,gamma=3000,n=3,eta=1500,s=3000_zeroU_v.png} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering\caption{$F$, $k=6,s=30$} \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=600,gamma=3000,n=3,eta=1500,s=3000_zeroU_F.png} \end{subfigure} \vspace{-0.15cm} \caption[Numerical simulations of the actin feedback model]{Simulations of the actin feedback model (AF) with parameters from Table~\ref{tab:parameters}(AF) ($s,k$ as indicated on labels), and default initial conditions. Each row corresponds to one parameters set, showing $u,v,F$ (left to right). We observe four behaviors by varying $k $ and $s$: (a-c) Wave pinning with oscillating front (WPO); (d-f) Reflecting waves (RW); (g-i) Single pulse absorbed at boundary (SP); (j-l) Persistent wave trains (WT). We used a larger domain length than \cite{holmes2012regimes}, leading to a richer set of patterns. } \label{fig:sim_actin} \end{figure} \begin{figure}[ht] \centering \begin{subfigure}[h]{0.33\textwidth} \centering \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=500,gamma=3000,n=3,eta=1500,s=1000_zeroU_u.png} \caption{u} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=500,gamma=3000,n=3,eta=1500,s=1000_zeroU_v.png} \caption{v} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=500,gamma=3000,n=3,eta=1500,s=1000_zeroU_F.png} \caption{F} \end{subfigure} \begin{subfigure}[h]{0.33\textwidth} \centering \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=500,gamma=3000,n=3,eta=1500,s=3000_zeroU_u.png} \caption{u} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=500,gamma=3000,n=3,eta=1500,s=3000_zeroU_v.png} \caption{v} \end{subfigure}% \begin{subfigure}[h]{0.33\textwidth} \centering \includegraphics[width=\textwidth]{sim/actin/wavepin1d_holmes_L=10,delta=0.01,k=500,gamma=3000,n=3,eta=1500,s=3000_zeroU_F.png} \caption{F} \end{subfigure} \caption[Exotic patterns observed under the actin feedback model]{Exotic patterns observed in the actin feedback (AF) model. Parameters as in Table~\ref{tab:parameters}(AF) but varying $k,s$. (a-c) $k=5, s=10$, default initial conditions. The pattern resembles WPO but with several subregions; (d-f) $k=5, s=30$, default initial conditions with excitation region $0\leq x \leq 0.1$. The resulting pattern is similar to RW but with a group of four pulses traversing the domain. } \label{fig:sim_actin_weird} \end{figure} \begin{figure}[htbp] \centering \begin{subfigure}[h]{0.5\textwidth} \centering \caption{u} \includegraphics[width=\textwidth]{sim/champ/wavepin1d_champ_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=500,epsilon_c=1,theta=450,alpha=150_leftHighU_u.png} \end{subfigure}~ \begin{subfigure}[h]{0.5\textwidth} \centering \caption{v} \includegraphics[width=\textwidth]{sim/champ/wavepin1d_champ_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=500,epsilon_c=1,theta=450,alpha=150_leftHighU_v.png} \end{subfigure} \begin{subfigure}[h]{0.5\textwidth} \centering \caption{u} \includegraphics[width=\textwidth]{sim/champ/wavepin1d_champ_L=10,delta=0.01,k=150,gamma=1500,n=3,eta=1500,epsilon_c=1,theta=450,alpha=150_leftLowU_u0=0,1.3134_v0=0.1866_u.png} \end{subfigure}~ \begin{subfigure}[h]{0.5\textwidth} \centering \caption{v} \includegraphics[width=\textwidth]{sim/champ/wavepin1d_champ_L=10,delta=0.01,k=150,gamma=1500,n=3,eta=1500,epsilon_c=1,theta=450,alpha=150_leftLowU_u0=0,1.3134_v0=0.1866_v.png} \end{subfigure} \caption[Numerical simulations of the non-conservative model]{Simulation of the non-conservative model (NC) with (a,b) default parameters (Table~\ref{tab:parameters}(NC)); (c,d) $\gamma=15L^2, \eta=15L^2$. Initial condition: (a,b) $u=u_*$ except $u=1$ on $0 \leq x \leq 0.1$, $v=v_*$. (c,d) $u=u_*=0.33333$ except $u=10u_*$ on $0.4\leq x \leq 0.41$, $v=v_*=3.19298$. In (a,b), the formation of a peak on the left triggers some new peaks farther away, until space runs out. Once all peaks form, they shift slightly to be evenly spaced. In (c,d), the single initial peak persists, without triggering new peaks. We refer to this as the soliton solution. } \label{fig:sim_champ} \end{figure} \begin{figure}[ht] \centering \begin{subfigure}[h]{0.5\textwidth} \centering \caption{Default parameters} \includegraphics[width=\textwidth]{sim/champ/wavepin1d_champ_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=500,epsilon_c=1,theta=450,alpha=150_leftLowU_u0=0,1.3134_v0=0.1866_final_new.png} \end{subfigure}~ \begin{subfigure}[h]{0.5\textwidth} \centering \caption{$\gamma=15L^2$} \includegraphics[width=\textwidth]{sim/champ/wavepin1d_champ_L=10,delta=0.01,k=150,gamma=1500,n=3,eta=1500,epsilon_c=1,theta=450,alpha=150_leftLowU_u0=0,1.3134_v0=0.1866_final_new.png} \end{subfigure} \begin{subfigure}[h]{0.5\textwidth} \centering \caption{$L=1$} \includegraphics[width=\textwidth]{sim/champ/wavepin1d_champ_L=1,delta=0.01,k=1.5,gamma=30,n=3,eta=5,epsilon_c=1,theta=4.5,alpha=1.5_leftHighU_final.png} \end{subfigure}~ \begin{subfigure}[h]{0.5\textwidth} \centering \caption{$\eta=15$} \includegraphics[width=\textwidth]{sim/champ/wavepin1d_champ_L=10,delta=0.01,k=150,gamma=3000,n=3,eta=1500,epsilon_c=1,theta=450,alpha=150_zeroU_final.png} \end{subfigure} \caption[Steady state pattern of the non-conservative model]{Final steady state pattern of the non-conservative model (NC) with most parameters from Table~\ref{tab:parameters}(NC), except the parameters indicated on the labels. (a) and (b) correspond to the steady state of Fig.~\ref{fig:sim_champ}(a,b) and (c,d) respectively. In (c) the shortened domain results in wave pinning; (d) Higher inactivation rate $\eta=15$ results in bifurcating peaks. (a,b) corresponds to Fig.~5 (a,d) of \cite{Champneys}, respectively.} \label{fig:sim_champ2} \end{figure} \begin{figure}[ht] \centering \begin{subfigure}[h]{0.5\textwidth} \centering \caption{$s=5$} \includegraphics[width=\textwidth]{sim/combined/wavepin1d_combined_L=10,delta=0.01,k=100,gamma=3000,n=2,eta=520,epsilon_c=1,theta=550,alpha=150,s=500_randU_u.png} \end{subfigure}~ \begin{subfigure}[h]{0.5\textwidth} \centering \caption{$s=8$} \includegraphics[width=\textwidth]{sim/combined/wavepin1d_combined_L=10,delta=0.01,k=100,gamma=3000,n=2,eta=520,epsilon_c=1,theta=550,alpha=150,s=800_randU_u.png} \end{subfigure} \begin{subfigure}[h]{0.5\textwidth} \centering \caption{$s=18$} \includegraphics[width=\textwidth]{sim/combined/wavepin1d_combined_L=10,delta=0.01,k=100,gamma=3000,n=2,eta=520,epsilon_c=1,theta=550,alpha=150,s=1800_randU_u.png} \end{subfigure}~ \begin{subfigure}[h]{0.5\textwidth} \centering \caption{$s=35$} \includegraphics[width=\textwidth]{sim/combined/wavepin1d_combined_L=10,delta=0.01,k=100,gamma=3000,n=2,eta=520,epsilon_c=1,theta=550,alpha=150,s=3500_randU_u.png} \end{subfigure} \caption[Numerical simulations of the combined model (2)]{Simulations of the combined model (CM). Parameters as in Table~\ref{tab:parameters}(CM2) but varying $s$, and HSS+noise initial condition as described in text. As we increase the actin feedback strength $s$, the behavior transitions from slowly moving, repelling peaks to colliding peaks. At higher $s$, there is a rapidly oscillating standing wave pattern in some parts of the domain.} \label{fig:sim_combined2} \end{figure} \subsection{Simulations in a fixed 2D domain} In two spatial dimensions, we use the same parameters as in 1D. For the WP model, we start at HSS and perturb one corner of the domain. The pattern we observe (Fig.~\ref{fig:sim_2d}(a,b)) is a direct analogue to the 1D case (compare to Fig.~\ref{fig:sim_wavepin}(a,b)): $u$ initially spreads out from the corner as a 2D travelling wave, and that is eventually pinned along a front determined by the initial conditions. We use a similar initial condition for the NC model. Based on 1D simulations, we expect evenly-spaced stripes to form around the corner as concentric rings, as happens initially (Fig.~\ref{fig:sim_2d}(c)). However, these rings quickly break up into spots (Fig.~\ref{fig:sim_2d}(d)). The spots spread out, and then settle into a steady state. We have not found any parameter sets for stable ring patterns. The patterns are insensitive to the shape of the domain. Simulations on circular, rectangular and other domains with simple shapes produced patterns with the same qualitative characteristics (not shown). For CM, we initialize the system at HSS and perturb with noise. Fig.~\ref{fig:sim_2d_combined} shows the simulation results. With a low $s$, the pattern is indistinguishable from the static spots under the non-conservative model. As $s$ increases, the spots become mobile and repel each other as in the 1D case. In 2D, as $s$ is increased further, the spots transitions to spiral waves. We also arrived at the AF model by initializing the CM model at HSS plus global noise and $c=1$. After a pattern starts to form, we gradually decreased $c$ to 0 to arrive at the AF model. (In our hands, this produced more robust results, with patterns that persisted.) Fig.~\ref{fig:sim_2d_actin} shows a few snapshot of the simulations. For low $s$, the pattern resembles slowly drifting and deforming blobs. As $s$ increases, the pattern transitions into spiral waves with decreasing width. \begin{figure}[ht] \centering \begin{subfigure}[h]{0.74\textwidth} \centering \caption{Wave pinning, $t=1.25$} \includegraphics[width=\textwidth]{sim/2d/wavepin2d_plain_Du=0.01_gamma=30.0_L=1.0_k=1.5_eta=15.0_c=0.0_theta=4.5_alpha=1.5_square_cornerIC.0025_compressed.png} \end{subfigure} \begin{subfigure}[h]{0.74\textwidth} \centering \caption{Wave pinning, $t=30$} \includegraphics[width=\textwidth]{sim/2d/wavepin2d_plain_Du=0.01_gamma=30.0_L=1.0_k=1.5_eta=15.0_c=0.0_theta=4.5_alpha=1.5_square_cornerIC.0600_compressed.png} \end{subfigure} \begin{subfigure}[h]{0.74\textwidth} \centering \caption{Non-conservative extension, $t=0.145$} \includegraphics[width=\textwidth]{sim/2d/wavepin2d_champ_Du=0.01_gamma=3000.0_L=10.0_k=150.0_eta=500.0_c=1.0_theta=450.0_alpha=150.0_square_cornerIC_snap1.png} \end{subfigure} \begin{subfigure}[h]{0.74\textwidth} \centering \caption{Non-conservative extension, $t=0.994$} \includegraphics[width=\textwidth]{sim/2d/wavepin2d_champ_Du=0.01_gamma=3000.0_L=10.0_k=150.0_eta=500.0_c=1.0_theta=450.0_alpha=150.0_square_cornerIC_snap2.png} \end{subfigure} \caption[2D simulations of the wave pinning and non-conservative model]{2D simulations of the wave pinning (a,b) and non-conservative (c,d) models, using the same parameters as in 1D (Table~\ref{tab:parameters}(WP) and (NC)). Left: $u$ , Right: $v$. For each model, two snap shots are shown: one when the pattern begin to take shape, and another after the system reached steady state.} \label{fig:sim_2d} \end{figure} \begin{figure}[ht] \centering \begin{subfigure}[h]{\textwidth} \centering \caption{$s=12$} \includegraphics[width=\textwidth]{sim/2d_fdm_stillpics/wavepin2d_combined_changing_c_L=10,delta=0.0001,k=1.5,gamma=30,n=3,eta=15,epsilon_c=1,theta=4.5,alpha=1.5,s=12_randU,t=150.png} \end{subfigure} \begin{subfigure}[h]{\textwidth} \centering \caption{$s=18$} \includegraphics[width=\textwidth]{sim/2d_fdm_stillpics/wavepin2d_combined_changing_c_L=10,delta=0.0001,k=1.5,gamma=30,n=3,eta=15,epsilon_c=1,theta=4.5,alpha=1.5,s=18_randU,t=114.png} \end{subfigure} \begin{subfigure}[h]{\textwidth} \centering \caption{$s=27$} \includegraphics[width=\textwidth]{sim/2d_fdm_stillpics/wavepin2d_combined_changing_c_L=10,delta=0.0001,k=1.5,gamma=30,n=3,eta=15,epsilon_c=1,theta=4.5,alpha=1.5,s=27_randU,t=143.png} \end{subfigure} \begin{subfigure}[h]{\textwidth} \centering \caption{$s=36$} \includegraphics[width=\textwidth]{sim/2d_fdm_stillpics/wavepin2d_combined_changing_c_L=10,delta=0.0001,k=1.5,gamma=30,n=3,eta=15,epsilon_c=1,theta=4.5,alpha=1.5,s=36_randU,t=120.png} \end{subfigure} \caption{2D simulations of the actin feedback (AF) model, with parameters from Table~\ref{tab:parameters}(AF) and initial conditions described in the text. These snapshots are taken after the patterns have fully developed. As $s$ increases, blobs transitions into thinner and thinner spiral waves. See movies at \url{https://imgur.com/a/61GwiA9}.} \label{fig:sim_2d_actin} \end{figure} \begin{figure}[ht] \centering \begin{subfigure}[h]{\textwidth} \centering \caption{$s=8$} \includegraphics[width=\textwidth]{sim/2d_fdm_stillpics/wavepin2d_combined_L=10,delta=0.0001,k=1.5,gamma=30,n=3,eta=5,epsilon_c=1,theta=4.5,alpha=1.5,s=8_randU,t=100.png} \end{subfigure} \begin{subfigure}[h]{\textwidth} \centering \caption{$s=12$} \includegraphics[width=\textwidth]{sim/2d_fdm_stillpics/wavepin2d_combined_L=10,delta=0.0001,k=1.5,gamma=30,n=3,eta=5,epsilon_c=1,theta=4.5,alpha=1.5,s=12_randU,t=80.png} \end{subfigure} \begin{subfigure}[h]{\textwidth} \centering \caption{$s=18$} \includegraphics[width=\textwidth]{sim/2d_fdm_stillpics/wavepin2d_combined_L=10,delta=0.0001,k=1.5,gamma=30,n=3,eta=5,epsilon_c=1,theta=4.5,alpha=1.5,s=18_randU,t=77.png} \end{subfigure} \begin{subfigure}[h]{\textwidth} \centering \caption{$s=4$} \includegraphics[width=\textwidth]{sim/2d_fdm_stillpics/wavepin2d_combined_L=10,delta=0.0001,k=1.5,gamma=30,n=3,eta=5,epsilon_c=1,theta=4.5,alpha=1.5,s=40_randU,t=111.png} \end{subfigure} \caption{Simulations of the combined model (CM) in 2D, with parameters from Table~\ref{tab:parameters}(CM2) and HSS + noise initial condition. There is a transition from spots to spiral waves near $s=12$. See movies at \url{https://imgur.com/a/a0u57GQ}.} \label{fig:sim_2d_combined} \end{figure} \subsection{Simulations in a 2D deforming domain}\label{sec:cpm} As a final set of numerical experiments, we simulate the models in an evolving 2D domain. The boundaries deform in response to the chemical levels close to the boundary. We use the Cellular Potts Model (CPM) for these examples. Full details of the CPM can be found elsewhere \cite{maree2007cellular} and are briefly summarized in the Appendix. The essential feature of the CPM is its ability to track an evolving shape such as morphology of a motile biological cell \cite{scianna2013cellular}. (In 2D, the cell is ``viewed from above'' as it migrates on a flat 2D surface.) The neighbourhood of each point inside the shape represents a 2D projection of some small cylinder in 3D, containing both membrane and cytosol. Hence, active and inactive GTPases ($u$ and $v$) coexist at every point inside the given shape, as they do in our fixed domain 2D simulations.) Commonly, for the CPM, a scalar Hamiltonian, analogous to a potential is assumed to depend on the area and perimeter of the cell, as well as the interface contact with other cells or empty space. Changes to the boundary of the cell are accepted or rejected stochastically, according to the net changes in the Hamiltonian, as described in the Appendix. Our simulations include the following additional features: (1) solving the reaction-diffusion PDEs inside the evolving domain with Neumann boundary conditions at the cell boundaries and (2) modifying the Hamiltonian to depend on the local RD variables. In real cells, actin polymerizes into F-actin, and promotes protrusion of a cell edge. Hence, we link the F-actin variable $F$ in the model to forces on the cell boundary, (by superimposing a chemically-dependent potential $H_0=\pm \beta F$ for retractions(+) vs extensions(-) on the basic Hamiltonian, see Appendix). In variants of the model that do not explicitly track F-actin, we assume that the GTPase $u$ plays a similar role (i.e., that $u$, like the GTPase Rac, locally promotes cytoskeleton assembly, creating a protrusive force at the cell edge). Simulations are initiated with a circular cell and internal variables close to HSS but with a randomly placed peak of active GTPase, $u$ somewhere inside the cell. Figure \ref{fig:CPMabsorbing} shows a time series of a CPM simulation with parameters that produced the absorbing wave simulations in the static domain. We observe three new types of dynamics (indicated by arrows 1, 2 and 3) resulting from cell movement. An initial burst in the lower right of the cell splits into two waves, moving to the lower right and upper left. The initial burst continues to produce additional waves that split and move towards the cell edge. Waves that impinge on the cell boundary push it outwards. The waves break and smaller protrusions are formed (see Arrow 1). \begin{figure} \centering \includegraphics[scale=1.2]{figures/AbsorbingConditionsFigure.png} \caption{Snapshots of 2D CPM simulation with parameters from the absorbing waves in a static domain. Visualized is F-actin ($F$) that promotes protrusions ($H_0=\pm \beta F$). Arrows indicate examples of interesting dynamics. Snapshots are 20 MCS apart. Parameters are: $D_a = 0.06$, $\eta=15$, $k=6$, $n=3$, $\gamma=30$, $\epsilon=0.1$, $k_s=7.5$, $k_n=24$, $s=30$. CPM Parameters are: $a=12000$, $\lambda_a=2$, $p=500$, $\lambda_p=20$, $J=50$, $r=3,\xi(r)=18$, $\beta=150$, $T=100$. Movie link \url{https://imgur.com/a/7OmgctR}. } \label{fig:CPMabsorbing} \end{figure} A new random burst appears (Arrow 2a) and produces waves in two directions (Arrow 2b). When waves collide, they break, amplify, move left and right (Arrow 2c) and eventually give rise to a spiral wave. Because the resulting spiral wave has a lower magnitude, there is weaker effect on the boundary at this time. \begin{figure} \centering \includegraphics[scale=1.2]{figures/OscillatingConditionsFigure.png} \caption{Snapshots of 2D CPM simulation with parameters from the oscillating waves in a static domain. Visualized is F-actin ($F$) that promotes protrusions ($H_0=\pm \beta F$) Arrows indicate examples of interesting dynamics. Snapshots are 20 MCS apart. Parameters are as in Fig. \ref{fig:CPMabsorbing}, but with $k=1.5$, $s=18$. CPM parameters are as in Fig. \ref{fig:CPMabsorbing}, but with $\beta=50$. Movie link \url{https://imgur.com/a/eIAjr59}} \label{fig:CPMoscillating} \end{figure} In Figure \ref{fig:CPMoscillating}, we show a time series for parameters that produced oscillating waves in the static domain. As before, the initial burst is in the lower right, and a new burst (Arrow 1a) breaks apart into two waves that broaden. We find a protrusion that is much broader than in Figure \ref{fig:CPMabsorbing} (Arrow 2). Wave absorption is lower than in Figure \ref{fig:CPMabsorbing}, so the cell edge is pushed further out. \begin{figure} \centering \includegraphics[scale=1.2]{figures/ReflectingConditionsFigure.png} \caption{Reflecting wave parameter set. Visualized is F-actin ($F$) that promotes protrusions ($H_0=\pm \beta F$). Snapshots in A,B,C are 10,20,20 MCS apart respectively. Parameters are as in Fig. \ref{fig:CPMabsorbing}, but with $k=1.5$, $s=27$. CPM parameters are as in Fig. \ref{fig:CPMabsorbing}, but with $\beta=50$. Movie link \url{https://imgur.com/a/FDCn3NY}} \label{fig:CPMreflecting} \end{figure} Figure \ref{fig:CPMreflecting} shows results for parameters corresponding to reflecting waves in a static domain. Here, because the cell boundary moves outwards, the waves are usually absorbed, rather than reflected. Occasionally, if the wave hits the cell edge tangentially, it is reflected (e.g. at 19 sec in the movie, upper left corner). We furthermore observe three new wave dynamics in a moving cell with random bursts. A wave can break apart when it hits a burst (A), waves can merge (B), or avoid each other (C). \begin{figure} \centering \includegraphics[scale=1.2]{figures/SpotsFigure.png} \caption{Spots. Visualized is Rac ($u$) that promotes protrusions ($H_0=\pm \beta u$). Snapshots in A,B,C are 10,5,25 MCS apart respectively. Parameters are: $D_a = 0.1$, $\eta=60$, $k=6$, $n=3$, $\gamma=30$, $c=1$, $\theta=18$, $\alpha=6$. CPM Parameters are: $a=10000$, $\lambda_a=0.02$, $p=1000$, $\lambda_p=0.04$, $J=40$, $r=3,\xi(r)=18$, $\beta=200$, $T=20$. Movie link \url{https://imgur.com/dADHOnS}.} \label{fig:CPMspots} \end{figure} As a last experiment, we simulate the formation of spots in the NC model (Figure \ref{fig:CPMspots}). Since this model has no F-actin variable, we base the edge protrusion on the active GTPase $u$ (assumed to act like Rac in promoting local cytoskeleton assembly). The spots are highly dynamic and, as expected, lead to the formation of small protrusions (``filopodia'') (C). Furthermore, edge deformation also causes the spot pattern to change. When a protrusion forms (stochastically or by locally elevated $u$), the spot in a region close to the protrusion can split into two, one of which moves into the protrusion (A). We also see formation of new spots inside protrusions (B). \section{Discussion} In summary we have explored extensions of the wave-pinning model (WP) \cite{mori2008wave,mori2011asymptotic} that coupled the non-conservative variant proposed by \cite{Champneys} (NC) and the actin feedback (AF) model of \cite{holmes2012modelling}. We found that the combined model (CM) borrows features from both, with moving peaks and wave trains, as well as more complex hybrid dynamics. At the same time, we were unable to find blinking localized spots as observed experimentally in \cite{robin2016excitable}. Despite the fact that the work of \cite{robin2016excitable} points to interactions of F-actin with the GTPase Rho, other unknown factors, missing in our model, should be considered to explain such behavior. We used the local perturbation analysis (LPA) on each model variant. As noted before \cite{holmes2015_lpa}, LPA recovers Turing analysis. States that are LPA stable are also Turing stable. LPA helps to identify potentially interesting parameter ranges, including polarizable regimes that cannot be detected by Turing analysis. At the same time, LPA does not predict details of patterns that emerge, nor accurate bifurcation points in the full PDE system. We also encountered examples where LPA identified apparent bifurcations that did not materialize as true regimes of behavior in the PDEs. As a second innovation, we simulated all model variants in 2D on both a static and a deforming domain. Previous work \cite{Champneys,holmes2012regimes} was concerned with fixed 1D domains for the PDEs. We hence showed that the patterns for the nonconservative (NC) model were primarily spots, not bands, whereas the AF model, while appearing to be less robust, produced a variety of moving peaks, bands, and waves, including spiral waves. Finally, our simulations of the models in a deforming domain mimicking a motile cell allowed us to consider the connection to experimentally observed waves of actin \cite{inagaki2017}. We showed that the internal dynamics of the models (and in particular the actin feedback model) have an interesting consequence on the motility of a ``model cell''. Indeed, the waves of high and low signaling levels led to formation of cellular protrusions, and gave rise to nontrivial motion in the deforming cell. \bigskip \noindent{\bf Acknowledgements: } LEK is funded by a Natural Sciences and Engineering Research Council of Canada (NSERC) Discovery Grant. YL was also supported by an NSERC postgraduate Fellowship. We are grateful to Zachary Pellegrin for his development of a CPM reaction-diffusion solver. We thank members of the Feng-Keshet groups for feedback. \section{Appendix: LPA diagram for the NC model} \label{apd:NC_lpa} The LPA diagram for the nonconservative model (NC) is given in Figure~\ref{fig:lpa_combined}. Due to the many intertwined bifurcations, it is difficult to interpret this diagram, and we present it here only to demonstrate the limitations of LPA. \begin{figure}[!hp] \centering \includegraphics[width=0.7\textwidth]{bif/combined/combined_lpa_s_gamma_30_champdefault_new2.png} \caption[Bifurcation diagram of the combined LPA system]{LPA bifurcation diagram for the combined model (CM) with respect to the parameter $s$. Other parameters as in Table~\ref{tab:parameters}(CM2). There are many apparent branches of periodic solutions. In a parameter range around $s=20$, there are no stable equilibria nor stable periodic solutions even though the system remains bounded, which suggests the presence of chaos.} \label{fig:lpa_combined} \end{figure} \section{Appendix: Relation between Turing and LPA} \label{apd:turing_vs_lpa} Linear stability analysis (i.e. Turing analysis) \cite{turing1952chemical} is a more traditional method of analyzing the stability of reaction-diffusion systems which focuses on the stability of a HSS in response to perturbations in the form of a global noise with infinitesimal height. Here we examine the relation between Turing and LPA. This was previously done by \cite{mata2013model} for the two-variable case in terms of eigenvalues, and for the general case by Theorem~4.1 of \cite{holmes2014efficient}. (The proof for this theorem is quite involved.) Here we present a much more elementary argument for the two-variable case. Suppose in a general reaction-diffusion PDE with a slow-diffusing quantity $u$ and a fast-diffusing quantity $v$. Assume that time has been rescaled so that the diffusion coefficient of the fast quantity is $1$. \begin{align*} \pd{u}{t} &= \delta \nabla^2 u +f(u,v),\\ \pd{v}{t} &= \nabla^2 v +g(u,v) . \end{align*} The corresponding well-mixed (WM) system is \begin{align*} \pd{u}{t} &= f(u,v),\\ \pd{v}{t} &= g(u,v) . \end{align*} The LPA system is the above plus an additional equation for the local variable: \begin{align*} \pd{u_L}{t} &= f(u_L,v) . \end{align*} Suppose the PDE system has a homogeneous steady state (HSS) $(u_*,v_*)$. The Jacobian of the well-mixed system and LPA system at the corresponding equilibrium is given by \[J_{WM} = \begin{bmatrix} \partial_u f & \partial_v f \\ \partial_u g & \partial_v g \end{bmatrix}, \quad J_{LPA} = \begin{bmatrix} \partial_u f & \partial_v f & 0\\ \partial_u g & \partial_v g & 0 \\ 0 & \partial_v g & \partial_u f \\ \end{bmatrix} = \begin{bmatrix} J_{WM} & 0 \\ * & \partial_u f \end{bmatrix} ,\] where the partial derivatives are understood to be evaluated at the HSS, and $*$ denote entries that are unimportant for later analysis. Notice that eigenvalues of $J_{LPA}$ are the two eigenvalues of $J_{WM}$, plus $\partial_u f$. This is due to $J_{LPA}$ being block-lower-triangular. We will show that saying the HSS is Turing-unstable in the limit $\delta \to 0$ is equivalent to saying it is a stable equilibrium for WM but unstable for LPA. Define the relevant matrices for Turing analysis: \[M(q^2) = J_{WM} - Dq^2, \quad D = \begin{bmatrix} \delta & 0 \\ 0 & 1 \end{bmatrix} \xrightarrow{\delta \to 0} \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix}\] Suppose the HSS satisfy the condition for Turing instability, which has three conditions (see, for example, \cite[Ch.~11.4]{leahsbook}): \begin{subequations} \begin{align} \Tr(J_{WM}) &<0 , \label{eqn:turingcond1}\\ \det(J_{WM}) &>0 , \label{eqn:turingcond2}\\ \det(M(q^2)) &<0 \text{ \ for some \ } q^2>0 \label{eqn:turingcond3} \,. \end{align} \end{subequations} Conditions \eqref{eqn:turingcond1}, \eqref{eqn:turingcond2} are equivalent to saying that the HSS is a stable equilibrium for WM. Next, in the limit of $\delta \to 0$, we compute \[\det(M) = \det(J_{WM} - Dq^2) = \det\left( J_{WM} - \begin{bmatrix} 0 & 0 \\ 0 & q^2 \end{bmatrix} \right) = \det(J_{WM}) - q^2 \partial_u f\] Notice that by setting $\delta = 0$, this equation is linear in $q^2$ instead of quadratic. This means \eqref{eqn:turingcond3} is equivalent to $\partial_u f >0$ . But since $\partial_u f$ is an eigenvalue for $J_{LPA}$, this means the HSS is unstable in the LPA system. Conversely, suppose that the HSS is stable in WM and unstable in LPA. This means the eigenvalues of $J_{WM}$ all have negative real part, and $\partial_u f >0$, which as shown above is equivalent to Turing-unstable. Compared to Turing analysis, LPA has several advantages and disadvantages. LPA is essentially a ``zeroth-order" expansion in $\delta$, so it is only valid in the limit of $\delta \to 0$ and offers no information on the effect of $\delta>0$, as opposed to Turing analysis. However, in this limit, LPA contains the Turing stability of the system. In particular, LPA-unstable is the same as Turing-unstable, whereas LPA-polarizable and LPA-stable regimes are Turing-stable. This follows the analysis above, and also \cite{mata2013model,holmes2014efficient}. This correspondence is illustrated in Fig.~\ref{fig:lpa_turing_comparison}, where we show how the LPA regimes from Fig.~\ref{tab:lpa_champ_regimes}(b) lines up with Turing regimes. In pattern-forming regimes, LPA does not help predict the exact form of the pattern. This is most relevant to the actin feedback model, when there are many different possible patterns and a large number of parameter regimes. Turing analysis also cannot predict the final pattern, but it does allow us to predict the initial precursor pattern that forms and exists only for small $t$. In Fig.~\ref{fig:turing_zoom}, we simulated the non-conservative model with parameters chosen such that only a single wave number is unstable. This results in a periodic, shallow precursor pattern which has the exact frequency as the unstable wave number. As the system continue to evolve, once a peak of the precursor pattern reaches a certain amplitude, it very rapidly grow to the full size of the final pattern while suppressing nearby peaks. Other precursor peaks farther away from the grown one might survive longer and eventually transition to full size, or be suppressed by another nearby peak which has transitioned sooner. These non-linear interactions cannot be captured by Turing analysis. In the special case that a static, periodic pattern forms, such as in the non-conservative model, the ``minimal patch size" idea from \cite{painter2011spatio}, which is based on Turing analysis, can give an upper bound on the number of periods the pattern can have. \begin{figure}[!hp] \centering \begin{subfigure}[h]{0.5\textwidth} \centering \caption{LPA} \includegraphics[width=\textwidth]{bif/champ_lpa_comparison_labelled.png} \end{subfigure}~ \begin{subfigure}[h]{0.5\textwidth} \centering \caption{Turing} \includegraphics[width=\textwidth]{bif/champ_turing_comparison_labelled.png} \end{subfigure} \caption[Comparison of LPA and Turing regimes for the non-conservative model]{Comparison of LPA and Turing bifurcation diagrams for the non-conservative model. (a) is a zoom of the LPA diagram from Fig.~\ref{fig:lpa_champ}(b). (b) is the Turing bifurcation diagram reproduced from Fig.~5 of \cite{Champneys}, using the same parameters. Observe that both the LPA-stable (I) and the LPA-polarizable (II) regimes in (a) located to the left of $\gamma_c=16.765$ correspond to the Turing-stable regime below the blue curve in (b). The LPA-unstable regimes (III, IV) correspond to the Turing-unstable regime above the curve. The curve passes through $\delta = 0, \gamma=\gamma_c$. The bifurcation boundary between Regimes I and II, and between III and IV cannot be detected by Turing analysis. Given that numerical simulations have shown that the PDE produces the same behavior (Fig.~\ref{fig:sim_champ2}(a)) in both Regimes III and IV, it is possible that these are not distinct regimes for the PDE. Overall, the LPA diagram (a) can be seen as a vertical slice of the Turing diagram (b) at $\delta=0$, with additional bifurcation boundaries that separates the LPA-stable and LPA-polarizable regimes.} \label{fig:lpa_turing_comparison} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\textwidth]{sim/turing_zoom/turing_zoom2.png} \caption{Simulations for the non-conservative model with random initial conditions $u=u_* (1+\mbox{Unif}(-0.01,+0.01)), v=v_*$ with default parameters from Table~\ref{tab:parameters}(NC) except $\gamma=25$. The color range is chosen so that the precursor pattern is more visible. The rapid transition from the shallower, higher frequency precursor pattern to the final pattern can be clearly seen.} \label{fig:turing_zoom} \end{figure} \section{Appendix: Methods} Bifurcation plots were produced with XPPAUT \cite{xppaut,auto} and Matcont \cite{matcont}. PDEs in 1D were solved using finite difference methods with Crank–Nicolson time stepping in Matlab with $\Delta x= 0.005, \Delta t= 0.0002$. Plots were produced with Matlab. PDEs in fixed 2D domain were solved using the FEniCS \cite{fenics} package in Python, plots and movies produced by Paraview. The codes for both are published at \url{https://github.com/liuyue002/Wave-pinning-model}. \section{Appendix: Cellular Potts Model simulations} In the CPM, a biological cell is represented by a set of contiguous lattice site in 2D (or 3D) all assigned an index $\sigma$. (For a single cell, the index is 1 and the surrounding medium is given an index of 0.) Here we focused on a 2D CPM model cell, representing a top-down view of a ``biological cell'' attached to a flat surface. We use the classic Hamiltonian \begin{equation} H=\lambda_a(A-a)^2 +\lambda_p (P-p)^2 + J P. \label{eq:Hamiltonian} \end{equation} Here the three terms represent the energetic cost for change of area $A$ (cell contraction/expansion) away from the preferred ``rest area'' $a$, a cost for elongation or shortening of the cell perimeter $P$ away from a preferred ``rest perimeter'' $p$, and a term that describes an interfacial energy associated with the cell-medium interface. The weighting factors, $\lambda_a, \lambda_p, J$ are adjusted to set the relative importance of the various energy terms. The perimeter $P$ is approximated as in \cite{magno_cpm}. For each cell site, we calculate the number of lattice sites within a certain radius $r$ (here $r=3$) in contact with the medium Then we take the sum over all boundary sites and rescale by $\xi(r)$ (here $\xi(r)=18$) to obtain a perimeter approximation: \begin{equation} P = \frac{1}{\xi(r)} \sum_{x : \sigma(x)=1} \; \; \; \sum_{y : \lbrace |x-y|^2<r^2 \wedge \sigma(y)=0 \rbrace } 1 \end{equation} At each Monte Carlo Step (MCS) in the simulation, points along the cell edge may protrude or retract with some probability. Formally, this is achieved by $N$ so-called ``copy attempts''. A copy attempt consists of selecting a random site (``source'') on the lattice and copying the index into a random neighbouring site (``target'') from its Moore neighbourhood. The change/copy is accepted with probability \begin{equation} P(\Delta H)= \begin{cases} 1 & \textrm{if}\;\Delta H + H_0 <0, \\ e^{-(\Delta H+ H_0)/T} & \textrm{if}\;\Delta H + H_0\geq 0. \end{cases} \label{eq:boltzmann} \end{equation} Here $T\geq 0$ is denoted a cellular ``temperature'' and sets the intensity of random edge fluctuations. $H_0$ is a yield energy (force) to be overcome. We start with a circular cell (12000 pixels). Assigning a nondimensional size $\Delta x = 0.005$ to each pixel implies that cell area is 0.3. We rescaled the parameters $\eta,k,\gamma,\alpha,\theta,k_n,k_s$ with $L^2$, where $L=10$. CPM parameters $a, p$ are in terms of pixels (see figure captions). The initial conditions are $v=2.5, u=0$ and $F=0$ everywhere. We introduce a randomly placed circular spot (radius 3 pixels) of $u=5$ to represent an initial random burst of active GTPase. Then every 100 MCS we add another randomly placed spot of elevated GTPase $u += 15$ (higher than the initial burst to prevent decay) to depict stochastic bursts of GTPase activation in the cell. For the model without F-actin, we have slightly different initial GTPase fields: $v = 1.1113, u=0.3333$, except in the upper left corner of the cell, with an area of about 1/9 of the cell, we set $u = 0.5454$. After every MCS we solve the RD equations for 0.001s, using $dt=1e-6$, so 1000 iterations per MCS. Within a MCS, after every accepted membrane extension or retraction we update the GTPase fields as follows. After an extension we set $u$(target)=$u$(source) and subsequently rescale the level of $u$ throughout the cell to conserve mass. After retraction we set u(target)=0 and then u(target) is equally distributed throughout the whole cell. The same operations are carried out for $v$. For F-actin, we do the same but do not redistribute, i.e. $F$(target)=$F$(source) for extensions and $F$(target)=0 for retractions. \bibliographystyle{spbasic}
\section{Introduction} In the last decade, improvements in genomic, transcriptomic, and proteomic technologies have enabled personalized medicine (also called precision medicine) to become an essential part of contemporary medicine. Personalized medicine takes into account individual variability in genes, proteins, environment, and lifestyle to decide on optimal disease treatment and prevention~\cite{hamburg2010path}. The use of a patient's genetic and epigenetic information has already proven to be highly effective to tailor drug therapies or preventive care in a number of applications, such as breast cancer ~\cite{cho2012personalized}, prostate cancer~\cite{nam2007assessing}, ovarian cancer~\cite{hippisley2015development}, and pancreatic cancer~\cite{ogino2011cancer}, cardiovascular disease~\cite{ehret2011genetic}, cystic fibrosis~\cite{waters2018human}, and psychiatry~\cite{demkow2017genetic}. The subfield of pharmacogenomics studies specifically how genes affect a person's response to particular drugs to develop more efficient and safer medications~\cite{ziegler2012personalized}. Genomic, epigenomic, and transcriptomic data used in precision medicine, such as gene expression, copy number variants, or methylation levels are typically high-dimensional with a number of variables that rivals or exceeds the number of observations. Using such data to estimate and predict treatment response or risk of complications, therefore, requires regularization typically by the $\ell_1$ norm (lasso), the $\ell_2$ norm (ridge), or other terms. Ridge regression~\cite{hoerl1970ridge} yields good predictive performance for dense or non-sparse effects, that is, for outcomes related to systemic conditions, as the method does not perform variable selection. Ridge regression has become a standard tool for prediction based on genomic data, and it has been shown that ridge regression can outmatch competing prediction methods for survival based on gene expression~\cite{bovelstad2007predicting,cule2013ridge}. However, regularization always introduces one or more tuning parameters. These tuning parameters are usually calibrated based on the averaged prediction risks. Most commonly used, $K$-fold cross-validation (CV) divides the data into $K$~folds (typically $K \in \{5, 10 \}$), predicts each fold out-of-sample, averages over all folds for a range of tuning parameters, and selects the value with the lowest averaged error~\cite{stone1974cross,golub1979generalized}. But the averaging removes the inherent individual heterogeneity of the patients and can, therefore, result in sub-optimal prediction performance. This may ultimately lead to unsuitable treatment, administration of improper medication with adverse side effects, or lack of preventive care~\cite{hamburg2010path}. Hence, rather than minimizing an averaged prediction error, our goal is to minimize each patient's individual (``personalized'') prediction error. A na\"ive two-stage personalized procedure for ridge regression was recently proposed by~\cite{hellton2018fridge}. In this paper, we introduce an alternative ridge estimator, referred to as euclidean distance ridge (\ensuremath{\operatorname{edr}}), and calibrate the tuning parameter using adaptive validation~\cite{lepskii_1992, spokoiny_mammen_lepski_1997} \textit{individually} for each patient. We show that this approach offers compelling theor , fast computation , and accurate prediction on data. The specific motivation for our method is to unravel the relationship between gene expression and weight gain in kidney transplant recipients~\cite{cashion2013expression}. Kidney transplant recipients are known to often gain substantial weight during the first year after transplantation, which can result in adverse health effects~\cite{patel1998effect}. Individual predictions of this weight gain based on the genetic data could help in providing each patient with the best possible care. The remainder of this paper is organized as follows: We introduce the linear regression framework and the problem statement in Section~\ref{sec:ProblemSetup}. We then introduce the main methodology of our approach, and present theoretical guarantees in Section~\ref{sec:Methodology}. In addition, we discuss the algorithm and analyze its performance through simulation studies using synthetic and real data in Section~\ref{sec:Algorithm}. We further apply our pipeline to kidney transplant data in Section~\ref{sec:Application}. Finally, we discuss the results in Section~\ref{sec:Conclusion} and we defer all proofs to the Appendix. All data are publicly available and our code is available at \url{https://github.com/LedererLab/personalized_medicine}. \section{Problem Setup} \label{sec:ProblemSetup} We consider data ($\ensuremath{\boldsymbol{y}}, \ensuremath{\boldsymbol{X}}$) that follows a linear regression model \begin{equation} \label{eq:LinearModel} \ensuremath{\boldsymbol{y}} = \ensuremath{\boldsymbol{X}}\ensuremath{\boldsymbol{\beta}^{*}} + \ensuremath{\boldsymbol{u}}. \end{equation} Let $p$ denote the number of parameters, e.g.\ genes or genetic probes, and $n$ the number of samples or patients, then $\ensuremath{\boldsymbol{y}} \in \real{n}$ is the vector of outcomes, $y_i$, for example, a person’s response to treatment. We let~$\ensuremath{\boldsymbol{X}}$ denote the design matrix, where each row $\mathbf{x}_i\in\real{p}$, $i\in\{1,\dots n\}$, contains the genome information of the corresponding person. Each element~$\beta^*_j$, $j\in\{1,\dots p\}$, of the regression vector~$\ensuremath{\boldsymbol{\beta}^{*}}\in\real{p}$ models the gene's influence on the person's response. We ensure the uniqueness of~$\ensuremath{\boldsymbol{\beta}^{*}}$ by assuming that it is a projection onto the linear space generated by the~$n$ rows of~$\ensuremath{\boldsymbol{X}}$~\cite{Shao2012,Buhlmann2013}. For the random error vector ~$\ensuremath{\boldsymbol{u}} \in \real{n}$, we make no assumptions on the probability distribution. Our goal is to estimate the regression vector~$\ensuremath{\boldsymbol{\beta}^{*}}$ from data~$(\ensuremath{\boldsymbol{y}},\ensuremath{\boldsymbol{X}})$, or in terms of our application, predicting a person's treatment response based on that person's genome information. Mathematically, this amounts to estimating $\ensuremath{\boldsymbol{z}}^\top\ensuremath{\boldsymbol{\beta}^{*}}$ in terms of the personalized prediction error \begin{equation} \label{eq:SingleError} \bigl|\ensuremath{\boldsymbol{z}}^{\top}(\ensuremath{\boldsymbol{\beta}^{*}}-\ensuremath{\boldsymbol{\hat{\beta}}})\bigr|, \end{equation} where $\ensuremath{\boldsymbol{z}} \in \real{p}$ is the person's genome information. Since the data in precision medicine is typically high-dimensional, that is, the number of parameters (genes)~$p$ exceeds the number of samples (patients)~$n$, we consider regularized least-squares estimators of the form \begin{equation} \label{eq:RegularizedLeastSquare} \regularizedestimator{}{\ensuremath{r}} \in \argmin_{\ensuremath{\boldsymbol{\beta}} \in \real{p}} \bigg\{ \normtwo{\ensuremath{\boldsymbol{y}} - \ensuremath{\boldsymbol{X}}\ensuremath{\boldsymbol{\beta}}}^{2} + \ensuremath{r} \cdot f[\ensuremath{\boldsymbol{\beta}}] \bigg\}. \end{equation} Here, $f$ denotes a function that takes into account prior information, such as sparsity or smaller regression coefficients, and the tuning parameter~$r \geq 0$ balances the least-squares term and the prior term. Given an estimator~\eqref{eq:RegularizedLeastSquare}, the main challenge is to find a good tuning parameter in line with our statistical goal. This means that we want to mimic the tuning parameter \begin{equation*} \label{eq:OptimalTunningParameter} \ensuremath{r^{*}} := \argmin_{\ensuremath{r} \in \ensuremath{\mathcal{R}}} \Bigl| \ensuremath{\boldsymbol{z}}^{\top}(\ensuremath{\boldsymbol{\beta}^{*}}-\regularizedestimator{}{\ensuremath{r}})\Bigr|, \end{equation*} which is the optimal tuning parameter in a given set of candidate parameters $\mathcal{R} :=\{ \ensuremath{r}_{1}, \ensuremath{r}_{2},\dots ,\ensuremath{r}_{m}\}$. The optimal tuning parameter~$\ensuremath{r^{*}}$ depends on the family of estimators~\eqref{eq:RegularizedLeastSquare}, the unknown noise~$\ensuremath{\boldsymbol{u}}$, and the patient's genome information~$\ensuremath{\boldsymbol{z}}$. The dependence on~$\ensuremath{\boldsymbol{z}}$ is integral to personalized medicine: different patients can respond very differently to the same treatment. But standard tuning parameter calibration such as CV schemes do not take this personalization into account but instead attempt to minimize the averaged prediction error $\normtwo{\ensuremath{\boldsymbol{X}}\ensuremath{\boldsymbol{\beta}^{*}}-\ensuremath{\boldsymbol{X}}\regularizedestimator{}{\ensuremath{r}}}^2/n$ rather than the personalized prediction error $\abs{\ensuremath{\boldsymbol{z}}^{\top}(\ensuremath{\boldsymbol{\beta}^{*}}-\regularizedestimator{}{\ensuremath{r}})}$. We, therefore, develop a new prediction pipeline, that is tailored to the personalized prediction error and equip our methods with fast algorithms and sharp guarantees. \section{Methodology} \label{sec:Methodology} In this section, we introduce an alternative version of the ridge estimator~\cite{hoerl1970ridge} along with a calibration scheme tailored to personalized medicine. Two distinct features of the pipeline are its finite-sample bounds and its computational efficiency. Our estimator is called \emph{euclidean distance ridge} (\emph{$\ensuremath{\operatorname{edr}}$}) and is defined as \begin{equation} \label{eq:SPR} \regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{r}} \: \in \: \argmin_{\ensuremath{\boldsymbol{\beta}} \in \real{p}} \bigg\{\normtwo{\ensuremath{\boldsymbol{y}} - \ensuremath{\boldsymbol{X}}\ensuremath{\boldsymbol{\beta}}}^{2} + \ensuremath{r} \normtwo{\ensuremath{\boldsymbol{\beta}}}\bigg\}. \end{equation} The \ensuremath{\operatorname{edr}}\ replaces the ridge estimator's squared $\ell_2$ prior term $f_{\operatorname{ridge}}[\ensuremath{\boldsymbol{\beta}}]\equiv\normtwos{\ensuremath{\boldsymbol{\beta}}}$ by its square-root $f_{\ensuremath{\operatorname{edr}}}[\ensuremath{\boldsymbol{\beta}}]\equiv\sqrt{f_{\operatorname{ridge}}[\ensuremath{\boldsymbol{\beta}}]}\equiv\normtwo{\ensuremath{\boldsymbol{\beta}}}$. This modification allows us to derive finite-sample oracle inequalities that can be leveraged for tuning parameter calibration. At the same time, the $\ensuremath{\operatorname{edr}}$ preserves two of the ridge estimator's most attractive features: it can model the influences of many parameters, and it can be computed without the need for elaborate descent algorithms (see Section~\ref{sec:Algorithm}). Our first step is to establish finite-sample guarantees for the $\ensuremath{\operatorname{edr}}$. The key idea is that if the tuning parameter is large enough, the personalized prediction error~\eqref{eq:SingleError} is bounded by a multiple of the tuning parameter. For ease of presentation, we assume an orthonormal design, that is, $\ensuremath{\boldsymbol{X}}^{\top}\ensuremath{\boldsymbol{X}} = ~\ensuremath{\boldsymbol{I}}_{p \times p}$ and defer the discussion of correlated covariates to the Appendix~\ref{appendix:orthonormal}. However, simulations with more general designs are carried out in Section~\ref{sec:Algorithm}. We establish the following guarantee for \ensuremath{\operatorname{edr}}: \begin{lemma}[Oracle inequality for $\ensuremath{\operatorname{edr}}$] \label{lem:OracleSPR} If $\ensuremath{r}\geq 2\abs{(\ensuremath{\boldsymbol{X}}\ensuremath{\boldsymbol{z}})^\top\ensuremath{\boldsymbol{u}}}/(\corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}}\normtwo{\ensuremath{\boldsymbol{z}}})$, where \begin{equation*} \corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}} := \frac{\abs{\ensuremath{\boldsymbol{z}}^{\top}\regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{r}}}}{\normtwo{\ensuremath{\boldsymbol{z}}}\normtwo{\regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{r}}}} \quad\in[0,1], \end{equation*} then it holds for orthonormal design that \begin{equation*} \bigl|\ensuremath{\boldsymbol{z}}^{\top}(\ensuremath{\boldsymbol{\beta}^{*}} - \regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{r}})\bigr| \leq \corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}} \cdot \normtwo{\ensuremath{\boldsymbol{z}}} \:\cdot\: \ensuremath{r}. \end{equation*} \end{lemma} \noindent Such guarantees are usually called \emph{oracle inequalities}~\cite{lederer2019oracle}. The given oracle inequality is an ideal starting point for our pipeline, because it gives us a mathematical handle on the quality of tuning parameters: a good tuning parameter should be large enough to meet the stated condition and yet small enough to give a sharp bound. The original ridge estimator, however, lacks such inequalities for personalized prediction. Our proof techniques, which are based on the optimality conditions of the estimator, also yield a similar bound for the original ridge estimator: if $\ensuremath{t}\geq \abs{(\ensuremath{\boldsymbol{X}}\ensuremath{\boldsymbol{z}})^\top\ensuremath{\boldsymbol{u}}}/\normtwo{\ensuremath{\boldsymbol{z}}}$, then $\abs{\ensuremath{\boldsymbol{z}}^{\top}(\ensuremath{\boldsymbol{\beta}^{*}} - \regularizedestimator{\ensuremath{\operatorname{ridge}}}{\ensuremath{t}})}\leq \abs{ 1 + \ensuremath{\boldsymbol{z}}^{\top}\regularizedestimator{\ensuremath{\operatorname{ridge}}}{\ensuremath{t}} / \normtwo{\ensuremath{\boldsymbol{z}}}} \cdot \normtwo{\ensuremath{\boldsymbol{z}}} \cdot \ensuremath{t}$. The following pipeline can then be applied the same way as for the \ensuremath{\operatorname{edr}}. But the crucial advantage of the \ensuremath{\operatorname{edr}}'s bound is that its right-hand side is bounded by $\normtwo{\ensuremath{\boldsymbol{z}}} \:\cdot\: \ensuremath{r}$, which ensures that the results do not scale with~\ensuremath{\boldsymbol{\beta}^{*}}. The factor $\corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}}$ can be interpreted as the absolute value of the correlation between the person's genome information~$\ensuremath{\boldsymbol{z}}$ and the estimator~$\regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{r}}$. This factor, and therefore~\ensuremath{\boldsymbol{z}}, are included in our calibration scheme below, and our pipeline, hence, optimizes the prediction for particular study subjects. Lemma~\ref{lem:OracleSPR} bounds the personalized prediction error of $\ensuremath{\operatorname{edr}}$ as a function of the tuning parameter~\ensuremath{r}. Given~\ensuremath{\boldsymbol{z}}, the best tuning parameter in terms of the bound minimizes $\corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}}\cdot\ensuremath{r}$ over all tuning parameters, that satisfy the lower bound \begin{equation*} \ensuremath{r}\geq \frac{2\abs{(\ensuremath{\boldsymbol{X}}\ensuremath{\boldsymbol{z}})^\top\ensuremath{\boldsymbol{u}}}}{\corr{z}{r}\normtwo{\ensuremath{\boldsymbol{z}}}}. \end{equation*} This tuning parameter value, which we call the oracle tuning parameter, can be interpreted as the closest theoretical mimic of the optimal tuning parameter~\ensuremath{r^{*}}. \begin{definition}[Oracle tuning parameter for personalized prediction] \label{def:OracleTuning} Given a new person's genome information \ensuremath{\boldsymbol{z}}, the oracle tuning parameter for personalized prediction in a candidate set \ensuremath{\mathcal{R}}\ is given by \begin{equation*} \ensuremath{{\tuning_{\vspace{-0.3mm}o}}} \: \in \: \argmin_{\ensuremath{r}\in \bar{\ensuremath{\mathcal{R}}}} \biggl\{ \corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}} \cdot\ensuremath{r} \biggr\}, \text{ where } \overline{\ensuremath{\mathcal{R}}} := \biggl\{ \ensuremath{r} \in \ensuremath{\mathcal{R}} : \ensuremath{r}\geq\frac{2\abs{(\ensuremath{\boldsymbol{X}}\ensuremath{\boldsymbol{z}})^\top\ensuremath{\boldsymbol{u}}}}{\corr{z}{r}\normtwo{\ensuremath{\boldsymbol{z}}}}\biggr\}. \end{equation*} \end{definition} \noindent The oracle tuning parameter~\ensuremath{{\tuning_{\vspace{-0.3mm}o}}}\ is the best approximation of the optimal tuning parameter~$\ensuremath{r^{*}}$ in view of the mathematical theory expressed by Lemma~\ref{lem:OracleSPR}. In practice, however, one does not know the target~\ensuremath{\boldsymbol{\beta}^{*}}\ nor the noise~$\ensuremath{\boldsymbol{u}}$ (typically not even its distribution), such that neither~\ensuremath{r^{*}}\ nor \ensuremath{{\tuning_{\vspace{-0.3mm}o}}}\ are accessible. In the following our goal is, consequently, to match the prediction accuracy of~\ensuremath{{\tuning_{\vspace{-0.3mm}o}}}\ (and, therefore, of~\ensuremath{r^{*}}\ essentially) with a completely data-driven scheme. Our proposal is based on pairwise tests along the tuning parameter path: \begin{definition}[$\ensuremath{\operatorname{PAV_{\nameedr}}}$ : Personalized adaptive validation for $\ensuremath{\operatorname{edr}}$] \label{def:AV} We select a tuning parameter~\ensuremath{\hat{\tuning}}\ by \begin{equation} \label{eq:PAVedrTuning} \ensuremath{\hat{\tuning}} \: \in \: \argmin_{\ensuremath{r}\in\ensuremath{\tuningset_{A}}} \bigg\{ \corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}} \cdot\ensuremath{r} \cdot \normtwo{\ensuremath{\boldsymbol{z}}} \bigg\}, \end{equation} where the set of admissible tuning parameters is \begin{equation*} \begin{split} \ensuremath{\tuningset_{A}} := \Bigg\{ \ensuremath{r} \in \ensuremath{\mathcal{R}} \, \bigg| \, \max_{\substack{\ensuremath{\tuning^{\prime}},\ensuremath{\tuning^{\prime\prime}}\in\ensuremath{\mathcal{R}} \\ \ensuremath{\tuning^{\prime}},\ensuremath{\tuning^{\prime\prime}}\geq\ensuremath{r}}} \bigg[ & \abs{\ensuremath{\boldsymbol{z}}^{\top}(\regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{\tuning^{\prime}}} - \regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{\tuning^{\prime\prime}}})} \\ &- (\corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{\tuning^{\prime}}} \cdot\ensuremath{\tuning^{\prime}} + \corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{\tuning^{\prime\prime}}} \cdot\ensuremath{\tuning^{\prime\prime}})\normtwo{\ensuremath{\boldsymbol{z}}} \: \leq 0 \bigg] \Bigg\}. \end{split} \end{equation*} \end{definition} \noindent The idea of using pairwise tests for tuning parameter calibration in high-dimensional statistics has been introduced by~\cite{Chichignoud2016} under the name \emph{adaptive validation}. A difference here is that the factors $\corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}}\cdot\ensuremath{r}$ are not constant but depend both on~\ensuremath{r}\ and~\ensuremath{\boldsymbol{z}}. The dependence on~\ensuremath{\boldsymbol{z}}\ in particular reflects our focus on \emph{personalized} prediction. The following result guarantees that the data-driven choice $\ensuremath{\hat{\tuning}}$ indeed provides---up to a constant factor 3---the same performance as the oracle tuning parameter~\ensuremath{{\tuning_{\vspace{-0.3mm}o}}}. \begin{thm}[Optimality for personalized adaptive validation for \ensuremath{\operatorname{edr}}] \label{thm:optimality} Under the conditions of Lemma~\ref{lem:OracleSPR}, it holds that \begin{equation*} \abs{\ensuremath{\boldsymbol{z}}^{\top}(\ensuremath{\boldsymbol{\beta}^{*}}-\regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{\hat{\tuning}}})} \leq 3 \: \corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{{\tuning_{\vspace{-0.3mm}o}}}}\cdot \normtwo{\ensuremath{\boldsymbol{z}}} \:\cdot\: \ensuremath{{\tuning_{\vspace{-0.3mm}o}}}. \end{equation*} \end{thm} \noindent This result guarantees that our calibration pipeline selects an essentially optimal tuning parameter from any grid~\ensuremath{\mathcal{R}}. Our pipeline is the only method for tuning parameter selection in personalized medicine that is equipped with such finite-sample guarantees. It does, moreover, not require any knowledge about the regression vector~\ensuremath{\boldsymbol{\beta}^{*}}\ nor the noise~$\ensuremath{\boldsymbol{u}}$. Our calibration method is fully adaptive to the noise distribution; however, it is instructive to exemplify our main result by considering Gaussian noise (see Appendix~\ref{example:gaussian} for the detailed derivations): \begin{example}[Gaussian noise] \label{ex:OracleNormalSPR} Suppose orthonormal design and Gaussian random noise $\ensuremath{\boldsymbol{u}}\sim \mathcal{N}_{n}[0_{n},\sigma^{2}\ensuremath{\boldsymbol{I}}_{n \times n}/n]$. For any $\ensuremath{\delta} \in (0,1)$, it holds with probability at least $1-\ensuremath{\delta}$ that \begin{equation*} \bigl|\ensuremath{\boldsymbol{z}}^{\top}(\ensuremath{\boldsymbol{\beta}^{*}}-\regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{\hat{\tuning}}})\bigr| \leq 3 \sigma \sqrt{\frac{8\log({2}/{\ensuremath{\delta}})}{n}}\normtwo{\ensuremath{\boldsymbol{z}}}. \end{equation*} The bound provides the usual parametric rate~$\sigma/\sqrt{n} $ in the number of samples~$n$; the factor~$\normtwo{\ensuremath{\boldsymbol{z}}}$ entails the dependence on the number of parameters~$p$. \end{example} \section{Algorithm and Numerical Analysis} \label{sec:Algorithm} One of the main features of our pipeline is its efficient implementation. This implementation exploits a fundamental property of our estimator: there is a one-to-one correspondence between the \ensuremath{\operatorname{edr}}\ and the ridge estimator via the tuning parameters. \subsection{Connections to the ridge estimator} The ridge estimator is the $\ell_2^2$-regularized least-squares estimator~\cite{hoerl1970ridge} \begin{equation} \label{eq:RidgeRegression} \regularizedestimator{\ensuremath{\operatorname{ridge}}}{\ensuremath{t}} \in \argmin_{\ensuremath{\boldsymbol{\beta}} \in \real{p}} \biggl\{\normtwo{\ensuremath{\boldsymbol{y}}-\ensuremath{\boldsymbol{X}}\ensuremath{\boldsymbol{\beta}}}^{2} + \ensuremath{t} \normtwo{\ensuremath{\boldsymbol{\beta}}}^{2}\biggr\}, \end{equation} where $\ensuremath{t}>0$ is a tuning parameter. Its computational efficiency, which is due to its closed-form expression, provides a basis for the computation of our \ensuremath{\operatorname{edr}}\ estimator. The closed-form of the ridge estimator can be derived from the Karush-Kuhn-Tucker (KKT) conditions as \begin{equation} \label{eq:RidgeEstimator} \regularizedestimator{\ensuremath{\operatorname{ridge}}}{\ensuremath{t}}=(\ensuremath{\boldsymbol{X}}^{\top}\ensuremath{\boldsymbol{X}}+\ensuremath{t}\ensuremath{\boldsymbol{I}}_{p \times p})^{-1}\ensuremath{\boldsymbol{X}}^{\top}\ensuremath{\boldsymbol{y}}, \end{equation} noting that the matrix $(\ensuremath{\boldsymbol{X}}^{\top}\ensuremath{\boldsymbol{X}}+\ensuremath{t}\ensuremath{\boldsymbol{I}}_{p \times p})$ is always invertible if $\ensuremath{t}>0$. However, the inversion of the matrix $\ensuremath{\boldsymbol{X}}^{\top}\ensuremath{\boldsymbol{X}}+\ensuremath{t}\ensuremath{\boldsymbol{I}}_{p \times p}$ still deserves some thought: first, the matrix might be ill-conditioned, and second, the matrix needs to be computed for a range of tuning parameters rather than only for a single one. A standard approach to these two challenges is a singular value decomposition (svd) of the design matrix~\ensuremath{\boldsymbol{X}}. \begin{lemma}[Computation of the ridge estimator through singular value decomposition] \label{lem:SVD} Let a singular value decomposition of \ensuremath{\boldsymbol{X}}\ be given by $\ensuremath{\boldsymbol{X}} = \ensuremath{\boldsymbol{U}} \ensuremath{\boldsymbol{D}}\ensuremath{\boldsymbol{V}}^{\top}$, where $\ensuremath{\boldsymbol{U}}\in\real{n \times n}$ and $\ensuremath{\boldsymbol{V}}\in\real{p \times p}$ are orthonormal matrices, and $\ensuremath{\boldsymbol{D}} = \operatorname{diag}(\ensuremath{d}_{1}, \ensuremath{d}_{2}, . . . , \ensuremath{d}_{p})$ is an $n \times p$ diagonal matrix of the corresponding {\em singular values} $d_{1}, d_{2}, . . . , d_{p}$. Then, the ridge estimator can be computed as \begin{equation} \label{eq:RidgeBySVD} \regularizedestimator{\ensuremath{\operatorname{ridge}}}{\ensuremath{t}} = \ensuremath{\boldsymbol{V}}\ensuremath{\boldsymbol{D^{\dagger}}}\ensuremath{\boldsymbol{U}}^{\top}\ensuremath{\boldsymbol{y}}, \end{equation} where $\ensuremath{\boldsymbol{D^{\dagger}}} \in \real{p \times n}$ is diagonal with $\ensuremath{\boldsymbol{D^{\dagger}}} = \operatorname{diag}(\ensuremath{d}_{1}/(\ensuremath{d}_{1}^{2}+\ensuremath{t}), ... , \ensuremath{d}_{p}/(\ensuremath{d}_{p}^{2}+\ensuremath{t}))$. \end{lemma} \noindent The singular value decomposition of the design matrix does not depend on the tuning parameter; therefore, the ridge estimators \regularizedestimator{\ensuremath{\operatorname{ridge}}}{\ensuremath{t}}\ can be readily computed for multiple tuning parameters just by substituting the value of \ensuremath{t}\ in~\ensuremath{\boldsymbol{D^{\dagger}}}. The resulting set of ridge ($\ensuremath{\operatorname{edr}}$) estimators for a set of tuning parameters \ensuremath{\mathcal{T}}\ is called the ridge ($\ensuremath{\operatorname{edr}}$) path for \ensuremath{\mathcal{T}}. Now, the crucial result is that the ridge estimator and the \ensuremath{\operatorname{edr}}\ are computational siblings. \begin{thm}[One-to-one mapping between tuning parameters] \label{thm:TuningRelation} The one-to-one mapping $\tuningmapping{\ensuremath{t}}\, : \, \ensuremath{t} \mapsto \ensuremath{r}$ defined by \begin{equation} \label{eq:TuningMapping} \ensuremath{r} = \tuningmapping{\ensuremath{t}} : = \normtwo{2\ensuremath{\boldsymbol{X}}^{\top}(\ensuremath{\boldsymbol{y}}-\ensuremath{\boldsymbol{X}}\regularizedestimator{\ensuremath{\operatorname{ridge}}}{\ensuremath{t}})} \end{equation} transforms tuning parameters~\ensuremath{t}\ of the ridge estimator to tuning parameters~\ensuremath{r}\ of the \ensuremath{\operatorname{edr}}\ estimator such that $\regularizedestimator{\ensuremath{\operatorname{ridge}}}{\ensuremath{t}}=\regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{r}}$. \end{thm} \noindent This mapping transforms, in particular, the optimal tuning parameter of the ridge\ estimator to a corresponding optimal tuning parameter of the \ensuremath{\operatorname{edr}}\ estimator. More generally, it allows us to compute the $\ensuremath{\operatorname{edr}}$ estimator via the ridge estimator---see below. \subsection{Algorithm} \label{subsec:Algorithm} The core idea of our proposed algorithm is to exploit the above one-to-one mapping between \ensuremath{\operatorname{edr}}\ estimator and ridge\ estimator. This correspondence allows us to compute $\ensuremath{\operatorname{edr}}$ solution paths efficiently via the ridge's explicit formulation and svd. First, consider a set of ridge\ tuning parameters \ensuremath{\mathcal{T}}\ and its corresponding set of \ensuremath{\operatorname{edr}}\ tuning parameters given by \begin{equation*} \label{eq:TransformedTuningSet} \ensuremath{\tuningset_\phi}:=\biggl\{\ensuremath{r}\in\real{}:\>r=\tuningmapping{\ensuremath{t}},\,\ensuremath{t}\in\ensuremath{\mathcal{T}}\biggr\} \end{equation*} with cardinality $m:=|\ensuremath{\tuningset_\phi}|$. This set contains, in particular, the tuning parameter~$\ensuremath{\hat{\tuning}}$, whose optimality is guaranteed under Theorem~\ref{thm:optimality}. To compute the tuning parameter~$\ensuremath{\hat{\tuning}}$, given data~\ensuremath{\boldsymbol{z}}, we first order the elements $r_1,r_2,\dots,r_m$ of~\ensuremath{\tuningset_\phi}\ such that \begin{equation} \label{eq:TuningSorting} \corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}_{1}} \cdot\ensuremath{r}_{1} \le \corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}_2}\cdot\ensuremath{r}_2 \le \dots \le \corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}_{m}} \cdot\ensuremath{r}_{m}. \end{equation} The $\ensuremath{\operatorname{PAV_{\nameedr}}}$ method can then be formulated in terms of the binary random variables \begin{equation*} \ensuremath{\hat{s}}_{\ensuremath{r}_{i}} := \prod_{j=i}^{m}\mathbbm{1} \Bigg\{ \abs{\ensuremath{\boldsymbol{z}}^{\top}(\regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{r}_{i}} - \regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{r}_{j}})} - \Bigl(\corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}_{i}} \cdot\ensuremath{r}_{i} + \corr{\ensuremath{\boldsymbol{z}}}{\ensuremath{r}_{j}} \cdot\ensuremath{r}_{j}\Bigr)\normtwo{\ensuremath{\boldsymbol{z}}} \: \leq \, 0 \Bigg\} \end{equation*} for $i \in \{1,\dots,m\}$, and an algorithm is as follows: \begin{algorithm}[H] \label{alg:PAVEDR} \SetAlgoLined \textbf{Input}: $\bigl(\ensuremath{r}_{i}\bigr)_{i=1,\dots,m}, \bigl(\regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{r}_{i}}\bigr)_{i=1,\dots,m}, \ensuremath{\boldsymbol{z}} $ \textbf{Result}: $\ensuremath{\hat{\tuning}}$ \vspace{1ex} Set initial index: $i\gets m$ \While{$\ensuremath{\hat{s}}_{\ensuremath{r}_{i}} \neq 0$ and $i > 1$}{ Update index: $i\gets i-1$ } Set output: $\ensuremath{\hat{\tuning}} \gets \ensuremath{r}_{i}$ \vspace{1em} \caption{Algorithm for $\ensuremath{\operatorname{PAV_{\nameedr}}}$ of Definition~\ref{def:AV}.} \end{algorithm \noindent The full pipeline can be summarized by the following four steps: \begin{enumerate}[leftmargin=1.8cm] \item[\textit{Step 1:}] Generate a set \ensuremath{\mathcal{T}}\ of tuning parameters for ridge regression. \item[\textit{Step 2:}] Compute the ridge solution path with respect to \ensuremath{\mathcal{T}}\ by using~\eqref{eq:RidgeBySVD}. \item[\textit{Step 3:}] Transform the ridge tuning parameters to their \ensuremath{\operatorname{edr}}\ counterparts \ensuremath{\tuningset_\phi}\ using~\eqref{eq:TuningMapping} and sort the tuning parameters according to~\eqref{eq:TuningSorting}. \item[\textit{Step 4:}] Use the \ensuremath{\operatorname{PAV_{\nameedr}}}\ method (Algorithm~\ref{alg:PAVEDR}) to compute the tuning parameter~\ensuremath{\hat{\tuning}}\ and map it back to its ridge counterpart \ensuremath{\hat{\ridgetuning}}. \end{enumerate} The algorithm can be readily implemented and is fast: it essentially only requires the computation of one ridge solution path (a single svd). In strong contrast, $K$-fold CV requires the computation of $K$ ridge solution paths. Consequently, the ridge estimator with \ensuremath{\operatorname{PAV_{\nameedr}}}\ can be computed approximately $K$~times faster than with $K$-fold CV, which we will confirm in the simulations. Moreover, CV still requires a tuning parameter, namely, the number of folds~$K$, while \ensuremath{\operatorname{PAV_{\nameedr}}}\ is completely parameter-free. \subsection{Simulation Study} \label{subsec:SimulationStudy} We evaluate the prediction performance of the \ensuremath{\operatorname{PAV_{\nameedr}}}\ method using (1) fully simulated data with random design and (2) a real data set with a simulated outcome. The results are compared to $K$-fold CV, which is a standard reference method. The first setting is solely based on simulated data. The dimensions of the design matrix are $(n,p) \in \{ (50,100), (150,250), (200,500) \}$. First, the entries of the design matrix~$\ensuremath{\boldsymbol{X}}$ are sampled i.i.d.\@ from~$\normalDist{\mu}{1}$, where the mean itself is sampled according to $\mu\sim\normalDist{0}{10}$, and the columns of the design matrix are then normalized to have Euclidean norm equal to one. The entries of the regression vector~\ensuremath{\boldsymbol{\beta}^{*}}\ are sample i.i.d.\@ from $\normalDist{0}{1}$ and then projected onto the row space of \ensuremath{\boldsymbol{X}}\ to ensure identifiability~\cite{Shao2012,Buhlmann2013}. The entries of the noise vector~$\ensuremath{\boldsymbol{u}}$ are sampled i.i.d.\@ from $\normalDist{0}{\sigma^2}$, where $\sigma^2 = 2 \variance{\ensuremath{\boldsymbol{X}}\ensuremath{\boldsymbol{\beta}^{*}}}$ to ensure a signal-to-noise ratio of 0.5. Then, $100$~data testing vectors~$\ensuremath{\boldsymbol{z}}$ are sampled i.i.d.\@ from $\mathcal{U}_p[-1,1]$. We generate a set of 300 tuning parameters $\ensuremath{\mathcal{T}} = \{10^q \>|\> q=-5 + 10i/299, \ i=0,\dots,299 \}$. \begin{table} \centering \caption{For the first simulation setting, which entirely consists of artificial data, \ensuremath{\operatorname{PAV_{\nameedr}}}\ outperforms $5$-fold and $10$-fold CV in accuracy and speed.} \label{table:simulationstudyRandom} \ra{1.2} \begin{tabular}{ccrr} \hline (n,p) & Method & Mean error (sd) & Scaled run time\\ \hline \multirow{3}{*}{(50,100)}& $\ensuremath{\operatorname{PAV_{\nameedr}}}$ & 166.78 \hphantom{0}(242.46) & 1.00\\ & 5-fold CV & 340.18 \hphantom{0}(888.28) & 1.57\\ & 10-fold CV & 474.58 (1220.44) & 3.64\\ \hline \multirow{3}{*}{(150,250)}& $\ensuremath{\operatorname{PAV_{\nameedr}}}$ & 433.50 \hphantom{0}(669.50) & 1.00\\ & 5-fold CV & 724.90 (1712.65) & 3.43\\ & 10-fold CV & 872.50 (2560.01) & 8.04\\ \hline \multirow{3}{*}{(200,500)}& $\ensuremath{\operatorname{PAV_{\nameedr}}}$ & 805.94 (1316.43) & 1.00\\ & 5-fold CV & 1098.68 (2821.35) & 3.65\\ & 10-fold CV & 1144.12 (2733.78) & 8.44\\ \hline \end{tabular} \end{table} The results are summarized in Table~\ref{table:simulationstudyRandom}. The mean personalized prediction errors for the testing vectors are averaged over 100 simulations as described above. The run time is shown relative to \ensuremath{\operatorname{PAV_{\nameedr}}}. We observe that in all considered cases, \ensuremath{\operatorname{PAV_{\nameedr}}}\ improves on CV both in terms of accuracy as well as in speed. A more detailed analysis of the scaled run time for CV relative to $\ensuremath{\operatorname{PAV_{\nameedr}}}$ is shown in Figure~\ref{fig:runtime}. We fix $n$ with increasing $p$ and vice versa. Observing that the gain in speed is less than the factor~$K$, because the computations of the ridge estimator are then fast enough to compete with the sorting of the bounds in \ensuremath{\operatorname{PAV_{\nameedr}}}. \begin{figure} \centering \includegraphics[width=0.49\textwidth]{runtime1.png} \hfill \includegraphics[width=0.49\textwidth]{runtime2.png} \caption[]{Run time of 10-fold CV scaled by the run time of \ensuremath{\operatorname{PAV_{\nameedr}}}\ for a fixed number of observations $n$ and fixed number of parameters $p$ with $p$ and $n$ increasing, respectively. We observe that $\ensuremath{\operatorname{PAV_{\nameedr}}}$ is faster than $10$-fold CV.} \label{fig:runtime} \end{figure} In the second setting, we simulate the outcome but based on real data as covariates. The basis is the genomic data from the application in Section~\ref{sec:Application} where the sample size or number of patient is~$n=26$. The number of covariates in the design matrix is restricted to the $p=1936$ gene probe targets identified as potentially influential by \cite{cashion2013expression}. The regression vector and the noise are then generated as in the first simulation setting above. The results are summarized in Table~\ref{table:simulationstudyKidney}. We observe again that \ensuremath{\operatorname{PAV_{\nameedr}}}\ improves on CV both in terms of accuracy as well as in speed. The results of this section demonstrate that \ensuremath{\operatorname{PAV_{\nameedr}}}\ is a contender on data, which confirms and complements our theoretical findings from before. \begin{table} \centering \caption{In the second simulation setting, which consists of real covariate data and simulated outcomes, \ensuremath{\operatorname{PAV_{\nameedr}}}\ outperforms $5$-fold and $10$-fold CV again both in accuracy and speed.} \label{table:simulationstudyKidney} \ra{1.2} \begin{tabular}{crr} \hline Method & Mean error (sd) & Scaled run time\\ \hline $\ensuremath{\operatorname{PAV_{\nameedr}}}$ & \hphantom{0}33.71 \hphantom{0}(34.73) & 1.00\\ 5-fold CV & 164.06 (120.06) & 4.02\\ 10-fold CV & 132.90 \hphantom{0}(97.31) & 9.58\\ \hline \end{tabular} \end{table} \section{Application to kidney transplant patient data} \label{sec:Application} Kidney transplant recipients are known to gain significant weight during the first year after transplantation, with a reported average increase of 12 kg~\cite{patel1998effect}. Such substantial weight gain over a relatively short time period gives an increased risk for several adverse health effects, such as cardiovascular disease, and may be detrimental for the overall outcome of the patient. The weight gain has been explained by the use of prescribed steroids which increase the appetite, but steroid-free protocols alone have not reduced the risk of obesity, suggesting alternative causes. Even though weight gain is fundamentally caused by a too high calorie intake relative to the energy expenditure, the heterogeneity in the individual response is substantial. Genetic variation has, therefore, been considered as a contributing factor, and several genes have been linked to obesity and weight gain~\cite{bauer2009obesity, cheung2010obesity}. \cite{cashion2013expression} investigated whether genomic data can be used to predict weight gain in kidney transplant recipients. This was done by measuring gene expression in subcutaneous adipose tissue which has an important role in appetite regulation and can easily be obtained from the patients during surgery. The patients' weight was recorded at the time of transplantation and at a 6-months follow-up visit, resulting in a relative weight difference. The adipose tissue samples were collected from 26 transplant patients at the time of surgery, and mRNA levels were measured to obtain the gene expression profiles for $28\,869$ gene probe targets using Affymetrix Human Gene 1.0 ST arrays\footnote{All data are publicly available in the EMBL-EBI ArrayExpress database (\url{www.ebi.ac.uk/arrayexpress}) under accession number E-GEOD-33070.}. The expression variability was further not associated with gender or race~\cite{cashion2013expression}. As excessive weight gain may have severe consequences for the patients, the goal is to predict the future weight increase based on the available gene expression profiles. If a large weight increase is predicted, additional measures such as diet restrictions or physiotherapy could be set into effect. \begin{table} \centering \caption{ In the kidney transplant data, regardless of in-sample or leave-one-out prediction, \ensuremath{\operatorname{PAV_{\nameedr}}}\ outperforms $5$-fold and $10$-fold CV again both in accuracy and speed. } \label{sx9x9s} \ra{1.2} \begin{subtable}{\textwidth} \centering \ra{1.2} \caption{In-sample prediction} \label{table:RealKidneyInSample} \begin{tabular}{crr} \hline Method & Mean error (sd) & Scaled run time\\ \hline $\ensuremath{\operatorname{PAV_{\nameedr}}}$ & 0.0049 (0.0121) & 1.00\\ 5-fold CV & 0.0646 (0.0540) & 1.19\\ 10-fold CV & 0.0666 (0.0584) & 3.04\\ \hline \end{tabular} \end{subtable \hfill \begin{subtable}{\textwidth} \centering \caption{Leave-one-out prediction} \label{table:RealKidneyLoocv} \begin{tabular}{crr} \hline Method & Mean error (sd) & Scaled run time\\ \hline $\ensuremath{\operatorname{PAV_{\nameedr}}}$ & 0.0622 (0.0309) & 1.00\\ 5-fold CV & 0.0672 (0.0415) & 1.10\\ 10-fold CV & 0.0678 (0.0475) & 2.82\\ \hline \end{tabular} \end{subtable} \end{table} We compare the performance of our method in predicting weight gain for the kidney transplant patients to the prediction of standard ridge regression calibrated by CV. In detail, we make predictions for each patient both in-sample and out-of-sample, leaving out the observation and using the remaining data to fit the penalized regression model and select the optimal tuning parameter. Since we do not know the true parameter $\boldsymbol{\beta^{*}}$, we can only examine the performance of our method and CV by comparing their estimation errors, which is defined by \begin{equation} \label{eq:KidneyError} |y_{i} - \mathbf{x}_i^{\top}\regularizedestimator{\ensuremath{\operatorname{edr}}}{\ensuremath{r}}|. \end{equation} \noindent As described in the previous section, the columns of the design matrix are normalized to have Euclidean norm one. Unlike in the Section \ref{subsec:SimulationStudy}, we here take all the $28\,869$ gene probes into consideration. The averaged results are summarized in Table~\ref{table:RealKidneyInSample} and Table~\ref{table:RealKidneyLoocv}. We observe that $\ensuremath{\operatorname{PAV_{\nameedr}}}$ clearly outperforms 5-fold and 10-fold CV for both in-sample and out-of-sample prediction of the kidney transplant data. For out-of-sample prediction, we observe an improvement of about $7.5\%$ in the estimation error and an improvement of $25.5\%$ in the standard deviation compared to 5-fold CV. These improvements, especially in standard deviation, reinforce the advantages of a personalized approach to tuning parameter calibration. \section{Conclusion} \label{sec:Conclusion} We have introduced a pipeline that calibrates ridge regression for personalized prediction. Its distinctive features are the finite sample guarantees (see Theorem~\ref{thm:optimality}) and the statistical and computational efficiency (see Tables~\ref{table:simulationstudyRandom} and~\ref{table:simulationstudyKidney}). These features are echoed when predicting the weight gain of kidney transplant patients (see Table~\ref{sx9x9s}). Hence, our pipeline can improve personalized prediction and, thereby, further the cause of personalized medicine. Despite our focus on personalized medicine, we also envision applications in other areas where individual heterogeneity is crucial for predictions. Two examples are item recommendation, predicting the rating of an item or product assigned by a specific user~\cite{guy2010social,rafailidis2014content}, and personalized marketing, delivering individualized product prices or messages to specific costumers~\cite{tang2013prediction}.
\section{\label{sec:level1}Introduction} In 1935, Einstein, Podolsky and Rosen (EPR) questioned the completeness of QM, by applying a criterion of LR to a pair of particles in a quantum state which Schr\"{o}dinger subsequently referred to as entangled~\cite{EPR,sch}. Locality means that two events cannot have any mutual physical influence if they are spacelike separated, that is, their spatial separation is larger than the distance the fastest physical signal, i.e. the light, can travel within the time difference between the two events. In 1964, Bell proposed the first BI satisfied by any local realistic theory while violated by QM~\cite{BI}. A more experimentally suitable version of BI, called Clauser-Horne-Shimony-Holt inequality~\cite{CHSHI}, was demonstrated to be violated in many experiments, including the ones closing the locality loophole~\cite{BIAspect,z1}, the detection loophole~\cite{d1,d2}, and both~\cite{BIfree1,free2,free3}. To close yet another loophole called measuring setting or freedom of choice loophole, observations of Milky Way stars~\cite{as,as2} and human choices~\cite{bigbell} have been employed. Great progress has been made in making use of quantum entanglement in quantum information science. With the conflict between LR and QM well established, it is important to identify which aspects of LR are the sources of the conflict. For this purpose, Leggett in 2003 proposed the LI, which is satisfied by CNR and is violated by QM~\cite{LI}. This means that even nonlocal realism, at least a subset, cannot avoid the conflict with QM, so the source of conflict seems to be more likely realism. In 2007, a version of LI was experimentally demonstrated to be violated by using polarizations of entangled photons generated in spontaneous parametric down conversion, first under an additional assumption of rotational invariance~\cite{LIExpNature}, then without this assumption~\cite{Paterek,Branciard}. LI violation was also demonstrated by using polarizations of photons from fibre-based source~\cite{Eisaman}, as well as the orbital angular momenta of photons~\cite{Romero}. Similar phenomena were observed in different degrees of freedom of single particles~\cite{Hasegawa,Cardano}. Various extended discussions have also been made~\cite{comment,Colbeck,Branciard2,Oh}. It is highly interesting to extend the investigations on BI and LI to particle physics, of which standard model (SM) is based on quantum field theory combining QM with special relativity, emphasizing causality and using local gauge principle to describe fundamental interactions. Massive and possibly unstable particles governed by strong and weak interactions and flying in relativistic velocities represent a new class beyond both photons and nonrelativistic particles governed merely by electromagnetism, and can still easily achieve spacelike separation. Besides, one might also wonder whether high energy particles, as excitations of quantum fields, may display nonlocal effects. In particle physics, entanglement, more often called EPR correlation, has been noted in pseudoscalar meson pairs since 1960s~\cite{1960s}. Various discussions were made on its rigorous verification~\cite{lot}, which was experimentally done in $K^0\bar{K}^0$ pairs produced in proton-antiproton annihilation~\cite{cern}, in $\phi$ resonance~\cite{kloe1,kloe2}, as well as in $B^0_d\bar{B}^0_d$ pairs produced in $\Upsilon (4S)$ resonance~\cite{go1,go2,bevan}. Entanglement is routinely used to tag mesons by identifying their entangled partners~\cite{kloe2,bevan,DT,Betad,Ablikim,detectionEfficience}. Moreover, entangled meson pairs are used in measuring various parameters~\cite{Ablikim,detectionEfficience,parameter}, and studying violations of discrete symmetries~\cite{bernaB,Bd,JDROtherReview}, including CP~\cite{lipkin89,dunietz,ImprovedCPV,bernaB,JDRxzz}, time reversal (T)~\cite{TViolation,TViolationD}, and CPT~\cite{bernabeucpt}. A possible scheme of teleporting mesons was also proposed~\cite{telep}. There exists similar entanglement in hyperon pairs generated from electron-positron annihilation, which was used recently to measure the phase between the amplitudes of the decays to different helicity states~\cite{bes3}. Many proposals had been made on BI test in entangled mesons~\cite{mesonbi,mesonbi2}, and in the analogous spin-entangled particles~\cite{toernqvist,privitera}. There had been an early experiment using entangled protons to test BI under a few additional assumptions~\cite{lamehi}. There was an experiment using entangled $B^0_d\bar{B}^0_d$ pairs to test BI, in which meson decay acts as effective measurement settings~\cite{go1}. However, it was not regarded as a genuine Bell test, because of the lack of active measurement~\cite{toernqvist,problemOfMeson,bevan}. Basically this is a manifestation of the loophole of measurement settings, for the following reason. One can envisage a local HV (LHV) theory in which HVs in the source of the particle pairs determine the times, modes and even products of the decays, and the information is carried by the particles, consequently the two particles are secretely correlated no matter how far away they are separated, rendering the violation of BI. Other approaches to BI using entangled high energy particles are difficult to realize, as the alternative bases of measurement are physically limited. In this paper, we extend CNR and LI to include the case that the measurement settings are not externally fixed, but determined by HV, therefore the above situation jeopardizing BI test in entangled mesons is allowed in CNR, and we propose LI test using entangled neutral $B_d$ mesons. From QM calculation of single particle decays, we identify the time-dependent effective measuring directions due to the decays, as counterparts of the directions of the polarizers measuring the photon polarizations. For different decay times, they all lie on a plane and a cone, respectively. For such effective measuring directions, whether it is externally fixed or emerge from averages of measurement outcomes over HV, we derive a new version of LI, which is violated by QM and entangled $B_d$ mesons. We calculate the measurable quantities characterizing the relative magnitude of the LI violation, and find their maxima to be about $2.7\%$. It turns out that the LI can only be violated when CP symmetry is violated indirectly, i.e. in the mass matrix. Our work establish the true randomness of particle decay, including its time, mode, and product. On the other hand, our new LI can also be tested in other systems such as photon polarizations. \section{Pseudoscalar Neutral Mesons \label{rev} } In QM, a neutral pseudoscalar meson $M$ can be regarded as living in a two-dimensional Hilbert space, with basis states $|M^0\rangle$ and $|\bar{M}^0\rangle$, which are flavor eigenstates and mutual CP conjugates, i.e. $CP|M^0\rangle = |\bar{M}^0\rangle$, $CP |\bar{M}^0\rangle = |M^0\rangle$. In this basis, the mass matrix is \begin{equation} H\equiv {\bf M}-\frac{i}{2}{\bf \Gamma }=\left( \begin{array}{cc} H_{00} & H_{0\bar{0}} \\ H_{\bar{0}0} & H_{\bar{0}\bar{0}} \end{array}\right), \end{equation} where $H_{00}\equiv \langle M^0|H|M^0\rangle$, $H_{0\bar{0}}\equiv \langle M^0|H|\bar{M}^0\rangle$, and so on. The eigenstates of $H$ are \begin{equation} \begin{split} &|M_1\rangle=\frac{1}{\sqrt{|p|^2+|q|^2}}[p|M^0\rangle + q|\bar{M}^0\rangle],\\ &|M_2\rangle=\frac{1}{\sqrt{|p|^2+|q|^2}}[p|M^0\rangle - q|\bar{M}^0\rangle], \end{split} \end{equation} with $p/q \equiv \sqrt{H_{\bar{0}0}/H_{0\bar{0}} }$. The corresponding eigenvalues are \begin{equation} \begin{split} \lambda _{1}&= m_{1}-\frac{i}{2}\Gamma _{1}=H_{00} +\sqrt{ H_{0\bar{0}}H_{\bar{0}0} },\\ \lambda _{2}&= m_{2}-\frac{i}{2}\Gamma _{2} =H_{00} - \sqrt{ H_{0\bar{0}}H_{\bar{0}0} }. \end{split} \end{equation} $H$ governs the evolution of the meson state \begin{equation}|\psi(t)\rangle = a(t) |M^0\rangle+ b(t) |\bar{M}^0\rangle, \end{equation} with \begin{equation} \left( \begin{array}{c} a(t) \\ b(t) \\ \end{array}\right) =U(t) \left( \begin{array}{c} a(0)\\ b(0) \\ \end{array} \right), \end{equation} where \begin{equation} U(t) = \exp(-iHt)= g_+(t)+g_-(t) \left( \begin{array}{cc} 0&p/q \\ q/p&0 \\ \end{array} \right), \end{equation} with $g_{\pm}(t) \equiv \frac{e^{-i\lambda _2 t} \pm e^{-i\lambda _1 t}}{2}$. This leads to the mixing phenomena. Especially, $M^0$ and $\bar{M}^0$ at $t=0$ evolve respectively to \begin{equation} \begin{split} &|M^0(t)\rangle= g_+(t)|M^0\rangle +\frac{q}{p}g_-(t)|\bar{M}^0\rangle,\\ &|\bar{M}^0(t)\rangle= \frac{p}{q}g_-(t)|M^0\rangle+g_+(t)|\bar{M}^0\rangle.\\ \end{split} \end{equation} For a meson in an arbitrary state, its decay to some final state $f$ indicates that there has been a projection or filtering to some basis state $|\phi\rangle$, which decays to $f$, $|\phi\rangle$ being~\cite{Bd} \begin{equation} |\phi\rangle = \frac{1}{\sqrt{|A_f|^2+ |\bar{A}_f|^2} } (\bar{A}_f^*|M^0\rangle+ A_f^*|\bar{M}^0\rangle), \label{phi} \end{equation} where $A_f=\langle f |W|M^0\rangle$ and $\bar{A}_f=\langle f |W|\bar{M}^0\rangle$ are, respectively, the amplitudes of the decays from $M^0$ and $\bar{M}^0$ to the final state $f$. $ W = \mathcal{U}H_w$, where $H_w$ being the weak decay Hamiltonian while $\mathcal{U}$ being the strong evolution operator and reducing to the identity if final state interactions are neglected. A pair of neutral mesons can be produced as $C=-1$ antisymmetric entangled state \begin{equation} |\Psi _- \rangle = \frac{1}{\sqrt{2}}\left(|M^0 \rangle |\bar{M}^0 \rangle - |\bar{M}^0 \rangle |M^0 \rangle \right), \end{equation} where in each term, the first and second basis states are those of mesons $a$ and $b$ respectively. Suppose this two-particle state evolves up to $t_a$, when meson $a$ decays to some final state $f_a$, indicating that there is a projection or filtering of $a$ to some basis state $|\phi\rangle_a$, which decays to $f_a$. $|\phi\rangle_a$ is $|\phi\rangle$ as given in (\ref{phi}) for meson a. The meson $b$ continues to evolve till it decays to some final state $f_b$ at $t_b$, indicating that there is a projection or filtering of $b$ to some basis state $|\phi\rangle_b$, which decays to $f_b$. $|\phi\rangle_b$ is $|\phi\rangle$ as given in (\ref{phi}) for meson b. The time evolution of the entangled state up to the projections can be described as $ P_bU_b(t_b-t_a)P_aU_b(t_a)U_a(t_a)|\Psi _-\rangle = P_bP_aU(t_b)U(t_a)|\Psi_-\rangle = P_b P_a|\Psi_-(t_a,t_b) \rangle$, where $P_a =|\phi\rangle_{aa} \langle \phi|$ and $P_b=|\phi\rangle_{bb} \langle \phi|$ are projection operators, and the commutativity between operators on $a$ and those on $b$ have been used. This justifies the usual use of a state vector with two time variables \begin{equation} \begin{split} &|\Psi _-(t_a,t_b)\rangle \equiv U(t_b)U(t_a)|\Psi_-\rangle \\ &= \frac{1}{\sqrt{2}}\left(|M^0(t_a)\rangle |\bar{M}^0(t_b)\rangle - |\bar{M}^0(t_a)\rangle |M^0(t_b)\rangle \right), \end{split} \label{eq.2.3} \end{equation} which means that the two mesons decay at $t_a$ and $t_b$, respectively. Specifically, we use neutral $B_d$ mesons, because of the advantage that $\Gamma_2 \approx \Gamma _1$, $q/p\approx e^{2i\beta}$, where $2\beta$ is a phase factor, $\beta$ is given as $\sin(2\beta)= 0.695$~\cite{PDG}. Then $M^0=B^0$, $\bar{M}^0=\bar{B}^0$, $M_1=B_L$, $M_2=B_H$, and $U(t)$ is simplified to \begin{equation} \begin{split} &U(t) =e^{-iMt-\frac{\Gamma}{2} t}\\ &\times \left( \cos\frac{x\Gamma t}{2}+i\sin \frac{x\Gamma t}{2} \left[ \cos(2\beta)\sigma ^x+\sin (2\beta)\sigma ^y\right]\right), \end{split} \label{bu} \end{equation} where $\sigma ^{i}$, $(i=x,y,z)$, are Pauli operators, $x \equiv (m_H-m_L)/\Gamma$, $M \equiv ( m_H+m_L)/2$ and $\Gamma \equiv (\Gamma_L+\Gamma_H)/2$, the subscripts following those of $B_H$ and $B_L$. In Bloch representation, $|B^0\rangle$, like the horizontally polarized state of a photon or the spin-up state of an electron, is represented as the vector $(0,0,1)$, while $|\bar{B}^0_d\rangle$, like the vertically polarized state of a photon or the spin-down state of an electron, is represented as the vector $(0,0,-1)$. They can be chosen as the ``measuring directions'' or bases of measurement. However, for a measurement following time evolution, it is more convenient to define an effective time-dependent basis or ``measuring direction''. A state of a two-state system can be parameterized as \begin{equation} |{\bf u} \rangle =e^{i\zeta} \left( \cos \frac{\theta_{\bf u}}{2}|0\rangle + e^{i\rho_{\bf u}} \sin \frac{\theta_{\bf u}}{2} |1\rangle\right), \label{eq.2.1} \end{equation} where $|0\rangle$ and $|1\rangle$ represent the basis states. We consider its time evolution that can be parameterized as \begin{equation} U(\theta _{\bf a},\rho _{\bf a})=\left(\cos\frac{\theta _{\bf a}}{2}-i\sin \frac{\theta _{\bf a}}{2}\left(\cos(\rho _{\bf a})\sigma ^x+\sin (\rho _{\bf a})\sigma ^y\right)\right), \label{eq.2.2} \end{equation} of which (\ref{bu}) is an example, multiplied by an additional decay factor $e^{-iMt-\frac{\Gamma}{2} t}$. Suppose that following the evolution $U(\theta _{\bf a},\rho _{\bf a})$, a signal is recorded as $\mathcal{A}=+1$ if $|0\rangle$ is detected, while $\mathcal{A}=-1$ if $|1\rangle$ is detected. The QM expectation value of $\mathcal{A}$ is \begin{equation} \begin{split} &\bar{\mathcal{A}}({\bf u})=\frac{|\langle 0|U|{\bf u}\rangle|^2-|\langle 1|U|{\bf u}\rangle|^2}{|\langle 0|U|{\bf u}\rangle|^2+|\langle 1|U|{\bf u}\rangle|^2}={\bf u}\cdot {\bf a}, \end{split} \label{eq.3.qm} \end{equation} where \begin{equation}{\bf u} =\left( \sin \theta_{\bf u}\cos \rho_{\bf u}, \sin \theta_{\bf u} \sin \rho_{\bf u}, \cos \theta_{\bf u}\right)\end{equation} is the Bloch vector of $|{\bf u} \rangle$, while \begin{equation}{\bf a} = \left( -\sin \theta_{a}\sin \rho_{a}, \sin \theta_{a} \cos \rho_{a}, \cos \theta_{a}\right)\end{equation} is the Bloch vector of $U^\dagger(\theta _{\bf a},\rho _{\bf a}) |0\rangle$. This can be easily understood by regarding $\bar{\mathcal{A}}({\bf u})$ as expectation value of the signal obtained by measuring the initial state $|{\bf u}\rangle$ in the rotated basis $\{U^\dagger|0\rangle, U^\dagger|1\rangle\}$. The rotation $U^\dagger$ of the basis is realized by evolution. For a $B_d$ meson, the measurement in the flavor basis \{$|B^0\rangle$, $|\bar{B}^0\rangle$\}, corresponding to $\mathcal{A}_l=\pm1$, can be made through the semileptonic decay channel, as the direct CP violation or wrong sign decay is negligible~\cite{PDG}. Thus $|\phi\rangle$ in (\ref{phi}) reduces to $|B^0\rangle$ or $|\bar{B}^0\rangle$, and one can define \begin{equation} \begin{split} &\bar{\mathcal{A}}_l({\bf u})=\frac{|\langle B^0|U(t)|{\bf u} \rangle|^2-|\langle \bar{B}^0|U(t)|{\bf u}\rangle|^2}{|\langle B^0|U(t)|{\bf u}\rangle|^2+|\langle \bar{B}^0|U(t)|{\bf u}\rangle|^2}={\bf u} \cdot {\bf a}^l(t), \end{split} \label{eq.3.3l} \end{equation} where \begin{equation*} {\bf a}^l (t)=\left(\sin(2 \beta) \sin( x\Gamma t), -\cos(2 \beta) \sin(x\Gamma t), \cos(x\Gamma t)\right). \end{equation*} Likewise, as the direct CP violation is negligible~\cite{PDG}, if the decay products are CP eigenstates $S_{\pm}$, they signals the projection of the meson to CP basis states $|B_{\pm}\rangle \equiv \left(|B^0\rangle \pm |\bar{B}^0\rangle\right)/\sqrt{2}$. In this case, $|\phi\rangle$ in (\ref{phi}) reduces to $|B_\pm\rangle$. With $B_{\pm}$ corresponding to $\mathcal{A}_s=\pm 1$, one can define \begin{equation} \bar{\mathcal{A}}_s({\bf u})=\frac{|\langle B_+|U(t)|{\bf u}\rangle|^2-|\langle B_-|U(t)|{\bf u}\rangle|^2}{|\langle B_+|U(t)|{\bf u}\rangle|^2+|\langle B_-|U(t)|{\bf u}\rangle|^2}={\bf u}\cdot {\bf a}^s(t), \label{eq.3.3s} \end{equation} where \begin{equation*} \begin{split} &{\bf a}^s (t) =\left(\sin ^2(2 \beta) \cos (x\Gamma t)+\cos ^2(2 \beta),\right.\\ &\left.\sin (4 \beta) \sin ^2\left(x\Gamma t/2\right),-\sin (2 \beta) \sin (x\Gamma t)\right). \end{split} \end{equation*} Eqs.~(\ref{eq.3.3l}) and (\ref{eq.3.3s}) are of the same form as the standard QM result (\ref{eq.3.qm}) because the factor $e^{-\Gamma t}$ exists in all terms in both denominator and the numerator, and thus cancels. Note that $|\langle B^0|U(t)|{\bf u} \rangle|^2$, $|\langle \bar{B}^0|U(t)|{\bf u}\rangle|^2$ and $|\langle B_\pm|U(t)|{\bf u}\rangle|^2$ do not depend on the specific decay channels signalling the projection, hence is not directly observed. In contrast CP asymmetries usually defined depend on which channels are observed. However, under the assumption of no wrong sign decays and no direct CP violation, $|\langle B^0|U(t)|{\bf u} \rangle|^2$, $|\langle \bar{B}^0|U(t)|{\bf u}\rangle|^2$ and $|\langle B_\pm|U(t)|{\bf u}\rangle|^2$ and thus the asymmetries we define above are related to the rates of decays in specific channels. For flavor eigenstates $l^{\pm}$, as the final states of semileptonic decays, $$\langle l^+|WU(t)|{\bf u} \rangle= \langle l^+|W |B^0\rangle \langle B^0|U(t)|{\bf u} \rangle=A_{l^+}\langle B^0|U(t)|{\bf u} \rangle,$$ $$\langle l^-|WU(t)|{\bf u} \rangle=\langle l^-|W | \bar{B}^0\rangle \langle \bar{B}^0|U(t)|{\bf u}\rangle=\bar{A}_{l^-}\langle \bar{B}^0|U(t)|{\bf u}\rangle.$$ For $|l^-\rangle=CP|l^+\rangle$, we have $A_{l^+}=\bar{A}_{l^-}=A_l$. For CP eigenstates $S_\pm$ as the final states, $$ \langle S_+|WU(t)|{\bf u}\rangle = \langle S_+|W|B_+\rangle \langle B_+|U(t)|{\bf u}\rangle,$$ $$ \langle S_-|WU(t)|{\bf u}\rangle = \langle S_-|W|B_-\rangle\langle B_-|U(t)|{\bf u}\rangle.$$ Note that here there is no special relation between $l^+$ and $l^-$, or between $S_+$ and $S_-$, as different decay channels may signal a same projection in the meson Hilbert space. The examples of flavor eigenstates $l^{\pm}$ as the final states include $M^-e^+\nu$, $M^+ e^-\bar{\nu}$, $M^-\mu^+\nu$, $M^+ \mu^-\bar{\nu}$, etc. The examples of CP eigenstates $S_\pm$ as the final states include $J/\psi K_S$, $J/\psi K_L$, $KK$, $KKK$, $\pi\pi$, $\pi\pi\pi$, $DD$, etc. Therefore, the asymmetries $\bar{A}_{l}$ and $\bar{A}_{s}$, defined above in the meson Hilbert space, can be obtained from experimentally measurable quantities, \begin{equation*} \begin{split} &\bar{\mathcal{A}}_l({\bf u})=\frac{\frac{|\langle l^+|WU(t)|{\bf u} \rangle|^2}{|\langle l^+|W|B^0\rangle |^2}-\frac{|\langle l^-|WU(t)|{\bf u}\rangle|^2}{|\langle l^-|W|\bar{B}^0|^2}}{\frac{|\langle l^+|WU(t)|{\bf u} \rangle|^2}{|\langle l^+|W|B^0\rangle |^2}+\frac{|\langle l^-|WU(t)|{\bf u}\rangle|^2}{|\langle l^-|W|\bar{B}^0|^2}},\\ &\bar{\mathcal{A}}_s({\bf u})=\frac{\frac{|\langle S_+|WU(t)|{\bf u}\rangle|^2}{|\langle S_+|W|B_+\rangle|^2}-\frac{|\langle S_-|WU(t)|{\bf u}\rangle|^2}{|\langle S_-|W|B_-\rangle|^2}}{\frac{|\langle S_+|WU(t)|{\bf u}\rangle|^2}{|\langle S_+|W|B_+\rangle|^2}+\frac{|\langle S_-|WU(t)|{\bf u}\rangle|^2}{|\langle S_-|W|B_-\rangle|^2}}. \end{split} \end{equation*} As shown in Fig.~\ref{fig:Polarizer}, with the time passing, ${\bf a}^l(t)$ rotates on a plane, while ${\bf a}^s(t)$ rotates on a cone whose axis is perpendicular to ${\bf a}^l$ plane. For convenience, we adopt a new coordinate system in which ${\bf a}^l$ plane is the $xy$ plane, then \begin{equation} \begin{split} &{\bf a}^l(\phi_l)=\left(\cos \phi_l,\sin \phi_l,0\right),\\ &{\bf a}^s(\theta _s,\phi_s)=\left(\sin\theta _s \cos \phi_s,\sin \theta _s\sin\phi_s,\cos \theta _s \right), \end{split} \label{eq.3.8} \end{equation} where $\phi_l= x\Gamma t$ and $\phi_s=x\Gamma t+\pi/2$ are the azimuthal angles of ${\bf a}^l$ and ${\bf a}^s$, respectively, $\theta_s=2\beta$ is the polar angle of ${\bf a}^s$, and it suffices to consider $0< \theta _s\leq \pi/2$. ${\bf a}^l(\phi_l)$ and ${\bf a}^s(\theta _s,\phi_s)$ are two effective measurement settings or ``measuring directions''. For $B_d$ mesons, they are time-dependent. The rotation of basis or measuring direction realized by evolution explains the similarity between decay time and polarizer angle. But ${\bf a}^l(\phi_l)$ and ${\bf a}^s(\theta _s,\phi_s)$ can also be used, say, for photon polarization, by directly adjusting $ \phi_l $ and $ (\theta _s,\phi_s)$ in experiments. \begin{figure} \resizebox{1.0\hsize}{!}{\includegraphics*{Polarizer.eps}} \caption{\label{fig:Polarizer} The effective measuring directions ${\bf a}^l$ and ${\bf a}^s$. In a certain coordinate system, ${\bf a}^l(\phi_l)$ is on $xy$ plane, ${\bf a}^s(\theta_s,\phi_s)$ is on a cone. For $B_d$ mesons, $\phi_l = x\Gamma t$, $(\phi_s, \theta_s)=(x\Gamma t+\pi/2,2\beta)$, corresponding to flavor and CP measurements following evolution of time $t$, respectively. For photon polarizations, ${\bf a}^l$ and ${\bf a}^s$ are polarizer directions in Bloch representation, and can be adjusted directly. } \end{figure} \section{CNHV theories \label{sec:level3} } $|{\bf u}\rangle$ is an eigenstate of the Pauli operator $\bm{\sigma}\cdot \mathbf{u}$ in the direction of $\mathbf{u}$. A particle in this state has a definite $\mathbf{u}$. For a single particle, QM result can be reproduced by a realistic or HV theory, in which the measurement outcomes are determined by preexisting properties independent of the measurement, or ``elements of reality'' in the words of EPR. Thus $\mathbf{u}$ is identified as such an element of reality. Consider a HV theory. Suppose a particle with property ${\bf u}$ is measured along direction ${\bf a}$, then the dichotomic measurement outcome $A=\pm 1$ is determined by the hidden variables $\lambda$ in addition to the property ${\bf u}$ and the local parameter ${\bf a}$. This is also called a local realistic theory, in which the parameter ${\bf a}$ is local. In a nonlocal realistic theory, $A$ also depends on a non-local parameters, collectively denoted as $\eta$. In a crypto-nonlocal HV (CNHV) theory, the individual properties of each particle, after averaging over distribution $\rho_{\mathbf{u} }(\lambda)$ of the hidden variables $\lambda$, become local, as indicated in countless phenomena, \begin{equation} \int d \lambda \rho_{\mathbf{u} } (\lambda) A(\mathbf{u},\mathbf{a},\eta,\lambda) =\bar{A}(\mathbf{u}, \mathbf{a}). \label{ave} \end{equation} A concrete example of $\bar{A}(\mathbf{u}, \mathbf{a})$ is the Malus' law~\cite{LIExpNature} \begin{equation} \bar{A}(\mathbf{u}, \mathbf{a})=\mathbf{u} \cdot\mathbf{a}, \label{avem} \end{equation} which is consistent with QM results of photon polarizations. In the last section, we have just shown that it is also consistent with QM result of the meson decay following its evolution. For a pair of particles from a common source, with respective properties $\mathbf{u}$ and $\mathbf{v}$, the measuring direction of the other particle can serve as the nonlocal parameter, and one can also assume nonlocal parameters $\eta_a$ and $\eta_a$, which are nonlocal with respect to a and b, respectively. The measurement outcomes along respective directions ${\bf a}$ and ${\bf b}$ are $ A(\mathbf{u},\mathbf{v},\mathbf{a},\mathbf{b}, \eta_a,\eta_b,\lambda)=\pm 1$ and $ B(\mathbf{v},\mathbf{u},\mathbf{b},\mathbf{a}, \eta_b,\eta_a,\lambda)=\pm 1$. The local measurement of each particle cannot detect its correlation with the other particle, hence the nonlocal dependence disappears after averaging over the hidden variables, \begin{equation} \int d \lambda \rho_{\mathbf{u},\mathbf{v}} (\lambda) A(\mathbf{u},\mathbf{v},\mathbf{a},\mathbf{b}, \eta_a,\eta_b,\lambda) =\bar{A}(\mathbf{u}, \mathbf{a}), \label{abar} \end{equation} \begin{equation} \int d \lambda \rho_{\mathbf{u},\mathbf{v}} (\lambda) B(\mathbf{v},\mathbf{u},\mathbf{b},\mathbf{a}, \eta_b,\eta_a,\lambda) =\bar{B}(\mathbf{v}, \mathbf{b}). \label{bbar} \end{equation} A general physical state is a statistical mixture of subensembles with definite $ {\bf u}$ and ${\bf v}$. Hence the final expectation values, which is experimentally measured, are~\cite{LI,LIExpNature} \begin{equation} \begin{split} &\langle A \rangle = \int d \mathbf{u} F(\mathbf{u}) \bar{A}(\mathbf{u}),\\ &\langle B \rangle = \int d \mathbf{v} F(\mathbf{v}) \bar{B}(\mathbf{u}), \end{split} \end{equation} where $F(\mathbf{u})$ and $F(\mathbf{v})$ are probability distribution of polarizations $\mathbf{u}$ and $\mathbf{v}$, respectively. In case of correlated particles, they are the reduced ones \begin{equation} \begin{split} F(\mathbf{u})=&\int d\bf{v} F({\bf u},{\bf v}), \\ F(\mathbf{v})=&\int d\bf{u} F({\bf u},{\bf v}). \end{split} \end{equation} The two-body quantities may indicate correlations. For definite $ {\bf u}$ and ${\bf v}$, \begin{equation} \begin{split} &\overline{AB}({\bf u},{\bf v},{\bf a},{\bf b})\\ &=\int d\lambda \rho _{{\bf u},{\bf v}}(\lambda) A({\bf u},{\bf v},{\bf a},{\bf b},\lambda) B({\bf v},{\bf u},{\bf b},{\bf a},\lambda). \end{split} \end{equation} For a general state, \begin{equation} E({\bf a},{\bf b})=\int d{\bf u}d{\bf v}F({\bf u}, {\bf v}) \overline{AB}({\bf u},{\bf v},{\bf a},{\bf b}), \end{equation} which is the main quantity to be investigated, as it may differ with the corresponding QM result when entanglement is present, in which case a probability distribution over subensembles with definite polarizations leads to inequalities violated by the entangled state in QM. Here we extend CNHV theories to include the case that ${\bf a}$ and ${\bf b}$ are not externally fixed. In each measurement, the measurement settings $\tilde{\bf a}(\lambda)$ and $\tilde{\bf b}(\lambda)$ are determined by HV $\lambda$, thus the measurement outcomes are like $A(\mathbf{u}, \tilde{\bf a}(\lambda), \eta, \lambda)$. Nevertheless, for those measurements with $\tilde{\bf a}(\lambda)= {\bf a} $, we can obtain the average of the outcomes. In the case of a single particle, the average is \begin{equation} \begin{split} &\int d \lambda \rho'_{\mathbf{u},\mathbf{a} }(\lambda) A(\mathbf{u},\tilde{\bf a}(\lambda),\eta,\lambda)=\bar{A}(\mathbf{u}, \mathbf{a})=\mathbf{u} \cdot\mathbf{a}, \end{split} \label{ave2} \end{equation} where $\rho'_{\mathbf{u},\mathbf{a} }(\lambda) \equiv \rho_{\mathbf{u} }(\lambda)\delta(\tilde{\bf a}(\lambda)-\mathbf{a})$ is a shorthand. Likewise, for two correlated particles, the outcomes of those measurements with $\tilde{\bf a}(\lambda)= {\bf a} $ and $\tilde{\bf b}(\lambda)= {\bf b}$ give rise to \begin{equation} \begin{split} &\int d \lambda \rho_{\mathbf{u},\mathbf{v}} (\lambda) \delta(\tilde{\bf a}(\lambda)-\mathbf{a})\delta(\tilde{\bf b}(\lambda)-\mathbf{b}) \\ & \times A(\mathbf{u},\mathbf{v},\tilde{\bf a}(\lambda),\tilde{\bf b}(\lambda),\eta_a,\eta_b,\lambda)\\ &=\bar{A}(\mathbf{u}, \mathbf{a})=\mathbf{u}\cdot \mathbf{a}, \end{split} \label{abar1} \end{equation} \begin{equation} \begin{split} &\int d \lambda \rho_{\mathbf{u},\mathbf{v}} (\lambda) \delta(\tilde{\bf a}(\lambda)-\mathbf{a})\delta(\tilde{\bf b}(\lambda)-\mathbf{b}) \\ & \times B(\mathbf{v},\mathbf{u},\tilde{\bf b}(\lambda),\tilde{\bf a}(\lambda),\eta_b,\eta_a,\lambda)\\ &=\bar{B}(\mathbf{v}, \mathbf{b})=\mathbf{v}\cdot \mathbf{b}. \end{split} \label{bbar1} \end{equation} \begin{equation} \begin{split} &\overline{AB}({\bf u},{\bf v},{\bf a},{\bf b})=\int d\lambda \rho_{\mathbf{u},\mathbf{v}} (\lambda) \delta(\tilde{\bf a}(\lambda)-\mathbf{a})\delta(\tilde{\bf b}(\lambda)-\mathbf{b}) \\ &\times A({\bf u},{\bf v},\tilde{\bf a}(\lambda),\tilde{\bf b}(\lambda),\eta_a,\eta_b,\lambda) B({\bf v},{\bf u},\tilde{\bf b}(\lambda),\tilde{\bf a}(\lambda),\eta_b,\eta_a,\lambda). \end{split} \label{corab} \end{equation} Clearly the original formalism is a special case of this extension, by externally fixing $\tilde{\bf a}(\lambda)$ to be always $\mathbf{a}$ and $\tilde{\bf b}(\lambda)$ to be always $\mathbf{b}$, independent of $\lambda$. \section{\label{sec:level4} LI for measuring directions on a plane and a cone} We now consider a pair of particles $a$ and $b$, with the measurement outcomes $A=\pm 1$ and $B=\pm 1$, respectively. The average of those outcomes $A$ with a same measurement setting ${\bf a}$ satisfy the Malus' Law (\ref{abar1}). The average of those outcomes $B$ with a same measurement setting ${\bf b}$ satisfy the Malus' Law (\ref{bbar1}). The correlation function is defined in the way of (\ref{corab}). $\mathbf{a}$ and $\mathbf{b}$ are each given as ${\bf a}^l(\phi_i)$ or ${\bf a}^s(\theta_s,\phi_i)$, $(i=a,b)$, as in (\ref{eq.3.8}). We first consider correlation functions of various combinations of ${\bf a}^l $ and ${\bf a}^s $ . Define $\hat{E}^\pm ({\bf a},{\bf b})\equiv E({\bf a},{\bf b} )+ E({\bf b},\pm{\bf b})$, and rewrite $\hat{E}^{\pm}({\bf a}^s(\theta_s,\phi_a),{\bf a}^l(\phi_b))$ as $ \hat{E}^{\pm}_{sl}(\theta _s,\xi,\varphi)$, where $\xi \equiv (\phi _a+\phi _b)/2$, $\varphi \equiv \phi _a-\phi _b$. $\hat{E}^{\pm}_{ll}(\theta _s,\xi,\varphi)$ and $\hat{E}^{+}_{ss}(\theta _s,\xi,\varphi)$ are similarly defined. Furthermore, we consider the averages over $\xi$, $\hat{E}^{-}_{sl} (\theta _s,\varphi)\equiv \int \frac{d\xi }{2\pi} \hat{E}^{-}_{sl} (\theta _s,\xi,\varphi)$ and so on. In the Appendix, we prove the following LI. The upper bound is given by \begin{equation} \begin{split} & \hat{E}^{-}_{sl} (\theta _s,\varphi _1)+\frac{\pi \cos (\theta _{1}(\theta _s, \varphi _1)) L_1(\theta_s,\varphi _1) }{4\cos(\frac{\varphi _2}{2})} \hat{E}^{-}_{ll}(\theta _s,\varphi _2) \\ &\leq 2 \left(1+\frac{\pi \cos (\theta _{1}(\theta _s, \varphi _1)) L_1(\theta_s,\varphi _1) }{4\cos(\frac{\varphi _2}{2})}\right)\\ &-\cos (\theta _{1}(\theta _s, \varphi _1)) L_1(\theta_s,\varphi _1), \end{split} \label{eq.3.25a} \end{equation} where \begin{equation*} \begin{split} &L_1(\theta_s,\varphi)\equiv |{\bf a}^s+{\bf a}^l|=\sqrt{2+2\cos(\varphi)\sin (\theta _s)},\\ &\theta _{1}(\theta_s,\varphi)=\cos ^{-1}\frac{\cos (\theta _s)}{\sqrt{2+2\cos (\varphi)\sin (\theta _s)}}. \end{split} \end{equation*} With $0<\theta _s<\pi /2$, we have $\sin(\theta _{1})> 0$, $\cos(\theta _{1})> 0$. We find two lower bounds. The first is given as \begin{equation} \begin{split} &\hat{E}^+_{sl}(\theta _s,\varphi _1)+\frac{\pi \cos (\theta _{2}(\theta_s,\varphi _1))L_2(\theta_s,\varphi _1)}{4\left|\sin(\frac{\varphi _2}{2})\right|}\hat{E}^+_{ll}(\theta_s,\varphi _2) \\ &\geq -2\left(1+\frac{\pi \cos (\theta _{2}(\theta_s,\varphi _1)) L_2(\theta_s,\varphi _1)}{4\left|\sin(\frac{\varphi _2}{2})\right|}\right)\\ &+ \cos (\theta _{2}(\theta_s,\varphi _1)) L_2(\theta_s,\varphi _1). \end{split} \label{eq.3.29a} \end{equation} where \begin{equation*} \begin{split} &L_2(\theta_s,\varphi)\equiv |{\bf a}^s-{\bf a}^l|=\sqrt{2-2\cos(\varphi)\sin (\theta _s)},\\ &\theta _{2}(\theta_s,\varphi)=\cos ^{-1}\frac{\cos (\theta _s)}{\sqrt{2-2\cos (\varphi)\sin (\theta _s)}}. \end{split} \end{equation*} The second lower bound is given as \begin{equation} \begin{split} & \hat{E}^+_{sl}(\theta_s,\varphi _1)+\frac{\pi \cos (\theta _2(\theta_s,\varphi _1)) L_2(\theta_s,\varphi_1)}{4\sin(\theta _s)\left|\sin(\frac{\varphi _2}{2})\right|}\hat{E}^+_{ss}(\varphi _2) \\ &\geq -2\left(1+\frac{\pi \cos (\theta _2(\theta_s,\varphi _1)) L_2(\theta_s,\varphi_1)}{4\sin(\theta _s)\left|\sin(\frac{\varphi _2}{2})\right|}\right)\\ &+\cos (\theta _2)L_2(\theta_s,\varphi_1). \end{split} \label{eq.3.31a} \end{equation} Eqs.~(\ref{eq.3.25a}), (\ref{eq.3.29a}) and (\ref{eq.3.31a}) comprise our LI. The correlation functions averaged over $\xi$ are not directly observable, therefore rotational invariance or fair sampling of the averages needs to be assumed for measurements, in order that LI in terms of these average correlation functions can be experimentally examined~\cite{Branciard,Paterek}. In the case of meson decays, the rotational invariance in Bloch representation is actually time translational invariance. To drop this additional assumption, we can redefine each average in a discrete way, \begin{equation} \begin{split} &\hat{E}^{\pm}_{sl}(\theta_s,\varphi)\equiv \frac{1}{N}\sum _{n=1}^N \hat{E}^{\pm}_{sl}(\theta_s,\xi_n =\frac{2n\pi}{N},\varphi), \end{split} \label{eq.3.43} \end{equation} and $\hat{E}^{\pm}_{ll}(\theta_s,\varphi)$ and $\hat{E}^{+}_{ss}(\theta_s,\varphi)$ similarly. As derived in the Appendix, for these discrete average correlation functions, our LI can be obtained from Eqs.~(\ref{eq.3.25a}), (\ref{eq.3.29a}) and (\ref{eq.3.31a}) by simply replacing $\pi/4$ as $1/2u_N$, where $u_N\equiv \frac{1}{N}\cot \left(\frac{\pi}{2N}\right)$. $N\geq 2$ is required. As $N\to \infty$, $u_N\to 2/\pi$, then the discrete version approaches the continuous version. Our LI can be tested using various systems, in which measurement directions ${\bf a}^l(\phi_l)$ and ${\bf a}^s(\theta_s,\phi_s)$ can be directly adjusted. For meson decays, $\theta_s=2\beta$ is fixed, while $\phi_l=\phi_l(t) = x\Gamma t$, $\phi_s=\phi _s(t) = x\Gamma t+\frac{\pi}{2}$ are given by the decay time $t$. We mention that for the two particles $a$ and $b$ to be separated in spacelike distance, there is a constraint on the decay times $t_a$ and $t_b$. Suppose the particle pairs are generated from a particle at rest and each flies in velocity $v$ to opposite directions. Then spacelike separation means $(1+w)t_a > (1-w) t_b$, where $w=(v/c)/\sqrt{1-v^2/c^2}$. Consequently there is a constraint on possible values of $\xi$, but it does not affect the averages over $\xi$, which is an angle mathematically, hence its functions are periodic. \section{\label{sec:level5} Testing LI in entangled \texorpdfstring{$B_d$}{B} mesons} We now come back to the $C=-1$ $B^0\bar{B}^0$ entangled meson pairs, and we can write the correlation functions as $$E({\bf a}^X(t_a),{\bf a}^Y(t_b)), (X,Y=l,s).$$ By definition, \begin{equation} \begin{split} &E({\bf a}^X(t_a),{\bf a}^Y(t_b))= \\ & [(P(X+,Y+,t_a,t_b)+P(X-,Y-,t_a,t_b)\\ &- P(X+,Y-,t_a,t_b)-P(X-,Y+,t_a,t_b)]/\\ &[P(X+,Y+,t_a,t_b)+P(X-,Y-,t_a,t_b)\\ &+ P(X+,Y-,t_a,t_b)+P(X-,Y+,t_a,t_b)], \end{split} \label{cor} \end{equation} where for convenience, we have invented the shorthand \begin{equation} l+ \equiv B^0, \,\, l-\equiv \bar{B}^0, \, \, s\pm \equiv B_\pm, \end{equation} which should not be confused with $l^{\pm}$ and $S_{\pm}$, with $\pm$ as the superscript or subscript, denoting the final states of decays. $P(X\pm,Y\pm,t_a,t_b)$ is the probability that the measurement results of a and b are $X\pm$ and $Y\pm$ at $t_a$ and $t_b$, respectively, indicated by the final states of their respective decays. The measurement or filtering or projection in the flavor basis $\{ B^0, \bar{B}^0\}$ is made through a semileptonic decay to a flavor eigenstate $|l^\pm\rangle$. The measurement or filtering or projection in CP basis $\{ B_+, B_-\}$ is made through a decay into CP eigenstate $|S_\pm\rangle$. With direct CP violation negligible, we have $A_{l^-}=\bar{A}_{l^+}=0$, $A_{S_{\pm}}=\pm \bar{A}_{S_{\pm}}$. Only if $|l^-\rangle =CP |l^+\rangle$, we have $A_{l^+}=\bar{A}_{l^-}$. Note that the decay products of a and b may be different even though their flavor or CP eigenvalues are the same, and may not be CP conjugates even though their flavor eigenvalues are opposites. The basis of measurement, namely flavor or CP basis, is not actively chosen by experiments, but is signalled by the decay products. Our extension of CNHV and LI addresses this issue, as the main achievement of this paper. A key quantity is the joint decay rate for particle a decaying to $f _a$ at $t_a$ while particle b decaying to $f_b$ at $t_b$, $R(f _a,f _b, t_a, t_b) \propto \left|\langle f _a, f _b| W_a W_b | \Psi (t_a,t_b)\rangle \right|^2$. The following joint decay amplitudes will be needed. There are four amplitudes in the form of \begin{equation} \langle l^\pm_a, l^\pm_b| W_a W_b | \Psi (t_a,t_b)\rangle = A_{l^\pm_a} A_{l^\pm_b} \langle l \pm, l\pm| \Psi (t_a,t_b)\rangle, \label{ll} \end{equation} where, $\pm$ in $l^\pm_a$ corresponds to the first $ l \pm$ on RHS, $\pm$ in $l^\pm_b$ corresponds to the second $ l \pm$ on RHS. There are four amplitudes of the form of \begin{equation} \begin{split} &\langle S_\pm^a, S_\pm^b| W_a W_b | \Psi (t_a,t_b)\rangle =\\ &2 A_{S_\pm^a} A_{S_\pm^b} \langle s\pm, s\pm| \Psi (t_a,t_b)\rangle, \end{split} \label{ss} \end{equation} where we have used $\langle S_\pm|W|B_\pm\rangle =(A_{S_\pm}\pm \bar{A}_{S_\pm})/\sqrt{2}=\sqrt{2} A_{S_\pm }$. There are four other amplitudes of the form of \begin{equation} \begin{split} &\langle S_\pm^a, l^\pm_b| W_a W_b | \Psi (t_a,t_b)\rangle =\\ &\sqrt{2} A_{S_\pm^a} A_{l^\pm_b} \langle s\pm, l\pm| W_a W_b | \Psi (t_a,t_b)\rangle. \end{split} \label{sl} \end{equation} The experimentally measured quantity is the number of the joint events $N(f_a,f_b,t_a,t_b) \propto \epsilon_{f_a,f_b}R(f_a,f_b,t_a,t_b)$, where $\epsilon_{f_a,f_b}$ is the detection efficiency for that channel~\cite{detectionEfficience}, $R(f_a,f_b,t_a,t_b)$ is proportional to the modulo square of the joint decay amplitude, as given in Eqs. (\ref{ll}-\ref{sl}). Therefore the correlation function (\ref{cor}) can be obtained from event numbers as \begin{equation} \begin{split} &E\left({\bf a}^l(t_a),{\bf a}^l(t_b)\right)\\ &= \left(\frac{N(l_a^+,l_b^+,t_a,t_b)}{\epsilon_{l_a^+,l_b^+}|A_{l_a^+}|^2|A_{l_b^+}|^2} +\frac{N(l_a^-,l_b^-,t_a,t_b)}{\epsilon _{l_a^-,l_b^-}|\bar{A}_{l_a^-}|^2|\bar{A}_{l_b^-}|^2}\right.\\ &\left.-\frac{N(l_a^+,l_b^-,t_a,t_b)}{\epsilon _{l_a^+,l_b^-}|A_{l_a^+}|^2|\bar{A}_{l_b^-}|^2} -\frac{N(l_a^-,l_b^+,t_a,t_b)}{\epsilon _{l_a^-,l_b^+}|\bar{A}_{l_a^-}|^2|A_{l_b^+}|^2} \right)\\ &/\left(\frac{N(l_a^+,l_b^+,t_a,t_b)}{\epsilon _{l_a^+,l_b^+}|A_{l_a^+}|^2|A_{l_b^+}|^2} +\frac{N(l_a^-,l_b^-,t_a,t_b)}{\epsilon _{l_a^-,l_b^-}|\bar{A}_{l_a^-}|^2|\bar{A}_{l_b^-}|^2}\right.\\ &\left.+\frac{N(l_a^+,l_b^-,t_a,t_b)}{\epsilon _{l_a^+,l_b^-}|A_{l_a^+}|^2|\bar{A}_{l_b^-}|^2} +\frac{N(l_a^-,l_b^+,t_a,t_b)}{\epsilon _{l_a^-,l_b^+}|\bar{A}_{l_a^-}|^2|A_{l_b^+}|^2} \right), \end{split} \label{eq.4.8.1} \end{equation} \begin{equation} \begin{split} &E\left({\bf a}^s(t_a),{\bf a}^l(t_b)\right)\\ &= \left(\frac{N(S_a^+,l_b^+,t_a,t_b)}{\epsilon _{S_a^+,l_b^+}|A_{S_a^+}|^2 |A_{l_b^+}|^2 } +\frac{N(S_a^-,l_b^-,t_a,t_b)}{\epsilon _{S_a^-,l_b^-}|A_{S_a^-}|^2|\bar{A}_{l_b^-}|^2}\right.\\ &\left.-\frac{N(S_a^+,l_b^-,t_a,t_b)}{\epsilon _{S_a^+,l_b^-}|A_{S_a^+}|^2 |\bar{A}_{l_b^-}|^2 } -\frac{N(S_a^-,l_b^+,t_a,t_b)}{\epsilon _{S_a^-,l_b^+}|A_{S_a^-}|^2 |A_{l_b^+}|^2 }\right)\\ &/\left(\frac{N(S_a^+,l_b^+,t_a,t_b)}{\epsilon _{S_a^+,l_b^+}|A_{S_a^+}|^2 |A_{l_b^+}|^2 } +\frac{N(S_a^-,l_b^-,t_a,t_b)}{\epsilon _{S_a^-,l_b^-}|A_{S_a^-}|^2|\bar{A}_{l_b^-}|^2}\right.\\ &\left.+\frac{N(S_a^+,l_b^-,t_a,t_b)}{\epsilon _{S_a^+,l_b^-}|A_{S_a^+}|^2 |\bar{A}_{l_b^-}|^2 } +\frac{N(S_a^-,l_b^+,t_a,t_b)}{\epsilon _{S_a^-,l_b^+}|A_{S_a^-}|^2 |A_{l_b^+}|^2 } \right), \end{split} \label{eq.4.8.2} \end{equation} \begin{equation} \begin{split} &E\left({\bf a}^s(t_a),{\bf a}^s(t_b)\right)\\ &= \left( \frac{N(S_a^+,S_b^+,t_a,t_b)}{\epsilon _{S_a^+,S_b^+}|A_{S_a^+}|^2|A_{S_b^+}|^2} +\frac{N(S_a^-,S_b^-,t_a,t_b)}{\epsilon _{S_a^-,S_b^-}|A_{S_a^-}|^2 |A_{S_b^-}|^2 }\right.\\ &\left.-\frac{N(S_a^+,S_b^-,t_a,t_b)}{\epsilon _{S_a^+,S_b^-}|A_{S_a^+}|^2|A_{S_b^-}|^2} -\frac{N(S_a^-,S_b^+,t_a,t_b)}{\epsilon _{S_a^-,S_b^+}|A_{S_a^+}|^2|A_{S_b^+}|^2}\right)\\ &/\left(\frac{N(S_a^+,S_b^+,t_a,t_b)}{\epsilon _{S_a^+,S_b^+}|A_{S_a^+}|^2|A_{S_b^+}|^2} +\frac{N(S_a^-,S_b^-,t_a,t_b)}{\epsilon _{S_a^-,S_b^-}|A_{S_a^-}|^2 |A_{S_b^-}|^2 }\right.\\ &\left.+\frac{N(S_a^+,S_b^-,t_a,t_b)}{\epsilon _{S_a^+,S_b^-}|A_{S_a^+}|^2|A_{S_b^-}|^2} +\frac{N(S_a^-,S_b^+,t_a,t_b)}{\epsilon _{S_a^-,S_b^+}|A_{S_a^+}|^2|A_{S_b^+}|^2}\right), \end{split} \label{eq.4.8.3} \end{equation} where $\epsilon$'s are the detection efficiencies. In experiments, $|A_{l^{\pm}_{i}}|^2$ and $|A_{S_{i}^{\pm}}|^2$, $(i=a,b)$, can be absorbed to the redefinitions of detection efficiencies. Furthermore, one obtains \begin{equation} \begin{split} &\hat{E}^{ll\pm}(\phi_a,\phi_b) \equiv \\ &E\left({\bf a}^l(x\Gamma t_a),{\bf a}^l(x\Gamma t_b)\right)+E\left({\bf a}^l(x\Gamma t_b),\pm{\bf a}^l(x\Gamma t_b)\right),\\ &\hat{E}^{sl\pm}(\phi_a,\phi_b) \equiv \\ &E\left({\bf a}^s(x\Gamma t_a+\frac{\pi}{2}),{\bf a}^l(x\Gamma t_b)\right)+E\left({\bf a}^l(x\Gamma t_b),\pm{\bf a}^l(x\Gamma t_b)\right),\\ &\hat{E}^+_{ss}(\phi_a,\phi_b) \equiv E\left({\bf a}^s(x\Gamma t_a+\frac{\pi}{2}),{\bf a}^l(x\Gamma t_b)\right)\\&+E\left({\bf a}^s(x\Gamma t_b+\frac{\pi}{2}),{\bf a}^s(x\Gamma t_b+\frac{\pi}{2})\right),\\ \end{split} \label{eq.4.8.new} \end{equation} from which the averages $\hat{E}^{ll\pm}(\varphi)$, $\hat{E}^{sl\pm}(\varphi)$, $\hat{E}^{ss+}(\varphi)$ can be obtained. Note that we did not define $\hat{E}^{ss-}$, which would not have physical meaning, as $-{\bf a}^s$ is not on the cone, where all possible ${\bf a}^s$'s lie. In SM, with $\Delta \Gamma = 0$, $R(f_b,f_b,t_a,t_b)$ can be obtained as \begin{equation} \begin{split} &R(f _a,f _b,t_a, t_b)=\frac{e^{-\Gamma (t_a+t_b)}}{4}\times \left\{(|\xi_-|^2+|\zeta_-|^2)\right.\\ &\left.-(|\xi_-|^2-|\zeta_-|^2)\cos (x\Gamma (t_a-t_b))\right.\\ &\left.-2Im(\zeta_-^*\xi_-)\sin (x \Gamma (t_a-t_b))\right\}, \end{split} \label{eq.4.3} \end{equation} where $\xi_- \equiv -\left(\frac{p}{q}A_{f_a}A_{f_b}- \frac{q}{p}\bar{A}_{f_a} \bar{A}_{f_b}\right)$, $\zeta_- \equiv \left(A_{f_a}\bar{A}_{f_b}- \bar{A}_{f_a}A_{f_b}\right)$. In experiments, it is more convenient to use the time-integrated joint decay rate \begin{equation} R(f _a,f _b,\Delta t)=\int _0^{\infty}dt_aR_-(f _a,f _b, t_a, t_a+\Delta t), \label{eq.4.1} \end{equation} which is obtained as \begin{equation} \begin{split} &R(f _a,f _b,\Delta t)= \frac{e^{-\Gamma |\Delta t|}}{8\Gamma}\times \left\{(|\xi_-|^2+|\zeta_-|^2)\right.\\ &\left. - (|\xi_-|^2-|\zeta_-|^2)\cos (x\Gamma \Delta t)\right.\\ &\left.+2Im(\zeta_-^*\xi_-)\sin (x\Gamma \Delta t)\right\}, \end{split} \label{eq.4.3b} \end{equation} It is more rigorous to test LI of the discrete version of the average correlation functions, rather than that of the continuous version. However, it is experimentally much easier to measure $N(f_a,f_b,\Delta t)\propto \epsilon _{f_a,f_b}R(f_a,f_b,\Delta t)$ than $N_{f_a,f_b}(t_a,t_b)$, consequently it is much easier to test LI in terms of the continuous version of the average correlation functions. From (\ref{eq.4.3}) and (\ref{eq.4.3b}), it can be seen that in SM, $R(f_a,f_b,t_b+\Delta t,t_b)=2\Gamma e^{-\Gamma (t_a+t_b)} e^{\Gamma |\Delta t|} R(f_a,f_b, \Delta t)$. Consequently, $\hat{E}(\varphi)$, as an average of $E(\phi _a, \phi _b)$ over $\xi\equiv x\Gamma(t_a+t_b)/2+\pi/2$, can be directly related to $N(f_a,f_b,\Delta t)$ as \begin{equation} \begin{split} &\hat{E}^{ll}(\varphi = x\Gamma \Delta t) =\\ &\left(\frac{N(l_a^+,l_b^+,\Delta t)}{\epsilon_{l_a^+,l_b^+}|A_{l_a^+}|^2|A_{l_b^+}|^2} +\frac{N(l_a^-,l_b^-,\Delta t)}{\epsilon _{l_a^-,l_b^-}|\bar{A}_{l_a^-}|^2|\bar{A}_{l_b^-}|^2}\right.\\ &\left.-\frac{N(l_a^+,l_b^-,\Delta t)}{\epsilon _{l_a^+,l_b^-}|A_{l_a^+}|^2|\bar{A}_{l_b^-}|^2} -\frac{N(l_a^-,l_b^+,\Delta t)}{\epsilon _{l_a^-,l_b^+}|\bar{A}_{l_a^-}|^2|A_{l_b^+}|^2}\right)\\ &/\left(\frac{N(l_a^+,l_b^+,\Delta t)}{\epsilon _{l_a^+,l_b^+}|A_{l_a^+}|^2|A_{l_b^+}|^2} +\frac{N(l_a^-,l_b^-,\Delta t)}{\epsilon _{l_a^-,l_b^-}|\bar{A}_{l_a^-}|^2|\bar{A}_{l_b^-}|^2}\right.\\ &\left.+\frac{N(l_a^+,l_b^-,\Delta t)}{\epsilon _{l_a^+,l_b^-}|A_{l_a^+}|^2|\bar{A}_{l_b^-}|^2} +\frac{N(l_a^-,l_b^+,\Delta t)}{\epsilon _{l_a^-,l_b^+}|\bar{A}_{l_a^-}|^2|A_{l_b^+}|^2} \right),\\ \end{split} \label{eq.4.9.1} \end{equation} \begin{equation} \begin{split} &\hat{E}^{sl}(\varphi = x\Gamma\Delta t+\frac{\pi}{2})=\\ &\left(\frac{N(S_a^+,l_b^+,\Delta t)}{\epsilon _{S_a^+,l_b^+}|A_{S_a^+}|^2 |A_{l_b^+}|^2 } -\frac{N(S_a^-,l_b^-,\Delta t)}{\epsilon _{S_a^-,l_b^-}|A_{S_a^-}|^2|\bar{A}_{l_b^-}|^2}\right.\\ &\left.+\frac{N(S_a^+,l_b^-,\Delta t)}{\epsilon _{S_a^+,l_b^-}|A_{S_a^+}|^2 |\bar{A}_{l_b^-}|^2 } -\frac{N(S_a^-,l_b^+,\Delta t)}{\epsilon _{S_a^-,l_b^+}|A_{S_a^-}|^2 |A_{l_b^+}|^2 } \right)\\ &/\left(\frac{N(S_a^+,l_b^+,\Delta t)}{\epsilon _{S_a^+,l_b^+}|A_{S_a^+}|^2 |A_{l_b^+}|^2 } +\frac{N(S_a^-,l_b^-,\Delta t)}{\epsilon _{S_a^-,l_b^-}|A_{S_a^-}|^2|\bar{A}_{l_b^-}|^2}\right.\\ &\left.+\frac{N(S_a^+,l_b^-,\Delta t)}{\epsilon _{S_a^+,l_b^-}|A_{S_a^+}|^2 |\bar{A}_{l_b^-}|^2 } +\frac{N(S_a^-,l_b^+,\Delta t)}{\epsilon _{S_a^-,l_b^+}|A_{S_a^-}|^2 |A_{l_b^+}|^2 } \right),\\ \end{split} \label{eq.4.9.2} \end{equation} \begin{equation} \begin{split} &\hat{E}^{ss}(\varphi = x\Gamma\Delta t) =\\ &\left( \frac{N(S_a^+,S_b^+,\Delta t)}{\epsilon _{S_a^+,S_b^+}|A_{S_a^+}|^2|A_{S_b^+}|^2} +\frac{N(S_a^-,S_b^-,\Delta t)}{\epsilon _{S_a^-,S_b^-}|A_{S_a^-}|^2 |A_{S_b^-}|^2 }\right.\\ &\left.-\frac{N(S_a^+,S_b^-,\Delta t)}{\epsilon _{S_a^+,S_b^-}|A_{S_a^+}|^2|A_{S_b^-}|^2} -\frac{N(S_a^-,S_b^+,\Delta t)}{\epsilon _{S_a^-,S_b^+}|A_{S_a^+}|^2|A_{S_b^+}|^2}\right)\\ &/\left(\frac{N(S_a^+,S_b^+,\Delta t)}{\epsilon _{S_a^+,S_b^+}|A_{S_a^+}|^2|A_{S_b^+}|^2} +\frac{N(S_a^-,S_b^-,\Delta t)}{\epsilon _{S_a^-,S_b^-}|A_{S_a^-}|^2 |A_{S_b^-}|^2 }\right.\\ &\left.+\frac{N(S_a^+,S_b^-,\Delta t)}{\epsilon _{S_a^+,S_b^-}|A_{S_a^+}|^2|A_{S_b^-}|^2} +\frac{N(S_a^-,S_b^+,\Delta t)}{\epsilon _{S_a^-,S_b^+}|A_{S_a^+}|^2|A_{S_b^+}|^2}\right).\\ \end{split} \label{eq.4.9.3} \end{equation} Moreover, the integration over $\xi$ of $\hat{E}^{\pm}({\bf a},{\bf b})=E({\bf a},{\bf b})+E({\bf b},\pm {\bf b})$ can be performed independently for the two terms on RHS, consequently, \begin{equation} \begin{split} &\hat{E}^+_{ll}(\varphi )=\hat{E}^{ll}(\varphi)+\hat{E}^{ll}(0),\;\;\hat{E}^{-}_{ll}(\varphi )=\hat{E}^{ll}(\varphi)+\hat{E}^{ll}(\pi)\\ &\hat{E}^+_{sl}(\varphi )=\hat{E}^{sl}(\varphi)+\hat{E}^{ll}(0),\;\; \hat{E}^{-}_{sl}(\varphi )=\hat{E}^{sl}(\varphi)+\bar{E}^{ll}(\pi)\\ &\hat{E}^+_{ss}(\varphi )=\hat{E}^{ss}(\varphi)+\hat{E}^{ss}(0).\\ \end{split} \label{eq.4.10.new} \end{equation} Note that Eqs.~(\ref{eq.4.8.1}-\ref{eq.4.8.3}) and (\ref{eq.4.9.1}-\ref{eq.4.9.3}) are mainly for the use in analyzing experimental data. QM result can be obtained simply from $\langle {\bf a}^X,{\bf a}^Y|\Psi_-\rangle=- {\bf a}^X\cdot{\bf a}^Y$, therefore \begin{equation} \begin{split} & \hat{E}^{sl} (\varphi )=-\sin (2\beta)\cos (\varphi ),\;\; \hat{E}^{ll} (\varphi )=-\cos (\varphi ),\\ & \hat{E}^{ss }(\varphi )=-\cos^2(2\beta)-\sin^2(2\beta)\cos (\varphi ). \\ \end{split} \label{eq.4.10} \end{equation} It is interesting to test our LI using various systems, in which $\varphi_a$ and $\varphi_b$ are directly adjusted. For $B_d$ mesons, QM result (\ref{eq.4.10}) can also be obtained from the definition (\ref{cor}) of correlation functions, with \\ $P(X\pm,Y\pm,t_a,t_b)$ $\propto$ \\$\left|\langle X\pm,Y\pm| W_a W_b | \Psi (t_a,t_b)\rangle \right|^2$ obtained by substituting LHS of $R(f _a,f _b, t_a, t_b) \propto$ $\left|\langle f _a, f _b| W_a W_b | \Psi (t_a,t_b)\rangle \right|^2$ with the result (\ref{eq.4.3}) of $R(f _a,f _b, t_a, t_b)$, and RHS with the joint amplitudes (\ref{ll}-\ref{sl}), and then having $A_f$ and $\bar{A}_f$ cancelled. For $B_d$ mesons, the values of $\beta$ and $x$ are given by $\sin (2\beta )=0.695$, $x=0.769$~\cite{PDG}. The upper bound of a our LI violation can be quantified as \begin{equation} g^u(\varphi_1,\varphi _2) \equiv \frac{h^u_{L}(\varphi_1,\varphi _2)-h^u_{R}(\varphi_1,\varphi _2)}{\left|h^u_{L}(\varphi_1,\varphi _2)\right|}, \end{equation} where $h^u_{R}$ and $h^u_{L}(\varphi_1,\varphi _2)$ are RHS and LHS of (\ref{eq.3.25a}), respectively. The first lower bound can be quantified as \begin{equation} g^{d1}(\varphi_1,\varphi _2)=\frac{h^{d1}_{R}(\varphi_1,\varphi _2)-h^{d1}_{L}(\varphi_1,\varphi _2)}{\left|h^{d1}_{L}(\varphi_1,\varphi _2)\right|}, \end{equation} where $h^{d1}_R$ and $h^{d1}_L$ are RHS and LHS of (\ref{eq.3.29a}), respectively. The second lower bound can be quantified as \begin{equation} g^{d2}(\varphi_1,\varphi _2)=\frac{h^{d2}_{R}(\varphi_1,\varphi _2)-h^{d2}_{L}(\varphi_1,\varphi _2)}{\left|h^{d2}_{L}(\varphi_1,\varphi _2)\right|}, \end{equation} where $h^{d2}_R$ and $g^{h2}_L$ are RHS and LHS of (\ref{eq.3.31a}), respectively. Each of these three quantities larger than $0$ represents the violation of the corresponding bound of LI. From $\partial _{\varphi _1}g^u(\varphi _1,\varphi _2)= \partial _{\varphi _1}g^{d1}(\varphi _1,\varphi _2)= \partial _{\varphi _1}g^{d2}(\varphi _1,\varphi _2)=0$, it is determined that the maximum of $g^{u}$ is on $\varphi_1=\pi$, while the maxima of $g^{d1}$ and $g^{d1}$ are both on $\varphi _1=0$. $L_1(\varphi _1=\pi)=L_2(\varphi _1=0)\approx 0.781$, $\theta _{1}(\varphi _1=\pi)=\theta _{ 2}( \varphi _1=0)\approx 0.401$. Furthermore, solving $\partial _{\varphi _2}g^u(\pi,\varphi _2)=0$ numerically, we find that $g^u(\pi, \varphi _2)$ reaches its maximum at $\varphi _2\approx \pm 2.81$. We also find numerically that $g^u(\pi,\varphi _2)>0$ when $2.39<|\varphi _2|<\pi$. Similarly, solving $\partial _{\varphi _2}g^{d1}(0,\varphi _2)=0$ numerically, we find that $g^{d1}(0,\varphi _2)$ reaches the maximum at $\varphi _2\approx \pm 0.336$. We also find numerically that $g^{d1}(0,\varphi _2)>0$ when $ 0<|\varphi _2|<0.75$. Solving $\partial_{\varphi _2}g^{d2}(0,\varphi _2)=0$ numerically, we find that $g^{d2}(0,\varphi _2)$ reaches its maximum at $\varphi _2\approx \pm 0.486$, and we find numerically that $g^{d_2}(0,\varphi _2)>0$ when $ 0<|\varphi _2|<1.11$. The $\varphi _2$ range of $g^{d2}>0$ is larger than that of $g^{d1}>0$. The maxima of $g^u$, $g^{d1}$ and $g^{d2}$ are all about $2.7\%$. The results are depicted in Fig.~\ref{Fig:gud}. \begin{figure*} \centering{ \subfloat[$g^u(\varphi _1, \varphi _2)$]{\resizebox{0.33\textwidth}{!}{\includegraphics{gu12}}} \subfloat[$g^{d1}(\varphi _1, \varphi _2)$]{\resizebox{0.33\textwidth}{!}{\includegraphics{gd1_12}}} \subfloat[$g^{d2}(\varphi _1, \varphi _2)$]{\resizebox{0.33\textwidth}{!}{\includegraphics{gd2_12}}} \\ \subfloat[$g^u(\pi, \varphi _2)$]{\resizebox{0.33\textwidth}{!}{\includegraphics{gu02}}} \subfloat[$g^{d1}(0, \varphi _2)$]{\resizebox{0.33\textwidth}{!}{\includegraphics{gd1_02}}} \subfloat[$g^{d2}(0, \varphi _2)$]{\resizebox{0.33\textwidth}{!}{\includegraphics{gd2_02}}}\\ \caption{\label{Fig:gud} LI violation of entangled $B_d$ mesons. $\theta_s$ is fixed to be $\sin ^{-1}{0.695}$. Our LI is violated when $g^u(\varphi_1,\varphi_2)>0$ or $g^{d1}(\varphi_1,\varphi_2)>0$ or $g^{d2}(\varphi_1,\varphi_2)>0$. $g^u>0$ when $\varphi _1=\pi$, $ 2.39<|\varphi _2|<\pi$, and the maximum is at $\varphi _1=\pm \pi, \varphi _2\approx \pm 2.81$. $g^{d1} >0$ when $\varphi _1=0$, $0<|\varphi _2|<0.75$, and the maximum is at $\varphi _1=0, \varphi _2\approx \pm 0.336$. $g^{d2} >0$ when $\varphi _1=0$, $0<|\varphi _2|<1.11$, and the maximum is at $\varphi _1=0, \varphi _2\approx \pm 0.486$. The maxima are all about $2.7\%$.} } \end{figure*} A $B_d$ meson is unstable, and the time interval between the two decays is of the order of the lifetime $\tau _B$~\cite{TViolationD}. So it is better to study the case in which $\Delta t$ is of the order of $\tau _B$, so that the number of events is large. Thus it is easier to test $g^{d2}$, because in its violation region, $\Delta t$ is closer to $\tau _B$. We now focus on how to make measurements to confirm the violation of the second lower bound. $g^{d2}(\varphi _1,\varphi _2)>0$ can be found in the regime $(\varphi _1=0$, $ 0<|\varphi _2|<1.11)$, as calculated above. The function $g^{d2}(\varphi _1,\varphi _2)$ contains $\hat{E}^+_{sl}(\varphi_1)=\hat{E}^{sl}(\varphi_1)+ \hat{E}^{ll}(0)$ and $\hat{E}^+_{ss}(\varphi_2)=\hat{E}^{ss}(\varphi)+ \hat{E}^{ss}(0)$. Hence one first measures $\hat{E}^{ll}(\Delta t_1=0)$ and $\hat{E}^{sl}(\varphi_1=0)= \hat{E}^{sl}(\Delta t_1 =-\pi / 2x \Gamma \approx -2.04\tau _B )$, as shown in Fig.~\ref{Fig:measure}. Thus $\hat{E}^+_{sl}(\varphi_1=0)= \hat{E}^{sl}(\varphi_1=0)+\bar{E}^{ll}(\varphi_1=0)$ is obtained. One also needs to measure $\hat{E}^{ss}(\Delta t_2 =0)$ and $\hat{E}^{ss}(\Delta t_2)$ with $0<|\Delta t_2|<1.11/x\Gamma \approx 1.44\tau _B$, such that $\hat{E}^+_{ss}(\varphi_2)$ with $0<|\varphi _2|<1.11$ is obtained. Thus one obtains $g^{d2}(\varphi _1,\varphi _2)>0$ in this regime. The violation is maximal when $\Delta t_2 \approx 0.486/x\Gamma \approx 0.633\tau _B$, then $g^{d2}(\varphi _1,\varphi _2)\approx 2.7\%$, as shown in Fig.~\ref{Fig:measure}. Typically, the resolution of the signal is proportional to the inverse of square of event numbers~\cite{TViolationD}. Therefore it can be estimated that the expected signal of LI violation can be observed when the event number is about $10^4 \sim 10^5$, which can be achieved in current experiments~\cite{ImprovedCPV}. \begin{figure*} \centering{ \resizebox{0.9\textwidth}{!}{\includegraphics{measure}} \caption{\label{Fig:measure} The correlation functions to be measured. The left picture represents $\hat{E}^{sl}(\Delta t = \pi / 2x\Gamma \approx 2.04\tau _B)=\hat{E}^{sl}(\varphi_1=0)$. The right picture represents $\hat{E}^{ss}(\Delta t = 0.486 / x\Gamma \approx 0.633\tau _B)=\hat{E}^{ss}(\varphi _2\approx 0.486)$. They give rise to $g^{d1}( \varphi_1=0,\varphi _2\approx 0.486)$, which maximally violates the second lower bound of our LI.} } \end{figure*} It is also possible to test LI in polarization-entangled baryon-antibaryon pairs produced in, say, $J/\Psi \to \Lambda \bar{\Lambda}$ decays, where the polarizations of $\Lambda$ and $\bar{\Lambda}$ can be measured through the angular distribution of the momenta of their decay products pions. However, the effective measuring directions satisfying the Malus' law are yet to be found out. \begin{figure*} \centering{ \subfloat[$g^u(\theta_s,\pi, \varphi _2)$]{\resizebox{0.33\textwidth}{!}{\includegraphics{gu_3d}}} \subfloat[$g^{d1}(\theta_s,0, \varphi _2)$]{\resizebox{0.33\textwidth}{!}{\includegraphics{gd1_3d}}} \subfloat[$g^{d2}(\theta_s,0, \varphi _2)$]{\resizebox{0.33\textwidth}{!}{\includegraphics{gd2_3d}}} \caption{\label{Fig:g3d} LI violation in case $\theta_s$ is a variable. The maxima of $g^u$, $g^{d1}$ and $g^{d2}$ are still at $\varphi _1= \pi,0,0$, respectively. $g^u(\theta_s,\pi,\varphi _2)$, $g^{d1}(\theta_s,0,\varphi _2)$ and $g^{d2}(\theta_s,0,\varphi _2)$ are functions of $\theta_s$ and $\varphi _2$. }} \end{figure*} If using other systems such as photon polarizations to test our LI, $\theta_s$ may become a variable. The results of $\partial _{\varphi _1}g^u(\varphi _1,\varphi _2)= \partial _{\varphi _1}g^{d1}(\varphi _1,\varphi _2)= \partial _{\varphi _1}g^{d2}(\varphi _1,\varphi _2)=0$ do not depend on $\theta_s$, hence their maxima are still at $\varphi _1= \pi,0,0$, respectively. $g^u(\theta_s,\pi,\varphi _2)$, $g^{d1}(\theta_s,0,\varphi _2)$ and $g^{d2}(\theta_s,0,\varphi _2)$ as functions of $\theta_s$ and $\varphi _2$ are shown in Fig.~\ref{Fig:g3d}. Interestingly, in a certain range of $\varphi _2$, for any value of $\theta _s$ except $0$ and $\pi/2$, we always have $g^{d2}>0$, that is, the second lower bound is always violated. Furthermore, we numerically found the maximal violations of the three bounds are all $3.87482\%$ when $\theta _s=1.18208$, i.e. \begin{equation}\begin{split} &g^u(1.18208,\pm \pi, \pm 2.7373)=g^{d1}(1.18208,0, \pm 0.404296)\\&=g^{d2}(1.18208,0, \pm 0.437399)=3.87482\%.\end{split} \end{equation} It is also found that \begin{equation} g^{d1}(1.18208,0,\varphi_2)>0,\,\mbox{when}\,\, 0<|\varphi_2|<1.0734, \end{equation} \begin{equation} g^{d2}(1.18208,0,\varphi_2)>0,\,\mbox{when}\, \, 0<|\varphi_2|<1.17078. \end{equation} The latter is wider, as shown in Fig~\ref{Fig:gdmax}. \begin{figure} \centering \resizebox{1.0\hsize}{!}{\includegraphics{gdmax}} \caption{ \label{Fig:gdmax} The two lower bounds are maximally violated on $\theta_s=1.18208$, $\varphi_1=0$. Shown here are the dependence of $g^{d1}(\theta_s=1.18208,\varphi_1=0,\varphi_2)$ and $g^{d2}(\theta_s=1.18208,\varphi_1=0,\varphi_2)$ on $\varphi_2$. $g^{d1} >0$ when $0<|\varphi_2|<1.0734$, while $g^{d2} >0$ when $0<|\varphi_2|<1.17078$. } \end{figure} \section{\label{sec:level6} Summary and Discussions} To summarize, we have extended the CNHV theories to include the case that the measuring settings, together with the measurement outcomes, are not externally fixed, but determined by HVs. The outcomes of those measurements with the same settings give averages satisfying Malus' Law and make up correlation functions. We show that such is the case of meson decays, which could be determined by HVs at the source of the meson pairs. This extension does not change the validity of LI. Therefore, entangled meson pairs can be used to test LI. We find that for a $B_d$ meson, the effective measuring directions appearing in Malus' Law are on a cone and a plane, corresponding to semileptonic decays and decays to CP eigenstates, respectively. For such effective measuring directions, we present a new LI. This can be tested in $C=-1$ entangled state of $B^0-\bar{B}^0$ pairs, within the present experimental capability. The expected violation is estimated quantitatively, using the indirect CP violation and other parameters. Our LI is violated if there is indirect CP violation. There may be profound reason for this surprising connection. Besides, our new LI can also be tested in other systems such as photon polarizations, where the measuring directions are simply directions externally fixed. \begin{acknowledgement} This work is supported by National Science Foundation of China (Grant No. 11574054 and No. 11947066). \end{acknowledgement}
\section{Introduction} The measurement of galaxy morphology is a fundamental topic in observational cosmology. Morphology is a strong function of the dynamical state of a galaxy, encodes the physical processes that dominate its evolutionary history \citep[e.g.][]{Martin2018b} and is strongly aligned with physical properties like stellar mass \citep[e.g.][]{Bundy2005}, star-formation rate \citep[e.g.][]{Bluck2014,Smethurst2015}, colour \citep[e.g.][]{Strateva2001,Skibba2009} and local environment \citep[e.g.][]{Dressler1980,Dressler1997,Postman2005}. For example, bulge-dominated galaxies typically have assembly histories that are richer in mergers \citep[e.g.][]{Conselice2006}, with the strength of the bulge correlating with the number of mergers \citep[e.g.][]{Hatton2003}. In comparison, the presence of a disc at the present day is a signature of a more quiescent formation history, with the buildup of stellar mass likely to be driven mainly by gas accretion and secular processes \citep{Codis2012,Kaviraj2014a,Martin2018c}. In a similar vein, at a given stellar mass, lower surface brightnesses or redder colours may indicate a larger role for tidal processes, like interactions and ram-pressure stripping, in the evolution of the galaxy in question \citep[e.g.][]{Dressler1980,Moore1999,Weisz2011,Martin2019}. Finally, morphological details, such as extended tidal features, are signposts of recent mergers and/or strong interactions \citep[e.g.][]{Kaviraj2014b,Kaviraj2019}, with the surface-brightness of these tidal features typically scaling with the mass ratios of the mergers in question \citep[e.g.][]{Peirani2010,Kaviraj2010}. In addition to its key role in the study of galaxy evolution, morphological information is useful for a vast array of astrophysical science. For example, it is used as a prior in photometric-redshift pipelines \citep[e.g.][]{Soo2018,Menou2018}, forms key contextual data in the classification of transient lightcurves \citep[e.g.][]{Djorgovski2012,Wollaeger2018} and is important for identifying the processes that trigger the onset of AGN activity in galaxies \citep[e.g.][]{Schawinski2014}. The measurement of accurate galaxy morphologies, particularly in large surveys which underpin our statistical endeavour is, therefore, a critical exercise. Over the past few decades a rich literature has emerged on methods for measuring galaxy morphology, especially in large observational surveys. These methods range from parametric techniques, which attempt to describe galaxy light profiles using small sets of parameters \citep[e.g.][]{Sersic1963,Simard2002,Odewahn2002,Lackner2012}, to non-parametric methods that reduce these light distributions to single values such as in the `CAS' system \citep[e.g.][]{Abraham1994,Conselice2003,Menanteau2006}, the Gini-M$_{20}$ coefficients \citep[e.g.][]{Lotz2004,Scarlata2007,Peth2016} or other non-parametric statistics such as the MID system \citep[e.g.][]{Freeman2013}. Recent work has increasingly harnessed the power of machine-learning to perform morphological analysis. Although the use of machine-learning in astronomy can be traced back at least as far as \citet{Lahav1995}, the recent literature has seen an explosion in the use of such techniques applied to a wide variety of problems in astrophysics \citep[e.g.][]{Huertas-Company2015,Ostrovski2017,Schawinski2017,Hocking2018,Goulding2018,DIsanto2018b,Siudek2018,An2018,Cheng2019,Ay2019}. While automated classification techniques, such as the ones described above, are particularly well-suited to efficiently processing large survey datasets, they are typically benchmarked against visual inspection \citep[e.g.][]{Kaviraj2010,Lintott2011,Simmons2017}, which produces arguably the most powerful and accurate measures of galaxy morphology. While time-consuming to perform, the development of the Galaxy Zoo \citep[GZ;][]{Lintott2011} platform has, in recent years, revolutionized the collection of visual classifications for large surveys. Using more than a million citizen-science volunteers, GZ has classified several contemporary surveys, like the SDSS and the HST legacy surveys \citep[e.g.][]{Lintott2011,Willett2017}. Automated methods, especially those that exploit machine-learning, have been routinely benchmarked against visual classifications from databases like GZ, and are now commonly deployed on large-scale survey data \citep[e.g.][]{Huertas-Company2015,Dieleman2015,Beck2018,Walmsley2019,Ma2019}. Notwithstanding the variety of techniques on offer, forthcoming `Big Data' surveys, e.g. from the LSST, present unprecedented challenges for performing morphological classification \citep{Robertson2017}. The sheer volume of data makes such surveys intractable for visual inspection, even via massively-distributed platforms like GZ. New techniques, which either combine visual and automated classification \citep[e.g.][]{Beck2018,Dickinson2019} or perhaps remove the need for visual classification altogether \citep[e.g.][]{Siudek2018,Hocking2018,Hendel2018,DIsanto2018a}, will be crucial in dealing with the unprecedented data volumes expected from these new surveys. The short cadence of rapidly-changing datasets, from instruments like the LSST, represents an additional hurdle and could make supervised machine-learning techniques challenging to deploy, as it may become impractical to repeatedly produce large, reliable training sets on short timescales, as the survey becomes progressively deeper. \textit{Unsupervised} machine-learning (UML) algorithms are ideally suited to the morphological analysis of Big Data surveys. Unsupervised techniques do not require visually-classified training sets and can, in principle, rapidly and autonomously compress an arbitrarily large galaxy population into a small number of `morphological clusters' comprised of galaxies with similar properties \citep[e.g.][]{Hocking2018}. These groups can then be benchmarked against visual classification which, if the number of groups is relatively small, becomes tractable even for individual researchers (and can be tackled easily using distributed systems like GZ). In this paper, we employ such a UML algorithm, which works by grouping pixels with similar properties and objects constructed from those pixels, like galaxies. Originally developed using Hubble Space Telescope (HST) data from the CANDELS \citep{Koekemoer2011} survey \citep{Hocking2017,Hocking2018}, we apply the algorithm to the Ultradeep layer of the Hyper Suprime-Cam Subaru-Strategic Program (HSC-SSP) Data Release 1 (DR1). We release a catalog of morphological classifications which can be used in conjunction with the HSC-SSP DR1 catalogue, explore the robustness of these classifications and discuss the applicability of the algorithm to surveys from forthcoming instruments like LSST (whose deep-wide-fast dataset will reach the same depth as the HSC-SSP Ultradeep survey after $\sim$10 years). We also plan to release catalogues of morphological classifications based on both forthcoming HSC-SSP data releases and datasets from future instruments like LSST will be released as data becomes available. This paper is structured as follows. In Section \ref{sec:HSC}, we describe the unsupervised graph-clustering algorithm that underpins this study. In Section \ref{sec:algorithm}, we outline the properties of the HSC-SSP and the ancillary data used in this study. In Section \ref{sec:catalogue}, we describe the benchmarking of the algorithm outputs using visual classification, the completeness of the resultant morphological catalogue and the contents of the released data products. In Section \ref{sec:analysis}, we explore the robustness of the classifications, by comparing the properties of galaxies in different morphological groups to known trends in these properties as a function of morphology, at $z<1$. We summarise our results in Section \ref{sec:summary}. \section{The Hyper Suprime Cam Subaru Strategic Program (HSC-SSP)} \label{sec:HSC} \subsection{Survey description} The HSC-SSP \citep{Aihara2018a} is a multi-layered imaging survey in $grizy$ (and 4 narrow-band filters), using the Hyper Suprime-Cam \citep[HSC,][]{Miyazaki2012} on the 8.2m Subaru Telescope. HSC has a 1.5 degree diameter field of view and a 0.168 arcsec pixel scale, with a median $i$-band seeing of $\sim$0.6 arcsec. The survey, which began in 2014, is being carried out using 300 nights over 5-6 years. The fields are chosen to be low in Galactic dust extinction and to have overlap with several well-known multi-wavelength data-sets, including SDSS/BOSS \citep{Eisenstein2011}, X-ray surveys from XMM \citep{Jansen2001} and eROSITA \citep{Merloni2012} and near-/mid-infrared imaging surveys e.g. VIKING/VIDEO \citep{Jarvis2013} and UKIDSS \citep{Lawrence2007}. The final HSC-SSP dataset (expected in 2021) will provide three layers: a `Wide' layer covering an area of 1400 deg$^2$ with a target $i$-band depth of 26.2 mag arcsec$^{-2}$, a `Deep' layer covering an area of 27 deg$^2$ with a target $i$-band depth of 27.1 mag arcsec$^{-2}$ and an `Ultradeep' layer covering an area of 3.5 deg$^2$ with a target $i$-band depth of 27.7 mag arcsec$^{-2}$ \citep{Aihara2018a}. The layers are nested, so that the Ultradeep layers are included in the Deep fields and the Deep regions are included in the Wide fields. Here, we use the HSC-SSP DR1\footnote{https://hsc.mtk.nao.ac.jp/ssp/data-release/}, which has released 108~deg$^2$, 26~deg$^2$, and 3.5~deg$^2$ in the Wide, Deep and Ultradeep layers, with current depths of $i \sim$ 26.4, $\sim$26.5, and $\sim$27. mag, respectively ($5\sigma$ for point sources) \citep{Aihara2018b}. The survey is split into a number of 1.5~deg wide square `tracts', each covering approximately a single HSC pointing. Each tract is further separated into $9\times9$ patches, consisting of approximately $4200\times4200$ pixels. Here we use stacked, sky-subtracted images, with WCS co-ordinate corrections applied and calibrated magnitude zero-points. \subsection{Data} For object centroids and observed photometry, we use \texttt{cModel} magnitudes \citep[][]{Stoughton2002}, which are released as part of the HSC-SSP DR1 \texttt{forced} catalogue. These are computed using the HSC-SSP reduction pipeline, using the $i$-band as the primary reference wavelength. We additionally calculate surface brightnesses using the Kron radius, by dividing the flux within this radius by the area of the aperture. In order to infer physical properties and photometric redshifts for the galaxies in our sample, we use results from the \textsc{mizuki} \citep{Tanaka2015} template-fitting code, that have been released as part of the HSC-SSP~DR1 \citep{Tanaka2018}. Redshifts are derived purely from HSC $g$, $r$, $i$, $z$ and $y$ band \texttt{cModel} magnitudes, for all primary objects detected in at least three bands. The \textsc{mizuki} code uses spectral energy distribution (SED) fitting to templates generated from the \citet{Bruzual2003} stellar population synthesis models, in order to self-consistently estimate redshifts and physical properties of individual galaxies. Redshift-dependent Bayesian priors are applied to physical parameters like stellar mass and the star-formation rate (SFR). We use values from the public HSC-SSP DR1 \texttt{photoz\_mizuki} catalogue for photometric redshifts, SFRs, stellar masses and rest-frame magnitudes and colours. For full details of the HSC-SSP DR1 we direct readers to \citet{Aihara2018b}. \section{An unsupervised algorithm for morphological classification based on the clustering of graph-based representations } \label{sec:algorithm} The graph-clustering algorithm that underpins this study is described in detail in \citet{Hocking2017} and \citet{Hocking2018}. The primary application of this algorithm is to provide a means of efficiently classifying large quantities of unseen data into small groups of visually similar objects, so that the groups can be benchmarked against visual classifications. The ability to do so quickly, without relying on pre-existing training sets, is essential in the LSST era, as the high survey cadence, rapidly evolving data and the new parameter spaces it will explore will make it challenging to construct the unbiased training sets that will be required. The technique has been previously tested on other astronomical datasets. \citet{Hocking2018} has demonstrated this method applied to HST data from CANDELS. In this work, the algorithm has been validated by showing that the characteristics of objects, separated into different morphological clusters, show consistency in terms of their basic properties and structural parameters (magnitude, M$_{20}$, colours), as well as strong concordance with classification data from GZ (e.g. smoothness, disciness etc). Separately, the algorithm has been shown to efficiently separate ellipticals and spirals, when benchmarked against expert human classifiers, and shows promise in identifying lensed galaxies \citep{Hocking2017}. In the following sections, we describe the main components of the algorithm. \subsection{Feature selection} \label{sec:feature_selection} \begin{table} \caption{Parameters used for the feature extraction step.} \begin{tabular}{lll} \toprule Parameter & Description & Value\\ \midrule $r$ & Side length of a square sub-image patch in pixels & 16 \\ $n$ & Number of bins in the radial power spectrum & 8 \\ \bottomrule \end{tabular} \label{table:FE} \end{table} The ultimate aim of the method is to automatically identify different groups of galaxies using HSC pixel data. Although the source data may be used directly, it is more useful to transform the data in a way that removes any irrelevant information. As our aim is to morphologically classify galaxies, we transform the data so that irrelevant information like galaxy orientation is removed. Importantly, the selected features must avoid redundancies or over-fitting, and also remain invariant to galaxy rotation, scale and orientation. Simplicity in the features selected is also desirable, in order that the results of the algorithm remain human-interpretable. Below, we outline the feature extraction process, which is also described in \citet{Hocking2017} and \citet{Hocking2018}. We first extract $r\times r$ pixel sub-image patches around each detected pixel in each HSC tract, where $r$ is the patch size (Table \ref{table:FE}). In order to reduce the time that the algorithm takes to run, and to avoid including pixels that contain no useful information, we only extract pixels that are $1\sigma$ above the noise level, determined by a simple sigma-clipping \citep[e.g. as implemented by][but see Appendix \ref{app:cross_match} for a discussion of potential improvements]{Bertin1996, Robitaille2013}. Following the initial detection and extraction step, we produce a rotationally invariant representation of each patch, by evaluating the radially averaged pixel intensity power spectrum, with $n$ bins (Table \ref{table:FE}) for each of the five bands ($g$, $r$, $i$, $z$, $y$). This is done by first calculating the 2D Fast Fourier transform \citep[FFT;][]{Ballard1982} for each patch and then multiplying it by its conjugate. The zero frequency component is then rearranged to the centre of the 2D matrix and the azimuthally averaged radial profile calculated. It is important that the patch size is large enough to sample the spatial scales over which the data varies (e.g. that it is larger than the PSF). Other common feature representations, including Rotationally Invariant Feature Transform (RIFT), spin intensity images \citep{Lazebnik2005} and histogram of gradient \citep[HoG;][]{Birk1979} were trialed \citep{Hocking2017}, with the power spectrum representation found to have the best performance and efficiency for separation of late-type and early-type galaxies, when compared to human expert classifications of CANDELS data. Each $n$ element power spectrum is concatenated into a $5\times n$ element feature vector, $\mathbf{p}$, which effectively encodes pixel intensity, colour and spatial frequency information for each sub-image patch in a rotationally invariant manner. Each feature vector is then combined into a patch data matrix, $\mathbf{P}$, which contains the feature vectors for every patch. Table \ref{table:FE} presents the values of $r$ and $n$ used for this feature extraction step. We note briefly that an alternative approach to the \textit{engineered} feature description detailed above, where the optimum feature representation is instead \textit{learned} \citep[e.g.][]{Coates2011,Cheriyadat2013,Tao2015} could also be used. While it is possible that this approach could produce better results, such an approach would also produce outputs that are difficult to interpret. Additionally, this could have significant implications for the speed of the algorithm, as it would introduce an additional learning step and also increase the dimensionality of the feature space that must be explored in later steps. This could potentially significantly increase the time required to produce classifications. Since we aim to be able to quickly and repeatedly produce classifications for rapidly changing datasets (e.g. from the LSST), and produce outputs where each step can be easily validated by human inspection, slowing down the algorithm and obfuscating the outputs in not desirable, even if it produces an improvement in the quality of the classifications. \subsection{Feature extraction} \label{sec:clustering} The next step is to use clustering methods to learn an accurate topological map (model) of the patch data matrix, $\mathbf{P}$, and then sub-divide the nodes within this map into coarser groups of feature vectors, thus producing a library of distinct `patch types'. \subsubsection{Growing neural gas} We use a growing neural gas \citep[GNG,][]{Fritzke1995} algorithm to learn the optimal representation of the data, based on the patch data matrix, $\mathbf{P}$. The data are first normalised over each feature component to ensure homoscedasticity, preventing undue influence from components with relatively high variance. The GNG algorithm then produces a graph representation of the data, by iteratively growing a graph of nodes with \textit{topological} neighbouring nodes in the graph connected by edges. The result is a topology-preserving map with an induced Delaunay triangulation \citep{Okabe2009}. Edges that are no longer part of the induced Delaunay triangulation must, however, be removed. This is achieved by removing edges that have reached a given \textit{age}, $a_{max}$, without being connected to another node. The GNG algorithm is applied to $\mathbf{P}$ using the following steps: \begin{table} \caption{Parameters used for the growing neural gas (GNG)s, hierarchical clustering (HC)s and morphological classification steps.} \begin{tabular}{lll} \toprule Parameter & Description & Value\\ \midrule $N$ & Maximum number of nodes in the graph & 200,000 \\ $\lambda$ & Samples processed before new node added & 100 \\ $a_{max}$ & Maximum age before an edge is removed & 50 \\ $\epsilon_{b}$ & Size of the adjustment in step (i) & 0.2 \\ $\epsilon_{n}$ & Size of adjustment for neighbours in step (i) & 0.006 \\ $\alpha$ & Error reduction to node with the largest error & 0.5 \\ $\beta$ & Error reduction to all nodes & 0.995\\ $N_{g}$ & Target number of HC groups & 1500\\ $k$ & Number of groups produced by $k$-means & 160\\ \bottomrule \end{tabular} \label{table:GNG} \end{table} \begin{enumerate} \item First, two nodes are initialized with positions using two randomly selected feature vectors from the patch data matrix, $\mathbf{P}$. Each node is, therefore, located within a $5\times n$ dimensional feature space with the same dimensionality as the number of elements of $\mathbf{p}$. A new random feature vector, $\mathbf{p}'$, is then drawn from $\mathbf{P}$ and the following steps applied: \begin{itemize} \item The two nearest nodes to the feature vector, whose positions in the feature space we designate $\mathbf{s}_{0}$ and $\mathbf{s}_{1}$, are identified such that the Euclidean distance from $\mathbf{p}'$, is minimised. $\mathbf{s}_{0}$ is the closest node to $\mathbf{p}'$ and $\mathbf{s}_{1}$ is the second closest. \item If an edge connecting the two nodes, $\mathbf{s}_{0}$ and $\mathbf{s}_{1}$, does not already exist it is created. The two connected nodes are called \textit{topological} neighbours. Whenever two nodes are connected by an edge, the edge is also assigned an age, $a$, which is initially set to $0$, and the age of all other edges connected to $s_0$ are incremented by $1$. \item The closest node to $\mathbf{p}'$, $\mathbf{s}_{0}$, is assigned an error equal to the square of their separation: \begin{equation} \sigma(\mathbf{s}_{0}) = ||\mathbf{p}' - \mathbf{s}_{0}||^{2}. \end{equation} \item $\mathbf{s}_{0}$ and its direct topological neighbours (i.e. those directly connected by edges) are all moved towards $\mathbf{p}'$ by a fraction ($\epsilon_{b}$ and $\epsilon_{n}$ respectively) of their separation from $\mathbf{p}'$, thus causing adaptation of the map towards the input data: \begin{equation} \begin{array}{l} \Delta \mathbf{s}_{0} = \epsilon_{b} (\mathbf{p}' - \mathbf{s}_{0})\\ \Delta \mathbf{s}_{n} = \epsilon_{n} (\mathbf{p}' - \mathbf{s}_{n}). \end{array} \end{equation} \item All edges with ages larger than the maximum age (where $a > a_{max}$) are removed. Any nodes that no longer have topological neighbours are also removed. \end{itemize} \item This procedure is repeated until $\lambda$ feature vectors have been processed, after which: \begin{itemize} \item A new node, $\mathbf{s}_{r}$, is inserted at the mid-point between the node with the highest error, $\mathbf{s}_{q}$, and its highest error topological neighbour, $\mathbf{s}_{f}$. \item The edges connecting the two nodes are removed and new edges are created connecting $\mathbf{s}_{q}$ and $\mathbf{s}_{f}$ to $\mathbf{s}_{r}$. \item The error of $\mathbf{s}_{q}$ and $\mathbf{s}_{f}$ is decreased by multiplying their errors with the parameter, $\alpha$, and the error of $\mathbf{s}_{r}$ is initialised with the same error as $\mathbf{s}_{q}$. \item The error of every node is decreased by multiplying their errors with the parameter $\beta$. \end{itemize} \item This is continued until the stopping criterion is met (i.e. $N$ nodes has been reached). \end{enumerate} The accumulation of errors in step (ii) ensures that the algorithm places new nodes in areas of the parameter space where the mapping from the model to the data is poor. Once the stopping criterion is met, we take a matrix containing the final positions of all the nodes within the feature space, $\mathbf{N}$, as the output. Table \ref{table:GNG} presents the values of the parameters used for the GNG step. We note that the exact value of these parameters is not important for the outcome, but does affect the time it takes for the graph to converge. Any sensible choice of parameters will always result in adaptation towards the input data, but a poor choice of parameters may result in inefficient performance, requiring a large number of iterations to finish. \subsubsection{Hierarchical clustering} Agglomerative (`bottom-up') hierarchical clustering \citep[HC;][]{Johnson1967} of the GNG output is used to produce a hierarchical representation of the nodes in the topological map. At each iteration, the HC algorithm initially tries to cluster the most similar nodes into pairs, with similarity measured, in this case, by the Pearson correlation. The Pearson correlation between the nodes $\mathbf{a}$ and $\mathbf{b}$ is calculated by comparing their position vectors and given by their co-variance divided by the product of their standard deviations: \begin{equation} \label{eqn:Pearson} \rho(\mathbf{a},\mathbf{b}) = \frac{\mathrm{cov}(\mathbf{a},\mathbf{b})}{\sigma_{\mathbf{a}}\sigma_{\mathbf{b}}}, \end{equation} where $\mathrm{cov}(\mathbf{a},\mathbf{b})$ is the co-variance between the two node position vectors, given by $\Sigma_{i}^{n}(\mathbf{a}_{i}-\overline{\mathbf{a}})(\mathbf{b}_{i}-\overline{\mathbf{b}})$ and $\sigma_{\mathbf{a}}$ and $\sigma_{\mathbf{b}}$ are simply the standard deviation of each position vector, given by $\sqrt{\Sigma_{i}^{n}(\mathbf{a}_{i}-\overline{\mathbf{a}})^{2}}$ and $\sqrt{\Sigma_{i}^{n}(\mathbf{b}_{i}-\overline{\mathbf{b}})^{2}}$ respectively. At each subsequent iteration the algorithm merges clusters into pairs of similar clusters and so on, until only a single cluster remains. A particular advantage of this method is that it enables us to select the desired level of detail that we use to segment the GNG graph. The clusters can have disparate sizes and separations and therefore the method makes no assumptions about the structure of the data. \subsection{Constructing feature vectors} \label{sec:feature_vectors} After a library of patch types has been produced from a subset of the data by the GNG algorithm and then reduced via HC, it is possible to construct \textit{object} feature vectors. Individual patches must be assembled into objects, either using existing detection maps or, as we use in this case, connected component labeling algorithms \citep[e.g.][]{Galler1964}. Each of the patches is assigned a patch type, based on the closest node defined in the previous step. They can then be described using a histogram of patch types i.e. an object feature vector. The feature vector describes the frequency of different patch types that the object consists of, thereby encoding an easily manipulated description of that object. The number of groups that patch types are clustered into, and therefore the length of the feature vector, can be changed according to the complexity of the data that is being classified. In this case it has a value $N_{g}=1500$, equal to the number of clusters produced by the HC algorithm. The feature vector of an object should, therefore, encode the basic visual characteristics of that object, making it possible to identify visually similar objects. Fig \ref{fig:cartoon} illustrates the process of extracting patches from multi-band survey data (Section \ref{sec:feature_selection}), assembling a library of patch types (Section \ref{sec:clustering}) and, finally, constructing feature vectors for each object (Section \ref{sec:feature_vectors}). \begin{figure} \centering \includegraphics[width=0.45\textwidth]{Figures/fig_UML.pdf} \caption{A schematic view of the morphological classification process. Patches are extracted around detected pixels in survey images and clustering methods are used to group these patches into a library of patch types. Galaxy feature vectors can then be constructed by creating a histogram for each object which describes the frequency of each patch `type'.} \label{fig:cartoon} \end{figure} \subsection{Producing morphological clusters} In order to finally classify galaxies into morphological clusters, we first define the similarity between feature vectors. Again, we use the Pearson correlation (Equation \ref{eqn:Pearson}), in order to define the distance between feature vectors in this new feature space, although other distance measures (e.g. Euclidean distance or cosine distance) may be used and may accentuate different features. Additionally, we apply `term frequency-inverse document frequency' \citep[TF$*$IDF,][]{Rajaraman2011} weightings when calculating the distance, in order to increase the importance of patch types with the greatest discriminatory power, and reduce the importance of patch types that are relatively common between all objects. Once we have produced a feature vector that encodes the visual characteristics of each object, and defined a distance measure for these feature vectors, it is finally possible to group these objects by their visual similarity. This can be done either by direct comparison, or a similarity search, of individual feature vectors e.g. searching for other objects that are most similar, or closest in the feature space, to the feature vector of a given object, or by applying a clustering algorithm to the feature vectors in order to group them. In order to ensure cleaner classifications, we exclude any objects that are comprised of fewer than $15$ pixels. Using $k$-means clustering \citep[e.g.][]{MacQueen1967}, we separate our object feature vectors into $k$ morphological clusters (in this paper we have chosen $k$ to be 160, which is intended to demonstrate the ability of the algorithm to distinguish subtle visual differences, however arbitrary values of $k$ may be chosen). We calculate silhouette scores for the objects in each morphological cluster, in order to evaluate the overall quality of the clustering, as well as the correspondence of individual objects to the average properties of the group they are assigned to. The silhouette score for a given object is calculated based on the level of similarity to both its corresponding cluster and all other clusters \citep[see][]{Rousseeuw1987}. Silhouette scores range from -1 to 1: a high silhouette score indicates that the object is well matched to its own cluster and distinct from neighbouring clusters. For more efficient visual classification it may be desirable to select values of $k$ that so that the mean silhouette score is optimised (see Section \ref{sec:release}). We calculate silhouette scores for individual objects, as well as averages on a group and global level, which are included in the catalogues presented in Section \ref{sec:release}. With $k=160$, we obtain a global mean silhouette score of 0.26. Using the parameters described above, the algorithm takes around 40~ms per pixel in order to perform feature extraction, generate a model from training data and perform the classification. Feature extraction and classification, using an existing model applied to unseen data, takes only around 1-2~ms per pixel, on a single thread of execution on a contemporary desktop computer with an Intel CPU. The feature extraction and classification steps can be easily split up and executed concurrently \citep{Herlihy2011}. This property makes the algorithm efficient, even on very large volumes of data (e.g. surveys from instruments like SDSS or LSST). The algorithm is implemented in a combination of C\#, utilising .NET Core 2 libraries and Python, relying on the numpy, astropy and scikit-learn modules (which are implemented in a mixture of Python, C and Cython). Even without parallelization of the extraction and classification steps, the algorithm performs well on large datasets. For example, the entire 3.5~deg$^{2}$ of the HSC Ultradeep dataset used in this paper was processed in under 40~CPU~hours, including feature selection, extraction and classification. Scaling up to much larger data volumes will also be possible. For example, under the conservative assumption that 1 per cent of the approximately $10^{12}$ pixels that make up the SDSS are detected, the entirety of SDSS could be processed in under 3000~CPU~hours (assuming a modeling/feature extraction step has already been performed). Assuming the same set of assumptions for LSST (although LSST images will have more detected pixels than SDSS due to greater depth), the smaller pixel size and larger area of LSST would require around 16,000 CPU hours. This still represents a relatively trivial amount of processing time on even a modest high performance computing (HPC) cluster (e.g. around 1 day with 500 threads of execution). \subsection{Cross-matching objects from the algorithm with the HSC-SSP} We cross-match the galaxy centroids from the HSC-SSP DR1 Ultradeep catalogue with the object centroids from the graph-clustering algorithm, excluding objects that do not have a match within $0.8''$, which is approximately the PSF of the worst HSC $i$-band seeing (note that the median $i$-band seeing is $0.6''$). Of the 89,257 objects for which the algorithm produced classification, 53,003 have more than 15 pixels, which we consider to be large enough for reliable classification, as a sufficient range of spatial scales can be captured. Of these, 41,062 (77 per cent) have centroids that match an object in the HSC catalogue within $0.8''$. Mismatch between centroids arises because, at present, we use a simple connected component labelling algorithm to identify objects, rather than the individual segmentation maps used by the HSC-SSP pipeline. The mismatch becomes increasingly worse for very large objects (see Fig \ref{fig:npix}) and is, therefore, principally a problem in the very local Universe. However, in our analysis below, we study more distant objects ($z \gtrsim 0.3$), with much smaller projected sizes. The fraction of matched objects is, therefore, much larger as, on average 95 per cent of objects smaller than 100 pixels are successfully cross-matched (compared with 15 per cent of objects larger than 1000 pixels). \section{Morphological catalogue} \label{sec:catalogue} \subsection{Benchmarking of morphological clusters via visual classification} \label{sec:classification} \begin{figure} \centering \subfigure[\textit{Spiral galaxies.}]{\includegraphics[width=0.45\textwidth]{Figures/spiral_sample.pdf}} \subfigure[\textit{S0/Sa galaxies.}]{\includegraphics[width=0.45\textwidth]{Figures/S0_sample.pdf}} \subfigure[\textit{Elliptical galaxies.}]{\includegraphics[width=0.45\textwidth]{Figures/ETG_sample.pdf}} \caption{$g$-$r$-$i$ false colour images showing a random selection of galaxies from each major morphological group. The samples are further split into bins of redshift, indicated by the label in the top right of each coloured box. Panel (a) shows objects classified as spirals, panel (b) shows objects classified as S0/Sa and panel (c) shows objects classified as ellipticals.} \label{fig:samples} \end{figure} The unsupervised graph-clustering algorithm allows us to effectively compress the galaxy population into a small number of morphological clusters. Crucially, the number is small enough to make visual classification of these clusters tractable for individual researchers. To generate a usable morphological catalogue, we benchmark the outputs of the algorithm via visual classification of each of the $k=160$ morphological clusters. These classifications are based on a subset of $g$-$r$-$i$ images of the 10 highest silhouette-score objects in each cluster, plus a sample of 10 objects selected at random, in order to assess the morphological purity of the cluster. We do not classify individual galaxies but perform visual classification on the cluster as a whole. We classify each cluster into one of three broad Hubble \citep{Hubble1936} morphological types: elliptical galaxies, S0/Sa galaxies and spiral galaxies. We also store finer morphological information, e.g. the type of spiral morphology (Sb, Sc, Sd) and noteworthy colour or structural features (e.g. when spirals appear unusually red or show clumpy structure, or when elliptical galaxies appear unusually blue). Except in Section \ref{sec:star_separation}, we only consider objects which are extended \citep[based on the difference between the PSF magnitude and the \texttt{cModelMag} magnitude;][]{Eisenstein2001}. We indicate the total number of objects in each morphological cluster that are not extended in Table \ref{table:props}. Figure \ref{fig:samples} shows a random selection of objects that are classified as having spiral, S0/Sa and elliptical morphologies, split into four redshift ranges. Note that, although a sample of individual objects in each cluster are visually classified in order to determine a morphological type for that cluster, the majority of objects in each cluster are unseen. Fig \ref{fig:groups} shows some individual morphological clusters identified by the algorithm. For example, cluster 10 contains galaxies identified as Sc/Sd Hubble types (Fig \ref{fig:groups:a}), cluster 14 is comprised of systems that appear to be high-redshift mergers (Fig \ref{fig:groups:b}), cluster 122 contains galaxies which show blue ring-like features indicative of the recent accretion of gas-rich satellites (Fig \ref{fig:groups:c}) and cluster 127 is composed of clumpy discs (Fig \ref{fig:groups:e}). As described in Section \ref{sec:release} below, the visual classifications of each morphological cluster, and the average properties of objects in these clusters, are presented in Appendix \ref{app:tables} and Table \ref{table:props}. \begin{figure} \centering \subfigure[Cluster 10: \textit{Sc/Sd galaxies.}]{\includegraphics[width=0.43\textwidth]{Figures/GRP_test_10.pdf}\label{fig:groups:a}} \subfigure[Cluster 14: \textit{High-$z$ mergers.}]{\includegraphics[width=0.43\textwidth]{Figures/GRP_test_14.pdf}\label{fig:groups:b}} \subfigure[Cluster 122: \textit{Discs with blue rings, possibly indicative of the recent accretion of blue satellites.}]{\includegraphics[width=0.43\textwidth]{Figures/GRP_test_122.pdf}\label{fig:groups:c}} \subfigure[Cluster 127: \textit{Clumpy discs.}]{\includegraphics[width=0.43\textwidth]{Figures/GRP_test_127.pdf}\label{fig:groups:e}} \caption{Examples of interesting morphological clusters produced by the algorithm: (a) Sc/Sd galaxies (b) merging systems at high-redshift (c) disks with blue ring-like structures that might be the result of the recent accretion of gas-rich satellites (d) clumpy disks in the nearby Universe. Spatial scales are indicated by the white bar in the top-left panel of each cluster.} \label{fig:groups} \end{figure} \subsection{Star-galaxy separation} \label{sec:star_separation} \begin{figure} \centering \includegraphics[width=0.45\textwidth]{Figures/stellar_locus.pdf} \caption{The positions of ellipticals (red), spirals (blue), S0/Sa galaxies (green) and stars (orange) in the rest-frame $g-r$ vs $r-i$ plane. The black contour contains 95 per cent of objects classified as not extended in the HSC-SSP catalogue.} \label{fig:stellar_locus} \end{figure} Figure \ref{fig:stellar_locus} presents a colour-colour diagram, showing the $g-r$ and $r-i$ colours for spirals (blue), S0/Sa galaxies (green), ellipticals (red) and stars (orange). The stellar locus is clearly delineated, occupying a distinct region of colour-colour space compared to spirals, ellipticals and S0/Sa galaxies. The objects that are morphologically identified as stars by the graph-clustering algorithm occupy the same region as objects that are identified as being not extended by the HSC pipeline (as defined in Section \ref{sec:classification}). The region of colour-colour space containing objects that are not extended is indicated by a black contour, which contains 95 per cent of all such objects in our sample. It is worth noting that optical colours alone may not encode sufficient information to effectively separate stars from galaxies \citep{Fadely2012}. However, the algorithm employed here is able to distinguish between stars and resolved galaxies, even within the region where they share the same colours, because resolved galaxies and unresolved stars do not share the same (spatial) power spectra or distribution of patch types, and therefore, do not fall into the same morphological clusters. We note that the relatively simple method used in \citet{Eisenstein2001} (as described in Section \ref{sec:classification}) to determine extendedness is not always a good proxy for stellarity. Although star-galaxy separation has traditionally used purely morphometric information to classify stars and galaxies in optical survey data \citep[e.g.][]{Kron1980, Eisenstein2001, Henrion2011}, new ground-based deep-wide surveys, which contain many more unresolved galaxies than stars at faint apparent magnitudes \citep{Fadely2012,Soumagnac2015}, represent an emerging challenge. Further work is therefore needed in order to determine whether the algorithm can effectively distinguish faint, unresolved galaxies from stars in very deep images. We note, however, that this does not affect the analysis in this study, since we are focused on bright objects. \subsection{Completeness of the UML-classified galaxy sample} \begin{figure} \centering \includegraphics[width=0.45\textwidth]{Figures/test_sb.pdf} \caption{The $i$-band apparent-magnitude distribution in the HSC-SSP Ultradeep catalogue (dashed grey histogram) and the distribution of the subset of these sources that has been matched and classified by the graph-clustering algorithm (solid dark-blue histogram). Light-blue, red and green histograms indicate the distribution of objects that are identified as spirals, ellipticals or S0/Sa galaxies respectively. The black solid line indicates the completeness as a function of apparent magnitude (with values indicated on the $y$-axis) and the grey hatching indicates the region where the completeness falls below 50 per cent.} \label{fig:sb_test} \end{figure} In Fig \ref{fig:sb_test}, we compare the distribution of $i$-band magnitudes from the HSC-SSP DR1 Ultradeep survey (grey) and the distribution for objects that are large enough to be classified by the graph-clustering algorithm and then successfully matched to the HSC-SSP DR1 Ultradeep catalogue (dark blue). The black line indicates the completeness, i.e. the fraction of all galaxies in each magnitude bin that can be classified by the algorithm and then matched to the HSC-SSP. The completeness values are indicated by the right-hand $y$-axis. While the completeness of the full sample only begins to decline significantly around $m_{i}>27$~mag, a magnitude cut of $m_{i}<22.5$~mag ensures that a majority (i.e. more than 50 per cent) of objects in the Ultradeep survey have large enough sizes for robust morphological classification using the graph-clustering algorithm. We note that this cut appears to vary as a function of galaxy morphology, as demonstrated by the brighter limiting magnitudes for some morphologies, particularly for ellipticals. This is likely the result of different average projected sizes, with ellipticals being typically more compact than spiral galaxies that have similar magnitudes, particularly at low luminosities \citep[e.g.][]{Lange2015}. In the subsequent figures in this section, we consider galaxies brighter than this $m_{i}=22.5$~mag threshold. We also show that the size criterion imposed by the algorithm does not produce biased galaxy populations as a result of the classification and matching procedure. \begin{figure} \centering \subfigure[]{\includegraphics[width=0.45\textwidth]{Figures/test_photoz.pdf}\label{fig:tests:a}} \subfigure[]{\includegraphics[width=0.45\textwidth]{Figures/test_m.pdf}\label{fig:tests:b}} \subfigure[]{\includegraphics[width=0.45\textwidth]{Figures/test_sfr.pdf}\label{fig:tests:c}} \caption{Distributions of galaxy properties (\textbf{(a)} \textsc{mizuki} photometric redshifts, \textbf{(b)}: stellar masses, \textbf{(c)}: SFRs) in the full HSC-SSP Ultradeep catalogue (grey) and for the subset of galaxies that has been matched and classified by the algorithm (blue). Dotted blue and grey lines show the distributions for galaxies with $m_{i} < 22.5$~mag. \textbf{Bottom}: The fraction of matched and classified objects with $m_{i} < 22.5$~mag as a function of photometric redshift.} \label{fig:tests} \end{figure} Fig \ref{fig:tests:a} shows the distribution of photometric redshifts derived using the \textsc{mizuki} code, for the full Ultradeep catalogue (grey) and the matched catalogue from the algorithm (dark blue). Dotted grey and dark blue lines show the same for all galaxies with $i$-band absolute magnitudes brighter than 22.5~mag for the full and matched samples respectively. The lower panel shows the fraction of galaxies with $m_{i} < 22.5$~mag that are matched as a function of photometric redshift. As might be expected, the matched sample, the magnitude limited matched sample and the full magnitude limited sample all share similar distributions, but the matched sample falls off more quickly compared to the full sample, as their projected sizes increase with redshift, making more objects unclassifiable. Figs \ref{fig:tests:b} and \ref{fig:tests:c} show the corresponding analyses for stellar masses and SFRs respectively. Again, the histograms show the distributions of stellar masses and SFRs for the full HSC-SSP Ultradeep catalogue (grey), the distribution for matched objects only (dark blue) and the full and matched distributions for $m_{i}<22.5$~mag (shown using grey and blue dotted lines). The lower panels again show the fraction of galaxies with $m_{i} < 22.5$~mag that are matched as a function of photometric redshift. While the redshift distributions of objects is influenced by the size cut, for objects brighter than the magnitude cut, the full and matched samples have very similar distributions of physical properties. This indicates that the size cut does not introduce any bias in such galaxy properties (e.g. high SFRs), so that a comparison of average properties as a function of redshift is possible. \subsection{Released data products} \label{sec:release} The released data products for the HSC-SSP DR1 are contained in two tables. The first table comprises a list of morphological clusters with their associated visual classifications and median values of key galaxy properties within the cluster (surface-brightness, stellar mass, specific SFR, rest-frame $(g-r)$ colour and absolute $r$-band magnitude). This table is presented in its entirety in Appendix \ref{app:tables}. The second table is a list of individual HSC-SSP galaxies with their associated morphological cluster number and useful ancillary information, including their coordinates, HSC-SSP DR1 ID, extendedness, size in pixels and silhouette score. Note that some morphological clusters can have some contamination from stars. Users should discard objects which are classified as not extended and which are, therefore, likely to be stars. The first ten rows of this table is presented in Table \ref{tab:galaxy_properties} of Appendix \ref{app:tables}. Both tables are available at the following URL: \url{https://github.com/garrethmartin/HSC_UML} \subsubsection{HSC-SSP DR2 release} More comprehensive data products will be made available for the newer HSC-SSP DR2 UDEEP/DEEP data release at the same URL (\url{https://github.com/garrethmartin/HSC_UML}). We will provide multiple catalogues for different numbers of clusters (values of $k$ from 2 - 10, then increasing in increments of 10 up to 200). We will give average silhouette scores for each catalogue as a whole, in order to allow users to select the optimal number of clusters if desired, as well as provide diagnostic and silhouette plots for each cluster. We will provide the feature vectors for each galaxy with code for performing searches on these feature vectors to find similar objects \citep[i.e. a `similarity search',][]{Hocking2018} as well as code to run the entire algorithm on other data if desired. \section{Galaxy properties as a function of morphological type} \label{sec:analysis} In this section, we explore the robustness of the morphological classifications produced by our algorithm. We study the distributions of key galaxy properties (e.g. stellar masses, star formation rates, rest-frame colours) as a function of morphological type, as a test of the veracity of our classifications. We demonstrate that the distributions of such galaxy properties in well-known morphological groups follow expected trends from studies using traditional visual morphological classification methods \citep[e.g][]{Menanteau2006,Kelvin2014,Khim2015,Willett2017}. \subsection{Sample selection and methodology} \subsubsection{Redshift binning} \begin{figure} \centering \includegraphics[width=0.45\textwidth]{Figures/redshift_distribution.pdf} \caption{\textbf{Main panel:} The redshift and stellar mass distributions of our sample for $m_{i}<22.5$ mag. The $x$- and $y$-axes indicate the median redshift and stellar mass respectively, derived from the \textsc{mizuki} fits to the optical SED of each object. Error bars indicate corresponding $1\sigma$ errors on the medians in each of the redshift bins. \textbf{Inset:} the \textit{unweighted} redshift distribution of our sample. The thickness of the line indicates the $2\sigma$ confidence interval, calculated using 10,000 draws from the redshift probability distribution of each galaxy, assuming a two-sided Gaussian error around the median value. Red, orange and green hatched regions indicate the three redshift bins used.} \label{fig:sample_z} \end{figure} We first bin our galaxies into three redshift ranges: $0.3<z<0.5$, $0.5<z<0.7$ and $0.7<z<0.9$. A minimum redshift of $z=0.3$ is chosen to ensure that the 3.5 deg$^{2}$ Ultradeep footprint encompasses a cosmological co-moving area greater than $85~\mathrm{Mpc}\times85~\mathrm{Mpc}$ in the lowest redshift bin, so that our galaxy populations are large enough to be statistically representative, and unlikely to be significantly biased by large-scale structure. For completeness, we do additionally consider a lower redshift bin ($0.1 < z < 0.3$) when studying stellar mass functions in Section \ref{sec:stellar_mass}, but this bin is likely to be strongly affected by cosmic variance. Fig \ref{fig:sample_z} presents a scatter plot showing the distribution of median stellar masses of individual galaxies as a function of their median redshifts. Points are colour coded by their redshift bin. Open circles with error bars indicate the central redshift and median stellar mass of each redshift bin and the $1\sigma$ error of these quantities in each bin. The inset shows the redshift distribution of galaxies. The thickness of the line indicates the $2\sigma$ confidence interval, derived using 10,000 draws from the redshift probability distribution, which assumes a two-sided Normal error around the median redshift, with a standard deviation equal to the upper and lower redshift errors. \subsubsection{$1/V_{max}$ weighting and simulation of uncertainties} In order to correct for Malmquist bias \citep{Malmquist1922}, we weight galaxy counts using $1/V_{max}$, the inverse of the maximum volume in which it would be possible to detect an object of a given luminosity \citep[e.g.][]{Schmidt1968, Weigel2016}. We do this by first making 10,000 random draws from the redshift probability distribution for each object. We assume that the probability density function (PDF) follows a two-sided Normal distribution, with a central value equal to the median \textsc{mizuki} redshift, $\langle z \rangle$, but with different standard deviations ($\sigma_{upper}$ and $\sigma_{lower}$) on either side of the central value. Each redshift, $z_{draw}$, is therefore drawn from the following distribution: \begin{equation} z_{draw} \sim \begin{cases} \mathcal{N}(z\ |\ \langle z \rangle, \sigma^{2}_{lower}) \ \textrm{if} \ z\le \langle z \rangle\\ \mathcal{N}(z\ |\ \langle z \rangle, \sigma^{2}_{upper})\times(\sigma_{lower}/\sigma_{upper}) \ \textrm{if} \ z>\langle z \rangle \end{cases} \end{equation} \noindent where $\mathcal{N}(z\ |\ \mu, \sigma^{2})$ is a Normal distribution with a central value equal to the median \textsc{mizuki} redshift, $\langle z \rangle$, and a variance of $\sigma^{2}$. $\sigma_{upper}$ is the 84th percentile of the redshift PDF, and $\sigma_{lower}$ is the 16th percentile of the redshift PDF. The factor of $\sigma_{lower}/\sigma_{upper}$ ensures that the distribution remains continuous. In the \textsc{mizuki} fitting, the dominant source of uncertainty in the inferred stellar mass and absolute magnitude is the luminosity distance, rather than the model template weights or dust attenuation. The equivalent absolute magnitude, $M_{i, draw}$, and stellar mass, $M_{\star, draw}$, at a given redshift can therefore be well approximated by only varying their values by the square of the ratio of the luminosity distance, $D_{L}(z)$, at the redshift of the draw and the median redshift. We can therefore calculate the new stellar mass for each drawn redshift as follows: \begin{equation} M_{\star, draw} \approx \langle M_{\star}\rangle \big[ D_{L}(z_{draw}) / D_{L}(\langle z \rangle) \big]^{2} \end{equation} \noindent and similarly for the absolute magnitude: \begin{equation} M_{i, draw} \approx \langle M_{i} \rangle \big[ D_{L}(z_{draw}) / D_{L}(\langle z \rangle) \big]^{2}. \end{equation} \noindent We then find the maximum redshift, $z_{max}$ at which an object with absolute magnitude $M_{i,draw}$ will fall below the detection limit (the redshift where the distance modulus, $\mu$, is equal to $m_{lim, i} - M_{i,draw}$) and thus obtain $V_{max}$, which is proportional to the co-moving volume out to $z_{max}$. \begin{equation} V_{max} \propto D_{c}(z_{max})^{3}, \end{equation} \noindent where $D_{c}(z)$ is the comoving distance at $z$. Note that the minimum size (15 pixels) that we impose influences the limiting apparent magnitude. Since the average size of objects at a given magnitude varies between morphological types, we use different values of $m_{lim,i}$ when calculating $z_{max}$, corresponding to the limiting magnitude found for the morphological type in question (e.g. as in Fig \ref{fig:sb_test}). Since we are primarily interested in the relative distribution of galaxy properties between morphological types, rather than the exact normalisation of the number density, we do not take into account the area of the survey when calculating $V_{max}$. Following the method of weighting and simulating uncertainties described above, we take 10,000 draws from the redshift distribution for individual objects in each morphological type. For each of the 10,000 draws, we calculate new stellar masses and $i$ band absolute magnitudes and thus the value of $V_{max}$ for each galaxy. After binning our sample into four redshift bins, based on the draws from the redshift distribution (with central redshifts of 0.2 0.4, 0.6 and 0.8), we use $1/V_{max}$ weighted univariate Gaussian kernel density estimation \citep[e.g.][]{Klein2006} with a kernel bandwidth of 0.1~dex to produce a galaxy stellar mass function for each redshift bin. We use the median value and 1 and 2 $\sigma$ dispersions (defined by the central 68 and 95 per cent of values around the median) to characterise the galaxy stellar mass function and its uncertainty for each morphological type. \subsection{Stellar mass distributions as a function of morphological type} \label{sec:stellar_mass} \begin{figure} \centering \includegraphics[width=0.50\textwidth]{Figures/elliptical_frac_combined.pdf} \caption{\textbf{Left}: Galaxy stellar mass functions for spirals (blue), S0/Sa galaxies (green) and ellipticals (red) in four redshift bins with arbitrary normalisation. Light and dark coloured regions indicate the $1\sigma$ and $2\sigma$ confidence intervals respectively, based on 10,000 draws from the redshift distribution of each galaxy. To enable comparison between the stellar mass functions at various redshifts, the pale dashed lines show the stellar mass function for the $0.3<z<0.5$ bin, normalised to the mass function in each redshift bin. \textbf{Right}: The evolution of the spiral, S0/Sa and elliptical fractions between $z=0.1$ and $z=0.9$. Blue, green and red lines show the fraction of galaxies that are spirals, S0/Sa and ellipticals, calculated from the galaxy stellar mass functions on the left. Light and dark coloured regions indicate the $1\sigma$ and $2\sigma$ confidence intervals respectively, based on 10,000 draws from the redshift distribution of each galaxy. Fractions are only plotted up to the point where the stellar mass function remains complete. Lighter dotted lines in the second to top panel indicate the elliptical, S0/Sa and spiral fractions from \citet[][Fig 3]{Kelvin2014} at $z<0.06$.} \label{fig:elliptical_fraction} \end{figure} Fig \ref{fig:elliptical_fraction} shows the evolution of the galaxy stellar mass function (left-hand column) and the evolution of the morphological fractions (right-hand column) as a function of redshift. We include a redshift bin in the range $0.1<z<0.3$ for completeness, however we avoid drawing any conclusions at these epochs, as the volume of this subsample is not large enough to be statistically representative, since it is likely to be strongly affected by cosmic variance. The light dotted lines in the second to top panel of the right hand column indicate the elliptical, S0/Sa and spiral fractions from \citet[][Fig 3]{Kelvin2014} at $z<0.06$. We note that the comparison is not perfect due to different definitions of morphological type, redshift range as well as cosmic variance. We attempt to create an equivalent definition for spirals by combining the LBS (little blue spheroid), Sab-Scd and Sd-Irr definitions from \citet[][Fig 3]{Kelvin2014}. The inclusion of irregular galaxies in \citep{Kelvin2014} may also be responsible for some of the discrepancy. However, regardless of any discrepancy, the general trend in spiral, elliptical and S0/Sa fractions remains the same, in agreement with other work \citep[e.g.][]{Conselice2008,Vulcani2011} As shown in previous work \citep[e.g.][]{Conselice2008,Ilbert2010,Conselice2014}, there is a general trend for elliptical and S0/Sa fractions at a given stellar mass to increase towards lower redshifts. These systems increasingly dominate the number density at high stellar masses towards the present day \citep[e.g.][]{Wilman2012, Kelvin2014}, as spiral galaxies are quenched to form S0/Sa systems and/or undergo morphological transformation via mergers to form ellipticals. In the highest redshift bin ($0.7<z<0.9$), ellipticals almost entirely dominate at masses greater than $10^{11}$M$_{\odot}$, whereas S0/Sa galaxies become more important in the same mass range towards lower redshifts. While S0/Sa galaxies and ellipticals share similar mass functions, at least at lower redshifts, the dominance of ellipticals at high stellar mass in the early Universe indicates that a distinct, more gradual, evolutionary channel may be responsible for producing the S0/Sa populations. In particular, ellipticals likely form at epochs that predate those where the mechanisms that produce S0/Sa populations \citep[e.g.][]{Dressler1997,Cerulo2017,Oh2019} are most efficient. This is likely to be particularly true for the most massive ellipticals, which must have formed rapidly at high or intermediate redshift \citep[e.g.][]{Jaffe2011,Tomczak2014,Company2015b}. The high-mass end of the elliptical mass function does not evolve significantly over redshift and is already in place in the highest redshift bin. The S0/Sa mass function appears instead to be built up from lower-mass systems, indicating a different evolutionary channel from their elliptical counterparts. At all redshifts, S0/Sa type galaxies typically dominate at intermediate masses, between spirals and ellipticals \citep[e.g.][]{Vulcani2011,Kelvin2014}, with the peak of the S0/Sa fraction moving towards lower stellar masses at lower redshifts. \subsection{Star formation rates and rest-frame colours as a function of morphological type} \begin{figure} \centering \includegraphics[height=0.8\textheight]{Figures/mssfr_sc.pdf} \caption{Scatter plots with contours overlaid, showing the distribution of galaxies as a function of SFR and stellar mass, for galaxies classified as elliptical (red), S0/Sa (green) and spiral (blue). The dots show individual galaxies, while contours show the $1/V_{max}$ weighted density, with log$_{10}$ distributed levels. Each panel shows a different redshift range (using the \textsc{mizuki} derived photometric redshifts) which is indicated in the top-left corner. Histograms at the top and right-hand side of each panel show the distributions of stellar mass and SFRs respectively, for each morphological type. Coloured triangles indicate the $1/V_{max}$ weighted median SFRs for ellipticals, S0/Sa galaxies and spirals. The number in the bottom right corner of each panel indicates the total number of objects in each redshift bin.} \label{fig:dist_MS} \end{figure} Figs \ref{fig:dist_MS} and \ref{fig:dist_col_mag} show the star formation main sequence and the $M_{i}$ vs. rest-frame $g-i$ colour-magnitude diagram, for three redshift bins (with central redshifts of 0.4, 0.6 and 0.8). Contours show the density of objects weighted by $1/V_{max}$. Galaxies classified as spirals inhabit a well-defined main sequence (Fig \ref{fig:dist_MS}), while ellipticals dominate a cloud below this sequence. S0/Sa galaxies lie somewhere between these two populations. Many S0/Sa galaxies are not quenched and remain on the main locus of the star formation main sequence, with a small number lying further below. Similarly, the colour-magnitude diagram (Fig \ref{fig:dist_col_mag}) shows a clear bi-modality, with galaxies classified as ellipticals occupying the `red sequence' and galaxies classified as spirals occupying the `blue cloud' \citep[e.g][]{Baum1959,Visvanathan1981}. S0/Sa galaxies inhabit both parts of the diagram, but largely occupy the space in between the two distributions defined by the spiral and elliptical populations. The histograms above each panel in Fig \ref{fig:dist_MS} show the distribution of stellar masses for each morphological type. In agreement with other studies \citep[e.g.][]{Kelvin2014}, we find that the stellar mass function of S0/Sa galaxies is much closer to that of ellipticals than spirals. Spirals are much less massive, on average, than ellipticals and S0/Sa galaxies, while S0/Sa galaxies have marginally lower stellar masses than ellipticals. The histograms on the right-hand side of each panel in Fig \ref{fig:dist_MS} show the distributions of SFRs. Coloured arrow heads indicate the $1/V_{max}$ weighted median values \citep[e.g.][]{Edgeworth1888} of the SFRs in each population. While S0/Sa galaxies typically have SFRs that are comparable to spirals and higher than those found in ellipticals, they are typically more massive and therefore inhabit an intermediate range of values of specific SFRs. They remain redder and less star-forming than the majority of spirals, although the majority retain fairly high levels of star formation compared to ellipticals \citep[e.g.][]{Thronson1989,Pogge1993}. The histograms above each panel in Fig \ref{fig:dist_col_mag} show the distributions of absolute $i$-band magnitudes for each morphological type, while the histograms to the right of each panel show distributions of rest-frame $g-i$ colours. Again, coloured arrow heads indicate the $1/V_{max}$ weighted median values for each population. Galaxies classified as ellipticals and spirals inhabit opposite ends of a bi-modal distribution in $g-i$ colour, with galaxies classified as S0/Sa typically lying between the two populations \citep[e.g][]{Wilman2012,Lopez2018}. Given that different morphologies show some separation in integrated properties (e.g. stellar mass and SFR), it may be tempting, particularly when faced with the data volumes expected from future surveys, to use these properties as proxies for morphology. However, as previous studies have shown \citep[e.g.][]{Fadely2012,Vika2015}, spatial frequency information is essential for the robust morphological classification of both stars and galaxies (see also Section \ref{sec:star_separation}). We use our morphological classifications to explore this point in more detail. Fig \ref{fig:mode_groups} shows the positions of a random selection of objects classified as ellipticals, spirals and S0/Sa galaxies within the colour-colour (Fig \ref{fig:mode_groups:a}), colour-magnitude (Fig \ref{fig:mode_groups:b}), magnitude-magnitude (Fig \ref{fig:mode_groups:c}) and stellar mass-SFR (Fig \ref{fig:mode_groups:d}) planes. Regions of contiguous colour in each plot indicate parts of the parameter space which are dominated by objects of a given morphological type i.e. the parameter space is colour-coded by the modal group in each hexagonal bin. It is clear that a significant fraction of objects of different morphology can fall into the same regions of parameter space, regardless of the exact plane being considered. Thus, a large degree of overlap exists in the integrated properties of S0/Sa galaxies, spirals and ellipticals, not only in colour-colour, colour-magnitude and magnitude-magnitude space, but also in physical properties like stellar mass and SFR. Such integrated properties \textit{alone} are therefore not sufficient to separate objects morphologically. The spatial information contained in the power spectrum of each patch type, as well as the spatial distribution of patch types across each object, are essential ingredients of accurate morphological classification. \begin{figure} \centering \includegraphics[height=0.8\textheight]{Figures/grr_sc.pdf} \caption{Contour plots showing the distribution of galaxies as a function of $g-i$ colour and rest-frame $i$-band absolute magnitude, for galaxies that have been classified as elliptical (red), S0/Sa (green) and spiral (blue). Dots show individual galaxies, while contours show the $1/V_{max}$ weighted density with log$_{10}$ distributed levels. Each panel shows a different redshift range (using the \textsc{mizuki} derived photometric redshifts) indicated in the top left corner. Histograms at the top and right hand side of each panel show the distribution of rest-frame $i$-band magnitudes and $g-i$ colours respectively, for each morphological type. Coloured triangles indicate the $1/V_{max}$ weighted median $g-i$ colours for ellipticals, S0/Sa galaxies and spirals. The number in the bottom right corner of each panel indicates the total number of objects in each redshift bin.} \label{fig:dist_col_mag} \end{figure} \begin{figure*} \centering \subfigure[]{\includegraphics[width=0.45\textwidth]{Figures/Algo_test_mode_0.pdf}\label{fig:mode_groups:a}} \subfigure[]{\includegraphics[width=0.45\textwidth]{Figures/Algo_test_mode_1.pdf}\label{fig:mode_groups:b}} \subfigure[]{\includegraphics[width=0.45\textwidth]{Figures/Algo_test_mode_2.pdf}\label{fig:mode_groups:c}} \subfigure[]{\includegraphics[width=0.45\textwidth]{Figures/Algo_test_mode_3.pdf}\label{fig:mode_groups:d}} \caption{Morphological clusters as a function of various parameters. Contiguous hexagonal bins with the same colour indicate regions in the parameter space which share the same dominant group. We show the most frequent morphological clusters in colour-colour \textbf{(a)}, colour-magnitude \textbf{(b)}, magnitude-magnitude \textbf{(c)} and stellar mass vs. star formation rate \textbf{(d)} space. Open red circles, blue squares, green diamonds and orange stars show the positions of a random sample of 200 ellipticals, spirals, S0/Sa galaxies and stars within each parameter space.} \label{fig:mode_groups} \end{figure*} \section{Summary} \label{sec:summary} Morphology is a fundamental quantity that encodes the principal mechanisms that drive the evolution of individual galaxies. Essential for the full spectrum of galaxy-evolution studies, morphology is an important parameter for an array of topics in astrophysics, e.g. as a prior in photometric redshift pipelines and as contextual data in transient lightcurve classifications. A rich literature exists on morphological-classification techniques, with methods ranging from automated classification (e.g. via parametric and non-parametric reductions of galaxy images and machine-learning techniques) to direct visual classification by human classifiers, which is typically used to benchmark automated algorithms. Notwithstanding the array of techniques on offer, the forthcoming era of `Big Data' deep-wide surveys poses unique challenges for measuring galaxy morphologies. The sheer volume of data expected from surveys like LSST and Euclid makes visual classification intractable for such datasets (even via massively-distributed systems like Galaxy Zoo) and makes some degree of automation essential for this exercise. The short cadence of surveys like LSST presents an additional challenge, because repeatedly producing training sets, that are required for supervised machine-learning techniques, on short timescales may be impractical. Unsupervised machine-learning (UML) offers an attractive solution to these problems and an ideal route for the morphological classification of galaxies in next-generation surveys. An effective UML algorithm can autonomously compress an arbitrarily large galaxy population into a small set of morphological clusters whose members have similar morphology. If the number of clusters is small enough (e.g in the hundreds or less), then this makes it tractable to benchmark them using visual classification by individual researchers. The resultant classifications can thus combine both the speed of automation and the accuracy of visual classification. Here, we have employed such a UML algorithm, which automatically identifies distinct groups of galaxy types from survey pixel data, to separate galaxies in the HSC-SSP DR1 Ultradeep layer into 160 morphological clusters. This technique extracts sub-image patches from multi-band HSC data, each of which are transformed into a rotationally-invariant representation of a small region of the survey data, efficiently encoding colour, intensity and spatial frequency information. Utilising growing neural gas and hierarchical clustering algorithms, it then groups patches into a library of patch types, based on their similarity, and assembles feature vectors for each object, which describe the frequency of each patch type. A $k$-means algorithm is then used to separate objects into morphological clusters, based on the similarity of their feature vectors. We have visually inspected a representative sample of objects in each morphological cluster to classify them into three broad morphological types: elliptical galaxies, S0/Sa galaxies and spiral galaxies. We also provide finer morphological information e.g. the type of spiral morphology (Sb, Sc, Sd) and noteworthy colour or structural features (e.g. when spirals appear unusually red or show clumpy structure, or when elliptical galaxies appear unusually blue). To test the robustness of the classifications, we have shown that galaxies in different morphological classes reproduce known trends in key galaxy properties as a function of morphological types at $z<1$, e.g. stellar mass functions, rest-frame magnitudes and colours and the position of galaxies on the star formation main sequence. Our study demonstrates the potential of UML in the morphological analysis of forthcoming deep-wide surveys. The combination of initial UML-driven automation, followed by benchmarking via visual classification, is likely to become an optimal tool for the morphological analysis of surveys like LSST. While this study has focused on bright galaxies at $z<1$, it is worth noting that a significant fraction of objects, especially at low masses, inhabit the low-surface-brightness (LSB) Universe \citep[e.g.][]{Martin2019}. In forthcoming work, we will optimize the algorithm for the morphological classification of LSB galaxies and the detection of LSB structures, such as faint merger-induced tidal features, which will be routinely detectable in future surveys like those from the LSST. Furthermore, while our morphological classifications are limited to $z<1$, due to the ground-based nature of the HSC images, implementation of this UML algorithm on forthcoming higher-resolution data, e.g. from Euclid, will enable virtually all-sky morphological classification of galaxies out to high redshift. \section*{Acknowledgements} We thank the anonymous referee, whose comments helped us improve the quality of this paper. We thank Dan Smith for many interesting discussions. GM and SR acknowledge support from the Science and Technology Facilities Council [ST/N504105/1]. SK acknowledges a Senior Research Fellowship from Worcester College Oxford. This work in based, in part, on data collected at the Subaru Telescope and retrieved from the HSC data archive system, which is operated by Subaru Telescope and Astronomy Data Center at National Astronomical Observatory of Japan. The Hyper Suprime-Cam (HSC) collaboration includes the astronomical communities of Japan and Taiwan, and Princeton University. The HSC instrumentation and software were developed by the National Astronomical Observatory of Japan (NAOJ), the Kavli Institute for the Physics and Mathematics of the Universe (Kavli IPMU), the University of Tokyo, the High Energy Accelerator Research Organization (KEK), the Academia Sinica Institute for Astronomy and Astrophysics in Taiwan (ASIAA), and Princeton University. Funding was contributed by the FIRST program from Japanese Cabinet Office, the Ministry of Education, Culture, Sports, Science and Technology (MEXT), the Japan Society for the Promotion of Science (JSPS), Japan Science and Technology Agency (JST), the Toray Science Foundation, NAOJ, Kavli IPMU, KEK, ASIAA, and Princeton University. This paper makes use of software developed for the Large Synoptic Survey Telescope. We thank the LSST Project for making their code available as free software at \url{http://dm.lsst.org}. The Pan-STARRS1 Surveys (PS1) have been made possible through contributions of the Institute for Astronomy, the University of Hawaii, the Pan-STARRS Project Office, the Max-Planck Society and its participating institutes, the Max Planck Institute for Astronomy, Heidelberg and the Max Planck Institute for Extraterrestrial Physics, Garching, The Johns Hopkins University, Durham University, the University of Edinburgh, Queen’s University Belfast, the Harvard-Smithsonian Center for Astrophysics, the Las Cumbres Observatory Global Telescope Network Incorporated, the National Central University of Taiwan, the Space Telescope Science Institute, the National Aeronautics and Space Administration under Grant No. NNX08AR22G issued through the Planetary Science Division of the NASA Science Mission Directorate, the National Science Foundation under Grant No. AST-1238877, the University of Maryland, and Eotvos Lorand University (ELTE) and the Los Alamos National Laboratory. \begin{comment} Plan for the paper: \begin{enumerate} \item Summary of the algorithm, stress that this is unsupervised which is ideal for new deep-wide surveys with unprecedented data volumes \item Groups \item Comparison with physical properties from SED fits \end{enumerate} \section*{Released data products} \subsection*{Catalogue} \begin{itemize} \item Galaxy ID in HSC catalogue \item RA \item DEC \item Cluster number \item Silhouette score \item Stellarity from HSC? \end{itemize} \subsection*{Feature vectors} Releasing the feature vectors will be a good way for people to associated objects that are shredded by deblenders e.g. galaxies and theit tidal features. We could output an image with patch types e.g. a 16 bit image which contains the features vectors associated with each pixel in the survey image. \end{comment} \bibliographystyle{mnras}
\section{Introduction} Over the past decade, approximately two hundred supermassive black holes (SMBHs) have been discovered with masses of $\gtrsim 10^9\,{\rm M_\odot}$ at redshift $z\gtrsim6$ \citep[e.g.][and references therein]{Fan01,Willott10,Mortlock11,Venemans13,DeRosa14,Wu15,Jiang16,Matsuoka18,Banados18,YangJ19,WangR19,Onoue19,Izumi19,Shen19,Matsuoka+2019}. The formation process of these SMBHs remains one of the most puzzling problems in astrophysics \citep[see, e.g.][for reviews]{Volonteri10,Haiman13,Gallerani17,SmithBromm2019,Inayoshi19}. Growth from stellar-mass BH remnants of Population~III (Pop~III) stars \citep[e.g.][]{Madau01,Abel02,Heger02,Tan04,VolonteriRees2006,McKee08,Yoshida08,Clark11Sci,Greif11,Susa14,Hirano14,Stacy16} to SMBHs is difficult because the gas accretion rate is suppressed by radiative and kinetic feedback processes \citep{Whalen+2004,Milosavljevic09,Alvarez09,Tanaka09,Tanaka12,Regan19} and growth by mergers is made inefficient by large recoil induced by gravitational wave emission during mergers, which unbinds the merger remnant BHs from the shallow potential wells of their early hosts~\citep{Haiman2004}. These difficulties have motivated several alternative pathways. One pathway is the direct collapse of supermassive stars (SMSs) \citep[e.g.][]{Omukai01,Oh02,Bromm03,Begelman06,Spaans06,Shang10,Hosokawa12,Agarwal12,Latif13,Sugimura14,Inayoshi14,Ferrara14,Tanaka14,Becerra15,Chon+2016,Hosokawa16,Umeda16,Hirano+2017,Haemmerle18}. If a gas cloud in a massive halo with virial temperature $T\gsim 8000\,$K has no metals or ${\rm H_2}$ molecules, the gas cloud can collapse without fragmentation and grow to become an SMS \citep{Oh02,Volonteri05}. However, the background UV radiation flux required to prevent ${\rm H_2}$ molecule formation is as high as a few times $10^4$ in units of $J_{21}$ \citep[see, e.g.][and references therein]{WolcottGreen19} because of the high density reached via atomic cooling~\citep{Omukai01,Oh02} and self-shielding of ${\rm H_2}$ for realistic UV spectra produced by Population~II stars \citep{WolcottGreen2011b,Sugimura14,Agarwal15,WolcottGreen2017}. The condition of such a strong background radiation is satisfied only in rare cases, in collapsing halos that have bright nearby neighbors \citep{Dijkstra+2008}. While this is a rare special configuration, it appears feasible for a sufficient number of such pairs of halos to form nearly simultaneously~\citep{Visbal+2014}, while avoiding metal pollution \citep{Dijkstra14}, tidal disruption~\citep{Chon+2016}, and photoevaporation~\citep{Regan+2017}. For gas in halos located in regions of unusually high baryonic streaming motions~\citep{Hirano+2017}, and/or in halos with unusually rapid merger histories experiencing compressional heating~\citep{Yoshida+2003,Fernandez+2014,Inayoshi+2018}, the UV flux required to avoid ${\rm H_2}$ cooling can be significantly reduced~\citep{Wise+2019}. A second possible pathway is hyper-Eddington accretion onto a stellar-mass BH \citep[][]{Begelman79,Volonteri05,Pacucci15,Inayoshi16,Sakurai16,Pacucci17,Sugimura18,Takeo18,Toyouchi19}. Here the problem is that inefficient angular momentum transfer is estimated to reduce the accretion rate (\citealt{Inayoshi18,Sugimura18}, but see \citealt{Alexander13} for a possible solution if the seed BH is surrounded by a massive and dense star cluster). Then the accretion of an isothermal rotating disk \citep{Oh02} may not be rapid enough to increase the mass of a BH by several orders of magnitude \citep{Sugimura18}. Also kinetic feedback may limit the growth rate of BHs \citep{Regan19}. A third possibility is runaway mergers of stars and stellar remnants in dense clusters \citep[e.g.][]{PortegiesZwart99,PortegiesZwart02,PortegiesZwart04,Gurkan04,Rasio04,Omukai08,Devecchi09,Vanbeveren09,Glebbeek09,Davies11,Fujii13,Lupi14,Katz15,Tagawa15,Tagawa16,Yajima16,Sakurai17,Sakurai18,Nakauchi18,Boekholt18,Reinoso18,AlisterSeguel19}. In high-density stellar systems, $\sim 10^{3-4}\,{\rm M_\odot}$ BHs can form in the cluster's center \citep{Omukai08,Devecchi09,Katz15,Sakurai17}. However the seed mass of $\sim 10^3\,{\rm M_\odot}$ may not be massive enough to grow into the SMBHs observed at $z\sim6$ \citep{diMatteo12,Regan19}. Thus it is still debated how high-$z$ SMBHs could have formed. In this study, we focus on environments similar to the direct collapse scenario. A significant caveat of this scenario is that the collapsing gas may fragment efficiently, resulting in the formation of a cluster of stars, preventing the gas from fueling the formation of a central SMS. This would then lead to a third pathway, which is expected to produce BH remnants with masses $\approx 10^{3-4}\,{\rm M_\odot}$. On the other hand, we propose here that if stars themselves continue to be accreted efficiently, a more massive SMS may form despite the fragmentation of the parent cloud. In order for this to occur, incoming stars must collide with the central star in sufficiently rapid succession such that the central star never has time to cool and contract and settle on the main sequence. This scenario is similar to the runaway mergers above, but differs in detail. Stars are brought to the central region of the halo by both gas and stellar dynamical friction. The central SMS bloats up to $\gtrsim$astronomical unit size, facilitating the continued accretion of other stars. To distinguish this from the usual ``runaway merger'' case, we refer to this variant as ``stellar bombardment''. To investigate the feasibility of such a scenario, we have performed numerical modeling, incorporating star formation, dynamical friction by gas and stars, gas accretion, stellar collisions, and gas ejection. After the submission of our paper, \citet{Chon20} presented results investigating similar scenarios (collapsing gas with a small amount of metal pollution without $\rm H_2$ molecules) using three-dimensional hydrodynamical simulations. They find that for metallicities up to $10^{-4}\,{\rm Z_\odot}$, a central star can keep growing to $\sim 10^4\,{\rm M}_\odot$ over $\sim 10^4\,\mathrm{yr}$ with high growth rate due to gas accretion and stellar accretion. Their results confirm the expectations in this paper. \section{Physical picture} The SMBHs of $\sim 10^9\,{\rm M}_\odot$ at $z\sim6$ are rare objects with an abundance $\sim1\,\mathrm{Gpc^{-3}}$, and thus rare conditions may be required to explain their formation \citep[e.g.][]{Buchner19}. The situation we consider is similar to the usual direct collapse scenario \citep[e.g.][]{Bromm03, Shang10}. In this scenario, ${\rm H_2}$ molecules are disrupted in the collapsing cloud by strong background radiation from nearby galaxies, the host halo is massive, and the collapsing cloud is not polluted by metals. These conditions keep the cloud at a high temperature, and so enable the cloud to collapse into an SMS without fragmentation. Recent studies have suggested that it may be difficult to satisfy these conditions \citep{Latif15}, particularly because a large ${\rm H_2}$-dissociating flux may be required for an extended period, prior to reaching the ``atomic cooling'' threshold~\citep{Regan+2017}. This may be alleviated only in rare overdense regions, via dynamical heating accompanying unusually rapid merger histories~\citep{Wise+2019}. Here, instead, we relax the assumption of (the lack of) metal pollution. We consider a massive host halo, a moderate amount of metal pollution of $\sim10^{-5}\,{\rm Z_\odot}$, and no ${\rm H_2}$ molecules in a collapsing cloud. In such environments, fragmentation only occurs in high-density regions of $\sim 10^{11}\,\mathrm{cm^{-3}}$ due to weak cooling by a small amount of dust grains \citep{Omukai08,Latif16}. After an ultrahigh-density star cluster forms via gas fragmentation, runaway mergers can proceed. In this process, the final mass of the central object is constrained by radiation and supernova (SN) feedback onto a collapsing cloud from newly formed stars, since if gas was ejected by feedback, the central object could grow at most to some fraction of the masses of stars (and compact objects) in the cluster. The main feedback processes from stars are photoionizing UV radiation and/or SN explosions, which can eject gas from the host halo \citep{Whalen+2004,Kitayama04,Kitayama05}. Photoionization feedback from a star influences gas on large scales when the Str{\" o}mgren radius $R_{\mathrm{St},i}=(3{Q}_{\mathrm{ion},i} /4\pi n_\mathrm{gas}^2 \alpha_\mathrm{rec,B})^{1/3}$ exceeds the effective Bondi radius $R_{\mathrm{eff,B},i} \equiv (Gm_i/c_\mathrm{s}^3)(1-L_i/L_{\mathrm{E},i})$. Here $R_{\mathrm{eff,B},i}$ is the radius within which ambient gas is bound to the star and is modified from the standard Bondi radius to incorporate radiation pressure to ionized gas \citep{McKee08}, $\alpha_\mathrm{rec,B}$ is the case-B recombination coefficient for H (evaluated at $T=10^4$~K), $n_\mathrm{gas}$ is the gas number density, $G$ is the gravitational constant, $c_\mathrm{s}$ is the sound velocity of gas, ${Q}_{\mathrm{ion},i}$ is the ionizing photon number flux emitted from a star, $m_i$ is the mass of a star, $L_i$ is the luminosity of a star, $L_{\mathrm{E},i}$ is the Eddington luminosity, and subscript $i$ represents the $i^{\rm th}$ star in the cluster. For main-sequence stars of $\lesssim 30\,{\rm M_\odot}$ in high gas density environments of $\sim 10^{11}\,\mathrm{cm^{-3}}$, the Bondi radius always exceeds the Str{\" o}mgren radius~\citep{Tan04,Hosokawa12,McKee08}. Thus, photoionization feedback from the low-mass stars of $\sim 0.1-1 M_\odot$, expected to be born from metal-poor gas \citep{Omukai08,Dopcke13} cannot quench accretion and star formation unless these stars grow to $\sim 30\,{\rm M}_\odot$ by gas accretion or mergers. Furthermore, photoionization feedback from a massive star becomes efficient only after the star contracts \citep{Hosokawa12}. Stars typically contract on the Kelvin Helmholtz (KH) timescale, which is the timescale for a star to radiate away its gravitational binding energy. On the other hand, \citet{Hosokawa12} and \citet{Haemmerle18} have shown that when the accretion rate onto a protostar exceeds a critical rate of ${\dot m}_\mathrm{cri}\sim (0.006-0.03)\,{\rm M_\odot}/\mathrm{yr}$, the protostar continues expanding, because the heating rate of its envelope due to gas accretion exceeds the radiative cooling rate. The production rate of ionizing photons emitted by the soft spectrum of the bloated star is so low that the gas dynamics is not influenced by photoionization feedback \citep{Kitayama04}. \citet{Sakurai15} have found that even when there are quiescent phases of accretion onto protostars, they keep expanding if the time-averaged accretion rate within the KH timescale (evaluated at the stellar surface) exceeds ${\dot m}_\mathrm{cri}$. The above suggests that if the growth rate of massive stars by mergers with other stars, averaged on the KH timescale, exceeds ${\dot m}_\mathrm{cri}$, massive stars would continue expanding for the same reason. The growth of massive stars may remain efficient in this way, until gas is ejected by an SN explosions of one of the massive stars or by accretion feedback from a collapsed massive BH. Thus, there is a possibility that efficient stellar accretion may help to keep the stellar envelope expanding and so inhibit strong feedback from a contracting massive star, thereby leading to the formation of an SMS. In the rest of this paper, unless specified otherwise, the expression ``stellar accretion'' refers to the central protostar colliding and merging with other stars in the core of the halo. In this paper, we calculate the evolution of stars that form in high gas density environments as predicted in \citet{Omukai08}. \citet{Sakurai17} calculated the evolution of stars formed in a massive halo. While they assumed that some fraction of gas is converted to stars at the beginning of the simulation and at the same time gas is ejected, in this paper we consider the evolution of stars including the effects of continuous star formation. Our pathway is similar to the situation in \citet{Boekholt18}, who calculated collisions of accreting stars. In their model, stars are assumed to be kept in the expanded phase due to high gas accretion rates of $\gsim 0.03\,{\rm M}_\odot/\mathrm{yr}$ per star, and dynamical interactions are restricted to the two-body relaxation among stars, while hydrodynamical interactions with gas are neglected. \citet{Boekholt18} and \citet{Reinoso18} find that the efficiency of collisions increases as the radii of the stars grow. On the other hand, we find that even when the gas accretion rate is limited by the Bondi-Hoyle-Lyttleton accretion rate, the central star can keep expanding due to accretion of stars. We find that the central star can grow efficiently due to the following feedback loop. First, stars are captured by the central star by efficient migration due to stellar dynamical friction. The radius of the central star then grows, both because of its increase in mass, and because of the heating of its envelope by stellar accretion. Due to the larger stellar radius, more stars can be captured by the central star. Thus stellar accretion is facilitated by both the mass segregation due to dynamical relaxation processes and the growth of the stellar radius due to stellar accretion. As mentioned above, we refer to this growth process by stellar accretion as ${\it stellar\, bombardment}$ to distinguish it from the usual runaway collisions. In the usual runaway collisions, only a small fraction of stars in the cluster forms a core and the core collapses. The core is maintained due to the heating by hard binaries, whose binding energy can be a large fraction of the binding energy of the cluster \citep[e.g.][]{PortegiesZwart99}. On the other hand, during stellar bombardment, the binding energy of hard binaries is a tiny fraction of the binding energy of the cluster, since the central star can be expanding during the evolution, so stars can accrete onto the central star almost without being heated by hard binaries. Thus both the dynamical evolution of surrounding stars and the final outcome (i.e. the mass of the central BH remnant) are qualitatively different between the runaway collision and the stellar bombardment. \begin{figure} \begin{center} \includegraphics[width=85mm]{schematic_b.pdf} \vspace{\baselineskip} \caption{ Schematic diagram illustrating the system we study and the mechanisms affecting each of its components. Surrounding stars are characterized by their radial position ($r_i$) from the central star and their mass ($m_i$). These variables are updated via semianalytic prescriptions in each ``$N$-body'' time step, due to multiple processes as listed in the diagram. } \label{fig:method_diagram} \end{center} \end{figure} \section{Method} To investigate how stars form, migrate inward, and crash into the central star, and how they are affected by feedback, we use a semianalytical model incorporating the effects of star formation, protostellar evolution, gas accretion, dynamical friction by stars and gas, collisions, and gas ejection (Fig.~\ref{fig:method_diagram}). In this section, we provide an overview of our simulations. \subsection{Setup and initial conditions} We consider the following components: a central star, surrounding stars, a gas cloud, and a dark matter (DM) halo. The label ``surrounding stars'' refers to all stars other than the central star. We reserve the term ``stars'' throughout the paper to include both surrounding stars and the central star. We follow the evolution of the entire system for 3~Myr, which is roughly the time when either the first surrounding star may be expected to explode or the central star collapses to a BH. In our semianalytical model, $N$-body particles represent surrounding stars. Surrounding stars form, migrate, and accrete onto the central star, while the central star is pinned to the center of the system neglecting both gas driven migration and wandering due to dynamical interactions with other stars.\footnote{Assuming that the central star is pinned to the center is not a major simplification. While in reality it may wander away from the center due to dynamical two-body interactions with the surrounding stars, as long as it has a mass lower than or comparable to that other stars in the cluster, generally the most massive objects in the cluster sink to the central region due to the {\it Spitzer} instability and become prone to stellar collisions. In this case, we assume that the most massive star becomes the central star. } We investigate several values for the maximum initial mass of surrounding stars ($m_\mathrm{0,max}$), and also set the initial mass of the central star to be $m_\mathrm{cent}=m_\mathrm{0,max}$. As a fiducial model, we set $m_\mathrm{0,max}=1\,{\rm M_\odot}$, which is roughly the Jeans mass at which fragmentation occurs at the density $10^{10}\,\mathrm{cm}^{-3}$ \citep{Omukai08}. We assume that there are no surrounding stars initially. When stars are expanding, we set their radius to \begin{align} \label{eq:r_expand} R_i=2.6\times 10^3\,R_\odot (m_i/100\,{\rm M}_\odot)^{0.5}, \end{align} following \citet{Hosokawa12}, while after stars are contracted (the condition of these stars depends on their accretion rate and the KH timescale as described in \S~\ref{sec:stellar_evolution} below), their radius is assumed to be \begin{align} \label{eq:r_contract} R_i= R_{\mathrm{ZAMS},i} =4.6\,R_\odot (m_i/100\,{\rm M}_\odot)^{0.58} \end{align} \citep{Hirano17b}. Throughout this paper, we refer to a star in the expanding (pre-main-sequence) and the contracting (main-sequence) phases as an ``expanding star'' and a ``contracted star'', respectively. \subsubsection{Density profile} \label{sec:gas_model} We set the number density profile for gas $n_\mathrm{gas} (r)$ as \begin{equation} \label{eq:ngas} n_\mathrm{gas} (r)= \left\{ \begin{array}{cl} n_\mathrm{c} &\mathrm{if}~r \leq r_\mathrm{c} \\ n_\mathrm{c} (r/r_\mathrm{c})^{-2} &\mathrm{if}~ r_\mathrm{c}\leq r \leq r_{\rm vir}\\ 0 &\mathrm{if}~r> r_{\rm vir} \end{array} \right. \end{equation} where $r_\mathrm{c}$ is the core radius of the collapsing gas and $n_\mathrm{c}$ is the core gas density. Outside the core radius, gas is assumed to be collapsing under its self-gravity, while in the dense core, gas is assumed to cool efficiently, fragment, and form stars. As a fiducial model, we set $n_\mathrm{c}=10^{11} \,\mathrm{cm}^{-3}$, and the temperature of inflowing gas to $T=10^4\,\mathrm{K}$ \citep[e.g.][]{Oh02,Omukai08,Shang10}. Assuming an isothermal equation of state, the sonic velocity of inflowing gas is $c_\mathrm{s}= ( kT / \mu )^{1/2} \simeq10\,\mathrm{km/s} (T/10^4\,\mathrm{K})^{1/2}$, where $k$ is the Boltzmann constant and $\mu=1.22$ is the mean mass per particle, and the accretion rate from large scales is set to \begin{equation}\label{eq:Mdotin} {\dot M}_\mathrm{in} = \frac{c_\mathrm{s}^3}{G} \simeq 0.22\,\frac{{\rm M}_\odot}{\mathrm{yr}} \left(\frac{T}{10^4\,\mathrm{K}}\right)^{3/2} \end{equation} \citep[e.g.][]{Stahler80,Begelman06}. The core density $n_\mathrm{c}= 10^{11} \,\mathrm{cm}^{-3}$ roughly matches the density at which gas with a metallicity of $\sim10^{-5}\,Z_\odot$ and a suppressed ${\rm H}_2$ fraction (by strong background radiation) begins to fragment due to the decrease of its temperature~\citep{Omukai08}. In the fiducial model, the initial value of the core radius for the collapsing gas is chosen to be $r_\mathrm{c,ini} \simeq 4 \times 10^{-4}$ pc by matching the cosmological baryon-to-DM mass ratio inside the virial radius $r_\mathrm{vir}=(3M_\mathrm{halo}/800 \pi \rho_\mathrm{cri})^{1/3}$, where $M_\mathrm{halo}$ is the halo mass within the virial radius, $\rho_\mathrm{cri}=3H^2/8\pi G$ is the cosmological critical density, $H\simeq H_0[\Omega_\mathrm{m0} (1+z)^3+\Omega _{\Lambda0}]^{1/2}$ is the Hubble parameter, $H_0 \simeq 70\,\mathrm{km/s/Mpc}$ is the Hubble constant, $\Omega_\mathrm{m0}=0.24$ is the matter density today, and $\Omega _{\Lambda0}=0.76$ is the cosmological constant today \citep{Plank16}. We assume that the halo mass within the virial radius $M_\mathrm{halo}$ is $10^{7}\,{\rm M}_\odot$. The radius at which $n_\mathrm{gas}(r)= 10^{11} \,\mathrm{cm}^{-3}$, measured in high-resolution cosmological hydrodynamical simulations of metal- and ${\rm H_2}$-free gas in atomic-cooling halos \citep[e.g.][]{Regan14} is also found to be $\sim 10^{-4}-10^{-3}$ pc. We also checked that our results are not significantly influenced by changing the value of $r_\mathrm{c,ini}$ to $10^{-3}$ pc, which is because $r_\mathrm{c}$ quickly evolves due to our assumption of setting $r_c$ to the place where the gas becomes unstable to fragmentation (see \S \ref{sec:star_formation}). Thus, we assume that the core gas density is fixed while $r_\mathrm{c}$ evolves with time (\S \ref{sec:star_formation}). In our model, the final results depend on the position of star formation at $r_\mathrm{c}$, while they are less affected by other effects related to the gas density distribution.\footnote{ The main effects of the background gas distribution in the simulation are (i) to generate a potential that influences the stellar collision probability (\S~\ref{sec:mergers}), and (ii) to drive stellar bombardment through gas dynamical friction (\S~\ref{sec:gdf}). The growth rate of the central star is not directly influenced by $n_{\rm gas}$ since we limit the stellar mass accretion rate and star formation by the inflowing gas supply rate from the outer regions $\dot{M}_\mathrm{in}$ (\S~\ref{sec:accretion} and ~\ref{sec:star_formation}).} Therefore we expect that the core gas density fixed in time is not a critical assumption. When we calculate the acceleration due to gas dynamical friction and accretion (\S \ref{sec:gdf} and \ref{sec:accretion}), we assume that the gas mean velocity is zero for simplicity. This assumption gives an optimal rate for migration toward the center for surrounding stars due to gas dynamical friction and accretion. Nevertheless, the migration by gas dynamical friction and accretion is found to give small contributions to the final SMS mass (\S \ref{sec:central_evolution}). \subsubsection{Gravitational potential} We adopt a four-component gravitational potential, \begin{eqnarray} \Phi (r) = \Phi_\mathrm{DM}(r)+\Phi_\mathrm{star}(r)+\Phi_\mathrm{gas}(r)+\Phi_\mathrm{cent}(r), \end{eqnarray} where $\Phi_\mathrm{DM}(r)$, $\Phi_\mathrm{star}(r)$, $\Phi_\mathrm{gas}(r)$, and $\Phi_\mathrm{cent}(r)$ are, respectively, the gravitational potential at the position $r$ of the dark matter halo, surrounding stars, collapsing gas, and the central star. We set $\Phi_\mathrm{DM}(r)$ by the Navarro-Frenk-White (NFW) profile as \begin{eqnarray} \Phi_\mathrm{DM} (r)=\frac{-4\pi G\rho_\mathrm{h} r_\mathrm{h}^3}{r} \ln\left(\frac{r_\mathrm{h}+r}{r_\mathrm{h}}\right), \end{eqnarray} where $r_\mathrm{h} = r_\mathrm{vir}/C$ is the scale radius of the halo, $\rho_\mathrm{h} = 200 \rho_\mathrm{cri} C^3/(3\ln(1+C)-C/(1+C))$ is the density parameter of the NFW profile, and $C$ is the concentration parameter \citep{Navarro97}. We assume that $C=9$. We assume a redshift $z=15$, since atomic-cooling halos (whose masses are $\approx 10^{7}\,{\rm M}_\odot$ at this redshift) start to appear from around this epoch \citep[e.g.][]{Tanaka09}. For reference, we also note that in the context of trying to grow to an SMBH of $\sim 10^9\,{\rm M}_\odot$ at $z\sim 6$ via gas accretion, the seed BH mass is required to be $\sim10^5\,{\rm M}_\odot$ at $z\sim 10$ \citep{diMatteo12}. The gravitational potential of the gas is derived from equation (\ref{eq:ngas}) using Eq.~(2.28) in \citet{Binney08} as \begin{equation} \Phi_\mathrm{gas} (r)= 4\pi G n_\mathrm{c} \mu m_\mathrm{H}\times\left\{ \begin{array}{l} \dfrac{r^2}{6}-\dfrac{r_\mathrm{c}^2}{2} - r_{\mathrm{c}}^2 \ln \dfrac{r_\mathrm{vir}}{r_{\mathrm{c}}}\\ \qquad\qquad \mathrm{for}~r<r_\mathrm{c}\,,\\ \dfrac{2 r_{\mathrm{c}}^3}{3 r} - r_{\mathrm{c}}^2 - r_{\mathrm{c}}^2 \ln \dfrac{r_\mathrm{vir}}{r} \\ \qquad\qquad\mathrm{for}~r>r_{\mathrm{c}}\,, \end{array} \right. \end{equation} where $m_\mathrm{H}$ is the hydrogen mass. Similarly, for the gravitational potential of the surrounding stars: \begin{eqnarray} \Phi_\mathrm{star} (r)=-\frac{GM_*(<r)}{r}-\int^{R_\mathrm{max}}_r 4\pi r G\rho_* (r) dr , \end{eqnarray} where $\rho_* (r)$ is the stellar density at $r$, and $M_*(<r)$ is the stellar mass within $r$. We integrate and derive the gravitational potential at the center of the spherical radial cell $l$ in each time step, using a linear interpolation of $\Phi_\mathrm{star}(r)$. We use 60 radial cells, covering the range from $10^{-8}$ pc to $R_\mathrm{max}=10$ pc, spaced uniformly in log~$r$. The gravitational potential by the central star is $\Phi_\mathrm{cent}(r)=-Gm_\mathrm{cent}/r$. Note that the profiles of $\Phi_\mathrm{DM}(r)$, $\Phi_\mathrm{gas}(r)$, and $\Phi_\mathrm{cent}(r)$ are assumed to be algebraically fixed as given above, while $r_\mathrm{c}$ and the normalizations of $\Phi_\mathrm{gas}(r)$ and $\Phi_\mathrm{cent}(r)$ are followed in time. $\Phi_\mathrm{star}(r)$ is assumed to evolve, and its full radial profile is followed during our calculations. \subsection{Star formation} \label{sec:star_formation} We assume that the any gas flowing in from large scales that is not accreted onto stars is converted into new surrounding stars, and thus the star formation rate is \begin{equation}\label{eq:mdot_SF} {\dot m_\mathrm{SF}}={\dot M}_\mathrm{in}-\sum_i{\dot m}_{i} \end{equation} where the sum goes over all stars, including the central star and surrounding stars. This assumption is not obvious, since the inflowing gas may accumulate in the central region and increase the core density and core radius. Since it is difficult to follow the time evolution of the core density due to this gas accumulation, we assume a constant core density and a constant inflow rate as input parameters. Due to the temperature dependence of the inflow rate given by Eq.~\eqref{eq:Mdotin}, cases with low star formation rates are investigated in models with low $T$ below. Following simulations of Population~II star formation by \citet{Dopcke13}, we set the initial mass function to \begin{equation}\label{eq:massfunction} \frac{dN}{dm} \propto m^{-\beta} ~~\mathrm{where}~~ 0.08 M_\odot \leq m \leq m_\mathrm{0,max} \end{equation} with a flat logarithmic distribution, $\beta=0$, as a fiducial model. In practice, in each time step we form new stars randomly from this mass function in succession as long as their total mass is less than $m_\mathrm{SF}={\dot m_\mathrm{SF}}\Delta t$. Let us label with $n$ the corresponding largest number of new stars where this criterion holds. Finally we form the last star with probability $m_{\mathrm{new},n+1}/(m_\mathrm{SF}-\Sigma_{i=1}^n m_{\mathrm{new},i})$, where the mass of the ${n+1}^{\rm th}$ newly formed star $m_{\mathrm{new},n+1}$ is drawn randomly from the mass function. We assign cells to the newly formed stars based on the following arguments. Although we assume that the collapsing gas cloud is overall spherically symmetric, gas disks may form around the central star or around surrounding stars forming and growing by accreting gas with nonzero angular momentum. Since a gas disk is stabilized by rapid rotation in a steep gravitational potential, surrounding stars form outside the radius where the Toomre parameter \begin{equation} \label{eq:q_value} Q=\frac{c_\mathrm{s} \Omega}{\pi G \Sigma_\mathrm{gas}}=\frac{ \Omega_\mathrm{Kep}\Omega}{2\pi G n_\mathrm{gas} \mu m_\mathrm{H} } \end{equation} becomes 1, where $\Omega$ is the orbital frequency of the gas disk, and $\Omega_\mathrm{Kep}(r)=(GM(r)/r^3)^{1/2}$ is the Keplerian orbital frequency, where $M(r)$ is the enclosed mass, and $\Sigma_\mathrm{gas}$ is the surface density of the gaseous disk. Since gas disks are partially supported also via turbulent and thermal pressure, $\Omega = \epsilon_\mathrm{Kep} \Omega_\mathrm{Kep}$ where $\epsilon_\mathrm{Kep}$ describes the deviation from a fully rotationally supported disk. Referring to the results of simulations for primordial disks \citep[e.g.][]{Greif12,Latif13,Hirano14}, we adopt $\epsilon_\mathrm{Kep}=0.5$. In the case of $r_{Q=1}>r_\mathrm{c,ini}$, unless the total accretion rate is as high as $\sim {\dot M}_\mathrm{in}$, gas accumulates within the central region. Unlike our simplified assumption of a homogeneous $n_{\mathrm{gas}}$, a more realistic density distribution for Keplerian rotating gas is $\rho\propto r^{-1/2} - r^{-3/2}$ \citep[e.g.][]{Inayoshi18}. However, even for this density profile within the core, gas is most unstable in the outer region where $n_\mathrm{gas}\geq n_\mathrm{c}$. Thus we assume that surrounding stars form at $r_{Q=1}$ when $r_{Q=1}>r_\mathrm{c,ini}$, while surrounding stars form uniformly from $r_{Q=1}$ to $r_\mathrm{c,ini}$ when $r_{Q=1}<r_\mathrm{c,ini}$. Accordingly the core radius is set to $r_\mathrm{c}=r_{Q=1}$ in each time step using equation~\eqref{eq:q_value}. From equation (\ref{eq:q_value}), $r_\mathrm{c}=r_{Q=1}$ is satisfied at \begin{equation} \label{eq:rc_m} r_\mathrm{c}=\left[ \frac{\epsilon_\mathrm{Kep}}{\left(\frac{3}{2} - \epsilon_\mathrm{Kep}\right)} \frac{[m_\mathrm{cent} + M_\mathrm{stars}(r_\mathrm{c}) + M_\mathrm{DM}(r_\mathrm{c})]}{\frac{4}{3}\pi n_\mathrm{c} \mu m_\mathrm{H}}\right]^{1/3}. \end{equation} Let us introduce $M_\mathrm{DM}(r)$ and $M_\mathrm{stars}(r)$ to label the enclosed mass of the dark matter and surrounding stars within $r$, respectively. The dark matter mass is typically subdominant in this expression. In the early phases, the total stellar mass of surrounding stars and the central star is limited by the inflow rate from large scales and $m_\mathrm{cent}+M_\mathrm{stars}(r)\sim {\dot M}_\mathrm{in}t$, which implies that \begin{equation} \label{eq:rc_t} r_\mathrm{c} \approx \frac{\epsilon_\mathrm{Kep}^{1/3}}{\left(\frac{3}{2}-\epsilon_\mathrm{Kep}\right)^{1/3}} \frac{\dot{M}_\mathrm{in}^{1/3}t^{1/3}}{\left[\frac{4}{3}\pi n_\mathrm{c} \mu m_\mathrm{H}\right]^{1/3}}. \end{equation} We ignore the dynamical effect on the surrounding stars due to the deepening of the gas gravitational potential if $r_\mathrm{c}$ moves outwards, which tightens the orbit of surrounding stars outside of $r_\mathrm{c}$. In order to form stars, cooling from dust grains needs to be stronger than heating, since gas fragmentation is caused by the decrease of the gas temperature due to cooling by dust grains \citep{Omukai08}. In our model, gas is heated by gas dynamical friction, with the total heating rate given by \begin{equation} \label{eq:heating_gdf} \Gamma_\mathrm{GDF}= \frac{\mathrm{d}E_\mathrm{GDF}}{\mathrm{d}t} =\sum_i m_i v_i a_{\mathrm{GDF},i}. \end{equation} We assume that even when gas dynamical friction does not reduce the velocity of surrounding stars at $\Sigma_{i \in l}4 \pi r_{\mathrm{Bondi},i}^3/3 > V_l$ (\S \ref{sec:gdf}), gas is heated by gas dynamical friction, and we substitute $a_{\mathrm{GDF},i}$ calculated by equation (\ref{eq:gdf}) into equation (\ref{eq:heating_gdf}). Thus equation (\ref{eq:heating_gdf}) represents the upper limit for the heating rate due to gas dynamical friction. Referring to \citet{Omukai08}, the specific cooling rate from dust grains is \begin{align} \label{eq:cooling_dust} \lambda_\mathrm{dust}\sim \left\{ \begin{array}{l} 100\,\dfrac{\mathrm{erg}}{\mathrm{s \,g}} \dfrac{n_\mathrm{gas}}{10^{10}\,\mathrm{cm^{-3}}} \\ \qquad\mathrm{for}~ 10^6\,\mathrm{cm^{-3}}<n_\mathrm{gas}<10^{10}\,\mathrm{cm^{-3}}, \\[1.5ex] 100\,\dfrac{\mathrm{erg}}{\mathrm{s\, g}} \left(\dfrac{n_\mathrm{gas}}{10^{10}\,\mathrm{cm^{-3}}}\right)^{0.2} \\ \qquad\mathrm{for}~ 10^{10}\,\mathrm{cm^{-3}}<n_\mathrm{gas}<10^{12}\,\mathrm{cm^{-3}}. \end{array} \right. \end{align} Since the core region is optically thin to dust emission \citep{Omukai08}, the net cooling rate by dust grains within the core region is $\Lambda_\mathrm{dust}=\lambda_\mathrm{dust}M_\mathrm{c}$, where $M_\mathrm{c}=\frac{4 \pi}{3}n_\mathrm{c} \mu m_\mathrm{H} r_\mathrm{c}^3 $ is the gas mass within the core radius. Whenever the heating rate exceeds the cooling rate, $\Gamma_\mathrm{GDF}>\Lambda_\mathrm{dust}$, star formation is assumed to be quenched. When the cooling dominates the heating, the gas temperature is expected to decrease and gas fragments as found in \citet{Omukai08}. \subsection{Expanding and contracting stars} \label{sec:stellar_evolution} For each star, we specify whether they are in the expanding (pre-main-sequence) or contracting (main-sequence) phase in each simulation time step as follows. In isolation, a protostar contracts on the KH timescale $t_{{\mathrm{KH},i}}=Gm_i^2/(R_iL_i)$. On the other hand, \citet{Hosokawa12} have shown that if the mass accretion rate (see \S~\ref{sec:accretion}) exceeds the critical rate, $\dot{m}_i > {\dot m}_\mathrm{cri}\sim0.006-0.03~{\rm M}_\odot/\mathrm{yr}$, stars can keep expanding (see also \citealt{Haemmerle18} for similar results). Furthermore, \citet{Sakurai15} have shown that if the mass accretion rate time-averaged over a KH timescale evaluated on the stellar surface, $t_{\mathrm{surf,KH},i}\sim10~t_{{\mathrm{KH},i}}\sim 10~Gm_i^2/R_iL_i$, exceeds the critical rate $\langle \dot{m}_i\rangle > {\dot m}_\mathrm{cri}$, the star can keep expanding. Following these results, we assume that if the accretion rate $\dot{m}_i$ smoothed on the surface KH timescale \footnote{ In practice we define $\langle \dot{m}_i\rangle_{t}$, the smoothed accretion rate of star $i$ at time $t$, recursively using the instantaneous accretion rate $\dot{m}_{i,t}$ as \begin{equation} \label{eq:time_smoothing} \langle \dot{m}_i\rangle_{t+\Delta t} = \langle \dot{m}_i\rangle_{t} \left( 1-\frac{\Delta t}{10t_{\mathrm{KH},i}}\right) + \dot{m}_{i,t} \frac{\Delta t}{10t_{\mathrm{KH},i}}\,. \end{equation} } exceeds ${\dot m}_\mathrm{cri} = 0.01~{\rm M}_\odot/\mathrm{yr}$, or the time from its formation is shorter than the KH timescale for zero-age main-sequence (ZAMS) stars ($t_{{\mathrm{KH,ZAMS},i}}=Gm_i^2/(R_{\mathrm{ZAMS},i} L_i)$), star $i$ keeps expanding, and otherwise it contracts. We calculate the surface KH timescale $t_{\mathrm{surf,KH},i}$ using the stellar luminosity $L_i$ given by equations (3), (4), and (5) in \citet{Hosokawa12} for stars with masses of $m_i<6\,{\rm M}_\odot$, $6\,{\rm M}_\odot \leq m_i < 50\,{\rm M}_\odot$, and $m_i \geq 50\,{\rm M}_\odot$, respectively. Note that the critical condition (${\dot m}_\mathrm{cri}$) could be lower for accretion of stars than that for accretion of gas. This is because high-velocity accretion of highly eccentric stars and/or the internal energy of accreted stars may heat the envelope of the central star more, per unit infalling mass, compared to accreting cold gas at the same rate. \subsection{Radial motion}\label{sec:radial} A particle $i$ (i.e. one of the surrounding stars) is described by its mass $m_i$ and its radial distance from the central star $r_i$. For simplicity, particles are assumed to follow circular orbits, but they are allowed to migrate radially. After each time step $\Delta t$, we update the position of particle $i$ to $r_i+\Delta r_i$, satisfying \begin{equation} \label{eq:migration_rate} E(r_i+\Delta r_i)=E(r_i)+\Delta k_i \end{equation} where $E(r_i)=\Phi(r_i)+k(r_i)$ is the total specific energy, $k(r_{i})=\frac{1}{2}v_i^2$ is the specific kinetic energy, $\Delta k_i$ is the change in the specific kinetic energy within $\Delta t$, and $v_i$ is the orbital velocity of the $i$th particle. The change in the specific kinetic energy is given as \begin{equation} \Delta k_i=v_i a_i\Delta t \end{equation} where $a_i$ is the acceleration of the $i$th particle. We assume $v_i = v_\mathrm{Kep}(r_{i})$, where $v_\mathrm{Kep}(r)$ is the Keplerian orbital velocity at $r$. The acceleration is given as \begin{equation} a_i=a_{\mathrm{SDF},i}+a_{\mathrm{GDF},i}+a_{\mathrm{acc},i} \end{equation} where $a_{\mathrm{SDF},i}$, $a_{\mathrm{GDF},i}$, and $a_{\mathrm{acc},i}$ are the acceleration of the $i$th particle due to stellar dynamical friction, gas dynamical friction, and accretion, respectively (see \S \ref{sec:sdf}, \ref{sec:gdf}, and \ref{sec:accretion} below). For simplicity, in the calculation of the migration rate in equation (\ref{eq:migration_rate}), we assume that the eccentricity of a surrounding star does not evolve with time, and remains zero. We consider the effects of nonzero eccentricities in \S \ref{sec:parameter_depend}. To follow the migration, we use a shared time step of \begin{align} \label{eq:timestep} \Delta t =\eta \,\mathrm{min}_i \left[ \frac{v_i}{a_{\mathrm{SDF},i}},\frac{v_i}{a_{\mathrm{GDF},i}}, \frac{v_i}{a_{\mathrm{acc},i}}, \frac{1}{\sqrt{G n_\mathrm{c} \mu m_\mathrm{H}}} \right] \end{align} where the constant $\eta$ is a time step parameter. On the right-hand side, the four terms are the timescales for stellar dynamical friction, gas dynamical friction, and accretion torque, and the dynamical time within the core radius, respectively. We set the time step parameter to be $\eta=0.1$. To validate this choice, we compared the final mass of the central star in one of the models (``Model 2'' below) with $\eta=$0.4, 0.2, and 0.1. The mass was found to be $4.1\times 10^3\,{\rm M}_\odot$, $3.8 \times 10^3\,{\rm M}_\odot$, and $3.7 \times 10^3\,{\rm M}_\odot$, respectively. The final mass changes only by $<2\%$ between the last two cases ($\eta=0.2$ and $\eta=0.1$), giving us confidence that our results have nearly converged at $\eta = 0.1$. \subsubsection{Stellar dynamical friction} \label{sec:sdf} Stellar dynamical friction is modeled using the analytic formula \citep{Binney08} of \begin{align} \label{eq:sdf} {a}_{\mathrm{SDF},i}=&-\frac{4\pi G^2 m_i \rho_* \ln\Lambda}{v_i^2} \left[\mathrm{erf}\left(\frac{v_i}{\sqrt{2}\sigma_*}\right)- \right.\nonumber\\&\left. \frac{\sqrt{2}v_i}{\sqrt{\pi}\sigma_* }e^{-v_i^2/2\sigma_*^2}\right], \end{align} where $\sigma_*$ is the velocity dispersion of background stars, $\rho_*$ is the stellar density, $\ln\Lambda=\ln(b_\mathrm{max}/b_\mathrm{min})$ is the Coulomb logarithm, and $b_\mathrm{max}$ and $b_\mathrm{min}$ are the maximum and minimum impact parameters for weak stellar encounters. We set $b_\mathrm{min}=Gm_i/v_i^2$, $b_\mathrm{max}=0.1$ pc. Equation (\ref{eq:sdf}) assumes an isotropic and Maxwellian velocity distribution for background stars. We set $\sigma_*=v_\mathrm{Kep}(r_i)/\sqrt{3}$, which sets the value in the square parenthesis in equation (\ref{eq:sdf}) to 0.86 since we assume $v_i=v_\mathrm{Kep}(r_i)$. To obtain the background density $\rho_*$ at each time step, we compute an average stellar density in each radial cell $l\in[1,60]$, obtained from the total number of surrounding stars found in each cell assuming spherical symmetry. To check the effect of the number of cells $N_\mathrm{cell}$, we compared the results for Model~2 for $N_\mathrm{cell}=40$, 60, and 80. The final mass of the central star in these three cases was found to be $4.1 \times 10^3$, $3.7 \times 10^3$, and $3.6 \times 10^3$, respectively. The small difference ($< 3\%$) between the latter two cases gives us confidence that our results nearly converge for $N_\mathrm{cell}=60$. When $m_i$ is larger than the average mass ($\overline{m}_l$) in some cell $l$ hosting the $i^{\rm th}$ surrounding star, the $i^{\rm th}$ surrounding star migrates inward by the acceleration in equation (\ref{eq:sdf}). On the other hand, when $m_i<\overline{m}_l$, the $i^{\rm th}$ surrounding star gains kinetic energy from the encounter and migrates outward, which is not accounted for by equation (\ref{eq:sdf}). Due to energy conservation, the total kinetic energy change for all surrounding stars in each cell by stellar dynamical friction is zero. To reduce computational time, we assign equal momentum change ($\Delta p_l$) to every below-average surrounding star in each cell. Here $\Delta p_l$ is determined from energy conservation by solving the following equation in each cell \begin{align} &\sum_{m_i<\overline{m}_l} \frac{1}{2}m_i \left[ \left( v_i + \frac{\Delta p_{l}}{m_i} \right)^2 - v_i^2 \right] \nonumber\\ &\qquad=-\sum_{ m_i>\overline{m}_l} \frac{1}{2}m_i\left[\left(v_i - |a_{\mathrm{SDF},i}| \Delta t \right)^2 -v_i^2\right]\,. \end{align} Since $v_i \gg |a_{\mathrm{SDF},i}|\Delta t$ (equation \ref{eq:timestep}) and $\Delta p_l \ll m_i v_i$, we approximate this equation as \begin{align} \sum_{m_i<\overline{m}_l} v_i {\Delta p_{l}} =\sum_{ m_i>\overline{m}_l} m_i v_i |a_{\mathrm{SDF},i}| \Delta t \,. \end{align} We assign the new radial location to the surrounding stars to match the updated velocity to the circular velocity at that radius (\S~\ref{sec:radial}). This procedure ensures that the cluster is in local virial equilibrium everywhere and accounts for two-body relaxation for the stellar cluster in an approximate way. We assume that stellar dynamical friction operates when the number of surrounding stars within a cell is more than one. In the fiducial model, we verify that the number of surrounding stars within $10\,R_\mathrm{cent}$ is more than a hundred at $t=10^4$ yr. Hence the number of surrounding stars is mostly large enough to validate equation (\ref{eq:sdf}) in our models. \subsubsection{Gas dynamical friction} \label{sec:gdf} When a particle has a nonzero velocity relative to the background gas, it suffers additional dynamical friction from the gas component. Due to this mechanism, surrounding stars may migrate toward the center. We use the gas dynamical friction formulation derived by \citet{Ostriker99} as \begin{align} \label{eq:gdf} a_{\mathrm{GDF},i} &= -\frac{4\pi G^2 m_i n_\mathrm{gas} \mu m_\mathrm{H}}{v_{\mathrm{rel,}i}^2}f(v_{\mathrm{rel,}i}/c_s),\nonumber\\ f(x) &= \left\{ \begin{array}{ll} \frac{1}{2} \mathrm{ln}\left(\frac{1+x}{1-x}\right)-x & \mathrm{for}~~0 < x < 1\,,\\ \frac{1}{2}\,\ln\left(x^2 -1 \right)+\ln\Lambda' & \mathrm{for}~~x>1\,,~~ \end{array} \right. \end{align} where $\ln\Lambda'$ is a Coulomb logarithm for the gas distribution, and $v_{\mathrm{rel,}i}$ is the relative velocity between the $i^{\rm th}$ surrounding star and the background gas. Referring to the result of numerical simulations by \citet{Chapon13}, we adopt $\ln\Lambda'=3.1$. We set $v_{\mathrm{rel,}i}=v_i$ assuming a static background gas distribution. In the usual formulation of dynamical friction, a body is assumed to be moving on a straight line (but see \citealt{KimKim2007,Chapon13}), relative to an unperturbed background. Since each star disturbs the gas inside its Bondi-Hoyle-Lyttleton sphere, the formulation of gas dynamical friction is not valid within another star's Bondi-Hoyle-Lyttleton sphere. We assume that when the sum of the volumes of the Bondi-Hoyle-Lyttleton spheres of surrounding stars within the spherical cell $l$ ($\Sigma_{i \in l}4 \pi R_{\mathrm{BHL},i}^3/3$) exceeds the volume of the cell $V_l$, gas dynamical friction does not operate in that cell. We likewise neglect gas dynamical friction inside the Bondi radius of the central star. \subsubsection{Accretion torque} Due to gas accretion (\S \ref{sec:accretion}), accreted objects receive momentum to satisfy momentum conservation. In this study, we set the acceleration due to gas accretion as \begin{equation} a_{\mathrm{acc},i}=-\frac{\dot{m}_i v_i}{m_i}. \end{equation} For simplicity we assume that gas is static, and the relative velocity between surrounding stars and gas is always given by the velocity of surrounding stars, i.e. the angular momentum is always reduced, which leads to radially inward migration. Since the collapsing gas may instead have angular momentum in the same sense as the surrounding stars, this prescription gives an upper limit for the deceleration and the resulting radial migration rate for surrounding stars. In \S \ref{sec:central_evolution}, we find that the deceleration by gas accretion has a minor effect on the migration of surrounding stars, even at this upper limit. \subsection{Stellar collisions among surrounding stars} \label{sec:mergers} We also consider collisions among surrounding stars. Assuming that the surrounding stars' motion is isotropic, the number, the number density, and the velocity dispersion in cell $l$ are $N_{l}$, $n_{l}$, and $\sigma_{*,l}$, respectively, the expected rate of collisions within the time step $\Delta t$ in a cell $l$ is given by (Eq.~(7.194) in \citealt{Binney08}) \begin{align} \label{eq:n_coll} N_{{\rm coll},l} &= \frac{1}{2} N_{l}\frac{\Delta t}{t_{\mathrm{coll},l}}\nonumber\\ &=\frac{1}{2} N_{l} n_{*,l} \sigma_{*,l} \left( R_{\rm coll}^2 + \frac{G \overline{m}_l}{\sigma_{*,l}^2}R_{\rm coll} \right) \Delta t , \end{align} where $R_{\rm coll}$ is the pericenter distance between the center of mass of two stars needed for a collision, i.e. the sum of the radii of the colliding stars, $\overline{m}_l$ is the average stellar mass in cell $l$, $t_{\mathrm{coll},l}$ is the collision timescale in cell $l$, and the factor $1/2$ is introduced to prevent double counting due to the fact that two stars participate in the collisions. In practice, we assume that the surrounding star $i$ collides in the simulation with probability \begin{align} \label{eq:p_coll} P_{\mathrm{coll},i} = 2 \sqrt{\pi} n_{*,l} \sigma_{*,l} \left( R_{\mathrm{coll},i}^2+\frac{Gm_i}{\sigma_{*,l}^2}R_{\mathrm{coll},i} \right) \Delta t , \end{align} during a time step, where the collision radius is approximated by $R_{\mathrm{coll},i}=2R_i$. For describing collisions between two surrounding stars $i$ and $j$, we assume that the relative velocity $v_\mathrm{rel,*}$ is drawn from a Maxwellian distribution with the dispersion of $\sqrt{2}\sigma_*$ as given in Eq.~(8.45) in \citet{Binney08}. Collisions may occur when the number of surrounding stars within a cell is more than one. For collisions among contracted stars, when this relative velocity $v_\mathrm{rel,*}$ exceeds the escape velocity from the stars, $v_\mathrm{esc}=[2G(m_i+m_{j})/(R_i+R_j)]^{1/2}$, contracted stars lose a significant amount of mass at collision instead of simply coalescing into one remnant star \citep{Freitag05}. For simplicity, we assume that when $v_\mathrm{rel,*}>v_\mathrm{esc}$ for contracted stars, the colliding surrounding stars are completely disrupted. However, the fraction of the released gas mass that accretes onto the central star and that is converted to form new stars is not well understood. In this study, the mass released during collisions is added to the inflowing gas ${\dot M}_\mathrm{in}$ from large scales (equation~\ref{eq:Mdotin}). The inflowing gas is mostly converted to new surrounding stars during the early phase of the evolution (see \S~\ref{sec:star_formation}) and it is mostly accreted onto the central star when ${\dot M}_\mathrm{in}\sim {\dot m}_\mathrm{cent}$ (see \S~\ref{sec:accretion}). For collisions with $v_\mathrm{rel,*}<v_\mathrm{esc}$ between contracted surrounding stars, we assume that the stars coalesce without any mass loss. When two stars $i$ and $j$ coalesce, we assume that $m_j$ accretes onto $m_i$. The merger remnant star may either become an expanding star or a contracted star depending on the time-smoothed accretion rate as defined in \S \ref{sec:stellar_evolution}. When surrounding stars are in an expanding phase (conditions specified in \S~\ref{sec:star_formation}), collisions become more frequent \citep{Boekholt18}. The mass loss during such collisions is also significantly different from that of contracted stars. \citet{AlisterSeguel19} have recently investigated the effect of mass loss during collisions on mass growth, relevant to collisions between contracted stars, in which high mass-loss rates are predicted. We used the fraction of total mass lost during collisions among expanding stars from figure 8 of \citet{Adams04} as \begin{equation} \label{eq:mass_loss} f_\mathrm{loss}=f_\mathrm{loss,max} 10^{-1.2\left(\frac{R_\mathrm{p}}{R_{\mathrm{coll},i}} \right)}, \end{equation} where $R_\mathrm{p}$ is the pericenter distance at collision. Referring to \citet{Adams04}, we set $f_\mathrm{loss,max}=0.16$ as a fiducial value, which is roughly consistent with the results by \citet{Bailey99}. Note that since \citet{Adams04} simulated collisions between an expanding star and a contracted star, $f_\mathrm{loss}$ for collisions between expanding stars may become lower than that in equation (\ref{eq:mass_loss}). To see the effect of $f_\mathrm{loss,max}$ on our results, we compared the final mass of the central star in one of the models (``Model 2'' below) with $f_\mathrm{loss,max}=0.16$, 0.3, and 1. The final mass of the central star was found to be $3.3\times 10^3~{\rm M}_\odot$, $2.6\times 10^3~{\rm M}_\odot$, and $1.8\times 10^3~{\rm M}_\odot$, respectively, and the total mass lost at collisions was $1.6\times 10^3~{\rm M}_\odot$, $2.9\times 10^3~{\rm M}_\odot$, and $4.0\times 10^3~{\rm M}_\odot$, respectively. Thus the final mass of the central star is affected by at most a factor $\sim 2$ due to $f_\mathrm{loss,max}$. The pericenter distance is related to the impact parameter $b$ through \citep[e.g.][]{OLeary09} \begin{equation} R_\mathrm{p} = \left(\sqrt{\frac{1}{b^2}+\frac{G^2(m_i+m_{j})^2}{b^4 v_\mathrm{rel,*}^4}} + \frac{G(m_i+m_{j})}{b^2 v_\mathrm{rel,*}^2}\right)^{-1}. \end{equation} We set the distribution of $R_{\rm p}$ so that $b^2$ is uniformly distributed between 0 and $b_{\rm max}^2$, where $b_{\rm max}$ is the maximum impact parameter at which collision occurs ($b=b_{\rm max}$ at $R_{\rm p}=R_{\rm coll}$). The fraction of mass $f_{\rm loss}$ (Eq.~\ref{eq:mass_loss}) is subtracted from the mass of the collided surrounding stars, and added to the inflow rate ${\dot M}_\mathrm{in}$. Following \citet{Bailey99}, we also set the condition for merger into a single star to \begin{equation} \frac{R_\mathrm{p}}{R_\mathrm{coll}} < -0.75 \left(\frac{v_\mathrm{rel,*}}{v_\mathrm{esc}}\right)+1.3. \end{equation} Even when the colliding surrounding stars merge into one single star, the collision leads to some mass loss in the case where at least one of the two colliding stars is expanding, according to equation (\ref{eq:mass_loss}). \subsection{Stellar and gaseous accretion onto the central star} \subsubsection{Stellar accretion} Surrounding stars collide with and accrete onto the central star when the distance from the central star to some surrounding star $r_{i}$ becomes smaller than the sum of the radii $R_\mathrm{cent}+R_i$. After a star accretes onto the central star, we add the mass of the accreted surrounding star to the mass of the central star, and the radius of the central star increases according to equations (\ref{eq:r_expand}) or (\ref{eq:r_contract}). We assume no mass loss during this collision/accretion event. \citet{Freitag05} show that when the collision velocity ($v_\mathrm{coll}$) is smaller than the escape velocity from the surface of the collided star ($v_\mathrm{esc}$), the mass loss is small. If the accreted surrounding star orbits in a gravitational potential dominated by the central star, the collision velocity becomes smaller than the escape velocity from the central star. This can be violated and some fraction of the envelope of the central star will be lost if surrounding stars accrete on highly eccentric orbits, which cannot be accounted for in our present model. After accreting a surrounding star, we assume that the envelope of the central star is heated since the orbital energy of the accreted surrounding star is converted to thermal energy in the envelope of the central star. The accreted surrounding star then sinks to the core of the central star, and the central star is expected to expand, similar to the case for gas accretion \citep{Sakurai15}. We determine the expansion rate of the central star according to the averaged mass accretion rate (\S \ref{sec:stellar_evolution}). \subsubsection{Gas accretion} \label{sec:accretion} \citet{Inayoshi18} have considered radiatively inefficient accretion onto a compact object and generalized Bondi accretion to a case with angular momentum. They have found that when the angular momentum is low, so that the centrifugal radius is well inside the Bondi radius and a compact accretion disk forms around the central object, the accretion rate ${\dot m}_{\mathrm{acc},i}$ onto the central object (in our case the $i^{\rm th}$ star) is given by \begin{equation} \label{eq:accretion} {\dot m}_{\mathrm{acc},i}= f_\mathrm{sup} {\dot m}_{\mathrm{BHL},i}. \end{equation} where \begin{equation} f_\mathrm{sup}=\min \left\{ 1,\max \left[ \left( \frac{\alpha_\mathrm{SS}}{0.01} \right)^{0.62} \frac{r_{\mathrm{in},i}}{R_{\mathrm{BHL},i}},f_\mathrm{sup,min} \right] \right\} \end{equation} is the suppression rate from the Bondi accretion rate, $\alpha_\mathrm{SS}$ is the viscosity parameter in the standard thin $\alpha$-disk model~\citep{Shakura73}, ${\dot m}_{\mathrm{BHL},i}=4\pi G^2 n_\mathrm{gas} \mu m_\mathrm{H} m_i^2/(c_s^2+v_i^2)^{3/2}$ is the Bondi-Hoyle-Lyttleton accretion rate, $R_{\mathrm{BHL},i}=Gm_i/(c_s^2+v_i^2)$ is the Bondi-Hoyle-Lyttleton radius, $r_{\mathrm{in},i}$ is the inner radius, and $f_\mathrm{sup,min}$ is the minimum of the suppression rate. \citet{Inayoshi18} found that $f_\mathrm{sup,min}\sim 10^{-2}-10^{-3}$. We set $f_\mathrm{sup,min}=0.003$. The inner radius is the inner boundary of the calculation introduced in \citet{Inayoshi18} due to the computational limit. The inner radius is considered to correspond to the stellar radius $r_{\mathrm{in},i}=R_i$. We set $\alpha_\mathrm{SS}=0.01$ as a fiducial value. This value is motivated by the results for a weak vertical magnetic field by \citet{Bai13}, which simulates the magnetorotational instability turbulence (however see also \citealt{King+2007}). We limit the maximum accretion rate to ${\dot m}_{\mathrm{acc},i}={\dot m}_{\mathrm{BHL},i}$, if ${\dot m}_{\mathrm{acc},i}>{\dot m}_{\mathrm{BHL},i}$ given by Eq.~\eqref{eq:accretion}, since in this case equation (\ref{eq:accretion}) becomes invalid, which describes the reduction in the accretion rate relative to the Bondi-Hoyle-Lyttleton rate due to rotation. We do not consider the enhancement of the gas density due to the $N$-body accretion \citep{Kaaz19}, since the upper limit on the density of gas outside of the Bondi-Hoyle-Lyttleton radius is given by $n_\mathrm{c}$. If the velocity of the $i^{\rm th}$ surrounding star is sufficiently high, $R_{\mathrm{BHL},i}$ may become smaller than $R_i$. In this case, the gas accretion rate is determined by direct collision with the stellar surface, ${\dot m}_{\mathrm{coll},i}=\pi R_i^2 n_\mathrm{gas} \mu m_\mathrm{H} v_i$. We set the accretion rate to $\mathrm{max}[{\dot m}_{\mathrm{acc},i},{\dot m}_{\mathrm{coll},i}]$. Furthermore, when the total accretion rate $\Sigma_i{\dot m}_{i}$ onto all stars exceeds the inflow rate from large scales ${\dot M}_\mathrm{in}$, we normalize the respective accretion rate of each star by the inflow rate by multiplying it by ${\dot M}_\mathrm{in}/\Sigma_i{\dot m}_{i}$. When $\Sigma_i{\dot m}_{i}\sim{\dot M}_\mathrm{in}$, the gas density should be depleted. However, for simplicity, we assume that the gas density distribution is unchanged; this is justified since whenever this condition is satisfied, the dynamical evolution of surrounding stars is hardly affected by the presence of gas because the gravitational potential is dominated by stars in later phases and star formation ceases. In cases in which the Bondi mass $M_{\mathrm{Bondi},i}=\frac{4}{3}\pi R_{\mathrm{BHL},i}^3 n_\mathrm{gas}\mu m_\mathrm{H} $, i.e. the gas mass within the Bondi-Hoyle-Lyttleton radius ($R_{\mathrm{BHL},i}$) of the $i^{\rm th}$ star, is larger than the stellar mass $m_i$, the gas within the Bondi-Hoyle-Lyttleton radius can be unstable to fragmentation since the Jeans instability can be significant in weak shear regions \citep[e.g.][]{Elmegreen94,KimOstriker01,KimOstriker02}. If fragmentation is significant, it is not obvious what fraction of the gas can accrete onto the star. The fraction depends on cooling, turbulence \citep[e.g.][]{Clark11,Greif11,Elmegreen11,Dopcke13}, and the efficiency of angular momentum transfer \citep[e.g.][]{Thompson05}. Following the prescription in \citet{Ryu16}, when the Bondi mass exceeds the stellar mass $M_{\mathrm{Bondi},i}>m_i$, we reduce the accretion rate $\dot m_i$ by a constant factor $f_{\rm red}$. We assume $f_\mathrm{red}=10^{-3}$ as a fiducial value. Even when fragmentation is expected within $r_{\mathrm{BHL},i}$, we assume that surrounding stars form at $r_\mathrm{c}$ (\S \ref{sec:star_formation}). Thus, in summary we calculate the gas accretion rate of stars as \begin{align} \dot{m}_{i} = \left\{ \begin{array}{cc} {\dot m}_{i,0} & \mathrm{if}~ M_{\mathrm{Bondi},i} < m_{i}, \\ f_\mathrm{red} {\dot m}_{i,0} & \mathrm{if}~ M_{\mathrm{Bondi},i} \geq m_{i}, \end{array} \right. \end{align} where \begin{align} \dot{m}_{i,0} &= \min\left( \dot{m}_{i,1}, \frac{\dot{m}_{i,1}\dot{M}_\mathrm{in}}{\sum_i \dot{m}_{i,1}} \right)\,, \end{align} and \begin{align} \dot{m}_{i,1} &= \max({\dot m}_{\mathrm{acc},i},{\dot m}_{\mathrm{coll},i})\,. \end{align} \subsection{Feedback effects} \label{sec:gas_ejection} Photoionization and supernova feedback play key roles in ejecting gas from pre-galactic halos \citep{Whalen+2004,Kitayama04,Kitayama05}. We did not take into account feedback from supernova explosions since our simulations are limited to the time until a first supernova explosion at $3$~Myr. \citet{Kitayama04} have shown that when the production rate of ionizing photons ${Q}_\mathrm{ion}=\sum_i {Q_{\mathrm{ion},i}}$ is below the critical value ${Q}_\mathrm{cri}\sim 10^{51}\,\mathrm{s^{-1}}(M_\mathrm{halo}/10^7\,{\rm M}_\odot)^{8/5}[(1+z)/15]^{12/5}$, the gas density is not affected by photoionization feedback. On the other hand, when ${Q}_\mathrm{ion}$ exceeds ${Q}_\mathrm{cri}$, gas is blown away from the halo. We adopt this criterion as the gas ejection condition. ${Q_{\mathrm{ion},i}}$ strongly depends on whether the $i^{\rm th}$ star is in the expanding phase or the contracting phase, with ${Q_{\mathrm{ion},i}}\sim 10^{36}~\mathrm{s^{-1}} (m_i/10M_\odot)^2$ and $\sim 10^{48}~\mathrm{s^{-1}} (m_i/10M_\odot)^2$ in these phases, respectively \citep{Hosokawa12}. If ${Q}_\mathrm{ion}>{Q}_\mathrm{cri}$ is ever satisfied, all gas is assumed to be ejected from the system. Although we add up the ionizing photons emitted by low-mass stars ($\lesssim 1\,{\rm M}_\odot$), these photons do not affect bulk gas dispersal due to their low numbers and because they are trapped within their parent stars' Bondi radii. Furthermore, the contraction timescale for low-mass stars exceeds the calculation time (3 Myr), and we expect that low-mass stars contribute negligibly to the total photon emission rate. Indeed, we find below that gas dispersal (when it occurs) is caused by the contraction of the central star in our models. After the gas is ejected, gas accretion, star formation, and gas dynamical friction are all assumed to stop operating (${\dot m}_i={\dot m}_\mathrm{SF}=n_\mathrm{gas}(r)=0$ for all $i$ and $r$) during the rest of the simulation.\footnote{Note that even if gas is released during collisions among surrounding stars after this point, we assume that it is also blown away by feedback in this phase.} The radial position of surrounding star $i$ increases to $r_i+\Delta r$ due to the decrease of the potential energy as \begin{align} \Phi(r_i+\Delta r)-\Phi_\mathrm{gas}(r_i+\Delta r)+k_\mathrm{ej}(r_i+\Delta r)\nonumber\\% =\Phi(r_i)-\Phi_\mathrm{gas}(r_i)+k_\mathrm{be}(r_i), \end{align} where $k_\mathrm{be}(r)$ and $k_\mathrm{ej}(r)$ are the specific kinetic energies of an object at radius $r$ with and without gas, respectively. As in equation (\ref{eq:migration_rate}), we use the zero-eccentricity approximation when we calculate the change in the radial position of surrounding stars. Although we assume that gas is ejected instantly, the ejection timescale is roughly given by the size of the gas cloud over the ejection speed. In our models, the gas distribution affects the dynamical evolution of surrounding stars, and most surrounding stars are distributed within 0.1 pc. The ejection timescale for gas within 0.1 pc is $\sim 10^4$ yr when the ejection speed is $\sim 10\,\mathrm{km/s}$, which is set to a rough value of the sound speed of ionized gas. Thus the ejection timescale is much smaller than our total calculation timescale of 3~Myr, which justifies the assumption of instant gas ejection. \begin{figure*} \begin{center} \includegraphics[width=180mm]{cent_ev11.pdf} \caption{ Evolution of several quantities in the fiducial Model 1. (a) The mass of the central star (black), the total mass of surrounding stars (orange), the total gas mass within the Bondi radius of the central star (blue), and the most massive star among surrounding stars (cyan). (b) The radius of the central star (black), the core radius of collapsing gas (orange), the Kelvin-Helmholtz (KH) timescale for the stellar surface of the central star, $t_\mathrm{surf,KH}$ (blue), and the number of collisions among surrounding stars (cyan). (c) The growth rate of the central star (black), the rate of stellar accretion onto the central star (red), the gas accretion rate onto the central star (blue), the total star formation rate (orange), and the critical accretion rate below which the central star contracts when the age of the central star exceeds the KH timescale $t_{\mathrm{KH}}$ (gray). The black, red, and blue lines are smoothed on a timescale of $t_{\mathrm{surf,KH}}$ since the behavior (contraction or expansion) of the central star depends on the growth rate averaged over this timescale. (d) Black and gray lines are the total production rate of ionizing photons and the critical production rate of ionizing photons at which gas is ejected from the halo, respectively. The cyan and blue lines show the cooling rate by dust grains and the heating rate due to gas dynamical friction by surrounding stars, respectively. In this model, the high growth rate of the central star enables it to continue expanding and growing into a supermassive star with $6.7\times 10^5\,{\rm M}_\odot$ at the end of the simulation at 3~Myr. } \label{fig:cent_ev_fid} \end{center} \end{figure*} \begin{figure*} \begin{center} \includegraphics[width=180mm]{cent_ev310.pdf} \caption{ Same as Fig.~\ref{fig:cent_ev_fid}, but with a reduced $n_\mathrm{c}=3\times 10^{10}\,\mathrm{cm^{-3}}$ (Model 2 in Table~\ref{table_results}), illustrating a case when the central star contracts. The slow decline of the gas accretion rate onto the central star (blue line in panel (c)) after gas dispersal is due to smoothing in time calculated from Eq.~\eqref{eq:time_smoothing}. } \label{fig:cent_ev_cont} \end{center} \end{figure*} \begin{figure} \begin{center} \includegraphics[width=85mm]{snapshot3.pdf} \caption{ Snapshots of the density and mass profiles and related timescales in Model~2. Upper panel: gas and stellar density profiles. The lines show the gas density at 0.01~Myr (dashed blue), and the stellar densities at 0.01~Myr (black), 0.1~Myr (orange), and 3~Myr (red), respectively. Middle panel: enclosed mass profile for gas and surrounding stars. The lines show the enclosed mass profile for gas at 0.01~Myr (dashed blue), and for surrounding stars at 0.01~Myr (black), 0.1~Myr (orange), and 3~Myr (red), respectively. Lower panel: timescales for collision (black), stellar dynamical friction (orange), and evaporation (red) for the stellar distribution at 3~Myr. } \label{fig:snapshot} \end{center} \end{figure} \begin{figure} \begin{center} \includegraphics[width=85mm]{cont_semi12.pdf} \caption{ The evolution of one of the surrounding stars, born with an initial mass of $m_i=0.50\,{\rm M}_\odot$ formed at $t=1.2\times 10^3$ yr in Model 2. (a) The radial position (orange) and the radius of the central star (black). (b) The mass of the star (orange) and the average mass of surrounding stars in the cell $l$ hosting the star $\overline{m}_l$ (black). (c) The binding energy of the star (black) and the cumulative change in the kinetic energy due to the stellar dynamical friction (orange and blue), accretion drag (cyan), and gas dynamical friction (brown). Decrease and increase of the kinetic energy by stellar dynamical friction are shown separately by orange and blue lines, respectively. This star decreases its mass due to frequent collisions, and ends up as a less massive star orbiting at $\sim 380$AU at 3~Myr. } \label{fig:ev_star_osc} \end{center} \end{figure} \section{Results} \label{sec:results} \subsection{Central star evolution} \label{sec:central_evolution} We have performed several numerical calculations using the above semianalytical model. We first present the evolution of the central star in the fiducial model (labeled as Model 1 in Table~\ref{table_results}). Figure~\ref{fig:cent_ev_fid} shows the evolution of several other quantities in this model. In the early stages, the gas accretion rate onto the central star ${\dot m}_{\mathrm{acc,}i}$ is as low as $\sim 6\times 10^{-5}(m_i/1\,{\rm M_\odot})^{1.5}\,{\rm M_\odot}/\mathrm{yr}$ (blue line in panel (c) of Figure \ref{fig:cent_ev_fid}), and almost all of the gas from flowing in from large scales is converted into new surrounding stars, at the rate of ${\dot m_\mathrm{SF}}\sim{\dot M_\mathrm{in}}\simeq 0.22\,{\rm M_\odot}/\mathrm{yr}$ (orange line in panel (c)), and so a dense $\sim 10^3\,{\rm M_\odot}$ stellar cluster forms in $\sim 10^4$ years (orange line in panel (a)). At $2.6\times 10^2$ yr, the central star accretes the first surrounding star (red line in panel (c)). The accretion rate of surrounding stars subsequently gradually increases, due to the increasing radius of the central star (eventually to $\sim 10^3$ AU) as well as due to the increase in the number of surrounding stars (red line in panel (c), black line in panel (b), and orange line in panel (a)). At the same time, the surface KH time $t_\mathrm{surf,KH}$ for the central star decreases significantly (blue line in panel (b)) due to its increase in mass, which significantly raises the luminosity up to $m_\mathrm{cent}\sim6\,{\rm M}_\odot$ \citep{Hosokawa12}. Before the radius of the central star increases to $10$ AU, 77 collisions occur between surrounding stars (cyan line in panel (b)). All of these collisions occur between expanding surrounding stars, $4.7\,{\rm M}_\odot$ is lost during stellar collisions, and five pairs of them merge as a result of collisions. The mass lost during collisions is added to the gas inflow rate ${\dot M}_\mathrm{in}$. At $1.7\times 10^3$ yr the central star's mass is $m_\mathrm{cent}=19\,{\rm M}_\odot$, and its growth rate exceeds the critical rate required to inhibit contraction (${\dot m}_\mathrm{cri}=0.01\,\mathrm{{\rm M}_\odot/yr}$ see \S~\ref{sec:stellar_evolution}; black and gray lines in panel (c)). The accretion rate of surrounding stars onto the central star subsequently increases further, due to the increasing radius of the central star, the increased total number of surrounding stars in the cluster, and the increased masses of the surrounding stars (black line in panel (b), orange and cyan lines in panel (a)). Thus the mass of the central star rapidly increases by stellar bombardment in this phase. At $t = 2.2\times 10^3\,\mathrm{yr}$, the Bondi mass of the central star exceeds its own mass, $m_\mathrm{cent}=31\,{\rm M}_\odot$ (blue and black lines in panel (a)), and the gas accretion rate is reduced by $f_\mathrm{red}=10^{-3}$ due to the fragmentation of gas within the Bondi-Hoyle-Lyttleton radius (see \S~\ref{sec:accretion}). Since the cooling rate due to emission by dust grains (equation~\ref{eq:cooling_dust}) always exceeds the heating rate due to gas dynamical friction (blue and cyan lines in panel (d)), surrounding stars continue forming at the core radius (\S \ref{sec:star_formation}). At $\gtrsim 10^5$ yr, gas accretion begins to dominate the central star's growth rate. In this phase, most of the gas flowing in from large scales ${\dot M}_\mathrm{in}$ is accreted onto the central star. Star formation ceases, and a large number of surrounding stars are absorbed by the central star due to the radial growth of the central star (orange lines in panels (c) and (a) and black line in panel (b)). Stellar bombardment keeps the central star in the bloated state. Hence, the central star continues growing, and reaches $\gtrsim 10^5\,{\rm M}_\odot$ without any contraction. During the evolution, $6.1\times 10^3$ collisions occur (cyan line in panel (b)), all are between expanding surrounding stars, and 31 pairs of them merge as a result of collisions. In total $3.5\times 10^2\,{\rm M}_\odot$ mass is lost by surrounding stars during collisions (\S \ref{sec:mergers}). Thus most collisions between surrounding stars result in a relatively small amount of mass loss in the fiducial model. To clarify the importance of each mechanism for the growth of the central star, we repeat the above calculation in several variants of the fiducial model, in which parameter settings remain unchanged but some mechanism is turned off and does not operate. To check whether the stellar bombardment plays an important role, we first run the model with the fiducial settings but no migrating motion for surrounding stars. In this model, the final mass of the central star is found to be $32\,{\rm M}_\odot$. Thus via gas accretion alone, we find that the central star contracts and cannot grow into an SMS. We next investigate the importance of dynamical friction. With stellar dynamical friction turned off, the final mass of the central star is $750\,{\rm M}_\odot$. On the other hand, in the model without gas dynamical friction or without gas accretion drag, respectively, the final masses of the central stars are $6.7\times 10^5\,{\rm M}_\odot$ and $6.6\times 10^5$. We conclude that the migration of surrounding stars is dominated by stellar dynamical friction rather than gas dynamical friction and gas accretion drag. This is essentially because the density of stars dominates the density of gas. For example, in Model 1, the gas mass within the core radius of $r_\mathrm{c}=880$ AU at $t=10^4$ yr is $9.9\times 10^2\,{\rm M}_\odot$, while that of stars is $2.1 \times 10^3\,{\rm M}_\odot$. The stellar density increases closer to the SMBH, while the gas density is set to be constant within the core (e.g. upper and middle panels of Figure~\ref{fig:snapshot}). We further simulate a model with the fiducial settings, but without allowing the stars to expand, and instead always setting their radii to the value in Eq.~\eqref{eq:r_contract}. In this model, the rate of stellar accretion onto the central star does not increase beyond $\sim 0.005\,{\rm M}_\odot/\mathrm{yr}$, and the final mass is found to be $1.7\times 10^3\,{\rm M}_\odot$. Thus the bloating of stars is required to facilitate the growth of the central star due to stellar accretion. We next present a case in which the central star contracts before it collapses to a BH. Figure~\ref{fig:cent_ev_cont} shows the results in Model~2, which differs from Model~1 only by a modified value of the gas density (reduced by a factor of 3 to $n_\mathrm{c}=3 \times 10^{10}\,\mathrm{cm^{-3}}$). Initially the radial position at which surrounding stars form is about a factor of 1.5 larger than in Model~1 (orange lines in panels (b) in Figures~\ref{fig:cent_ev_cont}~versus~\ref{fig:cent_ev_fid}). Stellar dynamical friction becomes less efficient due to the lower stellar density, and the average accretion rate of surrounding stars onto the central star becomes lower than in Model~1 (red line in panel (c) of Figure~\ref{fig:cent_ev_cont}). At $t_\mathrm{KH,ZAMS} (\sim 3\times 10^4$ yr) for the central star, the central star contracts, and then the production rate of ionizing photons exceeds the critical value for gas ejection from the system (black and gray lines in panel (d)). After the ejection, gas accretion and star formation cease (blue and orange lines in panel (c)), and the rate of accretion of surrounding stars decreases (red line in panel (c)). The radius of a star is predicted to contract in $\sim 10^2-10^3$ yr \citep[e.g.][]{Sakurai15}, which justifies the assumption of abrupt contraction in our calculations. The central star continues to grow by accreting surrounding stars, but at a more moderate rate, reaching the mass of $3.7\times 10^3\,{\rm M}_\odot$ at 3~Myr. Therefore a massive BH may still be produced in Model~2, but the mass of this massive BH is $\approx 100$ times below that of the BH remnant in Model 1. The top panel of Figure \ref{fig:snapshot} shows the stellar and gas density profiles for Model 2. The power-law slope of the stellar density is almost unchanged during the evolution (black, orange, and red curves in the top panel). Coincidentally, such self-similar evolution is also expected for the core collapse of a self-gravitating system driven by two-body relaxation \citep{Binney08}. The evolution of the stellar density in our model is driven by the combination of gas and stellar dynamical friction, Bondi accretion, and star formation. On the other hand, the outer cutoff of the stellar density distribution slowly evolves from 0.1~to 3~Myr (orange and red curves in the top panel of Figure \ref{fig:snapshot}). This is because the timescale for stellar dynamical friction ($t_\mathrm{SDF}\equiv v_\mathrm{Kep}(r)/a_{\mathrm{SDF},i}$ with ${m}_i=\overline{m}_l$) at this position (orange curve in the bottom panel) exceeds the calculation timescale of 3~Myr. At 3~Myr, the density profile contains zero surrounding stars within $10$AU, and $\approx$50 surrounding stars within 100 AU. \subsection{Evolution of surrounding stars} \label{sec:stellar_evolution_result} Figure~\ref{fig:ev_star_osc} shows the evolution of one of the surrounding stars in Model 2. This star is born at $1.2 \times 10^3$ yr with mass $m_i=0.50\,{\rm M}_\odot$ at $r_{i}=660$ AU. In the early phase, due to gas dynamical friction, accretion drag and stellar dynamical friction, the star migrates inwards very slightly (orange line in panel (a) and brown, cyan, and orange lines in panel (c)). At $\gtrsim 2.5 \times 10^3$ yr, the average mass in the cell hosting this star becomes more massive than the mass of the star due to the formation of new stars within the cell (orange and black lines in panel (b)). The star therefore begins to migrate outward due to mass segregation. At $3.2\times 10^4$ yr, gas is ejected from the system due to photoionization feedback (as was shown by the gray and black lines in panel (d) of Fig.~\ref{fig:cent_ev_cont}), and so the binding energy of this star decreases abruptly (black line in panel (c) in Fig.~\ref{fig:ev_star_osc}). Gas dynamical friction and gas accretion stop operating due to the lack of gas around the star. Since star formation also stops operating and massive surrounding stars migrate inward, the average masses in cells at $\sim 100-1000$ AU begin to decrease. At $\sim 2\times 10^5$ yr, this star also begins to migrate inward. In the inner regions, the star and other surrounding stars lose some fraction of their mass due to frequent collisions (black and orange lines in panel (b)). Since the direction of migration due to stellar dynamical friction is influenced by the mass of the star compared to that of surrounding stars, the star wanders around $\sim 500$ AU. When the central star collapses into a massive BH at $3\times 10^6$ yr, this star orbits at $r_i= 380$ AU, and the mass is $m_i=0.32\,{\rm M}_\odot$. Hence surrounding stars are redistributed mainly by mass segregation driven by stellar dynamical friction, and only more massive stars can migrate toward the central star. In later phases, frequent collisions reduce the masses of surrounding stars, and they prevent accretion of surrounding stars onto the central star. \begin{table*} \caption{ The results of our simulations in the fiducial model (Model~1) and 21 variants. The columns show several input and output parameters in each case, as follows: the model number, the core gas number density ($n_\mathrm{c}$), the gas temperature ($T$), the reduction factor for the gas accretion rate when the Bondi mass exceeds the central mass ($f_\mathrm{red}$), the power-law index of the stellar IMF ($\beta$), the maximum initial mass of stars ($m_\mathrm{0,max}$), the mass of the central star at the end of the simulation at 3~Myr ($m_\mathrm{fin}$), the total mass of surrounding stars accreted onto the central star ($m_\mathrm{acc,*}$), the total mass lost during collisions ($M_\mathrm{loss}$), the number of newly formed surrounding stars ($N_\mathrm{SF}$), the number of surrounding stars accreted onto the central star ($N_\mathrm{acc}$), the number of collisions between surrounding stars ($N_\mathrm{coll}$), the mass of the central star and the time at the ejection of gas from the system ($m_\mathrm{ej}$ and $t_\mathrm{ej}$) for models in which such ejection occurs, and the maximum value for the ratio of the heating rate by gas dynamical friction to the cooling rate by dust grains ($\gamma_\mathrm{HC}=\mathrm{max}(\Gamma_\mathrm{GDF}/\Lambda_\mathrm{dust}$)). } \label{table_results} \hspace{-15mm} \begin{tabular}{c|c|c|c|c|c||c|c|c|c|c|c|c|c|c} \hline \multicolumn{6}{c}{Input} \vline& \multicolumn{9}{c}{Output}\\\hline Model&$n_\mathrm{c}$ &$T/10^4$ &$f_\mathrm{red}$&$\beta$& $m_\mathrm{0,max}$& $m_\mathrm{fin}$& $m_\mathrm{acc,*}$& $M_\mathrm{loss}$& $N_\mathrm{SF}$&$N_\mathrm{acc}$& $N_\mathrm{coll}$&$m_\mathrm{ej}$& $t_\mathrm{ej}$& $\gamma_\mathrm{HC}$ \\ & $[\mathrm{cm^{-3}}]$ &[K] &&& $[{\rm M}_\odot]$& $[{\rm M}_\odot]$& $[{\rm M}_\odot]$& $[{\rm M}_\odot]$& && &$[{\rm M}_\odot]$& $[\mathrm{yr}]$& \\\hline\hline 1&$10^{11}$&$1$&$10^{-3}$&0&1& $6.7\times 10^5$&$9.6\times 10^3$&$3.5\times 10^2$&$8.7\times 10^3$&$8.7 \times 10^3$ &$6.1\times 10^3$&-&-&0.50\\\hline 2&$3\times 10^{10}$&$1$&$10^{-3}$&0&1& $3.7\times 10^3$&$3.7\times 10^3$&$1.6\times 10^3$&$1.2\times 10^4$&$5.1 \times 10^3$ &$5.7\times 10^4$&$2.4\times 10^2$&$3.2\times 10^4$&0.19\\\hline 3&$10^{11}$&$0.5$&$10^{-3}$&0&1& $2.4\times 10^5$&$3.8\times 10^3$&$1.6\times 10^2$&$4.1\times 10^3$&$4.1 \times 10^3$ &$3.3\times 10^3$&-&-&0.77\\\hline 4&$10^{11}$&$0.3$&$10^{-3}$&0&1& $1.1\times 10^5$&$1.8\times 10^3$&$89$&$2.2\times 10^3$&$2.1 \times 10^3$ &$2.0\times 10^3$&-&-&0.67\\\hline 5&$10^{11}$&$0.1$&$10^{-3}$&0&1& $2.8\times 10^2$&$2.4\times 10^2$&$57$&$5.0\times 10^2$&$3.2 \times 10^2$ &$3.3\times 10^3$&$2.4\times 10^2$&$4.8\times 10^4$&0.67\\\hline 6&$10^{11}$&$1$&$0$&0&1& $6.7\times 10^5$&$6.7\times 10^5$&$4.3\times 10^2$&$6.7\times 10^5$&$6.7 \times 10^5$ &$7.6\times 10^3$&-&-&0.50\\\hline 7&$10^{11}$&$1$&$10^{-3}$&2.35&1& $6.7\times 10^5$&$1.1\times 10^4$&$5.7\times 10^2$&$2.6\times 10^4$&$2.6 \times 10^4$ &$2.8\times 10^4$&-&-&0.18\\\hline 8&$3\times 10^{10}$&$0.5$&$10^{-3}$&0&1& $1.7\times 10^3$&$1.7\times 10^3$&$6.2\times 10^2$&$4.8\times 10^3$&$2.4 \times 10^3$ &$2.4\times 10^4$&$2.4\times 10^2$&$3.5\times 10^4$&0.23\\\hline 9&$3\times 10^{10}$&$0.3$&$10^{-3}$&0&1& $9.3\times 10^2$&$9.3\times 10^3$&$35$&$2.6\times 10^3$&$1.3 \times 10^3$ &$1.5\times 10^4$&$2.4\times 10^2$&$4.1\times 10^4$&0.32\\\hline 10&$3\times 10^{10}$&$1$&$10^{-3}$&0&0.1& $3.7\times 10^2$&$3.5\times 10^2$&$1.2\times 10^2$&$8.7\times 10^2$&$4.8 \times 10^2$ &$5.6\times 10^3$&$2.4\times 10^2$&$7.5\times 10^4$&0.29\\\hline 11&$3\times 10^{10}$&$1$&$10^{-2}$&0&1& $3.6\times 10^3$&$3.6\times 10^3$&$1.6\times 10^3$&$1.2\times 10^4$&$5.0 \times 10^3$ &$5.4\times 10^4$&$2.4\times 10^2$&$3.1\times 10^4$&0.19\\\hline 12&$3\times 10^{10}$&$1$&$10^{-1}$&0&1& $6.7\times 10^5$&$7.1\times 10^3$&$1.4\times 10^3$&$1.5\times 10^4$&$9.2 \times 10^3$ &$5.1\times 10^4$&-&-&0.19\\\hline 13&$3\times 10^{10}$&$1$&$10^{-3}$&2.35&1& $2.7\times 10^3$&$2.7\times 10^3$&$2.2\times 10^3$&$4.4\times 10^4$&$6.4 \times 10^3$ &$1.8\times 10^5$&$2.4\times 10^2$&$4.1\times 10^4$&0.073\\\hline 14&$10^{10}$&$1$&$10^{-3}$&0&1& $4.1\times 10^3$&$4.1\times 10^3$&$2.7\times 10^3$&$2.3\times 10^4$&$5.1 \times 10^3$ &$7.6\times 10^4$&$2.4\times 10^2$&$5.9\times 10^4$&0.076\\\hline 15&$10^{10}$&$1$&$10^{-2}$&0&1& $4.1\times 10^3$&$4.1\times 10^3$&$2.7\times 10^3$&$2.3\times 10^4$&$5.1 \times 10^3$ &$7.6\times 10^4$&$2.4\times 10^2$&$5.9\times 10^4$&0.076\\\hline 16&$10^{10}$&$1$&$10^{-1}$&0&1& $4.1\times 10^3$&$4.0\times 10^3$&$2.6\times 10^3$&$2.2\times 10^4$&$5.0 \times 10^3$ &$7.4\times 10^4$&$2.4\times 10^2$&$5.7\times 10^4$&0.076\\\hline 17 & $10^{10}$ & $1$ & $1$ & 0 &1& $6.6\times 10^5$&$1.3\times 10^3$&$3.8\times 10^2$&$1.1\times 10^4$&$1.5 \times 10^3$ &$1.3\times 10^4$&-&-&0.076\\\hline 18 & $10^{9}$ & $1$ & $10^{-3}$ & 0 &1& $1.2\times 10^3$&$1.1\times 10^{3}$&$5.2\times 10^2$&$9.6\times 10^4$&$1.0 \times 10^3$ &$9.7\times 10^3$&$2.4\times 10^2$&$2.4\times 10^5$&0.085\\\hline 19 & $10^{9}$ & $1$&$1$&0&1& $2.6\times 10^2$&$1.7\times 10^2$&$1.5\times 10^2$&$9.0\times 10^4$&$1.6 \times 10^2$ &$3.2\times 10^3$&$2.4\times 10^2$&$2.5\times 10^5$&0.085\\\hline 20&$10^{8}$&$1$&$10^{-3}$&0&1& $3.2\times 10^2$&$2.8\times 10^2$&$1.3\times 10^2$&$3.6\times 10^5$&$2.2 \times 10^2$ &$2.5\times 10^3$&$2.4\times 10^2$&$8.8\times 10^5$&0.081\\\hline 21&$10^{7}$&$1$&$10^{-3}$&0&1& $2.0\times 10^2$&$1.9\times 10^2$&$56$&$1.2\times 10^6$&$1.6\times 10^2$ &$1.1\times 10^3$&-&-&0.082\\\hline 22&$10^{6}$&$1$&$10^{-3}$&0&1& $22$&21&$2.4$&$1.2\times 10^6$&17 &$34$&-&-&0.079\\\hline 23&$10^{11}$&$1$&$10^{-3}$&0&10& $6.7\times 10^5$&$8.4\times 10^3$&$3.1\times 10^2$&$1.2\times 10^3$&$1.2 \times 10^3$ &$7.7\times 10^2$&-&-&3.1\\\hline 24&$10^{10}$&$1$&$10^{-3}$&0&10& $6.6\times 10^5$&$5.2\times 10^4$&$4.8\times 10^3$&$6.4\times 10^3$&$6.3 \times 10^3$ &$1.1\times 10^4$&-&-&0.74\\\hline 25&$10^{9}$&$1$&$10^{-3}$&0&10& $4.2\times 10^3$&$4.2\times 10^3$&$9.0\times 10^2$&$1.4\times 10^3$&$5.3 \times 10^2$ &$2.7\times 10^3$&$2.5\times 10^2$&$3.2\times 10^4$&0.75\\\hline 26&$10^{11}$&$1$&$10^{-3}$&0&100& $6.6\times 10^5$&$8.0\times 10^3$&$2.0\times 10^2$&$1.6\times 10^2$&$1.4 \times 10^2$ &$94$&-&-&8.8\\\hline 27&$10^{10}$&$1$&$10^{-3}$&0&100& $9.0\times 10^3$&$8.8\times 10^3$&$3.0\times 10^2$&$2.1\times 10^2$&$1.5 \times 10^2$ &$83$&$4.3\times 10^3$&$5.4\times 10^4$&3.6\\\hline 28&$10^{9}$&$1$&$10^{-3}$&0&100& $2.8\times 10^2$&$1.3\times 10^2$&$0$&$14$&$2$ &$0$&$2.7\times 10^2$&$8.1\times 10^4$&3.9\\\hline \end{tabular} \end{table*} \begin{figure} \begin{center} \includegraphics[width=85mm]{mass_c.pdf} \caption{ The final mass of the central star as a function of the product $(T/10^4\,\mathrm{K})^{3/2}(n_\mathrm{c}/10^{10}\,\mathrm{cm}^{-3})$. Color represents gas temperature, empty circles/squares correspond to models with $\beta=2.35$ (Salpeter mass function), and large empty circles/squares correspond to models with high $m_\mathrm{0,max}$. The results for cases in which the central star contracts and does not contract are shown by circles and squares, respectively. The results for cases in which the central star contracts (circles) roughly follow the relation $(m_\mathrm{fin}/5700\,{\rm M}_\odot)=(T/10^4\,\mathrm{K})^{1.5}(n_\mathrm{c}/10^{10}\,\mathrm{cm}^{-3})$ (dashed diagonal line). } \label{fig:mass_n} \end{center} \end{figure} \begin{figure} \begin{center} \includegraphics[width=85mm]{mass_ps.pdf} \caption{ Similar to Fig.~\ref{fig:mass_n}, but the $y$-axis represents the maximum stellar density within the core radius. } \label{fig:mass_ps} \end{center} \end{figure} \subsection{Parameter dependence} \label{sec:parameter_depend} The dependence of the results on the input parameters of our model is illustrated through a range of model variants listed in Table~\ref{table_results}. The final mass of the central star ($m_\mathrm{fin}$) is most strongly influenced by whether the central star contracts or not, which in turn depends on the parameters we investigated. This is illustrated by the masses shown in Figure~\ref{fig:mass_n}. We find that for efficient growth via stellar bombardment, the formation of a high-density star cluster is required in order to enhance the inward acceleration by stellar dynamical friction. In cases with high core gas density $n_\mathrm{c}$, the core radius $r_\mathrm{c}$ is small, and since surrounding stars form at the core radius, the growth rate of the density of stars in early phases is high (equation \ref{eq:rc_m}). The growth rate of the stellar density is also high for the high $T$ cases, since the star formation rate during the early stages is mostly given by the gas inflow rate (${\dot M}_\mathrm{in}\propto T^{3/2}$, equation~\ref{eq:Mdotin}). In high stellar density environments, the migration time due to stellar dynamical friction is short and the rate of stellar bombardment is high. When the growth rate by stellar bombardment exceeds the critical rate, the central star continues growing without ejecting gas, as seen in the evolution for Model 1 in Figure~\ref{fig:cent_ev_fid}. From Table \ref{table_results}, for $n_\mathrm{c}= 10^{11}\,\mathrm{cm^{-3}}$ with $T\geq 3\times 10^3$ (Models 1, 3, and 4) the stellar accretion rate onto the central star exceeds the critical rate for contraction before $t_\mathrm{KH,ZAMS}$ for the central star, allowing it to grow to $\gtrsim 10^5\,{\rm M}_\odot$. Whether the central star contracts is also influenced by the value of $f_\mathrm{red}$ (see \S~\ref{sec:stellar_evolution} and \S~\ref{sec:accretion}). This is the factor by which the gas accretion rate is assumed to be reduced by both fragmentation and by the removal of gas that is captured by the fragmented clumps, when the Bondi mass becomes larger than the star's own mass. A high $f_\mathrm{red}$ value increases the gas accretion rate for $M_\mathrm{Bondi}>m_\mathrm{cent}$, which is satisfied for $m_\mathrm{cent}\gtrsim 30\,{\rm M}_\odot$ in Models~1~and~2 (blue and black lines in panel (a) of Figs.~\ref{fig:cent_ev_fid}~and~\ref{fig:cent_ev_cont}). So if the central star can grow to $m_\mathrm{cent}\gtrsim 30\,{\rm M}_\odot$ within $t_\mathrm{KH,ZAMS}$, the high value for $f_\mathrm{red}$ can aid to enhance the growth rate of the central star. From Table~\ref{table_results}, we see that for $n_\mathrm{c}= 3\times 10^{10}\,\mathrm{cm^{-3}}$ with $f_\mathrm{red}\geq 0.1$ (Model 12) or $n_\mathrm{c}= 10^{10}\,\mathrm{cm^{-3}}$ with $f_\mathrm{red}\sim 1$ (Model 17), the central star keeps expanding until 3~Myr when the SMS collapses to a massive BH or when any of the surrounding stars explode as a supernova and blow away all of the gas from the vicinity. In Models 12 and 17, the central star grows mainly via stellar accretion until $m_\mathrm{cent}\sim 100\,{\rm M}_\odot$, and then the gas accretion rate onto the central star exceeds the critical rate ${\dot m_\mathrm{cri}}$. Thus even for high $f_\mathrm{red}$, stellar accretion is important to enhance the gas accretion rate. Unfortunately, the relevant value for $f_\mathrm{red}$ is highly uncertain. To assess it, we need to consider fragmentation of gas inside the Bondi radius, and the evolution of any accretion disk around the central star. These issues are beyond the scope of the present paper and will be investigated elsewhere in the future. In those cases in which the central star contracts and gas is ejected before 3 Myr ($t_\mathrm{ej}<$3~Myr), gas accretion contributes very little to the final mass (see the values of $m_\mathrm{fin}$ and $m_\mathrm{acc,*}$ in Table \ref{table_results}). In these cases, since the growth rate should correlate with the efficiency of stellar dynamical friction, which depends on the stellar density, the final mass of the central star should correlate with the stellar density. We further assume that the stellar density is proportional to the star formation rate over the core radius cubed ($\rho_\mathrm{*}\propto \sim {\dot m}_\mathrm{SF}/r_\mathrm{c}^3$). Due to the scaling relations ${\dot m}_\mathrm{SF}\propto \sim T^{3/2}$ and $r_\mathrm{c} \propto n_\mathrm{c} ^{-1/3}$ (equation~\ref{eq:rc_m}), we can expect $\rho_\mathrm{*}\propto \sim T^{3/2} n_\mathrm{c}$. Figure~\ref{fig:mass_n} shows the relation between the final mass for the central star and the product $T^{3/2} n_\mathrm{c}$. We can indeed see the rough correlation between the final mass and $T^{3/2} n_\mathrm{c}$ as expected in the cases in which the central star contracts (dashed line and circles in Figure~\ref{fig:mass_n}). Also, the expected relation $\rho_\mathrm{*}\propto \sim T^{3/2} n_\mathrm{c}$ is roughly confirmed in Fig.~\ref{fig:mass_ps}, which shows the maximum stellar density within the core radius as a function of $T^{3/2} n_\mathrm{c}$. The offsets for high $m_\mathrm{max,0}$ or low $T$ cases (large empty or red circles/squares in Fig.~\ref{fig:mass_ps}) are presumably due to the differences in the efficiency of migration, which changes the accretion rate of surrounding stars onto the central star and so affects the stellar density within the core radius. As discussed above, if $T$ is low, $\rho_*$ remains low, and therefore stellar dynamical friction is inefficient. Additionally, since the mass of the stellar cluster in the core is approximately limited by $\dot{M}_{\mathrm{in}}t$, if $T$ is low, then $\dot{M}_\mathrm{in}$ is low (equation~\ref{eq:Mdotin}) and the cluster mass grows slowly. If the cluster mass remains low, the number of surrounding stars that bombard the central star is reduced. This is plausibly the reason why the final mass of the central star at some fixed values of the combination $T^{3/2}n_\mathrm{c}$ in low $T$ models is lower than those for high $T$ models (Figure~\ref{fig:mass_n}). Also in those cases when the central star keeps expanding until it collapses into a massive BH, the growth rate is determined primarily by the gas accretion rate in the final phase, the final mass depends on the inflow rate and accordingly the gas temperature (square plots in figure \ref{fig:mass_n}). This dependence explains why the final masses in Models 1, 6, and 7, which have the same temperature, are the same. Note that, in the cases in which the central star keeps expanding for 3~Myr, almost all of the gas that fell in from large scales is converted to the central star ($m_\mathrm{fin}\sim 3\,\mathrm{Myr}\times {\dot M}_\mathrm{in}$). On the other hand, the power-law slope $\beta$ of the IMF has only a small effect on the final mass (empty circle and square in Figure~\ref{fig:mass_n}). This is because $\beta$ has almost no effect on the density and mass of the stellar cluster, which are the critical factors for the efficiency of migration by stellar dynamical friction. For high $m_\mathrm{0,max}$, the final mass is higher than that for low $m_\mathrm{0,max}$ except in Model 28 (large empty symbols in Figure~\ref{fig:mass_n}). When the masses of surrounding stars are high, stellar dynamical friction operates prominently, which facilitates the growth of the central star. For high-mass stars, gas dynamical friction also operates efficiently, which enhances the heating of gas. In our models, when $\Gamma_\mathrm{GDF}>\Lambda_\mathrm{dust}$, star formation is assumed to stop operating due to the gas heating. In Model 28, star formation becomes inefficient due to this effect, resulting in a low final mass of the central star. However, our models cannot predict the evolution in this case, since the gas distribution and accretion processes will be affected by the increased gas pressure. Additional studies using three-dimensional hydrodynamical simulations are required to estimate the evolution in these cases, i.e. when $\Gamma_\mathrm{GDF}\gtrsim\Lambda_\mathrm{dust}$. \section{Discussion} In this section, we discuss assumptions in our models. \subsection{Inconsistency between assumptions} To calculate the acceleration rate due to stellar dynamical friction, the velocity dispersion of surrounding stars is assumed to be isotropic. Such a thermalized distribution for the surrounding stars is realized during the evolution due to the nonresonant and resonant relaxation processes \citep{Kocsis11}. We note that, technically, this isotropic distribution is inconsistent with the assumption that the surrounding stars follow circular orbits (in the calculation of the migration rate in equation~\ref{eq:migration_rate}). However, since migration rates for nonzero- and zero-eccentricity surrounding stars are the same when the binding energy is dissipated by the same amount, this inconsistency should have a negligible impact on our results (i.e. on the evolution of the central star). There is an inconsistency between the star-formation prescription, assuming surrounding stars form in a rotating gas disk, and equation (\ref{eq:sdf}), which assumes that surrounding stars are isotropically distributed. We expect that this does not significantly affect our conclusions. First, the gas disk thickness $h/r$ roughly evolves from $\sim0.4$ to $\sim0.08$ from $10^3$ yr to $10^5$ yr in Model 1, and never reaches very small values. Second, we expect that an isotropic distribution is established by relaxation processes \citep[e.g.][]{Kocsis11}. Finally, even if relaxation processes are inefficient, stellar dynamical friction would operate more strongly in a disk configuration, due to the higher stellar density and the low relative velocity between surrounding stars, which would facilitate stellar accretion. Thus the isotropic distribution of surrounding stars is a conservative choice for the growth rate of the central star. Although the disk around the central star is thick, we used the approximation $h\sim c_s/\Omega$ for the scale height of the disk. At $h/r=0.4$, the Toomre $Q$ parameter is overestimated by $\sim 10\%$ due to the approximation. Since $Q$ depends linearly on $n_\mathrm{c}$, this assumption may affect the dependence of the results on $n_\mathrm{c}$ by the same factor of 10\%, which is well within other uncertainties of our simplified model. \subsection{Star formation efficiency} In our models, we allow a high star formation efficiency (SFE), defined as the ratio of the total mass in newly formed stars to the initial gas mass. For example, the SFE within the core radius is $\sim 0.7$ at $t=10^4$ yr in our fiducial Model 1 (see below), and it increases with time. Observationally, some massive molecular clouds are found to have an SFE of $>0.5$ \citep{Turner15}, though the SFEs of most molecular clouds in the Milky Way are $\sim 0.002-0.3$ \citep{Murray11}. On the other hand, theoretically the SFE is determined by radiation pressure from ionizing ultraviolet (UV) photons, nonionizing UV photons, and infrared (IR) photons \citep[e.g.][]{Kim18}. Radiation pressure from nonionizing UV photons does not halt gas collapse when the gas surface density exceeds a critical value \citep{Raskutti16,Thompson16}, and likewise IR photons do not halt collapse unless the IR opacity is very high \citep{Skinner15}. In our models, the gas surface density within the core radius (Eq.~\ref{eq:ngas}) is much higher than the critical value \citep{Raskutti16,Thompson16}, and the IR opacity is extremely low because the gas is metal poor. We also estimate whether ionizing UV photons are confined within the Bondi-Hoyle-Lyttleton radius of each star (in which case they do not halt gas collapse; \S~\ref{sec:gas_ejection}). According to numerical simulations \citep{Skinner15,Raskutti16,Thompson16,Kim18}, when these feedback effects are inefficient, the SFE is close to unity (but not exactly 1 in their simulations due to the initial turbulent motion). Thus we considered the SFE of $\sim1$ to be justified in our case. On the other hand, although the SFE within the core radius becomes close to 1, the SFE within the rest of the halo is still low in our models since the baryon mass within the halo is $\sim 2\times 10^6\,{\rm M}_\odot$, and the mass of the stellar cluster is at most $\sim 10^4\,{\rm M}_\odot$ (see orange line in panel (a) of Figure \ref{fig:cent_ev_fid} below), so the SFE might not be so extreme compared to the SFE observed in molecular clouds (0.002-0.5). Also as mentioned earlier, the rate of star formation is sensitive to the gas temperature in our models. Compared to the fiducial case of $T=10^4$ K, the star formation rates for $T=5\times 10^3, 3\times 10^3,$ and $10^3$ K are lower by factor of 2.8, 6.1, and 32, respectively. These lower-$T$ models may be considered as proxies for lower SFE cases. \subsection{The eccentric orbit} In this study, surrounding stars are allowed to migrate in- or outward, but are assumed to remain on circular orbits. If angular momentum exchange dominates the accretion of surrounding stars, stellar accretion becomes more efficient than in our model, since the binding energy of a surrounding star required to accrete onto the central star decreases by a factor of $1/(1-e_i)$ where $e_i$ is the eccentricity of the $i^{\rm th}$ surrounding star. To investigate the impact of nonzero eccentricity, we examine a case in which the eccentricity distribution for surrounding stars is assumed to be thermalized (e.g. due to two-body relaxation), and has a distribution function of $f(e_i)=2e_i de_i$~\citep[e.g.][]{Jeans1919,Heggie75}. In this case, the central star captures surrounding stars from the larger distance $r_i=R_\mathrm{cent}/(1-e_i)$ (this is the only difference from the models above). Simulating this prescription with the parameter set of Model 2, we find the final mass of the central star to be $m_\mathrm{fin}=4.6\times 10^3\,{\rm M}_\odot$, which is almost unchanged from the final mass in Model 2 ($m_\mathrm{fin}=3.7\times 10^{3}\,{\rm M}_\odot$). However, this neglects other possible effects. For example, a surrounding star with a high eccentricity interacts with stars and gas orbiting over a wider ranges of $r$, and mass loss should increase when a surrounding star with extremely high eccentricity is captured. If most stellar accretion onto the central star is highly eccentric, and the mass lost at stellar accretion is typically a large fraction of the mass of the accreted surrounding star, the results of our models may be largely influenced. We intend to explore these issues in a follow-up study, based on direct $N$-body and hydrodynamical simulations. Here we only briefly consider the possible fate of the lost gas. If the launch velocity of this gas is similar in magnitude to the collision velocity between the stars, then the gas is kicked out to at most the apocenter of the colliding star's orbit before the collision. On the other hand, due to the low specific angular momentum of the ejected gas, it would be circularized (presumably by shocks it encounters) near the central star, similar to the expectation in the context of tidal disruption of stars \citep{Hayasaki2013,Hayasaki2016,Bonnerot_Lu2019}. In the vicinity of the central star, the viscous timescale is very short. Thus the gas ejected in high-eccentricity collisions may end up promptly accreted onto the central star, leaving our results largely unchanged. \subsection{Evolution following the formation of the massive black hole} Finally, let us consider the evolution of the stellar cluster after the central star collapses to a massive BH. Since collisions, relaxation, and evaporation are important mechanisms for cluster evolution, we show the collision (black curve in the bottom panel of Figure \ref{fig:snapshot}), stellar dynamical friction (orange curve), and evaporation (red curve) timescales for the stellar cluster at 3~Myr in Model 2. For the collision timescale (equation \ref{eq:n_coll}), the collision radius is assumed to be twice the radius of stars with the average mass, and stars are assumed to be in the contracted phase (equation \ref{eq:r_contract}). We adopt the evaporation timescale to be $t_{\mathrm{evap},l}=f_\mathrm{evap} t_{\mathrm{relax},l}$ \citep{Binney08}, where the factor $f_\mathrm{evap}$ is $\sim 300$ for clusters with a single stellar mass, and without a massive black hole and gas \citep{Spitzer87}, $t_{\mathrm{relax},l}=0.34 \sigma_{*,l}^3/(G^2 \overline{m}_l \rho_{*,l} \mathrm{ln}\Lambda)$ is the relaxation timescale \citep{Binney08}, and we set the Coulomb logarithm to be 10. Although we set $f_\mathrm{evap}= 300$, this value may be significantly increased for the cluster with a central massive BH which may help to retain objects from dynamical ejections both by increasing the cluster's escape velocity and by inhibiting binary formation.\footnote{The binary formation rate due to three-body encounters scales with $\sigma_{*}^{-9}$, which is greatly affected by a massive black hole \citep{Binney08}.} Figure~\ref{fig:snapshot} shows that the collision and evaporation timescales in the outer regions of the cluster are longer (at $\gsim 2000$ AU where $\rho_* \sim 10^{7-8}\,{\rm M}_\odot/\mathrm{pc}^3$) and comparable to the Hubble time of $\sim 10\,\mathrm{Gyr}$, respectively. Thus these clusters could possibly survive to low-$z$ epochs. If such high-density clusters sink to the centers of massive local galaxies, the relics of such high-density clusters formed at high $z$ may be observationally confused with stellar systems formed at lower redshift, such as infalling dense clusters and in situ formed stars, if those produce similarly high stellar density environments. The stellar density of nuclear star clusters may also be reduced by a supermassive black hole binary following galaxy collisions \citep{Merritt2006}. On the other hand, if such clusters remain isolated, their relics may in principle be clearly identified in the local universe. Such clusters contain low-mass and extremely low-metallicity stars, and an intermediate-mass BH with the mass of $\sim 10^3 \,{\rm M}_\odot$. Stellar densities within $\sim 2000$ AU of galactic nuclei have not been resolved to date \citep[e.g.][]{Nguyen18}. Extrapolating the observed density profile from diffuse light in the center of the Milky Way, the stellar mass within $\sim$2000 AU from Sgr A* is estimated to be $\sim 600-800\,{\rm M}_\odot$ \citep[e.g.][]{Schodel18}, which is about a factor $\sim 3$ smaller than that for high-density clusters formed at high $z$ (middle panel of figure \ref{fig:snapshot}). If such high-density nuclear star clusters are identified with low-mass stars in the future, they might represent the fossils of high-$z$ clusters. In the stellar cluster in Model 2, the accretion of stars will continue after the BH formation. This may contribute to the rate of high-$z$ tidal disruption events \citep{Kashiyama16} or to gravitational wave events observed by the {\it Laser Interferometer Space Antenna} ({\it LISA}) \citep[e.g.][]{AmaroSeoane07,Hartwig18}. \begin{figure} \begin{center} \includegraphics[width=90mm]{cent_ev2.pdf} \caption{ Same as panels (a) and (c) in Fig.~\ref{fig:cent_ev_fid}, but parameter settings are different (see \S \ref{sec:comparison}). } \label{fig:cent_ev_cont2} \end{center} \end{figure} \subsection{Comparison with hydrodynamical simulations} \label{sec:comparison} After this work was submitted and posted on {\it arXiv}, \citet{Chon20} presented results for three-dimensional hydrodynamical simulations focusing on similar scenarios. In this section, we briefly discuss the consistency between our predictions and their simulation results. \citet{Chon20} chose a relatively massive halo formed from cosmological initial conditions, in which the gas inflow rate is very high ($\gtrsim 1\,{\rm M}_\odot/\mathrm{yr}$). They find that the power law index of the initial mass function is $\sim -1$, the maximum mass of surrounding stars is $\sim 100\,{\rm M}_\odot$, and stars form at densities $\gtrsim 10^{11}\,\mathrm{cm}^{-3}$. Referring to these findings, we perform models with $n_\mathrm{c}=10^{11}\,\mathrm{cm}^{-3}$, $m_\mathrm{0,max}=100\,\mathrm{Msun}$, $\beta=-1$, and $T=3\times 10^4\,\mathrm{K}$. Since they use a barotropic equation of state, we allow the star formation even when $\Gamma_\mathrm{GDF}>\Lambda_\mathrm{dust}$. Since $f_\mathrm{red}$ is highly uncertain, we varied $f_\mathrm{red}$ between $10^{-3}$ and 1. The evolution of $f_\mathrm{red}=0.1$ is shown in Fig.~\ref{fig:cent_ev_cont2}. The central star grows to $\sim 10^{4}\,{\rm M}_\odot$ by $10$ kyr (black line in the upper panel) mainly due to mergers in the early phases (red line in the lower panel) and gas accretion in the later phases (blue line in the lower panel). The total stellar mass stops increasing at $\sim 5$ kyr for $f_\mathrm{red}=0.1$ (orange line in the upper panel) while it keeps increasing for $f_\mathrm{red}\leq0.01$. Similar trends are seen in panel (d) of Fig.~4 in \citet{Chon20}; namely the number of stars keeps increasing for $Z=10^{-4}$ and $Z=10^{-5}$, while it stops increasing at $\sim 5$ kyr for other models. We conclude from our models that quenching of star formation in their simulations is related to whether the accretion rate onto the central star comes close to the gas inflow rate. For $f_\mathrm{red}=$0.001, 0.01, 0.1, and 1, respectively, the mass of the central star at $10$ kyr is $5.5\times 10^3$, $5.8\times 10^3$, $1.0\times 10^4$, and $1.1\times 10^4\,{\rm M}_\odot$, the number of surviving stars is 896, 743, 426, and 203, and the contribution of mergers to the total final mass of the central star is 98$\%$, 87$\%$, 33$\%$, and 6.8$\%$. \citet{Chon20} find that the contribution of mergers is $\sim 30-70\%$, the central mass is $\sim10^{4}\,{\rm M}_\odot$, and the number of surviving stars is $\sim 500-4000$ at $10$ kyr. Thus our models with $f_\mathrm{red}\sim 0.01-0.1$ can reproduce their results remarkably well. The larger number of surrounding stars in \citet{Chon20} presumably reflects the lower minimum mass of surrounding stars ($\sim 0.01\,{\rm M}_\odot$) for $Z\sim 10^{-3}-10^{-5}$ compared to the value adopted in our models ($0.08\,{\rm M}_\odot$). When we continue the above models beyond the $10$ kyr at which \citet{Chon20} stopped their simulation, we find that the final mass (at $t=3$ Myr) of the central star for $f_\mathrm{red}=10^{-3}-1$ is as high as $3.5\times 10^6$, due to the high inflow rate (${\dot M}_\mathrm{in}\sim 1.1\,{\rm M}_\odot/\mathrm{yr}$). \section{Conclusions} In this paper, we propose a process for forming supermassive stars via stellar collisions and accretion in high-redshift protogalaxies. The scenario envisioned here shares some aspects of both the popular ``direct collapse'' and the ``runaway collision'' scenarios. We focus on environments in which a gas cloud is polluted only by a moderate amount of metals, and its ${\rm H_2}$ abundance is suppressed. In such environments, a gas cloud fragments only at very high density, producing a high-density stellar cluster~\citep{Omukai08}. If gas is ejected soon after stars form, the final mass of a central star becomes $\sim10^3\,{\rm M}_\odot$ \citep{Sakurai17}. The novel aspect proposed here is that if subsequent frequent capture and accretion of surrounding stars onto a central star efficiently heats the envelope of the central star, the central star continues expanding, and gas will be retained in the system due to the lack of strong UV radiation and weak photoionization feedback from the bloated central star. The central star can therefore keep growing until the supply of surrounding stars and gas runs out due to gas ejection by SN explosions or by accretion feedback from a collapsed massive BH. We call such a rapid stellar accretion process ``stellar bombardment'', which could be caused by efficient stellar migration via relaxation processes, the increase of the stellar radius by the mass increase, and most importantly, the heating and bloating of the stellar envelope due to the frequent stellar accretion itself. To investigate the viability of this ``stellar bombardment'' scenario, we have performed numerical modeling using a semianalytic toy model. The model includes dynamical friction by stars and gas, star formation, gas accretion, collisions, and gas ejection. Our main results can be summarized as follows: \begin{enumerate} \item When the central core density exceeds $10^{11}\,\mathrm{cm^{-3}}$ and the gas temperature is $\geq 3\times 10^3$ K, the central star continues growing without contracting until it reaches a mass of $\sim 10^5-10^6\,{\rm M_\odot}$ at 3~Myr. The central star grows mainly by stellar bombardment early on, and by gas accretion in the later phases. \item When the central core density is below $3\times 10^{10}\,\mathrm{cm^{-3}}$, the central star contracts due to the subcritical rate of accretion and heating by surrounding stars. After the contraction, photoionization feedback ejects gas from the system, reducing the final central star mass by about two orders of magnitude, to $\lesssim10^4\,{\rm M_\odot}$. \item The final mass of the central star depends strongly on the gas temperature and the core density of the gas, in addition to whether the central star contracts (figure \ref{fig:mass_n}). This is because the efficient growth of the central star by stellar accretion requires a high-density cluster. High-density star clusters can be realized for high star formation rates and/or compact core sizes, which in turn are produced for high gas temperature and core gas density, respectively. In a cosmological setting, these conditions can arise in metal-poor atomic-cooling halos, in which the ${\rm H_2}$ abundance has been suppressed, leading to inefficient cooling until very high densities are reached. \end{enumerate} In this paper we have used a simple toy model to illustrate the possibility of this new evolutionary process. To understand this pathway in more detail, including its viability, future $N$-body and hydrodynamical simulations will be required, which are able to follow stellar evolution and radiation feedback onto the collapsing cloud. \citet{Chon20} have recently presented results from three-dimensional hydrodynamical simulations, albeit with a prescribed barotropic equation of state, and without radiation. They find that supermassive stars likely form from gas with metallicities up to $\sim 10^{-4}\,{\rm Z_\odot}$ due to stellar accretion and gas accretion. Thus our predictions are confirmed by more realistic numerical simulations. \acknowledgments We thank to Simon Portegies Zwart and Takashi Hosokawa for important suggestions. This work received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 Programme for Research and Innovation ERC-2014-STG under grant agreement No. 638435(GalNUC), and from the Hungarian National Research, Development, and Innovation Office under grant NKFIH KH-125675. ZH acknowledges support from NASA grant NNX15AB19G and NSF grant 1715661. Simulations and analyses were carried out on Cray XC50 and computers at the Center for Computational Astrophysics, National Astronomical Observatory of Japan. \bibliographystyle{yahapj.bst}
\section{Introduction} \label{Introduction} Transportation is one of the largest consumers of energy in the world - in the United States, it accounted for $29\%$ of energy consumption in $2016$ \citep{eia2016}. Despite occupying a central place in the economy, transportation is far from efficient. Many areas of urban transportation networks are underutilized while other areas are congested. Congestion alone in the United States wastes $6.9$ billion hours and $3.1$ billion gallons of fuel per year \citep{schrank2015}. Thus, transportation has become an important policy \& innovation problem. Recently, public and private entities have begun introducing new transportation services including bike/scooter share, car share, ride hailing, and carpooling to complement private vehicles and existing public transit. This increasing accessibility of novel modes and the corresponding need for planning solutions creates an opportunity for \emph{mobility marketplaces} that aggregate a variety of offerings into a single market, similar to what Travelocity or Expedia does for air travel. Such mobility marketplaces enable the creation of new technologies to assist travelers in making decisions that meet their needs and benefit their community. Our long-term research goal is to develop AI methods to support efficient transportation decision-making reducing overall energy consumption and increasing citizen satisfaction in metropolitan areas. There are two important components to changing the transportation behavior of a large population toward this \emph{social good} goal. The first - the \emph{multi-modal route planning} problem - addresses how to reason about the large decision space of a variety of modes, routes, and combinations that are accessible to a person to determine an energy-efficient trip. The second component - the \emph{influence} problem - is guiding an individual's behavior such that they actually adopt trips that reduce the overall energy expenditure of a region. While the multi-modal route planning problem has been studied in detail by the AI community \citep{bast2016route}, the influence problem is largely unexplored in the AI literature. When influence is considered, it is from the perspective of monetary incentives \citep{doi:10.1177/0361198118775875,azevedo2018tripod}, which poses a business challenge. Here we focus on understanding the factors that underlie transportation decision-making to enable influence without monetary incentives. Our research on AI systems that act to influence human behavior towards a social good goal is part of a larger research agenda on design and analysis of \emph{human-aware} AI systems. Often while designing AI systems, little attention is devoted to modeling the behavior of humans who invariably are crucial decision makers. Human-aware AI systems \citep{khampapati2018} seek to address this gap and pose modeling humans as a question central to AI system design. While this is a worthwhile pursuit, current human modeling methods in AI are extremely limited in their scope \citep{albrecht2018autonomous}. Largely, human modeling research in AI originates in game domains where humans are modeled either as collaborators or opponents with fixed objective functions. These models are not sufficient for representing the causation of dynamic and evolving human behavior in the real-world (such as choosing a mode of transport) and consequently, cannot be applied to influence it. Our approach to building human-aware AI systems is to borrow models and methods from social sciences, in particular, behavioral economics, and explore how they can be integrated in computational systems in a principled fashion. Additionally, we relinquish typical AI metrics of accuracy and efficiency and define new \emph{human-centered} desiderata for AI systems to ensure that we are making progress towards systems that are truly human-aware. In our problem, the desiderata is related to \textit{influence} - how likely is a person to change their behavior when provided with a recommendation. To develop a computational formulation of \textit{influence}, we engage with research in economics on rational choice and human preference modeling. Further, we adopt empirical methods prevalent in social science research to evaluate our proposed formulation. Then, we engage with transportation modeling research to simulate the impact of applying our approach on the energy consumption of a large city. By engaging these disciplines, we propose a comprehensive methodology for developing intelligent solutions for social good. More specifically, our paper makes the following contributions: \begin{enumerate} \item Introduces the transportation influence problem for social good and a useful component - \textit{acceptability}, \item Develops a machine learning approach to estimate acceptability, \item Evaluates the formulation of acceptability using a human participant study, \item Proposes and implements a novel integration of AI planning theory and economic choice theory for \emph{acceptable planning}, and \item Evaluates the integrated approach by combining human decision data with a high fidelity transportation simulation model of the Los Angeles area. \end{enumerate} \section{The Traveller Influence Problem} \label{sec:influence_problem} Social sciences research proposes several factors that are useful for influencing someone to change their behavior. The transportation mode choice framework \citep{ben1985discrete} suggests that attributes that define the context in which the trip is undertaken, such as distance of the trip, cost of taking the mode, duration of travel etc. play a role in people's preference for a specific mode. Recommending a mode that is higher on a person's preference list may increase the likelihood that the recommendation will be adopted. Just-in-time adaptive interventions for health behavior change \citep{nahum2015building} suggest that recommendations provided at opportune times are more likely to influence behavior. Further, research in persuasive messaging \citep{benoit2008persuasive} has studied the impact of various types of message framing - how information is conveyed - has on individuals in influencing their choices and behaviors. Building on these results, we define the travel influence problem as delivering an \emph{acceptable}, \emph{timely}, and \emph{compelling} travel recommendation that results in a person selecting a sustainable mode. Our approach to the influence problem is embedded within an intelligent \emph{travel assistant} - Collaborative Optimization and Planning for Transportation Energy Reduction (\textsc{Copter}) and aims at operationalizing influence strategies for travellers. Figure \ref{fig:arch} contains a functional description of the system and we illustrate \textsc{Copter's} desired influence behavior with the following example. Assume that Jane makes a regular trip driving to her office every weekday morning and has \textsc{Copter} installed on her smartphone. In a \emph{timely} fashion, $15$ minutes before she has to leave, \textsc{Copter} suggests an alternative trip - walk to the bus stop and take the direct bus to her office - chosen from all alternatives available to Jane. This trip is not only energy-efficient, but also \textit{acceptable} to Jane given the context of her travel and her preferences. \textsc{Copter} makes this suggestion by considering that the route is direct, that a lot of people in her neighborhood take the bus, and that she is traveling to her workplace and therefore, will not be carrying heavy loads. Further, \textsc{Copter} recognizes that she cares about her impact on the environment and frames this information in a \emph{compelling} way by telling her the emissions she can reduce by taking this trip. \begin{figure} \centering \includegraphics[width=1\textwidth]{images/dr-jane.png} \caption{The transportation influence problem seeks to alter traveler behavior by suggesting routes based on the available options, the dynamic context including trip purpose, and a model of the traveler's preferences.} \label{fig:arch} \end{figure} This paper explores how acceptability of a mode can be defined for transportation planning and how acceptability affects the adoption of a recommendation. The remainder of the paper is organized as follows. We begin by describing the multi-modal planning framework and choice theory framework that form the basis of our approach, in Section \ref{sec:preliminaries}. Then, in Section \ref{sec:defining-acceptability}, we formally define the notion of \textit{acceptability} for planning. We develop a machine learning method to estimate individual acceptability from a population-level, transportation behavior dataset from Los Angeles, California in Section \ref{sec:ml_approach}. We show that this acceptability model is predictive of adoption through a human participant study in Section \ref{sec:evaluation_acceptability}. Upon validating our definition of acceptability, we incorporate it in the planning framework in Section \ref{sec:acceptable_planning}. Finally, we demonstrate the energy impact of our approach using a high-fidelity simulation model of transportation energy integrated with human behavior in Section \ref{sec:experiments}. In Section \ref{sec:related_work}, we study research threads pursued by other researchers from AI, transportation, and behavior change. We conclude with a discussion of the future work in Section \ref{sec:conclusion}. \section{Preliminaries} \label{sec:preliminaries} To understand the novelty of our approach, we first review the two strands of research we build upon, and later, we describe their limitations for the transportation influence problem. \subsection{Multi-Modal Route Planning} Routing in transportation networks is a well studied problem in computer science dating back to Dijkstra's algorithm \citep{dijkstra1959note}. Today, through pre-computation and heuristics, planners identify optimal routes for continent-size networks while guaranteeing optimal solutions in fractions of seconds \citep{bast2016route}. These approaches use the standard transportation network representation as a directed graph $G = (V,E)$, where $V$ is a set of nodes and $E \subseteq V \times V$ is a set of directed edges. The formalism also includes a standard representation of time, $T$. A request for transporting a person from their origin location $v \in V$ starting at a certain time $t_s \in T$ to their destination $w \in V$ before a certain deadline $t_e \in T$ is formalized as $q = (v,w,t_s,t_e)$. The planning problem is formalized as $(G, q)$. Traversal of each edge is represented as a pair $(e,t)$ where a person begins moving along the edge $e$ at time $t$. A plan $\pi = ((e_1,t_1),...,(e_n,t_n))$ is a valid solution of the problem $(G, q)$ if and only if: \begin{enumerate} \item the edges connect the origin with the destination. $e_1 = (v_0, v_1),e_2 = (v_1,v_2),...,e_n = (v_{n-1},v_n) \wedge (v_0 = v) \wedge (v_n = w)$, \item temporal constraints are satisfied, $t_s \leq t_1 + dur(e_1) \leq t_2 + dur(e_2) \leq ... \leq t_n + dur(e_n) \leq t_e$ where $dur(e)$ represents the time it takes to traverse the edge $e$. \end{enumerate} To find an optimal plan, cost function $cost(e)$ is defined for every edge in $G$. An optimal plan is a plan that minimizes the cumulative cost $\pi^* = \argmin_{\pi \in \Pi} \sum_{e \in \pi} cost(e_i)$, where $\Pi$ is the set of all valid plans. In the simple case, the cost is the time it takes to traverse the edge, $cost(e_i) = dur(e_i)$. $A^*$ search with a reasonable heuristic (e.g., euclidean distance) efficiently solves these problems. Recent work provides extensions for multi-modal trips \citep{Dibbelt:2015:UMR:2627368.2699886} and more elaborate cost functions. This is achieved by adding additional edges between vertices corresponding to the various modes (e.g., public transportation, biking, walking) that are available to traverse them. When the edges represent public transit vehicles, they have temporal constraints representing the vehicle schedules. Each edge $e$ is labeled with the mode it represents, e.g., $lbl(e) = b$ for an edge representing taking the bus. Consequently, each plan $\pi$ corresponds to a sequence of labels, \emph{word} ($w_p$). This imposes a third requirement on valid solutions that the word is part of the language of acceptable mode sequences ($w_p \in L$), represented using regular expressions. This constraint eliminates plans that are impossible, such as taking a bus and then getting on a bike. Others \citep{delling2013computing,botea2016hedging,dvorak2018} have shown that in this formulation, the cost function can consider additional dimensions including price, energy, and schedule risk. The cost function is formalized as $cost(\pi) = \sum_{e \in \pi}\sum_{\varphi \in \Phi}\theta_{\varphi} \varphi(e)$ where $\Phi$ is the set of evaluative functions including energy consumed, price, etc. and $\theta_{\varphi}$ corresponds to how much importance that evaluative function has toward computing the overall edge cost. To support personalization, numerous researchers have extended the basic notion of an edge-based objective function to capture more information. For example, deployed planners now combine travel time, cost, and convenience measures in selecting multi-modal plans \citep{delling2013computing}. In the research setting, methods for incorporating even more criteria (e.g., robustness to missing connections, \cite{botea2016hedging}, safety, \cite{Liu2018}) have been used. \subsection{Utility-Based, Probabilistic Choice Theory} Economists use the framework of rational choice theory \citep{tversky1986rational} to study how humans make decisions from a set of competing alternatives. Empirical research in transportation economics \citep{domencich1975urban} has shown that such frameworks are useful in predicting transportation mode shares in urban populations. The theory posits a choice process: for a trip, the individual first determines the available mode alternatives; next, evaluates the attributes of each alternative relevant to the travel decision, and then, uses a decision rule to select an alternative. The rational decision-making perspective motivates \emph{utility maximization} as a relevant decision rule. Utility maximization is based on two fundamental concepts. First, the attributes of a mode alternative can be reduced to a scalar utility value. This assumption implies a compensatory decision process; i.e, the decision maker will make \emph{trade-offs} among the various attributes. For example, an individual may choose a pricier mode if the comfort provided by that mode compensates for the increased cost. Second, the decision maker selects the alternative with the highest utility value. This framework can be expressed as: \[ util(x_i, f_p) \geq util(x_j, f_p) \forall j \implies i \succ j \forall j \in C \] where $util()$ is the utility function, $x_i, x_j$ are vectors of attributes describing mode alternatives $i$ and $j$ (e.g, travel time, travel cost, etc.), $f_p$ is a vector of characteristics of the decision maker that influence their preferences (e.g., income, number of automobiles), $i \succ j$ means that $i$ is preferred to $j$, and $C$ is the choice set of various alternatives. The deterministic theory assumes all aspects of the decision process can be observed and measured. Transportation decision-making is only partially-observable. By adding noise, the utility of an alternative for an individual can be split into two components - observable utility and error: \[ util(x_i, f_p) = val(x_i, f_p) + \epsilon(x_i, f_p) \] Here $val(x_i, f_p)$ is the observable portion of the utility. This quantity is modeled as a linear combination of measurable attributes such as travel time, travel cost, walk distance, etc: \begin{equation} \label{eq:value} \begin{split} val(x_i, p) = \gamma_1 \times x_{i1} + \gamma_2 \times x_{i2} + ... + \gamma_k \times x_{ik} + \\ \lambda_1\times f_{p1} + \lambda_2 \times f_{p2} + ... + \lambda_l \times f_{pl} \end{split} \end{equation} $\gamma_k$ is the parameter which defines the direction and importance of the attribute $k$ on the utility of an alternative $i$. Similarly, $\lambda_l$ defines the direction and importance of the person's characteristic $l$ . $\epsilon(x_i, f_p)$ is the unobservable portion - the error term - of the utility function. Prior work \citep{koppelman2006self} in transportation mode choice recommends an assumption that the error terms of various alternatives are independent. This assumption leads to a \emph{multinomial logit model}. This model estimates the probability $Pr(i, p)$ of the person $p$ selecting the alternative $i$ from the set of alternatives $C$: \begin{equation} \label{eq:probability} Pr(i, p) = \frac{e^{val(x_i, f_p)}}{\sum_{j \in C} e^{val(x_j, f_p)}} \end{equation} Empirical work in transportation research \citep{ben1985discrete} has studied how $\gamma$ and $\lambda$ parameters in equation \ref{eq:value} can be estimated from human choice data using maximum likelihood estimation given equation \ref{eq:probability}. \subsection{Limitations \& Challenges for Influence} While each of these threads provides insights for the influence problem, there are significant gaps. While we incorporate many of the ideas from AI planning including constraints on multi-modal transit graphs and time-dependent edges, finding optimal routes depends on computing costs for traversing each edge in the transportation network which poses two challenges in our context: (1) They include a large number of user parameters that are difficult to elicit from users (e.g., how much do you value time riding a bus versus a train versus driving a car?), and (2) Empirical work from transportation choice theory indicates that there are attributes that do not correspond to edge weights (e.g., household income, number of vehicles at home). We are unable to apply choice theory directly, because by itself this theory does not suggest how mode alternatives can be generated. Furthermore, neither of these methods explicitly provide a definition of \emph{acceptability}, \emph{adoption}, or influence. Planning computes the optimal path for an individual given a cost function defined for every edge and choice theory predicts the probability of a trip occurring given some observable characteristics about the person and the mode of transport. The results of these computations are not the same as an estimate of the likelihood that the user will take an alternative mode if recommended (mode adoption likelihood). This is necessary for a solution to our decision-theoretic problem. That is, in \textsc{Copter}, each traveler has an expected plan for an upcoming trip, and our goal is to produce an \emph{acceptable} alternative that changes their behavior to reduce energy consumption across the network. In the sections below, we propose how these challenges can be addressed for \emph{acceptable} planning. \section{Defining Acceptability} \label{sec:defining-acceptability} We adapt choice theory's decision process to incorporate \emph{acceptability} as follows. Jane (from Section \ref{sec:influence_problem}) drives to her office every weekday on a certain route. The choice theory suggests that this usual route ($u$) has a certain measurable utility, $val(x_u, f_p)$ and a certain probability of being selected based on equation \ref{eq:probability}. Here $x_u$ is the vector of attributes representing Jane's usual mode such as time, distance, etc. and $f_p$ is a vector that describes Jane's attributes that pertain to mode selection such as income, education level etc. Upon receiving the recommendation, $r$, from \textsc{Copter}, Jane evaluates it against her usual means of travel. The recommendation $r$ has a measurable certain utility, $val(x_r, f_p)$, given the utility function underlying Jane's preferences. On adopting the recommendation, Jane will experience a \emph{switching cost} - $\Delta_{u,r,p}$ - the difference in utilities of her usual route and the proposed route. Conversely, $\Delta_{r,u,p} = -\Delta_{u,r,p}$, can be understood as the \emph{switching gain} a person makes on adopting the recommendation $r$. Following probabilistic choice theory (equation \ref{eq:probability}): \begin{equation} \label{eq:acceptability} \begin{split} \frac{e^{val(x_u, f_p)}}{e^{val(x_r, f_p)}}= \frac{Pr(u, p)}{Pr(r, p)} \\ e^{val(x_u, f_p) - val(x_r, f_p)} = \frac{Pr(u, p)}{Pr(r, p)} \\ \Delta_{u,r,p} = val(x_u, f_p) - val(x_r, f_p) = \ln{\frac{Pr(u, p)}{Pr(r, p)}} \\ \Delta_{r,u,p} = -\Delta_{u,r,p} = \ln{\frac{Pr(r, p)}{Pr(u, p)}} \\ \end{split} \end{equation} We postulate that the acceptability of a route is related to its switching gain. If we can estimate the likelihood of a person taking their usual mode of travel and that of the recommended mode, we can compute the change in utility and consequently estimate the recommendation's acceptability. This formulation is a significant departure from prior empirical work in transportation research. The prior work focuses on estimating the coefficients in equation \ref{eq:value} to compute exact utility values given measurements of relevant, observable attributes. Exact values of coefficients are useful for comparing various attributes in the model to understand the trade-offs a person may be willing to make and for computing monetary incentives. For influence, this exact computation of utility value is not necessary and the switching gain (and acceptability) can be computed from estimated likelihoods alone. However, before acceptability is integrated in the planning framework, the following questions merit further exploration. \begin{itemize} \item What is the exact quantity that represents acceptability? Based on the discussion here, we begin by considering three candidate definitions: \begin{enumerate} \item switching gain: $\Delta_{r,u,p}$ \item odds: $e^{\Delta_{r,u,p}} = Pr(r,p)/Pr(u,p)$ \item likelihood of the recommended mode: $Pr(r,p)$ \end{enumerate} A related question is - how can acceptability be computed for a person when there is no prior observed mode selection data for them? \item Does acceptability of a mode affect its adoption when it is included in a recommendation? Are there other factors that may influence mode adoption above and beyond a recommendation's acceptability? \end{itemize} We answer these questions through an empirical approach described in the following sections. In Section \ref{sec:ml_approach}, we develop a machine learning approach using a large-scale, publicly available survey dataset to estimate mode likelihood for a person taking a given trip. These likelihoods can be used to compute acceptability using any candidate definition. Then, we compare different candidate definitions of acceptability (computed using these likelihoods) in Section \ref{sec:evaluation_acceptability} determine which definition best predicts adoption. \section{Estimating Acceptability: A Machine Learning Approach} \label{sec:ml_approach} As explained earlier, in order to estimate acceptability of a recommendation $r$ for a person $p$, we need to calculate the likelihood of taking the mode of the recommendation, $Pr(r, p)$ as well as for their usual mode, $Pr(u, p)$. Here we explore how a data-driven, machine learning method can be used to estimate these likelihoods. A typical ML classifier, such as a random forest classifier, generates a prediction of a class, given a set of input features, by computing probability for each class label and selecting the class with the highest probability. Thus, the classifier not only predicts the class label, but also the probability for every other class label. This probability estimate is critical for our approach. \subsection{Dataset} To develop our ML classifiers, we used the California Household Travel Survey (CHTS; \cite{CHTS}) that consists of a single-day (distributed in a year) travel diary of people from $58$ counties of California and $3$ counties of Nevada. To ground our research within the context of a specific metropolitan area, we extracted trip data for $4,889$ Los Angeles (LA) residents belonging to $2,006$ households. Each sample in this dataset is a trip (defined by an origin-destination pair) taken by a specific individual. This dataset contains $78,380$ trips undertaken in Los Angeles county. For each trip, we extracted the following features: \begin{itemize} \item \textit{trip-related}: trip distance, \item \textit{demographics}: such as education level, number of people/students/workers in the household, \item \textit{employment}: number of hours worked every week, income, number of jobs, flexibility of work, \item \textit{mode accessibility}: number of automobiles in the household, number of bicycles in the household, owns a driver's license \& transit pass, and \item \textit{mode experience}: transit used, bike trips made \& walking trips made in the past week. \end{itemize} These trips were made using $7$ different modes - walk, cycle, bus, subway/train, drive, auto passenger, and motorcycle. \subsection{Models} We explored two different multi-class prediction problems: mode prediction and category prediction. The mode prediction problem is predicting the most likely mode given some characteristics about the trip and the person making that trip. For category prediction, we created additional labels with walking \& cycle as \textit{non-motorized}, driving, riding, \& motorcycle as \textit{motorized}, and bus \& subway as \textit{public transport}. Consequently, the category prediction problem is predicting the category of the mode given trip and person characteristics. For each prediction problem, we developed two kinds of classifiers using standard open-source implementations: \begin{enumerate} \item Random forest \citep{scikit-learn}: an ensemble of decision trees with $20$ estimators of $30$ depth each. \item Multi-layer perceptron \citep{tensorflow2015-whitepaper}: a multi-layer perceptron with $4$ layers ($[1000, 500, 100, 100]$). \end{enumerate} We selected these classifiers because they impose minimal constraints on the relationships between features and class labels and can capture non-linear decision boundaries. As a starting point of exploring the prediction problems, these types of classifiers are fairly reliable. The specific parameters were found by a brief, bucketed linear hyperparameter search. To study if these classifiers captured useful predictive information, we compared their performance with two baselines: \begin{enumerate} \item \textit{most frequent}: This baseline assigns the most frequent class label to every sample. \item \textit{weighted random}: This baseline randomly assigns class labels to each sample based on its distributional frequency in the dataset. \end{enumerate} \subsection{Results} \begin{table}[t] \begin{center} \def1.2{1.1} \begin{tabular}{lcccc} \toprule Mode & Baseline 1 & Baseline 2 & Random& Multi-layer \\ & (most frequent) & (weighted random) & Forest&Perceptron \\ \midrule \textit{Walk} &0.00&0.12&0.82*&0.62 \\ \textit{Cycle} &0.00&0.00&0.81*&0.28 \\ \textit{Bus} &0.00&0.02&0.78*&0.38 \\ \textit{Subway/train} &0.00&0.00&0.58*&0.05 \\ \textit{Drive} &0.72&0.56&0.93*&0.86 \\ \textit{Ride }&0.00&0.28&0.84*&0.65 \\ \textit{Motorcycle} &0.00&0.00&0.80*&0.00 \\ \midrule[0.15pt] \textbf{\emph{Total}} & 0.68& 0.40& 0.88*& 0.74\\ \bottomrule \bottomrule Mode category &&&&\\ \midrule \emph{Non-motorized} &0.00&0.05&0.83*&0.60 \\ \emph{Public transit} &0.00&0.14&0.79*&0.43 \\ \emph{Motorized} &0.90&0.82&0.97*&0.93 \\ \midrule[0.15pt] \textbf{\emph{Total}} &0.68&0.70&0.94*&0.86\\ \bottomrule \end{tabular} \end{center} \caption{F1-scores for predicting mode classes and major modes with various machine learning methods. * indicate the best performing classifier for that mode.} \label{table:prediction} \end{table} $F1$ scores for both classifiers as well as baselines on a $20\%$ test set are shown in Table \ref{table:prediction}. We see that both ML classifiers perform significantly better than the baselines for not only predicting each class (\& category) but have a better overall performance as well. These results suggests that the ML classifiers contain useful predictive information that can be used to estimate the switching gain (as well as acceptability of a recommendation). We can see that the random forest classifier has better performance than the multi-layer perceptron.\footnote{With additional effort and design, there is room for significant improvement in each of these classifiers. The results presented were sufficient for our objective of evaluating the overall framework.} This is expected due to the limited size of the dataset. We further see that the performance on category prediction is better than mode prediction. Again, this is to be expected as combining mode classes leads to more data to learn from and consequently better performance. Given that the random forest classifier achieves the best performance on this dataset, this classifier was selected for implementing the remainder of our approach. A deeper look (Figure \ref{fig:importance}) into the random forest classifiers reveals the Gini importance \citep{breiman1984classification} of various features in predicting the mode and category. As expected, we can see that the distance of the trip is the best predictor. People prefer to drive when they have to travel longer distances and there is no reliable public transport option. Apart from trip distance, characteristics of a person's transportation network (such as accessibility of vehicles in their home) and their past experience (such as walking trips undertaken last week) also contain predictive information. \begin{figure} \begin{subfigure}{.5\linewidth} \includegraphics[width=1\textwidth]{images/importance_mode.png} \caption{Mode prediction problem} \end{subfigure} \hfill \begin{subfigure}{.5\linewidth} \includegraphics[width=1\textwidth]{images/importance_category.png} \caption{Category prediction problem} \end{subfigure} \caption{Gini importance \citep{breiman1984classification} of various features in predicting mode and category using the random forest model} \label{fig:importance} \end{figure} \subsection{Towards Computing Acceptability} For our candidate definitions of acceptability (in Section \ref{sec:defining-acceptability}), $P(r,p)$ and $P(u,p)$ are important quantities. In this section, we demonstrate how these quantities can be estimated from a population survey dataset. In particular, a person $p$ is defined as a collection of attributes encoding their demographic and employment information. Our ML approach is a significant step forward from previous empirical approaches in transportation research \citep{ben1985discrete} that have relied on standard features such as distance, income, etc. to predict mode selection. We conducted detailed interviews and survey \citep{mohan2019exploring} and found that a large variety of factors play a role in mode selection. Our ML-based approach here allows for a breadth of features including trip features (trip distance) as well as features that represent a person's transportation network (accessibility of various modes) and their experience (walking trips in the past week). It should be noted that while these previous approaches are more detailed in measuring the relative importance of each attribute of an individual's preference, our approach is extensible to whatever attributes are available. As we discussed in Section \ref{sec:defining-acceptability}, for a planning formulation that seeks to select from various available plans, detailed models are not necessary. An approach such as ours that provides an overall evaluation will suffice. Computing mode acceptability using these likelihoods captures the intuition that it is easier to switch to modes taken by similar people in similar contexts. Thus, our primary assumption is that the utility function (and consequently, acceptability) can be generalized to people with similar characteristics. For example, a traveller who usually drives to a destination lives in a neighborhood where 50\% people drive, 40\% use transit, and 10\% walk to the same destination. Intuitively, it should be easier for the traveller to switch to transit than to walk. \section{Evaluating Acceptability: Evidence from a Stated Preference Study} \label{sec:evaluation_acceptability} Recall from Section \ref{sec:defining-acceptability} that not only do we have three candidate definitions of acceptability, it has not been previously shown that acceptability of a mode (computed using the ML models) will in fact impact adoption. Further, it is unclear if individuals differ in how acceptability of a recommendation impacts its adoption. These differences may arise due to difference in demographics (i.e., young individuals are more open to trying newer ways to travel) or due to some aspects of their personality that make them more or less susceptible to persuasion \citep{cialdini2001harnessing}. In this section, we study these questions. We rely on stated preference methods \citep{johnston2017contemporary} that are used to elicit customer preference as well as for product valuation via survey responses. In particular, we conducted a small choice experiment for mode adoption. The survey instrument was adapted for our use-case of recommendations made through a travelling assistant application. This experiment had the following goals: \begin{enumerate} \item to establish that when recommendations are provided to regular drivers, they will consider adopting the recommended mode; \item to evaluate if adoption of the recommended mode depends on its acceptability computed via the ML models in Section \ref{sec:ml_approach}; \item to study individual factors in the impact of acceptability on mode adoption; and finally, \item to choose a specific definition of acceptability and develop a working model of adoption to integrate with planning. \end{enumerate} A choice experiment presents a participant with a set of options that differ on various attributes and asks the participant to select one option. This experiment and the following analysis uncovers how participants value different features. In our context of mode recommendation, one of the options is traveling by driving - the \emph{usual} mode - and another option is the \emph{recommended} mode determined by \textsc{Copter} through acceptable planning. We designed a choice experiment that mimics our context as described next. Our experiment had $49$ ($27$ female, $22$ male) participants who are regular drivers in the Los Angeles area. The participants had a mean age of $38.98(\pm 12.25)$ and a median household income of $\$75,000 - \$99,999$. The participants were distributed in the Los Angeles area and have diverse commuting behaviors as shown in Figure \ref{fig:stated-pref-participants}. The participants were gathered by a paid recruiter who ensured compliance with responses. The participants were provided Amazon gift cards worth $\$30$ for completing the study. \begin{figure}[t] \centering \begin{subfigure}[b]{0.6\textwidth} \includegraphics[width=\textwidth]{images/map.png} \end{subfigure} \hfill \begin{subfigure}[b]{0.27\textwidth} \includegraphics[width=\textwidth]{images/miles_per_week.png} \includegraphics[width=\textwidth]{images/trips.png} \end{subfigure} \caption{Location of study participants in the Los Angeles Metropolitan Area and their weekly travel characteristics.} \label{fig:stated-pref-participants} \end{figure} \subsection{Materials} Each study participant took two surveys within a week: \begin{enumerate} \item \emph{Profiler}: For each participant, this survey collected a set of trips they regularly made by driving in terms of the origin, destination, departure time, and purpose. Participants were asked to provide a specific name for each trip (such as \emph{Film Networking Events} in Figure \ref{fig:question}). This name was used in a later survey to refer back to this trip. Additionally, we measured participants on the features incorporated in our random forest classifier (from Section \ref{sec:ml_approach}). To study individual differences in the impact of acceptability on adoption, we collected information about participant demographics: their age and gender as well as their susceptibility to persuasion using Cialdini's scale \citep{cialdini2001harnessing}. The $17$ item scale measures a participant's agreement with various values that underlie persuasion and influence: \emph{reciprocity} ($2$ items), \emph{commitment} ($2$ items), \emph{social proof} ($2$ items), \emph{authority} ($2$ items), \emph{liking} ($2$ items), and \emph{unity} ($5$ items). Measurements are done on a $7$-point Likert agreement scale from \emph{strong disagree} to \emph{strongly agree}. \item \emph{Mode adoption}: The mode adoption experiment was generated programmatically from the data collected in the profiler survey. We generated $10$ mode adoption questions for each participant. For all trips reported in the profiler survey, we generated a set of available modes. This set included: \emph{public transit}, \emph{driving slow}, \emph{driving 15 minutes later}, \emph{biking} if the trip distance is $<3$ miles and the participant owns a bicycle, and \emph{walking} if the trip distance is $<1$ mile. Each available mode must correspond to a class from the mode prediction problem in the previous section. We included driving-related modes as a sanity check for the responses in study. Because both driving modes ask participants to change their behavior, and consequently, will result in a negative switching gain. We expect that due to this negative switching gain, they will not be fully adopted. Further, because both are driving-related (and are similar to what the participants are already doing), their adoption will be better than taking the public transport or walking. Evidence suggests that the driving-related modes can reduce transportation energy consumption. From the trip-mode pairs, we randomly selected $10$ pairs. For each trip-mode pair, we generated a recommendation to be presented to the participant. This recommendation (see Figure \ref{fig:question}) included information about the original trip: name of the trip, origin and destination addresses, day of the week, usual departure time, and usual arrival time; and the new recommended trip: recommended mode, departure time, and expected arrival time. Additionally, a visual representation of the proposed route was shown. The visual representation was generated using a web application - \textsc{TripGo} \cite{tripgo}. The participants were provided the context of this recommendation and asked to evaluate if they will take the recommendation. \begin{figure}[h] \centering \includegraphics[width=1\textwidth]{images/scenario.png} \includegraphics[width=1\textwidth]{images/scenario-pic.png} \includegraphics[width=1\textwidth]{images/likelihood.png} \caption{An example of the mode adoption question in the survey along with the response measurement instrument.} \label{fig:question} \end{figure} This question sets up the choice experiment. Participants had indicated that their usual mode of travel for that trip is driving. This recommendation sets up an alternate scenario and the participants are asked if they are willing to change their behavior by accepting the recommendation. The participants indicated likelihood of accepting the recommendation using a $7$-point Likert scale: from \textit{extremely unlikely} ($-3$) to \textit{extremely likely} ($3$). If the participant is tending towards the \textit{unlikely} end of the scale, they can be considered choosing their usual mode, driving. When the participant is tending towards \textit{likely}, they can be considered choosing the recommended mode. \end{enumerate} \subsection{Data Analysis} From the materials described above, we have the following for each mode adoption measurement: \begin{enumerate} \item{Independent variables} \begin{enumerate} \item \emph{Computations for acceptability}. We estimated the probability of driving, taking public transit, and taking a non-motorized mode (cycling or walking) using the random forest ML model for category prediction described previously. Using these probabilities, we computed the following three values of acceptability as per the three candidate definitions of acceptability: \begin{enumerate} \item switching gain: $\Delta_{r,u,p}$ \item odds: $e^{\Delta_{r,u,p}} = Pr(r,p)/Pr(u,p)$ \item likelihood of the recommended mode: $Pr(r,p)$ \end{enumerate} \item \emph{Individual variability}. \begin{enumerate} \item \emph{Demographics}, measurement of gender and age. \item \emph{Susceptibility to persuasion}, measurements on $17$ item Cialdini scale. \end{enumerate} \end{enumerate} \item{Dependent response variables} \begin{enumerate} \item \emph{Ordinal adoption}: Participant response on the $7$-point Likert scale. \item \emph{Binary adoption}: To simulate real-world behavior where someone will either follow the recommendation or not, we compressed the ordinal response by categorizing everything reported as \emph{slightly likely} or higher as $1$ and others at $0$. \end{enumerate} \end{enumerate} Using the data above, we conducted the following analyses: \begin{enumerate} \item In Section \ref{sec:driving_adoption}, we plot the distribution of ordinal adoption responses for various modes to show that participants consider adopting modes when provided with a recommendation and that our instrument - the mode adoption survey - is a reasonable instrument. \item In Section \ref{sec:acceptability_selection}, we evaluate if acceptability of a mode (computed using population-based ML models) is predictive of adoption and which candidate definition should be adopted. To do this, we employ mixed-effect linear and logistic regression models for the ordinal and binary adoption respectively. Mixed-effects linear regression is of the form $y = \alpha + \beta x + \gamma z + \epsilon$, where $y$ is the adoption vector, $x$ is a fixed-effect vector corresponding to different definitions of acceptability, and $z$ is a random effect vector corresponding to a participant. $\alpha$ is the intercept, $\beta$ and $\gamma$ are coefficients, and $\epsilon$ is the error term. For the binary adoption variable, we fit a mixed-effects logistic regression of the form $Pr(y) = 1 / ( 1 + e^{-(\alpha + \beta x + \gamma z + \epsilon)})$, where $Pr(y)$ is the probability of observing the specific adoption value ($0$/$1$). Participants are modeled as random effects in these models under the \emph{random intercept} assumption which encodes that some variance in responses is due to each participant having a different baseline reaction to recommendations. We report $R^2m$, the proportion of variance in $y$ explained by measured, independent variables as well as $R^2c$, the proportion of the variance that is explained by the complete model including the random individual-level effects. \item In Section \ref{sec:adoption_individual}, we explore the individual differences in the impact of acceptability in adoption of recommendations. Here, we include participants' measurements on the Cialdini's scale as fixed-effects in the regression models as well as their age and gender. \item In Section \ref{sec:adoption_model}, we select a definition of acceptability and develop a working model of adoption for formulation of acceptable planning. \end{enumerate} \subsection{Results} \subsubsection{Adoption of Driving v/s Other Mode Recommendations} \label{sec:driving_adoption} First, we compare the adoption rates of driving-related modes with others. As discussed earlier, \emph{H1}: we expect the adoption rates of driving-related modes to be higher than other modes as they are similar to what the participants are already doing. However, \emph{H2}: we expect them to not be fully adopted as they do require a change in usual behavior. We compare ordinal adoption of various recommended modes by plotting Likert-scale ratings as in Figure \ref{fig:box-plots-modes}. We see that both \emph{H1} and \emph{H2} are supported in our data. Further, we find that adoption of \emph{driving slow} may be better than that of \emph{driving later}. That is reasonable, given that for some participants arriving at their destination by a certain time may be required. Given that the data collected through the choice experiment study matches our intuition about the domain, we can conclude that the study is measuring useful information about participants' behavior. \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{images/mode-adoption.png} \caption{Box plots showing the distribution of ordinal adoption responses by mode.} \label{fig:box-plots-modes} \end{figure} \subsubsection{Acceptability and Mode Adoption} \label{sec:acceptability_selection} Next, we study different definitions of acceptability proposed in Section \ref{sec:defining-acceptability}. Recall that we have three candidate definitions: \begin{enumerate} \item switching gain, $\Delta_{r,u,p}$ \item odds, $e^{\Delta_{r,u,p}} = Pr(r,p)/Pr(u,p)$ \item probability, $Pr(r,p)$ \end{enumerate} where $r$ is the recommended mode, $u$ is the usual mode for person $p$ and $Pr()$ is the likelihood of prediction from our ML models. Results from mixed-effect linear and logistic regression are shown in Table \ref{tab:regression}. For each definition of acceptability, we report $R^2c$, the proportion of the variance that is explained by the complete model, and $R^2m$, the proportion is explained by the candidate definition. Each cell in the table denotes a fitted mixed-effects regression model. Overall, the results show that people reported a willingness to change their travel behavior by adopting recommended modes. Further, we see that all definitions of acceptability significantly impact the adoption of a recommendation. The coefficients align with the intuition about the domain - as the cost of adopting the recommendation decreases (acceptability increases), adoption increases. We see that $R^2c$, $R^2m$ are highest for odds. These results suggest that it is the best predictor of mode adoption because it explains the most variance in the data. The odds and probability have similar impact on adoption due to the fact that our participants are regular drivers and $Pr(u,p) \approx 1$ for many of the trips. With a more diverse population in a larger deployment, the differences between these definitions of acceptability can be teased apart. For further analyses and implementation, we chose the odds definition of mode acceptability. \begin{table} \centering \small \def1.2{1.2}% \begin{tabular}{lll} \toprule Dependent $\rightarrow$ & \multicolumn{1}{c}{Adoption} & Adoption \\ Independent $\downarrow$ & \multicolumn{1}{c}{(ordinal)} & \multicolumn{1}{c}{(binary)} \\ \midrule (intercept) &-0.017&-0.185\\ switching gain, $\Delta_{r,u,p}$&0.108*&0.104*\\ \midrule[0.15pt] $R^2m$&0.034&0.035\\ $R^2c$&0.347&0.270\\ \midrule (intercept) & -0.025 & -1.065 \\ odds, $e^{\Delta_{r,u,p}}$ & 2.386*** & 1.780** \\ \midrule[0.15pt] $R^2m$ & 0.075 & 0.064 \\ $R^2c$ & 0.379 & 0.346 \\ \midrule (intercept)&-0.964&-1.080\\ probability, $Pr(r,p)$&3.623***&3.317*\\ \midrule[0.15pt] $R^2$m &0.066&0.058\\ $R^2$c &0.369&0.293\\ \bottomrule \end{tabular} \caption{Regression modeling results for ordinal and binary mode adoption. *** p $< 0.001$, ** p $< 0.05$, * p $< 0.1$} \label{tab:regression} \end{table} \begin{figure} \centering \includegraphics[width=0.45\textwidth]{images/logit-model.png} \caption{Participant mode adoption (green), cumulative density of responses (black), and results of the mixed-effects logit model with odds as independent variable (blue)} \label{fig:logit-model} \end{figure} Figure \ref{fig:logit-model} shows the distribution of responses and the results of the regression model with odds as the independent variable. The green points represent adoption choices by different participants. The black line shows the cumulative density of responses. The blue line and ribbon capture the coefficient of odds and the confidence interval. From the graph, it can be seen that the statistical significance arises from the responses where the estimated likelihood ratio $> 0.5$ ($<= 10\%$ of responses). For lower values of likelihood ratio, the responses are evenly distributed. One explanation of these observations is that when asked about changing behavior to support sustainable modes of transport, participants tended to be optimistic. In a deployment where real choice data is available, revealed preference methods \citep{carson1996contingent} can be employed for more accurate choice modeling. \subsubsection{Individual Variability in Adoption} \label{sec:adoption_individual} Results in the previous section provide strong evidence that acceptability of a mode is a significant predictor of its adoption. Next, we study if there are individual differences in adopting a mode recommendation above and beyond its computed acceptability. We have two kinds of factors that may bring individual variability in adoption: demographics and personality - in particular, susceptibility to persuasion. We analyze the impact of these factors by extending the regression models to include these factors as independent variables in two different efforts. To be valuable, these factors must influence adoption significantly as well as increase the variance explained by fixed-effects of the model ($R^2_m$). First, in Table \ref{tab:regression_age_gender}, we show results from the regressions that include an ordinal variable representing participant age and a categorical gender variable. As is apparent, there is no significant impact of either age or gender, suggesting that these variables do not play a role in adoption. \begin{table}[h] \small \centering \def1.2{1.2} \begin{tabular}{lll} \toprule Dependent $\rightarrow$ & \multicolumn{1}{c}{Adoption} & Adoption \\ Independent $\downarrow$ & \multicolumn{1}{c}{(ordinal)} & \multicolumn{1}{c}{(binary)} \\ \midrule (intercept) & -1.63736 & -1.67021 \\ odds, $e^{\Delta_{r,u,p}}$& 2.38833*** & 2.15086** \\ GenderMale & 0.33149 & 0.01281 \\ Age & 0.01377 & 0.21983 \\ \midrule[0.15pt] $R^2m$ & 0.085 & 0.072 \\ $R^2c$ & 0.396 & 0.310 \\ \bottomrule \end{tabular} \caption{Regression models with age and gender for ordinal and binary mode adoption. *** p $< 0.001$, ** p $< 0.05$, * p $< 0.1$ \newline \newline} \label{tab:regression_age_gender} \end{table} Next, we extended the mixed-effects regression model to include independent variables from the susceptibility to persuasion scale \citep{cialdini2001harnessing}. In Table \ref{tab:regression-full}, we show the results from these regressions. As previously, we model both ordinal and binary adoptions, shown as models of class I and II in the table. For each class, we develop three models with varying independent variables. Models IA \& IIA are reproduced from Table \ref{tab:regression} for comparison. Models IB \& and IIB are full models and include all measurements from the Cialdini scale as independent variables. Models IC \& and IIC are simplified models that only have variables judged to be significant in the full models. In models IB, we see that commitment (i7) and liking (i12) dimensions are significant predictors of adoption. As is expected, $R^2_m$ and $R^2_c$ both increase significantly suggesting that including these variables in the model helps explain more variance in our dataset, above and beyond what is explained by odds. In model IC, in which we removed non-significant persuasion items, we see that both commitment and liking dimensions are still significant. Further, we see that $R^2_c$ in models IC is close to that of model IA suggesting that they explain similar amounts of variance. However, in model IC $R^2_m$ (variance explained by fixed-effects) is much higher than that of model IA. A proportion of variance that was explained by random effects (corresponding to participants) in model IA can be explained by measured persuasion items in model IC. Similar observations can be made of Models II. This suggests that persuasion items measure important predictive information about individual adoption of recommendations above and beyond what odds does. \begin{table}[t] \footnotesize \centering \def1.2{1.1}% \begin{tabular}{lccccccc} \toprule \textbf{MODEL} & \multicolumn{3}{c}{I} & \multicolumn{3}{c}{II}\\ & \textbf{A} & \textbf{B} & \textbf{C} & \textbf{A} & \textbf{B} & \textbf{C}\\ \textbf{Dependent $\rightarrow$} & \multicolumn{3}{c}{Ordinal adoption} & \multicolumn{3}{c}{Binary adoption}\\ \textbf{Independent}$\downarrow$ &\multicolumn{3}{c}{}&\multicolumn{3}{c}{}\\ \midrule (intercept) &-0.025&-0.183 &-0.201 & -1.065&-0.084& -0.998 \\ odds, $e^{\Delta_{r,u,p}}$&2.386***& 2.306*** & 2.348***&2.1587**&1.780** &1.729**\\ I1 \emph{Reciprocity repay favor}&& -0.138&&& -0.166&\\ I2 \emph{Reciprocity return gift}&& -0.009&&& -0.043&\\ I3 \emph{Scarcity last to buy}&& -0.034&&& -0.009&\\ I4 \emph{Scarcity special value}&& -0.212&&&-0.170&\\ I5 \emph{Authority obey directions}&& 0.311&&&0.330*&0.1386\\ I6 \emph{Authority listen to}&& -0.002&&&0.021&\\ I7 \emph{Commitment appointment}&& 0.495*&0.515**&&1.126**&0.979***\\ I8 \emph{Commitment promise}&& 0.448&&& 0.207 &\\ I9 \emph{Consensus advice}&& -0.051&&& 0.031&\\ I10 \emph{Consensus what to do}&& 0.170&&& 0.206&\\ I11 \emph{Liking inclined to believe}&& -0.069&&& 0.075&\\ I12 \emph{Liking do favor}&& -0.966**&-0.819**&&-1.105**&-0.905**\\ I13 \emph{Unity help}&& -0.143&&& -0.238&\\ I14 \emph{Unity self assembly furniture}&& -0.026&&& -0.008&\\ I15 \emph{Unity country}&& 0.236 &&& 0.128&\\ I16 \emph{Unity sports team}&& 0.157 &&& 0.162&\\ I17 \emph{Unity vicarious success happy}&& -0.357 &&& -0.491&\\ \midrule $R^2m$ &0.075&0.224&0.156&0.064&0.329&0.254\\ $R^2c$ &0.379& 0.467&0.388&0.301&0.346&0.318\\ \bottomrule \end{tabular} \caption{Regression modeling results for ordinal and binary mode adoption. *** p $< 0.001$, ** p $< 0.05$, * p $< 0.1$} \label{tab:regression-full} \end{table} \subsubsection{Working Model of Adoption} \label{sec:adoption_model} In this section, we first demonstrated that providing recommendations to people in a travel route choice task can indeed influence their decisions. Then, we evaluated if acceptability (odds, as defined in Section \ref{sec:defining-acceptability} and computed using ML model in Section \ref{sec:ml_approach}) impacts adoption. Our analysis suggests that it indeed is a significant factor in recommendation adoption. Further, we show that different individuals may be influenced to a different extent. In our analysis, a person's measurement of susceptibility to persuasion on Cialdini's scale is useful in explaining this individual variation in the impact of acceptability on adoption. To identify the recommendation that reduces the most expected energy, it is necessary to estimate the likelihood of adoption. Recall that our motivating example suggests that a recommendation should be \textit{timely}, \textit{acceptable}, and \textit{compelling} among other things to motivate behavior change. At this point, we have defined, computed, and evaluated what acceptability is. Therefore for the remainder of this paper, as a working model of adoption, we use the logit model of odds to estimate the probability of a person adopting a recommended route. Understandably, this is a limited model of adoption and our future efforts will extend this model further to include other factors as well. In particular, our results in Section \ref{sec:adoption_individual} suggest that the framing of a recommendation can be personalized to every individual such that it is compelling to them. We will extend our adoption model to include the impact of personalized compelling framing. \section{Finding Energy-Efficient Acceptable Plans} \label{sec:acceptable_planning} Until now, we have defined plan acceptability, proposed a data-driven way to compute it, and have validated it to be an important component of mode adoption. Now, we extend the multi-modal planning formulation to include acceptability. The main concern in incorporating acceptability in planning is that costs in planning are defined at edges, while acceptability is an overall evaluation of a plan recommendation. For integration, we sacrifice efficiency and split plan evaluation in two phases as described below. Figure \ref{fig:two-stage} provides an overview of \textsc{Copter}'s operation. In a deployment, we expect to maintain a series of future trips for each user. Before an expected departure, \textsc{Copter} computes an energy efficient \emph{acceptable} alternative and sends it to the user $15$ minutes before they would have to leave for the new trip. To compute this plan, we augment the multi-modal planning formulation with our acceptability model with the following steps: \begin{enumerate} \item Generate a mode candidate set $M_p$ for the person $p$ for whom the request is made. $M_p$ can be generated by knowing if they can walk and if they have a bike. For example, someone who doesn't own a bike but can walk $M = \{walk (w), bus (b), subway (s)\}$. \item Given $M_p$, determine the language $L_p$ set that is valid. For the example above, $L_p = \{w* , w*b+w*, w*s+w*\}$. Note that while this is a fairly simplistic set, the formulation can be extended to include more complex plans. \item For every element in $L_p$, generate the most time-efficient plan (using the multi-modal formulation) where $cost(e) = dur(e, m)$ where $m$ is the mode used to traverse the edge. This process will generate a candidate set of plans for the person, $\Pi_p$. \item Compute the energy reduction in each plan $\pi \in \Pi_p$ using an existing mesoscopic energy model \citep{elbery2018}. \item Evaluate the likelihood of adoption, $adopt(\pi, p)$, for every $\pi \in \Pi_p$ using the logit model of adoption in the previous section. \item \label{item:plan-selection} Select a plan that has maximal expected energy savings, $\pi^* = \argmax_{\pi \in \Pi_p} adopt(\pi, p) \times energy(\pi)$. \end{enumerate} \begin{figure}[h] \centering \includegraphics[width=1\textwidth]{images/internals.png} \caption{\textsc{Copter} identifies the recommendation with the largest expected reduction in energy consumption by acceptable planning and energy modeling.} \label{fig:two-stage} \end{figure} There are two items in the above process that merit additional discussion. First, is the proposed acceptable planning framework extensible to additional multi-modal route recommendations? For each element in the candidate mode set $M_p$, there must be a language $L_p$ that constrains the possible sequences of modes and corresponding likelihood of adoption, $adopt(\pi,p)$. In the empirical work discussed in this paper, the likelihood of adoption is the same for all trips involving public transit (an element of $M_p$). To consider trips where the traveler walks to transit distinctly from those in which the traveler takes a taxi for the first/last mile requires changing $M_p$ and $L_p$ as well as gathering mode adoption data to update $adopt(\pi,p)$ for the new modes in $M_p$. Computing $adopt(\pi,p)$ requires the acceptability of the plan which in turn is estimated from travel behaviors of a population. As data collection in cities gets more sophisticated, we expect to have a richer dataset of mode sequences for trips. This enables the use of classification-based likelihood estimation to compute adoption. Second, to clarify the plan selection (Step \ref{item:plan-selection}), consider two options for a particular traveler: walking which saves huge amounts of energy but its likelihood of adoption is very low and taking public transit which does not save as much energy but has much higher likelihood of adoption. Based on quantitative expected savings in fuel, \textsc{Copter} may recommend walking by ranking it above public transit, which may not result in adoption and consequently, no savings in fuel. If plan selection is biased by likelihood of adoption alone, \textsc{Copter} will recommend public transit which has improved chances of adoption and consequently, is more likely to result in some energy savings. From a behavior change perspective, the second approach may be better - some change is better than none at all. This is a design question that can be answered empirically by deploying both competing plan selection approaches. However, in absence of empirical observations from deployments, we consider the algorithm above for further evaluation. Our formulation allows for exploring both design criterion in future. \section{Energy Simulation Experiments} \label{sec:experiments} While deploying \textsc{Copter} in a large city to measure the impact is the ideal evaluation, it is extremely resource intensive to conduct. Furthermore, without being incorporated into a widely used product, it would be impossible to iteratively evaluate different components of a complex system such as \textsc{Copter} employs. Therefore, we evaluate the potential impact of \textsc{Copter} using a high fidelity simulation of the Los Angeles region as shown in Figure \ref{fig:study-area}. Our integrative simulation simulates people of Los Angeles making commuter trips in the morning and evening periods. It uses the adoption model developed in the previous sections to simulate \textsc{Copter}'s influence on their decisions and computes energy impact using a state-of-art transportation energy simulation of the LA region described briefly below. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{images/study-area.png} \caption{Los Angeles region study area.} \label{fig:study-area} \end{figure} \subsection{Transportation Energy Model} The simulation model \citep{elbery2018} supports city-level networks with different modes of transportation including cars, buses, railways, walking, biking, and carpooling. It utilizes both microscopic and mesoscopic simulation to leverage their respective strengths of accuracy and scalability. The simulation spatially partitions the road network enabling distinct portions of the region to be simulated in parallel. Additional parallel simulations capture loosely interacting modes (e.g., the rail and road network). This enables micro-simulation (i.e., considering driver behavior w.r.t. throttle position, braking, and lane choice every $0.1$s) of the arterial and highway roads encoded as 10,650 links. Dynamic calibration aligns previous government planning documents with observed vehicle flows to capture the changing rates of vehicles entering the different networks throughout the day \citep{Du2018}. The simulation incorporates previously validated driver behavior \citep{rakha2009simplified} and fuel \citep{fiori2016power} models to provide accurate estimates of travel time and energy consumption due to traveler influence. \subsection{Simulation Scenario} Our study area, shown in Figure \ref{fig:study-area}, covers the majority of Los Angeles County. Our study area includes diverse offerings with over $170,000$ roadway links and over $1$ million daily transit trips. During the AM period ($7$am-$10$am) and PM period ($4$pm-$7$pm), our calibrated transportation model includes $1.2$ and $1.7$ vehicle trips respectively. As the effects of congestion continue past the peak period, our study considers an AM peak/off-peak period ($7$am-$12$pm) and a PM peak/off-peak period ($4$pm-$9$pm). In our deployment scenario, we assume that $10\%$ of peak period drivers use apps (e.g., Waze, TripGo) through which we can offer alternative suggestions. \subsection{Simulation Method} Given our deployment assumption that 10\% of the driving population receives our messages, we sample $10\%$ of the traffic during the peak periods ($7$am-$10$am and $4$pm-$7$pm) for our influenced population. Our experiment has two conditions: \begin{enumerate} \item Baseline: Each influenced traveler drives their original route \item Influence: Each influenced traveler probabilistically takes the maximum expected energy reduction route as determined by \textsc{Copter} using the mesoscopic model or drives their original route based on working model of adoption in Section \ref{sec:adoption_model}. \end{enumerate} To account for the uncertainty in alternative adoption and background traffic rates, we ran each condition four to seven times. The simulation model runs in just over real time and therefore, running a larger number of trials is prohibitive. $5-10$ trials is standard practice for similar transportation studies. We report $95\%$ confidence intervals for difference of means between the Baseline and Influence trials for total fuel consumption and congestion related delay. We also report the resulting changes in mode of the influenced travelers. For simulation in the influence condition, we: \begin{enumerate} \item Sampled features from the CHTS dataset and used these features to augment trips in our energy models \item For each trip, selected a recommendation from motorized, non-motorized, and public transit using \textsc{Copter} \item Computed the likelihood of adoption by applying our working model of adoption as follows: \begin{enumerate} \item Generated an intercept by fitting and sampling from a Gaussian distribution with intercept mean and standard deviation from our analysis. \item Computed acceptance likelihood by applying the working model of adoption \end{enumerate} \item Simulated adoption by selecting the recommendation biased by likelihood of adoption \end{enumerate} \subsection{Results} Table \ref{tab:ampm} contain the results for AM and PM periods obtained using the microscopic model. These results indicate a potential $4.6\%$ energy reduction during the AM period and $3.5\%$ energy reduction in the PM period. Congestion-induced delay results were even greater at $20\%$ and $14\%$, respectively. This is significant considering the influenced population represents about $6\%$ of the total traffic over the period. To identify an upper bound, we ran simulations in which every influenced traveler walked. In these simulations, we observed a reduction in energy consumption of $~9\%$ and a reduction in delay of $~30\%$ across the AM and PM periods. Table \ref{tab:mode} indicates that almost half the influenced population is willing to take alternative modes. These mode switches are based on our mode adoption study and may be optimistic. Future work will refine these estimates through a deployment of the technology and measuring people's behavior. \begin{table}[h] \centering \def1.2{1.2}% \begin{subtable}{1\linewidth} \centering \begin{tabular}{lccc} \toprule & Baseline & Influence & Change (CI)\\ \midrule Total& 3,195,637 & 3,048,278 & -4.6\%\\ Fuel (l)&&&(-3.6\% -5.6\%)\\ Total& 249,221 & 199,395 & -20\%\\ Delay (hr) &&& (-13.6\% -26.4\%)\\ \bottomrule \end{tabular} \caption{Results of departures in the AM period: 7:00 - 12:00} \end{subtable} \begin{subtable}{1\linewidth} \centering \begin{tabular}{lccc} \toprule & Baseline & Influence & Change (CI)\\ \midrule Total& 3,487,982 & 3,367,675 &-3.5\%\\ Fuel (l)&&&(-2.6\% -4.3\%) \\ Total& 375,137 & 322,228 &-14.1\\ Delay (hr)&&&(-10\% -18\%)\\ \bottomrule \end{tabular} \caption{Results of departures in the PM period: 16:00 - 21:00} \end{subtable} \caption{The mean for each condition is reported along with the percent change in the Influence condition. We also report a $95\%$ confidence interval for the difference in mean.} \label{tab:ampm} \end{table} \begin{table}[h] \def1.2{1.2}% \centering \begin{tabular}{lcc } \toprule Mode & AM Share & PM Share \\ \midrule Car & 54\% & 53\% \\ Walk & 42.7\% & 42.8\% \\ Bike & 3.6\% & 3.8\% \\ Bus & 38.9\% & 39.1\% \\ Train & 14.4\% & 14\% \\ \bottomrule \end{tabular} \caption{Share of influenced population that used mode on trip. Sum is over 100\% due to trips using multiple modes.} \label{tab:mode} \end{table} \section{Related Work} \label{sec:related_work} This paper incorporates ideas from diverse disciplines and consequently, is related to a large body of work in transportation and AI. Here, we briefly discuss how our work relates to ongoing research. \subsection{Transportation} The majority of transportation policy and social science research either focuses on systemic changes that are applied evenly to the entire population such as congestion pricing/dynamic tolling \citep{brownstone2003drivers} or studies long term behavior change in individuals to encourage sustainable commuting \citep{castellani2016understanding}. Recently, there has been a shift toward personalizing the interventions to increase the use of sustainable transportation. IncenTrip \citep{doi:10.1177/0361198118775875} allocates incentives from government sponsored programs such that each dollar spent provides the largest environmental impact. TriPod \citep{azevedo2018tripod} takes a different approach in which the allocation comes from a points-based system in which companies give travelers points for alternative transportation choices that can be redeemed at local businesses. While these systems primarily rely on monetary incentives to affect travel behavior, Metropia \citep{zhu2018will} has shown that congestion information alone can influence traveler departure time. Our work differs from the above by identifying a single personalized recommendation from diverse alternatives based on network conditions without any monetary incentives. In addition to algorithmic work in route planning, the AI community has explored other aspects of the transportation influence problem. Work on compliant micro-tolling assumes a subset of agents would be willing to opt-in to a congestion tolling regime \citep{Hanna2019}. In that work, energy and traffic are modeled mesoscopically to compute marginal cost paths for social benefit and human behavior is captured using a single parameter for value of time. Recent work on recommender systems use more complicated user models to order potential routes to a user \citep{liu2019joint}. Our work differs by computing alternative routes to an expected default. Other work in AI seeks to make predictions about the transportation network. Using position traces and other data, systems predict the mode and destination of travelers \citep{LIAO2007311,song2016deeptransport}. These works address travel prediction problems, which are essential to the commercial applicability of our approach. With respect to the transportation influence problem, \textsc{Copter} could incorporate these approaches as follows. First, predicting expected future trips is necessary to trigger the generation of alternatives. Second, the prediction of current mode supports monitoring travelers to determine if they follow the recommendation and to assist them as conditions change. \subsection{AI for Social Good} \citet{hager2017} identified urban computing and sustainability as one of the motivating domains for research on intelligent methods for public welfare. The methods developed in this paper take a unique perspective towards the problem of urban computing and sustainability in recognizing that humans are a critical component of urban transportation systems. It puts reasoning about human behavior as the center of intelligent system design. Our approach aligns with the perspective of \citet{abebe2018mechanism}, who argue that AI for social good inherently is an inter-disciplinary problem and developing good AI solutions requires deep grounding in the field of interest and collaboration with domain experts. To develop our AI planning-based approach, we engage with behavioral economics to understand how people choose and with transportation research to estimate energy consumption. Our work is a part of growing body of work in AI that seeks to achieve social good goals. Intelligent systems have been employed for allocation of security resources at ports \citep{shieh2012protect}, protecting biodiversity in conservation areas \citep{fang2016deploying}, and screening 800 million airport passengers annually throughout the USA \citep{brown2016one}. Research has also begun exploring intelligent algorithms and systems that can influence people's behavior to benefit society. Most of this work has been focused on health. \citet{hartzler2016acceptability, mohan2017designing} develop an adaptive interactive system for scaffolding learning of exercising behaviors in sedentary populations. \citet{yadav2018bridging} explore social network models to maximize influence for HIV awareness in homeless youth population. Our work brings technology-mediated influence and behavior change to the domain of urban computing and sustainability. \subsection{Human-Aware AI Systems} AI research on modeling of humans in human-AI collaborative systems is in its infancy. While the community has recognized the importance of incorporating explicit models of human behavior in AI systems to make them more effective in collaborative tasks \citep{khampapati2018, albrecht2018autonomous}, there is a dearth of computational models that can be incorporated with AI algorithms. In problems where the humans (or their teams) are adversaries to the AI algorithm, various game-theoretic modeling techniques \citep{sinha2018stackelberg} have been found to be useful. In dearth of detailed models of why a specific human behavior occurs, these approaches optimize against the worst case, providing guarantees of reasonable performance in the expected case. Often in collaborative modeling, task models employed by AI systems for acting are used as a stand-in for representing human goals and behaviors \citep{chakraborti2018projection,kim2015inferring}. These approaches are useful when humans and systems are engaged in the same task and have similar goals. Our proposed method takes a unique perspective towards building models of human collaborators. In our problem, the human and the agent are engaged in different tasks. The human's goal is to reach their destination while the agent's goal is to perturb human cognitive system such that the human takes a sustainable mode to get there. We adopt the choice modeling techniques from behavioral economics and explore how it can be incorporated in the AI planning framework to produce personalized plan recommendations. In contrast with adversarial modeling techniques, our work incorporates explicit causal models of human decisions to produce effective solutions. Our work can be considered as an instance in the human-aware AI design agenda that exploits detailed, explicit models of human decisions, learning, and behavior and of which cognitive tutors \citep{Koedinger2013NewOptimization} are another instance. Along these lines, \citet{mao2012modeling} proposed human modeling for AI systems that is grounded in theory of human cognition and reasoning. It is worth noting that this work aims at only predicting human behavior while our work takes a step beyond prediction and employs predictive information for causing a change in behavior. \section{Discussion and Conclusion} \label{sec:conclusion} This paper presents \textsc{Copter}, an intelligent travel assistant that is designed to influence individual travel behavior to reduce the total energy consumption of a large city. To do this, we propose an integrative framework that is a novel combination of multi-modal trip planning, transportation choice modeling, and machine learning. We introduce the notion of acceptability of a recommended alternative and define it in terms of the change in utility. We show how this change can be estimated using ML models trained on the CHTS dataset. We evaluate different definitions of acceptability using a human mode choice study. Finally, in a simulation experiment over the Los Angeles area we show that if $10\%$ of peak travelers were receiving influence messages, estimated energy consumption would be reduced by $4.6\%$ in the AM period and $3.5\%$ in the PM period with corresponding reductions in congestion induced delay of $20\%$ and $14\%$, respectively. In future work, we would like to integrate these results with additional alternatives. Eco-routing feedback control selects driving routes based on real-time link estimates of fuel consumption \citep{elbery2018}. Additionally, we would also like to explore techniques for departure time optimization and measure the switching costs associated with carpooling to expand the set of alternatives. From a social good perspective, \textsc{Copter} is ready for deployment with influenced messages sent through the TripGo application \citep{tripgo}. The next step is to evaluate the influence model by measuring actual traveler behavior and then feeding those results back into our simulation study. In a deployed scenario, we will be able to integrate additional transportation influence features identified from our survey \citep{mohan2019exploring} (e.g., weather) by updating the acceptability model, if we have enough historical trip behavior, or the influence model by incorporating these features as parameters in the adoption model. Later work will define and assess the impacts of timeliness of a recommendation and compelling messaging by considering Cialdini's influence strategies \citep{cialdini2001harnessing}. Urban transportation is a huge problem for the environment and citizens' quality of life. \textsc{Copter} demonstrates how multiple AI techniques can be adapted and combined to alleviate congestion and improve the environment through transportation influence. \section{Acknowledgments} This work was funded in part by the Advanced Research Projects Agency-Energy (ARPA-E), U.S. Department of Energy, under Award Number DE-AR0000612. The authors would like to thank Filip Dvorak and Aaron Ang for engineering the system, Frances Yan and Victoria Bellotti for contributions to the design and execution of the human studies presented here, and Spenser Anderson for reviewing a draft of this work. The authors appreciate the effort invested by the City of Los Angeles and CalTrans in collecting the data necessary for developing the. Finally, the authors would like to thank the anonymous reviewers for the AAAI/AIES conference on AI, Ethics, and Society and the Journal of AI Research for providing invaluable feedback that has made the writing impactful. \printbibliography \end{document}
\section{Introduction}\label{introduction} In recent years, magneto-caloric effect (MCE), the driving force for magnetic refrigeration technology, led to intensive research due to its superiority over the conventional gas refrigeration technology on account of energy and environmental concerns. Gd has been considered as a benchmark material in magnetic refrigerator due to the discovery of significant magneto-caloric effect in it, as an outcome of a second-order ferromagnetic to paramagnetic transition close to room temperature \cite{brown1976}. Giant MCE is generally observed in rare-earth materials which undergo a magneto-structural transition and/or second order magnetic transition\cite{pecharsky2001,tishin2016,de2006,fujieda2002,wada2001,tegus2002}. \\ In this context, Ni-Mn based shape memory Heusler alloys drew considerable attention due to the presence of the martensitic phase transition (MPT), which in many cases is coupled with the magnetic transition, giving rise to a first order magneto-structural transition from the high temperature austenite (cubic) phase to the low temperature martensite (orthorhombic or tetragonal) phase\cite{li2012,li2014,krenke2005,7krenke2007}. This class of materials are less expensive and more effective than conventional rare-earth-based magnetocaloric materials. Several materials in this family have shown substantial MCE, thus raising their stakes as commercially viable materials for magneto-caloric applications. In the Ni-Mn Heusler family, apart from Ni$_{2.2}$Mn$_{0.8}$Ga which exhibits the highest MCE\cite{8pasquale2005}, off-stoichiometric Ni-Mn-Sn and Ni-Mn-In systems with Mn-excess and In/Sn deficient compositions exhibit substantial MCE in the vicinity of first-order magnetostructural transition \cite{pathak2007,79krenke2005,muthu2010}. All these studies on magnetocaloric materials conclude that from the perspective of practical applications, high-performance magnetocaloric materials should meet at least the following important requirements: (1) the materials should posses a good value of magnetisation in the high temperature phase. A large difference in magnetisation ($\Delta$M) between the high temperature austenite and low temperature martensitic phases is also of great importance because substantial Zeeman energy, which is defined as $\Delta$M.H, is the key to first order magneto-structural transition; (2) the first-order magneto-structural transition temperature (T$_{M}$) and the second-order magnetic transition temperature (T$_c^A$) in the austenite phase should be close and must be near room temperature; (3) the materials should have good mechanical stability during operation; (4) the two parameters characterising the MCE, the magnetic-field-induced isothermal entropy change ($\Delta$S$_{M}$) and adiabatic temperature change($\Delta$T$_{ad}$), must be significant at a magnetic field as low as possible. \\ Inspite of the discovery of substantial MCE in Mn-excess, Z-deficient off-stoichiometric Ni-Mn-Z Heusler alloys some serious drawbacks due to the off-stoichiometry limited their potentials. One major disadvantage is that the value of $\Delta$M is limited due to the low value of magnetisation in the high temperature austenite phase which arises because of the antiparallel alignment between the Mn atoms occupying different crystallographic sites. To overcome this, recently, several experimental studies have been done on Ni-Mn-Z compounds considering substitution of either of the constituents with another 3$d$-transition element (i) to get a larger $\Delta$M near the structural transition (ii) to tune the transition temperatures (T$_{M}$ and T$_c^A$) and bring them close to each other, (iii) to improve the mechanical properties. Positive changes in several counts were observed for substitution of Co, Cu and Fe at different sites and in different proportions \cite{agao2009,lee2009,12kainuma2006,khan2005,soto2010,pathak2010,gomes2006,stadler2006,soto2008,cherechukin2001,wang2006,jing2009,krenke2007,gao2009}. A recent addition to this class of Heusler alloys showing promising MCE properties, is the off-stoichiometric Mn-excess Sb-deficient Ni-Mn-Sb systems where magneto-structural transition and significant magneto-caloric effect are observed near room temperature \cite{91duc2012,22khan2007}. This, along with low cost of Sb and achievable negligible hysteresis loss \cite{20w2009}, makes Ni-Mn-Sb systems of great interest in the research on magnetic refrigeration. A large positive $\Delta$S$_{M}$ of 19~Jkg$^{-1}$K$^{-1}$ at 297~K was obtained under a field of 5~T in Ni$_{2}$Mn$_{1.48+x}$Sb$_{0.52-x}$ with $x=0.04$\cite{22khan2007}. With an aim to improve the MCE, some recent investigations have also been carried out for the Mn-excess Sb-deficient off-stoichiometric Ni-Mn-Sb systems by substituting the Fe and Co atoms at Mn and Ni sites respectively. As a consequence, a large positive $\Delta$S$_{M}$ near room temperature was obtained with 0.28$\leq$x$\leq$0.36 in Ni$_{2-x}$Co$_{x}$Mn$_{1.56}$Sb$_{0.44}$ alloys\cite{64han2008}. For a slightly different composition, Ni$_{2-x}$Co$_{x}$Mn$_{1.52}$Sb$_{0.48}$, nearly 70\% decrease in moment is observed associated with the martensitic transition and remarkable enhancement in $\Delta$S$_{M}$ of 34~Jkg$^{-1}$K$^{-1}$ is achieved for $x=0.2$ at 262~K in a field of 5~T near room temperature\cite{nayak2009,anayak2009}. A significant $\Delta$S$_{M}$ value of 14.2~Jkg$^{-1}$K$^{-1}$ at 288~K under 5~T field was observed for $x=0.08$ in Ni$_{2}$Mn$_{1.52-x}$Fe$_{x}$Sb$_{0.48}$\cite{59sahoo2011}. Thus, the Ni-Mn-Sb based Heusler alloys show a possibility to be proved as emerging materials, showing significant MCE properties with the substitution of $3d$-transition elements. These results suggest that Fe, Co and Cu substitutions at select sites of Ni-Mn-Z Heusler compounds help in improving their MCE properties. However, it crucially depends on the substituent, the site of substitution and the composition. What is nevertheless lacking is a systematic investigation into the impacts of these three. Such an investigation would throw light on the microscopic understanding of these factors, help interpret the experimental observations and provide a roadmap to tune the compositions for maximising the functional properties. in this work, we have considered relatively less explored Ni-Mn-Sb system to address these issues. We specifically consider the compound Ni$_{2}$Mn$_{1.5}$Sb$_{0.5}$, relative concentrations of the elements being around the mostly studied experimental composition, as the parent one, and systematically substitute Ni and Mn by Fe, Co and Cu, varying the concentrations of the substituents. We mainly address the following: (i) the effect on the magnetisation in the high temperature phase and whether and how the substitutions improve $\Delta$M (ii) in what way the substitutions impact the structural phase stabilities, the magnetic exchange interactions, the mechanical properties, the characteristic temperatures (T$_{M}$ and T$_c^A$) and (iii) how the information from (i) and (ii) can be correlated to the magneto-caloric properties of the Ni-Mn-Sb compounds. In light of these, we also attempt to interpret the experimental observations in Fe-substituted\cite{59sahoo2011} and Co-substituted\cite{64han2008,nayak2009,anayak2009} compounds which highlight the important role of atomic ordering in the system. \section{Details of calculations}\label{methods} At high temperature, Ni$_2$MnSb crystallises in a Cu$_2$MnAl-type structure (regular Heusler L2$_1$, space group no. 225 (Fm$\bar{3}$m))\cite{72khan2008,20w2009,53rama2011} with three inequivalent Wyckoff positions (4a, 4b, 8c). The Sb and Mn atoms occupy 4a (0, 0, 0) and 4b (0.50, 0.50, 0.50) positions respectively and Ni atoms occupy the 8c ((0.25, 0.25, 0.25) and (0.75, 0.75, 0.75)) sites. In the present work, we have dealt with Fe, Co and Cu substituted Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ compounds with substitutions done both at Ni and Mn sites to get a comparative understanding of how they affect the properties as a function of composition. We, thus, have considered two different systems: (i) Ni$_{2}$Mn$_{1.50-y}$Z$_{y}$Sb$_{0.50}$(referred as Z@Mn) and (ii) Ni$_{2-y}$Z$_{y}$Mn$_{1.50}$Sb$_{0.50}$(referred as Z@Ni) with Z=Fe, Co and Cu for $y=0, 0.25, 0.50$ (shown in Table \ref{table1}). The systems are modelled with a 16-atom conventional cubic cell. For example, to make a 25\% Fe-substituted Ni$_2$Mn$_{1.25}$Fe$_{0.25}$Sb$_{0.50}$ composition, one Mn atom out of the six in the conventional cell of Ni$_2$Mn$_{1.50}$Sb$_{0.50}$ is replaced with one Fe atom, as done elsewhere\cite{54v2015,55sokolovskiy2015,28kundu2017,ghosh2019}. Though the experiments have been done with much smaller concentrations of the substituents, we had to restrict ourselves with above mentioned values of $y$ as modelling of experimental compositions would require computationally demanding larger supercells. Electronic structure calculations were done with spin-polarised density functional theory (DFT) based projector augmented wave (PAW) method as implemented in Vienna {\it Ab initio} Simulation Package (VASP)\cite{41blochl1994,43kresse1999,42kresse1996}. The valence electronic configurations used for the Mn, Fe, Co, Ni, Cu and Sb PAW pseudopotentials are 3$d^{6}$4$s$, 3$d^{7}$4$s$, 3$d^{8}$4$s$, 3$d^{8}$4$s^{2}$, 3$d^{10}$4$s$ and 5$s^{2}$5$p^{3}$, respectively. For all calculations, we have used the Perdew-Burke-Ernzerhof implementation of generalised gradient approximation for exchange-correlation functional\cite{44perdew1996}. An energy cut off of 550 eV and a Monkhorst-Pack $11\times{11}\times{11}$ k-mesh were used for self-consistent calculations. The convergence criteria for the total energies and the forces on individual atoms were set to 10$^{-6}$ eV and $10^{-2}$ eV/\r{A} respectively for all calculations. To study the variation of Curie temperatures with concentrations, we have calculated the magnetic pair exchange parameters using multiple scattering Green function formalism(KKR) as implemented in SPRKKR code\cite{ebert2011}. In here, the spin part of the Hamiltonian is mapped to a Heisenberg model \begin{eqnarray} H = -\sum_{\mu,\nu}\sum_{i,j} J^{\mu\nu}_{ij} \mathbf{e}^{\mu}_{i} .\mathbf{e}^{\nu}_{j} \end{eqnarray} $\mu$, $\nu$ represent different sub-lattices, \emph{i}, \emph{j} represent atomic positions and $\mathbf{e}^{\mu}_{i}$ denotes the unit vector along the direction of magnetic moments at site \emph{i} belonging to sub-lattice $\mu$. The $J^{\mu \nu}_{ij}$s are calculated from the energy differences due to infinitesimally small orientations of a pair of spins within the formulation of Liechtenstein { \it et al.}\cite{liechtenstein1987}. In order to calculate the energy differences by the SPRKKR code, full potential spin polarized scalar relativistic Hamiltonian with angular momentum cut-off $l_{max} = 3$ is used along with a converged k-mesh for Brillouin zone integrations. The Green's functions were calculated for 32 complex energy points distributed on a semi-circular contour. The energy convergence criterion was set to 10$^{-5}$ eV for the self-consistent cycles. Here we used the equilibrium lattice parameters and the optimized atomic positions from the projector augmented wave calculation using VASP package. These exchange parameters are then used for the calculations of Curie temperatures (T$_c^A$). The Curie temperatures are estimated with two different approaches: the mean-field approximation (MFA)\cite{26sokolovskiy2012,meinert2010} and the Monte Carlo simulation (MCS) method\cite{landau2014,zagrebin2016} in order to check the qualitative consistency in the results and to obtain a reliable estimate of the quantity as the MFA is known to overestimate T$_{c}^A$ while the MCS method is more accurate quantitatively. Details of the MFA and MCS calculations are given in supplementary material. \\ The elastic constants for the compounds are calculated using energy-strain method only for high-temperature cubic austenite phases. To determine the bulk modulus (B), the total energy vs volume data is fitted to $Murnaghan's$ equation\cite{46murnaghan1944}. Then the elastic moduli C$^\prime$ and C$_{44}$ are calculated\cite{47vitos2007,48kart2010} by considering volume conserving orthorhombic($\epsilon_o$) and monoclinic($\epsilon_m$) deformations of the cubic cell, respectively. Six strains $\epsilon$=0, 0.01, 0.02, 0.03, 0.04, 0.05 were used to calculate the total energies E($\epsilon_o$) and E($\epsilon_m$). The elastic moduli (C$^\prime$ and C$_{44}$) are then obtained by fitting the variation of total energies with distortions to a fourth order polynomial equation\cite{48kart2010}. C$_{11}$ and C$_{12}$ are then calculated using the relations: B=$\frac{1}{3}$(C$_{11}$+2C$_{12}$) and C$^\prime$=$\frac{1}{2}$(C$_{11}$-C$_{12}$). The isotropic shear modulus, G is typically calculated as an average of G$_v$, according to the formalism of Voigt\cite{49voigt1889} and G$_R$, according to the formalism by Reuss\cite{50roy2015}. In cases of a number of ferromagnetic Heusler alloys, it was found out that G$_v$ using Voigt formalism are closer to the experimental results\cite{26sokolovskiy2012,51roy2016}. Hence we have approximated G as G$_v$ and calculated its value using the relation: G$_v$=$\frac{1}{5}$(C$_{11}$-C$_{12}$+3C$_{44}$). Finally Cauchy pressure (C$^p$) has been calculated as C$^p$=(C$_{12}$-C$_{44}$). \section{Results and Discussions}\label{results} \subsection{Site Preferences, and magnetic ground states in austenite phases} \label{table1} The configurational ordering of the constituent elements in the crystal lattice affects both the martensitic transformation characteristics and the magnetic properties of Ni-Mn-based alloys \cite{26sokolovskiy2012,ghosh2019,82ghosh2014,35sanchez2007}. First-principles calculations\cite{45li2011,28bkundu2017,89chakrabarti2013} demonstrated that the substituent $3d$-transition metals do not always prefer to occupy the sites of substitutions. Therefore, we first focus on determination of the site preferences and the associated magnetic ground states of the substituted Ni$_{2}$Mn$_{1.5}$Sb$_{0.5}$ compounds in their high temperature austenite phases, by comparing total energies of various possible site ordered and magnetic configurations at fixed compositions. The results are shown in Table ~\ref{table1}. \begin{table*}[htpb!] \centering \caption{\label{table1} Preferred site-occupancies, corresponding possible magnetic configurations and their relative electronic energies $\Delta$E$_{0}$ (in meV/atom) are shown. $``$C1$"$ to $``$C4$"$ denote possible magnetic configurations, for Z=Fe, Co and Cu substituted (i) Ni$_{2}$Mn$_{1.50-y}$Z$_{y}$Sb$_{0.50}$(Z@Mn) and (ii) Ni$_{2-y}$Z$_{y}$Mn$_{1.50}$Sb$_{0.50}$(Z@Ni) systems. The atom $``$X$"$ at its original site in L2$_{1}$ lattice is denoted as $``$X1$"$, whereas it is denoted as $``$X2$"$ when it occupies any other site. The reference energy in each case is that of $``$C1$"$ or $``$C3$"$ (when $``$C1$"$ is not possible) magnetic configuration. Boldface indicates the ground state magnetic configuration for the corresponding composition.} \resizebox{0.93\textwidth}{!}{% \vspace{0.3 cm} \begin{tabular}{l@{\hspace{0.3cm}} c@{\hspace{0.2cm}} c@{\hspace{0.2cm}} c@{\hspace{0.2cm}} l@{\hspace{0.2cm}} c@{\hspace{0.2cm}} } \hline\hline \vspace{-0.33 cm} \\(i) Ni$_{2}$Mn$_{1.50-y}$Z$_{y}$Sb$_{0.50}$ \\ \hline\hline \vspace{-0.33 cm} \\ Composition & \multicolumn{3}{c}{Site Occupancies} & Mag. Configurations & $\Delta$E$_{0}$ \\ & 4a & 4b & 8c & & \\ \hline\hline \\Z=Fe \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$(y=0.00) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{2}$ & \textbf{C1(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$)} & 0.00 \\ & & & & C2(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$) & 15.32 \\ Ni$_{2}$Mn$_{1.25}$Fe$_{0.25}$Sb$_{0.50}$(y=0.25) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1$_{0.75}$Fe1$_{0.25}$ & Ni1$_{2}$ & C1(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Fe1$\downarrow$) & 0.00 \\ & & & & C2(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Fe1$\downarrow$) & -3.15 \\ & & & & \textbf{C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Fe1$\uparrow$)} & -26.10 \\ & & & & C4(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Fe1$\uparrow$) & -1.20 \\ Ni$_{2}$MnFe$_{0.50}$Sb$_{0.50}$(y=0.50) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1$_{0.50}$Fe1$_{0.50}$ & Ni1$_{2}$ & C1(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Fe1$\downarrow$) & 0.00 \\ & & & & C2(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Fe1$\downarrow$) & -16.94 \\ & & & & \textbf{C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Fe1$\uparrow$)} & -36.17 \\ & & & & C4(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Fe1$\uparrow$) & -3.34 \\ \hline \\Z=Co \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$(y=0.00) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{2}$ & \textbf{C1(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$)} & 0.00 \\ & & & & C2(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$) & 15.32 \\ Ni$_{2}$Mn$_{1.25}$Co$_{0.25}$Sb$_{0.50}$(y=0.25) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1$_{0.75}$Ni2$_{0.25}$ & Ni1$_{1.75}$Co1$_{0.25}$ & \textbf{C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1,Ni2$\uparrow$ Co1$\uparrow$)} & 0.00 \\ & & & & C4(Mn1$\uparrow$ Mn2$\uparrow$ Ni1,Ni2$\uparrow$ Co1$\uparrow$) & 12.02 \\ Ni$_{2}$MnCo$_{0.50}$Sb$_{0.50}$(y=0.50) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1$_{0.50}$Ni2$_{0.50}$ & Ni1$_{1.50}$Co1$_{0.50}$ & C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1,Ni2$\uparrow$ Co1$\uparrow$) & 0.00 \\ & & & & \textbf{C4(Mn1$\uparrow$ Mn2$\uparrow$ Ni1,Ni2$\uparrow$ Co1$\uparrow$)} & -0.69 \\ \hline \\Z=Cu \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$(y=0.00) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{2}$ & \textbf{C1(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$)} & 0.00 \\ & & & & C2(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$) & 15.32 \\ Ni$_{2}$Mn$_{1.25}$Cu$_{0.25}$Sb$_{0.50}$(y=0.25) & Sb1$_{0.50}$Mn2$_{0.25}$Cu1$_{0.25}$ & Mn1 & Ni1$_{2}$ & \textbf{C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Cu1$\uparrow$)} & 0.00 \\ & & & & C4(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Cu1$\uparrow$) & 6.80 \\ Ni$_{2}$MnCu$_{0.50}$Sb$_{0.50}$(y=0.50) & Sb1$_{0.50}$Cu1$_{0.50}$ & Mn1 & Ni1$_{2}$ & \textbf{C4(Mn1$\uparrow$ Ni1$\uparrow$ Cu1$\uparrow$)} & 0.00 \\ \hline\hline \\ \\ \hline\hline \vspace{-0.33 cm} \\(ii) Ni$_{2-y}$Z$_{y}$Mn$_{1.50}$Sb$_{0.50}$ \\ \hline\hline \vspace{-0.33 cm} \\ Composition & \multicolumn{3}{c}{Site Occupancies} & Mag. Configurations & $\Delta$E$_{0}$ \\ & 4a & 4b & 8c \\ \hline\hline \\Z=Fe \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$(y=0.00) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{2}$ & \textbf{C1(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$)} & 0.00 \\ & & & & C2(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$) & 15.32 \\ Ni$_{1.75}$Fe$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$(y=0.25) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{1.75}$Fe1$_{0.25}$ & C1(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Fe1$\downarrow$) & 0.00 \\ & & & & C2(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Fe1$\downarrow$) & 25.13 \\ & & & & \textbf{C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Fe1$\uparrow$)} & -13.07 \\ & & & & C4(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Fe1$\uparrow$) & -4.26 \\ Ni$_{1.50}$Fe$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$(y=0.50) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{1.50}$Fe1$_{0.50}$ & C1(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Fe1$\downarrow$) & 0.00 \\ & & & & C2(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Fe1$\downarrow$) & 38.84 \\ & & & & \textbf{C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Fe1$\uparrow$)} & -22.73 \\ & & & & C4(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Fe1$\uparrow$)& -13.68 \\ \hline \\Z=Co \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$(y=0.00) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{2}$ & \textbf{C1(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$)} & 0.00 \\ & & & & C2(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$) & 15.32 \\ Ni$_{1.75}$Co$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$(y=0.25) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{1.75}$Co1$_{0.25}$ & \textbf{C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Co1$\uparrow$)} & 0.00 \\ & & & & C4(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Co1$\uparrow$) & 5.77 \\ Ni$_{1.50}$Co$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$(y=0.50) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{1.50}$Co1$_{0.50}$ & C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Co1$\uparrow$) & 0.00 \\ & & & & \textbf{C4(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Co1$\uparrow$)} & -3.04 \\ \hline \\Z=Cu \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$(y=0.00) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{2}$ & \textbf{C1(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$)} & 0.00 \\ & & & & C2(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$) & 15.32 \\ Ni$_{1.75}$Cu$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$(y=0.25) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{1.75}$Cu1$_{0.25}$ & \textbf{C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Cu1$\uparrow$)} & 0.00 \\ & & & & C4(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Cu1$\uparrow$) & 17.74 \\ Ni$_{1.50}$Cu$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$(y=0.50) & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{1.50}$Cu1$_{0.50}$ & \textbf{C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Cu1$\uparrow$)} & 0.00 \\ & & & & C4(Mn1$\uparrow$ Mn2$\uparrow$ Ni1$\uparrow$ Cu1$\uparrow$) & 18.90 \\ \hline\hline \end{tabular} } \end{table*} The results suggest the following: Substitutions at Mn sites show that the different substituents prefer different sites. While the substituting Fe atoms prefer to occupy the Mn sublattices, Co atoms prefer the Ni sublattices forcing the Ni to occupy the substituted Mn sublattices. Substituting Cu atoms, on the other hand, prefer the Sb sublattices. In case of substitutions at Ni sites, all three substituents have preferences for the sites of substitution only, corroborating the experimental predictions in case of Co substituted Ni$_{2}$Mn$_{1.52}$Sb$_{0.48}$\cite{60sahoo2014}. Regarding the preferred magnetic configurations, it can be concluded that for both Fe and Cu substitutions, the Mn1 atoms align parallel with Ni1, Ni2 and Z($=$Fe, Cu) atoms and align antiparallel with the Mn2 atoms; the configuration denoted as $``$C3$"$. In cases of Co substitutions, though the Mn atoms have anti-parallel alignments for smaller concentrations (i.e. $``$C3$"$ configuration), with increase in Co concentration they align parallel making the $``$C4$"$ magnetic configuration as the ground state. However in Ni$_{2}$MnCo$_{0.50}$Sb$_{0.50}$ the energy difference between the $``$C3$"$ and $``$C4$"$ configurations is small indicating that a mixed phase of these two can be present. This implies that Co acts as a $``$ferromagnetic activator$"$ in Ni-Mn-Sb alloys as is seen in other Ni-Mn based Heusler alloys\cite{jing2009,vasiliev2010,han2010,perez2013,nayak2010}. \subsection{Magnetic moments in the austenite phases} \label{moment} As was discussed in Section \ref{introduction}, significant enhancement of magnetic moment in the austenite phases leading to a possibility of large $\Delta$M is one of the motivations for substitutions of Ni and Mn with other magnetic atoms. That there is a correlation between enhancement of magnetisation in the austenite phase and a large MCE for Ni-Mn-Sb system could be observed in the experiment on the compound where Co substituted Ni. An enhancement in magnetisation in the austenite phase along with a significant MCE was observed\cite{nayak2009,anayak2009,nayak2010}. In order to understand the qualitative and quantitative trends in magnetisations due to substitutions of different elements at different sites and with different concentrations, we have calculated the total and atomic moments of all compounds as function of compositions. The results are shown in Table \ref{table2} and Figure \ref{fig1}. In Figure \ref{fig1}, we present simultaneously the variations in the moments when concentrations of the substituting element are between $0$ and $25 \%$ as well as between $25\%$ and $50\%$, that is when the concentrations could be chosen arbitrarily. These calculations are done by SPRKKR code which implements the KKR-CPA method that uses single-site mean field technique to address the substitutional disorder and hence do not require constructions of supercell. This was necessary in order to mimic the experimental compositions as much as possible and at the same time to find whether the qualitative changes in the moments with compositions indeed follow the trends as computed using supercells where concentrations of the substituents are varied by larger percentages. The lattice constants used for the calculations with KKR-CPA for arbitrary concentrations are taken by interpolating the lattice constants obtained from supercell calculations, presented in Table \ref{table2}. \begin{figure}[t] \centerline{\hfill \psfig{file=fig1a.eps,width=0.245\textwidth} \psfig{file=fig1b.eps,width=0.245\textwidth} \hfill} \caption{Calculated total magnetic moment and atomic magnetic moments (in $\mu_{\rm B}/f.u.$) (for atom-name convention see Table ~\ref{table1}) as a function of concentration $y$ of substituting elements, Z=Fe, Co and Cu for (a) Ni$_{2}$Mn$_{1.50-y}$Z$_{y}$Sb$_{0.50}$(Z@Mn) and (b) Ni$_{2-y}$Z$_{y}$Mn$_{1.50}$Sb$_{0.50}$(Z@Ni) systems in their lowest energy magnetic configurations as indicated in Table \ref{table1}. Variations of total magnetic moments with $y$ calculated by SPRKKR code\cite{ebert2011}, are presented by dashed lines with open symbols. For Co-substituted systems, magnetic moments both for $``$C3$"$(dashed lines with open circles) and $``$C4$"$(solid lines with marked circles) magnetic configurations for $y>0.25$ are shown.} \label{fig1} \end{figure} We find that, Fe-substitutions at the Mn1 sites in Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ lead to a slight decrease in total magnetic moments with increase in the concentration of Fe, although the atomic moments hardly change. This is due to the lower moments on Fe atoms in comparison to the substituted Mn1 atoms. When Fe substitutes Ni, the total magnetic moment increases with Fe concentration as stronger magnet Fe replaces Ni. In case of Cu substituting Mn, we find remarkable increase in the total moment as Cu concentration increases. This occurs as the Cu atoms, instead of occupying the Mn1 sites, replace Mn2 atoms at the Sb sites, thus decreasing the negative contributions from Mn2 atoms to the overall moment. This does not happen when Cu replaces Ni. Co-substitutions at either Mn or Ni sites present an interesting picture. When Co substitutes Mn or Ni, the magnetic configuration upto at least $y=0.25$, is $``$C3$"$. Since Co always occupies Ni sites irrespective of whether Mn or Ni is substituted, leaving Mn2 as it is, the moment decreases when Mn is substituted, as the net positive contribution to the total moment goes down with weaker magnet Co replacing Mn. When Ni is substituted, the net moment increases with $y$, albeit weakly, as Co moment is greater than that of Ni. Quantitatively the results of supercell calculations(by VASP) and KKR-CPA calculations (by SPRKKR) have excellent agreements, and reproduce experimental results well as KKR-CPA calculated moment value of 1.99 $\mu_{\rm B}/f.u.$ for Ni$_{1.8}$Co$_{0.2}$Mn$_{1.50}$Sb$_{0.50}$ is in good agreement with the experimental value of 1.85 $\mu_{\rm B}/f.u.$ for Ni$_{1.8}$Co$_{0.2}$Mn$_{1.52}$Sb$_{0.48}$ composition\cite{60sahoo2014}. For $y=0.5$, we found that although the lowest energy magnetic configuration $``$C4$"$, the energy difference between $``$C3$"$ and $``$C4$"$ is extremely low, even less than 1~meV per atom for Mn-substituted compound. This gives rise to the possibility of mixed magnetic phases comprising of both $``$C3$"$ and $``$C4$"$. However, in our calculations we have considered only $``$C4$"$ for $y=0.5$ in the supercell calculations while both configurations are considered for all $y$ between $0.25$ and $0.5$ in KKR-CPA calculations. We find that for $y=0.5$, both supercell and KKR-CPA produce identical results, a high magnetic moment which is expected as the Mn spins align in $``$C4$"$. The configuration $``$C3$"$ leads to gradual quenching of the total moment as Co replaces Mn1, an extrapolation of the behaviour for $y \leq 0.25$. However, for Co replacing Ni the total moment does not change appreciably due to the proximity of the atomic moments of the two. Thus, substitution with Co provides us with a possibility for large magnetic moment in the austenite phase when $y \sim 0.25$ and subsequently large value of $\Delta$M as desired may be realised. However, since there is a good possibility of mixed magnetic phases of the two configurations, the actual moment may not be that high as the net moment will be a weighted average of moments of the two magnetic configurations. Even then, the net magnetic moment is expected to be higher than the cases where Fe or Cu are substituted. \subsection{Structural Phase Transition and associated change in magnetic structure} \label{MPT} Significant MCE in the Ni-Mn based Heusler alloys is observed in the vicinity of the reversible martensitic phase transformation (MPT), a diffusionless first-order phase transition from a high symmetry austenite phase to a low symmetry martensite phase with decreasing temperature when coupled with a substantial change in the magnetic order\cite{albertini2004}. The associated large change in magnetization ($\Delta$M) across the structural phase transition gives rise to a large magnetic entropy change i.e. an increased MCE. Thus, compositions exhibiting the structural phase transition near the room temperature and associated with a change in magnetic structure are of great importance. Chemical substitution in Ni-Mn based ternary compounds has been proved to be an effective way to tune the stability of the austenite phase or in other words, to adjust T$_M$ and to increase $\Delta$M . As discussed in Section \ref{introduction}, different investigations conclude that Fe, Co, Cu substitutions at Mn and Ni sites in Mn-excess Ni-Mn-(Ga,In,Sn) alloys tune the thermodynamic parameters related to the magnetic and structural transformations and consequently the MCE \cite{59sahoo2011,60sahoo2014,64han2008,nayak2009,anayak2009,62feng2011}. Therefore, in this section, we have systematically investigated the effects of substitution of different elements with different concentrations and at various sites on the stability of the austenite phase of Ni$_{2}$Mn$_{1.5}$Sb$_{0.5}$. We also look into the possible changes in the magnetic configurations due to the structural transitions from cubic austenite to a tetragonal martensitic phase that can result in a large ($\Delta$M) in these compounds. Although, the quantification of $\Delta$M and comparison with experiments cannot be directly done in this way due to the fact that the experimental samples may not lead to the tetragonal martensites immediately after the MPT and at the temperatures where experimental measurements were carried out, the calculations surely can provide important insights into the possible trends and outcomes in regard to expectation of large $\Delta$M. \begin{figure*}[t] \centerline{\hfill \psfig{file=fig2a.eps,width=0.35\textwidth} \hspace{0.005cm} \psfig{file=fig2b.eps,width=0.33\textwidth} \hspace{0.005cm} \psfig{file=fig2c.eps,width=0.33\textwidth} \hfill} \vspace{-0.55cm} \centerline{\hfill \psfig{file=fig2d.eps,width=0.35\textwidth} \hspace{0.005cm} \psfig{file=fig2e.eps,width=0.33\textwidth} \hspace{0.005cm} \psfig{file=fig2f.eps,width=0.33\textwidth} \hfill} \caption{The variations of total energy difference ($\Delta$E) between the austenite(L2$_{1}$) and the martensite(tetragonal) phases as a function of tetragonal distortion i.e. $c/a$ ratio for (a) Ni$_{2}$Mn$_{1.50-y}$Z$_{y}$Sb$_{0.50}$(Z@Mn) and (b) Ni$_{2-y}$Z$_{y}$Mn$_{1.50}$Sb$_{0.50}$(Z@Ni) (Z=Fe, Co and Cu) systems for considered values of $y$ and at their ground state magnetic configurations (as in Table \ref{table1}). Results where the magnetic configurations are different in the martensitic phases (for Co substitution with $y=0.50$) are also shown.} \label{fig2} \end{figure*} \begin{table*}[t] \centering \caption{\label{table2} Calculated values of equilibrium lattice constant (a$_{0}$), and total magnetic moment (M$_{\rm A}$) of the systems under considerations in their austenite ground states are shown. The total energy difference ($\Delta{E}$) between the austenite(L2$_{1}$) and the martensite(tetragonal) phases $[$the equilibrium value of tetragonal distortion (c$/$a) is given in parentheses$]$, the total magnetic moment (M$_{\rm M}$) in the non-modulated martensitic phases and the differences in magnetic moments between the austenite and martensite phases ($\Delta$M) are also shown.} \resizebox{0.86\textwidth}{!}{% \begin{tabular}{l@{\hspace{0.4cm}} c@{\hspace{0.4cm}} c@{\hspace{0.4cm}} c@{\hspace{0.4cm}} c@{\hspace{0.4cm}} c@{\hspace{0.4cm}} c@{\hspace{0.4cm}} c@{\hspace{0.4cm}} } \hline\hline \vspace{-0.33 cm} \\ Composition & Mag. Config. & a$_{0}$ & $\Delta$E($c/a$) & M$_{\rm A}$ & M$_{\rm M}$ & $|\Delta{M}|$ \\ & & (\r{A}) & (meV/atom) & ($\mu_{\rm B}/f.u.$) & ($\mu_{\rm B}/f.u.$) & ($\mu_{\rm B}/f.u.$) & \\ \hline\hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 5.94 & 27.64(1.34) & 1.71 & 1.55 & 0.16 \\ Ni$_{2}$Mn$_{1.25}$Fe$_{0.25}$Sb$_{0.50}$ & C3 & 5.92 & 39.23(1.36) & 1.51 & 1.46 & 0.05 \\ Ni$_{2}$MnFe$_{0.50}$Sb$_{0.50}$ & C3 & 5.91 & 48.38(1.36) & 1.33 & 1.37 & 0.04 \\ \hline Ni$_{1.75}$Fe$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 5.92 & 10.68(1.29) & 2.09 & 1.88 & 0.21 \\ Ni$_{1.50}$Fe$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 5.91 & 4.81(1.24) & 2.48 & - & - \\ \hline\hline Ni$_{2}$Mn$_{1.25}$Co$_{0.25}$Sb$_{0.50}$ & C3 & 5.89 & 33.00(1.34) & 1.04 & 0.93 & 0.11 \\ Ni$_{2}$MnCo$_{0.50}$Sb$_{0.50}$ & C4 & 5.87 & 73.26(1.36) & 4.53 & 0.09 & 4.44 \\ \hline Ni$_{1.75}$Co$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 5.93 & 20.97(1.30) & 1.99 & 1.94 & 0.05 \\ Ni$_{1.50}$Co$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$ & C4 & 5.95 & 16.27(1.29) & 6.82 & 1.95 & 4.87 \\ \hline\hline Ni$_{2}$Mn$_{1.25}$Cu$_{0.25}$Sb$_{0.50}$ & C3 & 5.92 & 22.30(1.28) & 2.94 & 3.06 & 0.12 \\ Ni$_{2}$MnCu$_{0.50}$Sb$_{0.50}$ & C4 & 5.90 & 22.00(1.27) & 4.15 & 4.15 & 0.00 \\ \hline Ni$_{1.75}$Cu$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 5.95 & 32.23(1.38) & 1.69 & 1.64 & 0.05 \\ Ni$_{1.50}$Cu$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 5.98 & 34.35(1.41) & 1.73 & 1.76 & 0.03 \\ \hline\hline \end{tabular} } \end{table*} To study the structural phase stability for a particular composition, we have distorted the lowest energy L2$_{1}$ structure at that composition along each of the possible crystallographic inequivalent directions and computed the total energy as a function of the tetragonal distortion given by $(c/a)$. Due to finite size of the 16 atom supercell, different atomic distributions in the planes, perpendicular to which distortion is given, define two crystallographic inequivalent directions for most of the compositions considered here. Further, for the purpose of investigation of any possible changes in the magnetic structures in the martensitic phases from that in the cubic phases, we have also calculated energy profiles for the possible magnetic configurations listed in Table \ref{table1} at each composition. The results are shown in Figure 1 of supplementary material. In each of these plots, the reference energy is the energy of the austenite ground state for the corresponding composition. In Figure \ref{fig2} we summarise the results and show the energy profiles of the configurations which provide the minimum energy in each case. Figure \ref{fig2}(a) shows that, when Fe is substituted at Mn site in Ni$_{2}$Mn$_{1.5}$Sb$_{0.5}$, the stability of the austenite phase decreases with increasing concentration of Fe as is apparent from the growing difference in energy ($\Delta$E) (Table \ref{table2}) between the austenite and the martensite phases, implying that T$_{M}$ increases with Fe concentration. This is completely in contrast with the qualitative behaviour observed in the experiment \cite{59sahoo2011}. We address this anomaly in detail as a special case in Section \ref{Fe-doped}. Fe substituting Ni, on the other hand, enhances the stability of the austenite phase. For 50\% Fe-substitution, the total energy curve has a shallow minima and thus the possibility of a martensitic instability is slim. Thus the relative phase stability due to Fe substitution is dependent on the atom that is being substituted. For both cases, no changes in magnetic structures have been observed near the structural phase transition and as a result $\Delta$M are also found to be very small. Substitution of Cu, in place of either Ni or Mn does not affect the relative phase stability significantly. As the figures \ref{fig2}c and \ref{fig2}f suggest, $\Delta$E do not change appreciably with $y$, implying that T$_{M}$ remains almost unchanged even when concentration of the substituents are high. In both cases, the magnetic structures do not change across phases as is clear from the results in Table \ref{table2}. Co-substitution turns out to be very interesting as compared to the other two cases. With increase of Co concentration substituting Mn, $\Delta$E first increases moderately in the lower concentration range ($y \leq 0.25$) and no changes is magnetic structure across phases are observed resulting in a lower value of $\Delta$M. Further increase in Co concentration brings in a change in the magnetic structure in austenite phase as was discussed in the previous section; however, the magnetic structure remains same in the martensitic phase with Mn spins still aligned anti-parallel, leading to a $\Delta$M value of 4.44~$\mu_{\rm B}/f.u.$. Simultaneously, we find a substantial increase in $\Delta$E implying a greater martensitic instability in the system. Large $\Delta$M coupled with a large T$_{M}$ indicate better prospect for MCE. Similar jump in $\Delta$M is observed in case of Co substituting Ni. However, the $\Delta$E decreases in this case with $y$. This is consistent with the experimental observation in Ni$_{2-y}$Co$_{y}$Mn$_{1.52}$Sb$_{0.48}$ with $y=0.2$ \cite{nayak2009}. Incidentally, large MCE has been found in this compound. Thus, our results in Co-substituted compounds indicate that they are potential materials for large MCE near a magneto-structural transition of first order. \subsection{Magnetic exchange interactions} \label{jij} \begin{figure*}[t] \centerline{\hfill \psfig{file=fig3a.eps,width=0.44\textwidth} \hspace{0.05cm} \psfig{file=fig3b.eps,width=0.44\textwidth} \hfill} \caption{The dependence of the inter-atomic magnetic exchange parameters in the first coordination shell (for different pair of atoms) for (left panel) Ni$_{2}$Mn$_{1.52-y}$Z$_{y}$Sb$_{0.48}$(Z@Mn) and (right panel) Ni$_{2-y}$Z$_{y}$Mn$_{1.52}$Sb$_{0.48}$(Z@Ni) with Z=Fe, Co and Cu systems in their austenite phases. Calculations in each case, are done at the ground state magnetic configuration. The composition of the parent compound ($y=0$), in each case, is considered to be the ones in the experiments \cite{nayak2009,60sahoo2014,64han2008,anayak2009,59sahoo2011,62feng2011}, and are nominally different from that of Ni$_{2}$Mn$_{1.5}$Sb$_{0.5}$. For Co-substituted systems, magnetic exchange parameters both for $``$C3$"$(closed symbols) and $``$C4$"$(open symbols) magnetic configurations for $y>0.25$ are shown.} \label{fig3} \end{figure*} The inter-atomic magnetic exchange interactions provide the understanding behind the evolution of magnetic transitions and the occurrence of MCE in cases of magneto-structural transitions as observed in Ni-Mn-Z compounds \cite{buchelnikov2008,singh2013,55sokolovskiy2015,sokolovskiy2013,sokolovskiy2014,moya2007,79krenke2005,22khan2007}. In this section, we investigate the effects of substitutions of different constituents of Ni$_{2}$Mn$_{1.5}$Sb$_{0.5}$ at different sites and with different concentrations, on the magnetic exchange interactions, in their austenite phases, and try to correlate with the results obtained in Sections \ref{moment} and \ref{MPT}. We then exclusively discuss the reasons behind large MCE observed in experiment on Ni$_{2-y}$Co$_{y}$Mn$_{1.52}$Sb$_{0.48}$ in light of these. Figure \ref{fig3} shows the trends in variations of various nearest neighbour inter-atomic magnetic exchange coupling strengths as a function of the substituents concentration. Only the variations in the first coordination shells are considered as these are the dominant interactions. We find that, in each case of substitution, the overall ferromagnetic interactions increase due to the predominantly ferromagnetic interactions between the Ni-Z, Mn-Z and Z-Z pairs. When Mn is substituted by Fe there is a competition between the ferromagnetic coupling of Ni-Fe, Mn1-Fe, and antiferromagnetic coupling of Mn1-Mn2 pairs. The antiferromagnetic interaction of Mn1-Mn2 pairs increases with concentration of Fe and compensates the weak increase in the ferromagnetic interactions with $y$. The small negative changes in the magnetic moment with $y$ can be correlated to such variations in the exchange interactions. In a complete contrast to this, substitution of Fe at Ni sites amplify the ferromagnetic Mn-Fe interactions, along with a simultaneous weakening of the antiferromagnetic interactions(Mn1-Mn2, Fe-Fe) as $y$ increases. The increase in the magnetic moment with $y$ is an artefact of this. Almost no variations in the magnetic moment of compounds when Ni is substituted by Cu can be understood from the minimal variations in both ferromagnetic and antiferromagnetic exchange interactions with Cu concentration. In contrast, The significant strengthening in Ni-Mn ferromagnetic interactions when Cu substitutes Mn, can be correlated to the increase in the magnetic moment of the corresponding compound. Co substitutions, both at Mn and Ni sites, give rise to the largest ferromagnetic coupling strengths which is due to very strong ferromagnetic exchange interactions between the Co and Mn atoms. ferromagnetic interactions between Mn-Ni and Co-Co pairs strengthen it further. For higher concentrations ($y > 0.25$) the parallel alignment of the Mn atoms (as in $``$C4$"$ magnetic configuration) magnifies the ferromagnetic interactions further. This explains the large value of moment at high concentrations of Co. Overall, it can be concluded that substitution of magnetic 3d-elements in Ni$_{2}$Mn$_{1.5}$Sb$_{0.5}$ magnify ferromagnetic exchange interactions in the system, and thus in general, leads to a higher value of magnetic moment with respect to the parent compound. \begin{figure*}[t] \centerline{\hfill \psfig{file=fig4a.eps,width=0.378\textwidth} \hspace{0.05cm} \psfig{file=fig4b.eps,width=0.35\textwidth} \hfill} \vspace{0.05cm} \centerline{\hfill \psfig{file=fig4c.eps,width=0.378\textwidth} \hspace{0.05cm} \psfig{file=fig4d.eps,width=0.35\textwidth} \hfill} \caption{Inter-atomic magnetic exchange interactions in (a)-(b)parent composition Ni$_{2}$Mn$_{1.52}$Sb$_{0.48}$ and (c)-(d) Ni$_{2-y}$Co$_{y}$Mn$_{1.52}$Sb$_{0.48}$ with $y=0.24$ in the cubic ($c/a=1$) and tetragonal ($c/a \neq 1$) phases as a function of distance d(in units of lattice constant a$_{0}$) between the pair of atoms.} \label{fig4} \end{figure*} We next focus on understanding of the occurrence of large $\Delta$M and the possible connection to significant MCE in some of the substituted Mn-excess, Sb-deficient Ni$_{2}$MnSb compounds. For this purpose, we consider Ni$_{2}$Mn$_{1.52}$Sb$_{0.48}$ compound and investigate the behaviour of magnetic exchange interactions, in both austenite and martensite phases, when Fe, Co and Cu substitute Ni and Mn with the concentration of the substituent being $0.24$. The reason for picking this particular composition is the observation of large MCE for compositions close to this \cite{anayak2009} in the compound where Co substitutes Ni. In Figure \ref{fig4}, we show the results for Ni$_{1.76}$Co$_{0.24}$Mn$_{1.52}$Sb$_{0.48}$ only. Results for other compounds are shown in Figures 2-5 of supplementary materials. In the parent composition Ni$_{2}$Mn$_{1.52}$Sb$_{0.48}$, the austenite phase is dominated by the Mn1-Mn2 nearest-neighbour antiferromagnetic (AFM) interactions. In the tetragonal martensite phase this AFM interaction gets almost four times magnified and shows an oscillatory behaviour in the second and third coordination shells. As a result not much difference between the magnetic moments in the two phases are expected to occur. This proposition is consistent with the results on Ni$_{2}$Mn$_{1.5}$Sb$_{0.5}$ (Table \ref{table2}). When Co substitutes Ni, the Mn1-Mn2 AFM interaction strength remains same as the pristine compound in the martensitic phase while the ferromagnetic interactions gain slightly. But, in the austenite phase, the Co-Mn ferromagnetic interactions amplify more than five times in comparison to the dominant ferromagnetic interactions in the pristine compound. As a result the magnetic moments in the two phases would differ substantially, in comparison to that in the pristine compound. This, therefore, perfectly explains the experimentally observed large $\Delta$M and large MCE. Another highlight of these calculations is observation of a correlation between the qualitative nature of the variations in the exchange interactions and relative stabilities of the structural phases. Experimentally it was observed that for Co-substitution at Ni site in Ni$_{2}$Mn$_{1.52}$Sb$_{0.48}$,T$_{M}$ decreases with the substituent concentration implying that this substitution stabilises the austenite phase. The nature of magnetic exchange interactions in Figure \ref{fig4} suggests that the strong ferromagnetic interactions stabilise the austenite phase. The analysis of Figures 2-5 in supplementary materials corroborate this. \subsection{Mechanical properties} \label{elastic} MCE materials with coupled magneto-structural transitions often suffer from cracking and fatigue, which severely limits their usefulness. Quaternary off-stoichiometric Ni-Mn based Heusler compounds are found to exhibit better mechanical properties such as ductility, corrosion resistance, machinability, all of which ease manufacturing and increase the product longevity. For example, Fe-addition improves the toughness of Ni-Mn-Ga allloys without sacrificing its magnetic and thermoelastic properties\cite{cherechukin2001,28bkundu2017}. In this section, we, therefore, explore the changes in the mechanical properties of Ni$_{2}$Mn$_{1.5}$Sb$_{0.5}$ compounds upon substitution by the fourth element. \\ \begin{table}[t] \centering \caption{\label{table3} The calculated values of Pugh ratio G$_v$/B and Cauchy pressure C$^P$ of the systems under considerations in their austenite phases with ground state magnetic configurations for corresponding compositions.} \resizebox{0.5\textwidth}{!}{% \begin{tabular}{l@{\hspace{0.4cm}} c@{\hspace{0.4cm}} l@{\hspace{0.4cm}} c@{\hspace{0.4cm}} } \hline\hline \vspace{-0.33 cm} \\ Composition & Mag. Config. & G$_v$/B & C$^P$(GPa) \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 0.39 & 49.19 \\ Ni$_{2}$Mn$_{1.25}$Fe$_{0.25}$Sb$_{0.50}$ & C3 & 0.43 & 41.77 \\ Ni$_{2}$MnFe$_{0.50}$Sb$_{0.50}$ & C3 & 0.44 & 38.93 \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 0.39 & 49.19 \\ Ni$_{1.75}$Fe$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 0.47 & 31.68 \\ Ni$_{1.50}$Fe$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 0.49 & 25.31 \\ \hline\hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 0.39 & 49.19 \\ Ni$_{2}$Mn$_{1.25}$Co$_{0.25}$Sb$_{0.50}$ & C3 & 0.42 & 42.70 \\ Ni$_{2}$MnCo$_{0.50}$Sb$_{0.50}$ & C4 & 0.45 & 40.12 \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 0.39 & 49.19 \\ Ni$_{1.75}$Co$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 0.43 & 40.85 \\ Ni$_{1.50}$Co$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$ & C4 & 0.41 & 44.81 \\ \hline\hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 0.39 & 49.19 \\ Ni$_{2}$Mn$_{1.25}$Cu$_{0.25}$Sb$_{0.50}$ & C3 & 0.46 & 33.78 \\ Ni$_{2}$MnCu$_{0.50}$Sb$_{0.50}$ & C4 & 0.39 & 52.65 \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 0.39 & 49.19 \\ Ni$_{1.75}$Cu$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 0.42 & 41.86 \\ Ni$_{1.50}$Cu$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 0.41 & 42.05 \\ \hline\hline \end{tabular} } \end{table} A good measure of whether the system is more ductile or more brittle is its Pugh ratio given as G$_v$/B\cite{92pugh1954,50roy2015}, Gv is the isotropic shear modulus under Voigt formalism\cite{49voigt1889} related to the resistance of the material to plastic deformation and B is the bulk modulus in the cubic phase. Compounds having a Pugh ratio greater than 0.57 are considered to be more brittle. On the other hand, Cauchy pressure C$^P$, defined as C$^p$=(C$_{12}$-C$_{44}$), provides insight to the nature of bonding in a material with cubic symmetry\cite{94pettifor1992}; C$_{12}$, C$_{44}$ are the shear moduli in the cubic phase. A positive value of Cauchy pressure indicates the bonding in the compound to be more metallic while a negative value implies a stronger covalent bonding\cite{28bkundu2017,ghosh2019}. To calculate the Pugh ratio and Cauchy pressure, at first we have calculated the Bulk modulus(B) and the elastic moduli (C$_{44}$ and C$^{\prime}$) for all the compounds considered in this work, in their austenite phases (the results are shown in Figure 6 and in TableI of supplementary material). We find that the bulk modulus decreases for all the cases where Mn is substituted. The bulk modulus does not change when Fe and Co substitute Ni but decreases appreciably when Cu replaces Ni. These trends in B are consistent with the trends in the variations of lattice constants as shown in Table \ref{table2}. Positive C$_{44}$ for all the compositions satisfies one of the stability criteria for cubic crystals. A negative C$^{\prime}$ indicates the instability in the L2$_{1}$ phase and that the system is prone to a structural transformation. The values of C$^{\prime}$ tabulated in TableI of supplementary material explains the observed martensitic instabilities in the compounds and will be discussed later in Section \ref{Tm-Tc} in detail. From the calculated bulk modulus and C$^{\prime}$, we have calculated C$_{11}$ and C$_{12}$, and then G$_v$/B and C$^P$ using the relations in Section \ref{methods} for all the compounds. The results are shown in Table \ref{table3}. The results imply that substitution of Fe, Co or Cu keeps the Ni-Mn-Sb compounds ductile and the nature of bonding largely metallic. \subsection{Variation in T$_{M}$ and T$_c^A$} \label{Tm-Tc} A large MCE i.e. $\Delta$S$_{M}$ is usually obtained at a temperature near T$_{M}$ in cases of first-order magneto-structural transitions, typical for Ni-Mn based Heusler compounds. However small $\Delta$S$_{M}$ may also be observed near T$_c^A$, the magnetic transition temperature in the austenite phase, in a second order magnetic transition. The largest MCE can be obtained if these two temperatures are as close as possible and near room temperature, for operational purpose. Attempts\cite{vasil1999,aliev2004,albertini2004}, thus, have been made to bring these two temperatures closer by adjusting the composition so that T$_{M}$ increases and T$_c^A$ decreases. Success in this approach has been achieved in case of Ni$_{2.18}$Mn$_{0.82}$Ga by substitution of the magnetic components with another transition metal from the $3d$ series \cite{cherechukin2004,khan2005,soto2008,stadler2006,liu2002}. After investigating the roles of the substituents in achieving a large $\Delta$M and the underlying physics therein in the previous sub-section, thus pinpointing the materials which can potentially be exhibiting significant MCE, it becomes necessary to explore how T$_{M}$ and T$_c^A$ behave with substitution of Fe, Co or Cu in Ni$_{2}$Mn$_{1.5}$Sb$_{0.5}$; more so as the experimental results on Ni-Mn-Sb compounds with compositions close to the parent compound considered in this work suggest that the two temperatures are quite close \cite{62feng2011,64han2008,anayak2009,60sahoo2014} and near room temperature, varying between 260-330K. \begin{table*}[t] \centering \caption{\label{table4} Calculated values all predicting observables of martensitic transition temperature, T$_{M}$: electron to atom ratio ($e/a$), electron density (n), total energy difference ($\Delta{E}$) between the austenite(L2$_{1}$) and the martensite(tetragonal) phases, tetragonality of the martensite phase ($\mid c/a-1\mid$) and shear modulus (C$^\prime$) of the austenite phase for all the six types of considered systems. In the last column trend in T$_{M}$ and Curie temperature (T$_c^A$) in the austenite phase have been concluded by observing the trend in more reliable quantity C$^\prime$ and values of T$_c^A$ calculated through Monte Carlo Simulation in Figure \ref{fig5}, respectively.} \resizebox{0.93\textwidth}{!}{% \begin{tabular}{l@{\hspace{0.4cm}} c@{\hspace{0.4cm}} l@{\hspace{0.4cm}} c@{\hspace{0.4cm}} c@{\hspace{0.4cm}} c@{\hspace{0.4cm}} c@{\hspace{0.4cm}} c@{\hspace{0.4cm}} } \hline\hline \vspace{-0.33 cm} \\ Composition & Mag. Config. & $e/a$ & n & $\Delta$E & $\mid c/a-1\mid$ & C$^\prime$ & Trends in T$_{M}$ and T$_c^A$ \\ & & & & (meV/atom) & & (GPa) & \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 8.25 & 0.630 & 27.64 & 0.34 & -3.81 & T$_{M}$ decreases, \\ Ni$_{2}$Mn$_{1.25}$Fe$_{0.25}$Sb$_{0.50}$ & C3 & 8.3125 & 0.641 & 39.23 & 0.36 & 1.65 & T$_c^A$ decreases slightly \\ Ni$_{2}$MnFe$_{0.50}$Sb$_{0.50}$ & C3 & 8.375 & 0.649 & 48.38 & 0.36 & 5.04 & \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 8.25 & 0.630 & 27.64 & 0.34 & -3.81 & T$_{M}$ decreases, \\ Ni$_{1.75}$Fe$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 8.125 & 0.627 & 10.68 & 0.29 & 5.28 & T$_c^A$ decreases \\ Ni$_{1.50}$Fe$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 8.00 & 0.620 & 4.81 & 0.24 & 13.12 & \\ \hline\hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 8.25 & 0.630 & 27.64 & 0.34 & -3.81 & T$_{M}$ increases, \\ Ni$_{2}$Mn$_{1.25}$Co$_{0.25}$Sb$_{0.50}$ & C3 & 8.375 & 0.656 & 33.00 & 0.34 & -9.26 & T$_c^A$ decreases \\ Ni$_{2}$MnCo$_{0.50}$Sb$_{0.50}$ & C4 & 8.50 & 0.672 & 73.26 & 0.36 & -14.06 &\\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 8.25 & 0.630 & 27.64 & 0.34 & -3.81 & T$_{M}$ decreases, \\ Ni$_{1.75}$Co$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 8.1875 & 0.628 & 20.97 & 0.30 & -0.55 & T$_c^A$ increases slightly \\ Ni$_{1.50}$Co$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$ & C4 & 8.125 & 0.617 & 16.27 & 0.29 & -1.90 & \\ \hline\hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 8.25 & 0.630 & 27.64 & 0.34 & -3.81 & T$_{M}$ decreases in the beginning \\ Ni$_{2}$Mn$_{1.25}$Cu$_{0.25}$Sb$_{0.50}$ & C3 & 8.50 & 0.656 & 22.30 & 0.28 & 15.64 & and then increases, \\ Ni$_{2}$MnCu$_{0.50}$Sb$_{0.50}$ & C4 & 8.75 & 0.682 & 22.00 & 0.27 & -7.95 & T$_c^A$ decreases \\ \hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & C1 & 8.25 & 0.630 & 27.64 & 0.34 & -3.81 & T$_{M}$ and T$_c^A$ remains \\ Ni$_{1.75}$Cu$_{0.25}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 8.3125 & 0.631 & 32.23 & 0.38 & -1.51 & almost constant \\ Ni$_{1.50}$Cu$_{0.50}$Mn$_{1.50}$Sb$_{0.50}$ & C3 & 8.375 & 0.627 & 34.35 & 0.41 & -1.26 & \\ \hline\hline \end{tabular} } \end{table*} \begin{figure}[t] \centerline{\hfill \psfig{file=fig5.eps,width=0.43\textwidth} \hfill} \caption{Calculated Curie temperatures (T$_c^A$) as a function of substituents (Z=Fe, Co, Cu) concentration for Ni$_{2}$Mn$_{1.52-y}$Z$_{y}$Sb$_{0.48}$(Z@Mn) and Ni$_{2-y}$Z$_{y}$Mn$_{1.52}$Sb$_{0.48}$(Z@Ni) systems. Closed symbols and Open symbols represent results calculated by Monte Carlo Simulation (MCS) and Mean Field Approximation (MFA) methods, respectively. For Co-substituted systems, Curie temperatures in $``$C4$"$ magnetic configuration for $y>0.25$ are shown with marked circles.} \label{fig5} \end{figure} Calculation of T$_{M}$ requires computations of free energies including contributions from phonon and magnetic excitations, apart from the electronic one. This becomes computationally prohibitive for off-stoichiometric compounds like the ones considered here. Therefore, in this work, we could only look at the qualitative variations in T$_{M}$ as a function of composition for the compounds considered here, by studying the variations of quantities which are related to T$_{M}$\cite{li2011,25hu2009,45li2011,68siewert2012}, and are calculated here. The $e/a$ ratio has been found to be a good predictor for composition dependence of T$_{M}$ in Ni-Mn based Heusler alloys. T$_{M}$ is found to follow $e/a$ \cite{29lanska2004,30zayak2006,31mehaddene2008}, albeit with exceptions in some cases: Fe substituted Ni-Mn-Sb being one\cite{59sahoo2011}. For a few notable cases like N-Mn-Ga compounds \cite{45li2011}, the electron density $n=((e/a)\times$n$_{1}$)/V$_{cell}$, scales with T$_{M}$, n$_{1}$ being the average number of atoms contained in the unit cell of volume V$_{cell}$\cite{chen2007}. The total energy difference($\Delta$E) between the austenite and the martensite phases is found to be another predictor of T$_{M}$\cite{89chakrabarti2013,81sokolovskiy2017,28bkundu2017,ghosh2019}. Larger value of $\Delta$E implies a higher stability of the martensite phase at zero temperature and thus a higher T$_{M}$. The tetragonality of the martensite phase quantified by $\mid c/a-1\mid$ is also found to follow variations in T$_{M}$ in cases of Ni-Mn-(Ga,In) compounds \cite{29lanska2004,banik2007,27li2012}. The best predictor of T$_{M}$ for Ni-Mn based Heusler alloys, so far, has been the shear modulus C$^\prime$ in the austenite phase. This is due to the fact that the shear modulus is associated with the softening of the acoustic phonon branch that drives the martensitic transformation in these systems. Important physical factors like site ordering and magnetic structure are all taken care of in the variation of this quantity \cite{36ren2000,37ren2003}. In Table \ref{table4}, we compile the trends in variations of these five quantities as a function of composition for the six compounds considered, to qualitatively understand the variations in T$_{M}$. With increase in Fe concentration at the expense of Mn, the $e/a$ ratio, electron density n, $\mid c/a-1\mid$ and $\Delta$E increases, suggesting increase in T$_{M}$ with Fe concentration, while the increase in C$^{\prime}$ with concentration of Fe suggests the stabilisation of the austenite phase, an opposite trend. This later trend is in agreement with the experimental observation \cite{59sahoo2011} which shows a decrease in T$_{M}$ with Fe concentration. Even though we consider the trends in C$^{\prime}$ as the authentic one, this particular system exhibits discrepancy between theory and experiment with regard to the trend in the magnetic moment in the austenite phase, as mentioned earlier. We discuss the origin of this discrepancy and possible solution in Section \ref{Fe-doped}. For compounds with Fe substituting Ni, the trends in all five quantities are consistent, indicating lowering of T$_{M}$ with Fe concentration. Though there is no experimental observations available on compositions close to Ni$_{2-y}$Fe$_{y}$Mn$_{1.5}$Sb$_{0.5}$, Fe substitution at Ni sites for similar systems Ni-Mn-(Ga, In, Sn) show the same trend in variation of T$_{M}$\cite{krenke2007,soto2008}. Our result for this system, therefore, is consistent. In case of Co-substitution, irrespective of whether Mn or Ni is substituted, all five quantities show the same trend which implies that T$_{M}$ increases(decreases) with Co concentration, when Co substitutes Mn(Ni). The available experimental results \cite{nayak2009,anayak2009,64han2008} for Ni$_{2-y}$Co$_{y}$Mn$_{1.52}$Sb$_{0.48}$ are in agreement with this. For Cu substitution at Mn site, both $e/a$ and n increase wheres $\Delta$E decreases slightly, implying contrasting trends in T$_{M}$. On the other hand, C$^{\prime}$ initially increases with Cu for the low concentrations, consistent with the trend seen in $\Delta$E, predicting a slight decrease in T$_{M}$, only to decrease for higher concentrations. For compounds where Cu substitutes Ni, $\Delta$E and C$^\prime$, too, show opposite trends. However changes in all the quantities are very small indicating that the T$_{M}$ remains almost constant with respect to the parent compound. In absence of experiments on this system, this cannot be verified. Nevertheless, it is noteworthy that other Ni-Mn based Heulser compounds show almost the same trend for Cu substitution\cite{ezekiel2018,khan2005}. \\ The variation in Curie temperature (T$_c^A$) in the austenite phase for all the considered systems, calculated by Mean field approximation (MFA) and Monte Carlo simulation (MCS) methods, have been shown in Figure \ref{fig5}. From Figure \ref{fig5}, it can be seen that the overall trend remains almost same for most of the cases, irrespective of the method used, and that the calculated values, in general, are overestimated in comparison to experiments. For Fe substitution at Mn site, T$_c^A$, calculated by MCS method slightly decreases with Fe concentration wheres with MFA calculation a substantial decrease in T$_c^A$ is observed. On the other hand, when Fe is substituted at Ni site, same trend of T$_c^A$ decreasing linearly with Fe concentration, is found from calculations by either method. We find the same for Co-substituted compounds. For compounds with Co substituting Mn, T$_c^A$ decreases with Co concentration when $``$C3$"$ magnetic configuration is considered. For $``$C4$"$ magnetic configuration in the higher concentration range, same trend is observed ; the values of T$_c^A$ are larger though. For compounds with Co substituting Ni, the T$_c^A$ slightly increases with Co concentration. For compounds with Cu substitution, T$_c^A$ decreases linearly when substitution is done at Mn site, whereas for substitution at Ni site T$_c^A$ remains almost constant when calculated with MCS method. T$_c^A$ calculated by MFA shows a different trend for substitution at Mn site for which T$_c^A$ first decreases in the low concentration range and then it increases in the higher concentration range. In Table \ref{table4} we have summarised the above discussion with regard to variations in T$_{M}$ and T$_{c}^{A}$. Among the compounds which showed promises as magnetocaloric materials by means of large $\Delta$M, the Co-substituted ones at concentrations of Co more than $25 \%$, Ni$_{2}$Mn$_{1.5-y}$Co$_{y}$Sb$_{0.5}$ can have T$_{M}$ and T$_{c}^{A}$ very close, desirable for large MCE. In this case, if we take into account the fact that our calculated T$_{c}^{A}$ is overestimated by around 50~K, the T$_{c}^{A}$ can be very close to room temperature for $y \sim 0.25$. On the other hand, a crude estimation of T$_{M}$ can be done from the values of $\Delta$E. If the $\Delta$E of the parent compound is mapped to 260~K, the possible T$_{M}$ by extrapolation from experimental results\cite{21j2007,22khan2007,20w2009} on compounds with compositions close to it, then, T$_{M}$ will be close to 300~K for $y \sim 0.25$. This together with large $\Delta$M will make this compound with this composition a desirable material for MCE. Ni$_{2-y}$Co$_{y}$Mn$_{1.5}$Sb$_{0.5}$ will not be as effective since its T$_{c}^{A}$ will be around 350~K for $y \sim 0.25$ while the T$_{M}$ will be around 220~K, as per the crude estimation from $\Delta$E. Although the $\Delta$M is very low, the compound Ni$_{2}$Mn$_{1.5-y}$Cu$_{y}$Sb$_{0.5}$ exhibits the possibility of almost coincidence of T$_{M}$ and T$_{c}^{A}$ as the former remains almost constant and the later rapidly decreases towards room temperature. \subsection{Resolving discrepancy between theory and experiment for Ni$_{2}$Mn$_{1.52-y}$Fe$_{y}$Sb$_{0.48}$: possible role of site occupancy } \label{Fe-doped} \begin{table*}[t] \centering \caption{\label{table5} All possible site-occupation configurations ($``$S-a$"$ to $``$S-e$"$) and corresponding ground state magnetic configurations of Ni$_{2}$Mn$_{1.50-y}$Fe$_{y}$Sb$_{0.50}$ (y=0 and 0.25) with their relative electronic energies $\Delta$E$_{0}$ (in meV/atom), considering the electronic energy of the $``$S-a$"$ configuration as reference one.} \resizebox{1.00\textwidth}{!}{% \vspace{0.3 cm} \begin{tabular}{l@{\hspace{0.05cm}} c@{\hspace{0.5cm}} l@{\hspace{0.2cm}} l@{\hspace{0.2cm}} l@{\hspace{0.2cm}} l@{\hspace{0.4cm}} c@{\hspace{0.2cm}}} \hline\hline \vspace{-0.33 cm} \\ Composition & Site & \multicolumn{3}{c}{Site Occupancies} & Mag. Configurations & $\Delta$E$_{0}$ \\ & Config. & 4a & 4b & 8c & & \\ \hline\hline Ni$_{2}$Mn$_{1.50}$Sb$_{0.50}$ & S-a & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1 & Ni1$_{2}$ & C1 (Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$) & 0.00 \\ \hline Ni$_{2}$Mn$_{1.25}$Fe$_{0.25}$Sb$_{0.50}$ & S-a & Sb1$_{0.50}$Mn2$_{0.25}$Fe1$_{0.25}$ & Mn1 & Ni1$_{2}$ & C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Fe1$\uparrow$) & 0.00 \\ & S-b & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1$_{0.75}$Fe1$_{0.25}$ & Ni1$_{2}$ & C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Fe1$\uparrow$) & -4.06 \\ & S-c & Sb1$_{0.50}$Mn2$_{0.25}$Ni2$_{0.25}$ & Mn1 & Ni1$_{1.75}$Fe1$_{0.25}$ & C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1,Ni2$\uparrow$ Fe1$\uparrow$) & 5.80 \\ & S-d & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1$_{0.75}$Ni2$_{0.25}$ & Ni1$_{1.75}$Fe1$_{0.25}$ & C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1,Ni2$\uparrow$ Fe1$\uparrow$) & -3.09 \\ & S-e & Sb1$_{0.50}$Mn2$_{0.25}$Ni2$_{0.25}$ & Mn1$_{0.75}$Fe1$_{0.25}$ & Ni1$_{1.75}$Mn3$_{0.25}$ & C3(Mn1$\uparrow$ Mn2$\downarrow$ Mn3$\uparrow$ Ni1,Ni2$\uparrow$ Fe1$\uparrow$) & 32.90 \\ \iffalse \hline Ni$_{2}$MnFe$_{0.50}$Sb$_{0.50}$(y=0.50) & S-a & Sb1$_{0.50}$Fe1$_{0.50}$ & Mn1 & Ni1$_{2}$ & C1(Mn1$\uparrow$ Ni1$\uparrow$ Fe1$\downarrow$) \\ & S-b & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1$_{0.50}$Fe1$_{0.50}$ & Ni1$_{2}$ & C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1$\uparrow$ Fe1$\uparrow$) \\ & S-c & Sb1$_{0.50}$Ni2$_{0.50}$ & Mn1 & Ni1$_{1.50}$Fe1$_{0.50}$ & C2(Mn1$\uparrow$ Ni1,Ni2$\uparrow$ Fe1$\uparrow$) \\ & S-d & Sb1$_{0.50}$Mn2$_{0.50}$ & Mn1$_{0.50}$Ni2$_{0.50}$ & Ni1$_{1.50}$Fe1$_{0.50}$ & C3(Mn1$\uparrow$ Mn2$\downarrow$ Ni1,Ni2$\uparrow$ Fe1$\uparrow$) \\ & S-e & Sb1$_{0.50}$Ni2$_{0.50}$ & Mn1$_{0.50}$Fe1$_{0.50}$ & Ni1$_{1.50}$Mn3$_{0.50}$ & C3(Mn1$\uparrow$ Mn2$\downarrow$ Mn3$\uparrow$ Ni1,Ni2$\uparrow$ Fe1$\uparrow$) \\ \fi \hline\hline \end{tabular} } \end{table*} In absence of experimental results for most of the systems considered in this work, the validation of our findings largely depended upon agreement with the results of only a couple of experiments on Fe and Co substituting Mn and Ni respectively in Ni$_{2}$Mn$_{1.52}$Sb$_{0.48}$, a composition very close to the one considered here. In case of the system with Co substituting Ni, we observed a good agreement for the trends in magnetic moment and T$_{M}$ \cite{anayak2009}. For the system where Fe substitutes Mn, following discrepancies between our calculations and the experimental observations \cite{59sahoo2011} were found: (i) the magnetic moment of the system, decreases with Fe concentration as per our calculations, in complete disagreement with the trend observed in the experiment and (ii) although the variation of C$^{\prime}$, the most reliable predictor of T$_{M}$, with Fe concentration, suggesting a lowering of T$_{M}$, in agreement with the experimental findings, the trend in $\Delta E$, another predictor, and a useful one, as it can provide a quantitative estimate of T$_{M}$, implies the opposite. In this section, we attempt to find the origin of the discrepancy and resolve it. \begin{figure*}[t] \centerline{\hfill \psfig{file=fig6a.eps,width=0.345\textwidth} \hspace{0.1cm} \psfig{file=fig6b.eps,width=0.40\textwidth} \hfill} \caption{Variations in the (a) total magnetic moments with $y$ for various site configurations (Table \ref{table5}) for Ni$_{2}$Mn$_{1.50-y}$Fe$_{y}$Sb$_{0.50}$ system in their austenite phases calculated with VASP (closed symbols with solid line) and for Ni$_{2}$Mn$_{1.52-y}$Fe$_{y}$Sb$_{0.48}$ calculated by SPRKKR (open symbols with dashed line) Experimental values of the total moment are added for comparison; (b) total energy differences ($\Delta$E) between the austenite and martensite phases of Ni$_{2}$Mn$_{1.50-y}$Fe$_{y}$Sb$_{0.50}$ with $y$, for select site configurations. Experimental values of T$_{M}$ \cite{59sahoo2011} are given for comparing trends.} \label{fig6} \end{figure*} \begin{figure}[htpb!] \centerline{\hfill \psfig{file=fig7.eps,width=0.49\textwidth} \hfill} \caption{The dependence of the inter-atomic magnetic exchange parameters in the first coordination shell (for different pairs of atoms) for Ni$_{2}$Mn$_{1.52-y}$Fe$_{y}$Sb$_{0.48}$ in their austenite phases for site configurations (a) $``$S-b$"$ and (b) $``$S-c$"$.} \label{fig7} \end{figure} The possible origin of the discrepancy is the difference between the site ordering obtained in our calculation and the actual one generated during the experiment. The site ordering in an experimental sample depends on the thermal treatment. To resolve whether the site ordering is behind the observed discrepancy, we have done a detailed investigation considering all possible site occupancy of the constituent atoms in the Fe-doped Ni$_{2}$Mn$_{1.25}$Fe$_{0.25}$Sb$_{0.50}$ system. In Table~II of supplementary material we have listed the possible site occupancies and magnetic configurations. The energies of the ground state magnetic configurations, for each pattern of site occupancy, are summarised in Table \ref{table5}. We, then, have calculated the magnetic moments as a function of Fe concentration between $0$ and $0.25$, for each site occupancy configuration of Table \ref{table5}. The results are shown in Figure \ref{fig6}(a). We find that the magnetic moment increases monotonically with Fe concentration, as observed in experiments, for all configurations except $``$S-b$"$ and $``$S-d$"$. It is to be noted that the configuration $``$S-b$"$ has the lowest energy for this compound and has been considered for calculations of physical properties throughout the paper. Since the configurations $``$S-a$"$, $``$S-c$"$, $``$S-e$"$ reproduce the experimentally observed trend of the magnetic moment, we next calculate the energy profiles of this system as a function of $(c/a)$ for these three configurations and compute $\Delta E$ in each case. The energy profiles are presented in Figure 7 of supplementary material and $\Delta$E are shown in Figure \ref{fig6}(b). In Figure \ref{fig6}(b), experimentally obtained T$_{M}$ are shown to find out the proximity of trends in variations of T$_{M}$ with one or more of the calculated $\Delta$E. We find that the configuration $``$S-c$"$, one where the substituent Fe atoms occupy the Ni sites while Ni atoms occupy the vacant Sb sites, provide the best agreement to the experiments, in terms of trends in magnetic moment of the austenite phase and the T$_{M}$. That this configuration provides the same trend in T$_{M}$ as the experiment, is further established when our calculated shear modulus C$^\prime$ is found to increase with Fe concentration (Table III, supplementary material). The calculated T$_{c}^{A}$ (Table III, supplementary material) provides further credence to $``$S-c$"$ being the site occupancy configuration realised in the experiment since its trend with Fe concentration also agrees to that in the experiment. The total energies of $``$S-b$"$ and $``$S-c$"$ are only 10 meV per atom apart. Thus, occurrence of the $``$S-c$"$ configuration during the heat treatment of the sample has substantial possibility. To conclude, the experimental results on Ni$_{2}$Mn$_{1.52-y}$Fe$_{y}$Sb$_{0.48}$ can be consistently interpreted by taking into consideration the role of site occupancies. In order to gain further insights into the connection between the site occupancies, large magnetic moment in the austenite phase and subsequently the MCE in this particular compound, we look at the variations in the magnetic exchange interactions as a function of $y$. The detailed comparison of the nearest neighbour inter-atomic magnetic exchange for $``$S-b$"$ and $``$S-c$"$ configurations is in Figure \ref{fig7}. We find that substantially large ferromagnetic interactions in $``$S-c$"$ configuration, the greatest being in the Ni2-Fe pair, makes the difference. The presence of large ferromagnetic interactions in the austenite phase produces a large moment, lends more stability to the austenite phase (T$_{M}$ reduces) and can be correlated with the large MCE observed experimentally. \section{Summary and Conclusions} Ni-Mn based Heusler compounds have turned out to be promising materials for magneto-caloric applications. Substitution of the transition metals Ni and Mn by other $3d$ transition metals in ternary Ni-Mn based compounds, have been found to open up avenues for enhancing the magneto-caloric effects in these compounds. In this work, we have explored the potentials of Mn-excess, Sb-deficient Ni$_{2}$MnSb compounds, as magneto-caloric materials by substitution of Ni and Mn by $3d$ transition metals Fe, Co and Cu. Apart from being able to explain the trends of variations in quantities like the martensitic transformation temperature, magnetic transition temperature and the magnetic moments with compositions, observed in handful of experiments on this system, we have provided insights into the possibilities of significant magneto-caloric effects in this group of compounds; the ones which are yet to be synthesised. We found that the site occupancies of various atoms play an important role in the variations of the above mentioned physical quantities. The structural stabilities in these systems could be correlated to the magnetic exchange interactions and their variations. We predict that the compounds Ni$_{2}$Mn$_{1.5-y}$Co$_{y}$Sb$_{0.5}$ and Ni$_{2}$Mn$_{1.5-y}$Cu$_{y}$Sb$_{0.5}$; $y \sim 0.25$, can emerge as materials with large magneto-caloric effects. In conclusion, this work systematically explores the physics behind occurrence of magneto-caloric effect in substituted Ni-Mn-Sb compounds. The approach adopted and knowledge obtained from this work can be used to investigate a wider pool of materials, boosting the possibility to discover more materials with large MCE. \section{Acknowledgement} The authors greatfully acknowledge the Department of Science and Technology, India for the compuational facilities under Grant No. SR/FST/P-II/020/2009 and IIT Guwahati for the PARAM supercomputing facility. \bibliographystyle{aip}
\section{Introduction} Quantum chromodynamics (QCD), the theory of the strong force, is challenging to study due to its non-perturbative nature and the inability to use lattice QCD simulations in the phenomenologically most interesting regime, namely finite baryon density, due to the infamous fermion sign problem~\cite{fukurev, simon} present in classical Monte Carlo algorithms. As such, except for asymptotically large baryon chemical potentials, where QCD is expected to be in a color-flavor-locked phase~\cite{raja, alford} and can be studied due to asymptotic freedom, most of the phenomenologically relevant QCD phase diagram must be mapped out by other methods, e.g. low-energy effective models. Recently, there has been renewed interest in a slightly different regime of QCD, one with a finite isospin chemical potential due to the possibility of a new form of compact stars known as pion stars, first discussed in Ref.~\cite{carigchpt}. This type of compact object could form in regions with large densities of neutrinos, which in turn leads to the production of pions and their subsequent condensation~\cite{brauner}. These pions under weak equilibrium lead to stable pion stars, which may be electromagnetically neutralized by either electrons or muons, or both. They are expected to have radii and masses that are substantially larger than those of neutron star ~\cite{endro}. Pion stars are also different from neutron stars in the sense that at $T=0$ it is interactions that give rise to an (effective) equation of state, and not the statistics of its constituents. QCD at finite isospin chemical potential was first studied by Son and Stephanov using chiral perturbation theory ($\chi$PT)~\cite{wein,gasser1,gasser2,bein,scherer} in their seminal paper~\cite{son}. In Refs.~\cite{loewe,fragaiso,cohen2,janssen,carig,carigchpt,luca} one can find various applications of $\chi$PT including some partial next-to-leading order results. Since then finite isospin systems have been studied extensively in other versions of QCD including two-color and adjoint QCD~\cite{cotter,kim}, in the NJL~\cite{toublannjl,he2f,heman2,heman,ebert1,ebert2,sun,lars,2fabuki,heman3,he3f,ricardo,ruggi}, in the quark-meson model~\cite{lorenz,ueda,qmstiele,allofus}, but also through lattice QCD, where it does not suffer from the fermion sign problem (except at finite magnetic fields~\cite{endromag,prabal} due to the charge asymmetry of the up and down quarks). The first lattice QCD calculations of finite isospin QCD were done in Refs.~\cite{kogut1,kogut2} and a more recent, thorough analysis in Refs.~\cite{gergy1,gergy2,gergy3}. They find as expected from chiral perturbation theory calculations that at zero temperature there is a second order phase transition at an isospin chemical potential, $|\mu_{I}|=m_{\pi}$~\footnote{The $|\mu_I|={1\over2}m_{\pi}$ conventions is also frequently found in the literature. See Eq.~(\ref{muidef}).}, which remains largely unaltered at finite temperatures up to approximately $170\ {\rm MeV}$ beyond which quarks become deconfined~\cite{fragaiso}. Similarly, with increasing isospin chemical potentials the quarks in the pions become more loosely bound and occur in a BCS phase though owing to the fact that this phase has the same order parameter as the BEC phase, there is no real phase transition, only a crossover transition, with the size of the pion condensate decreasing substantially within a narrow isospin window. There have been a number of studies in recent years comparing $(2+1)$ flavor lattice QCD results with both QCD models and effective theories. Recently, the NJL model (non-renormalizable) comparisons~\cite{ricardo} were made that showed good agreement with the lattice while the quark-meson model~\cite{allofus} (which is renormalizable) largely agrees with the lattice. Furthermore, there have been other comparisons of lattice QCD with results from an effective field theory (and model-independent) description~\cite{carig}, which is valid for asymptotically large isospin chemical potentials~\cite{cohen2}, where the pions behave as a free Bose gas. A recent review can be found in Ref.~\cite{massrev}. The focus of this work is to compare the results of three-flavor $\chi$PT at finite isospin density~\cite{kogut3} with that of $(2+1)$-flavor lattice QCD of Refs.~\cite{gergy1,gergy2,gergy3}. We previously studied two-flavor $\chi$PT at next-to-leading order (NLO)~\cite{us} and found that the NLO results are in better agreement with lattice QCD than the tree-level results though the pressure, isospin density and energy density were all found to be consistently smaller than lattice QCD values. This is not entirely unexpected since the lattice QCD observables included the effects of the sea strange quarks~\cite{usagain} while two-flavor $\chi$PT does not. As such, we extend our previous work in NLO two-flavor $\chi$PT to include the effect of the strange quarks by using three-flavor $\chi$PT at finite isospin chemical potential and find that the observables near the second phase transition is in good agreement with lattice QCD. As a natural extension of our finite isospin study, we also construct the NLO, one-loop effective potential to study the effects of the simultaneous presence of both the isospin and strange quark chemical potential.~\footnote{Note that the ``strange quark chemical potential" ($\mu_{s}$) is different from the ``strange chemical potential" ($\mu_{S}$). We define them in Eq.~(\ref{musdef}).} We find the second-order phase transition in the pion condensed phase remains at $|\mu_{I}|=m_{\pi}$ even with the inclusion of $\mu_{S}$ and NLO corrections.~\footnote{This property is expected to hold to all orders in perturbation theory.} Similarly, the second order phase transition in the kaon condensed phases remain at $|\pm\frac{1}{2}\mu_{I}+\mu_{S}|=m_{K}$ where $m_{K}$ is the kaon mass. Furthermore the effective potential even in the presence of $\mu_{S}$ in the pion condensed phase only depends on $\mu_{I}$ and in the kaon condensed phase on the combination $|\pm\frac{1}{2}\mu_{I}+\mu_{S}|$ but not $\mu_{I}$ and $\mu_{S}$ separately. The paper is organized as follows. In the next section, we discuss the Lagrangian of three-flavor chiral perturbation theory at finite isospin and strange chemical potentials at next-to-leading order in the low-energy expansion. In Sec.~3, we review the ground state of the theory and fluctuations in the different phases. In Sec.~4 the NLO effective potential in the three different phases of the theory is calculated. In Sec.~5, we calculate the pressure, the isospin density, and the equation of state in the pion-condensed phase. We also consider the large-$m_s$ limit, where it is shown that the observables in three-flavor $\chi$PT reduce to the two-flavor observables of Ref.~\cite{us} with renormalized couplings. In Sec.~6, we discuss the phase diagram in more detail and derive medium-dependent masses at tree level. We compare our results for the thermodynamic functions with recent lattice simulations. \section{$\chi$PT Lagrangian at ${\cal O}(p^4)$} In this section, we briefly discuss the symmetries of three-flavor QCD as well the chiral Lagrangian to next-to-leading order in the low-energy expansion and its renormalization. The three-flavor Lagrangian of QCD is \begin{eqnarray} {\cal L}&=& \bar{\psi}\left( i/\!\!\!\!D-m \right)\psi-{1\over4}F_{\mu\nu}^aF^{\mu\nu a}\;, \end{eqnarray} where $m={\rm diag}(m_u,m_d,m_s)$ is the quark mass matrix, $/\!\!\!\!D=\gamma^{\mu}\left(\partial_{\mu}-ig\tfrac{\lambda^a}{2}A_{\mu}^a\right)$ is the covariant derivative, $\lambda^a$ are the Gell-Mann matrices, $g$ is the strong coupling, $A_{\mu}^a$ is the gauge field, and $F_{\mu\nu}^a$ is the field-strength tensor. The global symmetry of massless three-flavor QCD is $SU(3)_L\times SU(3)_R\times U(1)_B$, which is spontaneously broken down to $SU(3)_V\times U(1)_B$ in the vacuum. For two degenerate light quarks, i.e. in the isospin limit the symmetry is $SU(2)_I\times U(1)_Y\times U(1)_B$, where $Y$ represents hypercharge. If $m_u\neq m_d$, this symmetry is reduced to $U(1)_{I_3}\times U(1)_Y\times U(1)_B$. If we add a chemical potential for each of the quarks, the symmetry is $U(1)_{I_3}\times U(1)_Y\times U(1)_B$, irrespective of the quark masses. In the present paper, we consider three-flavor QCD with two degenerate light quarks. The chiral Lagrangian then describes the octet of pseudo-Goldstone bosons consisting of the three pions ($\pi^{\pm}$ and $\pi^0$), the four kaons ($K^{\pm}$, $K^0$ and $\bar{K}^{0}$), and the eta ($\eta$). We begin with the chiral perturbation theory Lagrangian at $\mathcal{O}(p^{2})$~\cite{gasser1}~\footnote{One factor of $\nabla_{\mu}$ counts one power of $p$ and one factor of $\chi$ counts two powers of $p$.} \begin{eqnarray} \mathcal{L}_{2}=\frac{f^{2}}{4}{\rm Tr} \left [\nabla_{\mu} \Sigma^{\dagger} \nabla^{\mu}\Sigma \right ] +{f^2\over4}{\rm Tr} \left [\chi^{\dagger}\Sigma+\chi\Sigma^{\dagger}\right ]\; , \label{lag0} \end{eqnarray} where $f$ is the bare pion decay constant, $\chi=2B_0M$, and \begin{eqnarray} M={\rm diag}(m_u,m_d,m_s) \end{eqnarray} is the quark mass matrix, $\Sigma=U\Sigma_0U$, where $U=\exp{i\lambda_i\phi_i\over2f}$, and $\Sigma=\mathbb{1}$ is the vacuum. Moreover, $\lambda_i$ ($i=1,2,...,8$) are the Gell-Mann matrices that satisfy ${\rm Tr}\lambda_i\lambda_j=2\delta_{ij}$ and $\phi_i$ are the fields that parametrize the Goldstone manifold. The covariant derivative at nonzero quark chemical $\mu_q$ potentials $(q=u,d,s)$ is defined as follows \begin{eqnarray} \label{nabla0} \nabla_{\mu} \Sigma&\equiv& \partial_{\mu}\Sigma-i\left [v_{\mu},\Sigma \right]\;,\\ \nabla_{\mu} \Sigma^{\dagger}&=& \partial_{\mu}\Sigma^{\dagger}-i [v_{\mu},\Sigma^{\dagger} ] \;, \label{nablas} \end{eqnarray} where \begin{eqnarray} v_{\mu}&=&\delta_{\mu0} {\rm diag}(\mu_u,\mu_d,\mu_s)\;. \end{eqnarray} We can also express $v_{\mu}$ in terms of the baryon, isospin and strangeness chemical potentials $\mu_B$, $\mu_I$, and $\mu_S$ as \begin{eqnarray} v_{\mu}&=&\delta_{\mu0}{\rm diag}(\mbox{$1\over3$}\mu_B +\mbox{$1\over2$}\mu_I,\mbox{$1\over3$}\mu_B-\mbox{$1\over2$}\mu_I, \mbox{$1\over3$}\mu_B-\mu_S)\;. \label{vmu} \end{eqnarray} where \begin{eqnarray} \mu_B&=&{3\over2}(\mu_u+\mu_d)\;,\\ \label{muidef} \mu_I&=&\mu_u-\mu_d\;,\\ \mu_S&=&{1\over2}(\mu_u+\mu_d-2\mu_s)\;. \label{musdef} \end{eqnarray} This yields \begin{eqnarray} v_0&=&{1\over3}(\mu_B-\mu_S)\mathbb{1}+ {1\over2}\mu_I\lambda_3+{1\over\sqrt{3}}\mu_S\lambda_8\;. \label{v0} \end{eqnarray} We note that the $\mu_B$-dependent term in Eq.~(\ref{v0}) commutes with $\Sigma$ and $\Sigma^{\dagger}$ in Eqs.~(\ref{nabla0})--~(\ref{nablas}) and so the baryon chemical potential drops completely out of the chiral Lagrangian. This reflects the fact that we have only included the mesonic octet, which has zero baryonic charge. We therefore set $\mu_B=0$ in the remainder of the paper. \subsection{Next-to-leading order Lagrangian} In order to perform calculations beyond tree level, we must go to next-to-leading order in the low-energy expansion and consider the terms that contribute to ${\cal L}$ at ${\cal O}\left(p^4\right)$. There are twelve operators in ${\cal L}_4$~\cite{gasser2}, but only eight of them are relevant for the present calculations. They are \begin{eqnarray}\nonumber {\cal L}_4&=& L_1\left({\rm Tr} \left[\nabla_{\mu}\Sigma^{\dagger}\nabla^{\mu}\Sigma\right]\right)^2 +L_2{\rm Tr}\left[\nabla_{\mu}\Sigma^{\dagger}\nabla_{\nu}\Sigma\right] {\rm Tr}\left[\nabla^{\mu}\Sigma^{\dagger}\nabla^{\nu}\Sigma\right] \\&& \nonumber +L_3{\rm Tr}\left[(\nabla_{\mu}\Sigma^{\dagger}\nabla^{\mu}\Sigma) (\nabla_{\nu}\Sigma^{\dagger}\nabla^{\nu}\Sigma)\right] +L_4{\rm Tr}\left[\nabla_{\mu}\Sigma^{\dagger}\nabla^{\mu}\Sigma\right] {\rm Tr}\left[\chi^{\dagger}\Sigma+\chi\Sigma^{\dagger}\right] \\ &&\nonumber +L_5{\rm Tr}\left[\left(\nabla_{\mu}\Sigma^{\dagger}\nabla^{\mu}\Sigma\right) \left(\chi^{\dagger}\Sigma+\chi\Sigma^{\dagger}\right)\right] +L_6\left({\rm Tr}\left[\chi^{\dagger}\Sigma +\chi\Sigma^{\dagger}\right]\right)^2 \\ && +L_8{\rm Tr}\left[\chi^{\dagger}\Sigma \chi^{\dagger}\Sigma + \chi\Sigma^{\dagger}\chi\Sigma^{\dagger}\right] +H_2{\rm Tr}\left[\chi^{\dagger}\chi\right]\;. \label{lag} \end{eqnarray} where $L_i$ and $H_i$ are unrenormalized couplings. The relations between the bare and renormalized couplings $L_{i}^r(\Lambda)$ and $H_{i}^r(\Lambda)$ are \begin{eqnarray} L_{i}&=&L_{i}^r(\Lambda)+ \Gamma_i\lambda\;, \label{lowl} \\ H_i&=&H_{i}^r(\Lambda) +\Delta_i\lambda\;, \label{highl} \end{eqnarray} where \begin{eqnarray} \lambda&=& -{\Lambda^{-2\epsilon}\over2(4\pi)^2}\left[{1\over\epsilon}+1\right]\;. \end{eqnarray} Here $\Gamma_i$ and $\Delta_i$ are constants and $\Lambda$ is the renormalization scale in the modified minimal substraction scheme $\overline{\rm MS}$. The renormalized couplings satisfy the renormalization group equations \begin{eqnarray} \label{rgeq0} \Lambda{d\over d\Lambda}L_i^r&=&-\frac{\Gamma_{i}}{(4\pi)^{2}}\;, \hspace{1cm} \Lambda{d\over d\Lambda}H_i^r=-\frac{\Delta_{i}}{(4\pi)^{2}}\;. \end{eqnarray} These are obtained by differentiation of Eqs~(\ref{lowl})--(\ref{highl}) noting that the bare parameters are independent of the scale $\Lambda$. The solutions are \begin{align} L_i^r(\Lambda)&=L_i^r(\Lambda_0)-{\Gamma_i\over2(4\pi)^2} \log{\Lambda^2\over\Lambda_0^2}\;, &H_i^r(\Lambda)=H_i^r(\Lambda_0)-{\Delta_i\over2(4\pi)^2} \log{\Lambda^2\over\Lambda_0^2}\;, \label{rgeq} \end{align} where $\Lambda_0$ is a reference scale. We note that the contact term $H_2{\rm Tr}[\chi^{\dagger}\chi]$ gives a constant contribution to the effective potential which is the same in all phases. We keep it, however, since it is needed to show the scale independence of the final result for the effective potential. In three-flavor QCD, the constants $\Gamma_i$ and $\Delta_i$ are \begin{align} & \Gamma_{1}=\frac{3}{32}\;,& \Gamma_{2}&=\frac{3}{16}\;,& \Gamma_{3}&=0\;, & \Gamma_{4}&={1\over8}\;, \\ & \Gamma_{5}=\frac{3}{8}\;,& \Gamma_{6}&=\frac{11}{144}\;, & \Gamma_{8}&={5\over48}\;, & \Delta_2 &={5\over24} \;. \end{align} \section{Ground state and fluctuations} In this section, we will discuss the phase structure of the theory as a function of the chemical potentials $\mu_I$ and $\mu_S$. We will also discuss how to parametrize the fluctuations above the ground state. The most general $SU(3)$ matrix for the ground state can be written as \begin{eqnarray} \Sigma_{\alpha}&=&e^{i\alpha\hat{\phi}_i\lambda_i}\;, \label{grall} \end{eqnarray} where $\alpha$ is a rotation angle, $\hat{\phi}_i$ are variational parameters and a sum over the repeated index $i$ is implied. In order to ensure the normalization of the ground state, $\Sigma_{\alpha}\Sigma_{\alpha}^{\dagger}=\mathbb{1}$, the coefficients must satisfy $\sum_{i}\hat{\phi}_i^2=1$. However, depending on the chemical potentials, we expect that the ground state takes a certain form, i.e. that it is rotated in a specific way. For example, in the case $\mu_S=0$, we expect pion condensation for $|\mu_I|>m_{\pi}$~\cite{son} and that the two-flavor results carry over. We therefore briefly review the two-flavor case first. Here the ground state can be written as~\cite{son} \begin{eqnarray} \Sigma_{\alpha}&=&e^{i\alpha\hat{\phi}_i\tau_i} =\cos\alpha+i\hat{\phi}_i\tau_i\sin\alpha\;, \label{sigma2} \end{eqnarray} where $\tau_i$ are the Pauli matrices and $\hat{\phi}_i$ are again variational parameters. The static part of the ${\cal O}(p^2)$ Hamiltonian ${\cal H}_2$ reads \begin{equation} {\cal H}_2^{\rm static}= {f^2\over4}\text{Tr}[v_0,\Sigma_{\alpha}][v_0,\Sigma^{\dagger}_{\alpha}] -{f^2\over2}B_0\text{Tr}[M\Sigma_{\alpha}+M\Sigma_{\alpha}^{\dagger}]\;, \label{stato} \end{equation} where in the two-flavor case $v_0={1\over2}\tau_3\mu_I$, cf. Eq.~(\ref{v0}) and $M={\rm diag}(m_u,m_d)={\rm diag}(m,m)$. The first term in Eq.~(\ref{stato}) can be written as \bq {\cal H}_2^{\rm static\,(a)}&=&{f^2\over4}\text{Tr} [v_0,\Sigma_{\alpha}][v_0,\Sigma_{\alpha}^{\dagger}] ={f^2\over8}\mu_I^2\text{Tr}[\tau_3\Sigma_{\alpha} \tau_3\Sigma_{\alpha}^{\dagger}-\mathbb{1}]\;. \label{firtterm} \end{eqnarray} This form suggests that ${\cal H}_2^{\rm static\,(a)}$ favors directions that anticommute with $\tau_3$~\cite{son}. Substituting Eq.~(\ref{sigma2}) into Eq.~(\ref{firtterm}), this expectation is made explicit, ${\cal H}_2^{\rm static\,(a)}= -{1\over2}f^2\mu_I^2\sin^2\alpha(\hat{\phi}_1^2+\hat{\phi}_2^2)$. Evaluating the other term in Eq.~(\ref{stato}), we find \begin{eqnarray} {\cal H}_2^{\rm static}&=&-2f^2B_0m\cos\alpha -{1\over2}f^2\mu_I^2\sin^2\alpha(\hat{\phi}_1^2+\hat{\phi}_2^2)\;. \label{toth} \end{eqnarray} The first term favors $\alpha=0$, i.e. the vacuum state $\Sigma_0=\mathbb{1}$, and it is clear that there is competition between the two terms in Eq.~(\ref{toth}). We notice that the static energy only depends on $\hat{\phi}_1^2+\hat{\phi}_2^2$, and it is minimized by setting $\hat{\phi_3}=0$. Without loss of generality and for later convenience, we can choose $\hat{\phi}_1=1$ and $\hat{\phi}_2=0$. The rotated vacuum Eq.~(\ref{sigma2}) can then be written as \begin{eqnarray} \Sigma_{\alpha}&=&A_{\alpha}\Sigma_0A_{\alpha}\;, \end{eqnarray} where \begin{eqnarray} A_{\alpha}=e^{i{\alpha\over2}\tau_1}=\cos\mbox{$\alpha\over2$} +i\tau_1\sin\mbox{$\alpha\over2$}\;. \end{eqnarray} Minimizing Eq.~(\ref{toth}) with respect to $\alpha$, we find two phases, $\alpha=0$ for $2B_0m<\mu_I^2$ and $\cos\alpha={{2B_0m\over\mu_I^2}}$ for $2B_0m>\mu_I^2$. The first phase is the vacuum phase and the second phase consists of a condensate of charged pions. In analogy with the two-flavor case, we expect that pion condensation in the three-flavor case can be captured by writing Eq.~(\ref{grall}) as~\footnote{ $\lambda_1$ plays the role of $\tau_1$ and $\lambda_2$ that of $\tau_2$. We are free to choose any linear combination of the two and we choose $\lambda_2$.} \begin{eqnarray} \Sigma_{\alpha}^{\pi^{\pm}}&=&A_{\alpha}\Sigma_0A_{\alpha}\;, \end{eqnarray} where \begin{eqnarray} A_{\alpha}&=&e^{i{\alpha\over2}\lambda_2} ={1+2\cos{\alpha\over2}\over3}\mathbb{1} +i\lambda_2\sin\mbox{$\alpha\over2$} +{\cos{\alpha\over2}-1\over\sqrt{3}}\lambda_8\;. \end{eqnarray} The rotated ground state can also be conveniently written as \begin{eqnarray} \Sigma_{\alpha}^{\pi^{\pm}}&=& \begin{pmatrix} \cos\alpha&\sin\alpha&0\\ -\sin\alpha&\cos\alpha&0\\ 0&0&1 \end{pmatrix}\;, \end{eqnarray} which shows that the rotation does not affect the $s$-quark. The symmetry breaking pattern in this case is \begin{eqnarray} U(1)_{I_3}\times U(1)_Y\times U(1)_B&\rightarrow& U(1)_Y\times U(1)_B\;. \end{eqnarray} Since $U(1)_Q\not\subset U(1)_Y\times U(1)_B$, electric charge $Q$ is also broken and the system is both a superfluid and a superconductor. We next consider kaon condensation in three-flavor $\chi$PT. Depending on the values of $\mu_I$ and $\mu_S$, either the charged kaons or neutral kaons condense. If $|{1\over2}\mu_I+\mu_S|=|\mu_u-\mu_s|>m_K$, we expect either $K^+$ or $K^-$ to condense depending on the sign. If $|-{1\over2}\mu_I+\mu_S|=|\mu_d-\mu_s|>m_K$, we expect $K^0$ or $\bar{K}^0$ to condense depending on the sign. In the case of charged kaon condensation, $\lambda_4$ and $\lambda_5$ replace $\lambda_1$ and $\lambda_2$, respectively, and without loss of generality we can write $\Sigma_{\alpha}^{K^{\pm}}=e^{i{\alpha\over2}\lambda_5}\Sigma_0e^{i{\alpha\over2}\lambda_5}$. The rotated ground state takes the form \begin{eqnarray}\nonumber \Sigma_{\alpha}^{K^\pm} &=&\nonumber {1+2\cos\alpha\over3}\mathbb{1} +{\cos\alpha-1\over2\sqrt{3}}\left(\sqrt{3}\lambda_3-\lambda_8\right) +i\lambda_5\sin\alpha \\ &=& \begin{pmatrix} \cos\alpha&0&\sin\alpha\\ 0&1&0\\ -\sin\alpha &0&\cos\alpha \end{pmatrix}\;. \end{eqnarray} The symmetry-breaking pattern is \begin{eqnarray} U(1)_{I_3}\times U(1)_Y\times U(1)_B&\rightarrow& U(1)_Y\times U(1)_B\;. \end{eqnarray} Again, since the $U(1)_Q\not\subset U(1)_Y\times U(1)_B$, electric charge is spontaneously broken and the superfluid is also a superconductor. Finally, in the case of neutral kaon condensation the rotated ground state is $\Sigma_{\alpha}^{K^0/\bar{K}^0}=e^{i{\alpha\over2}\lambda_7}\Sigma_0e^{i{\alpha\over2}\lambda_7}$, or \begin{eqnarray}\nonumber \Sigma_{\alpha}^{K^0/\bar{K}^0} &=&\nonumber {1+2\cos\alpha\over3}\mathbb{1} +{1-\cos\alpha\over2\sqrt{3}}\left(\sqrt{3}\lambda_3+\lambda_8\right) +i\lambda_7\sin\alpha \\ &=& \begin{pmatrix} 1&0&0\\ 0& \cos\alpha&\sin\alpha\\ 0&-\sin\alpha &\cos\alpha \end{pmatrix}\;. \end{eqnarray} The symmetry-breaking pattern is now \begin{eqnarray} U(1)_{I_3}\times U(1)_Y\times U(1)_B&\rightarrow& U(1)_Q\times U(1)_B\;, \end{eqnarray} implying that the superfluid is not a superconductor. While we have considered the possibility of a single species condensing, in principle it is possible for the ground state to have simultaneous condensation of multiple mesons. However, explicit calculations in Ref.~\cite{massrev,kogut3} that include the possibility of multiple rotations into multiple condensed phases show that such phases are not the global minima except on the first order transition line. We discuss the line at the end of this section. We now return to the evaluation of the static Hamiltonian ${\cal H}_2$. In the case of pion condensation, the static Hamiltonian reduces to \begin{eqnarray} {\cal H}_2&=&-2f^2B_0m\cos\alpha-f^2B_0m_s-{1\over2}f^2\mu_I^2\sin^2\alpha\;. \end{eqnarray} The minimum of the static Hamiltonian is \begin{align} \cos\alpha&=1\;,&\mu_I^2<&2B_0m \\ \cos\alpha&={2B_0m\over\mu_I^2}\;,&\mu_I^2>&2B_0m\;. \end{align} The ground-state energy in the vacuum and pion-condensed phase is \begin{align} {\cal H}_2&=-f^2B_0(2m+m_s \;,&\mu_I^2<&2B_0m\;,\\ {\cal H}_2&=-{(2fB_0m)^2\over\mu_I^2}-f^2B_0m_s-{1\over2}f^2\mu_I^2\left( 1-{(2B_0m)^2\over\mu_I^4}\right) \;,&\mu_I^{2}>&2B_0m \label{firsth} \;. \end{align} In the case of charged kaon condensation, the static Hamiltonian reduces to \bq {\cal H}_2&=&-f^2B_0m(1+\cos\alpha)-f^2B_0m_s\cos\alpha -{1\over2}f^2\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\sin^2\alpha\;. \end{eqnarray} The minimum of the static Hamiltonian is \begin{align} \cos\alpha&=1\;,&\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2<B_0(m+m_s) \\ \cos\alpha&={B_0(m+m_s)\over(\mbox{$1\over2$}\mu_I+\mu_S)^2} \;,& \left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2>B_0(m+m_s) \;. \end{align} The ground-state energy in the vacuum and the charged kaon-condensed phase is \bq {\cal H}_2&=&-f^2B_0(2m+m_s \;,(\mbox{$1\over2$}\mu_I+\mu_S)^2<B_0(m+m_s) \;,\\ \nonumber {\cal H}_2&=&-f^2B_0m-{f^2B_0^2(m+m_s)^2\over(\mbox{$1\over2$}\mu_I+\mu_S)^2} -{1\over2}f^2\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2 \left(1-{B_0^2(m+m_s)^2\over(\mbox{$1\over2$}\mu_I+\mu_S)^4}\right)\;, \\ && \hspace{0.1cm}(\mbox{$1\over2$}\mu_I+\mu_S)^2>B_0(m+m_s) \;. \label{lasth} \end{eqnarray} Finally, we consider the case of condensation of neutral kaons. The results for this phase can be obtained from the results of the phase of condensed charged kaons by the substitution $\mu_I\rightarrow-\mu_I$ since $-{1\over2}\mu_I+\mu_S=\mu_d-\mu_s$. In order to find the global minimum, we must compare Eqs.~(\ref{firsth}) and ~(\ref{lasth}) in the region $|\mu_I|>m_{\pi,0}$ and $|\mbox{$1\over2$}\mu_I+\mu_S|>m_{K,0}$. The boundary between the pion-condensed phase and the kaon-condensed phase is then given by equating these expressions. This yields \begin{eqnarray} -{\left(\mu_I^2-m_{\pi,0}^2\right)^2\over2\mu_I^2} &=&-{ \left[m_K^2-(\mbox{$1\over2$}\mu_I+\mu_S)^2\right]^2 \over2(\mbox{$1\over2$}\mu_I+\mu_S)^2}\;, \end{eqnarray} or \begin{eqnarray} |\mbox{$1\over2$}\mu_I+\mu_S| &=&{\mu_I^2-m_{\pi,0}^2+\sqrt{(\mu_I^2-m_{\pi,0}^2)^2+4\mu_I^2m_{K,0}^2}\over2\mu_I} \label{phaseline} \;, \end{eqnarray} where we used the tree-level relations $m_{\pi,0}^2=2B_0m$ and $m_{K,0}^2=B_0(m+m_s)$. We will return to the phase diagram in the $\mu_I$--$\mu_S$ plane in Sec.~\ref{pd}. \subsection{Parametrizing Fluctuations} Since we want to study the thermodynamics of the pion-condensed and kaon-condensed phases including leading-order quantum corrections, it is natural to expand the chiral perturbation theory Lagrangian around the relevant ground state. The Goldstone manifold as a consequence of chiral symmetry breaking is $SU(3)_{L}\times SU(3)_{R}/SU(3)_{V}$. We will focus on the pion-condensed phase for simplicity. The remarks below also apply to the kaon-condensed phases. Following Refs.~\cite{kim,us}, we write \begin{eqnarray} \Sigma&=L_{\alpha}\Sigma_{\alpha}R_{\alpha}^{\dagger}\;, \label{sigmas} \end{eqnarray} with \begin{eqnarray} \label{lrot} L_{\alpha}&=&A_{\alpha}UA^{\dagger}_{\alpha}\;,\\ R_{\alpha}&=&A_{\alpha}^{\dagger}U^{\dagger}A_{\alpha}\;. \label{rrot} \end{eqnarray} We emphasize that the fluctuations parameterized by $L_{\alpha}$ and $R_{\alpha}$ around the ground state depend on $\alpha$ since the broken generators (of QCD) need to be rotated appropriately as the condensed vacuum rotates with the angle $\alpha$~\cite{kim}. In the present case, $U$ is an $SU(3)$ matrix that parameterizes the fluctuations around the vacuum, \begin{eqnarray} U=\exp\left (i\frac{\phi_a\lambda_a}{2f} \right )\;. \end{eqnarray} With the parameterizations stated above, we get \begin{eqnarray} \label{parametrization} \Sigma&=&A_{\alpha}(U\Sigma_{0}U)A_{\alpha}\;. \end{eqnarray} This parameterization not only produces the correct linear terms that vanish when evaluated at the minimum of the static Hamiltonian $\mathcal{O}(p^{2})$, the divergences of the one-loop vacuum diagrams also cancel using counterterms from the $\mathcal{O}(p^{4})$ Lagrangian. Furthermore, the parametrization produces a Lagrangian that is canonical in the fluctuations and has the correct limit when $\alpha=0$, whereby \begin{eqnarray} \Sigma&=&U\Sigma_{0}U=U^{2}=\exp\left (i\frac{\phi_{a}\lambda_{a}}{f} \right )\; , \end{eqnarray} as expected. If one expands the Lagrangian using the parametrization $\Sigma=L\Sigma_{\alpha}R=U\Sigma_{\alpha}U=UA_{\alpha}\Sigma_0A_{\alpha}U$ instead of Eq.~(\ref{sigmas}), the kinetic terms of the Lagrangian are non-canonical. By a field redefinition that depends on the chemical potentials, these terms can be made canonical. However, calculating the leading corrections to the tree-level potential, it can be shown that the ultraviolet divergences can be eliminated by renormalization only at the minimum of the classical potential.~\footnote{Renormalization of the effective potential is carried out by renormalizing the low-energy constants in the NLO static Lagrangian, see Sec.~\ref{effpot22}.} Thus one cannot find the minimum of the next-to-leading order effective potential as a function of $\alpha$, showing that this parametrization is erroneous. Let us finally take a look at the rotated generators. To linear order in the $\phi_i$, an infinitesimal fluctuation can be written as \bq L_{\alpha &=& \begin{pmatrix} \cos{\alpha\over2}&\sin{\alpha\over2}&0\\ -\sin{\alpha\over2}&\cos{\alpha\over2}&0\\ 0&0&1 \end{pmatrix} \left[1+i{\phi_i\lambda_i\over2f}\right] \begin{pmatrix} \cos{\alpha\over2}&-\sin{\alpha\over2}&0\\ \sin{\alpha\over2}&\cos{\alpha\over2}&0\\ 0&0&1 \end{pmatrix} \;. \label{flucti} \end{eqnarray} Using the (anti)commutator relations of the Gell-Mann matrices, Eq.~(\ref{flucti}) takes the form \begin{eqnarray}\nonumber L_{\alpha}&=&1+ {i\phi_1\over2f}(\cos\alpha\lambda_1+\sin\alpha\lambda_3) +{i\phi_2\lambda_2\over2f} +{i\phi_3\over2f}(\cos\alpha\lambda_3-\sin\alpha\lambda_1) \\ && \nonumber +{i\phi_4\over2f} \left(\cos\mbox{$\alpha\over2$}\lambda_4-\sin\mbox{$\alpha\over2$} \lambda_6\right) +{i\phi_5\over2f}\left(\cos\mbox{$\alpha\over2$}\lambda_5 -\sin\mbox{$\alpha\over2$} \lambda_7\right) +{i\phi_6\over2f}\left(\cos\mbox{$\alpha\over2$}\lambda_6 +\sin\mbox{$\alpha\over2$} \lambda_4\right) \\ && +{i\phi_7\over2f}\left(\cos\mbox{$\alpha\over2$}\lambda_7+ \sin\mbox{$\alpha\over2$} \lambda_5\right) +{i\phi_8\lambda_8\over2f}\;. \end{eqnarray} The linear combinations $\lambda_1^{\prime}=(\cos\alpha\lambda_1+\sin\alpha\lambda_3)$, $\lambda_2^{\prime}=\lambda_2$, etc can be thought of as rotated generators, some of them, however, only by half the angle. The rotated generators $\lambda_i^{\prime}$ satisfy the same (anti)commutation relations as do $\lambda_i$ To all orders in $\alpha$, we then have \begin{eqnarray} L_{\alpha}&=&\exp\left({i\phi_i\lambda_i^{\prime}\over2f}\right)\;. \end{eqnarray} \subsection{Leading-order Lagrangian} Using the parameterization Eq.~(\ref{parametrization}) discussed above, we can write down the Lagrangian in terms of the fields $\phi_{a}$, which parametrizes the Goldstone manifold. The leading-order terms in the low-energy expansion are given by ${\cal L}_2$, which can be expanded as a power series in the fields \begin{eqnarray} \mathcal{L}_{2}&=&\mathcal{L}_2^{\rm linear +\mathcal{L}_2^{\rm static +\mathcal{L}_2^{\rm quadratic +\cdots\; \label{lolag} \end{eqnarray} where the ellipses indicate terms that are cubic or higher order in the fields. We will carry out the expansion for the normal phase, the pion-condensed phase, and the charged kaon-condensed phase. Similar results can be obtained for the neutral kaon-condensed phase. \subsubsection{Normal Phase} In the normal phase, the different terms in Eq.~(\ref{lolag}) are \begin{eqnarray} \label{nen} \mathcal{L}_{2}^{\rm static}&=&f^2B_0(2m+m_s \;, \\ \mathcal{L}_{2}^{\rm linear}&=&0\;,\\ \nonumber \mathcal{L}_{2}^{\rm quadratic}&=&\frac{1}{2}\partial_{\mu}\phi_{a} \partial^{\mu}\phi^a -\frac{1}{2}\left(2B_0m-\mu_{I}^{2}\right) \left(\phi_{1}^{2}+\phi_{2}^{2}\right) -\frac{1}{2}(2B_0m)\phi_{3}^{2}\\ \nonumber && -\frac{1}{2}\left [B_{0}(m+m_{s})-\left(\frac{1}{2}\mu_{I}+\mu_{S} \right )^{2}\right ](\phi_{4}^{2}+\phi_{5}^{2})\\ \nonumber &&-\frac{1}{2}\left [B_{0}(m+m_{s})-\left(-\frac{1}{2}\mu_{I}+\mu_{S} \right )^{2}\right ](\phi_{6}^{2}+\phi_{7}^{2}) \\ \nonumber && -\frac{B_0(m+2m_{s})}{3}\phi_{8}^{2} +\mu_{I}(\phi_{1}\partial_{0}\phi_{2}-\phi_{2}\partial_{0}\phi_{1})+ \left (\mbox{$1\over2$} \mu_I+\mu_{S} \right )\left (\phi_{4}\partial_{0} \phi_{5}-\phi_{5}\partial_{0}\phi_{4}\right ) \\ && + \left (-\mbox{$1\over2$}\mu_I+\mu_{S} \right )\left (\phi_{6}\partial_{0} \phi_{7}-\phi_{7}\partial_{0}\phi_{6}\right )\ . \end{eqnarray} The inverse propagator is block diagonal and can be written as \begin{eqnarray} D^{-1}&=& \begin{pmatrix} D^{-1}_{12}&0&0&0&0&\\ 0&P^2-m_3^2&0&0&0&\\ 0&0&D^{-1}_{45}&0&0&\\ 0&0&0&D^{-1}_{67}&0&\\ 0&0&0&0&P^{2}-m_{8}^{2}\\ \end{pmatrix}\;,\\ m_3^2&=&2B_0m\;,\\ m_8^2&=&{2B_0(m+2m_s)\over3}\;, \end{eqnarray} where $P=(p_0,p)$ is the four-momentum and $P^2=p_0^2-p^2$. The submatrices are \begin{align} D^{-1}_{12}&= \begin{pmatrix} P^{2}-m_{1}^{2}&ip_{0}m_{12}\\ -ip_{0}m_{12}&P^{2}-m_{2}^{2}\\ \end{pmatrix}\;, & D^{-1}_{45}&= \begin{pmatrix} P^{2}-m_{4}^{2}&ip_{0}m_{45}\\ -ip_{0}m_{45}&P^{2}-m_{5}^{2}\\ \end{pmatrix}\;, \\ D^{-1}_{67}&= \begin{pmatrix} P^{2}-m_{6}^{2}&ip_{0}m_{67}\\ -ip_{0}m_{67}&P^{2}-m_{7}^{2}\\ \end{pmatrix}\;, \end{align} The masses are \begin{eqnarray} m_1^2&=&2B_0m-\mu_I^ \;,\\ m_2^2&=&m_1^2\;,\\ m_{12}&=&2\mu_I\;, \\ m_{4}^2&=&B_0(m+m_s)-\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2 \;,\\ m_5^2&=&m_4^2\;,\\ m_{45}&=&\mu_I+2\mu_S\;, \\ m_{6}^{2}&=&B_{0}(m+m_{s})-\left(-\frac{1}{2}\mu_{I}+\mu_{S} \right )^{2}\;,\\ m_7^2&=&m_6^2\;,\\ m_{67}&=&-\mu_I+2\mu_S\;. \end{eqnarray} The dispersion relations for the charges mesons are \begin{eqnarray} \label{nspec1} E_{\pi^{\pm}}&=&\sqrt{p^2+2B_0m}\mp\mu_I =\sqrt{p^2+m_{\pi,0}^2}\mp\mu_I \;,\\ E_{\pi^0}&=&\sqrt{p^2+2B_0m}=\sqrt{p^2+m_{\pi,0}^2}\;,\\ E_{K^{\pm}}&=&\sqrt{p^2+B_0(m+m_s)}\mp(\mbox{$1\over2$}\mu_I+\mu_S) =\sqrt{p^2+m_{K,0}^2}\mp(\mbox{$1\over2$}\mu_I+\mu_S) \;,\\ E_{K^{0},\bar{K}^{0}}&=&\sqrt{p^2+B_0(m+m_s)}\mp(-\mbox{$1\over2$}\mu_I+\mu_S) =\sqrt{p^2+m_{K,0}^2}\mp(-\mbox{$1\over2$}\mu_I+\mu_S)\;,\\ E_{\eta}&=&\sqrt{p^2+{2\over3}B_0(m+2m_s)} =\sqrt{p^2+m_{\eta,0}^2} \;. \label{nspec2} \end{eqnarray} The tree-level masses of the pions, kaons, and the $\eta$ are then given by $m^2_{\pi,0}=2B_0m$, $m_{K,0}^2=B_0(m+m_s)$, and $m_{\eta,0}^2=\mbox{$2\over3$}B_0(m+2m_s)$. \subsubsection{Pion-condensed phase} In the pion-condensed phase, the different terms in Eq.~(\ref{lolag}) are \begin{eqnarray} \mathcal{L}_{2}^{\rm static}&=&f^2B_0(2m\cos\alpha+m_s) +\frac{1}{2}f^{2}\mu_{I}^{2} \sin^{2}\alpha \label{statlag1} \\ \mathcal{L}_{2}^{\rm linear}&=& \label{linear} f(-2B_0m+\mu_{I}^{2}\cos\alpha)\sin\alpha \phi_{2}-f\mu_{I}\sin\alpha\partial_{0}\phi_{1}\\ \nonumber \mathcal{L}_{2}^{\rm quadratic}&=&\frac{1}{2}\partial_{\mu}\phi_{a} \partial^{\mu}\phi_{a} -\frac{1}{2}\left (2B_0m\cos\alpha-\mu_{I}^{2}\cos^{2}\alpha \right )\phi_{1}^{2} \\ && \label{quad} \nonumber -\frac{1}{2}\left (2B_0m\cos\alpha-\mu_{I}^{2} \cos2\alpha \right )\phi_{2}^{2} -\frac{1}{2}\left (2B_0m\cos\alpha +\mu_{I}^{2}\sin^{2}\alpha \right )\phi_{3}^{2} \\ && \nonumber -\frac{1}{2}\left [B_0(m\cos\alpha+m_{s}) -{1\over4}\mu_{I}^{2}\cos2\alpha -\mu_{I}\mu_{S}\cos\alpha-\mu_{S}^{2} \right ](\phi_{4}^{2}+\phi_{5}^{2})\\ &&\nonumber -\frac{1}{2}\left [B_0(m\cos\alpha+m_{s}) -{1\over4}\mu_{I}^{2}\cos2\alpha +\mu_{I}\mu_{S}\cos\alpha-\mu_{S}^{2} \right ](\phi_{6}^{2}+\phi_{7}^{2}) \\ &&\nonumber -\frac{B_0(m\cos\alpha+2m_{s})}{3}\phi_{8}^{2} +\mu_{I}\cos\alpha(\phi_{1}\partial_{0}\phi_{2}-\phi_{2}\partial_{0}\phi_{1}) \\ && \nonumber +\left (\mbox{$1\over2$} \mu_I\cos\alpha+\mu_{S} \right )\left (\phi_{4}\partial_{0} \phi_{5}-\phi_{5}\partial_{0}\phi_{4}\right ) +\left (-\mbox{$1\over2$} \mu_I\cos\alpha+\mu_{S} \right )\left (\phi_{6}\partial_{0} \phi_{7}-\phi_{7}\partial_{0}\phi_{6}\right)\;. \\ && \end{eqnarray} \noindent We get for the inverse propagator: \begin{eqnarray} D^{-1}&=& \begin{pmatrix} D^{-1}_{12}&0&0&0&0\\ 0&p^{2}-m_{3}^{2}&0&0&0\\ 0&0&D^{-1}_{45}&0&0\\ 0&0&0&D^{-1}_{67}&0\\ 0&0&0&0&P^{2}-m_{8}^{2}\\ \end{pmatrix}\;,\\ m_{3}^{2}&=&2B_0m\cos\alpha+\mu_{I}^{2}\sin^{2}\alpha\;, \\ m_{8}^{2}&=&\frac{2B_0(m\cos\alpha+2m_{s})}{3}\;. \label{invDp} \end{eqnarray} The three different $2\times2$ matrices are given by \begin{align} D^{-1}_{12}&= \begin{pmatrix} P^{2}-m_{1}^{2}&ip_{0}m_{12}\\ -ip_{0}m_{12}&P^{2}-m_{2}^{2}\\ \end{pmatrix}\;, & D^{-1}_{45}&= \begin{pmatrix} P^{2}-m_{4}^{2}&ip_{0}m_{45}\\ -ip_{0}m_{45}&P^{2}-m_{5}^{2}\\ \end{pmatrix}\;,\\ D^{-1}_{67}&= \begin{pmatrix} P^{2}-m_{6}^{2}&ip_{0}m_{67}\\ -ip_{0}m_{67}&P^{2}-m_{7}^{2}\\ \end{pmatrix}\;, \end{align} where the masses are \begin{eqnarray} m_{1}^{2}&=&2B_0m\cos\alpha-\mu_{I}^{2}\cos^{2}\alpha \;, \\ m_{2}^{2}&=&2B_0m\cos\alpha-\mu_{I}^{2}\cos2\alpha \;, \\ m_{12}&=&2\mu_{I}\cos\alpha\;,\\ m_{4}^{2}&=&B_0(m\cos\alpha+m_{s}) -\frac{\mu_{I}^{2}}{4}\cos2\alpha-\mu_{I}\mu_{S}\cos\alpha-\mu_{S}^{2} \;,\\ m_5^2&=&m_4^2\;,\\ m_{45}&=&\mu_{I}\cos\alpha+2\mu_{S}\;, \\ m_{6}^{2}&=&B_0(m\cos\alpha+m_{s}) -\frac{\mu_{I}^{2}}{4}\cos2\alpha+\mu_{I}\mu_{S}\cos\alpha- \mu_{S}^{2}\;,\\ m_7^2&=&m_6^2\;,\\ m_{67}&=&-\mu_{I}\cos\alpha+2\mu_{S}\;. \end{eqnarray} The quasiparticle dispersion relations can be easily found and read \begin{eqnarray} \label{kvasi1} E_{\pi^0}&=&p^2+m_3^2 \;,\\ \nonumber E_{\pi^{\pm}}^{2}&=&p^2+{1\over2}\left(m_{1}^{2}+m_{2}^{2}+m_{12}^{2}\right)\\ &\mp&{1\over2}\sqrt{4p^{2}m_{12}^{2}+(m_{1}^{2}+m_{2}^{2} +m_{12}^{2})^2-4m_{1}^{2}m_{2}^{2}}\;,\\ \nonumber E_{K^{\pm}}^{2}&=&p^2+{1\over2}\left(m_{4}^{2}+m_{5}^{2}+m_{45}^{2}\right)\\ &\mp&{1\over2}\sqrt{4p^{2}m_{45}^{2}+(m_{4}^{2}+m_{5}^{2} +m_{45}^{2})^2-4m_{4}^{2}m_{5}^{2}}\;,\\ \nonumber E_{K^0,\bar{K}_{0}}^{2}&=&p^2+{1\over2}\left(m_{6}^{2}+m_{7}^{2}+m_{67}^{2}\right)\\ &\mp&{1\over2}\sqrt{4p^{2}m_{67}^{2}+(m_{6}^{2}+m_{7}^{2} +m_{67}^{2})^2-4m_{6}^{2}m_{7}^{2}}\;,\\ E_{\eta^0}^2&=&p^2+m_8^2\;. \label{kvasi2} \end{eqnarray} \subsubsection{Charged kaon-condensed phase} In the kaon-condensed phase, the different terms in Eq.~(\ref{lolag}) are \begin{eqnarray} \label{statlag111} \mathcal{L}_{2}^{\rm static}&=& f^2B_0[m+(m+m_{s})\cos\alpha] +\frac{1}{2}f^{2}\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2 \sin^{2}\alpha\\ \mathcal{L}_{2}^{\rm linear}&=&f\left[-B_{0}(m+m_{s})+ \left (\tfrac{1}{2}\mu_{I}+\mu_{S} \right )^2\cos\alpha \right ] \sin\alpha\phi_{5}-f\left (\tfrac{1}{2}\mu_{I}+\mu_{S} \right )\sin\alpha \partial_{0}\phi_{4} \label{linear1} \\ \nonumber \mathcal{L}_{2}^{\rm quadratic}&=&\frac{1}{2}\partial_{\mu}\phi_{a} \partial^{\mu}\phi_{a}-\frac{1}{2}\left \{\frac{1}{2}B_{0}\left[3m-m_{s} +(m+m_{s})\cos\alpha \right ] \right.\\ \label{quad1} \nonumber &&\left.-\frac{1}{16}\left [3\mu_{I}-2\mu_{S}+2\left (\tfrac{1}{2}\mu_{I} +\mu_{S} \right )\cos\alpha \right ]^{2}+\frac{1}{4} \left (\tfrac{1}{2}\mu_{I}+\mu_{S} \right )^{2}\sin^{2}\alpha\right \} (\phi_{1}^{2}+\phi_{2}^{2})\\ \nonumber &&-\frac{1}{2}\left \{\frac{1}{2}B_{0}\left [3m-m_{s}+(m+m_{s})\cos\alpha \right ]+\frac{1}{4}\left (\tfrac{1}{2}\mu_{I}+\mu_{S} \right )^{2}\sin^{2} \alpha \right\}\phi_{3}^{2}\\ \nonumber &&-\frac{1}{2}\left\{B_{0}(m+m_{s})\cos\alpha-\left (\tfrac{1}{2}\mu_{I} +\mu_{s} \right )^{2}\cos^{2}\alpha \right \}\phi_{4}^{2}\\ \nonumber &&-\frac{1}{2}\left\{B_{0}(m+m_{s})\cos\alpha-\left (\tfrac{1}{2}\mu_{I}+\mu_{s} \right )^{2}\cos2\alpha \right \}\phi_{5}^{2}\\ \nonumber &&-\frac{1}{2}\left\{\frac{1}{2}B_{0}(m+m_{s})(1+\cos\alpha)-\tfrac{1}{16} \left[-3\mu_{I}+2\mu_{S}+2(\tfrac{1}{2}\mu_I+\mu_{S})\cos\alpha \right]^{2} \right.\\ \nonumber &&+\left.\tfrac{1}{4}(\tfrac{1}{2}\mu_{I}+\mu_{S})^{2}\sin^{2}\alpha\right\} (\phi_{6}^{2}+\phi_{7}^{2})\\ \nonumber &&-\frac{1}{2}\left \{\left[\frac{1}{6}B_{0}(-m+3m_{s}+5(m+m_{s})\cos\alpha)+ \tfrac{3}{4}\left (\tfrac{1}{2}\mu_{I}+\mu_{S} \right )^{2}\sin^{2}\alpha \right] \right \}\phi_{8}^{2}\\ \nonumber &&-\left\{{1\over2\sqrt{3}}B_0(m+m_s)(\cos\alpha-1)+ {\sqrt{3}\over4}\left(\tfrac{1}{2}\mu_{I}+\mu_{S} \right )^{2} \sin^{2}\alpha\right\}\phi_3\phi_8\\ \nonumber &&+\frac{1}{4}\left [3\mu_{I}-2\mu_{S}+2(\tfrac{1}{2}\mu_{I}+\mu_{S}) \cos\alpha \right ](\phi_{1}\partial_{0}\phi_{2}-\phi_{2}\partial_{0}\phi_{1})\\ \nonumber &&+\left (\tfrac{1}{2}\mu_{I}+\mu_{S} \right )\cos\alpha(\phi_{4}\partial_{0} \phi_{5}-\phi_{5}\partial_{0}\phi_{4})\\ &&+\frac{1}{4}\left [-3\mu_{I}+2\mu_{S}+2(\tfrac{1}{2}\mu_{I}+\mu_{S})\cos \alpha \right ](\phi_{6}\partial_{0}\phi_{7}-\phi_{7}\partial_{0}\phi_{6})\;. \end{eqnarray} The inverse propagator is block diagonal and can be written as \begin{eqnarray} D^{-1}&= \begin{pmatrix} D^{-1}_{12}&0&0&0&\\ 0&D^{-1}_{38}&0&0&\\ 0&0&D^{-1}_{45}&0&\\ 0&0&0&D^{-1}_{67}&\\ \end{pmatrix}\;,\\ \label{invDk} \end{eqnarray} where the submatrices are \begin{align} D^{-1}_{12}&= \begin{pmatrix} P^{2}-m_{1}^{2}&ip_{0}m_{12}\\ -ip_{0}m_{12}&P^{2}-m_{2}^{2}\\ \end{pmatrix}\;, & D^{-1}_{38}&= \begin{pmatrix} P^{2}-m_{3}^{2}&-m_{38}^2\\ -m_{38}^2&P^{2}-m_{8}^{2}\\ \end{pmatrix}\;, & \\ \nonumber \\ D^{-1}_{45}&= \begin{pmatrix} P^{2}-m_{4}^{2}&ip_{0}m_{45}\\ -ip_{0}m_{45}&P^{2}-m_{5}^{2}\\ \end{pmatrix}\;, & D^{-1}_{67}&= \begin{pmatrix} P^{2}-m_{6}^{2}&ip_{0}m_{67}\\ -ip_{0}m_{67}&P^{2}-m_{7}^{2}\\ \end{pmatrix}\;. \end{align} The masses are \begin{eqnarray} \nonumber m_{1}^{2}&=&\left \{\frac{1}{2}B_{0}\left[3m-m_{s}+(m+m_{s})\cos\alpha \right ] \right.\\ &&\left.-\frac{1}{16}\left [3\mu_{I}-2\mu_{S}+2\left (\tfrac{1}{2}\mu_{I} +\mu_{S} \right )\cos\alpha \right ]^{2}+\frac{1}{4}\left (\tfrac{1}{2} \mu_{I}+\mu_{S} \right )^{2}\sin^{2}\alpha\right \}\;,\\ m_{2}^{2}&=&m_{1}^{2}\;,\\ m_{12}&=&-\frac{1}{2}\left [3\mu_{I}-2\mu_{S}+2(\tfrac{1}{2}\mu_{I}+\mu_{S}) \cos\alpha \right ]\;,\\ m_{3}^{2}&=&\left \{\frac{1}{2}B_{0}\left [3m-m_{s}+(m+m_{s})\cos\alpha \right ] +\frac{1}{4}\left (\tfrac{1}{2}\mu_{I}+\mu_{S} \right )^{2}\sin^{2}\alpha \right\}\;,\\ m_{4}^{2}&=&\left\{B_{0}(m+m_{s})\cos\alpha-\left (\tfrac{1}{2}\mu_{I}+\mu_{S} \right )^{2}\cos^{2}\alpha \right \}\;,\\ m_{5}^{2}&=&\left\{B_{0}(m+m_{s})\cos\alpha-\left (\tfrac{1}{2}\mu_{I}+\mu_{S} \right )^{2}\cos2\alpha \right \}\;,\\ m_{45}&=&-2\left (\tfrac{1}{2}\mu_{I}+\mu_{S} \right )\cos\alpha\;,\\ \nonumber m_{6}^{2}&=&\left\{\frac{1}{2}B_{0}(m+m_{s})(1+\cos\alpha)-\tfrac{1}{16}\left [-3\mu_{I}+2\mu_{S}+2(\tfrac{\mu_{I}}{2}+\mu_{S})\cos\alpha \right]^{2} \right.\\ &&+\left.\tfrac{1}{4}(\tfrac{1}{2}\mu_{I}+\mu_{S})^{2}\sin^{2}\alpha\right\} \;,\\ m_{7}^{2}&=&m_{6}^{2}\;,\\ m_{67}&=&-\frac{1}{2}\left [-3\mu_{I}+2\mu_{S}+2(\tfrac{1}{2}\mu_{I}+\mu_{S}) \cos\alpha \right ]\;,\\ m_{8}^{2}&=&\left[\frac{1}{6}B_{0}(-m+3m_{s}+5(m+m_{s})\cos\alpha)+ \tfrac{3}{4}\left (\tfrac{1}{2}\mu_{I}+\mu_{S} \right )^{2}\sin^{2}\alpha \right]\;,\\ m_{38}^{2}&=&{1\over{{2}\sqrt{3}}}B_0(m+m_s)(\cos\alpha-1) +{\sqrt{3}\over4}\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\sin^2\alpha\;. \end{eqnarray} The quasiparticle dispersion relations can be easily found and read \begin{eqnarray} \label{kvasi3} E_{\pi^0}^2&=&p^2+{1\over2}(m_3^2+m_8^2)+{1\over2} \sqrt{(m_3^2-m_8^2)^2+4m_{38}^4} \;,\\ E_{\pi^{\pm}}^{2}&=&p^2+{1\over2}\left(m_{1}^{2}+m_{2}^{2}+m_{12}^{2}\right)\\ & \mp&{1\over2}\sqrt{4p^{2}m_{12}^{2}+(m_{1}^{2}+m_{2}^{2} +m_{12}^{2})^2-4m_{1}^{2}m_{2}^{2}}\;,\\ E_{K^{\pm}}^{2}&=&p^2+{1\over2}\left(m_{4}^{2}+m_{5}^{2}+m_{45}^{2}\right)\\ &\mp&{1\over2}\sqrt{4p^{2}m_{45}^{2}+(m_{4}^{2}+m_{5}^{2} +m_{45}^{2})^2-4m_{4}^{2}m_{5}^{2}}\;,\\ E_{K^0,\bar{K}^0}^{2}&=&p^2+{1\over2}\left(m_{6}^{2}+m_{7}^{2}+m_{67}^{2}\right)\\ &\mp&{1\over2}\sqrt{4p^{2}m_{67}^{2}+(m_{6}^{2}+m_{7}^{2} +m_{67}^{2})^2-4m_{6}^{2}m_{7}^{2}}\;,\\ E_{\eta^0}^2&=&p^2+{1\over2}(m_3^2+m_8^2)-{1\over2} \sqrt{(m_3^2-m_8^2)^2+4m_{38}^4}\;. \label{kvasi4} \end{eqnarray} The linear terms in the condensed phases are given by Eqs.~(\ref{linear}) and~(\ref{linear1}). By differentiation with respect to $\alpha$, it is straightforward to see that the terms vanish at the extremum of the corresponding static Lagrangian. \section{Next-to-leading order effective potential} \label{effpot22} In this section, we calculate the NLO effective potential in the three different phases we consider. At $\mathcal{O}(p^2)$, the contribution to the effective potential in each phase is given by evaluating $-{\cal L}_2^{\rm static}$ using $\Sigma_{\alpha}^{\pi^{\pm}}$, $\Sigma_{\alpha}^{K^{\pm}}$, or $\Sigma_{\alpha}^{K^{0}/\bar{K}^0}$. At $\mathcal{O}(p^4)$, there are two contributions to the effective potential. The first is the Gaussian fluctuations about the ground state, i.e. the standard one-loop contribution. The second is given by evaluating $-{\cal L}_4^{\rm static}$, again using $\Sigma_{\alpha}^{\pi^{\pm}}$, $\Sigma_{\alpha}^{K^{\pm}}$, or $\Sigma_{\alpha}^{K^{0}/\bar{K}^0}$. The one-loop contribution is ultraviolet divergent and needs regularization. We regularize the ultraviolet divergences using dimensional regularization in $d=3-2\epsilon$ dimensions. The divergences are cancelled by renormalizing the coupling constants that multiply the operators in ${\cal L}_4$. The sum of the three contributions is the complete effective potential to $\mathcal{O}(p^4)$ in $\chi$PT. After going to Euclidean space, the one-loop contribution to the effective potential of a free massive boson is given by \begin{eqnarray} V_1&=& {1\over2}\int_P\log\left[P^2+m^2\right]= {1\over2}\int{dp_0\over2\pi}\int_p\log\left[p_0^2+p^2+m^2\right]\;, \end{eqnarray} where $m$ is the mass and the second integral is defined in $d=3-2\epsilon$ dimensions as \begin{eqnarray} \int_{p}&=&\left (\frac{e^{\gamma_{E}}\Lambda^{2}}{4\pi} \right )^{\epsilon} \int \frac{d^{d}p}{(2\pi)^{d}}\;, \label{sumint} \end{eqnarray} and where $\Lambda$ is the renormalization scale associated with the modified minimal subtraction scheme ($\overline{\rm MS}$). Integrating over $P_0$, one finds \begin{eqnarray} \label{int1} V_1&=&{1\over2}\int_p\sqrt{p^2+m^2} =-{m^4\over4(4\pi)^2} \left({{\Lambda^2\over m^2}}\right)^{\epsilon} \left[{1\over\epsilon}+{3\over2}+{\cal O}(\epsilon)\right]\;. \end{eqnarray} \subsection{Normal phase} The leading-order contribution to the effective potential is minus the static Lagrangian given in Eq.~(\ref{nen}) \begin{eqnarray} V_0&=&-f^2B_0(2m+m_s) \;. \end{eqnarray} The one-loop contribution to the effective potential is \begin{eqnarray} V_1&=& {1\over2}\int_p\left[ E_{\pi^+}+E_{\pi^-}+E_{\pi^0} + E_{K^+}+E_{K^-}+E_{K^0}+E_{\bar{K}^0}+E_{\eta^0}\right]\;, \label{loopie} \end{eqnarray} where the particle energies are given by Eqs.~(\ref{nspec1})--(\ref{nspec2}). Using Eq.~(\ref{int1}), we can write Eq.~(\ref{loopie}) as \begin{eqnarray}\nonumber V_1&=& -{3\over4(4\pi)^{2}}\left [{1\over\epsilon}+\frac{3}{2} + \log\left (\frac{\Lambda^{2}}{{m_{\pi,0}^2}} \right ) \right ]\left[2B_0m\right]^2 \\ \nonumber &&-{1\over(4\pi)^{2}}\left [\frac{1}{\epsilon}+\frac{3}{2} + \log\left (\frac{\Lambda^{2}}{{m_{K,0}^2}} \right ) \right ]\left[B_0(m+m_s)\right]^2 \\ && -{1\over4(4\pi)^{2}}\left [\frac{1}{\epsilon}+\frac{3}{2} + \log\left (\frac{\Lambda^{2}}{{m_{\eta,0}^2}} \right ) \right ]\left[{2B_0(m+2m_s)\over3}\right]^2\;. \label{eftnormal} \end{eqnarray} The $\mathcal{O}(p^4)$ contribution from minus the static Lagrangian ${\cal L}_4^{\rm static}$ is given by \bq V_1^{\rm static}&=& -16L_6B_0^2(2m+m_s)^2-8L_8B_0^2(2m^2+m_s^2) -4H_2B_0^2(2m^2+m_s^2) \label{statcount1} \end{eqnarray} After renormalization, the effective potential is \begin{eqnarray}\nonumber V_{\rm eff}&=&-f^2B_0(2m+m_s) -16L_6^rB_0^2(2m+m_s)^2-8L_8^rB_0^2(2m^2+m_s^2) -4H_2^rB_0^2(2m^2+m_s^2) \\ && \nonumber -\left[ {1\over(4\pi)^2}\left({37\over18} +3\log{\Lambda^2\over m_{\pi,0}^2}+ \log{\Lambda^2\over m_{K,0}^2} +{1\over9}\log{\Lambda^2\over m_{\eta,0}^2} \right)\right]B_0^2m^2 \\ && \nonumber -\left[ {1\over(4\pi)^2}\left({11\over9} +2\log{\Lambda^2\over m_{K,0}^2} +{4\over9}\log{\Lambda^2\over m_{\eta,0}^2}\right)\right]B_0^2mm_s \\ & -\left[ {1\over(4\pi)^2}\left({13\over18} +\log{\Lambda^2\over m_{K,0}^2}+{4\over9}\log{\Lambda^2\over m_{\eta,0}^2} \right)\right]B_0^2m_s^2\;. \label{normal} \end{eqnarray} Using the renormalization group equations (\ref{rgeq}) for the couplings, we find that the effective potential is independent of the renormalization scale $\Lambda$. We note that the renormalized effective potential of Eq.~(\ref{normal}) is independent of the chemical potentials $\mu_I$ and $\mu_S$. This independence is a result that we expect will generalize at next-to-next-to-leading order (NNLO) and higher orders. This is due to a general argument, namely the Silver Blaze property, that shows the isospin independence of the eigenvalues of the Dirac operator at finite isospin density (in the normal phase)~\cite{cohen} and consequently the isospin independence of the partition function and resulting thermodynamic quantities. While the original proof in Ref.~\cite{cohen} did not include the strange chemical potential, we expect that it generalizes to systems with both isospin and strange chemical potentials. \subsection{Pion-condensed phase} The tree-level contribution to the effective potential is minus the static Lagrangian given in Eq.~(\ref{statlag1}) \begin{eqnarray} V_0&=&-f^2B_0(2m\cos\alpha+m_s)-{1\over2}f^2\mu_I^2\sin^2\alpha \;. \label{treepi} \end{eqnarray} The one-loop effective potential is \begin{eqnarray} V_{\rm1}&=&{1\over2}\int_p\left[ E_{\pi^+}+E_{\pi^-}+E_{\pi^0} + E_{K^+}+E_{K^-}+E_{K^0}+E_{\bar{K}^0}+E_{\eta^0} \right]\;. \end{eqnarray} where the energies are given by Eqs.~(\ref{kvasi1})--(\ref{kvasi2}). The integrals of $E_{\pi^0}$ and $E_{\eta^0}$ can be calculated analytically in dimensional regularization using Eq.~(\ref{int1}). The remaining contributions require a little more work. Let us consider the contribution from the charged pions. In order to eliminate the divergences, their dispersion relations are expanded in powers of $1/p$ as \begin{eqnarray} E_{\pi^+}+E_{\pi^-}= 2p+\frac{2(m_{1}^{2}+m_{2}^{2})+m_{12}^{2}}{4p} -\frac{8(m_{1}^{4}+m_{2}^{4})+4(m_{1}^{2}+m_{2}^{2})m_{12}^{2} +m_{12}^{4}}{64p^{3}}+\dots\;\;\;\;\;\;\;\; \label{expandp} \end{eqnarray} To this order, the large-$p$ behavior in Eq.~(\ref{expandp}) is the same as the sum $E_1+E_2$, where $E_1=\sqrt{p^2+m_1^2+\mbox{$1\over4$}m_{12}^2}$ and $E_2=\sqrt{p^2+m_2^2+\mbox{$1\over4$}m_{12}^2}$. For later convenience we introduce the masses $\tilde{m}_1^2=m_1^2+{1\over4}m_{12}^2=2B_0m\cos\alpha$, $\tilde{m}_2^2=m_2^2+{1\over4}m_{12}^2=2B_0m\cos\alpha+\mu_I^2\sin^2\alpha=m_3^2$, The integral over $E_{\pi^+}+E_{\pi^-}-E_1-E_2$ is convergent in the ultraviolet and the subtraction integrals of $E_1$ and $E_2$ can be done analytically in dimensional regularization. We can then write \begin{eqnarray} V_{1,\pi^+}+V_{1,\pi^-} &=&V_{{\rm 1},\pi^{+}}^{\rm div}+V_{{\rm 1},\pi^{-}}^{\rm div} + V_{{\rm 1},\pi^{+}}^{\rm fin}+V_{{\rm 1},\pi^{-}}^{\rm fin} \end{eqnarray} where \begin{eqnarray} V_{{\rm 1},\pi^{+}}^{\rm div}+V_{{\rm 1},\pi^{-}}^{\rm div} &=&{1\over2}\int_p\left[E_1+E_2\right] \;,\\ V_{{\rm 1},\pi^{+}}^{\rm fin}+V_{{\rm 1},\pi^{-}}^{\rm fin} &=&\frac{1}{2}\int_{p}\left [E_{\pi^+}+E_{\pi^-}-E_1-E_2\right ]\;. \end{eqnarray} The contributions from the kaons can be calculated analytically as follows. Consider first the contribution from the charged kaon which is given by \begin{eqnarray} V_{1,K^{+}}+V_{1,K^{-}} &=&{1\over2}\int_P\log \left[(P^2+m_4^2)(P^2+m_5^2)+p_0^2m_{45}^2\right]\;, \end{eqnarray} which can be rewritten as \begin{eqnarray} V_{1,K^{+}}+V_{1,K^{-}} &=&{1\over2}\int_P\log\left\{ \left[P^2+{1\over2}(m_4^2+m_5^2)\right]^2+p_0^2m_{45}^2 -{1\over4}(m_4^2-m_5^2)^2 \right\}\;. \end{eqnarray} Since $m_4=m_5$, the last term vanishes and the integrand can be factorized as \begin{eqnarray}\nonumber V_{1,K^{+}}+V_{1,K^{-}}&=& {1\over2}\int_P\log\left[\left(p_0+{im_{45}\over2}\right)^2+p^2+ m_4^2+{1\over4}m_{45}^2\right] \\ && \times\left[\left(p_0-{im_{45}\over2}\right)^2+p^2+ m_4^2+{1\over4}m_{45}^2\right] \;. \end{eqnarray} Shifting integration variables in the two terms, $p_0\rightarrow p_0\mp{im_{45}\over2}$, the integral simplifies to \begin{eqnarray} V_{1,K^{+}}+V_{1,K^{-}} &=&\int_P\log\left[P^2+m_4^2+{1\over4}m_{45}^2\right]\;. \end{eqnarray} The contribution from the neutral kaons is obtained simply by replacing $m_4$ by $m_6$ and $m_{45}$ by $m_{67}$. Since $\tilde{m}_2^2=m_3^2$ and by defining $\tilde{m}_4^2=m_4^2+{1\over4}m_{45}^2=m_6^2+{1\over4}m_{67}^2= B_0(m\cos\alpha+m_s)+{1\over4}\mu_I^2\sin^2\alpha$, we can write the divergent part of the one-loop contribution as \begin{eqnarray}\nonumber V_{\rm 1}^{\rm div} &=& -\frac{1}{4(4\pi)^{2}}\left [\frac{1}{\epsilon}+\frac{3}{2} + \log\left (\frac{\Lambda^{2}}{{\tilde{m}_1^2}} \right ) \right ]\left[2B_0m\cos\alpha\right]^2 \\ &&\nonumber -\frac{1}{2(4\pi)^{2}}\left [\frac{1}{\epsilon}+\frac{3}{2} + \log\left (\frac{\Lambda^{2}}{m_{3}^{2}} \right )\right ] \left[2B_0m\cos\alpha + \mu_{I}^2\sin^2\alpha\right]^2 \\ \nonumber &&-\frac{1}{(4\pi)^{2}}\left [\frac{1}{\epsilon}+\frac{3}{2} + \log\left (\frac{\Lambda^{2}}{\tilde{m}_4^{2}} \right )\right ] \left[B_0(m\cos\alpha+m_s)+\mbox{$1\over4$}\mu_{I}^{2}\sin^{2}\alpha\right]^2 \\ && -\frac{1}{4(4\pi)^{2}}\left [\frac{1}{\epsilon}+\frac{3}{2} + \log\left (\frac{\Lambda^{2}}{m_{8}^{2}} \right )\right ] \left[{2B_0(m\cos\alpha+2m_s)\over3}\right]^2 \label{divpi} \;, \end{eqnarray} The static part of the Lagrangian ${\cal L}_4$ as a function of $\alpha$ is \begin{eqnarray}\nonumber V_{1}^{\rm static} &=& -(4L_1+4L_2+2L_3)\mu_I^4\sin^4\alpha -8L_4B_0(2m\cos\alpha+m_s)\mu_I^2\sin^2\alpha \\ &&\nonumber -8L_5B_0m\mu_I^2 \cos\alpha\sin^2\alpha -16L_6B_0^2(2m\cos\alpha+m_s)^2 \\ && - 8L_8B_0^2(2m^2\cos2\alpha+m_s^2) -4H_2B_0^2(2m^2+m_s^2)\;. \label{statpi} \end{eqnarray} The renormalized one-loop effective potential $V_{\rm eff}=V_0+V_1+V_1^{\rm static}$ is given by the sum of Eqs.~(\ref{treepi}), ~(\ref{divpi}), and ~(\ref{statpi}) then reads \begin{eqnarray}\nonumber V_{\rm eff}&=&-f^2B_0(2m\cos\alpha+m_s) -{1\over2}f^2\mu_I^2\sin^2\alpha - (4{L}_1^r+4{L}_2^r+2{L}_3^r)\mu_I^4\sin^4\alpha \\ && \nonumber -8{L}_4^rB_0(2m\cos\alpha+m_s)\mu_I^2\sin^2\alpha - 8{L}_5^rB_0m\mu_I^2\cos\alpha\sin^2\alpha \\ && \nonumber - 16{L}_6^rB_0^2(2m\cos\alpha+m_s)^2 -8{L}_8^rB_0^2(2m^2\cos2\alpha+m_s^2)-4{H}_2^rB_0^2(2m^2+m_s^2) \\ \nonumber &&-\frac{1}{4(4\pi)^{2}}\left [\frac{1}{2} + \log\left (\frac{\Lambda^{2}}{{\tilde{m}_1^2}} \right ) \right ]\left[2B_0m\cos\alpha\right]^2 \\ \nonumber &&-\frac{1}{2(4\pi)^{2}}\left [ \frac{1}{2} + \log\left (\frac{\Lambda^{2}}{m_{3}^{2}} \right )\right ] \left[2B_0m\cos\alpha \mu_{I}^2\sin^2\alpha\right]^2 \\ \nonumber &&-\frac{1}{(4\pi)^{2}}\left [\frac{1}{2} + \log\left (\frac{\Lambda^{2}}{\tilde{m}_4^{2}} \right )\right ] \left[B_0(m\cos\alpha+m_s)+\mbox{$1\over4$}\mu_{I}^{2}\sin^{2}\alpha\right]^2 \\ &&-\frac{1}{4(4\pi)^{2}}\left [\frac{1}{2} + \log\left (\frac{\Lambda^{2}}{m_{8}^{2}} \right )\right ] \left[{2B_0(m\cos\alpha+2m_s)\over3}\right]^2 +V_{\rm 1,{\pi^{+}}}^{\rm fin} +V_{\rm 1,{\pi^{-}}}^{\rm fin} \;. \label{renpi} \end{eqnarray} Again, it can be verified that the NLO effective potential is independent of the scale $\Lambda$. It is also explicitly independent of the strangeness chemical potential $\mu_S$. \subsection{Charged kaon-condensed phase} The tree-level contribution to the effective potential is \begin{eqnarray} V_0&=&-f^2B_0\left[m+(m+m_s)\cos\alpha)\right] -{1\over2}f^2\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\sin^2\alpha\;. \end{eqnarray} The one-loop effective potential is \begin{eqnarray} V_{\rm1}&=&{1\over2}\int_p\left[ E_{\pi^+}+E_{\pi^-}+E_{\pi^0} + E_{K^+}+E_{K^-}+E_{K^0}+E_{\bar{K}^0}+E_{\eta^0} \right]\;. \end{eqnarray} The contributions from $\pi^{\pm}$, $K^{\pm}$, $K^{0}$ and $\bar{K}^{0}$ can be treated as in the previous section and it is only the terms $V_{1,K^{\pm}}$ that require a subtraction term. The relevant masses are defined as \begin{eqnarray} \tilde{m}_1^2&=&m_1^2+{1\over4}m_{12}^2= {1\over2}B_0[3m-m_s+(m+m_s)\cos\alpha] +{1\over4} \left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\sin^2\alpha \;,\\ \tilde{m}_4^2&=& m_4^2+{1\over4}m_{45}^2= B_0(m+m_s)\cos\alpha \;,\\ \label{m4tilde} \tilde{m}_5^2&=& m_5^2+{1\over4}m_{45}^2= B_0(m+m_s)\cos\alpha +\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\sin^2\alpha \label{m5tilde}\;,\\ \tilde{m}_6^2&=& m_6^2+{1\over4}m_{67}^2= \mbox{$1\over2$}B_0(m+m_s)(1+\cos\alpha) +{1\over4}\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\sin^2\alpha \;. \end{eqnarray} The contribution from the mixed $\pi^0$ and $\eta^0$ is given by \begin{eqnarray}\nonumber V_{1,\pi^0}+V_{1,\eta^0} &= {1\over2}\int_P\log\left[(P^2+m_3^2)(P^2+m_8^2)-m_{38}^4\right] \\ &=& {1\over2}\int_P\log\left[P^2+\tilde{m}_3^2]+\log[P^2+\tilde{m}_8^2\right] \;, \end{eqnarray} where the new masses are defined as \begin{eqnarray} \tilde{m}_{3,8}^2&=& {1\over2}\left[m_3^2+m_8^2\pm{\sqrt{(m_3^2-m_8^2)^2+4m_{38}^4}}\right]\;. \end{eqnarray} This yields \begin{eqnarray}\nonumber V_{\rm 1} &=& -\frac{1}{2(4\pi)^{2}}\left[\frac{1}{\epsilon}+{3\over2} \log\left (\frac{\Lambda^{2}}{\tilde{m}_{1}^{2}} \right )\right ] \left\{\mbox{$1\over2$}B_0[(3m-m_s+(m+m_s)\cos\alpha] \right.\\ &&\nonumber\left. +\mbox{$1\over4$} \left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\sin^2\alpha\right\}^2 \\ \nonumber &&-\frac{1}{4(4\pi)^{2}}\left [\frac{1}{\epsilon}+{3\over2}+ \log\left (\frac{\Lambda^{2}}{{\tilde{m}_4^2}} \right ) \right ]\left[B_0^2(m+m_s)^2\cos^2\alpha \right] \\ \nonumber &&-\frac{1}{4(4\pi)^{2}}\left [\frac{1}{\epsilon}+{3\over2}+ \log\left (\frac{\Lambda^{2}}{{\tilde{m}_5^2}} \right ) \right ]\left[B_0(m+m_s)\cos\alpha + \left(\mbox{$1\over2$} \mu_I+\mu_S\right)^2\sin^2\alpha\right]^2 \\ \nonumber &&-\frac{1}{2(4\pi)^{2}}\left [\frac{1}{\epsilon}+{3\over2}+ \log\left (\frac{\Lambda^{2}}{\tilde{m}_6^{2}} \right )\right ] \left[\mbox{$1\over2$}B_0(m+m_s)(1+\cos\alpha) + \mbox{$1\over4$} \left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\sin^2\alpha \right]^2 \\ &&-\frac{1}{4(4\pi)^{2}}\left [\frac{1}{\epsilon}+\frac{3}{2} + \log\left (\frac{\Lambda^{2}}{\tilde{m}_{3}^{2}} \right )\right]\tilde{m}_3^4 -\frac{1}{4(4\pi)^{2}}\left [\frac{1}{\epsilon}+\frac{3}{2} + \log\left (\frac{\Lambda^{2}}{\tilde{m}_{8}^{2}} \right )\right]\tilde{m}_8^4 \end{eqnarray} The static part of the Lagrangian ${\cal L}_4$ as a function of $\alpha$ is \begin{eqnarray}\nonumber V_1^{\rm static} &=& - (4L_1+4L_2+2L_3)\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^4\sin^4\alpha \\ && \nonumber -8L_4B_0[m+(m+m_s)\cos\alpha] \left(\mbox{$1\over2$} \mu_I+\mu_S\right)^2\sin^2\alpha \\ \nonumber&& -4L_5B_0(m+m_s)\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^{{2}}\cos\alpha \sin^2\alpha - 16L_6B_0^2[m+(m+m_s)\cos\alpha]^2 \label{lagstat} \\ && -4L_8B_0^2(3m^2 -2mm_s+m_s^2+(m+m_s)^2\cos2\alpha)-4H_2B_0^2(2m^2+m_s^2)\;. \end{eqnarray} After renormalization, the effective potential is \begin{eqnarray}\nonumber V_{\rm eff} &=& -f^2B_0\left[m+(m+m_s)\cos\alpha)\right] -\mbox{$1\over2$}f^2\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\sin^2\alpha \\ && \nonumber -(4{L}_1^r+4{L}_2^r+2{L}_3^r) \left(\mbox{$1\over2$}\mu_I+\mu_S\right)^4\sin^4\alpha \\ &&\nonumber -8{L}_4^rB_0[m+(m+m_s)\cos\alpha] \left(\mbox{$1\over2$} \mu_I+\mu_S\right)^2\sin^2\alpha \\ \nonumber&& -4{L}_5^rB_0(m+m_s)\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\cos\alpha \sin^2\alpha - 16{L}_6^rB_0[m+(m+m_s)\cos\alpha]^2 \\ && \nonumber -4{L}_8^rB_0^2(3m^2 -2mm_s+m_s^2+(m+m_s)^2\cos2\alpha)-4{H}_2^rB_0^2(2m^2+m_s^2) \\ && \nonumber -\frac{1}{2(4\pi)^{2}}\left[{1\over2}+ \log\left (\frac{\Lambda^{2}}{\tilde{m}_{1}^{2}} \right )\right ] \Big\{\mbox{$1\over2$}B_0[(3m-m_s+(m+m_s)\cos\alpha] +\mbox{$1\over4$} \left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\sin^2\alpha\Big\}^2 \\ \nonumber &&-\frac{1}{4(4\pi)^{2}}\left [{1\over2}+ \log\left (\frac{\Lambda^{2}}{{\tilde{m}_4^2}} \right ) \right ]\left[ B_0^2(m+m_s)^2\cos^2\alpha\right] \\ \nonumber &&-\frac{1}{4(4\pi)^{2}}\left [{1\over2}+ \log\left (\frac{\Lambda^{2}}{{\tilde{m}_5^2}} \right ) \right ]\left[B_0(m+m_s)\cos\alpha + \left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2 \sin^2\alpha\right]^2 \\ \nonumber &&-\frac{1}{2(4\pi)^{2}}\left [ {1\over2}+ \log\left (\frac{\Lambda^{2}}{\tilde{m}_6^{2}} \right )\right ] \left[\mbox{$1\over2$}B_0(m+m_s)(1+\cos\alpha) + \mbox{$1\over4$} \left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\sin^2\alpha \right]^2 \\ \nonumber &&-\frac{1}{4(4\pi)^{2}}\left [ \frac{1}{2} + \log\left (\frac{\Lambda^{2}}{\tilde{m}_{3}^{2}} \right )\right]\tilde{m}_3^4 -\frac{1}{4(4\pi)^{2}}\left [ \frac{1}{2} + \log\left (\frac{\Lambda^{2}}{\tilde{m}_{8}^{2}} \right )\right]\tilde{m}_8^4 +V_{1,{K^{+}}}^{\rm fin} +V_{1,{K^{-}}}^{\rm fin}\;, \\ && \label{nlok} \end{eqnarray} where the subtraction terms and energies are defined by \begin{eqnarray} V_{1,{K^{+}}}^{\rm fin} +V_{1,{K^{-}}}^{\rm fin}&=& {1\over2}\int_p\left[E_{K^{+}}+E_{K^-}-E_4-E_5 \right]\;, \\ E_{4,5}&=&\sqrt{p^2+\tilde{m}_{4,5}^2}\;, \end{eqnarray} with $\tilde{m}_{4,5}$ given by Eqs.~(\ref{m4tilde})--(\ref{m4tilde}). The effective potential depends only on the combination $|\mbox{$1\over2$}\mu_I+\mu_S|$ as is evident by inspection. Using the expressions for the running couplings, Eq.~(\ref{rgeq}), the scale dependence in the final results for the effective potential, Eqs.~(\ref{normal}), ~(\ref{renpi}), and ~(\ref{nlok}) cancels. \section{Thermodynamic functions} In this section, we derive various thermodynamic functions from the effective potential. We will focus on the pion-condensed phase since we are interested in comparing our results with lattice simulations. \subsection{Pion-condensed phase} The pressure $P$ is given by $-V_{\rm eff}$. In the pion-condensed phase, we get from Eq.~(\ref{renpi}) \begin{eqnarray} \nonumber P&=&f^2B_0(2m\cos\alpha+m_s)+{1\over2}f^2\mu_I^2\sin^2\alpha \\ && \nonumber +\left[4{L}_1^r+4{L}_2^r+2{L}_3^r +{1\over16(4\pi)^2}\left({9\over2}+8\log{\Lambda^2\over m_3^2} +\log{\Lambda^2\over\tilde{m}_4^2}\right) \right]\mu_I^4\sin^4\alpha \\ && \nonumber +\left[8{L}_4^{r} +{1\over2(4\pi)^2}\left({1\over2}+\log{\Lambda^2\over\tilde{m}_4^2}\right) \right] B_0(2m\cos\alpha+m_s)\mu_I^2\sin^2\alpha \\ && \nonumber +\left[8{L}_5^{r} +{1\over2(4\pi)^2}\left({3\over2}+4\log{\Lambda^2\over m_3^2} -\log{\Lambda^2\over\tilde{m}_4^2}\right) \right] B_0m\mu_I^2\cos\alpha\sin^2\alpha \\ && \nonumber +\left[ 16L_6^r+8L_8^r+4H_2^r +{1\over(4\pi)^2}\left({13\over18} +\log{\Lambda^2\over\tilde{m}_4^2} +{4\over9}\log{\Lambda^2\over m_8^2}\right)\right]B_0^2m_s^2 \\ && \nonumber +\left[ 64L_6^r +{1\over(4\pi)^2}\left({11\over9} +2\log{\Lambda^2\over\tilde{m}_4^2} +{4\over9}\log{\Lambda^2\over m_8^2} \right)\right] B_0^2mm_s\cos\alpha \\ && \nonumber +\left[ 64L_6^r+16L_8^r+8H_2^r +{1\over(4\pi)^2}\left({37\over18} +\log{\Lambda^2\over\tilde{m}_1^2}+ \right.\right. \\ &&\left.\left. \nonumber +2\log{\Lambda^2\over m_3^2}+ \log{\Lambda^2\over\tilde{m}_4^2} +{1\over9}\log{\Lambda^2\over m_8^2} \right)\right]B_0^2m^2\cos^2\alpha -\left[16L_8^r-8H_2^r\right]B_0^2m^2\sin^2\alpha \\ && -V_{\rm 1,{\pi^{+}}}^{\rm fin} -V_{\rm 1,{\pi^{-}}}^{\rm fin}\;, \label{renpi2} \end{eqnarray} The isospin density is given by \begin{eqnarray}\nonumber n_I&=&-{\partial V_{\rm eff}\over\partial\mu_I}\\ \nonumber &=& \nonumber f^2\mu_I\sin^2\alpha +\left[16L_1^r+16L_2^r+8L_3^r +{1\over{4(4\pi)^2}}\left({8}\log{\Lambda^2\over m_3^2} +\log{\Lambda^2\over\tilde{m}_4^2}\right)\right]\mu_I^3\sin^4\alpha \\ && \nonumber +\left[{16}L_4^ +{{1}\over{(4\pi)^2}} \log{\Lambda^2\over\tilde{m}_4^2}\right] B_0(2m\cos\alpha+m_s)\mu_I\sin^2\alpha \\ && +\left[{16}L_5^r+{1\over{(4\pi)^2}}\left( 4\log{\Lambda^2\over{m}_3^2} -\log{\Lambda^2\over\tilde{m}_4^2}\right) \right] B_0m\mu_I\cos\alpha\sin^2\alpha -{\partial V_{\rm 1,{\pi^{+}}}^{\rm fin}\over\partial\mu_I} -{\partial V_{\rm 1,{\pi^{-}}}^{\rm fin}\over\partial\mu_I} \;. \label{isos} \end{eqnarray} The energy density is given by \begin{eqnarray} \epsilon&=&-P+\mu_in_i\;. \end{eqnarray} where $n_i=-{\partial V_{\rm eff}\over\partial\mu_i}$ is the charge density associated with the chemical potential $\mu_i$. In the pion-condensed phase it takes the following form \begin{eqnarray} \epsilon&=&-P+\mu_In_I\;. \end{eqnarray} since the effective potential is independent of $\mu_S=0$ in this phase. Using Eqs.~(\ref{renpi}) and~(\ref{isos}), we find the following energy density \begin{eqnarray}\nonumber \epsilon&=& -f^2B_0(2m\cos\alpha+m_s) +{1\over2}f^2\mu_I\sin^2\alpha \\ &&\nonumber +\left[12L_1^r+12L_2^r+6L_3^r+{1\over{(4\pi)^2}} \left(-{9\over32}+{{\frac{3}{2}}}\log{\Lambda^2\over m_3^2} +{3\over16}\log{\Lambda^2\over\tilde{m}_4^2}\right)\right]\mu_I^4\sin^4\alpha \\ && \nonumber +\left[{8}L_4^r+{1\over2{(4\pi)^2}} \left({-\frac{1}{2}} +\log{\Lambda^2\over\tilde{m}_4^2}\right)\right] B_0(2m\cos\alpha+m_s)\mu_I^2\sin^2\alpha \\ && \nonumber +\left[{8}L_5^r+{1\over{2(4\pi)^2}}\left({-{3\over 2}}+ 4\log{\Lambda^2\over{m}_3^2}- \log{\Lambda^2\over\tilde{m}_4^2}\right) \right] B_0m\mu_I^2\cos\alpha\sin^2\alpha \\ \nonumber&& - \left[ 16L_6^r+8L_8^r+4H_2^r +{1\over(4\pi)^2}\left({13\over18} +\log{\Lambda^2\over\tilde{m}_4^2} +{4\over9}\log{\Lambda^2\over m_8^2} \right)\right]B_0^2m_s^2 \\ && \nonumber -\left[ 64L_6^r +{1\over(4\pi)^2}\left({11\over9} +2\log{\Lambda^2\over\tilde{m}_4^2} +{4\over9}\log{\Lambda^2\over m_8^2} \right)\right] B_0^2mm_s\cos\alpha \\ && \nonumber -\left[ 64L_6^r+16L_8^r+8H_2^r +{1\over(4\pi)^2}\left({37\over18} +\log{\Lambda^2\over\tilde{m}_1^2} +2\log{\Lambda^2\over m_3^2} + \log{\Lambda^2\over\tilde{m}_4^2} +{1\over9}\log{\Lambda^2\over m_8^2}\right)\right] \\ && \times B_0^2m^2\cos^2\alpha +V^{\rm fin}_{\rm 1,{\pi^{+}}}+V^{\rm fin}_{\rm 1,{\pi^{-}}} -\mu_I{\partial V_{\rm 1,{\pi^{+}}}^{\rm fin}\over\partial\mu_I} -\mu_I{\partial V_{\rm 1,{\pi^{-}}}^{\rm fin}\over\partial\mu_I} \label{eos0} \;, \end{eqnarray} \subsection{Large-$m_s$ limit} \label{mapping} We are interested in the large-$m_s$ limit of our three-flavor results for thermodynamic quantities. In this limit, general effective field theory arguments tell us that the mesonic degrees of freedom containing the $s$-quark decouple. Thus one should recover the two-flavor results of Ref.~\cite{us} with modified couplings. The modified couplings then contain the loop effects from integrating out kaons and the eta. The one-loop expressions for the pion-decay constant and the light-quark condensate in the vacuum are given by~\cite{gasser2} \begin{eqnarray} \label{fpi0} f_{\pi}^2 &=&f^2\left[1 +\left(8{L}_4^r +8L_5^r+{2\over(4\pi)^2}\log{\Lambda^2\over m_{\pi,0}^2} \right){m_{\pi,0}^2\over f^2} +\left(16L_4^r+{1\over(4\pi)^2} \log{\Lambda^2\over m_{K,0}^2} \right){m_{K,0}^2\over f^2} \right] \\ \nonumber \langle\bar{\psi}\psi\rangle&=&-f^2B_0\left[ 1+ \left(16L_6^r+4L_8^r+4H_2^r + {3\over2(4\pi)^2}\log{\Lambda^2\over m_{\pi,0}^2} \right){m_{\pi,0}^2\over f^2} \right.\\ &&\left. +\left( 32L_6^r+{1\over(4\pi)^2} \log{\Lambda^2\over m_{K,0}^2} \right){m_{K,0}^2\over f^2} +{m_{\eta,0}^2\over6(4\pi)^2f^2}\log{\Lambda^2\over m_{\eta,0}^2} \right]\;. \end{eqnarray} The loop corrections involve pions, kaons, and etas. Integrating out the $s$-quark corresponds to setting $m=0$ or ignoring the pionic loop corrections. This yields \begin{eqnarray} \tilde{f}^2&=&f^2\left[1+ \left(16L_4^r +{1\over(4\pi)^2}\log{\Lambda^2\over \tilde{m}_{K,0\textrm{}}^2}\right) {\tilde{m}_{K,0}^2\over f^2} \right]\;, \label{rel5} \\ \langle\bar{\psi}\psi\rangle&=&-f^2B_0\left[1 +\left( 32L_6^r+{1\over(4\pi)^2} \log{\Lambda^2\over \tilde{m}_{K,0}^2} \right){\tilde{m}_{K,0}^2\over f^2} +{\tilde{m}_{\eta,0}^2\over6(4\pi)^2f^2}\log{\Lambda^2\over \tilde{m}_{\eta,0}^2} \right]\;, \end{eqnarray} where the masses are $\tilde{m}_{K,0}^2=B_0m_s$ and $\tilde{m}_{\eta,0}^2={4B_0m_s\over3}$. Defining $\tilde{B}_0$ via $\langle\bar{\psi}\psi\rangle=-\tilde{f}^2\tilde{B}_0$ yields \begin{eqnarray} \tilde{B}_0&=&B_0\left[ 1-\left(16L_4^r-32L_6^r\right) {\tilde{m}_{K,0}^2\over f^2} +{\tilde{m}_{\eta,0}^2\over6(4\pi)^2f^2}\log{\Lambda^2\over \tilde{m}_{\eta,0}^2} \right]\;. \label{rel6} \end{eqnarray} Using the renormalization group equations for $L_4^r$ and $L_6^r$, one verifies that Eqs.~(\ref{rel5}) and~(\ref{rel6}) are independent of the scale $\Lambda$. Moreover, in Ref.~\cite{gasser2}, the authors derived the relations among the renormalized couplings in two - and three-flavor $\chi$PT. The relevant relations are \bq l_1^r&=&4L_1^r+2L_3^r +{1\over48(4\pi)^2} \left[\log{\Lambda^2\over\tilde{m}_{K,0\textrm{}}^2}-1\right]\;, \label{rel0} \\ l_2^r&=&4L_2^r +{1\over24}{1\over(4\pi)^2} \left[\log{\Lambda^2\over\tilde{m}_{K,0\textrm{}}^2}-1\right]\;, \label{rel1} \\ l_3^r&=&-8L_4^r-4L_5^r+16L_6^r+8L_8^r +{1\over36(4\pi)^2} \left[\log{\Lambda^2\over\tilde{m}_{\eta,0\textrm{}}^2}-1\right]\;, \\ l_4^r&=&8L_4^r+4L_5^r+{1\over4(4\pi)^2}\left[ \log{\Lambda^2\over\tilde{m}_{K,0\textrm{}}^2}-1\right]\;, \\ h_1^r&=&8L_4^r+4L_5^r-4L_8^r+2H_2^r +{1\over4(4\pi)^2}\left[ \log{\Lambda^2\over\tilde{m}_{K,0\textrm{}}^2}-1\right]\;. \label{rel4} \end{eqnarray} The relations between the renormalized couplings $l_i^r,h_i^r$ and the low-energy constants $\bar{l}_i, \bar{h}_i$ in two-flavor $\chi$PT are \begin{eqnarray} l_i^r(\Lambda)&=&{\gamma_i\over2(4\pi)^2} \left[\bar{l}_i+\log{2B_0m\over\Lambda^2}\right]\;, \hspace{1cm} h_i^r(\Lambda)={\delta_i\over2(4\pi)^2} \left[\bar{h}_i+\log{2B_0m\over\Lambda^2}\right]\;, \label{lirlbare} \end{eqnarray} where $\gamma_1={1\over3}$, $\gamma_2={2\over3}$, $\gamma_3=-{1\over2}$, $\gamma_4=2$, and $\delta_1=2$~\cite{gasser1}. Using the renormalization group equations for renormalized couplings, one finds that the $\Lambda$-dependence are the same on the left - and right-hand sides of Eqs.~(\ref{rel0})--(\ref{rel4}). The large-$m_{s}$ limit of Eqs.~(\ref{renpi2}),~(\ref{isos}), and~(\ref{eos0}) are then obtained as follows. We expand them in powers of $1/m_s$, express the result using Eqs.~(\ref{rel5}), and (\ref{rel6})--(\ref{lirlbare}). The pressure is \begin{eqnarray}\nonumber P&=&2\tilde{f}^{2}\tilde{B}_0m\cos\alpha+\frac{1}{2}\tilde{f}^{2}\mu_{I}^{2} \sin^{2}\alpha +{4\over(4\pi)^2}\left[-\bar{h}_1+\bar{l}_1\right]B_0^2m^2 \\ && \nonumber +\frac{1}{(4\pi)^{2}}\left [\frac{3}{2}-\bar{l}_{3} +{4}\bar{l}_{4} +\log\left({2B_0m\over \tilde{m}_1^2}\right) + {2}\log{2B_0m\over m_3^2}\right ]B_0^2m^{2}\cos^{2}\alpha \\&& \nonumber +\frac{1}{(4\pi)^{2}} \left [{1\over2}+\bar{l}_{4} + \log{2B_0m\over m_3^2}\right ] m^{2}\mu_{I}^{2}\cos\alpha\sin^{2}\alpha \\ && +\frac{1}{2(4\pi)^{2}}\left [{1\over2} +\frac{1}{3}\bar{l}_{1}+\frac{2}{3}\bar{l}_{2} + \log{2B_0m\over m_3^2}\right ]\mu_{I}^{4}\sin^{4}\alpha -V_{{\rm 1},\pi^+}^{\rm fin}-V_{{\rm 1},\pi^-}^{\rm fin} \;, \label{effpotnlo} \end{eqnarray} the isospin density is \begin{eqnarray}\nonumber n_{I}&=& \nonumber \tilde{f}^2\mu_I\sin^2\alpha +{2\over(4\pi)^2}\left \bar{l}_4+\log{2B_0m\over m_3^2}\right] 2B_0m\mu_I\cos\alpha\sin^2\alpha \\ &&+{2\over(4\pi)^2}\left {1\over3}\bar{l}_1+{2\over3}\bar{l}_2+ \log{2B_0m\over m_3^2}\right]\mu_I^3\sin^4\alpha -\mu_I{\partial V_{{\rm 1},\pi^+}^{\rm fin} \over\partial\mu_I} -\mu_I{\partial V_{{\rm 1},\pi^-}^{\rm fin} \over\partial\mu_I}\;, \end{eqnarray} and the energy density is \begin{eqnarray}\nonumber \epsilon&=& \nonumber -2\tilde{f}^2\tilde{B}_0m\cos\alpha +{1\over2}\tilde{f}^2\mu_I^2\sin^2\alpha \\ &&\nonumber -{4\over(4\pi)^2}\left[-\bar{h}_1+\bar{l}_1\right]B_0^2m^2 -\frac{1}{(4\pi)^{2}}\left [\frac{3}{2}-\bar{l}_{3} +{4}\bar{l}_{4} +\log\left({2B_0m\over\tilde{m}_1^2}\right) + {2}\log\left({2B_0m\over m_3^2}\right) \right ]B_0^2m^{2}\cos^{2}\alpha \\ && \nonumber -{1\over(4\pi)^2}\left[{1\over2}-\bar{l}_4 -\log{2B_0m\over m_3^2}\right] 2B_0m\mu_I^2\cos\alpha\sin^2\alpha \\ \nonumber &&-{1\over2(4\pi)^2}\left[{1\over2} -\bar{l}_1-2\bar{l}_2- 3\log{2B_0m\over m_3^2}\right] \mu_I^4\sin^4\alpha +V_{{\rm 1},\pi^+}^{\rm fin}+V_{{\rm 1},\pi^-}^{\rm fin} -\mu_I{\partial V_{{\rm 1},\pi^+}^{\rm fin} \over\partial\mu_I} -\mu_I{\partial V_{{\rm 1},\pi^-}^{\rm fin} \over\partial\mu_I}\;. \\ && \end{eqnarray} Up to different notation ($2B_0m\rightarrow m^2$), the results for $P$, $n_I$, and $\epsilon$ are of the same form as the two-flavor results derived in~\cite{us} with renormalized parameters $\tilde{B}_0$ and $\tilde{f}$. (In two-flavor $\chi$PT $m$ is the tree level pion mass.~\cite{us}) \section{Results and discussion} In this section, we calculate and study the (tree-level) quasiparticle masses, isospin density, pressure and the equation of state. In order to evaluate these quantities, we need the numerical values of the low-energy constants ($L_i$) as well as the meson masses and decay constants. The low-energy constants have been determined experimentally, with the following values and uncertainties at the scale $\mu=m_{\rho}$, where $\Lambda^2=4\pi e^{-\gamma_E}\mu^2$~\cite{bijnensreview}, where $m_{\rho}$ is the mass of the $\rho$ meson, \begin{align} {L}_{1}^r&=(1.0\pm 0.1)\times10^{-3}\;,& {L}_{2}^r&=(1.6\pm 0.2)\times10^{-3}\;,\\ {L}_{3}^r&=(-3.8\pm 0.3)\times10^{-3}\;, &{L}_{4}^r&=(0.0 \pm 0.3)\times10^{-3}\;, \\ {L}_{5}^r&=(1.2 \pm 0.1)\times10^{-3}\; &{L}_{6}^r&=(0.0 \pm 0.4)\times10^{-3}\;,\\ {L}_{7}^r&=(-0.4 \pm 0.2)\times10^{-3}\; &{L}_{8}^r&=(0.5 \pm 0.2)\times10^{-3}\;. \label{LECs} \end{align} Since we are mainly interested in comparing our results to the predictions of the lattice simulations in Refs.~\cite{gergy1}, we will use their values for the pion and kaon masses as well as the pion and kaon decay constants. With uncertainties, they are given by~\cite{private} \begin{align} m_{\pi}&=131\pm3\text{MeV}\;,& m_{K}=481\pm10\text{MeV}\;, \\ f_{\pi}&={128\pm3\over\sqrt{2}} \text{MeV}\;, & f_{K}={150\pm3\over\sqrt{2}} \text{MeV}\;. \label{latticeval} \end{align} These uncertainties (in the masses and decay constants) arise due to lattice discretization errors and consequently differ slightly from their experimental values. Since we have three parameters in the Lagrangian, $B_0m$, $B_0m_s$, and $f$, we need to pick three observables from the set above, and we choose $m_{\pi}$, $m_K$, and $f_{\pi}$. The relevant meson masses and the pion decay constants at one-loop are given by Eqs.~(\ref{mpi}), ~(\ref{mk}), and~(\ref{fpi}) in terms of the parameters $B_0m$, $B_0m_s$ and $f$ at next-to-leading order. Using the lattice values given above, we can solve for $B_0m$, $B_0m_s$, and $f$. This yields \begin{align} \label{treevals} f^{\rm cen}&=75.16\;{\rm MeV}\;, f^{\rm low}=79.88\;{\rm MeV}\;, f^{\rm high}=70.44\;{\rm MeV}\;,\\ m_{\pi,\rm tree}^{\rm low}&=148.45\;{\rm MeV}\;, m_{\pi,\rm tree}^{\rm cen}=131.28\;{\rm MeV}\;, m_{\pi,\rm tree}^{\rm high}=115.93\;{\rm MeV}\;,\\ m_{K,\rm tree}^{\rm cen}&=520.65\;{\rm MeV}\;, m_{K,\rm tree}^{\rm low}=617.35\;{\rm MeV}\;, m_{K,\rm tree}^{\rm high}=437.84\;{\rm MeV}\;, \end{align} where the subscripts indicate that the values correspond to the central, minimum, and maximum values of the low-energy constants. Using the one-loop $\chi$PT expression for the $f_K$, Eq.~(\ref{fk}), we find $f_K=113.9$ MeV for the central values, which is off by approximately 7\% compared to the lattice value of $f_K={150\over\sqrt{2}}=106.1$ MeV. The uncertainties in the LECs, $L_{i}^{r}$, the pion mass, $m_{\pi}$, the pion decay constant, $f_{\pi}$, and the kaon mass, $m_{K}$, lead to uncertainties in $B_{0}m$, $B_{0}m_{s}$ and $f$. These uncertainties are dominated by the uncertainties in the LECs with the uncertainty in the lattice parameters contributing the least. Additionally, it turns out that the lowest values of LECs calculated after including the LEC uncertainty leads to unphysical values of the $\eta$ mass. As such we were forced to choose the lowest values of the LECs using 0.46 times the uncertainties leading to the results in Eq.~(\ref{treevals}). The thermodynamic quantities are functions of the effective potential evaluated at its minimum as a function of $\alpha$ for given values of the isospin and strange chemical potentials. Hence, we must solve the equation \begin{eqnarray} {\partial V_{\text{eff}}\over\partial\alpha}&=&0\;. \label{alphi1} \end{eqnarray} In Fig.~\ref{alphi}, we show the solution to Eq.~(\ref{alphi1}) as function of the isospin chemical potential $\mu_I$ and $\mu_S=0$. The red curve is the tree-level result, while the blue curve is the one-loop result in two-flavor $\chi$PT, the green curve is the one-loop result in three-flavor $\chi$PT and the brown curve is the one-loop result in two-flavor $\chi$PT using three-flavor LECs. In Section~\ref{pideos}, we use $\alpha_{\rm gs}$ to calculate the pressure, isospin density and the equation of state. \begin{figure}[htb] \centering \includegraphics[width=0.45\textwidth]{muvsalpha.pdf} \caption{$\alpha_{\rm gs}$ as a function of $\mu_I/m_{\pi}$ at LO (red), at NLO with two flavors (blue), NLO with three flavors (green), and NLO with two flavors and three-flavor LECs (brown). See main text for details.} \label{alphi} \end{figure} \subsection{Phase diagram} \label{pd} We find that $\alpha_{\rm gs}$ becomes non-zero when $|\mu_{I}|>m_{\pi}$. In order to show that the transition from the vacuum phase to the Bose-condensed phase occurs at a critical chemical potential equal to the physical pion mass, we expand the effective potential in a power series in $\alpha$ around $\alpha=0$ up to order $\alpha^4$ to obtain an effective Landau-Ginzburg energy functional~\cite{split2}, \begin{eqnarray} V_{\rm eff}^{\rm LG}&=&a_0+a_2\alpha^2 +a_4\alpha^4+{\cal O}(\alpha^6)\;. \end{eqnarray} As pointed out before, in the charged pion-condensed phase, $V_{\rm eff}$ and therefore the coefficients are independent of $\mu_S$. Similarly, in the charged kaon-condensed phase, they only depend on the combination ${1\over2}\mu_I+\mu_S$, and in the neutral kaon-condensed phase, only on the combination $-{1\over2}\mu_I+\mu_S$, Using the expressions for the pion mass $m_{\pi}$ (\ref{mpi}) and the pion-decay constant $f_{\pi}$, (\ref{fpi}), it can be shown that in the pion-condensed phase (see Ref.~\cite{us} for details) \begin{eqnarray} a_2(\mu_I)&=& {1\over2}f_{\pi}^2\left[m_{\pi}^2-\mu_I^2\right]\;. \label{a2} \end{eqnarray} The critical isospin chemical potential $\mu_I^c$ is defined by the vanishing of $a_2(\mu_I)$, and Eq.~(\ref{a2}) shows that $|\mu_I^c|=m_{\pi}$. Moreover, using the techniques in Ref.~\cite{split2} it can be shown that $a_4(\mu_I^c)>0$, implying that the the transition from the vacuum phase to a pion-condensed phase is second order located at $\mu_I^c=\pm m_{\pi}$.~\footnote{If $a_4(\mu_I^c)<0$, the transition is first order.} Similarly, in the charged kaon-condensed phase, we find \begin{eqnarray} a_2(\mbox{$1\over2$}\mu_I+\mu_{S})&=&\frac{1}{2}f_{K}^{2} \left[m_K^2-\left(\mbox{$1\over2$}\mu_I+\mu_S\right)^2\right] \;, \end{eqnarray} where $m_K$ is the physical kaon mass, whose one-loop expression is given by Eq.~(\ref{mk}). The critical chemical potential is again given by the vanishing of $a_2$, i.e. $|\mbox{$1\over2$}\mu_I+\mu_S|=m_K$ The coefficient of the order $\alpha^4$ term can be shown to be positive when evaluated at ${1\over2}\mu_I+\mu_S=m_K$. This shows there is a second-order transition to a kaon-condensed phase at $\mbox{$1\over2$}\mu_I+\mu_S=\pm m_K$. For the transition to a neutral kaon-condensed phase, we have $-\mbox{$1\over2$}\mu_I+\mu_S=\pm m_K$. While the transitions from the vacuum to either a pion-condensed phase or a kaon-condensed phase are second order, the transition between the two Bose-condensed phases is first order. At leading, this is straightforward to see. For example the pion and kaon condensates are given by \begin{eqnarray} \langle\pi^+\rangle&=&2f^2B_0\sin\alpha =2f^2B_0\sqrt{1-{m_{\pi}^4\over\mu_I^4}}\;, \mu_I>m_{\pi} \\ \langle K^+\rangle&=&2f^2B_0\sin\alpha =2f^2B_0\sqrt{1-{m_{K}^4\over(\mbox{$1\over2$}\mu_I+\mu_S)^4}} \;,\mbox{$1\over2$}\mu_I+\mu_S>m_K \;. \end{eqnarray} For any $\mu_I>m_{\pi}$ and $\mbox{$1\over2$}\mu_I+\mu_S>m_K$, these condensates jump discontinuously to zero as we cross the phase line. The transition line itself is given by the equality of the pressures in the two phases. While it is possible to find this line analytically at tree level as shown in Eq.~(\ref{phaseline}), in order to find the line at NLO, we need to compare the pressure in the pion and kaon condensed phases, which can only be done numerically. We have performed this calculation for the central values from Eqs.~(\ref{LECs}) and (\ref{latticeval}). In Fig.~\ref{diagram} we show the phase diagram in the $\mu_I$--$\mu_S$ plane with the first order transition line increasing to higher strange chemical potential for all values of the isospin chemical potential greater than the pion mass. The vacuum phase is in the region bounded by the straight lines $\mu_I=\pm m_{\pi}$, $\mu_S=\pm({1\over2}\mu_I+m_K)$, and $\mu_S=\pm(-{1\over2}\mu_I+m_K)$. The corners from where the first-order lines emerge are located at $(\mu_I,\mu_S)=(\pm131,\pm415.5)$ MeV. The solid lines represent second-order transitions while the dashed line indicates the tree level first-order transition and the green dot dashed line indicates the NLO first-order transition. In the vacuum phase, the thermodynamic functions are independent of the isospin and strange chemical potentials. This is an example of the so-called Silver Blaze property~\cite{cohen}. \begin{figure}[htb] \centering \includegraphics[scale=.8]{phase.pdf} \caption{Phase diagram in the $\mu_I$--$\mu_S$ plane at $T=0$. Solid lines represent second-order transitions while the red dashed lines are the tree level first-order transitions and the green dot-dashed lines are the NLO first-order transitions. The normal phase has vanishing meson condensates and the meson condensate that becomes non-zero is indicated in each region.} \label{diagram} \end{figure} \subsection{Medium-dependent masses} In this subsection, we will briefly discuss the medium-dependent masses. We restrict ourselves to a leading-order calculation, i.e. we consider the tree-level dispersion relations evaluated at $p^2=0$. In the pion-condensed phase, they are given by Eqs.~(\ref{kvasi1})--(\ref{kvasi2}). In the kaon-condensed phase, they are given by Eqs.~(\ref{kvasi3})--(\ref{kvasi4}). In the left panel of Fig.~\ref{mediumdepmass}, we show the medium-dependent masses as a function of the isospin chemical potential $\mu_I$ for fixed strange chemical potential $\mu_S=200$ MeV. For $\mu_I=0$, we are in the normal phase, the pion masses take on their vacuum values, while the kaons are degenerate in pairs. The mass of $\pi^+$ decreases as we increase $\mu_I$ and vanishes when $\mu_I=m_{\pi}$ and enter the pion-condensed phase. At $\mu_I=m_{\pi}$, the masses vary continuously reflecting the second-order nature of the transition. We also note that the mass of $\eta^0$ is independent of $\mu_I$, which follows directly from Eq.~(\ref{kvasi2}). Finally, for asymptotically large values of $\mu_I$, the kaons and pions are pairwise degenerate. In the right panel of Fig.~\ref{mediumdepmass}, we show the medium-dependent masses as a function of isospin chemical potential $\mu_I$ for fixed strange chemical potential $\mu_S=460$ MeV. At $\mu_I=0$, we are in the vacuum phase. The kaons are again degenerate in pairs, the pions are also degenerate taking on their vacuum values. We enter the kaon-condensed phase at $\mu_I=42$ MeV, which is a second-order transition. In this phase, $K^+$ is the Goldstone mode associated with the spontaneous breakdown of the $U(1)$-symmetry. As we increase the isospin chemical potential past approximately $\mu_I=268$ MeV, we enter the pion-condensed phase. In this phase, $\pi^+$ is the Goldstone mode associated with the spontaneous breakdown of the $U(1)_{I_3}$-symmetry. This first-order nature of the transition can be seen by the jumps in the quasiparticle masses. Finally, we also note that in the charged pion and kaon condensed phases the mass eigenstates do not coincide with the charge eigenstates~\cite{intrigue}. It is easy to see using the form of the inverse propagators in Eqs.~(\ref{quad}) and (\ref{quad1}) that in the condensed phases the mass eigenstates can be found using momentum-dependent rotations of the mass eigenstates. However, the pion and kaon charge eigenstates are the standard ones \begin{equation} \begin{split} \pi^{\pm}&=\frac{\phi_{1}\mp i\phi_{2}}{\sqrt{2}},\ K^{\pm}=\frac{\phi_{4}\mp i\phi_{5}}{\sqrt{2}}\ . \end{split} \end{equation} They can be deduced using the canonical form of the quadratic, kinetic terms in Eqs.~(\ref{linear}) and (\ref{linear1}) in the unbroken phase with $\alpha=0$, which possesses a global $U(1)$ symmetry. When gauged (using electromagnetic fields), the Lagrangian possesses a local $U(1)$ (gauge) symmetry, which is broken by the pion condensed phase. \begin{figure}[htb] \includegraphics[scale=0.43]{spectrum-200.pdf} \includegraphics[scale=0.43]{spectrum-460.pdf} \caption{Medium-dependent masses as a function of $\mu_I$ for $\mu_S=200$ MeV (left panel) and $\mu_S=460$ MeV (right panel). See main text for details.} \label{mediumdepmass} \end{figure} \subsection{Pressure, isospin density, and equation of state} \label{pideos} In this subsection, we discuss the pressure, the isospin density and the equation of state in the pion-condensed phase and compare our results to the $(2+1)$-flavor lattice QCD results of Refs.~\cite{gergy1,gergy2,gergy3}. We begin with Fig.~\ref{presieure}, where we plot the pressure (divided by $m_{\pi}^{4}$) as a function of $\mu_{I}/m_{\pi}$. The pressure has been normalized to be zero in the normal vacuum, which also has zero isospin density. As pions condense beginning at the critical isospin chemical potential, $\mu_{I}^{c}=m_{\pi}$, the pressure increases with increasing chemical potential and continues to increase monotonically, a feature that is consistent with results from lattice QCD. The pressure from two-flavor $\chi$PT is smaller than that from lattice QCD even when the uncertainties within the LECs, the pion mass and pion decay constant are taken into account. The range of pressures due to the uncertainties calculated within two-flavor $\chi$PT is represented by the blue band. We find that the uncertainty in the pion mass and the pion decay constant (as opposed to the uncertainty in the LECs) dominates the uncertainty in the pressure. On the other hand, pressure from three-flavor $\chi$PT (shown in green), which includes the contribution from strange quarks unlike two-flavor $\chi$PT, overestimates the pressure. In Fig.~\ref{presieure}, we use a dark green band to show the uncertainty in the pressure due to the uncertainties in the pion mass and the pion decay constant, and we use a light green band to represents the uncertainty in the pressure due to the LECs, the pion mass and the pion decay constant. The result shows that unlike in two-flavor $\chi$PT, the uncertainty in the pressure is dominated by the uncertainty in the LECs. \begin{figure}[htb] \centering\includegraphics[width=0.5\textwidth]{Pressure2with3LEC.pdf} \caption{Normalized Pressure ($P/m_{\pi}^4$) as a function of $\mu_I/m_{\pi}$ at LO (red), at NLO with two flavors (blue), NLO with three flavors (green), and NLO with two flavors and three-flavor LECs (brown). See main text for details.} \label{presieure} \end{figure} It is clear from Fig.~\ref{presieure} that the difference in pressure calculated in two-flavor $\chi$PT versus that calculated in three-flavor $\chi$PT is quite significant. The tree level pressure in two and three-flavor $\chi$PT is identical. Therefore, the difference arises through the NLO contribution to the pressure in two-flavor and three-flavor $\chi$PT. Since the NLO contribution is suppressed by a power of $1/(4\pi f_{\pi})^{2}$, the difference in the two-flavor and three-flavor pressure seems unusually large. In order to explain the difference we have mapped three-flavor $\chi$PT by expanding the effective potential in the limit of large strange quark masses in subsection~\ref{mapping}. After identifying the appropriate two-flavor LECs in terms of three-flavor LECs -- see Eqs.~(\ref{rel0})--(\ref{rel4}) -- we find the appropriate two-flavor LECs that are consistent with the values of three-flavor LECs. They are \begin{equation} \label{newLEC} \bar{l}_{1}(N_{f}=3)=14.5,\ \bar{l}_{2}(N_{f}=3)=6.5,\ \bar{l}_{3}(N_{f}=3)=4.1,\ \bar{l}_{4}(N_{f}=3)=4.2\ , \end{equation} with $\bar{l}_{i}$ being defined in Eq.~(\ref{lirlbare}). In order to contrast the above values with the two-flavor LECs, we state the LECs below where \begin{equation} \label{LEC2old} \bar{l}_{1}(N_{f}=2)=-0.4,\ \bar{l}_{2}(N_{f}=2)=4.3,\ \bar{l}_{3}(N_{f}=2)=2.9, \ \bar{l}_{4}(N_{f}=2)=4.4\ . \end{equation} We note that while $\bar{l}_{4}$ looks quite similar in the two cases, $\bar{l}_{2}$ and $\bar{l}_{3}$ are somewhat different with the difference in $\bar{l}_{1}$ being the most significant (they have opposite signs). We calculated the pressure in two-flavor $\chi$PT using the LECs found to be consistent with three-flavor $\chi$PT -- we show this result in Fig.~\ref{presieure} in brown (dashed). The result shows that even the two-flavor $\chi$PT overestimates the pressure compared to that from $2+1$ flavor lattice QCD. This analysis shows that the overestimation of the pressure is due to the values of the LECs of three-flavor $\chi$PT, which also have large uncertainties compared to two-flavor LECs. As a secondary observation, we note that as the strange quark mass becomes lighter, the pressure increases in $\chi$PT, particularly for larger isospin chemical potential. In Fig.~\ref{iso}, we plot the isospin density (divided by $m_{\pi}^{3}$) as a function of the normalized chemical potential ($\mu_{I}/m_{\pi}$). The isospin density is zero in the vacuum phase and monotonically increases in the pion-condensed phase. The rate of increase decreases as the isospin chemical potential increases. The isospin density from three-flavor $\chi$PT is consistent with that of lattice QCD (in the normal vacuum and) near the critical isospin chemical potential up to approximately $\mu_{I}=1.4m_{\pi}$. For larger isospin chemical potentials, three-flavor $\chi$PT consistently overestimates the isospin density. This is unlike the result in two-flavor $\chi$PT which is in extremely good agreement with lattice QCD. The two-flavor $\chi$PT result using three-flavor LECs is plotted in brown and shows that the three-flavor $\chi$PT result is largely explained by the discrepancy in the values of the LECs in two-flavor and three-flavor $\chi$PT. \begin{figure}[htb] \centering \includegraphics[width=0.5\textwidth]{IsospinDensity2with3LEC.pdf} \caption{Normalized isospin density ($n_{I}/m_{\pi}^{3}$) as a function of $\mu_I/m_{\pi}$ at LO (red), at NLO with two flavors (blue), NLO with three flavors (green), and NLO with two flavors and three-flavor LECs (brown). See main text for details.} \label{iso} \end{figure} Finally, in Fig.~\ref{eoss} we plot the equation of state: the energy density (divided by $m_{\pi}^{4}$) is plotted against the pressure (divided by $m_{\pi}^{4}$). \begin{figure}[htb] \centering \includegraphics[width=0.5\textwidth]{EoS2with3LEC.pdf} \caption{Normalized energy density ($\epsilon/\mu_{I}^{4}$) as a function of the normalized pressure ($P/m_{\pi}^4$) at NLO with two flavors (blue), NLO with three flavors (green), and NLO with two flavors and three-flavor LECs (brown). See main text for details.} \label{eoss} \end{figure} Three-flavor $\chi$PT consistently overestimates the energy density for all pressures though up to $P/m_{\pi}^{4}\approx 0.10$, the discrepancy is small. Two-flavor $\chi$PT, on the other hand, underestimates the energy density up to $P/m_{\pi}^{4}\approx0.2$ but is largely consistent for values above it. Using three-flavor LECs, we can show that most of the discrepancy between two-flavor and three-flavor $\chi$PT is due to the discrepancy between the two sets of LECs, a theme common to all observables we have calculated in this work. The two-flavor results using three-flavor LEC is shown using brown (dashed) lines. The result is consistent with three-flavor $\chi$PT for $P/m_{\pi}^{4}\approx 0.2$ while above it the two-flavor $\chi$PT result gives larger values of energy density. It is also worth noting that for a given value of pressure the energy density decreases with decreasing strange quark masses. \section{Acknowledgements} The authors would like to thank B. Brandt, G. Endr\H{o}di and S. Schmalzbauer for useful discussions as well as for providing the data points of Ref. \cite{endro}. P.A. would like to acknowledge the hospitality of the Niels Bohr International Academy, where a portion of the work was done.
\section{Introduction} \emph{Mastermind} is a game played between two players, the \emph{codemaker} and the \emph{codebreaker}. In the 1970 original $4$-position $6$-color version of the game, the codemaker chooses $4$ colored pegs, each taking one of $6$ colors, and the codebreaker tries to guess the codemaker's $4$ pegs by making queries to the codemaker by taking a guess at the sequence of the codemaker's $4$ colored pegs. These guesses are answered by two numbers, the number of pegs guessed that are in the right position and the right color, indicated by black pegs, and the additional number of pegs of the right color but in the wrong position, indicated by white pegs. Ever since, this game and its generalizations and variants have been studied by many computer scientists. The original version was completely characterized by \cite{knuth1977computer}, who showed upper and lower bounds of $5$ queries for deterministic strategies. The $n$-position $k$-color generalization of the game was studied in \cite{chvatal1983mastermind}, which sparked a line of research that lead to progressive improvement in upper and lower bounds for this problem, both in the original version of the game as well as in related variants of the game \cite{DBLP:journals/dm/BergerCS18}. As these variants are not the focus of this work, we refer the reader to the expositions of \cite{doerr2016playing, DBLP:journals/dm/BergerCS18} for more details on this literature. Note that in the variant that the codebreaker only receives the black peg answers, the problem can be phrased as guessing a hidden vector based on Hamming distance queries. One can then consider many variants of the Mastermind game in which the codebreaker guesses the codemaker's hidden vector based on other distance queries. For instance, motivated by the theory of black-box complexity, \cite{afshani2019query} recently studied the variant where the distance is the length of the longest common prefix with respect to an unknown permutation. In recreational mathematics, the $\ell_1$ distance case has been studied under the name of ``digit-distance'' \cite{ginat2002digit}. When the distance between the vectors is a graph distance of a graph $G$ and we only allow for nonadaptive queries, that is when the queries cannot depend on the results of previous queries, then the query complexity is known as the \emph{metric dimension of $G$} \cite{Rodriguez-VelazquezYKO14, JiangP19}. Another natural variant to consider is the case of $\ell_p$ distance queries. That is, the codemaker chooses a hidden vector $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$ and answers to queries of the form $\norm*{\bfy-\bfx}_p$ where $\bfx\in\{-k,-k+1,\dots,k-1,k\}^n$. This is the question we focus on in this work. We study the asymptotics with respect to $n$ and $k$, but view $p$ as a fixed constant. \subsection{Previous work} The above problem has been solved, even up to constant factors in the dominant term of the asymptotics for integer $p$ and $k = o(n)$. For $p=1$, note that the absolute value distance on a single coordinate is exactly the graph distance on the path graph, and the $\ell_1$ distance is exactly the graph distance on the $n$th Cartesian power of the path graph. Thus, the nonadaptive query complexity to $(2+O(\log\log n/\log n))n\log(2k+1)/\log n$ by Theorems 1 and 4 of \cite{JiangP19}. Furthermore, \cite{JiangP19} extend their techniques to a very general class of integer-valued distances in their Theorem 7, which includes $\ell_p$ distances for integer $p$. This settles the nonadaptive query complexity for $\ell_p$ distances for any fixed integer $p$ to $(2+O(\log\log n/\log n))n\log(2k+1)/\log n$ as well. Furthermore, their algorithms are efficient. \subsection{Our contributions} On the algorithmic side, we present Theorem \ref{thm:exact-recovery-coordinate-wise}, in which we develop a very general nonadaptive algorithm that works for any separable distance measure, i.e.\ the distance between $\bfx,\bfy\in\mathbb R^n$ is given by $f(\bfx-\bfy)$ where $f(\bfx) = \sum_{i=1}^n g_i(\abs*{x_i})$, with a mild technical assumption. This class in particular includes the smooth max ($g_i(x) = \exp(\abs{x})$) as well as many widely-studied $M$-estimator losses, such as $\ell_p$ norms for even $p\in(0,1)$, the $\ell_1$-$\ell_2$ loss ($g_i(x) = 2(\sqrt{1+\abs{x}^2/2}-1)$), the Huber loss ($g_i(x) = \abs{x}^2/2\tau$ for $\abs{x}\leq\tau$ and $g_i(x) = \abs{x}-\tau/2$ otherwise), and the Fair estimator loss ($g_i(x) = c^2(\abs{x}/c - \log(1+\abs{x}/c))$). We refer to \cite{DBLP:conf/soda/ClarksonW15} for a discussion of $M$-estimators. When we apply this to case of $g_i(x) = x^p$ \emph{for any constant real $1\leq p<\infty$}, i.e.\ when $f$ is the $\ell_p$ norm, we obtain a polynomial time algorithm making $O\parens*{\min\braces*{n,\frac{n\log k}{\log n}}}$ queries. We note that our $\ell_p$ result generalizes the result of \cite{JiangP19} both by allowing $k$ to vary and by handling noninteger $p$. For $p=\infty$, we give a simple algorithm achieving $O(n)$ queries. We also give lower bounds for any adaptive algorithm that match our upper bounds up to constant factors, \emph{for any constant integer $1\leq p<\infty$} (Theorem \ref{thm:lb-p}) and for $p=\infty$ (Theorem \ref{thm:lb-infty}). In fact, our lower bounds are for a weaker problem, the problem of outputting an approximation $\bfy'$ such that its distance from the true hidden vector $\bfy$ is at most $\norm*{\bfy'-\bfy}_p\leq R$, whenever the approximation radius satisfies $R\leq k^{1-\eps}n^{1/p}$ (where we think of $n^{1/p} = 1$ when $p=\infty$) for constant $\eps>0$. Thus, approximation for this problem is hard, in the sense that finding the point exactly is optimal up to constant factors, even when the approximation radius is as large as $k^{1-\eps}n^{1/p}$. Our main algorithmic technique for obtaining Theorem \ref{thm:exact-recovery-coordinate-wise} is a judicious application of a generalization of the Fourier-based detecting matrix construction of \cite{bshouty2009optimal}. Our lower bounds are simply obtained by counting the number of lattice points in an $\ell_p$ ball. Finally, we consider a noisy version of the above problem, where the codemaker is allowed to answer queries with any answer that is within $(1\pm\eps)\norm*{\bfy-\bfx}_p$. For this variant, we show that any algorithm must take $\Omega(\exp(\eps^2 \Theta(k^p n)))$ in Theorem \ref{thm:noisy-prob}. That is, there is no query efficient algorithm for this problem. \section{Preliminaries} \subsection{Notation} \begin{dfn}[$\ell_p$ norm] Let $1\leq p\leq\infty$. Then, we endow $\mathbb R^n$ with the $\ell_p$ norm $\norm*{\cdot}_p$, given by \begin{eqn} \norm*{\bfx}_{p}\coloneqq \parens*{\sum_{i=1}^n \abs*{x_i}^p}^{1/p} \end{eqn} if $p<\infty$ and \begin{eqn} \norm*{\bfx}_{\infty}\coloneqq \max_{i=1}^n \abs*{x_i} \end{eqn} if $p=\infty$. \end{dfn} \begin{dfn}[Weight of binary vector] Let $a\in\{0,1\}^\nu$. Then, $\wt(a)$ is the number of $1$s in $a$. \end{dfn} \begin{dfn}[Even-odd decomposition]\label{def:even-odd} Let $h:\mathbb R\to\mathbb R$ be any function. Then, the \emph{even-odd decomposition of $h$} given by \begin{eqndot} h_\mathrm{even}(x) &\coloneqq \frac{h(x)+h(-x)}2 \\ h_\mathrm{odd}(x) &\coloneqq \frac{h(x)-h(-x)}2 \end{eqndot} It is easy to see that $h = h_\mathrm{even} + h_\mathrm{odd}$ and that $h_\mathrm{even}(-x) = h_\mathrm{even}(x)$ and $h_\mathrm{odd}(-x) = -h_\mathrm{odd}(x)$ for all $x\in\mathbb R$. \end{dfn} \subsection{Bshouty detecting matrix} We very briefly review the construction of the detecting matrix of \cite{bshouty2009optimal}, as we build off of this result for our algorithms. \begin{dfn}[Detecting matrix \cite{bshouty2009optimal}] A $(d_1,d_2,\dots,d_n)$-detecting matrix is a $\{0,1\}$-matrix such that for every $\bfu,\bfv\in\prod_{i=1}^n\{0,1,\dots,d_i-1\}$ with $\bfu\neq \bfv$, we have $M\bfu\neq M\bfv$. \end{dfn} The theorem we use is the following: \begin{thm}[Bshouty detecting matrix, Theorem 4/Corollary 5 of \cite{bshouty2009optimal}] Let $1<d_1\leq d_2\leq \dots\leq d_n$ where $d_1+d_2+\dots+d_n = d$. There is a $(d_1,d_2,\dots,d_n)$-detecting matrix $M$ of size $s\times n$ where \begin{eqn}\label{eqn:bshouty-size-bound} s(\log s-4)\leq 2n\log\frac{d}{n}. \end{eqn} Furthermore, for $\bfu\in\prod_{i=1}^n\{0,1,\dots,d_i-1\}$, there is a polynomial time algorithm for recovering $\bfu$ given $M\bfu$. \end{thm} We will only sketch the main idea behind the construction of the matrix and the decoding algorithm, and refer the reader to \cite{bshouty2009optimal} for the proof of the bounds and the correctness. \paragraph{Fourier representation \normalfont\cite{bshouty2009optimal}.} We consider the Fourier basis on real-valued functions defined on the Boolean hypercube $\{-1,+1\}^\nu$, i.e.\ the basis \begin{eqn} \mathcal B\coloneqq \braces*{\chi_a(x)\coloneqq \prod_{a_i=1}x_i \Bigg\vert a\in\{0,1\}^\nu}\subseteq \braces*{f:\{-1,+1\}^\nu\to\mathbb R}. \end{eqn} It is known that $\mathcal B$ is an orthonormal basis, and thus any $f:\{-1,+1\}^\nu\to\mathbb R$ can be uniquely represented as \begin{eqn} f(x) = \sum_{a\in\{0,1\}^s}\hat f(a)\chi_a(x) \end{eqn} where $\hat f(a)$ is the Fourier coefficient of $\chi_a$ given by \begin{eqn} \hat f(a) = \frac1{2^\nu}\sum_{x\in\{-1,+1\}^\nu} f(x)\chi_a(x). \end{eqn} Using the fast Fourier transform, all the coefficients $\hat f(a)$ can be found from the values of $f(x),x\in\{-1,+1\}^\nu$ and ordered according to lexicographic order of $a\in\{0,1\}^\nu$ in time $O(\nu2^\nu)$. \paragraph{Detecting matrix construction.} The overall idea is as follows. We choose $s$ as in equation (\ref{eqn:bshouty-size-bound}) and $\nu\coloneqq \log_2 s$. Then, we view column vectors in $\mathbb R^s$ with $s = 2^\nu$ rows as enumerations of the values of functions $f:\{-1,+1\}^\nu\to\mathbb R$. That is, for $x\in\{-1,+1\}^\nu$, the $x$th row of the column vector representing $f$ is $f(x)$. We then view our detecting matrix $M\in\{0,1\}^{s\times n}$ as a family of $n$ $\{0,1\}$-valued functions defined on $\{-1,+1\}^\nu$ and $Mu$ as a linear combination of functions from this family, where the coefficients of the linear combination are specified by the unknown vector $\bfu\in\prod_{i=1}^n\{0,1,\dots,d_i-1\}$. The $n$ functions of $M$ have a special structure in the Fourier basis, so that there is an efficient iterative algorithm for recovering the coordinates of $u$ in batches from the Fourier coefficients of the function $Mu$. We iteratively construct columns of $M$ as follows. For each $a\in\{0,1\}^\nu$, we will choose $\ell_a$ more columns to construct, so that in the end, we have $\sum_{a\in\{0,1\}^\nu}\ell_a = n$ columns. Suppose that columns $1$ through $r$ have already been constructed. Let $a\in\{0,1\}^\nu$ and choose an integer $\ell_a$ such that \begin{eqndot} d_{r+1}d_{r+2}\dots d_{r+\ell_a} &\leq 2^{\wt(a)} \\ d_{r+1}d_{r+2}\dots d_{r+\ell_a}d_{r+\ell_a+1} &>2^{\wt(a)-1} \end{eqndot} We then construct $\ell_a$ more columns of $M$ so that the $i$th new function $g_{a,i}$ has Fourier coefficient of $\chi_a$ as \begin{eqn} \hat g_{a,i}(a) = d_{r+1}d_{r+2}\dots d_{r+i} / 2^{\wt(a)} \end{eqn} and the Fourier coefficient of $\chi_b$ for any $b>a$ (in the usual ordering on the Boolean hypercube) as \begin{eqn} \hat g_{a,i}(b) = 0. \end{eqn} The way we choose the column functions $g_{a,i}$ to have these properties is described in \cite{bshouty2009optimal}. \paragraph{Decoding algorithm.} We now show how to efficiently decode $M\bfu$. Essentially, we will decode $\ell_a$ of the entries of $\bfu$ at a time, subtract them off, and recurse. Note that column vector $M\bfu$ is the enumeration of the values of a linear combination $f$ of the $g_{a,i}$ functions from above, where the row corresponding to $x\in\{-1,+1\}^\nu$ is $f(x)$. Then, using the fast Fourier transform, we find all the Fourier coefficients $\hat f(z)$ for $z\in\{0,1\}^\nu$ and search for a maximal $a\in\{0,1\}^\nu$ such that $\hat f(a)\neq 0$. For such an $a$, one can prove that its Fourier coefficient in $f$ is \begin{eqn} \hat f(a) = \frac1{2^{\wt(a)}}\parens*{\lambda_{r+1} + \lambda_{r+2}d_{r+1} + \lambda_{r+3}d_{r+1}d_{r+2} + \dots + \lambda_{r+\ell_a+1}d_{r+1}d_{r+2}\dots d_{r+\ell_a}} \end{eqn} where $r$ is the number of columns in $M$ before the columns corresponding to $a$, and $\lambda_{r+i} = u_{r+i}$ (for sake of matching the notation in \cite{bshouty2009optimal}). Since $\lambda_{r+i}\in\{0,1,\dots,d_{r+i}-1\}$ for all $i\in[\ell_a]$, we can recover all of the $\lambda_{r+i}$. Then, these coefficients can be subtracted off and we can recurse on the remaining entries of $\bfu$. In our Theorem \ref{thm:exact-recovery-coordinate-wise}, we will modify the above algorithm to allow for non-integer values for the $\lambda_{r+i}$, as long as they are bounded and well-separated (to be made precise later). \section{Algorithms} We now describe our upper bounds. As a warm up, we start with algorithms for $\ell_1$, $\ell_2$, and $\ell_\infty$. These will introduce some tricks that we exploit in our coordinate-wise sums algorithm. Then, we combine these tricks along with a modification of the Bshouty detecting matrix algorithm described above to obtain Theorem \ref{thm:exact-recovery-coordinate-wise}. \subsection{Algorithms for \texorpdfstring{$\ell_1$}{l1}, \texorpdfstring{$\ell_2$}{l2}, and \texorpdfstring{$\ell_\infty$}{l infinity}} Our algorithms will be based around the idea of applying the Bshouty detecting matrix $M$ to the hidden vector $\bfy$. This can be most straightforwardly applied in the case of $\ell_2$, by expanding squared distances (equation (\ref{eqn:pythagorean})). \begin{thm}[Algorithm for $\ell_2$ queries] Let $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$ be an unknown vector, and suppose that we receive answers to $s$ queries of the form $\norm*{\bfx-\bfy}_2$. Then, there is a polynomial time algorithm that recovers $\bfy$ in $s = O\parens*{\min\braces*{n,\tfrac{n\log k}{\log n}}}$ queries. \end{thm} \begin{proof} By first making the query with the $\mathbf 0$ vector, we may find the norm $\norm*{\bfy}_2$ of the unknown vector. Now suppose we query for $\norm*{\bfx-\bfy}_2$. Note then that \begin{eqn}\label{eqn:pythagorean} \angle*{\bfx,\bfy} = \frac{\norm*{\bfx}_2^2 + \norm*{\bfy}_2^2 - \norm*{\bfx-\bfy}_2^2}{2} \end{eqn} so we can compute the inner product between $\bfx$ and $\bfy$. Thus by taking $n$ queries to be the $n$ standard basis vectors $\bfx = \bfe_i$ for $i\in[n]$, we can always recovery $\bfy$ in $n+1$ queries. To obtain $s = O\parens*{\tfrac{n\log k}{\log n}}$ queries for $k\leq n$, we can take our query vectors $\bfx$ to be the rows of the detecting matrix of Theorem 4/Corollary 5 of \cite{bshouty2009optimal} and recover $\bfy$ by using the decoding algorithm as described in the proof. We thus conclude as desired. \end{proof} As shown above, if we can simulate computing inner products with binary vectors in $O(1)$ queries each, then we get an $O(n)$ algorithm by querying with the standard basis vectors or $O\parens*{\tfrac{n\log k}{\log n}}$ by using \cite{bshouty2009optimal}. For $\ell_1$, we take a similar approach. This time, the way we extract the inner product is quite different from the case of $\ell_2$. This technique turns out to be much more flexible, and will allow us to generalize the result to coordinate-wise sums. \begin{thm}[Algorithm for $\ell_1$ queries] Let $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$ be an unknown vector, and suppose that we receive answers to $s$ queries of the form $\norm*{\bfx-\bfy}_1$. Then, there is a polynomial time algorithm that recovers $\bfy$ in $s = O\parens*{\min\braces*{n,\tfrac{n\log k}{\log n}}}$ queries. \end{thm} \begin{proof} We will just show how to compute inner products in $O(1)$ queries, since the rest follows as in the $\ell_2$ case. Let $\bftau\in\{0,1\}^n$ be any binary vector and consider the sign vector $\bfsigma\in\{\pm1\}^n$ with $\sigma_i = (-1)^{\tau_i+1}$. Then for $\sigma_i\in\{\pm1\}$ and $-k\leq y_i\leq k$, we have that \begin{eqn} \abs*{k\sigma_i-y_i} = \abs*{k\sigma_i-\sigma_i^2y_i} = \abs*{k-\sigma_iy_i} = k - \sigma_i y_i. \end{eqn} Thus, \begin{eqn} \norm*{k\bfsigma-\bfy}_1 = \sum_{i=1}^n \abs*{k\sigma_i-y_i} = \sum_{i=1}^n k-\sigma_iy_i = kn - \bfsigma\cdot\bfy \end{eqn} so we may compute the quantity $\bfsigma\cdot\bfy = kn - \norm*{k\bfsigma-\bfy}_1$. We may then compute the desired inner product with binary vectors as $\bftau\cdot\bfy = (\bfsigma\cdot\bfy + \mathbf1_n\cdot\bfy)/2$. \end{proof} To conclude the section, we show an $O(n)$ algorithm for $\ell_\infty$ queries. This turns out to be optimal, as we show later. \begin{thm}[Algorithm for $\ell_\infty$ queries] Let $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$ be an unknown vector, and suppose that we receive answers to $s$ queries of the form $\norm*{\bfx-\bfy}_\infty$. Then, there is a polynomial time algorithm that recovers $\bfy$ in $s = O(n)$ queries. \end{thm} \begin{proof} For each $i\in[n]$, we make the query $q_i^+ = \norm*{k\bfe_i-\bfy}_\infty$ and $q_i^- = \norm*{-k\bfe_i-\bfy}_\infty$. Note that $y_i = 0$ if and only if these two are both equal to $k$. If $y_i>0$, then $q_i^- = k+y_i > k$ and if $y_i<0$, then $q_i^+ = k-y_i > k$. Thus, with these two queries, we can determine $y_i$. Thus, we recover $\bfy$ in $O(n)$ queries. \end{proof} \subsection{Algorithm for separable distances} In the previous section, we obtained polynomial time algorithms with tight query complexity for $\ell_1$ and $\ell_2$ by simulating inner product computations between $\bfy$ and binary vectors. We now generalize these ideas to an algorithm for any query given by sums along the coordinates. This in particular includes all $\ell_p$ norms, even for $p$ not an integer. \begin{thm}[Algorithm for separable distances]\label{thm:exact-recovery-coordinate-wise} Let $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$ be an unknown vector, and suppose that we receive answers to $s$ queries of the form $f(\bfy-\bfx)$, where $f(\bfx) = \sum_{i=1}^n g_i(\abs*{x_i})$. For each $i\in[n]$, define the function $h_i(x) = g_i(k-x)$ and consider the even-odd decomposition $h_i = (h_i)_\mathrm{even} + (h_i)_\mathrm{odd}$ (see Definition \ref{def:even-odd}). Also consider the following quantities: \begin{eqn}\label{eqn:def-quantities} M_i^{\min} &\coloneqq \min_{x\in\{-k,-k+1,\dots,k-1,k\}}(h_i)_\mathrm{odd}(x) \\ M_i^{\max} &\coloneqq \max_{x\in\{-k,-k+1,\dots,k-1,k\}}(h_i)_\mathrm{odd}(x) \\ \Delta_i &\coloneqq \min_{\substack{x_1,x_2\in\{-k,-k+1,\dots,k-1,k\} \\ x_1\neq x_2}} \abs*{(h_i)_\mathrm{odd}(x_1) - (h_i)_\mathrm{odd}(x_2)}\\ \Delta &\coloneqq \min_{i=1}^n\Delta_i \\ d_i &\coloneqq \ceil*{\frac{M_i^{\max} - M_i^{\min}}{\Delta}}+1 \end{eqn} If $\Delta > 0$, then there is a polynomial time algorithm that recovers $\bfy$ with $s = O\parens*{\min\braces*{n,\tfrac{\log \prod_{i=1}^n d_i}{\log n}}}$ queries. \end{thm} \begin{proof} Let $\bfh_\mathrm{even}$ and $\bfh_\mathrm{odd}$ be the functions that apply $(h_i)_\mathrm{even}$ and $(h_i)_\mathrm{odd}$ on the $i$th coordinate, respectively. We will show that we can recover $\bfh_\mathrm{odd}(\bfy)$ in $O\parens*{\min\braces*{n,\tfrac{\log \prod_{i=1}^n d_i}{\log n}}}$ queries. Note that since $\min_{i=1}^n\Delta_i > 0$, $(h_i)_\mathrm{odd}$ is injective for each $i$ and thus we can recover $\bfy$ from $\bfh_\mathrm{odd}(\bfy)$ in polynomial time using a lookup table for the values of $(h_i)_\mathrm{odd}$. \paragraph{Inner products with binary vectors.} We first show that we can compute the inner product between $\bfh_\mathrm{odd}(\bfy)$ and any binary vector $\bftau\in\{0,1\}^n$. To do this, consider the sign vector $\bfsigma\in\{\pm1\}^n$ with $\sigma_i = (-1)^{\tau_i+1}$. Note that for $\sigma_i\in\{\pm1\}$ and $-k\leq y_i\leq k$, we have $\abs*{k\sigma_i-y_i} = \abs*{k-\sigma_iy_i} = k - \sigma_iy_i$. Then, by querying vectors of the form $\bfx = k\bfsigma$, we obtain \begin{eqn} f(k\bfsigma-\bfy) = \sum_{i=1}^n g_i(k-\sigma_iy_i) = \sum_{i=1}^n h_i(\sigma_iy_i). \end{eqn} Then using the even/oddness of $(h_i)_\mathrm{even}$/$(h_i)_\mathrm{odd}$, we have \begin{eqn} \sum_{i=1}^n h_i(\sigma_iy_i) = \parens*{\sum_{i=1}^n (h_i)_\mathrm{even}(y_i)} + \parens*{\sum_{i=1}^n\sigma_i(h_i)_\mathrm{odd}(y_i)} = \mathbf{1}_n\cdot \bfh_\mathrm{even}(\bfy) + \bfsigma\cdot\bfh_\mathrm{odd}(\bfy). \end{eqn} Note also that by querying for $k\mathbf{1}_n$ and $-k\mathbf{1}_n$, we also obtain \begin{eqndot} \frac{f(k\mathbf{1}_n-\bfy) + f(-k\mathbf{1}_n-\bfy)}2 &= \sum_{i=1}^n (h_i)_\mathrm{even}(y_i) = \mathbf{1}_n\cdot \bfh_\mathrm{even}(\bfy) \\ \frac{f(k\mathbf{1}_n-\bfy) - f(-k\mathbf{1}_n-\bfy)}2 &= \sum_{i=1}^n (h_i)_\mathrm{odd}(y_i) = \mathbf{1}_n\cdot \bfh_\mathrm{odd}(\bfy) \end{eqndot} Using these, we may compute $\bftau\cdot\bfh_\mathrm{odd}(\bfy) = \tfrac12(\bfsigma + \mathbf{1}_n)\cdot \bfh_\mathrm{odd}(\bfy)$ and thus we are able to compute dot products of arbitrary binary vectors with $\bfh_\mathrm{odd}(\bfy)$. At this point, we can obtain $O(n)$ queries just by taking the binary vectors to be the standard basis vectors, so we focus on obtaining an algorithm making at most $O\parens*{\tfrac{\log \prod_{i=1}^n d_i}{\log n}}$ queries. \paragraph{Modification of the Bshouty detecting matrix decoding \normalfont\cite{bshouty2009optimal}.} Recall the detecting matrix of \cite{bshouty2009optimal} for integer vectors in $\prod_{i=1}^n\{0,1,\dots,d_i-1\}$ for $d_i\in\mathbb N$ for $i\in[n]$. If $\bfh_\mathrm{odd}(\bfy)$ took integer values, then we could just directly use this theorem to conclude with the desired query complexity. However, this is not true of $\bfh_\mathrm{odd}(\bfy)$, and so we need to show how to modify the \cite{bshouty2009optimal} construction to handle our setting. We first shift and scale our vector $\bfh_\mathrm{odd}(\bfy)$. Let $\bfM^{\min}$ be the vector with $M_i^{\min}$ in the $i$th coordinate. Note that we can easily compute $\bftau\cdot\bfM^{\min}$. Thus, we are able to compute dot products of arbitrary binary vectors with the vector $(\bfh_\mathrm{odd}(\bfy)-\bfM^{\min})$. By dividing by $\Delta$, we have dot products of arbitrary binary vectors with$\tfrac1\Delta\parens*{\bfh_\mathrm{odd}(\bfy)-\bfM^{\min}}$. We now define this as \begin{eqn} \varphi_i(y) &\coloneqq \frac1\Delta\parens*{(h_i)_\mathrm{odd}(y)-M_i^{\min}} \\ \bfphi(\bfy) &\coloneqq \frac1\Delta\parens*{\bfh_\mathrm{odd}(\bfy)-\bfM^{\min}} \end{eqn} Note then that $0\leq \varphi_i \leq d_i-1$ (see equation (\ref{eqn:def-quantities})) and that $y_1\neq y_2\implies \abs*{\varphi(y_1)-\varphi(y_2)}\geq 1$. Now consider the detecting matrix construction of Theorem 4 in \cite{bshouty2009optimal}. Recall that we may extract the Fourier coefficient of $\chi_a$ for some maximal $a$ in our unknown vector $\bfphi(\bfy)$ viewed as a function, which gives us \begin{eqn}\label{eqn:fourier-coefficient} \lambda_{r+1}+\lambda_{r+2}d_{r+1}+\lambda_{r+3}d_{r+1}d_{r+2} + \dots + \lambda_{r+\ell_a+1}d_{r+1}d_{r+2}\dots d_{r+\ell_a} \end{eqn} which in our case we set $\lambda_j = \varphi_j(y_j)$. Now let $\mathcal X\coloneqq\prod_{j=r+1}^{r+\ell_a+1}\varphi_j(\{-k,-k+1,\dots,k-1,k\})$ be the image of our original points in a subset of $\ell_a+1$ coordinates starting at $r+1$ under the corresponding $\varphi_j$. Consider the function $\psi:\mathcal X\to \mathbb R^+$ defined via \begin{eqn} \psi(\bfz) = \sum_{i=0}^{\ell_a} z_{i+1}\prod_{j=1}^{i}d_{r+j}. \end{eqn} It is easy to see that when we endow $\mathcal X$ with the lexicographical ordering, then $\psi$ is increasing. Thus, given the Fourier coefficient as in equation (\ref{eqn:fourier-coefficient}), we can do binary search on the at most $k^n$ values in $\mathcal X$ to extract the values $\lambda_{r+i}$ in time $O(n\log k)$. Given this step of recovering $\ell_a$ of the coordinates, we can proceed as in the rest of \cite{bshouty2009optimal} by subtracting these coordinates of the unknown vector and recursing. Hence, we conclude that we may recover $\bfphi(\bfy)$ efficiently and thus $\bfh(\bfy)$, as claimed. \end{proof} \subsubsection{Applications} As a corollary of the above result, we obtain an algorithm for recovering $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$ from $s = O\parens*{\min\braces*{n,\tfrac{n\log k}{\log n}}}$ distance queries in $\ell_p$ and a variety of $M$-estimators. We also give a weaker bound of $O(\min\{n,nk/\log n\})$ for the smooth max. The proofs are deferred to Appendix \ref{section:applications}. \begin{cor}[Algorithm for $\ell_p$ queries]\label{cor:lp} Let $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$ be an unknown vector, and suppose that we receive answers to $s$ queries of the form $\norm*{\bfx-\bfy}_p$ for $p$ a constant. Then, there is a polynomial time algorithm that recovers $\bfy$ in $s = O\parens*{\min\braces*{n,\tfrac{n\log k}{\log n}}}$ queries. \end{cor} \begin{cor}[Algorithm for $M$-estimator loss queries]\label{cor:m} Let $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$ be an unknown vector, and suppose that we receive answers to $s$ queries of the form $\norm*{\bfx-\bfy}_M = \sum_{i=1}^n M(\abs{x_i-y_i})$ for any one of the following choices of $M$: \begin{itemize} \item \textbf{$\ell_1$-$\ell_2$ loss} \begin{eqn} M(x) = 2\parens*{\sqrt{1+\frac{\abs{x}^2}{2}}-1} \end{eqn} \item \textbf{Huber loss} \begin{eqn} M(x) = \begin{cases} \abs{x}^2/2\tau & \text{if $\abs{x}\leq\tau$} \\ \abs{x}-\tau/2 & \text{otherwise} \end{cases} \end{eqn} \item \textbf{Fair estimator loss} \begin{eqn} M(x) = c^2\parens*{\frac{\abs{x}}{c}-\log\parens*{1+\frac{\abs{x}}{c}}} \end{eqn} \end{itemize} Then, there is a polynomial time algorithm that recovers $\bfy$ in $s = O\parens*{\min\braces*{n,\tfrac{n\log k}{\log n}}}$ queries. \end{cor} \begin{cor}[Algorithm for smooth max queries]\label{cor:sm} Let $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$ be an unknown vector, and suppose that we receive answers to $s$ smooth max queries. Then, there is a polynomial time algorithm that recovers $\bfy$ in $s = O\parens*{\min\braces*{n,\tfrac{nk}{\log n}}}$ queries. \end{cor} \section{Lower Bounds} In this section, we compliment our $\ell_p$ algorithms with matching lower bounds, for integer $p$. Our lower bounds work even for the problem of approximating the hidden vector and for adaptive randomized algorithms with constant success probability, improving upon the nonadaptive lower and exact lower bound of \cite{JiangP19}. \begin{thm}[Lower bound for integer $\ell_p$]\label{thm:lb-p} Let $1\leq p<\infty$ be a constant integer and let $R\in (0,kn^{1/p}]$ be an approximation radius. Suppose there exists an algorithm $\mathcal A$ such that for all unknown vectors $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$, $\mathcal A$ outputs a vector $\bfy'\in\{-k,-k+1,\dots,k-1,k\}^n$ such that \begin{eqn} \norm*{\bfy'-\bfy}_p\leq R \end{eqn} in $s$ possibly adaptive $\ell_p$ queries with probability at least $2/3$ over the algorithm's random coin tosses. Then \begin{eqn} s = \Omega\parens*{\frac{n\log(kn^{1/p}/R)}{\log k + \log n}}. \end{eqn} In particular, if $R\leq k^{1-\eps}n^{1/p}$ for some constant $\eps>0$, then \begin{eqn} s = \Omega\parens*{\frac{n\log k}{\log k + \log n}}, \end{eqn} which is $\Omega\parens*{\frac{n\log k}{\log n}}$ if $k < n$ and $\Omega(n)$ if $k\geq n$. \end{thm} \begin{proof} By Yao's minimax principle \cite{yao1977probabilistic}, it suffices to show the lower bound for all deterministic algorithms $\mathcal A$ that correctly approximates a uniformly random $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$ with probability at least $2/3$. Note that each query $\norm*{\bfx-\bfy}_p^p$ results in a nonnegative integer that is at most $(2k)^pn$. Thus, there are at most $((2k)^pn + 1)^s$ possible sequences of answers. Now let $Q$ be the set of all sequence of answers that $\mathcal A$ can observe, and for each sequence of answers $\bfq\in Q$, let $S_\bfq$ denote the set of vectors $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$ such that the deterministic algorithm $\mathcal A$ observes $\bfq$ on input $\bfy$. Then, $S_\bfq$ partitions the unknown vectors $\bfy$ into $\abs*{Q}$ disjoint sets. Then, the probability that $\abs*{S_\bfq}$ has size at most $\tfrac1{100}\tfrac{(2k+1)^n}{\abs*{Q}}$ is \begin{eqn} \Pr_\bfy\parens*{\abs*{S_\bfq}\leq\frac1{100}\frac{(2k+1)^n}{\abs*{Q}}} &= \sum_{\substack{\bfq\in Q \\ \abs*{S_\bfq}\leq \frac1{100}\frac{(2k+1)^n}{\abs*{Q}}}}\Pr_\bfy\parens*{\text{$\mathcal A$ queries the sequence $\bfq$}} \\ &= \sum_{\substack{\bfq\in Q \\ \abs*{S_\bfq}\leq \frac1{100}\frac{(2k+1)^n}{\abs*{Q}}}}\frac{\abs*{S_\bfq}}{(2k+1)^n} \\ &\leq \sum_{\substack{\bfq\in Q \\ \abs*{S_\bfq}\leq \frac1{100}\frac{(2k+1)^n}{\abs*{Q}}}}\frac1{100}\frac{(2k+1)^n}{\abs*{Q}}\frac1{(2k+1)^n} \\ &\leq \sum_{\bfq\in Q}\frac1{100\abs*{Q}} = \frac1{100}. \end{eqn} Thus with probability at least $99/100$, $\abs*{S_\bfq}$ has size at least $\tfrac1{100}\tfrac{(2k+1)^n}{\abs*{Q}}$. Note that by \cite{wang2005volumes}, the volume of a unit $\ell_p$ ball is $2^n\Gamma(1+1/p)^n/\Gamma(1+n/p)$, so the volume of a ball of radius $R$ in $\ell_p$ is \begin{eqn} V \coloneqq R^n 2^n\frac{\Gamma(1+1/p)^n}{\Gamma(1+n/p)}= \parens*{\Theta\parens*{\frac{R}{n^{1/p}}}}^n. \end{eqn} Now suppose that $\bfq$ is a sequence of queries such that $\abs*{S_\bfq}>2V$ and let $\bfz$ be the output of the deterministic algorithm $\mathcal A$ on the sequence of queries $\bfq$. Then, at most $V$ of the points in $S$ can be in the $\ell_p$ ball of radius $R$ centered at $\bfz$. Thus, with probability at least $1/2$ over the random hidden vector $\bfy$, we output a point $\bfz$ such that $\norm*{\bfz-\bfy}_p\geq R$. Thus, if \begin{eqn} \frac1{100}\frac{(2k+1)^n}{\abs*{Q}} > 2V, \end{eqn} then our probability of success is at most $1/2 + 1/100$ and thus we do not have a correct algorithm. Thus, it must be that \begin{eqn} \frac1{100}\frac{(2k+1)^n}{\abs*{Q}}\leq 2V\implies \frac{(2k+1)^n}{200V}\leq \abs*{Q}\leq ((2k)^pn+1)^s. \end{eqn} Rearranging, we have that \begin{eqn} s\geq\frac{\log\frac{(2k+1)^n}{200V}}{\log((2k)^pn + 1)} = \Omega\parens*{\frac{n\log(kn^{1/p}/R)}{\log k + \log n}}, \end{eqn} as claimed. \end{proof} For $p = \infty$, we have a lower bound of $\Omega(n)$ regardless of $k$. \begin{thm}[Lower bound for $\ell_\infty$]\label{thm:lb-infty} Let $R\in (0,k]$ be an approximation radius. Suppose there exists an algorithm $\mathcal A$ such that for all unknown vectors $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$, $\mathcal A$ outputs a vector $\bfy'\in\{-k,-k+1,\dots,k-1,k\}^n$ such that \begin{eqn} \norm*{\bfy'-\bfy}_\infty\leq R \end{eqn} in $s$ possibly adaptive $\ell_\infty$ queries with probability at least $2/3$ over the algorithm's random coin tosses. Then \begin{eqn} s = \Omega\parens*{\frac{n\log(k/R)}{\log k}}. \end{eqn} In particular, if $R\leq k^{1-\eps}$ for a constant $\eps>0$, then $s = \Omega(n)$. \end{thm} \begin{proof} By the same argument as the finite $\ell_p$ case, we use Yao's minimax principle to pass the argument to a lower bound for all deterministic algorithms $\mathcal A$ on uniformly random inputs $\bfy$ succeeding with probability at least $2/3$. Furthermore, by the same partition argument as before, we have that $\abs*{S_\bfq}$ is at least $\tfrac1{100}\tfrac{(2k+1)^n}{\abs*{Q}}$ with probability at least $99/100$. The volume of an $\ell_\infty$ ball of radius $R$ is $(2R)^n$, so as before, we must have \begin{eqn} \frac1{100}\frac{(2k+1)^n}{\abs*{Q}}\leq 2(2R)^n. \end{eqn} When $p=\infty$, there are only $(2k+1)^s$ possible sequences of answers, so we instead have the bound \begin{eqn} \frac{(2k+1)^n}{(2R)^n}\leq 200(2k+1)^s \end{eqn} By rearranging, we obtain the bound $s = \Omega\parens*{\frac{n\log(k/R)}{\log k}}$ as desired. \end{proof} \subsection{Lower bound for the noisy problem} Finally, we show that in the noisy version of the problem, i.e.\ the setting where the codemaker is allowed to answer the queries $\bfx$ with any $q = (1\pm\eps)\norm*{\bfy-\bfx}_p$, there is no good algorithm. \begin{thm}[Lower bound for the noisy problem]\label{thm:noisy-prob} Let $1\leq p<\infty$ be constant and let $0<R<kn^{1/p}$ be an approximation radius. Suppose there exists an algorithm $\mathcal A$ such that for all unknown vectors $\bfy\in\{-k,-k+1,\dots,k-1,k\}^n$, $\mathcal A$ outputs a vector $\bfy'\in\{-k,-k+1,\dots,k-1,k\}^n$ such that \begin{eqn} \norm*{\bfy'-\bfy}_p\leq R \end{eqn} in $s$ possibly adaptive $(1\pm\eps)$-noisy $\ell_p$ queries, i.e.\ answers with adversarially chosen $q_\bfx = (1\pm\eps)\norm*{\bfy-\bfx}_p$, with probability at least $2/3$ over the algorithm's random coin tosses. Then \begin{eqn} s = \Omega\parens*{\exp\parens*{\eps^2\Theta(k^p n)}}. \end{eqn} \end{thm} \begin{proof} By Yao's minimax principle, we can take the algorithm to be deterministic by taking our hidden vector $\bfy$ to be drawn uniformly from $\{-k,-k+1,\dots,k-1,k\}^n$. Now fix any query $\bfx\in\{-k,-k+1,\dots,k-1,k\}^n$ and let $\mu = \bfE_\bfz\parens*{\norm*{\bfx-\bfz}_p^p} = \Theta(k^pn)$. Then by Chernoff bounds, \begin{eqn} \Pr_{\bfy}\parens*{\abs*{\norm*{\bfx-\bfy}_p^p-\mu}\geq \eps\mu}\leq 2\exp\parens*{-\eps^2\mu}. \end{eqn} Thus, if the number of queries $s$ is less than $\exp\parens*{\eps^2\Theta(k^p n)}/200$, then by the union bound over the $s$ queries, with probability at least $99/100$ over the choice of $\bfy$, the codemaker can just return $\bfE_\bfz\parens*{\norm*{\bfx-\bfz}_p^p}$ for any query $\bfx$. Thus, the deterministic codebreaker algorithm sees the same sequence of answers with probability at least $99/100$ and so the algorithm cannot be correct. Hence, we conclude that $s = \Omega(\exp\parens*{\eps^2\Theta(k^p n)})$. \end{proof} \section{Acknowledgements} We thank Flavio Chierichetti and Ravi Kumar for helpful discussions, as well as the anonymous reviewers for helpful feedback. We also thank Zilin Jiang and Nikita Polianskii for pointing out connections to their work in \cite{JiangP19}. \bibliographystyle{alpha}
\section{Introduction} One of the pillars in the building of quantum physics is the uncertainty principle, which has been formulated by Heisenberg \cite{Hei1927} and originally given in terms of the product of variances of position and momentum observables as quantifiers of the quantum particles' spreading. Recently, nontrivial relations have been obtained for the sum of variances~\cite{Mac14}. Besides, it has been proven that uncertainty relations can be formulated as well in terms of Shannon and R\'enyi information entropies (see, for instance, \cite{Bia75,Maa88,Zozor2008,Bia11} and references therein). The possible influence of gravity in uncertainty relations has been recently proposed \cite{Kem95,Pedram2012a,Pedram2012,Hossenfelder2013}, and a modification to Heisenberg inequality known as generalized uncertainty principle (GUP) has been analyzed. The modification of the position--momentum uncertainty relation, which is carried out through a deformation of the typical commutation relation between operators, is linked to the existence of a minimal observable length. It is interesting to quote that an experimental procedure to detect these possible modifications has been proposed~\cite{Pik12}, however it is not yet possible to achieve the required precision. We consider here the harmonic oscillator and study the deformed uncertainty relations appealing to R\'enyi entropies. In Refs.~\cite{Chang2002, Ped16}, the wavefunctions for some values of the principal quantum number have been given in momentum space, and in position space. However, differently to the standard quantum mechanics, the presence of gravity induces that position and momentum space wavefunctions are not related via a Fourier transform, but it is necessary to consider an auxiliary transformation~{\cite{Ras17}. We present an entropic analysis in this case, and show a family of inequalities satisfied by R\'enyi entropies. \section{Results} \subsection{Quantum oscillator wavefunctions with a minimal length} \label{ssec_wavefunction} The harmonic oscillator (HO) is one of the most relevant physical systems, and it is one of the few quantum systems for which the spectrum and corresponding wavefunctions are exactly known. In general, the Hamiltonian of the 1D HO is given by $H=P^2/(2m)+(m\omega^2/2) X^2$, where $X$ and $P$ are such that their commutator gives the $c$-number $i\hbar$. In the context of GUP, a deformation of the standard commutation relation is assumed. Here we assume the form \ $[x,k]=i\hbar(1+\beta k^2)$, with $\beta$ being a positive parameter, which imposes a minimal value for the variance in position, $\Delta X_{\min}=\hbar \sqrt\beta$, of the order of Planck's length. We mention that more general deformations (in arbitrary dimensions) have been proposed~\cite{Kem95}, however this will be focus of further study to be considered elsewhere. Under these assumptions, the Schr\"odinger equation in the (auxiliary) momentum space has been solved by Pedram~\cite{Ped16}. Letting $k=\frac{\tan(\sqrt\beta \, q)}{\sqrt\beta}$, the wavefunctions are given by \begin{equation} \label{MWF} \phi_n(q)=N_n\,C_n^{(\lambda)}\left(\sin\left(\sqrt{\beta}\,q\right)\right) \ \cos^\lambda\left(\sqrt\beta \,q\right) , \qquad q\in\left(-\frac{\pi}{2\sqrt \beta},\frac{\pi}{2\sqrt \beta}\right), \end{equation} where $N_n$ is the normalization constant, given by $N_n=\left(\frac{\sqrt\beta \, \Gamma(\lambda)^2\Gamma(n+1)(n+\lambda)}{\pi2^{1-2\lambda}\Gamma(n+2\lambda)}\right)^\frac12$ \ for $n=0,1,2,\ldots$; the symbol $C_n^{(\lambda)}(\cdot)$ denotes the Gegenbauer polynomials, with $\lambda=\frac12\left(1+\sqrt{1+\frac{4}{\eta^2}}\right)$ \ and $\eta=m\hbar\omega\beta$; and the energy levels are given by $E_n=\hbar\omega\left(n+\frac12\right)\left(\sqrt{1+\frac{\eta^2}{4}}+\frac\eta2\right)+\frac12\hbar\omega n^2\eta$. table Note that in the limit $\beta\to0^+$, or equivalently $\lambda\to+\infty$, the standard case is recovered as it is shown in \cite{Ped16}. From Eq.~\eqref{MWF} one can compute the position wavefunction through the Fourier transform as \begin{equation}\label{Fourier} \psi_n(x)=\frac1{\sqrt{2\pi}}\int_{-\frac{\pi}{2\sqrt\beta}}^{\frac{\pi}{2\sqrt\beta}}e^{iqx}\phi_n(q)\,dq . \end{equation} % In Ref.~\cite{Ped16} this has been computed exactly for $n=0$ and $n=1$. As claimed by Rastegin~\cite{Ras17}, the physically legitimate wavefunction in momentum space, which must depend on $k$, is not given by Eq.~\eqref{MWF}, but can be obtained through the following condition: % \begin{equation} |\tilde \phi_n(k)|^2\,dk=|\phi_n(q)|^2\,dq . \end{equation} Therefore % \begin{equation}\label{transformation} |\tilde \phi_n(k)|^2=\frac{|\phi_n(q)|^2}{1+\beta\,k^2}, \end{equation} % with \ $q(k)=\frac{\arctan(\sqrt\beta\,k)}{\sqrt\beta}$. Finally \begin{equation} \tilde \phi_n(k)=N_n\, C_{n}^{(\lambda)} \left(\frac{\sqrt\beta\,k}{\sqrt{1+\beta\,k^2}}\right)\,(1+\beta k^2)^{-\frac{\lambda+1}2} . \end{equation} \subsection{Behavior of the sum of R\'enyi entropies} \label{ssec_Renyi} Shannon entropy in momentum space was analytically calculated by Pedram \cite{Ped16} for the ground state and for the first excited state. Here the R\'enyi entropy $R_{\alpha}$ using both representations in momentum space, is numerically studied for the ground state and the first five excited ones. R\'enyi entropies are given by % \begin{equation}\label{Renyigamma} R_\alpha[\phi_n]=\frac1{1-\alpha}\ln\int_{-\frac{\pi}{2\sqrt{\beta}}}^{\frac{\pi}{2\sqrt{\beta}}} |\phi_n(q)|^{2\alpha}\,dq,\quad\text{and}\quad R_\alpha[\tilde\phi_n]=\frac1{1-\alpha}\ln\int_{-\infty}^\infty |\tilde\phi_n(k)|^{2\alpha}\,dk, \end{equation} % for the representations of auxiliary and actual momenta respectively, where ${\alpha}>0$ and ${\alpha}\neq1$. Note that, as the wavefunctions $\psi(x)$ and $\phi(q)$ are connected through Fourier transformation, they necessarily satisfy the Maassen--Uffink uncertainty relation~\cite{Maa88} % \begin{equation} \label{UP} R_{\alpha}[\psi]+R_{\alpha^*}[\phi]\ge \ln\left(\pi\alpha^{\frac{1}{2(\alpha-1)}}{\alpha^*}^{\frac{1}{2(\alpha^*-1)}}\right) \end{equation} % for conjugated indices, with $1/\alpha + 1/\alpha^*=2$. Although this relation has been improved by considering the probability density governing the measurement process \cite{Ras17}, to the best of our knowledge the correction to this inequality taking into account the transformation~\eqref{transformation} has not been developed until now, except for the Shannon case~\cite{Ras17} that corresponds to the limit $\alpha=\alpha^*=1$. Notice that, from Eqs.~\eqref{transformation} and~\eqref{Renyigamma}, it follows trivially that $R_{\alpha}[\tilde\phi_n]>R_{\alpha}[\phi_n]$ whenever $\phi$ is not the Dirac's delta. As an example we show in Table~\ref{tableRenMom} the behavior of the R\'enyi entropies corresponding to the ground state and first five excited ones in both representations of momentum space, for $\alpha=2$, and for different values of the deformation parameter~$\beta$. % \begin{table}[H] \caption{Numerical computation of R\'enyi entropy $R_2$, in auxiliary (left) and actual (right) momentum space, for the ground and first 5 excited states of the 1D harmonic system with minimal length.} \label{tableRenMom} \centering \begin{tabular}{cccc|ccccc} \hline \textbf{$R_2[\phi_{n}]$} & \textbf{$\beta=0.1$} & \textbf{$\beta=0.5$} & \textbf{$\beta=1$} \hspace{8mm} & \quad \ \quad & \textbf{$R_2[\tilde\phi_{n}]$} & \textbf{$\beta=0.1$} & \textbf{$\beta=0.5$} & \textbf{$\beta=1$} \\ \hline \midrule $n=0$& 0.876 & 0.723 & 0.565 \hspace{8mm} && $n=0$& 0.899& 0.808 & 0.690 \\ $n=1$ & 1.119 & 0.859 & 0.640\hspace{8mm} &&$n=1$ & 1.229 & 1.227 & 1.153 \\ $n=2$ & 1.242 & 0.916 & 0.669\hspace{8mm} && $n=2$ & 1.432 & 1.424 & 1.285 \\ $n=3$ & 1.322 & 0.949 & 0.685\hspace{8mm} && $n=3$ & 1.582 & 1.533 & 1.341 \\ $n=4$ & 1.380 & 0.971 & 0.695\hspace{8mm} && $n=4$ & 1.700 & 1.599 & 1.370 \\ $n=5$ & 1.424 & 0.987 & 0.701\hspace{8mm} && $n=5$ & 1.798 & 1.642 & 1.388 \\ \hline \bottomrule \end{tabular} \end{table} In Table~\ref{tableRenPos} we show some particular values of the position-momentum R\'enyi entropies' sum for different values of the parameter $\beta$, various quantum states of the harmonic system with minimal length, and fixed $\alpha=\frac23$, then $\alpha^*=2$. Note that, as expected, all values are bigger than the lower bound in~\eqref{UP}, given by \ $\ln\left(\frac{3\sqrt 3\,\pi}{2}\right) \simeq 2.100$ for these particular values of the entropic parameters $\alpha$ and $\alpha^*$. % \begin{table}[H] \caption{Numerical computation of R\'enyi entropy in position space (left) and sum of position--momentum entropies (right), for the ground and first 5 excited states of the 1D harmonic system with minimal length.} \centering \begin{tabular}{cccc|ccccc} \hline \textbf{$R_2[\psi_{n}]$} & \textbf{$\beta=0.1$} & \textbf{$\beta=0.5$} & \textbf{$\beta=1$}\hspace{6mm} & \qquad & \textbf{$R_\frac23[\psi_{n}]+R_{2}[\tilde\phi_{n}]$} & \textbf{$\beta=0.1$} & \textbf{$\beta=0.5$} & \textbf{$\beta=1$} \\ \hline $n=0$& 0.974 & 1.167 & 1.356 \hspace{6mm} && $n=0$ & 2.123 & 2.205 & 2.290 \\ $n=1$ & 1.276 & 1.506 & 1.717 \hspace{6mm} && $n=1$ & 2.723 & 2.939& 3.106 \\ $n=2$ &1.426 & 1.623& 1.819\hspace{6mm} && $n=2$ & 3.084 & 3.307 & 3.417 \\ $n=3$ & 1.517 & 1.668 & 1.855\hspace{6mm} && $n=3$ & 3.346 & 3.526 & 3.585 \\ $n=4$ & 1.576 &1.684 & 1.868 \hspace{6mm} && $n=4$ & 3.552 & 3.673 & 3.693 \\ $n=5$ & 1.615 & 1.688 & 1.872 \hspace{6mm} && $n=5$ & 3.719 & 3.776 & 3.770 \\ \hline \end{tabular} \label{tableRenPos} \end{table} \section{Discussion} In these proceedings we show a numerical analysis of informational measures such as R\'enyi entropies and their sum, in the case of the 1-dimensional quantum harmonic oscillator wavefunctions assuming for the position and momentum operators a deformed commutation relation, characterized by a parameter $\beta$. A nonvanishing deformation parameter implies the existence of a minimal length, which is proposed to be a characteristic of quantum gravity theory. Further findings for arbitrary pairs of entropic indices below the conjugacy curve, could also be obtained, and will be presented elsewhere together with a comparison with known lower bounds for the entropies' sum. Future work includes consideration of other physical systems and/or a more general deformed commutator between position and momentum observables (in $D$ dimensions), focusing on those states that minimize the generalized uncertainty relations. \vspace{6pt} \subsection*{authorcontributions}{Both authors have contributed to conceptualization, methodology, formal analysis, and writing--original draft preparation. } \subsection*{funding}{This research was funded by Universidad Nacional de La Plata (UNLP), Argentina, project number 11/X812. MP is grateful also to Consejo Nacional de Investigaciones Cient\'ificas y T\'ecnicas (CONICET), Argentina, for financial support. DPC acknowledges Universidad de Granada, Spain.} \subsection*{conflictsofinterest}{The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.} \subsection*{References}
\section{Introduction} The analysis of time-dependent phenomena is at the heart of investigation in a broad range of scientific research. Within these studies, the integration of data in the form of time-series has increased considerably. Therefore, the application of innovative algorithms is necessary to gain deep insights into the characteristics of data. In this paper, we address time-series analysis by Dynamic Mode Decomposition (DMD), which was first introduced by Schmid and Sesterhenn in 2008. DMD is a data-driven and model-free algorithm extracting spatio-temporal patterns in the form of so-called DMD modes and DMD eigenvalues. As an efficient tool in fluid mechanics, DMD has gained much attention. DMD has been investigated on both practical and theoretical grounds. Nonetheless, the focus of these analyses was mainly a practical one. For example, various types of flow were considered, such as airflow around an airfoil, fuel flow in a combustion chamber, or heat conduction in various cases. Completely different fields of application comprise financial trading, video processing, epidemiology, neuroscience, and control theory. In contrast, we focus on theoretical investigations. The paper is thus structured as follows: After discussing related work, we introduce the theoretical framework of DMD dealing with the background mechanisms. In this process, we define the so-called system matrix, which is pioneering for DMD and prove the following results: a characterization for the exactness and diagonalizability of the system matrix as well as the resulting reconstruction of data with its spectral components. These theorems are central for the following sections introducing the three common variants of DMD: The original formulation~\cite{schmid:2008:APS}, the modification by a singular value decomposition~\cite{schmid:2011:applications_of_dmd}, and Exact-Dynamic Mode Decomposition~\cite{tu:2014:on_dmd_theorey_and_app}. In this context, a systematic advancement will be presented that clarifies precisely the interrelation of these algorithms. This especially includes algebraic identities as well as spectral-theoretic results leading, e.g., to a new approach for the extension to the most recent variant of DMD. In addition, the exact reconstruction property of DMD will be proven for each DMD variant that guarantees an error-free reconstruction of the data. To this end, a new variant of scaling factors is introduced involving a new concept of an error scaling for the reconstruction of the first snapshot. Some concluding remarks will be given in the last section. \section{Related Work} Rowley et al. provided a first theoretical investigation~\cite{rowley:2009:spectral_nonlinear_flow} for the fundamental version of DMD, here denoted as Companion Dynamic Mode Decomposition (CDMD). They dealt with the reconstruction property of CDMD, however, they did not take appropriate scaling factors into account. An algorithmic improvement through the singular value decomposition was achieved by Schmid resulting in another variant of DMD~\cite{schmid:2010:dmd_numerical_data}. We refer to this algorithm as Singular Value Decomposition Dynamic Mode Decomposition (SDMD). The reconstruction property of SDMD was mentioned by Chen et al. as well as further properties of CDMD~\cite{chen:2012:variants_of_DMD}. Tu et al. introduced the advancement of SDMD to Exact-Dynamic Mode Decomposition (EXDMD)~\cite{tu:2014:on_dmd_theorey_and_app}, which is the most recent version of DMD. They prove basic algebraic identities and show primarily spectral-theoretic connections between these two algorithms. We generalize and extend all results or derive them as a corollary. In addition, we present a new approach for the extension of SDMD to EXDMD characterizing precisely the connection between these two algorithms. Despite these theoretical investigations, the problem of an exact reconstruction is left open. However, Jovanovic et al.~\cite{jovanovic:2014:sparsity_promoting_dmd} as well as Drma{\v{c}} et al.~\cite{drmavc:2018:data_driven_koopman_spectral_analysis_in_vandermonde_cauchy_form} discussed efficient techniques for finding appropriate coefficients by solving certain (convex) minimization problems. We introduce a new variant of scaling factors that lead to an error-free reconstruction of the snapshots under appropriate conditions. \section{Theoretical Framework} This section is dedicated to the basic theoretical background of DMD. In this context, the general setting will be presented as well as an intuitive interpretation of the principles of DMD. These are crucial for the precise understanding of DMD, forming the basis for the subsequent sections. In addition, basic notation will be formalized and consistently used in this paper. The application of DMD starts with the availability of data that may stem either from empirical experiments or numerical simulations alike. The objective of DMD is to extract spatio-temporal patterns out of the data in the form of DMD modes, eigenvalues ,and amplitudes. As the modes are related to spatial structures, the corresponding eigenvalues determine the temporal behavior of these. The amplitudes characterize the impact of individual modes on the whole system, i.e. the dominance structure. Now, consider data (snapshots) $x_0,x_1,\dots,x_m \in \mathbb{C}^n$ with the following two quantities: \begin{align*} n &= \text{``size/dimension of the data points''}, \\ m &= \text{``number of data points''}. \end{align*} In the application areas of DMD such as fluid dynamics or non-linear dynamics, the connection between these variables is typically given by $n \gg m$, which means that the size of the data points is considerable larger than the number of snapshots. In this context, typical values are $n \approx 10^6$--$10^{12}$ (depending on whether we address 2D or 3D scenarios) and $m \approx 100$--$1000$. This basic setting is crucial for understanding the principles of DMD and will be assumed in the following derivation. However, DMD can also be mathematically formulated and applied without this assumption, as we will see later. In short, DMD calculates the relevant dynamic information of a high-dimensional linear operator that connects the given data points $x_0,x_1,\dots,x_m $ in a least square sense, without explicitly computing it. This is achieved by an eigenvalue decomposition of a low-dimensional representation. The corresponding eigenvectors will be embedded as DMD modes into the high-dimensional space endowed with appropriate scaling factors, the DMD amplitudes. In order to obtain the high-dimensional matrix $A \in \mathbb{C}^{n \times n}$ connecting the data points, we consider the following (least-squares) minimization problem: \begin{equation*} \min_{A \in \mathbb{C}^{n \times n}} \sum_{j=0}^{m-1} \lVert A x_j - x_{j+1} \rVert_2^2. \end{equation*} Note that the high dimensionality stems from the fact $n \gg m$. An explicit solution of $A$ is necessary to formulate an algorithmic approach. To this end, we rewrite the data into the matrices \begin{equation*} X = \begin{bmatrix} | & | & & | \\ x_0 & x_1 & \dots & x_{m-1} \\ | & | & & | \\ \end{bmatrix} , \quad Y = \begin{bmatrix} | & | & & | \\ x_1 & x_2 & \dots & x_{m} \\ | & | & & | \\ \end{bmatrix} \in \mathbb{C}^{n \times m} \end{equation*} obtaining the following equivalent minimization problem: \begin{equation*} \min_{A \in \mathbb{C}^{n \times n}} \lVert A X - Y \rVert_F^2, \end{equation*} where $\lVert \cdot \rVert_F$ denotes the Frobenius norm of a matrix. An explicit solution is now given by \begin{equation*} A = Y X^+ \in \mathbb{C}^{n \times n}, \end{equation*} where $X^+$ denotes the Moore-Penrose pseudoinverse~\cite{moore:1920:moore_penrose} of $X$. Since the pseudoinverse always exists, the solution $A$ can be used for an algorithmic formulation. Now, assuming the diagonalizability of the matrix $A$, i.e., $A = V \Lambda V^{-1}$ with the matrices $\Lambda = \textnormal{diag}(\lambda_1,\dots,\lambda_n)$ and $V = \begin{bmatrix} v_1 & v_2 & \dots & v_n \end{bmatrix}$ containing the eigenvalues and eigenvectors respectively, we obtain the characteristic reconstruction property of the matrix $A$ by \begin{equation*} x_k \approx A^k x_0 = (V \Lambda V^{-1})^k x_0 = V \Lambda^k V^{-1} x_0 = V \Lambda^k b = \sum_{j=1}^n \lambda_j^k b_j v_j \end{equation*} for $k = 0,1,\dots,m$, where $b=(b_1,\dots,b_n)^T$ are the coefficients of the linear combination of $x_0$ in the eigenvector basis, i.e. $b = V^{-1} x_0$. Since the rank of $A$ is at most $\min\{\textnormal{rank}(X),\textnormal{rank}(Y)\}$ and consequently not more than $m$, there are at least $n-m$ eigenvalues of $A$ that are equal to zero. The dynamic behavior will be thus captured by at most $m$ components, which are considerable fewer components. Consequently, we obtain the following reconstruction of the data: \begin{equation*} x_0 \approx \sum_{j=1}^m b_j v_j + q_0 \qquad x_k \approx \sum_{j=1}^m \lambda_j^k b_j v_j, \end{equation*} for $k = 1,\dots,m$, where $q_0$ is the resulting error arising from the missing $m-n$ components. In sum, we gain a reasonable low-dimensional decomposition of the data into the triples $(\lambda_j, v_j, b_j) \in \mathbb{C} \times \mathbb{C}^n \times \mathbb{C}$, providing an instrument for diagnostic approaches as well as a tool for prediction, long-term analysis, and stability analysis. The different versions of DMD presented in the subsequent sections are based on various techniques to produce a low-dimensional representation of the matrix $A$ in order to (approximately) compute its eigenvalues and eigenvectors as well as new appropriate scaling factors. These procedures yield similar triples that will be denoted by $(\lambda_j, \vartheta_j, a_j) \in \mathbb{C} \times \mathbb{C}^n \times \mathbb{C}$ throughout the paper. These triples consist of the so-called DMD eigenvalues, DMD modes, and DMD amplitudes corresponding to a particular algorithm (see each section). Before studying the variants of DMD, we first concentrate on an analysis of the high-dimensional structures involving the matrix $A$. Through a deeper understanding of the matrix $A$ representing the starting point of DMD, we obtain insights into the desired action of DMD. In particular, the success of an error-free reconstruction of DMD depends on the following two aspects: \begin{enumerate} \item The exactness of the matrix $A$, i.e., $A X = Y$. \item The diagonalizability of the matrix $A$. \end{enumerate} These two aspects will be examined throughout this section, however, before, the matrix $A$ will be captured in the following definition. \begin{definition} For data $x_0,\dots,x_m \in \mathbb{C}^n$ with associated matrices $X = \begin{bmatrix} x_0 & \dots & x_{m-1} \end{bmatrix}$ and $Y = \begin{bmatrix} x_1 & \dots & x_m \end{bmatrix}$, we call the matrix $A = Y X^+ \in \mathbb{C}^{n \times n}$ the system matrix to the data $x_0,\dots,x_m$. \end{definition} First, we recall some well-known facts. The definition is well-defined, as the pseudoinverse always exists and is unique. Furthermore, the system matrix is the unique solution to the the minimization problem $\min_{A \in \mathbb{C}^{n \times n}} \lVert A X - Y \rVert _F^2$, if the rows of the matrix $X$ are linearly independent (or equivalently, if the matrix $X$ is surjective). An important condition is the exactness of the system matrix, i.e., the equality $AX =Y$ or equivalently $A x_j = x_{j+1}$ for $j = 0,\dots,m-1$. The following proposition characterizes this property on linear functionals. \begin{proposition} Let the system matrix $A$ be given to the data $x_0,\dots,x_m \in \mathbb{C}^n$ as well as an arbitrary vector $w \in \mathbb{C}^{n}$. Then the following statements are equivalent: \begin{enumerate} \item[(i)] $\ker(X) \subseteq \ker(w^*Y)$, i.e., $Xz = 0 \implies w^*Yz = 0$ for all $z \in \mathbb{C}^n$. \item[(ii)] The system matrix is exact on $w$, i.e. $w^*A X=w^*Y$. \end{enumerate} \end{proposition} \begin{proof} ``$(i) \implies (ii)$''. Consider the following equation \begin{equation*} w^*Y-w^*A X = w^*Y - w^*Y X^+ X = w^*Y( I - P_{X^*}), \end{equation*} where $P_{X^*}$ is the orthogonal projection onto the image of $X^*$. Therefore $I - P_{X^*}$ is the orthogonal projection onto the kernel of $X$ and consequently the assertion follows by the assumption $\ker(X) \subseteq \ker(w^*Y)$. ``$(ii) \implies (i)$''. Let $z \in \ker(X)$, i.e., $Xz = 0$. This implies $w^* A X z = 0$, which is by assumption equivalent to $w^* Y z = 0$. Hence $z \in \ker(w^*Y)$. \end{proof} A simple consequence of this proposition is the following corollary~\cite[Theorem 2]{tu:2014:on_dmd_theorey_and_app}. \begin{corollary} \label{2:Corollary_AX=Y} Let the system matrix $A$ be given to the data $x_0,\dots,x_m \in \mathbb{C}^n$. Then the following assertions are equivalent: \begin{enumerate} \item[(i)] $\ker(X) \subseteq \ker(Y)$. \item[(ii)] The system matrix is exact, i.e. $A X=Y$. \end{enumerate} \end{corollary} In the case of linear independent data points $x_0,\dots,x_{m-1}$, the system matrix is exact, since $\ker(X) = \{0\}$ and hence condition $(i)$ of \cref{2:Corollary_AX=Y} is trivially satisfied. In this context, the condition $n \gg m$ (which is typical for the application areas of DMD) suggests the linear independence of the data. Consequently, the first aspect (exactness of the system matrix) is characterized. For a full reconstruction of the data, however, we still need the diagonalizability of the system matrix. To this end, we examine the inner structure of the system matrix, i.e., its kernel and image. \begin{lemma} \label{2:Lemma_DimImKerA} Let the system matrix $A$ be given to the data $x_0,\dots,x_m \in \mathbb{C}^n$, where $\allowbreak x_0, \allowbreak \dots,\allowbreak x_{m-1}$ and $x_1,\dots,x_m$ are linear independent, respectively. Then the dimension of the image and the kernel of $A$ is given by \begin{equation*} \dim~\textnormal{im}(A)=m, \qquad \dim~\ker(A)=n-m. \end{equation*} \end{lemma} \begin{proof} For the first assertion, we use the following rank inequality: \begin{equation*} m = \textnormal{rank}(Y) + \textnormal{rank}(X^+) - m \leq \textnormal{rank}(Y X^+) \leq \min\{\textnormal{rank}(Y),\textnormal{rank}(X^+)\} = m, \end{equation*} which implies $\textnormal{rank}(A) = m$ or equivalently $\dim~\textnormal{im} (A) = m$. Consequently, we obtain that $\dim~\ker (A) = n - \dim~\textnormal{im} (A) = n-m$. \end{proof} \begin{corollary} \label{2:Corollary_DiagoA} Let the system matrix $A$ to the data $x_0,\dots,x_m \in \mathbb{C}^n$ be given, where $x_0, \dots, x_{m-1}$ and $x_1,\dots,x_m$ are linear independent, respectively. If $A$ has $m$ non-zero distinct eigenvalues, then it is diagonalizable. \end{corollary} Regarding the reconstruction property of the system matrix, the final result will be stated in the following theorem, which deals with both sufficient and necessary conditions. For a simple notational handling of the proof, we define the Vandermonde matrix. \begin{definition} For $\lambda_1,\dots,\lambda_m \in \mathbb{C}$ we define the $k$-$K$-Vandermonde matrix by \begin{equation*} \textnormal{Vand}(\lambda_1,\dots,\lambda_m;k,K) = \begin{pmatrix} \lambda_1^{k-1} & \lambda_1^k & \cdots & \lambda_{1}^{K-1} \\ \lambda_2^{k-1} & \lambda_2^k & \cdots & \lambda_{2}^{K-1} \\ \vdots & \vdots & \ddots & \vdots \\ \lambda_m^{k-1} & \lambda_m^k & \hdots & \lambda_{m}^{K-1} \end{pmatrix} \in \mathbb{C}^{m \times (K-(k-1))}. \end{equation*} with $\textnormal{Vand}(\lambda_1,\dots,\lambda_m) = \textnormal{Vand}(\lambda_1,\dots,\lambda_m;1,m)$ for the usual Vandermonde matrix. \end{definition} \begin{theorem}[Reconstruction-property system matrix] \label{2:Theorem_Reconst_System_matrix_A} Let the system matrix $A$ be given to the data $x_0,\dots,x_m \in \mathbb{C}^n$. Then the two following assertions are equivalent: \begin{enumerate} \item[(i)] The system matrix $A$ has the following properties: \begin{itemize} \item[a)] $\ker(X) \subseteq \ker(Y)$. \item[b)] $A$ is diagonalizable, where the non-zero eigenvalues are distinct. \item[c)] $\textnormal{rank}(Y) = r_1$. \end{itemize} \item[(ii)] There are distinct numbers $0 \neq \lambda_1,\dots,\lambda_{r_1} \in \mathbb{C}$, coefficients $0 \neq b_1,\dots,b_{r_2} \in \mathbb{C}$ and linearly independent vectors $v_1,\dots,v_{r_2}$ with $r_1 \leq r_2 \leq n$ and $r_1 \leq m$ such that the following identities hold for $k = 1,\dots,m$: \begin{equation*} x_0 = \sum_{j=1}^{r_2} b_j v_j, \qquad x_k = \sum_{j=1}^{r_1} \lambda_j^k b_j v_j. \end{equation*} \end{enumerate} In this case, the non-zero distinct numbers $\lambda_1,\dots,\lambda_{r_1}$ are the eigenvalues of the system matrix and the related (scaled) vectors $v_1,\dots,v_{r_1}$ are the corresponding eigenvectors. The remaining vectors $v_{r_1 + 1},\dots, v_{r_2}$ are eigenvectors of the system matrix to the eigenvalue zero. \end{theorem} \begin{proof} ``$(i) \implies (ii)$''. By condition $c)$, the system matrix has at most $r_1$ non-zero eigenvalues, because $\textnormal{rank}(A) \leq \min\{\textnormal{rank}(X^+),\textnormal{rank}(Y)\} \leq r_1$. As the system matrix is diagonalizable by assumption $b)$, there exist non-zero distinct eigenvalues $\lambda_1,\dots,\lambda_r$ with $r \leq r_1$ and zero eigenvalues $\lambda_{r+1},\dots,\lambda_n$ with corresponding eigenvectors $v_1,\dots,v_r,v_{r+1},\dots,v_n$. Rewriting into matrices leads to $W^{-1} A W = \Lambda$ for $W = \begin{bmatrix} v_1 & v_2 & \dots & v_n \end{bmatrix}$ and $\Lambda = \textnormal{diag}(\lambda_1,\dots,\lambda_n)$. By \cref{2:Corollary_AX=Y}, the first assumption $a)$ is equivalent to $AX = Y$, which implies the identity \begin{equation*} x_k = A^k x_0 = W \Lambda^k W^{-1} W b = W \Lambda^k b = \sum_{j=1}^n \lambda_j^k b_j v_j, \end{equation*} for $k = 0,1,\dots,m$, where $b=(b_1,\dots,b_n)^T$ contains the coefficients of the linear combination of $x_0$ in the eigenvector basis, i.e., $b = W^{-1} x_0$. Some of the coefficients $b_j$ may be zero, such that we obtain, after reordering, the identity \begin{equation*} x_k = \sum_{j=1}^{\tilde{r}} \lambda_j^k b_j v_j, \end{equation*} for $k = 1,\dots,m$ and $b_1,\dots,b_{\tilde{r}} \neq 0$ with $\tilde{r} \leq r \leq r_1$. Since the rank of $Y$ is $r_1$ by condition $c)$, the data points $x_1,\dots,x_m$ span an $r_1$-dimensional vector subspace. As the vectors $v_1,\dots,v_{\tilde{r}}$ are linearly independent, the sum have to has at least $r_1$ terms. Hence, $\tilde{r} = r = r_1$ and $b_1,\dots,b_{r_1} \neq 0$ as well as $\lambda_1,\dots,\lambda_{r_1} \neq 0$. Finally, the first data point can be expressed by the remaining non-zero coefficients $b_1,\dots,b_{r_1},b_{r_1+1},\dots,b_{r_2}$ through \begin{equation*} x_0 = \sum_{j=1}^{r_2} b_j v_j. \end{equation*} ``$(ii) \implies (i)$''. First, we define the following matrices \begin{align*} &W_{r_1} = \begin{bmatrix} v_1&\dots&v_{r_1} \end{bmatrix} \in \mathbb{C}^{n \times r_1} && W_{r_2} = \begin{bmatrix} v_1&\dots&v_{r_2} \end{bmatrix} \in \mathbb{C}^{n \times r_2} \\ &K_{r_1} = \textnormal{diag}(b_1,\dots,b_{r_1}) \in \mathbb{C}^{r_1 \times r_1} && K_{r_2} = \textnormal{diag}(b_1,\dots,b_{r_2}) \in \mathbb{C}^{r_2 \times r_2} \\ &M_{r_1} = \textnormal{Vand}(\lambda_1,\dots,\lambda_{r_1};1,m) \in \mathbb{C}^{r_1 \times m} && M_{r_2} = \textnormal{Vand}(\lambda_1,\dots,\lambda_{r_1},0,\dots,0;1,m) \in \mathbb{C}^{r_2 \times m} \\ &\Lambda_{r_1} = \textnormal{diag}(\lambda_1,\dots,\lambda_{r_1}) \in \mathbb{C}^{r_1 \times r_1} &&\Lambda_{r_1 \times r_2} = \begin{bmatrix} \Lambda_{r_1} & 0 \end{bmatrix} \in \mathbb{C}^{r_1 \times r_2}. \end{align*} Now, we can rewrite the data matrices $X$ and $Y$ with the above introduced notation by \begin{equation*} X = W_{r_2} K_{r_2} M_{r_2}, \qquad Y = W_{r_1} K_{r_1} \Lambda_{r_1} M_{r_1} = W_{r_1} K_{r_1} \Lambda_{r_1 \times r_2} M_{r_2}. \end{equation*} Consider the linear operator $A_* = W_{r_1} \Lambda_{r_1 \times r_2} W_{r_2} ^+ \in \mathbb{C}^{n \times n}$. This operator exactly connects the data, since \begin{equation*} A_* X = W_{r_1} \Lambda_{r_1 \times r_2} W_{r_2} ^+ W_{r_2} K_{r_2} M_{r_2} = W_{r_1} \Lambda_{r_1 \times r_2} K_{r_2} M_{r_2} = W_{r_1} K_{r_1} \Lambda_{r_1 \times r_2} M_{r_2} = Y. \end{equation*} As a result, the system matrix $A = Y X^+$ is exact, too, because it minimizes the problem $\lVert A X - Y \rVert_F$, i.e., $A X = Y$. By \cref{2:Corollary_AX=Y}, the first assertion $\ker(X) \subseteq \ker(Y)$ is proven. The second claim, $\textnormal{rank}(Y) = r_1$, follows from the application of simple rank inequalities onto $Y = W_{r_1} K_{r_1} \Lambda_{r_1} M_{r_1}$ together with the conditions in $(ii)$. As a consequence, we have $\textnormal{rank}(A) \leq r_1$, which implies that $A$ has at most $r_1$ non-zero eigenvalues. Now, if we prove that $\lambda_1,\dots,\lambda_{r_1}$ are these eigenvalues, then the proof is complete, since this implies the diagonalizability of the system matrix with distinct non-zero eigenvalues (\cref{2:Corollary_DiagoA}). More precisely, we have to show that \begin{equation*} A W_{r_1} K_{r_1} = W_{r_1} K_{r_1} \Lambda_{r_1}. \end{equation*} Note that the column vectors of $W_{r_1} K_{r_1}$ (representing the eigenvectors) are already non-zero by assumption. To prove the equality we consider two cases: 1. case: $r_1 < m$. Defining the matrix $\tilde{M}_{r_1} = \textnormal{Vand}(\lambda_1,\dots,\lambda_{r_1};2,m) \in \mathbb{C}^{r_1 \times m-1}$ (i.e., without the first column), then we obtain by the exactness of the system matrix \begin{equation*} A W_{r_1} K_{r_1} \tilde{M}_{r_1} = W_{r_1} K_{r_1} \Lambda_{r_1} \tilde{M}_{r_1}. \end{equation*} Since the eigenvalues are distinct and $r_1 < m$, the matrix $\tilde{M}_{r_1}$ has a right inverse (which is given by the pseudoinverse), hence, we arrive at the desired assertion. 2. case: $r_1 = m$. From $\textnormal{rank}(Y) = m$ follows $\ker(Y) = \{0\}$ and, consequently, $\ker(X) = \{0\}$ by the already proven condition $a)$. Hence, $\textnormal{rank}(X) = m$, too and by \cref{2:Lemma_DimImKerA}, the system matrix has $\textnormal{rank}(A) = m$ and $\dim~\ker(A) = n-m$. As the second identity geometrically implies $\textnormal{im}(Y) \subseteq \langle v_1,\dots,v_m \rangle$, we obtain the following relationship \begin{equation*} \textnormal{im}(A) \subseteq \textnormal{im}(Y) \subseteq \langle v_1,\dots,v_m \rangle. \end{equation*} Since $\textnormal{rank}(A) = m$ and $v_1,\dots,v_m$ are linearly independent, it follows $\textnormal{im}(A) = \langle v_1,\dots,v_m \rangle$. Consequently, the remaining linearly independent vectors $v_{m+1},\dots,v_{r_2}$ belong to the kernel of the system matrix $A$. Rewriting the matrix $X$ into $X= W_{r_1} K_{r_1} M_{r_1} + q e_1^T$ with $q = \sum_{j=m+1}^{r_2} b_j v_j$ with the first standard basis vector $e_1$, we obtain \begin{equation*} W_{r_1} K_{r_1} \Lambda_{r_1} M_{r_1} = Y = A X = A W_{r_1} K_{r_1} M_{r_1} + A q e_1^T = A W_{r_1} K_{r_1} M_{r_1}, \end{equation*} because $q \in \ker(A)$. Multiplying this equation by $M_{r_1}^+$ from the right side, we obtain the desired algebraic identity, since $M_{r_1}^+$ is a right inverse. \end{proof} \section{Companion Dynamic Mode Decomposition (CDMD)} In 2008, Schmid and Sesterhenn presented the first version of DMD~\cite{schmid:2008:APS}. This variant will be referred to as Companion Dynamic Mode Decomposition (CDMD). CDMD has been investigated by experimental and numerical data by Schmid~\cite{schmid:2010:dmd_numerical_data,schmid:2011:applications_of_dmd}. The first approaches of a theoretic analysis were performed by Rowley et al.~\cite{rowley:2009:spectral_nonlinear_flow}. Before we discuss the derivation of CDMD, the companion matrix will be defined, which is eponymous for this variant of DMD. \begin{definition} For a vector $c = (c_0,\dots,c_{m-1})^T \in \mathbb{C}^m$, we define the matrix $C_c \in \mathbb{C}^{m \times m}$ of the form \begin{equation*} \begin{pmatrix} 0 & 0 & \cdots & c_0 \\ 1 & 0 & \cdots & c_1 \\ \vdots & \ddots & \ddots & \vdots \\ 0 & \hdots & 1 & c_{m-1} \end{pmatrix} \end{equation*} as the companion matrix to the vector $c$. \end{definition} For the derivation of CDMD, we consider a given data set $x_0,\dots,x_m \in \mathbb{C}^n$. Again, we rewrite the data points into the matrices $X = \begin{bmatrix} x_0 & \dots & x_{m-1} \end{bmatrix}$ and $Y = \begin{bmatrix} x_1 & \dots & x_m \end{bmatrix}$. Now, instead of using the system matrix $A$, which connects the matrices $X$ and $Y$ (from the left), i.e., $AX \approx Y$, another approach is to look for a right-hand multiplied matrix $C \in \mathbb{C}^{m \times m}$ such that $Y \approx X C$. By construction, we can choose $C$ as a companion matrix $C_c$ and, hence, the problem reduces to find a vector $c$ such that \begin{equation*} Y = X C_c + q e_m^{T} \end{equation*} with a minimal error $q \in \mathbb{C}^{n}$, where $e_m$ represent the last standard basis vector. Under the assumption $n \gg m$, the companion matrix $C_c \in \mathbb{C}^{m \times m}$ is substantially lower dimensional than the system matrix $A \in \mathbb{C}^{n \times n}$. In addition, with decreasing error $q$ the companion matrix approximates the spectral-theoretic properties of $A$. In fact, for an eigenvector $v$ of $C_c$ to the eigenvalue $\lambda$ the transformed eigenvector $\vartheta = X v$ satisfies \begin{equation*} A \vartheta = A X v \approx X C_c v = X \lambda v = \lambda \vartheta. \end{equation*} In sum, the computation of $C_c$ is reduced to the calculation of the associated vector $c = (c_0,\dots,c_{m-1})^T$. This vector minimizes the error $q = x_m - Xc$ and hence only need to solve the following minimization problem \begin{equation*} \min_{c \in \mathbb{C}^{m}} \lVert X c - x_m \rVert_2^2, \end{equation*} which will be solved by $c = X^+ x_m$. Consequently, we can formulate CDMD as an algorithm, however, before, we define the companion matrix to a given data set. \begin{definition} For data $x_0,\dots,x_m \in \mathbb{C}^n$ with associated matrix $X = \begin{bmatrix} x_0 & \dots & x_{m-1} \end{bmatrix}$, we call the companion matrix $C_c$ to the vector $c = X^+ x_m \in \mathbb{C}^m$ the companion matrix to the data $x_0,\dots,x_m$. \end{definition} \begin{algorithm}[Companion Dynamic Mode Decomposition (CDMD)] \label{3:Algorithmus_CDMD} \leavevmode\newline Input: Data $x_0,\dotso,x_m \in \mathbb{C}^n$. \\ Output: DMD eigenvalues $\lambda_1,\dotso,\lambda_m \in \mathbb{C}$, DMD modes $\vartheta_1,\dotso,\vartheta_m \in \mathbb{C}^n$, and DMD amplitudes $a_1,\dots,a_m \in \mathbb{C}$. \begin{enumerate} \item Define the matrices $X:= \begin{bmatrix} x_0&\dotso&x_{m-1} \end{bmatrix}, Y:= \begin{bmatrix} x_1&\dotso&x_{m} \end{bmatrix} \in \mathbb{C}^{n \times m}$. \item Compute the $c = X^+x_m \in \mathbb{C}^m$. \item Construct the companion matrix $C_c \in \mathbb{C}^{m \times m}$ to the vector $c$. \item Compute the DMD eigenvalues $\lambda_1,\dots,\lambda_m$ and eigenvectors $W^{-1} = \begin{bmatrix} v_1&\dotso&v_m \end{bmatrix}$ of $C_c$ to the vector $c$. \item Calculate DMD modes $\Theta = \begin{bmatrix} \vartheta_1&\dotso&\vartheta_m \end{bmatrix} = X W^{-1} \in \mathbb{C}^{n \times m}$. \item Compute the DMD amplitudes by $K = \textnormal{diag}(a_1,\dots,a_m) =(\textnormal{Vand}(\lambda_1,\dots,\lambda_m) W^{-1})^+$. \end{enumerate} \end{algorithm} The algorithm described here differs from the standard literature as we introduce the necessary concept of DMD amplitudes. Note, that the matrix $K$ in step $6$, which defines the DMD amplitudes, may not be diagonal. However, if the eigenvalues are distinct, then $K$ is a diagonal matrix, as we will observe later. The current definition of the DMD amplitudes seems to be obscure and not very intuitive. Later on, we will show that these DMD amplitudes are the right scaling factors for an exact reconstruction. In addition, we will prove that this choice equals $(a_1,\dots,a_m)^T = \Theta^+ x_0$ under some further assumption. For a theoretical investigation, we need a more compact representation of the companion matrix $C_c$ from \cref{3:Algorithmus_CDMD}. To this end, consider the following minimization problem \begin{equation*} \min_{C \in \mathbb{C}^{m \times m}} \lVert X C - Y \rVert_F^2, \end{equation*} which is closely related to the construction of the companion matrix. An explicit solution of the minimization problem is given by $C = X^+ Y \in \mathbb{C}^{m \times m}$. This matrix will be captured in the following definition. \begin{definition} For data $x_0,\dots,x_m \in \mathbb{C}^n$ with associated matrices $X = \begin{bmatrix} x_0 & \dots & x_{m-1} \end{bmatrix}$ and $Y = \begin{bmatrix} x_1 & \dots & x_m \end{bmatrix}$, we call the matrix $C = X^+ Y \in \mathbb{C}^{n \times n}$ the twisted system matrix to the data $x_0,\dots,x_m$. \end{definition} \begin{remark} At first glance, the two approaches seems to be equivalent. However, note that the twisted system matrix $C$ and the companion matrix $C_c$ are not necessarily equal or similar. This fact can be observed by a rank truncation of the matrices $X$ and $Y$. In particular, the companion matrix $C_c$ has at least rank $m-1$, because the first $m-1$ columns are linearly independent. However, the rank of the matrix $C = X^+ Y$ depends only on the matrices $X$ and $Y$ and therefore it may be less than $m-1$, which implies a non-similarity in general. \end{remark} The following lemma and corollary characterize the relations between the three objects $A, C$, and $C_c$. \begin{lemma} \label{3:Lemma_C_C_c_A} Let the system matrix $A$, the twisted system matrix $C$, and the companion matrix $C_c$ be given to the data $x_0,\dots,x_m \in \mathbb{C}^n$ as well as the projections $P_X = X X^+$ and $P_{X^*} = X^+ X$ onto $\textnormal{im}(X) \subseteq \mathbb{C}^n$ and $\textnormal{im}(X^*) \subseteq \mathbb{C}^m$, respectively. Then the following assertions hold: \begin{enumerate} \item[(1)] $X^+ q = 0$, especially $Aq = 0$. \item[(2)] $P_{X^*} C_c = C = X^+ A X$. \item[(3)] $X C_c X^+ = X C X^+ = P_{X} A$. \end{enumerate} \end{lemma} \begin{proof} The identities are proven by simple algebraic manipulations. \end{proof} A direct consequence of this lemma is that the twisted system matrix and the companion matrix are equal, if the first $m$ snapshots are linearly independent. In addition, in the case of $n \gg m$, it illustrates that the companion matrix $C_c \in \mathbb{C}^{m \times m}$ is a low-dimensional representation of the system matrix $A \in \mathbb{C}^{n \times n}$. \begin{corollary} \label{3:Corollary_C_C_c_A} Let the system matrix $A$, the twisted system matrix $C$ and the companion matrix $C_c$ be given to the data $x_0,\dots,x_m \in \mathbb{C}^n$. If $x_0,\dots,x_{m-1}$ are linearly independent, then the following assertions hold: \begin{enumerate} \item[(1)] $C_c = C$. \item[(2)] $C_c = X^+ A X$. \end{enumerate} \end{corollary} \begin{proof} Since $x_0,\dots,x_{m-1}$ are linearly independent, the identity $X^+ X = I$ holds, which implies the assertions by \cref{3:Lemma_C_C_c_A} \end{proof} The property of a low-dimensional representation suggests that CDMD inherits the characteristic reconstruction of the system matrix. Indeed, the following theorem proves this fact using the new concept of DMD amplitudes from \cref{3:Algorithmus_CDMD}. In the literature a similar theorem is known~\cite[Theorem 1]{rowley:2009:spectral_nonlinear_flow} that does not account for amplitudes. Hence, the choice of the corresponding modes is not appropriate for the reconstruction as these are computed up to a scaling (since they stem from eigenvectors). \begin{theorem}[Reconstruction-property of CDMD] \label{3:Thoerem_Reconst_CDMD} Let DMD eigenvalues $\lambda_1,\dots,\lambda_m$, DMD amplitudes $a_1,\dots,a_m$, and DMD modes $\vartheta_1,\dots,\vartheta_m$ be given by \cref{3:Algorithmus_CDMD} to the data $x_0,\dots,x_m \in \mathbb{C}^n$. If the DMD eigenvalues $\lambda_1,\dots,\lambda_m$ are distinct, then the following identities hold: \begin{equation*} x_k = \sum_{j=0}^m \lambda_j^k a_j \vartheta_j, \qquad x_m = \sum_{j=0}^m \lambda_j^m a_j \vartheta_j + q, \end{equation*} for $k = 0,\dotso,m-1$ and $q = x_m - Xc$. \end{theorem} \begin{proof} Since the eigenvalues are distinct, the companion matrix $C_c$ will be diagonalized by the Vandermonde matrix: \begin{equation*} \textnormal{Vand}(\lambda_1,\dots,\lambda_m) C_c \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1} = \Lambda. \end{equation*} However, the eigenvectors $\begin{bmatrix} z_1 & \dots & z_m \end{bmatrix} = \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1}$ may not coincide with the eigenvectors $v_1,\dots,v_m$ of the companion matrix produced by \cref{3:Algorithmus_CDMD}. As the eigenvalues are distinct, there exist scaling factors $\alpha_1,\dots,\alpha_m \in \mathbb{C}$ such that for $j = 1,\dots,m$: \begin{equation*} \alpha_j v_j = z_j. \end{equation*} For the eigenvectors $v_1,\dots,v_m$ and scaling factors $\alpha_1,\dots,\alpha_m$ we define the matrices $W^{-1} = \begin{bmatrix} v_1 & \dots & v_m \end{bmatrix}$ and $K = \textnormal{diag}(\alpha_1,\dots,\alpha_m$), respectively. As a result, we get the following connection \begin{equation*} W^{-1} K = \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1}. \end{equation*} Consequently, $K = (\textnormal{Vand}(\lambda_1,\dots,\lambda_m) W^{-1})^{-1}$, which shows that $K$ equals the matrix in step $6$ of \cref{3:Algorithmus_CDMD} consisting of the DMD amplitudes, i.e., $\alpha_j = a_j$ for $j =1,\dots,m$. Multiplying the above equation by the matrix $X$, we obtain \begin{equation*} X W^{-1} K = X \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1}. \end{equation*} By this notation the DMD modes $\Theta = \begin{bmatrix} \vartheta_1&\dots&\vartheta_m \end{bmatrix}$ are given by $\Theta = X W^{-1}$ and, therefore, the first assertions follows by rearranging the above equation to $X = \Theta K \textnormal{Vand}(\lambda_1,\dots,\lambda_m)$. The second identity is a result of the following calculation \begin{align*} x_m = Xc + q = XCe_m^T + q &= \Theta K \textnormal{Vand}(\lambda_1,\dots,\lambda_m) C e_m^T + q \\ &= \Theta K \Lambda \textnormal{Vand}(\lambda_1,\dots,\lambda_m) e_m^T + q \\ &= \sum_{j=0}^m \lambda_j^m a_j \vartheta_j + q. \end{align*} \end{proof} \begin{corollary} \label{3:Corollary_Ampltidues_CDMD_Alternative} Let DMD eigenvalues $\lambda_1,\dots,\lambda_m$, DMD amplitudes $a_1,\dots,a_m$, and DMD modes $\vartheta_1,\dots,\vartheta_m$ be given by \cref{3:Algorithmus_CDMD} to the data $x_0,\dots,x_m \in \mathbb{C}^n$. If the DMD eigenvalues $\lambda_1,\dots,\lambda_m$ are distinct and $x_0,\dots,x_{m-1}$ are linearly independent, then the DMD amplitudes $a = (a_1,\dots,a_m)^T$ can be calculated by \begin{equation*} a = \Theta^+ x_0. \end{equation*} \end{corollary} \begin{proof} By \cref{3:Thoerem_Reconst_CDMD}, we obtain the relation $x_0 = \Theta a$, where $\Theta = \begin{bmatrix} \vartheta_1&\dots&\vartheta_m \end{bmatrix} = X W^{-1}$ with $W^{-1} = \begin{bmatrix} v_1 & \dots & v_m \end{bmatrix}$. Since the matrix $X$ and $W^{-1}$ have full rank, the DMD modes will be linear independent and, consequently, there exist a left-inverse of $\Theta$, which is given by its pseudoinverse $\Theta^+$. Hence, $ a = \Theta^+ x_0$. \end{proof} Even though, the method of CDMD is mathematically correct, a practical implementation leads to an ill-conditioned algorithm~\cite{schmid:2010:dmd_numerical_data}. The reason for this is the external computation of the vector $c$ (which define companion matrix $C_c$) that leads to unsatisfied approximation properties of the system matrix $A$. This problem can be tackled by using the robust singular value decomposition (SVD), and will be discussed in the next section. \section{SVD-Dynamic Mode Decomposition (SDMD)} In 2010, the algorithm of DMD was modified radically by Schmid. He published a variant of DMD based on a reduced singular value decomposition~\cite{schmid:2010:dmd_numerical_data}. For this reason, we will denote this method by SVD-Dynamic Mode Decomposition (SDMD). The result was a robust and stable algorithm, which serves as a basis for the most modern version of DMD. We start this section by deducing this algorithm. Let the system matrix $A$ to the data $x_0,\dots,x_m \in \mathbb{C}^n$ be given as well as the reduced singular value decomposition of $X$ with $r= \textnormal{rank}(X)$ and $X=U\Sigma V^* \in \mathbb{C}^{n \times m}$, where $U\in \mathbb{C}^{n \times r}$, $V \in \mathbb{C}^{m \times r}$ and $\Sigma \in \mathbb{R}^{r \times r}$. Utilizing the transformation matrix $U$, we construct the low-dimensional representation $S$ of the system matrix $A$ by \begin{equation*} S := U^* A U \in \mathbb{C}^{r \times r}. \end{equation*} For an explicit calculation of $S$, it is necessary to avoid the computation of the system matrix $A$. To this end, we calculate \begin{equation*} S = U^* A U = U^* A U \Sigma V^* V \Sigma^{-1} = U^* A X V \Sigma^{-1} = U^* Y V\Sigma^{-1}. \end{equation*} Now, we compute the eigenvalues $\lambda_i$ and eigenvectors $v_i$ of the matrix $S$ and finally transform them by the matrix $U$ into \begin{equation*} \vartheta_i := Uv_i \in \mathbb{C}^n, \end{equation*} in order to obtain an approximation of the eigenvalues and eigenvectors of the system matrix: \begin{equation*} A \vartheta_i = A U v_i \approx U U^* A U v_i = U S v_i = U \lambda v_i = \lambda \vartheta_i. \end{equation*} Consequently, the algorithm can be formulated as follows. \begin{algorithm}(SVD-Dynamic Mode Decomposition) \leavevmode\newline Input: Data $x_0,\dotso,x_m \in \mathbb{C}^n$. \label{4:Algorithmus_SDMD} \\ Output: DMD eigenvalues $\lambda_1,\dotso,\lambda_r \in \mathbb{C}$, DMD modes $\vartheta_1,\dotso,\vartheta_r \in \mathbb{C}^n$, and DMD amplitudes $a_i,\dots,a_r \in \mathbb{C}$. \begin{enumerate} \item Define the matrices $X:=(x_0,\dotso,x_{m-1}), Y:=(x_1,\dotso,x_m) \in \mathbb{C}^{n \times m}$. \item Compute the reduced singular value decomposition $X=U\Sigma V^*$ with $r = \textnormal{rank}(X)$. \item Define the DMD matrix $S:=U^*YV\Sigma^{-1} \in \mathbb{C}^{r \times r}$. \item Compute the DMD eigenvalues $\lambda_i$ and eigenvectors $v_i$ of $S$. \item Calculate the DMD modes $\vartheta_i=Uv_i \in \mathbb{C}^n$ and define $\Theta = (\vartheta_1,\dots,\vartheta_r) \in \mathbb{C}^{n \times r}$. \item Compute the DMD amplitudes $a=\Theta^+ x_0 \in \mathbb{C}^r$ with $a=(a_1,\dots,a_r)^T$. \end{enumerate} \end{algorithm} In \cref{4:Algorithmus_SDMD}, the DMD amplitudes will be defined intuitively by a best-fit linear combination of the first snapshots $x_0$ in the modes selection (compare \cref{3:Corollary_Ampltidues_CDMD_Alternative}). For a deeper understanding of SDMD, we first characterize the connection to CDMD, which will be examined in the following lemma. \begin{lemma} \label{4:Lemma_CS_similar} Let the companion matrix $C_c$ and the DMD matrix $S$ be given by \cref{4:Algorithmus_SDMD} to the data $x_0,\dotso,x_m \in \mathbb{C}^n$. Then the following identity holds: \begin{equation*} S = (\Sigma V^*) C_c (V \Sigma^{-1}). \end{equation*} In particular, if $x_0,\dotso,x_{m-1}$ are linearly independent, then the matrices $C_c$ and $S$ are similar. \end{lemma} \begin{proof} By \cref{3:Lemma_C_C_c_A} and the reduced singular value decomposition $X = U \Sigma V^*$, we obtain \begin{align*} S = U^* Y V \Sigma^{-1} &= U^* (X C_c + q e_m^T) V \Sigma^{-1} \\ &= \Sigma V^* X^+ ( X C_c + q e_m^T ) V \Sigma^{-1} = \Sigma V^* X^+ X C_c V \Sigma^{-1} = \Sigma V^* C_c V \Sigma^{-1} \end{align*} \end{proof} \begin{corollary} Let the data $x_0,\dotso,x_m \in \mathbb{C}^n$ be given. If $x_0,\dotso,x_{m-1}$ are linearly independent, then CDMD and SDMD produce the same DMD eigenvalues. \end{corollary} The corollary suggests that the reconstruction property of CDMD from \cref{3:Thoerem_Reconst_CDMD} will be also transferred onto SDMD. In the case of distinct DMD eigenvalues, the DMD modes associated to equal eigenvalues only differ by a scaling factor. Therefore, the DMD modes of SDMD have to be rescaled for an exact reconstruction. The following theorem shows the reconstruction property of SDMD, where the scaling factors are given by the DMD amplitudes. \begin{theorem}[Reconstruction-property SDMD] \label{4:Thoerem_Reconst_SDMD} Let DMD eigenvalues $\lambda_1,\dots,\lambda_m$, \allowbreak DMD amplitudes $a_1,\dots,a_m$, and DMD modes $\vartheta_1,\dots,\vartheta_m$ be given by \cref{4:Algorithmus_SDMD} to the data $x_0,\dotso,x_m \in \mathbb{C}^n$, where $x_0,\dotso,x_{m-1}$ are linearly independent. If the DMD eigenvalues are distinct, then the following identities hold: \begin{equation*} x_k = \sum_{j=1}^m {\lambda_j^k a_j \vartheta_j}, \hspace{20pt} x_m = \sum_{j=1}^m {\lambda_j^m a_j \vartheta_j} + q \end{equation*} for $k = 0,\dotso,m-1$ and $q = x_m - Xc$ with $c = X^+x_m$. \end{theorem} \begin{proof} By the notation of the proof of \cref{3:Thoerem_Reconst_CDMD} and \cref{4:Lemma_CS_similar} we obtain \begin{align*} W S W^{-1} = \Lambda &= \textnormal{Vand}(\lambda_1,\dots,\lambda_m) C_c \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1} \\ &= \textnormal{Vand}(\lambda_1,\dots,\lambda_m) (\Sigma V^*)^{-1} S (\Sigma V^*) \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1}, \end{align*} where the matrix $W^{-1}$ contains the eigenvectors of $S$. Consider a scaling matrix $K=\text{diag}(\alpha_1,\dotso,\alpha_m)$ that satisfies the equation \begin{equation*} W^{-1} K = (\Sigma V^*) \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1}. \end{equation*} Since the scaling matrix $K$ adjusts eigenvectors (in the same one-dimensional eigenspace), the scaling factors are $\alpha_1,\dots,\alpha_m \neq 0$ and, therefore, the matrix $K$ is invertible. By multiplying the above equation with $U$ from the left, we obtain \begin{equation*} \Theta K = U W^{-1} K = U (\Sigma V^*) \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1} = X \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1}, \end{equation*} where $\Theta = U W^{-1}$ are the DMD modes (by \cref{4:Algorithmus_SDMD}). In sum, we obtain \begin{equation*} X = \Theta K \textnormal{Vand}(\lambda_1,\dots,\lambda_m), \end{equation*} which shows the first identity concerning the scalings $\alpha_1,\dots,\alpha_m$. The second statement follows analogously by \begin{align*} x_m = X C e_m^T + q &= \Theta K \textnormal{Vand}(\lambda_1,\dots,\lambda_m) C e_m^T + q \\ &= \Theta K \Lambda \textnormal{Vand}(\lambda_1,\dots,\lambda_m) e_m^T + q \\ &= \sum_{j=1}^m {\lambda_j^m a_j \vartheta_j} + q. \end{align*} It misses to show that the scaling factors $\alpha_i$ are given by the DMD amplitudes $a_i$. Rewriting $\alpha = (\alpha_1,\dots,\alpha_m)^T$ and using the identity $X \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1} e = x_0$ (from \cref{3:Thoerem_Reconst_CDMD}), we obtain: \begin{align*} \alpha = K e &= W \Sigma V^* \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1} e \\ &= W U^* X \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1} e = W U^* x_0 = \Theta^{-1} x_0 = a. \end{align*} \end{proof} \begin{remark} \label{4:Remark_EigenvalueEquation_with_Projection} SDMD is characterized by the robust singular value decomposition and the reconstruction property. However, the spectral-theoretical connection of SDMD to the system matrix is not clear. Therefore, let the system matrix $A$ as well as DMD eigenvalues $\lambda_1,\dots,\lambda_m$ and DMD modes $\vartheta_1,\dots,\vartheta_m$ be given by \cref{4:Algorithmus_SDMD} to the data $x_0,\dotso,x_m \in \mathbb{C}^n$. Then the following equation hold: \begin{equation*} \lambda_i \vartheta_i = \lambda_i U v_i = U S v_i = U U^* Y V \Sigma^{-1} v_i = U U^* Y V \Sigma^{-1} U^* U v_i = U U^* Y X^+ \vartheta_i = U U^* A \vartheta_i. \end{equation*} We observe that the eigenvalue equation is correct up to the projection $P_X = X X^+ = U U^*$ onto the image of $X$. \end{remark} The following proposition presents characterizations for the equality of the eigenvector equation of \cref{4:Remark_EigenvalueEquation_with_Projection}. \begin{proposition} \label{4:Proposition_SDMD_A_Characterization} Let the system matrix $A$ as well as DMD eigenvalues $\lambda_1,\dots,\lambda_m$ and DMD modes $\vartheta_1,\dots,\vartheta_m$ be given by \cref{4:Algorithmus_SDMD} to the data $x_0,\dotso,x_m \in \mathbb{C}^n$. In addition, let the error $q = x_m - Xc$ with $c = X^+ x_m$ be given. Then the following assertions are equivalent: \begin{itemize} \itemsep0pt \item[(i)] The DMD mode $\vartheta_i$ is an eigenvector of the system matrix $A$ to the eigenvalue $\lambda_i$. \item[(ii)] $A \vartheta_i \in \langle x_0,\dots,x_{m-1} \rangle$. \item[(iii)] $ \langle e_m, X^+ \vartheta_i \rangle \cdot q = 0$. \item[(iv)] $x_m \in \langle x_0,\dots,x_{m-1}\rangle$ or $\langle e_m,V \Sigma^{-1} v_i \rangle = 0$. \end{itemize} \end{proposition} \begin{proof} Let the companion matrix $C_c$ to the data $x_0,\dots,x_m$ be given. $(iii) \implies (ii)$ By \cref{3:Lemma_C_C_c_A} we obtain the equality \begin{equation*} P_X A \vartheta_i = X C_c X^+ \vartheta_i = X C_c X^+ \vartheta_i + q e_m^T X^+ \vartheta_i = [XC_c + q e_m^T] X^+ \vartheta_i = Y X^+ \vartheta_i = A \vartheta_i, \end{equation*} which implies $A \vartheta_i \in \text{im}(X)$, i.e. $A \vartheta_i \in \langle x_0,\dots,x_{m-1} \rangle$. ``$(ii) \implies (i)$'' Let $A \vartheta_i \in \langle x_0,\dots,x_{m-1} \rangle$. Then the (algebraic) eigenvalue equation is trivially satisfied, since the projection $P_X$ can be ignored in the equation of \cref{4:Remark_EigenvalueEquation_with_Projection}. Furthermore, since the columns of $U$ are orthogonal and $v_i \neq 0$, the vector $\vartheta_i = U v_i$ is non-zero and, therefore, an eigenvector of $A$. ``$(i) \implies (iii)$'' By the preliminary \cref{4:Remark_EigenvalueEquation_with_Projection}, \cref{3:Lemma_C_C_c_A}, and assumption (i), we obtain \begin{equation*} 0 =A \vartheta_i - \lambda_i \vartheta_i = Y X^+ \vartheta_i - P_X A \vartheta_i = [XC_c + q e_m^T] X^+ \vartheta_i - X C_c X^+ \vartheta_i = q e_m^T X^+ \vartheta_i. \end{equation*} ``$(iii) \iff (iv)$'' We reformulate the conditions by \begin{align*} \langle e_m, X^+ \vartheta_i \rangle \cdot q = 0 & \iff q = 0 \text{ or } \langle e_m,X^+ \vartheta_i \rangle = 0 \\ & \iff q = 0 \text{ or } \langle e_m , V \Sigma^{-1} U^* U v_i \rangle = 0 \\ & \iff x_m \in \langle x_0,\dots,x_{m-1} \rangle \text{ or } \langle e_m , V \Sigma^{-1} v_i \rangle = 0. \end{align*} \end{proof} A trivial consequence of the above proposition is the following corollary, which was first proven by Tu et al.~\cite{tu:2014:on_dmd_theorey_and_app}. \begin{corollary} \label{4:Corollary_SDMD_A_Characterization} Let the system matrix $A$ as well as DMD eigenvalues $\lambda_1,\dots,\lambda_m$ and DMD modes $\vartheta_1,\dots,\vartheta_m$ be given by \cref{4:Algorithmus_SDMD} to the data $x_0,\dotso,x_m \in \mathbb{C}^n$. If $x_m \in \allowbreak \langle \allowbreak x_0, \allowbreak \dots,x_{m-1} \allowbreak \rangle $, then the DMD modes and DMD eigenvalues are eigenvectors and eigenvalues of the system matrix $A$, respectively. \end{corollary} The previous statement implies $\sigma(S) \subseteq \sigma(A)$. However, the other inclusion is also true for all non-zero eigenvalues of the system matrix $A$~\cite{tu:2014:on_dmd_theorey_and_app}. \begin{proposition} \label{4:Propostion_AllEigenvaluesCalculated} Let the system matrix $A$ as well as DMD eigenvalues $\lambda_1,\dots,\lambda_m$ and DMD modes $\vartheta_1,\dots,\vartheta_m$ be given by \cref{4:Algorithmus_SDMD} to the data $x_0,\dotso,x_m \in \mathbb{C}^n$. Then all non-zero eigenvalues $\lambda \neq 0$ of $A$ will be calculated by DMD, i.e., it holds \begin{equation*} \sigma(A) \setminus \{0\} \subseteq \sigma(S). \end{equation*} \end{proposition} \begin{proof} For an arbitrary eigenvector $z$ of $A$ to the eigenvalue $\lambda \neq 0$, we obtain by defining the vector $v:= U^*z$: \begin{equation*} S v = U^* Y V \Sigma^{-1} U^* z = U^* Y X^+ z = U^* A_\varphi z = U^* \lambda z = \lambda v. \end{equation*} Assume $v = 0$. Then $U^*z=0$ and we obtain \begin{equation*} 0 = Y V \Sigma^{-1} U^* z = Y X^+ z = A z = \lambda z. \end{equation*} As $z \neq 0$, it follows $\lambda = 0$, which contradicts the assumptions. \end{proof} Consequently, under appropriate assumptions of the data, we obtain the spectral-theoretic relation \begin{equation*} \sigma(A) \setminus \{0\} \subseteq \sigma(S) \subseteq \sigma(A). \end{equation*} However, the condition $x_m \in \langle x_0,\dots,x_{m-1}\rangle$ in \cref{4:Corollary_SDMD_A_Characterization} is actually never satisfied in the case of $n \gg m$ and, hence, not practically applicable. This raises the question, whether the DMD modes can be modified such that we obtain eigenvectors of the system matrix without any assumptions. A solution to this problem is presented in the next theorem, which is inspired by the assertion $(iii)$ in \cref{4:Proposition_SDMD_A_Characterization}. \begin{theorem} \label{4:Theorem_Modification_Modes} Let the system matrix $A$ as well as DMD eigenvalues $\lambda_1,\dots,\lambda_m$ and DMD modes $\vartheta_1,\dots,\vartheta_m$ be given by \cref{4:Algorithmus_SDMD} to the data $x_0,\dotso,x_m \in \mathbb{C}^n$. In addition, let the error $q = x_m - Xc$ with $c = X^+ x_m$ be given. For $\lambda_i \neq 0$ \begin{equation*} \zeta_i = \vartheta_i + \frac{1}{\lambda_i} \langle e_m, X^+ \vartheta_i \rangle \cdot q \end{equation*} is an eigenvector of the system matrix $A$ to the eigenvalue $\lambda_i$. \end{theorem} \begin{proof} By \cref{3:Lemma_C_C_c_A} and \cref{4:Remark_EigenvalueEquation_with_Projection}, we obtain the eigenvalue equation by \begin{align*} A \zeta_i &= A \vartheta_i + \frac{1}{\lambda_i} \langle e_m, X^+ \vartheta_i \rangle \cdot A q = A \vartheta_i = Y X^+ \vartheta_i = [XC_c + q e_m^T] X^+ \vartheta_i \\ &= XC_cX^+ \vartheta_i + q e_m^T X^+ \vartheta_i = P_X \vartheta_i + \langle e_m, X^+ \vartheta_i \rangle \cdot q = \lambda_i \vartheta_i + \langle e_m, X^+ \vartheta_i \rangle \cdot q = \lambda_i \zeta_i. \end{align*} Assume $\zeta = 0$. Then we obtain \begin{equation*} 0 = X^+ \zeta = X^+ (\vartheta_i + \frac{1}{\lambda_i} \langle e_m, X^+ \vartheta_i \rangle \cdot q) = X^+ \vartheta_i, \end{equation*} and therefore \begin{equation*} 0 = U^* Y X^+ \vartheta_i = U^* Y V \Sigma^{-1} U^* U v_i = S v_i = \lambda v_i. \end{equation*} Since $v_i \neq 0$, it follows $\lambda = 0$, which contradicts the assumption. \end{proof} The previous proposition characterizes exactly the spectral-theoretic relation between the DMD matrix $S$ and the system matrix $A$. In fact, it holds $\sigma(A) \setminus \{0\} \subseteq \sigma(S) \subseteq \sigma(A)$ (without any assumption) and thus \begin{equation*} \sigma(A) \setminus \{0\} = \sigma(S) \setminus \{0\}. \end{equation*} Consequently, the dynamic behavior of the system matrix $A$ will be completely captured by the low-dimensional DMD matrix $S$. However, the DMD modes have to be modified according to \cref{4:Theorem_Modification_Modes} in order to get eigenvectors of the system matrix. This motivates the formulation of a new variant of DMD with modified DMD modes and possibly new DMD amplitudes such that the reconstruction property is preserved. In particular, as \cref{4:Theorem_Modification_Modes} states, only the non-zero eigenvalues can be used. Nevertheless, these eigenvalues are sufficient to capture the temporal evolution and consequently no dynamical information is lost. \begin{remark} \label{4:Remark_Modification_Modes_Adjustment} For the formulation of an efficient algorithm, we need a more compact representation of the modified DMD modes $\zeta_i$, which arises directly from transformations of the eigenvectors of $S$. By \cref{4:Remark_EigenvalueEquation_with_Projection} and \cref{3:Lemma_C_C_c_A}, we rearrange the modified DMD modes by \begin{align*} \zeta_i &= \vartheta_i + \frac{1}{\lambda_i} \langle e_m, X^+ \vartheta_i \rangle \cdot q = \frac{1}{\lambda_i} \lambda_i \vartheta_i + \frac{1}{\lambda_i} q e_m^T X^+ \vartheta_i = \frac{1}{\lambda_i} P_X A \vartheta_i + \frac{1}{\lambda_i} q e_m^T X^+ \vartheta_i \\ &= \frac{1}{\lambda_i} X C_c X^+ \vartheta_i + \frac{1}{\lambda_i} q e_m^T X^+ \vartheta_i = \frac{1}{\lambda_i} (X C_c + q e_m^T) X^+ \vartheta_i = \frac{1}{\lambda_i} Y X^+ \vartheta_i = \frac{1}{\lambda_i} Y V \Sigma^{-1} v_i. \end{align*} \end{remark} Defining the DMD modes in this way, we obtain the most modern version of DMD, called Exact-Dynamic Mode Decomposition (EXDMD). In the following section, we will introduce this variant of DMD. \section{Exact-Dynamic Mode Decomposition (EXDMD)} In 2014, Tu et. al.~\cite{tu:2014:on_dmd_theorey_and_app} presented the most modern version of DMD, called Exact-Dynamic Mode Decomposition (EXDMD). However, the algorithm presented here differs from the standard literature as we use a different definition of the DMD amplitudes. In addition, we introduce a novel relevant variable: The error scaling. \begin{algorithm}[Exact-Dynamic Mode Decomposition] \leavevmode\newline Input: Data $x_0,\dotso,x_m \in \mathbb{C}^n$. \label{5:Algorithmus_EXDMD} \\ Output: DMD eigenvalues $\lambda_1,\dotso,\lambda_{r_0} \in \mathbb{C}$, DMD modes $\vartheta_1,\dotso,\vartheta_{r_0} \in \mathbb{C}^n$, DMD amplitudes $a_1,\dots,a_{r_0} \in \mathbb{C}$, and the error scaling $a_0$. \begin{enumerate} \item Define the matrices $X:=(x_0,\dotso,x_{m-1}), Y:=(x_1,\dotso,x_m) \in \mathbb{C}^{n \times m}$. \item Compute the reduced singular value decomposition $X=U\Sigma V^*$ with $r = \textnormal{rank}(X)$. \item Define the DMD matrix $S:=U^*YV\Sigma^{-1} \in \mathbb{C}^{r \times r}$. \item Compute the DMD eigenvalues $\lambda_i$ and eigenvectors $v_i$ of $S$. \item Calculate the DMD modes $\vartheta_i= \frac{1}{\lambda_i} Y V \Sigma^{-1} v_i \in \mathbb{C}^n$ and define $\Theta = (\vartheta_1,\dots,\vartheta_{r_0}) \mathbb{C}^{n \times {r_0}}$. \item Compute the DMD amplitudes $a=\Lambda^{-1} \Theta^+ x_1 \in \mathbb{C}^r$ with $a=(a_1,\dots,a_{r_0})^T$. \item Calculate the error scaling $a_0 = -\sum_{j=1}^{r_0} \frac{1}{\lambda_j} \prod_{\substack{k=1 \\ k \neq i}}^{r_0} \frac{1}{\lambda_j - \lambda_k} \in \mathbb{C}$, if it exists. \end{enumerate} \end{algorithm} The introduction of the error scaling $a_0$ and the fundamental change of the definition of the DMD amplitude will be justified by the subsequent theorem, which proves the reconstruction property of EXDMD. The reconstruction property of EXDMD, however, differs from the previous ones of CDMD (see \cref{3:Thoerem_Reconst_CDMD}) and SDMD (see \cref{4:Thoerem_Reconst_SDMD}). The reason for this is the spectral-theoretic relation of EXDMD to the system matrix, as we will examine in the proof. \begin{lemma} \label{5:Lemma_kerXkerY_kerXneq0} Let data $x_0,\dotso,x_m \in \mathbb{C}^n$ with associated matrices $X = \begin{bmatrix} x_0 & \dots & x_{m-1} \end{bmatrix}$ and $Y = \begin{bmatrix} x_1 & \dots & x_{m} \end{bmatrix}$ be given. If $ker(X) \subseteq ker(Y)$ and $\ker(X) \neq \{0\}$, then $x_m \in \textnormal{im}(X)$. In particular, it holds $\textnormal{im}(X) \subseteq \textnormal{im}(Y)$. \begin{proof} Since the kernel of $X$ is non-trivial, there exist a vector $v=(v_1,\dotso,v_m)^T \neq 0 \in \mathbb{C}^m$ with $Xv = 0$. Since $\ker(X) \subseteq \ker(Y)$, we obtain $Yv = 0$. 1. case: $v_m \neq 0$. Then the equation $v_1 x_1 + \dots v_m x_m = 0$ implies \begin{equation*} x_m = -\frac{1}{v_m}( v_1 x_1 + \dotso + v_{m-1} x_{m-1}) = -\frac{v_1}{v_m} x_1 - \dotso -\frac{v_{m-1}}{v_m} x_{m-1}, \end{equation*} and hence the assertion is proven. 2. case: $v_m = 0$. Then we obtain \begin{equation*} 0 = Y \begin{pmatrix} v_1 \\ \vdots \\ v_{m-1} \\ 0 \end{pmatrix} = X \begin{pmatrix} 0 \\ v_1 \\ \vdots \\ v_{m-1} \end{pmatrix} . \end{equation*} By assumption $\ker(X) \subseteq \ker(Y)$, we obtain \begin{equation*} X \begin{pmatrix} 0 \\ v_1 \\ \vdots \\ v_{m-1} \end{pmatrix} = 0 \implies Y \begin{pmatrix} 0 \\ v_1 \\ \vdots \\ v_{m-1} \end{pmatrix} = 0. \end{equation*} If $v_{m-1} \neq 0$, then we get a representation of $x_m$ analogous to the firstcase. Otherwise, we repeat this steps as long as an entry $v_{j} \neq 0$ appears. As $v$ is non-zero, there exists such an entry $v_{j_0} \neq 0$. \end{proof} \end{lemma} \begin{theorem}[Reconstruction property EXDMD] \label{5:Theorem_Reconst-EXDMD} Let DMD eigenvalues $\lambda_1,\dots,\lambda_r$, DMD amplitudes $a_1,\dots,a_r$, DMD modes $\vartheta_1,\dots,\vartheta_r$, and the error scaling $a_0$ be given by \cref{5:Algorithmus_EXDMD} to the data $x_0,\dotso,x_m \in \mathbb{C}^n$. If $\ker(X) \subseteq \ker(Y)$ and the DMD eigenvalues are distinct, then the following identities hold: \begin{equation*} x_0 = \sum_{j=1}^r {a_j \vartheta_j} + q_0, \qquad x_k = \sum_{j=1}^r {\lambda_j^k a_j \vartheta_j}, \end{equation*} for $k = 1,\dotso,m$ and a vector $q_0$ with \begin{equation*} \begin{cases} q_0 = a_0 \cdot q & r = m \\ q_0 = 0 & r \neq m \end{cases} \end{equation*} where $q = x_m - Xc$ and $c = X^+ x_m$. \end{theorem} \begin{proof} By \cref{4:Theorem_Modification_Modes} and \cref{4:Remark_Modification_Modes_Adjustment}, we obtain that the DMD eigenvalues $\lambda_i$ and modes $\vartheta_i$ are eigenvalues and eigenvectors of the system matrix $A$ for $i = 1,\dots,m$. Since $\ker(X) \subseteq \ker(Y)$, we obtain the relation \begin{equation*} \textnormal{rank}(Y) = m - \ker(Y) \leq m - \ker(X) = \textnormal{rank}(X) = r. \end{equation*} In addition, the condition $\textnormal{im}(A) \subseteq \textnormal{im}(Y)$ implies $\textnormal{rank}(A) \leq \textnormal{rank}(Y)$ and consequently $r \leq \textnormal{rank}(Y)$, because $A$ has $r$ non-zeros distinct eigenvalues. Hence, $\textnormal{rank}(Y) = r$ and the system matrix $A$ is diagonalizable by $r$ non-zero distinct eigenvalues. Therefore, the assumptions of \cref{2:Theorem_Reconst_System_matrix_A} are satisfied such that there exist scaling factors $\alpha_1,\dotso,\alpha_r \in \mathbb{C}$ and an error $q_0 \in \mathbb{C}^n$ such that \begin{equation*} x_0 = \sum_{j=1}^{r} \alpha_j v_j + q_0, \qquad x_k = \sum_{j=1}^{r} \lambda_j^k \alpha_j v_j, \end{equation*} for $k = 1,\dots,m$. Using the notation of \cref{2:Theorem_Reconst_System_matrix_A}, we obtain the equation \begin{equation*} Y = \Theta K \Lambda \textnormal{Vand}(\lambda_1,\dots,\lambda_r;1,m), \end{equation*} where $K=\text{diag}(\alpha_1,\dotso,\alpha_m)$ is the scaling matrix. Since the DMD modes (which are eigenvectors of the system matrix) are related to distinct eigenvalues, they are linearly independent and, consequently, the following calculation \begin{align*} a = \Lambda^{-1} \Theta^+ x_1 &= \Lambda^{-1} \Theta^+ Y e_1 \\ &= \Lambda^{-1} \Theta^+ \Theta K \Lambda \textnormal{Vand}(\lambda_1,\dots,\lambda_r;1,m) e_1 \\ &= K \textnormal{Vand}(\lambda_1,\dots,\lambda_r;1,m) e_1 \\ &= (\alpha_1,\dots,\alpha_m)^T \end{align*} shows that the scaling factors $\alpha_k$ coincide with the DMD amplitude $a_k$. Hence, the two identities are proven. For the additional statement, we consider two cases: 1. case: $r = m$. Consider $Y = XC_c + qe_m^T$ and rearrange this equation by using the inverse of $C_c$ (which exists since $r=m$): \begin{equation*} X = (Y - q e_m^T) C_c^{-1} = Y C_c^{-1} - q e_m^T C_c^{-1}. \end{equation*} By \cref{4:Lemma_CS_similar} and relation $C_c = (\Sigma V^*) S (\Sigma V^*)^{-1}$, we obtain the identity \begin{equation*} Y C_c^{-1} = Y V \Sigma^{-1} S^{-1} \Sigma V^* = \Theta \Lambda W S^{-1} \Sigma V^* = \Theta W \Sigma V^* = \Theta W \Sigma V^* M^{-1} M = \Theta K M, \end{equation*} and, therefore, it follows \begin{equation*} x_0 = X e_1 = (Y C^{-1} - q e_m^T C_c^{-1})e_1 = \Theta K M e_1 - q e_m^T C_c^{-1}e_1 = \sum_{j=1}^m {a_j \vartheta_j} - \langle e_m, C_c^{-1} e_1 \rangle \cdot q. \end{equation*} Now, we examine the remaining term $\langle e_m , C_c^{-1} e_1 \rangle \cdot q$. To this end, we represent the companion matrix $C_c$ by its eigenvectors and eigenvalues \begin{align*} e_m^T C^{-1} e_1 &= e_m^T \textnormal{Vand}(\lambda_1,\dots,\lambda_m)^{-1} \Lambda^{-1} \textnormal{Vand}(\lambda_1,\dots,\lambda_m) e_1 \\ &= ((\textnormal{Vand}(\lambda_1,\dots,\lambda_m)^T)^{-1} e_m)^T \Lambda^{-1} \textnormal{Vand}(\lambda_1,\dots,\lambda_m) e_1. \end{align*} The inverse of the transposed Vandermonde matrix $\textnormal{Vand}(\lambda_1,\dots,\lambda_m)^T$ is given by a LU-decomposition~\cite{moya:2012:inverse}, i.e., there exist a lower triangle matrix $L$ and a upper triangle matrix $U$ with \begin{equation*} (\textnormal{Vand}(\lambda_1,\dots\lambda_m)^T)^{-1} = (LU)^{-1} = U^{-1} L^{-1}. \end{equation*} More precisely, these matrices are given by \begin{equation*} U^{-1}_{i,j} = \begin{cases} 0 &i>j\\ \prod_{\substack{k=1 \\ k \neq i}}^{j} \frac{1}{\lambda_i - \lambda_k} &i\leq j \end{cases} \end{equation*} and \begin{equation*} L^{-1}_{i,j} = \begin{cases} 0 & i < j \\ 1 & i = j \\ L_{i-1,j-1} - L_{i-1,j} \cdot \lambda_{i-1} & i = 2,\dots,m, \quad j = 2,\dots,i-1. \end{cases} \end{equation*} Thus we obtain \begin{equation*} (\textnormal{Vand}(\lambda_1,\dots,\lambda_m)^T)^{-1} e_m = U^{-1} L^{-1} e_m = U^{-1} e_m = \begin{pmatrix} \prod_{\substack{k=1 \\ k \neq i}}^{m} \frac{1}{\lambda_1 - \lambda_k} \\ \vdots \\ \prod_{\substack{k=1 \\ k \neq i}}^{m} \frac{1}{\lambda_m - \lambda_k} \end{pmatrix} \end{equation*} and finally \begin{align*} e_m^T C^{-1} e_1 &= ((\textnormal{Vand}(\lambda_1,\dots,\lambda_m^T)^{-1} e_m)^T \Lambda^{-1} \textnormal{Vand}(\lambda_1,\dots,\lambda_m e_1 \\ &= \frac{1}{\lambda_1} \prod_{\substack{k=1 \\ k \neq i}}^{m} \frac{1}{\lambda_1 - \lambda_k} + \dots + \frac{1}{\lambda_m} \prod_{\substack{k=1 \\ k \neq i}}^{m} \frac{1}{\lambda_m - \lambda_k}. \end{align*} This factor equals the error scaling $a_0$, which completes the proof for the first case. 2. case: $r \neq m$. Hence, $\ker(X)$ is non-trivial, i.e., $\ker(X) \neq \{0\}$. By \cref{5:Lemma_kerXkerY_kerXneq0}, we obtain $\textnormal{im}(X) \subseteq \textnormal{im}(Y)$ and, therefore, it holds \begin{equation*} \textnormal{im}(X) = \textnormal{im}(Y) = \textnormal{im}(A) = \langle \vartheta_1,\dots,\vartheta_r \rangle, \end{equation*} because $\textnormal{im}(A) \subseteq \textnormal{im}(Y)$. Hence, $x_0$ is in the span of $\vartheta_1,\dots,\vartheta_r$ and therefore $q_0 \in \textnormal{im}(A)$, especially. However, by the proof of \cref{2:Theorem_Reconst_System_matrix_A}, we obtain that the vector $q_0 \in \ker(A)$. Consequently, we obtain $q_0 = 0$. \end{proof} \cref{5:Theorem_Reconst-EXDMD} clearly demonstrates the functionality of EXDMD. Via a reduced singular value decomposition, the dynamicly relevant properties of the system matrix were extracted, i.e., the eigenvectors to non-zero eigenvalues. As a result, the eigenvectors (or DMD modes) do not not generate a basis anymore and consequently the first snapshot $x_0$ will be reconstructed with an error. However, \cref{5:Theorem_Reconst-EXDMD} gives us an exact representation of the error. The subsequent corollary illustrates the connection between the DMD amplitudes and the coefficients of the first snapshot in the eigenvector basis of the system matrix. \begin{corollary} Let the system matrix $A$ as well as DMD eigenvalues $\lambda_1,\dots,\lambda_r$, DMD modes $\vartheta_1,\dots,\vartheta_r$, DMD amplitudes $a_1,\dots,a_r$ be given by \cref{5:Algorithmus_EXDMD} to the data $x_0, \allowbreak\dotso, \allowbreak x_m \allowbreak \in \mathbb{C}^n$. In addition, let the eigenvalues $\lambda_1,\dots,\lambda_r,\lambda_{r+1},\dots,\lambda_n$ and eigenvectors $\vartheta_1, \allowbreak \dots, \allowbreak\vartheta_r, \allowbreak v_{r+1}, \allowbreak\dots, \allowbreak v_n$ of the system matrix as well as the coefficient vector $b = (b_1,\dots,b_n)^T = W^{-1} x_0$ with $W = (\vartheta_1,\dots,\vartheta_r,v_{r+1},\dots,v_m)$ be given. If $\ker(X) \subseteq \ker(Y)$, $\textnormal{rank}(Y) = r$, and the (DMD) eigenvalues $\lambda_1,\dots,\lambda_r$ are distinct, then the DMD amplitudes coincide with the coefficients: \begin{equation*} a_j = b_j \end{equation*} for $j=1,\dots,r$. \end{corollary} \begin{proof} The assumptions of \cref{5:Theorem_Reconst-EXDMD} and \cref{2:Theorem_Reconst_System_matrix_A} are satisfied, because the system matrix $A$ is diagonalizable by the $r$ distinct eigenvalues. Hence we receive \begin{equation*} \sum_{j=1}^r \lambda_j a_j \vartheta_j = x_1 = \sum_{j=1}^r \lambda_j b_j \vartheta_j. \end{equation*} Since the eigenvectors (to distinct eigenvalues) are linear independent and the eigenvalues are non-zero, the coefficients have to match. \end{proof} \section{Conclusion} A comprehensive theoretical analysis of Dynamic Mode Decomposition has been developed that clarify the connection between different variants of DMD (CDMD, SDMD, and EXDMD) and demonstrates several features of them. One of these features is the reconstruction property, which was proven for all variants and the system matrix as well. To this end, different scaling factors were used and new ones introduced to ensure this property. Especially for EXDMD, it was shown that under appropriate conditions the algorithm calculates the dynamically relevant, high-dimensional structures of the system matrix with the help of low-dimensional, spectral-theoretical techniques. The new findings facilitate the application with DMD since precise reconstructions are obtained which lead to a clearer decomposition of the data into DMD eigenvalues, modes and amplitudes. \section*{Acknowledgment} The first author would like to thank Rainer Nagel for ideas, helpful suggestions and inspiring discussions. Moreover, he expresses his gratitude to the entire working group functional analysis (AGFA) from the University of T{\"u}bingen for the numerous discussions and the support. This work is partly supported by ``Kooperatives Promotionskolleg Digital Media'' at Hochschule der Medien and the University of Stuttgart. \bibliographystyle{plain}
\section{Introduction} Detection of high impedance faults poses a highly challenging problem because of the random, asymmetric and nonlinear nature of high impedance fault (HIF) current. Most of the time, these faults cannot be detected and isolated by conventional over-current schemes, because magnitude of fault current is considerably lower than nominal load current \citep{233519:5217212}. High impedance faults typically occur when an energised conductor comes in contact with ground through any high impe-dance object such as dry asphalt, wet sand, dry grass and sod etc. which limits the flow of current towards ground \citep{233519:5217212}. Timely detection of high impedance faults is necessary for efficient, reliable and safe operation of power systems. Probability of occurrence of high impedance fault in distribution networks is more than in transmission network because distribution feeders are more likely to come in contact with high impedance objects like trees etc. However, in underground cables high impedance faults are caused by insulation degradation that exposes the energised conductor to high impedance objects \citep{233519:5217213}. High impedance faults occur at voltage level of 15KV or below in most of the cases. Magnitude of HIF current is independent of the conventional short circuit fault current level \citep{233519:5217214}. High impedance faults are extremely difficult to detect and isolate by conventional protection schemes, because fault current magnitude is much lower than nominal current. According to report by Power System Relaying Committee (PSRC), only 17\% of HIFs can be detected by conventional relaying schemes \citep{233519:5217212}. Detection of HIFs helps in prognostic maintenance in power distribution system. High impedance faults involve arcing which makes fault current asymmetric and nonlinear. As a result of arcing, HIFs involve high frequency components similar to load and capacitor switching which makes detection much more difficult \citep{233519:5217215}. Previous research on diagnosis of HIFs was focused on lab-based staged fault studies. However, with the advancement in technology and better understanding of features of HIFs, the focus has shifted towards simulations and software studies \citep{233519:5217216}. Due to its critical nature, researchers from both industry and academia have proposed various techniques to detect HIFs in distribution networks. Majority of the studies were reported as early as 1980s and 1990s, but the simulation methods and advanced detection techniques are still being developed and proposed. HIF detection methods can be broadly classified into time domain algorithms, frequency domain algorithms \citep{lima2018high}, hybrid algorithms \citep{samantaray2008high} and knowledge-based systems \citep{etemadi2008high}. K. Zoric and M. B. Djuric presented a method to detect high impedance fault based on harmonic analysis of voltage signals \citep{233519:5217219}. James Stoupis introduced a new relaying scheme manufactured by ABB in the area of artificial neural networks \citep{233519:5217220}. Sedighi proposed two methods based on soft computing for detection of HIF \citep{233519:5217221}. Mark Adamiak proposed signature based high impedance fault diagnoses which involves expert system pattern recognition on harmonic energy levels in arcing current \citep{233519:5217222}. S.R. Samantaray presented an intelligent approach to detect high impedance faults in distribution systems \citep{233519:5217224}. In \citep{233519:5217225}, authors have proposed a new approach to detect HIF based on PMU (Phasor Measurement Unit). F. V. Lopes presented a method to diagnose HIF in smart distribution systems \citep{233519:5217226}. Authors in \citep{233519:5217216,233519:5217223} presented a method to detect HIF based on mathematical morphology. A new model for high impedance faults has been present in \citep{233519:5217227}. Results of this model are quite closer to what is observed in staged faults. This research activity also detected HIF using harmonic analysis of current waveform. Recenlty, Kavi presented a method to detect HIF in Single Wire Earth Return (SEWR) system \citep{233519:5217228}. Sekar and Mohanty proposed fuzzy rule base approach for high impe-dance fault detection in distribution systems \citep{sekar2018fuzzy}. They present a filter-based morphology gradient (MG) to differentiate non-HIF events from HIF events. W. C. Santos presented a transient based approach to identify HIF in power distribution systems \citep{233519:5217230} . In \citep{233519:5217231}, real time complexity measurement (RCM) based approach is used to detect HIF. In \citep{233519:5217217} HIF detection techniques are evaluated and compared with each. With the advancement in technology, the trend has been shifted towards smart grids and smart distribution systems. Smart distribution systems include measurements (such as voltage and current) at each node that helped to discover and develop digital signal processing based fault detection techniques \citep{233519:5217232,233519:5217233,233519:5217234}. Prior studies have helped to reveal many of the hidden characteristics of High Impedance Faults. But the major drawback of aforementioned techniques is that they are not capable of detecting \textit{all} types of high impedance faults. Furthermore, active methods of HIF detection use signal injection which deteriorates the power quality. Some methods employ data gathered by PMUs, which are quite expensive and also many distribution systems currently don't deploy PMUs. Another disadvantage is that most of the proposed methods use a lot of computing power and thus can not be implemented on an embedded system as a portable numerical relay. The motivation for this research work lies in manifold shortcomings of the prior research. The proposed method is computationally less rigorous, so it can be implemented on an embedded system as a numerical relay. The method ensures power quality as it does not inject any signal into power system for HIF detection. The technique developed can detect all types of HIF i.e., broken and unbroken conductor HIFs and can locate the faulty section of network. Furthermore, input data is gathered using CTs and PTs which are already deployed in all distribution networks, so no additional hardware installation is needed for data acquisition. The proposed method is accurate and highly reliable as it can distinguish load switching from faults, and can also detect and isolate multiple high impedance faults in the power network. The training model used for detecting faults is of low order and can easily be implemented on any embedded hardware for real time prototyping and HIF detection. In proposed method, data obtained from voltage and current sensors is fed to three fault detection algorithms i.e., Principal Components Analysis (PCA), Fischer Discriminant Analysis (FDA) and Support Vector Machines (SVM). PCA extracts principal components of data and use them for fault detection. FDA reduces the data to a lower dimension to maximise distance among various classes for increased accuracy. Binary class SVM is used only for detection of HIFs. To determine type and location of fault multiclass SVM is deployed to signal the presence of an incipient or sudden high impedance fault. Once the fault is detected, the faulty system can be isolated from the network by issuing a trip signal to traditional over current relays in substation. The speed and accuracy of proposed method is comparable to conventional fault detection of overcurrent faults. The rest of research paper is organised as follows. Section II details characteristics and features of high impedance faults. Theoretical foundation for data driven techniques is laid down in Section III. Proposed techniques have been tested on IEEE 13-node test system and results are discussed in Section IV. Section V concludes the research. \section{High Impedance Fault Characteristics} In this section, prominent features of high impedance faults are described. To obtain training data from simulation, a fault model is simulated in Simulink and training data is obtained from voltage and current sensors installed in the network. \subsection{Properties of High Impedance Faults} Arcing is a prominent phenomena in HIFs. The arc is formed due to air gap between energised conductor and high impedance object. Arc ignition occurs when magnitude of voltage is higher than air gap breakdown voltage. Consequently, arc extinction occurs when voltage is lower than breakdown voltage \citep{233519:5217217}. The value of break down voltage changes during each cycle. Thus, in every cycle of voltage, the HIF current includes two arc re-ignitions and two arc extinctions. Therefore, current conducting path changes during each cycle which changes the magnitude of HIF current making it non-linear, also HIF current is intermittent in nature \citep{233519:5217217}. Some of the typical features of high impedance faults are as follows: \begin{itemize} \item \textbf{Non linearity:} Voltage-current characteristics are highly nonlinear due to change in current conducting path \citep{233519:5217238}. \item \textbf{Asymmetric nature of HIF current:} Peak values of current are different in positive and negative half cycle due to the presence of varying break down voltage \citep{233519:5217217,233519:5217235}. \item \textbf{Intermittent nature:} HIF current is not steady due to intermittent nature of arc \citep{233519:5217236}. \item \textbf{Build up:} Current magnitude progressively increases till it reaches it maximum value \citep{233519:5217235} \item \textbf{Randomness:} Magnitude of HIF current and its shape changes with time due change in impedance of conducting path \citep{233519:5217237}. \item \textbf{Low and high frequency components:} HIF current includes low frequency components due to non-linearity of HIF. Additionally, HIF current also contains high frequency components due to intermittent nature of arc\\ \citep{233519:5217217}. \end{itemize} \subsection{Simulation of High Impedance Fault} To obtain training data from simulation, appropriate model of HIF is required which would show real behaviour of an HIF. This paper utilises an HIF model shown in Fig.~\ref{hifmodel}, connected between any of phase and ground \citep{233519:5217216}. The model is simulated in MATLAB, the parameters of model are tuned according to test feeder. In this HIF model, two diodes $D_p $ and $D_n $ are connected to two DC voltage sources $V_p $ and $V_n$, respectively. The DC sources have different magnitude and their magnitude randomly changes around $V_p$ and $V_n $ after every 0.11 ms. This models the asymmetric nature of arc current and intermediate arc extinction. To model the randomness in duration of arc extinction in high impedance fault, voltage polarity also changes at every sampling instant \citep{233519:5217216}. When the instantaneous value of phase voltage is greater than $V_p $, current flows towards ground, when the instantaneous value of phase voltage is less than $V_n $, current reserves its direction, when the instantaneous value of phase voltage is between $V_p $, and $V_n $, no current flows. In order to incorporate varying arc resistance, the model of HIF also includes two variable resistances, $R_p $ and $R_n $, such that values of these resistances vary randomly after every 0.11 ms. \begin{figure} \centering \includegraphics[height=6cm]{media/hifModel1} \caption{{The selected HIF model \citep{233519:5217216}}} \label{hifmodel} \end{figure} The parameters used for HIF model with IEEE 13-node test feeder in Simulink are: \begin{eqnarray*} \begin{array}{l}\begin{array}{l}V_p=1.0\;kv,\;with\pm\;10\%\;variation\\V_n=0.5\;kv,\;with\pm\;10\%\;variation\end{array}\\R_p,R_n=1000~\Omega-1500~\Omega,\;with\;random\;variation\end{array} \end{eqnarray*} The above model is simulated in Matlab{\textregistered}. There are two steps involved in modelling HIF; in first step, variable DC voltage sources are modelled using controlled voltages source; in second step, variable resistances are modelled using controlled current sources. First part is implemented using only random number generator, constant block, and controlled voltage source is used to obtain varying DC voltages. Second step involves a build-up series R-L circuit and a sinusoidal signal of 60 Hz. Both of these generate an exponentially growing sine wave. The sine wave is multiplied with a random number of amplitude 1 and variance of 0.12 to obtain a randomly varying resistance. \begin{figure}[tb] \centering \includegraphics[width=0.45\textwidth]{media/arcWaveform2} \caption{{Arc current and voltage during HIF}} \label{viHIF} \end{figure} \begin{figure}[tb] \centering \includegraphics[width=0.45\textwidth]{media/viChar3} \caption{{The v-i characteristics of HIF}} \label{viChar} \end{figure} Fig.~\ref{viHIF} shows arc current and voltage waveforms obtained as a result of modelling HIF in Simulink, using HIF model of Fig.~\ref{hifmodel}. It is clear that the arc current is small, random, asymmetric, and nonlinear in nature. The voltage waveform in Fig.~\ref{viHIF} also shows the random behaviour. Fig.~\ref{viChar} shows the v-i characteristics of HIF, the v-i characteristics of HIF and the current waveform are quite similar to those got from a staged fault \citep{233519:5217216}. \section{Theoretical Foundation} Data driven techniques are the perfect candidate for fault diagnoses in large systems where enough amount of data is available. Principal Component Analysis, Fischer Discriminant Analysis, and Support Vector Machines are widely used for addressing diagnosis problems due to their simplicity and efficiency in processing large amount of data. Here the theoretical basis for applied algorithms is given. \subsection{Principal Component Analysis} Principal Component analysis is linear dimensional reduction technique, it projects higher dimensional data into lower dimensions while keeping significant features. PCA has ability to retain maximum variation that is possible in lower dimensions such that transformed features are linear combination of primary features. In reduced dimensions, different statistical plots such as $T^2 $ or Q-charts are utilised for visualisation of different trends. PCA is known as powerful tool for feature extraction and data reduction in fault detection techniques because of simplicity and its ability to process large amount of data \citep{233519:5217241}. Application of PCA for fault diagnoses consists of three steps; first of all, loading vectors (transformation vectors) are calculated by performing offline computations on training data; in second step, the loading vectors are utilised to transform online data (higher dimensional data) into lower dimensions; in third step, test statistics such as $T^2$ are used to detect fault \citep{233519:5217241}. Let us assume that a training set of $m$ process variables, with set of $n$ observations, is normalised to unit variance and zero mean by subtracting each process variable by its mean and dividing by standard deviation of data, and is shown in the form of input matrix $\mathrm{X}\mathrm{\in }{\mathrm{R}}^{\mathrm{n\times m}}$. With the help of singular value decomposition of input data matrix X, loading vectors or transformation vectors are calculated. \begin{eqnarray} \frac{1}{\sqrt{1-n} } X=U{\rm \Sigma V}^{{\rm T}} \label{eq1} \end{eqnarray} In equation (\ref{eq1}), $U$ and $V$ are unitary matrices, and $\Sigma $ is called diagonal matrix and its singular values are in decreasing order. The transformation vectors are orthonormal vectors of matrix $\mathrm V\in\mathrm R^{\mathrm m\times\mathrm m} $. Training set's variance projected along the $u^{th}$ column of V is equal to $\sigma _u^2 $. In PCA, loading vectors or transformation vectors related to a largest singular value are kept to capture large data variation in lower dimensions. Let us assume that $\mathrm P\in\mathrm R^{\mathrm m\times\mathrm a} $ is the matrix with first a column of $\mathrm V\in\mathrm R^{\mathrm m\times\mathrm m} $, and projection of observed data X into reduced dimensions are incorporated in the score matrix T is given as, \begin{eqnarray}T=XP\end{eqnarray} Once the data is projected in lower dimensions, Hotteling's $T^2 $ statistics is used for fault detection. Hotteling's $T^2 $- statistics can be calculated as \citep{233519:5217241,233519:5217242}, \begin{eqnarray} T^2=x^T P\Sigma_a^{-1} P^T x \label{eq3} \end{eqnarray} where $\Sigma$ is the diagonal matrix of first $a$ singular values, $P$ is the loading vector matrix corresponding to first a singular values. The Hotteling's $T^2 $- statistics (\ref{eq3}) is scaled squared 2-norm of observation space X, measures systematic variations of the process, and if there is violations, it will indicate that systematic variations are out of control. If \ensuremath{\alpha } is the level of significance, the threshold of $T^2 $ statistics can be calculated as \citep{233519:5217242}, \begin{eqnarray}T_\alpha^2=\frac{m(n-1)(n+1)}{n(n-m)}F_\alpha (m,n-m) \label{eq4}\end{eqnarray} Where $F_\alpha (m,n-m) $ is known as F-distribution with m and (n-m) degree of freedom \citep{233519:5217242}. Essential condition for fault detection occurs if Hotteling's $T^2 $- statistics exceeds its threshold value, that is, \begin{eqnarray*}T^2 \ensuremath{\leq } T_\alpha^2 \ \ \ \ Fault\ free\ case \\ T^2 > T_\alpha^2 \ \ \ \ \ \ \ \ \ \ \ \ \ s Fault\ case\end{eqnarray*} A complete flowchart for offline and online computation of the PCA algorithm for fault detection is shown in Fig. \ref{PCA-offline} and \ref{PCA-online}, respectively. \begin{figure}[tb] \centering \includegraphics[scale=0.5]{media/PCA-offline} \caption{{Flowchart for offline fault computation using PCA}} \label{PCA-offline} \end{figure} \begin{figure}[tb] \centering \includegraphics[width=0.45\textwidth]{media/PCA-online} \caption{Flowchart for online fault computation using PCA} \label{PCA-online} \end{figure} \subsection{Fisher discriminant analysis} Fisher discriminant analysis is one of the most powerful methods for dimensionality reduction. In case of fault detection, PCA gives very good results. However, it has poor properties of fault classification because it does not consider information (variance) among different classes of data during computation of loading vectors \citep{233519:5217241}. FDA considers information among different classes of data, so it is more favourable for fault classification. It determines a set of transformation vectors, known as FDA vectors. FDA vectors maximise the information (distance) among different classes of data, while minimising information within each class in projected space. FDA tries to centralise different data classes and feature recognition rates of FDA is better than PCA. According to \citep{233519:5217240}, performance of FDA for fault detection and classification is quite better than that of PCA. The procedure to implement FDA is similar to PCA. First of all, FDA vectors are computed using training data, then these FDA vectors are utilised to transform online data into lower dimensional space. Finally, a discriminant function isolates the fault. In FDA training data, both normal and faulty data is used for computation of FDA vectors, however, in PCA only normal data is used for computation of loading vectors \citep{233519:5217240,233519:5217242}. In order to detect fault with the help of FDA, Hotteling's $T^2$- statistics is used. Let us assume that a training set of m process variables, with set of n observations, is shown in the form of input matrix $\mathrm{X}\mathrm{\in }{\mathrm{R}}^{\mathrm{n\times m}} $. Consider $q$ as number of classes in different faults and $n_k$ is number of observations in $k^th$ class, let $x_i $ be the transpose of \textbf{\textit{i}}\ensuremath{_{th}} row of matrix X. The transformation vector \ensuremath{\nu} is computed using training data such that following optimisation is solved. \begin{eqnarray} J_{FDA}(\nu)=arg \ max\ _{\nu\neq0} \frac{\nu^T S_b \nu}{\nu^T S_w \nu} \label{eq5} \end{eqnarray} Where S\_w shows within class scatter matrix given by \begin{eqnarray}S_w= \Sigma_{k=1}^qS_k \end{eqnarray} With \begin{eqnarray}S_k=\Sigma_{x_i\in\ensuremath{\chi }_k}^n(x_i-\overline{x}_k) (x_i-\overline{x}_k)^T\end{eqnarray} and the mean of kth class $\overline{x}_k=\frac1n_k \Sigma_{x_i\in x_k}x_i $ similarly $S_b $ is between class scatter matrix given by \begin{eqnarray}S_b=\Sigma_1^q(x_i-{\overline x}_k)(x_i-{\overline x}_k)^T\end{eqnarray} With $\overline x $ shows the combined (total) mean vector given by $\overline{x}=\frac1n \Sigma_{i=1}^n \ x_i $ it is stated that solution to above optimisation problem is identical to eigenvalue decomposition problem \citep{233519:5217243}, \begin{eqnarray} S_b \nu_h=\lambda_h S_w \nu_h \end{eqnarray} Where $\lambda_h $ is generalised eigenvalue representing the extent of separability between classes and $\lambda_h $ are respective eigenvectors. Equation (\ref{eq5}) shows optimisation problem that ensures minimum scatter within class and maximum scatter between different data classes. This feature helps to classify faults. In order to project online data into lower dimensional space, a matrix $V_q \in R^{(m\times q-1)} $ with q-1 FDA vectors is defined as, such data projected data $z_i \in R^{(q-1)} $ is given by \begin{eqnarray}z_i = V_q^T x_i\end{eqnarray} For fault detection Hotteling's $T^2 $- statistics is used \citep{233519:5217244}, given by \begin{eqnarray}T_k^2 = x^T V_a (V_a^T S_k V_a )^{-1} V_a^T x \end{eqnarray} Where a shows the number of non-zero eigenvalues. For a given level of significance \ensuremath{\alpha } , threshold for Hotteling's $T^2 $- statistics is given by: \begin{eqnarray} T_\alpha^2= \frac{a(n-1)(n+1)}{n(n-1)}{F_\alpha (a,n-a)} \\ T_k^2 \ensuremath{\leq } T_\alpha^2 \ \ \ Fault\ free\ case \nonumber \\ T^2>T_\alpha^2 Fault\ case \nonumber \end{eqnarray} For fault classification, the discriminant function is used as given below: \begin{eqnarray} g_k(x)= -\frac12(x-\overline x_k)^T V_q {(\frac{1}{n_k-1} V_q^T S_k V_q})^{-1} V_q^T (x-\overline{x}_k) \nonumber\\ +ln(q_i )-\frac12 ln[det(\frac{1}{n_k-1} V_q^T S_k V_q )] \end{eqnarray} In above equation, g\_k (x) is the discriminant function associated with class k, provided a data vector $x{\in}R^m$, online data is associated with class $i$ provided that the discriminant function belonging to $i^th$ class is maximum for a fault in class $i$, can be expressed as, \begin{equation} g_i (x) > g_k (x) \end{equation} A complete flowchart for offline training of the FDA algorithm is shown in Fig. \ref{offlineTrainFDA}. \begin{figure}[h] \centering \includegraphics[width=0.5\textwidth]{media/offlineTrainFDA} \caption{Flowchart for offline training of FDA} \label{offlineTrainFDA} \end{figure} \subsection{Support Vector Machines (SVM)} SVM is a well-known data driven technique used for detection and classification of faults due to its generalisation ability and being less susceptible to the curse of dimensionality \citep{233519:5217245}. For the first time, Support vector machines were used by Vapnik \citep{233519:5217246}. It is one of the new machine learning tools for classification of linear and nonlinear data. SVM is a binary classifier that maximises the margin between two data classes through a hyper-plane as shown in Fig. \ref{linePlanFig4}. SVMs maximise the margin near separating hyperplane. The decision of separation is fully identified by the support vectors. Solution of SVM is obtained through solution of quadratic programming. In SVM, a discriminant function is used to differentiate different classes of data given by: \begin{eqnarray}f(x)=w^T x+b\end{eqnarray} Where b, the bias, x, the data points, and w, the weighting vector, are obtained through training data. In two-dimensional space, the discriminant function is a line, in three-dimensional space, the discriminant function is a plane, and in n-dimensional space, the discriminant function is a hyperplane. SVM generates the optimal separating hyperplane by calculating the value of bias, weighting vector in such way that maximum margin is achieved. The points in training set with least perpendicular distance to the hyperplane are known as support vectors. The margin of the optimal separator can be defined as width of separation between support vectors. \begin{eqnarray}\rho=2 \frac{f(x^0 )}{w} =2r\end{eqnarray} \begin{figure} \centering \includegraphics[width=0.35\textwidth]{media/linSepHyp4} \makeatother \caption{{Linear separating hyperplane \protect\citep{233519:5217247}}} \label{linePlanFig4} \end{figure} \subsubsection{The Kernel Trick (Feature Space)} The cases in which training data is not linearly separable in the original space using above methods, then, this kind of data can be mapped to a higher-dimensional space which makes the data separable \citep{233519:5217247}, as shown in Fig.~\ref{featureSpace}. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/featureSpace5} \makeatother \caption{{Mapping of data to feature space \protect \citep{233519:5217247}}} \label{featureSpace} \end{figure} A kernel function is a type of function that corresponds to an inner product in the higher dimensional space. For example, if data is mapped to feature space through a transformation $\Phi:\;\;x\;\rightarrow\;\varphi(x) $, then, the inner product results: \begin{eqnarray}K(xi, xj) = \phi(xi) T \phi (xj) \end{eqnarray} There are different types of kernels, such as, polynomial, linear, Radial Basis Function (RBF) etc. The discriminant function of SVM, can be written as: \begin{eqnarray}f(x)=w^T x+b\end{eqnarray} According to Representer theorem, $w$ can be written as linear combination of input vectors. \begin{eqnarray}w= \Sigma_{j=1}^N \alpha_j x_j\end{eqnarray} Thus \begin{eqnarray}f(x)=w^T x+b=b+ \Sigma_{l=1}^N \alpha_l x_l^T x\end{eqnarray} All the dot products can be replaced with \begin{eqnarray}k(c,d)=c^T d \end{eqnarray} Optimisation problem: \begin{eqnarray}min \ a,b \ \ \frac12 \Sigma_{j,l=1}^N \alpha_j \ensuremath{\alpha }_l k(x_j,x_k )+C \Sigma_{j=1}^N \xi_j \end{eqnarray} Where \ensuremath{\xi }\_j{\textgreater}0 \begin{eqnarray}y_j \Sigma_{l=1}^N \alpha_l k(x_l,x_j)+b\ensuremath{\geq }1- \xi_j \end{eqnarray} In order to test the pattern, we use: \begin{eqnarray}f(x)=b+ \Sigma_{l=1}^N \alpha_l k(x_l,x)\end{eqnarray} Euclidean dot product can be substituted with dot product in feature space ``\ensuremath{\Phi }'', which will permit nonlinear classification. \begin{eqnarray}k(c,d)= \Phi(c)^T \Phi(d)\end{eqnarray} $k(c,d)$ is known as kernel function and corresponding SVM is called kernelized SVM. This type of SVM can solve the issue of classification of not linear separable data. Steps involved in implementation of kernelized SVM are:\\ \begin{enumerate}[Step 1:] \item Input data is normalised. \item Training of SVM. \begin{enumerate}[Step 2.1:] \item Selection of kernel function. \item Selection of kernel parameter. \item Optimisation of penalty factor (C). \item Cross validation. \end{enumerate} \item Classification of SVM test data. \end{enumerate} \subsubsection{Multiclass SVM} Binary class SVM can be used for fault detection, but it cannot be used for fault classification. However in practical cases, discrimination of more than two classes is required, hence, multiclass pattern recognition is often required in real world problems \citep{233519:5217248}. In majority of cases, multiclass pattern recognition problems are decomposed into series of binary problems such that binary pattern recognition techniques can easily be applied in practical cases. multiclass SVM algorithms such as one-versus-one, one-versus-all, can be applied be applied to classify more than two faults. \section{Application of Data Driven Techniques to Diagnose HIF} HIF is introduced at different positions and different phase conductors of IEEE 13-node test feeder as shown in Fig.~\ref{13node}. In data structure, data is generated from Simulink model of test feeder. There are 29 variables of singles phase, two phase and three phase voltages of 13-node test feeder. Data has been placed in input matrix in such a way that each column of input matrix represents voltage and each row of input matrix represents number of observations. There were 400 observations recorded for bus voltages, first 100 observations correspond to normal data, while other 300 observations correspond to three HIF locations at different positions of test feeder. \begin{figure} \centering \includegraphics[height=6cm, width=0.45\textwidth]{media/IEEE13_6} \makeatother \caption{{IEEE 13-node Distribution Test Feeder}} \label{13node} \end{figure} \subsection{Detection of HIF using PCA and Hotteling's $T^2 $ statistics} For diagnoses of HIF using PCA, training data consisting of 60 samples of normal condition (without fault) has been selected while testing data is consist of 100 samples of non-faulty data and 100 samples of faulty data. PCA algorithm has been applied on training data and 29 principal components are obtained. Out of 29 principal components only 5 principal components have been retained, the decision is made on the basis of total variance captured by these 5 principal components. The value of $\alpha$, as mentioned in (\ref{eq4}), is taken 0.001. As we have retained 5 principal components so $(\frac{1.6983}{1.72})=98\% $ of total variance has been captured by first five principal components. Fig.~\ref{projectData} shows projection of training data and testing in two dimensional space. It can be observed that first two components capture most of variation in higher dimensional data. Fig.~\ref{hotteling} shows the results of Hotteling's $T^2$ statistics to detect HIF after applying (3.3) on test data. It can be seen that normal data (first 100 samples) lies below threshold value of $T^2$ statistics, where threshold value is 22.0108. This threshold value was found using significance level of 0.1\% and confidence region of 99\%. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/projectionPCA2D_7} \makeatother \caption{{Projection of training data and testing in two dimensional space for PCA}} \label{projectData} \end{figure} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/HottlingT2-PCA-8} \makeatother \caption{{The results of Hotteling's $T^2$ statistics to detect HIF}} \label{hotteling} \end{figure} PCA can successfully detect high impedance fault as shown in Fig.~\ref{hotteling}. In some cases, it is required to classify different types of HIFs such as broken conductor and unbroken conductor HIFs at different locations of feeder. For this purpose, High impedance faults at three different locations are analysed. Fig.~\ref{hotteling3location} shows plot of Hotteling's $T^2 $ statistics to detect HIFs at three different locations. Results show that PCA can successfully detect these three HIFs. Only 5 principal components are retained such that (1.6983/1.72)=98\% of total variance has been captured. Fig.~\ref{multiFaultproject} shows projection of training data and test data in two dimensional space, it can be seen that PCA cannot discriminate between different types of HIFs, this is due to the reason that PCA do not consider information among different classes of data. We can conclude that PCA is suitable for HIF detection but it cannot classify different types of HIFs. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/Hotteling-T2-10} \makeatother \caption{{Plot of Hotteling's $T^2$ statistics to detect multiple HIFs}} \label{hotteling3location} \end{figure} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/projection2D-PCA-11} \makeatother \caption{{Projection of training and test data in 2-D space for multiple faults}} \label{multiFaultproject} \end{figure} \subsection{Detection of HIF using FDA}FDA is applied for detection and isolation of high impedance faults in power distribution systems. In order to compute FDA vectors, both normal and faulty data is used, in this work, 60 samples in training data and 40 samples in test data corresponding to each scenario, that is, faulty and non-faulty case. Fig.~\ref{FDAprojection} shows projection of training data in two-dimensional space by FDA. In second step, after computation of transformation vectors (FDA vectors), the discriminant function is used to test online data. Fig.~\ref{discFunPlot} shows plot of discriminant function in each category. It can be observed that up to first 30 samples, value of discriminant function corresponding to normal case has maximum magnitude, which shows that there is no fault in test feeder. Similarly, after 30 samples, value of discriminant function corresponding to fault at position A has maximum magnitude, which shows that fault at position has occurred. Same is the case with fault at position B and C. Zoomed view of plot is shown in Fig.~\ref{discFunZoom}. \begin{figure}[tb] \centering \includegraphics[width=0.5\textwidth]{media/projectionFDA-12} \makeatother \caption{{Projection of training data in two dimensional space by FDA}} \label{FDAprojection} \end{figure} \begin{figure}[tb] \centering \includegraphics[height=4.75cm, width=0.5\textwidth]{media/discFunFDA-13} \makeatother \caption{{Plot of discriminant function for multiple HIF detection using FDA}} \label{discFunPlot} \end{figure} \begin{figure}[tb] \centering \includegraphics[width=0.5\textwidth]{media/zoomedDiscFDA-14} \makeatother \caption{{Zoomed view of discriminant function for multiple HIF detection using FDA}} \label{discFunZoom} \end{figure} The above results have shown that FDA can successfully isolate/locate HIF. This technique is very well suited for monitoring of power distribution systems. \subsection{Detection of HIF using SVM}Support vector machine algorithm has been applied for 29-dimensional data without any dimensional reduction technique. Selection of optimal value of penalty factor is important, this is done by performing nested 3-fold cross validation in original data. With the help of cross validation, average area under the curve was computed for 1000 values of penalty factor between 0.1 and 100. After selection of optimal value of C, SVM classifiers were trained with optimal penalty factor and validated on training data so that generalisation would be checked. Test data of HIF was classified by validated SVM classifier. The predicted labels of test data fairly detects the occurrence of fault, that is -1 for non-faulty data and +1 for faulty data as shown in Fig.~\ref{binarySVM}. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/bSVM-15} \makeatother \caption{{Classification of an HIF using binary-class SVM}} \label{binarySVM} \end{figure} \subsection{Detection and Classification of HIF using M-SVM} Binary class SVM can be used for fault detection, but it cannot be used for fault classification. However, in Power distribution systems, discrimination of more than two classes is required, hence, multiclass pattern recognition is often required in monitoring Power distribution systems. Multiclass SVM (M--SVM) classifier is obtained using training of non-fault cases with class label 4, fault at position A with class label 3, fault at position B with class 2, and fault at position C with class 1. In each classifier, during training, a Gaussian Radial Basis Function kernel with a scaling factor, sigma ($\sigma$), of 0.5 and a penalty factor of 10 is used. The tolerance value for Karush-Kuhn-Tucker (KKT) condition for the training of data is taken as 0.001. The value of regularization parameter, lambda ($\lambda$) is 1. Test data is classified using the trained classifiers for 50 observations of each data class and predicted labels were differentiated with known data labels. Fig.~\ref{predLabelsSVM} shows that up to 50 samples, the predicted labels belong to normal class data, indicating that there is no fault. After first 50 samples, predicted labels belong to class label 3, indicating that the fault is occurred at position A. After first 100 samples, predicted labels belong to class label 2, indicating that the fault is occurred at position B. similarly, after first 150 samples, predicted labels belong to class label 1, indicating that the fault is occurred at position C. Similarly, Fig.~\ref{predLabelSVM2d} show the score plot of test data for each class of data. A comparison is presented to evaluate the results of the proposed technique with those from literature and observations have been recorded in Table \ref{tableComp}. After testing the technique on 400 test cases, it is found that proposed method is extremely quick and efficient in detecting HIFs. The proposed method is evaluated through the following performance indices:\\ Dependability: Predicted HIF cases/Actual HIF cases.\\ Security: Predicted non-HIF cases/Actual non-HIF cases. Table 1 compares the performance indices of the proposed method. It is noted that the proposed method detects all HIF faults under various operating conditions and disturbances. Thus, the proposed method is accurate, reliable and prompt in the detection of High Impedance Faults. \begin{table*}[] \caption{Comparison of performance indices of the proposed M-SVM method with previous techniques} \begin{center} \begin{tabular}{|c|c|c|} \hline \textbf{Method} & \textbf{Security (\%)} & \textbf{Dependability (\%)}\\ \hline Wavelet transform \citep{chen2016detection} & 68.5 & 72 \\ \hline Time frequency transform \cite{samantaray2008high} & 81.5 & 98.3 \\ \hline Morphological gradient \citep{sarlak2011high} & 96.3 & 98.3 \\ \hline Mathematical Morphology \citep{gautam2012detection} & 100 & 100 \\ \hline The proposed method (M-SVM) & 100 & 100 \\ \hline \end{tabular} \label{tab1} \end{center} \label{tableComp} \end{table*} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/M-SVM-17} \makeatother \caption{{Predicted labels of test data using Multiclass--SVM classifier}} \label{predLabelsSVM} \end{figure} \begin{figure} \centering \includegraphics[height=4.81cm, width=0.5\textwidth]{media/M-SVM-Label-18} \makeatother \caption{{Predicted labels of test data using M--SVM classifier on a 2-D plane}} \label{predLabelSVM2d} \end{figure} It can be seen that M-SVM can easily classify high impedance faults at different locations with load variation and capacitor switching. So, we can conclude that SVM based techniques can successfully detect and locate HIFs in a Power Distribution Network. \section{Conclusion} In this research paper, high impedance fault detection and classification in power distribution systems has been studied using data driven techniques. Source-diode-resistance model consisting of two diodes with opposite polarity connected to DC sources is utilised to simulate the high impedance fault. Data driven techniques including PCA, FDA, and SVM are applied to detect/classify HIFs. PCA along with Hotteling's $T^2$ statistics to detect HIFs, it is demonstrated that PCA successfully detects HIF but it cannot classify HIFs. Compared to that, FDA can also successfully classify/locate the fault. Further superior results are achieved by M-SVM, fault classification rate of SVM is better than FDA. M-SVM algorithm can detect all types of HIF and is also robust against capacitor and load switching transients in distribution network. \section*{Conflict of Interest} The authors declare no conflict of interest. \section{Introduction} Detection of high impedance faults poses a highly challenging problem because of the random, asymmetric and nonlinear nature of high impedance fault (HIF) current. Most of the time, these faults cannot be detected and isolated by conventional over-current schemes, because magnitude of fault current is considerably lower than nominal load current \citep{233519:5217212}. High impedance faults typically occur when an energised conductor comes in contact with ground through any high impe-dance object such as dry asphalt, wet sand, dry grass and sod etc. which limits the flow of current towards ground \citep{233519:5217212}. Timely detection of high impedance faults is necessary for efficient, reliable and safe operation of power systems. Probability of occurrence of high impedance fault in distribution networks is more than in transmission network because distribution feeders are more likely to come in contact with high impedance objects like trees etc. However, in underground cables high impedance faults are caused by insulation degradation that exposes the energised conductor to high impedance objects \citep{233519:5217213}. High impedance faults occur at voltage level of 15KV or below in most of the cases. Magnitude of HIF current is independent of the conventional short circuit fault current level \citep{233519:5217214}. High impedance faults are extremely difficult to detect and isolate by conventional protection schemes, because fault current magnitude is much lower than nominal current. According to report by Power System Relaying Committee (PSRC), only 17\% of HIFs can be detected by conventional relaying schemes \citep{233519:5217212}. Detection of HIFs helps in prognostic maintenance in power distribution system. High impedance faults involve arcing which makes fault current asymmetric and nonlinear. As a result of arcing, HIFs involve high frequency components similar to load and capacitor switching which makes detection much more difficult \citep{233519:5217215}. Previous research on diagnosis of HIFs was focused on lab-based staged fault studies. However, with the advancement in technology and better understanding of features of HIFs, the focus has shifted towards simulations and software studies \citep{233519:5217216}. Due to its critical nature, researchers from both industry and academia have proposed various techniques to detect HIFs in distribution networks. Majority of the studies were reported as early as 1980s and 1990s, but the simulation methods and advanced detection techniques are still being developed and proposed. HIF detection methods can be broadly classified into time domain algorithms, frequency domain algorithms \citep{lima2018high}, hybrid algorithms \citep{samantaray2008high} and knowledge-based systems \citep{etemadi2008high}. K. Zoric and M. B. Djuric presented a method to detect high impedance fault based on harmonic analysis of voltage signals \citep{233519:5217219}. James Stoupis introduced a new relaying scheme manufactured by ABB in the area of artificial neural networks \citep{233519:5217220}. Sedighi proposed two methods based on soft computing for detection of HIF \citep{233519:5217221}. Mark Adamiak proposed signature based high impedance fault diagnoses which involves expert system pattern recognition on harmonic energy levels in arcing current \citep{233519:5217222}. S.R. Samantaray presented an intelligent approach to detect high impedance faults in distribution systems \citep{233519:5217224}. In \citep{233519:5217225}, authors have proposed a new approach to detect HIF based on PMU (Phasor Measurement Unit). F. V. Lopes presented a method to diagnose HIF in smart distribution systems \citep{233519:5217226}. Authors in \citep{233519:5217216,233519:5217223} presented a method to detect HIF based on mathematical morphology. A new model for high impedance faults has been present in \citep{233519:5217227}. Results of this model are quite closer to what is observed in staged faults. This research activity also detected HIF using harmonic analysis of current waveform. Recenlty, Kavi presented a method to detect HIF in Single Wire Earth Return (SEWR) system \citep{233519:5217228}. Sekar and Mohanty proposed fuzzy rule base approach for high impe-dance fault detection in distribution systems \citep{sekar2018fuzzy}. They present a filter-based morphology gradient (MG) to differentiate non-HIF events from HIF events. W. C. Santos presented a transient based approach to identify HIF in power distribution systems \citep{233519:5217230} . In \citep{233519:5217231}, real time complexity measurement (RCM) based approach is used to detect HIF. In \citep{233519:5217217} HIF detection techniques are evaluated and compared with each. With the advancement in technology, the trend has been shifted towards smart grids and smart distribution systems. Smart distribution systems include measurements (such as voltage and current) at each node that helped to discover and develop digital signal processing based fault detection techniques \citep{233519:5217232,233519:5217233,233519:5217234}. Prior studies have helped to reveal many of the hidden characteristics of High Impedance Faults. But the major drawback of aforementioned techniques is that they are not capable of detecting \textit{all} types of high impedance faults. Furthermore, active methods of HIF detection use signal injection which deteriorates the power quality. Some methods employ data gathered by PMUs, which are quite expensive and also many distribution systems currently don't deploy PMUs. Another disadvantage is that most of the proposed methods use a lot of computing power and thus can not be implemented on an embedded system as a portable numerical relay. The motivation for this research work lies in manifold shortcomings of the prior research. The proposed method is computationally less rigorous, so it can be implemented on an embedded system as a numerical relay. The method ensures power quality as it does not inject any signal into power system for HIF detection. The technique developed can detect all types of HIF i.e., broken and unbroken conductor HIFs and can locate the faulty section of network. Furthermore, input data is gathered using CTs and PTs which are already deployed in all distribution networks, so no additional hardware installation is needed for data acquisition. The proposed method is accurate and highly reliable as it can distinguish load switching from faults, and can also detect and isolate multiple high impedance faults in the power network. The training model used for detecting faults is of low order and can easily be implemented on any embedded hardware for real time prototyping and HIF detection. In proposed method, data obtained from voltage and current sensors is fed to three fault detection algorithms i.e., Principal Components Analysis (PCA), Fischer Discriminant Analysis (FDA) and Support Vector Machines (SVM). PCA extracts principal components of data and use them for fault detection. FDA reduces the data to a lower dimension to maximise distance among various classes for increased accuracy. Binary class SVM is used only for detection of HIFs. To determine type and location of fault multiclass SVM is deployed to signal the presence of an incipient or sudden high impedance fault. Once the fault is detected, the faulty system can be isolated from the network by issuing a trip signal to traditional over current relays in substation. The speed and accuracy of proposed method is comparable to conventional fault detection of overcurrent faults. The rest of research paper is organised as follows. Section II details characteristics and features of high impedance faults. Theoretical foundation for data driven techniques is laid down in Section III. Proposed techniques have been tested on IEEE 13-node test system and results are discussed in Section IV. Section V concludes the research. \section{High Impedance Fault Characteristics} In this section, prominent features of high impedance faults are described. To obtain training data from simulation, a fault model is simulated in Simulink and training data is obtained from voltage and current sensors installed in the network. \subsection{Properties of High Impedance Faults} Arcing is a prominent phenomena in HIFs. The arc is formed due to air gap between energised conductor and high impedance object. Arc ignition occurs when magnitude of voltage is higher than air gap breakdown voltage. Consequently, arc extinction occurs when voltage is lower than breakdown voltage \citep{233519:5217217}. The value of break down voltage changes during each cycle. Thus, in every cycle of voltage, the HIF current includes two arc re-ignitions and two arc extinctions. Therefore, current conducting path changes during each cycle which changes the magnitude of HIF current making it non-linear, also HIF current is intermittent in nature \citep{233519:5217217}. Some of the typical features of high impedance faults are as follows: \begin{itemize} \item \textbf{Non linearity:} Voltage-current characteristics are highly nonlinear due to change in current conducting path \citep{233519:5217238}. \item \textbf{Asymmetric nature of HIF current:} Peak values of current are different in positive and negative half cycle due to the presence of varying break down voltage \citep{233519:5217217,233519:5217235}. \item \textbf{Intermittent nature:} HIF current is not steady due to intermittent nature of arc \citep{233519:5217236}. \item \textbf{Build up:} Current magnitude progressively increases till it reaches it maximum value \citep{233519:5217235} \item \textbf{Randomness:} Magnitude of HIF current and its shape changes with time due change in impedance of conducting path \citep{233519:5217237}. \item \textbf{Low and high frequency components:} HIF current includes low frequency components due to non-linearity of HIF. Additionally, HIF current also contains high frequency components due to intermittent nature of arc\\ \citep{233519:5217217}. \end{itemize} \subsection{Simulation of High Impedance Fault} To obtain training data from simulation, appropriate model of HIF is required which would show real behaviour of an HIF. This paper utilises an HIF model shown in Fig.~\ref{hifmodel}, connected between any of phase and ground \citep{233519:5217216}. The model is simulated in MATLAB, the parameters of model are tuned according to test feeder. In this HIF model, two diodes $D_p $ and $D_n $ are connected to two DC voltage sources $V_p $ and $V_n$, respectively. The DC sources have different magnitude and their magnitude randomly changes around $V_p$ and $V_n $ after every 0.11 ms. This models the asymmetric nature of arc current and intermediate arc extinction. To model the randomness in duration of arc extinction in high impedance fault, voltage polarity also changes at every sampling instant \citep{233519:5217216}. When the instantaneous value of phase voltage is greater than $V_p $, current flows towards ground, when the instantaneous value of phase voltage is less than $V_n $, current reserves its direction, when the instantaneous value of phase voltage is between $V_p $, and $V_n $, no current flows. In order to incorporate varying arc resistance, the model of HIF also includes two variable resistances, $R_p $ and $R_n $, such that values of these resistances vary randomly after every 0.11 ms. \begin{figure} \centering \includegraphics[height=6cm]{media/hifModel1} \caption{{The selected HIF model \citep{233519:5217216}}} \label{hifmodel} \end{figure} The parameters used for HIF model with IEEE 13-node test feeder in Simulink are: \begin{eqnarray*} \begin{array}{l}\begin{array}{l}V_p=1.0\;kv,\;with\pm\;10\%\;variation\\V_n=0.5\;kv,\;with\pm\;10\%\;variation\end{array}\\R_p,R_n=1000~\Omega-1500~\Omega,\;with\;random\;variation\end{array} \end{eqnarray*} The above model is simulated in Matlab{\textregistered}. There are two steps involved in modelling HIF; in first step, variable DC voltage sources are modelled using controlled voltages source; in second step, variable resistances are modelled using controlled current sources. First part is implemented using only random number generator, constant block, and controlled voltage source is used to obtain varying DC voltages. Second step involves a build-up series R-L circuit and a sinusoidal signal of 60 Hz. Both of these generate an exponentially growing sine wave. The sine wave is multiplied with a random number of amplitude 1 and variance of 0.12 to obtain a randomly varying resistance. \begin{figure}[tb] \centering \includegraphics[width=0.45\textwidth]{media/arcWaveform2} \caption{{Arc current and voltage during HIF}} \label{viHIF} \end{figure} \begin{figure}[tb] \centering \includegraphics[width=0.45\textwidth]{media/viChar3} \caption{{The v-i characteristics of HIF}} \label{viChar} \end{figure} Fig.~\ref{viHIF} shows arc current and voltage waveforms obtained as a result of modelling HIF in Simulink, using HIF model of Fig.~\ref{hifmodel}. It is clear that the arc current is small, random, asymmetric, and nonlinear in nature. The voltage waveform in Fig.~\ref{viHIF} also shows the random behaviour. Fig.~\ref{viChar} shows the v-i characteristics of HIF, the v-i characteristics of HIF and the current waveform are quite similar to those got from a staged fault \citep{233519:5217216}. \section{Theoretical Foundation} Data driven techniques are the perfect candidate for fault diagnoses in large systems where enough amount of data is available. Principal Component Analysis, Fischer Discriminant Analysis, and Support Vector Machines are widely used for addressing diagnosis problems due to their simplicity and efficiency in processing large amount of data. Here the theoretical basis for applied algorithms is given. \subsection{Principal Component Analysis} Principal Component analysis is linear dimensional reduction technique, it projects higher dimensional data into lower dimensions while keeping significant features. PCA has ability to retain maximum variation that is possible in lower dimensions such that transformed features are linear combination of primary features. In reduced dimensions, different statistical plots such as $T^2 $ or Q-charts are utilised for visualisation of different trends. PCA is known as powerful tool for feature extraction and data reduction in fault detection techniques because of simplicity and its ability to process large amount of data \citep{233519:5217241}. Application of PCA for fault diagnoses consists of three steps; first of all, loading vectors (transformation vectors) are calculated by performing offline computations on training data; in second step, the loading vectors are utilised to transform online data (higher dimensional data) into lower dimensions; in third step, test statistics such as $T^2$ are used to detect fault \citep{233519:5217241}. Let us assume that a training set of $m$ process variables, with set of $n$ observations, is normalised to unit variance and zero mean by subtracting each process variable by its mean and dividing by standard deviation of data, and is shown in the form of input matrix $\mathrm{X}\mathrm{\in }{\mathrm{R}}^{\mathrm{n\times m}}$. With the help of singular value decomposition of input data matrix X, loading vectors or transformation vectors are calculated. \begin{eqnarray} \frac{1}{\sqrt{1-n} } X=U{\rm \Sigma V}^{{\rm T}} \label{eq1} \end{eqnarray} In equation (\ref{eq1}), $U$ and $V$ are unitary matrices, and $\Sigma $ is called diagonal matrix and its singular values are in decreasing order. The transformation vectors are orthonormal vectors of matrix $\mathrm V\in\mathrm R^{\mathrm m\times\mathrm m} $. Training set's variance projected along the $u^{th}$ column of V is equal to $\sigma _u^2 $. In PCA, loading vectors or transformation vectors related to a largest singular value are kept to capture large data variation in lower dimensions. Let us assume that $\mathrm P\in\mathrm R^{\mathrm m\times\mathrm a} $ is the matrix with first a column of $\mathrm V\in\mathrm R^{\mathrm m\times\mathrm m} $, and projection of observed data X into reduced dimensions are incorporated in the score matrix T is given as, \begin{eqnarray}T=XP\end{eqnarray} Once the data is projected in lower dimensions, Hotteling's $T^2 $ statistics is used for fault detection. Hotteling's $T^2 $- statistics can be calculated as \citep{233519:5217241,233519:5217242}, \begin{eqnarray} T^2=x^T P\Sigma_a^{-1} P^T x \label{eq3} \end{eqnarray} where $\Sigma$ is the diagonal matrix of first $a$ singular values, $P$ is the loading vector matrix corresponding to first a singular values. The Hotteling's $T^2 $- statistics (\ref{eq3}) is scaled squared 2-norm of observation space X, measures systematic variations of the process, and if there is violations, it will indicate that systematic variations are out of control. If \ensuremath{\alpha } is the level of significance, the threshold of $T^2 $ statistics can be calculated as \citep{233519:5217242}, \begin{eqnarray}T_\alpha^2=\frac{m(n-1)(n+1)}{n(n-m)}F_\alpha (m,n-m) \label{eq4}\end{eqnarray} Where $F_\alpha (m,n-m) $ is known as F-distribution with m and (n-m) degree of freedom \citep{233519:5217242}. Essential condition for fault detection occurs if Hotteling's $T^2 $- statistics exceeds its threshold value, that is, \begin{eqnarray*}T^2 \ensuremath{\leq } T_\alpha^2 \ \ \ \ Fault\ free\ case \\ T^2 > T_\alpha^2 \ \ \ \ \ \ \ \ \ \ \ \ \ s Fault\ case\end{eqnarray*} A complete flowchart for offline and online computation of the PCA algorithm for fault detection is shown in Fig. \ref{PCA-offline} and \ref{PCA-online}, respectively. \begin{figure}[tb] \centering \includegraphics[scale=0.5]{media/PCA-offline} \caption{{Flowchart for offline fault computation using PCA}} \label{PCA-offline} \end{figure} \begin{figure}[tb] \centering \includegraphics[width=0.45\textwidth]{media/PCA-online} \caption{Flowchart for online fault computation using PCA} \label{PCA-online} \end{figure} \subsection{Fisher discriminant analysis} Fisher discriminant analysis is one of the most powerful methods for dimensionality reduction. In case of fault detection, PCA gives very good results. However, it has poor properties of fault classification because it does not consider information (variance) among different classes of data during computation of loading vectors \citep{233519:5217241}. FDA considers information among different classes of data, so it is more favourable for fault classification. It determines a set of transformation vectors, known as FDA vectors. FDA vectors maximise the information (distance) among different classes of data, while minimising information within each class in projected space. FDA tries to centralise different data classes and feature recognition rates of FDA is better than PCA. According to \citep{233519:5217240}, performance of FDA for fault detection and classification is quite better than that of PCA. The procedure to implement FDA is similar to PCA. First of all, FDA vectors are computed using training data, then these FDA vectors are utilised to transform online data into lower dimensional space. Finally, a discriminant function isolates the fault. In FDA training data, both normal and faulty data is used for computation of FDA vectors, however, in PCA only normal data is used for computation of loading vectors \citep{233519:5217240,233519:5217242}. In order to detect fault with the help of FDA, Hotteling's $T^2$- statistics is used. Let us assume that a training set of m process variables, with set of n observations, is shown in the form of input matrix $\mathrm{X}\mathrm{\in }{\mathrm{R}}^{\mathrm{n\times m}} $. Consider $q$ as number of classes in different faults and $n_k$ is number of observations in $k^th$ class, let $x_i $ be the transpose of \textbf{\textit{i}}\ensuremath{_{th}} row of matrix X. The transformation vector \ensuremath{\nu} is computed using training data such that following optimisation is solved. \begin{eqnarray} J_{FDA}(\nu)=arg \ max\ _{\nu\neq0} \frac{\nu^T S_b \nu}{\nu^T S_w \nu} \label{eq5} \end{eqnarray} Where S\_w shows within class scatter matrix given by \begin{eqnarray}S_w= \Sigma_{k=1}^qS_k \end{eqnarray} With \begin{eqnarray}S_k=\Sigma_{x_i\in\ensuremath{\chi }_k}^n(x_i-\overline{x}_k) (x_i-\overline{x}_k)^T\end{eqnarray} and the mean of kth class $\overline{x}_k=\frac1n_k \Sigma_{x_i\in x_k}x_i $ similarly $S_b $ is between class scatter matrix given by \begin{eqnarray}S_b=\Sigma_1^q(x_i-{\overline x}_k)(x_i-{\overline x}_k)^T\end{eqnarray} With $\overline x $ shows the combined (total) mean vector given by $\overline{x}=\frac1n \Sigma_{i=1}^n \ x_i $ it is stated that solution to above optimisation problem is identical to eigenvalue decomposition problem \citep{233519:5217243}, \begin{eqnarray} S_b \nu_h=\lambda_h S_w \nu_h \end{eqnarray} Where $\lambda_h $ is generalised eigenvalue representing the extent of separability between classes and $\lambda_h $ are respective eigenvectors. Equation (\ref{eq5}) shows optimisation problem that ensures minimum scatter within class and maximum scatter between different data classes. This feature helps to classify faults. In order to project online data into lower dimensional space, a matrix $V_q \in R^{(m\times q-1)} $ with q-1 FDA vectors is defined as, such data projected data $z_i \in R^{(q-1)} $ is given by \begin{eqnarray}z_i = V_q^T x_i\end{eqnarray} For fault detection Hotteling's $T^2 $- statistics is used \citep{233519:5217244}, given by \begin{eqnarray}T_k^2 = x^T V_a (V_a^T S_k V_a )^{-1} V_a^T x \end{eqnarray} Where a shows the number of non-zero eigenvalues. For a given level of significance \ensuremath{\alpha } , threshold for Hotteling's $T^2 $- statistics is given by: \begin{eqnarray} T_\alpha^2= \frac{a(n-1)(n+1)}{n(n-1)}{F_\alpha (a,n-a)} \\ T_k^2 \ensuremath{\leq } T_\alpha^2 \ \ \ Fault\ free\ case \nonumber \\ T^2>T_\alpha^2 Fault\ case \nonumber \end{eqnarray} For fault classification, the discriminant function is used as given below: \begin{eqnarray} g_k(x)= -\frac12(x-\overline x_k)^T V_q {(\frac{1}{n_k-1} V_q^T S_k V_q})^{-1} V_q^T (x-\overline{x}_k) \nonumber\\ +ln(q_i )-\frac12 ln[det(\frac{1}{n_k-1} V_q^T S_k V_q )] \end{eqnarray} In above equation, g\_k (x) is the discriminant function associated with class k, provided a data vector $x{\in}R^m$, online data is associated with class $i$ provided that the discriminant function belonging to $i^th$ class is maximum for a fault in class $i$, can be expressed as, \begin{equation} g_i (x) > g_k (x) \end{equation} A complete flowchart for offline training of the FDA algorithm is shown in Fig. \ref{offlineTrainFDA}. \begin{figure}[h] \centering \includegraphics[width=0.5\textwidth]{media/offlineTrainFDA} \caption{Flowchart for offline training of FDA} \label{offlineTrainFDA} \end{figure} \subsection{Support Vector Machines (SVM)} SVM is a well-known data driven technique used for detection and classification of faults due to its generalisation ability and being less susceptible to the curse of dimensionality \citep{233519:5217245}. For the first time, Support vector machines were used by Vapnik \citep{233519:5217246}. It is one of the new machine learning tools for classification of linear and nonlinear data. SVM is a binary classifier that maximises the margin between two data classes through a hyper-plane as shown in Fig. \ref{linePlanFig4}. SVMs maximise the margin near separating hyperplane. The decision of separation is fully identified by the support vectors. Solution of SVM is obtained through solution of quadratic programming. In SVM, a discriminant function is used to differentiate different classes of data given by: \begin{eqnarray}f(x)=w^T x+b\end{eqnarray} Where b, the bias, x, the data points, and w, the weighting vector, are obtained through training data. In two-dimensional space, the discriminant function is a line, in three-dimensional space, the discriminant function is a plane, and in n-dimensional space, the discriminant function is a hyperplane. SVM generates the optimal separating hyperplane by calculating the value of bias, weighting vector in such way that maximum margin is achieved. The points in training set with least perpendicular distance to the hyperplane are known as support vectors. The margin of the optimal separator can be defined as width of separation between support vectors. \begin{eqnarray}\rho=2 \frac{f(x^0 )}{w} =2r\end{eqnarray} \begin{figure} \centering \includegraphics[width=0.35\textwidth]{media/linSepHyp4} \makeatother \caption{{Linear separating hyperplane \protect\citep{233519:5217247}}} \label{linePlanFig4} \end{figure} \subsubsection{The Kernel Trick (Feature Space)} The cases in which training data is not linearly separable in the original space using above methods, then, this kind of data can be mapped to a higher-dimensional space which makes the data separable \citep{233519:5217247}, as shown in Fig.~\ref{featureSpace}. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/featureSpace5} \makeatother \caption{{Mapping of data to feature space \protect \citep{233519:5217247}}} \label{featureSpace} \end{figure} A kernel function is a type of function that corresponds to an inner product in the higher dimensional space. For example, if data is mapped to feature space through a transformation $\Phi:\;\;x\;\rightarrow\;\varphi(x) $, then, the inner product results: \begin{eqnarray}K(xi, xj) = \phi(xi) T \phi (xj) \end{eqnarray} There are different types of kernels, such as, polynomial, linear, Radial Basis Function (RBF) etc. The discriminant function of SVM, can be written as: \begin{eqnarray}f(x)=w^T x+b\end{eqnarray} According to Representer theorem, $w$ can be written as linear combination of input vectors. \begin{eqnarray}w= \Sigma_{j=1}^N \alpha_j x_j\end{eqnarray} Thus \begin{eqnarray}f(x)=w^T x+b=b+ \Sigma_{l=1}^N \alpha_l x_l^T x\end{eqnarray} All the dot products can be replaced with \begin{eqnarray}k(c,d)=c^T d \end{eqnarray} Optimisation problem: \begin{eqnarray}min \ a,b \ \ \frac12 \Sigma_{j,l=1}^N \alpha_j \ensuremath{\alpha }_l k(x_j,x_k )+C \Sigma_{j=1}^N \xi_j \end{eqnarray} Where \ensuremath{\xi }\_j{\textgreater}0 \begin{eqnarray}y_j \Sigma_{l=1}^N \alpha_l k(x_l,x_j)+b\ensuremath{\geq }1- \xi_j \end{eqnarray} In order to test the pattern, we use: \begin{eqnarray}f(x)=b+ \Sigma_{l=1}^N \alpha_l k(x_l,x)\end{eqnarray} Euclidean dot product can be substituted with dot product in feature space ``\ensuremath{\Phi }'', which will permit nonlinear classification. \begin{eqnarray}k(c,d)= \Phi(c)^T \Phi(d)\end{eqnarray} $k(c,d)$ is known as kernel function and corresponding SVM is called kernelized SVM. This type of SVM can solve the issue of classification of not linear separable data. Steps involved in implementation of kernelized SVM are:\\ \begin{enumerate}[Step 1:] \item Input data is normalised. \item Training of SVM. \begin{enumerate}[Step 2.1:] \item Selection of kernel function. \item Selection of kernel parameter. \item Optimisation of penalty factor (C). \item Cross validation. \end{enumerate} \item Classification of SVM test data. \end{enumerate} \subsubsection{Multiclass SVM} Binary class SVM can be used for fault detection, but it cannot be used for fault classification. However in practical cases, discrimination of more than two classes is required, hence, multiclass pattern recognition is often required in real world problems \citep{233519:5217248}. In majority of cases, multiclass pattern recognition problems are decomposed into series of binary problems such that binary pattern recognition techniques can easily be applied in practical cases. multiclass SVM algorithms such as one-versus-one, one-versus-all, can be applied be applied to classify more than two faults. \section{Application of Data Driven Techniques to Diagnose HIF} HIF is introduced at different positions and different phase conductors of IEEE 13-node test feeder as shown in Fig.~\ref{13node}. In data structure, data is generated from Simulink model of test feeder. There are 29 variables of singles phase, two phase and three phase voltages of 13-node test feeder. Data has been placed in input matrix in such a way that each column of input matrix represents voltage and each row of input matrix represents number of observations. There were 400 observations recorded for bus voltages, first 100 observations correspond to normal data, while other 300 observations correspond to three HIF locations at different positions of test feeder. \begin{figure} \centering \includegraphics[height=6cm, width=0.45\textwidth]{media/IEEE13_6} \makeatother \caption{{IEEE 13-node Distribution Test Feeder}} \label{13node} \end{figure} \subsection{Detection of HIF using PCA and Hotteling's $T^2 $ statistics} For diagnoses of HIF using PCA, training data consisting of 60 samples of normal condition (without fault) has been selected while testing data is consist of 100 samples of non-faulty data and 100 samples of faulty data. PCA algorithm has been applied on training data and 29 principal components are obtained. Out of 29 principal components only 5 principal components have been retained, the decision is made on the basis of total variance captured by these 5 principal components. The value of $\alpha$, as mentioned in (\ref{eq4}), is taken 0.001. As we have retained 5 principal components so $(\frac{1.6983}{1.72})=98\% $ of total variance has been captured by first five principal components. Fig.~\ref{projectData} shows projection of training data and testing in two dimensional space. It can be observed that first two components capture most of variation in higher dimensional data. Fig.~\ref{hotteling} shows the results of Hotteling's $T^2$ statistics to detect HIF after applying (3.3) on test data. It can be seen that normal data (first 100 samples) lies below threshold value of $T^2$ statistics, where threshold value is 22.0108. This threshold value was found using significance level of 0.1\% and confidence region of 99\%. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/projectionPCA2D_7} \makeatother \caption{{Projection of training data and testing in two dimensional space for PCA}} \label{projectData} \end{figure} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/HottlingT2-PCA-8} \makeatother \caption{{The results of Hotteling's $T^2$ statistics to detect HIF}} \label{hotteling} \end{figure} PCA can successfully detect high impedance fault as shown in Fig.~\ref{hotteling}. In some cases, it is required to classify different types of HIFs such as broken conductor and unbroken conductor HIFs at different locations of feeder. For this purpose, High impedance faults at three different locations are analysed. Fig.~\ref{hotteling3location} shows plot of Hotteling's $T^2 $ statistics to detect HIFs at three different locations. Results show that PCA can successfully detect these three HIFs. Only 5 principal components are retained such that (1.6983/1.72)=98\% of total variance has been captured. Fig.~\ref{multiFaultproject} shows projection of training data and test data in two dimensional space, it can be seen that PCA cannot discriminate between different types of HIFs, this is due to the reason that PCA do not consider information among different classes of data. We can conclude that PCA is suitable for HIF detection but it cannot classify different types of HIFs. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/Hotteling-T2-10} \makeatother \caption{{Plot of Hotteling's $T^2$ statistics to detect multiple HIFs}} \label{hotteling3location} \end{figure} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/projection2D-PCA-11} \makeatother \caption{{Projection of training and test data in 2-D space for multiple faults}} \label{multiFaultproject} \end{figure} \subsection{Detection of HIF using FDA}FDA is applied for detection and isolation of high impedance faults in power distribution systems. In order to compute FDA vectors, both normal and faulty data is used, in this work, 60 samples in training data and 40 samples in test data corresponding to each scenario, that is, faulty and non-faulty case. Fig.~\ref{FDAprojection} shows projection of training data in two-dimensional space by FDA. In second step, after computation of transformation vectors (FDA vectors), the discriminant function is used to test online data. Fig.~\ref{discFunPlot} shows plot of discriminant function in each category. It can be observed that up to first 30 samples, value of discriminant function corresponding to normal case has maximum magnitude, which shows that there is no fault in test feeder. Similarly, after 30 samples, value of discriminant function corresponding to fault at position A has maximum magnitude, which shows that fault at position has occurred. Same is the case with fault at position B and C. Zoomed view of plot is shown in Fig.~\ref{discFunZoom}. \begin{figure}[tb] \centering \includegraphics[width=0.5\textwidth]{media/projectionFDA-12} \makeatother \caption{{Projection of training data in two dimensional space by FDA}} \label{FDAprojection} \end{figure} \begin{figure}[tb] \centering \includegraphics[height=4.75cm, width=0.5\textwidth]{media/discFunFDA-13} \makeatother \caption{{Plot of discriminant function for multiple HIF detection using FDA}} \label{discFunPlot} \end{figure} \begin{figure}[tb] \centering \includegraphics[width=0.5\textwidth]{media/zoomedDiscFDA-14} \makeatother \caption{{Zoomed view of discriminant function for multiple HIF detection using FDA}} \label{discFunZoom} \end{figure} The above results have shown that FDA can successfully isolate/locate HIF. This technique is very well suited for monitoring of power distribution systems. \subsection{Detection of HIF using SVM}Support vector machine algorithm has been applied for 29-dimensional data without any dimensional reduction technique. Selection of optimal value of penalty factor is important, this is done by performing nested 3-fold cross validation in original data. With the help of cross validation, average area under the curve was computed for 1000 values of penalty factor between 0.1 and 100. After selection of optimal value of C, SVM classifiers were trained with optimal penalty factor and validated on training data so that generalisation would be checked. Test data of HIF was classified by validated SVM classifier. The predicted labels of test data fairly detects the occurrence of fault, that is -1 for non-faulty data and +1 for faulty data as shown in Fig.~\ref{binarySVM}. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/bSVM-15} \makeatother \caption{{Classification of an HIF using binary-class SVM}} \label{binarySVM} \end{figure} \subsection{Detection and Classification of HIF using M-SVM} Binary class SVM can be used for fault detection, but it cannot be used for fault classification. However, in Power distribution systems, discrimination of more than two classes is required, hence, multiclass pattern recognition is often required in monitoring Power distribution systems. Multiclass SVM (M--SVM) classifier is obtained using training of non-fault cases with class label 4, fault at position A with class label 3, fault at position B with class 2, and fault at position C with class 1. In each classifier, during training, a Gaussian Radial Basis Function kernel with a scaling factor, sigma ($\sigma$), of 0.5 and a penalty factor of 10 is used. The tolerance value for Karush-Kuhn-Tucker (KKT) condition for the training of data is taken as 0.001. The value of regularization parameter, lambda ($\lambda$) is 1. Test data is classified using the trained classifiers for 50 observations of each data class and predicted labels were differentiated with known data labels. Fig.~\ref{predLabelsSVM} shows that up to 50 samples, the predicted labels belong to normal class data, indicating that there is no fault. After first 50 samples, predicted labels belong to class label 3, indicating that the fault is occurred at position A. After first 100 samples, predicted labels belong to class label 2, indicating that the fault is occurred at position B. similarly, after first 150 samples, predicted labels belong to class label 1, indicating that the fault is occurred at position C. Similarly, Fig.~\ref{predLabelSVM2d} show the score plot of test data for each class of data. A comparison is presented to evaluate the results of the proposed technique with those from literature and observations have been recorded in Table \ref{tableComp}. After testing the technique on 400 test cases, it is found that proposed method is extremely quick and efficient in detecting HIFs. The proposed method is evaluated through the following performance indices:\\ Dependability: Predicted HIF cases/Actual HIF cases.\\ Security: Predicted non-HIF cases/Actual non-HIF cases. Table 1 compares the performance indices of the proposed method. It is noted that the proposed method detects all HIF faults under various operating conditions and disturbances. Thus, the proposed method is accurate, reliable and prompt in the detection of High Impedance Faults. \begin{table*}[] \caption{Comparison of performance indices of the proposed M-SVM method with previous techniques} \begin{center} \begin{tabular}{|c|c|c|} \hline \textbf{Method} & \textbf{Security (\%)} & \textbf{Dependability (\%)}\\ \hline Wavelet transform \citep{chen2016detection} & 68.5 & 72 \\ \hline Time frequency transform \cite{samantaray2008high} & 81.5 & 98.3 \\ \hline Morphological gradient \citep{sarlak2011high} & 96.3 & 98.3 \\ \hline Mathematical Morphology \citep{gautam2012detection} & 100 & 100 \\ \hline The proposed method (M-SVM) & 100 & 100 \\ \hline \end{tabular} \label{tab1} \end{center} \label{tableComp} \end{table*} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{media/M-SVM-17} \makeatother \caption{{Predicted labels of test data using Multiclass--SVM classifier}} \label{predLabelsSVM} \end{figure} \begin{figure} \centering \includegraphics[height=4.81cm, width=0.5\textwidth]{media/M-SVM-Label-18} \makeatother \caption{{Predicted labels of test data using M--SVM classifier on a 2-D plane}} \label{predLabelSVM2d} \end{figure} It can be seen that M-SVM can easily classify high impedance faults at different locations with load variation and capacitor switching. So, we can conclude that SVM based techniques can successfully detect and locate HIFs in a Power Distribution Network. \section{Conclusion} In this research paper, high impedance fault detection and classification in power distribution systems has been studied using data driven techniques. Source-diode-resistance model consisting of two diodes with opposite polarity connected to DC sources is utilised to simulate the high impedance fault. Data driven techniques including PCA, FDA, and SVM are applied to detect/classify HIFs. PCA along with Hotteling's $T^2$ statistics to detect HIFs, it is demonstrated that PCA successfully detects HIF but it cannot classify HIFs. Compared to that, FDA can also successfully classify/locate the fault. Further superior results are achieved by M-SVM, fault classification rate of SVM is better than FDA. M-SVM algorithm can detect all types of HIF and is also robust against capacitor and load switching transients in distribution network. \section*{Conflict of Interest} The authors declare no conflict of interest.
\section{Introduction} The question of how an isolated many-body system thermalizes has a long history. In the classical domain, thermalization of an isolated system in the limit of long times is governed by Boltzmann's ergodic hypothesis~\citep{huang2009introduction,pathria2011statistical,penrose1979foundations}. It states that classical chaotic systems, uniformly sample all the available micro-states at a given energy, in the long time limit. However, this hypothesis cannot be generalized directly to the quantum domain as in the long time limit the expectation value of an observable retains the initial memory of the system, and is thus unable to sample all the eigenstates of the system. Experimental advancement~\cite{kinoshita2006quantum,hofferberth2007non,rigol2008thermalization} in recent times has created a strong demand for a close understanding of thermalization in isolated quantum systems and led to a flurry of theoretical activity~\citep{PhysRevLett.103.100403,PhysRevE.82.031130,rigol2011initial,he2012initial,mondaini2015many,PhysRevE.89.042112,rigol2007relaxation,PhysRevE.81.036206,canovi2011quantum,rigol2010quantum}. Thermodynamic entropy in the context of classical statistical mechanics is by its very nature an extensive quantity~\citep{huang2009introduction,penrose1979foundations,pathria2011statistical}. In quantum systems, entanglement entropy of individual eigenstates brings in a rich additional dimension. Discussions of the extensivity or the lack thereof of entanglement entropy have abounded~\citep{vitagliano2010volume,PhysRevLett.96.010404,PhysRevLett.111.210402,roy2018entanglement,roy2019quantum,PhysRevB.89.115104} in recent times. The celebrated area law~\citep{hastings2007area,laflorencie2016quantum,eisert2010colloquium} which asserts that the ground state entanglement entropy scales with subsystem as the surface area of the subsystem, has been a central topic around which many of these studies have been carried out. However, the relationship between entanglement entropy and thermodynamic entropy has only been scantily covered~\cite{deutsch2013microscopic}. In this Letter, we demonstrate, with the aid of a specific example, that a systematic study of this relationship is an illuminating diagnostic for a class of quantum phase transitions. For an isolated quantum system it has been argued that the route to thermalization is described by the \emph{eigenstate thermalization hypothesis}(ETH)\citep{PhysRevA.43.2046,PhysRevE.50.888,rigol2008thermalization,deutsch2018eigenstate,d2016quantum}. The ETH states that expectation values of operators in the eigenstates of the Hamiltonian are identical to the their thermal values, in the thermodynamic limit. The measurement of any local observable in these systems gives the same expectation values for nearby energies. A closely related, but completely independent feature analogous to the ETH is the question of whether the thermodynamic entropy of a subsystem obtained from the micro-canonical reduced density matrix with a fixed energy $E_0$ is equal to the entanglement entropy calculated from the energy eigenstate of the system with the same energy $E_0$~\citep{deutsch2010thermodynamic,deutsch2013microscopic}. \begin{figure}[t] \includegraphics[scale=0.65]{picture4} \caption{A schematic representation of the model with our main findings. In the non-integrable ergodic phase, the entanglement entropy matches with the thermodynamic entropy, while in the integrable and non-integrable MBL phases, it differs from the thermodynamic entropy. In the non-integrable MBL phase, the magnitude of the entanglement entropy is significantly smaller. The arrow represents the direction of increasing field strength. The inset shows the mean level-spacing ratio (averaged over different values of $\alpha$) as a function of the field strength. The other parameters are: $L=16, V=1.0$ and filling factor $=0.5$.} \label{ravS} \end{figure} The phenomenon of many-body localization (MBL)~\citep{PhysRevLett.95.206603,basko2006metal,PhysRev.109.1492,nandkishore2015many,pal2010many} in which interactions fail to destroy Anderson localization ( caused by random disorder) has created considerable excitement. The MBL phase is believed to exhibit properties similar to those of integrable systems~\citep{vosk2013many,huse2014phenomenology,vasseur2016nonequilibrium,RevModPhys.91.021001,imbrie2017local,serbyn2013local,chandran2015constructing}. In particular, although the ETH criterion is known to be satisfied by generic, non-integrable systems~\citep{khatami2012quantum,he2013single,tang2015quantum,beugeling2014finite,PhysRevE.81.036206,kim2014testing,PhysRevE.82.031130,PhysRevLett.108.110601,PhysRevE.87.012125}, a violation of the ETH is expected for integrable, and therefore MBL systems~\citep{PhysRevLett.103.100403,deutsch2013microscopic,mondaini2015many,PhysRevE.85.050102}. The expectation value of any local observable in these systems fluctuates wildly for nearby eigenstates. Integrable systems are exactly solvable and have an extensive number of local conserved currents~\citep{sutherland2004beautiful}, which do not evolve in the course of time and hence, prevent the system from thermalization. Similarly, MBL systems have conserved quasi-local integrals of motion which help to retain the memory of the initial state~\cite{RevModPhys.91.021001,imbrie2017local,serbyn2013local,chandran2015constructing}. Most MBL systems have in-built disorder \citep{luitz2015many,nandkishore2015many,iyer2013many}. Recent work~\citep{schulz2019stark,van2019bloch} has proposed that a stable MBL-like phase may be obtained in a clean (disorderless) interacting system subjected to an electric field and a confining/disordered potential. The additional potential turns out to be essential as in its absence, the MBL phase cannot be obtained~\cite{schulz2019stark,van2019bloch,moudgalya2019thermalization,taylor2019experimental}. This many-body system is known to exhibit a rich phase diagram. In the absence of both electric field and curvature term, this model is integrable, while a finite value of either of these external potentials breaks the integrability. Further in the region of broken integrability it shows a transition from the ergodic to the MBL phase on varying the strength of the electric field. Thus it provides a good test bed to characterize various phases: integrable, non-integrable ergodic and non-integrable MBL phases. As opposed to a standard disordered system, a clean system could potentially be realized experimentally with greater ease, while still using the already available methods~\citep{schreiber2015observation,choi2016exploring, smith2016many,kondov2015disorder,bordia2017probing}. In this article, we demonstrate the profitability of a study of the relationship between thermodynamic entropy and entanglement entropy to characterize various phases. Although our technique is, in principle, more general, we concentrate on the concrete case of the above disorder-free model. We find that for a small subsystem, the entanglement entropy of each eigenstate matches with the thermodynamic entropy, provided the system is tuned in the non-integrable ergodic phase and satisfies the ETH criterion. However in the integrable and non-integrable MBL phases, the entanglement entropy shows large fluctuations for nearby eigenstates, and also differs from the thermodynamic entropy. The difference between the thermodynamic entropy and the entanglement entropy increases on varying the strength of the electric field due to the strong localization from the electric field which leads to a smaller entanglement entropy. Further tests are done from an alternative perspective by studying the dynamics of average particle number in the subsystem. In the long time limit, the saturation value of the observable in the non-integrable ergodic phase matches with the results predicted by the diagonal ensemble and the microcanonical ensemble, while in the non-integrable MBL phase the saturation value matches with the diagonal ensemble result but differs from the microcanonical ensemble result. \section{Model Hamiltonian} We consider the clean, spinless fermionic Hamiltonian with $L$ sites ~\cite{schulz2019stark}: \begin{eqnarray}\label{eq1} H=-J\sum_{j=0}^{L-2}(c_{j}^{\dagger}c_{j+1}+c_{j+1}^{\dagger}c_{j})-F\sum_{j=0}^{L-1} j (n_{j}-\frac{1}{2})\qquad \nonumber \\ + \alpha \sum_{j=0}^{L-1} \frac{j^2}{(L-1)^2} (n_{j}-\frac{1}{2}) + V\sum_{j=0}^{L-2} (n_j-\frac{1}{2})(n_{j+1}-\frac{1}{2}),\nonumber \\ \end{eqnarray} where $c, c^\dagger$ are the fermionic operators, $F$ is the linear electric field, $\alpha$ is the curvature term and $V$ is the nearest neighbor interaction. The form of the curvature term provides a slight non-linearity in the overall onsite potential. The lattice constant is kept at unity and natural units ($J=\hbar=e=1$) are adopted for all the calculations. In the non-interacting limit $(V=0)$ with $\alpha= 0$, the above Hamiltonian yields the Wannier-Stark ladder characterized by an equi-spaced energy spectrum proportional to the electric field strength, and where all the single particle eigenstates are localized~\citep{krieger1986time,wannier1960wave}. Furthermore, the dynamics governed by this Hamiltonian gives rise to oscillatory behavior which is known as Bloch oscillations~\citep{bouchard1995bloch,mendez1993wannier,hartmann2004dynamics,PhysRevB.98.045408,PhysRevB.99.155149}. When interactions are included, the model is integrable in the absence of both the static field and the curvature term ($F=0, \alpha =0$). The integrability is broken by a non-zero value of either the field $F$ or the curvature $\alpha$. When the field $F$ is varied while keeping $\alpha$ fixed at a non-zero value, the system undergoes a transition from a delocalized (ergodic) phase at small field strengths to the MBL phase~\citep{schulz2019stark,van2019bloch} at large field strengths. The inset of Fig.~\ref{ravS} carries a plot of the mean level spacing ratio~\citep{oganesyan2007localization} (averaged over the curvature parameter $\alpha$) as a function of the field, indicating a change of statistics~\citep{atas2013distribution} from Wigner-Dyson to Poisson. \section{ETH and thermodynamic entropy} For an isolated quantum system described by a Hamiltonian $H$, the time evolution of any initial state is given by \begin{equation}\label{eq3} |\psi(t)\rangle = e^{-iHt}|\psi (0)\rangle = \sum_{n} c_n e^{-i\epsilon_n t} |n\rangle, \end{equation} where $\epsilon_n$ and $|n\rangle$ are the eigenvalues and the eigenstates of the Hamiltonian respectively. The information of the initial state is encoded into the coefficients $c_n$. For any operator $\hat{\mathcal{O}}$ the expectation value after any time $t$ is given by \begin{equation}\label{eq4} \langle\hat{\mathcal{O}}(t)\rangle = \langle \psi(t)|\hat{\mathcal{O}}(t)|\psi(t)\rangle. \end{equation} Using Eq.~\ref{eq3}, this simplifies to \begin{equation}\label{eq5} \langle\hat{\mathcal{O}}(t)\rangle = \sum_{n} |c_n|^2 \mathcal{O}_{nn} + \sum_{m\neq n} c^{*}_{m}c_n e^{i(\epsilon_m - \epsilon_n)t} \mathcal{O}_{mn}, \end{equation} where $\mathcal{O}_{mn}$ are the matrix elements of the operator $\hat{\mathcal{O}}$ in the eigenbasis of the Hamiltonian $H$. It can be seen from Eq.~\ref{eq5} that in the long time limit ($t\to\infty$), generically (in the absence of degeneracy) the second term goes to zero and the expectation value of the observable saturates to the value predicted by the diagonal ensemble: \begin{equation}\label{eq5a} \langle\hat{\mathcal{O}}(t\to \infty)\rangle = \langle\hat{\mathcal{O}}_{DE}\rangle = \sum_{n} |c_n|^2 \mathcal{O}_{nn}. \end{equation} Hence the system retains the memory of the initial state through the coefficients $c_n$, and does not follow the ergodic hypothesis. \begin{figure}[t] \includegraphics[scale=0.56]{entI_eigL16f00NS4} \includegraphics[scale=0.56]{entI_eigL16f04NS4}\\ \includegraphics[scale=0.56]{entI_eigL16f15NS4} \includegraphics[scale=0.56]{entI_eigL16f30NS4} \caption{The entanglement entropy of each energy eigenstate and the corresponding thermodynamic entropy. (a) Integrable phase ($F=0$, $\alpha =0$): the entropy of nearby eigenstates fluctuates wildly with a finite difference between average entropy and the microcanonical average. (b,c,d) Non-integrable phase : with $\alpha=1.0$ and $F=0.4,1.5,\ \text{and}\ 3.0$ respectively. We obtain agreement between the entanglement entropy with its corresponding thermodynamic entropy in the ergodic phase $(F=0.4)$ satisfying ETH while the ETH is violated on increasing the value of field strength (going into the MBL phase). The other parameters are: $L=16, V=1.0$ filling factor $=0.5$, and subsystem size $m = 4$.} \label{enteig} \end{figure} Thermalization in isolated quantum many body systems happens via the mechanism of ETH, which implicitly involves the assumption that the diagonal elements of the operator $\hat{\mathcal{O}}$ change slowly with the eigenstates. Specifically, the off-diagonal elements $\mathcal{O}_{mn}$, and the difference in the neighboring diagonal elements: $\mathcal{O}_{n+1,n+1}-\mathcal{O}_{n,n}$ are exponentially small in $\mathcal{N}$, with $\mathcal{N}$ being the system size. With this assumption, the diagonal ensemble result (Eq.~\ref{eq5a}) saturates to a constant value as the matrix elements $\mathcal{O}_{nn}$ are effectively constant over a given energy window. Now considering the micro-canonical ensemble, the average value of the same observable can be written as \begin{equation}\label{eq5b} \langle\hat{\mathcal{O}}_{ME}\rangle = \frac{1}{N_{\text{states}}}\sum_{n=1}^{N_{\text{states}}} \mathcal{O}_{nn}, \end{equation} where $N_{\text{states}}$ is the number of states in a given energy shell. Imposing the assumption of ETH, this also saturates to a constant value. Thus in the long time limit, the system thermalizes and the observable saturates to a thermal value predicted by the micro-canonical ensemble~\citep{rigol2008thermalization,kim2014testing,PhysRevLett.108.110601}. Under these conditions the expectation value of the operator $\hat{\mathcal{O}}$ in the energy eigenstate characterized by the density matrix $\rho_E \equiv |E\rangle\langle E|$ is the same as the micro-canonical average of the same operator: \begin{equation}\label{eq6} \text{Tr}(\rho_E \hat{\mathcal{O}})=\text{Tr}(\rho_{\text{micro},E}\hat{\mathcal{O}}), \end{equation} where the microcanonical density matrix is defined as \begin{equation}\label{eq7} \rho_{\text{micro},E_0} = \frac{1}{N_{\text{states}}}\sum_{E_0<E< E_0+\Delta E} |E\rangle\langle E|, \end{equation} where $N_{\text{states}}$ is the number of states available in the energy window $\Delta E$. \begin{figure}[t] \includegraphics[scale=1.1]{entF16a_frac} \caption{The difference between the thermodynamic entropy and the average entropy as a function of energy. Only the central part of the spectrum ($E\in[-10:10]$) is shown for various values of the field strength. In the ergodic phase the difference is almost zero while in the MBL phase the difference is much larger. The other parameters are: $L=16, \alpha = 1.0, V=1.0$ filling factor $=0.5$, and subsystem size $m = 4$.} \label{avgentdiff} \end{figure} \begin{figure*}[t] \includegraphics[scale=0.77]{entScale16_frac} \includegraphics[scale=0.77]{ent16_inset_f02} \includegraphics[scale=0.77]{ent16_inset_f30} \caption{(a) Difference between the thermodynamic entropy and the average entropy (average carried out over $100$ nearest eigenstates in both cases) as a function of energy for different subsystem sizes in the ergodic phase($F=0.2$). A better thermalization can be seen for smaller subsystem sizes. (b,c) The finite size scaling of the difference of thermodynamic and average entropy (for a single eigenstate located at the middle of spectrum) as a function of the subsystem size in both ergodic and MBL phases. The other parameters are: $L=16, \alpha = 1.0, V=1.0$ filling factor $=0.5$. } \label{diff_m} \end{figure*} For a composite system $(A+B)$ characterized by the density matrix $\rho$, the entanglement entropy of a subsystem $A$ is defined as: $S_{\text{Ent}}=-\text{Tr}(\rho_{A}\text{ln}\rho_{A})$, where $\rho_A = \text{Tr}_B \rho$, is the reduced density matrix of the subsystem $A$ taken after tracing out the degrees of freedom of the other subsystem $B$. On the other hand, the thermodynamic entropy from a microcanonical ensemble is defined as: $S_{\text{thermo}}=-\text{Tr}(\rho_{\text{micro}}\text{ln}\rho_{\text{micro}})$. The criterion of ETH is extended~\citep{deutsch2013microscopic,deutsch2010thermodynamic} by asking whether the entanglement entropy of a small subsystem taken out of a large system in an eigenstate with energy $E_0$ is equal to the thermodynamic entropy computed from the micro-canonical density matrix (Eq.~\ref{eq7}) with the same energy $E_0$. Positing an ETH-like equation where $\rho_{\text{micro}}$ is replaced by $\rho_A$ we ask if the condition \begin{equation}\label{eq11} S_{\text{thermo}} = -\text{Tr}(\rho_{A}\text{ln}\rho_{A})=-\text{Tr}(\rho_{A,\text{micro}}\text{ln}\rho_{A,\text{micro}}) \end{equation} holds. Here, $\rho_{A,\text{micro}}$ is the reduced density matrix corresponding to the density matrix $\rho_{\text{micro}}$. For the subsystem $A$, this can be calculated by tracing out the degree of freedom of the remaining part: $\rho_{A,\text{micro}}= \text{Tr}_{B}(\rho_{A,\text{micro}})$. Although the above criterion is analogous to the standard ETH one (Eq.~\ref{eq6}) the logarithmic factor $\text{ln}\rho_A$ is not an observable quantity, thus making it an independent characteristic of thermalization. \section{Results and discussion} \subsection{Statics} The model considered contains three regimes of interest: the integrable phase, the non-integrable ergodic phase and the non-integrable MBL phase. We employ numerical exact diagonalization of the model (Eq.~\ref{eq1}) for a system size upto $L=16$ with the filling factor set to half filling. We also define the subsystem $A$ as consisting of first $m$ sites out of the $L$ sites. We test the equivalence of the thermodynamic entropy and entanglement entropy (Eq.~\ref{eq11}) in these distinct phases. We compute the entanglement entropy for a small subsystem ($m=4$) for all the eigenstates and plot it in Fig.~\ref{enteig}. The thermodynamic entropy for all the eigenstates is also plotted by considering the microcanonical density matrix (Eq.~\ref{eq7}), followed by tracing out the degrees of freedom of the complement of the subsystem. Since the energy spectrum fans out as a function of the electric field strength, we average the density matrix over $N_\text{states}=100$ nearest-neighbor eigenstates to compute the thermodynamic entropy. Furthermore, the average entanglement entropy $S_\text{avg}$ (average of the entanglement entropy of $100$ nearby eigenstates) is also plotted in the same figure. In the integrable case ($F,\alpha = 0$), the thermodynamic entropy differs from the entanglement entropy with the latter having a lot of fluctuations. However, for the parameters in the ergodic phase, nice agreement is found between the thermodynamic entropy and entanglement entropy, which signifies the validity of ETH in this phase. When the system is tuned on the border ($F=1.5$), the entanglement entropy also shows fluctuations due to a mixture of both volume law and area law scaling states. This in-between phase has been called the ``S-phase" ~\citep{xu2019butterfly}. For the parameters in the MBL region, the entanglement entropy shows wild fluctuations and the thermodynamic entropy is also different from the entanglement entropy, which suggests the breakdown of ETH in the MBL phase. It is interesting to note that even though both integrable and non-integrable MBL phases violate the ETH, the \emph{magnitude} of entanglement is considerably lower in the latter, due to the underlying localization. It is useful to consider the difference between thermodynamic entropy and the average entanglement entropy: \begin{equation} \Delta S = \frac{S_{\text{thermo}}-S_{\text{avg}}}{S_{\text{thermo}}}. \end{equation} The difference between the thermodynamic entropy and the entanglement entropy ($\Delta S$) increases on increasing the electric field strength. The entropy for a part of the spectrum ($E\in[-10:10]$) is plotted in Fig.~\ref{avgentdiff} for various values of the field strengths. In the ergodic phase the difference is close to zero signifying the validity of ETH while a finite difference in the MBL phase shows the violation of ETH. \begin{figure}[t] \includegraphics[scale=1.1]{dynamic_nav_mod} \caption{Quench dynamics: In the non-integrable ergodic phase ($F=0.6$), the long time saturation value of the average number of particles in the subsystem matches with those of the diagonal ensemble and the micro-canonical ensemble. In the non-integrable MBL phase ($F=3.0$) on the other hand, the saturation value matches with the result of the diagonal ensemble while it differs from that of the micro-canonical ensemble. The inset shows the normalized difference between the diagonal ensemble result and the micro-canonical ensemble result as a function of field strength for the same initial state. The value is close to zero in the non-integrable ergodic phase while a finite difference is obtained in the non-integrable MBL phase. The other parameters are: $L=16, \alpha = 1.0, V=1.0$ filling factor $=0.5$, and subsystem size $m = 4$.} \label{quench} \end{figure} Finally, we test the equivalence of thermodynamic entropy and entanglement entropy on varying the subsystem size. For each eigenstate, Fig.~\ref{diff_m} shows the difference between these two for various values of subsystem size. It can be seen that for smaller subsystems the difference tends to zero, hence the smaller the subsystem the better is the thermalization~\cite{PhysRevLett.119.020601,PhysRevLett.121.220602}. The other two figures in Fig.~\ref{diff_m} show the finite size scaling of this difference but for a single eigenstate located at the center of the spectrum. It can be seen that for a smaller fraction $m/L$ the difference goes to zero and thus shows the validity of ETH for these fractions. On the other hand, in the MBL phase, this difference is found to increase on increasing the system size as well as the subsystem sizes. \subsection{Quench dynamics} A complementary understanding of the distinction between the various phases is afforded by a study of the long time behavior of the system under time evolution. As evident from Eq.~\ref{eq5}, the dynamics of any observable has two parts: the first part is the same as the result predicted by the diagonal ensemble while the second part gives the fluctuations around it. In the long time limit, the observable, in general, equilibrates to the diagonal ensemble value. However this does not imply the thermalization of the observable. An observable is said to thermalize if the result of the diagonal ensemble matches with the result predicted by any thermal ensemble such as micro-canonical or canonical. We consider the average number of particles in the subsystem~\citep{PhysRevLett.115.186601}: $\hat{\mathcal{O}} = \sum_{i=1}^{m} \hat{N}_i$, where $\hat{N}_{i}=c_{i}^{\dagger}c_i$ is the number operator at site $i$. The initial state is taken as a charge density wave state (where all the even sites are occupied and odd sites are empty), and the dynamics is governed by the final Hamiltonian (Eq.~\ref{eq1}). The prescription for obtaining the micro-canonical density matrix is as follows. We first calculate the average energy of the initial state: $E_{\text{ini}} = \langle \psi_0|H|\psi_0\rangle$. Next we obtain the eigenstate closest to this energy. By taking $100$ nearest neighbor eigenstates around the obtained state, we then construct the micro-canonical density matrix. \begin{figure}[t] \includegraphics[scale=1.2]{ravg16int} \caption{Surface plot of the level statistics as a function of both field strength $(F)$ and the interaction strength $(V)$. The other parameters are: $L=16, \alpha=1.0$. } \label{rav} \end{figure} We present data for the dynamics of the above observable in Fig.~\ref{quench}, comparing against the values predicted by the diagonal and micro-canonical ensembles. In the ergodic phase, the long time limit of the expectation value of the observable is in agreement with that predicted by both the diagonal ensemble and the micro-canonical ensemble, which in turn implies thermalization and the validity of ETH in this phase. On the other hand, in the MBL phase the saturation value is the same as predicted by the diagonal ensemble but it differs from the micro-canonical ensemble result suggesting the lack of thermalization in the MBL phase. To study the difference between the diagonal and micro-canonical ensemble results, we define the following normalized difference: \begin{equation}\label{eq14} \Delta N = \frac{|N_{\text{DE}} - N_{\text{ME}}|}{|N_{\text{ME}}|}, \end{equation} where $N_{\text{DE}}$ and $N_{\text{ME}}$ are the expectation values of the observable $\hat{\mathcal{O}}$, calculated from the diagonal ensemble and micro-canonical ensemble respectively. The inset shows the normalized difference $\Delta N$ (Eq.~\ref{eq14}) as a function of electric field strength for the same initial state. The value is close to zero in the non-integrable ergodic phase while a finite difference is obtained in the non-integrable MBL phase. \subsection{Variation of interaction strength} The nature of the phase obtained also depends on the interaction strength. Fig.~\ref{rav} shows the surface plot of the average level spacing as a function of both field strength and interaction strength for a fixed value of the curvature term ($\alpha = 1.0$). It can be seen that on increasing the interaction strength, the ergodic region extends, thus we expect the equivalence of the entanglement entropy and the thermodynamic entropy to hold in this extended region. \section{Summary and Conclusions} To summarize, we test the validity of ETH in an interacting system subjected to a static electric field. For small electric field strength this model shows ergodic behavior while for sufficiently strong electric field it exhibits MBL. In the limit of zero electric field and curvature strength, the model is integrable. We find that in the ergodic phase, the entanglement entropy of the states following a volume law of scaling matches with the corresponding thermodynamic entropy thus satisfying the ETH criterion, while in the MBL phase, the entanglement entropy fluctuates wildly from eigenstate to eigenstate, and also differs from the thermodynamic entropy. Since the MBL phase possesses low entanglement, a clear distinction is obtained between the integrable and the MBL phase from the point of view of the ETH. As reported earlier~\citep{deutsch2013microscopic}, a striking distinction between integrable and non-integrable systems is the presence of large eigenstate-to-eigenstate fluctuations in the expectation value of any observable in the integrable case. In support of the argument that the MBL phase is similar to integrable systems, we find that indeed, the MBL phase is also characterized by large flucutations in entanglement entropy across adjacent eigenstates. However, in contrast to the integrable phase, the \emph{magnitude} of entanglement is significantly lower in the MBL phase. Moreover, the difference between the average entropy and the thermodynamic entropy increases on going deep into the localized phase. We further verify the above arguments from a dynamical perspective by studying the dynamics of average number of particles in the subsystem starting from a charge density wave type of initial state. We find that in the ergodic phase the saturation value obtained from the dynamics, the result predicted by the diagonal ensemble as well as the micro-canonical ensemble result match with each other, implying that the system thermalizes in the long time limit. In the MBL phase on the other hand, the saturation value matches with the result predicted by the diagonal ensemble, but differs from that predicted by the micro-canonical ensemble. This signifies the lack of thermalization or ETH in the MBL phase. \section*{Acknowledgment} We are grateful to the High Performance Computing (HPC) facility at IISER Bhopal, where large-scale calculations in this project were run. A.S is grateful to SERB for the grant (File Number: CRG/2019/003447), and for financial support via the DST-INSPIRE Faculty Award [DST/INSPIRE/04/2014/002461]. D.S.B acknowledges PhD fellowship support from UGC India. We are grateful to Josh Deutsch and Sebastian W\"{u}ster for their comments on the manuscript. We thank Ritu Nehra for help with the schematic diagram.
\subsection{Overview} \subsection{Overview} \begin{figure}[b!] \centering \resizebox{\sfigsmall}{!}{\includegraphics {./Figures/overview.pdf}} \caption{{Conceptual overview of the input and output of the proposed PAGAN generator. }} \label{fig:overview} \end{figure} In this work we deal with deep-learning networks for time series data. As observed by other authors \cite{shaojie2018}, 1D convolutional networks are an effective tool to process time series and can outperform traditional recurrent networks in terms of both result quality and performance. For this reason we process time series by means of convolutional networks and represent the asset-price trends as a matrix ${M}$ with $\assets$ rows (financial assets) and $\window$ columns (days), ${M}\in \mathbb{R}^{\assets\times\window}$. The deep-learning networks process the time information by convolving along the time dimension. Our aim in this work is to model the probability distribution of the asset-price trends for the future $\windowForward$ days given the current market situation represented by the latest observed $\windowBackward$ days. We consider the matrix ${M}$ to span the whole analysis length: $\window=\windowForward + \windowBackward$. Thus, ${M}$ is composed of two parts: \textit{a)} the known past ${\priceSequence_{\windowBackward}}$ of length $\windowBackward$, and \textit{b)} the unknown future ${\priceSequence_{\windowForward}}$ of length $\windowForward$. We apply a generative deep-neural network ${G}$ to learn the probability distribution of future price trends ${\priceSequence_{\windowForward}}$ within the target future horizon $\windowForward$ given the known recent past ${\priceSequence_{\windowBackward}}$, and a prior distribution of a random latent vector. Figure \ref{fig:overview} shows a graphical interpretation of what the matrix ${M}$ represents and the input and output of the generator ${G}$. Formally the generative model returns a synthetic possible future matrix ${\hat{\forwardSequence}}$ (a simulation) as a function: \begin{equation} {\hat{\forwardSequence}} = {G}({\priceSequence_{\windowBackward}}, \latent), \end{equation} where $\latent$ is the latent vector sampled from a prior distribution. In practice, $\latent$ represents the unknown future events and phenomena impacting the marketplace. The known past ${\priceSequence_{\windowBackward}}$ is used to condition the probability distribution of the future ${\hat{\forwardSequence}}$ based on the most updated market situation. The generator ${G}$ is a generative network which weights are learnt to let ${\hat{\forwardSequence}}$ match the probability distribution of ${\priceSequence_{\windowForward}}$ given the past ${\priceSequence_{\windowBackward}}$ on a set of training data. The generator ${G}$ is trained in adversarial mode against a discriminator ${D}$ with the goal of minimizing the Wasserstein distance between synthetic data ${\hat{\forwardSequence}}$ and real data ${\priceSequence_{\windowForward}}$, based on historical observations. The training process has the goal to approximate the real posterior probability distribution $P({\priceSequence_{\windowForward}} | {\priceSequence_{\windowBackward}})$ with the surrogate probability distribution $P({\hat{\forwardSequence}} | {\priceSequence_{\windowBackward}})$, given the prior distribution of $\latent$. In this work we use the normal distribution for the prior $\lambda$. To implement the adversarial training process we consider a discriminator network ${D}$ to take as input the overall price matrix ${M}$, that is the concatenation of the conditioning ${\priceSequence_{\windowBackward}}$ and either the synthetic data ${\hat{\forwardSequence}}$ or the real data ${\priceSequence_{\windowForward}}$. The discriminator output is a critic value ${c}={D}({M})$. The discriminator is trained to minimize ${c}$ for the real data and maximize it for synthetic data, whereas the generator ${G}$ training goal is to minimize ${c}$ for the synthetic data. In this work we apply WGAN-GP methodology \cite{gulrajani2017}. \subsection{Deep-learning architecture} \textbf{Data normalization.} We consider the \textit{adjusted close} price ${p}$ for each financial asset. During training, given a time window of $\window=\windowBackward+\windowForward$ days, we normalize the prices ${p}$ for each asset to fit in the range $[-1, 1]$ for the initial $\windowBackward$ days. The normalization output is the daily asset price variation ${p}(t) - {p}(t-1)$ computed in this normalized scale. Whereas normalizing to the range $[-1, 1]$ enables us to expose to the neural networks values limited within a reasonable range, the normalization removes from the data information about the price-variability within the given window $\window$. Since the normalized values of ${\priceSequence_{\windowBackward}}$ always range between $[-1, 1]$, the presence of long tails in the data is normalized out. To feed into the neural network information about the observed price variability and possible presence of long-tails, during the normalization procedure we also compute an \textit{analysis value} ${a}$ for each asset: \begin{equation}\label{eq:analysisValue} {a} = \frac{{p}_{max} - {p}_{min}}{{p}_{mean}}, \end{equation} where ${p}_{max}$, ${p}_{min}$, and ${p}_{mean}$ are respectively the maximum, minimum and mean values of the price ${p}$ in ${\priceSequence_{\windowBackward}}$ for a given asset. Let's define the analysis vector ${A}$ as the vector representation of ${a}$ to consider multiple assets. Figure \ref{fig:architecture} shows the architecture of PAGAN generator and discriminator and explicitly clarify the presence of this non-traditional normalization process (\textit{Norm}). \textbf{Generator.} The generator ${G}$ takes as input the price sequence ${\priceSequence_{\windowBackward}}$ and the latent vector $\latent$ (Figure \ref{fig:genArch}). ${G}$ is composed of two consecutive parts: \textit{a)} a \textit{conditioning} network to compute an inner representation of the past price sequence ${\priceSequence_{\windowBackward}}$, and \textit{b)} a \textit{simulator} network to generate the simulation of future price trends. The \textit{conditioning} input is the most recent market trend ${\priceSequence_{\windowBackward}}$. After the normalization, we apply a set of 1D convolution and dense layers as described in details in Appendix \ref{sec:hyperparams}. The \textit{conditioning} output depends only on ${\priceSequence_{\windowBackward}}$ and is used to condition the probability distribution of the synthetic data $P\big({\hat{\forwardSequence}} ~ |~ {\priceSequence_{\windowBackward}}\big)$, Equation \ref{eq:Pgenerator}. The \textit{simulator} network takes as input the \textit{conditioning} output and the latent vector $\latent$, and generates as output a simulation of future market prices ${\hat{\forwardSequence}}$. The \textit{conditioning}, and the \textit{simulator} together implement the generator ${G}$ and are trained at once against the discriminator ${D}$ with the traditional adversarial approach. \textbf{Discriminator.} The discriminator takes as input either \textit{a)} the real data ${M}$, concatenation of ${\priceSequence_{\windowBackward}}$ and ${\priceSequence_{\windowForward}}$, or \textit{b)} the synthetic data ${\hat{\priceSequence}}$, concatenation of ${\priceSequence_{\windowBackward}}$ and ${\hat{\forwardSequence}}$. The discriminator output is computed by the network shown in Figure \ref{fig:disArch}. \textbf{Architectural parameters.} Appendix \ref{sec:hyperparams} in the supplementary material describes all parameter and other details of the generator and discriminator networks. \begin{figure}[t!] \centering \subfloat[{Generator.}]{ \label{fig:genArch} \resizebox{\sfigbigbig}{!}{\includegraphics{./Figures/generator.pdf}} } \qquad \subfloat[{Discriminator.}]{ \label{fig:disArch} \resizebox{\sfigmedium}{!}{\includegraphics{./Figures/discriminator.pdf}} } \caption{ Architectures of the PAGAN generative and discriminative models. } \label{fig:architecture} \end{figure} \subsection{Portfolio optimization} Once the training process is completed, the generator ${G}$ is able to synthesize realistic future trends ${\hat{\forwardSequence}} = {G}({\priceSequence_{\windowBackward}}, \latent)$. We use these synthetic simulations to numerically estimate the expected risks and returns for different portfolio diversification options ${x}$. We thus execute a portfolio optimization on the estimated posterior probability distribution: \begin{equation} P\big({\hat{\forwardSequence}} ~ |~ {\priceSequence_{\windowBackward}}\big), ~ ~ {\hat{\forwardSequence}}={G}({\priceSequence_{\windowBackward}}, \latent) \end{equation} given the known prior distribution of $\latent$ and the conditioning ${\priceSequence_{\windowBackward}}$. For a given conditioning ${\priceSequence_{\windowBackward}}$, let us consider a set ${S}$ of ${n}$ simulations ${\hat{\forwardSequence}}\in{S}$ sampled from $P\big({\hat{\forwardSequence}} ~ |~ {\priceSequence_{\windowBackward}}\big)$ by evaluating the generative model ${G}({\priceSequence_{\windowBackward}}, \latent)$ on different extractions of $\latent$. Let us define also the return vector function ${r}({\hat{\forwardSequence}})$ where the ${i}$th element ${r}_{{i}}$ is the return obtained by the ${i}$th asset at the end of the simulation horizon for one simulation ${\hat{\forwardSequence}}$ given by ${{r}}_{{i}}={e}_{{i}}/{s}_{{i}}-1$, where ${e}$ is the asset price at the end of the simulation ${\hat{\forwardSequence}}$, and ${s}$ is the price at the beginning of the simulation. Since the constant in the definition of ${{r}}_{{i}}$ does not impact the optimization results, in the work, we use \begin{equation} \label{eq:returnDefinition} {{r}}_{{i}}={e}_{{i}}/{s}_{{i}} \end{equation} The portfolio returns achieved with the diversification ${x}$ for a given simulation ${\hat{\forwardSequence}}$ is: \begin{equation}\label{eq:Pgenerator} {\return_{p}}({x}, {\hat{\forwardSequence}})={x}\cdot{r}({\hat{\forwardSequence}}) \end{equation} The simulations ${\hat{\forwardSequence}}\in{S}$ sampled from the probability distribution $P\big({\hat{\forwardSequence}} ~ |~ {\priceSequence_{\windowBackward}}\big)$ are used to infer the probability distribution $P\big({\return_{p}}({x}, {\hat{\forwardSequence}}) ~ |~ {\priceSequence_{\windowBackward}}, {x}\big)$. The portfolio optimization problem is defined as in the traditional Markowitz' optimization approach (Section \ref{sec:motivation}), yet it is executed on the predicted future probability distribution $P\big({\return_{p}}({x}, {\hat{\forwardSequence}}) ~ |~ {\priceSequence_{\windowBackward}}, {x}\big)$ that is non-normal and includes non-linear interactions between the different assets. For instance, the optimization goal is to identify the configurations of ${x}$ that maximize the expected returns ${\expectedReturn_{p}}=\mathbb{E}\big({\return_{p}}({x}, {\hat{\forwardSequence}}) ~ |~ {\priceSequence_{\windowBackward}}, {x}\big)$ and minimize a risk function ${\theta}({\priceSequence_{\windowBackward}}, {x})$. Both ${\theta}$ and ${\expectedReturn_{p}}$ are estimated on the base of the simulation samples ${\hat{\forwardSequence}}\in{S}$. In this framework, the risk function ${\theta}({x})$ can be any metric such as the \textit{value at risk} \cite{chen2013}, or the \textit{volatility}. Without loss of generality, we use the estimated volatility (variance) that enables us to evaluate the approach directly with respect to the traditional Markowitz's methodology. The optimization problem is thus formalized as: \begin{eqnarray} \label{eq:obj0}\max_{x} {\expectedReturn_{p}}({x} ~ | ~ {S}), \\ \label{eq:obj1}\min_{x} {\theta}({x} ~ | ~ {S}), \\ \label{eq:retDefPAGAN}{\expectedReturn_{p}}({x})=\mathbb{E}\big({\return_{p}}({x}, {\hat{\forwardSequence}}) ~ | ~ {\priceSequence_{\windowBackward}}, {x}\big), \\ \label{eq:riskDefPAGAN}{\theta}({x})={\sigma_{p}^2}({x})={\mathbb{V}ar\big({\return_{p}}({x}, {\hat{\forwardSequence}}) ~ |~ {\priceSequence_{\windowBackward}}, {x}\big)} \end{eqnarray} where Equations \ref{eq:obj0}, and \ref{eq:obj1} are the target objectives. We solve the optimization problem by means of a multi-objective genetic algorithm, the NSGA-II \cite{deb2002} to provide a trade-off between expected returns and risk. The output of the NSGA-II is a set ${X}({S})$ that depends on the simulations ${S}$. Elements ${x}\in{X}$ are Pareto-optimal diversifications trading off returns and risk. The decision of what diversification strategy ${x}\in{X}$ to use is left to the end user depending on its own goals. \subsection{Portfolios setup} We apply public available data Yahoo Finance \cite{yahooFinance} to back-testing the proposed PAGAN approach. A matrix ${M}$ representing the price trend for a window of length $\window$, i.e. 2006-05-01 to 2015-01-01, is considered train data, and 2015-01-012 to 2018-06-30 is considered as test data. The proposed PAGAN methodology learns the generative model ${G}$ from train data and applies it for optimizing portfolio for the test data. In this work, we investigate two different portfolios representing different geopolitical areas and industrial segments. To select the assets to be included in the portfolios, we mainly looked at the following three criteria. \textit{a) Data availability}: we only include assets for which data is available from at least 2006, given Yahoo Finance data source. \textit{b) Currency homogeneity}: whereas we consider different portfolios with different currencies, in a single portfolio we include assets traded in a single currency. This is is not an actual limitation, yet it facilitates our evaluation process. \textit{c) Data correctness}: we identified some erroneous data from Yahoo Finance, e.g. \textit{NaN} values or fluctuation of $10\times$ in asset price lasting a single day, etc.. Whereas these errors are rare, we systematically discard the associated assets. In the considered portfolios we include a set of lower-risk securities (e.g. the overall market index). This is a common approach in portfolio optimization and it enables us a wide range of options to trade off between low-risk securities and high-returns ones. The considered portfolios are detailed in Table \ref{tab:portfolios} and summarized as follows: \begin{itemize} \item \textit{US general market} (\textit{usgen}): a set of US firms from different market segments, such as IT (GOOG, MSFT), healthcare (CELG, PFE), energy (HES, XOM), and consumer staples (KR, WBA). We also include three ETFs tracking the overall US markets (SHY, IYR, IYY). \item \textit{EU automotive} (\textit{eucar}): four of the most well known European automotive companies (BMW.DE, FCA.MI, UG.PA, VOW3.DE). We balance these shares with two EU indices tracking the German and French stock markets (~$\hat{ }$~FCHI, ~$\hat{ }$~GDAXI). \end{itemize} \begin{table}[t!] \centering \scriptsize \caption{List of assets in the portfolios \textit{usht}, and \textit{eucar}.} \setlength\tabcolsep{0.15cm} \begin{tabular}{|c|| c|c|c|c|c| } \hline & \textbf{Ticker} & \textbf{Type} & \textbf{Industry} & \textbf{Description} & \textbf{Cur.} \\ \hline \hline \multirow{11}{*}{\textit{usgen}} & GOOG & Share & IT & Alphabet & USD \\ & MSFT & Share & IT & Microsoft & USD \\ \cline{2-6} & \textit{CELG} & Share & Healthcare & Celgene & USD \\ & PFE & Share & Healthcare & Pfizer & USD \\ \cline{2-6} & HES & Share & Energy & Hess & USD \\ & XOM & Share & Energy & Exxon Mobil & USD \\ \cline{2-6} & KR & Share & Consumer staples & The Kroger & USD \\ & WBA & Share & Consumer staples & Walgreens Boots Alliance & USD \\ \cline{2-6} & IYY & ETF & Dow Jones & iShares Dow Jones & USD \\ & IYR & ETF & Real estate & iShares US Real Estate & USD \\ & SHY & ETF & US treasury bond & iShares Treasury Bond & USD \\ \hline \hline \multirow{6}{*}{\textit{eucar}} & BMW.DE & Share & Automotive & BMW & EUR \\ & FCA.MI & Share & Automotive & Fiat Chrysler Automobiles & EUR \\ & UG.PA & Share & Automotive & Peugeot & EUR \\ & VOW3.DE & Share & Automotive & Volkswagen & EUR \\ \cline{2-6} & $\hat{ }$~FCHI & Index & French market & CAC 40 & EUR \\ & $\hat{ }$~GDAXI & Index & German market & DAX & EUR \\ \hline \end{tabular} \label{tab:portfolios} \end{table} \begin{figure*}[t!] \centering \resizebox{\sfigwhole}{!}{\includegraphics{./results/simulations_example.pdf}} \caption{{Actual price trend (solid line) for the \textit{eucar} portfolio between 2017-02 and 2017-04, and five representative simulations generated by PAGAN (dashed lines). Observe that simulations are correlated along the different assets, e.g. \textit{Sim\_4} represent the possibility of a general loss in the considered markets. }} \label{fig:resSimulations} \end{figure*} \subsection{Benchmarks} \textbf{Markowitz.} We benchmark the proposed PAGAN approach with respect to the Markowitz' modern portfolio optimization \cite{markowitz}. Since the genetic algorithm in PAGAN returns a discrete set of optimal diversifications ${x}\in{X}$ whereas the Markowitz methodology solves the optimization problem in a continuous form, to apply a simple and fair comparison we define a set of discrete risk levels ${\zeta}\in\{1, .., {Z}\}$, with ${Z}$ an arbitrary Integer. In this work, ${Z}=25$. We define the target return ${\hat{\return}}({\zeta})$ for the risk level ${\zeta}$ as follows. The lowest risk level has a return goal of ${\hat{\return}}(1)=1$. Given Equation \ref{eq:returnDefinition}, this goal defensively aims not to lose. We set an relatively large value for the maximum return level ${\hat{\return}}({Z})$. In this work we use ${\hat{\return}}(Z)=2{r}_{max} -1$, where ${r}_{max}$ is the maximum returns observed for any asset in the portfolio along the training period. The factor 2 enables us to search for higher returns than those observed during training if these are considered possible by the generator ${G}$. The constant $-1$ is introduced to compensate the fact that ${r}=1$ is a non-loosing nor-winning policy (Equation \ref{eq:returnDefinition}). Target returns for other risk levels ${\hat{\return}}({\zeta})$ are uniformly spread: \begin{equation}\label{eq:riskDefinition} {\hat{\return}}({\zeta})={\hat{\return}}(1) + ({\zeta}-1) \times \frac{{\hat{\return}}({Z}) - {\hat{\return}}(1)}{{Z}-1} \end{equation} Once the efficient solutions ${X}$ are found by the genetic algorithm, we select an optimal diversification ${x}_{{\zeta}}$ for each risk level ${\zeta}$ as: \begin{equation} {x}_{{\zeta}} = \argmin{{x}\in{X}}|{\hat{\return}}({Z}) - {r}({x})| \end{equation} \textbf{Default.} Given the continuously changing market situations, Assumption \ref{as:mark} used by the Markowitz methodology hardly applies in general. Yet, there are limited other well-established approaches to predict the probability distribution of future market returns, that makes the Markowitz's approach a widely-used and well-accepted method. The proposed PAGAN methodology is explicitly meant to cope with this lack of sound alternative methodologies. Though, in the recent years, markets have performed very differently from the past because of ending of QE, geopolitical situations, trade wars, and scandals such as the Volkswagen emission scandal in September 2015. The return probability distribution differs significantly between the \textit{train} and \textit{test} periods. For this reason we include as second benchmark (\textit{default}) a simple random optimization to verify how well one could perform by investing in randomly-selected assets. Every day we sample ${Z}$ diversifications ${x}$ at random. We assign a risk level ${\zeta}$ to each of these diversification by sorting and enumerating them accordingly to their expected returns as defined in Equation \ref{eq:retDef}. \begin{figure*}[t!] \centering \subfloat[{\textit{usgen}, 5-days horizon.}]{ \resizebox{\sfigbig}{!}{\includegraphics{./results/tradeoff-us-5.pdf}} } \subfloat[{\textit{usgen}, 10-days horizon.}]{ \resizebox{\sfigbig}{!}{\includegraphics{./results/tradeoff-us-10.pdf}} } \subfloat[{\textit{usgen}, 20-days horizon.}]{ \label{fig:resultUS} \resizebox{\sfigbig}{!}{\includegraphics{./results/tradeoff-us-20.pdf}} } \qquad \subfloat[{\textit{eucar}, 5-days horizon.}]{ \resizebox{\sfigbig}{!}{\includegraphics{./results/tradeoff-eu-5.pdf}} } \subfloat[{\textit{eucar}, 10-days horizon.}]{ \resizebox{\sfigbig}{!}{\includegraphics{./results/tradeoff-eu-10.pdf}} } \subfloat[{\textit{eucar}, 20-days horizon.}]{ \label{fig:resultEU} \resizebox{\sfigbig}{!}{\includegraphics{./results/tradeoff-eu-20.pdf}} } \caption{ Returns-risk measured on the \textit{test} period by varying the risk levels (different points). The increasing-risk -- decreasing-returns behavior for \textit{Markowitz} happens because the returns probability distribution changes from the train to the test period thus models learnt on the train period may suggest to buy high-risk assets that loose value along the test period. PAGAN mitigates this issue by forecasting the future probability distribution $P({\priceSequence_{\windowForward}} | {\priceSequence_{\windowBackward}})$ based on ${\priceSequence_{\windowBackward}}$. } \label{fig:result} \end{figure*} \begin{figure*}[t!] \centering \subfloat[{PAGAN \textit{usgen}.}]{ \label{fig:diversificationPAGANUS} \resizebox{\sfigsmall}{!}{\includegraphics{./results/diversification-us-20.pdf}} } \subfloat[{Markowitz \textit{usgen}.}]{ \label{fig:diversificationMUS} \resizebox{\sfigsmall}{!}{\includegraphics{./results/markowitz-diversification-us-20.pdf}} } \subfloat[{PAGAN \textit{eucar}.}]{ \label{fig:diversificationPAGANEU} \resizebox{\sfigsmall}{!}{\includegraphics{./results/diversification-eu-20.pdf}} } \subfloat[{Markowitz \textit{eucar}.}]{ \label{fig:diversificationMEU} \resizebox{\sfigsmall}{!}{\includegraphics{./results/markowitz-diversification-eu-20.pdf}} } \caption{ Diversification results for the considered portfolios by varying the target risk level ${\zeta}$ (x axis). These results are averaged along the whole test period. The portfolios from PAGAN are more diversified than those from Markowitz. PAGAN is able to systematically improve the returns achievable at a given risk. } \label{fig:diversification} \end{figure*} \begin{figure}[t!] \centering \subfloat[{PAGAN \textit{eucar}, September 2015.}]{ \label{fig:diversificationPAGANEUsep} \resizebox{\sfigsmall}{!}{\includegraphics{./results/diversification-eu-sep.pdf}} } \subfloat[{PAGAN \textit{eucar}, October 2015.}]{ \label{fig:diversificationPAGANEUoct} \resizebox{\sfigsmall}{!}{\includegraphics{./results/diversification-eu-oct.pdf}} } \caption{ PAGAN diversification results before (September) and after (October) the Volkswagen emission scandal. } \label{fig:diversificationPAGANex} \end{figure} \subsection{Diversification results} The output of the generative model are financial market simulations, such as the ones in Figure \ref{fig:resSimulations}. Each simulation is carried out for all assets at once and represents a possible behavior of the marketplace. The goal is to draw possible scenarios and to understand how the price of different assets are interacting, i.e. what may happen to one asset when another situation is presenting for another one. PAGAN aims to capture non-linear dependencies between different trends and samples simulations from the resulting multidimensional probability distribution. For example, \textit{Sim\_4} in Figure \ref{fig:resSimulations} (thick dashed line) shows a possible situation where both market indices (~$\hat{ }$~GDAXI, ~$\hat{ }$~FCHI) have a sudden loss in the first half of April, followed by a quick re-bounce. At the same time, UG.PA and FCA.MI accumulate significant losses by the end of the simulation (around the end of April). In this case (\textit{Sim\_4}) the best would have been to buy VOW3.DE. Yet, each simulation is just one possible realization of the probability distribution learnt by PAGAN. The goal of PAGAN is to enable us to investigate automatically several different simulations in order to organize a portfolio diversification strategy. The solutions of the optimization problem defined in Equations \ref{eq:obj0}--\ref{eq:riskDefPAGAN} generate a trade-off for the expected risk-return objective space given the probability distribution modeled by a PAGAN-generated simulation set ${S}$. In this work, we set the number of simulations in ${S}$ to 250. We evaluate how good the proposed approach is in diversifying the portfolio aiming at different time horizons $\windowForward$. In particular we address horizons of one week (5 days), two weeks (10 days), and 1 month (20 days). Figure \ref{fig:result} shows the return-risk trade off achieved during the test period by PAGAN and the reference benchmarks (Markowitz, default). Since the market situation during the test period (starting in 2015-01) significantly diverges from the training period (ending in 2014-12), the returns for Markowitz significantly decrease when aiming at high-risk solution. This happens because Markowitz assumes that the future mean returns for a given asset equal the past ones (Assumption \ref{as:mark}). This approach let Markowitz buy risky assets that were profitable along the train period and are losing in the test period. PAGAN does not assume the future probability distribution to be equal to the past one because it learns to forecast the probability distribution given the most recent market situation. This significantly improves PAGAN results that are able to generally provide higher returns when accepting a higher risk. Note that, given the very different market situation of the last few years, the default approach of randomly buying assets provides not too bad solutions. Yet default is not capable of systematically trading off risk for returns leading to an unstructured cloud of solutions in the risk-return objective space. Default solutions are all drawn purely at random and their final results do not differentiate much from one another. Figure \ref{fig:diversification} shows the diversifications proposed by PAGAN and Markowitz approaches for different risk levels given a one-month horizon $\windowForward=20$. These diversifications are averaged along the whole test period. PAGAN presents a smoother behavior. In fact, given the short-term conditioning window ${\priceSequence_{\windowBackward}}$, PAGAN models the future probability distribution $P({\hat{\forwardSequence}} | {\priceSequence_{\windowBackward}})$ enabling it to quickly adapt its diversifications to continuously and quickly changing market conditions. As example, Figures \ref{fig:diversificationPAGANEUsep} and \ref{fig:diversificationPAGANEUoct} show PAGAN diversifications averaged along September and October 2015. At the end of September 2015, the Volkswagen emission scandal perturbs the European automotive market. PAGAN already in September (Figure \ref{fig:diversificationPAGANEUsep}) allocates significantly fewer capital to VOW3.DE than the overall average allocated along the whole test period (Figure \ref{fig:diversificationPAGANEU}). In October, after the shock brought by the scandal to the automotive industries, PAGAN shows a defensive strategy by allocating always more than 50\% of the overall capital to low volatility indices (~$\hat{ }$~FCHI, ~$\hat{ }$~GDAXI) to avoid loosing capital on higher risk assets. \begin{figure*}[t!] \centering \subfloat[{\textit{usgen}.}]{ \label{fig:portfolioSimulationUS} \resizebox{\sfigwhole}{!}{\includegraphics{./results/us_sim.pdf}} } \qquad \subfloat[{\textit{eucar}.}]{ \label{fig:portfolioSimulationEU} \resizebox{\sfigwhole}{!}{\includegraphics{./results/eu_sim.pdf}} } \caption{ Portfolio values for different diversification risk settings (subplots). Reference benchmarks are shown with dashed lines, PAGAN and Markowitz approaches with solid lines. Note that in the defensive setting, the goal is not to maximize the portfolio returns but rather to reduce the risk (standard derivation of returns). } \label{fig:portfolioSimulation} \end{figure*} \begin{figure}[t!] \centering \subfloat[{\textit{usgen}.}]{ \label{fig:portfolioAnalysisUS} \resizebox{\sfigbigbig}{!}{\includegraphics{./results/us_analysis.pdf}} } \qquad \subfloat[{\textit{eucar}.}]{ \label{fig:portfolioAnalysisEU} \resizebox{\sfigbigbig}{!}{\includegraphics{./results/eu_analysis.pdf}} } \caption{ PAGAN surpasses the reference approach on financial-performance. } \label{fig:portfolioAnalysis} \end{figure} \subsection{Realized performance} Let us analyse the financial performance of the considered optimization strategies by tracking the value of the corresponding portfolios along the test period. We consider three settings for both Markowitz and PAGAN approaches. A \textit{defensive} setting with risk level ${\zeta}=5$, a \textit{balanced} setting with ${\zeta}=13$, and an \textit{aggressive} setting with ${\zeta}=21$. Over the considered ${Z}=25$ risk levels, these settings account respectively for the 20\%, 50\%, and 80\% of the risk. Since the performance for the default approach do not vary much by changing the risk level (Figure \ref{fig:result}), we only consider the \textit{balanced} version of the default approach. We also include in the analysis portfolio-specific benchmarks such as \textit{a)} the Dow Jones Industrial Average ETF tracker (\textit{IYY}), and the US Treasury Bond ETF tracker (\textit{SHY}) for \textit{usgen}, and \textit{b)} the German and French market indices (~$\hat{ }$~{GDAXI}, ~$\hat{ }$~{FCHI}) for \textit{eucar}. We initialize each portfolio with an unitary value. We consider an optimization horizon of 20 days to decide our diversification strategy, yet we allow trading every day to keep the diversification to the suggested level. In fact, a sudden variation of price for an asset changes the ratio of capital invested in this asset with respect to the others if the number of shares is not adjusted accordingly. Figure \ref{fig:portfolioSimulation} shows the simulation results along the test period. PAGAN dominates the other approaches in terms of final portfolio value for the aggressive and balanced settings. In the defensive setting, the goal is not to maximize the portfolio returns but rather to reduce the risk that is the portfolio volatility (standard deviation of returns). Figure \ref{fig:portfolioAnalysis} depicts the financial performance of PAGAN and Markowitz approaches including the different settings: aggressive (\textit{A}), balanced (\textit{B}), and defensive (\textit{D}). PAGAN-A and PAGAN-B clearly dominate in terms of monthly returns. This comes however at the cost of a higher risk (volatility). For a fairer comparison of the two approaches, we examine the annualized sharpe ratio $\rho$ defined as $\rho=({r}-{\overline{\return}})/\sigma$, where ${r}$ is the average annual return, ${\overline{\return}}$ is the risk-free return\footnote{We consider as risk-free return a situation with no earning nor losses.}, and $\sigma$ is the volatility (standard deviation of annual returns). In terms of Sharpe ratio (the higher, the better), PAGAN surpasses the reference approach for all settings (A, B, D) for \textit{usgen} and for the A and B settings for \textit{eucar}. \begin{figure}[t!] \centering \resizebox{\sfigbigbig}{!}{\includegraphics{./results/coverage_per_level.pdf}} \caption{{Repeatability: PAGAN (PAGAN2M) systematically surpasses Markowitz (M2PAGAN) for the \textit{usgen} portfolio. On the \textit{eucar} portfolio, \textit{PAGAN2M} and \textit{M2PAGAN} achieve comparable performance. }} \label{fig:repeatability} \end{figure} \subsection{Repeatability considerations} GANs are known to be unstable, adversarial training often does not converge towards an equilibrium because of the non-linear dynamics introduced by the differential equations implementing the learning algorithm \cite{mescheder2018}. This let the PAGAN model change during training. Furthermore, PAGAN results depend on the randomness introduced by the weight initialization. To analyze the repeatability of the presented results we train several PAGAN models and compare them with Markowitz. This reference approach is deterministic and, given the training data, it always produces the same results. We proceed as follows. Given a trained PAGAN model, we analyze the return--risk of PAGAN diversifications along the test period and we compare their results with the diversifications suggested by Markowitz. Let $\sigma^{M}_{{\zeta}}$ and $\sigma^{P}_{{\zeta}}$ be the volatility observed for Markowitz and PAGAN diversifications at risk level ${\zeta}$, and let ${r}^{M}_{{\zeta}}$ and ${r}^{P}_{{\zeta}}$ be the related returns. We consider that PAGAN dominates Markowitz at risk level ${\zeta}$ if PAGAN results are better for at least one of the two metrics and not worse for the other: $\big(\sigma^{P}_{{\zeta}}\leq\sigma^{M}_{{\zeta}} \bigwedge {r}^{P}_{{\zeta}}>{r}^{M}_{{\zeta}}\big) \bigvee \big(\sigma^{P}_{{\zeta}}<\sigma^{M}_{{\zeta}} \bigwedge {r}^{P}_{{\zeta}}\geq{r}^{M}_{{\zeta}}\big)$. For every trained PAGAN model, we compute the percentage of risk levels ${\zeta}$ for which PAGAN dominates Markowitz (\textit{PAGAN2M}), and the opposite (\textit{M2PAGAN}). Figure \ref{fig:repeatability} shows the distribution of these metrics in box-plot for the two portfolios when considering different optimization horizons. In general, \textit{PAGAN2M} increases for higher horizon demonstrating the difficulties of Markowitz in modeling long-term situations and the advantage of using the proposed PAGAN model. PAGAN systematically surpasses Markowitz for the \textit{usgen} portfolio with values of \textit{PAGAN2M} much higher than \textit{M2PAGAN}. On the \textit{eucar} portfolio, \textit{PAGAN2M} and \textit{M2PAGAN} are partially overlapping. For \textit{eucar}, Markowitz achieves sometimes performance comparable to PAGAN. Yet, when aiming at an horizon of 20 days, PAGAN in average outperforms Markowitz. For a fair comparison, all results presented in this paper along the previous sections are gathered starting from the PAGAN model that achieved the median result for the \textit{PAGAN2M} metric for an horizon of 20 days. Additional results can be found in Appendix \ref{sec:addRes}. \section{Introduction} \input{introduction.tex} \section{The Markowitz's Framework} \label{sec:motivation} \input{motivation.tex} \section{Related Work} \input{related_work.tex} \section{Proposed methodology} \input{algorithm.tex} \section{Experimental results} \label{sec:res} \input{experiment.tex} \section{Conclusion} \input{conclusion.tex} \bibliographystyle{unsrt} \subsection{Portfolio Management} To address the limitation of MPT, a main breakthrough is the introduction of conditional volatility models that allow returns' volatility to vary through time \cite{Bollerslev1988}. These sophisticated statistical models assumes that relationships shift will eventually return to normal, and therefore tend to fail when the shifts in returns or correlations are more permanent \cite{Rapach2008}. Recently, the application of machine learning to finance has drawn interests from both investors and researchers. However, the current work has been focused on adapting reinforcement learning (RL) frameworks to trading strategy \cite{Deng2017, Jiang2017, Almahdi2017}. To be specific, the market action of the RL agent defines portfolio weights. An asset with an increased target weight will be bought in with additional amount, and that with decreased weight will be sold. These works focus on intra-day decision, while we tackle the challenge of medium-long term portfolio diversification. In addition, all these RL algorithms assume a single agent and ideal trading environment, i.e., each trade is carried out immediately and has no influence on the market. In fact, the trading environment is essentially a multiplayer game with thousands of agents acting simultaneously and impact the market in a complicated way. Considering the complexity of financial market, combining machine learning with portfolio management remains relatively unexplored. \subsection{GANs on Time Series} Recently generative adversarial networks (GAN) has become an active research area in learning generative models. GAN is introduced by Goodfellow et al. \cite{Goodfellow2014}, where images patches are generated from random noise using two networks training simultaneously. The discriminative net $D$ learns to distinguish whether a given data instance is real or not, and a generative net $G$ learns to confuse $D$ by generating high quality data. Powered by the learning capabilities of deep neural networks, GANs have gained remarkable success in computer vision and natural language processing. \hide{\cite{Saatci2017}} However, to date there has been limited work in adopting the GAN framework for continuous time series data. One of the preliminary works in the literature produces polyphonic music with recurrent neural networks as both generator and discriminator \cite{Mogren2016}, and the other one uses conditional version of recurrent GAN to generate real-valued medical time series \cite{Hyland2017}. In these methods, the multiple sequences are treated as i.i.d. and fed to a uniform GAN framework. Stock price is largely driven by the fundamental performance of an individual company and the dynamic interactions of different stocks are embedded in their prices. Thus the i.i.d. assumption of multiple sequences is too restricted for portfolio analysis. Li et al. \cite{Li2018} adopt Long Short Term-Recurrent Neural Networks (LSTM-RNN) in both the generator and discriminator of GAN to capture the temporal dependency of time series. Zhou et al. \cite{Zhou2018} apply the superposition of an adversarial loss and a prediction loss to improve a traditional LSTM-based forecast network. Yet, in Zhou there is no actual generative model in the sense that, once trained, the prediction model of Zhou returns a single deterministic forecast given an input price sequence whereas in the proposed PAGAN model we provide the capability of simulating possible future situations by sampling future prices from a posteriori probability distribution learnt with the adversarial training process. \subsection{Stock Market Forecast} Stock market forecast is one of the most challenging issues among time series forecasting \cite{Tsay2010} due to chaotic dynamics of the markets. Traditionally, statistical methods, such as autoregressive model, moving average model, and their combinations, are widely used. However, these methods rely on restricted assumptions with respect to the noise terms and loss functions. During the past decades, machine learning models, such as artificial neural networks \cite{Kara2011, Ghiassi2013} and support vector regression \cite{WeiHuang2005, Sheta2015} have been applied to predict future stock prices and price movement direction. More recently, a deep convolutional neural network is applied to predict the influence of events on stock movements \cite{Ding2015}. Kuremoto et al. \cite{Kuremoto2014} present a deep belief network with restricted Boltzmann machines and Bao et al. \cite{Bao2017} investigate autoencoders and LSTM for short-term stock price forecast. However, with the continuous advancement of the financial transactions and the information systems, financial market becomes increasingly efficient. This leads to increased market uncertainty and challenge of forecasting market price. Instead of predicting market trend, we for the first time learn modeling the uncertainty of the marketplace in its sophisticated multidimensional form for portfolio management.
\section{Introduction} While the Standard Model is successful at describing physical phenomena at the highest energies measured, it is expected to break down when gravitational effects are no longer negligible. Since many models of quantum gravity are nonlocal, one might expect Lorentz invariance to be violated at a high energy scale. While it is expected that this high energy scale would be the Planck scale, requiring very high precision studies, larger effects are possible, and the question of Lorentz violation is one that should be probed experimentally. In general, it is difficult to write the most general Lorentz violating theory. Even the meaning of a Lagrangian becomes uncertain in such a theory. An extremely useful approach was developed years ago by Colladay and Kosteleck\'y \cite{Colladay:1996iz,Colladay:1998fq,Kostelecky:2002hh,Kostelecky:2003fs}, who constructed the Standard Model Extension (SME). This model is based on the Standard Model, but adds Lorentz violating terms which satisfy the Standard Model gauge symmetry and have dimension less than or equal to four. The extra terms also are invariant under observer Lorentz transformations, i.e.\ all Lorentz indices must be contracted and the physics does not depend on the choice of coordinates. The Lorentz violation is also independent of position and time, so that energy and momentum are conserved. The model contains a large number of parameters that can be experimentally constrained, and there are many hundreds of papers studying constraints on these parameters (an extensive list, updated to 2016, can be found in Ref.\ \cite{Kostelecky:2008ts}). The vast majority of these studies have involved long-lived particles, and only a few have involved, for example, heavy scalar and vector bosons \cite{Altschul:2006uw,Anderson:2004qi,Iltan:2003we,Iltan:2003nq,Iltan:2004qp,Aranda:2013cva,Aranda:2013vda,Noordmans:2013xga,Noordmans:2014hxa,Dijck:2013dza,Vos:2015fqi}. Most of these involve fermions, studying, for example, beta-decays. Recently, Fu and Lehnert \cite{Fu:2016fmf} considered bounds on parameters that only involve gauge bosons. They studied bounds involving internal $Z$ boson lines in electron-electron scattering experiments searching for parity violation, and found that bounds from the E158 experiment at SLAC improved previous bounds by two orders of magnitude. The parameters they considered arise from the Lorentz violating terms in the SME \begin{equation} \mathcal{L} = -\frac{1}{4}(k_B)_{\kappa\lambda\mu\nu} B^{\kappa\lambda}B^{\mu\nu} -\frac{1}{2}(k_W)_{\kappa\lambda\mu\nu}\tr (W^{\kappa\lambda}W^{\mu\nu})\,. \end{equation} The coefficients $k_B$ and $k_W$ are real and dimensionless. They have the symmetries of the Riemann tensor and a vanishing double trace, so there are 19 coefficients each. These are CPT even; we will not discuss CPT odd terms since they are associated with negative energy contributions. Fu and Lehnert also discuss the fact that a relevant term in the Higgs kinetic energy SME Lagrangian will not have an effect on the results, and we will ignore that here. Writing the above Lagrangian term in terms of the photon and $Z$ gives \begin{equation} \begin{aligned} \mathcal{L} = &-\frac{1}{4}(k_B\cos^2\theta_W + k_W\sin^2\theta_W)_{\kappa\lambda\mu\nu}F^{\kappa\lambda}F^{\mu\nu} \\ & - \frac{1}{4}(k_W\cos^2\theta_W + k_B\sin^2\theta_W)_{\kappa\lambda\mu\nu}Z^{\kappa\lambda}Z^{\mu\nu} \\ & - \frac{1}{4}\sin 2\theta_W (k_W - k_B)_{\kappa\lambda\mu\nu}F^{\kappa\lambda}Z^{\mu\nu} \end{aligned} \label{lagr} \end{equation} Here, $F^{\mu\nu} = \partial^\mu A^\nu - \partial^\nu A^\mu, Z^{\mu\nu} = \partial^\mu Z^\nu - \partial^\nu Z^\mu$. The first term in this expression deals with Lorentz violation in the QED sector. This is very strongly constrained by many experiments and is completely negligible, so one can set $k_B = -\tan^2\theta_W k_W$. The resulting Feynman rules are given in Figure \ref{ins}. It is the $k_W$ coefficients that Fu and Lehnert bound from considerations of parity violation in electron-electron scattering. \begin{figure}[h] \centering \subfigure[{\label{pzg}}] { \(\vcenter{\hbox{\incfigwid{pzg}{.25}}} = -2i\tan\theta_W (k_W)_{\kappa\lambda\mu\nu} q^\kappa q^\mu\) } \subfigure[{\label{pzz}}]{\(\vcenter{\hbox{\incfigwid{pzz}{.25}}} = -2i(1-\tan^2\theta_W) (k_W)_{\kappa\lambda\mu\nu} q^\kappa q^\mu\)} \caption{\label{ins} Propagator insertions afforded by Eq.~\ref{lagr}.} \end{figure} In this paper, we extend the work of Fu and Lehnert to include parity violation in electron-proton scattering. This has been measured precisely at Qweak, and will also be measured at the Electron-Ion Collider (EIC)\cite{Accardi:2012qut,Aschenauer:2014cki,Abeyratne:2015pma}, Large Hadron-electron Collider (LHeC)\cite{AbelleiraFernandez:2012cc} and eventually at the Future Circular Collider (FCC-eh)\cite{Abada:2019lih}. There have been studies of effects of Lorentz violation in deep inelastic scattering\cite{Kostelecky:2016pyx, Lunghi:2018uwj,Kostelecky:2018yfa}, but these all consider the quark sector coefficients on the scattering. We considered the pure gauge sector coefficients. The model and calculations are presented in Section 2 and the results are discussed (for each proposed future experiment) in Section 3, as are our conclusions. \section{Electron-proton Scattering} In parity violation in elastic $e p$ scattering, such as at Qweak, the Lorentz violating effects are proportional to $Q^2/M_Z^2$, which is very small. This suppression makes it impossible to strengthen existing bounds on $k_W$. We instead consider inelastic $e^-p\to e^-X$ scattering. Only energies high enough for the parton model to hold are considered. The $e^-p\to e^-X$ cross section in terms of the $e^-q_i\to e^-q_i$ quark subprocess cross section is \begin{equation} \qty(\frac{\dd[2]{\sigma}}{\dd{E'}\dd{\Omega}})_{ep\to eX} = \sum_{i}\int_0^1\,\dd{x}f_i(x)\qty(\frac{\dd[2]{\sigma}}{\dd{E'} \dd{\Omega}})_{eq_i\to eq_i}\,. \label{parton} \end{equation} The functions $f_i(x)$ are the usual parton distribution functions (PDFs) and the sum over $i$ ranges over all quark flavors. The diagrams contributing to the quark subprocess are in Figure \ref{eqeq}. \begin{figure}[H] \centering \subfigure[{\label{qmg} $i\mathcal{M}_\gamma$}]{\incfigwid{qmg}{.43}} \hfill \subfigure[{\label{qmz} $i\mathcal{M}_Z$}]{\incfigwid{qmz}{.43}} \hfill \subfigure[{\label{qmgz} $i\mathcal{M}_{\gamma Z}$}]{\incfigwid{qmgz}{.43}} \hfill \subfigure[{\label{qmzg} $i\mathcal{M}_{Z \gamma}$}]{\incfigwid{qmzg}{.43}} \hfill \subfigure[{\label{qmzz} $i\mathcal{M}_{ZZ}$}]{\incfigwid{qmzz}{.43}} \hfill \caption{\label{eqeq} Diagrams contributing to the process $e^-q_i\to e^-q_i$.} \end{figure} We denote by $\abs{\mathcal{M}_{i,h}}^2$ the squared sum of the diagrams in Figure \ref{eqeq}, where $h=L,R$ is the helicity of the incoming electron and $i$ is the quark flavor. This matrix element can be written \[\abs{\mathcal{M}_{i,h}}^2 = \abs{\mathcal{M}_{i,h}}_0^2 + \delta\abs{\mathcal{M}_{i,h}}^2\,,\] where $\abs{\mathcal{M}_{i,h}}_0^2$ contains the usual standard model contribution and $\delta\abs{\mathcal{M}_{i,h}}^2$ is the Lorentz violating correction. The explicit form of $\delta\abs{\mathcal{M}_{i,h}}^2$ is rather long, so we have placed it in Appendix A. The primary observable is the asymmetry \begin{equation} \mathcal{A} \equiv \frac{d\sigma_L(ep\to eX)-d\sigma_R(ep\to eX)}{d\sigma_L(ep\to eX)+d\sigma_R(ep\to eX)}\,. \end{equation} Expanded to leading order in $k_W$ in the lab frame, the asymmetry is of the form $\mathcal{A} = \mathcal{A}_0 + \delta\mathcal{A}$ where $\mathcal{A}_0$ is the Standard Model result and $\delta\mathcal{A}$ is the Lorentz violating correction proportional to $k_W$. In order to cast $\delta\mathcal{A}$ into a form suitable for numerical analysis, we employ a parameterization of $k_W$ due to Fu and Lehnert \cite{Fu:2016fmf} in terms of a dimensionless vector $\vec{\xi}=(\xi_x,\xi_y,\xi_z)$. This is a substantial simplification of the analytical calculation, which reduces the 19-dimensional parameter space to a 3-dimensional parameter space. It seems reasonable, since time and space coordinates do not mix, but there is no general argument as to why these three parameters should dominate the effects. Fu and Lehnert then define $\xi^\mu \equiv (0,\vec{\xi})^\mu$ and $\zeta^\mu \equiv (1,\vec{0})^\mu$ we can write { \newcommand{\comu}[2]{\xi^{\{#1}\zeta^{#2\}}} \begin{equation} \begin{gathered} (k_W)^{\kappa\lambda\mu\nu} = \frac{1}{2}\left[g^{\kappa\mu}\comu{\lambda}{\nu} - g^{\kappa\nu}\comu{\lambda}{\mu} + g^{\lambda\nu}\comu{\kappa}{\mu} - g^{\lambda\mu}\comu{\kappa}{\nu}\right]\label{comu}\,,\\ \qq{where}\xi^{\{\mu}\zeta^{\nu\}} \equiv \frac{1}{2} \left(\xi^\mu\zeta^\nu + \xi^\nu\zeta^\mu\right) \end{gathered} \end{equation} }% This parameterization reduces our problem to the bounding of $\vec{\xi}$, which now expresses the entirety of the Lorentz violation effect. One needs to consider the coordinate system in order to define $k_W$ (and hence $\vec{\xi}$). The canonical choice is sun-centered celestial equatorial coordinates \cite{Kostelecky:2002hh}. Consequently, the calculation of $\delta\mathcal{A}$ will require all momenta to be expressed in this frame. To change to these coordinates from those usually employed in scattering calculations\footnote{E.g.\ coordinates chosen so that the plane of interaction is spanned by $\vb{\hat{z}}$ and either of $\vb{\hat{x}},\vb{\hat{y}}$.} one must first transform to the coordinate system with $\vb{\hat{x}}$ pointing south, $\vb{\hat{y}}$ pointing east, and $\vb{\hat{z}}$ normal to the Earth's surface. Changing to this reference frame will involve rotations that depend on the azimuthal scattering angle $\phi$ and the angle $\beta$ of the electron beam east of south. The rotation \begin{equation} \begin{pmatrix} \cos\chi\cos\Omega_{\oplus} t & -\sin\Omega_{\oplus} t & \sin\chi\cos\Omega_{\oplus} t \\ \cos\chi\sin\Omega_{\oplus} t & \cos\Omega_{\oplus} t & \sin\chi\sin\Omega_{\oplus} t \\ -\sin\chi & 0 & \cos\chi \end{pmatrix} \label{dayrotation} \end{equation} then transforms to the sun-centered celestial equatorial coordinate system \cite{Kostelecky:2002hh}. Here, $\Omega_{\oplus}=2\pi/(23\text{ h }56\text{ min})$ and $\chi$ is the colatitude of the lab. This last rotation need not include a boost, since the Earth's motion is completely nonrelativistic. Notice that the only 3-vectors appearing in the problem are the incoming (outgoing) electron momenta $\vec{k}$ ($\vec{k'}$) and the parton momentum $\vec{p}$. Then since $\delta\mathcal{A}$ is a scalar quantity proportional to $k_W$, it must be a linear combination of the dot products $\vec{\hat{k}}\cdot\vec{\xi}$, $\vec{\hat{k'}}\cdot\vec{\xi}$, and $\vec{\hat{p}}\cdot\vec{\xi}$. It is then straightforward to show that \begin{equation} \begin{aligned} \vec{\hat{p}}\cdot\vec{\xi}&=-\vec{\hat{k}}\cdot\vec{\xi} \\ \vec{\hat{k}}\cdot\vec{\xi} &= f_1\cos(\Omega_{\oplus} t - \delta_1)\sqrt{\xi_x^2 + \xi_y^2}\qq{+} \text{constant} \\ \vec{\hat{k}'}\cdot\vec{\xi} &= \big(f_2\cos(\Omega_{\oplus} t - \delta_2) + f_3\cos\Omega_{\oplus} t\big)\sqrt{\xi_x^2 + \xi_y^2}\qq{+}\text{constant} \\ \end{aligned} \label{dots} \end{equation} The parameters used in the above expressions are given in Table 1. The overall additive constants we have chosen to omit above are time independent and therefore not easily disentangled from Standard Model effects. Fu and Lehnert also find a dependence on $\sqrt{\xi^2_x+\xi^2_y}$. The $\xi_z$ piece is not sensitive to the time dependence since the $z$-direction is perpendicular to the Earth's surface, and the azimuthal dependence vanishes, as they show, in the ultrarelativistic limit. \begin{table} \centering { \renewcommand{\hline}{} $\begin{array}{||c | c ||} \gamma & \arctan(\tan\theta\sin\phi) \\ \delta_1 & -\arctan({\tan\beta}/{\cos\chi}) \\ \delta_2 & -\arctan({\tan(\beta-\gamma)}/{\cos\chi}) \\ f_1 & \sqrt{1-\sin^2\beta\cos^2\chi} \\ f_2 & \sqrt{1-\sin^2\theta\cos^2\phi}\sqrt{1-\sin^2(\beta-\gamma)\cos^2\chi} \\ f_3 & \abs{\sin\theta\cos\phi\sin\chi} \\ \end{array}$ } \caption{\label{params} Explicit forms of the parameters in Eq.~\ref{dots}. Recall that $\beta$ is the beam angle east of south, $\chi$ is the colatitude of the beam, and $\theta$ ($\phi$) is the polar (azimuthal) scattering angle of the scattered electron.} \end{table} Using Eq.~\ref{dots} we can cast the correction into its final form \begin{equation} \delta\mathcal{A} = A(\theta,\phi)\cos\big(\Omega_{\oplus} t - \delta(\theta,\phi)\big)\sqrt{\xi_x^2 + \xi_y^2} \qq{+}\text{constant} \label{deltaA} \end{equation} The computation of $\delta$ and $A$ must be done numerically as a function of $\theta$, all the parameters in Table 1, and the beam energies associated with the given experiment. This is the subject of the next section. \section{Results and Conclusions} The calculation is now straightforward. One uses Eq.~A3, with $F$ (the proton energy) replaced by the quark energy, $xF$, and then kinematically replaces $E^\prime$ with \[\frac{2xEF}{E+xF-(E-xF)\cos\theta}\,.\] The $c_i^{V,A}$ are then input into Eq.~A2 and then the matrix elements in Eq.~A4 are summed. Note the factor of $h$ in the matrix elements---this is $-1$ for left-handed electrons and $+1$ for right-handed electrons. The dot products involving $\vec{\xi}$ are in Eq.~7. Then one integrates over the parton distributions and the asymmetry is determined. The final form is in Eq.~8, and we just need to determine $A(\theta,\phi)$. The resulting asymmetry depends on the colatitude, $\chi$, which we will take to be 45 degrees (this is fairly close to all current and future laboratories). It depends on $\beta$, the angle of the beam east of south, which will, in due course, be known for any collider. The only remaining variables are the polar and azimuthal angle of the scattered electron. One could, of course, integrate over these variables, but it is useful to see the dependence explicitly. Our results for the FCC-eh are in Figure \ref{fcceh}. In Figure \ref{fccbeta}, we show the value of A (in Equation \ref{deltaA}) as a function of $\theta$ for various values of $\phi$. Here, we have set $\beta = 45$ degrees. Note that the Lorentz violating corrections are peaked in the backward direction. In Figure \ref{fccphi}, we show the value of A as a function of $\theta$ for various values of $\beta$, setting $\phi = 60$ degrees. If one integrates over the solid angle in the backward hemisphere and divides by $2\pi$, one can get an ``average'' value of $A$. Typical values of $A$ are 0.3-0.7, depending on $\beta$, and thus the result in Equation 8 is this value times $\sqrt{\xi^2_x + \xi^2_y}$ times an oscillation with a period of the Earth's rotational period. \begin{figure} \centering \makebox[\textwidth][c]{% \subfigure[\label{fccbeta} Fixed $\beta=45$\textdegree]{\incsubgraph{FCC-eh-beta45}} \hfill\hspace{-2em} \subfigure[\label{fccphi} Fixed $\phi=60$\textdegree]{\incsubgraph{FCC-eh-phi60}}} \caption{\label{fcceh} Graphs of $A(\theta,\phi)$ for FCC-eh energies. In (a), $\beta$ is fixed to $45$\textdegree\ while $\phi$ takes on the values on the right of the graph. The reverse is true for (b).} \end{figure} \begin{figure} \centering \makebox[\textwidth][c]{% \subfigure[\label{lhecbeta} Fixed $\beta=45$\textdegree]{\incsubgraph{LHeC-beta45}} \hfill\hspace{-2em} \subfigure[\label{lhecphi} Fixed $\phi=60$\textdegree]{\incsubgraph{LHeC-phi60}}} \caption{\label{lhec} Graphs of $A(\theta,\phi)$ for LHeC energies.} \end{figure} In Figure 4, we have given the results for the LHeC. The general structure is similar to the FCC-eh, but the amplitude is roughly an order of magnitude smaller. We will not show results for the EIC---the structure is similar but the amplitude is 2-3 orders of magnitude smaller. The reason that the LHeC and EIC have much smaller effects is entirely due to the center of mass energy of the colliders. The LHeC has a proton beam that has an order of magnitude less energy, and the EIC has an even smaller energy. In the work of Fu and Lehnert \cite{Fu:2016fmf}, the value of $\sqrt{\xi^2_x + \xi^2_y}$ was bounded by studying the E158 experiment at SLAC \cite{Anthony:2003ub, Anthony:2005pm}, which studied M\o ller scattering. The bound arose by requiring that the amplitude of the fluctuation be smaller than the statistical uncertainty in the E158 experiment, and gave an upper bound of $3.4\times 10^{-7}$. They noted that the upcoming MOLLER experiment at Jefferson Lab would, using the same argument, be able to improve this by a factor of $1.4$. They also pointed out that the different beam directions might provide access to different components of $(k_W)_{\kappa\lambda\mu\nu}$, thus even if the bound could not be improved, it would be valuable to search for Lorentz violation. This is already a low bound and it might seem difficult for the FCC-eh to do much better. The Fu-Lehnert analysis only considered the amplitude of the oscillation---the actual rotation period of the Earth did not enter into the analysis. This is not surprising, since the timing of events for E158 are not available. If such timing is included for the FCC-eh, then it might be possible to perform a fit including the explicit time-dependence and thus improving the bound. Even if one does not do this, it is likely that a good bound could be obtained. While we do not know the estimated uncertainties in DIS parity violation at the FCC-eh, it has been reported\cite{Abada:2019lih} that DIS at the FCC-eh will be sensitive to $\sin^2\theta_W$ to an accuracy of $0.001$. This is a factor of four better than the E158 experimental uncertainty, and thus it is plausible that the FCC-eh will improve the bound substantially. At the LHeC, the size of the effect is an order of magnitude smaller, but a comparable bound might still be reached. Even if the bound obtained by E158 cannot be reached, one must remember that the Fu-Lehnert parameterization of Eq.~5, while quite reasonable, essentially considers a three dimensional slice of the 19-dimensional space of $(k_W)_{\kappa\lambda\mu\nu}$. Thus, a fit including to a potential time-dependence in future deep inelastic experiments could prove worthwhile. In future deep inelastic parity violation experiments, the values of the latitude and electron beam direction will be fixed, and it will be straightforward to use our results to find the polar and azimuthal angular dependence of the Lorentz violating effect. By fitting to a sinusoidal dependence with a period of the Earth's rotation, one will be able to bound $\sqrt{\xi^2_x + \xi^2_y}$, if the Fu-Lehnert parametrization is adopted. But even without that parametrization, a search would be worthwhile, since it is sensitive to the entire 19-dimensional space of $(k_W)_{\kappa\lambda\mu\nu}$. \section*{Acknowledgements} We are grateful to Wouter Deconinck, David Armstrong, Jianwei Qiu, Michael Kordosky and Chris Carone for useful discussions. We thank the National Science Foundation for support under Grant PHY-1819575. This work was performed in part using computing facilities at the College of William and Mary which were provided by contributions from the National Science Foundation, the Commonwealth of Virginia Equipment Trust Fund and the Office of Naval Research.
\section{Introduction} Computing the stable homotopy groups of the sphere spectrum is one of the most important problems of stable homotopy theory. Focusing on the 2-complete stable homotopy groups instead of the integral homotopy groups, the Adams spectral sequence appears to be one of the most effective tools to compute the homotopy groups. The spectral sequence has been studied by F. Adams, M. Mahowald, P. May, M. Tangora and others \cite{M-thesis} \cite{T-thesis} \cite{diff-A} \cite{diff-A-2} \cite{diff-A-B}. In 1999, Voevodsky and Morel introduced motivic homotopy theory \cite{VM-scheme}. One of its consequences is the realization that almost any object studied in classical algebraic topology could be given a motivic analog. In particular, we can define the motivic Steenrod algebra $\mathbf{A}$ \cite{Vod-S1}, the motivic stable homotopy groups of spheres \cite{VM-scheme} and the motivic Adams spectral sequence \cite{I-MASS}. In the motivic perspective, there are many more non-zero classes in the motivic Adams spectral sequence, which allows the detection of otherwise elusive phenomena. Also, the additional motivic weight grading can eliminate possibilities which appear plausible in the classical perspective. Let $\mathbb{M}_2$ denote the motivic cohomology of a point, which is isomorphic to $\mathbb{F}_2[\tau]$ where $\tau$ has bidegree $(0,1)$ \cite{Vod-Z2}. The motivic Steenrod algebra $\mathbf{A}$ is the $\mathbb{M}_2$-algebra generated by elements $\mathrm{Sq}^{2k}$ and $\mathrm{Sq}^{2k-1}$ for all $k\ge 1$, of bidegrees $(2k,k)$ and $(2k-1,k-1)$ respectively, subject to Adem relations \cite{Vod-S1} \cite{Vod-S2}. Let Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$ denote the cohomology of the motivic Steenrod algebra. To run the motivic Adams spectral sequence, one begins with Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$. The cohomology Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$ has an $\mathbb{M}_2$-algebra structure. Inverting $\tau$ in Ext$_\mathbf{A}(\mathbb{M}_2,\mathbb{M}_2)$ gives the cohomology Ext$_{\mathbf{A}_{cl}}(\mathbb{F}_2,\mathbb{F}_2)$ of the classical Steenrod algebra $\mathbf{A}_{cl}$ \cite{I-stem}. Given a classical element, there are many corresponding motivic elements. We typically want to find the corresponding element with the highest weight. For example, the classical element $g$ corresponds to the motivic elements $\tau^k g$ for all $k \geq 1$. The element $\tau g$ has weight $11$, but there is no motivic element of weight $12$ that corresponds to the classical element $g$. The algebra Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$ is infinitely generated and irregular. A natural approach is to look for systematic phenomena in Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$. One potential candidate is the wedge family in Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$. The classical wedge family was studied by M. Mahowald and M. Tangora \cite{Maho-Tango-wedge}. It is a subset of the cohomology Ext$_{\mathbf{A}_{\mathrm{cl}}}(\mathbb{F}_2,\mathbb{F}_2)$ of the classical Steenrod algebra, consisting of non-zero elements $P^ig^j \lambda$ and $g^j t$ in which $\lambda$ is in $\boldsymbol\Lambda$, $t$ is in $\mathbf{T}$, $i\ge 0$ and $j\ge 0$. The sets $\boldsymbol\Lambda $ and $\mathbf{T}$ are specific subsets of Ext$_{\mathbf{A}_{\mathrm{cl}}}(\mathbb{F}_2,\mathbb{F}_2)$. The wedge family gives an infinite wedge-shaped diagram inside the cohomology of the classical Steenrod algebra, which fills out an angle with vertex at $g^2$ in degree (40,8) (i.e. $g^2$ has stem 40 and Adams filtration 8), bounded above by the line $f=\frac{1}{2}s-12$, parallel to the Adams edge \cite{Adams-ped}, and bounded below by the line $s=5f$, in which $f$ is the Adams filtration and $s$ is the stem. The wedge family is a large piece of Ext$_{\mathbf{A}_{\mathrm{cl}}}(\mathbb{F}_2,\mathbb{F}_2)$ which is regular, of considerable size and easy to understand. Using this idea we build the motivic version of the wedge. However, it appears to be more complicated than the classical one. The highest weights of the motivic wedge elements follow a somewhat irregular pattern. We will discuss this irregularity in more detail later. Let $\mathbf{A}(2)$ denote the $\mathbb{M}_2$-subalgebra of $\mathbf{A}$ generated by $\mathrm{Sq}^1, \mathrm{Sq}^2$ and $\mathrm{Sq}^4$. Let Ext$_{\mathbf{A}(2)}(\mathbb{M}_2,\mathbb{M}_2)$ denote the cohomology of $\mathbf{A}(2)$. The finitely generated algebra Ext$_{\mathbf{A}(2)}(\mathbb{M}_2,\mathbb{M}_2)$ is fully understood by \cite{I-A2}. We use a new technique of comparison to Ext$_{\mathbf{A}(2)}(\mathbb{M}_2,\mathbb{M}_2)$ which makes the proof of the non-triviality of the wedge elements easy. We consider the ring homomorphism $\phi$ from Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$ to Ext$_{\mathbf{A}(2)}(\mathbb{M}_2,\mathbb{M}_2)$ induced by the inclusion from $\mathbf{A}(2)$ to $\mathbf{A}$. We use the map $\phi$ to detect structure in Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$. Most of the elements studied in this article have non-zero images via $\phi $ \cite{I-A2}. Therefore, they are all non-trivial elements in Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$. We define set-valued operations $\mathbf{P}$ and $\mathbf{g}$ on Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$. Classically, $g$ is an element of the cohomology of the classical Steenrod algebra. However, this is not true motivically. Rather, $\tau g$ is an element in Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$, while $g$ itself does not survive the motivic May spectral sequence. Consequently, multiplication by $g$ does not make sense motivically. Also, $P$ is not an element in Ext$_\mathbf{A}(\mathbb{M}_2,\mathbb{M}_2)$ either. We instead consider the set-valued operations $\mathbf{P}$ and $\mathbf{g}$ whose actions can be seen as multiplications by $P$ and $g$ in Ext$_{\mathbf{A}(2)}(\mathbb{M}_2,\mathbb{M}_2)$ respectively. For any $\lambda$ in Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$, $i \ge 0$ and $j\ge 0$, let $\mathbf{P}^i\mathbf{g}^j \lambda$ be the set consisting of all elements $x$ in Ext$_\mathbf{A}(\mathbb{M}_2,\mathbb{M}_2)$ such that $\phi(x) = P^ig^j \phi(\lambda)$ in Ext$_{\mathbf{A}(2)}(\mathbb{M}_2,\mathbb{M}_2)$. We define the wedge family via the actions of $\mathbf{P}$ and $\mathbf{g}$. The wedge is the set consisting of all elements in $\mathbf{P}^i\mathbf{g}^j \lambda$ with $i \ge 0$ and $j\ge 0$, where $\lambda$ is contained in a specific 16-element subset $\boldsymbol\Lambda$ of Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$ to be defined in Table \ref{lambda}. The motivic wedge family takes the same position and same shape as the classical one (Figure \ref{figure}). However the vertex of the motivic wedge is at $\tau g^2$ in degree $(40,8,23)$ having weight 23. Note that $g^2$ in degree $(40,8,24)$ does not survive the motivic May spectral sequence \cite{I-stem}. Our main result, Theorem \ref{def-wedge}, states that the subsets $\mathbf{P}^i\mathbf{g}^j\lambda$ are non-empty and consist of non-zero elements for all $\lambda$ in $\boldsymbol\Lambda$. However, our main result is not optimal, in the sense that there exist elements of weight greater than the weight of elements in $\mathbf{P}^i \mathbf{g}^j \lambda$ for some values of $i$, $j$, and $\lambda$. Some such elements are listed in Table \ref{opt}. We can not even conjecture the optimal result in general. However, we know a bit more about elements in the set $e_0^t \mathbf{g}^k$ for $t \geq 0$ and $k \geq 0$, which are part of the wedge. We will show that $\tau e_0^t \mathbf{g}^k$ is non-empty for all $t \geq 0$ and $k \geq 0$. We do not know whether $e_0^t \mathbf{g}^k$ is non-empty in general, but we make the following conjecture. \begin{conj} The set $e_0^t\mathbf{g}^k$ is non-empty if and only if $k=\sum ^{t}_{i=0}2^{n_i}-t$ for some integer $n_i \ge 1$. \end{conj} The conjecture holds if and only if $e_0\mathbf{g}^{2^n-1}$ is non-empty for all $n\ge 1$, since $$e_0^t\mathbf{g}^k \supseteq e_0\mathbf{g}^{2^{n_1}-1} \cdots e_0\mathbf{g}^{2^{n_t}-1}.$$ By explicit computations we know that $e_0, e_0\mathbf{g}$ and $e_0\mathbf{g}^3$ are non-empty and $e_0\mathbf{g}^2$ and $e_0\mathbf{g}^4$ are empty \cite{I-stem}. This means that the subsets $e_0 \mathbf{g}^k$ are non-empty sometimes but empty other times. The analogous classical question is trivial, since $e_0^t g^k$ is a product of $e_0^t$ and $g^k$. \subsection{Organization} The article contains four sections. In the second section, we recall techniques of comparison to classical computations, to Ext$_{\mathbf{A}(2)}(\mathbb{M}_2,\mathbb{M}_2)$ and to $h_1$-localization of Ext$_\mathbf{A}(\mathbb{M}_2,\mathbb{M}_2)$. In the third section, we introduce our main result on the motivic wedge. In the last section, we study the family $e_0^t\mathbf{g}^k$ in Ext$_\mathbf{A}(\mathbb{M}_2,\mathbb{M}_2)$ and give a conjecture on its behavior. \subsection{Acknowledgements} I would like to acknowledge the invaluable assistance of Daniel Isaksen. I also want to thank Robert Bruner, Andrew Salch and Bogdan Gheorghe for useful discussions. \subsection{Notation} We will use the following notation. \begin{enumerate} \item $\mathbb{M}_2=\mathbb{F}_2[\tau]$ is the mod 2 motivic cohomology of a point, where $\tau$ has bidegree (0,1). \item $\mathbf{A}$ is the mod 2 motivic Steenrod algebra over $\mathbb{C}$. \item $\mathbf{A}(2)$ is the $\mathbb{M}_2$-subalgebra of $\mathbf{A}$ generated by $\mathrm{Sq}^1, \mathrm{Sq}^2$ and $\mathrm{Sq}^4$. \item $\mathbf{A}_{\mathrm{cl}}$ is the mod 2 classical Steenrod algebra. \item Ext is the trigraded ring Ext$_{\mathbf{A}}(\mathbb{M}_2,\mathbb{M}_2)$, the cohomology of the motivic Steenrod algebra. \item Ext$_{\mathbf{A}(2)}$ is the trigraded ring Ext$_{\mathbf{A}(2)}(\mathbb{M}_2,\mathbb{M}_2)$, the cohomology of the $\mathbb{M}_2$-subalgebra of $\mathbf{A}$ generated by $\mathrm{Sq}^1, \mathrm{Sq}^2$ and $\mathrm{Sq}^4$. \item Ext$_{\mathrm{cl}}$ is the bigraded ring Ext$_{\mathbf{A}_{\mathrm{cl}}}(\mathbb{F}_2,\mathbb{F}_2)$, the cohomology of the classical Steenrod algebra. \item We use the notation of \cite{more-stem} for elements in Ext. \item We use the notation of \cite{I-A2} for elements in Ext$_{\mathbf{A}(2)}$, except that we use $a$ and $n$ instead of $\alpha$ and $\nu$ respectively. \item An element $x$ in Ext has degree of the form $(s,f,w)$ where: \begin{enumerate}\item $f$ is the Adams filtration, i.e., the homological degree. \item $s+f$ is the internal degree, i.e., corresponds to the first coordinate in the bidegrees of $\mathbf{A}$. \item $s$ is the stem, i.e., the internal degree minus the Adams filtration. \item $w$ is the motivic weight. \end{enumerate} \item The Chow degree of an element of degree $(s,f,w)$ is $s+f-2w$. \item The coweight of an element of degree $(s,f,w)$ is $s-w$. \end{enumerate} \section{Comparison Criteria} We know Ext$_{\mathrm{cl}}$ \cite{M-thesis} \cite{T-thesis} and Ext$_{\mathbf{A}(2)}$ \cite{I-A2} quite well. Computations in Ext can be studied via the relation with Ext$_{\mathrm{cl}}$ and Ext$_{\mathbf{A}(2)}$ in certain cases. The following theorem plays a key role in comparing the motivic and the classical computations, saying that they become the same after inverting $\tau$. \begin{thm}\cite{I-MASS} There is an isomorphism of rings $$\mathrm{Ext}\otimes _{\mathbb{M}_2} \mathbb{M}_2[\tau ^{-1}] \cong \mathrm{Ext}_{{\mathrm{cl}}} \otimes _{\mathbb{F}_2} \mathbb{F}_2[\tau, \tau ^{-1}].$$ \end{thm} Furthermore, the part of Ext at Chow degree 0 is isomorphic to Ext$_{\mathrm{cl}}$. \begin{thm}\label{Chow}\cite{I-stem} There is an isomorphism from $\mathrm{Ext}_{\mathrm{cl}}$ to the subalgebra of $\mathrm{Ext}$ consisting of elements in degrees $(s,f,w)$ such that $s+f-2w=0$. This isomorphism takes classical elements of degrees $(s,f)$ to motivic elements of degrees $(2s+f,f,s+f)$, and it preserves all higher structure including products, squaring operations, and Massey products. \end{thm} In other words, $$\mathrm{Ext}|_{s+f-2w=0} \cong \mathrm{Ext}_{\mathrm{cl}}.$$ The inclusion $\mathbf{A}(2) \hookrightarrow \mathbf{A}$ induces a homomorphism $\phi :$ Ext $ \rightarrow $ Ext$_{\mathbf{A}(2)}$ which allows us to detect some structure in Ext via Ext$_{\mathbf{A}(2)}$. We emphasize that Ext$_{\mathbf{A}(2)}$ is described completely in \cite{I-A2}. Table \ref{table-phi} gives some values of $\phi$ that we will need. \begin{table}[h] \caption{Some values of the map $\phi: \mathrm{Ext} \longrightarrow \mathrm{Ext}_{\mathbf{A}(2)}$.} \label{table-phi} \begin{tabular}{c|c|c} Ext & Ext$_{\mathbf{A}(2)}$ & $(s,f,w)$\\ \hline $i$ & $Pn$ & $(23,7,12)$ \\ $k$ & $dn$ & $(29,7,16)$ \\ $r$ & $n^2$ & $(30,6,16)$ \\ $m$ & $ng$ & $(35,7,20)$ \\ $ \Delta h_1 d_0$ & $ \Delta h_1 \cdot d_0$ & $(39,9,21)$\\ $\tau g^2$ & $\tau \cdot g^2$ & $(40,8,23)$\\ $\tau \Delta h_1 g$ & $\tau \cdot \Delta h_1 \cdot g$ & $(45,9,24)$\\ $h_2 g^j$ & $h_2 \cdot g^j$ & ($20j+3,4j+1,12j+2$) \\ $P^id_0$ & $P^i\cdot d_0$ & ($8i+14,4i+4,4i+8$)\\ $P^ie_0$ & $P^i \cdot e_0$ & ($8i+17,4i+4,4i+10$) \end{tabular} \end{table} \begin{remark}In some cases, $\phi(x)$ is decomposable in Ext$_{\mathbf{A}(2)}$ when $x$ is indecomposable in Ext. For example, the element $\Delta h_1 d_0$ in Ext is indecomposable but $\phi(\Delta h_1 d_0)=\Delta h_1 \cdot d_0$ is the product of $\Delta h_1$ and $d_0$ in Ext$_{\mathbf{A}(2)}$. \end{remark} If we invert $h_1$ on Ext, then Ext$[h_1^{-1}]$ becomes simpler. We can use Ext$[h_1^{-1}]$ to detect some structure in Ext. The following theorems describe Ext$[h_1^{-1}]$ and Ext$_{\mathbf{A}(2)}[h_1^{-1}]$. \begin{thm}\cite{G-I-local}*{Theorem 1.1}\label{thm:h1-local} The $h_1$-localization $\mathrm{Ext}[h_1^{-1}]$ is a polynomial algebra over $\mathbb{F}_2[h_1^{\pm 1}]$ on generators $v_1^4$ and $v_n$ for $n \ge 2$, where: \begin{itemize} \item the element $v_1^4$ has degree $(8,4,4)$. \item the element $v_n$ has degree $(2^{n+1}-2,1,2^n-1)$. \end{itemize} \end{thm} \begin{thm}\cite{G-I-local}The $h_1$-localization $\mathrm{Ext}_{\mathbf{A}(2)} [h_1^{-1}]$ is a polynomial algebra $$\mathrm{Ext}_{\mathbf{A}(2)} [h_1^{-1}] \cong \mathbb{F}_2[h_1^{\pm 1},a_1,v_1^4,v_2]$$ in which $a_1$ has degree $(11,3,7)$; $v_1^4$ has degree $(8,4,4)$; and $v_2$ has degree $(6,1,3)$. \end{thm} We can use $h_1$-localization to prove the non-existence of certain elements $x$ in Ext. We use the May spectral sequence analysis of Ext$[h_1^{-1}]$ to determine the localization map $$L: \mathrm{Ext} \longrightarrow \mathrm{Ext}[h_1^{-1}]$$ in a range \cite{G-I-local}. Some values of $L$ are given in Table \ref{L-map}. \begin{table}[h] \caption{Some values of the localization map $L: \mathrm{Ext} \rightarrow \mathrm{Ext}[h_1^{-1}]$ \cite{G-I-local} \label{L-map}}\begin{tabular}{c|c} $x$ & $L(x)$ \\ \hline $P^k h_1$ & $h_1v_1^{4k}$ \\ $P^k d_0$ & $h_1^2 v_1^{4k} v_2^2$ \\ $P^k e_0$ & $h_1^3 v_1^{4k} v_3$ \\ $e_0 g$ & $h_1^7 v_4$ \\ \end{tabular} \end{table} There is also a localization map $L:$ Ext$_{\mathbf{A}(2)} \longrightarrow$ Ext$_{\mathbf{A}(2)}[h_1^{-1}]$. The following diagram is commutative. \[ \begin{tikzcd} \mathrm{Ext} \ar{r}{\phi} \arrow{d}{L} & \mathrm{Ext}_{\mathbf{A}(2)} \arrow{d}{L} \\ \mathrm{Ext}[h_1^{-1}] \ar{r}{\phi} & \mathrm{Ext}_{\mathbf{A}(2)}[h_1^{-1}] \end{tikzcd} \] \begin{defn}Let $t$ be a non-negative integer. We define $\alpha (t)$ to be the number of 1's in the binary expansion of $t$. \end{defn} \begin{lemma}\label{lem:binary} Let $t, k$ and $s$ be non-negative integers, $s\ge 1$. We have \begin{itemize} \item $\alpha (t) \le t$. \item $\alpha (t+k) \le \alpha (t) + \alpha(k)$. \item $\alpha (2^st) = \alpha (t).$ \end{itemize} \end{lemma} \begin{proof}Suppose that $t=\sum_{i=1}^{n} 2^{m_i}$ in which $m_i \ge 0$ and $m_i \neq m_j$ if $i\neq j$. Consequently, $\alpha (t)=n$. Since $t=\sum_{i=1}^{n} 2^{m_i}\ge 1\cdot n=n$, we obtain the first inequality. With the above $t$ we suppose further that $k=\sum_{i=1}^{p} 2^{q_i}$ in which $q_i \ge 0$ and $q_i \neq q_j$ if $i\neq j$. Consequently, $\alpha (k)=p$. We have $$t+k = \sum_{i=1}^{n} 2^{m_i} + \sum_{j=1}^{p} 2^{q_j} $$ where the right hand side has $n+p$ powers of 2. If there is no pair $(m_i,q_j)$ such that $m_i=q_j$, then $\alpha (t+k)=n+p = \alpha (t) + \alpha(k)$. If there exists at least one pair $(m_i,q_j)$ such that $m_i = q_j = c$, since $2^{m_i} + 2^{q_j} = 2^{c+1}$ we have $\alpha (t+k) < n+p = \alpha (t) + \alpha(k)$. Therefore, $\alpha(t+k)\le \alpha(t)+\alpha(k)$. The last identity can be proven by the observation that if $t = \sum_{i=1}^{n} 2^{m_i}$, then $2^st = \sum_{i=1}^{n} 2^{m_i+s}$. \end{proof} \begin{lemma}\label{local2}The image of \begin{equation*} \phi: \mathrm{Ext}[h_1^{-1}] \longrightarrow \mathrm{Ext}_{\mathbf{A}(2)} [h_1^{-1}] \end{equation*} is spanned by the monomials $h_1^d v_1^{4a} v_2^b a_1^c$ where $a, b$ and $c$ are non-negative integers for which $\alpha(b+c) \le b$ and $d$ is an integer. \end{lemma} \begin{proof}Denote by $\mathcal{G}$ the $\mathbb{M}_2$-submodule of Ext$_{\mathbf{A}(2)} [h_1^{-1}]$ spanned by the monomials $h_1^d v_1^{4a} v_2^b a_1^c$ where $a, b$ and $c$ are non-negative integers for which $\alpha(b+c) \le b$ and $d$ is an integer. The map $\phi$ takes $v_1^4$ and $v_n$ to $v_1^4$ and $h_1^{-3(2^{n-2}-1)}a_1^{2^{n-2}-1}v_2$ respectively for all $n$ \cite{G-I-local}. Consequently $$\phi: v_1^{4a}\prod _{j\in J} v_j \longmapsto h_1^{-3\sum_{j\in J}(2^{j-2}-1)} v_1^{4a}v_2^m a_1^{\sum_{j\in J}(2^{j-2}-1)}$$ in which $J$ is a sequence $(j_1,\ldots,j_m)$ of length $m$ such that $j_k \ge 2$ (repeats are allowed). Consequently, the image of $\phi$ equals the $\mathbb{M}_2$-submodule $\mathcal{H}$ of Ext$_{\mathbf{A}(2)} [h_1^{-1}]$ spanned by the monomials of the form $h_1^d v_1^{4a}v_2^m a_1^{\sum_{j\in J}(2^{j-2}-1)}$ in which $J$ is a sequence $(j_1,\ldots,j_m)$ of length $m$ such that $j_k \ge 2$ (repeats are allowed). Since $J$ has length $m$, $$\alpha(m+\sum_{j\in J}(2^{j-2}-1)) = \alpha (\sum_{j\in J}2^{j-2}) \le m.$$ As a result, $\mathcal{H}$ is contained in $\mathcal{G}$. Conversely, for any monomial $h_1^d v_1^{4a} v_2^b a_1^c$ for which $\alpha(b+c) \le b$, we can suppose that $b+c = \sum_{j\in J}2^{j} $ where $J$ is a sequence $(j_1,\ldots,j_r)$ of length $r\le b$ such that $j_k \ge 0$ for $k$ in $\{1,\ldots,r\}$. By replacing $2^j$ by $2^{j-1}+2^{j-1}$ as necessary, we can rewrite $b+c$ as $$ b+c = \sum_{i\in I}2^{i}$$ where $I$ is a sequence $(i_1,\ldots,i_b)$ of length $ b$ such that $i_k \ge 0$ for $k$ in $\{1,\ldots,b\}$. Then $$c = \sum_{i\in I}2^{i} - b = \sum_{i\in I}(2^{i}-1). $$ This shows that $\mathcal{G}$ is contained in $\mathcal{H}$. \end{proof} \begin{remark}The value of $\phi(v_n)$ is given in \cite{G-I-local} for $n \leq 6$. In \cite{G-I-local}, it is also explained that the value of $\phi(v_n)$ for all $n$ can be deduced from the existence of a ``motivic modular forms" spectrum. Such a spectrum has recently been constructed \cite{GKIR}, so that the values of $\phi(v_n)$ are now known for all $n$. \end{remark} \section{The wedge family} We recall that the inclusion $\mathbf{A}(2)\hookrightarrow \mathbf{A}$ induces a homomorphism of algebras $\phi: \mathrm{Ext} \rightarrow \mathrm{Ext}_{\mathbf{A}(2)}$. \begin{defn}\label{def:Pg}For any $\lambda$ in Ext, $i \ge 0$ and $j\ge 0$, $\mathbf{P}^i\mathbf{g}^j \lambda$ is the set which consists of all elements $x$ of Ext such that $\phi (x) = P^ig^j \phi(\lambda)$ in Ext$_{\mathbf{A}(2)}$. \end{defn} \begin{ex} The set $\mathbf{g}^2r$ contains $m^2$ because $\phi (m^2) = g^2 n^2 = g^2 \phi(r).$ \end{ex} \begin{remark}We differentiate $\mathbf{P}$ and $\mathbf{g}$ with $P$ and $g$. By the bold $\mathbf{P}$ and $\mathbf{g}$ we mean set-valued operations from Ext to Ext. Remember that $\mathbf{P}$ and $ \mathbf{g}$ do not exist in Ext as elements. By $P$ and $g$, we mean elements in Ext$_{\mathbf{A}(2)}$. \end{remark} \begin{remark} More specifically, the sets $\mathbf{P}^i\mathbf{g}^j\lambda$ can be seen as cosets with respect to the subgroup $$I=\{z:\phi(z)=0\}$$ of Ext. \end{remark} \begin{remark}We sometimes write the symbols $\mathbf{P}$ and $\mathbf{g}$ in a different order for consistency with standard notation. For example: \begin{itemize} \item By $e_0\mathbf{g}^2$ we mean $\mathbf{g}^2(e_0)$. The set $e_0\mathbf{g}^2$ is empty (See Corollary \ref{cor:empty}). \item By $\tau \Delta h_1 \mathbf{g}^{j+1}$ we mean the set $\mathbf{g}^{j} (\tau \Delta h_1 g)$. \item By $\tau \mathbf{P}^i\mathbf{g}^{j+1}$ we mean $\mathbf{P}^i\mathbf{g}^{j+1}(\tau)$. \item The same convention is applied for $\tau \mathbf{g}^k$, $\tau e_0^t \mathbf{g}^k$ and many others. \end{itemize} \end{remark} \begin{remark}From Definition \ref{def:Pg} we have $\mathbf{P}^i\mathbf{g}^jx \cdot \mathbf{P}^a\mathbf{g}^b y \subseteq \mathbf{P}^{i+a}\mathbf{g}^{j+b}xy.$ However, the inverse inclusion is not correct generally. For example, by low dimension calculation \cite{I-stem} we have$$e_0 \cdot \tau^2 \mathbf{g} =\{e_0\}\{\tau^2 g\} \varsubsetneq \tau^2 e_0 \mathbf{g} = \{\tau^2 e_0g, \tau^2e_0g+h_0^3x\}.$$ \end{remark} \begin{defn} We define $\boldsymbol\Lambda $ to be the following sixteen elements of Ext. \begin{table}[h] \caption{Sixteen elements of the set $\boldsymbol\Lambda \label{lambda}$} \begin{tabular}{c|cc|c} element & $(s,f,w)$ & element & $(s,f,w)$ \\ \hline $\tau g^2$ & (40,8,23) & $d_0r$ & (44,10,24) \\ $\tau \Delta h_1 g$ & (45,9,24) & $d_0m$ & (49,11,28) \\ $gr$ & (50,10,28) & $\tau e_0^2g$ & (54,12,31) \\ $gm$ & (55,11,32) & $\tau \Delta h_1 e_0^2$ & (59,13,32) \\ $\tau \Delta h_1e_0$ & (42,9,22) & $d_0l$ & (46,11,26) \\ $e_0 r$ & (47,10,26) & $\tau e_0^3$ & (51,12,29) \\ $e_0m$ & (52,11,30) & $\tau \Delta h_1 d_0 e_0$ & (56,13,30) \\ $\tau e_0 g^2$ & (57,12,33) & $d_0 e_0 r$ & (61,14,34) \\ \end{tabular} \end{table} \end{defn} The following theorem is our main result. \begin{thm}\label{def-wedge}For any $\lambda$ in $\boldsymbol\Lambda$, $i \ge 0$ and $j\ge 0$, the set $\mathbf{P}^i \mathbf{g}^j\lambda$ is non-empty and consists of non-zero elements. \end{thm} Combining all elements of $\mathbf{P}^i\mathbf{g}^j\lambda$ with $i\ge 0$, $j\ge 0$ and $\lambda$ in $\boldsymbol\Lambda$, we obtain an infinite wedge-shaped diagram, filling out the angle with vertex at $\tau g^2$ in degree $(40,8,23)$, bounded above by the line $f=\frac{1}{2}s-12$ parallel to the Adams edge \cite{Adams-mot}, and bounded below by the line $s=5f$ in Ext (Figure \ref{figure}). We need a couple of preliminary results before proving Theorem \ref{def-wedge}. \begin{lemma}\label{Lemma:P-ope} The sets $\mathbf{P}^i d_0$, $\mathbf{P}^i e_0$ and $\mathbf{P}^i \Delta h_1 e_0$ are non-empty for $i\ge 0$ and $j\ge 0$. \end{lemma} \begin{proof}Since $d_0$, $e_0$ and $\Delta h_1 e_0$ are generators in Ext, the statement is trivial when $i=0$. We now consider the case $i>0$. The Adams periodicity operator $P^i$ is an isomorphism on Ext in specified ranges \cite{Adams-ped}. Since the element $d_0$ lies in these ranges, then $\mathbf{P}^id_0$ contains the element $P^id_0$. Therefore, the set $\mathbf{P}^id_0$ is non-empty. The same argument is applied for $\mathbf{P}^ie_0$ and $\mathbf{P}^i\Delta h_1 e_0$. \end{proof} \begin{lemma}\label{Lemma:Pg}Let $x$ be an element in $\mathrm{Ext}$ such that $h_1^3\phi(x)=0$. Then $\mathbf{P}^{i+1}\mathbf{g}x$ contains the non-empty set $\mathbf{P}^id_0^2x$ for all $i \ge 0$. As a result, $\mathbf{P}^{i+1}\mathbf{g}x$ is non-empty. \end{lemma} \begin{proof}Since $\mathbf{P}^id_0$ is non-empty by Lemma \ref{Lemma:P-ope}, the set $\mathbf{P}^id_0^2x$ is non-empty. Consider an element $\beta$ in $\mathbf{P}^id_0^2x$. We have \begin{align*} \phi(\beta)=P^id_0^2 \phi(x) &= P^i(Pg+h_1^3\cdot \Delta h_1)\phi(x) \\ &=P^{i+1}g\phi(x)+P^i \Delta h_1 \cdot h_1^3\phi(x)=P^{i+1}g\phi(x). \end{align*} Consequently, $\mathbf{P}^{i+1}\mathbf{g}x$ contains the element $\beta$ of $\mathbf{P}^id_0^2x$. \end{proof} Now we consider $j\ge 2$ and suppose that $j=2^r m$ for $r\ge 0$ and $m$ odd. Classically, we have the following May differential: $d_{2^{r+2}}(P^j)=h_0^5 x_j$ for some $x_j$ in Ext$_{\mathrm{cl}}$. We denote by $\tilde{x}_j$ the motivic element of Chow degree zero corresponding to $x_j$ via the Chow degree zero isomorphism in Theorem \ref{Chow}. \begin{lemma}\label{lemma:h2g}In $\mathrm{Ext}$, the Massey product $\langle h_2,h_1,h_1^4\tilde{x}_j \rangle$ equals $h_2g^j$. \end{lemma} \begin{proof}The motivic elements $h_2g^j, h_2,h_1$ and $h_1^4\tilde{x}_j$ all have Chow degree zero. They correspond to classical elements $P^jh_1$, $h_1$, $h_0$ and $h_0^4 x_j$ via the Chow degree zero isomorphism in Theorem \ref{Chow}. Classically we have $P^jh_1=\langle h_1,h_0,h_0^4x_j \rangle$. We obtain the desired identity by the Chow degree zero isomorphism. \end{proof} \begin{remark}The $g$ in $h_2g^j$ in the above argument is not the operator $\mathbf{g}$. We write $h_2g^j$ for the element of Ext which corresponds to the classical element $P^jh_1$ via the Chow degree zero isomorphism in Theorem \ref{Chow}. \end{remark} \begin{lemma}\label{Lemma:gm}The sets $\mathbf{g}^jm$, $\mathbf{g}^jl$ and $\mathbf{g}^jr$ are non-empty for all $j\ge 0$. \end{lemma} \begin{proof}We have $$h_2 \langle h_1,h_1^4\tilde{x}_j,m \rangle = \langle h_2,h_1,h_1^4\tilde{x}_j \rangle \cdot m = h_2g^j \cdot m$$ in which the last identity is by Lemma \ref{lemma:h2g}. Consider an element $\beta$ in $\langle h_1,h_1^4\tilde{x}_j,m \rangle$. We apply $\phi$ to get $$h_2 \phi(\beta) = h_2g^j \phi(m) = h_2n g^{j+1}.$$ By inspection of Ext$_{\mathbf{A}(2)}$, we have $$\phi(\beta) = ng^{j+1}.$$ Therefore $\mathbf{g}^jm$ contains $\beta$, and is non-empty. The same argument is applied to $\mathbf{g}^jl$ and $\mathbf{g}^jr$. \end{proof} \begin{lemma}\label{Lemma:tDhg}The set $\tau \Delta h_1 \mathbf{g}^{j+1}$ is non-empty for all $j\ge 0$. \end{lemma} \begin{proof}The set $\tau \Delta h_1 \mathbf{g}$ is non-empty since it contains $\tau \Delta h_1 g$. When $j\ge 1$, the set $\tau \Delta h_1 \mathbf{g}^{j+1} = r \cdot \mathbf{g}^{j-1}m$ is non-empty since $\mathbf{g}^jm$ is non-empty by Lemma \ref{Lemma:gm}. Here we are using the identity $\tau \Delta h_1 g\cdot g=\phi(r) \cdot \phi(m)$ in Ext$_{\mathbf{A}(2)}$. \end{proof} \begin{lemma}\label{Lemma:tg}The set $\tau \mathbf{g}^j$ is non-empty for any $j\ge 0$. \end{lemma} \begin{proof}The claim for $j=1$ is proven by explicit low dimension calculation \cite{I-stem} \cite{I-MASS}. \\ By Lemma \ref{lemma:h2g} $$\langle \tau, h_1^4\tilde{x}_j, h_1 \rangle h_2 = \tau \langle h_1^4\tilde{x}_j,h_1,h_2 \rangle = \tau h_2g^j.$$ Consider an element $\gamma$ in $\langle \tau, h_1^4\tilde{x}_j,h_1 \rangle$, we apply $\phi$ to get $$ \phi(\gamma) h_2 = \tau h_2 g^j.$$ By inspection of Ext$_{\mathbf{A}(2)}$, $$ \phi(\gamma) = \tau g^j.$$ Therefore $\tau \mathbf{g}^j$ contains $\gamma$, and is non-empty. \end{proof} \begin{lemma}\label{Lemma:tPg}The set $\tau \mathbf{P}^i \mathbf{g}^{j+1}$ is non-empty for $i \ge 0$ and $j\ge 0$. \end{lemma} \begin{proof}The case $i=0$ is established in Lemma \ref{Lemma:tg}. Now we assume $i>0$. When $j=0$, by Lemma \ref{Lemma:P-ope} the set $\mathbf{P}^{i-1}d_0$ is non-empty. Consequently, $\tau \mathbf{P}^{i-1}d_0^2$ is non-empty. We consider an element $x$ in $\tau \mathbf{P}^{i-1}d_0^2$. The set $\mathbf{P}^i(\tau g)$ contains $x$ because $$\phi(x)= \tau P^{i-1} d_0^2 = \tau P^{i-1} (Pg + h_1^3 \Delta h_1) = \tau P^ig.$$ When $j\ge 1$, consider $x$ in $\tau \mathbf{g}^{j}$. Since $h_1^3\phi(x)=h_1^3 \cdot \tau g^{j} =0 $ in Ext$_{\mathbf{A}(2)}$, $\mathbf{P}^i\mathbf{g}x$ is non-empty by Lemma \ref{Lemma:Pg}. Therefore $\tau \mathbf{P}^i\mathbf{g}^{j+1}= \mathbf{P}^i\mathbf{g}x$ is non-empty. \end{proof} \begin{ex}\label{Pgt=d}The set $\tau \mathbf{P}\mathbf{g} $ contains $\tau d_0^2$. \end{ex} Now we can prove Theorem \ref{def-wedge}. \begin{proof} We have the following inclusions of sets. $$\mathbf{P}^i\mathbf{g}^j \tau \Delta h_1 e_0 \supseteq \tau \mathbf{g}^j \cdot \mathbf{P}^i \Delta h_1e_0,$$ $$\mathbf{P}^i\mathbf{g}^j e_0r \supseteq \mathbf{P}^ie_0\cdot \mathbf{g}^jr, $$ $$\mathbf{P}^i\mathbf{g}^j e_0m \supseteq \mathbf{P}^ie_0\cdot \mathbf{g}^jm,$$ $$\mathbf{P}^i\mathbf{g}^j \tau e_0g^2 \supseteq \mathbf{P}^ie_0\cdot \tau \mathbf{g}^{j+2},$$ $$\mathbf{P}^i\mathbf{g}^j d_0r \supseteq \mathbf{P}^id_0 \cdot \mathbf{g}^jr,$$ $$\mathbf{P}^i\mathbf{g}^j d_0m \supseteq \mathbf{P}^id_0\cdot \mathbf{g}^jm,$$ $$\mathbf{P}^i\mathbf{g}^j \tau e_0^2g \supseteq \mathbf{P}^ie_0^2 \cdot \tau \mathbf{g}^{j+1},$$ $$\mathbf{P}^i\mathbf{g}^j \tau \Delta h_1e_0^2 \supseteq \tau \mathbf{g}^j \cdot \mathbf{P}^i \Delta h_1 e_0 \cdot e_0,$$ $$\mathbf{P}^i\mathbf{g}^j d_0l \supseteq \mathbf{P}^id_0\cdot \mathbf{g}^jl,$$ $$\mathbf{P}^i\mathbf{g}^j \tau e_0^3 \supseteq \tau \mathbf{g}^j\cdot \mathbf{P}^ie_0^3,$$ $$\mathbf{P}^i\mathbf{g}^j \tau \Delta h_1d_0e_0 \supseteq \tau \mathbf{g}^j\cdot \mathbf{P}^i\Delta h_1e_0 \cdot d_0,$$ $$\mathbf{P}^i\mathbf{g}^j d_0er \supseteq \mathbf{P}^jd_0 \cdot \mathbf{g}^jr \cdot e_0.$$ The set $\tau \mathbf{g}^j \cdot \mathbf{P}^i\Delta h_1 e_0$ consists of all products $x\cdot y$ in which $x$ is an element of $\tau \mathbf{g}^j$ and $y$ is an element of $\mathbf{P}^i\Delta h_1 e_0$. The same interpretation is applied for other sets on the right hand side. The sets on the right hand side are all non-empty because of Lemmas \ref{Lemma:P-ope}, \ref{Lemma:gm} and \ref{Lemma:tg}. For example, since $\tau \mathbf{g}^j$ and $\mathbf{P}^i \Delta h_1e_0$ are non-empty, $$\mathbf{P}^i\mathbf{g}^j \tau \Delta h_1 e_0 \supseteq \tau \mathbf{g}^j \cdot \mathbf{P}^i \Delta h_1e_0$$ is non-empty. Therefore, the sets on the left are all non-empty. Several values of $\lambda$ remain. Now consider $\lambda = \tau g^2$. The set $\mathbf{P}^i\mathbf{g}^j (\tau g^2)$, or $\tau \mathbf{P}^i \mathbf{g}^{j+2}$, is non-empty by Lemma \ref{Lemma:tPg}. Next consider $\lambda =gr$. The case $i=0$ is established in Lemma \ref{Lemma:gm}. We consider $i>0.$ Since $\mathbf{g}^jr$ is non-empty by Lemma \ref{Lemma:gm}, we consider any element $x$ in $\mathbf{g}^jr$. Since $h_1^3\phi(x)=h_1^3n^2\cdot g^j=0$ \cite{I-A2}, then $\mathbf{P}^i\mathbf{g}^j\lambda =\mathbf{P}^i\mathbf{g}x$ is non-empty by Lemma \ref{Lemma:Pg}. The same argument is applied for $\lambda = gm$. Finally, consider $\lambda = \tau \Delta h_1g$. The case $i=0$ is established in Lemma \ref{Lemma:tDhg}. We consider $i>0$. When $j>0$, since $\tau \Delta h_1 \mathbf{g}^j$ is non-empty by Lemma \ref{Lemma:tDhg}, we consider any element $x$ in $\tau \Delta h_1 \mathbf{g}^j$. Since $h_1^3\phi(x) = h_1^3\tau \Delta h_1\cdot g^j =0$ \cite{I-A2}, then $\mathbf{P}^i\mathbf{g}^j \lambda = \mathbf{P}^i\mathbf{g} x$ is non-empty by Lemma \ref{Lemma:Pg}. When $j=0$, since $$\phi(\tau P^{i-1}d_0\cdot d_0 \Delta h_1)=\tau P^{i-1}d_0^2 \Delta h_1 = \tau P^{i-1} (Pg+h_1^3 \Delta h_1) \Delta h_1 = P^i \tau \Delta h_1g, $$ $\mathbf{P}^i\tau \Delta h_1 g$ contains $\tau P^{i-1}d_0\cdot \Delta h_1d_0$, so it is non-empty. \end{proof} \section{The $e_0^t\mathbf{g}^k$ and $\Delta h_1 e_0 \mathbf{g}^k$ families}\label{optimize} Theorem \ref{def-wedge} is not optimal in the sense that there exist elements of weight greater than the weight of elements in $\boldsymbol\Lambda$. For example, the element $\tau e_0^2g$ in $\boldsymbol\Lambda$ is of weight 31. However, the element $e_0^2g$ in Ext is of weight 32. Table \ref{opt} lists all such elements in $\boldsymbol\Lambda$. \begin{table}[h] \caption{\label{opt}} \begin{tabular}{c|c|c|c} element of the wedge& weight & element of higher weight& weight \\ \hline $\tau \Delta h_1 e_0$ & 22 & $ \Delta h_1 e_0$ & 23 \\ $\tau e_0^3$ & 29 & $e_0^3$ & 30 \\ $\tau \Delta h_1 d_0 e_0$ & 30 & $\Delta h_1 d_0 \cdot e_0$ & 31 \\ $\tau e_0^2g$ & 31 & $e_0\cdot e_0g$ & 32 \\ $\tau \Delta h_1 e_0^2$ & 32 & $ \Delta h_1 e_0\cdot e_0$ & 33 \end{tabular} \end{table} \begin{remark}By $\mathbf{g}^j$ we mean $\mathbf{g}^j(1)$ which is understood in the sense of Definition \ref{def:Pg}. \end{remark} \begin{lemma}\label{g-empty}The set $\mathbf{g}^j$ is empty for all $j\ge 0$. \end{lemma} \begin{proof}We prove the statement via contradiction. Suppose that $\mathbf{g}^j$ is non-empty. Consider any element $x$ in $\mathbf{g}^j$. Since $x$ maps to the non-zero element $g^j$ in Ext$_{\mathbf{A}(2)}$, $x$ is non-zero. Furthermore, because $x$ has Chow degree zero, $x$ corresponds to a classical element at degree $(8j,4j)$ in Ext$_{\mathrm{cl}}$ via the Chow degree zero isomorphism. However, Ext$_{\mathrm{cl}}$ is zero in degrees $(8j,4j)$ for all non-negative integers $j$ \cite{Adams-ped}. Therefore, $x$ does not exist. \end{proof} \begin{lemma}\label{gd}The set $d_0\mathbf{g}$ contains $e_0^2$. \end{lemma} \begin{proof}We have $\phi (e_0^2)=e_0^2 = gd.$ The last identity is because $e_0^2 = gd$ in Ext$_{\mathbf{A}(2)}.$ \end{proof} We study the behavior of the sets $\tau \mathbf{P}^i\mathbf{g}^j \tau e_0^3$ for $i\ge 0$ and $j\ge 0$. \begin{thm}\label{thm:ij}The set $\tau \mathbf{P}^i \mathbf{g}^j e_0^3$ contains an element divisible by $\tau$ if \begin{itemize} \item $i\ge 0$ and $j=0$, or \item $i\ge j\ge 1$, or \item $1\le i < j \le 3i$. \end{itemize} \end{thm} \begin{proof}When $i=0$ and $j=0$, the element $\tau e_0^3$ is divisible by $\tau$. When $i\ge 1$ and $j=0$, the set $\tau \mathbf{P}^ie_0^3$ contains the element $\tau \cdot P^ie_0^3$ which is divisible by $\tau.$ Apply Example \ref{Pgt=d} and Lemma \ref{gd} to get: \begin{itemize}\item When $i\ge j \ge 1$, the set $\tau \mathbf{P}^i\mathbf{g}^j e_0^3$ contains the element $\tau \cdot d_0^{2j} \cdot P^{i-j}e_0^3$ which is divisible by $\tau$. \item When $1\le i < j \le 3i$, the set $\tau \mathbf{P}^i\mathbf{g}^j e_0^3$ contains the element $\tau \cdot d_0^{3i-j} \cdot e_0^{2(j-i)+3}$ which is divisible by $\tau.$ \end{itemize} \end{proof} There are unknown cases from Theorem \ref{thm:ij}. When $i=0$ and $j\ge 1$, the set $\tau e_0^3 \mathbf{g}^j $ is not known fully and will be of our interest. When $3i<j$, the set $\mathbf{P}^i\mathbf{g}^j \tau e_0^3$ contains the set $\tau e_0^{4i+3}\mathbf{g}^{j-3i}$ which is not known fully and will be of our interest. We apply the same argument for the sets $\mathbf{P}^i\mathbf{g}^j \tau \Delta h_1e_0$, $\mathbf{P}^i\mathbf{g}^j \tau \Delta h_1 d_0 e_0$, $\mathbf{P}^i\mathbf{g}^j \tau e_0^2 g$ and $\mathbf{P}^i\mathbf{g}^j \tau \Delta h_1 e_0^2$ for $i\ge 0$ and $j\ge 0$ to observe that we need to study the behavior of the families of sets $\Delta h_1 e_0^t \mathbf{g}^j $ and $e_0^t \mathbf{g}^j $ for $i \ge 0$, $j \ge 0$ and $t\ge 1$. \begin{remark}Since $\Delta h_1$ is not an element of Ext, $\Delta h_1 \mathbf{g}^j$ is not defined in Ext. Therefore, we do not consider the set $\Delta h_1 e_0^t \mathbf{g}^j$ when $t=0$. \end{remark} \subsection{The $e_0^t\mathbf{g}^k$ family} \begin{lemma} \label{lem:h1-local} If $e_0^t\mathbf{g}^k$ is non-empty, then $e_0^t\mathbf{g}^k$ consists of elements which are non-zero in the $h_1$-localization $\mathrm{Ext}[h_1^{-1}]$. \end{lemma} \begin{proof}For any element $x$ in $e_0^t\mathbf{g}^k$ and any non-negative integer $n$, we have $\phi (h_1^n x)=h_1^n e_0^tg^k$ which is non-zero in Ext$_{\mathbf{A}(2)}$ \cite{I-A2}. Consequently, $h_1^n x$ is non-zero in Ext. In other words, $x$ is non-zero in the $h_1$-localization Ext$_{\mathbf{A}}[h_1^{-1}]$. \end{proof} \begin{prop}\label{prop:eg-empty}Let $t$ and $k$ be non-negative integers. If $\alpha (t+k) >t $, then $e_0^t \mathbf{g}^k$ is empty. \end{prop} \begin{proof}(Via contradiction) Suppose that $e_0^{t}\mathbf{g}^k$ is non-empty. As a result, its elements survive the $h_1$-localization by Lemma \ref{lem:h1-local}. Note that elements of $e_0^{t}\mathbf{g}^k$ have Chow degree $t$ and coweight $(7t+8k)$. By Theorem \ref{thm:h1-local}, after considering Chow degrees, any element of $e_0^{t}\mathbf{g}^k$ maps to a summation of monomials of the form $$v_1^{4n} v_2^m \prod_{i=1}^{t-4n-m}v_{m_i}$$ in Ext$_{\mathbf{A}}[h_1^{-1}]$ for some $n, m$ and $m_i\ge 3$. By comparing coweights, we have $$7t+8k = 4n +3m + \sum_{i=1}^{t-4n-m} (2^{m_i}-1).$$ Then $$8t+8k = 8n + 4m + \sum_{i=1}^{t-4n-m} 2^{m_i}.$$ Since $m_i \ge 3$, $m$ has to be even, i.e., $m=2m'$ for some non-negative integer $m'$. We obtain $$t+k=n+m'+\sum_{i=1}^{t-4n-m}2^{m_i-3}.$$ By Lemma \ref{lem:binary}, $$\alpha (t+k) \le \alpha (n) + \alpha (m') + t - 4n - m = t + (\alpha (n) - 4n) + (\alpha (m') - 2m') \le t.$$ \end{proof} \begin{cor}\label{cor:empty}If $e_0 \mathbf{g}^k$ is non-empty, then $k=2^n-1$ for some non-negative integer $n$. \end{cor} \begin{proof}Since $e_0 \mathbf{g}^k$ is non-empty, $\alpha (1+k) \le 1$ by Proposition \ref{prop:eg-empty}. Then $1+k=2^n$ for some non-negative integer $n$. \end{proof} We state the following conjecture. \begin{conj}\label{conj:eg}The set $e_0\mathbf{g}^k$ is non-empty if and only if $k=2^n-1$ for some non-negative integer $n$. \end{conj} We mention some evidence supporting the conjecture. The elements $e_0g$ and $e_0g^3$ survive in Ext (by explicit computations). Also, the conjecture fits nicely with the properties of the $h_1$-localization of Ext \cite{G-I-local}. \begin{thm}\label{eg}Suppose that $e_0\mathbf{g}^{2^n-1}$ is non-empty for every non-negative integer $n$. Then $e_0^t\mathbf{g}^k$ is non-empty if and only if $k = (\sum_{i=1}^{t} 2^{n_i}) - t $ for some non-negative integers $n_i$. \end{thm} \begin{proof}If $e_0^t\mathbf{g}^k$ is non-empty, then by Proposition \ref{prop:eg-empty} we have $\alpha(k+t)\le t$. As a result, $k + t = \sum_{i=1}^{t} 2^{n_i}$ for some non-negative integers $n_i$. In other words, $$k = (\sum_{i=1}^{t} 2^{n_i}) - t .$$ Conversely, if $k = (\sum_{i=1}^{t} 2^{n_i}) - t $, since $e_0\mathbf{g}^{2^{n_i}-1}$ is non-empty for all $n_i$ then $$e_0^t\mathbf{g}^k \supseteq e_0\mathbf{g}^{2^{n_1}-1} \cdots e_0\mathbf{g}^{2^{n_t}-1}$$ is non-empty. \end{proof} \begin{remark}\label{rem:eg}The condition $k = (\sum_{i=1}^{t} 2^{n_i}) - t $ is equivalent to $\alpha(k+t) \le t$. In practice, we use the latter condition rather than the former one. \end{remark} \subsection{The $\Delta h_1e_0^t\mathbf{g}^k$ family} \begin{prop}{\label{dheg}}If $\alpha (1+k+t)>t$ for $t\ge 1$ and $k\ge 0$, then the set $\Delta h_1e_0^t\mathbf{g}^k$ is empty. \end{prop} \begin{proof}(Via contradiction) We recall the following commutative diagram \cite{G-I-local} \[ \begin{tikzcd} \mathrm{Ext} \ar{r}{\phi} \arrow{d}{L} & \mathrm{Ext}_{\mathbf{A}(2)} \arrow{d}{L} \\ \mathrm{Ext}[h_1^{-1}] \ar{r}{\phi} & \mathrm{Ext}_{\mathbf{A}(2)}[h_1^{-1}] \end{tikzcd} \] Suppose that $\Delta h_1e_0^t\mathbf{g}^k$ is non-empty. Then it contains an element $x$. The element $x$ maps to the element $\Delta h_1e_0^tg^k$ in Ext$_{\mathbf{A}(2)}$, surviving $h_1$-localization. The element $\Delta h_1e_0^tg^k$ maps to $$h_1^{-2k-5} v_1^4 a_1^{2+2k+t} v_2^t + h_1^{-2k+1} v_2^{4+t} a_1^{2k+t}$$ in Ext$_{\mathbf{A}(2)}[h_1^{-1}]$ via $L$. Since $\alpha (1+k+t)>t$, the term $h_1^{-2k-5} v_1^4 a_1^{2+2k+t} v_2^t$ is not in the image of $\phi:$ Ext$[h_1^{-1}] \longrightarrow$ Ext$_{\mathbf{A}(2)}[h_1^{-1}]$ by Lemma \ref{local2}. \end{proof} \begin{lemma}For any integer $k\ge 0$, there is no element $x$ in $\mathrm{Ext}$ such that $\phi(x) = \Delta h_1 g^k$ in $\mathrm{Ext}_{\mathbf{A}(2)}$. \end{lemma} \begin{proof}We apply the same argument as in Proposition \ref{dheg}. \end{proof} By Proposition \ref{dheg}, a necessary condition for the set $\Delta h_1e_0\mathbf{g}^j$ to be non-empty is $\alpha (2+k)\le 1$, or $k=2^n-2$ for some non-negative integer $n$. Unfortunately, we do not know if it is sufficient. We state the following conjecture. \begin{conj}\label{delta-eg}The set $\Delta h_1e_0\mathbf{g}^j$ is non-empty if and only if $k=2^n-2$ for some non-negative integer $n$. \end{conj} \begin{thm}\label{thm:delta-eg}Suppose that $e_0\mathbf{g}^{2^n-1}$ and $\Delta h_1e_0\mathbf{g}^{2^n-2}$ are non-empty for every non-negative integer $n$. Then $\Delta h_1 e_0^t\mathbf{g}^k$ is non-empty if and only if $k = (\sum_{i=1}^{t} 2^{n_i}) - t -1$ for some non-negative integers $n_i$. \end{thm} \begin{proof}If $\Delta h_1 e_0^t\mathbf{g}^k$ is non-empty, then $\alpha (1+k+t)\le t$ or $k = (\sum_{i=1}^{t} 2^{n_i}) - t -1$ for some non-negative integers $n_i$. Conversely, if $k = (\sum_{i=1}^{t} 2^{n_i}) - t -1$ for some non-negative integers $n_i$, then $\Delta h_1 e_0^t\mathbf{g}^k$ contains the set $$\Delta h_1 e_0 \mathbf{g}^{2^{n_{i_1}}-2} e_0 \mathbf{g}^{2^{n_{i_2}}-1} \cdot \ldots e_0 \mathbf{g}^{2^{n_{i_t}}-1}$$ which is non-empty. \end{proof} \subsection{The wedge at filtrations $f=4k$ and $f=4k+1$ for $k\ge 2$} At filtrations $f=4k+2$ and $f=4k+3$ for $k\ge 2$, the wedge is known completely. At filtrations $f=4k$ and $f=4k+1$ for $k\ge 2$, the wedge remains not optimal. If Conjectures \ref{conj:eg} and \ref{delta-eg} are correct, we can completely solve the problem of optimizing the wedge mentioned at the beginning of section \ref{optimize}. The wedge contains the following elements and sets (the order is of increasing stems) at filtrations $f=4k$ for $k\ge 3$ $$\tau \cdot P^{k-3}d_0 e_0^2, \tau \cdot P^{k-3} e_0^3, \tau \cdot P^{k-4} e_0^{2} d_0^2, \tau \cdot P^{k-4} e_0^{3} d_0, \tau \cdot P^{k-4} e_0^{4}, \ldots, $$ $$\tau \cdot e_0^{k-2}d_0^2, \tau \cdot e_0^{k-1}d_0, e_0^k, \tau e_0^{k-1}\mathbf{g}, \ldots, \tau e_0 \mathbf{g}^{k-1}, \tau \mathbf{g}^k.$$ \begin{thm} Suppose that $e_0\mathbf{g}^{2^n-1}$ is non-empty for every non-negative integer $n$. Then at filtration $f=4k$ for $k\ge 2$ the set $\tau e_0^s \mathbf{g}^{k-s}$ contains an element divisible by $\tau$ if $s\ge \alpha(k)$ and does not contain any element divisible by $\tau$ if $s < \alpha (k)$. \end{thm} \begin{proof}If $s\ge \alpha(k)$, by Theorem \ref{eg} and Remark \ref{rem:eg} the set $e_0^s \mathbf{g}^{k-s}$ contains an element $x$. Then $\tau e_0^s \mathbf{g}^{k-s}$ contains the element $\tau \cdot x$ divisible by $\tau$. If $s< \alpha (k)$, we suppose that $\tau e_0^s \mathbf{g}^{k-s}$ contains an element $\tau \cdot y$ divisible by $\tau$. The element $\tau \cdot y$ maps to $\tau e_0^s g^{k-s}$ in Ext$_{\mathbf{A}(2)}$. Then $y$ maps to $e_0^s g^{k-s}$ in Ext$_{\mathbf{A}(2)}$. In other words, $y$ is an element of the set $e_0^s \mathbf{g}^{k-s}$. However, since $s< \alpha (k)$, the set $e_0^s \mathbf{g}^{k-s}$ is empty by Proposition \ref{prop:eg-empty}. \end{proof} The wedge contains the following elements and sets (the order is of increasing stems) at the filtration $f=4k+1$ for $k\ge 2$ $$\tau \cdot P^{k-2}\Delta h_1 e_0, \tau \cdot P^{k-3} d_0 \Delta h_1 d_0, \tau \cdot P^{k-3} d_0 \Delta h_1 e_0, \tau \cdot P^{k-3} \Delta h_1 e_0^2, \ldots $$ $$\tau \cdot d_0^2 \Delta h_1 e_0^{k-3}, \tau \cdot d_0 \Delta h_1 e_0^{k-2}, \tau \cdot \Delta h_1 e_0^{k-1}, \tau \Delta h_1 e_0^{k-2} \mathbf{g}, \ldots, \tau \Delta h_1 e_0 \mathbf{g}^{k-2}, \tau \Delta h_1 \mathbf{g}^{k-1}. $$ \begin{thm} Suppose that $e_0\mathbf{g}^{2^n-1}$ and $\Delta h_1e_0\mathbf{g}^{2^n-2}$ are non-empty for every non-negative integer $n$. Then at filtration $f=4k+1$ for $k\ge 2$ the set $\tau \Delta h_1 e_0^{s} \mathbf{g}^{k-s-1}$ contains an element divisible by $\tau$ if $s\ge \alpha(k)$ and does not contain any element divisible by $\tau$ if $s< \alpha(k)$. \end{thm} \begin{proof}If $s\ge \alpha(k)$, then by Theorem \ref{thm:delta-eg} the set $\Delta h_1 e_0^{s} \mathbf{g}^{k-s-1}$ contains an element $x$. Then $\tau \Delta h_1 e_0^{s} \mathbf{g}^{k-s-1}$ contains the element $\tau \cdot x$ divisible by $\tau$. If $s< \alpha(k)$, we suppose that $\tau \Delta h_1 e_0^{s} \mathbf{g}^{k-s-1}$ contains an element $\tau \cdot y$ divisible by $\tau$. The element $\tau \cdot y$ maps to $\tau \Delta h_1 e_0^s g^{k-s-1}$ in Ext$_{\mathbf{A}(2)}$. Then the element $y$ maps to $\Delta h_1 e_0^s g^{k-s-1}$ in Ext$_{\mathbf{A}(2)}$. In other words, $y$ is an element of the set $\Delta h_1 e_0^s \mathbf{g}^{k-s-1}$. However, since $s< \alpha (k)$, the set $\Delta h_1 e_0^s \mathbf{g}^{k-s-1}$ is empty by Proposition \ref{dheg}. \end{proof} \subsection{The wedge chart} This chart shows the wedge from its vertex to stem 70. \begin{itemize} \item All dots indicate copies of $\mathbb{M}_2$. \item Red dots indicate elements which behave irregularly, as in Propositions \ref{prop:eg-empty} and \ref{dheg}. \end{itemize} \begin{landscape} \newrgbcolor{cldotcolor}{0.5 0.5 0.5} \newrgbcolor{clhzerocolor}{0.5 0.5 0.5} \newrgbcolor{clhonecolor}{0.5 0.5 0.5} \newrgbcolor{clhtwocolor}{0.5 0.5 0.5} \newrgbcolor{Ctauhiddenhzerocolor}{0 0 1} \newrgbcolor{Ctauhiddenhonecolor}{0 0 1} \newrgbcolor{Ctauhiddenhtwocolor}{0 0 1} \newrgbcolor{taubottomcolor}{0.5 0.5 0.5} \newrgbcolor{tautopcolor}{1 0 0} \newrgbcolor{taubottomhidcolor}{0.2 0.8 0.2} \newrgbcolor{tautophidcolor}{1 0.6 0.2} \newrgbcolor{tauunknowncolor}{0.7 0.1 0.8} \newrgbcolor{tauzerocolor}{0.5 0.5 0.5} \newrgbcolor{tauonecolor}{1 0 0} \newrgbcolor{tautwocolor}{0.3 0.3 1} \newrgbcolor{tauthreecolor}{0 0.7 0} \newrgbcolor{taufourcolor}{0.7 0.1 0.8} \newrgbcolor{taufivecolor}{0.7 0.1 0.8} \newrgbcolor{tausixcolor}{0.7 0.1 0.8} \newrgbcolor{hzerotaucolor}{1 0 1} \newrgbcolor{hzeromoretaucolor}{1 0.5 0} \newrgbcolor{hzerotowercolor}{0.5 0.5 0.5} \newrgbcolor{honetaucolor}{1 0 1} \newrgbcolor{honemoretaucolor}{1 0.5 0} \newrgbcolor{honetowercolor}{1 0 0} \newrgbcolor{htwotaucolor}{1 0 1} \newrgbcolor{htwomoretaucolor}{1 0.5 0} \newrgbcolor{dtwocolor}{0 0.7 0.7} \newrgbcolor{dtwotaucolor}{1 0 1} \newrgbcolor{dtwomoretaucolor}{1 0.5 0} \newrgbcolor{dthreecolor}{1 0 0} \newrgbcolor{dfourcolor}{0.1 0.7 0.1} \newrgbcolor{dfivecolor}{0.2 0.2 0.7} \newrgbcolor{dsixcolor}{1 0.5 0} \newrgbcolor{dsevencolor}{1 0.5 0} \newrgbcolor{deightcolor}{1 0.5 0} \newrgbcolor{tauextncolor}{0 0.6 0} \newrgbcolor{twoextncolor}{0.7 0.7 0} \newrgbcolor{etaextncolor}{0.5 0 1} \newrgbcolor{nuextncolor}{0.6 0.3 0} \newgray{gridline}{0.8} \newgray{unknowncolor}{0.95} \newcommand{0.06}{0.06} \newcommand{0.05}{0.05} \newpsobject{tauextn}{psline}{linecolor=tauextncolor} \newpsobject{tauextncurve}{psbezier}{linecolor=tauextncolor} \newpsobject{twoextn}{psline}{linecolor=twoextncolor} \newpsobject{twoextncurve}{psbezier}{linecolor=twoextncolor} \newpsobject{etaextn}{psline}{linecolor=etaextncolor} \newpsobject{nuextn}{psline}{linecolor=nuextncolor} \newpsobject{nuextncurve}{psbezier}{linecolor=nuextncolor} \newpsobject{Ctautwoextncurve}{psbezier}{linecolor=Ctauhiddenhzerocolor} \newpsobject{Ctauetaextncurve}{psbezier}{linecolor=Ctauhiddenhonecolor} \newpsobject{Ctaunuextncurve}{psbezier}{linecolor=Ctauhiddenhtwocolor} \newcommand{\Delta}{\Delta} \newcommand{1ex}{1ex} \psset{unit=0.71cm} \psset{unit=0.65cm} \renewcommand{0.06}{0.1} \begin{figure} \begin{center} \begin{pspicture}(39,7)(70,25) \tiny \psgrid[unit=2,gridcolor=gridline,subgriddiv=0,gridlabelcolor=white](20,4)(35,12) \rput(40,7){40} \rput(42,7){42} \rput(44,7){44} \rput(46,7){46} \rput(48,7){48} \rput(50,7){50} \rput(52,7){52} \rput(54,7){54} \rput(56,7){56} \rput(58,7){58} \rput(60,7){60} \rput(62,7){62} \rput(64,7){64} \rput(66,7){66} \rput(68,7){68} \rput(70,7){70} \rput(-1,0){0} \rput(-1,2){2} \rput(-1,4){4} \rput(-1,6){6} \rput(39,8){8} \rput(39,10){10} \rput(39,12){12} \rput(39,14){14} \rput(39,16){16} \rput(39,18){18} \rput(39,20){20} \rput(39,22){22} \rput(39,24){24} \rput(-1,26){26} \rput(-1,28){28} \rput(-1,30){30} \rput(-1,32){32} \rput(-1,34){34} \rput(-1,36){36} \rput(-1,38){38} \rput(-1,40){40} \rput(-1,42){42} \rput(-1,44){44} \rput(-1,46){46} \rput(-1,48){48} \rput(-1,50){50} \rput(-1,52){52} \rput(-1,54){54} \rput(-1,56){56} \pscircle*[linecolor=tauonecolor](40.00,8){0.06} \uput{0.06}[-90](40.00,8){$\tau g^2$} \pscircle*[linecolor=tauzerocolor](42.00,9){0.06} \uput{0.06}[-90](42.00,9){$ \Delta h_1 e_0$} \pscircle*[linecolor=tauzerocolor](44.00,10){0.06} \uput{0.06}[-90](44.00,10){$d_0 r$} \pscircle*[linecolor=tauonecolor](45.00,9){0.06} \uput{0.06}[-90](45.00,9){$\tau \Delta h_1 g $} \pscircle*[linecolor=tauzerocolor](46.00,11){0.06} \uput{0.06}[150](46.00,11){$d_0 l$} \pscircle*[linecolor=tauzerocolor](47.00,10){0.06} \uput{0.06}[-90](47.00,10){$e_0 r$} \pscircle*[linecolor=tauzerocolor](48.00,12){0.06} \uput{0.06}[-90](48.00,12){$ d_0 e_0^2$} \pscircle*[linecolor=tauzerocolor](49.00,11){0.06} \uput{0.06}[150](49.00,11){$d_0 m$} \pscircle*[linecolor=tauzerocolor](50.00,10){0.06} \uput{0.06}[-90](50.00,10){$gr$} \pscircle*[linecolor=tauzerocolor](50.00,13){0.06} \uput{0.06}[-90](50.00,13){$ P \Delta h_1 e_0$} \pscircle*[linecolor=tauzerocolor](51.00,12){0.06} \uput{0.06}[-90](51.00,12){$ e_0^3$} \pscircle*[linecolor=tauzerocolor](52.00,11){0.06} \uput{0.06}[-90](52.00,11){$e_0 m$} \pscircle*[linecolor=tauzerocolor](52.00,14){0.06} \uput{0.06}[-90](52.00,14){$P d_0 r$} \pscircle*[linecolor=tauzerocolor](53.00,13){0.06} \uput{0.06}[-90](53.00,13){$\Delta h_1 d_0^2 $} \pscircle*[linecolor=tauzerocolor](54.00,12){0.06} \uput{0.06}[-90](54.00,12){$ e_0^2 g$} \pscircle*[linecolor=tauzerocolor](54.00,15){0.06} \uput{0.06}[150](54.00,15){$P d_0 l$} \pscircle*[linecolor=tauzerocolor](55.00,11){0.06} \uput{0.06}[-90](55.00,11){$gm$} \pscircle*[linecolor=tauzerocolor](55.00,14){0.06} \uput{0.06}[-90](55.00,14){$P e_0 r$} \pscircle*[linecolor=tauzerocolor](56.00,13){0.06} \uput{0.06}[-60](56.00,13){$ \Delta h_1 d_0 e_0$} \pscircle*[linecolor=tauzerocolor](56.00,16){0.06} \uput{0.06}[-90](56.00,16){$ P d_0 e_0^2$} \pscircle*[linecolor=tauonecolor](57.00,12){0.06} \uput{0.06}[-90](57.00,12){$\tau e_0 g^2$} \pscircle*[linecolor=tauzerocolor](57.00,15){0.06} \uput{0.06}[150](57.00,15){$P d_0 m$} \pscircle*[linecolor=tauzerocolor](58.00,14){0.06} \uput{0.06}[-90](58.00,14){$d_0^2 r$} \pscircle*[linecolor=tauzerocolor](58.00,17){0.06} \uput{0.06}[-90](58.00,17){$ P^2 \Delta h_1 e_0$} \pscircle*[linecolor=tauzerocolor](59.00,13){0.06} \uput{0.06}[-90](59.00,13){$ \Delta h_1 e_0^2$} \pscircle*[linecolor=tauzerocolor](59.00,16){0.06} \uput{0.06}[-90](59.00,16){$ P e_0^3$} \pscircle*[linecolor=tauonecolor](60.00,12){0.06} \uput{0.06}[-90](60.00,12){$\tau g^3$} \pscircle*[linecolor=tauzerocolor](60.00,15){0.06} \uput{0.06}[150](60.00,15){$P e_0 m$} \pscircle*[linecolor=tauzerocolor](60.00,18){0.06} \uput{0.06}[-90](60.00,18){$P^2 d_0 r$} \pscircle*[linecolor=tauzerocolor](61.00,14){0.06} \uput{0.06}[-90](61.00,14){$d_0 e_0 r$} \pscircle*[linecolor=tauzerocolor](61.00,17){0.06} \uput{0.06}[-90](61.00,17){$ P \Delta h_1 d_0^2 $} \pscircle*[linecolor=tauonecolor](62.00,13){0.06} \uput{0.06}[-90](62.00,13){$\tau \Delta h_1 e_0 g$} \pscircle*[linecolor=tauzerocolor](62.00,16){0.06} \uput{0.06}[-120](62.00,16){$ P e_0^2 g$} \pscircle*[linecolor=tauzerocolor](62.00,19){0.06} \uput{0.06}[150](62.00,19){$P^2 d_0 l$} \pscircle*[linecolor=tauzerocolor](63.00,15){0.06} \uput{0.06}[150](63.00,15){$d_0^2 m$} \pscircle*[linecolor=tauzerocolor](63.00,18){0.06} \uput{0.06}[-120](63.00,18){$P^2 e_0 r$} \pscircle*[linecolor=tauzerocolor](64.00,14){0.06} \uput{0.06}[90](64.00,14){$d_0 g r$} \pscircle*[linecolor=tauzerocolor](64.00,17){0.06} \uput{0.06}[-90](64.00,17){$ P \Delta h_1 d_0 e_0$} \pscircle*[linecolor=tauzerocolor](64.00,20){0.06} \uput{0.06}[-90](64.00,20){$ P^2 d_0 e_0^2$} \pscircle*[linecolor=tauonecolor](65.00,13){0.06} \uput{0.06}[90](65.00,13){$\tau \Delta h_1 g^2$} \pscircle*[linecolor=tauzerocolor](65.00,16){0.06} \uput{0.06}[-90](65.00,16){$ d_0^2 e_0g$} \pscircle*[linecolor=tauzerocolor](65.00,19){0.06} \uput{0.06}[150](65.00,19){$P^2 d_0 m$} \pscircle*[linecolor=tauzerocolor](66.00,15){0.06} \uput{0.06}[150](66.00,15){$d_0 e_0 m$} \pscircle*[linecolor=tauzerocolor](66.00,18){0.06} \uput{0.06}[-90](66.00,18){$P d_0^2 r$} \pscircle*[linecolor=tauzerocolor](66.00,21){0.06} \uput{0.06}[-90](66.00,21){$ P^3 \Delta h_1 e_0$} \pscircle*[linecolor=tauzerocolor](67.00,14){0.06} \uput{0.06}[90](67.00,14){$e_0 g r$} \pscircle*[linecolor=tauzerocolor](67.00,17){0.06} \uput{0.06}[-90](67.00,17){$ P \Delta h_1 e_0^2$} \pscircle*[linecolor=tauzerocolor](67.00,20){0.06} \uput{0.06}[-90](67.00,20){$ P^2 e_0^3$} \pscircle*[linecolor=tauzerocolor](68.00,16){0.06} \uput{0.06}[-90](68.00,16){$ e_0^4$} \pscircle*[linecolor=tauzerocolor](68.00,19){0.06} \uput{0.06}[150](68.00,19){$P^2 e_0 m$} \pscircle*[linecolor=tauzerocolor](68.00,22){0.06} \uput{0.06}[-90](68.00,22){$P^3 d_0 r$} \pscircle*[linecolor=tauzerocolor](69.00,15){0.06} \uput{0.06}[-90](69.00,15){$e_0^2 m$} \pscircle*[linecolor=tauzerocolor](69.00,18){0.06} \uput{0.06}[-90](69.00,18){$P d_0 e_0 r$} \pscircle*[linecolor=tauzerocolor](69.00,21){0.06} \uput{0.06}[-90](69.00,21){$ P^2 \Delta h_1 d_0^2$} \pscircle*[linecolor=tauzerocolor](70.00,14){0.06} \uput{0.06}[0](70.00,14){$m^2$} \pscircle*[linecolor=tauzerocolor](70.00,17){0.06} \uput{0.06}[-90](70.00,17){$ \Delta h_1 d_0^2 e_0 $} \pscircle*[linecolor=tauzerocolor](70.00,20){0.06} \uput{0.06}[-90](70.00,20){$ P^2 e_0^2 g$} \pscircle*[linecolor=tauzerocolor](70.00,23){0.06} \uput{0.06}[150](70.00,23){$P^3 d_0 l$} \end{pspicture} \end{center} \caption{The $\mathbb{C}$-motivic wedge through the 70-stem} \label{figure} \end{figure} \end{landscape}
\section{Introduction} Echo is a common phenomenon that occurs in a nonlinear system excited by a pair of delayed perturbation. Since Hahn reported the first observation of echo response in a nuclear spin system in 1950 \cite{echo_area_0}, echo phenomenon has been discovered in many other nonlinear systems, including cyclotron beams \cite{echo_area_1,echo_area_2}, plasma waves \cite{echo_area_3}, photon \cite{echo_area_4}, cold atoms \cite{echo_area_5,echo_area_6}, cavity QED \cite{echo_area_7}, and hadron colliders \cite{echo_area_8,echo_area_9}. The echo effects are demonstrated to have significant applications in magnetic resonance imaging (MRI) \cite{eei1}, 2D electronic \cite{eei2,eei3,eei4}, vibrational \cite{eei5,eei6,eei7}, and rotational spectroscopy \cite{align_echo_1,align_echo_2,align_echo_3,ddm,esd1}, and also the generation of short-wavelength radiation in free-electron lasers \cite{EEHG1,EEHG2,EEHG3}. Recently, a new type of echo, i.e., the molecular alignment echo, was introduced. Excited by two time-delayed short laser pulses, the echo response was first experimentally observed in CO$_2$ gas by measuring the laser-induced birefringence signal \cite{align_echo_1}. Later on, molecular echoes have also been observed in CH$_3$I \cite{align_echo_4} and OCS \cite{align_echo_5} molecules. Unlike the conventional molecular rotational revivals, the alignment echoes appear at the time delays of $\tau=NT$, where $T$ is the time delay between the two pump pulses, $N$ is a positive integer. The formation of these echoes can be theoretically explained as a consequence of the kick-induced filamentation of the rotational phase space \cite{align_echo_1,align_echo_2,align_echo_3}. In addition to the echoes at $\tau=NT$ (also called the full echoes), G. Karras \textit{et al}. also predicted some additional remarkable recurrences (which are referred to fractional echoes) at times that are rational fractions of the delay between the pump pulses \cite{align_echo_1,align_echo_2}. To observe the fractional echoes, it requires measurement of higher order moments of the molecular angular distribution, which however cannot be achieved in the birefringence measurement. Very recently, the lowest-order (1/2) fractional echo in molecules was optically detected by measuring the third harmonic of the probe pulse \cite{align_echo_2}. While Lin \textit{et al.} have also demonstrated the measurement of fractional molecular echoes (up to 1/3) with Coulomb explosion imaging (CEI) method \cite{align_echo_3}, a purely optical technique to probe high-order fractional molecular echoes is still lacking. High-order harmonic generation (HHG) is a highly non-linear phenomenon that occurs in laser-driven recollision process \cite{3s1,3s2}. The generated harmonic spectrum encodes abundant information of structure and dynamics of the target, which has been widely employed for the ultrafast detection in atom \cite{at1,at1_2,at3_2,at4_3,at4_4,at4_5}, molecules \cite{mo1,HOMO2,mo3,mo3_2,mo4,mo5,mo7,mo8,mo8_2,mo8_3} and solid \cite{so1,so2,so3,so3_2,so3_3,so4,so4_2,so4_2_0,so4_2_1,so4_2_2,so4_2_3,so4_3,so4_5}. In particular, HHG from the molecular ensembles intrinsically convolutes the molecular angular distribution \cite{mad1,mad2,mad3,mad3_2,mad4}, which therefore is expected to be a powerful candidate for the detection of high-order molecular echoes. In this work, we demonstrate the measurement of high-order fractional molecular echoes through HHG. Excited by a pair of time-delayed laser pulses, the full, 1/2, and 1/3 alignment echoes are observed in measured time-dependent HHG signals from CO$_2$ molecules. Higher-order fractional (reaching 1/4) echo is also observed in HHG from N$_2$O by increasing the time delay of the two pump pulses. The rotational dynamics of the echo response is further successfully retrieved from experimental results by using an analytic model based on the impulsive approximation. \section{Results and discussion} \begin{figure}[t] \includegraphics[width=\linewidth]{Fig1_experimentSetup_V03.png} \caption{\label{fig1} Experiment setup of harmonic generation from molecular ensemble excited by a pair of time-delayed laser pulses. } \label{fig:moving vs static} \end{figure} The experiment is conducted by using a Ti:sapphire laser system (Astrella-USP-1K, Coherent, Inc.), which delivers 35 fs, 800 nm laser pulses at a repetition rate of 1 kHz. The experiment setup is sketched in Fig. \ref{fig1}. The output laser pulses are divided into three optical paths to generate two pump pulses (P$_1$ and P$_2$) and one probe pulse. The three laser pulses are linear polarized and parallel to each other in our experiment. As shown in Fig. \ref{fig1}, the first pump laser pulse P$_1$ is applied at $t=0$ (the initial time throughout the paper), which leads to a transient alignment of molecular ensemble within a narrow cone. Afterwards the transient alignment vanishes due to the dispersion of molecular angular velocities. The second pump laser pulse (P$_2$) is applied at a delayed time $\Delta t$, resulting in another transient excitation. As reported in \cite{align_echo_1,align_echo_2,align_echo_3,align_echo_4,align_echo_5}, excited by these two pump pulses, the alignment echoes will be formed at certain time delays after P$_2$. To probe the following echo dynamics, an intense laser pulse is applied to interact with the excited molecules to generate high-order harmonics at various time delays (relative to P$_1$). These three incident laser pulses are focused into a 500$\mu m$ continuous gas valve by a lens (f=400 mm. The background gas pressure is 20 Torr and the rotational temperature at the focus is estimated to be 100K in terms of the procedure introduced in \cite{rt1,rt2}. The generated high harmonic spectrum is recorded by a home-made spectrometer consisting of a flat-field grating (1200 grave/mm), a multichannel-plate detector backed with a phosphor screen, and a charge coupled device (CCD) camera \cite{mad3}. \begin{figure*}[t] \centering \includegraphics[width=.8\linewidth]{Fig2_simVSexp_V17.png} \caption{\label{fig2} Measured time-dependent harmonic signals from the CO$_2$ molecules excited by pump P$_1$ and P$_2$ (blue squares with dashed line). For comparison, the results from the molecules excited by P$_1$ alone are also presented (red circles with dotted line). The dashed rectangles show the locations of the full, 1/2, and 1/3 echoes. Shaded areas represent the standard deviation of five independent measurements. Blue solid and black dashed lines are the simulated results with the optimized laser intensities of P$_1$ and P$_2$. } \label{fig:mechanism} \end{figure*} We first perform the experiment with CO$_2$ gases. In our experiment, the time delay between P$_1$ and P$_2$ is set to $\Delta t$=4.8 ps, and the laser energies of pump pulses P$_1$, P$_2$ and probe pulse are 143 $\mu$J, 52 $\mu$J and 560 $\mu$J, respectively. Figure \ref{fig2} presents the time-dependent harmonic signals of 25th harmonic (H25) generated from the excited molecules (the blue squares with dashed line). Here, the abscissa denotes the time delay $t$ between the probe pulse and the first pump pulse P$_1$, and the harmonic signals have been normalized by the results from the random molecules (i.e., no pump pulses). For comparison, the result from the molecules pumped by P$_1$ pulse alone is also presented as red circles with dashed line in Fig. \ref{fig2}. Excited by P$_1$ alone (i.e., a typical molecular alignment situation), the alignment events mainly occur at quarter rotational revivals, i.e., $\frac{1}{4}$T$_{rev}$, $\frac{1}{2}$T$_{rev}$, etc. (T$_{rev}\sim42.7 $ps is the revival period of CO$_2$). From Fig. \ref{fig2}, one can clearly see the alignment signal of the first quarter quantum revival at the time delay of 10.7 ps. While within the interval of two adjacent quarter revivals (like the delays of 6 ps-9.7 ps, which is between 0 and $\frac{1}{4}$T$_{rev}$), the molecular ensemble is nearly isotropic, therefore the harmonic signals exhibit no modulation. When P$_2$ is applied at $\Delta t=$4.8 ps, one can see significant modulations in the HHG signals at the time delays of 8.4 ps-9.6 ps, 7 ps-7.8 ps, and 6.5 ps-7 ps (indicated by dashed rectangles in Fig. \ref{fig2}), which just correspond to the appearance time of the full, 1/2, and 1/3 echoes, respectively. Similar results have also been observed in other harmonics and even a spectrally integrated signal. These results mean that the echo response has been recorded in the time-dependent HHG signals. Besides, compared to the typical alignment excited by P$_1$ alone, the HHG signal excited by both P$_1$ and P$_2$ is severely modulated and shows a more rapid oscillation at the quarter revival (10 ps-11.2 ps), indicating a significant influence of the pump pulse P$_2$ on the molecular rotational dynamics. Next, we demonstrate to extract the molecular rotational dynamics from the measured HHG signals. HHG from the rotational molecules is a convolution of the molecular angular distribution and the electronic response on the single-molecule level. Since the HHG process is much faster than the molecular rotation, molecular rotation during the probe pulse is usually neglected \cite{QRS1,QRS2}. The time-dependent harmonic signals from the rotational molecules can be given by coherent superposition of emission from the molecules aligned at different angles \cite{mad3,QRS1}, \begin{align} S(\alpha,t) = |\int_{\phi=0}^{2\pi}\int_{\theta=0}^{\pi}D_q(\theta)\rho(\theta,\phi,t)sin\theta d\theta d\phi|^2. \label{HHGsim} \end{align} Here, $D_q(\theta)$ is the angle-dependent induced dipole moment of $q$th harmonic on the single-molecule level. $\rho(\theta,\phi,t)$ is the transient molecular angular distribution, which is related to spatiotemporal evolution of molecular rotational wave packet. $\theta$ and $\phi$ are the polar and azimuthal angles of the molecular axis. Unlike the CEI approach that measures the time-dependent molecular distributions directly, the extraction of the molecular distributions from HHG signals requires a prior knowledge of the laser-induced dipole moment. To ensure the precision of the extraction, the single-molecule HHG process should be accurately described. In this work, we use the quantitative rescattering (QRS) theory \cite{QRS1,QRS2} to model the single-molecule HHG process. The accuracy and validity of QRS have been well established by comparing with the ``exact'' numerical solution of the time-dependent Schr\"{o}dinger equation (TDSE) and the experimental results \cite{QRSV1,QRSV2,QRSV3}. Within QRS theory, the laser-induced dipole moment for fixed-in-space molecule is given by $D_q(\theta)=N(\theta)^{\frac{1}{2}}W(q,\theta)d(q,\theta)$. Here, $N(\theta)$ is the alignment-dependent ionization rate, which is calculated by the molecular Ammosov-Delone-Krainov (MO-ADK) theory \cite{MOADK}. $W(q,\theta)$ is called the recolliding electron wave packet, which is obtained by solving the TDSE with a reference atom that has nearly the same ionization potential as the molecule \cite{QRS1}. The photorecombination transition dipole $d(q,\theta)$ is given by $d(\omega)=\langle \Psi_0|r|\Psi_f\rangle$, where $\Psi_0$ is the initial bound state and $\Psi_f$ is the final continuum state. In our simulation, $\Psi_0$ is obtained from the MOLPRO code \cite{QRSd1} within the valence complete-active-space self-consistent field method. The final state $\Psi_f$ is described in a single-channel approximation, which is given by $\Psi_f=A[\varPhi\phi_k]$. Here, $\varPhi$ is the correlated electron wavefunction of the parent ion, $\phi_k$ is the continuum electron wavefunction, and $A$ is the antisymmetrization operator. The target part $\varPhi$ is calculated by a valence complete-active-space configuration interaction wavefunction using the same bound states in the initial state. The continuum wavefunction $\phi_k$ is calculated by solving the Schr\"{o}dinger equation for the continuum electron with the iterative Schwinger variational method \cite{QRSd2}. In our simulation, the intensity of the probe pulse is estimated from the measured harmonic cutoff (the 31st harmonic), which is about 1.85$\times$10$^{14}$W/cm$^2$. According to Eq. \eqref{HHGsim}, the HHG signals depend on the angle dependence of the single-molecular dipole. We can deduce that a monotone angle-dependent single-molecule dipole (both amplitude and phase) with a large difference between 0$^\circ$ and 90$^\circ$ alignment would be more beneficial to the observation of the echo signals. In contrast, a flat angle dependence of the single-molecule dipole will be detrimental to the observation of the echoes. Considering the durations of the pump pulses are much shorter than the typical timescale of molecular rotation, we adopt the impulsive approximation and treat the pump pulses as $\delta$-pulse \cite{dp1}. Based on this assumption, the rotation wave function resulting from the interaction between pump P$_1$ and the initial molecular rotational state $\Psi_{JM}^0$ (the eigenstate $|JM\rangle $ of field-free rigid rotor described by the spherical harmonic $Y_J^M(\theta,\phi)$) can be written as, \begin{align} \Psi'_{JM}=e^{i\mathscr{P}_1cos^2\theta}\Psi_{JM}^0. \end{align} Here, $\mathscr{P}_1=\frac{1}{4}\Delta\alpha\int E_1(t)^2dt$ is the dimensionless strength of the first pump laser pulse P$_1$, $E_1(t)$ is the laser envelop of the pump pulse P$_1$. The propagation of the generated molecular rotational wave packet in time is then calculated by the spectral decomposition of the wave function \cite{dp1}: \begin{align} \Psi'_{JM}(\theta,\phi,t)=\mathop{\Sigma}_{J'}C'_{JM,J'M}e^{-i\frac{E_{J'}}{\hbar}t}Y_{J'}^{M}(\theta,\phi). \end{align} Here, $E_{J'}$ is the eigenenergy of the eigenstate $|J'M\rangle $. Note that, excited by the linearly polarized pump laser, the magnetic quantum number M is conserved during the rotational transition. When P$_2$ is applied at the delay $\Delta t$, a new rotational wave function $\Psi''_{JM}$ is generated, \begin{align} \Psi''_{JM}=e^{i\mathscr{P}_2cos^2\theta}\Psi'_{JM}(\theta,\phi,\Delta t). \end{align} Here, $\mathscr{P}_2=\frac{1}{4}\Delta\alpha\int E_2(t)^2dt$ is the dimensionless strength of the second pump laser pulse P$_2$, $E_2(t)$ is the laser envelop of the pump laser P$_2$. Similarly, the propagation of the new generated molecular rotational wave packet in time can be calculated as \begin{align} \Psi''_{JM}(\theta,\phi,t)=\mathop{\Sigma}_{J''M}C''_{JM,J''M}e^{-i\frac{E_{J''}}{\hbar}(t-\Delta t)}Y_{J''}^{M}(\theta,\phi). \end{align} The molecular angular distribution $\rho(\theta,\phi,t)$ is given by the weighted average of the modulus squares of the molecular rotational wave packet: \begin{align} \rho(\theta,\phi,t)=\mathop{\Sigma}_{JM}\Gamma_{JM}|\Psi''_{JM}(\theta,\phi,t)|^2. \end{align} Here, $\Gamma_{JM}$ is the statistic weight of initial rotational state $|JM\rangle $ according to the Boltzmann distribution. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{Fig3_wavePacketFor3echo_V12.png} \caption{\label{fig3} (a) The time-dependent angular distribution of molecular rotational wavepacket of CO$_2$ molecule simulated with the optimal intensities of P$_1$ and P$_2$ (I$_1$=4$\times10^{13}$W/cm$^2$ and I$_2$=1.5$\times10^{13}$W/cm$^2$). (b)-(c) Polar plots of the angular distributions of full echo at t=8.7 ps (in the left column) and t=9.2 ps (in the right column). (d)-(e) Same as (b)-(c), but for 1/2 echo at t=7.3 ps and t=7.6 ps. (f)-(g) Same as (b)-(c), but for 1/3 echo at t=6.6 ps and t=6.8 ps. } \label{fig:scalingLaw_CREI} \end{figure} \begin{figure*}[t] \centering \includegraphics[width=.8\linewidth]{Fig5_N2O_ExpVSSim_V12.png} \caption{\label{fig5} (a) Measured time-dependent harmonic signals (H25) from the N$_2$O molecules excited by pump P$_1$ and P$_2$ (blue squares with dashed line). For comparison, the results from the molecules excited by P$_1$ alone are also presented (red circles with dotted line). The dashed rectangles show the locations of the 1/3 and 1/4 echoes. Shaded areas represent the standard deviation of five independent measurements. Blue solid and black dashed lines are the simulated results with the optimized laser intensities of P$_1$ and P$_2$. (b) Same as (a), but for the results measured at the half quantum revival. } \label{fig:compareMass} \end{figure*} In our experiment, the intensities of the two pump pulses are not certain. Equations (1)-(6) build connection between the intensities of these two pump pulses and the harmonic signals. To retrieve the molecular rotational dynamics, we have performed simulations with different intensity combinations of the two pump pulses according to Eqs. (1)-(6). Note that, in order to produced strong echo signals, in our experiment and therefore the simulations, the intensity of P$_2$ is maintained smaller than P$_1$ \cite{align_echo_1,align_echo_2,align_echo_5}. The optimal intensity combination of P$_1$ and P$_2$ is I$_1$=4$\times10^{13}$W/cm$^2$ and I$_2$=1.5$\times10^{13}$W/cm$^2$, which is obtained by minimizing the squared difference between the simulated and measured harmonic signals. Using the optimal intensities of P$_1$ and P$_2$, we have calculated the time-dependent harmonic signals as presented in Fig. \ref{fig2} (blue solid and black dashed lines), which agree well with the experimental results. Here, it's worth mentioning that in our simulation only the highest occupied molecular orbital (HOMO) of CO$_2$ is considered. It has been reported that the multi-orbital contribution could play an important role in HHG from CO$_2$ \cite{HOMO2}. However, in our work (and also previous works \cite{QRS1,QRS2}), the HOMO of CO$_2$ alone can well reproduce the experimental results. The discrepancy between the two interpretations is likely due to the accuracy of photoionization cross section (PICS) used in the theory. In QRS, accurate transition dipoles from state-of-the-art molecular photoionization calculation were used \cite{QRS1,QRS2}. The PICS from these calculations have been found to be in good agreement with conventional photoionization experiment. We further investigate the echo dynamics by analyzing the spatiotemporal evolution of molecular rotational wave packet. Figure \ref{fig3} shows the time-dependent molecular angular distribution simulated with the optimal intensities of P$_1$ and P$_2$. One can see clear signatures of the full, 1/2, and 1/3 echoes at 8.7-9.2 ps, 7.3-7.6 ps, and 6.6-6.8 ps [indicated by the dashed lines in Fig. \ref{fig3}(a)], respectively. More clearly, we present the polar plots of the angular distributions of these echoes in Figs. \ref{fig3}(b)-\ref{fig3}(g). As shown in Figs. \ref{fig3}(b)-\ref{fig3}(c), the full echo exhibits a cigar-shaped angular distribution and transforms from alignment at t=8.7 ps [Fig. \ref{fig3}(b)] to anti-alignment at t=9.2 ps [Fig. \ref{fig3}(c)]. The 1/2 echo is demonstrated to have a cross-shaped distribution at t=7.3 ps [Fig. \ref{fig3}(d)] and then a butterfly structure at t=7.6 ps [Fig. \ref{fig3}(e)]. For 1/3 echo, it shows much more complex six-lobe structures at the alignment [t=6.6 ps in Fig. \ref{fig3}(f)] and anti-alignment [t=6.8 ps in Fig. \ref{fig3}(g)] moments. All these results are consistent with previous studies \cite{align_echo_3}. Besides, from Fig. \ref{fig3}(a), one can see that higher-order fractional molecular echoes experience a much rapid transition from alignment to anti-alignment. Such a rapid transition will be beneficial for the ultrashort-time measurement in molecules \cite{align_echo_2,ddm}. As shown in Fig. \ref{fig2}, the time space between the 1/2 and 1/3 echo is very narrow due to the small time delay between the pump pulses. In order to visualize higher-order fractional molecular echoes, one can increase the delay of the pump pulses. However, for CO$_2$, the interplay of quantum revival and echo phenomenon will show up when the delay of the pump pulses is further increased \cite{align_echo_2,align_echo_3}. Alternatively, we adopt the N$_2$O as the sample gas, which has a similar revival period (T$_{rev}$=39.9 ps) as CO$_2$. However, unlike CO$_2$, N$_2$O does not demonstrate quarter revivals due to its different symmetry, which therefore provides much longer time window for the observation of the higher-order fractional molecular echoes. Figure \ref{fig5}(a) presents the harmonic signals (blue squares with dashed line) measured from N$_2$O with the time delay between P$_1$ and P$_2$ set to $\Delta t=$12 ps. The results pumped by P$_1$ alone are also presented for comparison [red circles with dashed line in Fig. \ref{fig5}(a)]. One can see clear signature of 1/4 echo in the range from 14.3 ps to 15 ps [indicated by the dashed rectangle in Fig. \ref{fig5}(a)]. Similar results have also been observed in other harmonic orders, e.g., H23 and H27, etc. Moreover, we have also performed above-mentioned simulation process for N$_2$O and the results are presented in Fig. \ref{fig5}(a) (blue solid and black dashed lines), which are in good agreement with the experiment. Besides, the HHG signals at the half revival of N$_2$O have also been measured. As shown in Fig. \ref{fig5}(b), excited by both P$_1$ and P$_2$, the time-dependent HHG signals (blue squares with dashed line) present a reversed modulation compared to that by P$_1$ alone (red circles with dotted line). \section{Conclusion} In summary, we have realized an all-optical measurement of higher-order fractional molecular echoes by using HHG. The full, 1/2, and 1/3 echoes are observed by measuring the time-dependent HHG from CO$_2$ gases excited by a pair of time-delayed laser pulses. Using an analytic model based on the impulsive approximation, the spatiotemporal dynamics of the echo response are extracted, which agree well with the recent CEI measurement \cite{align_echo_3}. Moreover, the 1/4 echo is observed in HHG from N$_2$O molecules with a longer time delay of the pump pulses. Higher-order fractional molecular echoes are demonstrated to transform more rapidly, which can be extended to the ultrashort-time measurement of the dissipative and decoherence processes in molecules \cite{ddm,dp1_2} by using a mid-IR laser \cite{dp3} with high gas pressure \cite{dp2_2}. \section*{Funding} National Natural Science Foundation of China (No. 11704137, 11627809, 11874165, 11774109); National key research and development program (2017YFE0116600); Fundamental Research Funds for the Central Universities (2017KFXKJC002); Science and Technology Planning Project of Guangdong Province (2018B090944001); the Program for HUST Academic Frontier Youth Team. \section*{Disclosures} The authors declare no conflicts of interest.
\section{Introduction} \label{sec:intro} At its largest scales, the universe is a vast cosmic web of filamentary structure \citep[e.g.,][]{1996Natur.380..603B}. Simulations have shown that these filaments, while taking up less than 10\% of the volume of the universe hold ${\sim}40\%$ of the universe's mass \citep{2010MNRAS.408.2163A}. Although easily traced by the locations of galaxies \citep[e.g.,][]{1986ApJ...302L...1D}, the baryonic component of this web is primarily diffuse gas \citep[e.g.,][]{2001ApJ...552..473D}. Quantifying the conditions of this gas -- the distributions of temperature and density -- is needed to balance the universal baryon budget to ensure the accuracy of cosmological models \citep{2012ApJ...759...23S}. \begin{figure*} \begin{center} \includegraphics{position_of_qso.pdf} \end{center} \caption{Position of QSO 0102$-$2209\ relative to the cluster Abell 133. Smoothed X-ray emission from \citet{2013HEAD...1340101V} is shown in purple, while the solid and dashed circles trace $R_{500}$ and $R_{200}$, respectively. The position of the quasar is marked by the dotted circle just south of the $R_{500}$ radius. The extents of the \textit{Chandra} observations are shown for reference; the border of these observations is highlighted in red at the positions of the filaments identified by \citet{2013HEAD...1340101V}.}\label{fig:QSO_position} \end{figure*} Due to the low density of filamentary gas, detections of direct emission have often proven unsuccessful \citep[e.g.,][]{1995A&A...302L...9B}. Therefore, the dominant method for studying the gas contents of filaments \citep[e.g.,][]{2016MNRAS.457.4236B} is through absorption studies \citep[see review of this technique by][]{2017ASSL..434..291C}, which require chance superpositions of bright background sources. Enabled by the tremendous power of the \textit{Hubble Space Telescope} (HST), diffuse gas has been observed at scales of the circumgalactic medium (CGM) around individual galaxies \citep[see review by][]{2017ARA&A..55..389T} out to intercluster filaments \citep{2016MNRAS.455.2662T}. In particular, cool gas ($T \sim 10^4 - 10^5\ \textrm{K}$) is best traced through narrow neutral hydrogen (\ion{H}{1}) absorption \citep[e.g.,][]{2019MNRAS.484.2257Z}. \begin{figure*} \begin{center} \includegraphics{full_spectrum.pdf} \end{center} \caption{UV and optical spectrum of QSO 0102$-$2209\ from COS (purple) and MagE (maroon). Prominent emission features of the quasar are labeled, and regions of terrestrial contamination are shaded. For display purposes, both spectra have been smoothed and low signal-to-noise regions have been removed. As a reference, the wavelength scales as observed (top), in the rest-frame of the filament (upper bottom), and in the rest-frame of the quasar (lower bottom) are given.}\label{fig:full_spectrum} \end{figure*} Alternatively, at the nodes of filaments, the gas in groups and clusters of galaxies is easily observed and studied in X-ray emission \citep[e.g.,][]{2014ApJ...794...48C}. There have been some successes in pushing outward from clusters to see the X-ray emission from filaments, notably from merging clusters (e.g., \citealt{2008A&A...482L..29W}; merging increases the temperature and density of a filament, making it X-ray brighter), and around Abell 2744 \citep{2015Natur.528..105E}, which has extreme amounts of substructure \citep{2017MNRAS.467.2913S}. In an extremely deep observation of Abell 133 (2.4 Ms), \citet{2013HEAD...1340101V} reported seeing extended X-ray emission from filaments that extend beyond the cluster's virial radius, as shown in Figure \ref{fig:QSO_position}. A follow-up analysis and redshift survey by \citet{2018ApJ...867...25C} found that these structures are traced by the galaxy population and align with the locations of large-scale structure filaments. Included in that survey is a potentially interesting target: [VV98] J010250.2-220929\ (also known as XRS 0102$-$2209, hereafter QSO 0102$-$2209), which was identified by \citet{1998MNRAS.299.1047W} as an active galactic nucleus behind Abell 133. In archival observations with the {\it Galaxy Evolution Explorer} \citep{2007ApJS..173..682M} the quasar has an FUV brightness of $20.77 \pm 0.26$\ mag and an NUV brightness of $20.42 \pm 0.16$\ mag. QSO 0102$-$2209\ is projected along one of the filaments identified by \citet{2013HEAD...1340101V} and at ${\sim}1100\,\textrm{pkpc}$ ($0.7R_\textrm{vir}$) from the center of Abell 133, it is outside $R_{500}$, as is shown in Figure \ref{fig:QSO_position}. QSO 0102$-$2209\ therefore provides the perfect opportunity to obtain the first comprehensive baryonic census along a filament of the cosmic web. Previous works on quasar absorption associated with clusters have focused on the nearby Virgo \citep{2012ApJ...754...84Y} and Coma clusters \citep{2017ApJ...839..117Y}. These authors reported that cool gas traced by Ly$\alpha$ mostly avoids areas of X-ray emission around clusters. Likewise, \citet{2018MNRAS.475.2067B} found no warm gas (as traced by \ion{O}{6} absorption) within $\pm 2000\,\textrm{km}\,\textrm{s}^{-1}$ along three quasar sightlines intersecting five cluster systems from $\sim 0.2 - 2.5 R_{\rm Vir}$, but did see narrow Ly$\alpha$ absorption just outside $r_{500}$ of one of a pair of merging clusters. Further complicating this picture is the work of \citet{2017ApJ...846L...8M}, who observed three quasar sightlines covering $(1.6 - 4.7) r_{500}$ of three clusters and reported that Sunyaev--Zel'dovich effect-selected clusters were more rich in cool gas than X-ray detected clusters. In previous studies of cluster outskirts \citep{2019MNRAS.488.5327P} and filaments \citep{2016MNRAS.455.2662T}, \ion{H}{1} and metals have been seen with column densities of $\log(N_{\rm H\,I}/\textrm{cm}^{-2}){\sim}14$ and Doppler parameters $b{\sim}20\,\textrm{km}\,\textrm{s}^{-1}$, although with covering fractions of the order 0.2 \citep{2019MNRAS.490.4292B} to 1.0 \citep{2016MNRAS.455.2662T}, respectively. As almost all further work on this topic has been theoretical \citep{2015MNRAS.453.4051E,2019MNRAS.490.4292B}, observations of QSO 0102$-$2209\ provide new insights into the nature of warm and cool gas around clusters. In this Letter, we describe UV and optical spectroscopic observations of QSO 0102$-$2209\ to quantify the amount of absorbing gas in the X-ray identified filament. Our observations are described in Section \ref{sec:obs}, the results are given in Section \ref{sec:results}, and finally we discuss these results in the broader context in Section \ref{sec:discussion}. Based on \citet{2018ApJ...867...25C}, we adopt a redshift for Abell 133 of $z=0.05584$, and we assume a flat $\Lambda$CDM cosmology with $\Omega_M = 0.3$, and $\textrm{H}_0 = 70\ \textrm{km}\ \textrm{s}^{-1}\ \textrm{Mpc}^{-1}$. We follow the naming convention of \citet{2017ARA&A..55..389T} when referencing gas temperatures: cold ($T<10^4\,\textrm{K}$), cool ($10^4\,\textrm{K}<T<10^5\,\textrm{K}$), warm ($10^5\,\textrm{K}<T<10^6\,\textrm{K}$), and hot ($T>10^6\,\textrm{K}$). To contrast with the hot X-ray detected gas \citep{2013HEAD...1340101V}, we also adopt the term ``cooler gas'' to refer to all gas of temperature $\textrm{T}<10^{6}\,\textrm{K}$ potentially detected in absorption. \section{Observations} \label{sec:obs} \subsection{HST-COS} The quasar QSO 0102$-$2209\ was observed with the Cosmic Origins Spectrograph \citep[COS;][]{2012ApJ...744...60G} on \textit{HST}\ as part of program GO-15198 (PID: 15198, PI: Connor); the spectrum is shown in Figure \ref{fig:full_spectrum}. Observations were conducted over two visits: two orbits on 2018 December 21 and three orbits on 2018 December 29. We used the primary source aperture and the G140L grating with a central wavelength of 1105 \AA. This configuration provided a spectral resolving power $R \sim 1000$ with a dispersion of $80.3\ \textrm{m\AA}\ \textrm{pix}^{-1}$ and resulted in a broad UV wavelength coverage of ${\approx}1100 - 2200$ \AA. Although \ion{O}{6} cannot be observed at this redshift with COS, our spectrum included Ly$\alpha$ and prominent low-, intermediate-, and high-ionization metal absorption transitions at the cluster redshift, including \ion{C}{2} $\lambda1334$ \ion{Si}{2} $\lambda1260$, \ion{Si}{3} $\lambda1206$, and the \ion{Si}{4} $\lambda \lambda1393,1402$ doublet. The total integration time over the two visits was 13,094 s, which was divided into 10 individual exposures of roughly equal durations. During the second visit, the \textit{HST}\ Fine Guidance Sensors did not acquire the guide stars until approximately 45 minutes after the exposures were scheduled to start, and the early parts of these observations were therefore taken under gyro pointing control. A close examination of the data revealed that this incident had no significant impact on the data quality. Individual spectral images were initially processed using the automatic COS calibration pipeline, \textsc{Calcos}, which produced a series of data products including an extracted one-dimensional spectrum for each science exposure. These pipeline-calibrated data products were retrieved from the {\it HST} archive. The extracted one-dimensional spectra from individual exposures were co-added to form a single combined spectrum, using inverse variance weighting based on the mean variance of the data at $1230-1250$ \AA, chosen for a lack of strong absorption features. Finally, the combined spectrum was continuum normalized using a low-order polynomial fit to spectral regions free of strong absorption features. The final continuum-normalized spectrum has a typical signal-to-noise ratio of ${\rm S}/{\rm N} \approx 8-15$ per resolution element of ${\approx} 300$ \mbox{km\ s${^{-1}}$}\ at $\lambda \lesssim 1700$ \AA, where relevant absorption transitions are located. \subsection{MagE} We observed QSO 0102$-$2209\ with the $1\farcs0$ slit on the Magellan Echellette spectrograph \citep[MagE;][]{2008SPIE.7014E..54M} on 2017 June 18. MagE provides spectral coverage from ${\sim}3100$\ \AA\ to ${\sim} 1\ \mu\textrm{m}$ micron with a spectral resolving power $R=4100$. Weather conditions were clear and calm, with seeing in the range of $0\farcs8 - 1\farcs3$. We took nine 900 s exposures of QSO 0102$-$2209, and observed the standard star LTT 1020 for four 90 s exposures in the middle of our observations. To ensure accurate wavelength calibration, we took ThAr hollow cathode tube exposures bracketing each set of science observations. Observations were reduced with the MAGE Spectral Extractor \citep[MASE;][]{2009PASP..121.1409B}. MASE handles the reduction and calibration of point sources from bias subtraction to flux calibration, and can achieve wavelength accuracy to ${\sim}5\ \textrm{km}\ \textrm{s}^{-1}$ and relative flux calibration to ${\sim}10\%$ \citep{2009PASP..121.1409B}. As there were issues with flat-fielding the bluest five orders of our observations, we trim our MagE spectrum to only include data redward of 4000 \AA. Note that none of the optical features we are concerned about are lost by this trimming. The spectrum is shown in Figure \ref{fig:full_spectrum}. Using the ASERA toolkit \citep{2013A&C.....3...65Y} to identify the peaks of broad-line emission in \ion{Mg}{2} and H$\beta$, we compute a quasar redshift of $z = 0.7548$, a refinement from the value reported by \citeauthor{1998MNRAS.299.1047W} (\citeyear{1998MNRAS.299.1047W}; $z=0.766$). \section{Results} \label{sec:results} Analysis of the hot gas content of the filaments as revealed by X-ray observations will be presented in a future paper (Vikhlinin et al., in preparation); here, we summarize those results, as described by \citet{2013HEAD...1340101V}. The three filaments are fit by a gas with temperature $T_X\approx2.0\pm0.3\,\textrm{keV}$ (${\sim}2.3\pm 0.3\times10^{7}\,\textrm{K}$). Assuming the filamentary emission is fit by a $\beta$-model with $\beta=2/3$ and $r_c\approx500\ \textrm{kpc}$, the integrated column density is of the order $\log(N_\textrm{H} / \textrm{cm}^{-2}) \approx 20 - 21$ for a sightline passing through the center of the filament. To constrain the amount of cooler gas present in this sightline, we turn to our UV and optical spectra of the QSO. The QSO spectra described in Section 2 provide limiting constraints for the properties of cold, cool, and warm absorbing gas in the intervening filament, as traced by absorption of neutral hydrogen and ionized metal species expected from both photoionized and collisionally ionized warm gas. In the UV spectrum taken with COS, these species include neutral hydrogen \ion{H}{1}, low-ionization metals \ion{C}{2} and \ion{Si}{2}, intermediate-ionization metal \ion{Si}{3}, and highly ionized \ion{Si}{4}. In addition to the species probed by our COS observations, we also looked at \ion{Ca}{2} $\lambda\lambda3934,3969$ doublet in the optical MagE spectrum, which acts as an independent tracer of neutral hydrogen and dust \citep[e.g.,][]{2006MNRAS.367..211W}. \begin{figure*} \begin{center} \includegraphics{absorption_profiles_updated.pdf} \end{center} \caption{Continuum-normalized spectrum for different absorption transitions along QSO 0102$-$2209\ at $d=1090$ pkpc ($0.7R_\textrm{vir}$) from the center of Abell 133. The absorption transition is identified in the bottom right corner of each panel. Zero velocity marks the redshift of Abell 133 at $z=0.05584$. The $1\sigma$ error spectrum is included in purple above the zero-flux level. Contaminating features (Galactic \ion{C}{2} $\lambda1334$ and an unassociated intervening absorber) have been grayed out for clarity. We find no evidence of the presence of cooler gas within $\pm2500$ \mbox{km\ s${^{-1}}$}\ from the cluster redshift, with a sensitive $2\sigma$ column density upper limit of log(\,$N_\mathrm{H\,I} / \textrm{cm}^{-2})<13.7$ for neutral hydrogen \ion{H}{1} absorption. The $2\sigma$ upper limits on these absorption transitions are plotted in red curves for a single-component Voigt profile with $b=20$ \mbox{km\ s${^{-1}}$}.}\label{fig:COS_absorption_suite} \end{figure*} \begin{deluxetable}{llrr} \tablecaption{Constraints on Absorption Properties} \tablewidth{0pt} \tablehead{ \colhead{Species} & \colhead{Transition} & \colhead{$W_r$\tablenotemark{a}} & \colhead{$\log(N/\textrm{cm}^{-2})$\tablenotemark{b}} \\ \colhead{} & \colhead{(\AA)} & \colhead{(m\AA)} & \colhead{} } \startdata \ion{H}{1} & 1215 & \textless160 & \textless13.7 (13.5, 13.5) \\ \ion{C}{2} & 1334 & \textless238 & \textless14.4 (14.2, 14.1) \\ \ion{Ca}{2} & 3934 & \textless127 & \textless12.2 (12.2, 12.2) \\ \ion{Si}{2} & 1260 & \textless177 & \textless13.4 (13.2, 13.1) \\ \ion{Si}{3} & 1206 & \textless153 & \textless13.1 (12.9, 12.9) \\ \ion{Si}{4} & 1393 & \textless231 & \textless13.7 (13.5, 13.4) \enddata \label{tab:AbsResults} \tablenotetext{a}{All reported values are $2\sigma$ upper limits} \tablenotetext{b}{Converted from the upper limit on $W_r$ assuming a single-component profile with $b=20$ \mbox{km\ s${^{-1}}$}. Upper limits in parentheses assume $b=50$ and $100$ \mbox{km\ s${^{-1}}$}, respectively.} \end{deluxetable} We searched for absorption features in the spectra of the background QSO over a line-of-sight velocity interval of $\pm2500$ \mbox{km\ s${^{-1}}$}\ from the systemic redshift of Abell 133. This search window corresponds to approximately $\pm 3 \sigma_\mathrm{v}$, where $\sigma_\mathrm{v}$ is the observed line-of-sight velocity dispersion of Abell 133 \citep{2018ApJ...867...25C}, and is therefore sufficiently wide to include all absorption features which are likely to be physically associated with the galaxy cluster. As shown in Figure 3, we do not find evidence of a significant Ly$\alpha$ absorption within the search window. We place a sensitive $2\sigma$ rest-frame equivalent width upper limit on Ly$\alpha$ absorption of $W_\mathrm{r}(1215) <0.16$ \AA, integrated over a velocity range of $\pm 300$ \mbox{km\ s${^{-1}}$}\ from the cluster redshift and calculated using the $1\sigma$ error spectrum. The chosen integration window is twice the spectral FWHM of our COS data. This equivalent width limit corresponds to a column density upper limit of log(\,$N_\mathrm{H\,I} / \textrm{cm}^{-2})<13.7$ for a single-component Voigt profile with Doppler width of $b=20$ \mbox{km\ s${^{-1}}$}, which is typical of \ion{H}{1} absorbers in cluster environment \citep[e.g.,][]{2016MNRAS.455.2662T,2018MNRAS.475.2067B,2019MNRAS.488.5327P}. Likewise, we do not detect any significant absorption from low-, intermediate-, or high-ionization metals within the search window. We show the results of our absorption search in Table \ref{tab:AbsResults} and Figure \ref{fig:COS_absorption_suite}; in Table \ref{tab:AbsResults}, for every ionic species we present the upper limits on the rest-frame absorption equivalent widths $W_r$ and ionic column density $\log(N)$, calculated for the strongest available transition at the $2\sigma$ level and integrated over 600 $\textrm{km}\ \textrm{s}^{-1}$ windows centered at the redshift of Abell 133. In Table \ref{tab:AbsResults} we also provide column density upper limits for assumed Doppler parameters of $b = 50\ \textrm{and}\ 100$ \mbox{km\ s${^{-1}}$}. 20 \mbox{km\ s${^{-1}}$}\ is perhaps a lower limit on the velocity broadening based on the amount of turbulence expected at the cluster outskirts \citep[e.g.,][]{2017MNRAS.469.3641I}. In contrast, to produce a broadening of $b=100\,\textrm{km}\,\textrm{s}^{-1}$ from thermal motions, \ion{H}{1} would have a temperature of $6\times10^{5}\,\textrm{K}$. Due to the relatively low spectral resolution of the G140L grating on COS (compared to the G130M grating), our resolution element is only ${\sim}300\,\textrm{km}\,\textrm{s}^{-1}$, which means we cannot resolve any differences in intrinsic line width at these levels. Considering the results of prior studies \citep{2016MNRAS.455.2662T, 2019MNRAS.488.5327P}, we restrict our discussion to the results when we assume $b=20\,\textrm{km}\,\textrm{s}^{-1}$, but the exercise shown in Table \ref{tab:AbsResults} demonstrates that the upper limits on column densities would be slightly tightened if we assume a stronger contribution from turbulence broadening for a $\sim10^{4}\,\textrm{K}$ cool gas, or if we assume a warmer gas of a few$\times 10^{5}\,\textrm{K}$. \section{Discussion} \label{sec:discussion} As part of our observations of QSO 0102$-$2209\, we were unable to observe any evidence of cold, cool, or warm gas (hereafter ``cooler gas'') coincident with the hot gas reported by \citet{2013HEAD...1340101V}. We discuss two potential physical reasons for this lack of absorption features: the entirety of the cooler gas in the filament this close to the cluster has been heated or the distribution of cooler gas in the filament is nonuniform. Below, we discuss both options individually, as well as the contribution of CGM from infalling galaxies to the cosmic filaments. \begin{figure*} \begin{center} \includegraphics{cutout_image.pdf} \end{center} \caption{$i$-band image of the field around QSO 0102$-$2209\ from the DES \citep{2018ApJS..239...18A}. Dashed black circles denote impact parameters in multiples of 25 pkpc at the cluster redshift. Stars \citep[selected from morphology as described in][]{2018ApJS..239...18A} are indicated with purple circles, while galaxies are marked with maroon circles. Where available, redshifts from \citet{2018ApJ...867...25C} are shown to the right; for other galaxies brighter than $i < 21$, DES photometry is given. For reference, the larger black circle in Figure \ref{fig:QSO_position} has a radius of 100 pkpc.}\label{fig:DES_cutout} \end{figure*} \subsection{Fully Heated Filaments} \label{ssect:heated} The most obvious potential reason for our spectra not showing signs of absorption is that the filament is fully heated this close to the cluster, such that all gas at this location is now hot. Simulations by, e.g., \citet{2018MNRAS.476.4629P} have shown that the centers of clusters are lacking in cooler gas, which begins to be seen outside the virial radius. \citet{2015MNRAS.453.4051E} report a potential link between ongoing merging and observed warm gas absorption; as Abell 133 is relatively dynamically relaxed \citep{2018ApJ...867...25C}, cool clumps should have had time to reach thermal equilibrium. While presenting simulations of the cosmic web, \citet{2006MNRAS.370..656D} described a phenomenon of advancing accretion shocks, which caused temperatures to rise two orders of magnitude along filaments out to twice the virial radius. Behind these shocks, gas is isothermal. Similar shock heating along filaments has been reported in observations of bridges in early-stage cluster mergers \citep[e.g,.][]{2015PASJ...67...71K}. An accretion shock along the filamentary axis leaving isothermal hot gas in its wake would explain both the ability to observe the filaments in X-rays and the lack of Ly$\alpha$ absorption. Although not as tied to a particular phenomenon, a similar result is seen in recent simulations by \citet{2019MNRAS.490.4292B}. They describe filaments of warm gas visible just outside the virial radius, but which are rare near the cluster center. In similar simulation work, \citet{2015MNRAS.453.4051E} saw that low column density absorbers trace infalling filaments, but do not survive their first infall, and that the cooler gas mass fraction is less than a few percent within the cluster virial radius. The combined picture from all the works described here is that our sightline may be located too close to the cluster center, and that any gas that was warm further out along the filament may have already been heated by the intracluster medium. More broadly, simulations by \citet{2019MNRAS.486.3766M} show that the primary component of gas in filaments at $z=0$ is the warm-hot intergalactic medium (WHIM; $10^5\,\textrm{K}<T<10^7\,\textrm{K}$; \citealt{1999ApJ...514....1C}), which transitions to $T>10^7\,\textrm{K}$ gas closer to bound structures. As the baryon mass fraction in filaments cannot be completely recovered by X-ray emitting gas \citep{2015Natur.528..105E}, and as we set upper limits on most other diagnostics of cooler gas, we expect that there may still be a component of WHIM traced by \ion{O}{6} absorption, which is inaccessible to COS at this redshift. This aligns with other recent works (e.g., \citealt{2016MNRAS.455.2662T}; \citealt{2018Natur.558..406N}; but see also \citealt{2019ApJ...884L..31J}) \subsection{Nonuniform Distribution of Warm Gas} One important caveat with our analysis is that we can only probe one sightline through the filament. In the case that there is cooler gas that is not uniformly distributed, our nondetection of Ly$\alpha$ may be related more to the relative positions of Earth and QSO 0102$-$2209\ than to the overall conditions of filamentary gas. Simulations have long seen an increase in gas clumping at the outskirts of clusters \citep[e.g.,][]{2011ApJ...731L..10N}. Similarly, observational work by, e.g., \citet{2014MNRAS.439.1796W} has found that the gas at the outskirts of clusters is clumpy and multiphase. \citet{2014MNRAS.439.1796W} also connect the increasing clumpiness with the decreasing impact of nongravitational feedback, which will also hold in filaments. The conditions of the filaments reported by \citet{2013HEAD...1340101V} are similar to that of a galaxy group ($T_X \sim 2\ \textrm{keV}$), so we also consider two works related to gas in group environments. \citet{2017ApJ...844...23P} put forth an ``onion-skin'' model for ionization states of CGM, with the harsh group environment ionizing gas from the outside in. Assuming a similar effect is happening to cooler gas clumps, we would expect them to be relatively small this close to the cluster center. \citet{2019ApJS..240...15S} report that in groups warm gas is patchy and has a small covering fraction (less than 10\%). If we assume the cooler gas covering fraction is similar to that of the intracluster medium of Abell 133, we would expect it to be between that seen for the Virgo cluster (which is approximately half the mass of Abell 133) and the Coma cluster (approximately three times the mass of Abell 133). Inside the virial radius, \citet{2017ApJ...839..117Y} report covering fractions for $\log(N_{\rm H\,I} / \textrm{cm}^{-2})\geq13.8$ absorbers is ${0.25}_{-0.13}^{+0.24}$ and ${0.09}_{-0.05}^{+0.13}$ for Coma and Virgo, respectively. \vspace{1cm} \subsection{CGM of Filament Galaxies} We also use our one sightline to place limits on the amount of CGM that galaxies in filaments can retain. In clusters, works by \citet{2013ApJ...772L..29Y}, on the Virgo cluster, and \citet{2018MNRAS.475.2067B}, on X-ray selected clusters, have shown that the covering fraction of CGM for cluster galaxies is greatly reduced compared to field galaxies. To explain this phenomenon, previous observational work has shown evidence for preprocessing of galaxies along filaments (e.g., \citealt{2019MNRAS.484....2S} and references within), which theoretical works often attribute in some way to infalling galaxies losing their supply of gas \citep[e.g.,][]{2019OJAp....2E...6A}. These observations can provide evidence of this effect, as strict limits on absorbing gas are observed, if any filament-associated galaxies are near our sightline. We show the area around QSO 0102$-$2209\ using imaging from the Dark Energy Survey \citep[DES;][]{2018ApJS..239...18A} in Figure \ref{fig:DES_cutout}. Excluding both stars and galaxies with spectroscopic redshifts from \citet{2018ApJ...867...25C}, of which none are cluster members, only two other galaxies brighter than $m_i < 21$ remain within ${\sim}100\ \textrm{pkpc}$ at the cluster redshift. The first (labeled ``I'' in Figure \ref{fig:DES_cutout}) is too red to be at the redshift of Abell 133 \citep{2018ApJ...867...25C}. Galaxy ``J,'' however, has the photometry to be on the red sequence. With a distance modulus of $M-m\approx-37$, this galaxy would be ${\lesssim}0.1 L\textrm{*}$ \citep{2017ApJ...848...37C}; comparing this to work by \citet{2015MNRAS.449.3263J}, we would expect $\log(N_{\rm H\,I} / \textrm{cm}^{-2})\approx17$ for a similar field galaxy. If follow-up spectroscopy shows this galaxy is at the cluster redshift, the lack of observed absorption provides further confirmation that infalling galaxies are losing their CGM. This is the only potential cluster galaxy within 100 pkpc of QSO 0102$-$2209\ that is brighter than $m_i < 21$. This analysis is limited to only those galaxies near the sightline (beyond 100 pkpc, nondetections at the level presented here in this dense of an environment become uninteresting; e.g., \citealt{2013ApJ...772L..29Y}, \citealt{2019MNRAS.490.4292B}) and bright ($m_i=21$ is both roughly the limit of the redshift survey by \citealt{2018ApJ...867...25C} and, at ${\sim}0.005L\textrm{*}$, the limit studies of faint galaxies have explored; e.g., \citealt{2014ApJ...796..136B}). Relaxing either constraint reveals more cluster galaxies, which may be relevant for deeper studies of this sightline. Within 175 pkpc, there are at least four other cluster galaxies, based on the catalog of \citet{2018ApJ...867...25C}, including one with brightness $m_i=15.4$. Similarly, visible just to the west of QSO 0102$-$2209\ in Figure \ref{fig:DES_cutout} are a pair of faint galaxies; while the southern one is far too red to be a cluster member, the northern galaxy of the pair, with brightness $m_i=22.8$ and color $g-r=0.58$, is potentially a dwarf galaxy in the filament. Deeper UV observations are needed to draw meaningful insights into either population, however. \section{Summary} We present UV and optical observations of QSO 0102$-$2209, a quasar whose sightline intersects X-ray detected filaments around the galaxy cluster Abell 133. We find no evidence for cool gas ($T \leq 10^{5}\ \textrm{K}$, as traced by $\textrm{Ly}\ \alpha$), to limits of $\log(N_{\rm H\,I} / \textrm{cm}^{-2}) < 13.7$ (assuming $b=20\,\textrm{km}\,\textrm{s}^{-1}$), or of cold or warm gas to similar limits. With only one sightline, we avoid drawing any significant conclusions, but this lack of observed absorption may be indicative that cosmic filaments with observed hot gas lack cooler gas as they approach clusters. Further investigations will be needed to constrain this effect, which is important in balancing the baryon budget of the universe. In addition, despite the presence of a potential filament galaxy within ${\sim}30$\ pkpc, we do not observe any CGM. Abell 133 provides a unique opportunity to study the roles of filaments in galaxy evolution, to quantify the baryon budget, and to understand how clusters are tied to the cosmic web. Further UV observations of quasars around this cluster, deeper X-ray observations (particularly with next-generation X-ray observatories), and a complete redshift census of nearby galaxies will all contribute to developing our understanding of these three questions. \vspace{2mm} {\small T.Connor was supported by STScI/NASA award \textit{HST}-GO-15198. This Letter includes data gathered with the 6.5 m Magellan Telescopes located at Las Campanas Observatory, Chile. Based on observations made with the NASA/ESA {\it Hubble Space Telescope}, obtained at the Space Telescope Science Institute, which is operated by the Association of Universities for Research in Astronomy, Inc., under NASA contract NAS 5-26555. These observations are associated with program \#15198. Support for program \#15198 was provided by NASA through a grant from the Space Telescope Science Institute, which is operated by the Association of Universities for Research in Astronomy, Inc., under NASA contract NAS 5-26555.} \vspace{5mm} \facilities{HST (COS), Magellan:Baade (MagE), Blanco} \software{MASE \citep{2009PASP..121.1409B}, PyFITS \citep{1999ASPC..172..483B}, ASERA \citep{2013A&C.....3...65Y}}
\section{Introduction} A leaf $\mathcal{L}$ of a holomorphic foliation $\mathcal{F}$ by complex curves on a complex manifold $M$ is a Riemann surface. In general, $\mathcal{L}$ is non-compact, and its closure $\overline{\mathcal{L}}$ in $M$ does not correspond to a compact Riemann surface embedding in $M$. Given condition on $M$ and $\mathcal{F}$, an interesting question is: what is the topological type of the leaves of $\mathcal{F}$? For the case of orientable regular $\mathcal{C}^r$ differentiable foliation $\mathcal{F}$ of real dimension 2 with $r\geq3$ on compact manifolds $M$, a theorem of E. Ghys \cite{ghys1995topologie} proves that if $\mathcal{F}$ has no compact leaf, then almost every leaf has one of the following six topological types: a plane, a cylinder, a sphere without a Cantor set, a plane with infinitely many handles attached, a cylinder with infinitely many handles attached to both ends and a sphere minus a Cantor set with infinitely many handles attached to every end. In such case $\mathcal{F}$ has a compact leaf $C$ with finite holonomy group $\mathrm{Hol}(C,\mathcal{F})$, the local stability theorem of Reeb implies that there is a open neighborhood $U\subset M$ of $C$ saturated by $\mathcal{F}$ and each leaf in $U$ is a finite cover of $C$. In the holomorphic case, the foliations have singularities; this does not allow to extend the above results. However, Anosov conjectured that for a generic holomorphic foliation $\mathcal{F}$ on the complex projective plane $\mathbb{CP}^2$ all the leaves are disks, except for a countably set of leaves which are topological cylinders. This conjecture remains unsolved. In a recent work N. Sibony and E. F. Wold \cite{sibony2017topology} give conditions on holomorphic foliations $\mathcal{F}$ on complex compact surfaces $X$, which guarantees the existence of a non-trivial closed subset $Y$ of $X$ saturated by $\mathcal{F}$, such that every leaf in $Y$ is a disk. Our purpose is to give the topological type of the leaves for generic logarithmic foliations on $\mathbb{CP}^2$. The logarithmic foliation on complex surfaces lets invariant compact Riemann surfaces. Thus, we study when a foliation $\mathcal{F}$ by real surfaces let invariant a compact Riemann surface$\Sigma_g$ with only $n$ singular points $\{p_j\}_{j=1,\ldots,n}$ of $\mathcal{F}$, in particular, $\Sigma_{g,n}=\Sigma_g-\{p_j\}$ is a leaf of $\mathcal{F}$. We will prove the following statement. \begin{THM}\label{THM:ReebType} Let $\mathcal{F}$ be a singular $\mathcal{C}^r$ differential foliation of real dimension 2 on a manifold $M$ and $o\in\Sigma_{g,n}$ a regular point of $\mathcal{F}$, with $r\geq1$. If $\mathrm{Hol}(\Sigma_{g,n},\mathcal{F})$ is an infinite group, then for each $N\in\mathbb{N}$ there is an embedding \[ \varepsilon:B_{N,\delta}(\tilde{o})\rightarrow(\mathcal{L}_p,p), \] of the closed subset $B_{N,\delta}(\tilde{o})$ of the regular cover $\Sigma_{g,n}^H$ of $\Sigma_{g,n}$ corresponding to the normal subgroup $H=\ker(\mathrm{Hol}(\Sigma_{g,n},\mathcal{F}))$, and $\mathcal{L}_p$ is a leaf through a regular point $p\in \tau-{o}$, with $\tau$ the germ of transversal to $\mathcal{F}$ at $o$ to define $\mathrm{Hol}(\Sigma_{g,n},\mathcal{F})$. \end{THM} The subset $B_{N,\delta}(\tilde{o})$ is a finite cover of $\Sigma_{g,n}-\cup_j B_{\delta}(p_j)$ and carry on with some topology of $\Sigma_{g,n}^H$, with $B_{\delta}(p_j)$ open neighborhoods of $p_j$ in $\Sigma_g$ (see Definition \ref{def:graphball}). Moreover, if the regular cover has infinitely many handles attached then, the above result implies that the foliation has leaves with infinitely many handles attached. In this sense, another Known result given by Goncharuk and Kudryashov \cite{goncharuk2014genera}, which proved that for generic holomorphic foliations $\mathcal{F}$ on $\mathbb{CP}^2$ with a projective line invariant by $\mathcal{F}$ has leaves with $n$ handles attached, where $n$ is a number depending on the degree of the polynomial vector fields defining the foliation. In general, the holonomy group of an invariant compact Riemann surface by a logarithmic foliation on a complex surface is infinite, and the corresponding regular cover has infinitely many handles. This claim is proved in Section 4 and let us prove our main result. \begin{THM}\label{THM:LNMP2} Let $\mathcal{F}$ be a logarithmic foliations on $\mathbb{CP}^2$ defined by a closed logarithmic 1-form $\omega$ with polar divisor $D$. Suppose that $D$ is normal crossing and the ratios $\lambda_j/\lambda_i$ of the residues of $\omega$ are not negative real numbers. Then all leaves, except for finite set of leaves, are homeomorphic to one of the following real surfaces: \begin{itemize} \item[a)]The plane, in this case is biholomorphic to $\mathbb{C}$. \item[b)]The Loch Ness Monster,i.e., the real plane with infinitely many handles attached. \end{itemize} \end{THM} The proof of this theorem relies on the description of the following topological invariants of an open orientable real surface $\Sigma$ (see \cite{richards1963classification} for more details): \begin{itemize} \item[a)]The space of ends $\mathcal{E}(\Sigma)$, which is compact and totally disconnected. \item[b)]The genus, which is the number of handles attached on $\Sigma$. \end{itemize} We recall these concepts in Section 2 and use them to show that there is only eleven infinite regular covers of compact Riemann surfaces minus a finite set of points. Also, we show that each of these surfaces is realizable as a generic leaf of a Riccati foliation. Section 3 provides a detailed exposition of the proof of Theorem 1, and we give all the concepts related with it. In the Section 4, we will be interested with the description of the end space and genus of the leaves of generic logarithmic foliations to give the proof of Theorem 2. \textbf{Acknowledgements.} The author thanks Jorge Pereira, for fruitful discussions and corrections. Also, he thanks the Universidad Aut\'{o}noma de Aguascalientes and the CIMAT for their hospitality during the corresponding stays. \section{Regular covers of real surfaces} This section presents a description of regular covers of orientable bordered real surfaces, via Cayley graphs. In particular, we show that any of these regular covers with infinite deck transformation group is of one of the following eleven topological types: \begin{itemize}\label{list:11} \item[1)] the plane, \item[2)] the Loch Ness monster, i.e., the real plane with infinitely many handles attached, \item[3)] the cylinder, \item[4)] the Jacob's ladder, i.e., the cylinder with infinitely many handles attached to both directions, \item[5)] the Cantor tree, i.e., the sphere without a Cantor set, \item[6)] the blooming Cantor tree, i.e., the Cantor tree with infinitely many handles attached to each end, \item[7)] the plane without an infinite discrete set, \item[8)] the Loch Ness monster without an infinite discrete set, \item[9)] the Jacob's ladder without an infinite discrete set \item[10)] the Cantor tree without an infinite discrete set, \item[11)] the blooming Cantor tree without an infinite discrete set. \end{itemize} Although this result seems to be well-known, we could only find in the literature a proof for normal covers of compact Riemann surfaces \cite{goldman1967open}. We will see that each of these surfaces is realizable as the generic leaf of regular or singular foliations of real dimension two on compact manifolds. The properties and conclusions in this section support further development in this text. Let $\Sigma_{g,n}$ denote the orientable real surface $\Sigma_g$ of genus $g$ whit a set $\{p_j\}\subset\Sigma_g$ of $n$ points taken out. We recall that every compact orientable surface $\Sigma_g$, with $g>0$, is constructed from a polygon $P_{4g}$ with $4g$-sides by identifying pairs of edges. A couple of edges identified will be labeled by the letter $a$ if the direction for attaching correspond to the chosen orientation of $\partial P_{4g}$ or $a^{-1}$ if it is counter the orientation. We will think the surface $\Sigma_{g,n}$, with $g>0$ and $n\geq 0$, as a punctured polygon $P_{4g}^n\subset P_{4g}$ of $4g$ edges without $n$ points $\{p_1,\ldots,p_n\}$ of its interior and with boundary $a_{1}b_{1}a_{1}^{-1}b_{1}^{-1}\cdots a_{g}b_{g}a_{g}^{-1}b_{g}^{-1}$. Let $o\in \Sigma_{g,n}$ denote the vertices attached of $P_{4g}$. We can choose the generators of the fundamental group $\pi_1(\Sigma_{g,n},o)$ to be the homotopy class of \[\mathfrak{G}_{g,n}:=\{a_1,b_1,\ldots,a_g,b_g,c_1,\ldots,c_{n-1}\},\] where $a_j,b_k$ correspond to the edges of $P_{4g}^n$ and the curves $c_j$ ,with $j=1,\ldots,n$, are the boundaries $\partial B(p_j,\delta)$ for $0<\delta<<1$ such that the intersections $c_j\cap c_i$ and $c_j\cap\partial P_{4g}$ are empty for all $j$ and $j\neq i$. These generators of $\pi_1(\Sigma_{g,n},o)$ will be called \emph{canonical generators}. When $g=0$ we only consider the generators $c_j$. For every normal subgroup $H$ of $\pi_1(\Sigma_{g,n},o)$, there is a regular cover \[\rho_H:\Sigma_{g,n}^H\rightarrow\Sigma_{g,n}\] of $\Sigma_{g,n}$ such that the image $\rho_{H*}(\pi_1(\Sigma_{g,n}^H))$ is $H$ and its group of deck transformations $A_{g,n}^H$ is isomorphic to $\pi_1(\Sigma_{g,n},o)/H$ (see \cite[p.71]{hatcher2002algebraic} for more details). In particular, we have a epimorphism $\varrho_H:\pi_1(\Sigma_{g,n},o)\rightarrow A_{g,n}^H$ whose kernel is $H$. Remind that the Cayley graph $\mathrm{Cayley}(A_{g,n}^H,\mathfrak{G}_{g,n})$, of $A_{g,n}^H$ respect $\mathfrak{G}_{g,n}$ is the graph whose set of vertices $V$ is $A_{g,n}^H$ and its set of edges is \[\{(a,\gamma\cdot a)\in V\times V|\gamma\in \mathfrak{G}_{g,n}\}.\] In case some $\gamma\in\mathfrak{G}_{g,n}$ is in $H$ the edge $(a,\gamma\cdot a)$ is a loop. Fix a point $\tilde{o}$ in $\rho_{H}^{-1}(o)$ and $\mathit{id}$ denotes the identity element of $A_{g,n}^H$. We give an embedding of $\mathrm{Cayley}(A_{g,n}^H,\mathfrak{G}_{g,n})$ in $\Sigma_{g,n}^H$ as follows: \[\begin{array}{lll} \varepsilon:\mathrm{Cayley}(A_{g,n}^H,\mathfrak{G}_{g,n})&\rightarrow & \Sigma_{g,n}^H\\ \mathit{id} & \mapsto & \tilde{o} \\ a & \mapsto & a\tilde{o} \\ (a,\gamma a) & \mapsto & \tilde{\gamma}_{a\tilde{o}} \end{array}\] where $\tilde{\gamma}_{a\tilde{o}}$ is the lift of $\gamma\in\mathfrak{G}_{g,n}$ starting at $a\tilde{o}$ and end point $a_\gamma a\tilde{o}$, with $\varrho_{H}(\gamma)=a_\gamma$. From now on, $\mathrm{Cayley}(A_{g,n}^H)$ stands for the image of the embedding $\varepsilon$. We consider that the distance $d(\tilde{o},\tilde{o}')$ between two vertices of $\mathrm{Cayley}(A_{g,n}^H)$ is the length of the shortest $(\tilde{o},\tilde{o}')$-path, where the length of $(\tilde{o},\tilde{o}')$-path is the number of different edges which it contains. \begin{definition}\label{def:graphball} The ball $B_N(\tilde{o})$ of center $\tilde{o}$ and radius $N\in\mathbb{N}_{>0}$ in $\mathrm{Cayley}(A_{g,n}^H)$ is the collection of vertices of $\mathrm{Cayley}(A_{g,n}^H)$ at distance at most $N$ of $\tilde{o}$ and of paths of length less than $N$ starting at $\tilde{o}$. As $\Sigma_{g,n}=\Sigma_g-\{p_j\}_{j=1}^n$, we denote by $\Sigma_{g,n}(\delta)$ the compact surface, which is the complement of $\cup_{j=1}^n B(p_j,\delta)$ in $\Sigma_g$, and denote by $D_{g,n}(\delta)$ a fundamental domain of $\Sigma_{g,n}(\delta)$ such that $o\in D_{g,n}(\delta)$. Thus we define the $(N,\delta)$-ball $B_{N,\delta}(\tilde{o})\subset\Sigma_{g,n}^H$ as the closure of \[ \bigcup\limits_{\tilde{o}'\in B_N(\tilde{o})}\tilde{D}_{g,n}(\delta,\tilde{o}'),\] where $\tilde{D}_{g,n}(\delta,\tilde{o}')$ is the lift of $\tilde{D}_{g,n}(\delta)$ at $\tilde{o}'$. \end{definition} Now, we recall that the topological classification of noncompact real surfaces states that the invariants which decide the topological class of an orientable connected real surface $S$ are its \textit{end space} $\mathcal{E}(S)$, genus finite or infinite, and the elements of $\mathcal{E}(S)$ where the genus accumulates in the latest case (see for instance\cite{richards1963classification}). An end $e\in\mathcal{E}(S)$ is an equivalent class of a nested sequence $P_1\supset P_2\supset\cdots$ of open connected unbounded sets in $S$ satisfying the following conditions: (i) the boundary of $P_k$ in $S$ is compact for all $k$; (ii) the sequence $\{P_k\}$ does not have any common point. The genus of $S$ can be understood as the limit of the genus of a compact exhaustion $\{K_i\}$ of $S$ such that the boundary of each $K_i$ is a union of closed simple curves. We define the \emph{genus} $g(K_i)$ of $K_i$ as follows: \[g(K_i)=\frac{1}{2}(2-\chi(K_i)-r_i), \] where $\chi(K_i)$ is the Euler characteristic of $K_i$ and $r_i$ the number of boundary components of $K_i$ (see \cite{brahana21twodimensional}). Moreover, we will say that $e\in\mathcal{E}(S)$ accumulates genus if any sequence $\{P_k\}$ representing $e$, satisfies that the genus of $P_k$ is nonzero for all $k$. Otherwise, we say that $e$ is planar. Here $\mathcal{E}'(S)$ denotes the subset of ends which accumulates genus. The following results describe these invariants for $\Sigma_{g,n}^H$. \begin{lemma}\label{lm:planarends} Let $\Sigma_{g,n},\Sigma_{g,n}^H,H$ and $c_j\in\mathfrak{G}_{g,n}$ be as defined above, with $n>0$. If there exists an integer $m$ distinct from zero such that $c_j^m\in H$, then $\mathcal{E}(\Sigma_{g,n}^H)$ contains a subset of planar ends with discrete topology. Otherwise, if there is no $c_j$ with this property then $\mathcal{E}(\Sigma_{g,n}^H)$ is a single point. \end{lemma} \begin{proof} Let $\tilde{c_j}$ be the lift of $c_j$ in $\Sigma_{g,n}^H$ trough a point $\tilde{p}$ in $\rho_H^{-1}(p)$, whit $p\in c_j$. Assume that $c_j^m$ is in $H$, where $m=\mathrm{min}\{b\in\mathbb{Z}_{>0}|c_j^b\in H\}$. Therefore $\tilde{c_j}^m$ is a closed curve and a finite cover of $c_j$, which is the boundary of the pointed disk $\mathbb{D}_{j,\delta}=B(p_j,\delta)-\{p_j\}\subset\Sigma_{g,n}$. The connected component $\widetilde{\mathbb{D}_{j,\delta}}$ of $\rho_H^{-1}(\mathbb{D}_{j,\delta})$, whose boundary contains $\tilde{p}$, is a finite cover of $\mathbb{D}_{j,\delta}$. Choose a decreasing sequence $\{\delta_i\}$ of positive numbers, with $\delta_0=\delta$, which converges to zero. The lifts $\widetilde{\mathbb{D}_{j,\delta_i}}$ of $\mathbb{D}_{j,\delta_i}$ contained in $\widetilde{\mathbb{D}_{j,\delta}}$ define a planar end of $\Sigma_{g,n}^H$. Analogously, each connected component of $\rho_H^{-1}(\mathbb{D}_{j,d})$ defines a planar end. Moreover, these define a discrete set of planar ends of $\Sigma_{g,n}^H$. In the case that no cycle $c_{j}^{m}$ is in $H$, with $j\in\{1,\ldots,n\}$ and $m\in\mathbb{Z}-\{0\}$, we will prove that for any compact $K\subset\Sigma_{g,n}^H$, exists a compact $K'\supset K$ in $\Sigma_{g,n}^H$ such that $\Sigma_{g,n}^H-K'$ is connected. The latest affirmation implies that the end space $\mathcal{E}(\Sigma_{g,n}^H)$ is a single point. Choose $\delta,\tilde{o}\in\rho_{H}^{-1}(o)$, and $N\in\mathbb{N}_{>0}$ such that $K\cap \tilde{D}_{g,n}(\delta,\tilde{o})$ is non-empty and $\rho_H(K)\subset\Sigma_{g,n}(\delta)$ and $K\subset B_{N,\delta}(\tilde{o})$. By assumption, each connected component of $\rho^{-1}(c_j)$ is an unbounded curve, with $c_j=\partial B_{\delta/2}(p_j)$, and its intersection with $K'=B_{N,\delta}(\tilde{o})$ is empty. Thus, we can follow some unbounded components of $\rho^{-1}(c_j)$ to join any two points in $\Sigma_{g,n}^H-K'$, which is the desire conclusion. \end{proof} \begin{lemma}\label{lm:ends'} For any infinite regular cover $\Sigma_{g,n}^H$ the set $\mathcal{E}'(\Sigma_{g,n}^H)$ is one of the following sets: an empty set, a single point, two points or a cantor set. \end{lemma} \begin{proof} Let $J\subset\{1,\ldots,n\}$ such that $c_j$ satisfies that $c_j^{m_j}\in H$, where $m_j\in\mathbb{Z}_{>0}$ is defined as in the proof above. Plug the holes of $\Sigma_{g,n}^H$ surrounded by the connected components of $\rho_{H}^{-1}(c_j)$, with $j\in J$. This gives us a new surface $\Sigma_{g,n}^H(J)$ which contains $\Sigma_{g,n}^H$. Consider the subgroup $G$ of $A_{g,n}^H$ generated by $\varrho_{H}(\mathfrak{G}_{g,n}-\{c_j\}_{j\in J})$. If $J=\{1,...,n\}$, then the group $G$ acts properly discontinuous on $\Sigma_{g,n}^H(J)$, and it is cocompact. Thus, the end space of $\Sigma_{g,n}^H(J)$ coincides with the end space of $G$ (see for instance \cite{scott_wall_wall_1979}), which by the \cite[Theorem8.2.11]{loh2011geometric} and \cite[Theorem 15.2]{goldman1967open} can only be empty, a single point, two points or a Cantor set. In the case $J$ is a proper subset of $\{1,..., n\}$, Lemma \ref{lm:planarends} implies that the end set of $\Sigma_{g,n}^H(J)$ is a point. When $\mathcal{E}'(\Sigma_{g,n}^H(J))$ is non-empty, the group action of $G$ on $\Sigma_{g,n}^H(J)$ implies that $\mathcal{E}'(\Sigma_{g,n}^H(J))=\mathcal{E}(\Sigma_{g,n}^H(J))$. Thus, we have $\mathcal{E}'(\Sigma_{g,n}^H)=\mathcal{E}'(\Sigma_{g,n}^H(J))$, which completes the proof. \end{proof} The Riemann-Hurwitz formula gives the topological type of any finite regular cover $\Sigma_{g,n}^H$ of $\Sigma_{g,n}$. The Lemmas \ref{lm:planarends} and \ref{lm:ends'} well describe the invariants $\mathcal{E}(\Sigma_{g,n}^H)$ and $\mathcal{E}'(\Sigma_{g,n}^H)$, which imply the following result. \begin{theorem}\label{THM:covers} Let $\Sigma_{g,n}^H$ be an infinite regular cover of $\Sigma_{g,n}$. Then $\Sigma_{g,n}^H$ is homeomorphic to one of the 11 topological types given at the beginning of this section. \end{theorem} \begin{remark} An analogous theorem is valid for the nonorientable surfaces. Just it increases the list with the corresponding six open nonorientable surfaces. \end{remark} Now, we give some applications of these statements on foliation theory. Consider a compact $\mathcal{C}^r$ differential manifold $F$, with $r\geq1$, and the group representation \[\Phi:\pi_1(\Sigma_{g,n})\rightarrow\mathrm{Diff}^r(F),\] where $\mathrm{Diff}^r(F)$ is the group of $C^r$ diffeomorphisms of $F$. Let $\Sigma^{id}_{g,n}$ the universal cover of $\Sigma_{g,n}$ and $M$ the quotient space of $\Sigma^{id}_{g,n}\times F/\sim$, where the equivalence relation is $(x,y)\sim(h_\gamma(x),\Phi(\gamma)(y))$ and $h_\gamma\in A^{id}_{g,n}$. $M$ is the suspension of $\Phi$ and it comes with a projection $P_\Phi:M\rightarrow\Sigma_{g,n}$. The foliation with leaves $\Sigma^{id}_{g,n}\times\{y\}$ on $\Sigma^{id}_{g,n}\times F$ gives a new foliation $\mathcal{F}_{\Phi}$ on $M$, which leaves are covering spaces of $\Sigma_{g,n}$ and they are transversal at each point of each fiber $P_{\Phi}^{-1}(o)=F$, with $o\in\Sigma_{g,n}$ (\cite[Chapter V]{camacho1979teoria}, \cite[Section 3.1,Vol.I]{candel2003foliations}). Thus, we have the following statement: \begin{theorem} Let $F,\Phi,P_{\Phi}:M\rightarrow\Sigma_{g,n}\text{and}\quad\mathcal{F}_{\Phi}$ be as above. Assume the image of each canonical generator $\gamma\in\mathfrak{G}_{g,n}$ under the representation $\Phi$ is a diffeomorphism of $F$ whose set of fixed points is finite. Then, any leaf of $\mathcal{F}_{\Phi}$ outside of a countable set of leaves is homeomorphic to one of the 11 topological types given at the Theorem \ref{THM:covers}. \end{theorem} \begin{proof} Fix the fiber $F=P_{\Phi}^{-1}(o)$, with $o\in\Sigma_{g,n}$. Let $G=\Phi(\pi_1(\Sigma_{g,n}))$ be the image of the representation. The group G is known as the global holonomy of $\mathcal{F}_\Phi$. Take $p \in F$ and consider the leaf $\mathcal L_p$ of $\mathcal{F}_\Phi$ through $p$. It is a covering space of $\Sigma_{g,n}$, whose covering map is the restriction of $P_{\Phi}$ to $\mathcal{L}_p$. Note that the isotropy group $\mathrm{Iso}_G(p) = \{ g \in G | g(p) = p \}$ is a subgroup of $P_{\Phi\ast}(\pi_1(\mathcal{L}_p))$. Since $G$ is countable and any nontrivial element in $G$ has a finite set of fixed points, it follows that there exists a countable set $\mathcal{C} \subset F$ such that for every $p \in F - \mathcal{C}$ the group $\mathrm{Iso}_G(p)$ reduces to the identity. Thus any two leaves $\mathcal L_p$ and $\mathcal L_q$ with $p,q \in F- \mathcal{C}$ are regular covers of $\Sigma_{g,k}$ with isomorphic groups of covering transformations. It follows that $\mathcal L_p$ and $\mathcal L_q$ are homeomorphic. Since $P_{\Phi\ast}(\pi_1(\mathcal{L}_p))=P_{\Phi\ast}(\pi_1(\mathcal{L}_q))=\mathrm{ker}\Phi$, Theorem \ref{THM:covers} shows that these leaves are homeomorphic to one of the real surfaces of the list in this theorem. \end{proof} We call \textit{Riccati} an holomorphic foliation $\mathcal{F}$ of complex dimension 1 on a compact connected complex surface if there exists a rational fibration $P:M\rightarrow\Sigma_g$, whose generic fiber is transversal to $\mathcal{F}$ and biholomorphic to $\mathbb{CP}^1$. Possibly the fibration has singular fibers, but these belong to a finite set $\{P^{-1}(p_j)\}_{j=1}^n$ of $\mathcal{F}$-invariant fibers, $\Sigma_g-\{p_j\}_{j=1}^{n}=\Sigma_{g,n}$. The restriction $\mathcal{F}|_{M*}$, with $M*=M-\cup_{j=1}^{n}P^{-1}(p_j)$, is a foliation obtained by suspending the global holonomy $\Phi_{\mathcal{F}}$ of $\mathcal{F}$ \[ \Phi_{\mathcal{F}}:\pi_1(\Sigma_{g,n})\rightarrow\mathrm{PSL}(2,\mathbb{C}), \] (see for instance \cite{gomez1989holomorphic}). As any biholomorphism in $\Phi_{\mathcal{F}}(\pi_1(\Sigma_{g,n}))$ has at most two fixed points, the Theorem\ref{THM:covers} implies the following result: \begin{corollary}\label{crl:Riccati} Let $\mathcal{F}$ be a Riccati foliation on compact complex surface $M$. Then any leaf of $\mathcal{F}$ outside of a countable set of leaves is homeomorphic to one of the 11 topological types given at the Theorem \ref{THM:covers}. \end{corollary} \begin{example}\label{exp:BCT} For each $x\in\mathbb C$, let $\Gamma_x$ be the subgroup of $\mathrm{PSL}(2,\mathbb C)$ generated by \[ e_1=\begin{pmatrix} 1 & x \\ 0 & 1 \end{pmatrix},\quad\quad e_2=\begin{pmatrix} 1 & 0 \\ x & 1 \end{pmatrix}.\] If $|x|\geq2$, the ping-pong lemma (\cite[Theorem 4.3.1]{loh2011geometric}) implies that the subgroup $\Gamma_x$ is free of rank two. Consider the suspension of the homomorphism \[\begin{array}{llll} \Phi:&\pi_1(\Sigma_3,o)&\rightarrow & \mathrm{PSL}(2,\mathbb C)\\ & a_1 & \mapsto & e_1\\ & a_2 & \mapsto & e_2 \\ & a_3,b_j & \mapsto & \mathit{id}, \end{array}\] where $\{a_j,b_j\}_{j=1}^3=\mathfrak{G}_{3,0}$. This suspension gives a nonsingular Riccati foliation $\mathcal{F}$ on a compact complex surface $M$ with adapted fibration $P_\Phi:M\rightarrow \Sigma_3$. The generic leaf $\mathcal{L}$ of $\mathcal{F}$ is a regular cover of $\Sigma_{3}$ with its group of deck transformation isomorphic to $\Gamma_x$. In particular, $\Sigma^{H}_3\cong\mathcal{L}$ whit $H$ being the kernel of $\Phi$. From \cite[Theorem8.2.14]{loh2011geometric}, we conclude that $\mathcal{E}(\Gamma_x)$ is a infinite set. Thus, $\mathcal{E}(\mathcal{L})$ is a Cantor set. The figure below shows the closure of the union of the lifts $\tilde{D}_{3}(\tilde{o}')$ of the fundamental domain $D_3$ of $\Sigma_3$ at each vertex in the ball $B_4(\tilde{o})\subset\mathcal{L}$. This closed surface has nontrivial genus, then $\mathcal{E}'(\mathcal{L})$ is a Cantor set. It follows that $\mathcal{L}$ is homeomorphic to the blooming Cantor tree. \begin{tikzpicture}[scale=.75] \foreach \x in {2,13} \foreach \y in {-1,4.5} { \draw[white] (\x,\y) circle (1pt); } \draw[black] (8,2.14) circle (1pt); \draw (8,2.4) node {$\tilde{o}$}; \foreach \x in {8.2} \foreach \y in {2.7} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.02,\y-.2) .. (\x+.1,\y-.4) .. controls (\x+.2,\y-.5) and (\x+.4,\y-.52) .. (\x+.5,\y-.5); } \foreach \x in {7.8} \foreach \y in {2.7} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.02,\y-.2) .. (\x-.1,\y-.4) .. controls (\x-.2,\y-.5) and (\x-.4,\y-.52) .. (\x-.5,\y-.5); } \foreach \x in {8.2} \foreach \y in {1.3} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.02,\y+.2) .. (\x+.1,\y+.4) .. controls (\x+.2,\y+.5) and (\x+.4,\y+.52) .. (\x+.5,\y+.5); } \foreach \x in {7.8} \foreach \y in {1.3} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.02,\y+.2) .. (\x-.1,\y+.4) .. controls (\x-.2,\y+.5) and (\x-.4,\y+.52) .. (\x-.5,\y+.5); } \draw (7.8,2) arc (135:45:.28); \draw (7.7,2.075) arc (225:315:.4); \draw (8.95,2) arc (135:45:.14); \draw (8.9,2.05) arc (225:315:.2); \draw (6.85,2) arc (135:45:.14); \draw (6.8,2.05) arc (225:315:.2); \draw (7.9,3.1) arc (135:45:.14); \draw (7.85,3.15) arc (225:315:.2); \draw (7.9,0.9) arc (135:45:.14); \draw (7.85,0.95) arc (225:315:.2); \foreach \x in {8.4} \foreach \y in {2.9} { \draw[line width=0.5pt] (\x,\y) .. controls (\x,\y+.1) .. (\x-.1,\y+.13) .. controls (\x-.2,\y+.1) and (\x-.22,\y-.02) .. (\x-.2,\y-.2); } \foreach \x in {7.6} \foreach \y in {1.1} { \draw[line width=0.5pt] (\x,\y) .. controls (\x,\y-.1) .. (\x+.1,\y-.13) .. controls (\x+.2,\y-.1) and (\x+.22,\y+.02) .. (\x+.2,\y+.2); } \foreach \x in {7.6} \foreach \y in {2.9} { \draw[line width=0.5pt] (\x,\y) .. controls (\x,\y+.1) .. (\x+.1,\y+.13) .. controls (\x+.2,\y+.1) and (\x+.22,\y-.02) .. (\x+.2,\y-.2); } \foreach \x in {8.4} \foreach \y in {1.1} { \draw[line width=0.5pt] (\x,\y) .. controls (\x,\y-.1) .. (\x-.1,\y-.13) .. controls (\x-.2,\y-.1) and (\x-.22,\y+.02) .. (\x-.2,\y+.2); } \foreach \x in {8.9} \foreach \y in {2.4} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y) .. (\x+.13,\y-.1) .. controls (\x+.1,\y-.2) and (\x-.02,\y-.22) .. (\x-.2,\y-.2); } \foreach \x in {8.9} \foreach \y in {1.6} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y) .. (\x+.13,\y+.1) .. controls (\x+.1,\y+.2) and (\x-.02,\y+.22) .. (\x-.2,\y+.2); } \foreach \x in {7.1} \foreach \y in {1.6} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y) .. (\x-.13,\y+.1) .. controls (\x-.1,\y+.2) and (\x+.02,\y+.22) .. (\x+.2,\y+.2); } \foreach \x in {7.1} \foreach \y in {2.4} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y) .. (\x-.13,\y-.1) .. controls (\x-.1,\y-.2) and (\x+.02,\y-.22) .. (\x+.2,\y-.2); } \foreach \x in {6.5} \foreach \y in {2.4} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.13,\y-.02) and (\x+.2,\y-.13) .. (\x+.15,\y-.26) .. controls (\x+.03,\y-.3) and (\x-.12,\y-.33) .. (\x-.1,\y-.1); } \foreach \x in {7.7} \foreach \y in {3.6} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.13,\y-.02) and (\x+.2,\y-.13) .. (\x+.15,\y-.26) .. controls (\x+.03,\y-.3) and (\x-.12,\y-.33) .. (\x-.1,\y-.1); } \foreach \x in {8.3} \foreach \y in {3.6} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.13,\y-.02) and (\x-.2,\y-.13) .. (\x-.15,\y-.26) .. controls (\x-.03,\y-.3) and (\x+.12,\y-.33) .. (\x+.1,\y-.1); } \foreach \x in {9.5} \foreach \y in {2.4} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.13,\y-.02) and (\x-.2,\y-.13) .. (\x-.15,\y-.26) .. controls (\x-.03,\y-.3) and (\x+.12,\y-.33) .. (\x+.1,\y-.1); } \foreach \x in {9.5} \foreach \y in {1.6} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.13,\y+.02) and (\x-.2,\y+.13) .. (\x-.15,\y+.26) .. controls (\x-.03,\y+.3) and (\x+.12,\y+.33) .. (\x+.1,\y+.1); } \foreach \x in {8.3} \foreach \y in {0.4} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.13,\y+.02) and (\x-.2,\y+.13) .. (\x-.15,\y+.26) .. controls (\x-.03,\y+.3) and (\x+.12,\y+.33) .. (\x+.1,\y+.1); } \foreach \x in {7.7} \foreach \y in {0.4} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.13,\y+.02) and (\x+.2,\y+.13) .. (\x+.15,\y+.26) .. controls (\x+.03,\y+.3) and (\x-.12,\y+.33) .. (\x-.1,\y+.1); } \foreach \x in {6.5} \foreach \y in {1.6} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.13,\y+.02) and (\x+.2,\y+.13) .. (\x+.15,\y+.26) .. controls (\x+.03,\y+.3) and (\x-.12,\y+.33) .. (\x-.1,\y+.1); } \draw (8.95,2) arc (135:45:.14); \draw (8.9,2.05) arc (225:315:.2); \draw (9.625,2) arc (135:45:.07); \draw (9.6,2.025) arc (225:315:.1); \draw (9.125,1.5) arc (135:45:.07); \draw (9.1,1.525) arc (225:315:.1); \draw (9.125,2.5) arc (135:45:.07); \draw (9.1,2.525) arc (225:315:.1); \draw (8.425,3.2) arc (135:45:.07); \draw (8.4,3.225) arc (225:315:.1); \draw (7.925,3.7) arc (135:45:.07); \draw (7.9,3.725) arc (225:315:.1); \draw (7.425,3.2) arc (135:45:.07); \draw (7.4,3.225) arc (225:315:.1); \draw (6.725,2.5) arc (135:45:.07); \draw (6.7,2.525) arc (225:315:.1); \draw (6.225,2) arc (135:45:.07); \draw (6.2,2.025) arc (225:315:.1); \draw (6.725,1.5) arc (135:45:.07); \draw (6.7,1.525) arc (225:315:.1); \draw (7.425,0.8) arc (135:45:.07); \draw (7.4,0.825) arc (225:315:.1); \draw (7.925,0.3) arc (135:45:.07); \draw (7.9,0.325) arc (225:315:.1); \draw (8.425,0.8) arc (135:45:.07); \draw (8.4,0.825) arc (225:315:.1); \foreach \x in {7.1} \foreach \y in {2.6} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y-.04) .. (\x-.2,\y-.03) .. controls (\x-.23,\y) and (\x-.21,\y+.1) .. (\x-.2,\y+.2); } \foreach \x in {6.5} \foreach \y in {2.6} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y-.04) .. (\x+.2,\y-.03) .. controls (\x+.23,\y) and (\x+.21,\y+.1) .. (\x+.2,\y+.2); } \foreach \x in {7.2} \foreach \y in {0.9} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y-.04) .. (\x+.2,\y-.03) .. controls (\x+.23,\y) and (\x+.21,\y+.1) .. (\x+.2,\y+.2); } \foreach \x in {6} \foreach \y in {2.1} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y-.04) .. (\x+.2,\y-.03) .. controls (\x+.23,\y) and (\x+.21,\y+.1) .. (\x+.2,\y+.2); } \foreach \x in {7.2} \foreach \y in {3.3} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y-.04) .. (\x+.2,\y-.03) .. controls (\x+.23,\y) and (\x+.21,\y+.1) .. (\x+.2,\y+.2); } \foreach \x in {7.7} \foreach \y in {3.8} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y-.04) .. (\x+.2,\y-.03) .. controls (\x+.23,\y) and (\x+.21,\y+.1) .. (\x+.2,\y+.2); } \foreach \x in {7.7} \foreach \y in {3.8} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y-.04) .. (\x+.2,\y-.03) .. controls (\x+.23,\y) and (\x+.21,\y+.1) .. (\x+.2,\y+.2); } \foreach \x in {8.9} \foreach \y in {2.6} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y-.04) .. (\x+.2,\y-.03) .. controls (\x+.23,\y) and (\x+.21,\y+.1) .. (\x+.2,\y+.2); } \foreach \x in {6} \foreach \y in {1.9} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y+.04) .. (\x+.2,\y+.03) .. controls (\x+.23,\y) and (\x+.21,\y-.1) .. (\x+.2,\y-.2); } \foreach \x in {6.5} \foreach \y in {1.4} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y+.04) .. (\x+.2,\y+.03) .. controls (\x+.23,\y) and (\x+.21,\y-.1) .. (\x+.2,\y-.2); } \foreach \x in {7.2} \foreach \y in {.7} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y+.04) .. (\x+.2,\y+.03) .. controls (\x+.23,\y) and (\x+.21,\y-.1) .. (\x+.2,\y-.2); } \foreach \x in {7.7} \foreach \y in {.2} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y+.04) .. (\x+.2,\y+.03) .. controls (\x+.23,\y) and (\x+.21,\y-.1) .. (\x+.2,\y-.2); } \foreach \x in {8.9} \foreach \y in {1.4} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y+.04) .. (\x+.2,\y+.03) .. controls (\x+.23,\y) and (\x+.21,\y-.1) .. (\x+.2,\y-.2); } \foreach \x in {7.2} \foreach \y in {3.1} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.1,\y+.04) .. (\x+.2,\y+.03) .. controls (\x+.23,\y) and (\x+.21,\y-.1) .. (\x+.2,\y-.2); } \foreach \x in {8.3} \foreach \y in {3.8} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y-.04) .. (\x-.2,\y-.03) .. controls (\x-.23,\y) and (\x-.21,\y+.1) .. (\x-.2,\y+.2); } \foreach \x in {8.8} \foreach \y in {3.3} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y-.04) .. (\x-.2,\y-.03) .. controls (\x-.23,\y) and (\x-.21,\y+.1) .. (\x-.2,\y+.2); } \foreach \x in {9.5} \foreach \y in {2.6} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y-.04) .. (\x-.2,\y-.03) .. controls (\x-.23,\y) and (\x-.21,\y+.1) .. (\x-.2,\y+.2); } \foreach \x in {10} \foreach \y in {2.1} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y-.04) .. (\x-.2,\y-.03) .. controls (\x-.23,\y) and (\x-.21,\y+.1) .. (\x-.2,\y+.2); } \foreach \x in {8.8} \foreach \y in {0.9} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y-.04) .. (\x-.2,\y-.03) .. controls (\x-.23,\y) and (\x-.21,\y+.1) .. (\x-.2,\y+.2); } \foreach \x in {8.8} \foreach \y in {3.1} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y+.04) .. (\x-.2,\y+.03) .. controls (\x-.23,\y) and (\x-.21,\y-.1) .. (\x-.2,\y-.2); } \foreach \x in {10} \foreach \y in {1.9} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y+.04) .. (\x-.2,\y+.03) .. controls (\x-.23,\y) and (\x-.21,\y-.1) .. (\x-.2,\y-.2); } \foreach \x in {9.5} \foreach \y in {1.4} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y+.04) .. (\x-.2,\y+.03) .. controls (\x-.23,\y) and (\x-.21,\y-.1) .. (\x-.2,\y-.2); } \foreach \x in {8.8} \foreach \y in {.7} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y+.04) .. (\x-.2,\y+.03) .. controls (\x-.23,\y) and (\x-.21,\y-.1) .. (\x-.2,\y-.2); } \foreach \x in {8.3} \foreach \y in {.2} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y+.04) .. (\x-.2,\y+.03) .. controls (\x-.23,\y) and (\x-.21,\y-.1) .. (\x-.2,\y-.2); } \foreach \x in {7.1} \foreach \y in {1.4} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.1,\y+.04) .. (\x-.2,\y+.03) .. controls (\x-.23,\y) and (\x-.21,\y-.1) .. (\x-.2,\y-.2); } \draw (7.9,4) arc (225:315:.14); \draw (8.4,3.5) arc (225:315:.14); \draw (9.1,2.8) arc (225:315:.14); \draw (9.6,2.3) arc (225:315:.14); \draw (7.4,3.5) arc (225:315:.14); \draw (6.7,2.8) arc (225:315:.14); \draw (6.2,2.3) arc (225:315:.14); \draw (8.4,1.1) arc (225:315:.14); \draw (7.4,1.1) arc (225:315:.14); \draw (8.4,.5) arc (225:315:.14); \draw (7.4,.5) arc (225:315:.14); \draw (8.4,2.9) arc (225:315:.14); \draw (7.4,2.9) arc (225:315:.14); \draw (9.1,1.2) arc (225:315:.14); \draw (9.6,1.7) arc (225:315:.14); \draw (7.9,0) arc (225:315:.14); \draw (6.7,1.2) arc (225:315:.14); \draw (6.2,1.7) arc (225:315:.14); \draw (7.9,4) arc (135:45:.14); \draw (8.4,3.5) arc (135:45:.14); \draw (9.1,2.8) arc (135:45:.14); \draw (9.6,2.3) arc (135:45:.14); \draw (7.4,3.5) arc (135:45:.14); \draw (6.7,2.8) arc (135:45:.14); \draw (6.2,2.3) arc (135:45:.14); \draw (8.4,1.1) arc (135:45:.14); \draw (7.4,1.1) arc (135:45:.14); \draw (7.7,3.8) arc (30:-30:.195); \draw (8.3,3.8) arc (30:-30:.195); \draw (7.2,3.3) arc (30:-30:.195); \draw (7.1,2.6) arc (30:-30:.195); \draw (6.5,2.6) arc (30:-30:.195); \draw (6,2.1) arc (30:-30:.195); \draw (6.5,1.6) arc (30:-30:.195); \draw (7.1,1.6) arc (30:-30:.195); \draw (7.2,.9) arc (30:-30:.195); \draw (7.7,.4) arc (30:-30:.195); \draw (8.3,.4) arc (30:-30:.195); \draw (8.8,.9) arc (30:-30:.195); \draw (8.9,1.6) arc (30:-30:.195); \draw (9.5,1.6) arc (30:-30:.195); \draw (10,2.1) arc (30:-30:.195); \draw (9.5,2.6) arc (30:-30:.195); \draw (8.9,2.6) arc (30:-30:.195); \draw (8.8,3.3) arc (30:-30:.195); \draw (7.7,3.8) arc (150:210:.195); \draw (8.3,3.8) arc (150:210:.195); \draw (7.2,3.3) arc (150:210:.195); \draw (7.1,2.6) arc (150:210:.195); \draw (6.5,2.6) arc (150:210:.195); \draw (6,2.1) arc (150:210:.195); \draw (6.5,1.6) arc (150:210:.195); \draw (7.1,1.6) arc (150:210:.195); \draw (7.2,.9) arc (150:210:.195); \draw (7.7,.4) arc (150:210:.195); \draw (8.3,.4) arc (150:210:.195); \draw (8.8,.9) arc (150:210:.195); \draw (9.5,1.6) arc (150:210:.195); \draw (10,2.1) arc (150:210:.195); \draw (9.5,2.6) arc (150:210:.195); \draw (8.9,2.6) arc (150:210:.195); \draw (8.8,3.3) arc (150:210:.195); \draw (8.9,1.6) arc (150:210:.195); \draw (8,-0.5) node {$B_4(\tilde{o})$}; \foreach \x in {12.5} \foreach \y in {1} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.01,\y-.1) .. (\x+.05,\y-.2) .. controls (\x+.1,\y-.25) and (\x+.2,\y-.26) .. (\x+.25,\y-.25); } \foreach \x in {12.3} \foreach \y in {1} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.01,\y-.1) .. (\x-.05,\y-.2) .. controls (\x-.1,\y-.25) and (\x-.2,\y-.26) .. (\x-.25,\y-.25); } \foreach \x in {12.5} \foreach \y in {.3} { \draw[line width=0.5pt] (\x,\y) .. controls (\x-.01,\y+.1) .. (\x+.05,\y+.2) .. controls (\x+.1,\y+.25) and (\x+.2,\y+.26) .. (\x+.25,\y+.25); } \foreach \x in {12.3} \foreach \y in {.3} { \draw[line width=0.5pt] (\x,\y) .. controls (\x+.01,\y+.1) .. (\x-.05,\y+.2) .. controls (\x-.1,\y+.25) and (\x-.2,\y+.26) .. (\x-.25,\y+.25); } \draw (12.3,.3) arc (225:315:.14); \draw (12.3,1) arc (225:315:.14); \draw (12.3,1) arc (135:45:.14); \draw (12.05,.75) arc (150:210:.195); \draw (12.75,.75) arc (150:210:.195); \draw (12.05,.75) arc (30:-30:.195); \draw (12.75,.75) arc (30:-30:.195); \draw (12.4,0) node {$D_3(\tilde{o}')$}; \draw (12.3,.65) arc (135:45:.14); \draw (12.25,.7) arc (225:315:.2); \end{tikzpicture} The blooming Cantor tree without an infinite discrete set as the generic leaf is obtained from a bimeromorphism $\varphi:M\rightarrow M'$, which is the composition of one blow-up $b$ in a regular point $p$ in a fibre $F$ and one blow-down on the closure of $b^{-1}(F)-E$, where $E=b^{-1}(p)$ (see \cite[p.54]{brunella2004}). The bimeromorphism sends a trivial neighborhood $U\subset M$ of a fibre $F$ to a trivial neighborhood $U'\subset M'$ with an induced foliation, which has two singularities on the fibre $F'$, one logarithmic and one dicritical. The holonomy around $F'$ is trivial. Therefore the generic leaf $\mathcal{L}$ is a normal cover of $\Sigma_{3,1}$. Considering that the holonomy of the border cycle is trivial, we have that $\mathcal{L}$ is homeomorphic to the blooming Cantor tree deprived from a infinite discrete set. \end{example} \begin{example}\label{exp:CT} Let $\Gamma_x,e_1,e_2$ be as in example above, with $x\geq2$. Consider the foliation $\mathcal{F}$ on the suspension $P_\Phi:M\rightarrow\Sigma_{2}$ generated by the representation \[\begin{array}{llll} \Phi:&\pi_1(\Sigma_2,o)&\rightarrow & \mathrm{PSL}(2,\mathbb C)\\ & a_1 & \mapsto & e_1\\ & a_2 & \mapsto & e_2 \\ & b_j & \mapsto & \mathit{id}, \end{array}\] where $\{a_j,b_j\}_{j=1}^2=\mathfrak{G}_{2,0}$. An analysis similar to that in the developing of Example \ref{exp:BCT} shows that the generic leaf of $\mathcal{F}$ is homeomorphic to the Cantor tree. Also using the composition of a blow-up at point $p\in F$ and a blow-down of the strict transform of $F$, we get a bimeromorphism $\phi:M\rightarrow M'$. The foliation $\phi^{-1\ast}\mathcal{F}$ on $M'$ has generic leaf homeomorphic to Cantor tree without an infinite discrete set. \end{example} \begin{example} Let $\Sigma_2$ be the compact Riemann surface of genus 2 and $\{a_1,b_1,a_2,b_2\}$ be the canonical generators of $\pi_1(\Sigma_2,o)$ for a point $o$ in $\Sigma_2$. Consider the homomorphism defined by \[\begin{array}{lll} \rho:\pi_1(\Sigma_2,o)&\rightarrow & \mathrm{PSL}(2,\mathbb C)\\ a_1 &\mapsto & T\\ a_2,b_j &\mapsto &\mathit{id}, \end{array}\] where $T(z)=z+1$, which fixed a sinlge point at infinity. From the suspension of this homomorphism we get a non singular Riccati foliation with a compact leaf. Since $\rho(\pi_1(\Sigma_2,o))$ is isomorphic to $\mathbb{Z}$, \cite[Theorem 8.2.14]{loh2011geometric} shows that any generic leaf $\mathcal{L}$ of $\mathcal{F}$ has two ends. We conclude from the construct of the surface $B_n(\tilde{o})$, with $n\geq1$, that the generic leaf $\mathcal{L}$ has infinite genus. Therefore $\mathcal{L}$ is homeomorphic to Jacob's ladder. Using a bimeromorphism as in Examples \ref{exp:BCT} and \ref{exp:CT} , it is possible to give an example of foliation with generic leaf homeomorphic to Jacob's ladder without an infinite discrete set.\end{example} We now consider holomorphic homogeneous foliations $\mathcal{F}$ in $\mathbb{CP}^2$ which are defined in an affine chart $U\subset\mathbb{CP}^2$ by a homogeneous $1$-form \[ \omega=h_{1}(x,y)dx+h_2(x,y)dy\quad\text{and}\quad\omega(R)\neq0 \] where $h_1,h_2$ are homogeneous polynomials of the same degree $\nu$, without common factors and $R$ is the radial vector field. The foliation $\mathcal{F}$ defined by $\omega$ extends to a foliation of $\mathbb{CP}^2$ leaving the line at infinity invariant. After making a linear change of coordinates we can assume that $x$ does not divide $\omega(R) = x h_1 + y h_2$. The roots of this polynomial $\omega(R)=\prod_{1}^{n}(y-t_{j}x)^{\nu_j}$ correspond to $\mathcal{F}$-invariant lines $l_j$ through the origin. Blowing-up $(0,0) \in U$ we obtain a Riccati foliation $\mathcal{F}'$ with a finite set $\{\tilde{l}_j\}_{j=1}^n$ of $\mathcal{F}'$-invariants fibers corresponding to the strict transforms of the lines $l_j$, and fibration $P:M\rightarrow\Sigma_0$. The global holonomy group $\Phi_{\mathcal{F}'}(\pi_1(\Sigma_{0,n}))$ of $\mathcal{F}'$ is linear and isomorphic to the group generated by $<\exp^{2\pi i\eta_j}z>$, where $\eta_j$ is the Camacho-Sad index of the singularity of $\mathcal{F}'$ at $p_j=\tilde{l}_j\cap E$ in the exceptional divisor $E$ \cite{brunella2004}. In particular, the global holonomy $\Phi_{\mathcal{F}'}(\pi_1(\Sigma_{0,n}))$ is abelian and isomorphic to the multiplicative group $<\exp(2\pi i\eta_j)>_{j=1}^n$ in $\mathbb C^*$. Except for the leaves corresponding to invariant fibers, the exceptional divisor $E$ and the line at infinity, all the other leaves $\mathcal{L}$ are homeomorphic to a regular cover of $\Sigma_{0,n}$ with the same group of deck transformations. We will describe the possible topological types of this leaves. In the proofs of \cite[Theorem 1]{valdez2009billiards} and \cite[Theorem 8]{goncharuk2014genera}, the authors show that for generic $\{\eta_j\}$ and $n\geq3$ it is possible to give two cycles $\gamma_1,\gamma_2$ in $[\pi_1(\Sigma_{0,n},o),\pi_1(\Sigma_{0,n},o)]$ whose lifts $\gamma_1',\gamma_2'$ at $p\in\mathcal{L}\cap F$ are nontrivial in $\pi_1(L)$ and have intersection index equal to 1, with $F=P^{-1}(o)$. Thus the leaf has an attached handle. But this hold for any point in $\mathcal{L}\cap F$ since $\mathcal{L}$ has infinite genus. The following statement is an extension of the construction of these two cycles with intersection index 1 in regular covers $\Sigma_{g,n}^H$, with $[\pi_1(\Sigma_{g,n}),\pi_1(\Sigma_{g,n})]\cap H\neq\{\mathit{id}\}$. \begin{proposition}\label{Propt:AbelianCovers} Let $\Sigma_{g,n},\Sigma_{g,n}^H,H$ and $\mathfrak{G}_{g,n}$ be as defined above. The following assertions give conditions on $g,n$ and $\mathfrak{G}_{g,n}$ to have to cycles with intersection index one. \begin{itemize} \item[a)] For $g=0,n\geq3$ and some pair $c_j,c_l\in\mathfrak{G}_{0,n}$. If it is satisfies that the cycles $\gamma_1=[c_i^m,c_j^l],\gamma_2=[c_i^{-m'},c_j^l]$ belong to $H$ and $c_i^\alpha,c_j^\beta\notin H$ for $\alpha\leq m+m'$ and $\beta\leq l$, with $m,m',l\in\mathbb{N}_{>0}$. \item[b)] For $g\geq1,n\geq0$ and $a_j,b_j,d\in\mathfrak{G}_{g,n}$, with $a_j\neq d\neq b_j$ and $2g+n\geq 3$. If it is satisfies that the cycles $\gamma_1=a_j^m d^{-k}a_j^{-2m}d^k a_j^m$ and $gamma_2=b_j^l d^{k'}b_j^{-2l}d^{-k'} b_j^l$ are contained in $H$ and $a_j^\alpha,b_j^\beta d^\delta\notin H$ for $\alpha\leq m,\beta\leq l$, $\delta\leq k+k'$,with $m,l,k,k'\in\mathbb{N}_{>0}$. In the case, there are $m$ or $l$ in $\mathbb{N}_{>0}$ such that they are minimal with the property $a_j^m\in H$ or $b_j^l \in H$. It is possible to change the cycles $\gamma_1$ by $a_j^m$ or $\gamma_2$ by $b_j^l$. \end{itemize} Then the lifts $\tilde{\gamma_1},\tilde{\gamma_2}$ of the cycles $\gamma_1,\gamma_2$ at a point $\tilde{o}\in\Sigma_{g,n}^H$ have intersection index one. Moreover, if $\Sigma_{g,n}^H$ is a infinite cover then it has infinite genus. \end{proposition} \begin{proof} The proof is based in the following observations. The lifts $\tilde{\gamma_1},\tilde{\gamma_2}$ of the cycles $\gamma_1,\gamma_2$ at a point $\tilde{o}\in\Sigma_{g,n}^H$ has intersection the point $\tilde{o}$. Consider the border $B$ of the lift $\tilde{D}_{g,n}(\delta,\tilde{o})$ of $D_{g,n}(\delta)$, which is a simple closed curve. The complement $B-\tilde{\gamma_1}$ has two connected components, and $\tilde{\gamma_2}$ intersects both components in only one point. The latest implies that the intersection index of $\tilde{\gamma_1}$ and $\tilde{\gamma_2}$ is one. A detailed proof of the last claim is in \cite[Section 2.4.2]{PincheTesis}. \end{proof} This result lets us give the topological type of the generic leaf homogeneous foliation using the data $\{\eta_j\}$ and the polynomial $\omega(R)$. Note that the generic leaf $\mathcal{L}$ of any homogeneous foliation is homeomorphic to a regular cover $\Sigma_{0,n}^H$ such that $[\pi_1(\Sigma_{0,n}),\pi_1(\Sigma_{0,n})]$ is contained in $H$. If $\Sigma_{0,n}$ is an infinite cover then Lemma \ref{lm:planarends} shows that $\mathcal{E}(\mathcal{L})$ is an infinite discrete set of points or a single point and Lemma \ref{lm:ends'} implies that $\mathcal{E}'(\mathcal{L})$ is an empty set or a single point, which proves the following result. \begin{corollary} Let $\mathcal{F}$ a homogeneous foliation in $\mathbb{CP}^2$. If the global holonomy is infinite, then the generic leaf of $\mathcal{F}$ is homeomorphic to one of the following n topological types:a plane, a cylinder, a plane with an infinite discrete set taken out, the Loch Ness monster or the Loch Ness monster without an infinite discrete set. \end{corollary} \begin{example}\label{ex:plane} Let $\mathcal{F}$ be a homogeneous foliation defined by a homogeneous 1-form \[ \omega=ydx+\lambda xdy. \] If $\lambda\notin \mathbb{Q}$, Corollary \ref{crl:Riccati} implies that the generic leaves $\mathcal{L}$ of $\mathcal{F}$ are biholomorphic to an infinite normal cover of $\mathbb C^\ast$. Moreover, $\mathcal{L}$ is the universal cover of $\mathbb C^\ast$. Then it is biholomorphic to $\mathbb C$. When $\lambda$ is a rational number and $\omega(R)\neq0$ the generic leaf is biholomorphic to $\mathbb C^{\ast}$. \end{example} \begin{example}\label{exp:logFol1} Consider a homogeneous foliation $\mathcal{F}$ on $\mathbb{CP}^2$ defined by the homogeous 1-form \[ \omega=\lambda_1\frac{dx}{x}+\lambda_2\frac{dy}{y}+\lambda_3\frac{d(y-x)}{(y-x)},\] where $\sum\lambda_j=1$. Requiring for the set $\{\lambda_1,\lambda_2,\lambda_3\}$ to satisfy: \[\lambda_1\in \mathbb{R}-\mathbb{Q},\quad\lambda_2=1\quad\text{and}\quad\lambda_3=-\lambda_1,\] we obtain that the generic leaf $\mathcal{L}$ is homeomorphic to a regular cover $\Sigma_{0,3}^H$ with deck transformation group isomorphic to $(\mathbb{Z}^2)/(0,1)$. Thus $H$ does not contain the cycles of the Proposition \ref{Propt:AbelianCovers}, so that it is a planar surface. Lemma \ref{lm:planarends} now shows that $\mathrm{Ends}(\mathcal{L})$ contains an infinite discrete set of planar ends. Hence $\mathcal{L}$ is homeomorphic to the plane without an infinite discrete set. Assuming the data is \[\lambda_1\in \mathbb{R}-\mathbb{Q},\quad\lambda_2=\frac{1}{n}\quad \text{with}\quad n\geq2\quad\text{and}\quad\lambda_3=1-\lambda_1-\lambda_2. \] It follows that $\mathcal{L}$ has desk transformation group isomorphic to $(\mathbb{Z}^2)/(0,n)$. Since $n\geq2$, we see that $\mathrm{Cayley}(\mathbb{Z}^2)/(0,n)$ contains the cycles of Proposition \ref{Propt:AbelianCovers}. By Lemma \ref{lm:planarends}, $\mathrm{Ends}(\mathcal{L})$ contains an infinite discrete set of planar ends. Consequently, $\mathcal{L}$ is homeomorphic to the Loch Ness monster without an infinite discrete set. Now if the data satisfies \[\lambda_1,\lambda_2\in \mathbb{C}-\mathbb{Q},\quad\text{and}\quad\lambda_3=1-\lambda_1-\lambda_2. \] Analogously, we prove that the generic leaf has infinite genus but has only one end. Hence, the generic leaf is homeomorphic to the Loch Ness monster. \end{example} \section{Reeb local stability type result} We consider a singular $\mathcal{C}^r$ differential foliation $\mathcal{F}$ ($r\geq1$) of real dimension 2 on a differential manifold $M$ of real dimension at least 3, whose singular locus $\mathrm{Sing}(\mathcal{F})$ satisfies the following conditions: $\mathrm{Sing}(\mathcal{F})$ is the union of closed submanifolds, maybe some of them are singular; the complement $M^*=M-\mathrm{Sing}(\mathcal{F})$ is a dense open subset and the restriction $\mathcal{F}|_{M^*}$ is a regular foliation of real dimension 2. \begin{definition} Fix a point $o$ on a regular leaf $\mathcal{L}$ of $\mathcal{F}$ and a germ of transversal $\tau$ to $\mathcal{F}$ at $o$. The \textbf{holonomy group} $\mathrm{Hol}(\mathcal{L},\mathcal{F})$ is the image of the holonomy representation of $\pi_1(\mathcal{L},o)$ defined by the following morphism \begin{equation}\label{map:holonomyRepresentation} \begin{array}{lll} \mathrm{Hol}(\mathcal{L},\mathcal{F}):\pi_{1}(\mathcal{L},o)&\rightarrow&\mathrm{Diff}(\tau,o)\\ \qquad\qquad\qquad[\gamma]&\mapsto& h_{\gamma}, \end{array} \end{equation} where $h_\gamma$ is the $\mathcal{C}^r$ diffeomorphism germ of $(\tau,o)$ defined by the end point of the lifts $\tilde{\gamma}_p:[0,1]\rightarrow\mathcal{L}_p$ of the closed path $\gamma$ in $\mathcal{L}$ starting at $o$ along the leaves $\mathcal{L}_p$ through $p\in (\tau,o)$, with $\tilde{\gamma}(0)=p$. The map $h_\gamma$ does not depend on the homotopy class of the path. \end{definition} If $C$ is a regular compact leaf of $\mathcal{F}$ and has finite holonomy group, the Reeb local stability theorem implies that there is a neighborhood $U$ of $C$ saturated by $\mathcal{F}$ and each leaf in $U$ is a finite cover space of $C$. Consider the case when a compact surface $\Sigma_g$ is $\mathcal{F}$-invariant, such intersection $\mathrm{Sing}(\mathcal{F})\cap\Sigma_g$ is a finite set of $n$ points, with $n\in\mathbb{N}$. In general, any neighborhood of $\Sigma_g$ cannot be saturated by $\mathcal{F}$ and the leaves are not an explicit cover of $\Sigma_{g,n}$. However, the following results study the topological of the intersection with a neighborhood of the $\mathcal{F}$-invariant compact surface. \begin{definition} Let $\tau$ be a germen of transversal to a leaf $\mathcal{L}$ at a regular point $o\in\mathcal{L}$ and let $\gamma=\gamma_{\sigma_1}^{\beta_1}\cdots\gamma_{\sigma_k}^{\beta_k}$ be a closed path, where $\{\gamma_j\}_{j\in\Lambda}$ are the generators of $\pi_1(\mathcal{L},o)$, and $\beta_l\in\mathbb{Z}, \sigma_l\in\Lambda$. Let $p\in\tau$, $l\in\mathbb{N}$ and the leaf $\mathcal{L}_p$ of $\mathcal{F}$ through $p$. We define $B(l,p,\tau)$ to be the union $ \cup_{|\gamma|\leq l}\tilde{\gamma}_p(I), $ where $\tilde{\gamma}_p:[0,1]\rightarrow\mathcal{L}_p$ is the lift of $\gamma$ to $\mathcal{L}_p$ at $p$ and $|\gamma|=\sum_{j=1}^{k}|\beta_j|$. If $\tilde{\gamma}_p$ is well defined for each $\gamma$, such that $|\gamma|< l$, we call $B_l(p,\tau)$ the \textbf{graph ball} in $\mathcal{L}_p$ of radius $l$ and center $p$. \end{definition} \begin{lemma}\label{lemma:ball} Let $\mathcal{F}$ be a $\mathcal{C}^r$ differential singular foliation of real dimension two of a manifold $M^m$ with $\mathcal{F}$-invariant compact Riemann surface $\Sigma_g\subset M$, $m>2$. Assume that the set $\Sigma_g\cap\mathrm{Sing}(\mathcal{F})$ has cardinality $n$. If $\mathrm{Hol}(\Sigma_{g,n},\mathcal{F})$ is infinite. Then for each $N\in\mathbb{N}$ there is an embedding \[ \varepsilon:B_N(\tilde{o})\rightarrow(\mathcal{L}_p,p), \] where $B_N(\tilde{o})\subset\mathrm{Cayley}(A_{g,n}^H)$ is as in Definition \ref{def:graphball} with $H=\ker(\mathrm{Hol}(\Sigma_{g,n},\mathcal{F}))$, and $\mathcal{L}_p$ is a leaf through a regular point $p$ sufficiently close to $\Sigma_{g,n}$. \end{lemma} \begin{proof} Let $\{\gamma_j\}_{j\in\Lambda}$ be the representations of the homotopy class of the canonical generators $\mathfrak{G}_{g,n}$ of $\pi_1(\Sigma_{g,n})$, whose image under $\varrho_H$ are nontrivial generators of $A_{g,n}^H$. For any neighborhood of $o$ in $\tau$, there are points p, whose isotropy group $\mathrm{Iso}_{\mathrm{Hol}(\Sigma_{g,n},\mathcal{F})}$ is trivial, \cite[ Proposition 2.7]{godbillon98feuilletages}. Since $\mathrm{Hol}(\Sigma_{g,n},\mathcal{F})$ is infinite, for each $N\in\mathbb{N}$ exists a point $p\in\tau$ with trivial isotropy group sufficiently close to $o$ such that an holonomy map $h_\gamma$ on $\gamma\in\pi_1(\Sigma_{g,n})$ , satisfying $|\gamma|<N$, is well defined. Here $H$ denotes the kernel of $\mathrm{Hol}(\Sigma_{g,n},\mathcal{F})$(\ref{map:holonomyRepresentation}). Choose a vertex $\tilde{o}$ in the Cayley graph $\mathrm{Cayley}(A_{g,n}^H)$, and define a function \[ \begin{array}{lll} \tilde{\epsilon}:\mathrm{Vertices}(B_N(p,\tau)) &\rightarrow & \mathrm{Vertices}(B_N(\tilde{o}))\\ \tilde{\gamma}_p(1) & \mapsto & \tilde{\gamma}_{\tilde{o}}(1)\\ \tilde{\gamma}_p(1) & \mapsto & \tilde{\gamma}_{\tilde{o}}(1), \end{array} \] where $\tilde{\gamma}_{\tilde{o}}(1)$ is the end point of the lift of $\gamma$ in $\mathrm{Cayley}(A_{g,n}^H)$ at the vertex $\tilde{o}$. Suppose $\tilde{\epsilon}(\tilde{\gamma}_{p}(1))=\tilde{\epsilon}(\tilde{\gamma}_{p}'(1))=v_q$, then $\tilde{\gamma}_{\tilde{o}}\cdot\tilde{\gamma}_{v_q}'^{-1}(1)=\tilde{o}$. As $\mathrm{Iso}_{\mathrm{Hol}(\Sigma_{g,n},\mathcal{F})}(p)$ is trivial, thus $\gamma\cdot\gamma'^{-1}\in H$. Since $B_N(p,\tau)$ is well defined and $\mathrm{Iso}_{\mathrm{Hol}(\Sigma_{g,n},\mathcal{F})}(p)$ is trivial, we have $h_{\gamma\cdot\gamma'^{-1}}$ is a trivial map and $h_{\gamma'}\circ h_{\gamma\cdot\gamma'^{-1}}=h_{\gamma}$. Hence $\tilde{\epsilon}$ is bijective. Since the lifts of the paths $\gamma_j$ at the points $\tilde{\gamma}_{p}(1)$, $|\gamma|<N-1$, are edges of $B_N(p,\tau)$, we can extend $\tilde{\epsilon}$ to a graph isomorphism \[ \begin{array}{lll} \epsilon:B_N(p,\tau) &\rightarrow &\overline{B_N(\tilde{o})}\\ p & \mapsto & \tilde{o}\\ edge(\tilde{\gamma}_p(1),\widetilde{\gamma\cdot\gamma_j}^{\pm 1}_p(1)) & \mapsto & edge(\tilde{\gamma}_{\tilde{o}}(1),\widetilde{\gamma\cdot\gamma_j}^{\pm 1}_{\tilde{o}}(1)). \end{array} \] Hence $\epsilon^{-1}$ is a homeomorphism of graphs. Since $B_N(p,\tau)$ is compact in $M$, the homeomorphism $\varepsilon=\epsilon^{-1}$ is an embedding. \end{proof} We can now prove the Theorem \ref{THM:ReebType}, wich is an adaptation of the local stability theorem of Reeb for singular foliations. \begin{proof}[Proof of Theorem \ref{THM:ReebType}] By the lemma above, for each $N\in\mathbb{N}$ there exists a point $p\in\tau$ such that $B_N(p,\tau)$ is a graph ball in $\mathcal{L}_p$ homeomorphic to the graph ball $B_N(\tilde{0})$ in the graph $\mathrm{Cayley}(A_{g,n}^H)$ associated with $\Sigma_{g,n}^H$. Let $D_{g,k}(\delta)$ be a fundamental domain defined as in Definition \ref{def:graphball} such that it is open, simply connected and $\overline{D_{g,k}(\delta)}=\Sigma_{g,k}-\cup B_\delta(p_j)$, with $\{p_j\}_{j=1}^n=\mathrm{Sing}(\mathcal{F})\cap\Sigma_g$. We can choose $\delta>0$ and $o\in\tau'\subset\tau$ such that the lift $\hat{D}_{g,n}(\delta,q)$ through $q$ is well defined at each point $q\in\tau'$, \cite[Lemma 2,p.66]{camacho1979teoria}. Therefore the embedding $\varepsilon$ of the lemma above extends to the interior of the surfaces \[ \begin{array}{lll} S_N(p,\tau)=\overline{\cup \hat{D}_{g,n}(\delta,\varepsilon(v))} &\quad & \varepsilon(v)\in Vertices(B_N(p,\tau)) \\ B_N(\delta,\tilde{o}) &\quad &v\in Vertices(B_N(\tilde{o})) . \end{array} \] This implies that for $p\in\tau$ sufficiently close to $o$ and trivial isotropy group, there exists an embedding \[\hat{\varepsilon}:B_N(\delta,\tilde{o})\rightarrow S_N(p,\tau)\subset\mathcal{L}_p.\] \end{proof} \begin{corollary} Under the assumptions of Theorem \ref{THM:ReebType}, if the regular cover $\Sigma_{g,n}^H$ has infinite genus; then, the foliation $\mathcal{F}$ has leaves with arbitrary genus nearly of $\Sigma_{g,n}$. Moreover, if $\mathrm{Hol}(\Sigma_{g,n},\mathcal{F})$ has a contracting map, then there are leaves of infinite genus. \end{corollary} \begin{proof} If $\Sigma_{g,n}^H$ has infinite genus, there exists a minimal $N_0\in\mathbb{N}$ such that $B_{N_0}(\delta,\tilde{o})^{\circ}$ has genus different of zero, $g(S(N_0,\tilde{o})^{\circ})\neq0$. Since $\Sigma_{g,n}^H$ is regular, it follows that \[g(B_{(a+1)N_0}(\delta,\tilde{o}))> g(B_{aN_0}(\delta,\tilde{o}))+g(B_{N_0}(\delta,\tilde{o}))\] for any $a\in\mathbb{N}_{>0}$. Theorem \ref{THM:ReebType} now shows that $\mathcal{F}$ has leaves with arbitrary genus. We now turn to the case when the group $\mathrm{Hol}(\Sigma_{g,n},\mathcal{F})$ has a contracting map $h$. Choose a point $p\in\tau$ whose isotropy group is trivial, then the points $h^m(p)$ has a trivial isotropy group. Thus, we can embed in $\mathcal L_p$ a surface $B_{N,\delta}(\tilde{o})$ for any $N\in\mathbb{N}$. It follows that $\mathcal L_p$ has unbounded genus. \end{proof} \section{Generic logarithmic foliations on $\mathbb{CP}^2$} Let $M$ be a connected complex manifold of dimension at least 2, and let $D\subset M$ be a union of irreducible complex hypersurfaces $D_j$. A \emph{closed logarithmic 1-form} $\omega$ on $M$ with poles on $D$ is a meromorphic 1-form with the following property: for any $p\in M$ there exists a neighborhood $U$ of $p$ in $M$ such that $\omega|_U$ can be written as \begin{equation}\label{eq:logForm} \omega_{0}+\sum_{j=1}^{r}\lambda_{j}\frac{df_{j}}{f_{j}}, \end{equation} where $\omega_0$ is a closed holomorphic 1-form on $U$, $\lambda_j\in\mathbb C^{\ast}$ and $f_j\in\mathcal{O}(U)$ , and $\{f_{j}=0\}$, $j=1,\ldots,r$, are the reduced equations of the irreducible components of $D\cap U$. The set $D$ is known as the polar divisor of $\omega$. The complex codimension one holomorphic foliation $\mathcal{F}$ of $M$ defined by $\omega$ is called \emph{logarithmic foliation}. In particular, the holonomy group $\mathrm{Hol}(D_j^*,\mathcal{F})$,with $D_j^*=D_j-\mathrm{Sing}(\mathcal{F})$, associated with any irreducible component $D_j$ of the polar divisor $D$ of a logarithmic foliation $\mathcal{F}$ is abelian and linearizable (it is isomorphic to a subgroup of $\mathbb{C}^{\ast}$). Moreover, if $M$ is simply connected then the holonomy group $\mathrm{Hol}(D_j^*,\mathcal{F})$ is a subgroup of the group generated by $\{\exp(2\pi i \frac{\lambda_k}{\lambda_j})\}$, where $\lambda_j$ is the residue of each irreducible component $D_j$ of $D$. \begin{lemma}\label{lemma:genuslog} Let $\mathcal{F}$ be a logarithmic foliation on a complex surfaces $M$ with polar divisor $D$. Assume that the holonomy group $\mathrm{Hol}(D_j^*,\mathcal{F})$ is infinite, with $D_j$ an irreducible component of $D$, and $\Sigma_{g,n}^H$ satisfies the condition (a) or (b) of Proposition \ref{Propt:AbelianCovers}, where $\Sigma_{g,n}=D_j^*$ and $H=\ker(\mathrm{Hol}(D_j^*,\mathcal{F}))$. Then $\mathcal{F}$ has leaves with infinitely many handles attached. \end{lemma} \begin{proof} Let $\tau$ be a germ of transversal to the irreducible component $D_j$ of $D$ at a regular point $o\in D_j$ of $\mathcal{F}$. Since $\mathrm{Hol}(D_j^*,\mathcal{F})$ is conjugate to a subgroup of $\mathbb C^*$, the isotropy group $\mathrm{Iso}_{\mathrm{Hol}(D_j^*,\mathcal{F})}(p)$ is trivial for each point $p\in\tau-o$. The group $\mathrm{Hol}(D_j^*,\mathcal{F})$ is infinite, then there is a map $h_\gamma\in\mathrm{Hol}(D_j^*, \mathcal{F})$ such that $\{h_{\gamma}^n(p)\}_{n\in\mathbb{N}}$ is contained in $\tau-o$, for a point $p\in\tau-o$ sufficiently close to $o$. Let $\mathcal{L}$ be a leaf of $\mathcal{F}$ through $p$. By Theorem \ref{THM:ReebType}, it suffices to show that $\Sigma_{g,n}^H$ has infinite genus, with $H={\mathrm{ker}\mathrm{Hol}(D_j^*,\mathcal{F})}$ and $n=|\mathrm{Sing}(\mathcal{F})\cap D_j|$, $g=g(D_j)$. Since the regular cover $\Sigma_{g,n}^H$ satisfies the condition (a) or (b) of Proposition \ref{Propt:AbelianCovers}, we see that it has infinitely many handles attached, and the lemma follows. \end{proof} \begin{remark} Is possible to construct a logarithmic foliation on a complex surface $M$ with invariant compact Riemann surface $C$ and the singularities on it are all hyperbolic. Thus, for any open neighborhood $U\subset M$ of $C$ there is an open neighborhood $U'\subset U$ such that any leaf intersecting $U'$ is not contained in $U'$. Out of $U'$, Theorem \ref{THM:ReebType} can not say anything about the topology of the leaves. \end{remark} We can define a logarithmic foliation on the complex projective plane $\mathbb{CP}^2$ by a homogeneous closed logarithmic 1-form on $\mathbb{C}^3$ of the form \[ \omega=F_1\cdots F_r\sum_{j=1}^r \lambda_j \frac{dF_j}{F_j},\quad \lambda_j\neq 0,\quad \sum_{j=1}^r d_j\lambda_j=0, \] where each $F_j$ is homogeneous of degree $d_j$. On the complement $\mathbb{CP}^2-D$ we can define the following multivalued first integral \begin{equation*} F=\prod F_{j}^{\lambda_j} \end{equation*} which is a single valued map if we take its values in the quotient $\mathbb{C}/R$, with $R$ the product group generated by the numbers $\exp(2\pi i\lambda_j)$. When all the ratios $\lambda_j/\lambda_i$ are rationals, it implies that the foliation has a rational first integral $F$ and all the leaves of $\mathcal{F}$ are an open subset of a complex algebraic curve. If the closure of a leaf $\mathcal{L}$ of $\mathcal{F}$ is not a complex algebraic curve, we call it \emph{non-algebraic} leaf. Note that for each singular point $p$ of $\mathcal{F}$ out of the polar divisor $D$, there is a simply connected open neighborhood $U$, such that $U\cap D=\emptyset$ and the restriction $\omega|_U$ is an exact 1-form. Thus, the number of separatrices through $p$ is finite. Now we call a leaf $\mathcal{L}$ of $\mathcal{F}$ \emph{generic} if $\mathcal{L}$ is not an irreducible component of $D$ or a separatrix of any point in $\mathrm{Sing}(\mathcal{F})-D$. In general, the generic leaves are non-algebraic. The following results describe the possible topological types of a non-algebraic leaf of logarithmic foliations on $\mathbb{CP}^2$. \begin{lemma}\label{logarithmic ends} Let $\mathcal{F}$ be a logarithmic foliation on $\mathbb{CP}^2$ with polar divisor $D$. Let $\mathcal{L}$ be a non-algebraic leaf of $\mathcal F$. If $e$ is an end of $\mathcal{L}$ then either locally the leaf $\mathcal{L}$ is a separatrix of a singularity of $\mathcal F$ on the complement of $D$, or $\overline e \cap D \neq \emptyset$. \end{lemma} \begin{proof} The divisor $D$ has at least two irreducible components. Divide the set of irreducible components in two sets, say $D_0$ and $D_{\infty}$. Let $F_0$ and $F_{\infty}$ be homogeneous polynomials of the same degree on $\mathbb C^3$ defining, respectively, $D_0$ and $D_{\infty}$. The quotient $\frac{F_0}{F_{\infty}}$ defines a non-constant holomorphic map $ F : U \to \mathbb C^\ast$, where $U$ is the complement of $D$ in $\mathbb{CP}^2$. From now on we assume that an end $e\in\mathcal{E}(\mathcal{L})$ is an open set of the nested sequence $\{P_k\}$ for a sufficiently large $k$. Let $K$ be a compact subset of $\mathcal{L}$. Let $e$ be an end of $\mathcal{L}$ contained in a connected component of $\mathcal{L} - K$ such that the boundary $\partial_{\mathcal{L}}e$ in $\mathcal{L}$ is compact. The restriction of $F$ to $e$ is a holomorphic function $f: e \to \mathbb C$. If $f$ is constant, then $\mathcal{L}$ is an irreducible component of a fibre of the rational function and, hence, is algebraic which contradicts our assumptions. So $f: e \to \mathbb C$ is a non-constant holomorphic function. Let $V = f(e) \subset \mathbb C$ be the image of $f$. Since $f$ is holomorphic and non-constant $V$ is an open subset of $\mathbb C$. If it contains $\infty$ or $0$ in its closure, then, the lemma follows by continuity, the closure of the end $e$ intersects $D_{\infty}$ or $D_0$ respectively. Assume from now on that $\infty,0 \notin \overline{f(e)}$. Let $\mathcal G$ be the restriction of $\mathcal F$ to $U-K=U'$. The boundary $\partial e = \overline{e} - e$ in $U'$ is mapped by $f$ to $ \partial V$, the boundary of $V$. We point out that $\partial e$ is invariant by $\mathcal G$, see \cite[Proposition 4.1.11]{candel2003foliations}. If $\partial e$ reduces to a point, the end in question accumulates at one of the finitely many singularities of $\mathcal F$ in $U$. If instead the boundary contains infinitely many points; then, it follows that $F(\partial e)$ contains infinitely many points. Therefore, $\mathcal G$ contains infinitely many leaves contained in fibers of $F$. Thus $\mathcal F$ has infinite algebraic leaves. Jouanolou's Theorem implies that every leaf of $\mathcal{F}$ is algebraic, contradicting our assumptions again. \end{proof} We have so far describe the topological invariants of leaves of logarithmic foliations on $\mathbb{CP}^2$. We can prove our main result. \begin{proof}[Proof of Theorem \ref{THM:LNMP2}] Our proof starts with the observation that the polar divisor $D=\sum_{j=1}^r D_j$ has at least three irreducible components. Otherwise, the equation $\sum_{j=1}^2 d_j\lambda_j=0$ implies that $\lambda_1/\lambda_2$ is negative. The assumption $\lambda_j/\lambda_l\notin\mathbb{R}_{<0}$ and the equations \[\sum_{j=1}d_j\frac{\lambda_j}{\lambda_l}=0\] implies that at least two ratios $\lambda_j/\lambda_l$ are complex numbers. Our next claim is that the space of ends $\mathcal{E}(\mathcal{L})$ of the generic leaf $\mathcal{L}$ is a single point. Suppose the proposition is false. Then, we could find a generic leaf $\mathcal{L}$ and a compact subset $K$ of $\mathcal{L}$ such that the complement of $K$ in $\mathcal{L}$ has two connected components $e_1$ and $e_2$. There is a neighbourhood $V$ of $D$ whose intersections with the level sets of $F:\mathbb{CP}^2\rightarrow\mathbb{C}/R$ are connected, \cite[Theorem B]{paul1997connectedness}. We can choose $V$ such that the intersection $V\cap K$ is empty. Since $\mathcal{L}$ is a generic leaf, Lemma \ref{logarithmic ends} shows that the intersections $E_j\cap V$, $j=1,2$, are not empty. Thus, $e_1$ and $e_2$ intersect in the connected set $V\cap\mathcal{L}$, a contradiction. Therefore, the generic leaf $\mathcal{L}$ has a single end $e$. In particular, \cite[Proposition 2.3]{paul1997connectedness} implies that the closure of $e$ contains $D$. When $r>3$ or some $d_j>1$, the fact that at least two ratios $\lambda_j/\lambda_l$ are complex numbers, the polar divisor $D$ is normal crossing and Lemma \ref{lemma:genuslog} imply that the generic leaf has infinitely many handles attached. Thus, the generic leaf $\mathcal{L}$ is homeomorphic to the Loch Ness Monster. Let $D$ be three lines in general position. Without loss of generality we assume that the homogeneous equation in $\mathbb{C}^3$ are $l_1=\{x=0\},l_2=\{y=0\},l_3=\{z=0\}$ and $\lambda_1/\lambda_2\in\mathbb{C}$. Note that $\mathbb{CP}^2-D$ is biholomorphic to $(\mathbb{C}^*)^2$, thus we can define the universal covering \[\begin{array}{lll} \rho:\mathbb{C}^{2} & \rightarrow & \quad\quad\mathbb{CP}^{2}-D \\ (x,y) & \mapsto & (e^{2\pi ix}, e^{2\pi iy}). \end{array} \] The pull-back $\rho^*\omega$ admits the following expression \[ 2\pi i(\lambda_1dx+\lambda_2dy) \] which is a linear 1-form on $\mathbb{C}^{2}$. Thus, the leaves $\mathcal{L}^*$ of $\rho^*\mathcal{F}$ are complex lines. Since $\lambda_1/\lambda_2\in\mathbb{C}$, the restriction $\rho|_{\mathcal{L}^*}$ is a biholomorphis on its image, which are the generic leaves of $\mathcal{F}$, and the proof is complete. \end{proof} \begin{example} Here we generalize an example given by Cerveau in \cite[Subsection 2.12]{cerveau2013quelques}. The homogeneous closed logarithmic 1-form \[\omega=\prod_{j=1}^r x_j\sum_{j=1}^r\lambda_j\frac{dx_j}{x_j},\quad\sum_{j=1}^r\lambda_j=0\] in $\mathbb{C}^{n+1}$ defines a logarithmic foliation $\mathcal{F}$ on $\mathbb{CP}^n$. Assume $n+1\geq r>3$ and the ratios of residues $\lambda_j$ are not negative real numbers. An analysis similar to that in the proof of Theorem \ref{THM:LNMP2} shows that the leaves different from the irreducible components of the polar divisor $\sum_j H_j$ of $\omega$ are biholomorphic to $\mathbb{C}^{n-1}$, with $H_j=\{x_j=0\}$. Consider a plane projective $P\subset\mathbb{CP}^n$ through the point $o=[1:0:\cdots:0]$, whose intersections with the hyperplanes out of $o$ are general. Thus the restriction $\mathcal{F}'=\mathcal{F}|_{P}$ is a homogeneous foliation, and by the assumptions on the ratios the generic leaf of $\mathcal{F}'$ is homeomorphic to the Loch Ness Monster. Moreover, if $P$ is general respect all the hyperplanes $H_j$ then Theorem \ref{THM:LNMP2} shows that the generic leaf of $\mathcal{F}'$ is also homeomorphic to the Loch Ness Monster. \end{example} \begin{remark} The Example \ref{exp:logFol1} gives a logarithmic foliation with generic leaf homeomorphic to a plane without an infinite discrete set of points. In this case, any element of the space of ends of a generic leaf accumulates in the polar divisor. Thus, it is not enough that a holomorphic foliation has an invariant compact Riemann surface to ensure that the foliation has leaves with a non-trivial genus. \end{remark} \begin{remark} An essential fact in the E. Ghys theorem \cite{ghys1995topologie} is that he can decide the space of ends for the generic leaf, this still unknown for almost every class of holomorphic foliations on compact complex surfaces. \end{remark} \bibliographystyle{alpha}
\section{Introduction\label{sec:intro}} Neutrinos provide the opportunity to probe the most cataclysmic and energetic processes in the Universe. As they are immune to magnetic fields, and their interactions with matter are extremely feeble, high-energy neutrinos may reach us unscathed from the edge of the Universe. However, as was pointed out since the neutrino's inception \cite{Pauli:1930pc}, the smallness of the neutrino cross section is a double-edged sword, as the remarkable ability of neutrinos to escape dense astrophysical environments goes hand in hand with the ability to pass through detectors~\cite{Gaisser:1994yf}. The neutrino detection problem becomes even more challenging for rare neutrino production processes. The two most elusive predicted neutrino fluxes are the cosmic neutrino background (C$\nu$B) and the cosmogenic flux. The former is the largest flux of naturally produced neutrinos. Unfortunately, it peaks at meV energies, where its cross section has made it undetectable as of yet. The latter is a guaranteed but yet to be detected flux of extremely-high-energy (EHE) neutrinos produced in weak decays of particles from the interactions of ultra-high-energy cosmic rays (UHECR) with the cosmic microwave background (CMB)~\cite{Greisen:1966jv, Zatsepin:1966jv, Beresinsky:1969qj}. The cross section around these energies reduces the interaction length of neutrinos to $\mathcal{O}(100)$ km in rock, but the flux is $\sim$50 orders of magnitude smaller than the C$\nu$B, making it equally elusive. Soon after the prediction of the cosmogenic neutrino flux, its level made it evident that cubic kilometer detectors are required to observe this flux at high energies~\cite{Roberts:1992re, Halzen:2008zz}. Later estimates for observing potential cosmic accelerators such as Galactic supernova remnants and gamma-ray bursts pointed to a similar requirement~\cite{Gaisser1995,Learned:2000sw,Halzen:2002pg}. The discovery of astrophysical neutrinos by IceCube marked the beginning of high-energy neutrino astro-particle physics \cite{Aartsen:2013jdh}. This initial observation was followed by the detection of an excess of a high-energy astrophysical muon-neutrino flux component above the atmospheric background in the northern sky \cite{Aartsen:2015rwa}. These initial measurements have been confirmed recently with 9.5 years of northern sky muon-neutrino data \cite{Stettner:2019tok} and 7.5 years of all-sky starting event data \cite{Schneider:2019ayi}. The astrophysical flux observed by IceCube saturates the theoretical flux expectations \cite{Waxman:1998yy} and is predominantly extragalactic \cite{Albert:2018vxw}. Intriguingly, as well, the total energy density in high-energy neutrinos is similar to the energy density of the UHECRs which might hint at their common origin. This observed flux, however, is not the cosmogenic neutrino flux, and the predominant sources are yet to be identified. In the search for cosmogenic neutrinos, IceCube selects the highest energy depositions corresponding to $\sim$EeV events. The main backgrounds in this region are the astrophysical component and muons produced in cosmic-ray showers. To reject the latter, a zenith-angle dependent cut on the deposited energy is applied resulting in the largest sensitivity near the horizon. Additionally, the Earth shields the detector from a large fraction of the primary cosmogenic flux in the northern sky due to the growing neutrino cross section ~\cite{Gandhi:1998ri,Connolly:2011vc,Vincent:2017svp}. Therefore the search is eventually limited to a region near the horizon; a sliver of the full sky. Similarly, neutrino detectors sensitive to higher energies compared to IceCube have typically limited searches to Earth-skimming or downgoing trajectories, where the column depth is optimal for detecting EHE neutrinos after a single interaction~\cite{Kotera:2010yn}. Experiments such as ANITA, ARA, ARIANNA, and the Pierre Auger Observatory have set limits on the cosmogenic flux taking advantage of the Earth-skimming technique~\cite{Abbasi:2010ak, Barwick:2014pca, Aab:2015kma, Aartsen:2016ngq, Allison:2015eky,Allison:2018cxu,Aartsen:2018vtx,Aab:2019auo}. Proposed experiments such as RNO, GRAND, CHANT, POEMMA, and IceCube Gen-2 \cite{Aguilar:2019jay, Fang:2017mhl, Neronov:2016zou, Krizmanic:2019hiq, Aartsen:2014njl} rely on the Earth-skimming technique for detection of EeV neutrinos. However, tau neutrinos offer a unique opportunity to detect those neutrinos which prematurely interact in the Earth prior to reaching the detector. When an incident tau neutrino undergoes a charged-current (CC) interaction, the subsequent decay of the produced tau will yield another tau neutrino at a lower energy~\cite{Learned:1994wg, Halzen:1998be,Beacom:2001xn, Dutta:2002zc,Bugaev:2003sw,Dutta:2005yt,Reno:2019jtr}. Although this process is not unique to the tau channel, the energy distribution of the secondary neutrinos peaks at much higher energies for tau neutrinos than for muon- or electron- neutrinos. This effect has been dubbed "tau neutrino regeneration," and will be discussed further in Sec.~\ref{sec:leptons}. In this paper, we take advantage of tau neutrino regeneration to study EHE neutrino fluxes by looking at their resultant secondaries. Numerous calculations have been performed with different approximations to solve the tau neutrino transport problem \cite{Bugaev:2003sw, Dutta:2000jv, Beacom:2001xn, Dutta:2002zc, Yoshida:2003js, Bottai:2002nn, Giesel:2003hj, Reno:2019jtr}. In our treatment of tau neutrino propagation, we include tau energy losses and show that signatures of Earth-traversing neutrinos provide an opportunity to infer a neutrino flux at EeV energies through its secondaries. Using this technique, we extend the parameter space to a previously neglected region below the horizon and discuss the prospects of detecting cascaded neutrino fluxes, or Earth-traversing EHE neutrinos. For this purpose, we develop a Monte Carlo software package, \texttt{TauRunner} and describe it in Sec.~\ref{sec:tau_runner}. In Sec.~\ref{sec:secondary_flux} we show that Earth-traversing EeV neutrinos emerge at $\mathcal{O}$(PeV) energies, a region where IceCube has already performed measurements. We further highlight the connection between EeV and PeV regions by investigating the recent anomalous EeV events reported by ANITA. ANITA is a radio-balloon experiment that flies over the Antarctic ice in search of the cosmogenic neutrino flux. During the third flight of ANITA in 2014, an event (AAE141220) was detected which appeared to be an upgoing tau shower initiated by a tau neutrino interaction in the ice. The reconstructed direction, however, implies a column depth through the Earth corresponding to $\sim$20 interaction lengths for an EeV neutrino. The implied survival probability coupled with an isotropic emission assumption requires a flux that is in tension with cosmogenic neutrino limits \cite{Romero-Wolf:2018zxt, Fox:2018syq, Chipman:2019vjm}. But, discrete source emission can evade these bounds. In section \ref{sec:ANITA}, we prove for the first time that any localized emission which would result in AAE141220 is in severe tension with IceCube measurements at PeV energies, closing the last loophole in the neutrino interpretation of the ANITA events. In Sec.~\ref{sec:GZK}, we propagate a cosmogenic neutrino flux model \cite{Ahlers:2010fw} through the Earth. We find that the rate of Earth-traversing tau neutrinos expected at IceCube is twice the rate of Earth-skimming events, with a well understood and unique energy and zenith distribution. These handles will allow separation from atmospheric and astrophysical backgrounds in future dedicated analyses. Finally, we discuss the current strengths and limitations of this approach as well as future prospects for IceCube Gen-2 in Sec.~\ref{sec:conclusion}. \section{Leptons through the Earth\label{sec:leptons}} The propagation of a flux of neutrinos through a medium can be described by the following cascade equation~\cite{GonzalezGarcia:2005xw} \begin{equation} \frac{d \varphi(E, x)}{d x}=-\sigma(E) \varphi(E, x)+\int_{E}^{\infty} d \tilde{E} ~ f(\tilde{E}, E) \varphi(\tilde{E}, x), \end{equation} where $E$ is the neutrino energy, $x$ is the target column density, $\sigma(E)$ the total neutrino cross section per target nucleon, $f(\tilde{E}, E)$ is a function that encodes the migration from larger to smaller neutrino energies, and $\varphi(E, x)$ is the neutrino spectrum. The first term on the right hand side accounts for the loss of flux at energy $E$ due to charged-current (CC) and neutral-current (NC) interactions, whereas the second term is the added contribution from neutrinos at larger energy, $\tilde{E}$, to $E$ through NC interactions of $\nu_{e, \mu, \tau}$ and CC interactions in the $\nu_{\tau}$ channel. In this work, the secondaries produced in CC interactions of other flavors are neglected due to the fact that the electrons and muons lose energy rapidly. On the other hand, taus produced in CC tau neutrino interactions have a much higher probability of decaying yielding high-energy neutrinos. This is due to the fact that weak decays scale as $m^5$ and that the tau mass is significantly larger than that of the muon, allowing for more decay modes, which results in a ratio of lifetimes between muons and taus of approximately $10^7$. While the lifetimes are drastically different, the energy losses above $\sim$1 PeV, where stochastic losses are dominant, are only a factor of 10 smaller for taus than for muons. These two facts set the critical energy in ice -- the energy at which the decay and interaction lengths are equal -- to be approximately ${\sim} 10^9$ GeV for taus, while for muons it is ${\sim}10$ GeV~\cite{Koehne:2013gpa}. This implies that tau energy losses can be safely neglected below 10 PeV and the on-spot instantaneous tau decay approximation is a good one, see {\it e.g.}~\cite{Vincent:2017svp}. However, in this work we consider neutrino propagation at EeV energies and higher, where this approximation no longer holds and careful treatment of tau energy losses is required; see~\cite{Alvarez-Muniz:2017mpk, Reno:2019jtr} for recent implementations and discussions. \subsection{Lepton behavior at extremely-high-energies\label{sec:leptons_ehe}} Measurements of neutrino cross sections have been performed from sub-GeV up to a few PeV energies~\cite{Patrignani:2016xqp}. This includes a multitude of results using human-made neutrinos in accelerator~\cite{AguilarArevalo:2010zc,Tzanov:2005kr} and reactor~\cite{Vogel:1999zy,Kurylov:2002vj} experiments, as well as natural sources such as solar~\cite{Agostini:2018uly}, atmospheric~\cite{Li:2017dbe}, and astrophysical neutrinos~\cite{Aartsen:2017kpd,Yuan:2019wil}; for recent reviews see~\cite{Formaggio:2013kya,Katori:2016yel}. In the future, measurements of high-energy neutrinos from collider experiments will be available in the TeV range~\cite{Feng:2017uoz,Abreu:2019yak}. Unfortunately, these measurements stop short of the region of interest for this work and predictions of the very-high-energy neutrino cross sections disagree at the highest energies; see Fig.~\ref{fig:nucross}. The main issue driving these uncertainties is that the nucleon structure functions cannot be derived from first principles, which causes us to instead rely on empirical measurements. Perturbative QCD calculations of the high-energy neutrino cross section are in good agreement with each other when physical consistency requirements are imposed on the PDFs used~\cite{Gandhi:1998ri,Connolly:2011vc,CooperSarkar:2011pa,Bertone:2018dse}, however they grow at a rate $\left(E_\nu^{0.3}\right)$ that will eventually violate the Froissart bound~\cite{Froissart:1961ux, Block:2011vz, Block:2004ek}. This unphysical growth is due to extrapolation of the PDFs to unmeasured phase space. A phenomenological approach~\cite{Block:2000gy, Block:2014kza} to address this issue relies on a $\ln^2(s)$ extrapolation of low-energy measurements using a dipole model of the nucleon. Calculations using this approach were shown to be in good agreement with the total proton-proton cross section measurements from Auger~\cite{Collaboration:2012wt} and TOTEM at LHC~\cite{Antchev:2013gaa} data. In this work, we use the dipole model calculation given in~\cite{Arguelles:2015wba} as our model for neutrino-nucleon interactions; this results in structure functions compatible with~\cite{Block:2014kza}. \begin{figure}[htb!] \centering \includegraphics[width=\linewidth]{neutrino_cross_sections.pdf} \caption{The neutrino-proton cross section as a function of the neutrino energy. Solid (dashed) lines correspond to charged-current (neutral-current) cross sections. Blue lines~\cite{Arguelles:2015wba} correspond to the model used for this work. Orange lines~\cite{CooperSarkar:2011pa} are implemented in the software as well and can be chosen by the user.} \label{fig:nucross} \end{figure} As discussed earlier, tau energy losses are negligible below 10 PeV and decay-on-the-spot is usually a good approximation. Above the critical energy, taus lose energy through ionization, bremsstrahlung, pair production, and photo-nuclear interactions. Ionization grows as $\ln(E_{\tau})$ and its contribution is minimal at the highest energies. Bremsstrahlung and pair-production have virtually no energy dependence above 1 PeV for taus and are sub-dominant, but are included in our treatment nonetheless. The photo-nuclear cross section grows with energy, and dominates the losses for taus above $\sim$1 EeV~\cite{Jeong:2017mzv}. This cross section depends on the nucleon structure function, and thus has the same source of uncertainty as the neutrino-nucleon cross section. For consistency, we use the same model of the nucleon structure function implemented for the neutrino-nucleon cross section. We incorporate it by modifying the publicly available Muon Monte Carlo (MMC) tool \cite{Chirkin:2004hz}, which we use to propagate taus. Fig.~\ref{fig:tau_losses} shows distributions of final tau energies and total distance traveled before decay for several initial tau energies. \begin{figure}[!t] \centering \subfloat[][]{\includegraphics[width=.46\textwidth, trim={1.5cm 1.75cm 2cm 2cm}]{tau_loss_2dhist_BDHM_7.pdf}}\quad \subfloat[][]{\includegraphics[width=.46\textwidth, trim={1.5cm 1.75cm 2cm 2cm}]{tau_loss_2dhist_BDHM_9.pdf}}\\ \subfloat[][]{\includegraphics[width=.46\textwidth, trim={1.5cm 2cm 2cm 1cm}]{tau_loss_2dhist_BDHM_12.pdf}}\quad \subfloat[][]{\includegraphics[width=.46\textwidth, trim={1.5cm 2cm 2cm 1cm}]{tau_loss_2dhist_BDHM_14.pdf}} \vspace{-1cm} \caption{Distribution of final tau energies and total distance traveled before decay for several initial tau energies. At 10 PeV (upper left) and below, taus lose little energy before decay, while at 1 EeV (upper right) taus reach the critical energy and losses become appreciable. In this regime, the median range increases linearly as the tau becomes more boosted. At 1 ZeV (bottom left) and above (bottom right), these distributions show asymptotic behavior, with taus decaying around 100 PeV and traveling, on average, tens of kilometers.} \label{fig:tau_losses} \end{figure} \subsection{\texttt{TauRunner}\label{sec:tau_runner}} \begin{figure}[htb!] \centering \includegraphics[width=\textwidth]{tautau_final-02.pdf} \caption{Schematic of lepton propagation through the Earth followed by a measurement with the IceCube detector. There are three possible signatures from EeV tau-neutrino secondaries, described here from left to right. Left: A through-going tau track, which is possible for taus at or above 10 PeV. Center: The interaction vertex is contained in the fiducial volume of the detector in this case, producing a cascade from the charged-current interaction, along with an outgoing tau track. Right: The tau decays before reaching the detector, producing a muon in ${\sim}18$\% of the cases, which subsequently enters the detector. For clarity, not all particles involved in the interaction are shown. An additional contribution included in the results but not shown here is a NC interaction inside the detection volume.} \label{fig:tau_runner_schematic} \end{figure} \texttt{TauRunner} is a Python package introduced for this analysis that propagates taus and neutrinos through a given medium, and is available at~\cite{TauRunner}. It begins by calculating the neutrino mean-free-path according to the total cross section and medium properties, followed by a random sampling to obtain the free-streaming distance. We use the Preliminary Reference Earth Model (PREM) \cite{Dziewonski:1981xy} for the density profile of the Earth, and compute the target number density using the isoscalar approximation. At the point of interaction, the specific process (NC or CC) is chosen via the accept or reject procedure. If the neutrino experiences a NC interaction, its energy loss is sampled from the differential cross section, and a new free-streaming distance is sampled. For CC interactions, a tau is created with an energy sampled from the corresponding differential cross sections. Tau energy losses, which include stochastic processes, are then calculated through a modified version of MMC. The tau final energy and distance traveled before decay are recorded. The tau-decay distribution for different modes has been parameterized in \cite{Dutta:2000jv}, from which we sample the energy of the daughter tau neutrino. The neutrino distributions described in \cite{Dutta:2000jv} depend on the polarization of the decaying tau. Taus produced in CC neutrino interactions are highly polarized~\cite{Hagiwara:2003di}. However, above 1 EeV, they undergo several interactions before decaying. As discussed earlier, the dominant interactions allowed before decaying are pair production~\cite{Koehne:2013gpa} and photo-hadronic interactions~\cite{Bugaev:2002gy}. These interactions are implemented in MMC~\cite{Chirkin:2004hz} by calculating the total cross section to all possible final states, which include those that change the tau polarization. This allows for the loss of the tau polarization after multiple scatterings. In order to take this into account, we take the simplifying assumption of considering taus produced above 1 EeV to be unpolarized at the point of decay. Below that energy, we average the negative and positive tau polarization distributions to account for neutrino and anti-neutrino propagation, respectively. From the tau-decay, only the leading tau neutrino is tracked and the process repeats. Propagation continues until the leading particle emerges, at which point the particle identity and final energy are recorded, along with a detailed history of undergone losses and interactions. A schematic showing the relevant outcomes of this process is shown in Fig.~\ref{fig:tau_runner_schematic}. \section{Expected secondary neutrino distributions\label{sec:secondary_flux}} We calculate the tau and neutrino energy distributions after traversing the Earth. We choose one energy value per decade from 100 GeV to 1 ZeV, and test a range of incident angles. Energy distributions from 1 TeV to 100 PeV are shown in Fig.~\ref{fig:energy_dependence}, and an angular distribution for 1 EeV neutrinos is shown in Fig.~\ref{fig:zenith_dependence}. We find that for angles greater than 20 degrees below the horizon and energies above ${\sim}1$ EeV, the secondary neutrino spectra are nearly identical. The reason for this primary energy degeneracy stems from the tau losses. As described in Sec.~\ref{sec:leptons_ehe}, the dominant energy losses grow with energy, which effectively means the tau loses more energy per column density traveled. This results in a flattening of the tau range, corresponding to the asymptotic behavior in Fig.~\ref{fig:tau_losses}. This effect, coupled with the short tau lifetime, causes the tau to travel roughly the same distance and decay around the same energy (10-100 PeV) regardless of its initial energy. We note this is counter-intuitive since one would expect (incorrectly) that a higher-energy incoming neutrino creates a higher-energy tau in a CC interaction, which would result in emerging neutrinos at higher energies. Therefore, the only differences in the secondary neutrino distributions are due to the variation of the first interaction length of the initial tau neutrino. For large enough column depths, this difference is negligible. For Earth-skimming neutrinos, however, the width of the distribution of the first interaction point is comparable to the corresponding column depth. An extended discussion of Earth-skimming neutrinos and their interactions can be found in \cite{Jeong:2017mzv, Dutta:2002zc, Venters:2019xwi, Reno:2019jtr, Dutta:2000jv, Dutta:2005yt}. Fig.~\ref{fig:energy_dependence} shows the secondary neutrino energy distributions after propagation through the Earth for a fixed angle of 30 degrees below the horizon. The gray line is the survival probability given by an exponential whose exponent is the ratio of the propagated distance to the neutrino mean interaction length. Thus, the rightmost bins in the distributions of Fig.~\ref{fig:energy_dependence} indicate the fraction of surviving primary neutrinos and, as expected, match the survival probability. \begin{figure}[ht!] \centering \includegraphics[width=0.95\linewidth]{secondaries_money_plot_Energies.pdf} \caption{Mono-energetic tau neutrinos are injected at 30 degrees below the horizon, at a set of initial energies (specified in the legend), and propagated through Earth to calculate the resulting spectrum at emergence from the Earth. The rightmost bin in each spectrum represents the fraction of neutrinos that did not interact, while the secondary energy spectrum is represented by the curve to the left of each spike. The gray line shows the survival probability of the primary flux calculated for the same distance and column depth.} \label{fig:energy_dependence} \end{figure} The most relevant feature of EeV tau neutrinos traversing the Earth are the energies with which they emerge. Fig.~\ref{fig:zenith_dependence} shows the distribution of outgoing events for an injected flux at 1 EeV, for several incident angles. Near the horizon, one can see the motivation for Earth-skimming detectors. These detectors are most sensitive to neutrinos that undergo a single CC interaction, which is inferred through the detection of the subsequent tau decay shower in the atmosphere. However, at steeper angles, it becomes less likely for a tau to exit the Earth. It's much more likely that the tau will instead decay in the Earth, producing a tau neutrino with energy between 100 TeV and 10 PeV. This is the regime where cubic-kilometer neutrino detectors such as IceCube effectively operate. Thus, there is an opportunity to study cosmogenic fluxes via the detection of cascaded daughter particles. This will be discussed in further detail in Sec.~\ref{sec:GZK}. \begin{figure}[ht!] \centering \includegraphics[width=\linewidth]{zenith_dependent_money_plot_1EeV.pdf} \caption{Tau neutrinos with an initial energy of 1 EeV with different incident angles are propagated through the Earth resulting in the cascaded tau neutrino spectra shown in red. At steep incident angles, exiting tau neutrino energies are centered around 100 TeV, while for shallower incidence, this peak is much higher in energy. The emergence angle $\theta$ is with respect to nadir.} \label{fig:zenith_dependence} \end{figure} \label{sec:secondaries} \section{Applications and Implications\label{sec:applications}} \noindent IceCube has measured the diffuse neutrino flux at energies extending to $\sim$10 PeV, and has placed upper limits at higher energies \cite{Kopper:2017zzm, Aartsen:2016xlq, Aartsen:2015knd, Aartsen:2014gkd}. Although IceCube is sensitive to EHE fluxes directly, and has set limits in that range, these searches are limited to a small region near the horizon since most of the primary flux is lost beyond that. As was discussed previously, radio detectors were developed to look for downgoing as well as near-horizon EeV neutrinos as they skim the Earth, yet no claim of cosmogenic neutrino detection has been made. Two exceptions are the anomalous ANITA events, which were detected at much steeper angles than would be expected from an isotropic neutrino flux. We discuss one of these events here in the context of its predicted PeV counterparts at IceCube. We then study the PeV counterparts of neutrinos from a diffuse cosmogenic flux and show the expected signal in ten years of IceCube data. \subsection{ANITA and its anomalous events\label{sec:ANITA}} The ANITA collaboration has reported the detection of two events whose signatures are consistent with upgoing air showers produced by a tau \cite{Gorham:2016zah,Gorham:2018ydl}. This interpretation requires the decay of a tau (from a tau neutrino CC interaction) to occur in the atmosphere producing an extensive air shower (EAS). This is distinguishable from a reflected EAS initiated by a cosmic-ray, in which the radio signal acquires a phase reversal from reflection off of the Antarctic ice, while an upgoing EAS does not display such a phase reversal. However, this interpretation is problematic as tau neutrinos with energies to which ANITA is sensitive are not likely to travel through the large Earth column depths required for these events. While it has been noted that these events are unlikely to be caused by an isotropic neutrino flux \cite{Romero-Wolf:2018zxt, Fox:2018syq, Chipman:2019vjm}, discrete-source emission could evade these constraints. Beyond the Standard Model (BSM) explanations have also been proposed. This includes axion-photon conversion \cite{Esteban:2019hcm}, sterile neutrinos \cite{Chipman:2019vjm,Huang:2018als, Anchordoqui:2018ucj, Cherry:2018rxj}, and heavy SUSY partners or Dark Matter particle decays \cite{Connolly:2018ewv, Collins:2018jpg, Anchordoqui:2018ssd, Heurtier:2019git, Hooper:2019ytr, Cline:2019snp, Heurtier:2019rkz, Borah:2019ciw}. Here, we examine the discrete-source emission hypothesis and show that any detection of EeV neutrinos from steep incident angles at ANITA can be ruled out by the non-observation of TeV - PeV neutrinos with other neutrino telescopes, such as IceCube. The number of events detected by ANITA due to tau showers in the atmosphere from a primary neutrino flux, $\Phi \left( E _ { \nu } \right)$, is given by \begin{equation} \label{eq:anita_exp} \mathcal{N} _ { \nu } = \int d E_{ \nu } d E^{\prime} _ { \nu } ~ \Phi \left( E _ { \nu } \right) \frac { d N_{\nu} } { d E' _ { \nu } } \left(E^{\prime} _ { \nu } ; E_ { \nu } \right) \xi _ { a c c } \left( E' _ { \nu } \right) \Delta T \; , \end{equation} where $E_{ \nu }$ and $E^{\prime} _ { \nu }$ are the primary and secondary neutrino energy, respectively. $ d N_{\nu} \left( E' _ { \nu }; E _ { \nu } \right) / d E' _ { \nu } $ is the energy distribution of secondary tau neutrinos near the ice surface, $\Delta T$ is the duration of observation, and $\xi _ { a c c } \left( E ' _ { \nu } \right)$ is the ANITA acceptance \cite{Romero-Wolf:2018zxt} in units of cm$^2$sr. The acceptance incorporates the probability of neutrinos interacting in the ice, as well as the probability of a tau decay shower occurring in the atmosphere. Given that the reported acceptance in \cite{Romero-Wolf:2018zxt} includes neutrino propagation through the Earth, we set the acceptance at all angles to be that near the horizon to remove the Earth absorption effects, which we account for separately with \texttt{TauRunner}. For the incoming flux, we take the minimalistic assumption of a delta function in energy, $\Phi \left( E _ { \nu } \right) = \frac{dN}{dA dt dE_{\nu}} = \Phi _ { 0 } \delta \left( E _ { \nu } - E _ { 0 } \right)$, where $\Phi_{0}$ is the normalization with units $\rm{cm}^{-2} \rm{s}^{-1}$. Probabilities of tau neutrinos exiting the Earth with energies greater than 0.1 EeV are shown in Fig.~\ref{fig:tau_prob}, for the chord lengths corresponding to AAE141220. For both taus and tau neutrinos, the probability of exiting the Earth with an energy larger than 0.1 EeV seems to be fairly independent of energy, for initial tau neutrino energies above 1 EeV. Therefore, in what follows, we choose $E_0 = 1$ EeV as the primary energy. Details of this primary energy degeneracy are discussed in more detail in Sec.~\ref{sec:secondary_flux}. \begin{figure}[ht!] \centering \includegraphics[width=0.55\linewidth]{nu_exit_probability_anita_energies.pdf} \caption{Probability for a tau neutrino to exit Earth with a minimum energy of 0.1 EeV (approximate ANITA threshold), after Earth propagation (based on inferred chord length for AAE141220), assuming $\nu_{\tau}$ incidence at a particular initial energy. Errors are statistical only.} \label{fig:tau_prob} \end{figure} As was discussed above, this primary flux of EeV neutrinos is guaranteed to be associated with a secondary flux of TeV to PeV neutrinos. Such a large rate of TeV muons crossing the IceCube volume simultaneously would deposit a large amount of charge. Large-charge events are promptly reported by IceCube via the EHE and HESE streams\footnote{\url{https://gcn.gsfc.nasa.gov/amon.html}}. For example, the EHE stream requires three thousand photo-electrons and thirty channels to trigger an alert. A $\sim$1 PeV muon typically deposits $\sim$200 TeV, which on average results in over four thousand photo-electrons in more than 40 channels, when crossing the full detector \cite{jvs}. In fact, the largest energy deposition reported in these streams corresponds to 5 PeV deposited energy\footnote{\url{https://gcn.gsfc.nasa.gov/gcn3/24028.gcn3}}, but it's for a down-going event; horizontal and upward going events have not had multi-PeV announcements in these streams. Thus, we conclude that IceCube has not observed catastrophic events that would be produced by bundles of TeV neutrino-induced muons. In what follows, we then take the conservative assumption that a single muon makes it through. Such events have been observed and we can compare this expected yield to IceCube's measurement of the high-energy events. We find the maximum allowed normalization of the incident flux by comparing the secondary neutrino distribution with the measured IceCube astrophysical flux from the High-Energy Starting Event selection (HESE) \cite{Kopper:2017zzm}. Results for AAE141220 are shown in Fig. \ref{fig:ANITA_UL}. The unfolded HESE spectrum is folded back to the detector using \texttt{TauRunner} as discussed in Sec.~\ref{sec:tau_runner}. The 90\% C.L upper limit on the EeV primary flux normalization is set by comparing both secondary distributions and requiring that the secondaries produced by the primary EeV flux do not exceed those of HESE at 90\% C.L. Given that the time profile of the intrinsic flux is unknown, we place limits on the time-integrated flux. We take the duration to be 22 days ($\Delta T$ in Eq.~\eqref{eq:anita_exp}), corresponding to the entire ANITA-III flight. We find the maximum allowed time-integrated flux to be $E^2 \Phi \Delta T \simeq 10^2$ GeV cm$^{-2}$. Using the maximum allowed time-integrated flux, we calculate the expected number of events at ANITA. This yields a maximum expected number of neutrinos of less than $ \mathcal{O}\left(10^{-7}\right)$ in 22 days. This is illustrated in Fig.~\ref{fig:ANITA_UL} where we show the flux required to produce one event at ANITA as a reference. It is therefore highly unlikely for the reported event to be caused by a high-energy tau neutrino. In this analysis, we integrate the IceCube measurement of the astrophysical flux over 22 days. However, as this measurement was made over six years, we are working under the assumption that the astrophysical flux has no large dependence on time. It is worth noting, however, that short timescale transients are allowed to overproduce the measured astrophysical flux, so long as they do not overproduce the astrophysical flux integrated over the duration of the measurement. For this reason, a dedicated analysis by IceCube searching for short timescale emission around the time of the ANITA event ought to be performed. \begin{figure}[] \centering \includegraphics[width=0.75\linewidth]{anita_is_dead.pdf} \caption{Maximum allowed flux of EeV neutrinos (maroon arrow), given an injected mono-energetic neutrino flux at or above the detected ANITA event (AAE141220) energy. The normalization of the secondary flux is set to the maximum that does not exceed IceCube's diffuse astrophysical flux (black bins). The flux needed to produce one event in the third flight of ANITA (blue marker) exceeds the upper limit by many orders of magnitude. We use the published spectrum based on six years of high energy starting events.} \label{fig:ANITA_UL} \end{figure} \subsection{Cosmogenic Flux} \label{sec:GZK} At energies beyond the so-called Greisen-Zatsepin-Kuzmin (GZK) cutoff ($E \geq 40$ EeV), proton interactions with the CMB restrict the mean-free path of cosmic-ray nuclei primaries to less than a few hundred Mpc from sites of cosmic acceleration. A suppression compatible with the GZK cutoff has indeed been observed in cosmic-ray experiments \cite{Abbasi:2007sv, Sokolsky:2008zz, Abraham:2008ru, AbuZayyad:2012ru}. The subsequent decay of the mesons from these interactions leads to an observable, yet currently undetected, flux of cosmogenic neutrinos. Although the cosmogenic flux should be isotropic at Earth, searches for this flux have been limited to either half of the sky (downgoing) or small solid angles, specifically looking for Earth-skimming neutrinos, where the probability of detecting a tau in the atmosphere after a single neutrino interaction in the Earth is optimized \cite{Abbasi:2010ak, Barwick:2014pca, Aab:2015kma, Aartsen:2016ngq, Allison:2015eky,Allison:2018cxu,Aartsen:2018vtx,Aab:2019auo, Kotera:2010yn}. Here, we show how using the secondary flux will extend this search to the entire sky. Specifically, we look for neutrinos after several interactions in the Earth, which we have shown emerge at $\mathcal{O}$(PeV) energies. We also show that the rate from Earth-traversing neutrinos is not negligible. \begin{figure} \centering \includegraphics[width=0.85\textwidth]{one_dimensional_primary_and_secondary_northernsky_wide.pdf} \caption{Per flavor neutrino fluxes from 1 TeV to 10 EeV, integrated over the Northern Sky. Primary fluxes are shown in solid lines, and fluxes present at the IceCube detector are shown in dashed-dotted lines and hatches. $\nu_{\tau}$ components for various models of the cosmogenic flux are shown in red and orange \cite{Ahlers:2010fw}. These spectra are compared to models of both the conventional \cite{Honda:2006qj} and prompt \cite{Enberg:2008te} components of the atmospheric flux as well as measurements of the diffuse astrophysical flux \cite{Haack:2017dxi}. Secondary $\nu_{\tau}$ spectra peak at PeV energies, a region of parameter space optimal for neutrino telescopes such as IceCube.} \label{fig:gzk_and_friends_wholesky} \end{figure} Fig.~\ref{fig:gzk_and_friends_wholesky} displays the secondary tau neutrino flux of cosmogenic neutrinos compared to atmospheric and diffuse astrophysical per-flavor neutrino fluxes in the Northern sky. For a cosmogenic flux, we choose a model produced from a fit to HiRes data \cite{Ahlers:2010fw}. The conventional component in Fig.~\ref{fig:gzk_and_friends_wholesky} shows the $\nu_{\mu}$ flux produced in cosmic-ray showers in the atmosphere, using the model in \cite{Honda:2006qj}. The prompt component is the expected muon neutrino flux arising from atmospheric charm production in cosmic-ray showers; we use the model in \cite{Enberg:2008te}. Although there is a predicted $\nu_{\tau}$ component of this prompt flux, predominantly from D-meson decays, the level of this flux is much smaller compared to the prompt $\nu_{e,\mu}$ components. The astrophysical muon-neutrino flux we use is based on eight years of Northern sky muon track data from IceCube \cite{Haack:2017dxi}. All of these primary fluxes are propagated to the detector. The fluxes arriving at the detector are then compared to the secondary flux from cosmogenic neutrinos. The spectrum of the secondary cosmogenic flux is much harder and strongly dependent on declination, providing additional handles to distinguish cosmogenic secondaries from other astrophysical or atmospheric events. To further highlight the expected signal shape, we show the resulting expected signal distribution of this benchmark model in Fig.~\ref{fig:GZK_signal}. The number of expected signal events at IceCube is calculated by propagating a $\nu_{\tau}$ flux isotropically over the Northern hemisphere from incidence on the Earth to a few kilometers away from IceCube. The number of events expected at IceCube is then given by \begin{equation} \mathcal{N}_{\nu}^{\rm{GZK}} ~ = \int dE^{\prime} d\Omega ~ \Phi_{\nu} (E^{\prime}_{\nu}) \Delta T \left[ \sigma_{\nu N}^{CC} (E_{\nu}^{\prime}) \cdot ~ \frac{\Gamma_{\tau \rightarrow \mu}}{\Gamma_{total}} \cdot N^{CC}_{N}(E_{\nu}^{\prime}) + \sigma_{\nu N}^{NC}(E_{\nu}^{\prime}) \cdot N^{NC}_{N} \right], \end{equation} where $ \Phi_{\nu} (E'_{\nu})$ is the emerging flux near the detector, $\sigma_{\nu N}^{CC}$ and $\sigma_{\nu N}^{NC}$ is the neutrino-nucleon isoscalar cross section for charged- and neutral- current, respectively. $\Gamma_{\tau \rightarrow \mu} / \Gamma_{total}$ is the tau to muon branching fraction, and $N_{N}$ is the effective number of isoscalar targets. This number is fixed to be $N$ targets in 1 km$^3$ of ice for the NC channel, but has an energy dependence for the CC channel due to the extended muon range, and is given by, \begin{equation} N^{CC}_{N} \left( E_{\nu} \right) = \int d\tilde{E_{\mu}}d\tilde{E}_{\tau} \frac { d N_{\tau} } { d \tilde{E}_{ \tau} } \left(\tilde{E} _ { \tau } ; E^{\prime}_ { \nu } \right) \frac { d N_{\mu} } { d E_{ \mu} } \left(E_{\mu} ; \tilde{E} _ { \tau } \right) R_{\mu} \left(E_{\mu} \right) A^{geo} \frac{\rho^{ice}}{M_{iso}}. \label{eq:ncc} \end{equation} \begin{figure}[!ht] \centering \includegraphics[width=0.9\textwidth,trim={0cm 0cm 0cm 0cm}]{GZK_secondaries_nsignal_summed_channels_other_model.pdf} \caption{Expected signal of cosmogenic neutrinos at IceCube, assuming the model from \cite{Ahlers:2010fw} and assuming a cosmic-ray composition that is dominated by protons above energies of $10^{17.5}$ eV, after 10 years of data collection. The Earth-skimming contribution represents only about one third of the total expectation, and the majority of events are expected to peak around 10 PeV in true neutrino energy. } \label{fig:GZK_signal} \end{figure} \noindent The first and second term in Eq.~\ref{eq:ncc} are the tau and muon energy distributions, respectively, $R_{\mu} \left(E_{\mu} \right)$ is the average muon range calculated with MMC, $A^{geo}$ is the geometrical transverse area (1 km$^2$ in this case), $\rho^{ice}$ is the density of ice, and $M_{iso}$ is the isoscalar nucleon mass. Fig.~\ref{fig:GZK_signal} shows the expected number of events at IceCube binned in true neutrino energy and declination. We find that, assuming a proton-dominated UHECR flux with a minimum crossover energy of 10$^{17.5}$ eV (10$^{18.5}$ eV), IceCube should see 2.70 (1.25) upgoing neutrinos with a hard energy spectrum, peaking at 10 PeV, in ten years of data taking. These events are dominated by the CC channel, with only around 10\% of the signal coming from NC interactions in the fiducial volume of the detector. Of all of the events, we find that only $\sim$0.8 (0.5) would be Earth-skimming, where we have defined Earth-skimming to be up to 5 degrees below the horizon. Therefore, in total, we expect the rate from Earth-traversing neutrinos to be at least twice that from Earth-skimming neutrinos. Fig.~\ref{fig:gzk_and_friends_bands} further demonstrates the declination dependence of this flux through comparison to atmospheric backgrounds, and shows that in certain zenith angle bands with large enough column depth through the Earth, the flux arriving at IceCube is higher than the atmospheric background at and above 2 PeV. It is important to note that testing several cosmogenic models showed that this technique yields more expected events when the primary fluxes peak at energies below 1 EeV. While cosmogenic neutrino fluxes predicted from heavy cosmic-ray nuclei primaries suppress the component at and above 1 EeV, they boost the expectation between 1 and 100 PeV. Therefore, this indirect detection method can prove essential if the cosmic-ray primary composition is determined to be dominated by heavy nuclei. \begin{figure} \centering \subfloat[][]{\includegraphics[width=.46\textwidth, trim={1cm 1.25cm 1cm 1cm } ]{one_dimensional_primary_and_secondary_025_00.pdf}}\quad \subfloat[][]{\includegraphics[width=.46\textwidth, trim={1cm 1.25cm 1cm 1cm }]{one_dimensional_primary_and_secondary_05_025.pdf}}\\ \subfloat[][]{\includegraphics[width=.46\textwidth, trim={1cm 1cm 1cm 1.25cm }]{one_dimensional_primary_and_secondary_075_05.pdf}}\quad \subfloat[][]{\includegraphics[width=.46\textwidth, trim={1cm 1cm 1cm 1.25cm }]{one_dimensional_primary_and_secondary_10_075.pdf}}\\ \caption{Per flavor neutrino fluxes from 1 TeV to 10 EeV, integrated over various zenith bands in the Northern Sky. Solid lines are primary fluxes, while secondary fluxes are represented by dashed-dotted lines and hatches. The secondary cosmogenic tau neutrino spectrum is strongly dependent on the incoming zenith angle. For arrival directions towards Earth's core, it contributes equally to the astrophysical flux at IceCube above 2 PeV.} \label{fig:gzk_and_friends_bands} \end{figure} \section{Discussion and Conclusion} In this work we have introduced a new Monte Carlo package, \texttt{TauRunner}, to propagate EHE neutrinos and taus, including updated cross section models and tau energy losses. We apply this calculation to two interesting cases. In the first case, we consider the anomalous ANITA events and find that the maximum allowed secondary neutrino flux constrained by IceCube measurements implies a primary flux that is inconsistent with a Standard Model neutrino explanation of AAE141220. We calculate that ANITA should see less than $\mathcal{O}\left(10^{-7}\right)$ events in the reported direction during the entire third flight, requiring a significant over-fluctuation to detect one event. As shown above, this conclusion is independent of the incident spectral shape and time profile. In the second case, we propagate cosmogenic neutrino fluxes through the Earth and find that the secondary flux of TeV-PeV neutrinos from cascaded cosmogenic fluxes is a non-negligible contribution to the total astrophysical flux at IceCube. Depending on the primary model used, this secondary flux can reach 20\% of the total flux at the detector above a PeV. We calculate the expected number of events from secondary cosmogenic neutrinos as well as their energy and zenith distributions. We find that the expected rate at IceCube from secondary neutrinos is twice the rate at the horizon, albeit at lower energies where the astrophysical background is higher. In the future, the larger effective area of IceCube Gen2 will allow a dedicated IceCube analysis to fit for this signal using its joint spectral and angular distribution and provide a complementary measurement to detectors optimized for the EeV scale. \label{sec:conclusion} \acknowledgments We would like to thank Segev BenZvi, Dmitry Chirkin, Sam Fahey, Mary-Hall Reno, Subir Sarkar, and Abigail Vieregg for useful discussions. We thank Kareem Farrag for creating the schematic in Figure 3, and for useful discussions. CA is supported by NSF grant PHY-1801996. FH, RH, AK, AP, IS, and JV are supported by NSF under grants PLR-1600823 and PHY-1607644 and by the University of Wisconsin Research Council with funds granted by the Wisconsin Alumni Research Foundation. \bibliographystyle{JHEP}
\section{Introduction} \IEEEPARstart{T}{he} introduction of robots to manufacturing industries aims to reduce human workload, increase productivity, and decrease operation costs. Towards realizing these goals, robots must be able to adapt to industrial environments, work alongside humans, and manipulate tools to complete given tasks. Particularly, motion planning for handling tools represents a unique challenge for planners: The tool acts as a dynamic obstacle when it is being manipulated by the robot and its position and orientation during the manipulation task must be accurately computed to avoid robot-object and object-environment collisions. The tool manipulation problem gets considerably more complicated when the tool is tethered (possesses a cable). Cables are soft and dynamic obstacles for motion planning -- Their position and orientation are considerably hard to compute due to their nature. The cable shape changes according to the robot actions, the tension applied to it, and the cable elasticity. These properties cause uncertainty and complicate the avoidance of robot-cable and obstacle-cable collisions. Furthermore, when the robot end-effector rotates around the tool cable, it can get snarled around the robot hand, producing undesired entanglements and cause damage to the robot and the tool. Thus, preventing robot-cable entanglements is an important goal for tethered tool manipulation. \begin{figure}[!htpb] \begin{center} \includegraphics[width=.95\linewidth]{figs/teaser.jpg} \caption{(a) A human handles a tethered tool using both arms: One arm is used for manipulating the tool; The other is used for manipulating the cables. (b) The proposed planner motivated by the human strategy.} \label{fig:teaser} \end{center} \end{figure} In this paper, we present a planner for manipulating tethered tools using dual-armed robots. The planner is motivated by human manipulation strategies widely seen in our daily life. Fig.\ref{fig:teaser} shows an example. The human in the figure handles a tethered tool using both arms: One arm is used for manipulating the tool; The other is used for manipulating the cables. Following this strategy, we develop a dual-arm tethered tool manipulation planner which generates an Object Manipulation Motion Sequence (OMMS) to handle the tool, and a Cable Manipulation Motion Sequence (CMMS) constrain the cable. The planner can prevent entanglement and guarantee that the robot (1) avoids bending the tool cable in excess, and (2) avoids cable-robot and cable-environment collisions when possible. Especially, our implementation uses a tool balancer and a cable slider. The balancer simplifies the cable deformation problem by constantly applying a pulling force, which forces the cable to form a straight line, facilitating the obstacle-avoidance computations. The cable slider is a self-designed mechanical device attached to the tool cable. The slider stuck to the cable when it is not held by the robot. When it is pressed the slider is released, and it allows the cable to slither through a central hole freely. Fig.\ref{fig:teaser}(b) shows the robot, its working environment as well as the cable slider (the blue box held by the right arm). The tool balancer is not shown, but it is hanged overhead straightening the cable. Besides the developed planner, this paper also provides a metric to evaluate the cable state or snarling around the robot end-effector, which can be used to compare our solution to other methods. The planner guarantees minimal robot-cable contact and avoids undesired entanglements by preventing excess bending. Simulations and real-world experiments help validate the presented solution. \section{Related work and Contribution} This paper develops a motion planning solution for tethered tool manipulation using dual-armed robots. It emphasizes the prevention of entanglements to increase robot safety and manipulation success rates. Accordingly, this section reviews related publications on motion planning and manipulation planning, with particular attention given to cable-like objects. \subsection{Motion planning} A considerable amount of publications are aimed to develop robot motion planning\cite{masehian2007classic}. Early and influential work on motion planning include algorithms for path planning \cite{lozano1979algorithm} as well as approaches based on fuzzy logic \cite{vachtsevanos1986fuzzy,walker2000fuzzy}, genetic algorithms \cite{parker1989inverse,gen1997genetic}, and neural networks \cite{zacksenhouse1988neural,kozakiewicz1991neural}. Nowadays, more refined methods for motion planning have been proposed. For example, in \cite{finn2017deep} a model predictive control algorithm based on probabilistic inference through a learned predictive image model is presented. The algorithm is used to plan for actions that move user-specified objects in the environment to user-defined locations. \cite{ichter2018learning} presents a methodology for nonuniform sampling to accelerate sampling-based motion planning. In \cite{solovey2016finding}, a discrete RRT algorithm for path planning is shown. \cite{pellegrinelli2017motion} shows an integrated motion planning and scheduling method for human and industrial-robot collaboration. \subsection{Manipulation planning} Manipulation planning can be considered as a constrained case of motion planning. The motion sequences generated by manipulation planning allow the robot to move objects and to modify its environment's structure \cite{alami1994two}. The planning process takes into account the movement of the robot in an environment with movable (manipulated) objects in addition to the environment static obstacles. Recently, manipulation planning has been the focus of several work such as algorithms for single-arm and dual-arm object pick-and-place using regrasps \cite{wan2016developing}, a probabilistically complete planner for prehensile and non-prehensile actions in cluttered environments \cite{garrett2015backward}, an algorithm to preserve object stability under changing external forces \cite{chen2018manipulation}, planning solutions for manipulating an elastic object from an initial to a final configuration \cite{lamiraux2001planning}, a planning framework that uses non-prehensile actions for the rearrangement of clutter and manipulation of object pose uncertainty \cite{dogar2012planning}, and a manipulation planner for the cleaning of planar surfaces \cite{martinez2015planning}. \subsection{The manipulation planning of cable-like objects} In particular, motion planning and manipulation planning for handling cables or cable-like objects represents a challenging task. Several strategies have been proposed to solve the task. For example, a study on quasi-static manipulation of a planar kinematic chain is presented in \cite{mccarthy2012mechanics}. A control solution, for the manipulation of a fire hose, was shown in \cite{ramirez2016motion}. A planner for manipulation of interlinked deformable linear objects for aircraft assembly was shown in \cite{shah2018planning}. A planning method for knotting/unknotting of deformable linear objects \cite{wakamatsu2006knotting}, and a motion planner to manipulate deformable linear objects is described in \cite{saha2008motion}. \subsection{Contributions} The work mentioned above presents solutions for manipulating cable-like objects, but they do not address robot-cable entanglement avoidance or excessive bending. The definition of cable entanglement can be subjective. In theory, if the robot avoids collision with the tool cable, there will be no entanglements. However, in practice, contact between the robot arm and the cable is often unavoidable. In such cases, it is important to establish a criterion to differentiate between dangerous cable collisions and unavoidable but manageable robot-cable contact. We do so by defining the angle accumulation concept and design a planner that tries to diminish the accumulated angle. In one of our previous work \cite{sanchez2019arm}, we presented a planning solution for regrasp manipulation of tethered tools with tool balancers, but that solution was based on avoiding robot poses or motions that could cause entanglements. The solution helped to avoid collisions with the cable but significantly diminished the freedom of movement of the robot. Unlike the previous solution, in this work, we generate a motion sequence to manipulate both the cable and the tool and diminish cable collisions. The cable maneuvering motions are performed to control the cable bending angle and keep it away from others. \section{Manipulation Planning for Tethered Tools} The present method for tool manipulation employs a tool balancer to suspend the manipulated tools. A tool balancer is a device that provides a cable to hang tools. The cable presents a constant pulling force that simplifies the cable deformation problem by making the cable form a straight line between its endpoint and the tools connection point, as seen in Fig.\ref{fig:toolbalancer}. \begin{wrapfigure}{r}{0.47\linewidth} \centering \includegraphics[width=.95\linewidth]{figs/toolbalancer.jpg} \caption{The cable of the tool balancer presents a constant pulling force that simplifies the cable deformation into a stright line.} \label{fig:toolbalancer} \end{wrapfigure} In our case, the installation of the tool balancer plays a key role in the success of tool manipulation. The initial position of the tool balancer was chosen using a manipulability-reachability based rating method. The method is used to determine the best starting positions for the balancer. The planner computes two motion sequences to realize tethered tool manipulation. The first motion sequence is an Object Manipulation Motion Sequence (OMMS), which is computed using our previously proposed single-arm manipulation planner \cite{wan2016developing} to manipulate the tool and place it in the desired pose. The second sequence, the Cable Manipulation Motion Sequence (CMMS), is used to modify the tool cable shape: The robot manipulates a cable slider to control the bending and the position of the cable. The CMMS diminishes the occurrence of robot-cable collisions by placing the cable directly behind the tool during its manipulation. \subsection{Cable angle accumulation and entanglement avoidance} In principle, if the robot avoids any contact between the cable and itself or the environment, then it can avoid entanglements entirely. In practice though, these conditions are not always possible since the robot end-effector is usually close to the tool cable. Furthermore, slight contact between the end-effector and the tool cable can be tolerated if it does not represent a risk for either. \begin{wrapfigure}{r}{0.47\linewidth} \centering \includegraphics[width=.95\linewidth]{figs/bending.jpg} \caption{A 2D illustration of angle accumulation. If the cable bending angle (blue and red segments) surpasses the angle of grasping or 90 degrees, the cable starts to get snarled around the end-effector (red segments). The arabic numbers indicate the quadrants in the tool reference frame.} \label{fig:angleacc} \end{wrapfigure} To tackle this problem, we introduce the concept of angle accumulation. Angle accumulation represents the extra rotation of the cable around a collision point in the end-effector -- If the tool cable collides with the robot end-effector, subsequent rotations around the collision point will cause the cable to get more snarled around the robot. Thus, it is important to prevent or diminish angle accumulation. Fig.\ref{fig:angleacc} helps illustrate the concept. The figure shows a 2D simplification the angle accumulation problem. By representing the tool cable as a straight line (thanks to the tool balancer) and measuring the angle of bending at the tool reference frame, we can determine if the cable stays within a permissible zone. If the tool cable bending (measured as 0 when the cable is in the $\alpha_{r}$ reference state, equivalent to the $\alpha_{0}$ state in Fig. \ref{fig:angleacc}), stays within the permissible states (its bending angle does not surpass the angle of grasping $\beta$ or 90 degrees), we can assume the cable will not collide with the end-effector or the tool itself. If on the other hand, the cable bending goes beyond the maximum angle $\beta$, we say it is in a state of angle accumulation around the end-effector. If the cable surpasses the 90 degrees of bending while rotating clockwise (using Fig.\ref{fig:angleacc} as reference) we say the cable is in a state of angle accumulation around the tool. To calculate the angle accumulation around the end-effector for a cable state $\alpha_{i}$, we use Eq.\eqref{eq:angleacc} to compute the accumulation magnitude: \begin{equation}\label{eq:angleacc} A_{cc}(i) = \left \{ \begin{matrix} 0 \mbox{ if $\angle\alpha_{r}\textit{T}\alpha_{i} < \beta$, else }& \mbox{ }\mbox{ \mbox{}} \\ A_{cc}(i - 1) + \eta_{\phi}(\alpha_{i})\{\angle\alpha_{r}\textit{T}\alpha_{i} - \angle\alpha_{r}\textit{T}\alpha_{i-1}\}-\beta & \mbox{}\end{matrix}\right. \end{equation} Here, $\alpha_{r}$ represents the cable with no bending, equivalent to $\alpha_{0}$ in Fig.\ref{fig:angleacc}. $\textit{T}$ is the connection point between the cable and the tool. $\alpha_{i}$ is the $i$-th cable state, which is represented as a vector or a straight line that goes from the tool tail to the cable anchor point (tool balancer or cable slider). Basically, the function adds up the differential changes in angle between cable states $\alpha_{i}$ and the reference state $\alpha_{r}$. The value of $\eta_{\phi}(\alpha_{i} ))$ acts as a memory variable with values that depend on the cable position, based on the quadrants at the tool local reference frame, the value of $\eta_{\phi}( \alpha_{i})$ is described by Eq.\eqref{eq:etavalue}: \begin{equation}\label{eq:etavalue} \eta_{\phi}(\alpha_{i}) = \left \{ \begin{matrix} 1 & \mbox{if }\mbox{ $\alpha_{i}\in$\mbox{ quadrants 1 or 2}} \\ -1 & \mbox{if }\mbox{ $\alpha_{i}\in$\mbox{ quadrants 3 or 4}}\end{matrix}\right. \end{equation} The variable $\eta_{\phi}(\alpha_{i})$ is used to correct the addition of differential accumulation when the cable enters quadrants 3 and 4 shown in Fig.\ref{fig:angleacc}. For example, If the cable starts at state $\alpha_{0}$ and rotates counter-clock wise, we must adjust the sign of the magnitude $\angle\alpha_{0}\textit{T}\alpha_{i} - \angle\alpha_{0}\textit{T}\alpha_{i-1} $ after the cable surpasses state $\alpha_{4}$, otherwise, the differential sum $\angle\alpha_{0}\textit{T}\alpha_{i} - \angle\alpha_{0}\textit{T}\alpha_{i-1} $ will be negative and the angular accumulation will decrease when, in reality, the cable is getting more snarled around the end-effector. To calculate the angle accumulation around the tool, (for clock-wise rotations, using Fig.\ref{fig:angleacc} as reference) we can use: \begin{equation}\label{eq:angleacc2} A_{cc}(i) = \left \{ \begin{matrix} 0 \mbox{ if $\angle\alpha_{r}\textit{T}\alpha_{i} < 90$, else }& \mbox{ }\mbox{ \mbox{}} \\ A_{cc}(i - 1) + \eta_{\theta}(\alpha_{i})\{\angle\alpha_{r}\textit{T}\alpha_{i} - \angle\alpha_{r}\textit{T}\alpha_{i-1}\}-90 & \mbox{}\end{matrix}\right. \end{equation} where $\eta_{\theta}=-\eta_{\phi}$. To determine if the angle accumulation is around the tool or the end-effector, we can check in which quadrant the cable is located when its bending surpasses 90 degrees or $\beta$ respectively. \subsection{High manipulability region} The initial installation position of the tool balancer is an important factor in successful manipulation planning. A non-optimal installation position can pose the tool and cable slider in difficult to grasp positions, hindering the planner ability to find a solution for a given manipulation task. Intuitively, the effectiveness of our planner depends on the initial position of the tool balancer. If the balancer is too far from the robot, the number of IK-feasible grasps of the cable slider and the tool decreases. On the other hand, if the tool balancer is too close to the robot, the maneuvering space for the tool cable could be too small, increasing the risk of robot self-collision. Also, the robot should be able to grasp the tool and the cable using both arms, so the balancer must be centered in front of the robot. Following these considerations, we optimize the initial installation position of the tool balancer by using a rating method based on the robots reachability and manipulability. Our rating method computes the most advantageous positions for the tool balancer and is also used to compute a region of high manipulability. \subsubsection{Grasp-based reachability region for dual armed robots} An optimal tool balancer position can help the planner by (1) placing the tool and its cable in a position of high reachability and manipulability, and (2) giving the robot enough room to maneuver the tool and the cable. We employ a reachability test for the robot workspace to find balancer positions that comply with both requirements, to find an optimal balancer position. Firstly, we map the workspace into several points in a grid separated by 50 $mm$ each. Secondly, we tasked our IK-solver to generate IK solutions to place the robot end-effectors in every point of the grid. The points with at least one IK solution are cataloged as reachable. These reachable points are then used to map the robot workspace with regions of reachability $\Omega_{r}$ and $\Omega_{l}$ for the right and left arms respectively. A region of dual-arm reachability can be computed by intersecting $\Omega_{r}$ and $\Omega_{l}$ like in Eq.\eqref{eq:reachabilityregion}: \begin{equation}\label{eq:reachabilityregion} \Omega = \Omega_{r}\cap\Omega_{l} \end{equation} The resulting region, $\Omega$ contains candidate positions for the tool placement. Since the tool balancer is used to hang the tool vertically, once the horizontal or $\textit{\textbf{x}}$ and $\textit{\textbf{y}}$ coordinates of the balancer (in the robot reference frame) are set, the tool and the cable slider can only change their resting position in the vertical axis. We aim to find a position in the robot horizontal plane ($\textit{\textbf{x}}$-$\textit{\textbf{y}}$ plane) that maximizes the dual-arm reachability in the robot vertical axis. To choose the optimal $\textit{\textbf{x}}$ and $\textit{\textbf{y}}$ coordinates for the balancer position, we evaluate each $\textit{\textbf{x}}$-$\textit{\textbf{y}}$ coordinate pair in our grid by counting the reachable points in their vertical axis. That is, we fix the $\textit{\textbf{x}}$ and $\textit{\textbf{y}}$ coordinates and test the reachability of the points in the vertical axis $\textit{\textbf{z}}$, increasing the height 50 $mm$ at a time. The $\textit{\textbf{x}}$-axis in the robot reference frame points to the robot front, the $\textit{\textbf{y}}$-axis points to the robot left-hand side and the $\textit{\textbf{z}}$ -axis points upwards. From our analysis, the coordinate pair $(300,0)[mm]$ (300 $mm$ in front of the robot, centered between its arms) yielded the highest amount of evaluated reachable points along the vertical axis $\textit{\textbf{z}}$, with 15 reachable points. Nonetheless the $\textit{\textbf{x}}$-$\textit{\textbf{y}}$ coordinate pair is dangerously close to the robot frame, which significantly impairs our CMMS since the CMMS normally places the cable-holding arm behind the tool-handling arm, leading to very close motion and a small zone near the robot body. To avoid these problems, we decided to place the tool balancer farther in front of the robot, at the coordinates $(450, 0, 1800)[mm]$ at the cost of selecting a pair of $\textit{\textbf{x}}$-$\textit{\textbf{y}}$ coordinates with 14 reachable points along the $\textit{\textbf{z}}$-axis. \subsubsection{Grasp-based manipulability analysis} The CMMS involves motions to make the cable-holding arm follow the movement of the tool while grasping a cable slider. Usually, these motions place the cable-holding arm in a region between the robot-body and the tool-handling arm. In this region the arm robot requires high mobility to avoid collisions and complete its task. To ensure high mobility for the cable-holding arm, we would like to place the cable slider in a region with a high expected manipulability index. The manipulability of a robot represents its ability to position and re-orientate its end-effector given an initial joint configuration. While inspecting the infinite joint configurations of the robot arm is impractical, we can perform a grasp-based analysis to obtain an expected or average manipulability based on the cable slider position and the IK-feasible grasps for that particular position. The result is an average value of manipulability associated with a point in space. To compute the expected manipulability of a point in space, we place the slider in this point using our simulation environment. Then, we compute the IK solutions if they exist, that allows the robot to grasp the tool using the grasps stored in our grasp database \cite{wan2017iros}. For simplicity, the slider orientation is fixed to a single value when evaluating the possible grasps. Our algorithm then evaluates the manipulability of each Ik solution and computes the median value for a single point in the robot workspace using Eq.\eqref{eq:graspmanipulability}: \begin{equation}\label{eq:graspmanipulability} M(p(x,y,z)) = \frac{\sum\limits^{G(p(x,y,z))}_{n=0}{m(g_{n}(p(x,y,z)))}}{G(p(x,y,z))} \end{equation} Here, $M$ is the average manipulability score for a point $p(x,y,z)$, $G(p(x,y,z))$ is the total (non-zero) amount of IK-feasible grasps for the slider in point $p(x,y,z)$, $m$ is a function that returns the manipulability of the robot based on its joint angles and its maximum angles of rotation and $g_{n}$ is the $n$-th set of joint angles that place the robot end-effector in the pose necessary to execute the $n$-th grasp. Fig.\ref{fig:Manipulability Analysis} shows the process of calculating the manipulability for two different slider positions. \begin{figure}[!htpb] \begin{center} \includegraphics[width=.95\linewidth]{figs/manipulability.jpg} \caption{Manipulability Analysis. Left: We compute the different grasps of the tool balancer for two cable slider positions. The manipulability for each grasp is calculated and added to a total value. The position with the highest average manipulability $M$ and possible grasps $G$ is a more desirable starting position for the slider. Right: Manipulability spheres. Within the radius of the spheres, the values M and G stay above threshold values based on a position of high manipulability and high amount of IK-feasible grasps.} \label{fig:Manipulability Analysis} \end{center} \end{figure} Using Eq.\eqref{eq:graspmanipulability}, we computed the average manipulability and available grasps within the grid used in the previous sub-section. The highest average manipulability scores were registered within a certain region of the robot workspace. By using these scores, we can create a ``manipulability sphere'' to represent this region in which the number of possible slider grasps $G(p(x,y,z))$ and the score $M$ stay above certain reference values. We used the coordinates $(400,0,1450)[mm]$ as our reference point since it has a central location in the robot reachable zone, the coordinates yielded a $M_{p}$ value for the average manipulability and $G_{p}$ number of unique Ik-feasible grasps. Afterward, we explored the remaining points in the grid and realized that, by keeping the slider within a 150 $mm$ radius from the reference point, the manipulability and available grasps of the evaluated points stay above $0.8M_{p}$ and $0.5G_{p}$. Since the chosen tool balancer position will directly place the slider at the coordinates $(450, 0, z)[mm]$, where the height $z$ is variable, we can assume the initial position where the slider will most likely be within $150[mm]$ of the reference point and a relatively high manipulability for the initial grasp can be expected. Fig.\ref{fig:Manipulability Analysis} shows a representation of the manipulability sphere of $150[mm]$ and $200[mm]$ and the minimum $M$ and $G$ values registered within these regions. \subsection{Object manipulation planning} The OMMS is generated in three steps using our previous planner \cite{wan2016developing}. Firstly, the planner selects a candidate object grasp ${}^{}_{}{C}^{\text{h}}_{}$ from a previously-built database to pick-up the object in a starting pose. The grasp database \cite{wan2017iros} is computed offline in the object's local coordinate system $\Sigma_{\text{t}}$. Secondly, the planner checks the IK-feasibility and robot-object collisions of the start and goal robot grasping poses. The grasping poses are represented by a given end-effector transformation matrix ${}^{\text{o}}_{}{T}^{}_{}$ which can be computed using Eq.\eqref{eq:graspingpose}: \begin{equation}\label{eq:graspingpose} {}^{\text{o}}_{}{T}^{}_{} = {}^{}_{}{C}^{\text{h}}_{} {}^{}_{}{O}^{\text{o}}_{} \end{equation} Here, ${}^{}_{}{O}^{\text{o}}_{}$ represents the transformation matrix of the tool for a given pose (starting or goal object pose) in the robots reference frame $\Sigma_{\text{o}}$. Finally, the planner connects the starting and goal grasping poses of the object through an intermediate/transfer robot poses generated by an RRT-based sampling method. The result is a series of motions that allow the robot to grasp an object, maneuver it through its workspace, and place it in the desired goal pose. The object movement associated with this motion sequence is subsequently used to plan the CMMS. \subsection{Cable manipulation planning} The CMMS is computed to control the cable-manipulating arm and place the cable in optimal positions that diminish cable angle accumulation around the end-effector and prevent robot-cable collisions. The robot handles the cable using a slider tool, as seen in Fig \ref{fig:sliderhandle4imgf}. \begin{figure}[!htbp] \begin{center} \includegraphics[width=.95\linewidth]{figs/slider.jpg} \caption{(a) The cable slider model. (a-Free) The slider in its free state. When the robot gripper grasps the slider, the gripper overcomes the spring forces and pushes the two slider internal circular holes to a concentric state, allowing for the free movement of the cable through both holes. (a-Attach) The slider in its attached state. When it is not being manipulated, its internal springs apply a constant force, constraining the cable. (b) The robot manipulating the slider in its free state.} \label{fig:sliderhandle4imgf} \end{center} \end{figure} The cable can slide through the slider, simplifying the cable manipulation problem to a slider placement problem. To generate a CMMS and avoid entanglements, our planner selects one of the possible slider grasps and generates the motions necessary to reach the selected grasp. Subsequently, the planner computes the tool motions associated with the OMMS and estimates the optimal cable positions for every intermediate state of the tool generated by RRT-based exploring. The result is a motion sequence that allows the robot to reach and grasp the cable slider and control the cable movement, placing it directly behind the tool if possible, preventing collisions and excess angle accumulation between the end-effector and the cable. The OMMS is used to calculate the poses of the tool during the manipulation process and generate the CMMS. For each tool pose, the planner computes a projection from the tool's tail (connection point between the tool and its cable). The projection will be used as goal positions for the slider tool. Each projection position $ {}^{\text{o}}_{}{p}^{}_{}$ (as described in the robots reference frame $\Sigma_{\text{o}}$) can be computed using Eq.\eqref{eq:cablepositionvec}: \begin{equation}\label{eq:cablepositionvec} {}^{\text{o}}_{}{p}^{}_{} = {}^{\text{o}}_{}{R}^{}_{t}\alpha_{s}{}^{\text{t}}_{}{\boldsymbol{\mathit{\upsilon}}}^{}_{} + {}^{\text{o}}_{}{q}^{}_{} + {}^{\text{o}}_{}{{h}}^{}_{}, \end{equation} where ${}^{\text{o}}_{}{R}^{}_{t}$ represents the tools rotation matrix. ${}^{\text{t}}_{}{\boldsymbol{\mathit{\upsilon}}}^{}_{}$ is an unitary vector in the tool's reference frame $\Sigma_{\text{t}}$. It points to the tool tail normal direction. The scalar value $\alpha_{s}$ dictates the magnitude of the projection or how far behind the tool the cable slider should be placed. The object's position ${}^{\text{o}}_{}{q}^{}_{}$ is added to place the projection in the correct position in the robot's reference frame. Finally, the vector ${}^{\text{o}}_{}{h}^{}_{}$ is added to translate the projection point vertically in order to maintain a minimum height for the slider position (to avoid collisions with the table). Fig.\ref{fig:simulationsetting} better illustrates this process. The planner then examines every point $ {}^{\text{o}}_{}{p}^{}_{}$ as a candidate goal position for the cable-holding arm. \begin{figure}[!htbp] \begin{center} \includegraphics[width=.95\linewidth]{figs/SImsettingedited2.png} \caption{Simulated OMMS-only and OMMS+CMMS tool manipulation. Left: The robot executes an OMMS with its right arm. The planner uses the vectors ${}^{\text{o}}_{}{R}^{}_{t}\alpha{}^{\text{t}}_{}{\boldsymbol{\mathit{\upsilon}}}^{}_{} + {}^{\text{o}}_{}{q}^{}_{} $ (in blue) and ${}^{\text{o}}_{}{h}^{}_{}$ (red) to calculate candidate positions for the cable slider (represented by the purple spheres) by using the vectors. Right: The robot moves the cable slider to selected candidate positions. The chosen positions (green spheres) minimize the bending angle of the cable and prevent collisions. Abbreviation: Man. sphere -- Manipulaiton sphere.} \label{fig:simulationsetting} \end{center} \end{figure} \textit{Discarding slider positions:} Each slider position is linked to its corresponding object pose and the pose of the tool manipulating arm (dictated by the OMMS), to form a list $P$ of candidate slider poses. The corresponding robot poses, object position, and slider candidate position are used to verify collision avoidance. To perform collision detection, we assume the cable shape is represented by two straight lines, the first line goes between the tool and the slider, and the second, between the slider and the balancer, both lines can be represented as vectors. With the line vectors, we can check if the robot collides with the cable during manipulation. Also, we can measure the angle between the cable (the section that goes from the tool to the slider) and the end-effector to verify if there is angle accumulation. Ideally, the robot can place the slider in all its candidate position points without collisions. If there are points in $P$ that are either, not reachable by the robot, cause cable collisions (disregarding the robot end-effector), or surpass the angle accumulation threshold, the planner discards them and uses RRT exploring to connect the closest adjacent points that do not violate these conditions. In the case the planner does not find a motion sequence that preserves the angle accumulation below a given threshold (30 degrees in our case) for all the robot states, the planner can compute the goal positions again by reducing $\alpha_{s}$ by 20\%. If it fails to find a solution again, the planning fails and a new OMMS must be computed again to find an alternative CMMS. \section{Experiments and Analysis}\label{sec:experiment} \subsection{Angle accumulation measurements} Several benchmarks to test the performance of the proposed planner using our simulation environment\footnote[1]{For more information about our planner and simulation environment, please visit: https://gitlab.com/wanweiwei07/wrs\_nedo } are performed. For these tests, the robot right arm manipulates the object, and the left-hand maneuvers the cable, the threshold for maximum angle accumulation is set to 30$^{\circ}$. Each benchmark consists of an initial tool pose and three-goal poses. The planner generates motion sequences to pick up the tool and then place it in the desired goal poses. Seven different goal poses are considered to create a benchmark. The poses are shown in Fig.\ref{fig:7goals}. For each simulation, we track the angle accumulation of the robot right arm for later analysis. Also, we used the OMMS-only planner and a planner that uses object handover to complete the same tasks and compare the planners. \begin{figure}[!htpb] \begin{center} \includegraphics[width=.95\linewidth]{figs/goals.jpg} \caption{Goals for the simulation benchmarks. The blue transparent objects represent the candidate goal poses of the tool. For each benchmark, the robot must grasp the object in its initial pose (white), and place it in three of the randomly chosen goal poses.} \label{fig:7goals} \end{center} \end{figure} Table \ref{Tab: Benchmarks} shows the goals chosen for each benchmark (benchmark number in bold and in parenthesis) and the maximum and mean angle accumulation (mean in bold and parenthesis) for each solution. \begin{table}[!htbp] \begin{center} \setlength{\tabcolsep}{4.3pt} \caption{\label{Tab: Benchmarks}} \begin{threeparttable} \begin{tabular}{cc} \toprule Goals &$A_{cc}$ \textbf{[degrees]} \\ \midrule \midrule \textbf{(1)} 1, 6, 3 &O+C = 27.61 \textbf{(6.06)}, O = 42.43 \textbf{(16.88)}, H = 83.75 \textbf{(27.14)}\\ \midrule \textbf{(2)} 2, 1, 3 &O+C = 16.56 \textbf{(2.89)}, O = 44.59 \textbf{(17.88)}, H = 44.59 \textbf{(14.21)}\\ \midrule \textbf{(3)} 3, 4, 5 &O+C = 16.49 \textbf{(2.20)}, O = 45.0 \textbf{(22.16)}, H = 82.48 \textbf{(19.95)}\\ \midrule \textbf{(4)} 4, 1, 5 &O+C = 16.70 \textbf{(2.31)}, O = 44.96 \textbf{(24.38)}, H = 80.65 \textbf{(23.55)}\\ \midrule \textbf{(5)} 7, 6, 2 &O+C = 29.83 \textbf{(6.02)}, O = 44.12 \textbf{(23.64)}, H = 75.12 \textbf{(26.95)}\\ \midrule \textbf{(6)} 5, 4, 1 &O+C = 25.05 \textbf{(4.48)}, O = 43.89 \textbf{(27.25)}, H = 44.99 \textbf{(18.74)}\\ \midrule \bottomrule \end{tabular} \begin{tablenotes} Meanings of abbreviation: O+C represents the OMMS+CMMS solution for the given benchmark. O is the OMMS-only solution. H represents the solutions using handover. \end{tablenotes} \end{threeparttable} \end{center} \end{table} The CMMS allows the robot to handle the tool cable to follow the movement of the tool, reducing cable bending at the tool local reference frame. On average, the OMMS+CMMS executions reduced maximum angle accumulation by 50\% when compared to the OMMS-only planner and by 67\% when compared to dual handed tool manipulation. The average angle accumulation for the OMMS+CMMS manipulation tasks was also considerably lower for the OMMS+CMMS planner, which hints at a lower chance of end-effector-cable entanglements. \subsection{OMMS+CMMS without the tool balancer} A downside of the tool balancer is that it does not allow for the regrasping of the tool using table placements (the cable would pull the tool out of position). If regrasping is necessary, the robot is forced to use handover motions, the motions with the highest angle accumulation. The proposed planner can also be used to maneuver tethered tools without the use of a tool balancer, allowing the tool handling arm to perform regrasps using table placements. In this case, one end of the cable is fixed to a corner of the robot table to approximate the cable shape as two straight lines, which go between the tool and the cable slider and between the cable slider and the fixed point. By manipulating the tool cable the robot can not only diminish angle accumulation and the possibility of entanglements, as shown in the previous experiment, but it can also maneuver the cable above obstacles in the robot workspace. Obstacle-avoidance experiments are performed to test the balancer-less planner. The experiments consist of randomly placing a box as an obstacle in the robot workspace and performing a manipulation task with a tool starting pose, and two-goal poses. The planner is tasked to place the tool in two-goal positions, and the amount of cable-obstacle collisions are measured for each planner. Ten different tests are performed with random box positions using our planner and the OMMS-only planner. The straight-line cable approximation is used to detect collisions in our simulation environment. Real tests are performed to assess collisions with the obstacles. \subsection{Real-world experiments} After testing our planner in simulations, we applied our solution to our real-world robot. The robot uses its hand-mounted cameras to detect the AR Markers on the tool and the slider and compute their current pose. For these experiments, we tested the same motion sequences planned in our simulations. In all cases, the robot was able to complete the OMMS+CMMS task while manipulating the cable. In Fig.\ref{fig:Real Exps} a real-world execution of the planner performing benchmark 1 can be seen and compared to the regular OMMS-only planner and the solution provided by the planner using handover. The angle accumulation comparison between planners for benchmarks 1 through 6 is shown in Fig.\ref{fig:123456 exps}. A video demonstration can be seen in the supplementary material. \begin{figure*}[!htpb] \begin{center} \includegraphics[width=.95\textwidth]{figs/REALEXPS.png} \caption{Real-world implementations. The first row shows the OMMS+CMMS motion sequences -- The robot completes its task without surpassing the maximum angle accumulation threshold of 30$^{\circ}$. The second row shows the OMMS-only sequence, from the second to the fourth image we can observe the excess bending on the cable. The third row shows a part of the planner solution involving handover. In this case, the cable gets snarled around the robot end-effector when the robot performs the handover motion. Rows four and five show the OMMS+CMMS and OMMS-only solutions respectively. In the OMMS+CMMS solution, the robot successfully maneuvers the cable and avoids the obstacle by lifting it above the box. The OMMS-only solution, on the other hand, does not consider the box or the cable and results in a cable-box collision. } \label{fig:Real Exps} \end{center} \end{figure*} Furthermore, we also executed the cable-box collision avoidance motion sequences. An example can also be seen in Fig.\ref{fig:Real Exps}. Table \ref{Tab: Obstacle Avoidance Test} shows the results of real-world executions. The presented planner avoids collisions in 70\% of the cases while the OMMS-only planner is only successful in 20\% of the cases. The cable shape is assumed to be a straight line for the OMMS + CMMS planner since the robot holds the cable slider close to the tool. The same approximation cannot be used for the balancer-less, OMMS-only solution since the cable does not form a straight line, making its shape difficult to predict. A video demonstration can be seen in the supplementary material. \begin{table}[!htbp] \begin{center} \setlength{\tabcolsep}{7.3pt} \caption{\label{Tab: Obstacle Avoidance Test}} \begin{tabular}{cccc} \toprule Planner & Success & Collisions & Mean $A_{cc}$\textbf{[degrees]} \\ \midrule \midrule OMMS& 2 & 8 & N/A\\ \midrule OMMS + CMMS & 7 & 3 & 6.81\\ \midrule \bottomrule \end{tabular} \end{center} \end{table} \begin{figure*}[!b] \begin{center} \includegraphics[width=.95\textwidth]{figs/123456.png} \caption{Angle accumulation for the benchmarks, from the top left to bottom right graphs the figure shows the accumulation angles registered for benchmarks 1 through 6 respectively. The vertical axis shows the angle accumulation in degrees. The horizontal axis indicates the robot n-th robot state during the execution. The blue lines show the results for our OMMS+CMMS planner, the red lines show the angle accumulation for the OMMS-only planner and the yellow lines show the accumulation for the solutions with object handover. } \label{fig:123456 exps} \end{center} \end{figure*} \section{Conclusions} In this paper, we presented a manipulation planner for entanglement avoidance. Simulations and real-world experiments confirm that the planner generates motion sequences that reduce angle accumulation around the robot end-effector and allow collision avoidance between the cable and the robot and the cable and its environment. The tool balancer provides a constant pulling force for the cable, straightening its shape and simplifying collision detection and the computation of the cable shape. On the other hand, the balancer limits the regrasping capabilities of the robot. Furthermore, the experiments without the tool balancer showed that the CMMS allows the robot to manipulate the cable to avoid obstacles and also perform tool regrasping by using placements. Cable obstacle avoidance can be especially useful in cluttered environments where the cable could push objects outside of the robot reach or disturb the original positions of obstacles and objects, which can be fatal for offline manipulation planners like ours. Nonetheless, a more accurate representation of the cable catenary shape could allow a higher success rate with an increased amount of obstacles. Our planner provides a safe alternative to tethered tool manipulation. It reduces cable bending at the tool local reference frame and angle accumulation during the manipulation task. The use of a tool balancer facilitates and makes more accurate the simulations during the planning stage, but the planner can still be implemented without the balancer to perform tool placements and regrasping. Future implementations of the proposed planner will aim to solve the cable deformation problem and discard the need for a tool balancer. \bibliographystyle{IEEEtran}
\section{Introduction} \label{intro} The results of the solar and atmospheric neutrino oscillation experiments were recognized by a recent Nobel prize. The Mikheyev-Smirnov-Wolfenstein (MSW) effect is an essential component needed for the interpretation of these neutrino oscillation experiments \cite{16smirnov} (for a historical account of neutrino oscillations in matter see \cite{19smirnov}). Therefore, the mixing of the neutrino mass eigenstates in vacuum and in dense matter seem to be well established in describing the propagation of the neutrinos from source to detecting devices. These effects were mostly considered in electron plasma \cite{haxton86,parke86}, such as the Sun or supernovae, and its use is extended to condensed matter, such as the Earth crust and inner layers. However, to our best knowledge, the variation of the electron density inside condensed matter was not yet considered. A simple estimate of the electron density and neutrino potential inside a medium-Z nucleus, such as $^{136}$Xe, shows that it is about four orders of magnitude larger than that existing in the Sun's core \cite{mh-msw18}. One could then ask if these high electron densities can produce additional mixing of the mass eigenstates that needs to be considered in the interpretation of neutrino production and detection phenomenology. The effect of the matter-induced neutrino potential on the neutrino mixing in matter is traditionally analyzed using the local in-medium modified mass eigenstates and mixings \cite{giunti2007,88mannheim1935,92giunti1557}. This approach relies on the separation of the neutrino wavelength scale from the much larger neutrino oscillation and matter density variation scales. In reality, there are no local mass eigenstates in matter, but the analysis of the evolution of the vacuum mass eigenstates in finite matter medium is complicated by the various scales involved. However, the results based on local, in-medium, mass eigenstates seem to be valid. One of the issues related to the introduction of the fictitious in-matter mass eigenstates is that one assumes that the neutrinos produced via weak interactions in dense matter (e.g. in the Sun's core) are emitted as matter mass eigenstates. The transition to vacuum is usually described by the long-scale evolution of the amplitudes (see e.g. Ref. \cite{03garcia345}), which could be adiabatic or not. We are investigating if this approach can be extended to the analysis of the effects of non-adiabatic transitions of the neutrinos through condensed matter where the electron densities near the atomic nuclei are few orders of magnitude larger than this in the Sun's core. \section{Neutrino oscillations in condensed matter} \label{spikes} It is now widely accepted that the flavor neutrinos participating in the weak interaction are coherent superpositions of vacuum mass eigenstates. For the neutrino fields, the mixing reads: \begin{equation} \nu_{\alpha L}(x)=\sum_{a=1} U_{\alpha a} \nu_{aL}(x)\ , \label{mee} \end{equation} where index $\alpha$ indicates a flavor state (electron, muon, tau, $\ldots$), and $a$ designates mass eigenstates (1, 2, 3, $\ldots$), and $U_{\alpha a}$ are elements of the vacuum neutrino mixing (PMNS) matrix. Here the dots indicate sterile flavors, or high mass eigenstates. If one discards the existence of the low mass sterile neutrinos, the coupling to the higher mass eigenstates is then very small, and the sum over $a$ in Eq. (\ref{mee}) is reduced to 3. This mixing leads to violations of the flavor number, and it is reflected in the outcome of the neutrino oscillation experiments. These experiments are mostly analyzed in terms of neutrino states \begin{equation} \label{kvm} \ket{ \nu_{\alpha L}} = \sum_{a=1} U_{fa}^* \ket{\nu_{aL}}\ , \end{equation} which are dominated by the larger components of the fields. Neutrino states are used to analyze the matter effects, also known as Mikheyev-Smirnov-Wolfenstein effects \cite{16smirnov}. Neutrino mixing is affected in matter by the neutrino optical potential. The general relation between the neutrino optical potential (in $eV$) and the electron density $N_e$ (in $cm^{-3}$) is \begin{equation} \label{vmat} V_e(eV) = \pm \sqrt{2}G_F N_e \approx \pm 7.56\times 10^{-14} m_p N_e =\pm 1.26\times 10^{-37} N_e \ , \end{equation} where the (minus)plus sign corresponds to (anti)neutrinos, $G_F$ is Fermis's constant, and $m_p$ is the proton mass ($1.67 \times 10^{-24} g$). Above we used Eq. (2.8) of \cite{92giunti1557}, where the equivalent matter density times the electron fraction $Y_e$ was replaced with $m_p N_e$. In atoms, just considering the electron density of two electrons in the lowest $1s$ state of a Hydrogen-like atom (the higher s-states contribute very little, $\propto 1/n^3$, $n$ being the principal quantum number), one gets \begin{equation} \label{rhot} N_e(r) = 10^{30} \frac{2}{\pi}\left(\frac{Z}{53}\right)^3 e^{-2 r Z/53}\ (cm^{-3}), \end{equation} \noindent where $Z$ is the atomic number, and $r$ is in $pm$ ($10^{-12}\ m$). Electron DFT calculations \cite{dftprl1,dftprl2} (see e.g. Fig. 1 of Ref. \cite{mh-msw18}), show that this approximation is very good at and near the nuclei, where the main transition takes place. Fig. \ref{fig:sio2} shows the result of a DFT calculation for the electron density in the cell of quartz crystal, one of the most common in the Earth's crust. The results show that 85\% of the electron density in the cell resides in the spikes (defined as larger than the average density of 0.1 atomic units), while only 15\% is located in the volume that has lower than average density. In addition, the values of the electron density near the peaks are very well described by Eq. (\ref{rhot}). These high electron densities near the nuclei are much larger than those in the Sun's core for all atoms with atomic number greater than 5. As an example, for atoms with $Z \approx 53$ the electron density at the nucleus is four orders of magnitude larger than that in the Sun's core. \begin{figure}[htb] \centering \includegraphics[height=3.5in]{SiO2.png} \caption{Electron density inside a quartz ($SiO_2$) cell obtained with DFT calculations using Quantum Expresso code \cite{qe2009}. Shown is the electron density (in atomic units) in a plane through the cell that cuts very close to three silicone nuclei (higher peaks), and two oxygen nuclei.} \label{fig:sio2} \end{figure} Therefore, it should be interesting to investigate the effects of these large electron densities on the neutrino mixing in atomic weak interactions. To solve this problem one needs to consider the evolution of mixing for three (or more) neutrino mass eigenstates, which can be described by the coupled Dirac equations \small \begin{equation} \label{aevolved} i\frac{d}{dt} \begin{pmatrix} \psi_{1} \\ \psi_{2} \\ \psi_{3} \end{pmatrix} = \left[ \begin{pmatrix} p_x \alpha_x + m_1 \beta & 0 & 0 \\ 0 & p_x \alpha_x + m_2 \beta & 0 \\ 0 & 0 & p_x \alpha_x + m_3 \beta \end{pmatrix} + U^{\dagger} \begin{pmatrix} V_e(x)+V_N & 0 & 0 \\ 0 & V_N & 0 \\ 0 & 0 & V_N \end{pmatrix} U \right] \begin{pmatrix} \psi_{1} \\ \psi_{2} \\ \psi_{2} \end{pmatrix}\ , \end{equation} \normalsize where $\psi_i$ are Dirac spinors for the (perturbed) vacuum mass eigenstates, $m_i$ are the corresponding neutrino masses, $p_x$ is the momentum in the direction of the beam, and $\alpha_x$ and $\beta$ are Dirac matrices \cite{peskin1995}. Here $V_N$ is the neutral current potential generated mostly by neutrons, i.e. \begin{equation} \label{VN} V_N(eV) \approx - G_F N_n/\sqrt{2} \approx -6.3 \times 10^{-38} N_n \ , \end{equation} where $N_n$ is the local neutron density in $cm^{-3}$. The neutral current potential is the same for all three active neutrinos, and therefore can be neglected in the analysis of neutrino oscillations (as is the main momentum term in the underlying Dirac equations). However, if the sterile neutrinos are present, the neutral current potential needs to be considered \cite{parke19}. In Eq. (\ref{aevolved}) the Dirac spinors, $\psi_a = \nu_a \phi_a$ can be viewed as components of some flavor neutrino normalized superposition of mass eigenstates spinors, \begin{equation} \psi_{\alpha} = \sum_{a=1,2,3} \psi_a=\sum_{a=1,2,3} \nu_a \phi_a \ , \end{equation} where $\alpha$ indicates the known active neutrino flavors, electron, muon, and tau. Here we consider the traditional approach \cite{03garcia345} of separating the neutrino wavelength scale from the neutrino oscillation and matter density variation scales, by considering a Schroedinger-like equation for the amplitudes, assuming that the $\phi_i$ spinors are free spinors, \begin{figure}[htb] \centering \includegraphics[height=3.5in]{dens-all.pdf} \caption{Profile of the electron density spikes used in the calculations multiplied by the proton mass, for comparison to equivalent matter density, $Y_e \rho_{equiv}(s) = N_e(s) m_p$.} \label{fig:den-spikes} \end{figure} The vector of 3 flavor amplitudes is denoted as $\nu_f = \left( \nu_e,\ \nu_{\mu},\ \nu_{\tau} \right)^T$, and then the Schroedinger-like evolution equation for the flavor amplitudes in matter reads \begin{equation} \label{wolf} i\frac{\partial \nu_f}{\partial t} = \left( H_0 + V \right) \nu_f \ , \end{equation} where $H_0 = U diag \left( m_1^2/(2P), m_3^2/(2P), m_3^2/(2P)\right) U^{\dagger}$, $V = diag \left( V_e+V_N, V_N, V_N \right)$, and $m_a$ are the masses of the vacuum mass eigenstates. The general requirement for the validity of the above evolution equation is that the neutrino wavelength be smaller than the length over which there is a significant change of the optical potential created by a varying electron density \cite{03garcia345,92giunti1557}, \begin{equation} \label{vcond} \lambda \ll \mid V(x)/ \left( dV/dx \right) \mid \ . \end{equation} In the case of the potential created by the atomic electron density, Eqs. (\ref{vmat}) and (\ref{rhot}), this condition reads \begin{equation} 2\pi\frac{\hbar c}{Pc} \ll \frac{53000}{2Z}\ \ (in\ fm), \end{equation} which is satisfied for neutrino energies larger than 2-5 MeV, and for a wide range of atomic numbers. In constant electron density Eq. (\ref{wolf}) is usually solved by diagonalizing the in-matter Hamiltonian, $H=H_0+V_e$, assuming that the solution describes in-matter mass eigenstates that have in-matter mixing matrix and masses, and using these effective masses and mixings in the standard vacuum oscillation formulae \cite{03garcia345}. We will call this the eigenvalues method. In this approach, Eq. (\ref{rhot}) suggests that the electron density inside the atomic nucleus is much larger than that in the Sun's core and, therefore, the (anti)neutrinos are emitted in the (lower)higher mass eigenstates. Solutions to this problem for one single atom were discussed in Ref. \cite{mh-msw18}. Here we are interested to see if there are any effects of the electron density "spikes" around the atomic nuclei in bulk condensed matter. For that we integrate Eq. (\ref{wolf}), which we rewrite in dimensionless form, \begin{equation} \label{propfl} i\frac{d}{ds} \begin{pmatrix} \nu_{e} \\ \nu_{\mu} \\ \nu_{\tau} \end{pmatrix} = \left[ U \begin{pmatrix} 0 & 0 & 0 \\ 0 & \alpha & 0 \\ 0 & 0 & \gamma \end{pmatrix} U^{\dagger}+ \begin{pmatrix} A(s) & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix} \right] \begin{pmatrix} \nu_{e} \\ \nu_{\mu} \\ \nu_{\tau} \end{pmatrix}\ \equiv H(s) \begin{pmatrix} \nu_{e} \\ \nu_{\mu} \\ \nu_{\tau} \end{pmatrix}\ . \end{equation} Here $s$ is the normalized propagation length, $s=x/s_u$, $s_u$ is the unit length defined as $s_u = (2E \hbar c)/|\delta m_{31}^2|$, $\alpha = \delta m_{21}^2/|\delta m_{31}^2|$, $\gamma=\delta m_{31}^2/|\delta m_{31}^2|$, and $A(s)=2E V_e(x)/|\delta m_{31}^2|$. In the calculation we use a number $N$ of density spikes, entering $A(s)$ via $V_e(x)$. Shown in Fig. \ref{fig:den-spikes} are different density profiles: Gaussians in blue, exponential in red, and a combination of the two of them in black. Each density profile represents the electron density near an atomic nucleus multiplied by twice the proton mass. Given that the Gaussians are normalized to unity, an additional normalization factor $\rho_N$ was used to recover the flat average density of matter $\rho$, \begin{equation} \label{norm_r} \rho_N = \rho\ s/N \ , \end{equation} where, for an easier comparison with solar density, we used the local equivalence between the average electron density $\left< N_e \right>$ and average mass density $\rho$, \begin{equation} \label{rho_ave} \rho = m_p \left< N_e \right>/Y_e \approx 2 m_p \left< N_e \right> \ . \end{equation} To integrate Eq. (\ref{wolf}) we used the ZVODE routine from the SciPy ODE package, which implements a complex version of the VODE algorithm \cite{vode89}. Given that the electron density spikes are extremely narrow, we tried different widths for the density profiles shown in Fig. \ref{fig:den-spikes}. In an attempt to get good accuracy of the solution we divided the width of each density spike by about 100 integration steps, and required for each step an absolute tolerance of $10^{-10}$ from ZVODE routine. The results in Fig. \ref{fig:pme} show a significant difference between the solution of the integration method using the spiked density profile (in black) and the``exact" eigenvalues solution corresponding to the equivalent flat electron density (in dark green). However, when increasing the accuracy in the ZVODE routine to $10^{-12}$ the difference between the two curves in Fig. \ref{fig:pme} disappeared. This situation emphasized once again the danger of relying solely on numerical analysis. In addition, the needed accuracy of $10^{-12}$ being close to the numerical round-off error for double precision, further emphasizes the difficulty of the numerical problem. Therefore, we tried using a more direct analysis to understand this result, which will be presented in the next section. \begin{figure}[htb] \centering \includegraphics[height=3.5in]{fl2gs-r38-e500-r.pdf} \caption{Electron neutrino appearance probability, $P_{\nu_{\mu} \nu_e}$, for a baseline of 7330 km. The energy of muon neutrino beam is 0.5 GeV. The green line is given by a constant matter density approach ($\rho=3.8\ g/cm^3$), and the black line was obtained integrating Eqs. (\ref {wolf}) using a spiked electron density (see text for details).} \label{fig:pme} \end{figure} \section{Fast and efficient algorithm to calculate the neutrino oscillation probabilities through varying electron densities} \label{iters} Previous work on neutrino oscillation probabilities in matter includes perturbative expansions \cite{parke16-1,parke16-2,parke18,parke19}. The mostly used approach is to diagonalize the Hamiltonian in matter, and use perturbation theory to identify main contributing terms. In the process, one uses the S-matrix approach for the propagation of the amplitudes. For example, for the Eq. (\ref{propfl}) the corresponding S-matrix is given by, \begin{equation} S(s)=T e^{-i \int_0^s H(s')ds'} \ , \end{equation} where the $T$ operator in front of the exponential indicates an ordered position-dependence of the integrals when the matrix exponential is expanded (similar to the time ordered product). The S-matrix can be used to calculate the probability of measuring neutrino flavor $\alpha$ at distance $s$ assuming that flavor $\beta$ was emitted at $s=0$ \cite{parke16-1}, \begin{equation} \label{prob_s} P_{\beta \rightarrow \alpha} = \left| S_{\alpha \beta} (s) \right|^2 \ . \end{equation} In case of constant electron density, $A(s)$ in Eq. (\ref{propfl}) does not depend of the integration variable $s$, and one can use the diagonalization methods or/and perturbation expansions \cite{parke16-1,parke16-2,parke18,parke19}. Alternatively, one can directly integrate Eq. (\ref{propfl}). Here we propose using the matrix solution to Eq. (\ref{propfl}) in a different way: we divide the $s$ interval in $N$ small pieces $\Delta s_i$ (for example equally spaced $\Delta s_i = s/N$), for which we consider the $H(s_i)$ Hamiltonian constant. With the notation \begin{equation} H(s) \equiv U D_1 U^{\dagger} + D_2(s) \ , \end{equation} the solution to Eq. (\ref{propfl}) can be written as \begin{equation} \label{alg_p} S (s) = \prod_{i=1}^N S (\Delta s_i) \ . \end{equation} Given that the $\Delta s_i$ are small, one can show that the matrices $S(\Delta s_i)$ can be approximated by \begin{equation} \label{alg_s} S(\Delta s_i) = e^{-i \Delta s_i D_2(s_i)} U e^{-i \Delta s_i D_1} U^{\dagger} \ . \end{equation} Moreover, given that matrices $D_1$ and $D_2$ are diagonal then, \begin{equation} \label{alg_ua} e^{-i \Delta s_i D_2(s_i)} = \begin{pmatrix} e^{-i \Delta s_i A(s_i)} & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} \equiv U_A(s_i) \ , \end{equation} and \begin{equation} \label{alg_um} e^{-i \Delta s_i D_1} = \begin{pmatrix} 1 & 0 & 0 \\ 0 & e^{-i \Delta s_i \alpha} & 0 \\ 0 & 0 & e^{-i \Delta s_i \gamma } \end{pmatrix} \equiv U_m \ . \end{equation} Using Eqs. (\ref{alg_p} - \ref{alg_um}) one can iteratively find the S-matrix and the associated probabilities of Eq. (\ref{prob_s}). We will call this approach the iterations method. In the proof of Eq. (\ref{alg_s}) one needs the transformations forth and back between the flavor amplitudes and the mass eigenstates amplitudes, \begin{equation} \label{flav_ch} \nu_{\alpha} = \sum_i U_{\alpha i} \nu_i\ ;\ \nu_i\ = \sum_{\alpha} \left( U^{\dagger}\right)_{i \alpha} \nu_{\alpha} \ . \end{equation} The condition for small $\Delta s_i$ used in Eq. (\ref{alg_s}) suggests that one needs a large number of iteration to obtain good accuracy. Our numerical implementation indicates that even 10-15 factors in Eq. (\ref{alg_p}) would provide an 0.1\% accuracy when compared with the ``exact" eigenvalues method. Fig. \ref{fig:errd} shows the difference between the iterations method described above when only 15 iterations are used, and the exact eigenvalues method solution. Increasing N to 150 reduces the absolute difference to less than $10^{-5}$. \begin{figure}[htb] \centering \includegraphics[height=3.5in]{abs-difference.pdf} \caption{Absolute difference between the probability of electron neutrino appearance calculated with the iteration method described in the text and the ``exact" eigenvalues method. Used was a matter constant density of $2.8\ g/cm^3$, and a muon neutrino beam of 0.5 GeV.} \label{fig:errd} \end{figure} The iterations method described above works as well for smoothly varying average electron (matter) densities. Fig. \ref{fig:iter} shows the results of the above method (red curve) compared with the solution obtained by directly integrating Eq. (\ref{wolf}) for a varying density through the Earth crust similar to that described in Ref. \cite{ecrust17} (blue curve). Calculated is the electron neutrino appearance probability for a muon neutrino beam of 0.8 GeV. The two curves are overlapping if the artificial 0.005 shift to the red curved is removed. \begin{figure}[htb] \centering \includegraphics[height=3.5in]{var-rho.pdf} \caption{Comparison of the electron neutrino appearance probability calculated with the iteration method described in the text and the direct integration method for smoothly varying electron (matter) density (see text for details). The two curves are artificially separated by 0.005 for a better view. A muon neutrino beam of 0.8 GeV was used in the calculations.} \label{fig:iter} \end{figure} The iterations algorithm described above can also be used to understand the results of section \ref{spikes}. To see that, one can consider the electron density in condensed matter composed of N spikes clustered around the atomic nuclei. One can further approximate the spikes with Dirac delta functions, which are normalized to unity, multiplied by the constant given in Eq. (\ref{norm_r}). Then, when integrating Eq. (\ref{wolf}) on each $\Delta s_i$ segment, one can (i) transform the flavor amplitudes into mass-eigenstate amplitudes with $U^{\dagger}$ (see e.g. Eq. (\ref{flav_ch})), (ii) freely propagate the mass-eigenstate amplitudes using $U_m$, (iii) transform the mass-eigenstate amplitudes into flavor amplitudes with $U$, and (iv) integrate Eq. (\ref{wolf}) over the Dirac delta spikes. For the last step one can assume that in the vicinity of a Dirac delta spike only the term proportional with $A(s)$ in Eq. (\ref{wolf}) survives, \begin{equation} i \frac{d \nu_e (s)}{ds} = A(s) \nu_e (s) \ . \end{equation} Given that the Dirac delta function norm in Eq. (\ref{norm_r}) is proportionate to $\rho \left(s/N\right)=\rho \Delta s_i$, the solution to the above equation becomes \begin{equation} \nu_e(s_a) = e^{-i \Delta s_i A(s_i)} \nu_e(s_b)\ , \end{equation} where $s_b$ and $s_a$ are the $s$ coordinates before and after the delta spike in the $\left(s_i,\ s_i+\Delta s_i \right)$ interval, and $A(s_i)$ is calculated with the average electron density of Eq. (\ref{rho_ave}). Therefore, the result of integrating the full vector of amplitudes over the Dirac delta spike is \begin{equation} \begin{pmatrix} \nu_{e} \\ \nu_{\mu} \\ \nu_{\tau} \end{pmatrix} (s_a)= \begin{pmatrix} e^{-i \Delta s_i A(s_i)} & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} \nu_{e} \\ \nu_{\mu} \\ \nu_{\tau} \end{pmatrix} (s_b) \equiv U_m \begin{pmatrix} \nu_{e} \\ \nu_{\mu} \\ \nu_{\tau} \end{pmatrix} (s_b)\ . \end{equation} Putting together all the steps of the algorithm described above, one gets for the S-matrix factors entering Eq. (\ref{alg_p}) \begin{equation} \label{alg_ss} S(\Delta s_i) = U_A(s_i) U U_m U^{\dagger} \ , \end{equation} which are the same as in Eq. (\ref{alg_s}). This completes the proof that justifies the use of an average electron density, rather than its large variation around the atomic nuclei. For smooth changes of the average electron density one can use a typical coarse-graining argument. \section{Conclusion and Outlook} In conclusion, we analyzed the effect of the large electron density variations around the atomic nuclei on the neutrino oscillation probabilities in condensed matter. The analysis is relevant for the DUNE/LBNF experiment. In section \ref{spikes} we attempted to fully integrate the evolution equation for the neutrino amplitudes, by considering the large variation of the electron density near the atomic nuclei, and therefore that of the neutrino potential. We found out that the numerical integration under these conditions could be treacherous, and could be leading to erroneous results. In the second part of the manuscript we proposed a new iterative solution to the neutrino amplitudes evolution equation, which proves to be very fast, reliable, and applicable to either constant matter density or slowly varying matter density (assuming average electron densities). Finally, we showed that one can obtain the same iterative solution, by assuming that the spikes in the electron density around the atomic nuclei can be approximated by Dirac delta functions. Our solution thus justifies the use of average electron densities for matter effects in neutrino oscillation probabilities. \section*{Acknowledgements} AZ would like to thank the Central Michigan University Office of Research and Graduate Studies Summer Scholar Grant, Central Michigan University Department of Physics. He also acknowledges collaboration with Marco Fornari of the AFLOW Consortium (http://www.aflow.org) under the sponsorship of DOD-ONR (Grants N000141310635 and N000141512266).  A special thank to Ethan Stearns for all his DFT calculations and help with Figure 1.
\section{Overview of stochastic series expansion methods} \subsection{Path integrals and series expansions} \label{sec:sse1} \index{path integral} The most obvious way to construct a Monte Carlo (MC) simulation scheme for a lattice Hamiltonian $H$ is to start from the path integral formulation of quantum statistical mechanics, where ${\rm e}^{-\beta H}$ is written as a product of imaginary-time evolution operators ${\rm e}^{-\Delta_\tau H}$ with a small ``time slice'', $\Delta_\tau = \beta/L$, for some large number $L$ of slices\cite{Feynman53,Suzuki76}. The partition function $Z={\rm Tr} \{ {\rm e}^{-\beta H} \}$ can then be written as \begin{equation} Z_{\rm PI} = \sum_{\{ \alpha \}} \langle \alpha_0| {\rm e}^{-\Delta_\tau H}|\alpha_{L-1}\rangle \cdots \langle \alpha_2| {\rm e}^{-\Delta_\tau H}|\alpha_1\rangle \langle \alpha_{1}| {\rm e}^{-\Delta_\tau H}|\alpha_0\rangle, \label{zpath} \end{equation} where the sum is over $L$ complete sets of states in a suitably chosen basis. Because the time step $\Delta_\tau$ of the slices is small, the matrix elements can be computed to some approximation with a total error of order $\Delta_\tau ^p$, where $p$ depends on the approximation used, e.g., $p=2$ with the lowest-order split-operator (Suzuki-Trotter) decomposition of the exponential operators, ${\rm e}^{-\Delta_\tau (H_A+H_B)} \approx {\rm e}^{-\Delta_\tau H_A} {\rm e}^{-\Delta_\tau H_B}$ (for generic non-commuting terms $H_A$ and $H_B$). Several variants of such path-integral based QMC methods, often called {\it world line} (WL) methods, were developed in the 1970s and 1980s \cite{Suzuki77,Hirsch82}. \vskip2mm There was also an earlier proposal by Handscomb, dating back to the early 1960s \cite{Handscomb62}, to instead start from the power series expansion of ${\rm e}^{-\beta H}$. Handscomb made the observation that the Heisenberg exchange interaction between two $S=1/2$ spins, $H_{ij} ={\bf S}_i \cdot {\bf S}_j$, is a permutation operator, and that traces of strings of these operators for different spin pairs can be easily evaluated analytically. In the case of a ferromagnetic coupling (i.e., with a negative sign in front of ${\bf S}_i \cdot {\bf S}_j$), the minus sign in the exponential is canceled. The powers of the Hamiltonian can be further decomposed into strings of two-body (bond) operators, $H_{b_n} \cdots H_{b_2}H_{b_1}$, with all combinations of the operators $H_b = H_{i(b),j(b)}$, $b \in \{1,\ldots,N_b\}$ on a finite lattice in any number of space dimensions $D$ (where $N_b=DL$ for nearest-neighbor interactions on a $D$-dimensional simple cubic lattice). Denoting a string of $n$ operator indices $b_1,b_2,\ldots, b_n$ by $S_n$, the partition function is then \begin{equation} Z_{\rm H} = \sum_{n=0}^\infty \frac{\beta^n}{n!} \sum_{S_n} {\rm Tr} \{ H_{b_n} \cdots H_{b_2}H_{b_1} \}, \label{zhand} \end{equation} where the traces of the strings of permutation operators are positive definite. With a simple scheme to evaluate the traces in terms of permutation cycles, the operator strings can be sampled using a Metropolis MC method and various thermodynamic expectation values can be evaluated \cite{Handscomb62,Lyklema82}. Among these expectation values, the total internal energy is particularly important as it takes the simple form $E=\langle H\rangle = -\langle n\rangle/\beta$, which shows that the mean number of operators $n$ in the expansion during the sampling process (which includes updates increasing and decreasing the string length $n$) scales as $\beta N$, $N$ being the total number of spins. Thus, the expansion is convergent (as is also guaranteed since $H$ on a finite lattice has a bounded energy spectrum) and there is in practice a ``fuzzy bound'' on the expansion order $n$, proportional to $\beta N$, that will never be exceeded during the sampling process. Both the computer storage requirement and the processor time for completing a full MC updating sweep then also scale as $\beta N$. \vskip2mm It is illustrative to compare Handscomb's expansion with the simple power series for the exponential of a positive number $x$, ${\rm e}^x = \sum_m x^m/m!=\sum_m W(m)$, which is always convergent and where the mean of the distribution $P(m)=W(m){\rm e}^{-x}$ (i.e., the Poisson distribution) is $\langle m\rangle = x$. In light of this fact, the distribution of expansion orders in the case of ${\rm Tr}\{{\rm e}^{-\beta H}\}$ can be easily understood in the limit $\beta \to \infty$, where ${\rm e}^{-\beta E_0}$ ($E_0$ being the ground state energy) is the only surviving contribution to the trace and $\beta |E_0|$ therefore corresponds to $x$ above; $\langle n\rangle = \beta |E_0|$. At any temperature, the fluctuations of $n$ are related to the heat capacity; $C=\langle n^2\rangle -\langle n\rangle ^2-\langle n\rangle$ \cite{Handscomb62}. Therefore, the variance of the distribution at $T=0$ is also exactly the same as for the Poisson distribution; $\langle n^2\rangle -\langle n\rangle ^2 = \langle n\rangle$. \vskip2mm Handscomb's method is certainly elegant, but in its original formulation it was very limited in applicability, as there is only a small number of models for which the traces can be computed analytically \cite{Chakravarty82}. The expansion is also normally not positive definite. The problem of mixed positive and negative terms (i.e., an incarnation of the QMC sign problem) appears already for the antiferromagnetic Heisenberg interaction, and it took some time until it was realized that this sign problem was easily solvable for bipartite lattices by simply adding a suitable constant to the interaction \cite{Lee84}. The traces can then still be computed and the strings can be sampled in a way similar to the original formulation. However, in practice the modified method did not perform as well as the path-integral based methods that had been developed by then for the Heisenberg antiferromagnet and many other models. Though some further applications were reported \cite{Manousakis89}, Handscomb's method was essentially abandoned, as it became clear that it was not possible in general to compute traces of operator strings efficiently, and, in the cases where the traces can be evaluated, the existing sampling schemes were also often inefficient. \vskip2mm The dismissal of the idea of starting from the series expansion was premature. It is not clear why it was not realized earlier that it is not necessary to compute the traces analytically---they also can be sampled in a chosen basis along with the operator strings \cite{Sandvik91,Sandvik92}. The sampling weight in the extended space comprising states and operator strings has matrix elements $\langle \alpha |H_{b_n} \cdots H_{b_2}H_{b_1}|\alpha \rangle$ in place of the full traces in Eq.~(\ref{zhand}); \begin{equation} Z_{\rm SSE} = \sum_{n=0}^\infty \frac{\beta^n}{n!} \sum_{S_n} \sum_\alpha \langle \alpha|H_{b_n} \cdots H_{b_2}H_{b_1}|\alpha \rangle. \label{zsse1} \end{equation} Here the Hamiltonian has been defined as $H=-\sum_b H_b$, so that no negative signs appear explicitly. Of course the string of operators can still produce negative signs, and the class of models for which this can be avoided is, as always, limited, but includes many important systems worthy of study (some recent examples will be discussed in Sec.~\ref{sec:examples}). It can be noted here that sign problems originating from the diagonal part of the interaction can always be avoided by adding suitable constants to some of the $H_b$ operators. Signs appearing with off-diagonal operations (either explicitly from negative prefactors of some $H_b$ or due to fermion anti-commutation) are in general difficult to avoid \cite{Henelius2000}, except in special cases, e.g., the aforementioned bipartite antiferromagnets, where the number of minus signs in the product is always even. \vskip2mm Methods based on sampling the traces in Eq.~(\ref{zsse1}) were first developed for general-$S$ Heisenberg models \cite{Sandvik91} and 1D Hubbard-type models \cite{Sandvik92} almost 30 years after the advent of Handscomb's original method, and the extended series scheme eventually became known as the SSE. Over the years, many further improvements of these algorithms have been made---some inspired by developments within other methods and some proposed first within the SSE scheme and later adopted into other techniques. The SSE method was the first broadly applicable exact QMC scheme (i.e., not affected by any systematical errors such as those from time discretization) and it was also the forerunner and inspiration to later algorithms based on other series expansions, in particular, the perturbation series leading to the continuous-time {\it worm algorithm} \cite{Prokofev98}. \vskip2mm The SSE method can in principle be used for any model written in a discrete basis, though in practice sign problems restrict applications to the same classes of models as the WL methods. Models that have been successfully studied include many spin Hamiltonians, boson models, and 1D fermion systems (see Sec.~\ref{sec:examples}). Both the WL and SSE approaches normally have insurmountable sign problems for fermions in higher dimensions (unlike, in some cases, auxiliary-field fermion determinant methods \cite{Blankenbecler81,Hirch85}). Models with controllable sign problems accessible to SSE include certain frustrated impurities in antiferromagnets, where the signs arise only locally at the impurity and the bulk operators do not involve any signs \cite{Liu09}. \vskip2mm The sampled basis in SSE simulations is typically the $z$ components $S^z_i$ for spin systems or the site occupation numbers $n_i=a^\dagger_ia_i$ for particle models. More complicated states can also be used, e.g., the basis of singlets and triplets on spin dimers has been used to solve certain sign problems \cite{Alet16,Honecker16}. The primary advantage of SSE over discrete-time WL methods for sign-free models is the absence of time-discretization error---the discrete dimension corresponding to the location in the SSE operator string constitutes a faithful representation of continuous imaginary time \cite{Sandvik92,Sandvik97}, as we will discuss below. Compared to more recently developed continuous-time WL methods \cite{Beard96,Prokofev98}, the discreteness of the SSE representation often allows for more efficient sampling schemes. For many models (especially spin systems), the SSE outperforms all other known QMC methods. Typically the SSE method is also easier to implement. \subsection{Continuous time in the power-series representation} Before discussing how to sample the SSE configuration space (in Sec.~\ref{sec:sampling}) and compute expectation values of interest (in Sec.~\ref{sec:estimators}), it is useful to consider some formal relationships between path integrals and the series representation of statistical mechanics. At the same time we will introduce some concepts that will be useful later in algorithm definitions and implementations. \vskip2mm We can insert complete sets of states between all the operators in Eq.~(\ref{zsse1}) to write the SSE partition function in the form \begin{equation} Z_{\rm SSE} = \sum_{n=0}^\infty \frac{\beta^n}{n!} \sum_{S_n} \sum_{\{ \alpha \}} \langle \alpha_0| H_{b_n}|\alpha_{n-1}\rangle \cdots \langle \alpha_2|H_{b_2}|\alpha_1\rangle \langle \alpha_{1}|H_{b_1}|\alpha_0\rangle , \label{zsse2} \end{equation} where one can see a similarity with the path integral in Eq.~(\ref{zpath}). The inserted states (except for $|\alpha_0\rangle$) are redundant in the SSE method, however, because the operators $H_b$ should be defined such that, for every possible combination of operator $H_b$ and basis state $|\alpha\rangle$, the state $H_b |\alpha\rangle$ is proportional to a single basis state; $H_b |\alpha\rangle = h_{b\alpha}|\alpha'\rangle$, $|\alpha'\rangle \in \{ |\alpha\rangle \}$ (and $h_{b\alpha}$ is the trivial matrix element $\langle \alpha '|H_b |\alpha\rangle$). Then the operator string itself uniquely defines how the state $|\alpha_0\rangle$ in Eq.~(\ref{zsse2}) is propagated through a series of basis states (similar to a path in the WL formulation) and eventually arrives back to the same state $|\alpha_0\rangle$ for an operator string contributing to the partition function (with the periodicity reflecting the original trace operation). Clearly the vast majority of the strings violate the periodicity condition and for those we have $\langle \alpha_0| H_{b_n}\cdots H_{b_1}|\alpha_0\rangle =0$. The strings should therefore be sampled so that the periodic ``time'' boundary condition is always maintained in any attempted update. \vskip2mm To ensure the ``no-branching'' condition $H_b |\alpha\rangle \propto |\alpha'\rangle$, the diagonal and off-diagonal parts of all the terms in $H$ have to be separated. The index $b$ then does not just refer to sites or bonds (or larger units of sites for interactions involving more than two sites) but enumerates separately the diagonal and off-diagonal terms. This is some times accomplished (formally and in actual program implementations) by introducing an additional index, so that $H_{1,b}$ refers to, say, the diagonal part and $H_{2,b}$ is the off-diagonal part of the interaction on bond $b$. In some cases the off-diagonal operators have to be formally split up further , e.g., in the case of $S>1/2$ Heisenberg spin systems the off-diagonal part of the interaction, $S^x_iS^x_j + S^y_iS^y_j = \frac{1}{2} (S^+_iS^-_j + S^-_iS^+_j)$ has to be regarded as two different operators, $\frac{1}{2}S^+_iS^-_j$ and $\frac{1}{2}S^-_iS^+_j$. In contrast, for $S=1/2$ the sum of the two terms can be considered as a single operator, since only one of them can give a non-zero result when acting on a basis state. \vskip2mm With the no-branching condition ensured, for a given operator string $S_n$, a propagated state $|\alpha(p)\rangle$ is defined in the SSE method as the state obtained when the first $p$ operators have acted on the ket state $|\alpha_0\rangle = |\alpha(0)\rangle$ in Eq.~(\ref{zsse2}), \begin{equation} |\alpha(p)\rangle = r\prod_{i=1}^p H_{b_i} |\alpha_0\rangle, \label{pstate} \end{equation} where $r$ formally is a normalization constant (which does not have to be computed in practice). In the sum over complete sets of states in Eq.~(\ref{zsse2}), there is now a single contributing component for each $p$, namely, $|\alpha_p\rangle = |\alpha(p)\rangle$, and the operator string uniquely defines the path of states evolving from $|\alpha_0\rangle$. \vskip2mm The propagated states also have a simple relationship to imaginary-time evolution in path integrals, where starting from some state $|\phi (0)\rangle$ at imaginary time $\tau=0$ we have the evolved state $|\phi (\tau)\rangle = r{\rm e}^{-\tau H}|\phi(0)\rangle$, where again we formally have a normalization constant $r$ because of the non-unitary evolution. For an SSE string of length $n$, we roughly have the correspondence $(p/n)\beta \approx \tau$ (which becomes increasingly accurate with increasing $n$). \vskip2mm The precise relationship between the discrete index $p$ and the continuous time variable $\tau$ can be seen in the SSE expression for a time dependent correlation function of some operators $A$ and $B$. With the a time dependent operator given by $B(\tau)={\rm e}^{\tau H} B {\rm e}^{-\tau H}$, by series expanding the thermal expectation value $\langle B(\tau)A(0)\rangle$ we obtain \begin{equation} \langle B(\tau)A(0)\rangle = \frac{1}{Z} \sum_{\alpha}\sum_{m,p}\frac{(\tau-\beta)^m(-\tau)^p}{m!p!} \langle \alpha| H^m B H^p A |\alpha \rangle, \label{atau} \end{equation} which can also be expanded into a summation over operator strings as we did in the partition function above. We defer until later the question of what types of operators can be considered in correlation functions in practice (but note that diagonal operators can always be treated easily). Here we just consider the general formal relationship between the index $p$ in Eq.~(\ref{atau}) and the time difference time $\tau$. We can see that the expansion of ${\rm e}^{-\tau H}$ in powers $H^p$ is independent of the expansion of ${\rm e}^{-(\beta-\tau) H}$ in powers $H^m$, and to estimate the distribution $P(p)$ roughly we can just replace $H^p$ by $\langle H\rangle^p$. Then we again have a Poisson distribution with mean $\langle p\rangle = \tau |\langle H\rangle|$, which also equals $(\tau/\beta)\langle n\rangle$, where $n$ is the total expansion power of a given term; $n=m+p$. Stated differently, propagation by $p$ operators in SSE corresponds roughly to a displacement $\tau = (p/n)\beta$ in imaginary time, as already mentioned at the end of the preceding paragraph. Eq.~(\ref{atau}) shows more precisely that the relationship between any given $\tau$ involves summation over a sharply peaked distribution of states propagated by powers $H^p$ of the Hamiltonian. \vskip2mm The similarity between the series approach and the path integral becomes even more obvious if the exponentials in Eq.~(\ref{zpath}) are expanded to linear order, ${\rm e}^{-\Delta_\tau H} \approx 1-\Delta_\tau H$; \begin{equation} Z_{\rm PI} \approx \sum_{\{ \alpha \}} \langle \alpha_0|1-\Delta_\tau H|\alpha_{L-1}\rangle \cdots \langle \alpha_2|1-\Delta_\tau H|\alpha_1\rangle \langle \alpha_{1}|1-\Delta_\tau H|\alpha_0\rangle, \label{zpath2} \end{equation} where the total error arising from all slices is of order $\Delta_\tau$, worse than the $\Delta_\tau^2$ error when the Trotter decomposition is used. We will in the end take the limit $\Delta\tau \to 0$ and the treatment becomes exact. Next we again write $H$ as a sum over its individual terms $H_b$ with a minus sign taken out in front, $H=-\sum_b H_b$. Furthermore, we can introduce new name for the unit operators $1$ in the matrix elements, defining $H_0=1$. Then, similar to the SSE formalism, we can write the path integral as a sum over index sequences $S_L = b_L,\ldots,b_2,b_{1}$ but now with the new index $b=0$ also allowed and with the number $L$ of indices fixed; \begin{equation} Z_{\rm PI} = \sum_{\{ \alpha\}} \sum_{S_L}\Delta_\tau^n \langle \alpha_0|H_{b_L}|\alpha_{L-1}\rangle \cdots \langle \alpha_2|H_{b_2}|\alpha_1\rangle \langle \alpha_{1}|H_{b_1}|\alpha_0\rangle, \label{zpath3} \end{equation} where $n$ is the number of elements in $S_L$ that are not equal to $0$ (i.e., the number of times actual terms of $H$ appear in a given operator product). \vskip2mm In the case of the SSE partition function (\ref{zsse2}), there is an explicit sum over expansion orders $n$ that does not appear in the path integral expression (\ref{zpath3}), but since we know that the series expansion is convergent we can introduce a cut-off, $n_{\rm max} = M$, and for expansion orders lower than $M$ we can use ``fill-in'' unit operators, defining $H_0=1$ as above. If we further consider all possible ways of distributing $n$ Hamiltonian terms within a product of $M$ operators out of which $M-n$ are unit operators, the SSE partition function becomes \begin{equation} Z_{\rm SSE} = \sum_{\{ \alpha \}} \sum_{S_M} \frac{\beta^n(M-n)!}{M!} \langle \alpha_0| H_{b_M}|\alpha_{M-1}\rangle \cdots \langle \alpha_2|H_{b_2}|\alpha_1\rangle \langle \alpha_{1}|H_{b_1}|\alpha_0\rangle , \label{zsse3} \end{equation} where we have divided the weight by in Eq.~(\ref{zsse2}) by the combinatorial factor $M!/[n!(M-n)!]$ to compensate for overcounting of identical contributions with different locations of the unit operators. Note again that $n$ is the number of non-$0$ elements in the operator-index string, and a summation over $n$ in Eq.~(\ref{zsse3}) is implicit in the summation over all fixed-length sequences. \vskip2mm For a given common string length $M=L$, we now see that the path integral and SSE partition functions in Eqs.~(\ref{zpath3}) and (\ref{zsse3}) involve exactly the same configuration space, but the weighting of the configurations is slightly different. However, the weights become identical in the limit where $\Delta_\tau \to 0$ is taken in the path integral, since $\Delta^n = \beta^n/L^n$ and for $M \to \infty$ we have $\beta^n(M-n)!/M! \to \beta^n/M^{n}$ in the SSE weight. Thus, we conclude that the two approaches are really identical if the limit $M=L \to \infty$ is taken. An important difference is that the SSE approach is in practice exact (i.e., the truncation error is exponentially small and not detectable in practice) already for some $M$ of order $\beta N$, while the path integral, in the approximation used above, is affected by an error of order $\beta /L$. An exceedingly large number of slices $L$ would have to be used for the error to become completely negligible. In a sense, the SSE method automatically finds the optimal number of slices for given $N$ and $\beta$. \vskip2mm Of course, the path integral approach as described above should not be used in an actual WL algorithm, because simple approximants of ${\rm e}^{-\Delta_\tau H}$ with smaller errors are available, i.e., the Trotter decomposition. The reason for using the linear approximation here was simply to obtain the most direct relationship between the SSE and path-integral forms of $Z$. In the case of the SSE, while it is not necessary to introduce the fill-in operators $H_0=1$ \cite{Sandvik92}, in practice it is actually convenient and efficient to use this device to achieve a fixed length of the index sequence. The cut-off $M$ can be easily adjusted automatically during the equilibration part of a simulation, in such a way that the number $n$ of Hamiltonian operators always stays below $M$ by a safe margin, as will be further discussed when updating schemes are described in Sec.~\ref{sec:sampling}. \vskip2mm The more recently developed continuous-time WL methods can be formally obtained by taking the limit $\Delta_\tau \to 0$ in Eq.~(\ref{zpath}). This is equivalent to the form (\ref{zpath3}) of the partition function, where the events correspond to the operators $H_{b_i}$. However, in this case it is better to keep the diagonal operators in the exponential form instead of expanding them to linear order, and then the paths of events dictated by the off-diagonal operators formally correspond to the perturbation expansion in the interaction representation \cite{Prokofev98,Sandvik97}. In a computer program, only the ``events'', where and how the paths change, need to be stored \cite{Beard96,Prokofev98}. \vskip2mm To see the equivalence with the perturbation series more clearly, we can divide the $H$ into its diagonal part $H_0$ in the chosen basis and an off-diagonal part $V$. As an example, for a generic Heisenberg spin system we could choose $H_0=\sum_{ij} J_{ij} S^z_iS^z_j$ and $V=\sum_{ij} J_{ij} (S^+_iS^-_j + S^-_iS^+_j)$. Then, by considering $V$ as a perturbation to $H_0$ (though eventually there will be no restriction on the strengths of the two terms) and carrying out the perturbation series to all orders we obtain the partition function as an integral in continuous imaginary time \begin{equation} Z_{\rm CT} = \sum_{n=0}^\infty (-1)^n \int_0^\beta d\tau_1 \int_0^{\tau_1} d\tau_2 \cdots \int_0^{\tau_{n-1}} d\tau_n {\rm Tr}\{e^{-\beta H_0} V(\tau_n) \cdots V(\tau_2)V(\tau_1)\}, \end{equation} where the time-evolved operator in the interaction representation is $V(\tau)={\rm e}^{\tau H_0} V{\rm e}^{-\tau H_0}$. Like in the SSE method, we can now sample the trace in the chosen basis and write the product $V(\tau_n) \cdots V(\tau_2) V(\tau_1)$ as a string of time evolved operators $V_b$ (now only including off-diagonal terms). When inserting complete sets of states between all the operators and summing over diagonal terms for the trace, the exponentials just become numbers, and the weight of a given configuration (a state $|\alpha_0\rangle$ acted on with an operator string) for a given set of times $\tau_1,\ldots,\tau_n$ can be easily computed. The integrals over time can also be sampled in an MC procedure in which all the degrees of freedom are updated together efficiently \cite{Beard96,Prokofev98}. The relationships between the SSE and continuous time formulation have been discussed in more detail in Ref.~\cite{Sandvik97}. \vskip2mm Like the SSE method, the perturbation expansion converges with a mean string length of order $\beta N$, regardless of the relative strengths of $H_0$ and $V$. When $H_0$ dominates the energy the prefactor will be smaller in the perturbation expansion, which then is more economical. When $H_0$ is not very dominant (which is common with quantum spin models, where the diagonal and off-diagonal energies are often similar in magnitude) the SSE approach has an advantage owing to the fact that it is formulated in a completely discrete representation, while in the continuous-time formulation floating-point numbers (the imaginary time points) have to be processed. Recently, the SSE scheme was also further developed for systems where $H_0$ dominates \cite{Albash17} (which often correspond to a nearly classical statistical system), essentially by integrating out all the diagonal terms from the SSE operator strings. This approach may be as efficient as the continuous-time WL approaches (or even more efficient in some cases) when there is a large imbalance in the strengths of the diagonal and off-diagonal terms. The original SSE approach should still be better (because of the simplicity of the algorithm) when the terms are similar in strength. \subsection{Stochastic series expansion for ground states} \label{sec:projector} \index{ground-state projector method} In order to study the ground state of a system, one can take the limit $T \to 0$ within one of the methods discussed above. In practice, this means $T \ll \Delta$, where $\Delta$ is the smallest finite-size excitation gap of the system. For systems with gaps closing as $1/L$ (where from now on $L$ will refer to the linear size of the lattice), the ground state can be routinely reached on systems with thousands, in many cases even tens of thousands, of spins or bosons. \vskip2mm Ground states can also be studied using ``projector methods'', where, instead of tracing over a complete basis, the imaginary-time evolution operator ${\rm e}^{-\beta H}$ propagates some initial state $|\Psi(0)\rangle$ (often called ``trial state'', though this term can be misleading, since the final result should be independent of the choice of initial state) that overlaps with the ground state; $|\Psi(\beta)\rangle = {\rm e}^{-\beta H} |\Psi(0)\rangle$. By expanding in energy eigenstates, one can readily confirm that $|\Psi(\beta)\rangle$ approaches the ground state for sufficiently large $\beta$ (up to a normalization factor). \vskip2mm In this case, the MC sampling is of terms contributing to the normalization $\langle \Psi(\beta)|\Psi(\beta)\rangle$. The numerator of an expectation value, \begin{equation} \langle A\rangle = \frac{\langle \Psi(\beta)|A|\Psi(\beta)\rangle}{\langle \Psi(\beta)|\Psi(\beta)\rangle}, \label{ags} \end{equation} is similarly expressed to obtain estimators to be averaged in the MC process. Here one can proceed as in the path integral approach, by introducing a discrete slicing $\Delta_\tau=\beta/L$ of ${\rm e}^{-\beta H}$ or taking the limit $\Delta_\tau=0$ as in the continuous time formulation. This type of method is known generically as the {\it path integral ground state} (PIGS) approach; \index{path integral ground state method} for a review see Ref.~\cite{Yan17}. One can also proceed with the ground state expectation value (\ref{ags}) as in the SSE method by series expansion and sampling strings of operators. In either case, the main difference from the $T>0$ methods is the boundary condition in the time direction---at $T>0$ we have periodic boundaries, reflecting the trace oparetion, while in the ground state approach the boundary condition is dictated by the starting state $|\Psi(0)\rangle$. This state is normally chosen such that the time boundary condition is convenient for the updating process used in the MC sampling \cite{Sandvik10a}, and it can also some times be optimized in some way, so that it already is a good approximation to the ground state. Note that the projection procedure is variational, so that $\langle H\rangle$ always approaches the true ground state energy monotonically from above. \vskip2mm Instead of projecting out the ground state with ${\rm e}^{-\beta H}$, a high power $(-H)^m$ of the Hamiltonian can also be used (where the negative sign is just included for convenience as the ground state energy is normally negative). For sufficiently large $m$, $(-H)^m|\Psi(0)\rangle$ approaches the eigenstate whose eigenvalue is the largest in magnitude, i.e., either the ground state of $H$ or of $-H$. Convergence to the ground state of $H$ can be ensured by adding a suitable constant to $H$. \vskip2mm We can now ask, what is the more efficient approach, using ${\rm e}^{-\beta H}$ or $(-H)^m$? Proceeding as we did above when discussing the distribution of expansion orders in the SSE, we an see that the power $m$ required to reach the ground state is related to the $\beta$ value required with the exponential operators as $m \approx \beta|E_0|$, where $E_0$ is the total ground state energy (which has been discussed in detail in Ref.~\cite{Sen15}). As in the SSE method, $(-H)^m$ is expanded out into strings of the terms of the Hamiltonian, and these are sampled along with the starting state. There is no major difference between the two approaches, as the summation over $n$ required with the series expansion is accomplished essentially for free when using the fixed string-length SSE approach, Eq.~(\ref{zsse3}). The sampling of the operator strings does not differ significantly between the two approaches. \vskip2mm The ground state projector method is particularly useful when starting states $|\Psi(0)\rangle$ can be used that are tailored to the sampling method used for the operator sequences. For Heisenberg quantum spin models, good variational starting states can be written in the valence-bond basis \cite{Lou07,Lin12}, i.e., the overcomplete basis of singlet pairs, and these are ideally matched with loop-algorithm sampling schemes \cite{Sandvik10a}. The valence-bond states have total spin $S_{\rm tot}=0$ and momentum $0$, which is the ground state sector for the models where the approach is suitable. Fixing these quantum numbers from the outset can help to reduce the projection time $\beta$ (or power $m$) \vskip2mm We will not discuss further any specifics of ground-state projector methods, but just note again that the differences with respect to $T>0$ methods are very minor, and typically it is very easy to change a program from one case to the other. \subsection{Quantum annealing with generalized stochastic series expansion} \index{quantum annealing} In projector QMC calculations, results obtained from a projected state $|\Psi(\beta)\rangle$ at first sight has no obvious use if the projection ``time'' $\beta$ is not sufficiently large for achieving convergence to the ground state. However, when considering ${\rm e}^{-\beta H}$ as a time evolution operator in imaginary time, i.e., with time $t=-i\beta$ in $U(t)={\rm e}^{-itH}$, the projection corresponds to a quantum quench from the initial state $|\Psi(0)\rangle$ where at $t=0$ the Hamiltonian is suddenly changed from the one which has $|\Psi(0)\rangle$ as its ground state to whatever $H$ is considered in the simulation. Though imaginary and real time evolutions are quite different, one can some time extract real-time dynamic information from such imaginary-time quenches \cite{Weinberg17}. \vskip2mm Real-time quantum dynamical calculations are in general very difficult, with any existing method, and it is interesting to ask what information may be gleaned from imaginary time evolution, where, for sign free models, QMC calculations can be carried out for various out-of-equilibrium situations. The aforementioned quantum quench in imaginary time is an extreme case of a more general setup where the Hamiltonian has some time dependence; $H=H(\tau)$ in imaginary time. The time evolution operator, starting at $\tau=0$, is then \begin{equation} U(\tau) = T{\rm exp} \left ( -\int_0^\tau d\tau ' H(\tau ') \right ), \end{equation} where $T$ indicates time-ordering, and one may consider expectation values \begin{equation} \langle A(\tau)\rangle = \frac{\langle \Psi(0)|U(\tau)AU(\tau)|\Psi(0)\rangle}{\langle \Psi(0)|U(\tau)U(\tau)|\Psi(0)\rangle}. \label{atauevolved} \end{equation} Here one can again proceed with a time-slicing approach or apply a series expansion. Using the latter, the time evolution operator can be written as \begin{equation} U(\tau) = \sum_{n=0}^\infty (-1)^n \int_{\tau_{n-1}}^\beta d\tau_n \cdots \int_{\tau_1}^{\beta} d\tau_2 \int_0^{\beta} d\tau_1 H(\tau_n) \cdots H(\tau_2) H(\tau_1), \end{equation} and one can proceed as in the several other cases discussed above and expand further into strings of terms of the Hamiltonian. Now, however, the Hamiltonian depends on imaginary time and the string is always time ordered. One can sample the strings and the initial state $|\Psi(0)\rangle$ with schemes very similar to the SSE method, and the the integrals can be taken into account by sampling sequences of ordered time points \cite{Degrandi11}. \vskip2mm There is also an alternative approach based on a product of Hamiltonians $H(\tau_m) \cdots H(\tau_2)H(\tau_1)$ for a fixed number of operators $m$, with a fixed spacing between the time points and no integrals over time \cite{Liu13}. This results in a dynamics slightly different from the Schr\"odinger dynamics in imaginary time, but for scaling purposes, e.g., when investigating dynamical quantum-criticality (i.e., the dependence on observables on the rate at which the Hamiltonian is changed in time close to a critical point), the two approaches both give correct results. It should be noted that these approaches really probe Hamiltonian quantum dynamics, and not the stochastic dynamics of the QMC sampling methods (as is the case with the other methods often referred to as ``simulated quantum annealing'' \cite{Boixo14}) \cite{Degrandi13,Liu15}. \section{Sampling algorithms and expectation values} \label{sec:sampling} We consider two classes of important $S=1/2$ quantum spin models to illustrate SSE sampling schemes. First, the Heisenberg antiferromagnet defined by \index{Heisenberg antiferromagnet} \begin{equation} H = J \sum_{\langle ij\rangle} {\bf S}_{i} \cdot {\bf S}_{j} = J \sum_{\langle ij\rangle} [S^z_{i}S^z_{j} + \hbox{$\frac{1}{2}$}(S^+_{i}S^-_{j} + S^-_{i}S^+_{j})], \label{heisenberg} \end{equation} where $\langle ij\rangle$ refers to the nearest-neighbor sites pairs on an arbitrary bipartite (to avoid sign problems) lattice. Second, we consider the transverse-field Ising model (which will hereafter be referred to as just the Ising model), which is often defined with Pauli matrices, \index{transverse-field Ising model} \begin{equation} H = -\sum_{ij}J_{ij} \sigma^z_{i} \sigma^z_{j} - h \sum_{i} (\sigma^+_{i} + \sigma^-_{i}). \label{ising} \end{equation} Here the Hamiltonian is written with a generic Ising coupling $J_{ij}$ with no restriction on the range of the interactions, and we will consider both short-range and long-range cases. The SSE method can also be used with long-range interactions in the Heisenberg case, though with the limitation that there can be no frustration in order to maintain positive-definite sampling weights. With anisotropic Heisenberg interactions, which we will consider later, the diagonal part can also be frustrated. It is some times better to study the Ising model in a rotated basis, or, equivalently, to use the same $\sigma^z$ basis as above but with the Hamiltonian written as \begin{equation} H = -\sum_{ij}J_{ij} \sigma^x_{i} \sigma^x_{j} - h \sum_{i} \sigma^z_{i}, \label{ising2} \end{equation} where $\sigma^x_i = \sigma^+_i + \sigma^-_i$. Whichever version is better depends on details of the system (e.g., whether the interactions are frustrated, if disorder is present, etc.) and what physical observables are to be calculated (noting that diagonal observables are often easier to access, as we will see in sec.~\ref{sec:estimators}). We will here only discuss implementations of algorithms with the version in Eq.~(\ref{ising}). \subsection{Configuration representations and diagonal updates} As discussed in Sec.~\ref{sec:sse1}, a configuration in the SSE algorithm comprises a state $|\alpha_0\rangle$ and an index sequence $S_M = b_1,b_2,\ldots,b_M$, the latter referring to a product of operators (and we will use the terms ``operators'' and ``indices'' interchangeably). Here we take the expression of the partition function in Eq.~(\ref{zsse3}), where the index sequence is of a fixed length $M$ (whic can be determined in a self-consistent way by the program during the equlibration part of a simulation). Removing the redundant complete sets of states we have \begin{equation} Z_{\rm SSE} = \sum_{S_M} \frac{\beta^n(M-n)!}{M!} \sum_{\{ \alpha \}} \langle \alpha| H_{b_M} \cdots H_{b_2}H_{b_1}|\alpha\rangle , \label{zsse4} \end{equation} where in the products of $M$ operators there are $n$ terms of the Hamiltonian along with $M-n$ randomly distributed unit operators represented by the index $b=0$. The number $n$ changes in updates that are called {\it diagonal updates}, because they involve replacing a unit operator $H_0$ by a diagonal term of $H$ (which we simply refer to as an operator insertion), whence $n \to n+1$, or vice versa (an operator removal), in which case $n \to n-1$. The generic way to carry out a sequence of diagonal updates is to go through the elements in $S_M$ one-by-one and to attempt a replacement of the index whenever it does not correspond to an off-diagonal operator. \vskip2mm Off-diagonal operators cannot be updated individually while maintaining the periodicity constraint $|\alpha(M)\rangle = |\alpha(0)\rangle$ for the propagated states defined according to Eq.~(\ref{pstate}). How to carry out updates with the off-diagonal operator will be discussed in detail in the next section, but here we note that the general strategy is to replace some number of diagonal operators by off-diagonal ones, or vice versa, without changing the lattice location of the operator. With some models, the original Hamiltonian contains operators that makes this possible, e.g., in the case of the Heisenberg interaction there are diagonal and off-diagonal operators on each bond, while in other cases certain constant diagonal operators have to be added just for the purpose of enabling the necessary operator replacements. The operator replacements also imply changes in the states, and normally the SSE algorithm is ergodic even if no other explicit state updates are included (though at high temperatures it can be useful to also carry out additional updates only on the stored state $|\alpha\rangle$, keeping the operator string unchanged). \vskip2mm To carry out an update at position $p$ in the sequence requires the propagated state $|\alpha(p-1)\rangle = |\alpha(p)\rangle$ on which the diagonal operator $H_{b_p}$ acts. The operator-index string is examined for each $p=1,\ldots,M$, and diagonal updates are attempted where possible. Whenever an off-diagonal operator is encountered at a position $p$, the stored propagated state is advanced; $|\alpha(p)\rangle = H_{b_p}|\alpha(p-1)\rangle$. If an encountered index $b_p=0$, one out of a number $N_d$ of diagonal operators can be chosen at random and inserted with a Metropolis acceptance probability, which depends on the matrix element $\langle \alpha(p)|H_{b'_p}|\alpha(p)\rangle$, where $b'_p$ is the new generated diagonal index. If the current index $b_p \not=0$, a replacement with $b'_p=0$ is attempted, and the acceptance probability then depends on the current matrix element $\langle \alpha(p)|H_{b_p}|\alpha(p)\rangle$. These updates change the expansion power $n$ by $+1$ and $-1$, respectively, and this change also enters in the acceptance probability due to the factor $(M-n)!$ in the configuration weigh in Eq.~(\ref{zsse4}). Importantly, to maintain detailed balance, the acceptance probabilities must also compensate for the inherent imbalance stemming from the fact that there are $N_d$ ways of tentatively replacing an index $b_p=0$ by a non-zero index (some of which may correspond to vanishing matrix elements, but that is irrelevant at this stage) when the number of Hamiltonian terms $n$ is increased by one, while for removing an operator there is only one way of replacing $b_p \not=0$ by $0$. \vskip2mm With all the relevant factors and imbalance taken into account, the following are the correct generic acceptance probabilities for a single-operator diagonal update with the SSE partition function (\ref{zsse4}): \begin{subequations} \begin{eqnarray} P(0 \to b_p) & = & \frac{\beta N_d \langle \alpha(p)|H_{b_p}|\alpha(p)\rangle}{M-n}, \label{pinsert} \\ P(b_p \to 0) & = & \frac{M-n+1}{\beta N_d \langle \alpha(p)|H_{b_p}|\alpha(p)\rangle}, \label{premove} \end{eqnarray} \end{subequations} where $n$ is the number of Hamiltonian operators in $S_M$ before the update is carried out. The matrix elements are trivial, and often some fraction of them vanish. \vskip2mm As an alternative to Metropolis-type updates as described above, one can carry out the diagonal updates according to a heat-bath scheme, where the relative probabilities of all diagonal operators, including the fill-in unit operators, are considered and a choice is made among them according to their relative probabilities (instead of choosing them with equal probability in the scheme above, irrespective of the values of the matrix elements). In many cases it would take too long to compute these relative probabilities for each new state $|\alpha(p)\rangle$, but for sufficiently simple models it is possible to avoid this step, at the cost of some rejected attempts, as will be discussed below in the context of systems with long-range interactions. \vskip2mm Let us now be more specific and discuss how to represent the SSE configurations for the Heisenberg and Ising models. Illustrations are provided in Fig.~\ref{fig:config}. We denote the spins in the stored state by $\sigma_i$, $i=1,2,\ldots,N$, and in a computer implementation they can be stored as integers, $\sigma_i = \pm 1$. In both cases, to define the terms $H_b$ appearing in the operator products it is convenient to regard the subscript $b$ as formally representing two indices (which can still for efficiency be packed back into a single integer in a program), but in slightly different ways for the two models considered. In both cases we use the notation $H_{0,0}=1$ for the fill-in unit operators. \begin{figure}[t!] \centering \includegraphics[width=0.9\textwidth]{fig1.pdf} \caption{Graphical representations of SSE configurations for (a) the Heisenberg model and (b) the Ising model, in both cases for a system of four spins and with the SSE cutoff $M=8$. Up and down spins correspond to solid and open circles. All the propagated states $|\alpha(0)\rangle,\ldots,|\alpha(M)\rangle$, with $|\alpha(M)\rangle=|\alpha(0)\rangle$, are shown along with the operators $H_{b_p}$. The number of Hamiltonian terms for both systems is $n=6$, and the two cases of empty slots between propagated states correspond to fill-in unit operators $H_{0,0}$ at these locations. In (a) the solid and open bars represent, respectively, off-diagonal and diagonal parts of the Heisenberg exchange operators. In (b) the ferromagnetic Ising interactions are likewise represented by open bars, and the off-diagonal single-spin flip operators are represented by short solid bars. The short open bars correspond to the constant site-indexed operators.} \label{fig:config} \end{figure} \vskip2mm For the antiferromagnetic Heisenberg model (\ref{heisenberg}) we set $J=1$ and define the following diagonal and off-diagonal operators: \begin{equation} H_{1,b} = \hbox{$\frac{1}{4}$} - S^z_{i}S^z_{j},~~~~~~ H_{2,b} = \hbox{$\frac{1}{2}$}(S^+_{i}S^-_{j} + S^-_{i}S^+_{j}). \end{equation} Then $H = -\sum_b [H_{1,b}-H_{2,b}]+N_b/4$, where $N_b$ is the total number of interacting spin pairs, e.g., $N_b=DN$ for $N$ spins on a $D$-dimensional simple cubic lattice with periodic boundary conditions. Here a constant ${1}/{4}$ has been included in the diagonal operators, and they can therefore act with a non-zero outcome only on two antiparallel spins. There is then a useful (as we will see) similarity with the off-diagonal terms, which also can only act on antiparallel spins. The non-zero matrix elements of the Hamiltonian terms $H_{1,b}$ and $H_{2,b}$ are all $1/2$. The weight of an allowed SSE configuration in Eq.~(\ref{zsse4}) is therefore $W(S_M) = (\beta/2)^n(M-n)!$, where the unimportant overall factor $1/M!$ has been omitted and there are never any minus signs (for bipartite interactions) because the number of off-diagonal operators in the string has to be even. \vskip2mm Note that there is no explicit dependence of the weight on the state $|\alpha\rangle$ in Eq.~(\ref{zsse4}), but the state imposes constraints on the operator string as only operations on antiparallel spins are allowed. An example of a very small Heisenberg SSE configuration is shown in Fig.~\ref{fig:config}(a). Note again that the mean number of operators is $\propto \beta N$, and in large-scale simulations the number can be up to many millions. \vskip2mm In the diagonal update, if an encountered index pair at the current location $p$ is $b_p=[0,0]$, a bond index $b$ is generated at random among all the choices. If the spins at the sites $i(b),j(b)$ connected by bond $b$ are antiparallel in the currently stored state $|\alpha(p)\rangle$, i.e., $\sigma_i\not=\sigma_j$, then the operator $H_{1,b}$ is allowed and the index pair is set to $b_p=[1,b]$ with probability given by (\ref{pinsert}), where the matrix element equals $1/2$. If the two spins are parallel nothing is changed and the process moves to the next position, $p \to p+1$. Each time an off-diagonal operator $[2,b]$ is encountered, in which case no diagonal update can be carried out, the stored state is propagated; $\sigma_i \to -\sigma_i$ and $\sigma_j \to -\sigma_j$. \vskip2mm For the Ising model (\ref{ising}), where the Ising interactions $J_{ij}$ are of arbitrary range, we define the following operators \cite{Sandvik03}: \begin{equation} H_{i,j} = |J_{ij}| -J_{ij}\sigma^z_{i}\sigma^z_{j} ~~~(i\not= j), ~~~~~ H_{i,i} = h, ~~~~~ H_{i,0}=h(\sigma^+_{i} + \sigma^-_{i}). \label{isingops} \end{equation} Here the constant site-indexed operators $H_{i,i}$ serve as an example of how trivial diagonal terms can be added to the Hamiltonian for the purpose of carrying out off-diagonal updates---as we will see in the next section, updates will be based on replacements $H_{ii} \leftrightarrow H_{i,0}$. In the diagonal updates, the trivial constants will be inserted and removed along with the Ising operators $H_{i,j}$ ($i,j \not= 0$, $i \not=j$). In the Ising operators, the presence of the constant $|J_{ij}|$ implies that only operation on a parallel pair of spins (for a ferromagnetic coupling $J_{ij}$) or an antiparallel pair (for antiferromagnetic coupling) is allowed. This choice of the added constant is again motivated by its convenience for constructing the off-diagonal (cluster) update, as we will see further below. The example of an SSE Ising configuration in Fig.~\ref{fig:config}(b) only includes nearest-neighbor ferromagnetic interactions. \vskip2mm For a $D$-dimensional simple cubic lattice and only nearest-neighbor interactions $J$ included, there are now $N_d=(D+1)N$ diagonal operators, of which $DN$ are Ising terms and $N$ are the constant operators $H_{i,i}$. When these are all generated with equal probability in attempts to insert operators, with the Metropolis acceptance probability given by Eq.~(\ref{pinsert}), there is an inherent inefficiency if $h$ and $J$ are very different. For example, if $J=1$ and $h \ll 1$, most of the attempted $h$-operator insertions will be rejected. \vskip2mm The rejection problem becomes worse with long-range interactions, e.g., \index{long-range interactions} if $J_{ij}$ decays with the separation $r_{ij}$ as a power law, $|J_{ij}| \propto r_{ij}^{-\alpha}$. Then there are $N(N-1)/2+N=N(N+1)/2$ diagonal operators to generate at random, and those with very small $J_{ij}$ will be rejected almost always. This problem can be overcome easily by generating the diagonal Hamiltonian terms along with the fill-in operators $H_{00}$ using a heat-bath method \cite{Sandvik03}. Instead of treating operator insertions and removals as different types of updates, these are now combined and carried out at all positions $p$ at which the current operator $H_{b_p}$ is not off-diagonal. The method needs a precomputed table of integrated relative probabilities $P_{ij}$ of all the different diagonal operators, where it is tentatively assumed that all operators are allowed. The probabilities are calculated from Eq.~(\ref{zsse4}) and the definitions in (\ref{isingops}), and, for efficiency, mapped into a single-index ordered table $P_k$, $k=1,\ldots,N(N+1)/2$. In each diagonal update, a random number $ r \in [0,1)$ is generated and the corresponding operator is identified in the table, using the bisection method to search in the ordered table for the corresponding probability window $P_{k-1} \le r < P_k$, thus finding the correct operator indices $i(k),j(k)$ in $\propto \ln(N)$ operations. A new Ising operator has to be rejected if the spins $\sigma_i,\sigma_j$ are incompatible with the sign of the interaction $J_{ij}$. \vskip2mm A very useful aspect of this approach is that it renders an algorithm with processing time scaling as $N \ln(N)$ for long-range interactions, instead of the naively expected $N^2$ scaling; details are described in Ref.~\cite{Sandvik03}. This efficient method for the diagonal updates can also be used for the Heisenberg model with long-range interactions, and for many other cases as well. Even with short-range interactions, the heat-bath approach may be slightly more efficient than the Metropolis update, though the difference in efficiency is likely minimal in most cases. \vskip2mm The probability of finding a $0$-element (fill-in operator) and attempting an operator insertion in the string clearly depends on how the cutoff $M$ of the series expansion is chosen. The cutoff naturally should be high enough for the contributions from terms with $n>M$ to be completely negligible, so that the truncation of the series expansion is no approximation in practice. In an SSE simulation this can be ensured by always requiring $M$ to be significantly larger than the largest $n$ that has been reached so far during the equilibration part of the simulation (with any adjustments done after each completed sweep of diagonal update during equilibration). In practice, $M$ exceeding the maximum $n$ by 30-50\% is a suitable chose; clearly sufficient for causing no systematical error and also enough to allow a large number of operator insertion attempts. Normally $M$ (and $\langle n\rangle$) converges very quickly at the initial stages of a simulation. \subsection{Loop and cluster updates} \vskip2mm In classical MC simulations of spin models, cluster updates \cite{Swendsen87,Wolff89} have played a major role in reaching system sizes sufficiently large for reliable finite-size scaling studies. These methods also have generalizations for some quantum spin models \cite{Evertz93,Ying93,Kawashima94,Beard96,Sandvik99,Evertz03,Sandvik03}, including the Heisenberg and Ising systems discussed here. Within the SSE approach, the loop and cluster updates are carried out in the operator string, which at this stage is regarded as a network of connected {\it vertices} comprising the operators and their associated ``incoming'' and ``outgoing'' states (i.e., the information needed to compute the weight of the operator string). The general strategy is to update a set of vertices (which are connected to each other to form a loop or a cluster) but maintain their lattice locations (which dictate their connectivity). The connectivity is changed only as a consequence of the diagonal updates. The off-diagonal updates also can change the stored state $|\alpha_0\rangle$, since the loops or clusters can span across the periodic time boundary represented by the stored state. \subsubsection{Linked vertex list} The loop or cluster updates are carried out in the linked vertex list, which after a full sweep of updates is mapped back into the simple operator-index string and state $|\alpha\rangle$ (or, in some cases, it is better to do this mapping-back continually during each loop or cluster flipping procedure). A vertex comprises the spin states before and after an operator has acted, and these states are associated with the {\it legs} of the vertex, e.g., for a two-body interactions there are four legs for each vertex; two before and two after the operator has acted on the two spins. Thus, the vertex is associated with a matrix element of the form $\langle \sigma_i(p),\sigma_j(p)|H_{b_p}|\sigma_i(p-1),\sigma_j(p-1)\rangle$, where $i$ and $j$ are the sites involved in the interaction term $H_{b_p}$. The way the legs of different vertices are linked to each other corresponds directly to the segments of unchanged spins between operators in the ``time'' direction in Fig.~\ref{fig:config}. These lines of spins are redundant when representing the changes that can be made in a configuration by changing the type of some of the operators (e.g., diagonal to off-diagonal or vice versa) and making associated changes in the spin state (represented by the changes at the vertex legs). In a computer program, these lines of constant spins are represented by bidirectional links connecting the relevant vertices, enabling direct jumps between any of the connected vertex legs without regard for the intermediate irrelevant spins. The linked list can be constructed according to a simple and efficient scheme discussed in detail in Ref.~\cite{Sandvik10b}. \subsubsection{Loop and cluster construction} \index{cluster update}\index{loop update} Some relevant vertices are illustrated in Fig.~\ref{fig:process}, along with lines indicating how the legs of vertices can be affected by a loop or cluster flip. The general idea is to change the spin state at one vertex leg and then move either to another leg of the same vertex or follow a link to another vertex, until the process closes. The allowed processes depend on the Hamiltonian. In the simplest cases, the {\it deterministic loops} for Heisenberg models and Ising cluster updates, there is a unique way to move at each step. The entire system can then be divided into a unique set of loops or clusters, each of which can be flipped (i.e., changing the spin states at the affected vertex legs) without affecting the configuration weight. Each loop or cluster can then be flipped independently with probability $1/2$, as in the classical Swendsen-Wang algorithm. \vskip2mm The condition that the loop or cluster flip must not change the configuration weight is the main restriction of this type of update, and is very similar to the limitation of classical cluster updates, e.g., the Swendsen-Wang cluster update for the Ising model \cite{Swendsen87} does not work in the presence of an external magnetic field. In the next section we will discuss more complicated {\it directed loop updates}, which partially overcome this limitation. \begin{figure}[t!] \centering \includegraphics[width=0.72\textwidth]{fig2.pdf} \caption{Examples of the elementary vertex processes by which loop and cluster updates are carried out for Heisenberg and Ising models. The green line segments represent parts of a loop or cluster. The spins and operators on a given vertex correspond to the state before the loop [in (a)] or cluster [in (c) and (d)] has been flipped, and the adjacent vertex shows the state after the loop or cluster has been flipped.} \label{fig:process} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=0.95\textwidth]{fig3.pdf} \caption{Examples of entire loop (a) and cluster (b) updates based on the elementary processes shown in Fig.~\ref{fig:process}. The pairs of configurations correspond to the states before and after the loop or cluster (indicated by green lines) has been flipped. Note that in (b) the cluster spans across the periodic time boundary. In cases where the loop and cluster algorithms are efficient, the vertex weight (matrix element) is the same before and after the flip.} \label{fig:updates} \end{figure} \vskip2mm We will not discuss the details of the SSE loop \cite{Sandvik99,Sandvik10b} and cluster updates \cite{Sandvik03} here, but refer to the literature. We just note that the loop update, also called {\it operator-loop} update within the SSE framework to emphasize that everything is formulated with a network of connected vertices (operators), corresponds to moving along a one-dimensional, non-branching path in the network of vertices. At some point, this process necessarily will lead back to the vertex leg at which the process started, at which point the loop is completed and a new one can be started. An example of a loop is shown in Fig.~\ref{fig:updates}(a). Normally these loops are constructed one-by-one, with the random decision of whether or not to flip the loop made before each new loop is started, and in each case the traversed vertex legs are flagged as visited, so that each new loop can be started from a not previously visited leg until all legs have been visited. \vskip2mm The cluster update for the Ising model differs from the Heisenberg loop update in the important sense of being branching. Since each two-body vertex must have all four legs in the same spin state, because of the choice of the added constant in the Ising operators $H_{ij}$ in Eq.~(\ref{isingops}), once one of those spins has been flipped the other three must be flipped as well to ``heal'' the vertex. The cluster therefore can branch out each time a two-body vertex is encountered. However, no branches extend out from vertex legs that have been previously visited, and eventually the cluster therefore does not grow further, and all defective vertices generated in the process have been healed. Branches that point to a single-site operator also terminate, because by flipping the type of single-site vertex from $H_{i,0}$ to $H_{i,i}$, or vice versa, the propagating defect is healed and not further changes need to be made at that branch. Fig.~\ref{fig:updates}(b) shows one example, which in this small configuration involves a single two-body operator and four one-body operators. In general, the branching-out can propagate to a very large number of vertices. \vskip2mm In a program implementation, the successive branching-out is handled by adding new branches to a stack, from which branches to follow are picked one-by-one until the stack is empty (the cluster is completed). By starting each new cluster from a vertex leg not previously visited, the entire system will eventually be subdivided into clusters (each of which was flipped by probability $1/2$), as in the Swendsen-Wang algorithm. \subsubsection{Directed-loop updates} \index{directed loop update} The loop update described above can be generalized to Heisenberg systems with anisotropic interactions and uniform magnetic fields, i.e., pair interactions of the form \begin{equation} H_{ij} = J_{ij} [\Delta_{ij} S^z_iS^z_j + \hbox{$\frac{1}{2}$}(S^+_iS^-_j + S^-_iS^+_j) + h_iS^z_i + h_jS^z_j], \end{equation} to which a suitable negative constant may have to be added in order to avoid a sign problem originating from the diagonal terms. In the directed-loop algorithm \cite{Syljuasen02}, the one-dimensional path through the vertex list is no longer unique, in contrast to the deterministic loop update, but a choice on how to continue the path has to be made at each vertex. A set of equations, called the {\it directed-loop equations} relate the possible vertex weights to the probabilities of the different paths through a vertex, and by solving these equations a process maintaining detailed balance is ensured. \vskip2mm The paths through the system taken in the directed-loop algorithm are similar to those in the continuous-time worm algorithm \cite{Prokofev98}, but the probabilities are different. The directed loops often lead to a much more efficient evolution of the configuration. The directed loops can also be directly formulated within the continuous-time framework \cite{Syljuasen02}, and implementations of continuous- and discrete-time WL methods now often rely on the directed loop ideas \cite{Gubernatis16}. \subsubsection{Sweeping cluster update} \index{sweeping cluster update} A very interesting recent development of efficient updates within the SSE approach is the {\it sweeping cluster update} developed for highly constrained models such as the quantum dimer model \cite{Yan19}. It is somewhat similar to an earlier {\it multibranch cluster update} developed in order to enhance the performance of a loop algorithm for a bosonic model with a constrained ring-exchange interaction \cite{Melko05}, but is more directly tailored to strict geometric restrictions. Simulation results for the square-lattice quantum dimer model indicate that this is a promising approach, overcoming at least some of the rather severe limitations of previous methods for this important class of models. \subsubsection{Extended-cell approach} \index{extended-cell expansion} In the original SSE formulation discussed in Sec.~\ref{sec:sse1}, the terms $H_b$ are defined as they appear in the Hamiltonian, e.g., they are the single-site operators such as $S^+_i+S^-_i$ or two-body terms such as $S^+_iS^-_j+S^-_iS^+_j$. A greater degree of freedom can be given to loop and cluster updates by enlarging the cell on which the operators and vertices are defined \cite{Louis04}. For instance, one can define an off-diagonal operator on three sites as $(S^+_iS^-_j+S^-_iS^+_j)I_k$, where $I_k$ is a unit operator with a site index. This allows the off-diagonal part to move during an update, e.g., a vertex with the mentioned operator can be updated (within some scheme involving more than one operator) to $(S^+_iS^-_k+S^-_iS^+_k)I_j$, This trick has proved to be very helpful for speeding up SSE simulations of systems where the diagonal interactions are highly frustrated \cite{Heidarian05,Isakov06,Melko07,Biswas16}. \subsubsection{Loop and cluster updates at $T=0$} As we saw in Sec.~\ref{sec:projector}, the $T>0$ SSE algorithm can be very easily modified for ground-state projection, with the only essential difference being the change from periodic time boundary conditions to boundary conditions dictated by the trial state. How this change affects the loop and cluster algorithms depends on the type of trial state used. \vskip2mm In the case of spin-isotropic Heisenberg models, a particularly good choice of trial state is one written in the valence-bond basis, i.e., the overcomplete basis of singlet pairs, with the two members of each singlet occupying different sublattices on a bipartite lattice \cite{Sandvik10a}. The valence bonds then serve as segments of loops touching the trial state, and there is no weight change, as before, when flipping a loop. The valence-bond trial state can also in many cases be variationally optimized, for improved convergence \cite{Lou07,Lin12}. Typically the valence-bond trial state is a superposition of valence-bond coverings, and the simulation involves a simple update for reconfiguring the bonds. \vskip2mm A convenient type of trial state to use in combination with the Ising cluster update is the ferromagnetic product state in the $x$ spin direction, i.e., $|\Psi(0)\rangle =\prod (\uparrow_i +\downarrow_i)$, where $\uparrow$ and $\downarrow$ correspond to $\sigma^z_i=\pm 1$. This state corresponds to a completely open time boundary condition, where cluster branches simply terminate at the trial state, and boundary clusters can be flipped as any other cluster without any change to the configuration weight. At the opposite extreme, it may some times be useful to use a fully polarized ferromagnetic state as the trial state \cite{Liu13}, in which case any cluster touching the boundary cannot be flipped at all. \section{Estimators for expectation values} \label{sec:estimators} Expectation values suitable for estimation with MC simulation are normally written in the form \begin{equation} \langle A \rangle = \frac{\sum_C A_CP_C}{\sum P_C}, \label{aexpmc} \end{equation} where $\{ C\}$ is some configuration space, $P_C$ is the probability (or relative probability) of configuration $C$, and $A_C$ is the estimator of the quantity $A$. In the QMC algorithms discussed in the preceding sections the sum of weights or probabilities in the denominator is the partition function at $T>0$ and the wave-function norm in $T=0$ projector methods. When importance-sampling the configurations, so that their probability of being generated equals $P_C$, the simulation result for $\langle A\rangle$ is the mean value $\langle A_C\rangle$, with a statistical error computed using some data binning technique. Here we discuss the form of the estimator $A_C$ for some important classes of physical observables. \vskip2mm We should first note that, in classical MC simulations, $A_C$ is normally just a trivial function of the sampled degrees of freedom, and that is also the case with SSE and WL methods when the operator $A$ is diagonal in the basis used. However, for off-diagonal operators the situation is more complicated, as then the configurations $C$ contributing to $\langle A\rangle$ are not necessarily the same as those that contribute to the sampled normalization in Eq.~(\ref{aexpmc}). We will here first discuss diagonal operators and then briefly touch on the topic of off-diagonal correlation functions. \subsection{Diagonal correlations and susceptibilities} \index{susceptibility} Equal-time expectation values, e.g., two-point or multi-point correlation functions, of diagonal operator in the basis used are normally trivial, and for improved statistics they can be averaged over the SSE propagation index $p$; \begin{equation} \langle A\rangle = \left \langle \frac{1}{n} \sum_{p=0}^{n-1} A(p) \right \rangle, \label{averageoverp} \end{equation} where $A(p)=\langle \alpha(p)|A|\alpha(p)\rangle$ is the value of $A$ computed in propagated state $p$ in a given SSE configuration. Here when defining the propagated state $|\alpha(p)\rangle$ as in Eq.(\ref{pstate}) we have implicitly disregarded the fill-in unit operators $H_0$ in the formulation of the method with a fixed string length $M$. It is also correct to include the unit operators and average over $M$ propagated states. In many cases it is too time consuming to average over all states, and since the propagated states are highly correlated there is also no loss of statistics in practice to average over a small fraction of the states, e.g., only including every $N$th or so state in Eq.~(\ref{averageoverp}). Similarly, spatial averaging may be carried out fully or partially to improve the statistics. \vskip2mm We are often interested in correlation functions in Fourier space of a periodic system, e.g., with the transformed diagonal spin operator \begin{equation} S^z_q = \frac{1}{\sqrt{N}} \sum_{\bf r} {\rm e}^{-{\bf q}\cdot {\bf r}} S^z_{\bf r}. \label{szq} \end{equation} The real part of the correlation function (often called the structure factor) is $S({\bf q}) = \langle S^z_{-q}S^z_q\rangle$ and the imaginary part vanishes by symmetry. If all or many values of the wave-vector ${\bf q}$ are needed, the most efficient way is often to evaluate (\ref{szq}) using the {\it Fast Fourier Transformation} method (see, for example, Ref.~\cite{Numrec}). However, if only a small number of values are needed it can be better to use the basic summation formula just for those cases. \vskip2mm Time dependent (in imaginary time) correlations can also be calculated, and by numerical analytic continuation they can provide real-frequency dynamic spectral functions of experimental interest, e.g., the dynamic spin structure factor measured in inelastic neutron scattering (see Ref.~\cite{Shao17} for a recent discussion of of analytic continuation and spectral functions). The way imaginary time is treated within the SSE method was already considered in Eq.~(\ref{atau}); a fixed value $\tau$ of imaginary time corresponds to a summation over separations $p$ between propagated states. Because the weighs of the different separations follow a very narrow distribution, only a small fraction of them has to be summed over in practice, and one can use a precomputed table of safe lower and upper bounds on the separations for the different $\tau$ values considered. \vskip2mm Alternatively, time dependent quantities can be more easily calculated if the SSE is formulated in combination with time slicing, where first the exponential operator is written as $({\rm e}^{-\Delta H})^m$, with $\Delta=\beta/m$, and the factors are series expanded individually with equal cutoffs $M_\Delta$. This is no approximation, since the slicing does not involve any separation of non-commuting operators. The operator string consists of $m$ segments, $i=1,\ldots,m$, containing $n_i$ Hamiltonian terms. Therefore, in the diagonal updates, $\beta$ and $n$ in Eqs.~(\ref{pinsert}) and (\ref{premove}) are replaced by $\Delta$ and $n_i$, with $i$ corresponding to the segment in which an update is carried out. The off-diagonal updates are not affected at all by the slicing, since they do not change the numbers $n_i$. Time-dependent correlations of diagonal operators can now be evaluated easily by just considering the propagated states at the boundaries between slices, which correspond to sharp time displacements in multiples of $\Delta$. \vskip2mm An interesting aspect of the SSE method is that rather simple estimators for static susceptibilities can be constructed. Such susceptibilities are in general given by Kubo integrals of the form \begin{equation} \chi_{AB} = \int_0^\beta d\tau \langle A(\tau) B(0) \rangle , \label{chikubo} \end{equation} where $h_A A$ can be regarded as a perturbation added to the Hamiltonian (the number $h_A$ being a corresponding field strength) and $\langle B\rangle$ is the linear response of the operator $B$ to this perturbation; $\langle B\rangle = h_A \chi_{AB}$. If $A$ and $B$ commute with $H$, then $\chi_{AB} = \beta \langle AB\rangle$, an important example of which is the uniform magnetic susceptibility of a system in which the magnetization $M$ is conserved; then $A=B=M$ and $\chi_u=\beta\langle M^2\rangle$ as in a classical system. In the more common case where $A$ and $B$ do not commute, e.g., if they are individual spins at different sites; $A=S^z_i$, $B=S^z_j$, the integral over the time dependent correlation function has to be evaluated. Within SSE, the integral can be computed for each individual SSE configuration, with the result \cite{Sandvik91,Sandvik92} \begin{equation} \chi_{AB} = \left \langle \frac{\beta}{n(n+1)} \left [ \left (\sum_{p=0}^{n-1} A(p) \right )\left (\sum_{p=0}^{n-1} B(p) \right )+ \sum_{p=0}^{n-1} A(p)B(p) \right ] \right \rangle, \end{equation} where $A(p)$ and $B(p)$ are the eigenvalues of the respective diagonal operators computed in propagated state $p$. Often these susceptibilities are also needed in Fourier space, but it can still be better to do the computations in real space (depending again on how many points in momentum space are needed, etc.) and only take the Fourier transform as the last step on the final averaged real-space susceptibilities. \subsection{Off-diagonal observables} We have already encountered two estimators for off-diagonal observables in the SSE method; the total energy and heat capacity \begin{equation} E=\langle H\rangle = -\frac{\langle n\rangle}{\beta},~~~~~~~ C=\frac{dE(T)}{dT} = \langle n^2\rangle - \langle n\rangle^2 - \langle n\rangle, \label{eexpval} \end{equation} which depend only on the number $n$ of Hamiltonian terms in the sampled operator sequences. These expressions are exactly the same as those in Handscomb's method. Note that the internal energy $E$ contains any constants that have been added to $H$ for the sampling scheme. \vskip2mm For any operator $H_b$ in the Hamiltonian, diagonal or off-diagonal, its expectation value is simply given by \begin{equation} \langle H_b\rangle = -\frac{\langle n_b\rangle}{\beta}, \end{equation} where $n_b$ is the number of instances of the index $b$ in the sampled sequences $S_M$. Thus, the energy estimator in Eq.~(\ref{eexpval}) corresponds to summing over all $b$. The simplicity of off-diagonal observables that can be related to the terms in the Hamiltonian also carries over to correlation functions \cite{Sandvik97}; \begin{equation} \langle H_aH_b\rangle = \frac{(n-1) \langle n_{ab} \rangle}{\beta^2}, \end{equation} where $n_{ab}$ is the number of times the indices $a$ and $b$ appear next to each other in $S_n$, where $S_n$ is the sequence obtained from $S_M$ when all zero indices are disregarded. This result can also be generalized to time dependent correlations. \vskip2mm Kubo integrals of the form (\ref{chikubo}) also have their direct SSE estimators. For $A=H_A$ and $B=H_B$ (terms in the Hamiltonian corresponding to the operators $H_b$ in the formalism above), after integrating over time for each SSE configuration we have \cite{Sandvik92} \begin{equation} \chi_{AB} =\beta^{-1}(\langle n_An_B \rangle - \delta_{AB} \langle n_A\rangle ), \label{chiaboff} \end{equation} which is very easy to evaluate. Two important off-diagonal quantities of this type can be mentioned (see the cited references for details): \vskip2mm \index{spin stiffness} The spin stiffness is the second-order energy (or free energy at $T>0$) response to a boundary twist imposed on the spins, or, alternatively, to a continuous twist field analogous to a vector potential. The spin stiffness is also analogous to the superfluid stiffness of a boson system. The stiffness (spin or superfluid) has an interesting estimator related to fluctuations of winding numbers \cite{Pollock87}, essentially the currents circulating around a periodic system. The SSE estimator for the stiffness is similar to Eq.~(\ref{chiaboff}), involving the counting of off-diagonal operators transporting spin (or charge) to ``left'' or ``right'' \cite{Sandvik97b}. \vskip2mm \index{fidelity susceptibility} Recently, a simple algorithm for computing the fidelity susceptibility was proposed \cite{Wang15} (likely more efficient than a different method proposed earlier \cite{Schwandt09}). This observable, which quantifies at what rate a state changes when some parameter is varied, plays an important role in quantum information theory and is also useful in studies of quantum phase transitions. The estimator for the fidelity susceptibility is similar to a correlator of the form (\ref{chiaboff}), with $n_A$ and $n_B$ corresponding to operators related to the infinitesimally varied coupling constant. These operators are counted in different halves of the time-periodic SSE configurations. \vskip2mm \index{entanglement entropy} Two other SSE-accessible information-theory inspired quantities can also be mentioned; the {\it entanglement entropy} \cite{Hastings10} and the {\it mutual information} \cite{Melko10}, \index{mutual information} both in their Rennyi versions. They are evaluated using a so-called swap operator, or a modified space-time lattice corresponding to a ratio of two different partition functions. \vskip2mm To evaluate general off-diagonal correlation functions, which cannot be expressed simply with the terms of the Hamiltonian, one has to go outside the space of the terms contributing to the partition function (or wave function norm in $T=0$ approach). An efficient scheme was first devised within the worm algorithm \cite{Prokofev98}, and a simple generalization to the SSE framework is also known \cite{Dorneich01}. We will not discuss details here, but just note that in the context of loop, directed-loop, or worm algorithms, the loop or worm building process involves two point defects that can be associated with the raising or lowering operators, $S^+_i$ and $S^-_j$ (or creation and destruction operators in particle models). Space-time correlation functions involving these operators, e.g., $\langle S^+_i(\tau)S^-_j(0)\rangle$ are therefore directly related to the probability distribution of the separation between the defects. \section{Recent applications} \label{sec:examples} MC simulations have played, and continue to play, an important role in studies of phase transitions in classical statistical physics. In a similar way, QMC simulations of quantum lattice models are now helping to push the boundaries of knowledge in the field of quantum many-body physics, uncovering various quantum states and elucidating the nature of various quantum phase transitions (i.e., transitions between different types of ground states and associated scaling behaviors at $T>0$) using sign free ``designer Hamiltonians'' \cite{Kaul13}. \index{designer Hamiltonian} Some selected applications of SSE methods to different classes of quantum-critical models will be very briefly reviewed in Sec.~\ref{sec:critical}, as a guide to recent works and mainly reflecting the author's own interests. Works aimed at extracting dynamic spectral functions from imaginary-time correlations, using numerical analytic continuation methods, will be discussed in Sec.~\ref{sec:dynamics}. Finally, SSE works on disorder (randomness) effects are reviewed in Sec.~\ref{sec:disorder}. The emphasis is on SSE applications, and references to works using other methods are therefore very incomplete. \subsection{Quantum phases and criticality in spin systems} \label{sec:critical} \index{dimerized Heisenberg model}\index{quantum criticality}\index{Heisenberg antiferromagnet} One of the first successes of WL-type QMC simulations in quantum magnetism was the convincing demonstration of long-range order at $T=0$ in the 2D $S=1/2$ Heisenberg antiferromagnet \cite{Reger88} (the currently most precise results were obtained with the SSE \cite{Sandvik97b} and valence-bond projector \cite{Sandvik10a} methods). Following this important result (of which there is still no rigorous analytical proof), the focus shifted to ways in which the long-range order can be destroyed by perturbing the Heisenberg model in various ways. Many studies were devoted to statically dimerized 2D Heisenberg models, e.g., the SSE studies in Refs.~\cite{Sandvik94,Wang06,Wenzel08,Ma18}, where there is a pattern of nearest-neighbor couplings of two strengths, $J_1$ (inter-dimer) and $J_2$ (intra-dimer), such that each spin belongs uniquely to a dimer. As a function of the ratio $g=J_2/J_1$, there is then a loss of antiferromagnetic order at $T=0$ when $g$ reaches a critical value $g_c$. The physical mechanism of this transition is that the density of singlets on the dimer increases with $g$, and eventually the ground state becomes close to a product state of dimer singlets. The transition is continuous and belongs to the 3D O(3) universality class, with the third dimension corresponding to imaginary time. In some cases, confirming this universality was challenging \cite{Wenzel08}, because of, as it turns out \cite{Ma18}, effects of competing scaling corrections. The $T=0$ quantum-critical point is associated with a so-called {\it quantum-critical fan} extending out in the $(T,g)$ plane from $g_c$ and which is associated with various scaling laws of physical quantities \cite{Chubukov94}. SSE and other QMC studies have, among other things, established the rangle of validity of these asymptotic scaling behaviors, and also tested the applicability of various approximate analytical calculations \cite{Sen15}, e.g., the $1/N$ expansion, where $N$ is the number of spin components. \vskip2mm \index{O(3) transition} The O(3) transition driven by dimerization can be realized experimentally in the 3D spin-dimer system TlCuCl$_3$ under pressure \cite{Merchant14} and this has motivated SSE simulations of this phase transition also in 3D generalizations of the 2D Heisenberg systems discussed above. In a 3D Heisenberg system antiferromagnetic long-range order can survive also at $T>0$ (which is excluded by the Mermin-Wagner theorem in 2D). An empirical universal scaling form of the critical temperature was found in Ref.~\cite{Jin12} and further studied in Ref.~\cite{Tan18}. Multiplicative logarithmic corrections at the $T=0$ and $T>0$ phase transitions have also been studied in detail \cite{Qin15} \vskip2mm In the statically dimerized 2D and 3D systems, the paramagnetic phase is a unique quantum state with no spontaneous symmetry breaking---the singlets simply form, with some fluctuations, at the dimers imposed by the Hamiltonian itself. A more interesting case is where also the paramagnetic state breaks additional symmetries spontaneously. It was discovered by SSE simulations that a certain planar [XY, or U(1) symmetric] $S=1/2$ spin model could go through a transition from XY magnetized to spontaneously dimerized in what appeared to be a continuous quantum phase transition \cite{Sandvik02a}. Shortly thereafter, a theory was proposed for a new type of quantum phase transition, beyond the Landau-Ginzburg-Wilson (LGW) paradigm, between 2D quantum antiferromagnetic and spontaneously dimerized states (also called valence-bond-solids, VBSs). \index{valence-bond solid} In this theory of {\it deconfined quantum critical points} \cite{Senthil04}, \index{deconfined quantum-critical point} the two different order parameters arise out of the same objects---spinons and gauge fields---instead of being described by separate fields corresponding to the two order parameters. This theory stimulated many further works on various 2D quantum antiferromagnets with VBS transitions, and these studies have uncovered a rich variety of phenomena beyond the original DQCP proposal. \vskip2mm Traditionally, VBS states were discussed in the context of frustrated Heisenberg models, such as the model with first $J_1$ and second $J_2$ neighbor interactions on the square lattice. These models have sign problems and are not accessible to QMC simulations. Another class of models, was proposed to study the DQCP phenomenon with QMC without sign problems---the $J$-$Q$ model, \index{J-Q model} in which the Heisenberg exchange is supplemented by a multi-spin interactions built out of $S=1/2$ singlet operators $P_{ij} = 1/4 - {\bf S}_i\cdot {\bf S}_j$ \cite{Sandvik07}. This interaction by itself, $-JP_{ij}$, is equivalent to the antiferromagnetic Heisenberg echange. Products of two or more of the singlet projectors make up the competing $Q$ interaction, e.g., terms of the form $-QP_{ij}P_{kl}$ with the involved sites $i,j,k,l$ suitably arranged on plaquettes (without breaking the symmetry of the square lattice). \vskip2mm When the ratio $Q/J$ is large, the correlated singlets favored by the multi-spin interactions cause many of these models undergo quantum phase transitions into four-fold degenerate columnar VBS states. This phase transition can be investigated in detail only with QMC simulations. SSE studies have established what seems like a continuous transition \cite{Sandvik07,Melko08,Sandvik10c,Kaul11,Block13,Pujari15}, similar to the proposed DQCP but with anomalous scaling corrections that so far only have a phenomenological explanation \cite{Shao16} . It has also been proposed that the transition is actually weakly first-order, with the true DQCP only existing outside the space that can be reached with lattice models (e.g., in a fractal dimension or on the complex plane) \cite{Wang17}. Though the ultimate nature of the phase transition is still unsettled, it is already clear that the length scale associated with the transition is very large, and the DQCP phenomenology applies. \vskip2mm By perturbing the $J$-$Q$ model sufficiently so that the $Q$ terms form a checker-board pattern, the VBS state can be modified from a four-fold columnar to a two-fold degenerate plaquette-singlet state. \index{plaquette-singlet state} The transition from the antiferromagnet into the plaquette-singlet state is clearly first-order according to $T>0$ SSE and $T=0$ projector QMC studies \cite{Zhao19}. However, the transition point is associated with an unexpected higher symmetry, combining the O(3) magnetic order parameter and the scalar $Z_2$ plaquette order parameter into an O(4) vector. A similar phenomenon with emergent SO(5) symmetry has been studied with SSE simulations in a spin-$1$ $J$-$Q$ model \cite{Wildeboer18}. The plaquette-singlet state is of relevance in the frustrated 2D magnet SrCu$_2$(BO$_3$)$_2$ \cite{Zayed17}, and SSE simulations aimed at explaining the phase transitions driven by high pressure in this system have been reported very recently \cite{Guo19}. \vskip2mm Building on the idea of the $J$-$Q$ model, Kaul and collaborators have constructed several other classes of sign-free ``designer Hamiltonians'' \cite{Kaul15a,Kaul15b,Demidio17,Desai19,Block19}. The original $J$-$Q$ models and these extended variants provide unique opportunities to further explore many interesting quantum phases and quantum phase transitions. \vskip2mm Highly frustrated Ising interactions, supplemented with various off-diagonal terms, can also be studied with SSE simulations (though the sampling is more challenging \cite{Melko07} and system sizes as large as those for Heisenberg and $J$-$Q$ interactions can not be reached). The focus of these studies is typically to explore different incarnations of $Z_2$ quantum spin liquids and their quantum phase transitions \cite{Dang11,Isakov12,Becker18}. \subsection{Dynamic response of quantum magnets} \label{sec:dynamics} To connect numerical simulations of lattice models to experiments, dynamic response functions are the most useful, e.g., in quantum magnets the dynamic spin structure factor $S(q,\omega)$ can be measured directly in inelastic neutron scattering experiments, \index{dynamic structure factor} and the low-energy structure factor is accessed, e.g., in NMR experiments. In QMC calculations, dynamic spectral functions can only be accessed in the form of imaginary-time dependent correlation functions, and these have to be analytically continued to the real time (or frequency) domain using some numerical scheme \cite{Jarrell96}. Analytic continuation in its own right is an interesting and challenging technical problem subject to ongoing research activities; see Ref.~\cite{Sandvik16,Shao17} for a recent example of methods developed by the author and collaborators. While all numerical analytical continuation method have natural limitations in the frequency resolution that can be achieved, due to the statistical noise in the QMC data (even when the noise level is exceedingly small), important spectral features can be resolved, and some times it is possible to compare with experiments in a very detailed manner \cite{Shao17,Ying19}. \vskip2mm While the static properties of the 2D Heisenberg model have been well understood for some time, there has been a long-standing unresolved mystery in the dynamic response: At and close to the equivalent wave-vectors $q=(\pi,0)$ and $(0,\pi)$, the excitation energy is reduced and the spectral line shape of $S(q,\omega)$ is anomalously broadened. The anomalies cannot be easily explained within spin-wave theory. In recent work based on SSE and analytic continuation, it was found that the phenomenon is a precursor to a DQCP that can be reached by adding other interactions \cite{Shao17}. Spectral functions at the DQCP of the $J$-$Q$ model have also been studied and are in excellent agreement with a field-theory treatment based on the so-called $\pi$-flux state \cite{Ma18b}. \vskip2mm The simpler dimerized Heisenberg models with O(3) transitions also have interesting dynamical response functions. In particular, the amplitude model (also often called the Higgs mode) of near-critical systems (on the ordered side of the phase transition) have been studied in 2D \cite{Lohofer15} and 3D \cite{Lohofer17,Qin17} and compared with experimental results for TlCuCl$_3$ \cite{Merchant14}. \vskip2mm In highly frustrated quantum Ising systems, spectral functions can give important insights into the nature of exotic excitations. Recent SSE-studied expamples include the identification of separate photon and spinon modes in a quantum spin-ice system \cite{Huang18} and a two-spinon continuum in a kagome-lattice model \cite{Becker18}. \subsection{Disordered systems} \label{sec:disorder} \index{quenched disorder} Randomness (quenched disorder) can fundamentally affect quantum states and quantum phase transitions. Many SSE studies have been devoted to the effects of random couplings in the ordered Heisenberg antiferromagnet \cite{Laflorencie06} and at the $O(3)$ transition in the dimerized Heisenberg systems mentioned above in Sec.~\ref{sec:critical} \cite{Yu05,Sandvik06,Tan17}. A still open issue is why the Harris criterion for the relevance or irrelevance of disorder appears to be violated in some cases \cite{Ma14}. Systems with dilution have also been frequently studied \cite{Sandvik02b,Sandvik02c}, and interesting excitations with a very low energy scale, that was not anticipated, have been found at the percolation point on the 2D square lattice \cite{Wang10}. \vskip2mm Very recently, effects of various types of disorder at the DQCP in the $J$-$Q$ model have been investigated \cite{Liu18}, and it was found that the VBS state is replaced by a critical phase similar to the {\it random singlet state} that is well known in random $S=1/2$ Heisenberg chain (and which have also been studied with SSE simulations \cite{Shu16,Shu18}). SSE simulations have also been applied to the Bose-Hubbard model with site randomness \cite{Wang15b}, where interesting differences were found between weak and strong disorder. \vskip2mm \index{quantum annealing} Disordered frustrated Ising models, which often have spin-glass phases, are of interest in the field of optimization with quantum annealing. Excitation gaps have been extracted from imaginary-time correlations computed with the SSE method \cite{Farhi12}, and the generalized SSE method for imaginary-time quantum annealing has also been used to study the dynamics of the quantum phase transition between a paramagnet and a quantum spin glass \cite{Liu15}. Recent further developments of the SSE algorithm for highly anisotropic (near-classical) frustrated Ising models were specifically aimed at quantum annealing applications \cite{Albash17}. \vskip5mm \subsection*{Acknowledgments} Some of the work reported here was supported by the NSF under Grant No.~DMR-1710170, by a Simons Investigator Award, and by computer time allocations on the Shared Computing Cluster administered by Boston University's Research Computing Services. \clearpage
\section{} State of the art algorithms for many pattern recognition problems rely on deep network models. Training these models requires a large labeled dataset and considerable computational resources. Also, it is difficult to understand the working of these learned models, limiting their use in some critical applications. Towards addressing these limitations, our architecture draws inspiration from research in cognitive systems, and integrates the principles of commonsense logical reasoning, inductive learning, and deep learning. In the context of answering explanatory questions about scenes and the underlying classification problems, the architecture uses deep networks for extracting features from images and for generating answers to queries. Between these deep networks, it embeds components for non-monotonic logical reasoning with incomplete commonsense domain knowledge, and for decision tree induction. It also incrementally learns and reasons with previously unknown constraints governing the domain's states. We evaluated the architecture in the context of datasets of simulated and real-world images, and a simulated robot computing, executing, and providing explanatory descriptions of plans. Experimental results indicate that in comparison with an ``end to end'' architecture of deep networks, our architecture provides better accuracy on classification problems when the training dataset is small, comparable accuracy with larger datasets, and more accurate answers to explanatory questions. Furthermore, incremental acquisition of previously unknown constraints improves the ability to answer explanatory questions, and extending non-monotonic logical reasoning to support planning and diagnostics improves the reliability and efficiency of computing and executing plans on a simulated robot. \end{abstract} \section{Introduction} \label{sec:introduction} Deep neural network architectures and the associated algorithms represent the state of the art for many perception and control problems in which their performance often rivals that of human experts. These architectures and algorithms are increasingly being used for a variety of tasks such as object recognition, gesture recognition, object manipulation, and obstacle avoidance, in domains such as healthcare, surveillance, and navigation. Common limitations of deep networks are that they are computationally expensive to train, and require a large number of labeled training samples to learn an accurate mapping between input(s) and output(s) in complex domains. It is not always possible to satisfy these requirements, especially in dynamic domains where previously unseen situations often change the mapping between inputs and outputs over time. Also, it is challenging to understand or provide an explanatory description of the observed behavior of a learned deep network model. Furthermore, it is difficult to use domain knowledge to improve the computational efficiency of learning these models or the reliability of the decisions made by these models. Consider a self-driving car on a busy road. Any error made by the car, e.g., in recognizing or responding to traffic signs, can result in serious accidents and make humans more reluctant to use such cars. In general, it is likely that humans interacting with a system designed for complex domains, with autonomy in some components, will want to know why and how the system arrived at particular conclusions; this ``explainability'' will help designers improve the underlying algorithms and their performance. Understanding the operation of these systems will also help human users build trust in the decisions made by these systems. Despite considerable research in recent years, providing explanatory descriptions of decision making and learning continues to be an open problem in AI. We consider Visual Question Answering (VQA) as a motivating example of a complex task that inherently requires explanatory descriptions of reasoning and learning. Given a scene and a natural language question about images of the scene, the objective of VQA is to provide an accurate answer to the question. These questions can be about the presence or absence of particular objects in the image, the relationships between objects, or the potential outcome of executing particular actions in the scene. For instance, a system recognizing and responding to traffic signs on a self-driving car may be posed questions such as ``what is the traffic sign in the image?'', or ``what is the meaning of this traffic sign?'', and a system controlling a robot arm constructing stable arrangements of objects on a tabletop may be asked ``why is this structure unstable?'' or ``what would make the structure stable?''. We assume that any such questions are provided as (or transcribed into) text, and that answers to questions are also generated as text (that may be converted to speech) using existing software. Deep networks represent the state of the art for VQA, but are characterized by the known limitations described above. We seek to address these limitations by drawing inspiration from research in cognitive systems, which indicates that reliable, efficient, and explainable reasoning and learning can be achieved in complex problems by jointly reasoning with commonsense domain knowledge and learning from experience. Specifically, the architecture described in this paper tightly couples knowledge representation, reasoning, and learning, and exploits the complementary strengths of deep learning, inductive learning, and non-monotonic logical reasoning with incomplete commonsense domain knowledge. We describe the following characteristics of the architecture: \begin{itemize} \item For any input image of a scene of interest, Convolutional Neural Networks (CNNs) extract concise visual features characterizing the image. \item Non-monotonic logical reasoning with the extracted features and incomplete commonsense domain knowledge is used to classify the input image, and to provide answers to explanatory questions about the classification and the scene. \item Feature vectors that the non-monotonic logical reasoning is unable to classify are used to train a decision tree classifier that is also used to answer questions about the classification during testing. \item Feature vectors not classified by non-monotonic logical reasoning, along with the output of the decision tree classifier, train a Recurrent Neural Network (RNN) that is used to answer explanatory questions about the scene during testing. \item Feature vectors not classified by non-monotonic logical reasoning are also used to inductively learn, and subsequently reason with, constraints governing domain states; and \item Reasoning with commonsense knowledge is expanded (when needed) to support planning, diagnostics, and the ability to answer related explanatory questions. \end{itemize} This architecture builds on our prior work on combining commonsense inference with deep learning~\cite{riley:hai18,mota:rss19} by introducing the ability to learn and reason with constraints governing domain states, and extending reasoning with commonsense knowledge to support planning and diagnostics to achieve any given goal. Although we use VQA as a motivating example, it is not the main focus of our work. State of the art algorithms for VQA focus on generalizing to images from different domains, and are evaluated on benchmark datasets of several thousand images drawn from different domains~\cite{shrestha:cvpr19}. Our focus, on the other hand, is on transparent reasoning and learning in any given domain in which a large, labeled dataset is not readily available. Towards this objective, our approach explores the interplay between non-monotonic logical reasoning, incremental inductive learning, and deep learning. We thus neither compare our architecture and algorithms with state of the art algorithms for VQA, nor use large benchmark VQA datasets for evaluation. Instead, we evaluate our architecture's capabilities in the context of: (i) estimating the stability of configurations of simulated blocks on a tabletop; (ii) recognizing different traffic signs in a benchmark dataset of images; and (iii) a simulated robot delivering messages to the intended recipients at different locations. The characteristics of these tasks and domains match our objective. In both domains, we focus on answering explanatory questions about images of scenes and the underlying classification problems (e.g., recognizing traffic signs). In addition, we demonstrate how our architecture can be adapted to enable a robot assisting humans to compute and execute plans, and to answer questions about these plans. Experimental results show that in comparison with an architecture based only on deep networks, our architecture provides: (i) better accuracy on classification problems when the training dataset is small, and comparable accuracy on larger datasets; and (ii) significantly more accurate answers to explanatory questions about the scene. We also show that the incremental acquisition of state constraints improves the ability to answer explanatory questions, and to compute minimal and correct plans. We begin with a discussion of related work in Section~\ref{sec:relwork}. The architecture and its components are described in Section~\ref{sec:arch}, with the experimental results discussed in Section~\ref{sec:expresults}. Section~\ref{sec:conclusions} then describes the conclusions and directions for further research. \section{Related work} \label{sec:relwork} State of the art approaches for VQA are based on deep learning algorithms~\cite{jiang:TR15,malinowski:IJCV17,masuda:cvpr16,pandhre:TR17,shrestha:cvpr19,zhang:TR17}. These algorithms use labeled data to train neural network architectures with different arrangements of layers and connections between them, capturing the mapping between the inputs (e.g., images, text descriptions) and the desired outputs (e.g., class labels, text descriptions). Although deep networks have demonstrated the ability to model complex non-linear mappings between inputs and outputs for different pattern recognition tasks, they are computationally expensive and require large, labeled training datasets. They also make it difficult to understand and explain the internal representations, identify changes that will improve performance, or to transfer knowledge acquired in one domain to other related domains. In addition, it is challenging to accurately measure performance or identify dataset bias, e.g., deep networks can answer questions about images using question-answer training samples without even reasoning about the images~\cite{jabri:eccv16,teney:TR16,zhang:TR17}. There is on-going research on each of these issues, e.g., to explain the operation of deep networks, reduce training data requirements and bias, reason with domain knowledge, and incrementally learn the domain knowledge. We review some of these approaches below, primarily in the context of VQA. Researchers have developed methods to understand the internal reasoning of deep networks and other machine learning algorithms. Selvaraju et al.~\cite{selvaraju:iccv17} use the gradient in the last convolutional layer of a CNN to compute the relative contribution (importance weight) of each neuron to the classification decision made. However, the weights of neurons do not provide an intuitive explanation of the CNN's operation or its internal representation. Researchers have also developed general approaches for understanding the predictions of any given machine learning algorithm. For instance, Koh and Liang~\cite{koh:icml17} use second-order approximations of influence diagrams to trace any model's prediction through a learning algorithm back to the training data in 4order to identify training samples most responsible for any given prediction. Ribeiro et al.~\cite{ribeiro:kdd16} developed a framework that analyzes any learned classifier model by constructing a interpretable simpler model that captures the essence of the learned model. This framework formulates the task of explaining the learned model, based on representative instances and explanations, as a submodular optimization problem. In the context of VQA, Norcliffe et al.~\cite{norcliffe:nips18} provide interpretability by introducing prior knowledge of scene structure as a graph that is learned from observations based on the question under consideration. Object bounding boxes are graph nodes while edges are learned using an attention model conditioned on the question. Mascharka et al.~\cite{mascharka:cvpr18} augment a deep network architecture with an image-space attention mechanism based on a set of composable visual reasoning primitives that help examine the intermediate outputs of each module. Li et al.~\cite{li:corr18} introduce a captioning model to generate an image's description, reason with the caption and the question to construct an answer, and use the caption to explain the answer. However, these algorithms do not support the use of commonsense reasoning to (i) provide meaningful explanatory descriptions of learning and reasoning; (ii) guide learning to be more efficient; or (iii) provide reliable decisions when large training datasets are not available. The training data requirements of a deep network can be reduced by directing attention to data relevant to the tasks at hand. In the context of VQA, Yang et al.~\cite{yang:cvpr16} use a Long Short-Term Memory (LSTM) network to map the question to an encoded vector, extract a feature map from the input image using a CNN, and use a neural network to compute weights for feature vectors based on their relevance to the question. A stacked attention network is trained to map the weighted feature vectors and question vector to the answer, prioritizing feature vectors with greater weights. Schwartz et al.~\cite{schwartz:nips17} use learned higher-order correlations between various data modalities to direct attention to elements in the data modalities that are relevant to the task at hand. Lu et al.~\cite{lu:nips16} use information from the question to identify relevant image regions and uses information from the image to identify relevant words in the question. A co-attentional model jointly and hierarchically reasons about the image and the question at three levels, embedding words in a vector space, using one-dimensional CNNs to model information at the phrase level, and using RNNs to encode the entire question. A generalization of this work, a Bilinear Attention Network, considers interactions between all region proposals in the image with all words in the (textual) question~\cite{kim:nips18}. A Deep Attention Neural Tensor Network for VQA, on the other hand, uses tensor-based representations to discover joint correlations between images, questions, and answers~\cite{bai:eccv18}. The attention module is based on a discriminative reasoning process, and regression with KL-divergence losses improves scalability of training and convergence. Recent work by combines top-down and bottom-up attention mechanisms, with the top-down mechanism providing an attention distribution over object proposals provided by the bottom-up mechanism~\cite{anderson:cvpr18}. In addition to reducing the training data requirements, researchers have focused on reducing the number of annotated samples needed for training, and on minimizing the bias in deep network models. In the context of VQA, Lin et al.~\cite{lin:eccv14} iteratively revise a model trained on an initial training set by expanding the training set with image-question pairs involving concepts it is uncertain about, with an ``oracle'' (human annotater) providing the answers. This approach reduces annotation time, but the database includes just as many images and questions as before. Goyal et al.~\cite{goyal:cvpr17} provide a balanced dataset with each question associated with a pair of images that require different answers, and provide a counterexample based explanation for each image-question pair. Agrawal et al.~\cite{agrawal:cvpr18}, on the other hand, separate the recognition of visual concepts in an image from the identification of an answer to any given question, and include inductive biases to prevent the learned model from relying predominantly on priors in the training data. In computer vision, robotics and other applications, learning from data can often be made more efficient by reasoning with prior knowledge about the domain. In the context of VQA, Wang et et.~\cite{wang:ijcai17} reason with knowledge about scene objects to answer common questions about these objects, significantly expanding the range of natural language questions that can be answered without making the training data requirements impractical. However, this approach does not reduce the amount of data required to train the deep network. Furbach et al.~\cite{furbach:KI10} directly use a knowledge base to answer questions and do not consider the corresponding images as inputs. Wagner et al.~\cite{wagner:eccvwrkshp18}, on the other hand, use physics engines and prior knowledge of domain objects to realistically simulate and explore different situations. These simulations guide the training of deep network models that anticipate action outcomes and answer questions about all situations. Based on the observation that VQA often requires reasoning over multiple steps, Wu et al.~\cite{wu:nips18} construct a chain of reasoning for multi-step and dynamic reasoning with relations and objects. This approach iteratively forms new relations between objects using relational reasoning operations, and forms new compound objects using object refining operations, to improve VQA performance. Given the different components of a VQA system, Teney and van den Hengel~\cite{teney:eccv18} present a meta learning approach to separate question answering from the information required for the task, reasoning at test time over example questions and answers to answer any given question. Two meta learning methods adapt a VQA model without the need for retraining, and demonstrate the ability to provide novel answers and support vision and language learning. Rajani and Mooney~\cite{rajani:naacl18} developed an ensemble learning approach, Stacking With Auxiliary Features, which combines the results of multiple models using features of the problem as context. The approach considers four categories of auxiliary features, three of which are inferred from image-question pairs while the fourth uses model-specific explanations. Research in cognitive systems indicates that reliable, efficient, and explainable reasoning and learning can be achieved by reasoning with domain knowledge and learning from experience. Early work by enabled an agent to reason with first-order logic representations and incrementally refined action operators~\cite{gil:icml94}. In such methods, it is difficult to perform non-monotonic reasoning, or to merge new, unreliable information with existing beliefs. Non-monotonic logic formalisms have been developed to address these limitations, e.g., Answer Set Prolog (ASP) has been used in cognitive robotics~\cite{erdem:bookchap12} and other applications~\cite{erdem:AIM16}. ASP has been combined with inductive learning to monotonically learn causal laws~\cite{otero:ilp03}, and methods have been developed to learn and revise domain knowledge represented as ASP programs~\cite{balduccini:aaaisymp07,law:AIJ18}. Cognitive architectures have also been developed to extract information from perceptual inputs to revise domain knowledge represented in first-order logic~\cite{laird:book12}, and to combine logic and probabilistic representations to support reasoning and learning in robotics~\cite{sarathy:TCDS16,zhang:TRO15}. However, approaches based on classical first-order logic are not expressive enough, e.g., modeling uncertainty by attaching probabilities to logic statements is not always meaningful. Logic programming methods, on the other hand, do not support one or more of the desired capabilities such as efficient and incremental learning of knowledge, reasoning efficiently with probabilistic components, or generalization as described in this paper. These challenges can be addressed using interactive task learning, a general knowledge acquisition framework that uses labeled examples or reinforcement signals obtained from observations, demonstrations, or human instructions~\cite{chai:ijcai18,laird:IS17}. Sridharan and Meadows~\cite{mohan:ACS18} developed such a framework to combine non-monotonic logical reasoning with relational reinforcement learning and inductive learning to learn action models to be used for reasoning or learning in dynamic domains. In the context of VQA, there has been interesting work on reasoning with learned symbolic structure. For instance, Yi et al.~\cite{yi:nips18} present a neural-symbolic VQA system that uses deep networks to infer structural object-based scene representation from images, and to generate a hierarchical (symbolic) program of functional modules from the question. An executor then runs the program on the representation to answer the question. Such approaches still do not (i) integrate reasoning and learning such that they inform and guide each other; or (ii) use the rich domain-specific commonsense knowledge that is available in any application domain. In summary, deep networks represent the state of the art for VQA and many other pattern recognition tasks. Recent surveys on VQA methods indicate that despite considerable research, it is still difficult to use these networks to support efficient learning, intuitive explanations, or generalization to simulated and real-world images~\cite{pandhre:TR17,shrestha:cvpr19}. Our architecture draws on principles of cognitive systems to address these limitations. It tightly couples deep networks with components for non-monotonic logical reasoning with commonsense domain knowledge, and for learning incrementally from samples over which the learned model makes errors. This work builds on our proof of concept architecture that integrated deep learning with commonsense inference for VQA~\cite{riley:hai18}. It also builds on work in our research group on using commonsense inference and learned state constraints to guide deep networks that estimate object stability and occlusion in images~\cite{mota:rss19}. In comparison with our prior work, we introduce a new component for incrementally learning constraints governing domain states, expand reasoning with commonsense knowledge to support planning and diagnostics, explore the interplay between the architecture's components, and discuss detailed experimental results. \section{Architecture} \label{sec:arch} Figure~\ref{fig:overall-arch} is an overview of our architecture that provides answers to explanatory questions about images of scenes and an underlying classification problem. The architecture seeks to improve accuracy and reduce training effort, i.e., reduce training time and the number of training samples, by embedding non-monotonic logical reasoning and inductive learning in a deep network architecture. We will later demonstrate how the architecture can be adapted to address planning problems on a simulated robot---see Section~\ref{sec:arch-plan}. The architecture may be viewed as having four key components that are tightly coupled with each other. \begin{enumerate} \item A component comprising CNN-based feature extractors, which are trained and used to map any given image of a scene under consideration to a vector of image features. \item A component that uses one of two methods to classify the feature vector. The first method uses non-monotonic reasoning with incomplete domain knowledge and the features to assign a class label and explain this decision. If the first method cannot classify the image, the second method trains and uses a decision tree to map the feature vector to a class label and explain the classification. \item A component that answers explanatory questions. If non-monotonic logical reasoning is used for classification, it is also used to provide answers to these questions. If a decision tree is instead used for classification, an RNN is trained to map the decision tree's output, the image features, and the question, to the corresponding answer. \item A component that uses the learned decision tree and the existing knowledge base to incrementally construct and validate constraints on the state of the domain. These constraints revise the existing knowledge that is used for subsequent reasoning. \end{enumerate} This architecture exploits the complementary strengths of deep learning, non-monotonic logical reasoning, and incremental inductive learning with decision trees. Reasoning with commonsense knowledge guides learning, e.g., the RNN is trained on (and processes) input data that cannot be processed using existing knowledge. The CNNs and RNN can be replaced by other methods for extracting image features and answering explanatory questions (respectively). Also, although the CNNs and RNN are trained in an initial phase in this paper, these models can be revised over time if needed. We hypothesize that embedding non-monotonic logical reasoning with commonsense knowledge and the incremental updates of the decision tree, between the CNNs and the RNN, makes the decisions more transparent, and makes learning more time and sample efficient. Furthermore, the overall architecture and methodology can be adapted to different domains. In this paper, we will use the following two domains to illustrate and evaluate the architecture's components and the methodology. \begin{figure*}[tb] \centering \includegraphics[width=0.9\textwidth]{./architecture_diagram} \vspace{-1em} \caption{Overview of the architecture that combines the principles of deep learning, non-monotonic logical reasoning, and decision-tree induction.} \label{fig:overall-arch} \end{figure*} \begin{figure}[tb] \begin{center} \includegraphics[width=0.85\linewidth]{./SS_example_combined}\hspace{0.05in} \vspace{-1em} \caption{Illustrative images of structures of blocks of different colors and sizes; these images were obtained from a physics-based simulator for the SS domain.} \label{fig:blocks-domain} \end{center} \vspace{-1em} \end{figure} \begin{figure}[tb] \begin{center} \includegraphics[height=0.17\columnwidth]{./TS_example_combined} \caption{Illustrative images of traffic signs from the BelgiumTS dataset~\cite{timofte:ijcnn13}.} \label{fig:signs-domain} \vspace{-1em} \end{center} \end{figure} \begin{enumerate} \item \textbf{Structure Stability (SS):} this domain has different structures, i.e., different arrangements of simulated blocks of different colors and sizes, on a tabletop---see Figure~\ref{fig:blocks-domain} for some examples. We generated $2500$ such images using a physics-based simulator. The relevant features of the domain include the number of blocks, whether the structure is on a lean, whether the structure has a narrow base, and whether any block is placed such that it is not well balanced on top of the block below. The objective in this domain is to classify structures as being stable or unstable, and to answer explanatory questions such as ``why is this structure unstable?'' and ``what should be done to make this structure stable?''. \item \textbf{Traffic Sign (TS):} this domain focuses on recognizing traffic signs from images---see Figure~\ref{fig:signs-domain} for some examples. We used the BelgiumTS benchmark dataset~\cite{timofte:ijcnn13} with $\approx 7000$ real-world images (total) of $62$ different traffic signs. This domain's features include the primary symbol of the traffic sign, the secondary symbol, the shape of the sign, the main color in the middle, the border color, the sign's background image, and the presence or absence of a cross (e.g., some signs have a red or black cross across them to indicate the end of a zone, with the absence of the cross indicating the zone's beginning). The objective is to classify the traffic signs and answer explanatory questions such as ``what is the sign's message?'' and ``how should the driver respond to this sign?''. \end{enumerate} In addition to these two domains, Section~\ref{sec:arch-plan} will introduce the \textbf{Robot Assistant (RA)} domain, a simulated domain to demonstrate the use of our architecture for computing and executing plans to achieve assigned goals. In the $RA$ domain, a simulated robot reasons with existing knowledge to deliver messages to target people in target locations, and to answer explanatory questions about the plans and observed scenes. The focus of our work is on understanding and using the interplay between deep learning, commonsense reasoning, and incremental learning, in the context of \emph{reliable and efficient scene understanding in any particular dynamic domain}. The benchmark VQA datasets and the corresponding algorithms, on the other hand, focus on generalizing across images from different scenarios in different domains, making it difficult to support the reasoning and learning capabilities of our architecture. We thus do not use these datasets or algorithms in our evaluation. \subsection{\bf Feature Extraction using CNNs} \label{sec:arch-cnn} The first component of the architecture trains CNNs to map input images to concise features representing the objects of interest in the images. For the SS domain and TS domain, semi-automated annotation was used to label the relevant features in images for training and testing. The selection of these features for each domain was based on domain expertise. In the SS domain, the features of interest are: \begin{itemize} \item Number of blocks in structure (number $\in [1, 5]$); \item Whether the structure is on a lean (true, false); \item Width of the base block (wide, narrow); and \item Whether any block is displaced, i.e., placed such that it is not well balanced on top of the block below (true, false). \end{itemize} In the TS domain, the features of interest are: \begin{itemize} \item Primary symbol in the middle of the traffic sign; $39$ primary symbols such as $bumpy\_road$, $slippery\_road$, $stop$, $left\_turn$, and $speed\_limit$; \item Secondary symbol in the traffic sign; $10$ secondary symbols such as $disabled$, $car$ and $fence$; \item Shape of the sign; $circle$, $triangle$, $square$, $hexagon$, $rectangle$, $wide~rectangle$, $diamond$, or $inverted$ $triangle$; \item Main color in the middle of the sign; $red$, $white$, or $blue$; \item Border color at the edge of the sign; $red$, $white$, or $blue$; \item Background image, e.g., some symbols are placed over a square or a triangle; and \item Presence of a red or black cross across a sign to indicate a zone's end or invalidity; the sign without the cross indicates the zone's beginning or validity, e.g., a parking sign with a cross implies no parking. \end{itemize} To reduce the training data requirements and simplify the training of CNNs, we (i) train a separate CNN for each feature to be extracted from an image; and (ii) start with a basic model for each CNN and incrementally make it more complex as needed. The number of CNNs is thus equal to the number of features to be extracted from each image for any given domain, and the CNN trained for each feature may be different even within a particular domain. The basic CNN model we begin with has an input layer, a convolutional layer, a pooling layer, a dense layer, a dropout layer, and a logit layer, as seen on the left of Figure~\ref{fig:cnn-example}. Additional convolutional and pooling layers are added until the feature extraction accuracy converges or exceeds a threshold (e.g., $\ge 90\%$). Our architecture also includes the option of fine-tuning previously trained CNN models instead of starting from scratch. The right side of Figure~\ref{fig:cnn-example} shows a CNN model learned in our example domains, which has three convolutional layers and pooling layers. We trained and validated these CNNs in an initial phase, and used them for evaluation. Our code for constructing these CNNs for features (in our example domains) is in our repository~\cite{code-results}. \begin{figure*} \begin{center} \includegraphics[width=\linewidth]{./cnn_diagram_merged.png} \vspace{-1em} \caption{Basic CNN model used for extracting each feature in our architecture. CNNs for individual features may end up with different numbers of convolutional and pooling layers.} \label{fig:cnn-example} \end{center} \vspace{-1em} \end{figure*} \subsection{\bf Classification using Non-monotonic Logical Reasoning or Decision Trees} \label{sec:arch-classify} The feature vector extracted from an image is used for decision making. In the SS domain and TS domain, decisions take the form of assigning a class label to each feature vector\footnote{Decision making can also include planning and diagnostics, as we will discuss later in Section~\ref{sec:arch-plan} for the RA domain.}. The second component of our architecture performs this task using one of two methods: (i) non-monotonic logical inference using ASP; or (ii) a classifier based on a learned decision tree. We describe these two methods below. \medskip \noindent \textbf{ASP-based Inference with Commonsense Knowledge:} ASP is a declarative programming paradigm that can be used to represent and reason with incomplete commonsense domain knowledge. ASP is based on stable model semantics, and supports \emph{default negation} and \emph{epistemic disjunction}. For instance, unlike ``$\lnot a$'', which implies that \emph{a is believed to be false}, ``$not~a$'' only implies \emph{a is not believed to be true}. Also, unlike ``$p~\lor\,\,\lnot p$'' in propositional logic, ``$p~or~\lnot p$'' is not tautological. Each literal can thus be true, false or unknown, and the agent reasoning with domain knowledge does not believe anything that it is not forced to believe. ASP can represent recursive definitions, defaults, causal relations, special forms of self-reference, and language constructs that occur frequently in non-mathematical domains, and are difficult to express in classical logic formalisms~\cite{baral:book03,gelfond:aibook14}. Unlike classical first-order logic, ASP supports non-monotonic logical reasoning, i.e., it can revise previously held conclusions or equivalently reduce the set of inferred consequences, based on new evidence---this ability helps the agent recover from any errors made by reasoning with incomplete knowledge. ASP and other paradigms that reason with domain knowledge are often criticized for requiring considerable (if not complete) prior knowledge and manual supervision, and for being unwieldy in large, complex domains. However, modern ASP solvers support efficient reasoning in large knowledge bases with incomplete knowledge, and are used by an international research community for cognitive robotics~\cite{erdem:bookchap12,zhang:TRO15} and other applications~\cite{erdem:AIM16}. For instance, recent work has demonstrated that ASP-based non-monotonic logical reasoning can be combined with: (i) probabilistic reasoning for reliable and efficient planning and diagnostics~\cite{mohan:JAIR19}; and (ii) relational reinforcement learning and active learning methods for interactively learning or revising commonsense domain knowledge based on input from sensors and humans~\cite{mohan:ACS18}. A domain's description (i.e., the knowledge base) in ASP comprises a \emph{system description} $\mathcal{D}$ and a \emph{history} $\mathcal{H}$. System description $\mathcal{D}$ comprises a \emph{sorted signature} $\Sigma$ and axioms. The signature $\Sigma$ comprises \emph{basic sorts}, \emph{statics}, i.e., domain attributes whose values do not change over time, \emph{fluents}, i.e., domain attributes whose values can change over time, and \emph{actions}. The domain's fluents can be \emph{basic}, i.e., those that obey the laws of inertia and are changed directly by actions, or \emph{defined}, i.e., those that do not obey the laws of inertia and are defined by other attributes. For instance, in the SS domain, $\Sigma$ includes basic sorts such as $structure$, $color$, $size$, and $attribute$; the basic sorts of the TS domain include $main\_color$, $other\_color$, $main\_symbol$, $other\_symbol$, $shape$, $cross$ etc. The sort $step$ is also in $\Sigma$ to support temporal reasoning over time steps. The statics and fluents in the SS domain include: \vspace{-1.5em} \begin{center} \begin{align} &num\_blocks(structure, num), ~block\_color(block, color),~block\_size(block, size) \\ \nonumber &block\_displaced(structure), ~stable(structure) \end{align} \end{center} which correspond to the image features extracted in the domain, and are described in terms of their arguments' sorts. In a similar manner, statics and fluents of the TS domain include: \vspace{-1.5em} \begin{center} \begin{align} &primary\_symbol(sign, main\_symbol), ~primary\_color(sign, main\_color)\\\nonumber &secondary\_symbol(sign, other\_symbol), ~secondary\_color(sign, other\_color)\\ \nonumber &sign\_shape(shape), ~background\_image(image) \end{align} \end{center} In both domains, signature $\Sigma$ includes a predicate $holds(fluent, step)$, which implies that a particular fluent holds true at a particular time step. As stated above, $\Sigma$ for a dynamic domain typically includes actions that cause state transitions, but this capability is not needed to answer explanatory questions about specific scenes and the underlying classification problem in our (SS, TS) domains. For ease of explanation, we thus temporarily disregard the modeling of actions, and their preconditions and effects. We will revisit actions in Section~\ref{sec:arch-plan} when we consider planning tasks in the RA domain. The axioms of $\mathcal{D}$ govern domain dynamics; in our example domains (SS, TS), they govern the belief about domain states. The axioms of the SS domain include statements such as: \begin{subequations} \label{eqn:axioms-ss} \begin{align} &\lnot stable(S) ~~\leftarrow~~block\_displaced(S)\\ &stable(S) ~~\leftarrow~~ num\_blocks(S, 2),~structure\_type(S, lean) \end{align} \end{subequations} where Statement~\ref{eqn:axioms-ss}(a) says that any structure with a block that is displaced significantly is unstable, and Statement~\ref{eqn:axioms-ss}(b) says that any pair of blocks without a significant lean is stable. \noindent Axioms of the TS domain include statements such as: \begin{subequations} \label{eqn:axioms-ts} \begin{align} \nonumber sign\_type(TS, no\_parking) \leftarrow~ &primary\_color(TS, blue),~primary\_symbol(TS, blank), \\ &cross(TS),~shape(TS, circle) \\\nonumber sign\_type(TS, stop) \leftarrow &primary\_color(TS, red),~primary\_symbol(TS, stoptext), \\ & shape(TS, octagon) \end{align} \end{subequations} where Statement~\ref{eqn:axioms-ts}(a) implies that a traffic sign that is blue, blank, circular, and has a cross across it, is a no parking sign. Statement~\ref{eqn:axioms-ts}(b) implies that a traffic sign that is red, octagon-shaped, and contains the text ``stop'', is a stop sign. The history $\mathcal{H}$ of a dynamic domain is usually a record of fluents observed to be true or false at a particular time step, i.e., $obs(fluent, boolean, step)$, and the successful execution of an action at a particular time step, i.e., $hpd(action, step)$; for more details, see~\cite{gelfond:aibook14}. The domain knowledge in many domains often includes default statements that are true in all but a few exceptional circumstances. For example, we may know in the SS domain that ``structures with two blocks of the same size are usually stable''. To encode such knowledge, we use our recent work that expanded the notion of history to represent and reason with defaults describing the values of fluents in the initial state~\cite{mohan:JAIR19}. Key tasks of an agent equipped with a system description $\mathcal{D}$ and history $\mathcal{H}$ include reasoning with this knowledge for inference, planning and diagnostics. In our architecture, these tasks are accomplished by translating the domain representation to a program $\Pi(\mathcal{D}, \mathcal{H})$ in CR-Prolog, a variant of ASP that incorporates consistency restoring (CR) rules~\cite{balduccini:aaaisymp03}. In this paper, we use the terms ``ASP'' and ``CR-Prolog'' interchangeably. The program $\Pi$ includes the signature and axioms of $\mathcal{D}$, inertia axioms, reality checks, closed world assumptions for defined fluents and actions, and observations, actions, and defaults from $\mathcal{H}$. In addition, features extracted from an input image (to be processed) are encoded as the initial state of the domain in $\Pi$. Each \emph{answer set} of $\Pi(\mathcal{D}, \mathcal{H})$ represents the set of beliefs of an agent associated with this program. Algorithms for computing entailment, and for planning and diagnostics, reduce these tasks to computing answer sets of CR-Prolog programs. We compute answer sets of CR-Prolog programs using the SPARC system~\cite{balai:lpnmr13}. The CR-Prolog programs for our example domains are in our open-source software repository~\cite{code-results}. For the classification task in our example domains, the relevant literals in the answer set provide the class label and an explanatory description of the assigned label (see Section~\ref{sec:arch-explain}); we will consider the planning task in Section~\ref{sec:arch-plan}. The accuracy of the inferences drawn from the encoded knowledge depends on the accuracy and extent of the knowledge encoded, but encoding comprehensive domain knowledge is difficult. The decision of what and how much knowledge to encode is made by the designer. \medskip \noindent \textbf{Decision Tree Classifier:} If ASP-based inference cannot classify the feature vector extracted from an image, the feature vector is mapped to a class label using a decision tree classifier learned from labeled training examples. In a decision tree classifier, each node is associated with a question about the value of a particular feature, with the child nodes representing the different answers to the question, i.e., the possible values of the feature. Each node is also associated with samples that satisfy the corresponding values of the features along the path from the root node to this node. We use a standard implementation of a decision tree classifier~\cite{duda:book00}. This implementation uses the Gini measure to compute information gain (equivalently, the reduction in entropy) that would be achieved by splitting an existing node based on each feature that has not already been used to create a split in the tree. Among the features that provide a significant information gain, the feature that provides the maximum information gain is selected to split the node. If none of the features would result in any significant information gain, this node becomes a leaf node with a class label that matches a majority of the samples at the node. \begin{figure*} \includegraphics[width=\linewidth]{./decision_tree_highlighted} \vspace{-1.5em} \caption{Example of part of a decision tree constructed from labeled samples and used for classification in the SS domain. The nodes used to classify a particular example are highlighted. Each leaf shows a class label and indicates the proportion of the labeled examples (at the leaf) that correspond to this label.} \label{fig:decisiontree-example} \end{figure*} The decision tree's search space is quite specific since it only considers samples that could not be classified by ASP-based reasoning. The decision tree does not need to generalize as much as it would have to if it had to process every training (or test) sample in the dataset. Also, although overfitting is much less likely, we still use pruning to minimize the effects of overfitting. Figure~\ref{fig:decisiontree-example} shows part of a learned decision tree classifier; specific nodes used to classify a particular example are highlighted to indicate that $94\%$ of the observed examples of structures that have fewer than three blocks, do not have a significant lean, and do not have a narrow base, correspond to stable structures. These ``active'' nodes along any path in the decision tree that is used to classify an example can be used to explain the classification outcome in terms of the values of particular features that were used to arrive at the class label assigned to a specific image under consideration. \subsection{\bf Answering Explanatory Questions} \label{sec:arch-explain} The third component of the architecture provides two methods for answering explanatory questions. The available inputs are the (i) question; (ii) vector of features extracted from the image under consideration; and (iii) classification output. The human designer also provides pre-determined templates for questions and their answers. In our case, we use a controlled vocabulary, templates based on language models and parts of speech for sentences, and existing software for natural language processing. Any given question is transcribed using the controlled vocabulary, parsed (e.g., to obtain parts of speech), and matched with the templates to obtain a relational representation. Recall that questions in the SS domain are of the form: ``is this structure stable/unstable?'' and `` what is making this structure stable/unstable?''. These questions can be translated into relational statements such as $stable(S)$ or $\lnot stable(S)$ and used as a question, or as the desired consequence, during inference or in a search process. In a similar manner, questions in the TS domain such as: ``what sign is this?'' and ``what is the sign's message?'' can be translated into $sign\_type(S, sign)$ and used for subsequent processing. The first method for answering explanatory questions is based on the understanding that if the feature vector extracted from the image is processed successfully using ASP-based reasoning, it is also possible to reason with the existing knowledge to answer explanatory questions about the scene. To support such question answering, we need to revise the signature $\Sigma$ in the system description $\mathcal{D}$ of the domain. For instance, we add sorts such as $query\_type$, $answer\_type$, and $query$ to encode different types of queries and answers. We also introduce suitable relations to represent questions, answers to these questions, and more abstract attributes, e.g., of structures of blocks, traffic signs etc. In addition to the signature, we also augment the axioms in $\mathcal{D}$ to support reasoning with more abstract attributes, and to help construct answers to questions. For instance, we can include an axiom such as: \begin{align} \nonumber many\_blocks(S)~\leftarrow~ &unstable(S),~\lnot base(S, narrow),\\ &\lnot struc\_type(S, lean),~\lnot block\_displaced(S) \end{align} which implies that if a structure (of blocks) is not on a narrow base, does not have a significant lean, and does not have blocks significantly displaced, any instability in the structure implies (and is potentially because) there are too many blocks in the structure. Once the ASP program $\Pi(\mathcal{D}, \mathcal{H})$ has been revised as described above, we can compute answer set(s) of this program to obtain the beliefs of the agent associated with this program. For any given question, the answer set(s) are parsed based on the known controlled vocabulary and templates (for questions and answers) to extract relevant literals---these literals are included in the corresponding templates to construct answers to explanatory questions. These answers can also be converted to speech using existing software. \begin{figure} \begin{center} \includegraphics[width=0.55\columnwidth]{./rnn_diagram} \vspace{-2em} \caption{Example of the basic RNN used to construct explanations. The RNN learned for the example domains has $26-30$ hidden layers.} \label{fig:rnn-example} \end{center} \end{figure} The second method for answering explanatory questions is invoked if the decision tree is used to process (i.e., classify in the context of the SS domain and TS domain) the vector of image features. The inability to classify the feature vector through ASP-based reasoning is taken to imply that the encoded domain knowledge is insufficient to answer explanatory questions about the scene. In this case, an LSTM network-based RNN is trained and used to answer the explanatory questions. The inputs are the feature vector, classification output, and a vector representing the transcribed and parsed query. The output (provided during training) is in the form of answers in the predetermined templates. Similar to the approach used in Section~\ref{sec:arch-classify}, the RNN is built incrementally during training. We begin with one or two hidden layer(s), as shown in Figure~\ref{fig:rnn-example}, and add layers as long as it results in a significant increase in the accuracy. We also include the option of adding a stack of LSTMs if adding individual layers does not improve accuracy significantly. In our example domains, the RNN constructed to answer explanatory questions had as many as $26-30$ hidden layers and used a softmax function to provide one of about $50$ potential answer types. An example of the code used to train the RNN is available in our repository~\cite{code-results}. \subsection{\bf Learning State Constraints} \label{sec:arch-learn-constraint} The components of the architecture described so far support reasoning with commonsense knowledge, learned decision trees, and deep networks, to answer explanatory questions about the scene and an underlying classification problem. In many practical domains, the available knowledge is incomplete, the number of labeled examples is small, or the encoded knowledge changes over time. The decisions made by the architecture can thus be incorrect or sub-optimal, e.g., a traffic sign can be misclassified or an ambiguous answer may be provided to an explanatory question. The fourth component of our architecture seeks to address this problem by supporting incremental learning of domain knowledge. Our approach is inspired by the inductive learning methods mentioned in Section~\ref{sec:relwork}, e.g., work in our research group on using relational reinforcement learning and decision tree induction to learn domain axioms~\cite{mohan:ACS18}. The work described in this paper uses decision tree induction to learn constraints governing domain states. The methodology used in this component, in the context of VQA, is as follows: \begin{enumerate} \item Identify training examples that are not classified, or are classified incorrectly, using the existing knowledge. Recall that this step is accomplished by the component described in Section~\ref{sec:arch-classify}, which processes each training example using the existing knowledge encoded in the CR-Prolog program, in an attempt to assign a class label to the example. \item Train a decision tree using the examples identified in Step-1 above. Recall that this step is also accomplished by the component described in Section~\ref{sec:arch-classify}. \item Identify paths in the decision tree (from root to leaf) such that (i) there are a sufficient number of examples at the leaf, e.g., $10\%$ of the training examples; and (ii) all the examples at the leaf have the same class label. Since the nodes correspond to checks on the values of domain features, the paths will correspond to combinations of partial state descriptions and class labels that have good support among the labeled training examples. Each such path is translated into a candidate axiom. For instance, the following are two axioms identified by this approach in the SS domain: \begin{subequations} \label{eqn:axiom-learn} \begin{align} &\lnot stable(S) ~:-~num\_blocks(S, 3),~ base(S, wide),~struc\_type(S, lean)\\ &\lnot stable(S) ~:-~num\_blocks(S, 3),~ base(S, narrow),~struc\_type(S, lean) \end{align} \end{subequations} \item Generalize candidate axioms if possible. For instance, if one candidate axiom is a over-specification of another existing axiom, the over-specified version is removed. In the context of the axioms in Statement~\ref{eqn:axiom-learn}(a-b), the second literal represents redundant information, i.e., if a structure with three blocks has a significant lean, it is unstable irrespective of whether the base of the structure is narrow or wide. Generalizing over these two axioms results in the following candidate axiom: \begin{align} &\lnot stable(S) ~:-~num\_blocks(S, 3),~struc\_type(S, lean) \end{align} which only includes the literals that encode the essential information. \item Validate candidate axioms one at a time. To do so, the candidate axiom is added to the CR-Prolog program encoding the domain knowledge. A sufficient number of training examples (e.g., $10\%$ of the dataset, as before) relevant to this axiom, i.e., the domain features encoded by the examples should satisfy the body of the axiom, are drawn randomly from the training dataset. If processing these selected examples with the updated CR-Prolog program results in misclassifications, the candidate axiom is removed from further consideration. \item Apply sanity checks to the validated axioms. The validated axioms and existing axioms are checked to remove over-specifications and retain the most generic version of any axiom. Axioms that pass these sanity checks are added to the CR-Prolog program and used for subsequent reasoning. \end{enumerate} Section~\ref{sec:expresults-axiom-vqa} examines the effect of such learned constraints on classification and VQA performance. \subsection{\bf Planning with Domain Knowledge} \label{sec:arch-plan} The description of the architecture's components has so far focused on classification and VQA, and reasoning has been limited to inference with knowledge. However, the architecture is also applicable to planning (and diagnostics) problems. Consider the \textbf{RA domain} in which a simulated robot has to navigate and deliver messages to particular people in particular places, and to answer explanatory questions, i.e., the domain includes aspects of planning and VQA. Figure~\ref{fig:ra-domain} depicts this domain and a simulated scenario in it; semantic labels of the offices and rooms are shown in the upper half. A robot planning and executing actions in the real world has to account for the uncertainty in sensing and actuation. In other work, we addressed this issue by coupling ASP-based coarse-resolution planning with probabilistic fine-resolution planning and execution~\cite{mohan:JAIR19}. In this paper, we temporarily abstract away such probabilistic models of uncertainty to thoroughly explore the interplay between reasoning and learning, including the effect of added noise in sensing and actuation (in simulation). \begin{figure*} \begin{center} \includegraphics[width=0.55\textwidth]{./office_world} \vspace{-0.75em} \caption{Block diagram and a simulated scenario in the RA domain in which the robot has to deliver messages to people in target locations.} \vspace{-1.25em} \label{fig:ra-domain} \end{center} \end{figure*} To support planning, the signature $\Sigma$ of system description $\mathcal{D}$ has basic sorts such as: $place$, $robot$, $person$, $object$, $entity$, $status$, and $step$, which are arranged hierarchically, e.g., $robot$ and $person$ are subsorts of $agent$, and $agent$ and $object$ are subsorts of $entity$. $\Sigma$ also includes ground instances of sorts, e.g., $of\!fice$, $workshop$, $kitchen$, and $library$ are instances of $place$, and $Sarah$, $Bob$, $John$, and $Sally$ are instances of $person$. As before, domain attributes and actions are described in terms of the sorts of their arguments. The fluents include $loc(agent, place)$, which describes the location of the robot and people in the domain, and $message\_status(message\_id, person, status)$, which denotes whether a particular message has been delivered (or remains undelivered) to a particular person. Static attributes include relations such as $next\_to(place, place)$ and $work\_place(person, place)$ to encode the arrangement of places and the work location of people (respectively) in the domain. Actions of the domain include: \begin{align} &move(robot, place) \\ \nonumber &deliver(robot, message\_id, person) \end{align} which move the robot to a particular place, and cause a robot to deliver a particular message to a particular person (respectively). For ease of explanation, we assume that the locations of people are defined fluents whose values are determined by external sensors, and that the locations of objects are static attributes; as a result, we do not consider actions that change the value of these attributes. The signature $\Sigma$ also includes (as before) the relation $holds(fluent, step)$ to imply that a particular fluent is true at a particular time step. Axioms of the RA domain capture the domain's dynamics. These axioms include causal laws, state constraints and executability conditions. For example: \begin{subequations} \label{eqn:axioms-ra} \begin{align} &move(rob_1, L)~~\mathbf{causes}~~loc(rob_1, L)\\ &deliver(rob_1, ID, P)~~\mathbf{causes}~~message\_status(ID, P, delivered) \\ &loc(P, L) ~~\mathbf{if}~~ work\_place(P, L),~not~\lnot loc(P, L)\\ &\lnot loc(T, L_2)~~\mathbf{if}~~ loc(T, L_1),~L_1 \ne L_2 \\ &\mathbf{impossible}~~deliver(rob_1, ID, P) ~~\mathbf{if}~loc(rob_1, L_1),~loc(P, L_2),~L_1 \ne L_2 \\ &\mathbf{impossible}~~move(rob_1, L) ~~\mathbf{if}~~ loc(rob_1, L) \end{align} \end{subequations} where Statement~\ref{eqn:axioms-ra}(a) states that executing a move action causes the robot's location to be the target place; Statement~\ref{eqn:axioms-ra}(b) states that executing a deliver action causes the message to be delivered to the desired person; Statement~\ref{eqn:axioms-ra}(c) is a constraint stating that unless told otherwise the robot expects (by default) a person to be in her/his place of work; Statement~\ref{eqn:axioms-ra}(d) is a constraint stating that any thing can be in one place at at time; Statement~\ref{eqn:axioms-ra}(e) implies that a robot cannot deliver a message to an intended recipient if the robot and the person are not in the same place; and Statement~\ref{eqn:axioms-ra}(f) states that a robot cannot move to a location if it is already there. As described in Section~\ref{sec:arch-classify}, the domain history is a record of observations (of fluents), the execution of actions, and the values of fluents in the initial state. Also, planning (similar to inference) is reduced to computing answer set(s) of the program $\Pi(\mathcal{D}, \mathcal{H})$ after including some helper axioms for computing a minimal sequence of actions; for examples, please see~\cite{gelfond:aibook14,mohan:JAIR19}. If the robot's knowledge of the domain is incomplete or incorrect, the computed plans may be suboptimal or incorrect. The approach described in Section~\ref{sec:arch-learn-constraint} can then be used to learn the missing constraints; we will explore the interplay between learning and planning in Section~\ref{sec:expresults-axiom-plan}. \section{Experimental Setup and Results} \label{sec:expresults} In this section, we describe the results of experimentally evaluating the following hypotheses about the capabilities of our architecture: \begin{itemize} \item \underline{\textbf{H1:}} for the underlying classification problem, our architecture outperforms an architecture based on just deep networks for small training datasets, and provides comparable performance as the size of the dataset increases; \item \underline{\textbf{H2:}} in the context of answering explanatory questions, our architecture provides significantly better performance in comparison with an architecture based on deep networks; \item \underline{\textbf{H3:}} our architecture supports reliable and incremental learning of state constraints, which improves the ability to answer explanatory questions; and \item \underline{\textbf{H4:}} our architecture can be adapted to planning tasks, with the incremental learning capability improving the ability to compute minimal plans. \end{itemize} These hypotheses were evaluated in the context of the domains (SS, TS and RA) introduced in Section~\ref{sec:arch}. Specifically, hypotheses $H1$, $H2$ and $H3$ are evaluated in the SS domain and TS domain in the context of VQA. As stated in Section~\ref{sec:introduction}, VQA is used in this paper only as an instance of a complex task that requires explainable reasoning and learning. We are primarily interested in exploring the interplay between reasoning with commonsense domain knowledge, incremental learning, and deep learning, in any given domain in which large labeled datasets are not readily available. State of the art VQA algorithms, on the other hand, focus instead on generalizing across different domains, using benchmark datasets of several thousand images. Given the difference in objectives between over work and the existing work on VQA, we thus do not compare with state of the art algorithms, and do not use the benchmark VQA datasets. Furthermore, we evaluated hypothesis $H4$ in the RA domain in which the robot's goal was to deliver messages to appropriate people and answer explanatory questions about this process. We begin by describing some execution traces in Section~\ref{sec:expresults-trace} to illustrate the working of our architecture. This is followed by Sections~\ref{sec:expresults-classify-vqa}-~\ref{sec:expresults-axiom-plan}, which describe the results of experimentally evaluating the classification, VQA, axiom learning, and planning capabilities, i.e., hypotheses $H1$-$H4$. We use accuracy (precision) as the primary performance measure. Classification accuracy was measured by comparing the assigned labels with the ground truth values, and question answering accuracy was evaluated heuristically by computing whether the answer mentions all image attributes relevant to the question posed. This relevance was established by a human expert, the lead author of this paper. Unless stated otherwise, we used two-thirds of the available data to train the deep networks and other computational models, using the remaining one-third of the data for testing. For each image, we randomly chose from the set of suitable questions for training the computational models. We repeated this process multiple times and report the average of the results obtained in these trials. Finally, for planning, accuracy was measured as the ability to compute minimal and correct plans for the assigned goals. \subsection{\bf Execution Traces} \label{sec:expresults-trace} The following execution traces illustrate our architecture's ability to reason with commonsense knowledge and learned models to provide intuitive answers for explanatory questions. \noindent \begin{execexample}\label{ex:exec-example1}[Question Answering, SS domain] {\rm Consider a scenario in the SS Domain in which the input (test) image is the one on the extreme right in Figure~\ref{fig:blocks-domain}. \begin{itemize} \item First \textbf{classification-related question} posed: ``\emph{is this structure unstable}?'' \ \\ The architecture's \textbf{answer}: ``\emph{no}''. \item The \textbf{explanatory question} posed: ``\emph{what is making this structure stable}?'' \ \\ The architecture's \textbf{answer}: ``\emph{the structure has five blocks and a narrow base, it is standing straight, and there is no significant lean}''. \item This answer was based on the following features extracted by CNNs from the image: (i) five blocks; (ii) narrow base; (iii) standing straight; and (iv) no significant lean, i.e, all blocks in place. \item The extracted features wew converted to literals. ASP-based inference provided an answer about the stability of the arrangement of objects in the scenario. Relevant literals in the corresponding answer set were then inserted into a suitable template to provide the answers described above. \item Since the example was processed successfully using ASP-based inference, it was not processed using the decision tree (for classification) or the RNN (for answering the explanatory question). \end{itemize} } \end{execexample} \begin{execexample}\label{ex:exec-example2}[Question Answering, TS domain] {\rm Consider a scenario in the TS Domain with the input (test) image is the one on the extreme right in Figure~\ref{fig:signs-domain}. \begin{itemize} \item The \textbf{classification question} posed was: ``\emph{what is the sign's message}?''\ \\ The architecture's \textbf{answer}: ``\emph{uneven surfaces ahead}''. \item When asked to explain this answer (``\emph{Please explain this answer}''), the architecture identified that the CNNs extracted the following features of the sign in the image: (i) it is triangle-shaped; (ii) main color is white and other (i.e., border) color is red; (iii) it has no background image; (iv) it has a bumpy-road symbol and no secondary symbol; and (v) it has no cross. \item These features were converted to literals and used in ASP-based inference based on existing knowledge in the TS domain. ASP-based inference is unable to provide an answer, i.e., unable to classify the sign. \item The extracted features were processed using the trained decision tree, which only used the colors in the sign to assign the class label. The main (or border) color is normally insufficient to accurately classify signs. However, recall that the decision tree is trained to classify signs that cannot be classified by reasoning with existing knowledge. \item The decision tree output, image feature vector, and input question, were processed by the previously trained RNN to provide the answer type and the particular answer described above. \end{itemize} } \end{execexample} \noindent These (and other such) execution traces illustrate the working of our architecture, especially that: \begin{itemize} \item The architecture takes advantage of (and perform non-monotonic logical inference with) the existing commonsense domain knowledge to reliably and efficiently address the decision-making problem (classification in the examples above) when possible. In such cases, it is also able to answer explanatory questions about the classification decision and the underlying scene. \item When the desired decision cannot be made using non-monotonic logical inference with domain knowledge, the architecture smoothly transitions to training and using a decision-tree to make and explain the classification decision. In such cases, the architecture also learns and uses an RNN to answer explanatory questions about the scene. \end{itemize} \subsection{\bf Experimental Results: Classification + VQA} \label{sec:expresults-classify-vqa} To quantitatively evaluate hypotheses $H1$ and $H2$, we ran experimental trials in which we varied the size of the training dataset. In these trials, the baseline performance was provided by a CNN-RNN architecture, with the CNNs processing images to extract and classify features, and the RNN providing answers to explanatory questions. We repeated the trials $50$ times (choosing the training set randomly each time) and the corresponding average results are summarized in Figures~\ref{fig:ss-classify} and~\ref{fig:ss-vqa} for the SS domain, and in Figures~\ref{fig:ts-classify} and~\ref{fig:ts-vqa} for the TS domain. We make some observations based on these figures: \begin{enumerate} \item The classification performance of our architecture depends on the domain. In the relatively simpler SS domain, the baseline deep network architecture is at least as accurate as our architecture, even with a small training set---see Figure~\ref{fig:ss-classify}. This is because small differences in the position and arrangement of blocks (which could almost be considered as noise) influence the decision about stability. For instance, two arrangements of blocks that are almost identical end up receiving different ground truth labels for stability, and it is not possible to draft rules based on abstract image features to distinguish between these cases. The baseline deep network architecture, which generalizes from data, is observed to be more sensitive to these small changes than our architecture. Exploring the reason for this performance is an interesting direction for further research. \item In the more complex TS domain, our architecture provides better classification accuracy than the baseline architecture based on just deep networks, especially when the size of the training set is small---see Figure~\ref{fig:ts-classify}. The classification accuracy increases with the size of the training set\footnote{We limit ourselves to training sets that are not too large in order to match the focus of our paper.}, but our architecture is always at least as accurate as the baseline architecture. \item Our architecture is much more capable of answering explanatory questions about the classification decisions than the baseline architecture. When the answer provided by our architecture does not match the ground truth, we are able to examine why that decision was made. We were thus able to understand and explain the lower classification accuracy of our architecture in the SS domain. The baseline architecture does not provide this capability. \item Unlike classification, the VQA performance of our architecture is much better than that of the baseline architecture in both domains. Also performance does not improve just by increasing the size of training set, even in simpler domains, e.g., see Figure~\ref{fig:ss-vqa}. This is because VQA performance also depends on the complexity of the explanatory questions. For more complex domains, the improvement in VQA accuracy provided by our architecture is much more pronounced, e.g., see Figure~\ref{fig:ts-vqa}. \end{enumerate} We explored the statistical significance of the observed performance by running paired t-tests. We observed that the VQA performance of the proposed architecture was significantly better than that of the baseline architecture; this is more pronounced in the TS domain that is more complex than the SS domain. Also, although the baseline architecture provides better classification performance in the SS domain, the difference is not always statistically significant. \begin{figure*}[tbh] \centering \includegraphics[width=0.7\linewidth]{./stability_classification_diagram} \vspace{-1em} \caption{Classification accuracy as a function of the number of training samples in the SS domain.} \label{fig:ss-classify} \end{figure*} \begin{figure*}[tbh] \centering \includegraphics[width=0.7\textwidth]{./stability_vqa_diagram} \vspace{-1em} \caption{VQA accuracy as a function of the number of training samples in the SS domain.} \label{fig:ss-vqa} \end{figure*} \begin{figure*}[tbh] \centering \includegraphics[width=0.7\textwidth]{./traffic_classification_diagram} \vspace{-1em} \caption{Classification accuracy as a function of number of training samples in TS domain.} \label{fig:ts-classify} \end{figure*} \begin{figure*}[tbh] \centering \includegraphics[width=0.7\textwidth]{./traffic_vqa_diagram} \vspace{-1em} \caption{VQA accuracy as a function of number of training samples in TS domain.} \label{fig:ts-vqa} \end{figure*} To further explore the observed results, we obtained a ``confidence value'' from the logits layer of each CNN used to extract a feature from the input image. For each CNN, the confidence value is the largest probability assigned to any of the possible values of the corresponding feature, i.e., it is the probability assigned to the most likely value of the feature. These confidence values are considered to be a measure of the network's confidence in the corresponding features being a good representation of the image. We trained a version of our architecture in which if the confidence value for any feature was low, the image features were only used to revise the decision tree (during training), or were processed using the decision tree (during testing). In other words, features that do not strongly capture the essence of the image are not used for non-monotonic logical reasoning; the deep network architectures provide much better generalization to noise. We hypothesized that this approach would improve the accuracy of classification and question answering, but it did not make any significant difference in our experimental trials. We believe this is because the extracted features were mostly good representations of the objects of interest in the images. We thus did not use such networks (that compute the confidence value) in any other experiments. \subsection{\bf Experimental Results: Learn Axiom + VQA} \label{sec:expresults-axiom-vqa} Next, we experimentally evaluated the ability to learn axioms, and the effect of such learning on the classification and VQA performance. For the SS domain, we designed a version of the knowledge base with eight axioms related to stability or instability of the structures. Out of these, four were chosen (randomly) to be removed and we examined the ability to learn these axioms, and the corresponding accuracy of classification and VQA, as a function of the number of labeled training examples (ranging from $100$ to $2000$). We repeated these experiments $30$ times and the results (averaged over the $30$ trials) are summarized in Figures~\ref{fig:ss-axiom-classify}-\ref{fig:ss-axiom-vqa}. In the TS domain, the methodology for experimental evaluation was the same. However, since the domain was more complex, there were many more axioms in the domain description (for classification and VQA); we also had access to more labeled training examples. In each experimental trial, a quarter of the available axioms were thus selected and commented out, and the accuracy of classification and VQA were evaluated with the number of labeled training examples varying from $100$ to $4000$. The results averaged over $30$ such trials are summarized in Figures~\ref{fig:ts-axiom-classify}-\ref{fig:ts-axiom-vqa}. \begin{figure*}[tbh] \centering \includegraphics[width=0.7\linewidth]{./stability_classification_axiom_learning} \vspace{-1em} \caption{Comparison of classification accuracy in the SS domain with and without axiom learning. In both cases, some axioms were missing from the knowledge base.} \label{fig:ss-axiom-classify} \end{figure*} \begin{figure*}[tbh] \centering \includegraphics[width=0.7\textwidth]{./stability_vqa_axiom_learning} \vspace{-1em} \caption{Comparison of VQA accuracy in the SS domain with and without axiom learning. In both cases, some axioms were missing from the knowledge base.} \label{fig:ss-axiom-vqa} \end{figure*} \begin{figure*}[tbh] \centering \includegraphics[width=0.7\textwidth]{./traffic_classification_axiom_learning} \vspace{-1em} \caption{Comparison of classification accuracy in the TS domain with and without axiom learning. In both cases, some axioms were missing from the knowledge base.} \label{fig:ts-axiom-classify} \end{figure*} \begin{figure*}[tbh] \centering \includegraphics[width=0.7\textwidth]{./traffic_vqa_axiom_learning} \vspace{-1em} \caption{Comparison of VQA accuracy in the TS domain with and without axiom learning. In both cases, some axioms were missing from the knowledge base.} \label{fig:ts-axiom-vqa} \end{figure*} In these figures, ``Original KB'' (depicted in blue) represents the baseline with some axioms missing from the system description, e.g., four in the SS domain and one quarter of the axioms in the TS domain. The results obtained by using the available labeled examples to learn the axioms that are then used for classification and answering explanatory questions about the scene, are shown as ``Learned KB'' in orange. We observe that our approach supports incremental learning of the domain axioms, and that using the learned axioms improves the classification accuracy and the accuracy of answering explanatory questions, in comparison with the baseline. This improvement was found to be statistically significant using paired tests at $95\%$ level of significance. These results support hypothesis $H3$. \subsection{\bf Experimental Results: Learn Axiom + Plan} \label{sec:expresults-axiom-plan} Next, we experimentally evaluated the ability to learn axioms and the effect of the learned axioms on planning, in the RA domain. The simulated robot was equipped with domain knowledge for planning, classification, and question answering. It uses this knowledge to navigate through an office building, locate the intended recipient of a message, deliver the message, detect and reason about objects in its surroundings, and answer questions about the rooms it has visited. As stated in Section~\ref{sec:arch-plan}, we limit uncertainty in sensing and actuation on robots to noise added in simulation. Average results from $100$ trials indicates a VQA accuracy of $\approx 85\%$ after training the architecture's components with just $500$ labeled images. The domain knowledge includes learned axioms---the corresponding experimental results and the planning performance are discussed later in this section. We begin with an execution trace in this domain. \noindent \begin{execexample}\label{ex:ra-exec-example4}[Question Answering, RA Domain] {\rm Consider the scenario in the RA domain (Figure~\ref{fig:ra-domain}) in which the robot's goal was to deliver a message from John to Sally, and return to John to answer questions. \begin{itemize} \item The robot was initially in John's office. It computed a plan that comprises moving to Sally's office through the library and the kitchen, delivering the message to Sally, and returning to John's office through the same route to answer questions. \item During plan execution, the robot periodically takes images of the scenes in the domain, which are used for planning, classification and question answering. \item After returning to John's office, the robot and the human had an exchange about the plan constructed and executed, and the observations received. The exchange includes instances such as: \\ \textbf{John's question:} ``is Sally's location cluttered?''\ \\ \textbf{Robot's answer:} ``Yes''.\\ When asked, the robot provides an \textbf{explanation} for this decision: ``Sally is in her office. Objects detected are Sally's chair, desk, and computer, and a cup, a large box, and a sofa. The room is cluttered because the cup, large box, and sofa are not usually in that room''. \end{itemize} } \end{execexample} The RA domain was also used to evaluate the effects of axiom learning. There were four employees in offices in the simulated scenario, as shown in Figure~\ref{fig:ra-domain}, and the robot was asked to find particular individuals and deliver particular messages to them. Employees are initially expected to be in their assigned workplace (i.e., their office), and spend most of their time in these offices, unless this default knowledge has been negated by other knowledge or observations. This information is encoded as follows: \begin{align} \nonumber &holds(loc(P, L), 0)~\leftarrow~ not~default\_negated(P, L), ~workplace(P, L) \end{align} where $workplace(P, L)$ specifies the default location of each person, and $default\_negated(P, L)$ is used to encode that a particular person may not be in their default location. These exceptions to the defaults can be encoded as follows: \begin{subequations} \label{eqn:ra-def-neg} \begin{align} &default\_negated(P, L)~\leftarrow~obs(loc(P, L1), true, I), ~L\neq L1 \\ &default\_negated(P, L)~\leftarrow~obs(loc(P, L), false, I) \end{align} \end{subequations} Statement~\ref{eqn:ra-def-neg}(a) implies that the default assumption should be ignored if the person in question is observed to be in a location other than their workplace, and Statement~\ref{eqn:ra-def-neg}(b) implies that a default assumption should be ignored if the corresponding person is not observed in their workplace. Including such default knowledge (and exceptions) in the reasoning process allows the robot to compute better plans and execute the plans more efficiently, e.g., when trying to deliver a message to a particular person. However, this knowledge may not be known in advance, the existing knowledge may be inaccurate or change with time (e.g., humans can move between the different places), or the observations may be incorrect. Our axiom learning approach was used in this domain to acquire previously unknown information about the default location of people and exceptions to these defaults. In all the trials, the simulated robot was able to learn the previously unknown axioms. \begin{table*}[tbh] \centering \begin{tabular}{| c || c | c | c | c | c |} \hline Axiom learning & Plans & Actions & Execution time & Planning time & Planning time\\ [0.5ex] & (per trial) & (per trial) & (per trial) & (per trial) & (per plan)\\ \hline \hline Before & 4 & 2.3 & 1.6 & 6.0 & 1.6 \\ \hline After & 1 & 1 & 1 & 1 & 1 \\ [1ex] \hline \end{tabular} \caption{Planning performance in a scenario in the RA domain (see Figure~\ref{fig:ra-domain}) before and after axiom learning. Results averaged over $100$ paired trials indicate that reasoning with previously unknown axioms results in fewer plans with fewer actions in each trial, and significantly reduces the time taken to compute and execute the plans.} \label{tab:ra-axiom-learn} \end{table*} We then conducted $100$ paired trials to explore the effects of the learned axioms on planning, with the corresponding results summarized in Table~\ref{tab:ra-axiom-learn}. In each trial, we randomly chose a particular goal and initial conditions, and measured planning performance before and after the previously unknown axioms had been learned and used for reasoning. Since the initial conditions are chosen randomly, the object locations, the initial location of the robot, and the goal, may vary significantly between trials. Under these circumstances, it is not meaningful to average the results obtained in the individual trials for performance measures such as planning time and execution time. Instead, the results obtained without including the learned axioms were computed as a ratio of the results obtained after including the learned axioms; the numbers reported in Table~\ref{tab:ra-axiom-learn} are the average of these computed ratios. Before axiom learning, the robot often explored an incorrect location (for a person) based on other considerations (e.g., distance to the room) and ended up having to replan. After the previously unknown axioms were included in the reasoning process, the robot went straight to the message recipient's most likely location, which also happened to be the actual location of the recipient in many trials. As a result, we observe a (statistically) significant improvement in planning performance after the learned axioms are used for reasoning. Note that in the absence of the learned axioms, the robot computes four times as many plans taking six times as much time in any given trial (on average) as when the learned axioms are included in reasoning. Even the time taken to compute each plan (with potentially multiple such plans computed in each trial) is significantly higher in the absence of the learned axioms. This is because the learned axioms enable the robot to eliminate irrelevant paths in the transition diagram from further consideration. In a similar manner, reasoning with intentional actions enables the robot to significantly reduce the plan execution time by terminating or revising existing plans when appropriate, especially in the context of unexpected successes and failures. These results provide evidence in support of hypothesis $H4$. Finally, we conducted some initial proof of concept studies exploring the use of our architecture on physical robots. We considered a robot collaborating with a human to jointly describe structures of blocks on a tabletop (similar to the SS domain described in this paper). We also considered a mobile robot finding and moving objects to desired locations in an indoor domain (similar to the RA domain). These initial experiments provided some promising outcomes. The robot was able to provide answers to explanatory questions, compute and execute plans to achieve goals, and learn previously unknown constraints. In the future, we will conduct a detailed experimental analysis on robots in different domains. \section{Discussion and Future Work} \label{sec:conclusions} Visual question answering (VQA) combines challenges in computer vision, natural language processing, and explainability in reasoning and learning. Explanatory descriptions of decisions help identify errors, and to design better algorithms and frameworks. In addition, it helps improve trust in the use of reasoning and learning systems in critical application domains. State of the art algorithms for VQA are based on deep networks and the corresponding learning algorithms. Given their focus on generalizing across different domains, these approaches are computationally expensive, require large training datasets, and make it difficult to provide explanatory descriptions of decisions. We instead focus on enabling reliable and efficient operation in any given domain in which a large number of labeled training examples may not be available. Inspired by research in cognitive systems, our architecture tightly couples representation, reasoning, and interactive learning, and exploits the complementary strengths of deep learning, non-monotonic logical reasoning with commonsense knowledge, and decision tree induction. Experimental results on datasets of real world and simulated images indicate that our architecture provides the following benefits in comparison with a baseline architecture for VQA based on deep networks: \begin{enumerate} \item Better accuracy, sample efficiency, and time complexity on classification problems when the training dataset is small, and comparable accuracy with larger datasets while still using only a subset of these samples for training; \item Ability to provide answers to explanatory questions about the scenes and the underlying decision making problems (e.g., classification, planning); \item Incremental learning of previously unknown domain constraints, whose use in reasoning improves the ability to answer explanatory questions; and \item Ability to adapt the complementary strengths of non-monotonic logical reasoning with commonsense domain knowledge, inductive learning, and deep learning, to address decision-making (e.g., planning) problems on a robot. \end{enumerate} Our architecture opens up multiple directions of future work, which will address the limitations of existing work and significantly extend the architecture's capabilities. We discuss some of these extensions below: \begin{enumerate} \item The results reported in this paper are based on image datasets (simulated, real-world) chosen or constructed to mimic domains in which a large, labeled dataset is not readily available. One direction of future work is to explore the use of our architecture in other domains that provide datasets of increasing complexity, i.e., with a greater number of features and more complex explanatory questions. This exploration may require us to consider larger datasets, and to examine the trade-off between the size of the training dataset, the computational effort involved in processing such a dataset with many labeled examples, and the effort involved in encoding and reasoning with the relevant domain knowledge. \item In our architecture, we have so far used variants of existing network structures as the deep network components (i.e., CNN, RNN). In the future, we will explore different deep network structures in our architecture, using the explanatory answers to further understand the internal representation of these network structures. Towards this objective, it would be particularly instructive to construct and explore deep networks and logic-based domain representations that provide similar behavior on a set of tasks, or provide different behavior when operating on the same dataset. As stated in the discussion in Section~\ref{sec:expresults-classify-vqa}, such an exploration may help us better understand (and improve) the design and use of deep network models for different applications. \item This paper used VQA as a motivating problem to address key challenges in using deep networks in dynamic domains with limited labeled training examples. We also described the use of our architecture (with tightly-coupled reasoning and learning components) for planning on a simulated robot. In the future, we will combine this architecture with other architectures we have developed for knowledge representation, reasoning, and interactive learning in robotics~\cite{mohan:ACS18,mohan:JAIR19}. The long-term goal will be to support explainable reasoning and learning on a physical robot collaborating with humans in complex domains. \end{enumerate} \section*{Acknowledgments} The authors thank Ales Leonardis for feedback on the architecture described in this paper. \section*{Data Availability Statement} The datasets generated or analyzed for this study, and the software implementation of the architecture and algorithms, can be found in the following online repository: \url{https://github.com/hril230/masters_code} \bibliographystyle{plain}
\section{Introduction} Any main-sequence star below $\approx$ 8$M_{\odot}$~will end its life by expelling the majority of its outer envelope and leaving behind a dense, degenerate core, known as a white dwarf \citep{althaus2010}. Due to their large surface gravities (abbreviated as the logarithm of surface gravity, $\log{g}$), compositionally these stellar remnants are well-stratified, with the heavier material sinking into the core and the outer layers being composed of the lightest chemical elements present \citep{schatzman48}. In magnitude-limited samples around 80\% of all white dwarfs have hydrogen-dominated atmospheres and 20\% have helium-dominated atmospheres \citep{kleinman13,kepler15}. White dwarfs are unable to fuse matter in their degenerate cores and thus evolve simply by cooling. As they cool, superficial convection zones develop in their envelopes and grow bigger with decreasing effective temperature, $T_{\rm{eff}}$~\citep{tassoul1990}. This means that both the structure and evolutionary models of white dwarfs can be affected by uncertainties arising from the treatment of convective energy transport. Until recently, the standard white dwarf models used for the atmosphere and the interior have been 1D, where convection is treated using the ML2 version \citep{tassoul1990} of the mixing length theory, MLT \citep{bohm1958}. The formulation of this theory assumes same-sized, large convective eddies travelling a distance, $d$, which is known as the mixing length, before dissipating into the surroundings by releasing (or absorbing) their excess (or deficient) energy. The distance travelled depends on a free parameter called the mixing length parameter, $\alpha$ (or ML2/$\alpha$~to indicate the use of ML2 version of MLT for white dwarfs), such that \begin{equation} d = \alpha H_{\rm{p}}~, \end{equation} where $H_{\rm{p}}$ is the pressure scale height. This free parameter is not given by the MLT and instead must be calibrated from observations, which is a significant shortcoming of the theory as the particular value of the parameter can have a significant effect on the modelled structures (see examples for both evolutionary and atmospheric models: \citealt{shipman1979,winget1982,winget1983,fontaine1984,tassoul1990,Thejll1991,bergeron1992,koester1994,bergeron1995,wesemael1999,corsico2016}), especially when convection becomes superadiabatic \citep{tremblay2015,sonoi_mlt_evolution}. As an improvement, another 1D theory of convection, CMT \citep{canuto1991,canuto1992} and its refined version CGM \citep{canuto1996}, have also been used in modelling white dwarf evolution \citep{althaus1996,althaus1997,Benvenuto1999}. Unlike MLT, CMT does not rely on the approximation of single-sized convective eddies and instead considers a full range of eddy sizes. Unfortunately, similarly to MLT, CMT depends on the local conditions of the atmosphere \citep{ludwig1999}, which is a restrictive approximation as convection is a non-local process. This assumption was subsequently removed in non-local 1D envelope models of white dwarfs \citep{montgomery2004}. Given that convection is inherently a 3D process, the dimensionality issue was first improved by 2D atmospheric models of DA white dwarfs developed by \cite{ludwig1993}, \cite{ludwig_1994_op_binning} and \cite{freytag1996}. More recently, the first 3D models for pure-hydrogen atmosphere (DA) \citep{tremblay_2013_3dmodels,tremblay_2013_granulation,tremblay_2013_spectra,kupka2018} and pure-helium atmosphere (DB) \citep{myprecious} white dwarfs have been developed. In 3D models convection is non-local, is treated from first principles and the models do not depend on any free parameters, although numerical parameters do exist. Spectroscopic corrections derived from 3D models have been tested against \textit{Gaia} DR2 data \citep{gaia2018} by comparing the observed parallaxes for samples of DA and DB/DBA white dwarfs with spectroscopically-derived parallaxes with and without 3D corrections \citep{tremblay2019}. 3D DA corrections were shown to be in excellent agreement with the data. For the DB/DBA samples, the 3D DB corrections were not a clear improvement upon predicted 1D parallaxes. Given that the 3D corrections were for DB white dwarfs only and the samples contained a large fraction of DBA stars, it was concluded that 3D DBA spectroscopic corrections, as well as a re-evaluation of the line broadening parameters \citep{gb2019}, are needed to proceed. This will be the subject of a future study. In this paper, we instead focus on ML2/$\alpha$~calibration at the bottom of the convection zone for 3D DB and DBA models, similar to what has been achieved for 3D DA models \citep{tremblay2015}. We use a new grid of 3D DBA models consisting of 235 simulations alongside the recently published grid of 47 3D DB models. Our calibration of ML2/$\alpha$~is relevant for the overall thermal and mixing properties of the convection zone. It differs in purpose to the ML2/$\alpha$~calibration based on a detailed spectroscopic analysis performed by \cite{bergeron_db_2011}. This is because the spectral light forming layers for DB and DBA stars are always near or above the top of the convection zone. Additionally, due to the dynamic nature of convection, the mixing length parameter varies throughout the white dwarf structure \citep{ludwig_1994_op_binning,tremblay2015}. Therefore, no single 1D synthetic spectrum at a given ML2/$\alpha$~value can reproduce the entirety of a 3D spectrum \citep{myprecious}. Our calibration is of relevance to many applications. First of all, it is not currently possible to compute 3D evolutionary models of any star. Instead, 1D stellar evolution models have been improved by calibrating the mixing length parameter based on 3D atmospheric models and allowing it to vary accordingly as the star evolves \citep{trampedach_mlt_evolution, magic2015, salaris_mlt_evolution, mosumgaard_mlt_evolution, sonoi_mlt_evolution}. Such calibration has already been performed for DA white dwarfs \citep{tremblay2015}, but has not been done for DB and DBA stars. The position of the theoretical blue edge of the instability strip for V777 Her (DBV) white dwarfs is heavily dependent on the assumed convective efficiency at the bottom of the convection zone \citep{fontaine2008,corsico2009,vangrootel2017}. Larger ML2/$\alpha$~values result in larger $T_{\rm{eff}}$~of the blue edge. The current empirical blue edge of the strip is defined by PG0112+104 at $T_{\rm{eff}}$~$\approx$~31\,000~K (at $\log{g}$~$\approx$~7.8) \citep{shipman2002,provencal2003,hermes2017}, approximately 2\,000~K higher than the current theoretical blue edge of $T_{\rm{eff}}$~$\approx$~29\,000~K (at $\log{g}$~$\approx$~7.8) calculated at the spectroscopically-calibrated ML2/$\alpha$~$=1.25$ \citep{vangrootel2017}. This suggests that higher convective efficiency is needed to correctly model the empirical blue edge. ML2/$\alpha$~calibration at the bottom of the convection zone can also provide more accurate convection zone sizes for DB and DBA white dwarfs. This is needed in order to understand the accretion of planetesimals onto white dwarfs, including the mixing of the different accreted chemical elements within the convection zone and their diffusion at its bottom (or floating in the case of hydrogen). These events are frequent around DB and DBA white dwarfs \citep{kleinman13, veras16} and could explain the origin of hydrogen in DBA stars \citep{gentilefusillo2017}. However, for a full 3D description of the accretion-diffusion scenario, convective overshoot must also be accounted for \citep{kupka2018,cunningham2019}, which is outside the scope of the current work. In Sect.~\ref{sec:num} we present the grids of 3D DB and DBA atmospheric models and 1D envelope structures used for the calibration of the ML2/$\alpha$~parameter. Sect.~\ref{sec:conv} describes the general properties of the 3D convection zones and the differences to 1D convection zones. The calibration method is described in Sect.~\ref{sec:cal} and results are discussed in Sect.~\ref{sec:disc}. We conclude in Sect.~\ref{sec:sum}. \newpage \section{Numerical setup}~\label{sec:num} \subsection{3D atmospheric models} Using the CO$^5$BOLD~radiation-hydrodynamics code \citep{freytag2002_co,wedemeyer2004_co,freytag2012_cobold,freytag2013,freytag2017}, we have calculated 285 3D DB and DBA models with 12\,000~K~$\lesssim$~$T_{\rm{eff}}$~$\lesssim$~34\,000~K, 7.5~$\leq$~$\log{g}$~$\leq$~9.0 and $-10.0\leq$~$\log{\rm{(H/He)}}$~$\leq-2.0$, where $\log{\rm{(H/He)}}$~is the logarithm of the ratio of the number of hydrogen-to-helium atoms in the atmosphere. Fig.~\ref{fig:models} illustrates the atmospheric parameter values of our 3D simulations. Appendix~\ref{ap:tables} in the Supplementary Material also lists basic information about the 3D models, including their atmospheric parameters, simulation box sizes, running times and intensity contrasts. For DB models we use $\log{\rm{(H/He)}}$~$=-10.0$ as this low hydrogen abundance practically describes a pure-helium composition. The abundance range chosen covers the majority of observed hydrogen abundances in DB/DBA samples \citep{bergeron_db_2011,koester_kepler_2015,rolland2018}. For all abundances, $\log{g}$~=~7.5 models only extend up to 32\,000~K due to convective energy transport being negligible at higher $T_{\rm{eff}}$~for this particular $\log{g}$. Currently, there are no known low-mass helium-dominated atmosphere white dwarfs, which would be formed as a consequence of binary evolution~\citep{tremblay2019,gb2019}. Therefore, we do not calculate models with $\log{g}$~$<7.5$. \begin{figure*} \includegraphics[width=1.5\columnwidth]{models.pdf} \caption{The abundances, surface gravities and effective temperatures of the 3D models presented in this paper. Open and filled circles denote the models with open and closed bottom boundaries, respectively.} \label{fig:models} \end{figure*} The 3D DB simulations have already been presented in \cite{myprecious}. The same numerical setup was used to calculate 3D DBA models but with equations of state (EOS) and opacity tables appropriate for the given hydrogen abundance. More detail on the numerical setup can therefore be found in \cite{myprecious}. In summary, each model is computed using the box-in-a-star CO$^5$BOLD~setup \citep{freytag2012_cobold}, where a portion of the atmosphere is modelled in a Cartesian 3D box of typical size 150 $\times$ 150 $\times$ 150 ($x \times y \times z$) grid points with $z$ being the geometric height pointing towards the exterior of the white dwarf. Each simulation has periodic side boundaries. The top boundary is always open to material and radiative flows, whereas the bottom boundary can be open or closed to convective flows. For most of our models the convection zone sizes are vertically too large to be simulated. In this case the open bottom boundary is used. As the effective temperature increases, the convection zone shrinks until its vertical size becomes small enough to fit within the simulation box. For these models we use closed bottom boundary where the vertical velocity is forced to go to zero at the boundary. For all simulations the top boundary is located at $\log{\tau_{\rm{R}}}$~$\lesssim -5.0$, where $\log{\tau_{\rm{R}}}$~is the logarithm of the Rosseland optical depth. The bottom boundaries are around $\log{\tau_{\rm{R}}}$~$=3.0$, however, some closed bottom simulations had to be extended deeper to justify the enforcement of zero vertical velocity. In most extreme cases, the models had to be vertically extended to 230 grids points, increasing $\log{\tau_{\rm{R}}}$~to around 4. For a given model the input parameters are an equation of state, an opacity table, $\log{g}$~and a parameter that controls the $T_{\rm{eff}}$~of the model. The $T_{\rm{eff}}$~value is recovered after the simulation is run from the spatially and temporally averaged emergent flux. In the case of open bottom models, the entropy of the inflowing material at the bottom boundary controls the $T_{\rm{eff}}$. For closed bottom models, the controlling parameter is the radiative flux specified at the bottom. For all abundances we use opacity tables with 10 bins with boundaries at $\log{\tau_{\rm{R}}}$~$=$~[99.0, 0.25, 0.0, $-$0.25, $-$0.5, $-$1.0, $-$1.5, $-$2.0, $-$3.0, $-$4.0, $-$5.0] based on reference 1D models. We rely on the binning technique as outlined in \cite{nordlund_1982_opac_binning}, \cite{ludwig_1994_op_binning}, \cite{vogler_2004_op_binning} and \cite{myprecious}. We do not include the far-UV opacities assigned to the~[$-$5.0, $-$99.0] bin due to interpolation issues as was the case for 3D DB simulations \citep{myprecious}. The opacity tables and EOS are based on the 1D models of \cite{bergeron_db_2011}, which include the Stark profiles of neutral helium from \cite{beauchamp_stark_profiles_1997} and the free-free absorption coefficient of negative helium ions from \cite{john_neg_ab_coeff_neg_he_ion_1994}. For DBA models the Stark broadening of \cite{tremblay_stark_2009} is used for hydrogen lines. The 3D models are spatially- and temporally-averaged in order to extract the relevant atmospheric stratifications, i.e. entropy, temperature, pressure and convective flux as functions of $\log{\tau_{\rm{R}}}$. The spatial average is performed over constant geometric height, unlike in \cite{myprecious} where the spatial average was done over contours of constant $\log{\tau_{\rm{R}}}$. The temporal average is performed over the last quarter of the simulation, i.e. the last quarter of the total run time given in Tabs.~\ref{tab:3d_models10}-\ref{tab:3d_models2}. We confirm that our models are relaxed by monitoring the total flux at all depths and the convergence of the velocity field \citep{myprecious}. Relaxation usually occurs in the first half of the simulation, as we start from a simulation that is already close to the final solution. \subsection{1D envelope models}~\label{sec:oneDmodels} In order to find a mixing length value that best matches the nature of 3D convection zones, we use the updated 1D DB and DBA envelope models of \cite{vangrootel2017} and \cite{fontaine2001}, which span the same parameter range as our 3D atmospheric models but also different values of ML2/$\alpha$, namely 0.4~$\leq$~ML2/$\alpha$~$\leq$~1.4 in steps of 0.1. The envelopes rely on non-grey upper boundary conditions extracted from the atmospheric models of \cite{bergeron_db_2011}, and on the non-ideal EOS of \cite{saumon1995}. Turbulent pressure is not included in the envelope structures. For the majority of 3D models the inflowing entropy at the base of the convection zone (the input parameter for open bottom models which controls $T_{\rm{eff}}$~of the model) is used for ML2/$\alpha$~calibration. In order to have a common entropy zero-point between the 1D envelopes and 3D atmospheres, we re-calculate the 1D entropy from temperature and pressure at the base of the 1D envelope convection zone. The entropy is re-calculated with and without partial degeneracy to demonstrate the degeneracy effects. Fig.~\ref{fig:s_teff} shows entropy as a function of $T_{\rm{eff}}$~for selected models. At high $T_{\rm{eff}}$~the partial degeneracy is negligible as the chemical potential of free electrons has a large negative value. Partial degeneracy becomes important for cool $T_{\rm{eff}}$~models due to their low temperatures and high densities. For the $\log{\rm{(H/He)}}$~$=-10.0$ grid, our first-order partial degeneracy correction begins to break down for the lowest $T_{\rm{eff}}$~models not plotted in Fig.~\ref{fig:s_teff}, namely $T_{\rm{eff}}$~$ \lesssim 14\,000$, $14\,000$, $16\,000$, $18\,000$ K for $\log{g}$~$=7.5$, 8.0, 8.5, 9.0 models, respectively. Similar behaviour is observed for the DBA grid. Below these $T_{\rm{eff}}$~convection in envelopes is almost fully adiabatic everywhere and becomes independent of the particular choice of ML2/$\alpha$. Therefore, we do not attempt calibration of ML2/$\alpha$~in that particular $T_{\rm{eff}}$~regime (see Sect.~\ref{sec:cal}). We find that partial degeneracy is more important for low $T_{\rm{eff}}$~DB/DBA models than low $T_{\rm{eff}}$~DA models (see Fig. 1 of \citealt{tremblay2015}) possibly due to the higher densities of DB models. \begin{figure*} \includegraphics[width=1.5\columnwidth]{s_teff.pdf} \caption{The entropy at the bottom of the convection zone defined by the Schwarzschild~criterion as a function of $T_{\rm{eff}}$~for 3D DB open (open circles) and closed (filled circles) bottom models, and for 1D DB envelopes with different values of the mixing length parameter. The ML2/$\alpha$~value decreases by increments of 0.1 from the dark blue line (ML2/$\alpha$~$=1.4$) all the way up to the dark purple line (ML2/$\alpha$~$=~0.4$). We show the 1D entropies with (solid lines) and without (dashed lines) partial degeneracy effects taken into account. The $\log{g}$~values of the models are indicated on the panels.} \label{fig:s_teff} \end{figure*} From 1D envelopes we also extract the ratio $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$, where $M_{\rm{CVZ}}$ is the mass of the convection zone integrated from the surface of the white dwarf to the bottom of the convection zone and $M_{\rm{tot}}$ is the total mass of the white dwarf. An example of this is shown in Fig.~\ref{fig:q_teff}. As expected, varying the value of the ML2/$\alpha$~parameter for models where superadiabatic convection is important has a significant effect on the mass of the convection zone. The change can be as much as $\approx 4$ dex for $\log{g}$~=~7.5 DB and DBA models and $\approx 3$ dex for $\log{g}$~=~9.0 models. By calibrating ML2/$\alpha$~with our 3D models (see Sect.~\ref{sec:cal}) we can narrow down the uncertainty on the mixed mass within the convection zone. \begin{figure*} \includegraphics[width=1.5\columnwidth]{q_teff.pdf} \caption{The fraction of the convection zone mass to the total mass of the white dwarf as a function of $T_{\rm{eff}}$~for 3D DB models and 1D DB envelopes (solid lines) with different values of the mixing length parameter. The ML2/$\alpha$~value decreases by increments of 0.1 from the dark blue line (ML2/$\alpha$~$=1.4$) all the way up to the dark purple line (ML2/$\alpha$~$=0.4$). The Schwarzschild~boundaries for the 3D open bottom models are indicated by open circles; filled circles represent the Schwarzschild boundary for closed bottom 3D models; open squares represent the flux boundary for closed bottom 3D models.} \label{fig:q_teff} \end{figure*} The convection zone size increases with decreasing $\log{g}$~and decreasing $T_{\rm{eff}}$~\citep{fontaine1976}. Shallower convection zones are expected for DBA models as the presence of hydrogen increases the total opacity, decreasing the atmospheric density and pressure \citep{fontaine1976}. This is also seen for late-type stars with increased metallicity \citep{magic2013}. The decrease in density and pressure results in higher adiabatic entropy (see Sec.~\ref{sec:conv}), and therefore lower convective efficiency (and entropy jump, see Sec.~\ref{sec:sjump}) and smaller convection zones \citep{magic2013}. Fig.~\ref{fig:q_teff_y-2} shows $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$~for the $\log{\rm{(H/He)}}$~$=-2.0$ grid. By comparing Figs.~\ref{fig:q_teff} and~\ref{fig:q_teff_y-2} it is clear that the presence of hydrogen does indeed shrink the convection zones. \begin{figure*} \includegraphics[width=1.5\columnwidth]{q_teff_y-2.pdf} \caption{Same as Fig.~\ref{fig:q_teff}, but for a DBA grid with $\log{\rm{(H/He)}}$~$= -2.0$.} \label{fig:q_teff_y-2} \end{figure*} \section{The convection zone}~\label{sec:conv} The envelopes of cool DA and DB white dwarfs are convective, with the top of the convection zone almost perfectly overlapping with the photospheric layers \citep{tassoul1990}, meaning that convection is essential for modelling both atmospheres and envelopes of cool white dwarfs. In 1D atmospheric and envelope models the convective layers are defined by the Schwarzschild~criterion \begin{equation} \left(\frac{\partial \ln{T}}{\partial \ln{P}} \right)_{\rm{radiative}} > \left(\frac{\partial \ln{T}}{\partial \ln{P}} \right)_{\rm{adiabatic}}, \end{equation} where $T$ and $P$ are the temperature and pressure. Therefore, only those layers that locally satisfy this inequality are able to transport energy through convection, leading to abrupt and clearly-defined boundaries of the convection zone in 1D. This is a limited approximation of the turbulent nature of convection, which is better explored with the use of 3D models. There are at least two ways one can define convection zone boundaries and subsequently convection zone sizes in 3D simulations. In the following we use the Schwarzschild~criterion (the Schwarzschild~boundary) and the zero convective flux (the flux boundary) definitions. The Schwarzschild~criterion can be rewritten in terms of the entropy gradient with respect to $\log{\tau_{\rm{R}}}$, such that the convective layers are defined by \begin{equation} \frac{\rm{d} \textit{s}}{\rm{d} \tau_{\rm{R}}} > 0~, \end{equation} where $s$ is the entropy. We use this definition to determine the edges of the convection zone in both 1D and $\langle$3D$\rangle$~entropy stratifications, focusing on the bottom boundary, defining it to be the Schwarzschild~boundary. Unlike in the 1D case, the 3D convective energy is transported even beyond the Schwarzschild~boundary. This is due to the acceleration of the overdense convective downdrafts in the layers just above the base of the convection zone. In response, because of mass conservation warm material is transported upwards, resulting in a positive convective flux \citep{tremblay2015}. We define the flux boundary to be the region where the ratio of convective-to-total flux goes to zero. The convective flux, $F_{\rm{conv}}$, is calculated using \begin{equation} \label{eq:fconv} F_{\rm{conv}} = \left \langle \left( e_{\rm{int}} + \frac{P}{\rho} \right) \rho u_z \right\rangle + \left \langle \frac{\mathbf{u}^2}{2} \rho u_z\right \rangle - e_{\rm{tot}} \langle \rho u_z \rangle, \end{equation} where $e_{\rm{int}}$ is the internal energy per gram, $\rho$ is the density, $u_z$ is the vertical velocity, $\mathbf{u}$ is the velocity vector and $e_{\rm{tot}}$ is the total energy, defined as \begin{equation} e_{\rm{tot}} = \frac{ \langle \rho e_{\rm{int}} + P + \rho \frac{\mathbf{u}^2 }{2} \rangle }{\langle \rho \rangle}. \end{equation} The first term of Eq.~\ref{eq:fconv} is the enthalpy flux, the second term is the kinetic energy flux and the third term is the mass flux weighted energy flux, which is subtracted in order to correct for any non-zero mass flux arising in the numerical simulations. This definition is identical to the one used in \cite{tremblay2015}. Some authors, for instance \cite{cattaneo1991} and \cite{canuto2007}, have referred to the sum of enthalpy and kinetic energy flux as "convected" flux. In general, convective flux is a synonym for enthalpy flux only. By adding kinetic energy flux, the "convective flux" boundary is moved closer to the Schwarzschild~boundary, as kinetic energy is always negative for simulations presented here, which have standard granulation topology of slow and broad upflows surrounded by fast and narrow downflows. Therefore, ML2/$\alpha$~values calibrated based on the enthalpy and kinetic flux boundary will be smaller than the calibrated values based on enthalpy flux alone \citep{kupka2018,tremblay2015}. As shown by \cite{kupka2018} the boundary associated with the enthalpy flux indicates where downflows become hotter than their surroundings, which is related to buoyancy, the driving mechanism of convection. Therefore, the definition of convective flux based on enthalpy flux would be crucial in studies of downflows. However, for consistency with previous work of \cite{tremblay2015} we use the definition of "convective" flux as defined in Eq.~\ref{eq:fconv}. In MLT, convective flux refers to enthalpy flux only, as kinetic flux is zero everywhere. \begin{figure} \includegraphics[width=\columnwidth]{closed_bottom_s.pdf} \caption{Entropy stratifications of two 3D closed bottom models with $\log{g}$~$= 8.0$ and $\log{\rm{(H/He)}}$~$=-10.0$ are shown as solid blue lines. The dashed black lines indicate the flux-forming region for wavelengths 3500~\AA~to 7200~\AA, representing the atmosphere of the white dwarf in terms of visible light. 1D models calculated at calibrated ML2/$\alpha_{\rm{S}}$~are shown as dashed red lines. According to the Schwarzschild~criterion, at $T_{\rm{eff}}$~$\approx$ 28\,000~K there are two convectively unstable regions due to He~I and He~II ionization. The top and bottom of the first convective region is denoted by right- and left-pointing triangles, respectively. The second convective region is indicated by upward- and downward-pointing triangles. The two convective regions are separated by a small region which is convectively stable in terms of the Schwarzschild~criterion. At $T_{\rm{eff}}$~$\approx$ 34\,000 K, according to the Schwarzschild~criterion there is only one convective region (He~II) left, which is denoted by the upward- and downward-pointing triangles.} \label{fig:closed_bottom_s} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{closed_bottom_hcon.pdf} \caption{The ratio of the convective-to-total flux as a function of the $\log{\tau_{\rm{R}}}$~for two 3D closed bottom $\log{g}$~$=8.0$, $\log{\rm{(H/He)}}$~$=-10.0$ models is shown in solid blue. The upward- and downward-pointing triangles denote the top and bottom flux boundaries of the convection zone, respectively. The dashed black lines represent the flux-forming region for wavelengths 3500~\AA~to 7200~\AA. Red dashed lines show the 1D models calculated at calibrated ML2/$\alpha_{\rm{f}}$, and green dotted lines show 1D models calculated at ML2/$\alpha_{\rm{F_{\rm{max}}}}$~(see Sect.~\ref{sec:fmax}). Unlike the Schwarzschild~boundary, at $T_{\rm{eff}}$~$\approx$ 28\,000~K the two convectively-unstable regions are inseparable in terms of the flux due to the dynamics of the downdrafts. Beyond the flux boundary, a region of negative flux related to convective overshoot is observed.} \label{fig:closed_bottom_hcon} \end{figure} Figs.~\ref{fig:closed_bottom_s} and~\ref{fig:closed_bottom_hcon} demonstrate the Schwarzschild~and flux boundaries, respectively. In the case of helium-dominated atmosphere white dwarfs, at higher $T_{\rm{eff}}$~there are two convectively-unstable regions related to He~I and He~II ionization. These zones can either be separated by a convectively stable region or merge into one convection zone depending on the $T_{\rm{eff}}$. This can also happen for a model at the same $T_{\rm{eff}}$, but for different definitions of the convection zone as shown in Figs.~\ref{fig:closed_bottom_s} and~\ref{fig:closed_bottom_hcon}, where the model at $T_{\rm{eff}}$~$\approx$~28\,000 K has two clearly defined and separated convectively-unstable regions in terms of the Schwarzschild~criterion, yet in terms of the flux criterion the two helium zones are indistinguishable, since the flux boundary penetrates deeper. At the highest $T_{\rm{eff}}$~only the He~II convection zone remains as He~I is fully ionised. In Fig.~\ref{fig:closed_bottom_hcon} we see a region beyond the flux boundary where the ratio of convective-to-total flux becomes negative. This is the convective overshoot region, where the negative convective flux is due to the convective downflow plumes being warmer than the surroundings \citep{zahn1991,tremblay2015}. There is no equivalent region in 1D models and therefore we do not attempt to calibrate the mixing length in any form to describe this region. However, overshoot is important for convective mixing studies. For DA white dwarfs it has been shown that more material can be mixed in the convection zone even beyond the negative flux region (the velocity overshoot region), impacting the mass, abundances, and diffusion times of accreted metals \citep{freytag1996,koester2009,kupka2018,cunningham2019}. This is still unexplored for helium-rich atmospheres. \section{The calibration method}~\label{sec:cal} \subsection{Closed bottom models}~\label{sec:closed} For the closed bottom 3D models (examples shown in Figs.~\ref{fig:closed_bottom_s} and~\ref{fig:closed_bottom_hcon}) both the Schwarzschild and flux boundaries can be directly probed and the $\langle$3D$\rangle$~temperature and pressure values at the two boundaries can be extracted. Similarly, from 1D envelope structures we also have access to the temperature and pressure at the bottom of the 1D Schwarzschild~boundary. These quantities are displayed in Figs.~\ref{fig:t_closed} and \ref{fig:p_closed}. For each 3D model with given atmospheric parameters, we interpolate over 1D envelopes with the same atmospheric parameters but varying values of ML2/$\alpha$, in order to find the ML2/$\alpha$~value that gives the same temperature and pressure at the base of either Schwarzschild~or flux boundary of the 3D convection zone. We refer to these calibrated ML2/$\alpha$~values as ML2/$\alpha_{\rm{S}}$~and ML2/$\alpha_{\rm{f}}$~for Schwarzschild~and flux boundaries, respectively. The calibrated ML2/$\alpha$~parameters between temperature and pressure generally agree within $\approx 0.05$ even in the most extreme cases such as $\log{g}$~=~9.0 shown in Figs.~\ref{fig:t_closed} and \ref{fig:p_closed}. Therefore, we take an average of the two ML2/$\alpha$~values. This gives us an indication of the average temperature gradient in the vicinity of the base of the convection zone. \begin{figure*} \includegraphics[width=1.5\columnwidth]{t_closed.pdf} \caption{The logarithm of the temperature at the base of the convection zone as a function of $T_{\rm{eff}}$~for DB white dwarfs. The solid lines are 1D envelope temperatures at the Schwarzschild~boundary for varying ML2/$\alpha$~values. The ML2/$\alpha$~value decreases by increments of 0.1 from the dark blue line (ML2/$\alpha$~$=1.4$) all the way down to the dark purple line (ML2/$\alpha$~$=0.4$). The solid circles represent the temperature of closed bottom 3D models at the Schwarzschild~boundary, the open squares are the temperatures of closed bottom 3D models at the flux boundary. The $\log{g}$~values are indicated on the plots.} \label{fig:t_closed} \end{figure*} \begin{figure*} \includegraphics[width=1.5\columnwidth]{p_closed.pdf} \caption{Similar to Fig.~\ref{fig:t_closed} but for pressure at the base of the convection zone.} \label{fig:p_closed} \end{figure*} A larger ML2/$\alpha$~value means that the convection zone extends deeper into the envelope and thus both the temperature and pressure are larger at the base. As $T_{\rm{eff}}$~increases for $\log{g}$~$=7.5$~and~8.0 models, the different ML2/$\alpha$~envelopes start to converge, yet we can still deduce that the calibrated ML2/$\alpha$~value in this $T_{\rm{eff}}$~range must be on the lower end of our ML2/$\alpha$~range, meaning that the convective efficiency is very low. The blue edge of the DBV instability strip is thought to be related to recombination of the main constituent of the atmosphere, which also causes convection to set in. Our 3D models indicate that a lower ML2/$\alpha$~value than 1.25 (the value used by \cite{vangrootel2017} to determine the theoretical blue edge) best represents the base of the convection zone both for Schwarzschild~and flux boundaries. In general, with the lowering of ML2/$\alpha$~value, convection will occur later in the white dwarf's evolution (i.e. at lower $T_{\rm{eff}}$). The theoretical location of the blue edge of the instability strip should therefore be at a lower $T_{\rm{eff}}$~than predicted by current studies. With closed bottom models we can also directly calculate $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$~for either convection zone boundary. In Figs.~\ref{fig:q_teff} and~\ref{fig:q_teff_y-2} we compare 3D $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$~to the predictions of 1D envelopes. Unlike the DA case \citep{tremblay2015} we do not find that mass-calibrated ML2/$\alpha$~values are similar to the temperature- and pressure-calibrated ML2/$\alpha$~values. As the mass is calculated independently of either temperature or pressure, a disagreement is not unexpected since 1D models cannot reproduce all of the dynamic quantities of 3D models. This is clearly shown in Figs.~\ref{fig:closed_bottom_s} and ~\ref{fig:closed_bottom_hcon}, where we plot $\langle$3D$\rangle$~structures and corresponding 1D atmospheric models of \cite{bergeron_db_2011} calculated at calibrated ML2/$\alpha_{\rm{S}}$~and ML2/$\alpha_{\rm{f}}$~values, respectively. As expected, the $\langle$3D$\rangle$~and 1D structures agree in the vicinity of either boundary, but the overall 1D and $\langle$3D$\rangle$~structures do not agree well. For all closed bottom models at $\log{g}$~$=$~$7.5$ and $8.0$, the masses included in the 3D convection zones diverge off the 1D envelope predictions, such that they are much smaller than what is possible to achieve in 1D within our range of ML2/$\alpha$~values. In Figs.~\ref{fig:q_teff} and~\ref{fig:q_teff_y-2} flux and Schwarzschild~boundary reversal is observed, just like in 3D DA models. As mentioned previously, the reversal is due to kinetic energy flux and if neglected it is not observed \citep{kupka2018,tremblay2015}. Such reversal does not occur in 1D models, as kinetic energy flux is not considered. For studies in need of the physical conditions near the base of the convection zone, the calibrations shown in Figs~\ref{fig:t_closed} and~\ref{fig:p_closed} and listed in Tabs.~\ref{tab:3d_db_modelsclosed10} to \ref{tab:3d_modelsclosed2} of Appendix~\ref{ap:tables} should be used. The masses listed in those tables are the 1D convection zone masses found from 1D envelopes calculated at 3D calibrated ML2/$\alpha$~values. For studies where such approximations are not adequate, the direct use of 3D structures would be more beneficial. \subsection{Open bottom models} For open bottom models we are unable to probe the bottom of the convection zone as our simulations are not deep enough. We can, however, exploit the fact that in 3D models a fraction of upflows from the bottom of the deep convection zone retain their adiabatic entropy almost all the way up to the observable atmospheric layers by not interacting with neighbouring downflows via heat exchange \citep{stein_nordlund1989}. This means that the spatially- and temporally-resolved entropy has a plateau corresponding to this adiabatic entropy value and it can be used to calibrate ML2/$\alpha$~\citep{steffen1993,ludwig1999}. Example entropy plateaus are shown in Fig.~\ref{fig:open_models_entropy} for $\log{\rm{(H/He)}}$~=~$-10.0$ and $\log{\rm{(H/He)}}$~$=-2.0$ models, where we also plot the temporally- and horizontally-averaged entropy stratifications. The averaged entropy is lower and does not reach the adiabatic entropy as it also considers the small entropy of the downflows. For CO$^5$BOLD~the adiabatic entropy value is the inflowing entropy input parameter and an entropy plateau is observed in all open bottom simulations. For each 3D model with given atmospheric parameters, we interpolate over the different ML2/$\alpha$~1D envelopes with the same atmospheric parameters to find the 1D entropy at the bottom of the Schwarzschild~boundary that best matches the 3D adiabatic entropy. We show this in Fig.~\ref{fig:s_teff}. The entropy of closed bottom models is also shown, but for these models we do not use the entropy to calibrate. This is because we have already calibrated ML2/$\alpha$~directly in Sec.~\ref{sec:closed} and generally for closed bottom models the upflows are not adiabatic in any portion of the convection zone. \begin{figure*} \centering \begin{subfigure}[b]{\columnwidth} \includegraphics[width=\columnwidth]{d3t200g80db02_f.eps} \end{subfigure} ~ \begin{subfigure}[b]{\columnwidth} \includegraphics[width=\columnwidth]{d3t200g80he-2_f.eps} \end{subfigure} \begin{subfigure}[b]{\columnwidth} \includegraphics[width=\columnwidth]{d3t260g80db02_f.eps} \end{subfigure} ~ \begin{subfigure}[b]{\columnwidth} \includegraphics[width=\columnwidth]{d3t260g80he-2_f.eps} \end{subfigure} \caption{The spatially- and temporally- resolved entropy of $\log{g}$~$=8.0$ 3D open bottom models. The top two plots show the entropy stratification when only the He~I convection is present, whereas the bottom two panels show models with both He~I and He~II convection zones. In green we plot the averaged entropy over constant geometric depth and time. Although the average entropy does not reach the adiabatic value near the bottom of the simulation, it is clear that the spatially- and temporally- resolved entropy has a plateau at deeper layers, which corresponds to the inflowing entropy, an input parameter of our 3D models.}\label{fig:open_models_entropy} \end{figure*} The adiabatic entropy value is for the 3D Schwarzschild boundary only. We cannot access the flux boundary for open bottom models. Instead, we use the results from closed bottom models to estimate the ML2/$\alpha$~value that best represents the flux boundary for open bottom models. For closed bottom models that do not show the flux and Schwarzschild~boundary reversal we find the relation ML2/$\alpha_{\rm{f}}$ $= 1.17$ ML2/$\alpha_{\rm{S}}$~with a standard deviation of around 3\%. A similar result of ML2/$\alpha_{\rm{f}}$ $= 1.16$ ML2/$\alpha_{\rm{S}}$~with a standard deviation of around 3\% was found for 3D DA models \citep{tremblay2015}. In Figs.~\ref{fig:q_teff} and~\ref{fig:q_teff_y-2} we show the $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$~value for both open and closed bottom models with $\log{\rm{(H/He)}}$~$=-10.0$ and $-2.0$, respectively. Unlike the closed bottom case, we cannot directly access the bottom of either convection zone boundary for open bottom models. Thus, the masses for open bottom 3D models are extracted from the 1D envelopes with ML2/$\alpha$~value that best matches the 3D adiabatic entropy. As mentioned earlier and shown in Fig.~\ref{fig:s_teff}, at the lowest $T_{\rm{eff}}$~the different ML2/$\alpha$~value envelopes converge to the same solution as convection becomes adiabatic and insensitive to ML2/$\alpha$~even in the upper atmosphere. In these cases, the derived mass fraction does not change significantly between the different values of the ML2/$\alpha$~parameter. Therefore, we propose not to interpolate for the best matching mixing length parameter, but to set it to 1.0 for both Schwarzschild and flux boundaries. \section{Discussion}~\label{sec:disc} The calibrated ML2/$\alpha$~values are shown in Figs.~\ref{fig:ml2_alpha_teff_s} and~\ref{fig:ml2_alpha_teff_f} for the Schwarzschild~and flux boundaries, respectively, and in the Appendix~\ref{ap:tables} of the Supplementary Material. In all cases, ML2/$\alpha$~values are smaller than what is often used in evolutionary models, i.e. ML2/$\alpha$~$=1.25$. This means that 3D models predict lower convective efficiencies. Given that the value of 1.25 is based on matching observed and model spectra and therefore describes the convective efficiency in the photosphere, it is not unexpected that it is different to the convective efficiency at the bottom of the convection zone. Interestingly, the mean convective efficiency for DB/DBA white dwarfs is very similar, or only slightly larger, to that of DA stars \citep{tremblay2015}. The plateaus observed at low $T_{\rm{eff}}$~are artificial. They are the consequence of fixing the value of ML2/$\alpha_{\rm{S}}$~$=$~ML2/$\alpha_{\rm{f}}$$=1.0$ for $T_{\rm{eff}}$~where the structures become insensitive to the ML2/$\alpha$~parameter. A similar effect can be observed at the highest $T_{\rm{eff}}$, where the calibration is forced to values of 0.65 for both ML2/$\alpha_{\rm{S}}$~and ML2/$\alpha_{\rm{f}}$, as none of the 1D ML2/$\alpha$~values can reproduce the boundaries of the 3D convection zone. Since the convective zone is in any case very small and inefficient in this regime, the fixed value may not be a concern for some applications. If on the other hand detailed convective properties are required, it is more appropriate to directly use 3D models which also include velocity overshoot (see Sect.~\ref{sec:v}). \begin{figure*} \includegraphics[width=1.5\columnwidth]{ml2_alpha_teff_s.pdf} \caption{The calibrated mixing length parameter based on the Schwarzschild boundary is plotted as solid colour points which are connected for clarity for the same surface gravity. The value of $\log{\rm{(H/He)}}$~is indicated on each panel.} \label{fig:ml2_alpha_teff_s} \end{figure*} \begin{figure*} \includegraphics[width=1.5\columnwidth]{ml2_alpha_teff_f.pdf} \caption{Same as Fig.~\ref{fig:ml2_alpha_teff_s} but for the flux boundary.} \label{fig:ml2_alpha_teff_f} \end{figure*} The peaks observed in Figs.~\ref{fig:ml2_alpha_teff_s} and~\ref{fig:ml2_alpha_teff_f} which seem to shift to higher $T_{\rm{eff}}$~for higher $\log{g}$, are associated with the knee-like feature of the 1D envelopes seen in Figs.~\ref{fig:s_teff}, \ref{fig:q_teff} and \ref{fig:q_teff_y-2}, which we suggest is related to the disappearance of the He~II convection zone as the white dwarf evolves to lower $T_{\rm{eff}}$. This transition is different in 3D, potentially because of the non-local coupling of the two convection zones. The knee-feature also means that ML2/$\alpha$~calibration is more sensitive in that region. \subsection{Calibration of the entropy jump}~\label{sec:sjump} Studies such as \cite{magic2015} have also performed ML2/$\alpha$~calibrations for solar-like stars based on the entropy jump associated with superadiabatic convection. Examples of such entropy jumps can be seen in Figs.~\ref{fig:closed_bottom_s} and~\ref{fig:open_models_entropy} for closed and open bottom models, respectively. In their calibration, \cite{magic2015} define the jump as the difference between the constant entropy value of the adiabatic convection zone and the entropy minimum for both 1D and 3D models. We use a similar method to investigate more clearly the variations of ML2/$\alpha$~as a function of $T_{\rm{eff}}$. To perform the calibration we do not use the evolutionary models presented in Sec.~\ref{sec:oneDmodels}. Instead, we use the 1D atmospheric models of \cite{bergeron_db_2011}. This grid of models spans the same range of atmospheric parameters as our 3D and 1D envelope grids, but also ML2/$\alpha$~values in the range $0.5 \leq$~ML2/$\alpha$~$\leq 1.5$ in steps of 0.25. We define the entropy jump, $s_{\rm{jump}}$, as \begin{equation} s_{\rm{jump}} = s(\log{\tau_{\rm{R}}} = 2) - s_{\rm{min}}, \end{equation} where $s(\log{\tau_{\rm{R}}} = 2)$ is the entropy at $\log{\tau_{\rm{R}}}$~$=2$ and $s_{\rm{min}}$ is the minimum entropy value. In the 3D case, the entropy stratification is temporally- and spatially-averaged, with the spatial average being performed over constant geometric height as before. We calculate $s_{\rm{jump}}$ both for the 3D atmospheric models, and for 1D atmospheric models calculated at different values of ML2/$\alpha$. We then find the value of ML2/$\alpha$, which we refer to as ML2/$\alpha_{\rm{s_{\rm{jump}}}}$, that best represents the given $\langle$3D$\rangle$~entropy jump. In late-type stars, the entropy jump was found to decrease for increasing values of ML2/$\alpha$~\citep{magic2015}. This is because as convection becomes more efficient, smaller temperature gradients in the superadiabatic layers are needed to transport the same flux \citep{sonoi_mlt_evolution}. This relation holds for DB and DBA 1D models where the entropy minimum is located at the top of the He~I convection zone (see Fig.~\ref{fig:open_models_entropy} for example). It breaks down when the He~I convection zone disappears or when the entropy minimum moves to the top of the He~II convection zone. This happens for the majority of 3D closed bottom models, and therefore we only perform ML2/$\alpha_{\rm{s_{\rm{jump}}}}$~calibration for 3D open bottom models. We show the ML2/$\alpha_{\rm{s_{\rm{jump}}}}$~values for DB white dwarfs in Fig.~\ref{fig:sjump}. Similar results were found for DBA white dwarfs. For all $\log{g}$~apart from 7.5, the peaks observed in ML2/$\alpha_{\rm{s_{\rm{jump}}}}$~are at the same $T_{\rm{eff}}$~as the peaks observed for ML2/$\alpha_{\rm{S}}$~and ML2/$\alpha_{\rm{f}}$. By looking at the structures directly, the peaks are clearly associated with the disappearance of the second-hump in the entropy profile due to He~II convection zone as the white dwarf cools to lower $T_{\rm{eff}}$. Examples of double peaked entropy profiles are shown in Fig.~\ref{fig:open_models_entropy}. \begin{figure} \includegraphics[width=\columnwidth]{sjump.pdf} \caption{The calibrated mixing length parameter based on the entropy jump for open bottom 3D DB models. The solid colour points represent the ML2/$\alpha_{\rm{s_{\rm{jump}}}}$~values and are connected based on their $\log{g}$~for clarity.} \label{fig:sjump} \end{figure} For atmospheric parameters where convection is sensitive to the ML2/$\alpha$~value (e.g. the calibrated value of ML2/$\alpha$~is not fixed in Figs.~\ref{fig:ml2_alpha_teff_s} and~\ref{fig:ml2_alpha_teff_f}), we find reasonable agreement between the ML2/$\alpha_{\rm{s_{\rm{jump}}}}$, ML2/$\alpha_{\rm{S}}$~and ML2/$\alpha_{\rm{f}}$~calibrations. \cite{magic2015} found that their ML2/$\alpha$~values based on the entropy jump were higher than the ML2/$\alpha$~values based on the adiabatic entropy (ML2/$\alpha_{\rm{S}}$). They attribute this to the 1D entropy minimum being lower than the $\langle$3D$\rangle$~entropy minimum, which is also the case for our lower $T_{\rm{eff}}$~models. This explains why at low $T_{\rm{eff}}$~we find ML2/$\alpha_{\rm{S}}$~and ML2/$\alpha_{\rm{f}}$~values that are larger than the value of ML2/$\alpha_{\rm{s_{\rm{jump}}}}$~(for example, $T_{\rm{eff}}$~$\lesssim 20\,000$ K for $\log{g}$~$=8.0$ DB models). From the studies of ML2/$\alpha_{\rm{s_{\rm{jump}}}}$, ML2/$\alpha_{\rm{S}}$~and ML2/$\alpha_{\rm{f}}$~it is apparent that the peaks in ML2/$\alpha$~values are observed close to the red edge of the DBV instability region. This means that in terms of the 3D picture, the mixing length changes quite rapidly in the region where pulsations are empirically observed to stop. As current DBV studies use an ML2/$\alpha$~value of 1.25, and the peak is closer to this value than the calibrated ML2/$\alpha$~values at other $T_{\rm{eff}}$, we expect that our calibration will not significantly alter the current theoretical DBV studies at the red edge of the instability strip. \subsection{Calibration of the maximum convective flux}~\label{sec:fmax} An alternative way to calibrate the ML2/$\alpha$~values for closed bottom models has been proposed by \cite{tremblay2015}. The calibration is based on the maximum value of the convective-to-total flux. This better represents the total amount of energy transported by convection as shown for DA white dwarfs by \cite{tremblay2015}. We perform this calibration for DB and DBA closed bottom models using the 1D atmospheric models of \cite{bergeron_db_2011}, i.e. same grid that was used in Sec.~\ref{sec:sjump}, but with additional grids at ML2/$\alpha$~$=0.55$, 0.60, 0.65 and 0.70 as convective flux changes significantly with ML2/$\alpha$~value. Our results are shown in Fig.~\ref{fig:fmax}. In Fig.~\ref{fig:closed_bottom_hcon}, we confirm that ML2/$\alpha_{\rm{F_{\rm{max}}}}$~calibration does indeed better reproduce the overall shape of DB (and DBA, although not shown) convection zones. Overall, the ML2/$\alpha_{\rm{F_{\rm{max}}}}$~results are similar to ML2/$\alpha_{\rm{S}}$~and ML2/$\alpha_{\rm{f}}$~calibration. We find inefficient convection resulting in small convection zones. \cite{montgomery2004} performed an equivalent calibration of maximum convective flux using their 1D non-local envelope models of DB white dwarfs. They found ML2/$\alpha$~$\approx 0.5$ for $\log{g}$~$=8.0$, 28\,000~K~$\leq$~$T_{\rm{eff}}$~$\leq$~33\,000~K DB models, whereas we find 0.64~$\gtrsim$~ML2/$\alpha$~$\gtrsim$~0.5 for the same atmospheric parameter range. Both studies therefore suggest that convection is less efficient than what is currently assumed. When comparing DA and DB white dwarfs in the regime of very inefficient convection (closed bottom models in our case), \cite{montgomery2004} found that for given $F_{\rm{convective}}/F_{\rm{total}}$, DB stars have lower values of ML2/$\alpha_{\rm{F_{\rm{max}}}}$, but larger convection zone sizes. They attribute this to the He~II convection zone being deeper than the H~I counterpart, allowing the same amount of convective flux to be transported more efficiently and therefore with a smaller value of ML2/$\alpha$. Comparing our results to the 3D DA calibration of \cite{tremblay2015}, we also find that DB white dwarfs have smaller ML2/$\alpha_{\rm{F_{\rm{max}}}}$~values and larger convection zone sizes, in agreement with \cite{montgomery2004} results. \begin{figure} \includegraphics[width=\columnwidth]{fmax.pdf} \caption{Same as Fig.~\ref{fig:sjump}, but for ML2/$\alpha$~calibration based on the maximum convective flux for 3D closed bottom models.} \label{fig:fmax} \end{figure} \subsection{Calibration of velocities}~\label{sec:v} Unlike in 1D models, in 3D simulations we expect there to be significant macroscopic diffusion at the bottom of the convection zone caused by momenta of downflows. We refer to this region as the velocity overshoot region, which overlaps with the flux overshoot region shown in Fig.~\ref{fig:closed_bottom_hcon} where negative flux is found. The velocity overshoot both includes and extends beyond the flux overshoot region. The overshoot region can be thought of as an extension to the more traditional convection zones discussed in this paper, especially for studies of metal diffusion in the atmospheres of white dwarfs. If included, it would mean larger convection zones than presented in this paper. In Fig.~\ref{fig:v} we compare the velocities of our $\langle$3D$\rangle$~and 1D structures. In 1D the convective velocities are only non-zero inside the Schwarzschild~convection zone, whereas in 3D, the velocities are significant even beyond the Schwarzschild~and flux boundaries. As long as these convective velocities result in a macroscopic diffusion process that is more efficient than microscopic diffusion, metals are expected to be fully mixed in the convection zone rather than diffuse out of it. Convective overshoot could also significantly enhance the dredge-up of carbon from the interior \citep{dufour2005} if the size of the superficial helium layer is small enough to allow convection to reach the underlying carbon layer. \begin{figure} \includegraphics[width=\columnwidth]{v_closed.pdf} \caption{The vertical root mean square velocity as a function of $\log{\tau_{\rm{R}}}$~at two different $T_{\rm{eff}}$~for $\log{g}$~$=8.0$ DB models. The $\langle$3D$\rangle$~$v_{z, \rm{rms}}$~is shown in solid blue. The 1D models with ML2/$\alpha$~$=$ ML2/$\alpha_{\rm{S}}$~and ML2/$\alpha_{\rm{f}}$~are shown as dotted green and red dashed lines, respectively. The bottom of the Schwarzschild~and flux boundaries are shown as downward- and upward-pointing triangles. The dashed black lines indicate the top and bottom of the optical light forming region. The 1D structures are unable to reproduce $\langle$3D$\rangle$~velocities especially outside the convective regions. In the upper layers ($\log{\tau_{\rm{R}}}$ < -3), the $\langle$3D$\rangle$~convective velocities have an important contribution from waves in the simulation.} \label{fig:v} \end{figure} Macroscopic diffusion can only be studied in 3D models with closed bottom. Yet, it is expected that all 3D models, including those with open bottom, will have overshoot both at the bottom and top of their convection zones, due to the dynamics of the convective flows. In order to study velocity overshoot for lower $T_{\rm{eff}}$~at which we currently only have open bottom models, a new grid of deep closed bottom models would have to be calculated. \cite{cunningham2019} have recently performed an in-depth study of overshoot in 3D DA closed models, finding that the mixed masses can be as much as 3 dex larger than currently used. Such a study for 3D DB and DBA models is beyond the scope of the current paper. As such, we do not attempt to perform any ML2/$\alpha$~calibration based on velocities. \subsection{Impact of metals on size of the convection zone} In order to test the effect of metals on the size of the convection zone, we calculate two sets of 3D models with and without metals at two selected $T_{\rm{eff}}$~values. We use the 1D atmospheric code of \cite{koester2010} to calculate input equations of state and opacity tables. When including metals, we use the metal composition and abundances of SDSS J073842.56+183509.06~determined by \cite{dufour2012}, as well as their determined hydrogen abundance of $\log{\rm{(H/He)}}$~$=-5.73 \pm 0.17$. We base our atmospheric composition on this white dwarf because it is one of the most polluted objects with 14 elements heavier than helium present in its atmosphere. Our aim is not to replicate exactly the atmospheric parameters determined by \cite{dufour2012} but rather to study the effect of strong metal pollution on 3D models. We start our models from two computed simulations of the 3D DBA grid with $\log{\rm{(H/He)}}$~$=-5.0$, $\log{g}$~$=8.0$ and $T_{\rm{eff}}$~$\approx 14\,000$~K and $\approx 20\,000$~K. As $\log{\rm{(H/He)}}$~is ultimately controlled by the input tables, the $\log{\rm{(H/He)}}$~value of the starting model does not matter, but for convergence it is desirable to start with the closest available hydrogen abundance. Although, a value of $\log{g}$~$=8.4 \pm 0.2$ was determined by \cite{dufour2012}, we instead use $\log{g}$~$=8.0$, more in line with the recent determination of $\log{g}$~$=8.05 \pm 0.15$ by \cite{gentilefusillo2019,gentilefusillo2019cat}. As $T_{\rm{eff}}$~is only recovered after the model is run, for each set of models we tried to achieve an agreement of around 100 K between the models with and without metals. We find that including our selected metal-rich composition in a 3D model decreases the $T_{\rm{eff}}$~by around $1\,500$ K given the specified inflowing entropy at the bottom boundary (using the same entropy zero point). For example, the non-metal $T_{\rm{eff}}$~value of one model is $13\,975$~K, whereas the $T_{\rm{eff}}$~of the metal version is $12\,497$~K with the same physical conditions at the bottom. In order to get an agreement of $\approx 100$ K between models with and without metals, we had to increase the entropy of the inflowing material at the bottom boundary. From Figs.~\ref{fig:s_teff} and~\ref{fig:q_teff} it is clear that higher inflowing entropy means smaller convection zone. Therefore, we can speculate that with the inclusion of metals, the size of the convection zone becomes smaller for the same $T_{\rm{eff}}$. This is not unexpected, since similarly to hydrogen, metals increase the total opacity. To find the mass of the convection zone we utilise the envelope code described in \cite{koester_kepler_2015} with our calibrated ML2/$\alpha$~parameter. The code takes the last point in a given $\langle$3D$\rangle$~atmospheric structure as a starting point for calculating the corresponding envelope. The envelope code is 1D and therefore depends on the mixing length theory. As per our calibration based on $\log{\rm{(H/He)}}$~$=-5.0$, $\log{g}$~$=8.0$ 3D models, we use ML2/$\alpha$~$=1.0$ and 0.80 for $T_{\rm{eff}}$~$\approx 14\,000$ K and $20\,000$ K models, respectively. We do not perform any additional mixing length parameter calibration beyond what has been described in previous sections. The total mass of the white dwarf is assumed to be 0.59$M_{\odot}$~with radius of 0.0127$R_{\odot}$. The \cite{saumon1995} equation of state is used and only hydrogen and helium atoms are considered. Metals are ignored as they do not impact the envelope structure as long as they are a trace species. Therefore, the difference in the mass of the convection zone between the metal and non-metal models arises from the fact that the 3D atmospheric structures are different (see Fig.~\ref{fig:dbz_temp}). In Tab.~\ref{tab:dbaz} we show the change in the mass of the convection zone with the addition of metals. We find that in the $T_{\rm{eff}}$~$\approx 14\,000$~K case, the mass of the convection zone decreases by a factor of 2 (or 0.31 dex) when metals are included. For the $T_{\rm{eff}}$~$\approx 20\,000$~K case, a similar change of 0.45 dex is observed. In both cases it would mean that for the same metal abundance observed, the total mass of metals present would be smaller using the appropriate metal-rich model atmosphere. For $T_{\rm{eff}}$~$\approx 14\,000$ K, the change in the mass of the convection zone with the inclusion of metals can be mimicked by increasing the hydrogen abundance from $\log{\rm{(H/He)}}$~$=-5.0$ to $-3.0$. Similarly, at $T_{\rm{eff}}$~$\approx 20\,000$ K, the increase of $\log{\rm{(H/He)}}$~from $-5.0$ to somewhere between $-3.0$ and $-2.0$ gives a change in mass similar to the effect of metals. In terms of the 3D picture, the effect of metals on the size of the convection zone is moderate, especially since SDSS J073842.56+183509.06~is one of the most heavily polluted white dwarfs. However, the effect of metals on spectroscopic 3D corrections for $T_{\rm{eff}}$~and $\log{g}$~are still to be explored. Fig.~\ref{fig:dbz_temp} suggests that changes in the structure of the light forming layers are important especially at lower Teff. \begin{figure} \includegraphics[width=\columnwidth]{dbz_temp.pdf} \caption{Temperature stratification of 3D models with and without metals at two different $T_{\rm{eff}}$~values. The $\langle$3D$\rangle$~structures for 3D DBAZ models are shown in solid blue, whereas the non-metal 3D models are in plotted in solid red.} \label{fig:dbz_temp} \end{figure} \newpage \begin{table} \centering \caption{Change in the convection zone mass from addition of metals (DBAZ) in a helium-rich DBA white dwarf. The DBAZ models use the metal abundances of SDSS J073842.56+183509.06~determined by \protect\cite{dufour2012}.} \label{tab:dbaz} \begin{tabular}{lccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & Change in convection \\ & (K) & zone mass (dex) \\ \hline 8.0 & $\approx 14\,000$ K & $-$0.31 \\ 8.0 & $\approx 20\,000$ K & $-$0.45 \\ \hline \end{tabular} \end{table} \newpage \section{Summary}~\label{sec:sum} With 285 3D CO$^5$BOLD~atmospheric models of DB and DBA white dwarfs, we have calibrated the mixing length parameter for the use of 1D envelope and evolutionary models. Our results are applicable for studies in need of convection zone sizes, for example for asteroseismological and remnant planetary systems analyses. As the nature of the convection zone boundaries is more complex in 3D than in 1D, two definitions of the boundary were used for calibration, the Schwarzschild~and flux boundaries. Overall, values of both ML2/$\alpha_{\rm{S}}$~or ML2/$\alpha_{\rm{f}}$~are lower than what is typically used in envelope and evolutionary models, meaning that convection is less efficient in 3D models. On average, for $\log{g}$~$= 8.0$ models with 18\,000~K~$\lesssim$ $T_{\rm{eff}}$~$\lesssim$~30\,000~K, we find ML2/$\alpha_{\rm{S}}$~$\approx 0.80$ and ML2/$\alpha_{\rm{f}}$~$\approx 0.9$. This is similar to ML2/$\alpha$~parameters calibrated for 3D DA white dwarfs \citep{tremblay2015}. Near the blue edge of the DBV instability strip, we find that the calibrated ML2/$\alpha$~values are much lower than the value of 1.25 recently used in the theoretical seismological study of \cite{vangrootel2017}. Therefore, in 3D, efficient convective energy transport sets in at a lower $T_{\rm{eff}}$. As the set-in of significant energy transport by convection is related to the blue edge of the strip, the 3D results would potentially mean lower $T_{\rm{eff}}$~of the theoretical blue edge. Note that compared to the empirical blue edge of $T_{\rm{eff}}$~$\approx$~31\,000~K at $\log{g}$~$\approx$~7.8 \citep{shipman2002,provencal2003,hermes2017,myprecious}, the current 1D theoretical blue edge of $T_{\rm{eff}}$~$\approx$~29\,000~K at $\log{g}$~$\approx$~7.8 is already too low in comparison (see Fig. 4 of \citealt{vangrootel2017}). In terms of determining the $T_{\rm{eff}}$~and $\log{g}$~values from spectroscopy, we recommend using ML2/$\alpha$~$=1.25$ (but see \citealt{myprecious} for details of 3D DB corrections). However, it is clear that the actual efficiency of convection in the atmosphere has little to do with the ML2/$\alpha$~$=1.25$ value calibrated from spectroscopic observations. The current evolutionary models of white dwarfs can be improved by including our ML2/$\alpha$~calibrated values. 3D models also provide the best available estimate for the masses of convection zones of DB and DBA white dwarfs which are relevant for studies of remnant planetary systems. We illustrate this by calculating example 3D DBAZ models. However, our calibration does not consider velocity overshoot which could increase the mixing mass by orders of magnitude. In most of the models presented here, however, we cannot currently do any overshoot studies as the convection zones are too large to model. For the select few models at the highest $T_{\rm{eff}}$~of our grid, the overshoot region can be directly accessed and could be used for direct investigation, similar to what has been achieved for DA white dwarfs \citep{cunningham2019}. Convection is not expected to have any direct impact of the derived ages of white dwarfs, up until the convection zone grows large enough to reach the core, directly coupling the degenerate core to the surface \citep{tremblay2015}. This occurs at $T_{\rm{eff}}$~$ \sim $ 5\,000 K for DA white dwarfs \citep{tassoul1990, tremblay2015} and $ \sim $ 10\,000 K for DB white dwarfs \citep{tassoul1990, macdonald1991}. However, at these $T_{\rm{eff}}$~convection is adiabatic and therefore loses its sensitivity to the ML2/$\alpha$~parameter. Therefore, we do not expect our calibration of the ML2/$\alpha$~parameter to have any direct impact on the ages derived from evolutionary models. However, the 3D models can have an indirect effect on age determinations due to 3D spectroscopic corrections for $\log{g}$~and $T_{\rm{eff}}$~\citep{myprecious}. 3D DBA spectroscopic corrections will be derived in a future work. \newpage \section*{Acknowledgements} We would like to thank the anonymous referee for their helpful comments. This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No 677706 - WD3D). B.F. has been supported by the Swedish Research Council (Vetenskapsr{\aa}det). H.G.L. acknowledges financial support by the Sonderforschungsbereich SFB\,881 ``The Milky Way System'' (subprojects A4) of the German Research Foundation (DFG). \newpage \bibliographystyle{mnras} \section{Additional information}~\label{ap:tables} Tabs.~\ref{tab:3d_models10} to \ref{tab:3d_models2} list some basic parameters of the 3D simulations. This includes the surface gravity of a given simulation, its effective temperature, the size of the box the simulation was run in, the run time and the relative bolometric intensity contrast averaged over space and time. Tabs.~\ref{tab:3d_db_open_models10} to \ref{tab:3d_db_open_models2} list the parameters needed for the mixing length calibration of 3D open bottom models, as well as the results of the calibration. For each 3D simulation, its surface gravity, effective temperature and the adiabatic entropy used for ML2/$\alpha_{\rm{S}}$~calibration is included. Also given are the ML2/$\alpha_{\rm{S}}$, $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$, $T$ and $P$ values for the Schwarzschild~boundary. $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$, temperature and pressure are found from the 1D envelope calculated at ML2/$\alpha_{\rm{S}}$. The same parameters are also given for the flux boundary. As the flux boundary cannot be directly accessed for open bottom models, we instead use the relation ML2/$\alpha_{\rm{f}}$~$=1.17$~ML2/$\alpha_{\rm{S}}$~to find ML2/$\alpha_{\rm{f}}$. Tabs.~\ref{tab:3d_db_modelsclosed10} to \ref{tab:3d_modelsclosed2} list the parameters needed for the calibration of the mixing length for 3D closed bottom models, as well as the results of the calibration. For each 3D simulation, its surface gravity and effective temperature are given. The mixing length calibration for closed bottom model relies on the spatially- and temporally-averaged 3D temperature and pressure at the bottom of the convection zone, and these parameters are given for both the Schwarzschild~and flux boundaries. The ML2/$\alpha_{\rm{S}}$~and ML2/$\alpha_{\rm{f}}$~are also given, as well as the $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$~for each boundary. \begin{table} \centering \caption{Select parameters of the 3D DB model atmospheres, where $\delta I_{\rm rms}/\langle I \rangle$ is the relative bolometric intensity contrast averaged over space and time.} \label{tab:3d_models10} \begin{tabular}{lcccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & Box size & Total run time & $\delta I_{\rm rms}/\langle I \rangle$ \\ & (K) & (km $\times$ km $\times$ km) & (stellar s) & (\%) \\ \hline 7.5 & 12098 & 1.22$\times$1.22$\times$0.58 & 33.6 & 3.6 \\ 7.5 & 13969 & 1.98$\times$1.98$\times$0.67 & 32.2 & 8.9 \\ 7.5 & 15947 & 2.86$\times$2.86$\times$1.19 & 32.2 & 16.4 \\ 7.5 & 18059 & 6.09$\times$6.09$\times$1.46 & 32.1 & 21.3 \\ 7.5 & 19931 & 11.96$\times$11.96$\times$2.39 & 34.7 & 23.4 \\ 7.5 & 22044 & 21.75$\times$21.75$\times$4.51 & 32.3 & 25.5 \\ 7.5 & 23774 & 23.96$\times$23.96$\times$4.78 & 31.7 & 24.3 \\ 7.5 & 26497 & 37.47$\times$37.47$\times$21.40 & 32.6 & 21.7 \\ 7.5 & 27993 & 31.22$\times$31.22$\times$10.77 & 14.7 & 17.5 \\ 7.5 & 29991 & 31.22$\times$31.22$\times$11.86 & 17.7 & 9.4 \\ 7.5 & 32001 & 33.48$\times$33.48$\times$14.00 & 48.3 & 4.8 \\ \hline 8.0 & 12020 & 0.70$\times$0.70$\times$0.10 & 10.0 & 2.1 \\ 8.0 & 14083 & 0.79$\times$0.79$\times$0.24 & 10.2 & 6.0 \\ 8.0 & 16105 & 0.94$\times$0.94$\times$0.18 & 10.1 & 11.9 \\ 8.0 & 18082 & 1.23$\times$1.23$\times$0.35 & 13.0 & 17.0 \\ 8.0 & 20090 & 2.00$\times$2.00$\times$0.58 & 12.5 & 19.4 \\ 8.0 & 21014 & 5.19$\times$5.19$\times$0.97 & 11.9 & 21.0 \\ 8.0 & 21465 & 5.19$\times$5.19$\times$0.97 & 11.0 & 21.6 \\ 8.0 & 21987 & 5.19$\times$5.19$\times$0.97 & 8.7 & 22.3 \\ 8.0 & 22988 & 8.62$\times$8.62$\times$1.41 & 11.6 & 24.2 \\ 8.0 & 24144 & 8.62$\times$8.62$\times$1.41 & 11.7 & 23.8 \\ 8.0 & 25898 & 8.62$\times$8.62$\times$1.56 & 10.0 & 21.1 \\ 8.0 & 28107 & 12.63$\times$12.63$\times$4.93 & 16.8 & 20.3 \\ 8.0 & 29997 & 12.63$\times$12.63$\times$5.12 & 13.5 & 19.2 \\ 8.0 & 31999 & 12.63$\times$12.63$\times$3.28 & 5.0 & 14.8 \\ 8.0 & 33999 & 12.63$\times$12.63$\times$3.42 & 5.3 & 7.9 \\ \hline 8.5 & 12139 & 0.25$\times$0.25$\times$0.05 & 3.6 & 1.5 \\ 8.5 & 14007 & 0.25$\times$0.25$\times$0.04 & 5.7 & 3.6 \\ 8.5 & 15961 & 0.34$\times$0.34$\times$0.05 & 3.5 & 7.6 \\ 8.5 & 18000 & 0.39$\times$0.39$\times$0.13 & 3.6 & 12.6 \\ 8.5 & 19955 & 0.60$\times$0.60$\times$0.20 & 4.0 & 15.5 \\ 8.5 & 21999 & 1.03$\times$1.03$\times$0.26 & 3.2 & 17.8 \\ 8.5 & 24143 & 1.78$\times$1.78$\times$0.37 & 3.7 & 22.1 \\ 8.5 & 25805 & 2.37$\times$2.37$\times$0.44 & 3.5 & 22.3 \\ 8.5 & 27934 & 2.53$\times$2.53$\times$0.59 & 2.9 & 20.6 \\ 8.5 & 30567 & 4.53$\times$4.53$\times$1.97 & 4.6 & 19.5 \\ 8.5 & 32208 & 4.53$\times$4.53$\times$2.12 & 3.8 & 18.9 \\ 8.5 & 34020 & 4.53$\times$4.53$\times$1.92 & 3.7 & 17.6 \\ \hline 9.0 & 12124 & 0.06$\times$0.06$\times$0.01 & 3.4 & 0.8 \\ 9.0 & 14117 & 0.07$\times$0.07$\times$0.01 & 2.0 & 2.3 \\ 9.0 & 16029 & 0.11$\times$0.11$\times$0.02 & 1.1 & 5.0 \\ 9.0 & 17998 & 0.12$\times$0.12$\times$0.03 & 1.1 & 8.7 \\ 9.0 & 19961 & 0.14$\times$0.14$\times$0.05 & 1.0 & 11.7 \\ 9.0 & 21978 & 0.20$\times$0.20$\times$0.07 & 1.0 & 13.6 \\ 9.0 & 24082 & 0.39$\times$0.39$\times$0.10 & 1.1 & 17.2 \\ 9.0 & 26109 & 0.76$\times$0.76$\times$0.13 & 0.6 & 20.6 \\ 9.0 & 28143 & 0.76$\times$0.76$\times$0.16 & 1.0 & 20.6 \\ 9.0 & 30184 & 0.86$\times$0.86$\times$0.20 & 1.1 & 17.4 \\ 9.0 & 31440 & 0.86$\times$0.86$\times$0.20 & 3.2 & 17.2 \\ 9.0 & 34105 & 1.43$\times$1.43$\times$0.84 & 2.3 & 18.3 \\ \hline \end{tabular} \end{table} \clearpage \begin{table} \centering \caption{Select parameters of 3D DBA model atmospheres with $\log{\rm{H}/\rm{He}} = -7$.} \label{tab:3d_models7} \begin{tabular}{lcccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & Box size & Total run time & $\delta I_{\rm rms}/\langle I \rangle$ \\ & (K) & (km $\times$ km $\times$ km) & (stellar s) & (\%) \\ \hline 7.5 & 12098 & 1.22$\times$1.22$\times$0.58 & 32.8 & 3.6 \\ 7.5 & 13967 & 1.98$\times$1.98$\times$0.67 & 31.7 & 8.8 \\ 7.5 & 15936 & 2.86$\times$2.86$\times$1.19 & 35.0 & 16.3 \\ 7.5 & 18051 & 6.09$\times$6.09$\times$1.46 & 34.1 & 21.0 \\ 7.5 & 19865 & 11.96$\times$11.96$\times$2.44 & 32.6 & 22.3 \\ 7.5 & 21873 & 21.75$\times$21.75$\times$4.04 & 37.8 & 22.7 \\ 7.5 & 23789 & 23.96$\times$23.96$\times$4.80 & 32.1 & 24.4 \\ 7.5 & 26501 & 37.47$\times$37.47$\times$21.40 & 33.2 & 22.1 \\ 7.5 & 27993 & 31.22$\times$31.22$\times$10.77 & 16.0 & 17.2 \\ 7.5 & 29993 & 31.22$\times$31.22$\times$11.86 & 18.3 & 10.2 \\ 7.5 & 32002 & 33.48$\times$33.48$\times$14.00 & 34.4 & 4.5 \\ \hline 8.0 & 12019 & 0.70$\times$0.70$\times$0.11 & 10.8 & 2.1 \\ 8.0 & 14083 & 0.79$\times$0.79$\times$0.24 & 10.9 & 5.9 \\ 8.0 & 16099 & 0.94$\times$0.94$\times$0.19 & 10.1 & 11.9 \\ 8.0 & 18074 & 1.23$\times$1.23$\times$0.35 & 10.3 & 17.0 \\ 8.0 & 20088 & 2.00$\times$2.00$\times$0.58 & 10.2 & 19.4 \\ 8.0 & 21996 & 5.19$\times$5.19$\times$0.97 & 11.4 & 22.3 \\ 8.0 & 24036 & 8.62$\times$8.62$\times$1.41 & 10.4 & 24.0 \\ 8.0 & 25956 & 8.62$\times$8.62$\times$1.56 & 10.2 & 21.1 \\ 8.0 & 28037 & 12.63$\times$12.63$\times$4.93 & 18.2 & 20.6 \\ 8.0 & 29963 & 12.63$\times$12.63$\times$5.12 & 10.5 & 20.2 \\ 8.0 & 32000 & 12.63$\times$12.63$\times$3.28 & 5.5 & 14.4 \\ 8.0 & 33999 & 12.63$\times$12.63$\times$3.42 & 5.4 & 8.5 \\ \hline 8.5 & 12147 & 0.25$\times$0.25$\times$0.05 & 3.1 & 1.5 \\ 8.5 & 14004 & 0.25$\times$0.25$\times$0.04 & 3.8 & 3.6 \\ 8.5 & 15958 & 0.34$\times$0.34$\times$0.05 & 3.3 & 7.6 \\ 8.5 & 17998 & 0.39$\times$0.39$\times$0.13 & 3.6 & 12.6 \\ 8.5 & 19951 & 0.60$\times$0.60$\times$0.20 & 3.4 & 15.5 \\ 8.5 & 22002 & 1.03$\times$1.03$\times$0.26 & 3.1 & 17.9 \\ 8.5 & 24047 & 1.78$\times$1.78$\times$0.37 & 3.3 & 22.1 \\ 8.5 & 25943 & 2.37$\times$2.37$\times$0.44 & 3.4 & 22.1 \\ 8.5 & 27907 & 2.53$\times$2.53$\times$0.59 & 3.2 & 20.6 \\ 8.5 & 30514 & 4.53$\times$4.53$\times$1.97 & 4.2 & 19.7 \\ 8.5 & 32012 & 4.53$\times$4.53$\times$2.12 & 3.7 & 19.0 \\ 8.5 & 33949 & 4.53$\times$4.53$\times$1.92 & 3.2 & 17.1 \\ \hline 9.0 & 12120 & 0.06$\times$0.06$\times$0.01 & 1.1 & 0.8 \\ 9.0 & 14114 & 0.07$\times$0.07$\times$0.01 & 1.0 & 2.3 \\ 9.0 & 16026 & 0.11$\times$0.11$\times$0.02 & 1.0 & 4.9 \\ 9.0 & 17985 & 0.12$\times$0.12$\times$0.03 & 1.0 & 8.7 \\ 9.0 & 19957 & 0.14$\times$0.14$\times$0.04 & 1.1 & 11.7 \\ 9.0 & 21982 & 0.20$\times$0.20$\times$0.07 & 1.1 & 13.6 \\ 9.0 & 24093 & 0.39$\times$0.39$\times$0.10 & 1.1 & 17.1 \\ 9.0 & 26115 & 0.76$\times$0.76$\times$0.13 & 1.1 & 20.7 \\ 9.0 & 28141 & 0.76$\times$0.76$\times$0.16 & 1.1 & 20.6 \\ 9.0 & 30006 & 0.86$\times$0.86$\times$0.20 & 1.0 & 17.8 \\ 9.0 & 31472 & 0.86$\times$0.86$\times$0.20 & 1.3 & 16.7 \\ 9.0 & 34021 & 1.43$\times$1.43$\times$0.84 & 2.0 & 18.3 \\ \hline \end{tabular} \end{table} \begin{table} \centering \caption{Select parameters of 3D DBA model atmospheres with $\log{\rm{H}/\rm{He}} = -5$.} \label{tab:3d_models5} \begin{tabular}{lcccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & Box size & Total run time & $\delta I_{\rm rms}/\langle I \rangle$ \\ & (K) & (km $\times$ km $\times$ km) & (stellar s) & (\%) \\ \hline 7.5 & 12009 & 1.22$\times$1.22$\times$0.59 & 33.1 & 3.4 \\ 7.5 & 14013 & 1.98$\times$1.98$\times$0.67 & 33.0 & 9.0 \\ 7.5 & 15886 & 2.86$\times$2.86$\times$1.19 & 33.9 & 15.7 \\ 7.5 & 17920 & 6.09$\times$6.09$\times$1.46 & 31.8 & 21.0 \\ 7.5 & 19900 & 11.96$\times$11.96$\times$2.44 & 32.2 & 23.1 \\ 7.5 & 21946 & 21.75$\times$21.75$\times$4.51 & 32.6 & 24.7 \\ 7.5 & 23757 & 23.96$\times$23.96$\times$4.80 & 32.2 & 24.2 \\ 7.5 & 26522 & 37.47$\times$37.47$\times$21.40 & 36.4 & 22.1 \\ 7.5 & 27998 & 31.22$\times$31.22$\times$10.77 & 15.8 & 17.7 \\ 7.5 & 29992 & 31.22$\times$31.22$\times$11.86 & 26.6 & 9.7 \\ 7.5 & 32002 & 33.48$\times$33.48$\times$14.00 & 24.0 & 5.1 \\ \hline 8.0 & 11978 & 0.70$\times$0.70$\times$0.11 & 10.2 & 2.1 \\ 8.0 & 14031 & 0.79$\times$0.79$\times$0.24 & 9.9 & 5.7 \\ 8.0 & 15974 & 0.94$\times$0.94$\times$0.19 & 11.5 & 11.3 \\ 8.0 & 17952 & 1.23$\times$1.23$\times$0.35 & 10.4 & 16.9 \\ 8.0 & 20012 & 2.00$\times$2.00$\times$0.58 & 12.7 & 19.4 \\ 8.0 & 21959 & 5.19$\times$5.19$\times$0.97 & 10.1 & 22.2 \\ 8.0 & 24014 & 8.62$\times$8.62$\times$1.41 & 10.0 & 24.0 \\ 8.0 & 25963 & 8.62$\times$8.62$\times$1.56 & 9.9 & 20.6 \\ 8.0 & 28086 & 12.63$\times$12.63$\times$4.93 & 12.4 & 20.7 \\ 8.0 & 29989 & 12.63$\times$12.63$\times$5.12 & 10.1 & 18.9 \\ 8.0 & 32002 & 12.63$\times$12.63$\times$3.28 & 10.3 & 14.7 \\ 8.0 & 34000 & 12.63$\times$12.63$\times$3.42 & 10.1 & 8.2 \\ \hline 8.5 & 11996 & 0.25$\times$0.25$\times$0.05 & 4.0 & 1.3 \\ 8.5 & 14012 & 0.25$\times$0.25$\times$0.04 & 3.7 & 3.5 \\ 8.5 & 15957 & 0.34$\times$0.34$\times$0.05 & 3.7 & 7.6 \\ 8.5 & 17956 & 0.39$\times$0.39$\times$0.13 & 3.6 & 12.7 \\ 8.5 & 19924 & 0.60$\times$0.60$\times$0.20 & 4.0 & 15.5 \\ 8.5 & 21962 & 1.03$\times$1.03$\times$0.26 & 3.7 & 17.8 \\ 8.5 & 24004 & 1.78$\times$1.78$\times$0.37 & 3.7 & 21.9 \\ 8.5 & 25938 & 2.37$\times$2.37$\times$0.45 & 3.7 & 22.2 \\ 8.5 & 27946 & 2.53$\times$2.53$\times$0.59 & 3.5 & 20.3 \\ 8.5 & 30517 & 4.53$\times$4.53$\times$1.97 & 4.1 & 19.5 \\ 8.5 & 32015 & 4.53$\times$4.53$\times$2.12 & 4.3 & 19.0 \\ 8.5 & 33947 & 4.53$\times$4.53$\times$1.92 & 3.6 & 17.4 \\ \hline 9.0 & 12077 & 0.06$\times$0.06$\times$0.01 & 1.1 & 0.8 \\ 9.0 & 14059 & 0.07$\times$0.07$\times$0.01 & 1.1 & 2.2 \\ 9.0 & 15930 & 0.11$\times$0.11$\times$0.02 & 1.0 & 4.7 \\ 9.0 & 17885 & 0.12$\times$0.12$\times$0.03 & 1.0 & 8.7 \\ 9.0 & 19922 & 0.14$\times$0.14$\times$0.04 & 1.1 & 11.8 \\ 9.0 & 21942 & 0.20$\times$0.20$\times$0.07 & 1.1 & 13.6 \\ 9.0 & 24076 & 0.39$\times$0.39$\times$0.10 & 1.1 & 17.1 \\ 9.0 & 26099 & 0.76$\times$0.76$\times$0.13 & 1.0 & 20.6 \\ 9.0 & 28181 & 0.76$\times$0.76$\times$0.16 & 1.0 & 20.6 \\ 9.0 & 29952 & 0.86$\times$0.86$\times$0.20 & 1.0 & 17.8 \\ 9.0 & 31452 & 0.86$\times$0.86$\times$0.20 & 1.0 & 17.2 \\ 9.0 & 33986 & 1.43$\times$1.43$\times$0.84 & 2.3 & 18.3 \\ \hline \end{tabular} \end{table} \newpage \begin{table} \centering \caption{Select parameters of 3D DBA model atmospheres with $\log{\rm{H}/\rm{He}} = -4$.} \label{tab:3d_models4} \begin{tabular}{lcccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & Box size & Total run time & $\delta I_{\rm rms}/\langle I \rangle$ \\ & (K) & (km $\times$ km $\times$ km) & (stellar s) & (\%) \\ \hline 7.5 & 11983 & 1.22$\times$1.22$\times$0.58 & 32.0 & 3.5 \\ 7.5 & 13985 & 1.98$\times$1.98$\times$0.67 & 31.8 & 9.0 \\ 7.5 & 15973 & 2.86$\times$2.86$\times$1.19 & 34.0 & 16.0 \\ 7.5 & 17979 & 6.09$\times$6.09$\times$1.46 & 34.2 & 20.4 \\ 7.5 & 19932 & 11.96$\times$11.96$\times$2.75 & 34.5 & 22.2 \\ 7.5 & 22021 & 21.75$\times$21.75$\times$4.51 & 32.2 & 23.8 \\ 7.5 & 23464 & 23.96$\times$23.96$\times$4.80 & 31.0 & 23.7 \\ 7.5 & 26632 & 37.47$\times$37.47$\times$21.40 & 34.4 & 21.9 \\ 7.5 & 28004 & 31.22$\times$31.22$\times$10.77 & 15.8 & 17.3 \\ 7.5 & 29993 & 31.22$\times$31.22$\times$11.86 & 19.8 & 9.4 \\ 7.5 & 32002 & 33.48$\times$33.48$\times$14.00 & 10.9 & 5.3 \\ \hline 8.0 & 12008 & 0.70$\times$0.70$\times$0.11 & 10.0 & 2.2 \\ 8.0 & 13999 & 0.79$\times$0.79$\times$0.24 & 10.1 & 5.8 \\ 8.0 & 15994 & 0.94$\times$0.94$\times$0.19 & 10.3 & 11.4 \\ 8.0 & 18052 & 1.23$\times$1.23$\times$0.35 & 10.1 & 17.1 \\ 8.0 & 19991 & 2.00$\times$2.00$\times$0.58 & 10.2 & 19.5 \\ 8.0 & 21981 & 5.19$\times$5.19$\times$1.02 & 10.0 & 22.0 \\ 8.0 & 23953 & 8.62$\times$8.62$\times$1.41 & 10.3 & 23.3 \\ 8.0 & 25961 & 8.62$\times$8.62$\times$1.56 & 10.2 & 20.6 \\ 8.0 & 28092 & 12.63$\times$12.63$\times$4.93 & 10.2 & 21.1 \\ 8.0 & 29994 & 12.63$\times$12.63$\times$5.12 & 11.9 & 19.4 \\ 8.0 & 32002 & 12.63$\times$12.63$\times$3.28 & 10.4 & 14.5 \\ 8.0 & 34000 & 12.63$\times$12.63$\times$3.42 & 10.1 & 8.0 \\ \hline 8.5 & 12027 & 0.25$\times$0.25$\times$0.05 & 3.8 & 1.4 \\ 8.5 & 13981 & 0.25$\times$0.25$\times$0.04 & 3.7 & 3.6 \\ 8.5 & 15982 & 0.34$\times$0.34$\times$0.06 & 4.1 & 7.6 \\ 8.5 & 17951 & 0.39$\times$0.39$\times$0.13 & 3.8 & 13.0 \\ 8.5 & 19972 & 0.60$\times$0.60$\times$0.20 & 3.8 & 15.8 \\ 8.5 & 21956 & 1.03$\times$1.03$\times$0.26 & 3.8 & 18.0 \\ 8.5 & 23980 & 1.78$\times$1.78$\times$0.37 & 3.9 & 21.9 \\ 8.5 & 26006 & 2.37$\times$2.37$\times$0.46 & 3.6 & 21.5 \\ 8.5 & 27829 & 2.53$\times$2.53$\times$0.59 & 3.7 & 20.8 \\ 8.5 & 30490 & 4.53$\times$4.53$\times$1.97 & 3.8 & 19.4 \\ 8.5 & 32008 & 4.53$\times$4.53$\times$2.12 & 4.0 & 19.0 \\ 8.5 & 33963 & 4.53$\times$4.53$\times$1.92 & 3.3 & 17.4 \\ \hline 9.0 & 12055 & 0.06$\times$0.06$\times$0.01 & 1.1 & 0.9 \\ 9.0 & 14023 & 0.07$\times$0.07$\times$0.01 & 1.0 & 2.2 \\ 9.0 & 16020 & 0.11$\times$0.11$\times$0.02 & 1.0 & 4.9 \\ 9.0 & 17972 & 0.12$\times$0.12$\times$0.03 & 1.1 & 9.3 \\ 9.0 & 19968 & 0.14$\times$0.14$\times$0.04 & 1.1 & 12.2 \\ 9.0 & 21957 & 0.20$\times$0.20$\times$0.07 & 1.0 & 13.9 \\ 9.0 & 23971 & 0.39$\times$0.39$\times$0.10 & 1.0 & 17.2 \\ 9.0 & 26018 & 0.76$\times$0.76$\times$0.13 & 1.0 & 20.5 \\ 9.0 & 27982 & 0.76$\times$0.76$\times$0.16 & 1.0 & 20.6 \\ 9.0 & 29948 & 0.86$\times$0.86$\times$0.20 & 1.0 & 17.8 \\ 9.0 & 31360 & 0.86$\times$0.86$\times$0.20 & 1.0 & 17.0 \\ 9.0 & 33988 & 1.43$\times$1.43$\times$0.84 & 1.7 & 18.3 \\ \hline \end{tabular} \end{table} \begin{table} \centering \caption{Select parameters of 3D DBA model atmospheres with $\log{\rm{H}/\rm{He}} = -3$.} \label{tab:3d_models3} \begin{tabular}{lcccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & Box size & Total run time & $\delta I_{\rm rms}/\langle I \rangle$ \\ & (K) & (km $\times$ km $\times$ km) & (stellar s) & (\%) \\ \hline 7.5 & 11980 & 1.22$\times$1.22$\times$0.37 & 31.7 & 3.3 \\ 7.5 & 13855 & 1.98$\times$1.98$\times$0.67 & 36.3 & 8.8 \\ 7.5 & 15805 & 2.86$\times$2.86$\times$1.19 & 34.6 & 16.2 \\ 7.5 & 18026 & 6.09$\times$6.09$\times$1.46 & 32.1 & 21.2 \\ 7.5 & 20035 & 11.96$\times$11.96$\times$2.53 & 33.0 & 23.3 \\ 7.5 & 22043 & 21.75$\times$21.75$\times$4.51 & 31.6 & 24.8 \\ 7.5 & 23752 & 23.96$\times$23.96$\times$4.89 & 31.4 & 24.5 \\ 7.5 & 26670 & 37.47$\times$37.47$\times$21.40 & 35.7 & 21.0 \\ 7.5 & 28000 & 31.22$\times$31.22$\times$10.77 & 15.2 & 17.2 \\ 7.5 & 29999 & 31.22$\times$31.22$\times$11.86 & 22.8 & 8.8 \\ 7.5 & 32000 & 33.48$\times$33.48$\times$14.00 & 23.0 & 4.3 \\ \hline 8.0 & 12007 & 0.70$\times$0.70$\times$0.12 & 11.9 & 2.1 \\ 8.0 & 13961 & 0.79$\times$0.79$\times$0.14 & 10.5 & 5.8 \\ 8.0 & 16040 & 0.94$\times$0.94$\times$0.19 & 10.1 & 11.6 \\ 8.0 & 17985 & 1.23$\times$1.23$\times$0.36 & 10.4 & 17.0 \\ 8.0 & 20088 & 2.00$\times$2.00$\times$0.58 & 10.1 & 19.5 \\ 8.0 & 22047 & 5.19$\times$5.19$\times$0.99 & 10.8 & 22.5 \\ 8.0 & 24002 & 8.62$\times$8.62$\times$1.41 & 10.4 & 24.0 \\ 8.0 & 25904 & 8.62$\times$8.62$\times$1.56 & 10.4 & 21.2 \\ 8.0 & 28118 & 12.63$\times$12.63$\times$4.93 & 11.4 & 21.4 \\ 8.0 & 30001 & 12.63$\times$12.63$\times$5.12 & 11.0 & 18.9 \\ 8.0 & 31999 & 12.63$\times$12.63$\times$3.28 & 10.0 & 14.1 \\ 8.0 & 33980 & 12.63$\times$12.63$\times$3.42 & 9.9 & 8.1 \\ \hline 8.5 & 12027 & 0.25$\times$0.25$\times$0.05 & 3.8 & 1.3 \\ 8.5 & 13985 & 0.25$\times$0.25$\times$0.05 & 3.5 & 3.5 \\ 8.5 & 15988 & 0.34$\times$0.34$\times$0.06 & 3.4 & 7.6 \\ 8.5 & 18029 & 0.39$\times$0.39$\times$0.13 & 3.7 & 12.8 \\ 8.5 & 20043 & 0.60$\times$0.60$\times$0.20 & 3.6 & 15.7 \\ 8.5 & 22050 & 1.03$\times$1.03$\times$0.27 & 3.8 & 18.0 \\ 8.5 & 24011 & 1.78$\times$1.78$\times$0.37 & 3.4 & 22.0 \\ 8.5 & 25884 & 2.37$\times$2.37$\times$0.46 & 3.6 & 22.1 \\ 8.5 & 27602 & 2.53$\times$2.53$\times$0.59 & 3.1 & 21.5 \\ 8.5 & 30364 & 4.53$\times$4.53$\times$1.97 & 3.2 & 19.2 \\ 8.5 & 31965 & 4.53$\times$4.53$\times$2.12 & 5.2 & 18.8 \\ 8.5 & 34038 & 4.53$\times$4.53$\times$1.92 & 3.6 & 17.3 \\ \hline 9.0 & 11994 & 0.06$\times$0.06$\times$0.01 & 1.0 & 0.8 \\ 9.0 & 13967 & 0.07$\times$0.07$\times$0.01 & 1.1 & 2.1 \\ 9.0 & 15970 & 0.11$\times$0.11$\times$0.02 & 1.1 & 4.8 \\ 9.0 & 18038 & 0.12$\times$0.12$\times$0.03 & 1.2 & 9.0 \\ 9.0 & 20045 & 0.14$\times$0.14$\times$0.04 & 1.0 & 12.0 \\ 9.0 & 22057 & 0.20$\times$0.20$\times$0.07 & 1.0 & 13.8 \\ 9.0 & 24026 & 0.39$\times$0.39$\times$0.10 & 1.0 & 17.1 \\ 9.0 & 25997 & 0.76$\times$0.76$\times$0.13 & 1.0 & 20.6 \\ 9.0 & 28015 & 0.76$\times$0.76$\times$0.16 & 1.0 & 20.6 \\ 9.0 & 29929 & 0.86$\times$0.86$\times$0.20 & 1.0 & 18.3 \\ 9.0 & 31340 & 0.86$\times$0.86$\times$0.20 & 1.0 & 17.5 \\ 9.0 & 33917 & 1.43$\times$1.43$\times$0.84 & 1.0 & 18.6 \\ \hline \end{tabular} \end{table} \clearpage \begin{table} \centering \caption{Select parameters of 3D DBA model atmospheres with $\log{\rm{H}/\rm{He}} = -2$.} \label{tab:3d_models2} \begin{tabular}{lcccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & Box size & Total run time & $\delta I_{\rm rms}/\langle I \rangle$ \\ & (K) & (km $\times$ km $\times$ km) & (stellar s) & (\%) \\ \hline 7.5 & 11977 & 1.98$\times$1.98$\times$0.67 & 39.8 & 9.0 \\ 7.5 & 13995 & 2.86$\times$2.86$\times$1.19 & 38.3 & 15.0 \\ 7.5 & 16063 & 6.09$\times$6.09$\times$1.46 & 40.0 & 17.7 \\ 7.5 & 17963 & 6.09$\times$6.09$\times$1.46 & 73.4 & 20.2 \\ 7.5 & 20042 & 21.75$\times$21.75$\times$3.39 & 36.8 & 20.6 \\ 7.5 & 21944 & 21.75$\times$21.75$\times$4.59 & 33.9 & 18.2 \\ 7.5 & 22925 & 23.96$\times$23.96$\times$5.01 & 32.8 & 21.8 \\ 7.5 & 26471 & 37.47$\times$37.47$\times$21.40 & 33.7 & 19.7 \\ 7.5 & 27996 & 31.22$\times$31.22$\times$11.11 & 16.6 & 16.1 \\ 7.5 & 29982 & 31.22$\times$31.22$\times$11.86 & 24.1 & 8.0 \\ 7.5 & 32009 & 33.48$\times$33.48$\times$14.00 & 24.0 & 4.0 \\ \hline 8.0 & 12044 & 0.79$\times$0.79$\times$0.16 & 14.0 & 5.8 \\ 8.0 & 13953 & 0.94$\times$0.94$\times$0.20 & 12.8 & 10.6 \\ 8.0 & 15983 & 1.23$\times$1.23$\times$0.36 & 14.4 & 14.3 \\ 8.0 & 17961 & 1.23$\times$1.23$\times$0.38 & 19.9 & 17.1 \\ 8.0 & 19903 & 3.40$\times$3.40$\times$0.69 & 23.1 & 18.4 \\ 8.0 & 22026 & 8.62$\times$8.62$\times$1.43 & 11.0 & 17.6 \\ 8.0 & 24006 & 8.62$\times$8.62$\times$1.53 & 11.9 & 19.3 \\ 8.0 & 25333 & 8.62$\times$8.62$\times$1.67 & 12.4 & 18.1 \\ 8.0 & 27968 & 12.63$\times$12.63$\times$4.93 & 11.5 & 20.2 \\ 8.0 & 30013 & 12.63$\times$12.63$\times$5.12 & 10.4 & 18.3 \\ 8.0 & 31997 & 12.63$\times$12.63$\times$3.39 & 10.2 & 12.5 \\ 8.0 & 33989 & 12.63$\times$12.63$\times$3.51 & 10.0 & 7.0 \\ \hline 8.5 & 12013 & 0.25$\times$0.25$\times$0.05 & 5.1 & 3.4 \\ 8.5 & 14013 & 0.34$\times$0.34$\times$0.06 & 4.4 & 7.1 \\ 8.5 & 15994 & 0.39$\times$0.39$\times$0.13 & 6.1 & 10.6 \\ 8.5 & 17996 & 0.60$\times$0.60$\times$0.20 & 4.4 & 13.7 \\ 8.5 & 19962 & 0.60$\times$0.60$\times$0.20 & 7.1 & 15.1 \\ 8.5 & 22044 & 1.78$\times$1.78$\times$0.38 & 3.6 & 15.8 \\ 8.5 & 24025 & 2.37$\times$2.37$\times$0.46 & 3.5 & 19.7 \\ 8.5 & 25969 & 2.53$\times$2.53$\times$0.59 & 3.8 & 16.1 \\ 8.5 & 27179 & 3.80$\times$3.80$\times$0.62 & 4.6 & 17.4 \\ 8.5 & 30535 & 4.53$\times$4.53$\times$2.05 & 7.9 & 18.4 \\ 8.5 & 31852 & 4.53$\times$4.53$\times$2.12 & 3.5 & 18.7 \\ 8.5 & 33930 & 4.53$\times$4.53$\times$1.92 & 3.4 & 16.9 \\ \hline 9.0 & 12025 & 0.07$\times$0.07$\times$0.01 & 1.2 & 2.0 \\ 9.0 & 13986 & 0.11$\times$0.11$\times$0.02 & 1.3 & 4.4 \\ 9.0 & 16001 & 0.12$\times$0.12$\times$0.03 & 1.6 & 7.3 \\ 9.0 & 17981 & 0.14$\times$0.14$\times$0.04 & 1.4 & 10.2 \\ 9.0 & 20038 & 0.14$\times$0.14$\times$0.05 & 2.0 & 12.0 \\ 9.0 & 21923 & 0.41$\times$0.41$\times$0.08 & 2.9 & 12.9 \\ 9.0 & 24031 & 0.76$\times$0.76$\times$0.13 & 1.0 & 17.7 \\ 9.0 & 26031 & 0.76$\times$0.76$\times$0.16 & 2.0 & 16.9 \\ 9.0 & 27980 & 0.86$\times$0.86$\times$0.20 & 1.1 & 16.3 \\ 9.0 & 29843 & 0.86$\times$0.86$\times$0.21 & 1.3 & 16.0 \\ 9.0 & 31011 & 0.86$\times$0.86$\times$0.22 & 2.3 & 16.7 \\ 9.0 & 33770 & 1.43$\times$1.43$\times$0.84 & 3.2 & 18.2 \\ \hline \end{tabular} \end{table} \begin{table*} \centering \caption{MLT calibration for open bottom 3D DB models, where 3D~$s_{\rm{env}}$ is the 3D adiabatic entropy used for calibration, ML2/$\alpha_{\rm{S}}$~is the calibrated ML2/$\alpha$~value for Schwarzschild~boundary, $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ is $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$~for Schwarzschild~boundary, $(\log{T_{\rm{b}}})_{\rm{S}}$ is the 1D calibrated temperature at the Schwarzschild~boundary, $(\log{P_{\rm{b}}})_{\rm{S}}$ is the 1D calibrated pressure at the Schwarzschild~boundary. The same parameters are also given for the flux boundary and are denoted by subscript `f'.} \label{tab:3d_db_open_models10} \begin{tabular}{lcccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & 3D~$s_{\rm{env}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $(\log{T_{\rm{b}}})_{\rm{S}}$ & $(\log{P_{\rm{b}}})_{\rm{S}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ & $(\log{T_{\rm{b}}})_{\rm{f}}$ & $(\log{P_{\rm{b}}})_{\rm{f}}$ \\ & (K) & ($10^9$ erg g$^{-1}$ K$^{-1}$) & & & (K) & (dyn cm$^{-2}$) & & & (K) & (dyn cm$^{-2}$) \\ \hline 7.5 & 12098 & 0.40 & 1.00 & $-$4.14 & 6.68 & 16.96 & 1.00 & $-$4.14 & 6.68 & 16.96 \\ 7.5 & 13969 & 0.44 & 0.91 & $-$4.56 & 6.63 & 16.53 & 1.07 & $-$4.54 & 6.63 & 16.55 \\ 7.5 & 15947 & 0.48 & 0.92 & $-$5.16 & 6.52 & 15.93 & 1.08 & $-$5.11 & 6.54 & 15.99 \\ 7.5 & 18059 & 0.59 & 0.91 & $-$6.57 & 6.25 & 14.51 & 1.07 & $-$6.40 & 6.28 & 14.69 \\ 7.5 & 19931 & 0.78 & 0.97 & $-$9.16 & 5.74 & 11.92 & 1.14 & $-$8.72 & 5.83 & 12.36 \\ 7.5 & 22044 & 0.94 & 0.82 & $-$11.06 & 5.42 & 10.02 & 0.95 & $-$10.82 & 5.46 & 10.26 \\ 7.5 & 23774 & 1.02 & 0.69 & $-$12.07 & 5.24 & 9.01 & 0.80 & $-$11.62 & 5.33 & 9.45 \\ \hline 8.0 & 12020 & 0.38 & 1.00 & $-$5.21 & 6.59 & 16.87 & 1.00 & $-$5.21 & 6.59 & 16.87 \\ 8.0 & 14083 & 0.42 & 1.00 & $-$5.57 & 6.56 & 16.51 & 1.00 & $-$5.57 & 6.56 & 16.51 \\ 8.0 & 16105 & 0.46 & 0.89 & $-$6.08 & 6.48 & 16.00 & 1.04 & $-$6.05 & 6.49 & 16.04 \\ 8.0 & 18082 & 0.52 & 0.83 & $-$6.96 & 6.32 & 15.12 & 0.97 & $-$6.86 & 6.34 & 15.23 \\ 8.0 & 20090 & 0.66 & 0.88 & $-$8.71 & 5.98 & 13.37 & 1.03 & $-$8.45 & 6.04 & 13.63 \\ 8.0 & 21014 & 0.66 & 0.89 & $-$9.92 & 5.75 & 12.16 & 1.04 & $-$9.56 & 5.82 & 12.52 \\ 8.0 & 21465 & 0.75 & 0.97 & $-$10.38 & 5.67 & 11.70 & 1.14 & $-$9.97 & 5.74 & 12.11 \\ 8.0 & 21987 & 0.78 & 1.10 & $-$10.82 & 5.59 & 11.26 & 1.28 & $-$10.38 & 5.67 & 11.70 \\ 8.0 & 22988 & 0.82 & 1.00 & $-$11.39 & 5.49 & 10.68 & 1.17 & $-$11.25 & 5.52 & 10.83 \\ 8.0 & 24144 & 0.82 & 0.78 & $-$11.90 & 5.41 & 10.17 & 0.92 & $-$11.69 & 5.45 & 10.38 \\ 8.0 & 25898 & 0.87 & 0.71 & $-$12.61 & 5.30 & 9.46 & 0.83 & $-$12.27 & 5.36 & 9.81 \\ \hline 8.5 & 12139 & 0.37 & 1.00 & $-$6.38 & 6.47 & 16.70 & 1.00 & $-$6.38 & 6.47 & 16.70 \\ 8.5 & 14007 & 0.40 & 1.00 & $-$6.64 & 6.47 & 16.44 & 1.00 & $-$6.64 & 6.47 & 16.44 \\ 8.5 & 15961 & 0.43 & 1.00 & $-$6.99 & 6.43 & 16.09 & 1.00 & $-$6.99 & 6.43 & 16.09 \\ 8.5 & 18000 & 0.48 & 0.74 & $-$7.60 & 6.33 & 15.47 & 0.87 & $-$7.55 & 6.34 & 15.53 \\ 8.5 & 19955 & 0.55 & 0.77 & $-$8.62 & 6.14 & 14.46 & 0.90 & $-$8.47 & 6.17 & 14.60 \\ 8.5 & 22000 & 0.70 & 0.80 & $-$10.56 & 5.77 & 12.52 & 0.94 & $-$10.26 & 5.84 & 12.82 \\ 8.5 & 24143 & 0.82 & 1.16 & $-$11.93 & 5.54 & 11.14 & 1.36 & $-$11.65 & 5.59 & 11.43 \\ 8.5 & 25805 & 0.87 & 0.85 & $-$12.50 & 5.45 & 10.57 & 0.99 & $-$12.34 & 5.48 & 10.74 \\ 8.5 & 27934 & 0.94 & 0.70 & $-$13.27 & 5.33 & 9.81 & 0.82 & $-$12.97 & 5.38 & 10.10 \\ \hline 9.0 & 12124 & 0.35 & 1.00 & $-$7.69 & 6.28 & 16.39 & 1.00 & $-$7.69 & 6.28 & 16.39 \\ 9.0 & 14117 & 0.38 & 1.00 & $-$7.84 & 6.34 & 16.24 & 1.00 & $-$7.84 & 6.34 & 16.24 \\ 9.0 & 16029 & 0.41 & 1.00 & $-$8.09 & 6.33 & 15.99 & 1.00 & $-$8.09 & 6.33 & 15.99 \\ 9.0 & 17998 & 0.45 & 0.77 & $-$8.47 & 6.29 & 15.61 & 0.90 & $-$8.44 & 6.30 & 15.64 \\ 9.0 & 19961 & 0.50 & 0.64 & $-$9.18 & 6.17 & 14.90 & 0.75 & $-$9.10 & 6.18 & 14.97 \\ 9.0 & 21978 & 0.59 & 0.75 & $-$10.32 & 5.97 & 13.76 & 0.88 & $-$10.13 & 6.01 & 13.94 \\ 9.0 & 24082 & 0.72 & 0.81 & $-$12.00 & 5.66 & 12.08 & 0.95 & $-$11.72 & 5.71 & 12.36 \\ 9.0 & 26109 & 0.79 & 1.13 & $-$12.81 & 5.53 & 11.27 & 1.32 & $-$12.58 & 5.57 & 11.49 \\ 9.0 & 28143 & 0.85 & 0.79 & $-$13.41 & 5.43 & 10.67 & 0.92 & $-$13.25 & 5.46 & 10.83 \\ 9.0 & 30184 & 0.89 & 0.74 & $-$13.86 & 5.37 & 10.22 & 0.86 & $-$13.63 & 5.41 & 10.45 \\ 9.0 & 31440 & 0.92 & 0.72 & $-$14.18 & 5.32 & 9.90 & 0.84 & $-$13.89 & 5.37 & 10.19 \\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Same as Tab.~\ref{tab:3d_db_open_models10} but for MLT calibration of open bottom 3D DBA models with $\log{\rm{H}/\rm{He}} = -7$.} \label{tab:3d_db_open_models7} \begin{tabular}{lcccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & 3D~$s_{\rm{env}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $(\log{T_{\rm{b}}})_{\rm{S}}$ & $(\log{P_{\rm{b}}})_{\rm{S}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ & $(\log{T_{\rm{b}}})_{\rm{f}}$ & $(\log{P_{\rm{b}}})_{\rm{f}}$ \\ & (K) & ($10^9$ erg g$^{-1}$ K$^{-1}$) & & & (K) & (dyn cm$^{-2}$) & & & (K) & (dyn cm$^{-2}$) \\ \hline 7.5 & 12098 & 0.40 & 1.00 & $-$4.14 & 6.68 & 16.96 & 1.00 & $-$4.14 & 6.68 & 16.96 \\ 7.5 & 13967 & 0.44 & 0.91 & $-$4.56 & 6.63 & 16.53 & 1.06 & $-$4.54 & 6.63 & 16.56 \\ 7.5 & 15936 & 0.48 & 0.91 & $-$5.16 & 6.52 & 15.93 & 1.07 & $-$5.11 & 6.54 & 15.99 \\ 7.5 & 18051 & 0.59 & 0.91 & $-$6.57 & 6.25 & 14.51 & 1.06 & $-$6.39 & 6.29 & 14.69 \\ 7.5 & 19865 & 0.79 & 0.91 & $-$9.23 & 5.73 & 11.85 & 1.07 & $-$8.76 & 5.82 & 12.32 \\ 7.5 & 21873 & 0.94 & 0.79 & $-$11.06 & 5.41 & 10.02 & 0.92 & $-$10.83 & 5.45 & 10.25 \\ 7.5 & 23789 & 1.02 & 0.69 & $-$12.07 & 5.24 & 9.01 & 0.80 & $-$11.62 & 5.33 & 9.45 \\ \hline 8.0 & 12019 & 0.38 & 1.00 & $-$5.21 & 6.59 & 16.87 & 1.00 & $-$5.21 & 6.59 & 16.87 \\ 8.0 & 14083 & 0.42 & 1.00 & $-$5.57 & 6.56 & 16.51 & 1.00 & $-$5.57 & 6.56 & 16.51 \\ 8.0 & 16099 & 0.46 & 0.88 & $-$6.08 & 6.48 & 16.00 & 1.03 & $-$6.05 & 6.49 & 16.04 \\ 8.0 & 18074 & 0.52 & 0.82 & $-$6.96 & 6.32 & 15.13 & 0.96 & $-$6.86 & 6.34 & 15.23 \\ 8.0 & 20088 & 0.66 & 0.88 & $-$8.71 & 5.98 & 13.37 & 1.03 & $-$8.45 & 6.04 & 13.63 \\ 8.0 & 21996 & 0.82 & 1.10 & $-$10.82 & 5.59 & 11.26 & 1.29 & $-$10.38 & 5.67 & 11.70 \\ 8.0 & 24036 & 0.91 & 0.79 & $-$11.87 & 5.42 & 10.21 & 0.93 & $-$11.65 & 5.46 & 10.43 \\ 8.0 & 25956 & 0.97 & 0.71 & $-$12.61 & 5.30 & 9.46 & 0.83 & $-$12.27 & 5.36 & 9.81 \\ \hline 8.5 & 12147 & 0.37 & 1.00 & $-$6.38 & 6.47 & 16.69 & 1.00 & $-$6.38 & 6.47 & 16.69 \\ 8.5 & 14004 & 0.40 & 1.00 & $-$6.64 & 6.47 & 16.44 & 1.00 & $-$6.64 & 6.47 & 16.44 \\ 8.5 & 15958 & 0.43 & 1.00 & $-$6.99 & 6.43 & 16.09 & 1.00 & $-$6.99 & 6.43 & 16.09 \\ 8.5 & 17998 & 0.48 & 0.74 & $-$7.60 & 6.33 & 15.48 & 0.87 & $-$7.55 & 6.34 & 15.53 \\ 8.5 & 19951 & 0.55 & 0.77 & $-$8.62 & 6.14 & 14.46 & 0.90 & $-$8.47 & 6.17 & 14.60 \\ 8.5 & 22002 & 0.70 & 0.80 & $-$10.56 & 5.77 & 12.52 & 0.94 & $-$10.26 & 5.84 & 12.82 \\ 8.5 & 24047 & 0.81 & 1.15 & $-$11.90 & 5.54 & 11.17 & 1.35 & $-$11.59 & 5.60 & 11.49 \\ 8.5 & 25943 & 0.87 & 0.83 & $-$12.55 & 5.44 & 10.53 & 0.97 & $-$12.38 & 5.47 & 10.69 \\ 8.5 & 27907 & 0.94 & 0.69 & $-$13.27 & 5.33 & 9.81 & 0.81 & $-$12.98 & 5.38 & 10.10 \\ \hline 9.0 & 12120 & 0.35 & 1.00 & $-$7.69 & 6.28 & 16.39 & 1.00 & $-$7.69 & 6.28 & 16.39 \\ 9.0 & 14114 & 0.38 & 1.00 & $-$7.84 & 6.34 & 16.24 & 1.00 & $-$7.84 & 6.34 & 16.24 \\ 9.0 & 16026 & 0.41 & 1.00 & $-$8.09 & 6.33 & 15.99 & 1.00 & $-$8.09 & 6.33 & 15.99 \\ 9.0 & 17985 & 0.45 & 0.75 & $-$8.47 & 6.29 & 15.61 & 0.88 & $-$8.44 & 6.30 & 15.64 \\ 9.0 & 19957 & 0.50 & 0.64 & $-$9.18 & 6.17 & 14.90 & 0.75 & $-$9.10 & 6.18 & 14.97 \\ 9.0 & 21982 & 0.59 & 0.76 & $-$10.32 & 5.97 & 13.76 & 0.89 & $-$10.13 & 6.01 & 13.94 \\ 9.0 & 24093 & 0.72 & 0.81 & $-$12.00 & 5.66 & 12.08 & 0.95 & $-$11.72 & 5.71 & 12.36 \\ 9.0 & 26115 & 0.79 & 1.13 & $-$12.81 & 5.53 & 11.27 & 1.33 & $-$12.58 & 5.57 & 11.49 \\ 9.0 & 28141 & 0.85 & 0.79 & $-$13.41 & 5.43 & 10.67 & 0.92 & $-$13.25 & 5.46 & 10.83 \\ 9.0 & 30006 & 0.89 & 0.75 & $-$13.80 & 5.38 & 10.27 & 0.87 & $-$13.58 & 5.41 & 10.49 \\ 9.0 & 31472 & 0.92 & 0.72 & $-$14.18 & 5.32 & 9.89 & 0.85 & $-$13.89 & 5.37 & 10.19 \\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Same as Tab.~\ref{tab:3d_db_open_models10} but for MLT calibration of open bottom 3D DBA models with $\log{\rm{H}/\rm{He}} = -5$.} \label{tab:3d_db_open_models5} \begin{tabular}{lcccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & 3D~$s_{\rm{env}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $(\log{T_{\rm{b}}})_{\rm{S}}$ & $(\log{P_{\rm{b}}})_{\rm{S}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ & $(\log{T_{\rm{b}}})_{\rm{f}}$ & $(\log{P_{\rm{b}}})_{\rm{f}}$ \\ & (K) & ($10^9$ erg g$^{-1}$ K$^{-1}$) & & & (K) & (dyn cm$^{-2}$) & & & (K) & (dyn cm$^{-2}$) \\ \hline 7.5 & 12009 & 0.40 & 1.00 & $-$4.13 & 6.69 & 16.98 & 1.00 & $-$4.13 & 6.69 & 16.98 \\ 7.5 & 14013 & 0.44 & 0.85 & $-$4.59 & 6.62 & 16.51 & 0.99 & $-$4.56 & 6.63 & 16.54 \\ 7.5 & 15886 & 0.49 & 0.78 & $-$5.22 & 6.51 & 15.88 & 0.91 & $-$5.14 & 6.53 & 15.95 \\ 7.5 & 17920 & 0.59 & 0.82 & $-$6.58 & 6.24 & 14.50 & 0.95 & $-$6.40 & 6.28 & 14.68 \\ 7.5 & 19900 & 0.79 & 0.93 & $-$9.24 & 5.73 & 11.84 & 1.09 & $-$8.78 & 5.82 & 12.30 \\ 7.5 & 21946 & 0.94 & 0.80 & $-$11.06 & 5.42 & 10.02 & 0.94 & $-$10.83 & 5.46 & 10.25 \\ 7.5 & 23757 & 1.02 & 0.68 & $-$12.07 & 5.24 & 9.01 & 0.80 & $-$11.62 & 5.33 & 9.45 \\ \hline 8.0 & 11978 & 0.38 & 1.00 & $-$5.23 & 6.58 & 16.86 & 1.00 & $-$5.23 & 6.58 & 16.86 \\ 8.0 & 14031 & 0.42 & 1.00 & $-$5.56 & 6.56 & 16.52 & 1.00 & $-$5.56 & 6.56 & 16.52 \\ 8.0 & 15974 & 0.46 & 0.74 & $-$6.09 & 6.48 & 15.99 & 0.86 & $-$6.05 & 6.49 & 16.04 \\ 8.0 & 17952 & 0.52 & 0.74 & $-$6.97 & 6.31 & 15.11 & 0.86 & $-$6.86 & 6.33 & 15.22 \\ 8.0 & 20012 & 0.66 & 0.84 & $-$8.71 & 5.98 & 13.37 & 0.98 & $-$8.45 & 6.04 & 13.63 \\ 8.0 & 21959 & 0.82 & 1.08 & $-$10.82 & 5.59 & 11.26 & 1.27 & $-$10.37 & 5.67 & 11.71 \\ 8.0 & 24014 & 0.91 & 0.79 & $-$11.87 & 5.42 & 10.21 & 0.93 & $-$11.65 & 5.46 & 10.43 \\ 8.0 & 25963 & 0.97 & 0.71 & $-$12.61 & 5.30 & 9.46 & 0.83 & $-$12.27 & 5.36 & 9.81 \\ \hline 8.5 & 11996 & 0.36 & 1.00 & $-$6.40 & 6.45 & 16.68 & 1.00 & $-$6.40 & 6.45 & 16.68 \\ 8.5 & 14012 & 0.40 & 1.00 & $-$6.66 & 6.46 & 16.42 & 1.00 & $-$6.66 & 6.46 & 16.42 \\ 8.5 & 15957 & 0.43 & 1.00 & $-$6.99 & 6.43 & 16.09 & 1.00 & $-$6.99 & 6.43 & 16.09 \\ 8.5 & 17956 & 0.48 & 0.66 & $-$7.65 & 6.32 & 15.43 & 0.77 & $-$7.57 & 6.34 & 15.51 \\ 8.5 & 19924 & 0.56 & 0.74 & $-$8.64 & 6.14 & 14.44 & 0.86 & $-$8.51 & 6.16 & 14.57 \\ 8.5 & 21962 & 0.70 & 0.78 & $-$10.56 & 5.78 & 12.52 & 0.92 & $-$10.26 & 5.83 & 12.81 \\ 8.5 & 24004 & 0.81 & 1.13 & $-$11.90 & 5.54 & 11.17 & 1.33 & $-$11.58 & 5.60 & 11.50 \\ 8.5 & 25938 & 0.87 & 0.83 & $-$12.55 & 5.44 & 10.53 & 0.97 & $-$12.38 & 5.47 & 10.69 \\ 8.5 & 27946 & 0.94 & 0.70 & $-$13.27 & 5.33 & 9.81 & 0.82 & $-$12.97 & 5.38 & 10.10 \\ \hline 9.0 & 12077 & 0.35 & 1.00 & $-$7.68 & 6.28 & 16.40 & 1.00 & $-$7.68 & 6.28 & 16.40 \\ 9.0 & 14059 & 0.38 & 1.00 & $-$7.84 & 6.34 & 16.24 & 1.00 & $-$7.84 & 6.34 & 16.24 \\ 9.0 & 15930 & 0.41 & 1.00 & $-$8.07 & 6.33 & 16.01 & 1.00 & $-$8.07 & 6.33 & 16.01 \\ 9.0 & 17885 & 0.45 & 0.65 & $-$8.48 & 6.28 & 15.60 & 0.76 & $-$8.45 & 6.29 & 15.63 \\ 9.0 & 19922 & 0.50 & 0.61 & $-$9.20 & 6.16 & 14.87 & 0.71 & $-$9.11 & 6.18 & 14.96 \\ 9.0 & 21942 & 0.59 & 0.74 & $-$10.32 & 5.97 & 13.76 & 0.86 & $-$10.13 & 6.01 & 13.94 \\ 9.0 & 24076 & 0.72 & 0.81 & $-$12.01 & 5.66 & 12.07 & 0.94 & $-$11.72 & 5.71 & 12.36 \\ 9.0 & 26099 & 0.79 & 1.13 & $-$12.81 & 5.53 & 11.27 & 1.32 & $-$12.58 & 5.57 & 11.50 \\ 9.0 & 28181 & 0.85 & 0.79 & $-$13.41 & 5.43 & 10.66 & 0.93 & $-$13.25 & 5.46 & 10.83 \\ 9.0 & 29952 & 0.89 & 0.74 & $-$13.80 & 5.38 & 10.27 & 0.87 & $-$13.58 & 5.41 & 10.50 \\ 9.0 & 31452 & 0.92 & 0.72 & $-$14.18 & 5.32 & 9.89 & 0.84 & $-$13.89 & 5.37 & 10.18 \\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Same as Tab.~\ref{tab:3d_db_open_models10} but for MLT calibration of open bottom 3D DBA models with $\log{\rm{H}/\rm{He}} = -4$.} \label{tab:3d_db_open_models4} \begin{tabular}{lcccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & 3D~$s_{\rm{env}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $(\log{T_{\rm{b}}})_{\rm{S}}$ & $(\log{P_{\rm{b}}})_{\rm{S}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ & $(\log{T_{\rm{b}}})_{\rm{f}}$ & $(\log{P_{\rm{b}}})_{\rm{f}}$ \\ & (K) & ($10^9$ erg g$^{-1}$ K$^{-1}$) & & & (K) & (dyn cm$^{-2}$) & & & (K) & (dyn cm$^{-2}$) \\ \hline 7.5 & 11983 & 0.40 & 1.00 & $-$4.21 & 6.67 & 16.89 & 1.00 & $-$4.21 & 6.67 & 16.89 \\ 7.5 & 13985 & 0.44 & 1.00 & $-$4.61 & 6.62 & 16.48 & 1.00 & $-$4.61 & 6.62 & 16.48 \\ 7.5 & 15973 & 0.49 & 0.85 & $-$5.27 & 6.50 & 15.83 & 0.99 & $-$5.21 & 6.51 & 15.88 \\ 7.5 & 17979 & 0.62 & 0.68 & $-$7.01 & 6.16 & 14.08 & 0.79 & $-$6.73 & 6.22 & 14.36 \\ 7.5 & 19932 & 0.82 & 0.86 & $-$9.67 & 5.65 & 11.41 & 1.00 & $-$9.11 & 5.75 & 11.97 \\ 7.5 & 22021 & 0.95 & 0.76 & $-$11.16 & 5.40 & 9.92 & 0.89 & $-$10.92 & 5.44 & 10.16 \\ 7.5 & 23465 & 1.01 & 0.68 & $-$11.92 & 5.27 & 9.15 & 0.80 & $-$11.53 & 5.35 & 9.55 \\ \hline 8.0 & 12008 & 0.39 & 1.00 & $-$5.30 & 6.57 & 16.78 & 1.00 & $-$5.30 & 6.57 & 16.78 \\ 8.0 & 13999 & 0.42 & 1.00 & $-$5.60 & 6.55 & 16.48 & 1.00 & $-$5.60 & 6.55 & 16.48 \\ 8.0 & 15994 & 0.46 & 0.80 & $-$6.11 & 6.47 & 15.97 & 0.93 & $-$6.08 & 6.48 & 16.00 \\ 8.0 & 18052 & 0.54 & 0.63 & $-$7.22 & 6.26 & 14.86 & 0.73 & $-$7.08 & 6.29 & 15.00 \\ 8.0 & 19991 & 0.68 & 0.74 & $-$8.98 & 5.92 & 13.10 & 0.86 & $-$8.66 & 5.99 & 13.41 \\ 8.0 & 21981 & 0.83 & 1.05 & $-$10.98 & 5.56 & 11.10 & 1.22 & $-$10.50 & 5.65 & 11.57 \\ 8.0 & 23953 & 0.91 & 0.78 & $-$11.88 & 5.42 & 10.20 & 0.91 & $-$11.65 & 5.46 & 10.43 \\ 8.0 & 25961 & 0.97 & 0.71 & $-$12.61 & 5.30 & 9.47 & 0.83 & $-$12.27 & 5.36 & 9.81 \\ \hline 8.5 & 12027 & 0.37 & 1.00 & $-$6.45 & 6.45 & 16.63 & 1.00 & $-$6.45 & 6.45 & 16.63 \\ 8.5 & 13981 & 0.40 & 1.00 & $-$6.70 & 6.45 & 16.38 & 1.00 & $-$6.70 & 6.45 & 16.38 \\ 8.5 & 15982 & 0.43 & 1.00 & $-$7.04 & 6.42 & 16.04 & 1.00 & $-$7.04 & 6.42 & 16.04 \\ 8.5 & 17951 & 0.49 & 0.57 & $-$7.76 & 6.29 & 15.32 & 0.66 & $-$7.67 & 6.31 & 15.41 \\ 8.5 & 19972 & 0.57 & 0.68 & $-$8.81 & 6.11 & 14.27 & 0.79 & $-$8.63 & 6.14 & 14.45 \\ 8.5 & 21956 & 0.72 & 0.73 & $-$10.73 & 5.74 & 12.35 & 0.86 & $-$10.39 & 5.81 & 12.68 \\ 8.5 & 23980 & 0.82 & 1.10 & $-$11.95 & 5.53 & 11.13 & 1.28 & $-$11.65 & 5.59 & 11.43 \\ 8.5 & 26006 & 0.88 & 0.82 & $-$12.58 & 5.44 & 10.50 & 0.96 & $-$12.41 & 5.46 & 10.67 \\ 8.5 & 27829 & 0.94 & 0.69 & $-$13.26 & 5.33 & 9.82 & 0.80 & $-$12.98 & 5.38 & 10.10 \\ \hline 9.0 & 12055 & 0.35 & 1.00 & $-$7.74 & 6.27 & 16.33 & 1.00 & $-$7.74 & 6.27 & 16.33 \\ 9.0 & 14023 & 0.38 & 1.00 & $-$7.88 & 6.33 & 16.20 & 1.00 & $-$7.88 & 6.33 & 16.20 \\ 9.0 & 16020 & 0.41 & 1.00 & $-$8.13 & 6.32 & 15.94 & 1.00 & $-$8.13 & 6.32 & 15.94 \\ 9.0 & 17972 & 0.45 & 0.53 & $-$8.57 & 6.27 & 15.50 & 0.62 & $-$8.54 & 6.27 & 15.54 \\ 9.0 & 19968 & 0.51 & 0.56 & $-$9.29 & 6.14 & 14.78 & 0.65 & $-$9.20 & 6.16 & 14.87 \\ 9.0 & 21957 & 0.60 & 0.68 & $-$10.45 & 5.94 & 13.62 & 0.79 & $-$10.27 & 5.98 & 13.81 \\ 9.0 & 23971 & 0.72 & 0.77 & $-$12.00 & 5.66 & 12.08 & 0.91 & $-$11.72 & 5.71 & 12.36 \\ 9.0 & 26018 & 0.79 & 1.11 & $-$12.80 & 5.53 & 11.27 & 1.29 & $-$12.57 & 5.57 & 11.50 \\ 9.0 & 27982 & 0.84 & 0.80 & $-$13.37 & 5.44 & 10.70 & 0.93 & $-$13.23 & 5.46 & 10.85 \\ 9.0 & 29948 & 0.89 & 0.74 & $-$13.81 & 5.38 & 10.27 & 0.87 & $-$13.58 & 5.41 & 10.50 \\ 9.0 & 31360 & 0.92 & 0.71 & $-$14.18 & 5.32 & 9.89 & 0.84 & $-$13.89 & 5.37 & 10.18 \\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Same as Tab.~\ref{tab:3d_db_open_models10} but for MLT calibration of open bottom 3D DBA models with $\log{\rm{H}/\rm{He}} = -3$.} \label{tab:3d_db_open_models3} \begin{tabular}{lcccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & 3D~$s_{\rm{env}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $(\log{T_{\rm{b}}})_{\rm{S}}$ & $(\log{P_{\rm{b}}})_{\rm{S}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ & $(\log{T_{\rm{b}}})_{\rm{f}}$ & $(\log{P_{\rm{b}}})_{\rm{f}}$ \\ & (K) & ($10^9$ erg g$^{-1}$ K$^{-1}$) & & & (K) & (dyn cm$^{-2}$) & & & (K) & (dyn cm$^{-2}$) \\ \hline 7.5 & 11980 & 0.40 & 1.00 & $-$4.56 & 6.59 & 16.54 & 1.00 & $-$4.56 & 6.59 & 16.54 \\ 7.5 & 13855 & 0.44 & 1.00 & $-$4.92 & 6.55 & 16.18 & 1.00 & $-$4.92 & 6.55 & 16.18 \\ 7.5 & 15805 & 0.49 & 1.00 & $-$5.51 & 6.45 & 15.58 & 1.00 & $-$5.51 & 6.45 & 15.58 \\ 7.5 & 18026 & 0.59 & 1.18 & $-$6.66 & 6.23 & 14.42 & 1.38 & $-$6.50 & 6.26 & 14.59 \\ 7.5 & 20035 & 0.80 & 1.08 & $-$9.39 & 5.70 & 11.69 & 1.27 & $-$8.93 & 5.79 & 12.15 \\ 7.5 & 22043 & 0.94 & 0.81 & $-$11.09 & 5.41 & 9.99 & 0.95 & $-$10.85 & 5.45 & 10.23 \\ 7.5 & 23752 & 1.02 & 0.69 & $-$12.05 & 5.25 & 9.02 & 0.81 & $-$11.62 & 5.33 & 9.45 \\ \hline 8.0 & 12007 & 0.38 & 1.00 & $-$5.61 & 6.51 & 16.48 & 1.00 & $-$5.61 & 6.51 & 16.48 \\ 8.0 & 13961 & 0.42 & 1.00 & $-$5.92 & 6.48 & 16.16 & 1.00 & $-$5.92 & 6.48 & 16.16 \\ 8.0 & 16040 & 0.46 & 1.00 & $-$6.37 & 6.42 & 15.72 & 1.00 & $-$6.37 & 6.42 & 15.72 \\ 8.0 & 17985 & 0.52 & 1.00 & $-$7.13 & 6.28 & 14.95 & 1.00 & $-$7.13 & 6.28 & 14.95 \\ 8.0 & 20088 & 0.66 & 1.02 & $-$8.79 & 5.96 & 13.29 & 1.19 & $-$8.53 & 6.02 & 13.55 \\ 8.0 & 22047 & 0.83 & 1.17 & $-$10.89 & 5.57 & 11.18 & 1.37 & $-$10.44 & 5.66 & 11.63 \\ 8.0 & 24002 & 0.91 & 0.79 & $-$11.88 & 5.42 & 10.20 & 0.93 & $-$11.66 & 5.45 & 10.42 \\ 8.0 & 25904 & 0.97 & 0.71 & $-$12.61 & 5.30 & 9.47 & 0.83 & $-$12.27 & 5.36 & 9.81 \\ \hline 8.5 & 12027 & 0.37 & 1.00 & $-$6.74 & 6.41 & 16.34 & 1.00 & $-$6.74 & 6.41 & 16.34 \\ 8.5 & 13985 & 0.40 & 1.00 & $-$6.96 & 6.40 & 16.11 & 1.00 & $-$6.96 & 6.40 & 16.11 \\ 8.5 & 15988 & 0.43 & 1.00 & $-$7.28 & 6.37 & 15.80 & 1.00 & $-$7.28 & 6.37 & 15.80 \\ 8.5 & 18029 & 0.48 & 1.00 & $-$7.80 & 6.29 & 15.28 & 1.00 & $-$7.80 & 6.29 & 15.28 \\ 8.5 & 20043 & 0.56 & 1.02 & $-$8.71 & 6.12 & 14.37 & 1.19 & $-$8.57 & 6.15 & 14.51 \\ 8.5 & 22050 & 0.71 & 0.88 & $-$10.63 & 5.77 & 12.45 & 1.03 & $-$10.36 & 5.81 & 12.72 \\ 8.5 & 24011 & 0.81 & 1.18 & $-$11.90 & 5.54 & 11.18 & 1.38 & $-$11.61 & 5.59 & 11.47 \\ 8.5 & 25884 & 0.87 & 0.83 & $-$12.56 & 5.44 & 10.52 & 0.97 & $-$12.38 & 5.47 & 10.69 \\ 8.5 & 27602 & 0.94 & 0.67 & $-$13.26 & 5.33 & 9.81 & 0.79 & $-$12.97 & 5.38 & 10.10 \\ \hline 9.0 & 11994 & 0.35 & 1.00 & $-$8.06 & 6.22 & 16.02 & 1.00 & $-$8.06 & 6.22 & 16.02 \\ 9.0 & 13967 & 0.38 & 1.00 & $-$8.14 & 6.27 & 15.94 & 1.00 & $-$8.14 & 6.27 & 15.94 \\ 9.0 & 15970 & 0.41 & 1.00 & $-$8.32 & 6.28 & 15.75 & 1.00 & $-$8.32 & 6.28 & 15.75 \\ 9.0 & 18038 & 0.45 & 1.00 & $-$8.65 & 6.25 & 15.43 & 1.00 & $-$8.65 & 6.25 & 15.43 \\ 9.0 & 20045 & 0.50 & 0.98 & $-$9.24 & 6.15 & 14.83 & 1.15 & $-$9.18 & 6.17 & 14.90 \\ 9.0 & 22057 & 0.60 & 0.90 & $-$10.40 & 5.95 & 13.68 & 1.05 & $-$10.23 & 5.99 & 13.84 \\ 9.0 & 24026 & 0.72 & 0.86 & $-$11.97 & 5.67 & 12.11 & 1.01 & $-$11.70 & 5.72 & 12.38 \\ 9.0 & 25997 & 0.79 & 1.15 & $-$12.79 & 5.53 & 11.29 & 1.35 & $-$12.57 & 5.57 & 11.51 \\ 9.0 & 28015 & 0.85 & 0.78 & $-$13.42 & 5.43 & 10.65 & 0.91 & $-$13.25 & 5.46 & 10.82 \\ 9.0 & 29929 & 0.89 & 0.73 & $-$13.85 & 5.37 & 10.23 & 0.85 & $-$13.62 & 5.41 & 10.46 \\ 9.0 & 31340 & 0.92 & 0.70 & $-$14.23 & 5.31 & 9.84 & 0.82 & $-$13.93 & 5.36 & 10.15 \\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Same as Tab.~\ref{tab:3d_db_open_models10} but for MLT calibration of open bottom 3D DBA models with $\log{\rm{H}/\rm{He}} = -2$.} \label{tab:3d_db_open_models2} \begin{tabular}{lcccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & 3D~$s_{\rm{env}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $(\log{T_{\rm{b}}})_{\rm{S}}$ & $(\log{P_{\rm{b}}})_{\rm{S}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ & $(\log{T_{\rm{b}}})_{\rm{f}}$ & $(\log{P_{\rm{b}}})_{\rm{f}}$ \\ & (K) & ($10^9$ erg g$^{-1}$ K$^{-1}$) & & & (K) & (dyn cm$^{-2}$) & & & (K) & (dyn cm$^{-2}$) \\ \hline 7.5 & 11977 & 0.45 & 1.00 & $-$5.24 & 6.44 & 15.85 & 1.00 & $-$5.24 & 6.44 & 15.85 \\ 7.5 & 13995 & 0.49 & 1.00 & $-$5.84 & 6.35 & 15.24 & 1.00 & $-$5.84 & 6.35 & 15.24 \\ 7.5 & 16063 & 0.56 & 1.00 & $-$6.97 & 6.15 & 14.11 & 1.00 & $-$6.97 & 6.15 & 14.11 \\ 7.5 & 17963 & 0.68 & 1.00 & $-$8.78 & 5.80 & 12.30 & 1.00 & $-$8.78 & 5.80 & 12.30 \\ 7.5 & 20042 & 0.88 & 1.11 & $-$10.38 & 5.52 & 10.70 & 1.30 & $-$10.23 & 5.55 & 10.85 \\ 7.5 & 21944 & 0.98 & 0.68 & $-$11.49 & 5.34 & 9.59 & 0.80 & $-$11.19 & 5.39 & 9.89 \\ 7.5 & 22925 & 1.02 & 0.65 & $-$12.00 & 5.25 & 9.08 & 0.76 & $-$11.60 & 5.33 & 9.48 \\ \hline 8.0 & 12044 & 0.43 & 1.00 & $-$6.26 & 6.37 & 15.82 & 1.00 & $-$6.26 & 6.37 & 15.82 \\ 8.0 & 13953 & 0.46 & 1.00 & $-$6.63 & 6.33 & 15.45 & 1.00 & $-$6.63 & 6.33 & 15.45 \\ 8.0 & 15983 & 0.50 & 1.00 & $-$7.28 & 6.22 & 14.80 & 1.00 & $-$7.28 & 6.22 & 14.80 \\ 8.0 & 17961 & 0.58 & 1.00 & $-$8.44 & 6.01 & 13.64 & 1.00 & $-$8.44 & 6.01 & 13.64 \\ 8.0 & 19903 & 0.74 & 1.11 & $-$9.87 & 5.75 & 12.21 & 1.29 & $-$9.50 & 5.82 & 12.58 \\ 8.0 & 22026 & 0.88 & 0.81 & $-$11.55 & 5.46 & 10.53 & 0.94 & $-$11.40 & 5.48 & 10.67 \\ 8.0 & 24006 & 0.94 & 0.69 & $-$12.21 & 5.36 & 9.86 & 0.81 & $-$11.96 & 5.40 & 10.12 \\ 8.0 & 25333 & 0.98 & 0.68 & $-$12.64 & 5.29 & 9.43 & 0.80 & $-$12.30 & 5.35 & 9.78 \\ \hline 8.5 & 12013 & 0.41 & 1.00 & $-$7.34 & 6.28 & 15.74 & 1.00 & $-$7.34 & 6.28 & 15.74 \\ 8.5 & 14013 & 0.44 & 1.00 & $-$7.57 & 6.28 & 15.51 & 1.00 & $-$7.57 & 6.28 & 15.51 \\ 8.5 & 15994 & 0.47 & 1.00 & $-$8.00 & 6.22 & 15.08 & 1.00 & $-$8.00 & 6.22 & 15.08 \\ 8.5 & 17996 & 0.52 & 1.00 & $-$8.70 & 6.10 & 14.37 & 1.00 & $-$8.70 & 6.10 & 14.37 \\ 8.5 & 19962 & 0.63 & 1.00 & $-$9.84 & 5.90 & 13.24 & 1.00 & $-$9.84 & 5.90 & 13.24 \\ 8.5 & 22044 & 0.80 & 0.93 & $-$11.73 & 5.56 & 11.35 & 1.09 & $-$11.28 & 5.64 & 11.80 \\ 8.5 & 24025 & 0.86 & 0.81 & $-$12.38 & 5.46 & 10.70 & 0.95 & $-$12.23 & 5.48 & 10.84 \\ 8.5 & 25969 & 0.90 & 0.73 & $-$12.83 & 5.39 & 10.25 & 0.86 & $-$12.63 & 5.43 & 10.45 \\ 8.5 & 27179 & 0.94 & 0.66 & $-$13.30 & 5.32 & 9.78 & 0.77 & $-$13.01 & 5.37 & 10.07 \\ \hline 9.0 & 12025 & 0.39 & 1.00 & $-$8.53 & 6.15 & 15.54 & 1.00 & $-$8.53 & 6.15 & 15.54 \\ 9.0 & 13986 & 0.42 & 1.00 & $-$8.63 & 6.19 & 15.44 & 1.00 & $-$8.63 & 6.19 & 15.44 \\ 9.0 & 16001 & 0.45 & 1.00 & $-$8.89 & 6.18 & 15.19 & 1.00 & $-$8.89 & 6.18 & 15.19 \\ 9.0 & 17981 & 0.48 & 1.00 & $-$9.35 & 6.11 & 14.73 & 1.00 & $-$9.35 & 6.11 & 14.73 \\ 9.0 & 20038 & 0.55 & 1.00 & $-$10.07 & 6.00 & 14.00 & 1.00 & $-$10.07 & 6.00 & 14.00 \\ 9.0 & 21923 & 0.68 & 0.79 & $-$11.51 & 5.73 & 12.56 & 0.93 & $-$11.23 & 5.79 & 12.85 \\ 9.0 & 24031 & 0.78 & 0.94 & $-$12.65 & 5.54 & 11.43 & 1.10 & $-$12.31 & 5.60 & 11.77 \\ 9.0 & 26031 & 0.83 & 0.84 & $-$13.18 & 5.46 & 10.90 & 0.98 & $-$13.05 & 5.48 & 11.02 \\ 9.0 & 27980 & 0.87 & 0.71 & $-$13.61 & 5.40 & 10.47 & 0.83 & $-$13.43 & 5.43 & 10.65 \\ 9.0 & 29843 & 0.91 & 0.69 & $-$14.00 & 5.34 & 10.07 & 0.81 & $-$13.75 & 5.38 & 10.33 \\ 9.0 & 31011 & 0.93 & 0.69 & $-$14.28 & 5.30 & 9.79 & 0.80 & $-$14.00 & 5.35 & 10.08 \\ \hline \end{tabular} \end{table*} \newpage \newpage \begin{table*} \centering \caption{MLT calibration for closed bottom 3D DB models, where $\langle$3D$\rangle$ $T_{\rm{b, \ S}}$ is the $\langle$3D$\rangle$~temperature at the bottom of the Schwarzschild~boundary, $\langle$3D$\rangle$ $P_{\rm{b, \ S}}$ is the $\langle$3D$\rangle$~pressure at the bottom of the Schwarzschild~boundary, ML2/$\alpha_{\rm{S}}$~is the calibrated ML2/$\alpha$~value for the Schwarzschild~boundary and $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ is the $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$~for the Schwarzschild~boundary. The same parameters are also given for the flux boundary and are denoted with a subscript `f'.} \label{tab:3d_db_modelsclosed10} \begin{tabular}{lccccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ S}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ S}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ f}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ f}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ \\ \hline 7.5 & 26497 & 4.98 & 7.85 & 0.76 & $-$13.20 & 5.10 & 8.28 & 0.85 & $-$12.76 \\ 7.5 & 27993 & 4.90 & 7.45 & 0.69 & $-$13.63 & 4.95 & 7.66 & 0.85 & $-$13.41 \\ 7.5 & 29991 & 4.87 & 7.24 & 0.42 & $-$13.84 & 4.86 & 7.19 & 0.65 & $-$13.82 \\ 7.5 & 32001 & 4.87 & 7.15 & 0.65 & $-$13.91 & 4.85 & 7.08 & 0.65 & $-$13.91 \\ \hline 8.0 & 28107 & 4.99 & 8.21 & 0.65 & $-$13.94 & 5.14 & 8.74 & 0.75 & $-$13.36 \\ 8.0 & 29997 & 4.94 & 7.86 & 0.72 & $-$14.24 & 5.03 & 8.24 & 0.85 & $-$13.84 \\ 8.0 & 31999 & 4.91 & 7.62 & 0.73 & $-$14.47 & 4.94 & 7.76 & 0.89 & $-$14.31 \\ 8.0 & 33999 & 4.89 & 7.43 & 0.65 & $-$14.63 & 4.87 & 7.35 & 0.65 & $-$14.63 \\ \hline 8.5 & 30567 & 5.03 & 8.58 & 0.63 & $-$14.59 & 5.20 & 9.14 & 0.74 & $-$13.96 \\ 8.5 & 32208 & 5.00 & 8.32 & 0.71 & $-$14.80 & 5.12 & 8.77 & 0.81 & $-$14.33 \\ 8.5 & 34020 & 4.95 & 8.00 & 0.75 & $-$15.09 & 5.02 & 8.27 & 0.87 & $-$14.80 \\ \hline 9.0 & 34105 & 5.05 & 8.78 & 0.64 & $-$15.38 & 5.21 & 9.28 & 0.75 & $-$14.81 \\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Same as Tab.~\ref{tab:3d_db_modelsclosed10} but for MLT calibration of closed bottom 3D DBA models with $\log{\rm{H}/\rm{He}} = -7$.} \label{tab:3d_modelsclosed7} \begin{tabular}{lccccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ S}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ S}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ f}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ f}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ \\ \hline 7.5 & 26501 & 4.98 & 7.84 & 0.75 & $-$13.21 & 5.11 & 8.29 & 0.85 & $-$12.75 \\ 7.5 & 27993 & 4.90 & 7.46 & 0.70 & $-$13.63 & 4.95 & 7.66 & 0.85 & $-$13.40 \\ 7.5 & 29993 & 4.87 & 7.25 & 0.57 & $-$13.83 & 4.87 & 7.21 & 0.65 & $-$13.82 \\ 7.5 & 32002 & 4.87 & 7.16 & 0.65 & $-$13.91 & 4.85 & 7.06 & 0.65 & $-$13.91 \\ \hline 8.0 & 28037 & 4.98 & 8.18 & 0.64 & $-$13.97 & 5.13 & 8.72 & 0.75 & $-$13.38 \\ 8.0 & 29963 & 5.00 & 8.04 & 0.80 & $-$14.01 & 5.12 & 8.49 & 0.90 & $-$13.55 \\ 8.0 & 32000 & 4.91 & 7.60 & 0.71 & $-$14.48 & 4.94 & 7.73 & 0.86 & $-$14.35 \\ 8.0 & 33999 & 4.89 & 7.43 & 0.65 & $-$14.63 & 4.87 & 7.35 & 0.65 & $-$14.63 \\ \hline 8.5 & 30514 & 5.03 & 8.59 & 0.63 & $-$14.58 & 5.21 & 9.15 & 0.74 & $-$13.94 \\ 8.5 & 32012 & 4.99 & 8.33 & 0.70 & $-$14.80 & 5.14 & 8.83 & 0.80 & $-$14.26 \\ 8.5 & 33949 & 4.95 & 8.00 & 0.74 & $-$15.09 & 5.02 & 8.28 & 0.87 & $-$14.79 \\ \hline 9.0 & 34021 & 5.06 & 8.82 & 0.65 & $-$15.33 & 5.21 & 9.29 & 0.75 & $-$14.79 \\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Same as Tab.~\ref{tab:3d_db_modelsclosed10} but for MLT calibration of closed bottom 3D DBA models with $\log{\rm{H}/\rm{He}} = -5$.} \label{tab:3d_modelsclosed5} \begin{tabular}{lccccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ S}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ S}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ f}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ f}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ \\ \hline 7.5 & 26522 & 4.97 & 7.83 & 0.75 & $-$13.23 & 5.10 & 8.27 & 0.85 & $-$12.77 \\ 7.5 & 27998 & 4.90 & 7.46 & 0.70 & $-$13.63 & 4.95 & 7.66 & 0.85 & $-$13.41 \\ 7.5 & 29992 & 4.87 & 7.25 & 0.49 & $-$13.84 & 4.86 & 7.19 & 0.65 & $-$13.82 \\ 7.5 & 32002 & 4.87 & 7.16 & 0.65 & $-$13.91 & 4.85 & 7.08 & 0.65 & $-$13.91 \\ \hline 8.0 & 28086 & 4.98 & 8.19 & 0.65 & $-$13.95 & 5.13 & 8.73 & 0.75 & $-$13.38 \\ 8.0 & 29989 & 4.94 & 7.87 & 0.72 & $-$14.24 & 5.03 & 8.24 & 0.85 & $-$13.84 \\ 8.0 & 32002 & 4.91 & 7.61 & 0.71 & $-$14.48 & 4.94 & 7.75 & 0.88 & $-$14.32 \\ 8.0 & 34000 & 4.89 & 7.43 & 0.65 & $-$14.63 & 4.87 & 7.35 & 0.65 & $-$14.63 \\ \hline 8.5 & 30517 & 5.02 & 8.59 & 0.63 & $-$14.58 & 5.21 & 9.16 & 0.74 & $-$13.93 \\ 8.5 & 32015 & 5.00 & 8.36 & 0.71 & $-$14.76 & 5.14 & 8.83 & 0.80 & $-$14.27 \\ 8.5 & 33947 & 4.95 & 8.00 & 0.74 & $-$15.09 & 5.02 & 8.29 & 0.87 & $-$14.78 \\ \hline 9.0 & 33986 & 5.06 & 8.82 & 0.65 & $-$15.33 & 5.21 & 9.30 & 0.75 & $-$14.79 \\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Same as Tab.~\ref{tab:3d_db_modelsclosed10} but for MLT calibration of closed bottom 3D DBA models with $\log{\rm{H}/\rm{He}} = -4$.} \label{tab:3d_modelsclosed4} \begin{tabular}{lccccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ S}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ S}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ f}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ f}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ \\ & (K) & (K) & (dyn cm$^{-2}$) & & & (K) & (dyn cm$^{-2}$) & \\ \hline 7.5 & 26632 & 4.97 & 7.81 & 0.76 & $-$13.24 & 5.09 & 8.23 & 0.86 & $-$12.81 \\ 7.5 & 28004 & 4.90 & 7.45 & 0.69 & $-$13.64 & 4.94 & 7.64 & 0.84 & $-$13.43 \\ 7.5 & 29993 & 4.87 & 7.25 & 0.51 & $-$13.84 & 4.86 & 7.19 & 0.65 & $-$13.82 \\ 7.5 & 32002 & 4.87 & 7.15 & 0.65 & $-$13.91 & 4.85 & 7.07 & 0.65 & $-$13.91 \\ \hline 8.0 & 28092 & 4.98 & 8.17 & 0.64 & $-$13.97 & 5.12 & 8.68 & 0.74 & $-$13.42 \\ 8.0 & 29994 & 4.94 & 7.87 & 0.72 & $-$14.23 & 5.04 & 8.25 & 0.85 & $-$13.82 \\ 8.0 & 32003 & 4.91 & 7.60 & 0.71 & $-$14.48 & 4.94 & 7.73 & 0.86 & $-$14.35 \\ 8.0 & 34000 & 4.89 & 7.43 & 0.65 & $-$14.63 & 4.87 & 7.35 & 0.65 & $-$14.63 \\ \hline 8.5 & 30490 & 5.03 & 8.61 & 0.63 & $-$14.56 & 5.20 & 9.15 & 0.73 & $-$13.95 \\ 8.5 & 32008 & 5.00 & 8.35 & 0.71 & $-$14.77 & 5.13 & 8.81 & 0.80 & $-$14.29 \\ 8.5 & 33963 & 4.95 & 8.00 & 0.75 & $-$15.09 & 5.01 & 8.27 & 0.87 & $-$14.80 \\ \hline 9.0 & 33988 & 5.06 & 8.83 & 0.65 & $-$15.33 & 5.21 & 9.30 & 0.75 & $-$14.79 \\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Same as Tab.~\ref{tab:3d_db_modelsclosed10} but for MLT calibration of closed bottom 3D DBA models with $\log{\rm{H}/\rm{He}} = -3$.} \label{tab:3d_modelsclosed3} \begin{tabular}{lccccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ S}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ S}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ f}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ f}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ \\ & (K) & (K) & (dyn cm$^{-2}$) & & & (K) & (dyn cm$^{-2}$) & \\ \hline 7.5 & 26670 & 4.95 & 7.74 & 0.74 & $-$13.34 & 5.06 & 8.15 & 0.85 & $-$12.91 \\ 7.5 & 28000 & 4.90 & 7.44 & 0.69 & $-$13.65 & 4.94 & 7.61 & 0.83 & $-$13.45 \\ 7.5 & 29999 & 4.87 & 7.24 & 0.54 & $-$13.84 & 4.85 & 7.15 & 0.65 & $-$13.82 \\ 7.5 & 32000 & 4.87 & 7.15 & 0.65 & $-$13.92 & 4.84 & 7.05 & 0.65 & $-$13.92 \\ \hline 8.0 & 28118 & 4.98 & 8.14 & 0.64 & $-$13.99 & 5.11 & 8.64 & 0.74 & $-$13.45 \\ 8.0 & 30001 & 4.94 & 7.83 & 0.71 & $-$14.27 & 5.02 & 8.18 & 0.84 & $-$13.90 \\ 8.0 & 31999 & 4.90 & 7.58 & 0.67 & $-$14.51 & 4.93 & 7.68 & 0.82 & $-$14.40 \\ 8.0 & 33980 & 4.89 & 7.43 & 0.65 & $-$14.63 & 4.87 & 7.36 & 0.65 & $-$14.63 \\ \hline 8.5 & 30364 & 5.03 & 8.59 & 0.62 & $-$14.58 & 5.20 & 9.14 & 0.72 & $-$13.96 \\ 8.5 & 31965 & 4.99 & 8.30 & 0.69 & $-$14.81 & 5.12 & 8.77 & 0.79 & $-$14.31 \\ 8.5 & 34038 & 4.95 & 7.99 & 0.75 & $-$15.10 & 5.01 & 8.26 & 0.88 & $-$14.81 \\ \hline 9.0 & 33917 & 5.06 & 8.84 & 0.65 & $-$15.31 & 5.21 & 9.31 & 0.75 & $-$14.77 \\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Same as Tab.~\ref{tab:3d_db_modelsclosed10} but for MLT calibration of closed bottom 3D DBA models with $\log{\rm{H}/\rm{He}} = -2$.} \label{tab:3d_modelsclosed2} \begin{tabular}{lccccccccccr} \hline $\log{g}$ & $T_{\rm{eff}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ S}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ S}}$ & ML2/$\alpha_{\rm{S}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{S}}$ & $\langle$3D$\rangle$ $T_{\rm{b, \ f}}$ & $\langle$3D$\rangle$ $P_{\rm{b, \ f}}$ & ML2/$\alpha_{\rm{f}}$ & $\log{(M_{\rm{CVZ}}/M_{\rm{tot}})}$$_{\rm{f}}$ \\ & (K) & (K) & (dyn cm$^{-2}$) & & & (K) & (dyn cm$^{-2}$) & \\ \hline 7.5 & 26471 & 4.93 & 7.67 & 0.71 & $-$13.43 & 5.02 & 8.04 & 0.84 & $-$13.04 \\ 7.5 & 27996 & 4.89 & 7.38 & 0.67 & $-$13.70 & 4.91 & 7.50 & 0.80 & $-$13.57 \\ 7.5 & 29982 & 4.87 & 7.22 & 0.65 & $-$13.84 & 4.85 & 7.13 & 0.65 & $-$13.84 \\ 7.5 & 32009 & 4.86 & 7.12 & 0.65 & $-$13.93 & 4.84 & 7.04 & 0.65 & $-$13.93 \\ \hline 8.0 & 27968 & 4.96 & 8.07 & 0.65 & $-$14.05 & 5.09 & 8.54 & 0.75 & $-$13.56 \\ 8.0 & 30013 & 4.93 & 7.77 & 0.71 & $-$14.32 & 4.99 & 8.06 & 0.86 & $-$14.01 \\ 8.0 & 31998 & 4.90 & 7.53 & 0.61 & $-$14.55 & 4.91 & 7.58 & 0.74 & $-$14.50 \\ 8.0 & 33989 & 4.88 & 7.41 & 0.65 & $-$14.65 & 4.86 & 7.33 & 0.65 & $-$14.65 \\ \hline 8.5 & 30535 & 5.01 & 8.45 & 0.64 & $-$14.69 & 5.17 & 8.99 & 0.75 & $-$14.10 \\ 8.5 & 31852 & 4.98 & 8.25 & 0.70 & $-$14.86 & 5.10 & 8.70 & 0.81 & $-$14.39 \\ 8.5 & 33930 & 4.94 & 7.95 & 0.75 & $-$15.14 & 5.00 & 8.20 & 0.89 & $-$14.87 \\ \hline 9.0 & 33770 & 5.05 & 8.78 & 0.66 & $-$15.36 & 5.20 & 9.27 & 0.76 & $-$14.81 \\ \hline \end{tabular} \end{table*}
\section{Introduction} \label{sec:intro} Linear mixed effects (LME) models play a central role in a wide range of analyses~\citep{DouglasBates2015FLMM}. Examples include longitudinal analysis~\citep{laird1982random}, meta-analysis~\citep{dersimonian1986meta}, and numerous domain-specific applications~\citep{zuur2009mixed}. Robust LME models are typically obtained by using heavy tailed error models for random effects. The Student's t distribution~\citep{pinheiro2001efficient}, as well as weighting functions~\citep{koller2016robustlmm} have been used. The resulting formulations are fit either by EM methods, estimating equations, or by MCMC~\citep{rosa2003robust}. In this paper, we take a different track, and extend the least trimmed squares (LTS) method to the ME setting. \blue{While LTS has found \blue{wide} use in a range of applications~\citep{AravkinDavis,yang2015robust,yang2018general}, trimming the ME likelihood extends prior \red{work}}. {\bf Contributions.} \red{In this paper, we consider a subclass of nonlinear mixed effects models.} We allow nonlinear measurements, priors, and constraints, but require that the random effects enter the model in a linear way. \blue{We call this class {\it partially nonlinear} ME models, and it covers a broad class of problems while allowing tractable algorithms.} \blue{We develop new conditions that guarantee the existence of estimators for partially nonlinear models, a trimming approach that robustifies any linear or partially nonlinear model against outliers, and algorithms for solving the nonconvex optimization problems required to find estimates with standard guarantees (convergence to stationary points). We also show splines (and associated shape constraints) can be used to capture key nonlinear relationships, and illustrate the full modeling capability on real-data examples based on dose-response relationships. } \begin{table}[h!] \caption{\label{table:novelty} Comparison with currently available robust mixed effects packages. } \begin{tabular}{|c|c|c|c|c|c|c|} \hline & \LimeTr & \texttt{metafor}& \begin{tabular}{c} \texttt{robumeta}\\ \texttt{metaplus}\end{tabular}& \begin{tabular} {c} \texttt{robustlmm}\\ \texttt{heavy}\end{tabular} & \texttt{clme}&\texttt{INLA}\\ \hline Robust option & \cmark & \xmark & \cmark &\cmark & \xmark & \cmark \\ \hline \begin{tabular}{c} Allows for known \\ observation variance \end{tabular} & \cmark & \cmark & \cmark & \xmark & \xmark & \cmark\\ \hline \begin{tabular}{c} Covariates in random \\ effects variance \end{tabular}& \cmark & \xmark & \xmark & \cmark &\cmark & \xmark \\ \hline Nonlinear observations & \cmark & \xmark & \xmark & \xmark & \xmark & \cmark \\ \hline Linear constraints & \cmark & \xmark & \xmark & \xmark & \cmark & \xmark \\ \hline Nonlinear constraints & \cmark & \xmark & \xmark & \xmark & \xmark & \xmark \\ \hline \end{tabular} \end{table} \noindent The main code to perform the inference is published as open source Python package called \LimeTr (Linear Mixed Effects with Trimming, pronounced {\it lime tree}). All synthetic experiments using \LimeTr have been submitted for review as supplementary material with this paper. The \LimeTr package allows functionality that is not available through other available open source tools. The functionality of \LimeTr is summarized in Table~\ref{table:novelty}. The paper proceeds as follows. In Section~\ref{sec:basics}, we describe the problem class of ME models and derive the marginal maximum likelihood (ML) estimator. In Section~\ref{sec:con}, we describe how constraints and priors are imposed on parameters. In Section~\ref{sec:trim}, we review trimming approaches and develop a new trimming extension for the ML approach. In Section~\ref{sec:algo}, we present a customized algorithm based on variable projection, along with a convergence analysis. In Section~\ref{sec:spline}, we discuss spline models for dose-response relationships and give examples of shape-constrained trimmed spline models. Section~\ref{sec:verify} shows the efficacy \blue{of} the methods for synthetic and empirical data. In Section~\ref{sec:synth}, we validate the ability of the method to detect outliers when working with heterogeneous longitudinal data, and compare with other packages. In Section~\ref{sec:real} we apply the method to analyze empirical data sets for both linear and nonlinear relationships using trimmed constrained MEs. This section highlights new capability of \LimeTr that is not available in other packages. \section{Methods} \label{sec:meth} \subsection{\blue{Notation and Modeling Concepts}} \blue{In this section, we define notation and concepts used throughout the paper. Additional definitions and notation are introduced in the analysis section. We use lower case letters to denote scalars, e.g. $\beta$, and scalar-valued functions, e.g. $f(\beta)$, and bold letters represent vectors, e.g. $\bm \beta$, and vector-valued functions, e.g. $\bm f_i(\bm\beta)$. We use capital bold letters to represent matrices, e.g. $\bm X$. All variables and vectors are real, i.e. in $\mathbb{R}^k$, with $k$ indicating dimension. For a smooth function $f: \mathbb{R}^{k} \rightarrow \mathbb{R}$, we denote the vector of first derivatives, or {\bf gradient}, by $\nabla f$, and the matrix of second derivatives, or {\bf Hessian}, by $\nabla^2 f$. We use $\mbox{diag}(\bm x)$ to denote a diagonal matrix whose diagonal is an input vector $\bm x$. We use $\bm M^{-1}$ to denote the inverse of a matrix, and denote weighted norms (Mahalanobis distances) by \[ \|\bm x\|_{\bm M}^2 := \bm x^T \bm M \bm x, \] and \red{$|\bf M|$ to denote the determinant of $\bf M$}. We use the $\odot$ notation to denote the Hadamard product or operation, so in particular \[ \bm x \odot \bm y = \begin{bmatrix} x_1 y_1 \\ \vdots \\ x_n y_n \end{bmatrix}, \quad \bm x^{\odot \bm y} = \begin{bmatrix} x_1^{y_1} \\ \vdots \\ x_n^{y_n} \end{bmatrix}. \] A {\bf likelihood} \red{maps parameters to an associated density function for observed data. In the mixed effects context, these parameters can be separated into {\bf fixed effects} (e.g. population mean) and {\bf random effects} (e.g. study-specific random intercept).} A {\bf marginal} likelihood function refers to the likelihood obtained by integrating out random effects from the joint likelihood. } \blue{ \red{We incorporate additional information about parameters using statistical priors, and restrict parameter domains using {\bf constraints}}. When constraints are present we use the term {\bf constrained likelihood}. We use {\bf trimming} ( Section~\ref{sec:trim}) to robustify a (marginal) likelihood, and use the term {\bf trimmed likelihood} to describe such likelihoods.} \blue{ The goal of an inference problem is to maximize the (marginal) likelihood or modified likelihood, or equivalently to minimize the negative logarithm of such a function, \red{called an {\bf objective function} in optimization.} The optimization problem specification includes constraints as well as the objective. We use $\min$ to refer to the minimum value of an optimization problem, and $\arg\min$ to refer to the minimizer, which corresponds to the {\bf estimator} \red{in this setting}. } \blue{ We define projection of a point $\bm x $ onto a closed set $C$ by \[ \red{\mbox{proj}}_C(\bm x) := \arg\min_{\bm y \in C} \frac{1}{2}\|\bm y-\bm x\|^2. \] } \subsection{Problem Class } \label{sec:basics} We consider the following mixed effects model: \begin{equation} \label{eq:coords} \begin{aligned} \bm y_{i} & = \bm f_i(\bm \beta) + \bm Z_i \bm u_i +\bm \epsilon_{i}, \quad \blue{i = 1, \dots, m}, \\ \bm u_i & \sim N(\bm 0, \bm \Gamma ), \quad \bm \Gamma = \mbox{diag}(\bm \gamma), \quad \bm \epsilon_{i} \sim N(\bm 0,\bm \Lambda_i), \end{aligned} \end{equation} \blue{where $m$ is the number of groups,} $\bm y_i \in \mathbb{R}^{n_i}$ is the vector of observations from the $i$th group, \blue{ and $n = \sum_i n_i$ is the total number of observations.} \blue{Measurement errors are denoted by $\bm\epsilon_i \in \mathbb{R}^{n_i}$}, with covariance $\bm \Lambda_i \blue{\in\mathbb{R}^{n_i \times n_i}}$, \blue{and we denote by $\bm \Lambda\in \mathbb{R}^{n\times n}$ the full block diagonal measurement error covariance matrix.} \blue{Regression coefficients are denoted by} $\bm \beta \blue{\in \mathbb{R}^{k_\beta}}$. \blue{Random effects are denoted by} $\bm u_i \in \mathbb{R}^{k_{\bm \gamma}}$, where $\bm Z_i \in \mathbb{R}^{n_i \times k_{\bm \gamma}}$ are linear maps. The \blue{functions} $\bm f_i \blue{: \mathbb{R}^{k_\beta} \rightarrow \mathbb{R}^{n_i}}$ may be nonlinear, but we restrict the random effects to enter in a linear way through the \blue{linear maps $\bm Z_i: \mathbb{R}^{k_\gamma}\rightarrow \mathbb{R}^{n_i}$}. A range of assumptions may be placed on $\bm \Lambda$. In longitudinal analysis, $\bm \Lambda$ is often a diagonal or block-diagonal matrix, parametrized by \blue{a small set of parameters, with the simplest example $\bm \Lambda = \sigma^2 \bm I$ where $\sigma^2$ is unknown}. In meta-analysis, $\bm \Lambda$ is a known diagonal matrix whose entries are variances for each input datum. \blue{We do not restrict the term `meta-analysis' to a single observation per study, since many analyses include multiple observations, such as summary results for quartiles based on exposure. The distinguishing feature of meta-analysis is the specification of a known $\bm \Lambda$ matrix.} \blue{For convenience, we denote by $\bm \theta$ the tuple of fixed parameters: \[ \bm \theta :=(\bm \beta, \bm \gamma, \bm \Lambda). \] } The joint likelihood \blue{corresponding to model~\eqref{eq:coords}} for $\bm \theta$ and random effects $\bm u$ is given by \begin{equation} \label{eq:ML} p(\bm \theta, \bm u | \bm y) = \frac{\exp\left(-\frac{1}{2}\|\bm u\|^2_{\bm \Gamma^{-1}}\right)}{\sqrt{|2\pi \bm \Gamma|}}\prod_{i=1}^m \frac{\exp\left(-\frac{1}{2}\|\bm y_{i} - \bm f_i(\bm \beta) - \bm Z_i \bm u\|^2_{\bm \Lambda^{-1}}\right)}{\sqrt{|2\pi \bm \Lambda_i|})} \end{equation} \blue{Maximizing~\eqref{eq:ML} with respect to both fixed and random parameters is problematic, as the number of random parameters $\bm u_i$ grows with the number of groups. In the extreme case of one observation per group, there are more unknowns than datapoints. Standard practice is to marginalize random effects, integrating~\eqref{eq:ML} with respect to all $\bm u_i$. The numerical estimation is then accomplished by taking the negative logarithm (a simplifying transformation) and minimizing the result, which is an equivalent problem to maximizing the marginal likelihood:} \begin{equation} \label{eq:MML} \begin{aligned} &\mathcal{L}_{ML} \blue{(\bm \theta)} = -\ln\left(\int p(\blue{\bm \theta}, \bm u | \bm y) d\bm u\right) \\ & \propto \sum_{i=1}^m \frac{1}{2}(\bm y_i - \bm f_i (\bm \beta))^\top (\bm Z_i \bm \Gamma\bm Z_i^\top + \bm \Lambda_i )^{-1}(\bm y_i - \bm f_i(\bm \beta)) + \frac{1}{2}\ln|\bm Z_i\bm \Gamma\bm Z_i^\top + \bm \Lambda_i |. \end{aligned} \end{equation} Problem~\eqref{eq:MML} is equivalent to a maximum likelihood formulation arising from a Gaussian model with correlated errors: \[ \bm y_i = \bm f_i (\bm \beta) + \bm \omega, \quad \bm \omega \sim N(\bm 0, \bm Z_i \bm \Gamma\bm Z_i^\top + \bm \Lambda_i ). \] The structure of this objective depends on the structural assumptions on $\bm \Lambda$. In the scope of this paper we always assume $\bm \Lambda$ is a diagonal matrix, namely all the measurement error are independent with each other. We restrict our numerical experiments to two particular classes: (1) $\bm \Lambda = \sigma^2 \bm I$ with $\sigma^2$ unknown, used in standard longitudinal analysis, and (2) the measurements variance is provided and used in meta-analysis. \LimeTr allows other structure options as well, for example group-specific unknown $\sigma_i^2$ that extends case (1), but we consider a simple set of synthetic results to help focus on robust capabilities. \subsection{Constraints and Priors} \label{sec:con} The ML estimate~\eqref{eq:MML} can be extended to incorporate linear and nonlinear inequality constraints \[ \bm C(\bm \theta) \leq \bm c, \] where $\bm \theta$ are any parameters of interest. Constraints play a key role in Section~\ref{sec:spline}, when we use polynomial splines to model nonlinear relationships. The trimming approach developed in the next section is applicable to both constrained and unconstrained ML estimates. In many applications it is essential to allow priors on parameters of interest $\bm \theta$. We assume that priors follow a distribution defined by the density function \[ \bm \theta \sim \exp(-\rho(\bm\theta)) \] where $\rho$ is smooth (but may be nonlinear and nonconvex). The likelihood problem is then augmented by adding the term $\rho(\bm \theta)$ to the ML objective~\eqref{eq:MML}. The most common use case is $\rho(\cdot) = \frac{1}{2\sigma_p^2}\|\cdot\|^2$, for some user-defined $\sigma_p^2$. In the next section we describe trimmed estimators, and extend them to the ME setting. \subsection{Trimming in Mixed Effect Models} \label{sec:trim} Least trimmed squares (LTS) is a robust estimator proposed by~\cite{rousseeuw1985multivariate,rousseeuw1993alternatives} for the standard regression problem. \blue{Starting from a standard least squares estimator,} \begin{equation} \label{eq:LTS} \min_{\bm \beta} \sum_{i=1}^n \frac{1}{2}(y_i - \langle \bm x_i, \bm \beta\rangle)^2, \end{equation} the LTS \blue{approach modifies~\eqref{eq:LTS} to minimize} the sum of {\it smallest $h$} residuals rather than all residuals. These estimators were initially introduced to develop linear regression estimators that have a high breakdown point (in this case 50\%) and good statistical efficiency (in this case $n^{-1/2}$).\footnote{Breakdown refers to the percentage of outlying points which can be added to a dataset before the resulting M-estimator can change in an unbounded way. Here, outliers can affect both the outcomes and training data.} LTS estimators are robust against outliers, and arbitrarily large deviations that are trimmed do not affect the final \blue{estimate}. \blue{The explicit LTS extension to~\eqref{eq:LTS} is formed by introducing} auxiliary variables $\bm w$: \begin{equation} \label{eq:LTSw} \min_{\bm \beta, \bm w} \sum_{i=1}^n w_i\left(\frac{1}{2} (y_i - \langle \bm x_i, \bm \beta\rangle)^2\right) \quad \mbox{s.t.} \quad \bm 1^\top \bm w = h, \quad \bm 0 \leq \bm w \leq \bm 1. \end{equation} The set \begin{equation} \label{eq:cappedSimplex} \Delta_h := \left\{ \bm w: \bm 1^\top \bm w = h, \quad \bm 0 \leq \bm w \leq \bm 1 \right\} \end{equation} is known as the {\it capped simplex}, since it is the intersection of the $h$-simplex with the unit box~(see e.g.~\cite{AravkinDavis} for details). For a fixed $\bm \beta$, the optimal solution of~\eqref{eq:LTSw} with respect to $\bm w$ assigns weight $1$ to each of the smallest $h$ residuals, and $0$ to the rest. Problem~\eqref{eq:LTSw} is solved {\it jointly} in $(\bm \beta, \bm w)$, simultaneously finding the regression estimate and classifying the observations into inliers and outliers. This joint strategy makes LTS different from post hoc analysis, where a model is first fit with all data, and then outliers are detected using that estimate. Several approaches for finding LTS and other trimmed M-estimators have been developed, including FAST-LTS~\citep{rousseeuw2006computing}, \blue{and} exact algorithms with exponential complexity~\citep{mount2014least}. The LTS approach~\eqref{eq:LTSw} does not depend on the form of the least squares function, and this insight has been used to extend LTS to a broad range of estimation problems, including generalized linear models~\citep{neykov2003breakdown}, high dimensional sparse regression~\citep{alfons2013sparse}, and graphical lasso~\citep{yang2015robust,yang2018general}. The most general problem class to date, presented by~\cite{AravkinDavis}, is formulated as \begin{equation} \label{eq:GLTSw} \min_{\bm \beta, \bm w} \sum_{i=1}^n w_if_i(\bm \beta) + R(\bm \beta) \quad \mbox{s.t.} \quad \bm 1^\top \bm w = h, \quad \bm 0 \leq \bm w \leq \bm 1. \end{equation} where $f_i$ are continuously differentiable (possibly nonconvex) functions and $R$ describes any regularizers and constraints (which may also be nonconvex). \red{Problem~\eqref{eq:MML} is not of the form~\eqref{eq:GLTSw}, except for the special case where we want to detect {\it entire outlying groups}}. This is limiting, since we want to differentiate measurements within groups. We solve the problem by using a new trimming formulation To explain the approach we focus on trimming a single group term from the likelihood~\eqref{eq:MML}: \[ \left( \frac{1}{2}(\bm y_i - \bm f_i (\bm \beta))^\top (\bm Z_i \bm \Gamma\bm Z_i^\top + \bm \Lambda_i )^{-1}(\bm y_i - \bm f_i(\bm \beta)) + \frac{1}{2}\ln|\bm Z_i \bm \Gamma\bm Z_i^\top + \bm \Lambda_i | \right) \] Here, $\bm y_i \in \mathbb{R}^{n_i}$, where $n_i$ is the number of observations in the $i$th group. To trim observations within the group, we introduce auxiliary variables $\bm w_i \in \mathbb{R}^{n_i}$, and define \[ \begin{aligned} \bm r_i := \bm y_i - \bm f_i (\bm \beta), \quad \bm W_i := \mbox{diag}(\bm w_i), \quad \sqrt{\bm W_i} := \mbox{diag}(\sqrt{\bm w_i}). \end{aligned} \] We now form the objective \begin{equation} \label{eq:trimGroup} \begin{aligned} \frac{1}{2} \bm r_i^\top \sqrt{\bm W_i}\left(\sqrt{\bm W_i} \bm Z_i\bm \Gamma\bm Z_i^\top\sqrt{\bm W_i} + \bm \Lambda_i^{\odot \bm w_i} \right)^{-1}\sqrt{\bm W_i} \bm r_i + \frac{1}{2}\ln\left|\sqrt{\bm W_i} \bm Z_i \bm \Gamma\bm Z_i^\top \sqrt{\bm W_i} + \bm \Lambda_i^{\odot \bm w_i}\right|, \end{aligned} \end{equation} where $^\odot$ denotes the elementwise power operation: \begin{equation} \label{eq:notationDef} \bm \Lambda_i^{\odot \bm w_i} := \begin{bmatrix} (\lambda_{i\red{1}})^{w_{i1}} & 0 & \dots & 0 \\ 0 & \ddots & \ddots& \vdots \\ 0 & \dots & 0 & (\lambda_{in_i})^{w_{in_i}}. \end{bmatrix} \end{equation} When $w_{ij} =1$, we recover the contribution of the $ij$th observation to the original likelihood. As $w_{ij} \downarrow 0$, The $ij$th contribution to the residual is correctly eliminated by $\sqrt{w_{ij}} \downarrow 0$. The $j$th row and column of $\sqrt{\bm W_i} \bm Z_i \bm \Gamma\bm Z_i^\top \sqrt{\bm W_i}$ both go to $0$, while the $j$th entry of $\bm \Lambda_i^{\odot \bm w_i}$ goes to $1$, which removes all impact of the $j$th point. \red{Specifically, the matrix $\sqrt{\bm W_i} \bm Z_i \bm \Gamma\bm Z_i^\top \sqrt{\bm W_i} + \bm \Lambda_i^{\odot \bm w_i}$ with $w_{ij}=0$ and all remaining $w_{i\cdot} = 1$ is the same as the matrix $\bm Z_i \bm \Gamma\bm Z_i^\top + \bm \Lambda_i$ obtained after deleting the $ij$-th point.} Combining trimmed ML with priors and constraints, we obtain the following \red{modified log-likelihood}: \begin{equation} \label{eq:trimGroupFull} \begin{aligned} \min_{\blue{\bm \theta}, \bm w} \mathcal{L}(\blue{\bm\theta}, \bm w) := & \sum_{i=1}^m \frac{1}{2} \bm r_i^\top \sqrt{\bm W_i} \left(\sqrt{\bm W_i} \bm Z_i \bm \Gamma\bm Z_i^\top\sqrt{\bm W_i} + \bm \Lambda_i^{\odot \bm w_i} \right)^{-1} \sqrt{\bm W_i} \bm r_i + \\ &\frac{1}{2}\ln\left|\sqrt{\bm W_i} \bm Z_i \bm \Gamma\bm Z_i^\top \sqrt{\bm W_i} + \bm \Lambda_i^{\odot \bm w_i}\right| + \rho(\bm \beta, \bm \gamma, \bm \Lambda)\\ & \mbox{s.t.} \quad \bm r_i = \bm y_i - \bm f_i (\bm \beta), \quad \bm 1^\top \bm w = h, \quad \bm 0 \leq \bm w \leq \bm 1, \quad \bm C\left(\begin{matrix} \bm \beta\\ \bm \gamma\\ \bm \Lambda \end{matrix}\right) \leq \bm c. \end{aligned} \end{equation} \red{Problem}~\eqref{eq:trimGroupFull} has not been previously considered in the literature. We present a specialized algorithm \red{and analysis} in the next section. \subsection{Fitting Trimmed Constrained MEs: Algorithm and Analysis} \label{sec:algo} \red{Problem}~\eqref{eq:trimGroupFull} is nonsmooth and nonconvex. The key to algorithm design and analysis is to decouple this structure, and reduce the estimator to solving a smooth nonconvex value function over a convex set. This allows an efficient approach that combines classic nonlinear programming with first-order approaches for optimizing nonsmooth nonconvex problems. We partially minimize with respect to $(\bm \beta, \bm \gamma, \bm \Lambda)$ using an interior point method, and then optimize the resulting value function with respect to $\bm w$ using a first-order method. The approach leverages ideas from variable projection~\citep{golub1973differentiation,golub2003separable,aravkin2012estimating,aravkin2018efficient}. We define $\bm \theta = (\bm \beta, \bm \gamma, \bm \Lambda)$, the implicit solution $\bm \theta(\bm w)$ and value function $v(\bm w)$ as follows: \begin{equation} \label{eq:v} \begin{aligned} \bm \theta(\bm w) & := \arg\min_{\bm \theta} \mathcal{L}(\bm \theta, \bm w) \quad \mbox{s.t.} \quad \bm C(\bm \theta) \leq \bm c\\ v(\bm w) &:= \min_{\bm\theta} \mathcal{L}(\bm \theta, \bm w) \quad \mbox{s.t.} \quad \bm C(\bm \theta) \leq \bm c \end{aligned} \end{equation} where $\mathcal{L}(\bm\theta, \bm w)$ is given in~\eqref{eq:trimGroupFull}. \red{The term $\bm\theta(\bm w)$ refers to the entire set of minimizers for a given $w$, which may not necessarily be a singleton.} \blue{We first develop conditions and theory to guarantee the existence of minimizers $\bm \theta(\bm w)$. While there are results in the literature for particular classes of linear mixed effects models, conditions for the existence of minimizers for the partial nonlinear case~\eqref{eq:trimGroupFull} have not been derived. Both~\cite{harville2018linear} and~\cite{davidian1995nonlinear} analyze the Aitken model, where $\red{\bm \Lambda} = \sigma^2 \bm H$ for a nonsingular $\bm H$, by essentially deriving the closed form estimates for $\bm\theta$ in this case, where the conditions that the residual is not exactly $0$ guarantees a positive estimator for $\sigma^2$. In the nonlinear case~\eqref{eq:trimGroupFull}, this is not possible, and to guarantee existence of minimizers we have to obtain some conditions for model validity. \\ Let $\mathcal{S}_{++}$ denote the \red{set} of positive definite matrices, and for $\bm M \in \mathcal{S}_{++}$ consider the function \begin{equation} \label{eq:fmr} f(\bm M, \bm r) = \bm r^T \bm M^{-1} \bm r + \ln|\bm M|. \end{equation} To connect the general functional form~\eqref{eq:fmr} with the problem~\eqref{eq:trimGroupFull}, we specify functional domains for feasible $\bm r$ amd $\bm M$. \begin{definition}[Domains] We define domains $\mathcal{D}_r$ for $\bm r$ and $\mathcal{D}_M$ for $\bm M$ as follows: \[\begin{aligned} \mathcal{D}_r &: = \{\bm y - \bm f(\bm \beta): \forall \bm \beta\}, \quad\\ \mathcal{D}_M &: = \{ \bm Z \mathrm{Diag}(\bm \gamma) \bm Z^\top + \bm\Lambda(\bm \sigma): \forall \bm \gamma \ge 0, \forall \bm \sigma> 0\}. \end{aligned}\] \end{definition} Using these definitions, we can write our objective as \begin{equation} \label{eq: simple_obj} \min_{\bm r \in\mathcal{D}_r, \bm M \in\mathcal{D}_M} f(\bm r, \bm M) \end{equation} for $f$ in~\eqref{eq:fmr}. We also need to define the {\bf level set} of a function. \begin{definition}[Level set] The $\alpha$-level set of a function $f:\mathbb{R}^k \rightarrow \mathbb{R}$, denoted $\mathcal{L}_{f,\alpha}$, is defined by \[ \mathcal{L}_{f,\alpha} := \{\bm \theta: f(\bm \theta) \leq \alpha\} \] \end{definition} To guarantee the existence of estimators $(\bm \theta)$ we make two assumptions. \begin{assumption} \label{ass: Dr_closed} We assume that the image of $\bm f$ is closed. This implies that $\mathcal{D}_r$ is closed. \end{assumption} \begin{assumption} \label{ass: r_nonzero} Denote the eigenvalue decomposition for any $\bm M \in \mathcal{D}_m$ by $\bm M = \bm X_M \mbox{Diag}(\bm \lambda_M) \bm X_M^\top$. For $\forall \bm r \in \mathcal{D}_r$ and $\forall \bm M \in \mathcal{D}_M$, we assume there exist $\alpha > 0$ such that \begin{equation} \label{eq:keyeq} \min_{i} \max(|\tilde r_i|, \lambda_i) \ge \alpha \end{equation} where $\tilde{\bm r} = X_M^\top \bm r$ and $\lambda_i$ is the corresponding eigenvalue. \end{assumption} Assumption~\ref{ass: r_nonzero} tells us that, after being pre-whitened by the covariance matrix, either the residual is bounded away from 0 or else the corresponding eigenvalue is bounded away from zero. These assumptions are necessary and sufficient for the existence of minimizers. Before we proceed, we make a simple remark about the meta-analysis case. \begin{remark} \label{rem:meta} Assumption~\ref{ass: r_nonzero} is always satisfied for the case of meta-analysis, as long as all reported covariance matrices are positive definite. \end{remark} The remark follows because in the meta-analysis case, $\bm\Lambda$ is block diagonal, with blocks precisely the covariance matrices reported by studies. For many functions $\bf f$, Assumption~\ref{ass: Dr_closed} is satisfied, including all linear and piecewise linear-quadratic functions. Functions that may violate these assumptions include logarithms and fractional functions, and complex models may therefore require further analysis. We can now prove the following lemma. \begin{theorem} \label{lem: level_set_compact} Under Assumption~\ref{ass: Dr_closed} and Assumption~\ref{ass: r_nonzero}, all level sets $\mathcal{L}_{f,\alpha}$ for $f$ in \eqref{eq: simple_obj} are bounded. Moreover, all level sets $\mathcal{L}_{f,\alpha}$ for $f$ in \eqref{eq: simple_obj} are closed. \end{theorem} {\bf Proof:} We first prove that \[ \|\bm r\|_2^2 + \|\bm M\|_F^2 \rightarrow \infty \quad \Rightarrow \quad f(\bm r, \bm M) \rightarrow \infty, \] which implies bounded level sets. From \eqref{eq: simple_obj} and the eigenvalue decomposition, we have \[ \begin{aligned} f(\bm r, \bm M) =& \frac{1}{2}\sum_{i=1}^m\left[\frac{\tilde{r}_i^2}{\lambda_i} + \ln(\lambda_i) \right]\\ \ge & \frac{1}{2}\sum_{i=1}^m \max\left(\ln(\lambda_i), 1 + \ln(\tilde{r}_i^2)\right) \ge \frac{m}{2} \min(\ln(\alpha), 1 + 2\ln(\alpha)) \end{aligned}\] When $\|\bm r\|_2^2 + \|\bm M\|_F^2 = \|\tilde{\bm r}\|_2^2 + \|\bm \lambda_M\|_2^2 > c$, we know that there at least exists one $\tilde r_i$ or $\lambda_i$ such that $\tilde r_i^2 > c/(2m)$ or $\lambda_i^2 > c/(2m)$, and \begin{equation} \label{eq:lower-bound} f(\bm r, \bm M) \ge \frac{1}{2}\max\left(\ln\left(\sqrt{\frac{c}{2m}}\right), 1 + \ln\left(\frac{c}{2m}\right)\right) + \frac{m-1}{2}\min(\ln(\alpha), 1 + 2\ln(\alpha)) \end{equation} And we know when $c \rightarrow \infty$, $f(\bm r, \bm M) \rightarrow \infty$. \\ Next we prove that $\mathcal{L}_{f,\alpha}$ are also closed. Since $f$ is the continuous function and $\mathcal{D}_r$ is closed from Assumption~\ref{ass: Dr_closed}, we only need to show that the intersection between any $\mathcal{L}_c$ and open boundary of $\mathcal{D}_M$, denoted as $\mathcal{B}_M$, is empty. And we know that $\mathcal{B}_M$ is contained in the space of positive indefinite matrices. For any $\overline{\bm M} \in \mathcal{B}_M$, and any sequence ${\bm M^i} \subset \mathcal{D}_M$ approaching $\overline{\bm M}$, without loss of generality, we assume $\overline{\lambda_m} = 0$, and we know that, $\lambda^i_m \rightarrow 0$ and the corresponding $|\tilde r^i_m|$ has to be stay above $\alpha$ (from Assumption~\ref{ass: r_nonzero}). And from the inequality~\eqref{eq:lower-bound}, we have \[\begin{aligned} f(\bm r, \bm M^i) \ge \frac{1}{2}\left(\frac{\alpha^2}{\lambda_m^i} + \ln(\lambda_m^i)\right) + \frac{m-1}{2}\min(\ln(\alpha), 1 + 2\ln(\alpha)) \end{aligned}\] And we know as $\lambda^i_m \rightarrow 0$, $f(\bm r, \bm M^i) \rightarrow \infty$, therefore there exists $N$ such that $f(\bm r, \bm M^i) > c$ for all $i \ge N$, and $\overline{\bm M} \not\in \mathcal{L}_c$.\\ We therefore have an immediate corollary. \begin{corollary}[Existence of minimizers] Under Assumptions~\ref{ass: r_nonzero} and~\ref{ass: Dr_closed}, the set of minimizers $f$ is nonempty. \end{corollary} By Theorem~\ref{lem: level_set_compact}, the level sets of $f$ are closed and bounded, hence compact. A continuous function assumes its minimum on a compact set, therefore the set of minimizers is nonempty. We can also use Theorem~\ref{lem: level_set_compact} to prove specific results about existence of minimizers for~\eqref{eq:trimGroupFull} under specific parametrizations, including meta-analysis and more standard longitudinal assumptions. Linear constraints will not fundamentally change the situation, so long as they allow any feasible solution, as is stated in the next corollary. \begin{corollary}[Effects of constraints] As long as the intersection of domains $\mathcal{D}_r$ and $\mathcal{D}_M$ with the polyhedral set~$\bm C \bm \theta \leq \bm c$ is nonempty, minimizers exist under Assumptions~\ref{ass: r_nonzero} and~\ref{ass: Dr_closed}. Moreover, constraints can be used to ensure Assumption~\ref{ass: Dr_closed}, for specific cases, by ensuring that the intersection of the feasible region with $\mathcal{D}_r$ is closed. \end{corollary} This follows immediately from the fact that the intersection of a compact set with any closed set remains compact. } \blue{Theorem~\ref{lem: level_set_compact} and following corollaries establish conditions for the existence of $\bm\theta(w)$, given assumptions~\ref{ass: r_nonzero} and~\ref{ass: Dr_closed}. These assumptions must hold for all $\bm w$ in the capped simplex specified by the modeler through the $h$ parameter, which roughly means that for any selection of $h$ datapoints, the problem has to be well defined in the sense of assumptions~\ref{ass: r_nonzero} and~\ref{ass: Dr_closed}. } \red{The existence of global minimizers $\bm \theta(\bm w)$ underpins the approach, which at a high level optimizers the value function $\bm v( \bm w)$ over the capped simplex to detect outliers. The optimization problem~\eqref{eq:trimGroupFull} has a nonconvex objective and nonlinear constraints. Nevertheless, we can specify the conditions under which $\bm v(\bm w)$ is a differentiable function, and we can find an explicit formula for its derivative. The result is an application of the Implicit Function Theorem to the Karush Kuhn Tucker conditions that characterize optimal solutions of~\eqref{eq:trimGroupFull}. We summarize the relevant portion of this classic result presented by~\cite[Theorem 4.4]{still2018lectures}, and refer the reader to~\cite{craven1984non,bonnans2013perturbation} where these results are extended under weaker conditions.} \begin{theorem}[Smoothness of the value function] \label{cor:expfit} \red{For a given $\bm w$, consider $\bm\theta(\bm w)$ and let $\mathcal{I}_0$ denote the set of active constraints: \[ \mathcal{I}_0 := \{i: \bm C_i(\bm \theta(\bm w)) = \bm c_i\}. \] Consider the extended Lagrangian function restricted to this index set: \[ L(\bm \theta, \bm \mu, \bm w) = \mathcal{L}(\bm\theta, \bm w) +\sum_{i \in I_0} \mu_i (\bm C_i (\bm \theta) - \bm c_i) \] Suppose that the following conditions hold: \begin{itemize} \item Stationarity of the Lagrangian: there exist multiplies $\bm \mu(\bm w)$ with \[ \nabla_{\bm \theta} L = \nabla_{\bm \theta} \mathcal{L}(\bm\theta(\bm w), \bm w) + \sum_{i \in I_0} \mu_i(\bm w) \nabla_{\bm \theta} \bm C_i (\bm \theta(\bm w)) = 0 \] \item Linear independence constraint qualification \[ \nabla_{\bm \theta}\bm C_i (\bm \theta(\bm w)), i \in \mathcal{I}_0 \quad \mbox{are linearly independent} \] \item Either of the following conditions hold: \begin{itemize} \item Strict complementarity: number of active constraints is equal to the number of elements in $\bm \theta$, and all $\mu_i(\bm w)>0$. \item Second order condition: $\nabla^2_{\bm \theta} L$ is positive definite when restricted to the tangent space $\mathcal{T}$ induced by the active constraints: \[ \mathcal{T} = \{d: \nabla_{\bm \theta} C_i(\bm w) d = 0, i \in \mathcal{I}_0.\} \] \end{itemize} \end{itemize} Then the value function $v(\bm w)$ is differentiable, with derivative given by \begin{equation} \label{eq:valDeriv} \begin{aligned} \nabla v(\bm w) & = \nabla_{\bm w} L(\bm \theta, \bm \mu, \bm w)|_{\bm \theta (\bm w), \bm \mu (\bm w), \bm w} \\ & = \nabla_{\bm w} \mathcal{L}(\bm\theta, \bm w)|_{\bm \theta(\bm w), \bm w}. \end{aligned} \end{equation} } \end{theorem} \red{The second order condition above guarantees that $\bm\theta(\bm w)$ is isolated (locally unique) minimizer~\cite[Theorem 2.5]{still2018lectures}. } Partially minimizing over $\bm \theta$ reduces problem~\eqref{eq:trimGroupFull} to \begin{equation} \label{eq:trimGroupFullVP} \min_{\bm w} v(\bm w) \quad \mbox{s.t.} \quad \bm 1^\top \bm w = h, \quad \bm 0 \leq \bm w \leq \bm 1, \end{equation} where $v(\bm w)$ is a continuously differentiable nonconvex function, and the constrained set is the (convex) capped simplex $\Delta_h$ introduced in the trimming section. The high-level optimization over $\bm w$ is implemented using projected gradient descent: \begin{equation} \label{eq:value} \bm w^+ = \mbox{proj}_{\Delta_h} (\bm w - \alpha \nabla v(\bm w)), \end{equation} \blue{where $\mbox{proj}_{\Delta_h}$ is the projection operator onto a set defined in the introduction. Since $\Delta_h$ is a convex set, the projection is unique. } Each update to $\bm w$ requires computing the gradient $\nabla v$, which in turn requires solving for $\bm \theta$; see~\eqref{eq:v}. The explicit implementation equivalent to~\eqref{eq:value} is summarized in Algorithm~\ref{alg:pg}. \blue{Projected gradient descent is guaranteed to converge to a stationary point in a wide range of settings, for any semi-algebraic differentiable function $v$~(\cite{attouch2013convergence}).} \begin{algorithm}[h!] \caption{Projected gradient descent on the Value Function $v$ of~\eqref{eq:v}} \label{alg:pg} \begin{algorithmic}[1] \State {\bfseries Input:} $\bm w_0, \lambda_{\bm w}.$ \State {\bfseries Initialize:} $\nu=0$ \While{not converged} \Let{$\nu$}{$\nu+1$} \Let{$\bm \theta^{\nu+1}$}{$\displaystyle\blue{\arg} \min_{\bm \theta} \mathcal{L}(\bm \theta, \bm w^\nu) \quad \mbox{s.t} \quad \bm C(\bm \theta) \leq \bm c$} \Let{$\bm w^{\nu+1}$}{$\displaystyle\mbox{proj}_{\Delta_h}(\bm w - \alpha\blue{\nabla}_{\bm w}\mathcal{L}(\blue{\bm \theta^{\nu+1},\bm w ))} $} \EndWhile \State {\bfseries Output:} $\bm w_\nu, \bm \theta_\nu$ \end{algorithmic} \end{algorithm} Step 5 of Algorithm~\ref{alg:pg} requires solving the constrained likelihood problem~\eqref{eq:trimGroupFull} with $\bm w$ held fixed. We solve this problem using \texttt{IPopt}~\citep{wachter2006implementation}, a robust interior point solver that allows both simple box and functional constraints. While one could solve the entire problem using \texttt{IPopt}, \blue{optimizing with simultaneously in $\bm\theta$ and $\bm w$ turns the problem into a high dimensional nonsmooth nonconvex problem. Instead, we treat them differently to exploit problem structure.} Typically $\bm\theta$ is small compared to $\bm w$, which is the size of the data. On the other hand the constrained likelihood problem in $\bm \theta$ is difficult while constrained value function optimization over $\bm w$ can be solved with projected gradient. \blue{We therefore iteratively solve the difficult small-dimensional problem using \texttt{IPopt}, while handling the optimization over the larger $\bm w$ variable through value function optimization over the capped simplex, a convex set.} \subsection{Nonlinear Relationships using Constrained Splines} \label{sec:spline} In this section we discuss using spline models to capture nonlinear relationships. The relationships most interesting to us are dose-response relationships, which allow us to analyze adverse effects of risk factor exposure (e.g. smoking, BMI, dietary consumption) on health outcomes. For an in-depth look at splines and spline regression see~\cite{de1978practical} and~\cite{friedman1991multivariate}. Constraints can be used to capture expert knowledge on the shape of such risk curves, particularly in segments informed by sparse data. \blue{Basic spline functionality is available in many tools and packages. The two main innovations here are (1) use of constraints to capture the shape of the relationship, explained in Section~\ref{sec:shape}, and (2) nonlinear functions of splines, such as ratios or differences of logs, developed in Section~\ref{sec:nonlin}. First we introduce basic concepts and notation for spline models.} \subsubsection{B-splines and bases} \label{sec:spline_basics} A spline basis is a set of piecewise polynomial functions with designated degree and domain. If we denote polynomial order by $p$, and the number of knots by $k$, we need $p+k$ basis elements $s^p_{j}$, which can be generated recursively as illustrated in Figure~\ref{fig:bspline}. \begin{figure}[h] \centering \includegraphics[width=0.99\textwidth]{figs/bspline.pdf} \caption{Recursive generation of bspline basis elements (orders 0, 1, 2). \blue{The points $t_i$ in the figure are locations for knots, specified (in this case) to be equidistant. Once the spline bases are formed, they can then be evaluated at any points $t$ in the domain, forming $\bm X$ as in~\eqref{eq:splinedesign}.}} \label{fig:bspline} \end{figure} Given such a basis, we can represent any nonlinear curve as the linear combination of the spline basis elements, with coefficients $\bm \beta \in \mathbb{R}^{p+k}$: \begin{equation} \label{eq:spline} f(t) = \sum_{j=1}^{p+k} \beta_j^p s_j^p (t). \end{equation} These coefficients are inferred by \LimeTr analysis. A more standard explicit representation of~\eqref{eq:spline} is obtained by building a design matrix $\bm X$. Given a set of \blue{$n_i$ range values $(t_1, \dots t_{n_i})$ from study $i$,} the $j$th column of $\bm X_i \blue{\in \mathbb{R}^{n_i \times (p+k)}}$ is given by the expression \begin{equation} \label{eq:splinedesign} \blue{\bm X_{i}(\cdot, j)} = \begin{bmatrix} s_j^p(t_1) \\ \vdots \\ s_j^p(\blue{t_{n_i}})\end{bmatrix}. \end{equation} The model for observed data coming from~\eqref{eq:spline} can now be written compactly as \[ \blue{\bm y_i} = \bm X_i \bm \beta + \bm Z_i \bm u_i +\bm \epsilon_{i}, \] which is a special case of the main problem class~\eqref{eq:coords}. \subsubsection{Shape constraints} \label{sec:shape} We can impose shape constraints such as monotonicity, concavity, and convexity on splines. This approach was proposed by~\cite{pya2015shape}, who used re-formulations using exponential representations of parameters to capture non-negativity. The development in this section uses explicit constraints, which is simple to encode and extends to more general cases, including functional inequality constraints $\bm C(\bm \theta) \leq \bm c$. \paragraph{Monotonicity.} Spline monotonicity across the domain of interest follows from monotonicity of the spline coefficients~\citep{de1978practical}. Given spline coefficients $\bm \beta$, the curve $f(t)$ in~\eqref{eq:spline} is monotonically nondecreasing when \[ \beta_1 \leq \beta_2 \leq \dots \leq \beta_{\blue{p+k}} \] and {monotonically non-increasing} if \[ \beta_1 \geq \beta_2 \geq \dots \geq \beta_{\blue{p+k}}. \] The relationship $\beta_1 \leq \beta_2$ can be written as $\beta_1 - \beta_2 \leq 0$. Stacking these inequality constraints for each pair $(\beta_i, \beta_{i+1})$ we can write all constraints simultaneously as \[ \underbrace{\begin{bmatrix} 1 & -1 & 0 & \dots & 0 \\ 0 & 1 & -1 & \dots & 0 \\ \ddots & \ddots & \ddots &\ddots & \vdots\\ 0 & \dots &\dots & 1 & -1 \end{bmatrix}}_{\bm C} \begin{bmatrix} \beta_1 \\ \beta_2\\ \beta_3 \\ \vdots \\ \beta_{\blue{p+k}} \end{bmatrix} \leq \begin{bmatrix} 0 \\ 0\\ \vdots \\ 0\end{bmatrix}. \] These linear constraints are a special case of the general estimator~\eqref{eq:trimGroupFull}. \paragraph{Convexity and Concavity} For any twice continuously differentiable function $f: \mathbb{R} \rightarrow \mathbb{R}$, convexity and concavity are captured by the signs of the second derivative. Specifically, $f$ is convex if $f''(t) \geq 0$ is everywhere, and concave if $f''(t) \leq 0$ everywhere. We can compute $f''(t)$ for each interval, and impose linear inequality constraints on these expressions. We can therefore easily pick any of the shape combinations given in~\cite[Table 1]{pya2015shape}, as well as imposing any other constraints on $\bm \beta$ (including bounds) through the interface of \LimeTr . \subsubsection{Nonlinear measurements} \label{sec:nonlin} Some of the studies in Section~\ref{sec:real} use nonlinear observation mechanisms. In particular, given a dose-response curve \blue{of the form~\eqref{eq:spline}}, studies often report odds ratio of an outcome between exposed and unexposed groups that are defined across two intervals on the underlying curve: \begin{equation} \label{eq:indirect} \begin{aligned} \blue{\mbox{relative risk}} &= \frac{\frac{1}{a_1-a_0}\int_{a_0}^{a_1}f(t) dt}{\frac{1}{b_1- b_0}\int_{b_0}^{b_1}f(t)dt} \end{aligned} \end{equation} When $f(t)$ is represented using a spline, each integral is a linear function of $\bm \beta$. If we take the observations to be the log of the relative risk \blue{for observation $j$ in study $i$}, this is given by \[ y_{ij} := \blue{\log \mbox{relative risk for $ij$ observation}}= \ln(\langle \bm x_{ij}^1, \bm \beta \rangle) - \ln(\langle \bm x_{ij}^2, \bm \beta\rangle):= f_{ij}(\bm \beta), \] a particularly useful example of the general nonlinear term $\bm f_{ij}(\bm \beta)$ in problem class~\eqref{eq:coords}. \blue{A set of examples of epidemiological models that arise from relative risk are discussed in Section~\ref{sec:smoking}.} \subsection{Uncertainty Estimation} \label{sec:var} The \LimeTr package modifies the parametric bootstrap~\citep{efron1994introduction} to estimate the uncertainty of the fitting procedure. This strategy is necessary when constraints are present, and standard Fisher-based strategies for posterior variance selection do not apply~\citep{cox2005delta}. The modified parametric bootstrap is similar to the standard bootstrap, but can be used more effectively for sparse data, e.g. when different studies sample sparsely across a dose-response curve. The approach can be used with any estimator~\eqref{eq:trimGroupFull}. In the linear Gaussian case, the standard bootstrap is equivalent to bootstrapping empirical residuals, since every datapoint can be reconstructed this way. When the original data is sparse, we modify the parametric procedure to sample {\it modeled} residuals. Having obtained the estimate $(\bm{\hat \beta}, \bm{\hat \Lambda}, \bm{\hat \gamma})$, we sample model-based errors to get new bootstrap realizations $\bm{\bar y}$: \[ \quad \bm{\bar y}_i = \blue{\bm f_i( \bm{\hat \beta})} + \bm Z_i \bm {\bar u}_i + \bm{\bar \epsilon}_i, \] where $\bm{\bar \epsilon_i} \sim N(0, \hat \Lambda)$ and $\bm{ \bar u_i} \sim N(0, \bm \hat \gamma)$. These realizations have the same structure as the input data. For each realization $\bm{\bar y}$, we then re-run the fit, and obtain $N$ estimates $\{\bm{\hat \beta}, \bm{\hat \Lambda}, \bm{\hat \gamma})\}_{1:N}$. This set of estimates is used to approximate the variance of the fitting procedure along with any confidence bounds. The procedure can be applied in sparse and complex cases but depends on the initial fit $(\bm{\hat \beta}, \bm{\hat \Lambda}, \bm{\hat \gamma})$. Its exact theoretical properties are outside the scope of the current paper and are a topic of ongoing research. \blue{We use N = 1000 in all of the numerical experiments in the next section. This significantly increases computational load, compared to a single fit. How to make the procedure more efficient (or develop alternatives) is another ongoing research topic.} \section{Verifications} \label{sec:verify} In this section we validate \LimeTr on synthetic and empirical datasets. In Section~\ref{sec:synth} we show how \LimeTr compares to existing robust packages on simple problems \blue{that can be solved by other available tools}; see Table~\ref{table:novelty}. We focus on robustness of the estimates to outliers, which is a key technical contribution of the paper. In Section~\ref{sec:real} we use the advanced features of \LimeTr to analyze multiple datasets in public health, where robustness to outliers, and information communicated through constraints and nonlinear measurements all play an important role. \blue{These examples illustrate advanced \texttt{LimeTr} functionality that is not available in other tools. All examples in the paper are available online, along with a growing library of additional examples (see the Supplementary Materials section). } \subsection{Validation Using Synthetic Data} \label{sec:synth} Here we consider two common mixed effects models. First we look at meta-analysis, where the $\bm \Lambda$ term is known while $(\bm \beta, \bm \gamma)$ are unknown. Then we look at a simple longitudinal case, where all three parameters are unknown, and $\bm \Lambda$ is modeled as $\sigma^2 \bm I$ with unknown scalar $\sigma^2$. In both of these cases, we compare the performance of \LimeTr against several available packages. The simulated data is the same for both examples; only the model is different. For the experiments, we generated $30$ synthetic datasets with $10$ observations in each of $10$ studies ($n=100$). The underlying true distribution is defined by $\beta_0 = 0$, $\beta_1 = 5$, $\gamma=6$, and $\sigma=4$, where $\gamma$ is the standard deviation of the between-study heterogeneity and $\sigma$ is the standard deviation of the measurement error. For the meta-analysis simulation, we assigned each observation a standard error of $4$. The domain of the covariate $x_1$ is $[0, 10]$. To create outliers, we randomly chose $15$ data points in the sub-domain $[6, 10]$ and offset them according to: $y'_i = y_i - 30 - |N(0, 80^2)|$. \blue{The setting of the simulation uses large outliers to show the robustness of the model to trimming. The larger the outliers, the larger the difference in performance between \texttt{LimeTr} and other tools. The behavior of trimming in the meta-analysis of real data is more clear in Section~\ref{sec:real}.} \subsubsection{Meta-analysis.} \label{sec:example_meta} We compared \LimeTr to three widely-used packages that have some robust functionality: \texttt{metafor}, \texttt{robumeta}, and \texttt{metaplus}. The functionality developed in these packages differs from that of \LimeTr . The \texttt{metafor} and \texttt{robumeta} packages refer to robustness in the context of the sandwich variance estimator, which makes the uncertainty around predictions robust to correlation of observations within groups. \texttt{metaplus} uses heavy-tailed distributions to model random effects, which potentially allows one to account for outlying studies but not measurements within studies. Nonetheless, it is useful to see how a new package compares with competing alternatives on simple examples. We compared the packages to \LimeTr in terms of error incurred when estimating ground truth parameters $(\beta_0, \beta_1, \gamma)$, computation time, the true positive fraction (TPF) of outliers detected and the false positive fraction (FPF) of inliers incorrectly identified. If a threshold of $0.8$ inliers is given to \LimeTr , then outliers are exactly data points with an estimated weight $w_i$ of zero, and those correspond to the largest absolute model residuals. To compare with other packages in terms of TPF and FPF, we identified the 20 data points with the highest residuals according to each packages' fit. Table~\ref{tab:metareg_results_case1} and Figure~\ref{fig:case1_plot} show the results of the meta-analysis simulation. The metrics are averages of 30 estimates from models fit on the synthetic datasets. \LimeTr had lower absolute error in $(\beta_0, \beta_1, \gamma)$, higher TPF, lower FPF and faster computation time than the alternatives. \begin{table}[h!] \centering \begin{tabular}{c|c|c|c|c|c|c}\hline Package & $\beta_0$& $\beta_1$ & $\red{\sqrt{\gamma}}$ & TPF & FPF & Seconds \\\hline Truth & 0 & 5 & 6 & --- & --- & --- \\ \hline LimeTr & {\bf 0.61} & {\bf 4.95} &{\bf 4.86} & {\bf 1.00} & {\bf 0.06} & {\bf 0.35} \\ \hline robumeta & 10.92 & 0.03 & 37.2 & 0.68 & 0.12 & 6.54 \\ \hline metaplus & 10.92 & 0.03 & 35.1 & 0.68 & 0.12 & 42.4 \\ \hline\hline metafor & 10.92 & 0.03 & 35.4 & 0.68 & 0.12 & 1.51 \\ \hline \end{tabular} \caption{\label{tab:metareg_results_case1} Results of Meta-Analysis Comparison. True values are $\beta_0 = 0, \beta_1 = 5, \gamma = 6$. Results show average estimates across realizations. The \LimeTr package has much smaller absolute error in $\beta_0$, $\beta_1$ and in $\gamma$ than other packages.} \end{table} \begin{figure}[h!] \centering \includegraphics[width=0.60\textwidth]{figs/case1_results_1.pdf} \caption{A representative instance of the experiment summarized in Table~\ref{tab:metareg_results_case1}. True mechanism is shown using solid line; the true model is successfully inferred by the \LimeTr package despite the outliers (red points). \label{fig:case1_plot}} \end{figure} \subsubsection{Longitudinal Example.} \label{sec:example_long} Here we compare \LimeTr to R packages for fitting robust mixed effects models. Rather than assuming that errors are distributed as Gaussian, the packages use Huberized likelihoods (\texttt{robustlmm}) and Student's t distributions (\texttt{heavy}) to model contamination by outliers. \LimeTr identifies outliers through the weights $w_i$ in the likelihood estimate~\eqref{eq:MML} that now captures simple longitudinal analysis. Specifically, $\bm\Lambda$ is no longer specified as in the meta-analysis case, but is instead parameterized through a single unknown error $\bm\Lambda = \sigma^2 \bm I$ common to all observations. We use the same simulation structure as in Section~\ref{sec:example_meta}, now replacing observation-specific standard errors with random errors generated according to $N(0,\sigma^2)$. Since $\sigma^2$ is now also an unknown parameter, we check how well it is estimated by all packages and report this error in Table~\ref{tab:metareg_results_case2}. \begin{figure}[h!] \centering \includegraphics[width=0.60\textwidth]{figs/case2_results_1.pdf} \caption{ \label{fig:case2_plot} A representative instance of the experiment summarized in Table~ \ref{tab:metareg_results_case2}. \texttt{robustlmm} and \texttt{heavy} packages both estimate $\beta$ better than \texttt{lme4}, likely because they use distributions with heavier tails. \LimeTr outperforms all three alternatives.} \end{figure} \begin{table}[h!] \centering \begin{tabular}{c|c|c|c|c|c|c|c}\hline Package & $\beta_0$& $\beta_1$ & $\sqrt{\gamma}$ & $\sigma$ & TPF & FPF & Seconds \\\hline Truth & 0 & 5 & 6 & 4 & --- & --- & --- \\ \hline LimeTr & {\bf 0.64} & {\bf 4.95} & 4.93 & {\bf 3.61} & {\bf 1.000} & {\bf 0.06} & 1.04 \\ \hline robustlmm & 3.32 & 3.67 & {\bf 5.14} & 9.53 & 0.99 & 0.06 & 7.7 \\ \hline heavy & 2.43 & 3.55 & 3.61 & NA & 0.95 & 0.07 & {0.16} \\ \hline \hline lme4 & 10.6 & 0.09 & {4.89} & 31.0 & 0.68 & 0.11 & {\bf 0.08} \\ \hline \end{tabular} \caption{ \label{tab:metareg_results_case2} Results of Longitudinal Comparison. True values are $\beta_0 = 0, \beta_1 = 5, \gamma = 6, \sigma = 4$. Both \texttt{robustlmm} and the \texttt{heavy} package do better than the standard \texttt{lme4}. \LimeTr more accurately estimates $\beta_0$, $\beta_1$, and $\sigma$. The \texttt{heavy} package estimates $\gamma$ more accurately. However, estimated $\gamma$ typically increases with a worse fit to the data, and heavy does not accurately estimate $\beta$.} \end{table} \subsection{Real-World Case Studies} \label{sec:real} In this section we look at three real-data cases, all using meta-analysis. Across these examples, we show how trimming, dose-response relationships, and non-linear observation mechanisms come together to help understand complex and heterogeneous data. \subsubsection{Simple Example: Vitamin A vs. Diarrheal Disease}. \label{sec:vitA} \begin{figure}[h!] \centering \includegraphics[width=0.49\textwidth]{figs/VitA_Diarrhea_notrim} \includegraphics[width=0.49\textwidth]{figs/VitA_Diarrhea} \caption{Results for Vitamin A vs. \blue{incidence and/or mortality rates} for diarrheal disease, shown using the funnel plot (effect size vs. reported standard error). The left panel shows model without trimming, while the right panel shows the model with trimming. Trimming 10\% of the studies shifts the effect closer to $0$, making it less plausible that Vitamin A is protective, and identifies potential outliers (right panel, shown in red), which are able to hide more easily in the left panel. \label{fig:vitA}} \end{figure} The first example is a simple linear model that aims to quantify the effect of vitamin A supplementation on diarrheal disease. This is an important topic in global health, and we refer the interested reader to the Cochrane systematic review of the topic~\citep{imdad2017vitamin}. In this example, we examine the influence outliers can have on inferences from a model, but we do not discuss in detail how to interpret the findings. In this example, the dependent variable is the natural log of relative risk of incidence \blue{or mortality from diarrheal disease from 12 studies. Two of the studies report on both incidence and mortality, giving 14 total datapoints}. No covariates are used. The model we consider is \[ \bm y_i = \bm 1_i\beta_0 + \bm 1_i u_i + \bm \epsilon_i, \] where $\bm y_i$ are data sets reported from each study, $\bm 1_i$ is a vector of $1$'s of the same size as the number of observations for study $i$, $\bm \epsilon_i \sim N(\bm 0, \bm \Sigma_i)$ are associated standard errors, and $u_i\sim N(0, \gamma^2)$ is a study-specific random effect, with $\gamma^2$ accounting for between-study heterogeneity. Figure~\ref{fig:vitA} shows the results without trimming and with 10\% trimming. We included data from 12 randomized control trials in the models, with a few studies having multiple observations. Without trimming, the estimated effect size is $\beta_0 = -0.15$; with trimming it is three time smaller, $\beta_0 = -0.05$. In the trimmed model, we observe all preserved points inside the funnel, indicating that there is no expected between-study heterogeneity. This is confirmed by the estimates -- without trimming, between-study heterogeneity $\gamma^2$ is estimated to be 0.0435, and after trimming two studies it is reduced to $7.14 \times 10^{-9}$, nearly $0$. Moreover, the potential outliers are unusual: while all other studies deal with ages 1 year or younger, the trimmed studies are among older ages, up to 10 years in one case and 3-6 years in the other. One of the trimmed studies was also conducted in slums, a non-representative population. \subsubsection{Spline Example: Smoking vs. Lung Cancer.} \label{sec:smoking} \paragraph{log relative risk model.} The log relative risk model is very common in the epidemiological context, and is often approximated by the log-linear \blue{relative risk} model. \blue{A brief introduction to the nonlinear model was given in Section~\ref{sec:nonlin}. Here we derive two models, and appropriate random effect specification, that can be used to analyze smoking and diet data.} \blue{In words, the log-relative risk model can be written as} \[\begin{aligned} \ln(\text{rel risk}) = &\left( \frac{\ln(\text{risk at alt exposure}) - \ln(\text{risk at ref exposure})}{\text{alt exposure} - \text{ref exposure}} + \blue{\text{random effect}} \right)\times\\ &(\text{alt exposure} - \text{ref exposure}) + \text{measurement noise} \end{aligned}\] where the random effect is on the average slope and the measurement error in the log space. Instead of \blue{making the strong assumption that the log of the risk is a linear function of exposure, we use a spline to represent this relationship:} \[ \ln(\text{risk at exposure } t) = \ln(\left\langle{\bm x, \bm \beta}\right\rangle) \] where $\bm x$ is the design vector at exposure $t$ and the spline is parametrized by $\bm \beta$, see Section~\ref{sec:spline_basics}. The correlation between smoking and lung cancer is indisputable~\citep{gandini2008tobacco,lee2012systematic}. The exact nature of the relationship and its uncertainty requires accounting for the dose-response relationship between the amount smoked (typically measured in pack-years) and odds of lung cancer. We expect a nonlinear relationship between smoking and lung cancer, and the spline methodology described in Section~\ref{sec:spline_basics} can be used. The outcome here is the natural log of relative risk (compared to nonsmokers). The effect of interest is a function of a continuous exposure, measured in pack-years smoked. All studies compare different levels of exposure to non-smokers (exposure = 0), and we assume there is no risk for non-smokers ($\ln(\text{risk at exposure 0}) = 0$). \blue{Since all datapoints share a common reference, we can simplify the relative risk model as follows:} \[ \ln(\text{rel risk}) = \left( \frac{\ln(\text{risk at alt exposure})}{\text{alt exposure}} + \blue{\text{random effect}} \right)\times \text{alt exposure} + \blue{\text{measurement noise}} \] If we normalize risk of nonsmokers to $1$, and use a spline to model the nonlinear risk curve, we have the explicit expression \[ y_{ij} = \log(\langle \bm x_{ij}, \bm \beta)) + \mbox{exposure}_{ij} u_i + \epsilon_{ij} \] with \blue{$y_{ij}$ the log relative risk,} $\bm x_{ij}$ computed using a spline basis matrix for exposure$_{ij}$ (see Section~\ref{sec:spline_basics}), $u_i$ the random effect for study $i$, and $\epsilon_{ij} \sim N(\bm 0, \sigma_{ij}^2)$ the variance reported by the $i$th study for its $j$th point. \begin{figure}[ht!] \centering \includegraphics[width=0.49\textwidth]{figs/smoking_lung_cancer_no_shape.pdf} \includegraphics[width=0.49\textwidth]{figs/smoking_lung_cancer_w_shape.pdf} \caption{Modeling dose-response relationship between exposure (pack years) and log-odds of lung cancer. Left figure shows a cubic spline, while right figure shows a cubic spline with monotonically increasing risk and concavity constraints. \blue{The reference group is `nonsmokers' in all studies, so taking nonsmoking risk at $1$ we can plot the relative risk for each exposure group at its midpoint, and show the comparison to the estimated risk curve.} The uncertainty of the mean is shown in dark grey, and additional uncertainty due to heterogeneity is shown in light gray. Constraints regularize the shape and decrease fixed effect uncertainty, but have higher estimated heterogeneity, whereas the more flexible model explains the data and has higher fixed effect uncertainty but lower heterogeneity. 10\% trimming removes points that are far away from the mean dose-response relationship, as well as those moderately away from the mean but with very low reported standard deviation. Point radii on the graphs are inversely proportional to the reported standard deviations. \label{fig:smoking}} \end{figure} To obtain the results in Figure~\ref{fig:smoking} using \LimeTr , interior knots were set at the 10th, 50th, and 80th percentiles of the exposure values observed in the data, corresponding to pack-year levels of 10, 30, and 55, respectively. We included 199 datapoints across 25 studies in the analysis, and again trimmed 10\% of the data. Trimming in this case removes datapoints that are far away from the group (even considering between-study heterogeneity), as well as points that are closer to the mean but over-confident; these types of outliers are specific to meta-analysis. We also used multiple priors and constraints. First, we enforced that at an exposure of 0, the log relative risk must be equal to 0 (baseline: non-smokers) by adding direct constraint on $\beta_0$. To control changes in slope in data sparse segments, we included a Gaussian prior of N(0, 0.01) on the highest derivative in each segment. Additionally, the segment between the penultimate and exterior knots on the right side is particularly data sparse, and is more prone to implausible behavior due to its location at the terminus, and we force that spline segment to be linear. We show the unconstrained cubic spline in the left panel of Figure~\ref{fig:smoking}, and the constrained analysis that uses monotonicity and concavity of the curve in the right panel the same figure. The mean relationship looks more regular when using constraints, but the model cannot explain the data as well and so the estimate of heterogeneity is higher. On the other hand, the more flexible model has higher fixed effects uncertainty, and a lower estimate for between-study heterogeneity. The point sets selected for trimming are slightly different as well between the two experiments. \subsubsection{Indirect nonlinear observations: red meat vs. breast cancer.} \label{sec:meat} The effect of red meat on various health outcomes is \red{a topic of} ongoing debate. In this section we briefly consider the relationship between breast cancer and red meat consumption, which has been systematically studied~\citep{anderson2018red}. In this section, we use data from available studies on breast cancer and red meat to show two more features of the \LimeTr package: nonlinear observation mechanisms and monotonicity constraints. The smoking example in Section~\ref{sec:smoking} uses a direct observation model, since all measurement are comparisons to the baseline non-smoker group. This is not the case for other risk-outcome pairs. When considering the effect of red meat consumption, studies typically report multiple comparisons between groups that consume various amounts of meat. In particular, all datapoints across studies are given to us a tuple: odds ratio for group $[a,b]$ vs. group $[c,d]$. These datapoints are thus not measuring the spline directly, but are average slopes between points in log-derivative space. The observation model \blue{given} by \blue{\eqref{eq:indirect}}. \begin{figure}[ht!] \centering \includegraphics[width=0.49\textwidth]{figs/redmeat_breast_curve_w_samples.pdf} \includegraphics[width=0.49\textwidth]{figs/RedMeatFitTrim.pdf} \caption{Spline fit obtained from observation model~\eqref{eq:indirect_full}. The left panel shows the inferred dose response mechanism from indirect observations, across multiple spline knot placement options. Uncertainty from the spline coefficient fits is plotted in dark gray, with additional uncertainty coming from the random effects shown in light gray. Observations are shown in the right panel. The midpoint between the reference and alternative intervals is displayed as a point, with the reference and alternative exposures plotted in blue and red. \label{fig:meat1}} \end{figure} \begin{figure}[h!] \centering \includegraphics[width=0.49\textwidth]{figs/redmeat_breast_curve_w_samplesMono.pdf} \includegraphics[width=0.49\textwidth]{figs/RedMeatFitTrimMono.pdf} \caption{Adding monotonicity constraints to example in Figure~\ref{fig:meat1}. \label{fig:meat2}} \end{figure} As in the smoking example, we model the random effects on the average slopes of the log-relative risks, use a spline to represent the risk curve, and constrain the risk at zero exposure to be $1$. \blue{In contrast to the smoking case, here we must account for both reference and alternative group definitions, so the observation model is given by} \begin{equation} \label{eq:indirect_full} \begin{aligned} y_{ij} &= \left(\frac{\ln(\langle \bm x_{ij}^1, \bm \beta \rangle) - \ln(\langle \bm x_{ij}^0, \bm \beta\rangle)}{\mbox{alt exposure}_{ij} - \mbox{ref exposure}_{ij}} + u_i\right) (\mbox{alt exposure}_{ij} - \mbox{ref exposure}_{ij}) + \epsilon_{ij} \\ & = \ln(\langle \bm x_{ij}^1, \bm \beta \rangle) - \ln(\langle \bm x_{ij}^0, \bm \beta\rangle) + (\mbox{alt exposure}_{ij} - \mbox{ref exposure}_{ij})u_i + \epsilon_{ij}. \end{aligned} \end{equation} with \blue{$y_{ij}$ the log relative risk,} $\bm x_{ij}^1$ and $\bm x_{ij}^0$ computed using spline basis matrix for alternative exposure$_{ij}$ and reference exposure$_i$, (see Section~\ref{sec:spline_basics}), $u_i$ the random effect for study $i$, and $\epsilon_{ij} \sim N(\bm 0, \sigma_{ij}^2)$ the variance reported by the $i$th study for its $j$th point. \LimeTr is the only package that can infer the nonlinear dose-response relationship in this example using heterogeneous observations of ratios of average risks across variable exposures. The meta-analysis to obtain the risk curve in Figure~\ref{fig:meat1} integrates results from 14 prospective cohort studies\footnote{Variation in risk here is much lower than for smoking, so we show relative risk instead of log relative risk.}. An ensemble of spline curves was used rather than a single choice of knot placement. The cone of uncertainty coming from the spline coefficients is shown in dark gray in the left panel, with additional uncertainty from random effects heterogeneity shown in light gray. The right panel of Figure~\ref{fig:meat1} shows the data fit. Each point represents a ratio between risks integrated across two intervals, so in effect on four points that define these intervals. We choose to plot the point at the midpoint defined by these intervals for the visualization. As in other plots, the radius of each point is inversely proportional to the standard deviation reported for it by the study. The derivatives of each spline curve fit are plotted in green so that they can be compared to these average ratios on log-derivative space. After studying the relationship and the data in Figure~\ref{fig:meat1}, it is hard to justify forcing a monotonic increase in risk. However, to test the functionality of \LimeTr , we add this constraint and show the result in Figure~\ref{fig:meat2}. Our conclusions about the relationship and its strength would change in this example if we impose such shape constraints, unlike the example that compares smoking and lung cancer. \section{Conclusion} \label{sec:conc} We have developed a new methodology for robust mixed effects models, and implemented it using the \LimeTr package. The package extends the trimming concept widely used in other robust statistical models to mixed effects. It solves the resulting problem using a new method that combines a standalone optimizer \texttt{IPopt} with a customized solver for the value function over the trimming parameters introduced in the reformulation. Synthetic examples show that \LimeTr is significantly more robust to outliers than available packages for meta-analysis, and also improves on the performance of packages for robust mixed effects regression/longitudinal analysis. In addition to its robust functionality, \LimeTr includes additional features that are not available in other packages, including arbitrary nonlinear functions of fixed effects $\bm f_i(\bm\beta)$, as well as linear and nonlinear constraints. In the section that uses empirical data, we have shown how these features can be used to do standard meta-analysis as well as to infer nonlinear dose-response relationships from direct and indirect observations of complex nonlinear relationships. \bigskip \begin{center} {\large\bf SUPPLEMENTAL MATERIALS} \end{center} \begin{description} \item[\LimeTr package:] Python package \LimeTr containing code to perform robust estimation of mixed effects models, for both meta-analysis and simple longitudinal analysis. Available online through github: \verb{https://github.com/zhengp0/limetr{ \item[Experiments:] Set of script files available online to produce simulated data and run \LimeTr and third party code: \verb{https://github.com/zhengp0/limetr/tree/paper/experiments{ \begin{itemize} \item \verb{Settings.R{: R code to Specifies folder structure and simulation parameters. \item \verb{functions.R{: R code for auxiliary functions for simulating data and aggregating results. \item \verb{0_create_sim_data.R{: R code to create simulated data. \item \verb{1_limetr.py{: Python code to run \LimeTr. \item \verb{2_metafor.R{: R code to run \verb{metafor{ package \item \verb{3_robumeta.R{: R code to run \verb{robumeta{ package \item \verb{4_metaplus.R{: R code to run \verb{metaplus{ package \item \verb{5_lme4.R{: R code to run \verb{lme4{ package \item \verb{6_robustlmm.R{: R code to run \verb{robustlmm{ package \item \verb{7_heavy.R{: R code to run \verb{heavy{ package \end{itemize} \end{description} \bibliographystyle{plainnat}
\section*{Abstract} \noindent \textbf{Purpose}: To develop a single-shot multi-slice T1 mapping method by combing simultaneous multi-slice (SMS) excitations, single-shot inversion-recovery (IR) radial fast low-angle shot (FLASH) and a nonlinear model-based reconstruction method. \noindent \textbf{Methods}: SMS excitations are combined with a single-shot IR radial FLASH sequence for data acquisition. A previously developed single-slice calibrationless model-based reconstruction is extended to SMS, formulating the estimation of parameter maps and coil sensitivities from all slices as a single nonlinear inverse problem. Joint-sparsity constraints are further applied to the parameter maps to improve T1 precision. Validations of the proposed method are performed for a phantom and for the human brain and liver in six healthy adult subjects. \noindent \textbf{Results}: Phantom results confirm good T1 accuracy and precision of the simultaneously acquired multi-slice T1 maps in comparison to single-slice references. In-vivo human brain studies demonstrate the better performance of SMS acquisitions compared to the conventional spoke-interleaved multi-slice acquisition using model-based reconstruction. Apart from good accuracy and precision, the results of six healthy subjects in both brain and abdominal studies confirm good repeatability between scan and re-scans. The proposed method can simultaneously acquire T1 maps for five slices of a human brain ($0.75 \times 0.75 \times 5$ mm$^3$) or three slices of the abdomen ($1.25 \times 1.25 \times 6$ mm$^3$) within four seconds. \noindent \textbf{Conclusion}: The IR SMS radial FLASH acquisition together with a non-linear model-based reconstruction enable rapid high-resolution multi-slice T1 mapping with good accuracy, precision, and repeatability. \noindent \textbf{Keywords}: simultaneous multi-slice, model-based reconstruction, T1 mapping, radial FLASH \clearpage \section*{Introduction} \label{sec:introduction} Quantitative mapping of MR relaxation times such as T1 finds increasing applications in a variety of clinical use cases \cite{margaret2012practical, kellman2014t1}. Mapping of T1 relaxation time commonly relies on the inversion-recovery (IR) Look-Locker sequence where RF excitations are continuously applied after inversion followed by computation of a T1 map in a postprocessing step \cite{Look_Rev.Sci.Instrum._1970,deichmann1992quantification,Messroghli_Magn.Reson.Med._2004}. While efficient, the conventional IR Look-Locker method may still require segmented data acquisitions with multiple inversions \cite{deichmann1992quantification,Messroghli_Magn.Reson.Med._2004}. As a sufficient delay is necessary between inversions, these techniques still suffer from long measurement time. Most recently, advances in sequence development such as non-Cartesian sampling together with state-of-the-art reconstruction techniques have enabled faster parameter mapping \cite{Block_IEEETrans.Med.Imaging_2009, Doneva_Magn.Reson.Med._2010, Petzschner_Magn.Reson.Med_2011,huang2012t2,velikina2013accelerating, zhang2015accelerating,Tamir_Magn.Reson.Med._2017,feng2017compressed}, including accelerated T1 mapping within a single inversion recovery \cite{gensler2014myocardial, wang2016high,marty2018fast}. These methods usually consist of two steps: First, reconstruction of contrast-weighted images from undersampled datasets and, second, subsequent voxel-by-voxel fitting of the T1 map. In contrast, nonlinear model-based reconstruction methods \cite{Block_IEEETrans.Med.Imaging_2009,Fessler_IEEESignalProcess.Mag._2010, Sumpf_J.Magn.Reson.Imaging_2011,tran2013model,zhao2014model,peng2014exploiting,knoll2015model, Volkert_Int.J.Imag.Syst.Tech._2016,zhao2016maximum, Wang_Magn.Reson.Med._2018, Maier2019} estimate parameter maps directly from k-space, completely bypassing the intermediate step of image reconstruction and voxel-by-voxel fitting. Moreover, a~priori information such as sparsity constraints can be applied to the parameter maps to improve precision \cite{Block_IEEETrans.Med.Imaging_2009,zhao2014model,knoll2015model,Wang_Magn.Reson.Med._2018}. So far, most of the above efforts have focused on the acceleration of single-slice parameter mapping. However, in clinical applications, multi-slice parameter mapping is highly desirable. For example, it has been recommended to perform myocardial T1 mapping in at least three short-axis sections to capture potential heterogeneity across the left ventricular wall \cite{moon2013myocardial,weingartner2017simultaneous}. Methods exploiting the conventional multi-slice acquisition strategy have been reported \cite{shah2001new, deichmann2005fast, Wang2018,li2019rapid}. On the other hand, the simultaneous multi-slice (SMS) technique \cite{Barth_Magn.Reson.Med._2016} is a promising way to accelerate multi-slice quantitative MRI. SMS allows for the distribution of undersampling along the additional slice dimension and exploits sensitivity encoding in all three spatial dimensions. Applications of SMS in quantitative MRI include but are not limited to simultaneous three-slice MR fingerprinting \cite{ye2017simultaneous}, simultaneous three-slice cardiac T1 mapping \cite{weingartner2017simultaneous} based on the SAPPHIRE technique and simultaneous multi-slice T2 mapping using the Cartesian multi-echo spin-echo sequence with a model-based iterative reconstruction \cite{hilbert2019fast}. To further enable fast T1 mapping of multiple slices, in this work, we aim to combine simultaneous multi-slice excitations and single-shot IR radial FLASH with a nonlinear model-based reconstruction to enable multi-slice T1 mapping within a single inversion recovery. In particular, we first combine SMS excitation with the single-shot IR radial FLASH sequence using a golden-angle readout. Next, we extend a previously developed single-slice calibrationless model-based reconstruction to SMS, formulating the estimation of parameter maps and coil sensitivities from all slices as a single nonlinear inverse problem. In this way, no additional coil-calibration steps are needed. Further, joint-sparsity constraints are applied on the parameter maps to improve T1 precision. Performance of the proposed method is validated first on an experimental phantom and then on human brain and liver studies of six healthy adult subjects. \section*{Methods} \label{sec:theory} \subsection*{Sequence Design} The sequence starts with a non-selective adiabatic inversion pulse, followed by a radial FLASH readout using continuous SMS excitations and a tiny golden angle between successive spokes ($\approx 23.63^{\circ}$) \cite{wundrak2016golden}. In the partition dimension, radial spokes can be designed to follow an aligned or non-aligned distribution as shown in Figure 1. The aligned scenario allows decoupling of SMS data using an inverse Fourier transform along the partition dimension, followed by independent reconstruction of each slice. In such a way, there is still the SNR benefit of a SMS acquisition over the spoke-interleaved multi-slice scheme. However, the main advantage of SMS - acceleration in the direction perpendicular to the slices - only comes into play when distinct k-space samples are acquired in each partition \cite{zhou2017golden, Rosenzweig_Magn.Reson.Med._2018}. Figure 1 (bottom) depicts the latter case, where a larger k-space coverage could be achieved within a given readout time. In this work, we applied the tiny golden angle ($\approx 23.63^{\circ}$) sampling in the partition dimension as well. Accordingly, throughout this manuscript, we adopt the terms "SMS aligned" and "SMS golden-angle" to refer to the two SMS acquisition strategies, respectively. To reconstruct images/parameter maps in the latter SMS golden-angle acquisition scheme, conventional slice-by-slice reconstruction can not be used. A more general SMS model-based reconstruction method is therefore developed, which is explained in the following. \subsection*{SMS Model-based Reconstruction} Following a similar notation introduced in \cite{Rosenzweig_Magn.Reson.Med._2018}, we define $p, q \in \{1,\ldots,Q\}$ as the partition index and the slice index, respectively, where $Q$ is the total number of partitions/slices. In SMS acquisitions, the signal from the $p$th partition $\widetilde{\bm{y}}^{p}$ can be written as \begin{equation} \label{signal} \widetilde{\bm{y}}^{p} = \sum_{q=1}^{Q}{\xi}^{p,q} \bm{y}^{q}, \end{equation} where ${\xi}^{p,q}$ is an SMS encoding matrix. In this study, it is chosen as the Fourier matrix, i.e., ${\xi}^{p,q} = \exp\Big(-2\pi i\frac{(p-1)(q-1)}{Q}\Big)$. The signal $\bm{y}_{j}^{q}(t)$ for the $q$th slice of the $j$th coil is given by \begin{equation} \bm{y}_{j}^{q}(t) = \int M^{q}(\vec{r})c^{q}_{j}(\vec{r})e^{-i\vec{r}\cdot\vec{k}(t)}d\vec{r}, \label{eq2} \end{equation} where $c^{q}_{j}$ is the corresponding coil sensitivity map, $\vec{r}$ is the position in image space, and $\vec{k}(t)$ is the chosen k-space trajectory. $M^{q}$ is the $T_{1}$ relaxation model for the $q$th slice at the inversion time $t_{k}$: \begin{equation} \label{T1_relax} M_{t_{k}}^{q} = M_{ss}^{q} - (M_{ss}^{q} + M_{0}^{q}) \cdot e^{-t_{k}\cdot {R^{*}_{1}}^q}, \end{equation} where $t_{k}$ is defined as the center of each acquisition window. $M^{q}_{ss}$, $M^{q}_{0}$ and ${R^{*}_{1}}^q$ are the steady-state signal, equilibrium signal and effective relaxation rate, respectively. After estimation of ($M_{ss}^{q}$, $M_{0}^{q}$, ${R^{*}_{1}}^{q}$), $T_{1}$ values of the $q$th slice can be calculated by \cite{Look_Rev.Sci.Instrum._1970,deichmann1992quantification, deichmann2005fast}: $T_{1}^{q} = \frac{M_{0}^{q}}{M_{ss}^{q}\cdot {R^{*}_{1}}^{q}} + 2 \cdot \delta t$, with $\delta t$ the delay between inversion and the start of data acquisition, which is around 15 ms for the sequence used in this study. To estimate parameter maps and coil sensitivity maps from all slices, equations (\ref{signal}) and (\ref{eq2}) are understood as a nonlinear inverse problem with a nonlinear operator $F$, mapping all the unknowns from all slices to the measured undersampled SMS data $\widetilde{Y} = (\widetilde{\bm{y}}_{t_{1}}^{1}, \ldots,\widetilde{\bm{y}}_{t_{1}}^{Q},\widetilde{\bm{y}}_{t_{2}}^{1}, \ldots, \widetilde{\bm{y}}_{t_{n}}^{Q})^{T}$: \begin{equation} F:x \mapsto \bm{P}{\Xi}\left( \begin{array}{c} \mathcal{F}\{ \bm {c}^{1} \cdot \bm{M}_{t_{1}}^{1}\} \\ \vdots \\ \mathcal{F}\{ \bm {c}^{Q} \cdot \bm{M}_{t_{1}}^{Q}\} \\ \mathcal{F}\{ \bm {c}^{1} \cdot \bm{M}_{t_{2}}^{1}\} \\ \vdots \\ \mathcal{F}\{ \bm{c}^{Q} \cdot \bm{M}_{t_{n}}^{Q}\} \end{array}\right), \quad \text{with} \quad \bm{P}{\Xi} := \left( \begin{array}{cccc} P_{t_{1}}{\xi} & && 0 \\ &P_{t_{2}}{\xi} & & \\ & & \ddots & \\ 0 & && P_{t_{n}}{\xi} \end{array} \right) \end{equation} \begin{equation} \text{and} \quad \mathcal{F}\{\bm{c}^{q} \cdot \bm{M}_{t_{k}}^{q}\}:=\left( \begin{array}{c} \mathcal{F}\{ c^{q}_{1} \cdot M_{t_{k}}^{q}(M_{ss}, M_{0}, R_{1}^{*}) \} \\ \vdots \\ \mathcal{F}\{c^{q}_{N} \cdot M_{t_{k}}^{q}(M_{ss}, M_{0}, R_{1}^{*}) \} \\ \end{array}\right). \end{equation} Here $\bm{P}$ is the sampling operator for the given k-space trajectory and $\mathcal{F}$ is the two dimensional Fourier transform. $\bm c^{q}$ represents a set of coil sensitivity maps for the $q$th slice. $M_{t_{k}}^{q}(\cdot)$ is the relaxation model described in Equation (\ref{T1_relax}). The unknowns are $x = (x^{1}, \cdots, x^{q},\cdots, x^{Q})^{T}$ with $x^{q} = (M^{q}_{ss}, M^{q}_{0}, {R^{*}_{1}}^q, c^{q}_{1},\cdots, c^{q}_{N})^{T}$, which are then estimated by solving the following regularized nonlinear inverse problem: \begin{equation} \hat{x} = \argmin_{x\in D} \|F(x) -\widetilde{Y} \|_{2}^{2} + \alpha \sum_{q=1}^{Q}R(x^{q}_{\bm{m}}) + \beta \sum_{q=1}^{Q}U(x^{q}_{\bm{c}}), \end{equation} with $R(\cdot)$ the joint $\ell_{1}$-Wavelet regularization in the parameter dimension \cite{Wang_Magn.Reson.Med._2018} and $U({\cdot})$ the Sobolev norm \cite{Uecker_Magn.Reson.Med._2008} enforcing the smoothness of coil sensitivity maps. $x^{q}_{\bm{m}} = (M^{q}_{ss}, M^{q}_{0}, {R^{*}_{1}}^q)^{T}$ and $x^{q}_{\bm{c}} = (c^{q}_{1},\cdots, c^{q}_{N})^{T}$, $\alpha$ and $\beta$ are the regularization parameters for the parameter and coil-sensitivity maps, respectively. $D$ is a convex set ensuring ${R^{*}_{1}}^q$ to be nonnegative. The above nonlinear inverse problem is then solved by the iteratively regularized Gauss-Newton method (IRGNM) where in each Gauss-Newton step the nonlinear problem is linearized and solved by the fast iterative shrinkage-thresholding algorithm (FISTA) \cite{Beck_IEEETrans.ImageProcessing_2009}. More details on the IRGNM-FISTA algorithm can be found in \cite{Wang_Magn.Reson.Med._2018}. \subsection*{Data Acquisition} All MRI experiments were conducted on a Magnetom Skyra 3T (Siemens Healthineers, Erlangen, Germany) with approval of the local ethics committee. The proposed method was first validated on a commercial reference phantom (Diagnostic Sonar LTD, Scotland, UK) consisting of six compartments with defined T1 values surrounded by water. Phantom and brain studies were conducted with a 20-channel head/neck coil, whereas abdominal scans were performed with a combined thorax and spine coil with 26 channels. Six subjects (4 females, 2 males, 26 $\pm$ 5 years old) without known illness were recruited. For each subject, both brain and liver measurements were performed. In all experiments, simultaneously acquired slices using IR radial FLASH are separated by a fixed distance $d$. All single-slice and multi-slice acquisitions employed the same nominal flip angle $\alpha$ = $6^{\circ}$. Acquisition parameters for phantom and brain measurements were: FOV: $192 \times 192$ mm$^{2}$, matrix size: $256 \times 256$, TR/TE = 4.10/2.58 ms, bandwidth 630 Hz/pixel, slice thickness $\Delta z$ = 5 mm, slice distances $d$ = 15 mm and $d$ = 20 mm for phantom and in-vivo studies, respectively. A gold standard T1 mapping was performed on the center slice of the phantom using an IR spin-echo method \cite{Barral_Magn.Reson.Med._2010} with 9 IR scans (TI = 30, 530, 1030, 1530, 2030, 2530, 3030, 3530, 4030 ms), TR/TE = 4050/12 ms, FOV: 192 $\times$ 192 mm$^{2}$, matrix size: $192\times 192$, and a total acquisition time of 2.4 hours. Parameters for the abdominal measurements were: FOV: $320 \times 320$ mm$^{2}$, matrix size: $256 \times 256$, TR/TE = 2.70/1.69 ms, bandwidth 850 Hz/pixel, $\Delta z$ = 6 mm, $d$ = 20 mm. All single-shot measurements were acquired within a 4-second duration, which was chosen to compromise between good T1 accuracy, SNR while still keep the acquisition time short \cite{wang2016high}. The SMS golden-angle acquisitions were executed twice to evaluate the repeatability of the proposed method. Abdominal experiments were performed during a brief breathhold. \subsection*{Numerical Implementation} All SMS image reconstruction was done offline based on the software package BART \cite{Uecker__2015} using a 40-core 2.3 GHz Intel Xeon E5–2650 server with a RAM size of 512 GB. For abdominal studies, coil elements far away from the regions of interest (i.e., coils near the arm regions) were manually excluded to image reconstruction to remove residual streaking artefacts \cite{Block_J.KoreanSoc.Magn.Reson.Med._2014}. After gradient-delay correction \cite{Block__2011} and channel compression to 8 principle components, the multi-coil radial raw data were gridded onto a Cartesian grid, where all successive iterations were then performed using FFT-based convolutions with the point-spread function \cite{Wajer__2001,Uecker_Magn.Reson.Med._2010}. Parameter maps $(M^{q}_{ss}, M^{q}_{0}, {R^{*}_{1}}^q)^{T}$ were initialized with $(1.0, 1.0, 2.0)^{T}$ and all coil sensitivities were initialized with zeros for all slices. The regularization parameters $\alpha$ and $\beta$ were initialized with $1.0$ and subsequently reduced by a factor of three in each Gauss-Newton step. A minimum value of $\alpha$ was used to control the noise of the estimated parameter maps even with a larger number of Gauss-Newton steps. The optimal value $\alpha_{\rm min}$ was chosen manually to optimize SNR without compromising the quantitative accuracy or delineation of structural details. 10 Gauss-Newton steps were employed to ensure convergence. With these settings, it took around 10 hours to reconstruct a five-slice SMS brain dataset and 6 hours to reconstruct a three-slice SMS abdominal dataset on the CPU system. For single-slice references, reconstructions were able to run on a GPU (Tesla V100 SXM2, NVIDIA, Santa Clara, CA), which then took only 8 to 12 min per dataset. Model-based reconstruction techniques generally offer a flexible choice of temporal binning, i.e., even a single radial spoke per k-space frame could be employed for accurate parameter estimation \cite{Volkert_Int.J.Imag.Syst.Tech._2016}. However, a certain amount of temporal binning effectively reduces the computational demand as long as the T1 accuracy is not compromised \cite{deichmann1992quantification, Volkert_Int.J.Imag.Syst.Tech._2016}. Here, the number of binned spokes was chosen such that the temporal bin size does not exceed 85 ms, which is sufficiently low to keep the quantification error below 1\% as shown previously \cite{Volkert_Int.J.Imag.Syst.Tech._2016}. More specifically, 15, 6 and 4 spokes per k-space frame were selected for single-slice, simultaneous three-slice and five-slice model-based brain reconstructions, respectively. For abdominal studies, 25 and 10 spokes per k-space frame were used for single-slice and simultaneous three-slice reconstructions. \subsection*{T1 Analysis} All quantitative T1 results are reported as mean $\pm$ standard deviation (SD). Regions-of-interest (ROIs) were carefully selected to minimize partial volume errors using the arrayShow \cite{sumpf2013arrayshow} tool in MATLAB (MathWorks, Natick, MA). For further analysis, relative difference maps $\big( \frac{|\text{T1}_\mathrm{estimate} - \text{T1}_\mathrm{ref}|}{|\text{T1}_\mathrm{ref}|}\times 100\% \big)$ and normalized relative errors ($\|\text{T1}_\mathrm{estimate} - \text{T1}_\mathrm{ref} \|_{2}/\|\text{T1}_\mathrm{ref}\|_{2}$) were calculated, respectively, with $\text{T1}_\mathrm{ref}$ the reference T1 map estimated from a single-slice acquisition \cite{Wang_Magn.Reson.Med._2018} and $\text{T1}_\mathrm{estimate}$ the T1 map reconstructed from the corresponding multi-slice acquisition. Moreover, the repeatability error between scans was calculated using $\sqrt{(\sum_{i=1}^{n_{s}}\text{T1}^{2}_{\text{diff}}(i))/n_{s}}$, with $\text{T1}_{\text{diff}}(i)$ the T1 difference between different measurements and $n_{s}$ the number of subjects. In addition, synthetic images are computed for all inversion times and this image series is then converted into a movie showing the recovery of the longitudinal magnetization after the inversion. \section*{Results} \label{sec:results} The proposed method was first validated in a phantom study using the SMS golden-angle acquisition and the developed SMS model-based reconstruction. Figure 2 (a) shows T1 maps of three slices reconstructed with the proposed method together with an IR spin-echo reference and the T1 maps estimated from single-slice IR radial acquisition \cite{Wang_Magn.Reson.Med._2018} of the center slice. Visual inspection reveals that the proposed method can completely disentangle the superposed slices and all multi-slice T1 maps are in good agreement with the references. These findings are confirmed by the T1 values of the ROIs in the center slice in Figure 2 (b), where preservation of good precision (low standard deviation) of the SMS T1 mapping method is also observed. Quantitative results for T1 maps from the other two slices are shown in the Supporting Information Table S1, which confirms good T1 accuracy and precision of these two slices as well. Figure 3 demonstrates the effect of the minimum regularization parameter $\alpha_{\text{min}}$ used in the SMS model-based reconstruction with a multi-slice factor of five. Low values of $\alpha_{\text{min}}$ result in increased noise in the T1 maps, while high values lead to blurring. A similar effect can be seen in the synthesized image series presented in the Supporting Information Video S1. A value of $\alpha_{\text{min}}$ = 0.001 was chosen to balance noise reduction and preservation of image details. This value was used for all multi-slice brain reconstructions. Similarly, $\alpha_{\text{min}}$ = 0.00025 was used for all multi-slice abdominal reconstructions. Figure 4 (a) compares the center-slice T1 maps of a human brain for different multi-slice acquisitions and using model-based reconstruction for a multi-slice factor of three. Both SMS methods produce T1 maps with less noise than the conventional spoke-interleaved multi-slice method. Further, the SMS T1 values are closer to the single-slice reference, as seen in the relative difference maps as well as the normalized errors. In line with the three-slice results, Figure 4 (b) shows for a multi-slice factor of five that both SMS T1 maps have better SNR and are closer to the reference than the conventional multi-slice method. For both acceleration factors, the SMS golden-angle method further helps to reduce artifacts in the border areas and has less quantitative errors than the SMS aligned method. The T1 values for white- and gray-matter ROIs in Figure 5 confirm the above findings: Apart from similar mean T1 values among all multi-slice methods, both SMS approaches produce T1 values with higher precision than the spoke-interleaved multi-slice method. In addition, all SMS brain T1 values are in close agreement with the single-slice reference as well as literature values \cite{wansapura1999nmr,preibisch2009influence}. Note the 5-slice SMS aligned T1 map looks slightly less noisier than the 3-slice SMS aligned one but has a higher normalized error. This may be due to the fact that streaking artifacts start to appear in the border areas of the 5-slice SMS aligned T1 map. Figure 6 (a) presents the center-slice abdominal T1 maps for different three-slice acquisitions using model-based reconstructions. Similar to the brain results, both SMS T1 maps have better SNR than the spoke-interleaved multi-slice result. The SMS golden-angle method further helps to reduce streaking artifacts on the T1 maps. The ROI-analyzed quantitative liver T1 values in Figure 6(b) confirm good accuracy of all multi-slice methods in comparison to the single-slice T1 map with a best quantitative precision achieved by the SMS golden-angle method. Figure 7 (a) depicts all T1 maps estimated from a five-slice SMS golden-angle acquisition as well as the corresponding single-slice T1 maps. All five-slice T1 maps are visually in good agreement with the corresponding single-slice maps. This is also observed for the other five subjects as shown in the Supporting Information Figure S1, indicating that the combination of the SMS golden-angle acquisition with SMS model-based reconstructions can be used to simultaneously acquire T1 maps for five slices of a human brain in good quality within four seconds. A similar comparison is presented for simultaneous three-slice abdominal T1 mapping in Figure 7(b) and Supporting Information Figure S2. In this case, the simultaneous three-slice datasets were acquired within a single four-second breathhold. Again, good agreement is reached between the simultaneous three-slice abdominal T1 maps and the single-slice maps. These results suggest an acceleration factor of three can be used for abdominal T1 mapping with the proposed method. Images for all inversion times were synthesized for the five-slice brain and three-slice liver studies and are presented in the Supporting Information Videos S2 and S3, respectively. Figure 8 and Figure 9 show T1 values of all six subjects for the two repetitive scans in both SMS brain and liver studies. The small T1 difference between the repetitive scans demonstrates good intra-subject repeatability of the proposed method. The repeatability errors are: Frontal white matter: 13 ms (1.8$\%$ of the mean), occipital white matter: 4 ms (0.5$\%$ of the mean), frontal gray matter: 15 ms (1.1$\%$ of the mean), occipital gray matter: 18 ms (1.3$\%$ of the mean) and liver: 4 ms (0.5$\%$ of the mean). Figure 9 additionally confirms good quantitative agreement between single-slice and SMS liver T1 values for all subjects. Figure 10 illustrates the use of the proposed SMS T1 mapping technique for the acquisition of a whole-brain T1 map consisting of 25 contiguous slices with a resolution of 0.75 $\times$ 0.75 $\times$ 5 $\text{mm}^{3}$. These datasets were acquired using five consecutive five-slice SMS acquisitions with each having slice distance of 25 mm. As a sufficient delay is necessary between the non-selective inversions, the total acquisition took around one minute: Four seconds for each five-slice SMS acquisition with a waiting period of 10 seconds in between to ensure full recovery of the magnetization. \section*{Discussion} \label{sec:Discussion} This work describes a fast multi-slice T1 mapping technique which combines simultaneous multi-slice excitations and single-shot IR radial FLASH with an extended nonlinear model-based reconstruction. The present method avoids any coil-calibration steps for SMS reconstruction and uses sparsity constraints to improve precision. Validation studies on a phantom and in six healthy subjects show that the combination of SMS golden-angle acquisition and the developed SMS model-based reconstruction technique can obtain high-resolution simultaneous five-slice brain T1 maps and simultaneous three-slice abdominal T1 maps with good accuracy, precision and repeatability within a single inversion recovery of four seconds. In comparison, to reconstruct a fully-sampled image at each time point while still keeping bin size small, the conventional IR Look-Locker technique needs to employ multiple inversions and acquire complementary k-space data in each inversion to fulfill the Nyquist criterion. With a bin size of 20 radial spokes (single-slice) and a 256 $\times$ 256 matrix, at least $20 \approx (256 \times \pi /2) / 20$ inversions are needed. Thus, the undersampling factor is 20 for model-based reconstruction in the single-shot single-slice method. With the extension to SMS described in the present work, the acceleration factor is further enhanced by an additional factor of 3-5. The present method achieves 0.8 to 1.33 seconds per T1 map within a single inversion recovery and 2.8 to 4.67 seconds per map when taking into account a 10 second delay in a multi-slice protocol with several inversions. This compares well to other recent radial T1 mapping approaches with IR Look-Locker based acquisitions recently described in the literature \cite{Maier2019,li2019rapid}. In contrast to many other quantitative SMS MRI techniques \cite{weingartner2017simultaneous,ye2017simultaneous,hilbert2019fast}, the proposed method integrates coil-sensitivity estimation into the model-based reconstruction framework, avoiding additional calibration scans, which further reduces miscalibration errors in case of motion, especially when imaging moving organs such as abdomen or heart. Moreover, the proposed method dispenses with intermediate image reconstruction, enabling the reconstruction of high-quality T1 maps directly from k-space which does not require binning. This property is especially beneficial for T1 mapping of multiple slices at higher acceleration factors where other methods need to trade off image quality against accuracy when choosing the bin size \cite{wang2015single,deichmann2005fast}. The spoke-interleaved results in this study are noisier than the ones presented in \cite{Wang2018}. The main reason might be that measurements in the previous work \cite{Wang2018} were done on a different scanner using a 64-channel head coil while this study employed a 20-channel head coil. Different parameter choices for sequence and reconstruction may also be a contributing factor. In this study, we used identical parameters as used in the proposed SMS model-based method to make a direct comparison possible. In the present work, we use a radial FLASH readout while other studies employ EPI or 3D spiral to achieve high-resolution brain mapping \cite{cohen2018optimized,cao2019fast}. While radial FLASH is less efficient in covering k-space, with short echo times it is much less sensitive to off-resonance effects than spiral or EPI trajectories and is not affected by geometric distortions. Due to the intrinsic oversampling of the k-space center, radial FLASH is also more robust to motion, which will be beneficial in abdominal and cardiac applications. An alternative to multi-slice T1 mapping is 3D imaging using a radial stack-of-stars sequence or other 3D sequences \cite{cao2019fast}. 3D sequences should provide even better SNR than 2D SMS imaging and allow for isotropic T1 mapping \cite{Maier2019, cao2019fast}. The proposed model-based reconstruction method is also applicable to 3D T1 mapping. However, 3D sequences need to employ multi-shot acquisitions, in which case data over the duration of a complete scan (usually in the order of minutes) have to be combined for parameter estimation. This makes 3D imaging much more sensitive to motion than their 2D SMS counterparts \cite{ye2017simultaneous}. For radial sampling, the use of a golden angle in the partition dimension has been shown to have better performance than the use of aligned spokes for undersampled stack-of-stars 3D volume MRI \cite{zhou2017golden} and 2D radial SMS parallel imaging using NLINV \cite{Rosenzweig_Magn.Reson.Med._2018}. In this work, we have adopted the same strategy for SMS model-based parameter mapping. Our results confirm a slightly better performance of this golden-angle strategy over the aligned case. Combination of such a sampling strategy and model-based reconstructions may be further exploited for single-shot SMS myocardial T1 mapping, where part of the IR data (e.g., systolic data) would be discarded prior to model-based T1 estimations \cite{wang2019model}. The proposed method is also applicable to whole-liver imaging where we need to perform the single-shot acquisition multiple times, i.e., with multiple breathholds to achieve the desired volume coverage. As the delay time can be as short as 3 seconds for liver studies \cite{chen2016rapid}, covering the entire liver with 30 slices using ten 4-second breathhold SMS-3 acquisitions interrupted by nine 3-second time gaps when the subject is allowed to breath freely required a minimum acquisition time of 67 seconds. With a longer delays of 10 seconds between breathholds for more patient convenience this scan could still be performed in two minutes. The non-selective inversion pulse used in this study is not optimal for whole-brain T1 mapping as it necessitates a delay time between successive SMS acquisitions. The 10-second delay time we employed is very high as usually 3-4 seconds should be enough for brain applications \cite{Maier2019}. Furthermore, it has been reported \cite{deichmann2005fast,li2019rapid} that there is little difference in T1 accuracy between non-selective and slab-selective inversion pulses for brain T1 mapping. With adapted excitation pulses and acquisition strategies, we expect to eliminate most of the delay time when combining a slab-selective inversion with the proposed simultaneous multi-slice T1 mapping technique for full brain applications in future studies. The other limitation of the proposed method is the long computation time, especially for model-based reconstruction of the SMS golden-angle datasets: All the data from multiple slices have to be held in memory simultaneously during iterations, which still prevents the use of GPUs. In principle, the alternative methods such as subspace methods have to deal with the same amount of data, but recent implementations use smart computational strategies to reduce the amount of memory and can then achieve very fast reconstruction \cite{mani2015fast, Tamir_Magn.Reson.Med._2017,Uecker__2015}. The key difference between subspace and the nonlinear methods is that the latter does not need any approximations for the signal models, i.e., a minimal number of physical parameters could describe the desired MR signal precisely. In contrast, subspace methods have to approximate the MR signal using a few principal coefficients, which then leads to compromised accuracy or precision. While computation times reported in this work for the proposed model-based reconstruction on CPUs are still very high, newer generations of GPUs with larger memory will enable much faster reconstructions. Preliminary results obtained by using a smaller matrix size are very encouraging: When reducing the in-plane resolution from 0.75 $\times$ 0.75 mm$^{2}$ (matrix size: 512 $\times$ 512) to 1.0 $\times$ 1.0 mm$^{2}$ (matrix size: 384 $\times$ 384), the SMS 5-slice model-based reconstructions could already run on a GPU, which then took only around 14 min per dataset. Similarly, the 1.0 $\times$ 1.0 mm$^{2}$ SMS 3-slice reconstruction took around 8 min per dataset. \section*{Conclusion} \label{sec:Conclusion} The proposed combination of simultaneous multi-slice excitations, single-shot IR radial FLASH, and calibrationless model-based reconstruction allows for efficient high-resolution multi-slice T1 mapping with good accuracy, precision and repeatability. \section*{Conflict of Interest} The authors declare no competing interests. \section*{Data Availability Statement} In the spirit of reproducible research, code to reproduce the experiments is available on \url{https://github.com/mrirecon/sms-T1-mapping}. The raw k-space data used in this study can be downloaded from \href{https://doi.org/10.5281/zenodo.3969809}{DOI:10.5281/zenodo.3969809}. \bibliographystyle{mrm}
\section{INTRODUCTION} A study of single-spin asymmetry (SSA) in processes involving a transversely polarized nucleon is crucial for exploring the three-dimensional nucleon structure. Significant experimental signals of SSA have been observed in hadron production \cite{B76,A91}, which amount up to order of ten or more percent of unpolarized cross sections. Data on pion production have been very consistent, showing asymmetries up to pion transverse momenta of several GeV \cite{Adare:2013ekj,Adamczyk:2012xd}. Despite decades of efforts, the origin of such significant asymmetries is not yet fully understood, due in part to large theoretical and experimental uncertainties. The future Electron-Ion Collider is expected to deliver very precise measurements, that will impose strong constraints on various theoretical approaches. From the theoretical point of view, understanding SSA is a quest for a `phase'. One is interested in the part of a cross section which depends linearly on the transverse spin vector ${\boldsymbol S}_T$ of a nucleon. The spin vector usually comes with a factor $i$, so to make the cross section real, one has to find another factor $i$ from involved diagrams. The first such attempt was made by Kane, Pumplin and Repko \cite{KPR78}, who calculated the SSA for single hadron (pion) production from quark-quark scattering diagrams with a transversely polarized quark. They found that nonvanishing SSA for high $p_T$ reactions is proportional to a current quark mass. Although their calculation does not explain the measured large SSA, the observation with the result being proportional to a quark mass indicates that SSA is a twist-three effect in perturbative QCD. Subsequently, Efremov and Teryaev pointed out that nonvanishing SSA could be obtained as one goes beyond the leading power \cite{Efremov:1981sh,Efremov:1983eb,Efremov:1984ip,Ratcliffe:1985mp}. It is by now well known that sizable SSA can be generated through the combined effect of nonperturbative twist-three distributions of a nucleon, called the Efremov-Teryaev-Qiu-Sterman (ETQS) function \cite{Efremov:1981sh,Efremov:1983eb,Qiu:1991pp,Qiu:1998ia}, and the pole part of a propagator which provides the required phase. In this picture, the smallness of a current quark mass is no longer an issue, since the relevant mass scale is a nucleon mass. A similar twist-three effect has been implemented into fragmentation functions as an alternative source of SSA \cite{Kang:2010zzb,Metz:2012ct,Kanazawa:2013uia}. SSA has been also studied extensively in the $k_T$ factorization framework. Parton transverse momenta are incorporated either in transverse-momentum-dependent (TMD) parton distribution functions (PDFs) or in TMD fragmentation functions (FFs). The former is the Sivers function \cite{S90,ABM95}, which describes the spin-orbit correlation of partons inside a transversely polarized nucleon. The required phase arises from the pole of a propagator for Wilson lines. For the latter, the Collins function \cite{C93,Collins:1993kq,ACY97} governs the fragmentation of a polarized quark, in which the phase comes from final state interactions. In this paper we will investigate the source of phases starting from a parton-level cross section up to two loops, taking the polarized semi-inclusive deeply inelastic scattering (SIDIS) as an example. On-shell internal particles in certain two-loop diagrams produce phases from different leading regions of particle momenta. The phase is then absorbed into the relevant piece in the factorization theorem for each leading region. In addition to the known Sivers (or ETQS) and Collins mechanisms, which are associated with the collinear regions of initial state and final state partons, respectively, we find a novel source of phases which goes into a hard kernel. The corresponding factorization formula contains the $g_T$ distribution function for a polarized nucleon, and the standard twist-2 FF for a final state hadron. Our result is reminiscent of the observations in \cite{Ma:2008gm,Ma:2008cj,Metz:2006pe,Afanasev:2007ii}: the authors of \cite{Ma:2008gm,Ma:2008cj} studied the same set of two-loop diagrams as proposed in this work, but for a transversely polarized quark target. The asymmetry is thus proportional to a current quark mass, and only factorizations into the known mechanisms (Sivers, ETQS,...) were examined. In \cite{Metz:2006pe,Afanasev:2007ii}, the authors found that multi-photon exchange between the leptonic and hadronic parts of inclusive deep-inelastic lepton-hadron scattering causes SSA. The two-photon-exchange diagrams considered in \cite{Metz:2006pe} has the same topology as our diagrams, but it turned out that their final formula does not contain the $g_T$ distribution function \cite{Schlegel:2012ve}. Once we are allowed to go to higher orders in a hard cross section, more twist-3 TMD PDFs and FFs from various spin projectors can contribute to SSA, resulting in abundant phenomenology to be explored. We will derive a complete set of subleading contributions to transverse SSA at two-parton twist-three accuracy in SIDIS up to two loops. Note that the proof of the factorization theorem at the twist-three level is highly nontrivial. Here we will adopt the twist-three factorization as a working hypothesis \cite{Bacchetta:2008xw,Vogelsang:2009pj,Song:2010pf,Kang:2012ns,Yoshida:2016tfh,Chen:2017lvx}, and leave its rigorous proof to future projects. This paper is organized as follows. In Section II, we present the general formalism for SSA in the collinear factorization and check the QED and QCD gauge invariance. In Section III, the complete set of two-loop diagrams that should be included into the hard kernel introduced in Section II is identified. We analyze the various infrared divergences in the considered diagrams, and discuss how to handle these divergences in the collinear and $k_T$ factorizations in Section IV. A source of phase, which cannot be ascribed to the known mechanisms of SSA, will be highlighted. It thus represents a new contribution to SSA, and is our main result. Section V is the conclusion. \section{Semi-inclusive deep inelastic scattering} \begin{figure}[!] \includegraphics[scale=0.5]{Generic_diagrams1} \hspace{1.0cm} \includegraphics[scale=0.5]{Generic_diagrams2} \caption{Generic diagrams contributing to SSA in SIDIS, and a graphical representation of the two terms in Eq.~(\ref{master}). } \label{dia} \end{figure} In this section we start with a general discussion of SSA in SIDIS in the collinear factorization framework mostly following the notations of \cite{Eguchi:2006mc} (see also \cite{Ratcliffe:1985mp,Qiu:1998ia}). The spin-dependent part of the $e(l)p(P)\to e(l')h(P_h)X$ cross section is given by \begin{eqnarray} d\sigma = \frac{1}{2S_{ep}}\frac{d^3P_h}{(2\pi)^32E_h}\frac{d^3 l'}{(2\pi)^32E_{l'}} \frac{e^4}{(Q^2)^2} L^{\mu\nu}W_{\mu\nu} , \end{eqnarray} where $S_{ep}\equiv (l+P)^2$, $Q^2\equiv -q^2=-(l-l')^2$, $L^{\mu\nu}=2(l^\mu l'^\nu + l^\nu l'^\mu)-g^{\mu\nu}Q^2$ is the leptonic tensor, $W^{\mu\nu}$ is the hadronic tensor, and $\nu$ and $\mu$ are the polarization indices of the virtual photon in the amplitude and the complex-conjugate amplitude, respectively. The Bjorken variable is denoted as $x_B=Q^2/(2P\cdot q)$. We work in the so-called hadron frame, where the virtual photon and the proton move in the $z$ direction with \begin{eqnarray} q^\mu=(0,0,0,-Q), \qquad P^\mu=\left(\frac{Q}{2x_B},0,0, \frac{Q}{2x_B} \right). \end{eqnarray} The incoming and outgoing leptons have the momenta \begin{eqnarray} l^\mu = \frac{Q}{2} (\cosh\psi ,\sinh\psi \cos \phi, \sinh\psi \sin \phi, -1), \qquad l'^\mu = \frac{Q}{2} (\cosh\psi ,\sinh\psi \cos \phi, \sinh\psi \sin \phi, 1), \label{use} \end{eqnarray} where $\phi$ is the azimuthal angle relative to the $z$ axis, and \begin{eqnarray} \cosh\psi \equiv \frac{2x_BS_{eq}}{Q^2}-1 = \frac{(l+P)^2}{P\cdot q}-1 \approx \frac{2P\cdot l}{P\cdot q}-1. \end{eqnarray} The hadronic tensor is expressed as a convolution of the reduced hadronic tensors $w_{q,g}^{\mu\nu}$ and the quark and gluon FFs $D_{1q,g}(z)$, which describe the processes $q(P_h/z), g(P_h/z) \to h(P_h)$, \begin{eqnarray} W^{\mu\nu}=\sum_{i=q,g}\int \frac{dz}{z^2}D_{1i}(z)w_i^{\mu\nu}. \end{eqnarray} In the following we will suppress the flavor summation. The tensor $w^{\mu\nu}$ is represented by the sum of the two diagrams in Fig.~\ref{dia}, \begin{eqnarray} w_{\mu\nu}=\int \frac{d^4k}{(2\pi)^4} {\rm Tr}[M^{(0)}(k)S_{\mu\nu}^{(0)}(k)] + \int \frac{d^4k_1}{(2\pi)^4}\frac{d^4k_2}{(2\pi)^4} {\rm Tr}[M^{(1)}_\sigma (k_1,k_2)S^{(1)\sigma}_{\mu\nu}(k_1,k_2)]. \label{master} \end{eqnarray} The hard matrix elements $S_{\mu\nu}^{(0)}(k)$ and $S_{\mu\nu}^{(1)\sigma}(k_1,k_2)$, with $\sigma$ being the polarization index of the attached gluon, can be computed in perturbation theory. The nonperturbative proton matrix elements $M_{ij}^{(0)}\sim \langle P S_T| \bar{\psi}_j\psi_i|P S_T\rangle$ and $M_{ij}^{(1)\sigma}\sim \langle P S_T|\bar{\psi}_j gA^\sigma \psi_i|P S_T\rangle$ have indices in Dirac space ($ij$), as well as in color space (omitted for simplicity). Here $S_T^\mu=(0,{\boldsymbol S}_T,0)$ is the spin vector of the transversely polarized proton with the normalization $S_T^2=-1$. The collinear factorization approach amounts to expanding the momentum $k^\mu$ in $S^{(0)}$ and $k^\mu_{1,2}$ in $S^{(1)}$ around the collinear part proportional to $P^\mu$, \begin{eqnarray} k^\mu = xP^\mu + k_T^\mu, \qquad k_{1,2}^\mu = x_{1,2}P^\mu + k_{1,2 T}^\mu. \end{eqnarray} After some manipulations, one finds (see Eqs.~(31) and (42) of \cite{Eguchi:2006mc}) \begin{eqnarray} w_{\mu\nu}&=& \int dx {\rm Tr}\left[M^{(0)}(x) S^{(0)}_{\mu\nu}(x) \right] + \int dx {\rm Tr} \left[ iM^{(0)\alpha}_\partial (x) \frac{\partial S^{(0)}_{\mu\nu}(k)}{\partial k^\alpha_T} \right]_{k=xP}\nonumber \\ &+& \int dx_1 dx_2 {\rm Tr} \Biggl[ M^{(1)+}(x_1,x_2)S_{\mu\nu}^{(1)-}(x_1,x_2) \nonumber \\ && \qquad \qquad \qquad + i M_F^{(1)\alpha}(x_1,x_2)\frac{\partial S_{\mu\nu}^{(1)-}(k_1,k_2)}{\partial k_{2 T}^\alpha } \nonumber \\ && \qquad \qquad \qquad + M^{(1)\alpha}(x_1,x_2) \Biggl( P^+ (x_2-x_1)\frac{\partial S_{\mu\nu}^{(1)-}(k_1,k_2)}{\partial k^\alpha_{2T}}+ S^{(1)}_{\alpha\mu\nu}(x_1,x_2)\Biggr) \nonumber \\ && \qquad \qquad \qquad + i M^{(1)\alpha}_{\partial 1}(x_1,x_2) \Biggl( \frac{\partial S_{\mu\nu}^{(1)-}(k_1,k_2)}{\partial k_{1T}^\alpha} +\frac{\partial S_{\mu\nu}^{(1)-}(k_1,k_2)}{\partial k_{2T}^\alpha} \Biggr) \Biggr]_{k_i=x_iP}, \label{ma} \end{eqnarray} where $\alpha$ is transverse, $S^{(0)}(x) \equiv S^{(0)}(xP)$, $S^{(1)}_\sigma(x_1,x_2) \equiv S^{(1)}_\sigma(x_1P,x_2P)$, and \begin{eqnarray} M^{(1)\alpha}_\partial (x) =\int \frac{d\lambda}{2\pi}e^{i\lambda x}\langle P S_T|\bar{\psi}(0) \partial^\alpha \psi(\lambda n)|P S_T\rangle, \end{eqnarray} \begin{eqnarray} M^{(1)\alpha}_F(x_1,x_2) =\int \frac{d\lambda}{2\pi}\int \frac{d\zeta}{2\pi} e^{i\lambda x_1 + i\zeta(x_2-x_1)}\langle P S_T|\bar{\psi}(0) gF^{\alpha+}(\zeta n)\psi(\lambda n)|P S_T\rangle, \end{eqnarray} \begin{eqnarray} M^{(1)\alpha}(x_1,x_2) =\int \frac{d\lambda}{2\pi}\int \frac{d\zeta}{2\pi} e^{i\lambda x_1 + i\zeta(x_2-x_1)}\langle P S_T|\bar{\psi}(0) gA^\alpha(\zeta n)\psi(\lambda n)|P S_T\rangle, \end{eqnarray} \begin{eqnarray} M^{(1)\alpha}_{\partial 1}(x_1,x_2) =\int \frac{d\lambda}{2\pi}\int \frac{d\zeta}{2\pi} e^{i\lambda x_1 + i\zeta(x_2-x_1)}\langle P S_T|\bar{\psi}(0) gA^+(\zeta n) \partial^\alpha_T \psi(\lambda n)|P S_T\rangle, \end{eqnarray} with $n^\mu=\delta^\mu_-/P^+$. The authors in \cite{Eguchi:2006mc} have focused on the third line of Eq.~(\ref{ma}), evaluating the corresponding one-loop hard kernel in perturbation theory and obtaining the soft gluon pole (SGP), soft fermion pole (SFP) and hard pole (HP) contributions. They have also shown that all the other lines in Eq.~(\ref{ma}) vanish identically for these contributions. However, all the lines in Eq.~(\ref{ma}) can actually contribute to SSA in more general situations. It has been pointed out in \cite{Ratcliffe:1985mp,Eguchi:2006mc} that the first line potentially contributes to SSA, if one picks up the $g_T$ distribution function \begin{eqnarray} M^{(0)}(x) = \frac{M_N}{2}\gamma_5\Slash S_T g_T(x) +\cdots, \end{eqnarray} with $M_N$ being the proton mass. The authors of \cite{Eguchi:2006mc} noted that if $S^{(0)}$ is calculated in the Born (one-loop) approximation, the asymmetry trivially vanishes, because there is no phase from the Born diagrams to cancel the $i$ from the trace involving $\gamma_5$ (see the discussion in Sec.~\ref{sec:twoloop}). As we shall demonstrate later, certain two-loop diagrams for $S^{(0)}$ can generate a phase, which leads to a contribution to SSA proportional to $g_T$. When this occurs, the second line of Eq.~(\ref{ma}) provides the ${\cal O}(g)$ piece of the Wilson line in the definition of $g_T$. To see this, note the QCD Ward-Takahashi (WT) identity for the contraction of a gluon of the momentum $k_2 - k_1$, \begin{eqnarray} (k_2-k_1)_\sigma S^{(1)\sigma}_{\mu\nu}(k_1,k_2)=S_{\mu\nu}^{(0)}(k_2) -S_{\mu\nu}^{(0)}(k_1), \label{cho} \end{eqnarray} where a color matrix $t^a$ with the color index $a$ is implicit on the right hand side. The above formula gives \begin{eqnarray} P^+S^{(1) -}_{\mu\nu}(x_1,x_2) = -\frac{S_{\mu\nu}^{(0)}(x_2)}{x_1-x_2+i\epsilon} + \frac{S_{\mu\nu}^{(0)}(x_1)}{x_1-x_2+i\epsilon},\label{cho1} \end{eqnarray} in the collinear limit. Upon the integration over $x_1$ or $x_2$, the factor $1/(x_1-x_2+i\epsilon)$ becomes the $\theta$-function that enters the Wilson line integral \begin{eqnarray} \bar{\psi}(0)\int_0^{\lambda} d\zeta A^+(\zeta n)\psi(\lambda n). \end{eqnarray} Differentiating Eq.~(\ref{cho}) with respect to $k_{1,2}$ and then taking the collinear limit, one finds \begin{eqnarray} && P^+(x_2-x_1)\left. \frac{\partial S_{\mu\nu}^{(1)-}(k_1,k_2)}{\partial k^\alpha_{2T}} \right|_{k_i=x_iP} + S^{(1)}_{\mu\nu\alpha}(x_1,x_2) =\left. \frac{\partial S^{(0)}_{\mu\nu}(k_2)}{\partial k^\alpha_{2T} } \right|_{k_i=x_iP}, \nonumber \\ && \left. P^+(x_2-x_1)\frac{\partial S_{\mu\nu}^{(1)-}(k_1,k_2)}{\partial k^\alpha_{1T}}\right|_{k_i=x_iP} - S^{(1)}_{\mu\nu\alpha}(x_1,x_2) =-\left. \frac{\partial S_{\mu\nu}^{(0)}(k_1)}{\partial k^\alpha_{1T} } \right|_{k_i=x_iP}. \label{two} \end{eqnarray} It means that the fourth line of Eq.~(\ref{ma}) is non-vanishing, and the fifth line does not vanish either, as one can see by summing the two relations in Eq.~(\ref{two}). The crucial difference between the analysis of \cite{Eguchi:2006mc} and ours is whether the right hand sides of Eq.~(\ref{two}) vanish or not. Following \cite{Eguchi:2006mc}, the hard kernel $S^{(1)}$ is defined as the sum of `irreducible' diagrams without including the `reducible' diagrams in which the $k_2-k_1$ gluon merges with the incoming or returning quark line. With this definition, the right hand sides of Eq.~(\ref{two}), accounting for the contributions from those reducible diagrams, exist in general. See \cite{Kanazawa:2013uia,Hatta:2013wsa,Xing:2019ovj} for related discussions in the context of SSA. It turns out that, for the SGP, SFP and HP contributions at the Born level considered in \cite{Eguchi:2006mc}, the right hand sides of Eq.~(\ref{two}), and the fourth and fifth lines of Eq.~(\ref{ma}), all vanish. However, for the set of two-loop diagrams proposed in the next section, the right hand sides Eq.~(\ref{cho}) do not vanish. The fourth and fifth lines of Eq.~(\ref{ma}) do not vanish either, and they must be treated simultaneously for gauge invariance as elaborated below. Inserting Eq.~(\ref{two}) into Eq.~(\ref{ma}), we observe that various terms organize themselves to form gauge invariant twist-three matrix elements.\footnote{Our notations are the same as in \cite{Eguchi:2006mc}: $\gamma_5=i\gamma^0\gamma^1\gamma^2\gamma^3$, $\epsilon_{0123}=1$ and $\epsilon^{\alpha P n S_T}\equiv \epsilon^{\alpha\beta\gamma\delta}P_\beta n_\gamma S_{T \delta}$. } Define \begin{eqnarray} &&\int\frac{d\lambda}{2\pi} \int \frac{d\mu}{2\pi} e^{i\lambda x_1+i\mu(x_2-x_1)} \langle P S_T|\bar{\psi}_j(0)[0,\mu n]D^\alpha_T(\mu n)[\mu n, \lambda n] \psi_i(\lambda n)|P S_T\rangle \nonumber \\ &&= \frac{M_N}{4}(\Slash P)_{ij} \epsilon^{\alpha P n S_T} G_D(x_1,x_2) + i\frac{M_N}{4}(\gamma_5\Slash P)_{ij}S^\alpha_T \tilde{G}_D(x_1,x_2), \label{gd} \end{eqnarray} \begin{eqnarray} &&\int\frac{d\lambda}{2\pi} \int \frac{d\mu}{2\pi} e^{i\lambda x_1+i\mu(x_2-x_1)} \langle P S_T|\bar{\psi}_j(0)[0,\mu n] g F^{\alpha \beta}(\mu n)n_\beta [\mu n,\lambda n] \psi_i(\lambda n)|P S_T\rangle \nonumber \\ &&= \frac{M_N}{4}(\Slash P)_{ij} \epsilon^{\alpha P n S_T} G_F(x_1,x_2) + i\frac{M_N}{4}(\gamma_5\Slash P)_{ij}S^\alpha_T \tilde{G}_F(x_1,x_2), \end{eqnarray} where the Wilson line $[\mu n, \lambda n] = {\rm P}\exp\left[ i g \int_\lambda^\mu dt n\cdot A(t n)\right]$ renders the matrix elements gauge invariant, and the three-parton PDFs obey the symmetry property, \begin{eqnarray} G_D(x_1,x_2)=-G_D(x_2,x_1), \qquad \tilde{G}_D(x_1,x_2)=\tilde{G}_D(x_2,x_1), \label{sym} \\ G_F(x_1,x_2)=G_F(x_2,x_1), \qquad \tilde{G}_F(x_1,x_2)=-\tilde{G}_F(x_2,x_1) . \nonumber \end{eqnarray} The second term of the first line and the fourth line in Eq.~(\ref{ma}) combine to give the covariant derivative $\bar{\psi}D^\alpha_T\psi$, and the fifth line provides the Wilson line of this operator to make it gauge invariant. Equation~(\ref{ma}) then becomes \begin{eqnarray} w_{\mu\nu}&=&M_N\int dx {\rm Tr} \left[\gamma_5 \Slash S_T \frac{g_T(x)}{2} S^{(0)}_{\mu\nu}(x ) \right] \label{for} \\ &+& \frac{iM_N}{4}\int dx_1dx_2 {\rm Tr}\left[ \left(\Slash P \epsilon^{\alpha P n S_T} G_D(x_1,x_2) + i\gamma_5\Slash P S_T^\alpha \tilde{G}_D(x_1,x_2) \right)\left.\frac{\partial S^{(0)}_{\mu\nu}(k)}{\partial k_T^\alpha}\right|_{k=x_2P} \right]\nonumber \\ &+& \frac{iM_N}{4}\int dx_1 dx_2 {\rm Tr}\left[\left(\Slash P \epsilon^{\alpha P n S_T} \frac{G_F(x_1,x_2)}{x_2-x_1} + i\gamma_5\Slash P S_T^\alpha \frac{\tilde{G}_F(x_1,x_2)}{x_2-x_1} \right) \left(\left. \frac{\partial S^{(0)}_{\mu\nu}(k)}{\partial k_T^\alpha}\right|_{k=x_2P} -S_{\mu\nu\alpha}^{(1)}(x_1,x_2)\right) \right]. \nonumber \end{eqnarray} The above expression can be further simplified by using the identity \cite{Eguchi:2006qz} \begin{eqnarray} G_D(x_1,x_2)={\cal P}\frac{G_F(x_1,x_2)}{x_1-x_2}, \qquad \tilde{G}_D(x_1,x_2)= \delta(x_1-x_2)\tilde{g}(x_1)+{\cal P}\frac{\tilde{G}_F(x_1,x_2)}{x_1-x_2}, \label{ident} \end{eqnarray} where ${\cal P}$ denotes the principal value prescription. We shall omit ${\cal P}$ below to avoid confusion with the momentum $P^\mu$. The second equation can be regarded as the definition of $\tilde{g}(x)$, that is in fact related to $g_T(x)$, $G_F$ and $\tilde{G}_F$ through the QCD equation of motion (see Eq.~(\ref{la}) below).\footnote{$\tilde{g}(x)$ is related to the first moment $g_{1T}^{\perp (1)}(x)$ of the twist-3 TMD $g_{1T}(x,k_T^2)$. We find $\tilde{g}(x) = - 2 g_{1T}^{\perp (1)}(x)$, where the definition of $g_{1T}^{\perp (1)}(x)$ from \cite{Kanazawa:2015ajw} has been used.} We thus arrive at \begin{eqnarray} w_{\mu\nu}&=&\frac{M_N}{2}\int dx g_T(x) {\rm Tr} \left[\gamma_5 \Slash S_T S^{(0)}_{\mu\nu}(x ) \right] \label{rev} \\ &-& \frac{M_N}{4}\int dx \tilde{g}(x) {\rm Tr}\left[ \gamma_5\Slash P S_T^\alpha \left.\frac{\partial S^{(0)}_{\mu\nu}(k)}{\partial k_T^\alpha}\right|_{k=xP} \right]\nonumber \\ &+& \frac{iM_N}{4}\int dx_1 dx_2 {\rm Tr}\left[\left(\Slash P \epsilon^{\alpha P n S_T} \frac{G_F(x_1,x_2)}{x_1-x_2} + i\gamma_5\Slash P S_T^\alpha \frac{\tilde{G}_F(x_1,x_2)}{x_1-x_2} \right) S_{\mu\nu\alpha}^{(1)}(x_1,x_2) \right], \nonumber \end{eqnarray} which will be the starting point of our two-loop analysis. \subsection{QED gauge invariance} \label{wt} Let us show that Eq.~(\ref{rev}) respects the QED WT identity, which is actually nontrivial. The WT identity for $S^{(0)}$ is written as \begin{eqnarray} q^\mu \Slash P S_{\mu\nu}^{(0)}(x) =0, \qquad q^\nu S_{\mu\nu}^{(0)}(x)\Slash P =0 , \label{li} \end{eqnarray} where $\Slash P=P^+\gamma^-$, and $q^\mu$ and $q^\nu$ represent the outgoing and incoming photon momenta, respectively. It is obvious that the first line of Eq.~(\ref{rev}) does not satisfy the WT identity by itself due to the presence of $\gamma_5\Slash S_T$. (For unpolarized distributions, one has the spin projector $\gamma^-$ instead, and the WT identity is trivially satisfied.) In fact, only the sum of all lines in Eq.~(\ref{rev}) obeys the WT identity. Similar observations have been made in the literature \cite{Ratcliffe:1985mp,Jaffe:1991ra,Kanazawa:2013uia}. To verify it, we begin with a slight generalization of Eq.~(\ref{li}), \begin{eqnarray} q^\mu \Slash k S_{\mu\nu}^{(0)}(k) =0, \qquad q^\nu S_{\mu\nu}^{(0)}(k) \Slash k=0, \label{on} \end{eqnarray} for an on-shell, but not necessarily collinear momentum $k$. Differentiating Eq.~(\ref{on}) with respect to $k_T^\alpha$ and then taking the collinear limit, we get \begin{eqnarray} q^\mu \gamma_{T\alpha} S_{\mu\nu}^{(0)}(x) + \left. q^\mu x\Slash P \frac{\partial S^{(0)}_{\mu\nu}(k)}{\partial k_T^\alpha}\right|_{k=xP}=0, \qquad q^\nu S_{\mu\nu}^{(0)}(x) \gamma_{T\alpha} + \left. q^\nu \frac{\partial S^{(0)}_{\mu\nu}(k)}{\partial k_T^\alpha}\right|_{k=xP}x\Slash P =0. \label{lim} \end{eqnarray} Furthermore, we need the following identity \cite{Eguchi:2006mc} \begin{eqnarray} g_T(x) = -\frac{1}{2x} \left( \tilde{g}(x) + \int dx' \frac{G_F(x,x') +\tilde{G}_F(x,x')}{x-x'} \right), \label{la} \end{eqnarray} where the $\tilde{g}(x)$ part combines with the second line of Eq.~(\ref{rev}) to give the structure \begin{eqnarray} \sim \int dx \tilde{g}(x) {\rm Tr}\left[ \gamma_5\Slash S_T \frac{S_{\mu\nu}^{(0)}(x)}{x} +\gamma_5 \Slash P S_T^\alpha \left.\frac{\partial S^{(0)}_{\mu\nu}(k)}{\partial k_T^\alpha}\right|_{k=xP} \right] = \int dx \frac{ \tilde{g}(x)}{x} {\rm Tr}\left[ \gamma_5 S_T^\alpha \frac{ \partial (\Slash k S^{(0)}_{\mu\nu}(k))}{\partial k_T^\alpha} \right]_{k=xP} . \label{gauge1} \end{eqnarray} This combination vanishes when contracted with $q^\mu$ or $q^\nu$, as can be easily checked by using Eq.~(\ref{lim}). The $G_F$ and $\tilde{G}_F$ terms of Eq.~(\ref{la}) combine with the third line of Eq.~(\ref{rev}) to give the structure \begin{eqnarray} \sim \int dx_1 dx_2 {\rm Tr}\Biggl[ \left( - \gamma_5\Slash S_T \frac{S^{(0)}_{\mu\nu}(x_1 )}{x_1} + i\Slash P \epsilon^{\alpha PnS_T} S_{\mu\nu\alpha}^{(1)}(x_1,x_2) \right) \frac{G_F(x_1,x_2)}{x_1-x_2} \nonumber \\ + \left( - \gamma_5\Slash S_T \frac{S^{(0)}_{\mu\nu}(x_1)}{x_1} -\gamma_5\Slash PS^\alpha_T S_{\mu\nu\alpha}^{(1)}(x_1,x_2) \right) \frac{\tilde{G}_F(x_1,x_2)}{x_1-x_2} \Biggr]. \label{gauge2} \end{eqnarray} Remembering that $S^{(1)}$ does not contain reducible diagrams, we have \begin{eqnarray} q^\mu S_{\mu\nu\alpha}^{(1)}(x_1,x_2) =\gamma_\alpha \frac{1}{x_1\Slash P}q^\mu S_{\mu\nu}^{(0)}(x_1), \qquad q^\nu S^{(1)}_{\mu\nu\alpha}(x_1,x_2)=q^\nu S_{\mu\nu}^{(0)}(x_2)\frac{1}{x_2\Slash P}\gamma_\alpha. \label{bo} \end{eqnarray} Using the following formulas \begin{eqnarray} \gamma_5 \Slash S_T = i\gamma^0\gamma^1\gamma^2\gamma^3 \Slash S_T=-i(1-\gamma^+\gamma^-)\gamma_1\gamma_2 (S_{T 1}\gamma_1 + S_{T 2}\gamma_2) &=& i(1-\gamma^+\gamma^- )\epsilon^{ij}\gamma_i S_{T j}, \label{c1} \\ &=& i(\gamma^-\gamma^+ -1 )\epsilon^{ij}\gamma_i S_{T j}, \nonumber \end{eqnarray} \begin{eqnarray} -i\gamma_\alpha \epsilon^{\alpha -+ \lambda}S_{T \lambda} = i\epsilon^{ij}\gamma_i S_{T j}, \label{c2} \end{eqnarray} together with Eqs.~(\ref{sym}) and (\ref{li}), one can show that both lines of Eq.~(\ref{gauge2}) vanish, when contracted with $q^\mu$ or $q^\nu$. This completes the proof of the QED WT identity. \subsection{QCD gauge invariance} Similarly, the QCD gauge invariance holds only for the sum of all terms in Eq.~(\ref{rev}). Suppose that $S^{(0)}$ is evaluated in some gauge which involves a parameter $\xi$ (here we have suppressed the subscripts $\mu$, $\nu$ for simplicity). For instance, $\xi$ can be the usual gauge parameter $\lambda$ in the covariant gauge, or a vector $n^\alpha$ in the axial gauge $n\cdot A=0$, in which the gluon propagator is proportional to \begin{eqnarray} N_{\rm co}^{\alpha\beta}&=&g^{\alpha\beta}-(1-\lambda) \frac{l^\alpha l^\beta}{l^2}, \nonumber\\ N_{\rm ax}^{\alpha\beta}&=&g^{\alpha\beta}- \frac{l^\alpha n^\beta+l^\beta n^\alpha}{l\cdot n} + n^2\frac{l^\alpha l^\beta}{(l\cdot n)^2}, \label{gp} \end{eqnarray} respectively. We will show that Eq.~(\ref{rev}) does not change under the variation of the gauge parameters $\xi$, concentrating on these two classes of gauges. To vary the $\lambda$ or $n$ dependence in diagrams at arbitrary orders, we apply the differential operator $d/d\lambda$ or $d/dn_\delta$ to each of the gluon propagators, yielding \begin{eqnarray} \lambda\frac{d}{d\lambda}N_{\rm co}^{\alpha\beta}&=& \frac{l_\delta}{2l^2} \left(N_{\rm co}^{\alpha \delta}l^\beta+N_{\rm co}^{\delta \beta}l^\alpha\right),\nonumber\\ \frac{d}{dn_\delta}N_{\rm ax}^{\alpha\beta}&=& -\frac{1}{n\cdot l} \left(N_{\rm ax}^{\alpha \delta}l^\beta+N_{\rm ax}^{\delta \beta}l^\alpha\right). \label{digp} \end{eqnarray} Starting with the $\tilde{g}$ terms in Eq.~(\ref{gauge1}), one writes the differentiated $S^{(0)}(k,\xi)$ as $\delta S^{(0)}(k,\xi)$. The momentum $l^\alpha$ or $l^\beta$ appearing at one end of the differentiated gluon line (\ref{digp}) is contracted with a vertex the gluon attaches to. We select an ordinary gluon vertex denoted by $\alpha$ (without the contraction with its momentum) in the diagrams, and collect vertices which correspond to the attachments of another end denoted by $\beta$. Since all gluons are differentiated, the possible attachments of $l^\beta$ form a complete set of diagrams. Summing all the gluon attachments, one finds that the only uncanceled piece comes from the diagram with the momentum attaching to the outermost end of either the incoming or returning quark \cite{BS89}, as depicted in Fig.~\ref{out}. One thus obtains $\delta S^{(0)}(k,\xi)= \delta S_L^{(0)}(k,\xi)+\delta S_R^{(0)}(k,\xi)$ corresponding to these two possibilities. Clearly they satisfy \begin{eqnarray} \delta S_L^{(0)}(k,\xi)\Slash k=0, \qquad \Slash k\delta S_R^{(0)}(k,\xi)=0, \label{cut} \end{eqnarray} which are entirely analogous to Eq.~(\ref{on}). It is then trivial to see that Eq.~(\ref{gauge1}) with $S^{(0)}$ being replaced by $\delta S_{L/R}^{(0)}$ vanishes. Therefore, the $\tilde{g}$ part is gauge independent. \begin{figure}[!] \includegraphics[scale=0.5]{fd72.pdf} \caption{The variation of the gauge parameters is represented by the diagram, in which the momentum $l^\beta$ attaches to the outermost end of either the incoming or returning quark.} \label{out} \end{figure} Similarly, one can write the differentiated three-parton amplitude $S^{(1)}$ as \begin{eqnarray} \delta S_\alpha^{(1)}(x_1,x_2,\xi)=\delta S^{(1)}_{L\alpha}(x_1,x_2,\xi) +\delta S^{(1)}_{R\alpha}(x_1,x_2,\xi), \end{eqnarray} for which the QCD gauge invariance holds for the sum of the reducible and irreducible diagrams. We then have \begin{eqnarray} \left(\delta S^{(1)}_{L\alpha}(x_1,x_2,\xi) -\delta S_L^{(0)}(x_2,\xi) \frac{1}{x_2\Slash P}\gamma_\alpha \right)\Slash P = 0, \nonumber \\ \Slash P\left(\delta S^{(1)}_{R\alpha}(x_1,x_2,\xi) -\gamma_\alpha \frac{1}{x_1\Slash P} \delta S_{R}^{(0)}(x_1,\xi) \right) =0, \end{eqnarray} which are again completely analogous to Eq.~(\ref{bo}). Hence, Eq.~(\ref{gauge2}) with $S^{(0),(1)}$ being replaced by $\delta S_{L/R}^{(0),(1)}$ vanishes. This completes the proof that Eq.~(\ref{rev}) is QCD gauge invariant. \section{Two-loop contribution to phase} \label{sec:twoloop} In this section, we identify the lowest order two-parton Feynman diagrams that produce nonvanishing contributions to Eq.~(\ref{rev}) in the collinear factorization. It was pointed out \cite{Eguchi:2006mc} that the Born term, given by the one-loop box diagram in Fig.~\ref{1loop} (left), does not contribute. We can easily confirm this result by an explicit calculation as follows. The incoming quark has the momentum $p_1=xP$ with $1\ge x\ge x_B$, and we write the virtual photon momentum as $q=p_2-p_1$ with \begin{eqnarray} p_2^+ = (x-x_B)P^+, \qquad p_2^- = \frac{Q^2}{2x_BP^+}, \qquad p_2^2=\frac{x-x_B}{x_B}Q^2. \end{eqnarray} Figure~\ref{1loop} (left) with the loop gluon momentum $l^\mu=(l^+,l^-,\boldsymbol{l}_T)$ is evaluated as \begin{eqnarray} \int\frac{d^4l}{(2\pi)^4} \frac{\gamma_\alpha(\Slash p_1-\Slash l)\gamma_\mu (\Slash p_2-\Slash l)\gamma_\nu (\Slash p_1-\Slash l) \gamma^\alpha}{[(p_1-l)^2+i\epsilon][(p_1-l)^2-i\epsilon]} \delta((p_2-l)^2)\delta(l^2) ,\label{s0} \end{eqnarray} whose integrand, as contracted with $\gamma_5\Slash S_T $, yields a factor $i$. In order to make the cross section real, the denominator must provide an imaginary part. However, this is clearly not possible, so the one-loop box diagram does not contribute to SSA. Next, consider the virtual correction to the photon vertex in Fig.~\ref{1loop} (right),\footnote{In the collinear factorization framework, this diagram does not contribute to SSA trivially, since the final state quark has a vanishing transverse momentum. We nevertheless study the pole structure of this diagram (and other virtual diagrams below) because our discussion can be straightforwardly generalized to the $k_T$ factorization framework, where the incoming quark has a nonzero transverse momentum and the analysis becomes nontrivial.} \begin{eqnarray} \int\frac{d^4l}{(2\pi)^4} \frac{\gamma_\mu\Slash p_2\gamma^\alpha(\Slash p_2-\Slash l)\gamma_\nu (\Slash p_1-\Slash l)\gamma_\alpha} {[(p_2-l)^2+i\epsilon]( l^2+i\epsilon) [(p_1-l)^2+i\epsilon]}\delta(p_2^2) ,\label{s1} \end{eqnarray} in which the final state quark is on-shell with $p_2^+=0$ ($x=x_B$). The loop integral over $l$ needs to generate an imaginary piece in order to get a real contribution. Expressing $(p_1-l)^2=2(l^+-p_1^+)l^--l_T^2$, $l^2=2l^+l^--l_T^2$, and $(p_2-l)^2= 2l^+(l^--p_2^-)-l_T^2$, we see that $l^+$ must take a value in the range $(0,p_1^+)$ to get a nonvanishing contribution from the contour integration over $l^-$. After picking up the pole $l^-=l_T^2/[2(l^+-p_1^+)]+i\epsilon$, we need one more $i$ from the remaining $l$ or $p_2 - l$ propagator. However, this is impossible due to $l^2=2p_1\cdot l=2p_1^+l^-<0$ and $(p_2-l)^2=2(p_1\cdot l-p_2\cdot l)=2(p_1^+l^--p_2^-l^+)<0$. Namely, neither the gluon nor the scattered quark can become on-shell, so this diagram does not contribute. These observations apply to other one-loop diagrams, and we conclude that the asymmetry cannot be produced in a parton-level diagram at one loop. \begin{figure}[!] \includegraphics[scale=1]{1loop} \caption{Left: A one-loop box diagram. Right: A one-loop vertex-correction diagram. } \label{1loop} \end{figure} \subsection{Fig.~\ref{2loop1}: a case with two virtual gluons} We then move on to two-loop diagrams, starting with the diagram with two virtual gluons in Fig.~\ref{2loop1} (see also footnote 2). Let the incoming quark carry the momentum $p_1-l_1$ after emitting the first gluon, and $p_1-l_2$ after emitting the second gluon of the momentum $l_2-l_1$. The scattered quark then carries the momentum $p_2-l_2$ before receiving the second gluon and $p_2-l_1$ before receiving the first gluon. Focus only on the propagator denominators entering the loop integrand for this diagram, and consider the poles of $l_1^-$ and $l_2^-$ (again, $p_2^+=0$): \begin{eqnarray} &&\int_{-\infty}^\infty dl_1^- d l_2^- \frac{1}{[(p_1 - l_1)^2 + i\epsilon](l_1^2+ i\epsilon)[(l_1 - l_2)^2+ i\epsilon][(p_1 - l_2)^2+ i\epsilon](l_2^2+ i\epsilon)}\nonumber \\ &=& \int_{-\infty}^\infty dl_1^- dl_2^- \frac{1}{[2(l_1^+-p_1^+)l_1^- -l_{1T}^2+i\epsilon](2l_1^+l_1^- - l_{1T}^2 +i\epsilon)[2(l_1^+-l_2^+)(l_1^--l_2^-)-(\boldsymbol{l}_{1T} - \boldsymbol{l}_{2T})^2+i\epsilon]} \nonumber \\ &&\times \frac{1}{[2(l_2^+-p_1^+)l_2^- - l_{2T}^2 +i\epsilon](2l_2^+l_2^- -l_{2T}^2 +i\epsilon)}. \end{eqnarray} It is easy to see that as long as one of the components $l_1^+$ and $l_2^+$ is greater than $p_1^+$, the integration over either $l_1^-$ or $l_2^-$ vanishes because the integration contour is not pinched. For example, if $l_1^+,l_2^+>p_1^+$, all the poles are in the lower-half plane except the one from the propagator $(l_1-l_2)^2$. The coefficient $l_1^+-l_2^+$ is either positive or negative, and then the integration over either $l_1^-$ or $l_2^-$ vanishes. The same conclusion is drawn, as one of the components $l_1^+$ and $l_2^+$ is negative. We thus need to examine only the ranges $0<l_{1,2}^+<p_{1}^+$. \begin{figure}[!] \includegraphics[scale=0.5]{ssa_fd_2-loop_1} \caption{A two-loop diagram with two virtual gluons. } \label{2loop1} \end{figure} We first investigate the case with $l_1^+<l_2^+$, for which we pick up the pole $l_2^-=l_{2T}^2/[2(l_2^+-p_1^+)]+i\epsilon$ from the incoming quark propagator. As for the pole of $l_1^-$, we pick up either $l_1^-=l_{1T}^2/[2(l_1^+-p_1^+)]+i\epsilon$ from the incoming quark propagator or \begin{eqnarray} l_1^-=\frac{(\boldsymbol{l}_{1T}-\boldsymbol{l}_{2T})^2}{2(l_1^+-l_2^+)}+l_2^-+i\epsilon =\frac{(\boldsymbol{l}_{1T}-\boldsymbol{l}_{2T})^2}{2(l_1^+-l_2^+)}+\frac{l_{2T}^2}{2(l_2^+-p_1^+)}+i\epsilon, \label{sec} \end{eqnarray} from the gluon propagator with the momentum $l_2 - l_1$. The first pole of $l_1^-$ does not lead to any on-shell internal particles, which all have negative invariant masses as $l_1^+<l_2^+$. Indeed, the invariant masses of the scattered quark are given by $(p_2-l_1)^2=2p_1^+l_1^--2p_2^-l_1^+<0$ and $(p_2-l_2)^2=2p_1^+l_2^--2p_2^-l_2^+<0$. The two gluons have the invariant masses $l_1^2=2p_1^+l_1^-<0$ and \begin{eqnarray} (l_2-l_1)^2 = l_2^2 - 2 l_1\cdot l_2 + 2p_1\cdot l_1 = - \frac{l_2^+ - p_1^+}{l_1^+ - p_1^+} \left(\boldsymbol{l}_{1T} - \frac{l_1^+ - p_1^+}{l_2^+ - p_1^+}\boldsymbol{l}_{2T}\right)^2 < 0. \end{eqnarray} For the second pole of $l_1^-$ in Eq.~(\ref{sec}), we just need to check the incoming quark of the momentum $p_1-l_1$: \begin{eqnarray} (p_1-l_1)^2 = -2p_1 l_1 + 2 l_1 \cdot l_2 - l_2^2 = \frac{l_2^+ - p_1^+}{l_1^+ - l_2^+} \left(\boldsymbol{l}_{1T} - \frac{l_1^+ - p_1^+}{l_2^+ - p_1^+}\boldsymbol{l}_{2T}\right)^2 > 0. \end{eqnarray} That is, this incoming quark does not go on shell. We then analyze the case with $l_1^+>l_2^+$, for which we pick up the pole $l_1^-=l_{1T}^2/[2(l_1^+-p_1^+)]+i\epsilon$ from the incoming quark propagator. As to the pole of $l_2^-$, we pick up either $l_2^-=l_{2T}^2/[2(l_2^+-p_1^+)]+i\epsilon$ from the incoming quark or \begin{eqnarray} l_2^-=\frac{(\boldsymbol{l}_{2T}-\boldsymbol{l}_{1T})^2}{2(l_2^+-l_1^+)}+l_1^-+i\epsilon =\frac{(\boldsymbol{l}_{2T}-\boldsymbol{l}_{1T})^2}{2(l_2^+-l_1^+)}+\frac{l_{1T}^2}{2(l_1^+-p_1^+)}+i\epsilon, \end{eqnarray} from the second gluon propagator. The discussion is completely analogous to the $l_1^+<l_2^+$ case: one can show that none of the remaining propagators can go on-shell, so they cannot produce a phase. We conclude that Fig.~\ref{2loop1} does not contribute to SSA. \subsection{Fig.~\ref{2loop2}: a case of real-virtual cancellation} When one gluon is real and another is virtual, there is a chance to get an on-shell parton. Consider the diagram in Fig.~\ref{2loop2} (left), which has the same assignment of momenta as in Fig.~\ref{2loop1} but with a different cut. Because $p_2^2=2p_1\cdot q(1-x_B)\geq 0$, the scattered quark with the invariant mass $(p_2-l_2)^2=p_2^2-2p_2\cdot l_2$ may go on-shell and generate a phase. Hence, this diagram deserves a careful investigation. The on-shell condition $l_1^2=0$ leads to $l_1^-=l_{1T}^2/(2l_1^+)$. The on-shell condition $(p_2-l_1)^2=p_2^2-2p_2\cdot l_1=0$ then yields two solutions \begin{eqnarray} l_1^+= \frac{p_2^+}{2}(1 \pm \Delta_1) \equiv l^+_{1(\pm)}, \qquad \Delta_1 \equiv \sqrt{1-\frac{4l_{1T}^2}{p_2^2}}, \qquad l^-_{1(\pm)}\equiv \frac{l_{1T}^2}{2l^+_{1(\pm)}}, \label{2m0} \end{eqnarray} for which the incoming quark is off-shell by $(p_1-l_1)^2=-2p_1\cdot l_1=-2p_1^+l_1^-<0$. We then come to the contour integration over $l_2^-$, \begin{eqnarray} &&\int_{-\infty}^\infty dl_2^- \frac{1}{[(l_2 - l_1)^2 + i\epsilon][(p_1 - l_2)^2 + i\epsilon][(p_2 - l_2)^2 + i\epsilon]}\nonumber \\ &=& \int dl_2^- \frac{1}{[2(l_2^+-l_1^+)(l_2^- - l_1^-)-(\boldsymbol{l}_{1T} - \boldsymbol{l}_{2T})^2+i\epsilon][2(l_2^+-p_1^+)l_2^- - l_{2T}^2 +i\epsilon][2(l_2^+-p_2^+)(l_2^--p_2^-) - l_{2T}^2 +i\epsilon]}, \end{eqnarray} which vanishes for $l_2^+>p_1^+$ as before. For $p_2^+<l_2^+<p_1^+$, we pick up the pole $l_2^-=l_{2T}^2/[2(l_2^+-p_1^+)]+i\epsilon$, that renders both the scattered quark and the virtual gluon off-shell with negative invariant masses. For $l_1^+<l_2^+<p_2^+$, we pick up the pole \begin{eqnarray} l_2^-=\frac{(\boldsymbol{l}_{2T}-\boldsymbol{l}_{1T})^2}{2(l_2^+-l_1^+)}+\frac{l_{1T}^2}{2l_1^+}-i\epsilon, \label{2m} \end{eqnarray} which makes the incoming quark of the momentum $p_1-l_2$ off-shell with a negative mass. The invariant mass of the scattered quark \begin{eqnarray} (p_2-l_2)^2 = p_2^2 - 2p_2 \cdot l_2 + 2 l_1 \cdot l_2 - l_1^2 = \frac{l_1^+-p_2^+}{l_2^+-l_1^+}\left(\boldsymbol{l}_{2T}-\frac{l_2^+-p_2^+}{l_1^+-p_2^+}\boldsymbol{l}_{1T}\right)^2 -\frac{(l_2^+-p_2^+)p_2^+}{(l_1^+-p_2^+)l_1^+}l_{1T}^2-2(l_2^+-p_2^+)p_2^-,\label{2m1} \end{eqnarray} approaches plus infinity as $l_2^+\to l_1^+$ from above, and $-l_{2T}^2$ as $l_2^+\to p_2^+$. That is, we have an on-shell internal particle, and an imaginary piece. However, this phase will be cancelled by a phase from the diagram with two real gluons, which we turn to next. \begin{figure}[!] \includegraphics[scale=0.5]{ssa_fd_2-loop_2} \hspace{1.0cm} \includegraphics[scale=0.5]{ssa_fd_2-loop_3} \caption{Left: A two-loop diagram with one virtual gluon and one real gluon. Right: A two-loop diagram with two real gluons. The phases cancel between these two diagrams (see the text). } \label{2loop2} \end{figure} The diagram in Fig.~\ref{2loop2} (right) with the final state cut on the outgoing quark of the momentum $p_2-l_2$ and the gluons of the momenta $l_1$ and $l_2-l_1$ is closely related to the previously considered diagram. The on-shell conditions $(l_2-l_1)^2=0$ and $(p_2-l_2)^2=0$ are equivalent to Eq.~(\ref{2m}) and the vanishing of Eq.~(\ref{2m1}), respectively. To get an imaginary piece, the outgoing quark of the momentum $p_2-l_1$ should go on shell, which then leads to the condition in Eq.~(\ref{2m0}). Therefore, this diagram can give rise to a phase from the same set of on-shell propagators as in the diagram of Fig.~\ref{2loop2} (left). It has been known that the contributions from on-shell partons cancel between virtual and real corrections. A simple explanation for this cancellation is as follows: for $l_1^+<l_2^+$, the contour integration over the pole of the gluon propagator with the momentum $l_2-l_1$ in the diagram on the left of Fig.~\ref{2loop2} gives the metric tensor $-g^{\mu\nu}$ of the same sign as the real gluon in the diagram on the right. The other pieces in the loop integrands also contain the same sign between the two diagrams. The only difference comes from the sign of the scattered quark propagators: for the diagram on the left, the quark propagator with the momentum $p_2-l_2$ is proportional to \begin{eqnarray} \frac{1}{(p_2-l_2)^2+i\epsilon}=\frac{1}{[(p_2-l_1)-(l_2-l_1)]^2+i\epsilon}= \frac{1}{-2(p_2-l_1)\cdot(l_2-l_1)+i\epsilon}. \end{eqnarray} For the diagram on the right, the quark propagator with the momentum $p_2-l_1$ is proportional to \begin{eqnarray} \frac{1}{(p_2-l_1)^2-i\epsilon}=\frac{1}{2(p_2-l_1)\cdot(l_2-l_1)-i\epsilon}, \end{eqnarray} where we have used the on-shell conditions $(p_2-l_2)^2=(l_1-l_2)^2=0$. Hence, the diagram on the right generates the same imaginary piece as the diagram on the left but with an opposite sign. Summing these diagrams, the imaginary pieces cancel. The same observation applies to other diagrams, where the real gluon of the momentum $l_1$ attaches to the incoming quark on the right hand side of the final state cut. In summary, the sum of the diagrams with two real gluons and those with one real gluon and one virtual gluon does not contribute to SSA. \subsection{Fig.~\ref{2loop4}: a two-loop box diagram} Next we discuss a two-loop box diagram in Fig.~\ref{2loop4}, where two final state partons form a time-like invariant mass with rescattering between them via a virtual gluon with momentum $l_2-l_1$ \cite{Brodsky:2002cx}. The plus and minus components of $l_1$ are fixed by the final state on-shell conditions as in Eq.~(\ref{2m0}). The contour integration over $l_2^-$ has the structure \begin{eqnarray} &&\int_{-\infty}^\infty dl_2^- \frac{1}{[(p_1 - l_2)^2 + i\epsilon][(p_2 - l_2)^2 + i\epsilon][(l_2 - l_1)^2 + i\epsilon](l_2^2 + i\epsilon)}\nonumber \\ &=& \int_{-\infty}^\infty dl_2^- \frac{1}{[2(l_2^+-p_1^+)l_2^- -l_{2T}^2 +i\epsilon][2(l_2^+-p_2^+)l_2^--l_{2T}^2 +i\epsilon]}\nonumber \\ && \times\frac{1}{[2(l_2^+-l_1^+)(l_2^- - l_1^-)-(\boldsymbol{l}_{2T} - \boldsymbol{l}_{1T})^2+i\epsilon](2l_2^+l_2^- - l_{2T}^2+i\epsilon)}. \end{eqnarray} For $p_2^+<l_2^+<p_1^+$, we have $l_2^+ - l_1^+ > 0$, as $l_1^+ < p_2^+$ implied by Eq.~(\ref{2m0}). In this case the pole $l_2^-=l_{2T}^2/[2(l_2^+-p_1^+)]+i\epsilon$ renders the outgoing quark $p_2-l_2$ and the two virtual gluons all off-shell with negative invariant masses. In the range $l_1^+<l_2^+<p_2^+$, we pick up the contributions from two poles, Eq.~(\ref{2m}) and $l_2^-=l_{2T}^2/(2l_2^+)-i\epsilon$. The former leads to an imaginary piece from the outgoing quark propagator $p_2-l_2$ shown in Eq~(\ref{2m1}). For this pole, the incoming quark is off-shell by a negative invariant mass, and the virtual gluon of the momentum $l_2$ is off-shell by \begin{eqnarray} l_2^2 = 2l_1\cdot l_2 - l_1^2 = \frac{l_1^+}{l_2^+-l_1^+}\left(\boldsymbol{l}_{2T}-\frac{l_2^+}{l_1^+}\boldsymbol{l}_{1T}\right)^2>0. \end{eqnarray} Following the same reasoning as before, the above imaginary piece will be canceled by the same type of diagram with the final state cut on the outgoing quark of the momentum $p_2-l_2$ and the gluon of the momentum $l_2-l_1$ (see Fig.~\ref{cancel}). \begin{figure}[!] \includegraphics[scale=0.5]{ssa_fd_2-loop_4} \caption{The box diagram. } \label{2loop4} \end{figure} \begin{figure}[!] \includegraphics[scale=1]{cancel} \caption{Cancellation of particular pole contributions, similar to the one between the two diagrams in Fig.~\ref{2loop2}. Crosses denote on-shell propagators, which give rise to a phase. } \label{cancel} \end{figure} \begin{figure}[!] \includegraphics[scale=1]{add} \caption{Non-cancellation of poles between diagrams with different final state cuts. } \label{add} \end{figure} The contribution from the latter pole of $l_2^-$ can be combined with the same pole in the range $0<l_2^+<l_1^+$, which makes the incoming quark off-shell by a negative invariant mass, and the virtual gluon of the momentum $l_2-l_1$ off-shell by \begin{eqnarray} (l_2 - l_1)^2 = -2l_1\cdot l_2 = -\frac{l_2^+}{l_1^+}\left(\boldsymbol{l}_{1T}-\frac{l_1^+}{l_2^+}\boldsymbol{l}_{2T}\right)^2 < 0. \end{eqnarray} For this pole, the outgoing quark of the momentum $p_2-l_2$ also generates an imaginary piece, since the on-shell condition $(p_2 - l_2)^2$ can be satisfied. The two solutions are given by \begin{eqnarray} l_2^+= \frac{p_2^+}{2}(1 \pm \Delta_2) \equiv l^+_{2(\pm)}, \qquad \Delta_2 \equiv \sqrt{1-\frac{4l_{2T}^2}{p_2^2}}, \qquad l^-_{2(\pm)}\equiv \frac{l_{2T}^2}{2l^+_{2(\pm)}}, \label{2p} \end{eqnarray} meaning that the imaginary piece persists for arbitrary $l_{1T}^2,l_{2T}^2 <p_2^2/4$. Note that this contribution is not canceled by the same type of diagram with the final state cut on the outgoing quark of the momentum $p_2-l_2$ and the gluon of the momentum $l_2$ (see Fig.~\ref{add}). This diagram is just the complex conjugate of the considered diagram, and thus gives the identical contribution. The observation is that we need two final state partons to form a time-like invariant mass, which rescatter with each other via exchange of a virtual gluon. The diagram with the virtual gluon of the momentum $l_2-l_1$ attaching to the incoming quark and the real gluon, displayed in Fig.~\ref{2loop5}, does not contribute an imaginary piece: as the first emitted gluon $l_2$ becomes on-shell, the second emitted gluon $l_2-l_1$ is off-shell and the loop integral does not produce a phase. \begin{figure}[!] \includegraphics[scale=0.5]{ssa_fd_2-loop_5} \caption{A diagram which does not contain a phase. } \label{2loop5} \end{figure} \begin{figure}[!] \includegraphics[scale=0.4]{alldiagrams} \caption{Two-loop diagrams which have the same pole structure as the box diagrams. The diagrams obtained by the left-right mirror reflection of the first, second and fifth diagrams are omitted. Virtual photon lines are also omitted for simplicity. } \label{2loop6} \end{figure} There exists a class of diagrams, as displayed in Fig.~\ref{2loop6}, which have exactly the same set of on-shell propagators as in Fig.~\ref{add}, and are equally important. The first and eighth diagrams can be directly obtained from the box diagram by changing the photon vertices. They guarantee that the imaginary piece alone respects the QED WT identity.\footnote{One might think that Fig.~\ref{2loop5} is also related to the box diagram via the WT identity. However, as we have argued, this diagram does not contain a phase, so the WT identity is satisfied without it.} The other diagrams, such as the third and fourth diagrams in the first row, are obtained from the box diagram by changing the attachments of the $l_2$ gluon. They are thus crucial for the QCD gauge invariance. The sum of all these diagrams is written as the following compact formula, as depicted in Fig.~\ref{blob}, \begin{eqnarray} S^{(0)\mu \nu}(x)& =& \frac{g^4}{N_c}(2\pi)\delta\left(\left(p_2 - \frac{P_h}{z}\right)^2\right)\int \frac{d^4 l_2}{(2\pi)^4} (2\pi)\delta(l_2^2)(2\pi) \delta((p_2 - l_2)^2)\nonumber \\ &&\times \left\{ i A^{\alpha\mu}(l_1) \Delta_\alpha^{\ \alpha'}M_{\alpha'\beta}(l_1,l_2)A^{\nu\beta}(l_2)-iA^{\alpha\mu}(l_2) M_{\alpha\beta}(l_2,l_1)\Delta^\beta_{\ \beta'}A^{\nu\beta'}(l_1)\right\}, \label{hs} \end{eqnarray} with the number of colors $N_c$, and $l_1 = p_2 - P_h/z$ being determined by the overall momentum conservation. $\Delta^\alpha_{\ \alpha'}$ is the projector onto the physical polarization states for the final state gluon $l_1$, \begin{eqnarray} \Delta^{\alpha\alpha'}= \sum_{i=1,2} \epsilon_i^\alpha \epsilon^{*\alpha'}_i= -g^{\alpha\alpha'} + \frac{l_1^\alpha \bar{l}_1^{\alpha'}+l_1^{\alpha'}\bar{l}_1^\alpha}{l_1\cdot \bar{l}_1}, \end{eqnarray} with $l=(l^0,\vec{l})$ and $\bar{l}=(l^0,-\vec{l})$. As long as we sum over all the terms in Eq.~(\ref{rev}) to ensure the gauge invariance, we may replace $\Delta^{\alpha\alpha'}$ by $-g^{\alpha\alpha'}$. The other factors in Eq.~(\ref{hs}) are defined as \begin{eqnarray} M_{\alpha\beta}(l_1,l_2)&=&(\Slash p_2-\Slash l_1) t^a \left[-i f^{abc}t^c\frac{V_{\alpha\beta\rho}\gamma^\rho}{(l_1-l_2)^2} + t^at^b\frac{\gamma_\alpha\Slash p_2\gamma_\beta}{p_2^2} + t^bt^a\gamma_\beta \frac{\Slash p_2 -\Slash l_1-\Slash l_2}{(p_2-l_1-l_2)^2}\gamma_\alpha \right]t^b (\Slash p_2 -\Slash l_2) , \label{mm} \end{eqnarray} \begin{eqnarray} V_{\alpha\beta\rho}&=& g_{\alpha\beta}(l_2+l_1)_\rho + g_{\alpha\rho}(l_2-2l_1)_\beta + g_{\rho\beta}(l_1-2l_2)_\alpha, \label{vert} \end{eqnarray} and \begin{eqnarray} A^{\alpha\mu}(l_{1})= \gamma^\alpha \frac{(\Slash p_1-\Slash l_{1})}{(p_1-l_{1})^2}\gamma^\mu +\gamma^\mu\frac{\Slash p_2}{p_2^2}\gamma^\alpha, \end{eqnarray} \begin{eqnarray} A^{\nu\beta}(l_{2})= \gamma^\nu \frac{(\Slash p_1-\Slash l_{2})}{(p_1-l_{2})^2}\gamma^\beta +\gamma^\beta\frac{\Slash p_2}{p_2^2}\gamma^\nu. \end{eqnarray} The two terms in Eq.~(\ref{hs}) correspond to the two possible insertions of the final state cut (cf. Fig.~\ref{add}). Taking the hermitian conjugate of the second term, one confirms that Eq.~(\ref{hs}) is symmetric in the indices $\mu,\nu$. \begin{figure}[!] \includegraphics[scale=0.5]{blob} \caption{A graphical representation of the first term in Eq.~(\ref{hs}). } \label{blob} \end{figure} It should be noted that, in the end, the final set of diagrams are identical to those considered in \cite{Ma:2008cj}. We have however provided a more complete analysis of diagrams, including the discussion of gauge invariance and various kinematic configurations. In particular, we have identified the roots in Eqs.~(\ref{2m0}) and (\ref{2p}) which are essential for the factorization of our new contribution to be highlighted in the next section. \subsection{Collinear splitting diagrams} There exists another class of two-loop diagrams, which contains an imaginary part and is characterized by the collinear splitting of an on-shell parton. An example is shown in Fig.~\ref{another}, where the quark with the momentum $p_2-l_2$ is on-shell, and splits into two on-shell partons, a quark with the momentum $p_2-l_1-l_2$ and a gluon with the momentum $l_1$. This configuration is kinematically possible only if the three partons are all collimated to each other, and thus gets phase space suppression. Indeed, a simple analysis indicates that the imaginary part arises, only if $\boldsymbol{l}_{2T}$ is opposite in direction relative to $\boldsymbol{l}_{1T}$ and $l_{2T}^2<l_{1T}^2$. It means that this diagram is suppressed by $l_{1T}^2/p_2^2 \sim P_{hT}^2/Q^2$, namely, a higher twist effect. We therefore neglect these diagrams. \begin{figure}[!] \includegraphics[scale=0.5]{fd71} \caption{A diagram with an on-shell parton splitting. } \label{another} \end{figure} \section{Factorization} Equation~(\ref{hs}) derived in the previous section cannot be immediately inserted into Eq.~(\ref{rev}), because it involves collinear divergences from different kinematic regions. In this section we examine the structure of these divergences and discuss their treatments in the collinear and $k_T$ factorizations. The on-shell conditions for the final state partons and the integration over the light-cone components of $l_2$ lead to a summation over the following combinations of roots, see Eqs.~(\ref{2m0}) and (\ref{2p}), \begin{eqnarray} (l_1^+,l_2^+)=(l_{1(+)}^+,l_{2(+)}^+), \quad (l^+_{1(+)},l^+_{2(-)}), \quad (l^+_{1(-)},l^+_{2(+)}), \quad (l^+_{1(-)},l^+_{2(-)}). \label{compo} \end{eqnarray} For each choice, the corresponding minus components are fixed by $l^-_{1}=l_{1T}^2/(2l^+_{1})$ and $l^-_{2}=l_{2T}^2/(2l^+_{2})$. We introduce the shorthand notations $(++),(+-),(-+),(--)$ to represent the above four choices. \subsection{Collinear factorization} Since the momentum $l_1$ has been set to $l_1=p_2 - P_h/z$ in the collinear factorization, we investigate only the infrared divergence from the integration over $\boldsymbol{l}_{2T}$. First consider the $(++)$ and $(-+)$ cases, for which the radiative $l_2$ gluon is collimated to the initial proton in the collinear region \begin{eqnarray} l_{2}^+\sim O(p_2^+)\gg l_{2T} \gg l_{2}^-.\label{h++} \end{eqnarray} The incoming quark of the momentum $p_1-l_2$ is nearly on-shell, and the associated $l_{2T}$ integral is logarithmically divergent like \begin{eqnarray} \int \frac{d^2 \boldsymbol{l}_{2T}}{(p_1-l_2)^2} = \int \frac{d^2 \boldsymbol{l}_{2T}}{-2p_1^+l_{2+}^-} \sim \int \frac{d^2 \boldsymbol{l}_{2T}}{l_{2T}^2}. \label{coll} \end{eqnarray} The $l_2-l_1$ propagators for the $(\pm +)$ combinations are written as \begin{eqnarray} \frac{1}{(l_1-l_2)^2} = \frac{-1}{p_2^2(\Delta_1\mp \Delta_2)^2/4+(\boldsymbol{l}_{1T}-\boldsymbol{l}_{2T})^2}.\label{12} \end{eqnarray} There is an apparent divergence at $\boldsymbol{l}_{1T} \to \boldsymbol{l}_{2T}$ in the $(++)$ case, but it is innocuous because the numerator of Eq.~(\ref{hs}) vanishes as $l_1=l_2$. The last term of Eq.~(\ref{mm}) is given by \begin{eqnarray} \frac{1}{(p_2-l_1-l_2)^2} = \frac{-1}{p_2^2(\Delta_1\pm \Delta_2)^2/4 +(\boldsymbol{l}_{1T}+\boldsymbol{l}_{2T})^2}, \label{appa} \end{eqnarray} for which the $(-+)$ combination appears problematic in the limit $\boldsymbol{l}_{1T}\to -\boldsymbol{l}_{2T}$. Inspecting the numerator, we find that all components of $p^\mu_2-l^\mu_1-l^\mu_2$ go to zero simultaneously as $\boldsymbol{l}_{1T}\to -\boldsymbol{l}_{2T}$, so this limit is in fact infrared finite. To determine the nature of the collinear configuration in the $(\pm +)$ combinations, look at the potentially dangerous term in Eq.~(\ref{hs}), \begin{eqnarray} M_{\alpha\beta}A^{\nu\beta} \sim M_{\alpha\beta} \gamma^\nu \frac{\Slash p_1-\Slash l_2}{l_{2T}^2}\gamma^\beta. \label{beta} \end{eqnarray} In the small $l_{2T}$ limit, $l_2^\mu$ has only the plus component. We then immediately see that the $\beta=-$ component in Eq.~(\ref{beta}) vanishes owing to $(\Slash p_1-\Slash l_2)\gamma^- \sim (\gamma^-)^2=0$. As for the component $\beta=+$, we find from Eq.~(\ref{mm}) \begin{eqnarray} M_{\alpha +} \propto M_{\alpha \beta}l^\beta_2 \propto l_{1\alpha}, \end{eqnarray} which is a consequence of the QCD WT identity. When the longitudinal momentum $l_{1\alpha}$ goes into the final state cut, this contribution also vanishes. Therefore, we only need to worry about the case, where $\beta$ in Eq.~(\ref{beta}) is transverse. For transverse $\beta$, the singularity does survive. We argue that this can be absorbed into the HP contribution to SSA known in the literature. Indeed, since the collinear gluon with the momentum $l_2$ is transversely polarized and travels a long distance, we may deform Fig.~\ref{blob} into Fig.~\ref{hp}, which is identical to Fig.~2 of \cite{Eguchi:2006mc}. As demonstrated in \cite{Eguchi:2006mc}, this corresponds to the HP contribution associated with the three-parton ETQS function $G_F(x_1,x_2)$, where the value of $x_1$ is set to the Bjorken variable $x_B$: label the longitudinal momentum of the incoming quark by $p_1^+-l_2^+ = xP^+ -l_2^+ =x_1P^+$ and the gluon momentum by $l_2^+=(x_2-x_1)P^+$. The on-shell condition $l_2^+ \approx p_2^+ =(x-x_B)P^+$ then yields $x_1=x_B$. In practice, to absorb the collinear divergence into the ETQS function, we insert the projector $(\gamma^+)(\gamma^-)$ from the Fierz identity \begin{eqnarray} I_{ij}I_{lk}&=& \frac{1}{4}I_{ik}I_{lj} + \frac{1}{4}(\gamma^\alpha)_{ik}(\gamma_\alpha)_{lj} + \frac{1}{8}(\gamma_5\sigma^{\alpha\beta})_{ik} (\sigma_{\alpha\beta}\gamma_5)_{lj} + \frac{1}{4}(\gamma_5\gamma^\alpha)_{ik}(\gamma_\alpha\gamma_5)_{lj} + \frac{1}{4}(\gamma_5)_{ik}(\gamma_5)_{lj}, \label{fierz0} \end{eqnarray} into the quark lines with the momenta $p_1-l_2$ and $p_1$ on the left and right hand sides of the cut, respectively. The matrix $\gamma^+$ then appears as the spin projector in the definition of the ETQS function, and $\gamma^-$ is contracted to the corresponding one-loop three-parton hard kernel. This factorization has been explicitly demonstrated for a quark target model in \cite{Ma:2008cj}. We therefore subtract this divergence, as well as the finite part by scheme choice, from Eq.~(\ref{hs}) as a known mechanism. \begin{figure}[!] \includegraphics[scale=0.4]{deform} \caption{The HP contribution from the transversely polarized $l_2$ gluon. } \label{hp} \end{figure} Next we turn to the $(+ -)$ and $(--)$ combinations. The $l_1-l_2$ and the $p_2 - l_1 - l_2$ propagator denominators have the forms as in Eqs.~(\ref{12}) and (\ref{appa}), respectively, which are infrared finite in the limits $\boldsymbol{l}_{1T} \to \boldsymbol{l}_{2T}$ and $\boldsymbol{l}_{1T} \to -\boldsymbol{l}_{2T}$ as explained above. Besides, the radiative $l_2$ gluon satisfies the hierarchy \begin{eqnarray} l_{2}^-\sim O(p_2^-)\gg l_{2T} \gg l_{2}^+,\label{h--} \end{eqnarray} for these combinations, such that there is no infrared singularity in the $p_1-l_2$ propagator. Hence, the corresponding phase cannot be absorbed into nonperturbative distribution functions. It thus represents a new perturbative origin of SSA purely attributed to a hard kernel, and this is the central observation of our work. In the collinear factorization framework, one can insert the projector $(\gamma^+)(\gamma^-)$ between the upper two blobs in Fig.~\ref{dia} and $(\gamma_5\gamma^i)(\gamma_i\gamma_5)$ between the lower two blobs. The former leads to the standard collinear twist-two FF $D_1$ and the latter leads to the $g_T$ distribution function. We then arrive at a factorization formula \begin{eqnarray} d\sigma^{(2)}&=&g_T^{(0)}\otimes H_{\gamma_5\gamma^y,\gamma^+}^{(2)}\otimes D_1^{(0)}, \label{our} \end{eqnarray} where the proton spin has been assumed to be along the $y$ direction. The superscript denotes the order to which various factors are evaluated. This is the explicit structure we advocated in Eq.~(\ref{rev}). There is, however, another possibility. One can insert the projector $(\gamma_5\sigma^{i+})(\sigma_{i+}\gamma_5)$ between the lower two blobs in Fig.~\ref{dia} and the identity matrix $(I)(I)$ between the upper two blobs. The former gives the twist-two transversity distribution function $h_1$, and the latter gives the collinear twist-three FF $E$ \cite{Bacchetta:2006tn}. We thus acquire an additional contribution \begin{eqnarray} d\sigma^{(2)}= h_1^{(0)}\otimes H_{\gamma_5\sigma^{y-},I}^{(2)}\otimes E^{(0)}. \label{sup} \end{eqnarray} The FF $E$ dropped out in the one-loop calculation of SSA in SIDIS \cite{Kanazawa:2013uia}, where it was denoted as $\hat{e}_1$, and also in $pp$ collisions \cite{Metz:2012ct}. It first shows up at two-loops, and is naturally suppressed by a factor $\alpha_s$ compared to the one-loop contributions to SIDIS in \cite{Kanazawa:2013uia}. We point out that an analysis of the complete set of collinear FFs is considerably more complicated at twist-three level. Of course, Eq.~(\ref{our}) is also parametrically suppressed by a factor $\alpha_s$ compared with the known one-loop contributions from the ETQS (or Sivers) distributions \cite{Chen:2017lvx}. The reason we nevertheless consider them worthwhile to study is because the $g_T$ distribution function has the Wandzura-Wilczek part \cite{Wandzura:1977qf} related to the twist-two polarized quark distribution function $\Delta q(x)$. This can be seen from Eq.~(\ref{ident}) together with another identity (see Eq.~(45) of \cite{Eguchi:2006qz}) \begin{eqnarray} \tilde{g}(x) =-x\int_x^1 dx_1 \left[ \frac{2\Delta q(x_1)}{x_1} + \frac{1}{x_1^2}\int_{-1}^1 dx_2 \left( \frac{G_F(x_1,x_2)}{x_1-x_2} +(3x_1-x_2)\frac{\widetilde{G}_F(x_1,x_2)}{(x_1-x_2)^2}\right)\right] . \end{eqnarray} As suggested in \cite{Kanazawa:2014dca}, the genuine twist-three distributions $G_F$ and $\widetilde{G}_F$, which are poorly constrained from the experimental data at present, may be numerically small. On the other hand, the polarized quark distributions, being purely twist-two quantities and well constrained by data, give a finite contribution to the proton spin. Hence, the apparent suppression by $\alpha_s$ could be numerically compensated in practice. This possibility will be explored in future works \cite{prep}. The above argument suggests that only the $(\pm -)$ roots is kept in the matrix elements $S^{(0)}$ in Eq.~(\ref{rev}). Remarkably, however, we can include also the $(\pm +)$ roots in this formula by inserting the Fierz identity into the $p_1$ quark lines, instead of the $p_1-l_2$ and $p_1$ quark lines, as we have done in the $(\pm -)$ case. It will be demonstrated that these divergences due to the alternative Fierz insertion cancel between the first two terms in Eq.~(\ref{rev}). Substituting Eq.~(\ref{la}) into Eq.~(\ref{rev}), we obtain the structures in Eqs.~(\ref{gauge1}) and (\ref{gauge2}). We then notice that \begin{eqnarray} S^{(0)}(k) \Slash k \sim M_{\alpha\beta} \gamma^\nu \frac{\Slash k - \Slash l_2}{(k-l_2)^2} \gamma^\beta \Slash k, \label{IR1} \end{eqnarray} is free of the collinear divergence for an on-shell but not necessarily collinear momentum $k$: in the collinear region where $k$ and $l_2$ are parallel, the numerator can be expressed as \begin{eqnarray} (\Slash k -\Slash l_2)\gamma^\beta \Slash k = 2(k^\beta-l_2^\beta)\Slash k -\gamma^\beta (\Slash k-\Slash l_2) \Slash k.\label{IR2} \end{eqnarray} This gives a vanishing contribution when $k^\beta \propto l_2^\beta$, because of $k^2=0$ and $M_{\alpha\beta} l_2^\beta=0$. The differentiation of Eq.~(\ref{IR1}) with respect to $S_T^\alpha \partial/\partial k^\alpha$ then immediately leads to the cancellation of the divergences in the Wandzura-Wilczek part of $g_T$ in Eq.~(\ref{gauge1}). Including the $(\pm +)$ roots into $S^{(0)}$ and $S^{(1)}$, which collects the diagrams with an additional valence gluon attaching to an internal line of $S^{(0)}$, we find that the resulting collinear divergences do not cancel in Eq.~(\ref{gauge2}). We argue that they should be absorbed into the renormalization of the $G_F$ and $\tilde{G}_F$ distributions associated with the one-loop HP contribution to SSA. Indeed, Eq.~(\ref{gauge2}) can be redrawn as in Fig.~\ref{fact} by inserting the Fierz identity at a different location. To achieve it, the projectors for the $S^{(0)}$ terms have been made the same as for the $S^{(1)}$ terms in the first and second lines of Eq.~(\ref{gauge2}) via the replacements $\gamma_5\Slash S_T/x_1=\Slash P\gamma_5\Slash S_T/(x_1\Slash P) =i\Slash P\gamma_\alpha \epsilon^{\alpha -+ S_T}/(x_1\Slash P)$ and $\Slash S_T/x_1=-\Slash PS_T^\alpha\gamma_\alpha/(x_1\Slash P)$, respectively. In the above expressions $\gamma_\alpha$ corresponds to the vertex located at the outermost end of the incoming quark in Fig.~\ref{fact}, and $1/(x_1\Slash P)$ represents the quark propagator following this vertex. The lower parts of the diagrams on the right are then identified as the one-loop diagrams to renormalize the $G_F$ and $\tilde{G}_F$ distributions (see Fig.~7 of Ref.~\cite{Kang:2008ey}). In principle, one is able to rederive the evolution equations of $G_F$ and $\tilde{G}_F$ this way. We leave it to a future work. \begin{figure}[!] \includegraphics[scale=0.4]{fig14} \caption{A sample of diagrams involved in the factorization of the divergent contribution in Eq.~(\ref{gauge2}), based on the two-loop box diagram. The dashed curve represents the proper insertion of the Fierz identity. } \label{fact} \end{figure} \subsection{$k_T$ factorization} Next we come to the more complicated $k_T$ factorization, in which both the initial and final state partons can carry transverse momenta. As elaborated below, the transverse momenta $\boldsymbol{l}_{1T}$, $\boldsymbol{l}_{2T}$ of the real gluons in the considered two-loop diagrams serve as these additional parton kinematic variables \cite{Nagashima:2002ia}, independent of the momentum fractions $x$ and $z$. For example, $\boldsymbol{l}_{1T}$ needs not to be equal to $\boldsymbol{P}_{h T}/z$ associated with the produced hadron as in the collinear factorization. A parton is then off-shell by $-l_T^2$ in the $k_T$ factorization, which is regarded as an infrared scale. That is, an infrared divergence in the $k_T$ factorization is represented by an infrared logarithm $\ln l_T^2$. A factorization formula is expressed as a convolution of a hard kernel with TMD PDFs and TMD FFs in both longitudinal and transverse momenta. The analysis of the phase origin is the same as in Sec.~III with the solutions of $l_1^+$ and $l_2^+$ being easily adapted from their collinear counterparts, given by Eqs.~(\ref{2m0}) and (\ref{2p}), respectively. Below we will discuss the $k_T$ factorization for the four combinations of $(l_1^+,l_2^+)$ separately. First consider the $(++)$ case, for which the radiative gluons of the momenta $l_1$ and $l_2$ are both collimated to the initial proton under the hierarchy similar to Eq.~(\ref{h++}). The two final state partons with the momenta $p_2-l_1$ and $l_1$ move in the minus and plus directions, respectively. The incoming quark of the momentum $p_1-l_2$ is nearly on-shell, and the associated $l_{2T}$ integral produces an infrared logarithm from the collinear region $l_{2T}\sim l_{1T}$ as shown in Eq.~(\ref{coll}). Besides, the $l_2-l_1$ gluon with the invariant mass being of order $l_{1T}^2$ as $l_{2T}\sim l_{1T}$, is soft according to Eq.~(\ref{12}). On the other hand, the outgoing quark of the the momentum $p_2-l_2$ moves mainly in the minus direction, namely, in the direction of the produced hadron. Since the attaching gluon momentum $l_2-l_1$ is soft, the quark line with the momentum $p_2-l_2$ can be eikonalized: \begin{eqnarray} \frac{1}{(p_2-l_2)^2}=\frac{1}{[(p_2-l_1)+(l_1-l_2)]^2}\approx \frac{1}{2(p^-_2-l^-_1)(l_1^+-l_2^+)}, \end{eqnarray} if this gluon is longitudinally polarized. The resultant Wilson line contains the propagator $1/(l_1^+-l_2^+ +i\epsilon)$, which generates a phase as $l_1^+=l_2^+$. The collinear logarithm together with this phase are then absorbed into the Sivers function by inserting the projector $(\gamma^+)(\gamma^-)$ from the Fierz identity in Eq.~(\ref{fierz0}): the matrix $\gamma^+$ appears as the spin projector in the definition of the Sivers function, and $\gamma^-$ is contracted to the corresponding leading-order two-parton hard kernel. Under this factorization, the quark carries the momentum $p_1-l_1$ before hard scattering, implying that the Sivers function depends on the longitudinal momentum $p_1^+-l_1^+\equiv xP^+$ and the transverse momentum $l_{1T}$. If the $l_2-l_1$ gluon is transversely polarized, the collinear logarithm can be absorbed into the one-loop renormalization of the twist-three three-parton TMD PDF (the TMD version of the ETQS function). To achieve this factorization, we simply insert the projector $(\gamma^+)(\gamma^-)$ from the Fierz identity: $\gamma^+$ appears as the spin projector in the definition of the three-parton TMD PDF, and $\gamma^-$ is contracted to the corresponding leading-order three-parton hard kernel. After the factorization, the quark and the gluon on the left of the final state cut carry the momenta $p_1-l_2$ and $l_2-l_1$ before hard scattering, respectively, and the quark on the right of the final state cut carries $p_1-l_1$. It indicates that the three-parton TMD PDF depends on the longitudinal momenta $p_1^+-l_2^+\equiv x_1P^+$ and $p_1^+-l_1^+\equiv x_2P^+$ and on the transverse momenta $l_{1T}$ and $l_{2T}$. The phase comes from the on-shell $p_2-l_2$ propagator in the hard kernel, which corresponds to the SGP contribution observed in the collinear factorization as $l_{2T}=l_{1T}$, and to the HP contribution as $l_{2T}\not =l_{1T}$. We thus conclude that the $(++)$ component does not lead to a new contribution to SSA. Next we turn to the $(--)$ combination, for which both the radiative gluons of the momenta $l_1$ and $l_2$ follow the hierarchy similar to Eq.~(\ref{h--}). Due to $p_2^-\gg p_2^+$, the two final state partons as well as the momentum $p_2-l_2$ are mainly in the minus direction. The incoming quark of the momentum $p_1-l_2$ is highly off-shell by ${\cal O}(Q^2)$, so the collinear-to-proton divergence in Eq.~(\ref{coll}) is absent. The $l_2-l_1$ propagator develops a soft logarithm as $l_{2T}\sim l_{1T}$, the same as in the $(++)$ combination according to Eq.~(\ref{12}). Since $l_{1,2}^+$ are soft, the two internal quark lines with the momenta $p_1-l_2$ and $p_1-l_1$ can be eikonalized. The resultant phase is absorbed by the twist-two FF, or the Collins function in the $k_T$ factorization framework. Note that, because the eikonalized $p_1-l_{1,2}$ quark lines always remain off-shell, the Wilson lines involved in the definition of the Collins function do not produce a phase. This result differs from that for the Sivers function mentioned above. See also \cite{Meissner:2008yf}. The factorization of the infrared logarithm into the Collins FF can be done by inserting the Fierz identity in Eq.~(\ref{fierz0}) between the two-loop FF and the leading-order two-parton hard kernel (i.e., between the upper two blobs in Fig.~\ref{dia}). One picks up the $(\gamma_5\sigma^{i+})(\sigma_{i+}\gamma_5)$ term, in which $\sigma_{i+}\gamma_5$ goes into the definition of the Collins function, and $\gamma_5\sigma^{i+}$ goes into the hard kernel. It implies that the same spin projector also enters the leading-order PDF of the polarized proton, defining the transversity distribution $h_1$. The other Dirac structures lead to either vanishing or subleading (twist-three TMD) contributions. The final state quark carries the momentum $p_2-l_1$, so the Collins function depends on the longitudinal momentum $p_2^--l_1^-\equiv zP_h^-$ and the transverse momentum $l_{1T}$. In conclusion, the $(--)$ contribution also reduces to the known mechanism of SSA. We then turn to the $(-+)$ combination. It has been pointed out that the $l_2-l_1$ propagator does not generate an infrared logarithm in this case (see Eq.~(\ref{12})). The quark line $p_1-l_2$ develops a collinear logarithm when the vertex $\beta$ of the $l_2$ gluon is transverse, as explained in the previous subsection. The $k_T$ factorization of this infrared logarithm is similar to the collinear factorization: it is absorbed into the three-parton TMD PDF with the same spin projector. Under this factorization, the quark and the gluon on the left of the final state cut carry the momenta $p_1-l_2$ and $l_2$ before hard scattering, respectively, and the quark on the right of the final state cut carries $p_1$. It indicates that the three-parton TMD PDF depends on the longitudinal momenta $p_1^+-l_2^+\equiv x_1P^+$ and $p_1^+\equiv x_2P^+$ and on the transverse momentum $l_{2T}$. The phase comes from the on-shell $p_2-l_2$ propagator in the one-loop three-parton hard kernel, which corresponds to the HP contribution observed in the collinear factorization. There is no SGP contribution, because of $l_2\not= l_1$ for the $(-+)$ combination. At last, we investigate the $(+-)$ combination, in which the phase cannot be absorbed into nonperturbative distribution functions. For this combination, there is no infrared singularity in the $l_2-l_1$ and $p_1-l_2$ propagators. The apparent singularity at $\boldsymbol{l}_{1T}=-\boldsymbol{l}_{2T}$ from the last term of Eq.~(\ref{mm}) does not exist either. Hence, we arrive at a factorization formula similar to Eq.~(\ref{our}), but with $g_T$ and $D_1$ being interpreted as the TMD PDF and the TMD FF, respectively. Before closing this section, we briefly comment on the general structure of SSA at the two-parton twist-three level in the $k_T$ factorization framework. If we allow for $k_T$-dependent distributions, there are more contributions than the TMD versions of Eqs.~(\ref{our}) and (\ref{sup}). For example, one can insert $(\gamma^i)(\gamma_i)$ between the upper two blobs and $(\gamma_5\gamma^+)(\gamma^-\gamma_5)$ between the lower two blobs. The former yields the twist-three TMD FF $D^\perp$, while the latter yields the twist-two TMD PDF $g_{1T}$. (All the notations for the TMD PDFs and the TMD FFs follow \cite{Bacchetta:2006tn}.) Exhausting all possible combinations of the spin projectors for higher-order hard kernels, we derive the contributions to SSA up to the two-parton twist-three and two-loop level \begin{eqnarray} d\sigma&=&f^{\perp}_{1T}\otimes H_{\gamma^-,\gamma^+}^{(0)}\otimes D_1 +f^{\perp}_{1T}\otimes H_{\gamma^-,\gamma^x}^{(1)}\otimes D^{\perp} +f^{\perp}_{1T}\otimes H_{\gamma^-,\gamma_5\gamma^x}^{(2)}\otimes G^{\perp}\nonumber\\ & &+g_{1T}\otimes H_{\gamma_5\gamma^-,\gamma^+}^{(2)}\otimes D_1 +g_{1T}\otimes H_{\gamma_5\gamma^-,\gamma_5\gamma^y}^{(1)}\otimes G^{\perp} +g_{1T}\otimes H_{\gamma_5\gamma^-,\gamma^y}^{(2)}\otimes D^{\perp}\nonumber\\ & &+h_1\otimes H_{\gamma_5\sigma^{y-},\gamma_5\sigma^{y+}}^{(0)}\otimes H_1^{\perp} +h_1\otimes H_{\gamma_5\sigma^{y-},\gamma_5\sigma^{yx}}^{(1)}\otimes H^* +h_1\otimes H_{\gamma_5\sigma^{y-},I}^{(2)}\otimes E^*\nonumber\\ & &+e_T\otimes H_{\gamma_5,\gamma_5\sigma^{y+}}^{(1)}\otimes H_1^{\perp} +e_T^\perp\otimes H_{I,\gamma_5\sigma^{y+}}^{(2)}\otimes H_1^{\perp}\nonumber\\ & &+f_{T}\otimes H_{\gamma^y,\gamma^+}^{(1)}\otimes D_1 +g_T\otimes H_{\gamma_5\gamma^y,\gamma^+}^{(2)}\otimes D_1\nonumber\\ & &+h_T^\perp\otimes H_{\gamma_5\sigma^{yx},\gamma_5\sigma^{y+}}^{(1)}\otimes H_1^{\perp} +h_T\otimes H_{\gamma_5\sigma^{-+},\gamma_5\sigma^{y+}}^{(1)}\otimes H_1^{\perp}, \label{many} \end{eqnarray} where the functions labelled by $*$ diminish for a massless produced hadron. The FF $G^\perp$ comes from the projector $\gamma_i\gamma_5$, and $H_1^\perp$ from $\sigma_{i+}\gamma_5$. The TMD transversity function $h_1$ denotes $h_1-(k_x^2-k_y^2)h_{1T}^\perp/(2M^2)$ actually. For the $h_1$ piece, the hard kernel $H^{(1)}_{\gamma_5\sigma^{y-},\gamma_5\sigma^{x+}}$ may appear at one loop. It has been omitted in Eq.~(\ref{many}), because it is subleading compared to the term $H^{(0)}_{\gamma_5\sigma^{y-},\gamma_5\sigma^{y+}}$. The nonperturbative spin-momentum correlation in the Sivers function and the Collins function are basically determined by fits to data. Including the numerous terms in Eq.~(\ref{many}), it is expected to make an impact on the determination of the Sivers function and the Collins function. When we work in the collinear factorization, all the above terms vanish except for the ones which reduce to Eqs.~(\ref{our}) and (\ref{sup}). This emphasizes the importance of the parton transverse momentum for the existence of SSA. Among the many terms in Eq.~(\ref{many}), the one proportional to the distribution $f_T$ is particularly interesting. Since $f_T$ is T-odd, the corresponding contribution flips signs between SIDIS and Drell-Yan. Its definition involves the proton spin $\langle \bar{\psi}\gamma^\alpha\psi\rangle \sim \epsilon_T^{\alpha\beta}S_{T\beta} f_T(x,k_T^2)$, that combines with a factor of $k^x$ from the one-loop hard kernel $H^{(1)}$ to generate a SSA proportional to $P_h^xS_T^y$. If we stick to the leading order hard kernel, the $k^x$ dependence will disappear, and $f_T$ will contribute only to the SIDIS structure function associated with $\sin \phi_S$ (denoted by $F_{UT}^{\sin \phi_S}$ in \cite{Bacchetta:2006tn}), where $\phi_S$ is the azimuthal angle of the proton spin relative to the lepton plane. Because the first moment vanishes $\int d^2k_T f_T(x,k_T^2)=0$, its $k_T$ dependence exhibits some nodes in $k_T$. This may result in a node in SSA as a function of $P_{hT}$, similarly to what was observed in \cite{Zhou:2013gsa,Yao:2018vcg}. \section{Conclusion} In this paper, we have presented a detailed study of the two-loop diagrams that produce an imaginary phase in SIDIS and discussed their gauge invariance and collinear factorization properties. In addition to the known mechanisms for SSA, we have also identified an entirely new contribution proportional to the $g_T$ distribution function. While it is parametrically suppressed by a factor $\alpha_s$, $g_T$ has the Wandzura-Wilczek part related to the polarized quark distribution functions. Since this part is usually considered to be larger than the genuine twist-three one, our new contribution could be comparable in magnitude to those from the ETQS function. In a future publication \cite{prep}, we plan to give a numerical estimate of the obtained results in this paper, and make comparisons with the existing data as well as predictions for the Electron-Ion Collider. We note that there have been a lot of discussions on potentially dominant sources of SSA recently. There is an indication that the Sivers or ETQS contribution may be numerically small \cite{Kang:2011hk}. Instead, a successful fit of the RHIC data \cite{Kanazawa:2014dca,Gamberg:2017gle} suggests that the twist-three FFs may be the dominant source of SSA. In order to confirm this, the same FFs should be able to fit other observables \cite{Hatta:2016khv,Zhou:2017sdx,Benic:2018moa,Benic:2018amn}. In other words, a global analysis of many different data is necessary for understanding the above observations. The subleading contributions derived in the $k_T$ factorization with a more complete set of origins for SSA may provide such a theoretical framework. Because the momentum transferred involved in the relevant processes are not large enough, higher-order hard cross sections may give sizable corrections. Therefore, the rich subleading structures proposed in this work are phenomenologically important. \begin{acknowledgments} S.~B. and H.~L. thank the nuclear theory group of Brookhaven National Laboratory for support and hospitality. H.~L. and D.~Y. thank Yukawa Institute for Theoretical Physics, Kyoto University for hospitality. We thank Zhong-Bo Kang, Yuji Koike, Marc Schlegel, Werner Vogelsang, Shinsuke Yoshida and Jian Zhou for useful discussions. This material is based upon work supported by the U.S. Department of Energy, Office of Science, Office of Nuclear Physics, under contract number DE-SC0012704 and the LDRD program of Brookhaven National Laboratory. It is also in part supported by the Ministry of Science and Technology of R.O.C. under Grant No. MOST-107-2119-M-001-035-MY3. S. B. is supported by a JSPS postdoctoral fellowship for foreign researchers under Grant No. 17F17323. \end{acknowledgments}
\section{Introduction} Unconventional superconducting materials have attracted considerable interest over the last decades due to their extremely rich physics and emerging breakthrough properties~\cite{scalapino2012, stewart2017}. In such materials, the superconducting state transcends the BCS-like signatures, as well as the isotropic $s$-wave pairing symmetry of the gap structure. Instead, a complex interaction framework among electrons, the crystal lattice, and spin-orbital fluctuations are established as the possible mediation mechanism of the Cooper pairs~\cite{norman2013}. HfV$_2$Ga$_4$ is a newly discovered superconducting compound with a critical temperature (T$_c$) of $\approx$\,3.9\, K that crystallizes in the tetragonal body-centered prototype YbMo$_2$Ga$_4$~\cite{Santos}. Substantial deviations of the temperature dependence of upper and lower critical fields from the expected Werthamer-Helfand-Hohenberg (WHH) formula~\cite{Werthamer} has led the authors to argue in favor of the presence of two superconducting gaps in the Fermi surface~\cite{Santos}. Later, first-principles electronic-structure calculations revealed the presence of electrons occupying very distinct bands at the Fermi level in the presence of spin-orbit coupling (SOC) effects~\cite{ferreira2018a}. Also, a substantial elastic anisotropy regime, due to the presence of extended linear vanadium chains in the structure~\cite{ferreira2018b}, indicates the feasibility of multiband superconductivity and the manifestation of possible unconventional properties. \begin{figure*}[t] \centering \includegraphics[width=\linewidth, height=0.5\linewidth]{fig1.png} \caption{Representative TF-$\mu$SR asymmetry spectra in the low time region collected at (a) at $T$ = 0.1 K and (b) at $T$ = 4.75 K (i.e. below and above $T_{\bf c}$) in an applied magnetic field of 30 mT. (c) Represent the $\sigma_{sc}(T)$ data in field cooling mode with fits using various gap models. The dash green line shows the fit using an isotropic single-gap $s$-wave model, the solid red line and dash-dotted blue line show the fit to a two-gap model, $s$+$d$-wave and $s$+$s$-wave, respectively. The orange dash-dotted line shows the fit using an anisotropic $s$-wave model and the dash-dotted purple line shows the fit using $d$-wave model. (d) Temperature dependence of the normalized internal field from the sample.} \label{tfmusr} \end{figure*} In this Letter, we present unambiguous evidence of two-gap nodal superconductivity in HfV$_2$Ga$_4$ using transverse (TF) muon spin rotation ($\mu$SR) measurement. However, in opposition to what is generally accepted in previous experimental and theoretical attempts, we have discovered an unconventional superconducting order parameter with $s$+$d$-wave pairing symmetry and spin fluctuations traces. These experimental findings are further supported by density functional theory (DFT) calculations. Therefore, HfV$_2$Ga$_4$ could represent a novel family of unconventional superconductors, going beyond Fe-based compounds, heavy-fermions, non-centrosymmetric systems, and other known classes~\cite{scalapino2012, stewart2017,norman2013}. Thus, several compounds within the HfV$_2$Ga$_4$-family, such as ScV$_2$Ga$_4$ and ZrV$_2$Ga$_4$ \cite{ferreira2018a, ferreira2018b}, stand out as an open avenue to further investigate unconventional superconducting properties using various experiments and theoretical models. For the present $\mu$SR study a high-quality polycrystalline sample of HfV$_2$Ga$_4$ was prepared by arc melting of the stoichiometric amount of hafnium, vanadium, and gallium on a water-cooled Cu crucible in a high-purity Ar atmosphere, the arc-melted pellet was encapsulated in an evacuated quartz ampoule and heated up to 800 $^{\circ}$C and kept at that temperature for one week, then quenched in cold water~\cite{Santos}. Magnetotransport measurements were performed using a VSM-PPMS EverCool II from Quantum Design. A powdered sample of HfV$_2$Ga$_4$ was used for the $\mu$SR experiments, which were carried out on the MUSR spectrometer at the ISIS Pulsed Neutron and Muon Source of Rutherford Appleton Laboratory, U.K. The sample was placed on a silver holder (99.999\%) using GE-varnish, which was loaded in a dilution refrigerator operating between 0.1 K and 4.75 K. Zero-field (ZF) and transverse field (TF)-$\mu$SR measurements were performed at different temperatures between 0.1~K and 4.75~K. For ZF-$\mu$SR measurement, an active compensation system was used to cancel any stray magnetic fields at the sample space to a level of $\sim 10^{-4}$~mT. ZF-$\mu$SR measurement is beneficial to identify the spontaneous internal field associated with time-reversal symmetry breaking~\cite{Sonier}. TF-$\mu$SR measurements were carried out in the presence of an external magnetic of 30 mT, which is well above the lower critical field ($\mu_{0}H_{c1}=1.2$ mT), and well below the upper critical field ($\mu_{0}H_{c2}=1.1$ T) of HfV$_2$Ga$_4$. The experimental data were analyzed using the WiMDA software~\cite{Pratt2000}. \begin{figure*}[t] \centering \includegraphics[width=\linewidth, height=0.35\linewidth]{fig2.png}\hfill \caption{(a) Represent the ZF-$\mu$SR spectra for HfV$_2$Ga$_4$ at 0.1 K and 4.6 K. The solid lines are fits to the data, as described in the text. The inset shows the asymmetry data at lower time. (b) shows the temperature dependence of the relaxation rate $\lambda_{ZF} (T)$, which intimate the presence of spin fluctuations.} \label{zfmusr} \end{figure*} Santos {\it et al.}~\cite{Santos} recently reported superconductivity on HfV$_2$Ga$_4$ at $T_{\mathrm{C}}$ = 3.9 K, in which the upper and lower critical fields show unusual dependence with reduced temperature ($T/T_{\mathrm{C}}$), suggesting strong deviations from the conventional BCS behavior. This type of unusual behavior is also seen for other materials, such as Cu$_{0.3}$ZrTe$_{2-y}$~\cite{Machado1}, fluorine doped NdFeAsO~\cite{Adamski}, FeSe~\cite{Abdel-Hafiez}, SmFeAs$_{0.09}$F$_{0.01}$ , Ba$_{0.6}$K$_{0.4}$Fe$_{2}$As$_{2}$~\cite{Ren1,Ren2} and MgB$_{2}$~\cite{Li1}. To clarify the microscopic characteristics and superconducting gap structure of HfV$_2$Ga$_4$, TF-$\mu$SR measurements were carried in the mixed superconducting state. First, we applied an external magnetic field of 30 mT above $T_\mathrm{C}$, followed by colling down to 0.1 K. The TF-$\mu$SR asymmetry spectra were collected at various temperatures up to $T_{\mathrm{C}}$. Figs.~\ref{tfmusr}(a)-(b) exhibit two representative TF-$\mu$SR spectra collected at $T$ = 4.75 K and 0.1 K in $H$ = 30 mT. The asymmetry spectra at 0.1 K show faster relaxation compared to 4.75 K data as a result of the development of the flux line lattice below $T_{\mathrm{C}}$. The time evolution of the $\mu$SR asymmetry can be modeled by $A_\mathrm{TF}(t) = A_\mathrm{1}\cos(\gamma_\mathrm{\mu}B_1t+\Phi)\exp(-\frac{\sigma^{2}t^{2}}{2})+A_\mathrm{bg}\cos(\gamma_\mathrm{\nu}B_{bg}t+\Phi)$ \cite{Bhattacharyyarev, AdrojaThFeAsN, BhattacharyyaThCoC2,BhattacharyyaLu5Rh6Sn18}, where $A_1$ and $A_{bg}$ describe the initial asymmetries belonging to the sample and silver holder contributions, individually, with $A_{bg}$ not undergoing any depolarization; $B_1$ and $B_{bg}$ are the internal fields from the sample and from the sample holder, respectively. $\gamma_\mathrm{\nu}$/2$\pi$ = 135.53 MHz/T is the muon gyromagnetic ratio; $\Phi$ is the initial phase; and $\sigma$ is a Gaussian muon spin relaxation rate. The flux line lattice related muon relaxation can be extracted by subtracting the nuclear contribution according $\sigma_\mathrm{sc} = \sqrt{\sigma^{2}-\sigma_\mathrm{n}^2}$, where $\sigma_{\mathrm{n}}$ is the nuclear magnetic dipolar contribution which is temperature independent and was obtained from spectra measured above $T_\mathrm{C}$. By fitting the spectra at 4.75 K we obtained $\sigma_{\mathrm{n}}$ = 0.35 $\mu$s$^{-1}$. Considering that $\sigma_\mathrm{sc}$ is linked to the magnetic penetration depth ($\lambda$) by $\sigma_\mathrm{sc}~\approx~1/\lambda^2$, the superconducting gap symmetry can be determined from the temperature dependence of $\sigma_\mathrm{sc}(T)$. The temperature-dependent of magnetic penetration depth was analyzed employing different models, generally described by $\frac{\sigma_{sc}(T)}{\sigma_{sc}(0)} = \frac{\lambda^{-2}(T)}{\lambda^{-2}(0)} = 1 + \frac{1}{\pi}\int_{0}^{2\pi}\int_{\Delta(T,\phi)}^{\infty}\Big(\frac{\partial f}{\partial E}\Big) \frac{EdEd\phi}{\sqrt{E^{2}-\Delta(T,\phi)^2}}$\cite{Prozorov, AdrojaK2Cr3As3}, where $\Delta$ is an angle-dependent gap function, $f= [1+\exp(-E/k_\mathrm{B}T)]^{-1}$ is the Fermi function, and the integration signifies an average across the Fermi surface. The gap is expected to follow the function $\Delta(T) = \Delta_{0}\delta(T/T_\mathrm{C})\mathrm{g}(\phi)$, where $\Delta_0$ is the maximum gap value at zero temperature and $\mathrm{g}(\phi)$ is the angular dependence of the gap, equal to 1 and $\cos(2\phi)$ for an $s$- and $d$-wave model, respectively. Here $\phi$ is the azimuthal angle. The superconducting gap symmetry is expected to follow $\delta(T/T_\mathrm{C}) = \tanh[1.82[1.018(T_\mathrm{C}/T-1)]^{0.51}]$\cite{Pang2015, Annet1990}. This gap function is sufficiently precise to explain the temperature dependency at any coupling strength. The $\lambda^{-2}(T)$ data were fitted based on five different gap models (a) an isotropic $s$-wave gap, (b) an isotropic $s$+$s$-wave, (c) anisotropic $s$-wave, (d) a $d$-wave line node and (e) a nodal $s$+$d$-wave, as shown in Fig.~\ref{tfmusr}(c). The estimated fit parameters are given in the Supplemental Material~\cite{Supplemental} in Table I. Further, the diamagnetic signal observed below $T_{\mathrm{C}}$ can be seen through the decrease in the internal field below $T_{\mathrm{C}}$ as shown in Fig.~\ref{tfmusr}(d). From the fits presented in Fig.~\ref{tfmusr}(c) it is obvious that the isotropic $s$-wave, anisotropic $s$-wave, $d$-wave models do not fit the data as they give a high value of goodness of fit $\chi^2$. Contrariwise, two-gap models using the isotropic $s$+$s$-wave and a nodal $s$+$d$-wave show good fits to the $\lambda^{-2}(T)$ data. Furthermore the low $T$ upturn can be best fitted with a nodal $s$+$d$-wave model with a minimum value of $\chi^2$ = 1.3. The estimated parameters for the nodal $s$+$d$-wave model show one larger gap 2$\Delta_1(0)/k_BT_c$ = 6.27$\pm$0.2 (meV), which is larger than the value of 3.53 as expected for conventional BCS gap and another smaller gap 2$\Delta_2(0)/k_BT_c$ = 1.14$\pm$0.1 (meV). The smaller gap is a nodal gap for the $s$+$d$-wave model. Moreover, the large gap value indicates the presence of strong coupling superconductivity in HfV$_2$Ga$_4$. The parameters obtained from the fit to the $\sigma_{sc}(T)$ data of HfV$_2$Ga$_4$ using different gap models is presented in the Supplemental Material~\cite{Supplemental}. The multigap features are usually seen in iron-based superconductors, Ba$_{1-x}$K$_{x}$Fe$_{2}$As$_{2}$~\cite{twogaps, Khasanov2009}, cuprate superconductors~\cite{Khasanov2007, dwave} also in Bi$_{4}$O$_{4}$S$_{3}$~\cite{Biswas2013}. Following the method described in Ref.~\cite{Hillierns}, we determined the values of $\lambda_L(0)$= 797(4) nm for $s$+$d$ wave fit, $n_\mathrm{s} = 6.78(9) \times 10^{25}$ carriers m$^{-3}$, and $m^{*} = 1.528(2) m_\mathrm{e}$ respectively, for HfV$_2$Ga$_4$. For a detail calculations see the Supplemental Material~\cite{Supplemental}. \begin{figure*}[t] \centering \includegraphics[width=0.6\linewidth, height=0.45\linewidth]{fig3.png}\hfill \caption{(Upper panel) Electronic bands along a selected path in the first BZ of HfV$_{2}$Ga$_{4}$. The Fermi energy (E$_\mathrm{F}$) is set at 0.0 eV. (Lower panel) Hf- and V-d orbital character contribution to electronic states projected over the three distinct Fermi surface sheets.} \label{fig:fermisurface} \end{figure*} To examine the fundamental issue of the presence of time-reversal symmetry (TRS) breaking or spin fluctuations in HfV$_2$Ga$_4$, we did ZF$-\mu$SR measurements. This technique is extremely helpful to identify the tiny spontaneous magnetic fields below $T_\mathrm{C}$. In the case of conventional superconductors, there is no change in the ZF muon relaxation rate ($\lambda_{ZF}$) below $T_\mathrm{C}$. $\lambda_{ZF}$ increases with decrease in temperature at $T_\mathrm{C}$ if TRS is broken. Fig.~\ref{zfmusr}(a) shows the ZF$-\mu$SR signal at 4.6 K and 0.1 K. The ZF$-\mu$SR signal could be best described by a combined Lorentzian and Gaussian Kubo-Toyabe relaxation function:~$A_\mathrm{ZF}(t) = A_\mathrm{2}A_\mathrm{KT}(t)e^{-\lambda_\mathrm{ZF}t}+A_\mathrm{bg}$, here $A_\mathrm{KT}(t) = [\frac{1}{3}+\frac{2}{3}(1-\sigma_\mathrm{KT}^{2}t^{2})\exp({-\frac{\sigma_\mathrm{KT}^2t^2}{2}})]$, is known as the Gaussian Kubo-Toyabe function, $A_\mathrm{2}$ and $A_\mathrm{bg}$ represent the asymmetry contribution from sample and silver holder, respectively. The resulting fit parameter is shown in Fig.~\ref{zfmusr}(b). It is interesting to note that $\lambda_{ZF}(T)$ increases with decreasing temperature, suggesting the presence of spin-fluatation in HfV$_2$Ga$_4$. Furthermore, the fits to the ZF data give $\sigma_\mathrm{KT} = 0.368(5) ~\mu \mathrm{s}^{-1}$ and $\lambda_\mathrm{\mu} = 0.0525(5) ~\mu \mathrm{s}^{-1}$ at 0.1~K and $\sigma_\mathrm{KT} = 0.368(5) ~\mu \mathrm{s}^{-1}$ and $\lambda_\mathrm{\mu} = 0.0337(6) ~\mu \mathrm{s}^{-1}$ at 4.6~K. Analysis of band-structure and Fermi surface of the HfV$_2$Ga$_4$ compound can provide a suitable baseline from which to raise some phenomenological hypothesis of the mechanisms involved in such unconventional superconductivity shown by the experimental evidence presented in this letter. Therefore, optimized first-principles calculations were carried out in the framework of the Kohn-Sham scheme within the Density Functional Theory (DFT) \cite{hohenberg1964, kohn1965}, performed within the pseudopotential approach in the Perdew-Burke-Ernzerhof (PBE) generalized gradient approximation \cite{perdew1996, dal2014} as implemented in Quantum \textsc{Espresso} \cite{giannozzi2009, giannozzi2017} and support by auxiliary codes \cite{kawamura2019, kokalj1999}. Fig.~ref{fig:fermisurface}(a) shows the band-structure through high-symmetry points in the first Brillouin zone (BZ) \cite{setyawan2010}. Multiple distinct bands are crossing the Fermi energy ($E_F$), with very contrasting V-d and Hf-d characters. Other atomic orbital contributions to the electronic density in the vicinity of the $E_F$ are negligible. The obtained results are in great agreement with previous electronic-structure calculations \cite{ferreira2018a}, except for the presence of an additional band in the Fermi level (resulting in a very small quasi-spheric hole-pocket around the Z point in the Fermi surface). Additionally, Fig.~\ref{fig:fermisurface}(b-d) presents the projected-orbital Fermi surface with a color scheme for each irreducible representation. The reddish regions indicate a substantial contribution of V-d orbitals, which dictate the density of states (DOS) at the Fermi level; the bluish ones represent a major character derived from Hf-d orbitals; while the greenish branches depict a strong hybridization between these two states, as indicated by the color bar scale. The Fermi surface consists of multiple tridimensional disconnected sheets, bridging the way for a multiband superconductivity scenario: (a) a minor hybridized hole sphere next to the Z point; (b) a quasi-hyperbolic paraboloid with hole carriers that develops around the M point with substantial admixture of Hf-d and V-d orbitals, in the midpoint of the line that connects the two rhombuses (which we will call \emph{horse-saddle}), plus a very complex hole-like surface around the Z point composed mainly by Hf-d character with a slight degree of V-d (\emph{jellyfish}); (c) and multiple V-d electron cone-shaped pockets around the P point (\emph{seashell}), together with small electron-pockets saddled within the BZ along the M-$\Gamma$ high-symmetry line. Such hole bands with a predominant Hf-derived character are deeply sensitive against spin-orbit interactions, as opposed to V-d bands, which, in turn, play a crucial role in the low-energy electronic states \cite{ferreira2018a}. This fermiology, with very distinct disconnected pockets, in the sense of their orbital weight contribution and, hence, their effective spin-orbit coupling, favors the condensation of pairs with different superconducting order parameters. Since \emph{jellyfish}-pockets have a strong Hf-d character, we could expect the emergence of pair states with non-zero angular momentum and strong angular anisotropy, resulting in an even-parity momentum-dependent order parameter. On the other hand, the negligible effect of SOC in V bands favors the emergence of conventional $s$-wave pairing. This interpretation supports the experimental $s+d$-wave symmetry as founded. Moreover, the weighting factor of 0.57 to $s$-wave pairing is attributed to the higher contribution of V states on the DOS at the Fermi level, residing mainly at the \emph{seashell}-pockets, and a lower $d$-wave character coming from those Hf-derived structures. On the other hand, repulsive interactions between the sheets, driven by spin fluctuations, for instance, are unexpected due to the complex nature of the fermiology. However, the \emph{jellyfish}- and \emph{horse-saddle}-pockets will take advantage of hole doping, increasing the SOC effects on the low-energy states, at the same time that \emph{seashell}-pockets will gradually decrease (see the Supplemental Material \cite{Supplemental}), paving the way for discontinuous sign change of the order parameter phase and spin fluctuations by the enlargement of possible nearly induced nesting instabilities \cite{kuroki2001, mazin2008, kuroki2008, singh2012}. This mechanism becomes relevant in our context since Ga-deficient HfV$_2$Ga$_4$ samples can, in a first approximation, effectively decrease the chemical potential of occupied states by a few meV, promoting such features. Also, hole doping promotes an increase in the density of states, favoring electronic correlations, and contributing to spontaneous symmetry breaking mechanisms. Indeed, nearly nested Fermi surface pockets and the anisotropic gap function support the enhanced pairing strength observed in $\mu$SR measurements (2$\Delta_1$/k$_B$T$_c$ = 6.27) \cite{terashima2009, monthoux1994a, pao1994}. Therefore, Ga-deficiency can be imperative to the unconventional superconductivity of HfV$_2$Ga$_4$, which seems to be unique, and high-quality single crystals, with systematic doping content, are urgently required to investigate the superconducting state further and to confirm the proposed hypothesis. In summary, we have examined the superconducting state of HfV$_2$Ga$_4$ utilizing magnetotransport, $\mu$SR, and numerical band-structure calculations. The temperature dependence of the magnetic penetration depth, $\lambda^{-2}(T)$, is better fitted to a nodal two-gap $s$+$d$-wave model than a single gap isotropic $s-$wave, anisotropic $s$-wave or $d$-wave models, suggesting unconventional superconductivity in HfV$_2$Ga$_4$. The large value of gap to T$_{\mathrm{c}}$ ratio, 2$\Delta_1(0)/k_{\mathrm{B}}T_{\mathrm{c}}$ = 6.27$\pm0.2$, obtained from the nodal $s$+$d$-wave gap, is larger than 3.53, expected for conventional BCS superconductors, indicating the presence of strong coupling superconductivity in HfV$_2$Ga$_4$. The decrease in ZF relaxation rate with temperature indicates the presence of spin fluctuations in the superconducting state of HfV$_2$Ga$_4$. In addition, \emph{ab initio} calculations suggest that there are electrons derived from multiple distinct bands in disconnected sheets of the Fermi surface, in agreement with the experimental evidence of two-gap superconductivity for HfV$_2$Ga$_4$, and the momentum-dependent SOC interactions may be a theoretical starting point to elucidate the appearance of nodal superconductivity. We want to acknowledge Mr. Kartik Panda for helping MUSR data analysis and Prof. A. M. Strydom for interesting discussions. AB would like to acknowledge the Department of Science and Technology (DST) India, for an Inspire Faculty Research Grant (DST/INSPIRE/04/2015/000169), and the UK-India Newton grant for funding support. DTA would like to thank the Royal Society of London for the UK-China Newton funding and the Japan Society for the Promotion of Science for an invitation fellowship. FBS, PPF, LEC, AJSM, ALRM, and LTFE gratefully acknowledge the financial support of the Brazilian agencies Conselho Nacional de Desenvolvimento Cientifico e Tecnologico (CNPq) under Grants No. 302149/2017-1 and 431868/2018-2, and Fundac\~ao de Amparo \`a Pesquisa do Estado de S\~ao Paulo (FAPESP) under Grants No. 2016/11774-5, 2016/11565-7, 2016/10167-8, 2018/08819-2, 2018/10835-6, 2018/20546-1, 2019/05005-7, and 2019/07082-9.
\section{\texorpdfstring{$\mathbb{Z}_2$}{Z2}-graded tensor representation of Majorana operators} \label{app: Majorana tensors} In this appendix, we show that the tensors introduced in section \ref{sec:gradedTN} and rewritten here: \begin{align} \begin{tikzpicture}[Sbase] \draw[red,OES={AR2=0.5}] (-1,0)node[below,black]{$e$}--(0,0)--(1,0)node[below,black]{$e$}; \node[OP] {$\gamma$}; \end{tikzpicture} &= \sum_{a}|a+1)_e(a|_e \\ \begin{tikzpicture}[Sbase] \draw[red,OES={AR2=0.5}] (-1,0)node[below,black]{$e$}--(0,0)--(1,0)node[below,black]{$e$}; \node[OP] {$\bar \gamma$}; \end{tikzpicture} &= \sum_{a} (-1)^{a} i |a+1)_e(a|_e, \end{align} are indeed good representations of Majorana operators. To do so, we explicitly show that the algebraic relations of the Majorana tensors match those of the Majorana operators introduced in section \ref{subsec: representing fermions}. We begin by analyzing the algebra at a single site $e$. To this end, we apply the Majorana tensors to an arbitrary state $\M{A}$ at site $e$: \begin{align} \begin{tikzpicture}[Sbase] \draw[red,-<-=0.5](0,0)node[below,black]{$e$}--++(1,0); \node[Tsq] at (1,0) {$\M{A}$}; \end{tikzpicture} \equiv \sum_{a} A_{a} |a)_{e}\nonumber. \end{align} According to section \ref{subsec: representing fermions}, at site $e$, $\gamma_e^2=\bar \gamma_e^2=1$. Applying a single $\gamma$ tensor to $\M{A}$, we find: \begin{align} \begin{tikzpicture}[Sbase] \draw[red,-<-=0.5](0,0)node[below,black]{$ $}--++(1,0); \node[Tsq] at (1,0) {$\M{A}$}; \draw[red,-<-=0.5](-1,0)node[below,black]{$e$}--++(1,0); \node[OP] at (0,0) {$\gamma$}; \end{tikzpicture} &\equiv \sum_{b} |b+1)_e(b|^\mathcal{C}_e \sum_{a} A_{a} |a)^\mathcal{C}_{e} \\ \nonumber &= \sum_{a} A_{a} |a+1)_{e}. \end{align} Then, acting with another $\gamma$ on $\gamma \M{A}$ gives: \begin{align} \begin{tikzpicture}[Sbase] \draw[red,OES={AR2=0.5}](-1,0)--++(.5,0)--++(1,0)--++(0.5,0); \node[Tsq] at (1,0) {$\M{A}$}; \draw[red,-<-=0.5](-1,0)node[below,black]{$e$}--++(1,0); \node[OP] at (-0.5,0) {$\gamma$}; \node[OP] at (0.25,0) {$\gamma$}; \node[red,scale=0.7] at (-0.5,-0.4) {2}; \node[red,scale=0.7] at (0.25,-0.4) {1}; \end{tikzpicture} &\equiv \sum_{b} |b+1)_e(b|^\mathcal{C}_e \sum_{a} A_{a} |a+1)^\mathcal{C}_{e} \\ \nonumber &= \sum_{a} A_a |a)_e. \end{align} Since $\M{A}$ was arbitrary, we see that $\gamma$ contracted in succession with another $\gamma$ acts as the identity. The relation $\bar \gamma_e^2=1$, can be shown similarly. Next, we show that the relation $\bar \gamma_e \gamma_e=-\gamma_e \bar \gamma_e$ is represented by the Majorana tensors. $\bar \gamma \gamma \M{A}$ is: \begin{align} \label{gammagammabarstats1} \begin{tikzpicture}[Sbase] \draw[red,OES={AR2=0.5}](-1,0)--++(.5,0)--++(1,0)--++(0.5,0); \node[Tsq] at (1,0) {$\M{A}$}; \draw[red,-<-=0.5](-1,0)node[below,black]{$e$}--++(1,0); \node[OP] at (-0.5,0) {$\bar \gamma$}; \node[OP] at (0.25,0) {$\gamma$}; \node[red,scale=0.7] at (-0.5,-0.4) {2}; \node[red,scale=0.7] at (0.25,-0.4) {1}; \end{tikzpicture} \equiv & \sum_{c} (-1)^c i|c+1)_e(c|^{\mathcal{C}_2}_e \nonumber\\ &\sum_{b} |b+1)^{\mathcal{C}_2}_e(b|^{\mathcal{C}_1}_e \sum_{a} A_a |a)^{\mathcal{C}_1}_e\nonumber \\ = & - \sum_{a} (-1)^{a} i |a)_e, \end{align} while $\gamma \bar \gamma \M{A}$ is: \begin{align} \label{gammagammabarstats2} \begin{tikzpicture}[Sbase] \draw[red,OES={AR2=0.5}](-1,0)--++(.5,0)--++(1,0)--++(0.5,0); \node[Tsq] at (1,0) {$\M{A}$}; \draw[red,-<-=0.5](-1,0)node[below,black]{$e$}--++(1,0); \node[OP] at (-0.5,0) {$\gamma$}; \node[OP] at (0.25,0) {$\bar \gamma$}; \node[red,scale=0.7] at (-0.5,-0.4) {2}; \node[red,scale=0.7] at (0.25,-0.4) {1}; \end{tikzpicture} \equiv & \sum_{b} |b+1)_e(b|^{\mathcal{C}_2}_e \nonumber\\ &\sum_{c} (-1)^c i|c+1)^{\mathcal{C}_2}_e(c|^{\mathcal{C}_1}_e\sum_{a} A_a |a)^{\mathcal{C}_1}_e \nonumber\\ =& \sum_{a}(-1)^{a} i |a)_e. \end{align} Comparing \eqref{gammagammabarstats1} and \eqref{gammagammabarstats2}, we see that the tensors $\gamma$ and $\bar \gamma$ capture the relation $\gamma_e \bar \gamma_e=-\bar \gamma_e \gamma_e$. It is important to note that in going from \eqref{gammagammabarstats1} to \eqref{gammagammabarstats2}, the contractions are different. The difference in sign is not simply due to the odd grading of $\gamma$ and $\bar \gamma$. Now, we consider the algebraic relations of Majorana operators at different sites. Majorana operators acting at different sites anti-commute, so we must show that switching the order of contraction, for Majorana tensors applied to different legs yields a sign. This property follows from the odd grading of the Majorana tensors. We write an arbitrary state $|\psi)$ with $N$ two dimensional fermionic site Hilbert spaces as: \begin{align} &\begin{tikzpicture}[Sbase] \foreach \j in {1,2,4,5} { \draw[red,->-=0.75](\j,0.5)--++(0,1); } \draw[fill=white,draw=black] (0,0) rectangle (6,0.5); \draw[dotted,red] (2.75,1)--+(0.5,0); \node at (3,0.25) {$|\psi)$}; \end{tikzpicture} \nonumber \\ & =\sum_{a_1,\ldots,a_N} \Psi_{a_1,\ldots,a_N} |a_1)_{e^1}\ldots|a_N)_{e^N}. \end{align} First acting with $\gamma$ at site $e^j$ and second acting with $\gamma$ at site $e^i$, we have: \begin{widetext} \begin{align} \label{gammaigammajpsi} &\begin{tikzpicture}[Sbase] \foreach \j in {1,2,4,5} { \draw[red,->-=0.75](\j,0.5)--++(0,1); } \draw[fill=white,draw=black] (0,0) rectangle (6,0.5); \draw[dotted,red] (2.75,1)--+(0.5,0); \node at (3,0.25) {$|\psi)$}; \node[OP] at (2,1) {$\gamma_i$}; \node[red,scale=0.7] at (2.5,1) {$2$}; \node[OP] at (4,1) {$\gamma_j$}; \node[red,scale=0.7] at (4.5,1) {$1$}; \end{tikzpicture} \nonumber\\ &\equiv\left( \sum_{c} |c+1)_{e^i}(c|^{\mathcal{C}_2}_{e^i}\right) \left(\sum_{b} |b+1)_{e^j}(b|^{\mathcal{C}_1}_{e^j}\right) \sum_{a_1,\ldots,a_N} \Psi_{a_1,\ldots,a_N} |a_1)_{e^1}\ldots|a_i)^{\mathcal{C}_1}_{e^i}\ldots|a_j)^{\mathcal{C}_2}_{e^j}\ldots|a_N)_{e^N} \\ \label{psiprimedef} &=\sum_{a_1,\ldots,a_N} \Psi'_{a_1,\ldots,a_N} |a_1)_{e^1}\ldots\left(\sum_{c} |c+1)_{e^i}(c|^{\mathcal{C}_2}_{e^i}\right)|a_i)^{\mathcal{C}_2}_{e^i}\ldots \left(\sum_{b} |b+1)_{e^j}(b|^{\mathcal{C}_1}_{e^j}\right)|a_j)^{\mathcal{C}_1}_{e^j}\ldots|a_N)_{e^N} \\ \label{switchcontraction} &=\sum_{a_1,\ldots,a_N} \Psi'_{a_1,\ldots,a_N} |a_1)_{e^1}\ldots\left(\sum_{c} |c+1)_{e^i}(c|^{\mathcal{C}_1}_{e^i}\right)|a_i)^{\mathcal{C}_1}_{e^i}\ldots \left(\sum_{b} |b+1)_{e^j}(b|^{\mathcal{C}_2}_{e^j}\right)|a_j)^{\mathcal{C}_2}_{e^j}\ldots|a_N)_{e^N}\\ \label{movemajoranaleft} &=\left(\sum_{c} |c+1)_{e^i}(c|^{\mathcal{C}_1}_{e^i}\right) \left(\sum_{b} |b+1)_{e^j}(b|^{\mathcal{C}_2}_{e^j}\right) \sum_{a_1,\ldots,a_N} \Psi_{a_1,\ldots,a_N} |a_1)_{e^1}\ldots|a_i)^{\mathcal{C}_1}_{e^i}\ldots |a_j)^{\mathcal{C}_2}_{e^j}\ldots|a_N)_{e^N} \\ \label{Majoranainterchange} &=- \left(\sum_{b} |b+1)_{e^j}(b|^{\mathcal{C}_2}_{e^j}\right) \left(\sum_{c} |c+1)_{e^i}(c|^{\mathcal{C}_1}_{e^i}\right) \sum_{a_1,\ldots,a_N} \Psi_{a_1,\ldots,a_N} |a_1)_{e^1}\ldots|a_i)^{\mathcal{C}_1}_{e^i}\ldots |a_j)^{\mathcal{C}_2}_{e^j}\ldots|a_N)_{e^N}\\ &=- \begin{tikzpicture}[Sbase] \foreach \j in {1,2,4,5} { \draw[red,->-=0.75](\j,0.5)--++(0,1); } \draw[fill=white,draw=black] (0,0) rectangle (6,0.5); \draw[dotted,red] (2.75,1)--+(0.5,0); \node at (3,0.25) {$|\psi)$}; \node[OP] at (2,1) {$\gamma_i$}; \node[red,scale=0.7] at (2.5,1) {$1$}; \node[OP] at (4,1) {$\gamma_j$}; \node[red,scale=0.7] at (4.5,1) {$2$}; \end{tikzpicture} \end{align} \end{widetext} In \eqref{psiprimedef}, we have absorbed the signs from moving the Majorana tensors past odd vectors into the coefficient $\Psi'$. After moving the Majorana tensors, the ordering of the contractions are switched [line \eqref{switchcontraction}]. Lastly, we have moved the Majorana tensors to the left and interchanged their order [\eqref{movemajoranaleft} and \eqref{Majoranainterchange}]. The contraction $\mathcal{C}_1$ is then to the right of $\mathcal{C}_2$, and we can read line \eqref{Majoranainterchange} as first a $\gamma$ acts on site $e^i$ then a $\gamma$ acts on site $e^j$. We thus have that $\gamma$ tensors acting on different sites anti-commute. Looking at \eqref{gammaigammajpsi} and \eqref{Majoranainterchange}, we see that the difference in sign is purely a consequence of the odd parity of $\gamma$. Indeed, more generally, $\gamma$ tensors acting on different legs of an arbitrary tensor will anti-commute. An analogous calculation for $\bar \gamma$ tensors or a mixture of $\gamma$ and $\bar \gamma$ tensors shows that they anti-commute when acting on different legs. \section{Calculation of the Koszul sign for a single loop} \label{app:proofofprop1} Here, we provide a proof of Prop.~\ref{prop:sigmaC}. We choose an arbitrary edge of the loop $L$ to be $e^0$ and label the $j^{\text{th}}$ edge of the path as $e^j$. Starting with the triangle following $e^0$, along the orientation of $L$, we denote the $j^\text{th}$ triangle on the path as $f^j$. For each triangle $f^j$, we have a specific basis tensor $\M{Q}^L_{f^j}$ from the set $\mathcal{Q}[f]$ or $\mathcal{\bar Q}[f]$ [see Eq.~\eqref{basisset}] depending on the orientation of $f^j$. The sign to be calculated is then: \begin{align} \label{Tf0Tfn} \hat{\sigma}(L)= \text{tr}\left[\M{Q}_{f^0}^L\boldsymbol{{\cdot}}\M{Q}_{f^1}^L\boldsymbol{{\cdot}} \ldots \boldsymbol{{\cdot}} \M{Q}_{f^n}^L\right]. \end{align} As already mentioned, there are six possible ways for the loop to cross a triangle. We list the six possible crossings of a positive triangle and its associated basis tensors $\M{Q}_{f}^L$ (ignoring legs with even parity): \begin{align} \begin{tikzpicture}[Sc=0.6] \post; \node at (-60:1) {$e^j$}; \path (0:3)++(-120:1) node{$e^{j+1}$}; \draw[-<-=0.75,blue](C)--+(210:{sqrt(3)}); \draw[->-=0.75,blue](C)--+(-30:{sqrt(3)}); \end{tikzpicture}\equiv &|1)_{e^{j}}|1)_{e^{j+1}}=-i|1)_{e^{j}}\big[i|1)_{e^{j+1}}\big] ,\nonumber\\ \begin{tikzpicture}[Sc=0.6] \post; \node at (-60:1) {$e^{j+1}$}; \path (0:3)++(-120:1) node{$e^j$}; \draw[->-=0.75,blue](C)--+(210:{sqrt(3)}); \draw[-<-=0.75,blue](C)--+(-30:{sqrt(3)}); \end{tikzpicture}\equiv& -|1)_{e^{j}}|1)_{e^{j+1}}=i|1)_{e^{j}}\big[i|1)_{e^{j+1}}\big]\nonumber\\ \begin{tikzpicture}[Sc=0.6] \post;\node at (0:1) {$e^j$}; \path (0:3)++(-120:1) node{$e^{j+1}$}; \draw[-<-=0.75,blue](C)--+(90:{sqrt(3)}); \draw[->-=0.75,blue](C)--+(-30:{sqrt(3)}); \end{tikzpicture}\equiv& |1)_{e^{j+1}}(1|_{e^{j}}={\big[}i(1|_{e^{j}}{\big]}{\big[}i|1)_{e^{j+1}}{\big]},\nonumber\\ \begin{tikzpicture}[Sc=0.6] \post;\node at (0:1) {$e^{j+1}$}; \path (0:3)++(-120:1) node{$e^j$}; \draw[->-=0.75,blue](C)--+(90:{sqrt(3)}); \draw[-<-=0.75,blue](C)--+(-30:{sqrt(3)}); \end{tikzpicture}\equiv& |1)_{e^{j}}(1|_{e^{j+1}}\nonumber\\ \begin{tikzpicture}[Sc=0.6] \post;\node at (0:1) {$e^j$}; \path (-60:1) node{$e^{j+1}$}; \draw[-<-=0.75,blue](C)--+(90:{sqrt(3)}); \draw[->-=0.75,blue](C)--+(210:{sqrt(3)}); \end{tikzpicture}\equiv& |1)_{e^{j+1}}(1|_{e^{j}}=\big[i(1|_{e^{j}}\big]\big[i|1)_{e^{j+1}}\big] \nonumber\\ \begin{tikzpicture}[Sc=0.6] \post;\node at (0:1) {$e^{j+1}$}; \path (-60:1) node{$e^j$}; \draw[->-=0.75,blue](C)--+(90:{sqrt(3)}); \draw[-<-=0.75,blue](C)--+(210:{sqrt(3)}); \end{tikzpicture}\equiv &|1)_{e^{j}}(1|_{e^{j+1}}. \end{align} The blue arrows denote the loop $L$, which enters at edge $e^j$ and exists from edge $e^{j+1}$. Notice that when the loop goes around a 0-vertex or a 2-vertex (bottom four pictures), both edges point to the same side of $L$, but when the loop goes around a 1-vertex (top two pictures), a right-left transition of edge directions occurs. The relation between the diagrams and the tensors can be summarized as follows: \begin{enumerate}[label=(\roman*)] \item Edges $e^j$ pointing to the \textit{right} of $L$ contribute $(1|_{e^j}$ to the tensor $\M{Q}^L_{f^{j-1}}$ and $|1)_{e^j}$ to the tensor $\M{Q}^L_{f^{j}}$. \item Edges $e^j$ pointing to the \textit{left} of $L$ contribute $i|1)_{e^j}$ to the tensor $\M{Q}^L_{f^{j-1}}$ and $i(1|_{e^j}$ to the tensor $\M{Q}^L_{f^{j}}$. \item If $f_L$ is an $1$-vertex, then we accrue an additional phase $i^{\delta_{f_L \in \bar{l}_L}}i^{-\delta_{f_L \in \bar{r}_L}}$, where $\delta_{f_L \in \bar{l}_L}=1$ if $f_L \in \bar{l}_L$ and $\delta_{f_L \in \bar{l}_L}=0$ otherwise. $\delta_{f_L \in \bar{r}_L}$ is defined similarly. Therefore, if $f_L$ is a 1-vertex, we accrue a phase $i$, if it lies to the left of $L$ or a phase $-i$, if it lies to the right of $L$. \end{enumerate} Negatively oriented triangles also have 6 possible crossings. It can be checked that the same rules as in (i)-(iii) above apply to negative triangles. For example, consider the following crossing on a negative triangle: \begin{align}\label{negTex} \begin{tikzpicture}[Sc=0.8] \negt; \node at (60:1) {$e^j$}; \path (0:3)++(120:1) node{$e^{j+1}$}; \draw[-<-=0.75,blue](C)--+(-210:{sqrt(3)}); \draw[->-=0.75,blue](C)--+(30:{sqrt(3)}); \end{tikzpicture}&\equiv (1|_{e^{j+1}}(1|_{e^{j}}, \end{align} where the RHS is an element of \eqref{basisset} (ignoring even parity legs). Now, we verify that the rules (i)-(iii) yield the RHS of Eq.~\eqref{negTex}. Rule (ii) implies $e^j$ contributes $i(1|_{e^j}$, rule (i) implies edge $e^{j+1}$ contributes $(1|_{e^{j+1}}$, and finally, rule (iii) implies that the $f_L$ vertex contributes an $i$ phase. Putting it together, we get the tensor $ i(1|_{e^j} (1|_{e^{j+1}} i=(1|_{e^{j+1}}(1|_{e^{j}}$, which is indeed the RHS of Eq.~\eqref{negTex}. The other five cases of crossing across negatively oriented triangles can be checked similarly. With this, we calculate the sign in Eq.~\eqref{Tf0Tfn}. We consider the contraction of tensors $ \M{Q}_{f^{j-1}}^L$ and $ \M{Q}_{f^{j}}^L$ at the edge $e^j$. If $e^j$ points to the the right of $L$, then, according to rule (i), $ \M{Q}_{f^{j-1}}^L$ has $(1|_{e^j}$ and $\M{Q}_{f^{j}}^L$ has $|1)_{e^j}$. No Koszul sign is produced in contraction at $e^j$ because $(1|_{e^j}\boldsymbol{{\cdot}} |1)_{e^j}=1$. Similarly, if $e^j$ points to the the left of $L$, then, according to rule (ii), $ \M{Q}_{f^{j-1}}^L$ has $i|1)_{e^j}$ and $\M{Q}_{f^{j}}^L$ has $i(1|_{e^j}$, and again no Koszul sign is produced: $ i|1)_{e^j}\boldsymbol{{\cdot}} i(1|_{e^j}=1$. The remaining sources of signs are triangles that contribute a sign $i^{\delta_{f_L \in \bar{l}_L}}i^{-\delta_{f_L \in \bar{r}_L}}$ according to rule (iii), and the overall $-1$ supertrace sign that comes from contracting the first and last indices in Eq.~\eqref{Tf0Tfn}. Therefore, the total sign is: \begin{align} \hat{\sigma}(L) = & - \prod_{f_L} i^{\delta_{f_L \in \bar{l}_L}}i^{-\delta_{f_L \in \bar{r}_L}} \nonumber\\ =& -i^{\boldsymbol{(}n(\bar{l}_L)- n(\bar{r}_L)\boldsymbol{)}}=-(-1)^{\frac{1}{2}\boldsymbol{(}n(\bar{l}_L)- n(\bar{r}_L)\boldsymbol{)}}. \end{align} Note that $\hat{\sigma}(C)$ is always $\pm 1$, because the total number of transition points $n(\bar{l}_L)+n(\bar{r}_L)$ has to be even. This implies $n(\bar{l}_L)- n(\bar{r}_L)$ is even as well. \section{Tensor Network Bosonization in 1D} \label{operatorduality1d} For completeness, we give a detailed description of the TNO representation of bosonization in 1D. To start, we present 1D bosonization as a map of local fermionic operators to local bosonic operators. \subsection{Review of 1D bosonization} \label{reviewbosonization} \begin{figure} \centering \begin{tikzpicture}[scale=0.7] \draw[dotted](0,0)edge[loosely dotted]+(-1,0)--(8,0)edge[loosely dotted]+(1,0); \draw[dotted](0,-3)edge[loosely dotted]+(-1,0)--++(8,0)edge[loosely dotted]+(1,0); \foreach[count=\k from 1] \j in {0,2,...,8} { \node[circle,draw=black] at (\j,0) {}; \ifthenelse{\j = 8}{}{\node[circle,draw=red] at (\j+1,-3) {}}; \node[circle,inner sep=0.3mm,fill] at (\j,0) {}; \node[circle,inner sep=0.3mm,fill] at (\j,-3) {};} \node[below=1mm] at (2,0) {$ {v} $}; \node[below=3pt] at (3,-3) {$e$}; \node[below=3pt] at (2,-3) {$e_1$};\node[below=3pt] at (4,-3) {$e_0$}; \node[scale=3] at (4,-1.5) {$ \Uparrow$}; \end{tikzpicture} \caption{The bosonization duality is a map from a fermionic system to a bosonic system. In the fermionic system there is a spinless complex fermion degree of freedom (red circles) at each edge $e$. In the bosonic system there is a spin-1/2 at each vertex $v$.} \label{fig:1d chain} \end{figure} On the fermionic side of the duality, we consider a one dimensional lattice with a spinless complex fermion at each edge, as pictured in Fig.~\ref{fig:1d chain}. The complex fermion at edge $e$ may be described using the familiar fermionic creation and annihilation operators: $c^{\dagger}_{e}$, $c_{e}$. These generate the full fermionic operator algebra at $e$. However, it will be convenient to instead work with Majorana operators, $\gamma_e, \bar \gamma_e$, as discussed in section \ref{subsec: representing fermions}. To ensure the bosonization duality maps local operators to local operators, we define the duality on a subset of the full fermionic operator algebra - the subalgebra of fermion parity even operators $\mathcal{E}$. The fermion parity even operators are those that commute with the global fermion parity operator $\prod_{e}P_{e}$, where $P_{e}$ is the fermion parity at the edge $e$. $\mathcal{E}$ can be generated by two types of operators: fermion parity $P_{e}$ at each edge and the hopping operators $S_v$ at each vertex $v$. The hopping operators transfer fermion parity between edges and are defined by: \begin{align} S_v\equiv i \gamma_{{L_v}} \bar \gamma_{{R_v}}, \end{align} with ${L_v}$ and ${R_v}$ the edge to the left and right of vertex $v$, respectively. The hopping operators are mutually commuting and commute with all parity operators besides the neighboring two, i.e.: \begin{align}\label{1SPcom} S_v P_{e} =& (-1)^{\delta_{v \subset e}} P_eS_v, \end{align} where $\delta_{v \subset e}=1$ if vertex $v$ is at one of the endpoints of the edge $e$ and $\delta_{v \subset e}=0$ otherwise. With open boundary conditions, the set of fermion parity operators and hopping operators are independent. However on a closed manifold they satisfy the relation: \begin{align} \prod_v S_v \prod_e P_e = -1 \end{align} On the bosonic side of the duality we have a spin-1/2 at each vertex (see Fig.~\ref{fig:1d chain}). The operator algebra of the spin-1/2 at vertex $v$ can be generated by the Pauli operators: $X_v$, $Z_v$. Thus, the set of $X_v$ and $Z_v$ for all vertices generates the full bosonic operator algebra, which we denote as $\mathcal{A}$. We now define the duality map $\mathfrak{D}: \mathcal{E} \to \mathcal{A}$ on the generators of $\mathcal{E}$: \begin{align} \label{D1def} \mathfrak{D} (P_{e})= & Z_{e_0}Z_{e_1} \nonumber \\ \mathfrak{D} (S_{v}) = & X_{v}. \end{align} where $e_0$ and $e_1$ denote the vertices at the endpoints of $e$ such that $e$ points from $e_0$ to $e_1$ (Fig.~\ref{fig:1d chain}). $\mathfrak{D}$ is an injective homomorphism from $\mathcal{E}$ to $\mathcal{A}$ so that for $A_1,A_2 \in \mathcal{E}$: \begin{align} \mathfrak{D}(A_1+A_2) = & \mathfrak{D}(A_1) +\mathfrak{D}(A_2) \nonumber \\ \mathfrak{D}(A_1 A_2) = & \mathfrak{D}(A_1) \mathfrak{D}(A_2). \end{align} One can check that $\mathfrak{D}$ preserves the commutation relations in \eqref{1SPcom}. {Note that the bosonization duality in Eq. \eqref{D1def} is not the usual Jordan-Wigner transformation, defined, for example, in Ref. [\onlinecite{Laumann09}]. $\mathfrak{D}$ is instead the composition of the familiar Jordan-Wigner transformation (restricted to $\mathcal{E}$) with the Kramers-Wannier duality. We have chosen the duality $\mathfrak{D}$ to define bosonization, because it is locality preserving and more naturally relates to the $2$D bosonization in section \ref{2Dbosonization}.} To translate the operator duality defined in \eqref{D1def} to a TNO, we employ the formalism of {$\mathbb{Z}_2$-graded Hilbert spaces} and {graded tensor products}. \subsection{TNO representation of the duality} \begin{figure*} \centering \begin{tikzpicture}[Sbase] \Fer; \end{tikzpicture}= \begin{tikzpicture}[Sbase] \Fer; \node[OP] at (1/2,0) {$P$}; \node[OP] at (3/2,0) {$P$}; \node[OP] at (1,-1/2) {$P$}; \end{tikzpicture}= \begin{tikzpicture}[Sbase] \Fer;\node[OP] (e0) at (3/2,0) {$\bar \gamma $}; \node[OP] (e) at (1,-1/2) {$i\gamma$}; \path (3/2,0)++(-45:0.4) node[red,scale=0.7]{1};\path (1,-1/2)++(-10:0.4) node[red,scale=0.7]{2}; \end{tikzpicture}= \begin{tikzpicture}[Sbase] \Fer; \node[OP] (e1) at (1/2,0) {$ \bar \gamma$};\node[OP] (e) at (1,-1/2) {$\bar \gamma$}; \path (1/2,0)++(-90:0.4) node[red,scale=0.7]{2};\path (1,-1/2)++(-10:0.3) node[red,scale=0.7]{1}; \end{tikzpicture} \begin{tikzpicture}[Sbase] \Bos; \end{tikzpicture}= \begin{tikzpicture}[Sbase]] \Bos; \node[OP] at (1/2,0) {$P$}; \node[OP] at (3/2,0) {$P$}; \end{tikzpicture}= \begin{tikzpicture}[Sbase] \Bos; \node[OP] at (3/2,0) {$P$}; \node[OP] at (1,1/2) {$Z$}; \end{tikzpicture}= \begin{tikzpicture}[Sbase] \Bos; \node[OP] (e1) at (1/2,0) {$\bar \gamma $};\node[OP] (e0) at (3/2,0) {$\bar \gamma$}; \node[OP] at (1,1/2) {$X$}; \path (3/2,0)++(-90:0.4) node[red,scale=0.7]{1};\path (1/2,0)++(-90:0.4) node[red,scale=0.7]{2}; \end{tikzpicture} \caption{Diagrammatic representation of the symmetries of $\mathsf{F}$ (first line) and $\mathsf{B}$ (second line) written algebraically in Eqs.~\eqref{Fsym} and \eqref{Bsym}.} \label{fig:1Dsym} \end{figure*} We now give a tensor network operator (TNO) representation $\M{D}$ of the bosonization duality $\mathfrak{D}$ in Eq.~\eqref{D1def}. We begin with the following TNO ansatz: \begin{align} \label{eq:UJod} \M{D}=\begin{tikzpicture}[Sbase,xscale=0.9] \draw[red,OES={AR2=0.55}] (0.5,0)--++(.5,0)--++(1.5,0)--++(1.5,0)--++(1.5,0)--++(1.5,0)edge[-<-=0.75]++(0.5,0); \draw[red,loosely dotted] (0,0)--(0.5,0); \draw[red,loosely dotted] (7.5,0)--(8,0); \draw[red,-<-=0.75] (1,0)node[Dtriangle]{$\M{F}$}--+(0,-1); \draw[red,-<-=0.75] (4,0)node[Dtriangle]{$\M{F}$}node[black,above=2.5mm]{$e$}--+(0,-1);\draw[red,-<-=0.75] (7,0)node[Dtriangle]{$\M{F}$}node[black,above=1mm]{}--+(0,-1); \draw[black,->-=0.75] (2.5,0)node[Bcir]{$\M{B}$}node[black,below=2.5mm]{$e_1$}--+(0,1); \draw[black,->-=0.75] (5.5,0)node[Bcir]{$\M{B}$}node[black,below=2.5mm]{$e_0$}--+(0,1); \end{tikzpicture}. \end{align} For now, we leave the boundary conditions of $\M{D}$ unspecified -- they will enter the construction later. $\mathsf{D}$ is constructed by gluing together two kinds of local tensors, $\M{F}$ (triangular nodes) and $\M{B}$ (circular nodes), as pictured in \eqref{eq:UJod}. An $\M{F}$ tensor is placed at each edge $e$ and is represented as follows: \begin{align}\label{B2d} \begin{tikzpicture}[Sbase] \Fer; \node[Dtriangle] at (1,0){$\M{F}$} ; \end{tikzpicture} \equiv \sum_{j,a,b} F^j_{a,b} |a)_{e_1} (j|_{e} (b|_{e_0}. \end{align} At each vertex $v$, we place a tensor $\M{B}$: \begin{align} \begin{tikzpicture} [Sbase] \Bos; \node[Bcir] at (1,0){$\M{B}$} ; \end{tikzpicture} \equiv \sum_{j,a,b} B^{j}_{a,b}|a)_v |j\rangle_v(b|_v. \end{align} Notice that in Eq.~\eqref{B2d}, we have three distinct Hilbert spaces labeled by the same site -- one fermionic space (to which $|a)_v$ belongs), one dual fermionic space (to which $(a|_v$ belongs) and one bosonic space (to which $|j\rangle_v$ belongs). To implement the duality map $\mathfrak{D}$ of Eq.~\eqref{D1def}, we need to choose tensors $\mathsf{F}$ and $\mathsf{B}$ such that the following relations hold for all even operators $A \in \mathcal{E}$: \begin{align} \label{dualitytno1} \M{D} \boldsymbol{{\cdot}} A = \mathfrak{D}(A) \boldsymbol{{\cdot}}\M{D}, \end{align} or diagrammatically: \begin{align} \label{dualitytno2} \begin{tikzpicture}[Sbase] \draw[red] (0,0)--(3,0); \draw[red,loosely dotted] (-0.25,0)--(0,0); \draw[red,loosely dotted] (3,0)--(3.25,0); \foreach \j in {0.5,1,...,2.5} {\draw[red] (\j,0)node[scale=0.4,Dtriangle]{}--+(0,-1); } \foreach \j in {0.25,0.75,...,2.75} {\draw[black!99] (\j,0)node[scale=0.4,Bcir]{}--+(0,1);} \draw[draw=black,fill=white] (0.95,-0.75) rectangle node{A} ++(1.1,0.5); \end{tikzpicture} = & \begin{tikzpicture}[Sbase] \draw[red] (0,0)--(3,0);\draw[red,loosely dotted] (-0.25,0)--(0,0); \draw[red,loosely dotted] (3,0)--(3.25,0); \foreach \j in {0.5,1,...,2.5} {\draw[red] (\j,0)node[scale=0.4,Dtriangle]{}--+(0,-1); } \foreach \j in {0.25,0.75,...,2.75} {\draw[black!99] (\j,0)node[scale=0.4,Bcir]{}--+(0,1); } \draw[draw=black,fill=white] (0.65,0.25) rectangle node{$\mathfrak{D}(A)$} ++(1.75,0.5); \end{tikzpicture}. \end{align} Note that, we need only show that the relations are satisfied for $P_e$ and $S_v$ -- the generators of $\mathcal{E}$. That is, we need to show that: \begin{subequations} \begin{align} \mathsf{D} \boldsymbol{{\cdot}} P_{e} = \mathfrak{D}(P_e) \boldsymbol{{\cdot}}\mathsf{D}=Z_{e_0} Z_{e_1} \boldsymbol{{\cdot}} \mathsf{D} \label{DP1d}\\ \mathsf{D} \boldsymbol{{\cdot}} S_{v} = \mathfrak{D}(S_v) \boldsymbol{{\cdot}}\mathsf{D}=X_v \boldsymbol{{\cdot}}\mathsf{D}. \label{DS1d} \end{align} \end{subequations} We can look at these constraints as symmetries of the tensor $\mathsf{D}$, which can be reduced to symmetries of local tensors $\mathsf{F}$ and $\mathsf{B}$. We claim that $\mathsf{D}$ satisfies \eqref{DP1d} and \eqref{DS1d} if $\mathsf{F}$ and $\mathsf{B}$ have the following symmetries: \begin{subequations} \label{FBsym} \begin{align} \mathsf{F} = P_{e_1} \boldsymbol{{\cdot}} \mathsf{F} \boldsymbol{{\cdot}} P_{e_0} \boldsymbol{{\cdot}} P_{e} = \mathsf{F} \boldsymbol{{\cdot}} i \gamma_{e} \boldsymbol{{\cdot}} \bar \gamma_{e_0} = \bar \gamma_{e_1}\boldsymbol{{\cdot}} \mathsf{F}\boldsymbol{{\cdot}} \bar \gamma_e \label{Fsym}\\ \mathsf{B} = P_v \boldsymbol{{\cdot}} \mathsf{B} \boldsymbol{{\cdot}} P_{v} = Z_v\boldsymbol{{\cdot}} \mathsf{B} \boldsymbol{{\cdot}} P_{v}= \bar \gamma_v\boldsymbol{{\cdot}} X_v \boldsymbol{{\cdot}}\mathsf{B} . \label{Bsym} \end{align} \end{subequations} These symmetries are represented graphically in Fig.~\ref{fig:1Dsym}. Using the diagrammatic representation of the symmetries, we can illustrate that $\mathsf{D}$ obeys \eqref{DP1d} and \eqref{DS1d}. By successive applications of the symmetries in Fig.~\ref{fig:1Dsym}, we have: \begin{align} \label{P image} \M{D} \boldsymbol{{\cdot}} P_{e} =&\begin{tikzpicture}[Sbase,SS] \DPone;\node[OP] at (2,-.75) {$P_{e}$}; \end{tikzpicture} \nonumber\\ =&\begin{tikzpicture}[Sbase,SS] \DPone;\node[OP] at (1.25,0) {$P$}; \node[OP] at (2.75,0) {$P$}; \end{tikzpicture}\nonumber\\ =&\begin{tikzpicture}[Sbase,SS] \DPone;\node[OP] at (0.5,0.75) {$Z_{e_1}$}; \node[OP] at (3.5,0.75) {$Z_{e_0}$}; \end{tikzpicture} = Z_{e_1}Z_{e_0} \boldsymbol{{\cdot}} \M{D}. \end{align} Similarly, for the hopping operator, we have: \begin{align} \label{S image} \M{D} \boldsymbol{{\cdot}} S_{v}= &\M{D} \boldsymbol{{\cdot}} i\gamma_{{L_v}} \bar \gamma_{{R_v}} \\ =&\begin{tikzpicture}[Sbase,SS] \DS; \node[OP] at (0.5,-0.75) {$i\gamma_{{L_v}}$};\node[OP] at (3.5,-0.75) {$\bar \gamma_{{R_v}}$}; \node[below=.9mm,red,scale=0.7] at (1,-0.75) {$2$}; \node[below=.9mm,red,scale=0.7] at (4,-0.75) {$1$}; \end{tikzpicture} \nonumber \\ =& \begin{tikzpicture}[Sbase,SS] \DS; \node[OP] at (1.25,0) {$ \bar \gamma$};\node[OP] at (2.75,0) {$ \bar \gamma$}; \node[below=.9mm,red,scale=0.7] at (2.95,0) {$1$}; \node[below=.9mm,red,scale=0.7] at (1.45,0) {$2$}; \end{tikzpicture} \nonumber \\ =&\begin{tikzpicture}[Sbase,SS] \DS; \node[OP] at (2,.75) {$ X_v$}; \end{tikzpicture} \nonumber = X_v \boldsymbol{{\cdot}}\M{D}. \end{align} Hence, $\mathsf{D}$ is a good representation of the operator duality $\mathfrak{D}$. Furthermore, we can use the symmetries of $\mathsf{F}$ and $\mathsf{B}$ to compute their explicit component form. Notice that the three symmetries of $\mathsf{F}$ are independent, commute with each other, and square to the identity. Thus, they generate a $\mathbb{Z}^3_2 = \mathbb{Z}_2 \times \mathbb{Z}_2 \times \mathbb{Z}_2$ symmetry group. Similarly, the three symmetries of $\mathsf{B}$ form a $\mathbb{Z}^3_2$ group. Since both tensors are vectors in a $2^3=8$ dimensional Hilbert space, the symmetries fix the tensors completely (up to a normalization). The explicit tensors can then be calculated by projecting the vaccuum tensor onto the symmetric subspace: \begin{align} \mathsf{F} \propto & \sum_{a,b,c} (\bar \gamma_{e_1}\bar \gamma_{e})^a(i\gamma_e)^b P^c_{e_1} |0)_{e_1}(0|_e(0|_{e_0}P^c_{e}P^c_{e_0} \gamma_{e_0}^b \nonumber \\ =&\sum_{a,b} |a)_{e_1}(a+ b |_{e}(b|_{e_0}. \end{align} Applying the same strategy to compute $\mathsf{B}$, we find: \begin{align} \mathsf{B} \propto & \sum_{a} |a)_{v}|a\rangle_{v}(a|_{v}. \end{align} Thus far, we have constructed a TNO that implements a map of local operators to local operators. In the next subsection, we will illustrate one of the key advantages of the TNO representation of the bosonization duality. That is, we will see that $\mathsf{D}$ may be applied to fermionic tensor network states to map them to bosonic tensor network states. \section{Bosonization of fermionic matrix product states} \label{subsec:TNbosonization1d} We now show that certain fermionic matrix product states (fMPS) can be directly bosonized using the bosonization TNO, $\mathsf{D}$, defined in the previous subsection. In particular, we will describe the bosonization procedure for fMPS of the form: \begin{align} \label{Opsi} |\psi) = \begin{tikzpicture}[Sbase] \draw[dashdotted](0,-0.5)--+(0,1);\draw[dashdotted](6,-0.5)--+(0,1); \draw[red,OES={AR2=0.5}] (0,0)--++(0.5,0) --++(1,0)--++(1,0)--++(1,0); \draw[red,loosely dotted] (3,0) --(4,0); \draw[red,OES={AR2=0.85}] (4,0) --++(1,0)--++(1,0); \foreach \j in {0.5,1.5,2.5,4.5} {\draw[red,->-=0.5] (\j,0)--+(0,1); \node[Tsq] at (\j,0) {$\M{T}$}; } \node[OP] at (5.5,0) {$O_\psi$}; \end{tikzpicture}, \end{align} where $\M{T}$ is a fermion parity even tensor and $O_\psi$ is an operator with definite parity. $O_\psi$ is inserted before closing the fermionic matrix product state to dictate the parity of the state and the boundary conditions. We will use vertical dash-dotted lines to denote closing the boundary (or taking the trace, algebraically). Unless otherwise stated, we assume the Hilbert spaces are two dimensional. Algebraically, $|\psi)$ can be written as: \begin{align} \label{psidef} |\psi) =\sum_{j_0,\ldots,j_N } \text{tr}\left[ T^{j_0}T^{j_1}\ldots T^{j_N} O_\psi\right] |j_0)_{e^0}|j_1)_{e^1} \ldots |j_N)_{e^N}&, \end{align} where $e^k$ denotes the edge connecting the $k-1$ vertex and the $k$ vertex. The first step in bosonizing $|\psi)$ is to close $\mathsf{D}$ with an operator $O_\mathsf{D}$: \begin{align} \label{step1bosonization} \begin{tikzpicture}[Sbase,scale=1.3] \def \h{0.75}; \draw[red,OES={AR2=0.5}] (0,\h) --++(.5,0)--++(.5,0)--++(.5,0)--++(1,0); \draw[red,loosely dotted] (2,\h) --(3,\h); \draw[red,OES={AR2=0.5}] (3,\h) --(3.5,\h)--(4,\h)--(4.5,\h)--(5.2,\h); \draw[dashdotted](0,\h-0.25)--+(0,.5); \draw[dashdotted](5.2,\h-0.25)--+(0,.5); \foreach \j in {0.5,1.5,3.5} {\draw[red,->-=0.5] (\j,.1)--+(0,.75); \draw[black,->-=0.5] (\j+.5,\h)--+(0,.75); \node[Dtriangle] at (\j,\h) { };\node[Bcir] at (\j+0.5,\h) { }; } \node[OP] at (4.7,\h) {$O_\mathsf{D}$}; \end{tikzpicture}. \end{align} As we will show now, the choice of $O_\mathsf{D}$ determines both the subspace of the fermionic Hilbert space mapped non-trivially by the duality as well as the subspace of the bosonic Hilbert space in the image of the duality. \subsection{Boundary conditions in 1D} \label{app: BC in 1D} Here, we discuss how the choice of $\M{O}_\mathsf{D}$ affects the duality. With $\M{O}_\mathsf{D}$ parameterized as $\M{O}_\mathsf{D}=(-i\bar \gamma)^\alpha P^\beta$ and $\alpha , \beta \in \{0,1\}$, we will show that $\alpha$ determines the parity of the fermionic states that are mapped to non-trivial bosonic states and $\beta$ dictates the image of the duality. Specifically, for $\alpha=0(1)$, the subspace of states with even (odd) parity are mapped to the subspace of bosonic states invariant under the operator $(-1)^{\beta+1}\prod_v X_v$. To begin, we note that the choice of $\M{O}_\mathsf{D}$ does not affect the duality away from the boundary. Away from the boundary, the graphical calculation in \eqref{P image} and \eqref{S image} is unchanged by the choice of $\M{O}_\mathsf{D}$. For a chain with $N+1$ sites, we constrain $\M{O}_\mathsf{D}$ by considering the image of the fermion parity operator $P_{e^0}$ and the hopping operator $S_N$. (Recall that we have defined $e^k$ as the edge connecting vertices $k-1$ and $k$, so $e^0$ connects 0 and $N$.) We will also require that, similar to the case away from the boundary, $\mathsf{D}$ maps local operators near the boundary to local operators. Now, we consider acting on $P_{e^0}$ with $\mathsf{D}$. The diagrammatic calculation yields: \begin{align} \label{P boundary} \mathsf{D}\boldsymbol{{\cdot}} P =&\begin{tikzpicture}[Sbase,SS] \DPOprime;\node[OP] (A) at (2,-.75) {$P_{e^0}$}; \node[OP] at (1.25,0) {$\M{O}_\mathsf{D}$}; \end{tikzpicture}\\ \nonumber =&\begin{tikzpicture}[Sbase,scale=1.2, every node/.style={scale=0.8}] \DPOprime;\node[OP] (A) at (1.25,0) {$P\M{O}_\mathsf{D} P$}; \node[OP] (A) at (0.5,0.75) {$Z_{N}$}; \node[OP] (B) at (3.5,0.75) {$Z_{0}$}; \end{tikzpicture} \\ \nonumber =&Z_NZ_0\boldsymbol{{\cdot}} \mathsf{D}'. \end{align} Note that the operator $Z_N$ is required to ensure that the commutation relations between $P_{e^0}$ and $S_N$ are preserved by the duality. In the last line of \eqref{P boundary}, $\mathsf{D}'$ is the same as $\mathsf{D}$ but with $\M{O}_\mathsf{D}$ replaced by $P\M{O}_\mathsf{D} P$. The bosonization TNO should be left unmodified, so we require that $\mathsf{D}'\propto \mathsf{D}$. This means that $P\M{O}_\mathsf{D} P=c\M{O}_\mathsf{D}$ for some $c\in \mathbb{C}$, and we have: \begin{align} \mathsf{D}=\mathsf{D} \boldsymbol{{\cdot}} P^2_{e^0} = c^2 \mathsf{D}. \end{align} Therefore, $c$ must be $\pm 1$, or $P\M{O}_\mathsf{D} P=\pm \M{O}_\mathsf{D}$. We then see that $\M{O}_\mathsf{D}$ must have definite fermion parity, so it can be parameterized as $\M{O}_\mathsf{D}=(-i\bar \gamma)^\alpha P^\beta$ with $\alpha, \beta \in \{0,1\}$. Next, we act on the hopping operator $S_N$ with $\mathsf{D}$: \begin{align} \label{S boundary} \mathsf{D}\boldsymbol{{\cdot}} S_{N}= &\mathsf{D}\boldsymbol{{\cdot}} i\gamma_{e^N} \bar \gamma_{e^0} \nonumber \\ =&(-1)^{|O_\mathsf{D}|}\begin{tikzpicture}[Sbase,SS] \DSOprime; \node[OP] at (0.5,-0.75) {$i\gamma_{e^N}$};\node[OP] at (3.5,-0.75) {$\bar \gamma_{e^0}$}; \node[red,scale=0.8] at (1.15,-.8) {2}; \node[red,scale=0.8] at (4,-.8) {1}; \end{tikzpicture} \nonumber \\ =& \begin{tikzpicture}[Sbase,scale=1.4, ] \DSOprime; \node[OP] at (2.75,0) {$ \bar \gamma O_\mathsf{D}\bar \gamma$}; \node[OP] at (2,.75) {$ (-1)^{|O_\mathsf{D}|}X_{N}$}; \end{tikzpicture} \nonumber\\ =& (-1)^{|\M{O}_\mathsf{D}|}X_N \boldsymbol{{\cdot}} \mathsf{D}''. \end{align} The factor of $(-1)^{|\M{O}_\mathsf{D}|}$ is a consequence of moving $i\gamma_{e^N}$ past $\M{O}_\mathsf{D}$. In the last line of \eqref{S boundary}, $\mathsf{D}''$ is the same as $\mathsf{D}$ except with $\M{O}_\mathsf{D}$ replaced by $\bar \gamma \M{O}_\mathsf{D} \bar \gamma$. To obtain a relation as in \eqref{dualitytno1}, we require that $\mathsf{D}''\propto \mathsf{D}$. Assuming $\bar \gamma \M{O}_\mathsf{D} \bar \gamma =a\M{O}_\mathsf{D}$ for $a \in \mathbb{C}$, we obtain: \begin{align} \mathsf{D}=\mathsf{D}\boldsymbol{{\cdot}} S^2_N = a^2 \mathsf{D}, \end{align} and thus, $a=\pm 1$. We are now able to discuss the affect of $\M{O}_\mathsf{D}$ on the mapping of states. We define $\mathsf{D}_{\alpha \beta}$ to be the TNO formed by closing $\mathsf{D}$ with $\M{O}_\mathsf{D}$ parameterized by $\M{O}_\mathsf{D}=(-i\bar \gamma)^\alpha (P)^\beta$. Then, \eqref{P boundary} and \eqref{S boundary} are summarized by: \begin{align} \label{ODPS} \mathsf{D}_{\alpha\beta} \boldsymbol{{\cdot}} P_{{e^0}}= &(-1)^{\alpha }Z_{N}Z_{0}\boldsymbol{{\cdot}} \mathsf{D}_{\alpha\beta} \\ \mathsf{D}_{\alpha\beta} \boldsymbol{{\cdot}} S_{N}=& (-1)^{\alpha+\beta }X_{N}\boldsymbol{{\cdot}} \mathsf{D}_{\alpha\beta}. \end{align} Acting on global fermion parity with $\mathsf{D}_{\alpha\beta}$, we find: \begin{align} \label{DPar} \mathsf{D}_{\alpha\beta}\boldsymbol{{\cdot}} \prod_{e} P_{e} =& (-1)^{\alpha}\left( \prod_{e} Z_{e_0}Z_{e_1} \right) \boldsymbol{{\cdot}} \mathsf{D}_{\alpha\beta} \nonumber\\ =& (-1)^{\alpha}\mathsf{D}_{\alpha\beta}. \end{align} This implies that $\mathsf{D}_{\alpha\beta}$ maps fermionic states $|\psi)$ with $|\psi| \neq \alpha$ to zero. Explicitly, we have: \begin{align} \mathsf{D}_{\alpha\beta} |\psi ) = & (-1)^{|\psi|}\mathsf{D}_{\alpha\beta} \boldsymbol{{\cdot}} \prod_{e} P_{e} |\psi) \nonumber \\ = & (-1)^{|\psi|+\alpha}\mathsf{D}_{\alpha\beta} |\psi ) . \end{align} Therefore, $\mathsf{D}_{\alpha\beta} |\psi ) =0$ whenever $|\psi| \neq \alpha$. To bosonize an even state, $\alpha$ should be equal to $0$, and accordingly, $\M{O}_\mathsf{D}$ is proportional to $I$ or $P$. For an odd state, one should use $\alpha=1$, in which case, $\M{O}_\mathsf{D}$ is proportional to $-i\bar \gamma$ or $\gamma$. To understand the role of the $\beta$ parameter, we act on $\mathsf{D}_{\alpha\beta}$ with $\prod_v X_v$: \begin{align} \label{prodXonD} \prod_v X_v \boldsymbol{{\cdot}} \mathsf{D}_{\alpha \beta}=(-1)^{\alpha + \beta}\mathsf{D}_{\alpha \beta} \boldsymbol{{\cdot}}\prod_v S_v. \end{align} Now we use a global relation of the fermionic operator algebra. It can be checked that: \begin{align} \prod_v S_v = - \prod_e P_e. \end{align} Hence, continuing the calculation from \eqref{prodXonD}: \begin{align} \prod_v X_v \boldsymbol{{\cdot}} \mathsf{D}_{\alpha \beta} &= (-1)^{\alpha + \beta +1} \mathsf{D}_{\alpha \beta}\boldsymbol{{\cdot}} \prod_e P_e \nonumber \\ &= (-1)^{\beta+1} \mathsf{D}_{\alpha \beta}. \end{align} This means that the duality maps a fermionic state $|\psi)$ to the $(-1)^{\beta+1}$ eigenspace of $\prod_v X_v$, as can be seen from the following: \begin{align} \prod_v X_v \boldsymbol{{\cdot}} \mathsf{D}_{\alpha \beta} |\psi) = (-1)^{\beta+1} \mathsf{D}_{\alpha \beta} |\psi). \end{align} We have thus shown that $\M{O}_\mathsf{D}$ can be parameterized by $\M{O}_\mathsf{D}=(-i\bar \gamma)^\alpha P^\beta$ with $\alpha, \beta \in \{0,1\}$, and that $\mathsf{D}$ closed with $\M{O}_\mathsf{D}$ gives a map from the $(-1)^\alpha$ eigenspace of $\prod_e P_e$ to the $(-1)^{\beta+1}$ eigenspace of $\prod_v X_v$. \subsection{Converting virtual indices to bosonic indices } The second step is to contract $\mathsf{D}$ with $|\psi)$ to form $ |\psi_\text{bos}\rangle $: \begin{align} |\psi_\text{bos}\rangle= \begin{tikzpicture}[Sbase,scale=1.3] \def \h{0.7}; \draw[red,OES={AR2=0.5}] (0,0) --++(2,0); \draw[red,loosely dotted] (2,0) --(3,0); \draw[red,-<-=0.5] (3,0) --(5.2,0); \draw[red,OES={AR2=0.5}] (0,\h) --++(0.5,0)--++(0.5,0)--++(0.5,0)--++(0.5,0); \draw[red,loosely dotted] (2,\h) --(3,\h); \draw[red,OES={AR2=0.5}] (3,\h) --(3.5,\h)--(4,\h)--(4.5,\h)--(5.2,\h); \draw[dashdotted](0,-0.25)--+(0,1.25); \draw[dashdotted](5.2,-0.25)--+(0,1.25); \foreach \j in {0.5,1.5,3.5} {\draw[red,->-=0.5] (\j,0)--+(0,\h); \draw[black,->-=0.5] (\j+0.5,\h)--+(0,.75); \node[Tsq] at (\j,0) { }; \node[Dtriangle] at (\j,\h) { }; \node[Bcir] at (\j+0.5,\h) { }; } \node[OP] at (4.7,0) {$O_\psi$};\node[OP] at (4.7,\h) {$O_\mathsf{D}$}; \end{tikzpicture}. \end{align} We can then see that $|\psi_\text{bos}\rangle$ is built from the local tensors $\M{M_f}\equiv \M{T} \boldsymbol{{\cdot}} \M{F}\boldsymbol{{\cdot}} \M{B}$: \begin{align} \label{TFB2} &\begin{tikzpicture}[Sbase,scale=1] \draw[red,-<-=0.5](0,0)node[left,black]{$e_1'$}--(3,0)node[right,black]{$e'_0$}; \draw[red,-<-=0.5](0,1)node[left,black]{$e_1$}--(3,1)node[right,black]{$e_0$};\draw[red](1,0)--+(0,1);\draw[->-=0.5](2,1)--+(0,1)node[left,black]{$e_0$}; \node[Tsq] at (1,0) { }; \node[Dtriangle] at (1,1) { }; \node[] at (1,1.4) {$ $};\node[Bcir] at (2,1) { }; \end{tikzpicture}, \end{align} and the tensor networkis closed with the operator $\M{O_f} \equiv O_\psi O_\mathsf{D}$: \begin{align} & \begin{tikzpicture}[Sbase,scale=1.3] \def \h{0.75}; \draw[red,-<-=0.15] (5,\h)node[left,black]{$N$} --(6,\h)node[right,black]{$N$}; \draw[red,-<-=0.15] (5,0)node[left,black]{$N'$} --(6,0)node[right,black]{$N'$}; \filldraw[fill=white, draw=black] (5.5,.375) ellipse (.3cm and .55cm); \node[] at (5.5,.375) {$\M{O_f}$}; \end{tikzpicture} \equiv \begin{tikzpicture}[Sbase,scale=1.3] \def \h{0.75}; \draw[red] (5,\h) --(6,\h); \draw[red] (5,0) --(6,0); \node[OP] at (5.5,0) {$O_\psi$};\node[OP] at (5.5,\h) {$O_\mathsf{D}$}; \end{tikzpicture}. \end{align} The state $ |\psi_\text{bos}\rangle $ formed by contracting together $\M{M_f}$ and closing with $\M{O_f}$ is indeed a bosonic state. However, it is not manifestly a bosonic matrix product state (bMPS), since the virtual legs may have nontrivial grading. In the third and final step of the bosonization procedure, we write $ |\psi_\text{bos}\rangle $ as a bonafide bMPS -- constructed from a local tensor with bosonic virtual legs. As suggested in section \ref{subsub:koszul signs}, we do so by choosing a particular internal ordering of the virtual legs of $\M{M_f}$ and $\M{O_f}$, in which they become convertible to bosonic indices. \begin{figure} \centering \begin{tikzpicture}[Sbase,scale=1,every node/.style={scale=1}] \def \h{0.4}; \draw[red] (0,0)--++(2,0)(2.5,0)--(4.5,0); \draw[red,loosely dotted] (2,0)--(2.5,0); \draw[red] (0,\h)--(2,\h)(2.5,\h)--(4.5,\h); \draw[red,loosely dotted] (2,\h)--(2.5,\h); \foreach \j in {0.5,1.5,3} {\draw (\j,\h)--+(0,0.5);\node[Mrec,scale=1.2] at (\j,.2) {$M_f$};} \node[OP,yscale=1.3] at (4,0.2) {$\M{O_f}$}; \draw[dashdotted](0,-0.25)--+(0,1); \draw[dashdotted](4.5,-0.25)--+(0,1); \end{tikzpicture} \begin{tikzpicture}[Sbase,scale=1] \node[scale=2] {$=$}; \end{tikzpicture} \begin{tikzpicture}[Sbase,scale=1,every node/.style={scale=1}] \def \h{0.4}; \draw[] (0,0)--++(2,0)(2.5,0)--(5,0); \draw[loosely dotted] (2,0)--(2.5,0); \draw[] (0,\h)--(2,\h)(2.5,\h)--(5,\h); \draw[loosely dotted] (2,\h)--(2.5,\h); \foreach \j in {0.5,1.5,3} {\draw (\j,\h)--+(0,0.5);\node[Mrec,scale=1.2] at (\j,.2) {$M_b$};} \node[OP,yscale=1.3] at (3.75,0.21) {$\M{O_b}$}; \draw[dashdotted](0,-0.25)--+(0,1); \draw[dashdotted](5,-0.25)--+(0,1); \node[OP] at (4.5,0) {$Z$};\node[OP] at (4.5,0.4) {$Z$}; \end{tikzpicture} \caption{With the internal ordering chosen in \eqref{intord1D1} and \eqref{intord1D2}, the virtual legs of $\M{M_f}$ and $\M{O_f}$ can be replaced with un-graded virtual legs. The supertrace sign produced between the first and last indices on both layers is accounted for by inserting the operator $Z_{N}\otimes Z_{N'}$ before closing the state generated by $\M{M_b}$ and $\M{O_b}$.} \label{fig:step3} \end{figure} We start by writing $\M{M_f}$ and $\M{O_f}$ in tensor component form. In tensor component form, a generic $\M{M_f}$ is: \begin{align}\label{Mf} \M{M_f} = \sum_{\substack{j,a',a,\\b,b'}=0} (M_f)^j_{aa',b'b} |a')_{e'_1}|a)_{e_1} |j\rangle_{e_0} (b|_{e_0}(b'|_{e'_0}, \end{align} where the components of $\M{M_f}$ can of course be expressed in terms of the components of $\mathsf{F}$, $\mathsf{B}$, and $\M{T}$. Note that we have chosen a specific ordering of the vectors in $\M{M_f}$. Schematically, the vectors are ordered as: \begin{align} \label{intord1D1} \begin{tikzpicture}[Sbase,scale=1] \draw[red](0,0)node[left,black]{$\M{(i)}$}--(3,0)node[right,black]{$\M{(v)}$}; \draw[red](0,1)node[left,black]{$\M{(ii)}$}--(3,1)node[right,black]{$\M{(iv)}$};\draw[red](1,0)--+(0,1);\draw(2,1)--+(0,1)node[left,black]{$\M{(iii)}$}; \node[Tsq] at (1,0) { }; \node[Dtriangle] at (1,1) { };\node[Bcir] at (2,1) { }; \end{tikzpicture}. \end{align} Next, we write a generic $\M{O_f}$ in tensor component form: \begin{align} \M{O_f} = \sum_{a',b',a,b}(O_f)_{a',b',a,b}|a')_{N'}|a)_N(b|_N (b'|_{N'}, \end{align} where we have intentionally ordered the graded vectors according to the diagram: \begin{align} \label{intord1D2} \begin{tikzpicture}[Sbase,scale=1.3] \def \h{0.75}; \draw[red] (5,\h)node[left,black]{(ii)} --(6,\h)node[right,black]{(iii)}; \draw[red] (5,0)node[left,black]{(i)} --(6,0)node[right,black]{(iv)}; \filldraw[fill=white, draw=black] (5.5,.375) ellipse (.3cm and .55cm); \node[] at (5.5,.375) {$\M{O_f}$}; \end{tikzpicture}. \end{align} It may be checked that with the special choices of ordering in \eqref{intord1D1}, we do not produce any Koszul signs while contracting the $\M{M_f}$ with each other. Therefore, as suggested in section \eqref{subsub:koszul signs}, we can simply replace all fermionic virtual legs shared by two $\M{M_f}$ tensors with bosonic legs. Similarly, with the choice of ordering in \eqref{intord1D2}, no sign is produced in the contraction of $\M{M_f}$ with $\M{O_f}$, so their common indices can also be replaced with bosonic indices. However, a Koszul sign \textit{is} produced in the trace operation (contraction of first and last indices) due to the supertrace phase [see \eqref{supetrace}]. However, these indices are convertible to bosonic indices with $(Z_{N} \otimes Z_{N'})$-insertion (see section \ref{subsub:koszul signs}). That is, we can replace them with bosonic indices as long as we insert an operator $Z_{N} \otimes Z_{N'}$ (one $Z$ on each of the two virtual indices) before closing the MPS. We denote the bosonic tensor obtained by replacing the fermionic virtual legs of $\M{M_f}$ as $\M{M_b}$, and similarly, we denote the bosonic tensor obtained by replacing the fermionic virtual legs of $\M{O_f}$ as $\M{O_b}$. Then, the state generated by $\M{M_f}$ and $\M{O_f}$ and the state generated by $\M{M_b}$ with $\M{O_b}$ and $Z_{N} \otimes Z_{N'}$ is the same state (see Fig.~\ref{fig:step3}). It is convenient to further absorb the $Z$ factors into the definition of $\M{O_b}$. With this, the bMPS is generated by the tensors: \begin{align} \M{M_b}=& \sum_{\substack{j,a',a\\,b,b'}=0} (M_f)^j_{aa',b'b} |a'\rangle_{e'_0}|a\rangle_{e_0} |j\rangle_{e_1} \langle b|_{e_1}\langle b'|_{e_1'} \\ \M{O_b}=& \sum_{a',b',a,b}(O_f)_{a',b',a,b}(-1)^{b+b'}|a'\rangle_{N'}|a\rangle_N\langle b|_N \langle b'|_{N'}, \end{align} where the phase $(-1)^{b+b'}$ comes from the application of $Z_{N} \otimes Z_{N'}$. Now, contracting $\M{M_b}$ and closing the tensor networkwith the bosonic tensor $\M{O_b}$ yields $|\psi_\text{bos}\rangle$, and in this way, $ |\psi_\text{bos}\rangle $ is expressly a bMPS. Thus, we have successfully mapped the fMPS $|\psi)$ to the bMPS $ |\psi_\text{bos}\rangle $. In summary, bosonization of a fMPS defined by a tensor $\M{T}$ and operator $O_\psi$ as in Eq. \eqref{psidef} proceeds in three steps. \begin{enumerate} \item Choose an operator $O_\mathsf{D}=(-i\bar \gamma)^{\alpha}P^{\beta}$ with $\alpha,\beta \in \{0,1\}$ with which to close the bosonization TNO. \item Construct $\M{M_f}$ by contracting $\M{T}$, $\mathsf{F}$, and $\mathsf{B}$. Form $\M{O_f}$ by combining $O_\psi$ and $O_\mathsf{D}$. \item Rearrange the vectors in $\M{M_f}$ and $\M{O_f} $ to match the ordering in \eqref{intord1D1} and \eqref{intord1D2}, respectively. Form $\M{M_b}$ and $\M{O_b}$ from $\M{M_f}$ and $\M{O_f}$ by taking the graded vectors to have trivial grading and modifying the components $(O_f)_{a',b',a,b}$ of $\M{O_f}$ by $(-1)^{b+b'}$ to account for the supertrace. \end{enumerate} In the next subsection, we provide explicit examples of the tensor network bosonization steps above. \subsection{Examples} We will illustrate the tensor network bosonization procedure of the previous section on two examples -- a trivial atomic insulating state and the nontrivial ground state of the Kitaev chain. To motivate the TNO duality, we also analyze the examples at the operator level using the duality of section \ref{reviewbosonization}. \textbf{Example 1:} The trivial atomic insulating state is the ground state of the Hamiltonian $H_\text{triv}=-\sum_{e }P_{e}$. It has zero fermion occupancy at each site and can be expressed in the form: \begin{align} \label{psidef2} &|\psi_\text{triv})=\sum_{j_0,\ldots,j_N } \text{tr}\left[ T^{j_0}\ldots T^{j_N} O_\psi \right] |j_1)_{e^0}\ldots |j_N)_{e^N}. \end{align} with $\M{T}$ being the trivial tensor: \begin{align}\label{trivialT2} \begin{tikzpicture}[Sbase] \draw[red,OES={AR2=0.5}](0,0)node[above,black]{$e_1$}--++(1,0)--++(1,0)node[above,black]{$e_0$}; \draw[red,->-=0.5](1,0)node[Tsq]{$\M{T}$}--+(0,1)node[right,black]{$e$}; \end{tikzpicture} = |0)_{e_1} |0)_{e} (0|_{e_0}, \end{align} and $O_\psi$ equal to the parity operator $P$. Using the 1D operator duality in section \ref{reviewbosonization} [Eq.~\eqref{D1def}], we see that $H_\text{triv}$ is mapped to the spontaneous symmetry breaking Hamiltonian $H_{SSB}=-\sum_{e}Z_{e^1} Z_{e^0}$. In accordance, we will see that the bosonization TNO maps the ground state of $H_\text{triv}$ to a ground state of $H_{SSB}$. The first step of the tensor network bosonization procedure is to choose an operator ${O}_\mathsf{D}$ with which to close the bosonization TNO. For simplicity, let us choose $O_\mathsf{D}$ to be fermion parity $P$. This choice of ${O}_\mathsf{D}$ gives a map from the set of fermion parity even states to the set of states symmetric under $\prod_v X_v$ (Appendix \ref{app: BC in 1D}). Next, we construct the tensor $ \M{M_f}$ and the operator $\M{O_f}$. $\M{M_f}$ is obtained by contracting $\M{T}$, $\mathsf{F}$, and $\mathsf{B}$ as in \eqref{TFB2}: \begin{align} &\M{M_f}=\M{T} \boldsymbol{{\cdot}} \M{F}\boldsymbol{{\cdot}} \M{B}\nonumber\\ &= |0)_{e'_1}|0)_{e'}^{\mathcal{C}_1} (0|_{e'_0} \sum_{a,b}|a)_{e_1}(a+b|^{\mathcal{C}_1}_e (b|^{\mathcal{C}_2}_{e_0} \sum_c|c)^{\mathcal{C}_2}_{e_0} |c\rangle_{e_0} (c|_{e_0} \nonumber\\ &= \sum_a |0)_{e_1'}(0|_{e_0'}|a)_{e_1} |a \rangle_{e_0} (a|_{e_0}\nonumber\\ &=\sum_a |0)_{e_1'}|a)_{e_1} |a \rangle_{e_0} (a|_{e_0}(0|_{e_0'}, \end{align} and $\M{O_f}$ is simply \begin{align} \M{O_f}=&\Bigg( \sum_{b'} (-1)^{b'} |b')_{N'}(b'|_{0'} \Bigg) \Bigg ( \sum_{b} (-1)^b |b)_{N}(b|_{0} \Bigg). \end{align} Then, we rearrange the order of the graded vectors in $\M{M_f}$ and $\M{O_f}$ according to \eqref{intord1D1} and \eqref{intord1D2}. In the final step of the tensor network bosonization procedure, we construct $\M{M_b}$ and $\M{O_b}$ by removing the grading and appropriately accounting for the supertrace. Following these steps, $\mathsf{M_b}$ is: \begin{align} \label{Mbtriv} \M{M_b}= \sum_a |0\rangle_{e_0'}|a\rangle_{e_0} |a \rangle_{e_1} \langle a|_{e_1} \langle 0|_{e'_1}, \end{align} and re-ordering the vectors of $\M{O_f}$ and accounting for the supertrace gives: \begin{align} \M{O_b}=\sum_{b',b} |b'\rangle_{e_0'}|b\rangle_{e_0} \langle b|_{e_1}\langle b'|_{e_1'}. \end{align} The bosonized state is constructed by gluing together $\M{M_b}$ and closing the tensor network with $\M{O_b}$. To see that $\M{M_b}$ generates the ground state of $H_\text{SSB}$, we first notice that, for $\M{M_b}$ in Eq. \eqref{Mbtriv}, the $e'_0$ and $e'_1$ indices do not affect the bosonized state. Therefore, $\M{M_b}$ and $\M{O_b}$ can be reduced to: \begin{align} \tilde{\mathsf{M}}_\M{b}&= \sum_{a} |a\rangle_{e_0} |a \rangle_{e_1}\langle a|_{e_1} \\ \tilde{\M{O}}_\M{b}&=\sum_{b} |b \rangle_{e_0} \langle b|_{e_1}. \end{align} $\tilde{\mathsf{M}}_\M{b}$ generates the state: \begin{align} |\psi_\text{bos} \rangle = |00\ldots \rangle + |11\ldots \rangle, \end{align} which is the ground state of $H_\text{SSB}$. Therefore, $\M{M_b}$ also generates the ground state of $H_\text{SSB}$. \textbf{Example 2:} Now, we turn to the example of the non-trivial ground state $|\psi_\text{K})$ of the Kitaev chain. $|\psi_\text{K})$ is the ground state of the Hamiltonian $H_\text{K}=-\sum_{v} S_{v}$, and it can be written as a fMPS with [\onlinecite{Bultinck17}]: \begin{align} \M{T}= \sum_{a,b} (-1)^{a(a+b)}|a)_{e_1'} |a+b)_{e} (b|_{e_0'}, \end{align} and $ {O}_\psi= -i\bar \gamma$. The operator duality $\mathfrak{D}$ maps $H_\text{K}$ to the paramagnet Hamiltonian $H_\text{para}=-\sum_{v} X_{v}$, so the bosonization TNO should transform $|\psi_\text{K})$ to the paramagnet ground state $|\psi_\text{para}) = |++\ldots \rangle $, where $|+\rangle =\frac{1}{\sqrt{2}}\left( |0\rangle + |1 \rangle\right) $. Following the three steps outlined in the previous section, we first choose ${O}_\mathsf{D}$. Since ${O}_\psi$ is fermion parity odd, we choose ${O}_\mathsf{D}=(-i\bar \gamma)P=\gamma$. First, we compute $\M{M_f}$ by contracting $\M{T}$, $\mathsf{F}$, and $\mathsf{B}$: \begin{widetext} \begin{align} \M{M_f}=\M{T}\boldsymbol{{\cdot}}\M{F}\boldsymbol{{\cdot}}\M{B}=& \Bigg[ \sum_{a',b'}(-1)^{|b'|(|a'|+|b'|)}|a')_{e_0'}|a'+b')^{\mathcal{C}_1}_{e'} (b'|_{e_1'} \Bigg] \Bigg[ \sum_{a,b}|a)_{e_0}(a+b|^{\mathcal{C}_1}_e (b|^{\mathcal{C}_2}_{e_1} \Bigg]\Bigg[ \sum_c|c)^{\mathcal{C}_2}_{e_1} |c\rangle_{e_1} (c|_{e_1} \Bigg] \nonumber \\ =& \sum_{a,b,a',b'}(-1)^{(b'+b)(a'+b')}\delta_{a+b,a'+b'}|a')_{e_0'}|a)_{e_0} |b\rangle_{e_1} (b|_{e_1} (b'|_{e_1'} \end{align} \end{widetext} Next, we remove the grading of the vectors in $\M{M_f}$ and $\M{O_f}=-i\bar \gamma$ and account for the supertrace to form $\M{M_b}$ and $\M{O_b}$: \begin{align} \mathsf{M_b}=&\sum_{\substack{a,b\\a',b'}}(-1)^{(a'+b)(a'+b')}\delta_{a+b,a'+b'}\nonumber\\ &|a'\rangle_{e_0'}|a\rangle_{e_0} |b\rangle_{e_1} \langle b|_{e_1} \langle b'|_{e_1'} \nonumber\\ \mathsf{O_b} =& \sum_{b,b'} (-1)^{b+b'}|b'\rangle_{N'}|b\rangle_{N}\langle b+1|_{0}\langle b'+1|_{0'}. \end{align} Explicitly, we have: \begin{align} \mathsf{M_b} = &\big(|00 \rangle-|11 \rangle \big) \big(|0\rangle \langle 00|-|1\rangle \langle 11| \big)+ \\ \nonumber &\big(|10 \rangle+|01 \rangle\big) \big(|0\rangle \langle 10|+|1\rangle \langle 01|\big) \\ \mathsf{O_b} = &|00\rangle \langle 11 | +|11\rangle \langle 00| \nonumber \\ -&|01\rangle \langle 10|- |10\rangle \langle 01 |. \end{align} Defining $|v_0\rangle = |00 \rangle-|11 \rangle $ and $|v_1\rangle=|10 \rangle+|01 \rangle $ and the corresponding projectors: $P_j=|v_j\rangle\langle v_j|$, $j=0,1$, then $\mathsf{M_b}$ satisfies $\mathsf{M_b}P_j = P_j\mathsf{M_b}P_j$. The boundary operator also satisfies $P_j \mathsf{O_b}=P_j \mathsf{O_b} P_j$. Thus, there are two canonical blocks: \begin{align} P_j \mathsf{M_b} P_j &= |v_j\rangle (|+\rangle) \langle v_j| \quad j=0,1\nonumber \\ \langle v_j |\mathsf{O_b} |v_j\rangle &= -1, \end{align} where $|+\rangle = |0\rangle +|1\rangle$. Both blocks give the same state: $- |+\rangle^{\otimes N}$. \section{Conclusion and future work} Tensor networks provide a powerful framework for studying quantum many-body systems. Their simple parameterization allows for efficient numerical computations, and their diagrammatic representation elucidates the structure of entanglement in quantum states. More abstractly, tensor networks provide a uniform language for discussing quantum many-body systems. Here, we have extended the formalism of tensor networks to exact bosonization dualities. In particular, we have constructed a TNO that implements the two dimensional bosonization duality first discussed in Ref. [\onlinecite{ChenYA17}]. Furthermore, our bosonization TNO can be applied directly to fermionic tensor network states, thus defining bosonization at the level of quantum states. A critical step of our bosonization procedure is to express the bosonized state as an explicit bosonic tensor network. To this end, we described how to account for Koszul signs accrued in contracting fermionic tensor networks, and we constructed matrix product operators to be placed along non-trivial cycles for this purpose. As a result, our bosonization duality at the level of states can be applied to fermionic systems on arbitrary triangulations of 2D manifolds without a boundary. {We would also like to emphasize that the calculation of Koszul signs in section \ref{sec: bosonization of fPEPS} has potential for applications outside of the bosonization of fPEPS. In fact, the calculation applies to the contraction of \textit{any}\footnote{Assuming the 2D fPEPS is defined on a triangulation of an orientable 2D manifold.} 2D fPEPS generated by fermion parity even local tensors and without fermionic physical legs. In particular, it may be useful for efficiently evaluating the overlap between two fPEPS. Explicitly, one can use the technology developed in section \ref{sec: bosonization of fPEPS} to replace the fermionic virtual legs with bosonic virtual legs and account for the Koszul signs. Notably, for a regular triangular lattice or square lattice, our results show that the fermionic virtual legs can freely be replaced with bosonic virtual legs as long as the MPO generated by $\M{W}$ and $\M{G}$ is inserted before closing the tensor network on a manifold with non-trivial genus.} Directions for future work include generalizing our bosonization duality, identifying tensor network representations of wider classes of dualities, and utilizing the bosonization TNO to study fermionic systems. A natural generalization is to develop a 3D bosonization duality at the level of quantum states. Recently, [\onlinecite{Chen18}] presented a bosonization duality in 3D, and we expect that this duality admits a tensor network representation. Formulating a TNO for the 3D duality might also make it clear how to bosonize in dimensions greater than three. Another possible generalization is to extend our bosonization duality to manifolds with boundaries. It would be interesting to construct tensor network representations for other operator-level dualities. Ref. [\onlinecite{Djordje18}] describes a duality for parafermionization in 2D, in which a system of constrained spins is dual to a system of parafermions. Formulating a corresponding TNO would require a careful understanding of paraspin-structure -- a generalization of spin-structure to parafermions. We also expect that recently developed dualities for gauging subsytem symmetries can be naturally formulated in terms of tensor networks [\onlinecite{Shirley19}]. Further, it would be nice to interpret the results of Ref. [\onlinecite{Kubica18}] using tensor networks. We anticipate that our bosonization procedure will be useful for studying fermionic topological orders. Beginning with a fermionic tensor network state, one can apply the bosonization procedure outlined in the text and subsequently analyze the topological order of the bosonic state using the myriad of techniques developed to study bosonic topological orders. In addition, MPO symmetries of the fermionic state can be tracked through the bosonization procedure to obtain the MPO symmetries of the bosonic system. Going the other direction, the Hermitian conjugate of the bosonization TNO can be applied to a bosonic state to obtain a fermionic tensor network state. Two dimensional (non-chiral) bosonic topological orders have been well studied using tensor networks, so we can use the known tensor network representations of fixed point states to construct fixed point states for fermionic topological phases. Furthermore, the MPO symmetries of the bosonic system descend to MPO symmetries of the fermionic system. While fixed point states for intrinsic fermionic topological orders and fermionic symmetry protected topological phases were identified in Refs. [\onlinecite{Bultinck17},\onlinecite{Bultinck17a}], our bosonization procedure gives a means for constructing and studying fixed point states for fermionic symmetry-enriched topological orders as well. \vspace{0.1in} \noindent{\it Acknowledgements -- } SS would like to acknowledge Alex Turzillo for valuable discussions about related work on $\mathbb{Z}_2$-graded tensors. SS and TE also thank Dave Aasen for helpful conversations about fermion condensation. LF is supported by NSF DMR-1519579. \section{Bosonization of fPEPS} \label{sec: bosonization of fPEPS} \begin{figure} \centering \begin{tikzpicture}[Sbase,xscale=1.7,yscale=1.4] \randt; \Tposf{(1)}{(2)}{(7)}{(0,0,0.6)}; \Tnegf{(3)}{(2)}{(4)}{(0,0,0.6)}; \Tnegf{(3)}{(5)}{(6)}{(0,0,0.6)}; \Tnegf{(3)}{(4)}{(5)}{(0,-.2,0.5)}; \Tposf{(2)}{(4)}{(7)}{(0,-.1,0.6)}; \Tposf{(3)}{(2)}{(6)}{(0,0,0.7)}; \Tposf{(4)}{(5)}{(7)}{(0,-.2,0.5)}; \Tnegf{(8)}{(11)}{(7)}{(0,-0.2,0.5)}; \Tposf{(1)}{(7)}{(8)}{(0,-0.2,0.5)}; \Tnegf{(8)}{(10)}{(11)}{(0,0,0.7)}; \Tposf{(9)}{(8)}{(10)}{(0,-0.2,0.5)}; \Tnegf{(11)}{(5)}{(7)}{(-.1,0,0.5)}; \end{tikzpicture} \caption{An example fPEPS on an arbitrarily triangulated torus. The square nodes represent the tensors $\M{T}$ and $\M{\bar{T}}$ in Eqs.~\eqref{Texp} and \eqref{Tpics}. The legs affixed to the center of the square nodes and pointing out of the page are the physical legs of the fPEPS. All other legs are contracted with a leg of a neighboring tensor.} \label{fig:fPEPS} \end{figure} In the previous section, we introduced the bosonization of a fermionic state $|\psi_f)$ as the action of the bosonization TNO $\mathsf{D}$ on $|\psi_f)$. As we now show, the TNO is especially useful when the fermionic $|\psi_f)$ is represented as a fermionic tensor network state. While the action of $\mathsf{D}$ on the fermionic tensor network state $|\psi_f)$ indeed yields a bosonic state $\mathsf{D}|\psi_f)=|\psi_b\rangle$, $|\psi_b\rangle$ is not manifestly a bosonic tensor network state. This is due, in part, to the $\mathbb{Z}_2$-graded virtual legs of the bosonization TNO. However, if $|\psi_f)$ is in the form of a fermionic projected entangled pair state (fPEPS) (see Fig.~\ref{fig:fPEPS} for an example), we can explicitly rewrite $|\psi_b\rangle$ as a bosonic projected entangled pair state (bPEPS). In this section, we give a detailed algorithm for converting bosonized fPEPS into bPEPS, which is well defined on arbitrary triangulations of orientable 2D manifolds without boundary. \subsection{Contracting the bosonization TNO with an fPEPS} An fPEPS on a triangulated manifold is built from $\mathbb{Z}_2$-graded tensors $\M{T}[f']$ on positively oriented triangles and $\M{\bar T}[f']$ on negatively oriented triangles. Assuming that the tensors are fermion parity even, they can be written in component form as: \begin{align}\label{Texp} \M{T}[f'] \equiv \sum_{a,b,c} T_{abc}^{(f')}|c)_{f'_{01}}|a)_{f'_{12}}(b|_{f'_{02}} (a+b+c|_{f'} \nonumber\\ \M{\bar{T}}[f'] \equiv \sum_{a,b,c} \bar{T}^{(f')}_{abc}|b)_{f'_{02}}(a|_{f'_{12}}(c|_{f'_{01}}(a+b+c|_{f'}, \end{align} where for generality, the tensor components are position dependent. $\M{T}[f']$ and $\M{\bar T}[f']$ can then be represented, respectively, as follows: \begin{align} \label{Tpics} \begin{tikzpicture}[Sbase,scale=1] \pic[scale=1] at (0,0) {newt}; \end{tikzpicture}, \, \begin{tikzpicture}[Sbase,scale=1] \pic[scale=1] at (0,0) {newtbar}; \end{tikzpicture}. \end{align} Fig.~\ref{fig:fPEPS} shows an fPEPS formed from contracting $\M{T}[f']$ and $\M{\bar T}[f']$ on an arbitrary triangulation of a torus. In general, one can insert matrix product operators (MPO) before closing an fPEPS on a closed manifold. Though we believe our construction can be extended to such cases, in the interest of brevity and clarity, we restrict the discussion to fPEPS without any MPO insertions. To apply $\mathsf{D}$ to an fPEPS $|\psi_f)$, we contract the physical indices of $\mathsf{F}$ tensors with those of the $\M{T}$ tensors, and likewise, we contract $\bar \mathsf{F}$ tensors with $\M{\bar T}$ tensors. Thus, the first step in bosonizing an fPEPS is to calculate the tensors $\M{M_f}=\mathsf{F}\boldsymbol{{\cdot}} \M{T}$ for positively oriented triangles and the tensors $\M{\bar{M_f}}= \M{\bar{F}\boldsymbol{{\cdot}} \bar{T}} $ for negatively oriented triangles. Graphically, $\M{M_f}$ and $ \M{\bar{M}_f}$ can be drawn, respectively, as: \begin{align}\label{cal:FT} \begin{tikzpicture}[Sbase,scale=1] \newft; \end{tikzpicture} , \begin{tikzpicture}[Sbase,scale=1] \newftbar; \end{tikzpicture} . \end{align} The bosonized state $|\psi_b\rangle$ is a tensor network state (in fact an fPEPS) generated by tensors $\M{M_f}$, $\M{\bar{M}_f}$, as well as $\mathsf{B}_\eta[e]$ on edges. Since there are two layers of virtual legs to be contracted, we refer to them as the ``state layer'' and the ``TNO layer''. Note that $\M{M_f}$ and $\M{\bar{M}_f}$ tensors have virtual legs on both layers, but $\mathsf{B}_\eta[e]$ is only on the TNO layer. While $|\psi_b\rangle$ is a tensor network state and an fPEPS, it is not generically a bPEPS, as there are fermionic virtual indices remaining. The challenge is then to re-express $|\psi_b\rangle$ as a bPEPS, or, in a sense, to convert the fermionic virtual legs to bosonic virtual legs. We accomplish this by systematically accounting for the signs accrued in contracting the fermionic virtual legs -- the so-called \textit{Koszul signs}. To make our strategy clear, we first discuss {Koszul signs} and introduce the idea of a \textit{removable grading}. These concepts play a key role in the rest of this section, so we describe them in generality before returning to the problem of converting the fermionic virtual legs of $|\psi_b\rangle$ to bosonic virtual legs. \subsection{Koszul signs and removable grading} \label{subsub:koszul signs} The bosonized fPEPS encodes a bosonic quantum state $|\psi_b\rangle=\sum_{\{\phi\}} C_\phi |\phi\rangle$, where the collection of $|\phi\rangle$ form a complete set of product states. The coefficients $C_\phi$ can be recovered from the bosonized fPEPS by fixing the physical indices according to $|\phi\rangle$ and summing over the virtual indices. Given the $\mathbb{Z}_2$-grading of the virtual legs, there are signs picked up upon re-ordering and contracting the $\mathbb{Z}_2$-graded vectors, which can contribute to the coefficient $C_\phi$. A natural question is whether the grading of a virtual index is essential to the tensor network, i.e., if the grading of a particular virtual index is removed, does the value of the bosonized fPEPS change? For illustration, consider the two simple graded tensors ${\M{A}=\sum_{a,a'}A_{aa'}(a'|_s (a|_t}$ and ${\M{B} = \sum_{b,b'} B_{bb'}|b')_s |b)_t}$. (We can think of $s$ and $t$ as indices corresponding to the state and TNO layers, respectively.) We want to calculate the tensor network (which is a scalar in this case) $\M{A}\boldsymbol{{\cdot}}\M{B}$. Let us describe the contraction of these tensors as a two step process. In the first step, we contract the basis tensors: \begin{align} (a'|_s (a|_t\boldsymbol{{\cdot}} |b')_s |b)_t = & (-1)^{|b'||a|}\delta_{ab}\delta_{a'b'}, \end{align} and in the second step, we calculate the components: \begin{align} \sum_{a,a,b,b'}(-1)^{|b'||a|}\delta_{ab}\delta_{a'b'}A_{aa'} B_{bb'} = \sum_{a,a'}(-1)^{|a'||a|}A_{aa'} B_{aa'}. \end{align} Notice that we produce an additional sign of $(-1)^{|b'||a|}$ in the basis contraction step due to the graded nature of indices. This is the key difference between virtual indices of fermionic and bosonic tensor networks -- bosonic indices do not produce any additional signs in basis contraction. We refer to these additional signs of basis contractions as Koszul signs. The point is that the grading of a virtual index contributes to the fPEPS only through possible Koszul signs. Therefore, we can remove the grading of a virtual index as long as we properly account for the Koszul signs. Sometimes this can be done simply by {picking a specific internal ordering for the fermionic tensors and interpreting their components, with respect to this ordering, as components of purely bosonic tensors. We say that the grading of the virtual indices in the original fermionic tensor network can be removed, if the contraction of this new bosonic tensor network is the same as that of the original fermionic tensor network. When we have some a priori internal ordering for the fermionic tensors in mind already -- one that does produce Koszul signs -- then we can refer to this process as \textit{changing the internal ordering} to eliminate the Koszul signs.} For example, consider changing the internal ordering of $\M{A}$ to ${\M{A}=\sum_{a,a'}A_{aa'}(-1)^{|a'||a|} (a|_t(a'|_s }$. Now, there is no Koszul sign in the basis contraction: ${ (a|_t(a'|_s \boldsymbol{{\cdot}}|b')_s |b)_t =\delta_{a,b}\delta_{a',b'}}$. Removing the grading from $\M{A}$ and $\M{B}$ yields: \begin{align} \M{A_b}&=\sum_{a,a'}A_{aa'}(-1)^{|a'||a|} \langle a|_t\langle a'|_s \nonumber \\ \M{B_b}&= \sum_{b,b'} B_{bb'}|b'\rangle_s |b\rangle_t. \end{align} $\M{A_b}$ and $\M{B_b}$ are purely bosonic tensors, and they produce the same tensor network: $\M{A_b}\boldsymbol{{\cdot}}\M{B_b}=\M{A}\boldsymbol{{\cdot}}\M{B}$. Note that the grading is removable for only particular choices of the internal ordering. In other cases, the Koszul signs can be accounted for with a removal of the grading, followed by an insertion of additional operators into the tensor network. To see an example of this, consider the two even tensors $\M{A} = \sum_{a}A_{a}|a)_p(a|_q$ and $\M{B} = \sum_{b}B_{b}|b)_q(b|_p$. We then aim to compute the tensor network (a scalar) $\text{tr}\left[\M{A}\boldsymbol{{\cdot}} \M{B}\right]$, where the $\boldsymbol{{\cdot}}$ denotes the contraction of the $q$ leg and the trace over the $p$ index is to emphasize that we are contracting the first index with the last index to close the loop. Contracting the basis tensors yields: \begin{align} \text{tr}\left[|a)_p(a|_q \boldsymbol{{\cdot}} |b)_q(b|_p \right] = \delta_{ab} \text{tr}\left[|a)_p (b|_p\right] = (-1)^{|a|}\delta_{ab}. \end{align} The grading of the $q$ vector did not produce a sign, so it can be removed without affecting the tensor network. However, if we try to remove the grading of the $p$ vector as well, the sign $(-1)^{|a|}$ is no longer accounted for. One way to reproduce the sign $(-1)^{|a|}$ is to insert a $Z=\sum_c(-1)^{|c|}|c\rangle \langle c|$ operator on leg $p$ after removing the grading. That is, grading removal gives bosonic tensors $\M{A_b}=\sum_a A_a |a\rangle_p \langle a|_q$ and $\M{B_b}=\sum_b B_b |b \rangle_q \langle b|_p$, which satisfy: \begin{align} \text{tr}\left[\M{A_b}\boldsymbol{{\cdot}} \M{B_b} \boldsymbol{{\cdot}} Z_p\right]= & \sum_{a,b,c}(-1)^{|c|}A_aB_b\text{tr}\left[|a\rangle_p\langle a|_q \boldsymbol{{\cdot}} |b\rangle_q \langle b|_p \boldsymbol{{\cdot}} |c\rangle_p \langle c|_p \right]\nonumber\\ =&\text{tr}\left[\M{A}\boldsymbol{{\cdot}} \M{B}\right] \end{align} When the grading of a virtual index can be accounted for by inserting an additional operator $O$ on un-graded indices, we will say that the grading is ``removable with $O$-insertion''. \subsection{Koszul signs in the bosonized fPEPS} \label{sign in 2D} We now return to the problem of re-writing the bosonized fPEPS as an explicit bPEPS. We will find that, for a particular internal ordering, the grading of the virtual legs in the bosonized fPEPS is removable with $(Z_t\otimes Z_s)^{\eta_e}$-insertion. Here, $Z_t$ is a Pauli $Z$ operator acting in the TNO layer, and $Z_s$ is a Pauli $Z$ operator acting in the state layer. In other words, the state represented by the bosonized fPEPS may be equivalently represented by the bPEPS obtained by removing the grading of the virtual legs (assuming a certain internal ordering) and applying $(Z_t\otimes Z_s)^{\eta_e}$ before contracting the tensors at each edge. To show this, we will compute the Koszul signs explicitly. We will see that the Koszul signs have a nice geometric interpretation in terms of the branching structure of the triangulated manifold. \subsubsection{Simplifying the Koszul sign calculation} {We begin by simplifying the problem. First, $\mathsf{B}_\eta=Z^{\eta_e}\boldsymbol{{\cdot}} \mathsf{B}$ does not contribute to any Koszul signs, since $\mathsf{B}_{\eta}$ can always be contracted with one of its neighboring $\M{M_f}$ or $\M{\bar{M}_f}$ tensors without any change of internal ordering. This is possible due to the even parity of $\mathsf{B}_\eta$ and its simple, two-virtual-leg form $\mathsf{B}_\eta=\sum_{a} (-1)^{a\eta_e}|a)_{e}|a\rangle_{e}(a|_{e}$.} Therefore, the Koszul signs accrued in contracting the tensors $\M{M_f}$, $\M{\bar{M}_f}$, and $\mathsf{B}_\eta$ are equivalent to the Koszul signs from directly contracting the $\M{M_f}$ and $\M{\bar{M}_f}$ tensors without $\mathsf{B}_\eta$. We continue to simplify the calculation of the Koszul signs by reducing $\M{M_f}$ and $\M{\bar{M}_f}$ from two layers of fermionic virtual legs as in Eq.~\eqref{cal:FT} to a single layer of fermionic virtual legs. The first step is to choose the following internal ordering for the tensors $\M{M_f}$ and $\M{\bar{M}_f}$, respectively: \begin{align}\label{ftinorder} \begin{tikzpicture}[Sbase] \ftorder; \end{tikzpicture}\, \begin{tikzpicture}[Sbase] \ftbarorder; \end{tikzpicture}. \end{align} Notice that for outward pointing legs (ket vectors), the state layer index comes before the TNO layer index, while for inward pointing legs (bra vectors), the order is reversed. Letting $|a')_s$ and $|a)_t$ be the state and TNO layer vectors, respectively, then with the ordering in Eq.~\eqref{ftinorder}, we have $(a|_{t}(a'|_{s} \boldsymbol{{\cdot}} |a')_{s}|a)_{t}=1$, and no Koszul sign is produced between $a'$ and $a$. Therefore, we can combine the legs and consider a composite index $(a',a)$ with tensors written in terms of $|a',a)_{st}$ and $(a',a|_{st}$. The Hilbert space of the composite leg corresponds to the Hilbert space of two spinless fermions. This is isomorphic to a single spinless fermion and a spin-1/2 under the isomorphism: \begin{align}\label{spinless} |a',a) \leftrightarrow |a+a') |a\rangle. \end{align} Since the spin-1/2 degree of freedom does not affect the Koszul signs, we may disregard it for the present computation. In summary, we have reduced the calculation of the Koszul signs of the bosonized fPEPS to a calculation of the Koszul signs obtained in the contraction of single layer tensors with internal orderings inherited from Eq.~\eqref{ftinorder} and pictured below: \begin{align}\label{KosT} \begin{tikzpicture}[Sbase,scale=0.8] \coordinate (C) at (-30:{sqrt(3)}) ; \draw[dotted,->-=0.75] (0,0)node[above]{0}--+(0:3)node[above,black]{2}; \draw[dotted,->-=0.75] (0,0)--+(-60:3)node[below,black]{1}; \draw[dotted,-<-=0.75] (0:3)--(-60:3); \draw[red,->-=0.75] (C)--(-60:3/2)node[left,black]{(i)}; \draw[red,->-=0.75] (C)--+(-30:{sqrt(3)/2})node[right,black]{(ii)}; \draw[red,-<-=0.75] (C)--(0:3/2)node[above,black]{(iii)}; \node[Dtriangle] at (C) {$ $}; \end{tikzpicture} , \, \begin{tikzpicture}[Sbase,scale=0.8] \coordinate (C) at (30:{sqrt(3)}) ; \draw[dotted,->-=0.75] (0,0)node[below]{0}--+(0:3)node[below,black]{2}; \draw[dotted,->-=0.75] (0,0)--+(60:3)node[above,black]{1}; \draw[dotted,-<-=0.75] (0:3)--(60:3); \draw[red,-<-=0.75] (C)--(60:3/2)node[left,black]{(iii)}; \draw[red,-<-=0.75] (C)--+(30:{sqrt(3)/2})node[right,black]{(ii)}; \draw[red,->-=0.75] (C)--(0:3/2)node[below,black]{(i)}; \node[Utriangle] at (C) {$ $}; \end{tikzpicture}. \end{align} In Eq.~\eqref{KosT}, we have again used triangular nodes, but these tensors should not be confused with the four legged $\M{F}$ and $\M{\bar F}$ tensors. It should be noted that similar simplifications can be performed for the contraction (inner product) of any two fPEPS (built from fermion parity even local tensors). Consequently, the calculation of the Koszul signs below holds more generally than the application at hand -- turning a bosonized fPEPS into a bPEPS. \subsubsection{Contraction of basis tensors} As mentioned in section \ref{subsub:koszul signs}, the contraction of tensors can be performed in two steps: (i) the basis tensors are contracted, and (ii) the components are calculated. The Koszul signs arise only in the first step. Therefore, to calculate the Koszul signs, we focus on the contraction of basis tensors with the ordering in Eq.~\eqref{KosT}. We denote the set of basis tensors at a positively oriented face $f$ as $\mathcal{Q}[f]$ and the set of basis tensors at a negatively oriented face $f$ as $\mathcal{\bar Q}[f]$. Explicitly, we have: \begin{align}\label{basisset} \mathcal{Q}[f]= & \lbrace |a+b)_{f_{01}}|a)_{f_{12}}(b|_{f_{02}},\, a,b=0,1\rbrace \nonumber\\ \mathcal{\bar Q}[f] =& \lbrace |b)_{f_{02}}(a|_{f_{12}}(a+b|_{f_{01}},\, a,b=0,1\rbrace. \end{align} Note that the tensors in $\mathcal{Q}[f]$ and $\mathcal{\bar Q}[f]$ are fermion parity even by construction. $\M{M_f}$ and $\M{\bar{M}_f}$ are fermion parity even, so their component value for any fermion parity odd basis tensor is necessarily zero. Thus, we can disregard fermion parity odd basis tensors in computing the Koszul signs. We now analyze the contraction of basis tensors in Eq.~\eqref{basisset}. For each triangle, we have an independently chosen element of either $\mathcal{Q}[f]$ or $\mathcal{\bar Q}[f]$ (depending on the orientation of $f$). The resulting product of basis tensors evaluates to $0$, $-1$, or $1$. If an odd vector $|1)$ is paired with an even vector $|0)$ at any edge, then the product is $0$. (This is simply the statement that $(0|1)=(1|0)=0$.) Thus, the configurations of basis tensors that evaluate to a nonzero value must have odd legs paired at edges. Since the elements of $\mathcal{Q}[f]$ and $\mathcal{\bar Q}[f]$ have even fermion parity (an even number of odd legs), this implies that the odd legs form closed loops (on the dual lattice) for any configuration that gives a nonzero value. The computation of the Koszul signs then distills down to calculating the $\pm 1$ valued contraction of configurations with closed loops of $|1)$ states at edges. To formalize the problem, we define $g_e$ as the $\{0,1\}$ valued index at the edge $e$, and $\hat{\sigma}( \lbrace g_e \rbrace)= \pm 1$ as the sign obtained by evaluating the tensor {{contractions}} corresponding to the configuration $\{ g_e \}$. \subsubsection{Basis contraction and cohomology} \begin{figure} \centering \begin{tikzpicture}[Sbase, scale=0.8] \randt; \draw[blue,->-=0.5](1.5,1.75 ) circle (1); \end{tikzpicture} \begin{tikzpicture}[Sbase, scale=0.8] \randt; \draw[blue,->-=0.75,thin] (0,0.5)--+(4,0)node[right]{$L^x$}; \end{tikzpicture} \begin{tikzpicture}[Sbase,scale=0.8] \randt; \draw[blue,->-=0.75,thin] (2.5,0)--+(0,4)node[above]{$L^y$}; \end{tikzpicture} \begin{tikzpicture}[Sbase, scale=0.8] \randt; \draw[blue,->-=0.75,thin] (0,0.5)--++(1.5,0) to[out=0,in=-90] (2.5,4)node[above]{$L^x+L^y$}; \draw[blue,->-=0.75,thin] (2.5,0)to[out=90,in=0](4,.5); \end{tikzpicture} \caption{Examples of $1$-cochains. Edges intersected by the blue line have coefficient $g_e=1$, while all other edges have $g_e=0$. The top left picture is an example of a contractible $1$-cocycle. The other three pictures are representative $1$-cocycles of the three non-trivial classes.} \label{fig:homoexample} \end{figure} To make our arguments precise, we find it convenient to describe configurations of odd edges using the language of cohomology. To this end, we define a $0$\textit{-cochain} as a sum $\sum_v g_v \mathbf{v}$, where $\mathbf{v}$ is a $\mathbb{Z}_2$-valued function of vertices such that $\mathbf{v}$ evaluates to $1$ on the vertex $v$ and $0$ otherwise, and $g_v$ are coefficients in $\mathbb{Z}_2$. Similarly, \textit{$1$-cochains} and \textit{$2$-cochains} may be defined as sums $\sum_{e} g_e \mathbf{e}$ and $\sum_f g_f \mathbf{f}$, respectively. A configuration of odd edges $\{g_e\}$ then naturally corresponds to the $1$-cochain $\sum_{e} g_e \mathbf{e}$. Furthermore, $j$-cochains can be added by combining the coefficients component wise, i.e., ${\sum_{e} g_e \mathbf{e}+\sum_{e} g'_e \mathbf{e}=\sum_{e} (g_e+g'_e) \mathbf{e}}$. The \textit{coboundary operator} $\delta$ from $j$-cochains to $j+1$-cochains is defined by: \begin{align} \delta \mathbf{v} = & \sum_{e \supset v} \mathbf{e}, \quad \quad \delta \mathbf{e} = \sum_{f \supset e} \mathbf{f}, \end{align} where the sum on the left is over all edges sharing the vertex $v$ and the sum on the right is over the two faces bordering the edge $e$. For example, in Fig.~\ref{fig:homoexample}: \begin{align} \delta \boldsymbol{\langle} \mathbf{4}\boldsymbol{\rangle} = & \boldsymbol{\langle} \mathbf{2,4} \boldsymbol{\rangle} +\boldsymbol{\langle} \mathbf{3,4} \boldsymbol{\rangle}+ \boldsymbol{\langle} \mathbf{4,5} \boldsymbol{\rangle} +\boldsymbol{\langle} \mathbf{4,7} \boldsymbol{\rangle} \nonumber\\ \delta \boldsymbol{\langle} \mathbf{4,7}\boldsymbol{\rangle}= & \boldsymbol{\langle} \mathbf{2,4,7}\boldsymbol{\rangle}+\boldsymbol{\langle} \mathbf{4,5,7}\boldsymbol{\rangle} \end{align} We call a cochain $C$ \textit{closed} if $\delta C=0$. Note that each of the $1$-cochains depicted in Fig.~\ref{fig:homoexample}, for example, are closed. More generally, a closed $1$-cochain, or $1$-cocycle, can be thought of as a sum of loops along the dual lattice. As such, the configurations $\{g_e\}$, obtained from basis contraction, are examples of $1$-cocycles. A $1$-cochain $C$ is called a \textit{$1$-coboundary} if there exists a $0$-cochain $R$ such that $C=\delta R$. $\delta$ can be understood as a boundary operator on the dual lattice, so intuitively, a $1$-coboundary is a boundary of a region on the dual lattice. For example, the top left picture of Fig.~\ref{fig:homoexample} depicts a $1$-coboundary -- it is equal to $\delta R$ for $R= \boldsymbol{\langle} \mathbf{7} \boldsymbol{\rangle} +\boldsymbol{\langle}\mathbf{4} \boldsymbol{\rangle}$. In general, $1$-coboundaries are sums of contractible loops, which are generated by small loops $L_v \equiv \delta \mathbf{v}$ enclosing a single vertex. A configuration $L$ with a single, contractible loop is a $1$-coboundary of a $0$-cochain $R$ containing vertices enclosed by the loop, i.e., $L=\sum_{v \in L}L_{v}$ with the sum being over vertices $v$ enclosed by $L$. Some loops of odd edges such as the $1$-cocycles $L^x$, $L^y$, and $L^x+L^y$ in Fig.~\ref{fig:homoexample}, are \textit{non-contractible}. These are $1$-cocycles that cannot be written as $\delta R$ for any $0$-cochain $R$. We can further define an equivalence of $1$-cocycles where $C_1 \sim C_2$ if there exists a $0$-cochain $R$ such that $C_1 = C_2 + \delta R$. In other words, two $1$-cocycles are equivalent if one can be constructed from the other by appending, or adding contractible loops. Hence, all $1$-coboundaries belong to the same equivalence class -- the class of trivial $1$-cocycles. For a torus, it is well known that there are four inequivalent classes of $1$-cocycles. These may be represented by $L^x$, $L^y$, $L^x+L^y$, and $\delta R$ for a $0$-cochain $R$. Therefore, an arbitrary $1$-cocycle on a torus can be expressed as: \begin{align}\label{Cdecomposition} C= g_{x}L^x +g_{y}L^y+\sum_v g_v L_v, \end{align} for some choice of $g_{x},g_{y},g_v \in \mathbb{Z}_2$. \subsubsection{Koszul signs from a single loop} Given that a $1$-cocycle can be decomposed in terms of constituent loops, as in Eq.~\eqref{Cdecomposition}, we begin by calculating the Koszul sign $\hat{\sigma}(L)$ for configurations $L$ with a single loop of odd edges along the path $L$ in the dual lattice. To propose an exact value for $\hat{\sigma}(L)$, we introduce the following notation. We assign a direction to the path $L$ so that, with respect to a global orientation of the 2D manifold, the loop has a ``left side'' and a ``right side''.\footnote{More formally, let $v_1$ be the unit tangent vector along $L$, in the direction of $L$. Then we say that the unit normal vector $v_2$ points to the ``left'' side of $L$ if $v_1 \wedge v_2$ is equal to the orientation of the underlying $2$D manifold. } $L$ overlaps with a triangle $f$ at two edges, and we call the common vertex of these two edges $f_L$. There are six possibilities for $f_L$: it can be a 0-, 1-, or 2-vertex of the triangle $f$, and it can lie to the left or to the right of the loop. We let $\bar{l}_L$ and $\bar{r}_L$ be the sets of $f_L$ for which $f_L$ is a 1-vertex of $f$ and is to the left or right of $L$, respectively. We use $n(\bar{l}_L)$ and $n(\bar{r}_L)$ to denote the cardinality of $\bar{l}_L$ and $\bar{r}_L$. Then we have: \begin{myprop}\label{prop:sigmaC} \begin{align}\label{sigmaC} \hat{\sigma}(L) = - (-1)^{\frac{1}{2}\boldsymbol{(}n(\bar{l}_L)-n(\bar{r}_L)\boldsymbol{)}}. \end{align} \end{myprop} \begin{proof} See Appendix \ref{app:proofofprop1}. \end{proof} \subsubsection{Winding number and Koszul signs} \label{subsub: winding} \begin{figure} \centering \begin{tikzpicture}[Sbase] \interpos; \end{tikzpicture} \begin{tikzpicture}[Sbase] \interneg; \end{tikzpicture} \caption{The branching structure is interpolated into the interior of each triangle to form the continuous, non-vanishing vector field $\mathcal{V}$.} \label{fig:interpolation} \end{figure} $\hat{\sigma}(L)$ is closely related to the winding number of a certain vector field along the oriented path $L$. In particular, $\hat{\sigma}(L)$ can be computed from the continuous, non-vanishing vector field $\mathcal{V}$ obtained from the branching structure by interpolating it into the interior of the triangles, as shown in Fig.~\ref{fig:interpolation} (see Ref. [\onlinecite{Gaiotto16}]). To calculate the winding number of $\mathcal{V}$ along $L$ we define $\hat n$ to be the left pointing unit normal vector of the loop $L$ and $\hat v$ to be the local vector of $\mathcal{V}$. Then, we integrate the {{derivate of the}} angle $\theta=\cos^{-1}(\hat v\cdot\hat n)$ between $\hat n$ and $\hat v$ along $L$. Given that $\theta$ is continuous, the change in $\theta$ around $L$ must be $2 \pi m$, where $m$ is an integer. $m$ gives the winding number of $\mathcal{V}$ along $L$, which we denote as $w(L)$.\footnote{Note that the definition of winding number here is the winding number of the vector field relative to the normal vector of the loop $L$. We emphasize that this differs by a sign from a notion of the winding number of a vector field sometimes used in physics.} For definiteness, we choose clockwise rotation to be positive. \begin{myprop}\label{prop:wc} \begin{align} w(L)=\frac{1}{2}\boldsymbol{(}n(\bar{l}_L)-n(\bar{r}_L)\boldsymbol{)}. \end{align} Equivalently, \begin{align} \hat{\sigma}(L) = -(-1)^{w(L)}. \end{align} \end{myprop} \begin{proof} We consider the ways in which $L$ can pass through triangles and in each case, identify the change in $\theta=\cos^{-1}(\hat v \cdot \hat n)$. When $f_L$ is a $0$- or $2$-vertex, the total change in $\theta$ is $0$. This is illustrated in the following example, where $f_L$ is a $2$-vertex: \begin{align} \begin{tikzpicture}[Sbase] \interpos; \draw[blue,-<-=0.75](3/2,-{sqrt(3)/2})--++(90:{sqrt(3)}); \draw[blue,->-=0.75](3/2,-{sqrt(3)/2})--++(-30:{sqrt(3)}); \draw[blue,->-=0.75](3/2,0.5)--++(0.35,0)node[right]{$\hat n$}; \draw[blue,->-=0.75](3/2,-{sqrt(3)/2})++(-30:1.2)--++(60:0.35)node[right]{$\hat n$}; \end{tikzpicture}. \end{align} The change in $\theta$ through the triangle above is 0, since the vector field is nearly parallel to $\hat n$ along the path. A similar argument applies whenever $f_L$ is a $0$- or $2$-vertex. Thus, the only crossings that can contribute to the winding number are when $f_L$ is a $1$-vertex. We first examine the case where $f_L$ is a $1$-vertex to the left of $L$, i.e., $f_L\in \bar{l}_L$. There are two such crossings: \begin{align} \begin{tikzpicture}[Sbase,scale=1] \interneg; \draw[blue,-<-=0.9](3/2,{sqrt(3)/2})--++(150:{sqrt(3)}); \draw[blue,->-=0.9](3/2,{sqrt(3)/2})--++(30:{sqrt(3)}); \draw[blue,->-=0.9](3/2,{sqrt(3)/2})++(150:1.2)--++(60:0.35); \draw[blue,->-=0.9](3/2,{sqrt(3)/2})++(30:1.2)--++(120:0.35); \end{tikzpicture} \hspace{1cm} \begin{tikzpicture}[Sbase,scale=1] \interpos; \draw[blue,->-=0.9](3/2,-{sqrt(3)/2})--++(210:{sqrt(3)}); \draw[blue,-<-=0.9](3/2,-{sqrt(3)/2})--++(-30:{sqrt(3)}); \draw[blue,->-=0.9](3/2,-{sqrt(3)/2})++(210:1.2)--++(300:0.35); \draw[blue,->-=0.9](3/2,-{sqrt(3)/2})++(-30:1.2)--++(-120:0.35); \end{tikzpicture}. \end{align} (Note the triangle on the left is negatively oriented while the triangle on the right is positively oriented.) For both crossings, moving along $L$, the vector field rotates clockwise relative to $\hat n$, and $\theta$ changes by $+\pi$. If instead, $f_L$ is to the right of $L$ then the corresponding crossings are: \begin{align} \begin{tikzpicture}[Sbase,scale=1] \interpos; \draw[blue,-<-=0.9](3/2,-{sqrt(3)/2})--++(210:{sqrt(3)}); \draw[blue,->-=0.9](3/2,-{sqrt(3)/2})--++(-30:{sqrt(3)}); \draw[blue,->-=0.9](3/2,-{sqrt(3)/2})++(210:1.2)--++(120:0.35); \draw[blue,->-=0.9](3/2,-{sqrt(3)/2})++(-30:1.2)--++(60:0.35); \end{tikzpicture} \hspace{1cm} \begin{tikzpicture}[Sbase,scale=1] \interneg; \draw[blue,->-=0.9](3/2,{sqrt(3)/2})--++(150:{sqrt(3)}); \draw[blue,-<-=0.9](3/2,{sqrt(3)/2})--++(30:{sqrt(3)}); \draw[blue,->-=0.9](3/2,{sqrt(3)/2})++(150:1.2)--++(240:0.35); \draw[blue,->-=0.9](3/2,{sqrt(3)/2})++(30:1.2)--++(-60:0.35); \end{tikzpicture}. \end{align} We see that, in this case, the vector field winds counterclockwise along $L$, and $\theta$ changes by $-\pi$. In conclusion, whenever $f_L$ belongs to $\bar{l}_L$, $\theta$ changes by $\pi$, and when $f_L$ is in $\bar{r}_L$, $\theta$ changes by $-\pi$. Accordingly, the winding number along $L$, with respect to $\hat n$, is: \begin{align} w(L)=\sum_{f_L} \left(\frac{1}{2} \delta_{f_L\in \bar{l}_L} -\frac{1}{2} \delta_{f_L\in \bar{r}_L}\right)= \frac{1}{2}\boldsymbol{(}n(\bar{l}_L)-n(\bar{r}_L)\boldsymbol{)}, \end{align} {where $\delta_{f_L\in \bar{l}_L}$ and $\frac{1}{2} \delta_{f_L\in \bar{r}_L}$ are indicator functions for the sets $\bar{l}_L$ and $\bar{r}_L$, respectively.} \end{proof} {In Refs. [\onlinecite{Cimasoni07},\onlinecite{Gaiotto16}], it is argued that a function on loops of the form $-(-1)^{w(L)}$, such as $\hat \sigma(L)$, gives a \textit{quadratic refinement of the intersection pairing}. This is to say that, as a consequence of Prop.~\ref{prop:wc}, $\hat \sigma$ satisfies: \begin{align}\label{quadraticrefinement} \hat \sigma(L_1+L_2)=(-1)^{\langle L_1, L_2 \rangle}\hat \sigma(L_1) \hat \sigma(L_2), \end{align} where $\langle L_1,L_2 \rangle$ is the intersection number ($\text{mod } 2$) of $L_1$ and $L_2$. For example, the non-contractible cycles $L^x$ and $L^y$ on a torus in Fig.~\ref{fig:homoexample} have an intersection number $\langle L^x, L^y \rangle = 1 \text{ mod }2$. Therefore, by Eq.~\eqref{quadraticrefinement}, we have: $\hat \sigma(L^x+L^y)=-\hat \sigma(L^x) \hat \sigma(L^y)$. } {Importantly, Eq.~\eqref{quadraticrefinement} allows us to relate the sign $\hat \sigma(C)$ for a general configuration $C=\sum_i L_i$ to the signs $\hat \sigma(L_i)$ of constituent loops. For a single contractible loop $L$, which can be decomposed into a sum of loops $L=\sum_{v \in L}L_{v}$, the sign $\hat \sigma(L)$ can be written as [using Eq.~\eqref{quadraticrefinement}]: \begin{align}\label{Lcontractiblesingvert} \hat \sigma(L)=\prod_{v \in L}\hat \sigma(L_{v}). \end{align} The product in Eq.~\eqref{Lcontractiblesingvert} is over vertices enclosed by the loop $L$.} {We call a vertex $v$ \textit{singular} if the loop $L_v$, enclosing only $v$, is such that $\hat \sigma(L_v)=-1$. Referring to Eq.~\eqref{Lcontractiblesingvert}, the sign $\hat \sigma(L)$ for a contractible loop $L$ can be computed by simply counting the singular vertices enclosed by $L$. Explicitly, $\hat \sigma(L)$ for a contractible loop $L$ is: \begin{align}\label{sigmasv} \hat \sigma(L)=(-1)^{n_{sv}(L)}, \end{align} where $n_{sv}(L)$ is the number of singular vertices enclosed by the loop $L$. This is a manifestation of Stokes' theorem for the winding number of the vector field along $L$. We note that, using Prop.~\ref{prop:sigmaC}, a vertex $v$ is singular if it is the $1$-vertex of $4m$ triangles, for an integer $m$. Alternatively, using Prop.~\ref{prop:wc}, $v$ is singular if $-(-1)^{w(L_v)}=-1$.} \subsection{{Removing grading and choosing spin-structure}} \label{subsec: choosing SS} {The function $\hat \sigma$ captures the Koszul signs accrued in the contraction of the fermionic virtual legs of the bosonized fPEPS. The goal of this section is to replace the $\mathbb{Z}_2$-graded virtual legs of the bosonized fPEPS with un-graded legs and simulate the Koszul signs given by $\hat \sigma$ by inserting Pauli $Z$ operators on certain bosonic virtual legs.} {More specifically, we first convert the fermionic virtual legs to bosonic virtual legs, i.e., with the internal ordering fixed, we map a fermion parity even state $|0)$ to an up spin $|0\rangle$ (in the $Z$ basis) and a fermion parity odd state $|1)$ to a down spin $|1\rangle$. The bosonic virtual legs fail to replicate the Koszul signs that were obtained by contracting the fermionic virtual legs. Thus, second, we fix this by choosing a set of edges $\eta$ (a choice of spin-structure) and including an extra $Z$ operator on edges $e \in \eta$ before contraction. When down spins $|1\rangle$ contract on an edge $e \in \eta$, the extra Pauli $Z$ operator results in a sign $-1$. We need to choose $\eta$ so that the contraction of a configuration $C$ of loops of down spins $|1\rangle$ yields the sign $\hat \sigma(C)$.} {We begin by accounting for the Koszul signs $\hat \sigma(L)$ accrued by contractible loops $L$. Next, we discuss a matrix product operator (MPO) which captures the Koszul signs from non-contractible loops. We focus on the case when the manifold is a torus and only outline the procedure for more general 2D manifolds.} \subsubsection{{Reproducing Koszul signs for contractible loops}}\label{contractibleloops} \begin{figure} \centering \begin{tikzpicture}[Sbase,scale=0.8] \randt; \path[](3)--node[]{$Z$}(4)--node[]{$Z$}(7); \path[](8)--node[]{$Z$}(10); \node at (2,-0.3) {(a)}; \end{tikzpicture} \begin{tikzpicture}[Sbase,scale=0.8] \randt; \path[](7)--node[]{$Z$}(8); \path[](3)--node[]{$Z$}(4)--node[]{$Z$}(2); \node at (2,-0.3) {(b)}; \end{tikzpicture} \caption{An arbitrary triangulation of a torus with the four singular vertices: $\langle 3 \rangle$, $\langle 7 \rangle$, $\langle 5=8 \rangle$, $\langle 2=10 \rangle$, $\langle 2 = 11 \rangle$. (a) $Z$-operators placed at edges corresponding to the spin-structure ${\eta = \lbrace \langle 3,4\rangle,\langle 4,7 \rangle,\langle 8,10 \rangle \rbrace}$. (b) $Z$-operators placed at edges for an alternative choice of spin-structure ${\eta = \lbrace \langle 3,4\rangle,\langle 4,2 \rangle,\langle 7,8 \rangle \rbrace}$. } \label{fig:spinstructureexample} \end{figure} {Our strategy for accounting for $\hat \sigma(L)$, when $L$ is a contractible loop is to `pair-up' the singular vertices and construct the set $\eta$ from edges that connect the two singular vertices in each pair. More precisely, Stokes' theorem guarantees an even number of singular vertices on a closed manifold, so we can always find a set of edges $\eta$ such that the boundary of $\eta$ gives the set of singular vertices. Here, the boundary of $\eta$ is defined as the set of vertices that are endpoints of an odd number of edges in $\eta$. Intuitively, $\eta$ can then be understood as `pairing-up' singular vertices with each other through arbitrary paths. Fig.~\ref{fig:spinstructureexample} provides an example of choosing $\eta$ on a torus.} {To replicate the sign $\hat \sigma(L)$, we insert $Z$ operators on all edges in $\eta$ (see Fig.~\ref{fig:spinstructureexample}). Now, in evaluating a configuration with a single loop $L$ of down spins $|1\rangle$, we incur the sign: \begin{align} \label{sigmaeta} \sigma_\eta(L) \equiv (-1)^{n(L,\eta)}, \end{align} where $n(L,\eta)$ denotes the number of common edges (or crossings) between the loop $L$ and the edges in $\eta$. Given our construction of $\eta$, $n(L,\eta)$ is equal ($\text{mod }2$) to the number of singular vertices enclosed in $L$. Therefore, for any contractible loop $L$: \begin{align} \label{sigmaeta2} \sigma_\eta(L)=(-1)^{n_{sv}(L)}, \end{align} in agreement with Eq.~\eqref{sigmasv}. Consequently, for any $1$-cocycle $C$ and $0$-cochain $R$, we have: \begin{align}\label{trivialquadratic} \sigma_\eta(C+\delta R)=\sigma_\eta(C)\sigma_\eta(\delta R)=\sigma_\eta(C)\prod_{v \subset R}\sigma_\eta(L_v). \end{align} The product $\prod_{v \subset R}$ is over all vertices such that the coefficient of $\mathbf{v}$ in $R$ is nontrivial. } {We note that a choice of $\eta$ can be modified by including any set of edges forming a contractible loop. We call two sets $\eta$ and $\eta'$ equivalent spin-structures, if one can be obtained from the other by appending contractible loops of edges.} \subsubsection{{Reproducing Koszul signs for non-contractible loops}} {$\sigma_\eta(C)$ simulates $\hat \sigma(C)$ for trivial $1$-cocycles $C$. This is sufficient to account for Koszul signs when the fermionic system is defined on a sphere or an infinite plane. However, $\sigma_\eta(C)$ does not capture the sign $\hat \sigma(C)$ when $C$ is a non-trivial $1$-cocycle. To account for the Koszul signs on a torus or higher genus manifolds, we insert MPOs along non-contractible loops to perform a certain sum over inequivalent spin-structures. In the following, we describe the case of a torus in detail and only sketch the generalization to higher genus manifolds.} {To start, we consider a particular triangulation of a torus without any singular vertices, as shown in Fig.~\ref{fig:triangulartorus}(a-c). Since there are no singular vertices, $\hat \sigma(L)=1$ for any contractible loop $L$. For non-contractible loops, however, the Koszul signs are non-trivial. To see this, we let $L^x$ and $L^y$ be distinct non-contractible loops lying parallel to the $x$-axis and $y$-axis, respectively. The specific choices of $L^x$ and $L^y$ do not matter, because contractible loops can freely be appended without changing $\hat \sigma(L^x)$ and $\hat \sigma(L^y)$. This follows from Eq.~\eqref{quadraticrefinement} and the fact that there are no singular vertices. Now, using either Prop.~\ref{prop:sigmaC} or Prop.~\ref{prop:wc}, one finds: \begin{align}\label{noncontractguwen} \hat \sigma(L^x)=\hat \sigma(L^y)=\hat \sigma(L^x+L^y)=-1. \end{align}} {Hence, after converting the $\mathbb{Z}_2$-graded virtual legs to bosonic virtual legs, a modification is necessary to simulate the sign in Eq.~\eqref{noncontractguwen}. A possible solution is to insert Pauli $Z$ operators along non-contractible loops. Naively, we can insert $Z$ operators along only the $x$-axis [Fig.~\ref{fig:triangulartorus}(a)], only the $y$-axis [Fig.~\ref{fig:triangulartorus}(b)], or both the $x$-axis and the $y$-axis [Fig.~\ref{fig:triangulartorus}(c)]. We find that all of these options fail to reproduce the sign in Eq.~\eqref{noncontractguwen}. The solution is a certain superposition of these options, which can be expressed using an MPO. Before describing this MPO, we develop some notation and discuss the effects of inserting $Z$ operators along the axes.} {First, we define the spin-structure $\eta^x$, which contains the edges along the $x$-axis. The product of $Z$ operators applied along the edges in $\eta^x$ can be expressed as $\prod_e Z_e^{\eta^x}$, where, in this expression, $\eta^x$ is the indicator function for the set $\eta^x$. The operator $\prod_e Z_e^{\eta^x}$ is pictured in Fig.~\ref{fig:triangulartorus}(a). Then, letting $\sigma_{\eta^x}(L)$ be the sign obtained in contracting a configuration of down spins along $L$ with the added operator $\prod_e Z_e^{\eta^x}$, we have: \begin{align}\label{sigmax} \sigma_{\eta^x}(L^x)=1,\quad \sigma_{\eta^x}(L^y)=-1, \quad \sigma_{\eta^x}(L^x+L^y)=-1. \end{align}} \begin{figure} \centering \begin{minipage}{0.3\linewidth} \begin{tikzpicture}[Sbase,scale=1] \foreach \j in {0,1,2} {\draw[dotted,OES={AR1=0.75}](0,\j)--(1,\j)--(2,\j); \draw[dotted,OES={AR1=0.75}](\j,0)--(\j,1)--(\j,2); } \foreach \j in {(0,0),(0,1),(1,0),(1,1)} {\draw[dotted,OES={AR1=0.75}] \j --++(45:{sqrt(2)}); } \path (0.5,0)node{$Z$}(1.5,0)node{$Z$}; \node at (1,-0.5) {$\prod_e Z^{\eta^x}$}; \node at (1,-1) {(a)}; \end{tikzpicture} \end{minipage} \begin{minipage}{0.3\linewidth} \begin{tikzpicture}[Sbase,scale=1] \foreach \j in {0,1,2} {\draw[dotted,OES={AR1=0.75}](0,\j)--(1,\j)--(2,\j); \draw[dotted,OES={AR1=0.75}](\j,0)--(\j,1)--(\j,2); } \foreach \j in {(0,0),(0,1),(1,0),(1,1)} {\draw[dotted,OES={AR1=0.75}] \j --++(45:{sqrt(2)}); } \path (0,0.5)node{$Z$}(0,1.5)node{$Z$}; \node at (1,-1) {(b)}; \node at (1,-0.5) {$\prod_e Z^{\eta^y}$}; \end{tikzpicture} \end{minipage} \begin{minipage}{0.3\linewidth} \begin{tikzpicture}[Sbase, scale=1] \foreach \j in {0,1,2} {\draw[dotted,OES={AR1=0.75}](0,\j)--(1,\j)--(2,\j); \draw[dotted,OES={AR1=0.75}](\j,0)--(\j,1)--(\j,2); } \foreach \j in {(0,0),(0,1),(1,0),(1,1)} {\draw[dotted,OES={AR1=0.75}] \j --++(45:{sqrt(2)}); } \path (0.5,0)node{$Z$}(1.5,0)node{$Z$}; \path (0,0.5)node{$Z$}(0,1.5)node{$Z$}; \node at (1,-1) {(c)}; \node at (1,-0.5) {$\prod_e Z^{\eta^{xy}}$}; \end{tikzpicture} \end{minipage} \caption{Triangulation of a torus without any singular vertices, but with $Z$-operators placed along (a) the $x$-axis (b) the $y$-axis (c) both the $x$-axis and the $y$-axis.} \label{fig:triangulartorus} \end{figure} {Next, we define the spin-structures $\eta^y$ and $\eta^{xy}$ similarly. $\eta^y$ is the set of edges along the $y$-axis and corresponds to the insertion of the operator $\prod_e Z_e^{\eta^y}$, depicted in Fig.~\ref{fig:triangulartorus}(b). In this case, the sign accrued in contracting the bosonic legs is: \begin{align}\label{sigmay} \sigma_{\eta^y}(L^x)=-1,\quad \sigma_{\eta^y}(L^y)=1, \quad \sigma_{\eta^y}(L^x+L^y)=-1. \end{align} If we instead insert $Z$ operators along both the $x$-axis and $y$-axis, as in Fig.~\ref{fig:triangulartorus}(c), and define $\eta^{xy}$ as the union of $\eta^x$ and $\eta^y$, we obtain the signs: \begin{align}\label{sigmaxy} \sigma_{\eta^{xy}}(L^x)=-1,\quad \sigma_{\eta^{xy}}(L^y)=-1, \quad \sigma_{\eta^{xy}}(L^x+L^y)=1. \end{align}} {In each case above [Eqs.~\eqref{sigmax}-\eqref{sigmaxy}], the operator insertion fails to replicate the sign in Eq.~\eqref{noncontractguwen}. However, the sign in Eq.~\eqref{noncontractguwen} can be simulated using the following superposition of operators: \begin{align}\label{MPOtargetoperator} \frac{1}{2}\left( -1+\prod_{e}Z_e^{\eta^x}+\prod_{e}Z_e^{\eta^y}+\prod_eZ_e^{\eta^{xy}} \right). \end{align} Explicitly, the sign obtained in contracting an arbitrary loop of down spins $L$ is then: \begin{align}\label{superpositionofsigns1} \frac{1}{2}\boldsymbol{(}-1+\sigma_{\eta^x}(L)+\sigma_{\eta^y}(L)+\sigma_{\eta^{xy}}(L)\boldsymbol{)}. \end{align} One can check that, for loops $L^x$, $L^y$, and $L^x+L^y$, the sign given by Eq.~\eqref{superpositionofsigns1} matches the sign in Eq.~\eqref{noncontractguwen}. Furthermore, the sign in Eq.~\eqref{superpositionofsigns1} agrees with $\hat \sigma$ on all loops.} \begin{figure} \centering \begin{tikzpicture}[Sbase,scale=1.5] \foreach \j in {0,1,2; \draw[](0,2)--(0,0)--(2,0); \draw[] (-0.25,1.5)--node[Sq={0},scale=0.7]{}++(0.5,0);\draw[] (-0.25,.5)--node[Sq={0},scale=0.7]{}++(0.5,0); \draw[] (1.5,-0.25)--node[Sq={0},scale=0.7]{}++(0,.5);\draw[] (.5,-0.25)--node[Sq={0},scale=0.7]{}++(0,.5); \node[Bcir,scale=1] at (0,0){};\node[Bcir,scale=1] at (0,0){$\M{G}$}; \end{tikzpicture} \caption{Triangulation of a torus without any singular vertices, and with the MPOs generated by $\M{W}$ (square nodes) and $\M{G}$ (circular nodes). The MPOs generated by $\M{W}$ wrap around both the $x$-axis and the $y$-axis and the $\M{G}$ tensor is placed at their intersection. } \label{fig:insertmpo} \end{figure} {The operator in Eq.~\eqref{MPOtargetoperator} can be represented using MPOs. We start by considering an MPO of the form: \begin{align} \begin{tikzpicture}[Sbase] \draw[](0,0)--(6,0);\draw[loosely dotted](-0.5,0)--(0,0); \draw[loosely dotted](6,0)--+(0.5,0); \foreach \j in {1,3,5} { \draw[](\j,0)++(0,-0.5)--++(0,1); \node[Sq={0},scale=0.9] at (\j,0){$\M{W}$} ; } \end{tikzpicture}, \end{align} generated by the local tensors $\M{W}$, given by: \begin{align}\label{Wtensor} \begin{tikzpicture}[Sbase,scale=0.6] \draw[](-1,0)node[below]{$p$}--++(2,0)node[below]{$q$};\draw[](0,-1)node[below]{$r$}--++(0,2)node[above]{$s$};\node[Sq={0},scale=1] {$\M{W}$}; \end{tikzpicture}=&\sum_{a,b}(-1)^{(a)(b)} |a\rangle_p|b\rangle_r \langle b|_s\langle a|_q \nonumber\\ = & |0\rangle I \langle 0|+ |1\rangle Z \langle 1|. \end{align} When the virtual (horizontal) legs take value $0$, $W$ acts as the identity, and when they take value $1$, $W$ acts as a $Z$ operator. Therefore, $\M{W}$ generates a {{controlled $Z$}} operator of the form $\ldots III\ldots + \ldots ZZZ\ldots $.} {If we insert this MPO on the virtual level of the bosonic tensor network, say, along the $x$-axis, it is equivalent to inserting the operator $1+\prod_eZ_e^{\eta^x}$. Similarly, inserting it along the $y$-axis is equal to the operator $1+\prod_eZ_e^{\eta^y}$. If we insert the MPO along both the $x$-axis and the $y$-axis they cross as a single vertex, and we link the MPOs together at their intersection using another tensor $\M{G}$ (see Fig.~\ref{fig:insertmpo}). We take $\M{G}$ to be: \begin{align}\label{Lwtensor} \begin{tikzpicture}[Sbase,scale=0.6] \draw[](-1,0)node[below]{$p$}--++(2,0)node[below]{$q$};\draw[](0,-1)node[below]{$r$}--++(0,2)node[above]{$s$};\node[Bcir,scale=1] {$\M{G}$}; \end{tikzpicture}=&\frac{1}{2}\sum_{a,b}(-1)^{(a+1)(b+1)} |a\rangle_p|b\rangle_r \langle b|_s\langle a|_q\nonumber\\ =&-\frac{1}{2}|0\rangle_p|0\rangle_r \langle 0|_s\langle 0|_q+\frac{1}{2}|0\rangle_p|1\rangle_r \langle 1|_s\langle 0|_q \nonumber\\ &+\frac{1}{2}|1\rangle_p|0\rangle_r \langle 0|_s\langle 1|_q+\frac{1}{2}|1\rangle_p|1\rangle_r \langle 1|_s\langle 1|_q. \end{align} Now, when virtual legs of the MPOs in both the $x$ and $y$ direction take value $0$, $\M{G}$ is $-\frac{1}{2}$, and otherwise it is $\frac{1}{2}$. Thus, the total MPO produces the superposition of operators: \begin{align} \frac{1}{2}\left( -1+\prod_{e}Z_e^{\eta^x}+\prod_{e}Z_e^{\eta^y}+\prod_eZ_e^{\eta^{x}} \prod_eZ_e^{\eta^{y}}\right). \end{align} Recalling that $\eta^{xy}$ is the union of $\eta^x$ and $\eta^y$, we see that the operator above is equivalent to the operator in Eq.~\eqref{MPOtargetoperator}. The Koszul signs, therefore, can be accounted for using the MPO generated by $\M{W}$ and $\M{G}$, pictured in Fig.~\ref{fig:insertmpo}.} {In effect, the MPO implements a sum over inequivalent spin-structures to capture the Koszul signs of non-contractible loops. The tensor $\M{G}$ dictates the particular sum over spin-structures and, in general, depends on the branching structure. To see this, we next consider a general triangulation of a torus, where we must incorporate $\sigma_\eta$, accounting for singular vertices, with the sum over inequivalent spin-structures given by the MPO. } \subsubsection{{General triangulation of a torus}}\label{generaltriG} {Thus far, we have argued that we can account for Koszul signs in the following two cases: (i) trivial $1$-cocycles formed from contractible loops of $|1)$ states and (ii) non-contractible loops formed by $|1)$ states in the absence of singular vertices. To reproduce the Koszul signs from contraction on a general triangulation of a torus, we then must be able to simulate the Koszul signs from non-contractible loops in the presence of singular vertices. We will find that we require a branching structure dependent choice of the tensor $\M{G}$ to obtain an appropriate sum over inequivalent spin-structures.} {The first step is to account for the Koszul signs of contractible loops, as in \ref{contractibleloops}. That is, we choose a set of edges $\eta$ such that the edges in $\eta$ pair up the singular vertices and insert $Z$ operators at the edges in $\eta$. The sign from evaluating a loop $L$ of down spins is then $\sigma_\eta(L)$ as in Eqs.~\eqref{sigmaeta} and \eqref{sigmaeta2}.} {After choosing $\eta$ we can account for the Koszul signs from non-contractible loops. As before, we choose representative non-contractible loops $L^x$ and $L^y$ lying parallel to the $x$- and $y$-axis, respectively, such as those in Fig.~\ref{fig:homoexample}. However, unlike the case with no singular vertices, the choice of $L^x$ and $L^y$ matters. For example, the sign $\hat \sigma(L^x)$ changes if $L^x$ is shifted across a singular vertex. Likewise the sign of $\sigma_\eta(L^x)$ changes if $L^x$ is shifted across a singular vertex. Therefore, to remove the ambiguity, we define the $\{0,1\}$ valued $\alpha_x$ and $\alpha_y$ by: \begin{align}\label{alpha1} (-1)^{\alpha_x}&\equiv{\hat \sigma(L^x) }/{ \sigma_\eta(L^x)} \\ \label{alpha2} (-1)^{\alpha_y}&\equiv{\hat \sigma(L^y) }/{ \sigma_\eta(L^y)} \\ \label{alpha3} (-1)^{\alpha_{x}+\alpha_y+1}&={\hat \sigma(L^x+L^y) }/{ \sigma_\eta(L^x+L^y)}. \end{align} We emphasize that the expressions above are independent of the particular choice of representative non-contractible loops $L^x$ and $L^y$, using Eqs.~\eqref{quadraticrefinement} and \eqref{trivialquadratic}.} {We now only need to reproduce the signs on the left side of Eqs.~\eqref{alpha1},~\eqref{alpha2}, and \eqref{alpha3} for non-contractible loops using the MPO generated by $\M{W}$ and $\M{G}$. A superposition of operators that yields these signs from contracting bosonic legs is: \begin{align} \frac{1}{2}(-1)^{\alpha_x\alpha_y}\bigg(1&+(-1)^{\alpha_y}\prod_{e}Z_e^{\eta^x}\nonumber \\ &+(-1)^{\alpha_x}\prod_{e}Z_e^{\eta^y}+(-1)^{\alpha_x+\alpha_y}\prod_eZ_e^{\eta^{xy}}\bigg). \end{align} It can be shown that this operator is generated by $\M{W}$ and $\M{G}$ with the components of $\M{G}$ given by: \begin{align} \label{gab2} G_{ab}=\frac{1}{2}(-1)^{(\alpha_y+a)(\alpha_x+b)}. \end{align} For the special case of the triangulation in Fig.~\ref{fig:triangulartorus}, $\alpha_x=\alpha_y=1$ and Eq.~\eqref{gab2} gives $G_{ab}=\frac{1}{2}(-1)^{(a+1)(b+1)}$, which matches our previous result. Given the spin structure in Fig.~\ref{fig:etatorus}, $\alpha_x=\alpha_y=0$. Thus, in this case, to capture the Koszul signs from non-contractible loops, the components of $\M{G}$ should be $G_{ab}=\frac{1}{2}(-1)^{ab}$.} \subsubsection{{Higher genus manifolds}} \begin{figure} \centering \includegraphics[scale=0.1,trim={2.5cm 10 10 0},clip]{PNG_figs/HGM.png} \caption{A cocycle on a genus $g$ manifold is cohomologous to a $\mathbb{Z}_2$ sum of cocycles on the component torii. The non-trivial cocycles on independent torii on the right hand side have a trivial intersection number. } \label{fig:HigherGenusDecomp} \end{figure} \begin{figure} \centering \includegraphics[scale=0.08,trim={5cm 10 15 0},clip]{PNG_figs/Slide1.png} \caption{MPOs generated by $\M{W}$ and $\M{G}$ are inserted on each component torii. The $\M{G}$ tensor may differ between the torii.} \label{fig:HigherGenusMpo} \end{figure} We briefly describe how our results can be extended to higher genus manifolds. We exploit the fact that any 2D oriented manifold $M$ with genus $g$ is topologically equivalent to a manifold constructed from the connected sum $\#$ of a sphere with $g$ torii: $M\simeq S^2\#T^2\#\cdots\#T^2$. Furthermore, given a decomposition of $M$ into a connected sum of a sphere and torii, any cocycle $C$ can be written as: \begin{align}\label{cocycledecompHG} C = \sum_{j=1}^{g} a_{j,x} L^{j,x} + \sum_{j=1}^{g} a_{j,y}L^{j,y} + \delta R. \end{align} Here, $L^{j,x}$ and $L^{j,y}$ denote generators of the non-trivial cocycles around the $j^\text{th}$ torus in the connected sum decomposition, and $\delta R$ gives a trivial cococyle. According to Eq.~\eqref{cocycledecompHG}, any cocycle $C$ is cohomologous to one of the form [see Fig.~\ref{fig:HigherGenusDecomp}]: \begin{align}\label{cocycledecompHG2} \sum_{j=1}^{g} a_{j,x} L^{j,x} + \sum_{j=1}^{g} a_{j,y}L^{j,y}. \end{align} With this, we can now describe how to account for the Koszul signs from contraction on a genus $g$ manifold. As before, the Koszul signs from contractible loops can be taken care of by making a choice of $\eta$ and inserting Pauli $Z$ operators along the edges in $\eta$. As for non-trivial cocycles, we first decompose the cocycle as in Eq.~\eqref{cocycledecompHG}. Then, we identify the cohomologous cocycle given in Eq.~\eqref{cocycledecompHG2}, which differs by a trivial cocycle. (The difference in the Koszul sign between the cohomologous cocycles is already accounted for by the choice of $\eta$.) Using that the Koszul sign corresponds to a quadratic refinement of the intersection pairing [Eq.~\eqref{quadraticrefinement}], the computation of the Koszul signs for a cocycle in the form of Eq.~\eqref{cocycledecompHG2} reduces to a computation of the Koszul signs for the loops $L^{j,x}$ and $L^{j,y}$. This is because loops belonging to different torii have trivial intersection number: \begin{align} \langle L^{x,j}, L^{x,k}\rangle = \langle L^{x,j}, L^{x,k}\rangle = \langle L^{x,j}, L^{x,k}\rangle =0 \text{ mod }2, \end{align} for all $j \neq k$. Therefore, the problem is reduced to that of $g$ independent arbitrarily triangulated torii. The Koszul signs of non-contractible loops can be accounted for by inserting MPOs generated by $\M{W}$ and $\M{G}$ as in Fig.~\ref{fig:HigherGenusMpo}. A similar strategy as in section \ref{generaltriG} can be used to choose $\M{G}$ at each intersection of the MPOs. \subsubsection{{Grading removal for the bosonized fPEPS}} {Now, we return to the original problem of writing bosonized fPEPS as bPEPS. To compute the Koszul signs, we worked with a single layer of fermionic virtual legs, while a bosonized fPEPS has both the state layer and TNO layer of fermionic virtual legs. Therefore, we need to translate our results for accounting for Koszul signs back to the case of two layers of virtual legs.} {To simplify the calculation of the Koszul sign, we noticed that [Eq.\eqref{spinless}], with the chosen ordering of the fermionic virtual legs, the pair of virtual legs $|a)_t|a')_s$ could be mapped to a spinless fermionic degree of freedom and a spin-1/2 via the isomorphism: \begin{align} |a)_t|a')_s \rightarrow |a+a')|a\rangle. \end{align} Then, we worked only with the fermionic leg. Ultimately, we converted the fermionic legs $|a+a')$ to bosonic legs $|a+a'\rangle$ with the addition of $Z$ operators on certain edges. A $Z$ operator acting on $|a+a'\rangle$ correponds to acting with a parity operator on $|a+a')$ or the operator $P_s\otimes P_t$ on $|a)_t|a')_s$. Therefore, to replace the two layers of fermionic legs with two layers of bosonic legs: $|a)_t|a')_s \rightarrow |a\rangle_t|a'\rangle_s$, we see that we need to apply operators $Z_t \otimes Z_s$ at edges to account for Koszul signs. } {In summary, we convert the two layers of fermionic legs (with the fixed internal ordering) to bosonic legs. Then, we insert $(Z_t\otimes Z_s)^{\eta_e}$ at every edge to account for the Koszul signs from contractible loops. To account for the Koszul signs from non-contractible loops, we modify the MPO so that $\M{W}$ in Eq.~\eqref{Wtensor} is: $|0\rangle (I_t \otimes I_s) \langle 0|+ |1\rangle (Z_t \otimes Z_s) \langle 1|$. } \subsection{{Algorithm for bosonizing an fPEPS}} {The following gives an algorithm for bosonizing an fPEPS on a torus and writing it explicitly as a bPEPS.} {\begin{enumerate} \item Given a triangulated 2D manifold with branching structure, determine the singular vertices. Singular vertices are those that are $1$-vertices of $4m$ number of triangles. Pair singular vertices along convenient paths. The edges along these paths are the elements of $\eta$. \item Construct the tensors $\M{M_f}=\M{F}\boldsymbol{{\cdot}} \M{T}$ and $\M{\bar{M}_f}=\M{\bar F}\boldsymbol{{\cdot}} \M{\bar T}$. Rearrange the virtual indices to match the order shown in Eq.~\eqref{ftinorder}. Remove the grading of the virtual indices of $\M{M_f}$, $\M{\bar{M}_f}$, and $\mathsf{B}_\eta$. The resulting tensors are $\M{M_b}$, $\M{\bar{M}_b}$, and $\M{B_b}$, respectively. \item Choose convenient generators of the non-contractible loops parallel to the $x$-axis and $y$-axis, say $L^x $ and $L^y$, and calculate $(-1)^{\alpha_x}= \hat{\sigma}(L^x)/\sigma_\eta(L^x)$ and $(-1)^{\alpha_y}= \hat{\sigma}(L^y)/\sigma_\eta(L^y)$. Determine the tensor $\M{G}$ using Eq.~\eqref{gab2}. \item Insert factors of $Z_t \otimes Z_s$ on virtual legs corresponding to the edges in $\eta$. Insert tensors $\M{W}$ along convenient generators of non-contractible loops parallel to the $x$- and $y$-axes, and glue the MPOs at their intersection with the $\M{G}$ tensor calculated in the previous step. Finally, contract $\M{M_b}$, $\M{\bar{M}_b}$, and $\M{B_b}$ with the inserted factors of $Z_t \otimes Z_s$ and the MPO generated by $\M{W}$ and $\M{G}$. \end{enumerate}} \subsection{{Example of bosonizing an fPEPS}} \label{examplebosonizingfpeps} \begin{figure} \centering \begin{tikzpicture}[Sbase,scale=1] \randt; \path[](3)--node[]{$Z$}(4)--node[]{$Z$}(7); \path[](8)--node[]{$Z$}(10); \draw[](0,4)--(0,0)--(4,0); \draw[] (-0.25,3.25)--node[Sq={0},scale=0.7]{}++(0.5,0);\draw[] (-0.25,1.25)--node[Sq={0},scale=0.7]{}++(0.5,0); \draw[] (2.5,-0.25)--node[Sq={0},scale=0.7]{}++(0,.5);\draw[] (.5,-0.25)--node[Sq={0},scale=0.7]{}++(0,.5); \node[Bcir,scale=1] at (0,0){$\M{G}$}; \end{tikzpicture} \caption{ Choice of spin structure $\eta = \lbrace \langle 3,4\rangle,\langle 4,7 \rangle,\langle 8,10 \rangle \rbrace$ and placement of the MPO generated by $\M{W}$ and $\M{G}$. The $Z^{\eta_e}$ operators shown represent the $(Z_t \otimes Z_s)^{\eta_e}$-operators that are inserted in the example of section \ref{examplebosonizingfpeps}.} \label{fig:etatorus} \end{figure} {As an example, we bosonize the atomic insulator state $|\psi_{AI} )$ on a 2D torus, triangulated as shown in Fig.~\ref{fig:etatorus}. The tensor network representation has a vacuum tensor everywhere: $T_{000}=1, \bar{T}_{000}=1$ and all other components zero.} \vspace{2mm} \noindent {\textbf{Step 1:} The singular vertices are $\langle3\rangle$, $\langle7\rangle$, $\langle8\rangle$ and $\langle10\rangle$. We pair them along the paths shown in Fig.~\ref{fig:etatorus}, so the spin structure $\eta$ is $\eta = \lbrace \langle 3,4\rangle,\langle 4,7 \rangle,\langle 8,10 \rangle \rbrace$.} \vspace{2mm} \noindent {\textbf{Step 2:} We compute the tensors $\M{M_f}$, $\M{\bar{M}_f}$, and $\mathsf{B}_\eta$, order the legs according to Eq.~\eqref{ftinorder}, and replace the fermionic legs with bosonic legs to obtain: \begin{align} \M{M_b}=&\sum_{a,b,c}\delta_{a+b+c,0} |c\rangle_{f_{01}}|0\rangle_{f'_{01}} |a\rangle_{f_{12}} |0\rangle_{f'_{12}} \langle 0|_{f'_{02}} \langle b|_{f_{02}} \\ \M{\bar{M}_b} =& \sum_{a,b,c} \delta_{a+b+c,0} |b\rangle_{f_{02}} |0\rangle_{f'_{02}} \langle 0|_{f'_{12}} \langle a|_{f_{12}} \langle 0|_{f'_{01}} \langle c|_{f_{01}} \\ \label{Bbdef} \M{B_b}=&\sum_{a} Z_e^{\eta_e} |a\rangle_{e} |a\rangle_{e} \langle a|_{e}. \end{align}} \vspace{2mm} \noindent {\textbf{Step 3:} We use $L^x$ in the upper right corner of Fig.~\ref{fig:homoexample} to calculate: \begin{align} (-1)^{\alpha_x} = {\hat{\sigma}(L^x)}/{\sigma_\eta(L^x)}=1, \end{align} and we use $L^y$ in the lower left corner of Fig.~\ref{fig:homoexample} to calculate: \begin{align} (-1)^{\alpha_y} = {\hat{\sigma}(L^y)}/{\sigma_\eta(L^y)}=1. \end{align} $\alpha_x=\alpha_y=0$, so $\M{G}$ has components $ G_{ab}=(-1)^{ab}$.} \vspace{2mm} \noindent {\textbf{Step 4:} We insert the operator $(Z_t \otimes Z_s)^{\eta_e}$ at each edge and insert the MPO generated by $\M{W}$ and $\M{G}$ as in Fig.~\ref{fig:etatorus}. The state layer has only $0$ indices, so the factors of $Z_s$ do not affect the state. We freely remove all of the state layer indices. The factors of $Z_t^{\eta_e}$ cancel with the factor of $Z_e^{\eta_e}$ in the definition of $\M{B_b}$ in Eq.~\ref{Bbdef}.} \vspace{2mm} {The result is a bPEPS generated by the tensors: \begin{align} \M{M_b} =& \sum_{a,b} |a+b\rangle_{f_{01}}|a\rangle_{f_{12}} \langle b|_{f_{02}}\\ \M{\bar{M}_b} =& \sum_{a,b} |b\rangle_{f_{02}} \langle a|_{f_{12}}\langle a+b|_{f_{01}} \\ \M{B_b} =& \sum_{a} |a\rangle_{e} |a\rangle_{e} \langle a|_{e}, \end{align} with the MPO generated by $\M{W}$ and $\M{G}$ inserted along the $x$- and $y$-axes (Fig.~\ref{fig:etatorus}). The bPEPS is in a ground state of Kitaev's toric code Hamiltonian. One way to see this is to notice that $\M{M_b}$ and $\M{\bar{M}_b}$ have the MPO symmetries: \begin{align} Z_{f_{01}}Z_{f_{12}}Z_{f_{02}}\boldsymbol{{\cdot}} \M{M_b} &= \M{M_b} \nonumber \\ Z_{f_{01}}Z_{f_{12}}Z_{f_{02}}\boldsymbol{{\cdot}} \M{\bar{M}_b} &= \M{\bar{M}_b}, \end{align} indicative of the toric code phase. Moreover, the symmetry implies that $\M{M_b}$ and $\M{\bar{M}_b}$ have an even number of down spins. Since $\M{B_b}$ copies the virtual legs to the physical leg, the ground state is a superposition of all loops (on the dual lattice) of down spins. The tensor $\M{G}$ dictates the particular toric code ground state. For the branching structure in Fig.~\ref{fig:etatorus}, the ground state is an equal amplitude superposition of all loops (on the dual lattice) of down spins acted on by the following operator: \begin{align} \frac{1}{2}\left( 1-\prod_e Z_e^{\eta^x} - \prod_e Z_e^{\eta^y} + \prod_e Z^{\eta^{xy}} \right). \end{align}} {While the example of an atomic insulator state is rather simple, we expect the algorithm to extend naturally to more complicated problems.} \section{\texorpdfstring{ $\mathbb{Z}_2$}{Z2}-graded tensor networks} \label{sec:gradedTN} {Our bosonization TNO is naturally expressed in terms of $\mathbb{Z}_2$-graded tensor networks. Therefore, the purpose of this section is to give a concise introduction to $\mathbb{Z}_2$-graded tensor networks and establish the notation used throughout the text. For a similar exposition of $\mathbb{Z}_2$-graded tensor networks, one can consult Refs.~[\onlinecite{Bultinck17},\onlinecite{Bultinck17a}]. We start by defining $\mathbb{Z}_2$-graded Hilbert spaces and $\mathbb{Z}_2$-graded tensors. Then, we introduce the contraction map to ``glue'' together $\mathbb{Z}_2$-graded tensors. The contraction map allows us to define a linear action of tensors on each other and to form $\mathbb{Z}_2$-graded tensor networks. Accordingly, we describe a representation of a fermionic operator algebra in terms of $\mathbb{Z}_2$-graded tensors and present a diagrammatic representation for $\mathbb{Z}_2$-graded tensor networks.} \subsection{\texorpdfstring{$\mathbb{Z}_2$}{Z2}-graded Hilbert spaces} A $\mathbb{Z}_2$-graded Hilbert space is a Hilbert space $\mathcal{H}$ with a natural direct sum decomposition: $\mathcal{H}=\mathcal{H}^0 \bigoplus \mathcal{H}^1$. A vector $|j)\in \mathcal{H}$ lying solely in either $\mathcal{H}^0$ or $\mathcal{H}^1$ has a $\{0,1\}$ valued \textit{grading} denoted as $|j|$, where $|j|=0$ if $|j) \in \mathcal{H}^0$ and $|j|=1$ if $|j) \in \mathcal{H}^1$. (We use round brackets for vectors in $\mathbb{Z}_2$-graded Hilbert spaces.) In the context of fermionic systems, we consider $\mathcal{H}^0$ to be the subspace spanned by states with an even number of fermions and $\mathcal{H}^1$ to be the subspace spanned by states with an odd number of fermions. Thus, the grading of a vector and its fermion parity coincide. For this reason, we use grading and parity interchangeably. Further, we refer to vectors with a definite parity as homogeneous vectors, and we call states formed from a superposition of both even and odd parity vectors inhomogeneous. To capture the physics of a many-body fermionic system, we will need a generalization of the usual tensor product -- the graded tensor product $\hat{\otimes}$. For graded Hilbert spaces $\mathcal{H}_a$ and $\mathcal{H}_b$, we define the graded tensor product space $\mathcal{H}_a \hat{\otimes} \mathcal{H}_b$ to be the quotient space: \begin{align} \label{gradedtensorspace} \mathcal{H}_a \hat{\otimes} \mathcal{H}_b \equiv \frac{(\mathcal{H}_a \otimes \mathcal{H}_b)\bigoplus (\mathcal{H}_b \otimes \mathcal{H}_a)}{\sim}. \end{align} Here, $\otimes$ is the usual (unsymmetrized) tensor product of Hilbert spaces, and $\sim$ denotes the relation: \begin{align} \label{gradedtensorrelation} |j)_a \otimes |k)_b \sim (-1)^{|j||k|} |k)_b \otimes |j)_a \end{align} for $|j)_a \in \mathcal{H}_a$ and $|k)_b \in \mathcal{H}_b$ both with definite grading. The Hilbert space $\mathcal{H}_a \hat{\otimes} \mathcal{H}_b$ is itself a graded Hilbert space with the equivalence class $|j)_a \hat{\otimes} |k)_b \in \mathcal{H}_a \hat{\otimes} \mathcal{H}_b$ having a grading of $|j| + |k| \text{ mod }2$. As a consequence of Eq.~\eqref{gradedtensorrelation}, we have: \begin{align} \label{gradedtensor} |j)_a \hat{\otimes} |k)_b = (-1)^{|j||k|} |k)_b \hat{\otimes} |j)_a. \end{align} This property of the graded tensor product is key to describing fermions, as it encodes the exchange statistics of the fermions. One can see that the graded tensor product captures the familiar notion of a fermionic Fock space by representing the equivalence class $|j)_a \hat{\otimes} |k)_b$ by the vector ${\frac{1}{2}\Big(|j)_a \otimes |k)_b + (-1)^{|j||k|} |k)_b \otimes |j)_a\Big)}$. When $|j)_a$ and $|k)_b$ are both fermion parity odd, we have an anti-symmetric combination -- the Slater determinant. \par Before moving on to describe $\mathbb{Z}_2$-graded tensors, we would like to note that Hilbert spaces for bosonic systems also fit into the framework of $\mathbb{Z}_2$-graded Hilbert spaces. A bosonic Hilbert space can be understood as a $\mathbb{Z}_2$-graded Hilbert space for which $\mathcal{H}^1$, the space of vectors with odd grading, is empty, leaving $\mathcal{H}= \mathcal{H}^0$. {The graded tensor product between two bosonic Hilbert spaces reduces to the symmetrized tensor product between the Hilbert spaces, as is standard in tensor networks for bosonic systems.} In a slight abuse of notation, we will denote vectors $|j\rangle$ in bosonic Hilbert spaces with angled brackets. In what follows, we will freely take graded tensor products of states in bosonic Hilbert spaces and states in fermionic Hilbert spaces, and the angled brackets are to remind us that those vectors necessarily have trivial grading. \subsection{\texorpdfstring{ $\mathbb{Z}_2$}{Z2}-graded tensors} A rank $N$ $\mathbb{Z}_2$-graded tensor $\M{T}$ is an element of the graded tensor product of $N$ $\mathbb{Z}_2$-graded Hilbert spaces, i.e., $\M{T} \in \mathcal{H}_{1} \hat \otimes \ldots \hat \otimes \mathcal{H}_N$. Similar to tensors used to study bosonic systems, $\mathbb{Z}_2$-graded tensors admit a convenient graphical representation. Let us consider a specific example with $N=4$ for illustration: \begin{align} \label{tensorexample} \begin{tikzpicture}[Sbase,scale=0.5] \draw[red,->-=0.5] (0,0)--(0:2)node[above,black]{$p$}; \draw[red,,->-=0.5] (0,0)--(-90:2)node[right,black]{$q$}; \draw[black,-<-=0.5] (0,0)--(180:2)node[above,black]{$r$}; \draw[red,-<-=0.5] (0,0)--(90:2)node[above,black]{$s$}; \node[Tsq] (v) at (0,0) {$\M{T}$}; \end{tikzpicture} &\equiv \sum_{a,b,c,d} T_{abcd} |a)_{p}|b)_{q} \langle c|_{r} ( d|_{s} . \end{align} On the left hand side of Eq.~\eqref{tensorexample}, we have a diagrammatic representation of the tensor $\M{T}\in \mathcal{H}_{p} \hat{\otimes} \mathcal{H}_{q} \hat{\otimes} \mathcal{H}^*_{r}\hat{\otimes} \mathcal{H}^*_{s}$, where $\mathcal{H}^*$ is the dual Hilbert space of $\mathcal{H}$. In the diagram, the characters at the end of the legs label the Hilbert spaces, and the orientation of the leg indicates whether we consider the Hilbert space to be a dual Hilbert space. (Legs oriented towards the node correspond to a dual Hilbert space.) Further, we have used red legs for $\mathbb{Z}_2$-graded Hilbert spaces and black legs for bosonic Hilbert spaces. The right hand side of Eq.~\eqref{tensorexample} is the tensor component form of $\M{T}$ with \textit{component values} $T_{abcd}$. Note that we have suppressed the $\hat{\otimes}$ between vectors, and as previously mentioned, we use angled brackets for vectors which necessarily have trivial grading [$\langle c|_r$ in Eq.~\eqref{tensorexample}]. Thus, the vector $|a)_{p}|b)_{q} \langle c|_{r} ( d|_{s} $ has a grading of $|a|+|b|+|d| \text{ mod }2$. Since the graded tensor product of Hilbert spaces is a graded Hilbert space, a tensor can be either homogeneous or inhomogeneous. A homogeneous tensor has nonzero component values only for vectors sharing the same parity, and otherwise, the tensor is inhomogeneous. It is important to note that the tensor $\M{T}$ is independent of the ordering of vectors in Eq.~\eqref{tensorexample}, but the component values ($T_{abcd}$) can depend on the ordering. For example, if we swap the order of $|a)_p$ and $|b)_q$, we get: \begin{align}\label{reordering sign} \M{T}=\sum_{a,b,c,d} T_{abcd}(-1)^{|a||b|} |b)_{q} |a)_{p}\langle c|_{r} (d|_{s}. \end{align} Hence, the tensor components have an additional sign $(-1)^{|a||b|}$ with the new choice of ordering. The ordering should therefore be interpreted as a particular choice of orthonormal basis with which to express the tensor. We will often refer to the choice of ordering of the vectors in the component form of a tensor as a choice of \textit{internal ordering}. \subsection{Contraction map and tensor action} \label{subsec:contraction} To form tensor networks, we require a map to ``glue'' together tensors. To this end, we define the \textit{contraction map}: \begin{align} \label{contraction} \mathcal{C}:\mathcal{H}^* \hat{\otimes} \mathcal{H} &\to \mathbb{C} \nonumber \\ (j| \hat{\otimes} |k) &\mapsto (j|k) = \delta_{jk}. \end{align} Notice that a reordering of vectors may be necessary before evaluating $\mathcal{C}$. For example: \begin{align}\label{supetrace} \mathcal{C}\big[ |k) \hat{\otimes} (j| \big] = \mathcal{C}\big[ (-1)^{|j||k|} (j| \hat{\otimes} |k) \big]=(-1)^{|j||k|}\delta_{jk}. \end{align} Interpreting $ \mathcal{C}\big[ |k) \hat{\otimes} (j| \big]$ as $\text{tr}[|k) \hat{\otimes} (j|]$, we see that it differs from the usual trace by a sign, $(-1)^{|j||k|}$. This phase is referred to as the \textit{supertrace sign}. In general, the indices to be contracted need not be next to each other in an algebraic expression. For this reason, we introduce the superscript notation: \begin{align} |k)^\mathcal{C} \hat{\otimes} (j|^\mathcal{C}\equiv \mathcal{C}\big[ |k) \hat{\otimes} (j| \big]. \end{align} A dual vector and a vector with matching superscripts $\mathcal{C}$ are to first be reordered then contracted with the map $\mathcal{C}$. We now provide examples to illustrate the contraction of $\mathbb{Z}_2$-graded tensors. We consider the following three even parity tensors to guide the discussion: \begin{align} \begin{tikzpicture}[Sbase] \draw[red,->-=0.5] (-1,0)node[below,black]{$p$} --+(1,0);\draw[red,-<-=0.5] (0,0) --+(1,0)node[below,black]{$q$}; \draw[-<-=0.75](0,0)--++(0,1)node[right]{$r$}; \node[Utriangle] at (0,0) {$\M{A}$}; \end{tikzpicture} \equiv & \sum_{a,b,c} A_{abc} (a|_q \langle b |_r (c|_p \nonumber \\ \begin{tikzpicture}[Sbase] \draw[red,-<-=0.5] (-1,0)node[below,black]{$q$} --+(1,0);\draw[red,-<-=0.5] (0,0) --+(1,0)node[below,black]{$s$}; \node[Bcir] at (0,0) {$\M{B}$}; \end{tikzpicture} \equiv & \sum_{d,e} B_{de} |d)_{q} ( e|_{s} \nonumber \\ \begin{tikzpicture}[Sbase] \draw[red,-<-=0.5] (-1,0)node[below,black]{$s$} --+(1,0); \node[Tsq] at (0,0) {$\M{C}$}; \end{tikzpicture} \equiv & \sum_{f} C_{f} |f)_{s}\nonumber. \end{align} First, we contract the $s$ leg of $\M{B}$ with the $s$ leg of $\M{C}$. The resulting tensor is denoted as $\M{B}\boldsymbol{{\cdot}} \M{C}$: \begin{align} \label{BC example} \begin{tikzpicture}[Sbase] \draw[red,-<-=0.5] (-1,0) --+(1,0);\draw[red,-<-=0.5] (0,0) --+(1,0); \node[Bcir] at (0,0) {$\M{B}$}; \node[Tsq] at (1,0) {$\M{C}$}; \end{tikzpicture} \equiv & \mathcal{C}_s\left[\M{B}\hat{\otimes} \M{C}\right]\nonumber \\ =& \sum_{d,e} B_{de} |d)_{q} (e|_{s}^{\mathcal{C}} \sum_{f} C_{f} |f)_{s}^{\mathcal{C}} \nonumber \\ =& \sum_{d,e} B_{de} C_{e}|d)_{q}\equiv \M{B}\boldsymbol{{\cdot}} \M{C}, \end{align} where $\mathcal{C}_{s}\left[ \cdots \right]$ refers to contraction of the $s$ index. Notice that $\M{C}$ is a $\mathbb{Z}_2$-graded vector, and $\M{B}$ is a $\mathbb{Z}_2$-graded matrix. We see that $\M{B}$ acts on $\M{C}$ by contraction and gives a new vector, $\M{B}\boldsymbol{{\cdot}} \M{C}$. Hence $\M{B}$ can represent linear operators on $\mathbb{Z}_2$-graded vector spaces. Second, we contract $\M{A}$ with $\M{B}\boldsymbol{{\cdot}} \M{C}$ by contracting the $q$ leg of $\M{A}$ with that of $\M{B}\boldsymbol{{\cdot}} \M{C}$ to produce a new tensor $\M{A}\boldsymbol{{\cdot}} \M{B}\boldsymbol{{\cdot}} \M{C}$: \begin{align*} \label{ABC example} \begin{tikzpicture}[Sbase,scale=0.9] \draw[red,->-=0.5] (-1,0) --+(1,0); \draw[red,-<-=0.5] (0,0) --+(1,0); \draw[red,-<-=0.5] (1,0) --+(1,0); \draw[-<-=0.75](0,0)--++(0,1); \node[Utriangle] at (0,0) {$\M{A}$}; \node[Bcir] at (1,0) {$\M{B}$}; \node[Tsq] at (2,0) {$\M{C}$}; \end{tikzpicture} & \equiv \mathcal{C}_q\left[\M{A}\hat{\otimes} \M{B}\boldsymbol{{\cdot}} \M{C}\right]\nonumber\\* &=\sum_{a,b,c} A_{abc} (a|^\mathcal{C}_q \langle b |_r (c|_p \sum_{d,e} B_{de} C_{e}|d)_{q}^{\mathcal{C}} \nonumber \\ &= \sum_{a,b,c,e} (-1)^{|a||c|}A_{abc}B_{ae}C_{e} \langle b|_{r} (c|_p \nonumber\\ & \equiv \M{A}\boldsymbol{{\cdot}} \M{B}\boldsymbol{{\cdot}}\M{C}. \end{align*} Note that the sign $(-1)^{|a||c|}$ comes from moving $(a|_q$ past $\langle b|_r (c|_p$ in order to perform the contraction. We can say that $\M{A}$ acted on $\M{B}\boldsymbol{{\cdot}} \M{C}$ by contraction to produce a tensor $\M{A}\boldsymbol{{\cdot}}\M{B}\boldsymbol{{\cdot}} \M{C}$. In general, contraction of any two tensors can be interpreted in this way: a tensor $\M{T}$ \textit{acts} on another tensor $\M{S}$ by contraction to produce a tensor $\M{T}\boldsymbol{{\cdot}} \M{S}$. Letting $ind$ be the set of indices contracted between $\M{T}$ and $\M{S}$, we have: \begin{align} \M{T}\boldsymbol{{\cdot}} \M{S}=\mathcal{C}_{ind}[\M{T} \hat{\otimes} \M{S}], \end{align} where $\mathcal{C}_{ind}[...]$ refers to contraction over the indices in the set $ind$. Note that, since $\M{T}\boldsymbol{{\cdot}} \M{S}$ depends on the set $ind$, we should ideally write it as $\M{T}\boldsymbol{{\cdot}}_{ind} \M{S}$. However, the set $ind$ is typically clear from context, so we omit the subscript for notational convenience. \subsection{$\mathbb{Z}_2$-graded representation of a fermionic operator algebra} \label{subsec: representing fermions} Now that we have defined tensors' linear action via contraction, we establish a representation for the fermionic operator algebra of a spinless complex fermion using $\mathbb{Z}_2$-graded tensors. The representation is essential for the construction of the bosonization TNO, since the bosonization TNO maps fermionic operators represented by $\mathbb{Z}_2$-graded tensors to bosonic operators. The operator algebra of a spinless complex fermion at a site $p$ is generated by the familiar fermionic creation and annihilation operators: $c^{\dagger}_p$, $c_p$. However, it is often convenient to instead work with a generating set formed by the two \textit{Majorana operators}: \begin{align} \label{gammadef} \gamma_{p} = c^{\dagger}_{p}+c_{p} \quad\text{and}\quad \bar \gamma_{p} = i(c^{\dagger}_{p}-c_{p}). \end{align} These are Hermitian, unitary operators: \begin{align} \label{gamma-prop} \gamma_{p}^{\dagger}=\gamma_{p}\text{,} \quad \bar \gamma_{p}^{\dagger}=\bar \gamma_{p}\text{,}\quad \gamma_{p}^2 =\bar \gamma_{p}^2 = 1\text{,} \end{align} and they satisfy the following commutation relations: \begin{align} \label{majoranacommutation} \lbrace \gamma_{p}, \bar \gamma_{p'} \rbrace = & 0 \nonumber \\ \lbrace \gamma_{p}, \gamma_{p'} \rbrace =& \lbrace \bar \gamma_{p}, \bar\gamma_{p'} \rbrace=2\delta_{ p , p'}, \end{align} where braces denote the anti-commutator and $\delta_{p,p'}$ is the Kronecker delta function. Furthermore, the \textit{fermion parity operator} $P_p$ is given by: \begin{align}\label{parity-def} P_p=(-1)^{c_p^{\dagger}c_p}=-i \gamma_p\bar \gamma_p. \end{align} We now show that $\gamma_{p}$, $\bar \gamma_p$ and $P_p$ can be represented as rank-2 $\mathbb{Z}_2$-graded tensors. Letting $|1)$ and $|0)$ represent the fermion occupied and unoccupied states respectively, then the creation and annihilation operators have the following canonical representations: \begin{align} c_p |1)_p &= |0)_p, \, c_p|0)_p =0 \nonumber\\ c_p^{\dagger} |1)_p &= 0, \, c_p^{\dagger} |0)_p = |1)_p. \end{align} Using Eq.~\eqref{gammadef}, this leads to the following representation of Majorana operators: \begin{align} \label{gammagraded} \begin{tikzpicture}[Sbase] \draw[red,OES={AR2=0.5}] (-1,0)node[below,black]{$p$}--(0,0)--(1,0)node[below,black]{$p$}; \node[OP] {$\gamma$}; \end{tikzpicture} &\equiv |1)_p(0|_p+|0)_p(1|_p \\ \nonumber &= \sum_{a} |a+1)_p(a|_p \\ \begin{tikzpicture}[Sbase] \draw[red,OES={AR2=0.5}] (-1,0)node[below,black]{$p$}--(0,0)--(1,0)node[below,black]{$p$}; \node[OP] {$\bar \gamma$}; \end{tikzpicture} \label{gammabargraded} &\equiv i|1)_p(0|_p-i|0)_p(1|_p \\ \nonumber &= \sum_{a} (-1)^{a} i |a+1)_p(a|_p. \end{align} Here, and throughout the paper, indices are assumed to take binary values, unless stated otherwise. Thus, $ \sum_a \equiv \sum_{a=0}^1$, and $(a+1) \equiv (a+1) \text{ mod }2$, etc. In Appendix \ref{app: Majorana tensors}, we show that the algebraic properties of the Majorana operators are indeed satisfied by the tensor representations in Eqs.~\eqref{gammagraded} and \eqref{gammabargraded}. Furthermore, using Eq.~\eqref{parity-def}, fermion parity $P$ can be represented as: \begin{align} \label{parity definition} \begin{tikzpicture}[Sbase] \draw[red,OES={AR2=0.5}](-1,0)node[below,black]{$p$}--(0,0)--(1,0)node[below,black]{$p$};\node[OP] {$P$}; \end{tikzpicture} &\equiv \sum_a (-1)^a|a)_p(a|_p \nonumber\\ &= |0)_p(0|_p -|1)_p(1|_p. \end{align} Eq.~\eqref{parity definition} agrees with the intuition that the $\mathbb{Z}_2$-grading of a vector corresponds to the fermion parity of the state. \subsection{\texorpdfstring{ $\mathbb{Z}_2$}{Z2}-graded tensor network diagrams} To establish a general theory of $\mathbb{Z}_2$-graded tensor networks, we need to make sure that tensor diagrams can unambiguously represent the algebraic values. For example, given the tensor network diagram: \begin{align} \begin{tikzpicture}[Sbase,scale=0.9] \draw[red,->-=0.5] (-1,0) --+(1,0); \draw[red,-<-=0.5] (0,0) --+(1,0); \draw[red,-<-=0.5] (1,0) --+(1,0); \draw[-<-=0.75](0,0)--++(0,1); \node[Utriangle] at (0,0) {$\M{A}$}; \node[Bcir] at (1,0) {$\M{B}$}; \node[Tsq] at (2,0) {$\M{C}$}; \end{tikzpicture}, \end{align} how do we know whether it represents the tensor $\M{A}\boldsymbol{{\cdot}}\M{B}\boldsymbol{{\cdot}} \M{C}$ or $\M{B}\boldsymbol{{\cdot}}\M{C}\boldsymbol{{\cdot}} \M{A}$, or any other order of action of tensors $\M{A}$, $\M{B}$, and $\M{C}$? Unlike bosonic tensors, $\mathbb{Z}_2$-graded tensors do not commute with each other, and hence, in general, $\M{A}\boldsymbol{{\cdot}}\M{B}\boldsymbol{{\cdot}} \M{C}$ and $\M{B}\boldsymbol{{\cdot}}\M{C}\boldsymbol{{\cdot}} \M{A}$ are different tensors. If $\M{T}$ and $\M{S}$ are homogeneous tensors, then the commutation relation of graded tensor products in Eq.~\eqref{gradedtensor} implies the following commutation relation: \begin{align}\label{STphase} \M{T}\boldsymbol{{\cdot}} \M{S}=(-1)^{|\M{T}||\M{S}|}\M{S}\boldsymbol{{\cdot}} \M{T}. \end{align} In particular, as long as only one tensor is odd, we have $\M{T}\boldsymbol{{\cdot}} \M{S}=\M{S}\boldsymbol{{\cdot}} \M{T}$, and the order of action of these tensors does not matter. Extending this argument, we see that for a set of homogeneous tensors $\lbrace \M{A},\M{B},\M{C},\ldots \rbrace$, as long as at most one tensor is odd, the order of contraction does not matter. What happens when more than one odd tensor appears in a TN? An example of such a tensor network is given in the following diagram, where we assume $\M{A}$ is an even tensor: \begin{align}\label{gAgorggA} \begin{tikzpicture}[Sbase,scale=0.9] \draw[red,->-=0.5] (-2,0)--+(1,0); \draw[red,->-=0.5] (-1,0)--+(1,0); \draw[red,-<-=0.5] (0,0)--+(1,0); \draw[red,-<-=0.5] (1,0)--+(1,0); \draw[-<-=0.75](0,0)--+(0,1); \node[Utriangle] at (0,0) {$\M{A}$}; \node[OP] at (1,0) {$\bar \gamma$}; \node[OP] at (-1,0) {$\gamma $}; \end{tikzpicture} . \end{align} How should this tensor network diagram be read algebraically? For instance, it could represent either $\gamma \boldsymbol{{\cdot}} \M{A} \boldsymbol{{\cdot}}\bar \gamma$ or $ \bar \gamma \boldsymbol{{\cdot}}\gamma \boldsymbol{{\cdot}} \M{A}$, among other possibilities. This is problematic because, according to Eq.~\eqref{STphase}, $\gamma \boldsymbol{{\cdot}} \M{A} \boldsymbol{{\cdot}} \bar \gamma=-\bar \gamma \boldsymbol{{\cdot}} \gamma \boldsymbol{{\cdot}} \M{A}$. Hence, the algebraic value of the this tensor network diagram is ill defined. To remove this ambiguity, we need to indicate the order in which $\gamma$ and $\bar \gamma$ are applied. We do this by adopting the following simple notation: if two or more odd tensors appear in a diagram, we place numbers next to their nodes to indicate their relative order. For example, $\gamma\boldsymbol{{\cdot}} A \boldsymbol{{\cdot}}\bar \gamma$ and $\bar \gamma \boldsymbol{{\cdot}} \gamma\boldsymbol{{\cdot}} \M{A} $ are then respectively represented by the following diagrams: \begin{align} \gamma\boldsymbol{{\cdot}} A \boldsymbol{{\cdot}}\bar \gamma \equiv \begin{tikzpicture}[Sbase,scale=0.9] \draw[red,->-=0.5] (-2,0)--+(1,0); \draw[red,->-=0.5] (-1,0)--+(1,0); \draw[red,-<-=0.5] (0,0)--+(1,0); \draw[red,-<-=0.5] (1,0)--+(1,0); \draw[-<-=0.75](0,0)--+(0,1); \node[Utriangle] at (0,0) {$\M{A}$}; \node[OP] at (1,0) {$\bar \gamma$}; \path (1,0)++(0,-0.5)node[red,scale=0.7] {$1$}; \node[OP] at (-1,0) {$\gamma $}; \path (-1,0)++(0,-0.5)node[red,scale=0.7] {$2$}; \end{tikzpicture} \nonumber\\ \bar \gamma \boldsymbol{{\cdot}} \gamma\boldsymbol{{\cdot}} A \equiv \begin{tikzpicture}[Sbase,scale=0.9] \draw[red,->-=0.5] (-2,0)--+(1,0); \draw[red,->-=0.5] (-1,0)--+(1,0); \draw[red,-<-=0.5] (0,0)--+(1,0); \draw[red,-<-=0.5] (1,0)--+(1,0); \draw[-<-=0.75](0,0)--+(0,1); \node[Utriangle] at (0,0) {$\M{A}$}; \node[OP] at (1,0) {$\bar \gamma$}; \path (1,0)++(0,-0.5)node[red,scale=0.7] {$2$}; \node[OP] at (-1,0) {$\gamma $}; \path (-1,0)++(0,-0.5)node[red,scale=0.7] {$1$}; \end{tikzpicture} . \end{align} In fact, the first diagram can also represent any tensor network in which $\bar \gamma$ is applied \textit{before} $\gamma$, so it can also represent $ \gamma \boldsymbol{{\cdot}} \bar \gamma \boldsymbol{{\cdot}} A $ or $ A\boldsymbol{{\cdot}} \gamma \boldsymbol{{\cdot}} \bar \gamma$. Similarly, the second diagram can also represent $ \bar \gamma \boldsymbol{{\cdot}} A \boldsymbol{{\cdot}} \gamma $ and $ A\boldsymbol{{\cdot}}\bar \gamma\boldsymbol{{\cdot}}\gamma$ (recall that we assume $A$ is an even tensor). \section{Introduction} The Jordan-Wigner transformation is a well established example of a bosonization duality -- it maps a system of spinless complex fermions to a system of spins [\onlinecite{Jordan28}]. The duality has led to many fruitful applications to one dimensional systems, where it equates 1D fermionic models and spin chains. However, while the Jordan-Wigner transformation is a powerful tool in one dimension, there are challenges to applying it to higher dimensional systems. To implement the Jordan-Wigner transformation in dimensions greater than one, the duality is applied along a 1D path which snakes through the fermionic system. In general, this yields a transformation that maps local fermionic Hamiltonians to \textit{non}-local bosonic Hamiltonians. Generalizations of the Jordan Wigner transformation to two dimensions have since overcome this obstacle and indeed map local fermionic Hamiltonians to local bosonic Hamiltonians [\onlinecite{ChenYA17},\onlinecite{Ball05},\onlinecite{Verstraete05},\onlinecite{Kitaev06a}]. Similar to the one dimensional Jordan-Wigner transformation, these two dimensional bosonization dualities are expressed at the level of operators. That is, they define a mapping of operators, where operators that act on fermionic degrees of freedom are mapped to operators that act on spins. Such a mapping of operators \footnote{This is technically a $C^*$ algebra automorphism.} necessarily comes from conjugating by some unitary operator on the Hilbert space [\onlinecite{Neumann31}]. However, finding the explicit form of this unitary, and thereby obtaining the action of the duality at the level of quantum states, is challenging. In this work, we formulate a two dimensional bosonization duality at the level of quantum states. Specifically, we identify a tensor network representation of the duality in Ref. [\onlinecite{ChenYA17}]. This is to say, we construct a tensor network operator (TNO) which, by conjugation, maps operators according to the transformation in Ref. [\onlinecite{ChenYA17}]. Moreover, the TNO may be applied directly to fermionic tensor network states to map them to bosonic states. Further, we show that bosonized fermionic projected entangled pair states (fPEPS) may be written explicitly as bosonic projected entangled pair states (bPEPS). The TNO inherits two of the main features of the transformation detailed in Ref. [\onlinecite{ChenYA17}]. First, the mapping of operators in Ref. [\onlinecite{ChenYA17}] makes the physical interpretation of two dimensional bosonization transparent -- fermionic excitations are mapped to \textit{emergent} fermions in a $\mathbb{Z}_2$ gauge theory. Operators that create pairs of fermions are explicitly mapped to operators that create pairs of emergent fermions, which are interpreted as bound states of a bosonic gauge charge and flux. The gauge constraint on the bosonic side of the duality expressly prohibits unbound charge and flux excitations. Consequently, our TNO clearly maps the subspace of states with an even number of fermions to a constrained Hilbert space with a basis given by configurations of emergent fermions. Second, the bosonization duality of Ref. [\onlinecite{ChenYA17}] carefully accounts for spin-structure -- a mathematical input necessary for bosonization dualities -- while in other treatments, spin-structure is hidden in seemingly arbitrary choices. In our construction, a choice of spin-structure is then specified by a certain set of bonds in the TNO. Importantly, keeping track of the spin-structure allows us to establish our tensor network bosonization for fermionic systems on arbitrary triangulations of closed, orientable 2D manifolds. For context, our approach to bosonization is analogous to a method employed in Ref. [\onlinecite{Haegeman15}] for gauging symmetries at the level of quantum states. In Ref. [\onlinecite{Haegeman15}], a TNO is used to map a state with a global symmetry to a state with the corresponding gauge symmetry. Indeed, symmetries may be gauged by using a duality [\onlinecite{Levin12}], and the TNOs in Ref. [\onlinecite{Haegeman15}] can be understood as a tensor network representation of the duality corresponding to gauging the symmetry. We note that, using the methods of Ref. [\onlinecite{Haegeman15}] to gauge the fermion parity symmetry in a fermionic system, one obtains a TNO that is closely related to our bosonization TNO. However, unlike the bosonization TNO, the TNO corresponding to gauging fermion parity maps to a system with fermionic degrees of freedom (although, see [\onlinecite{Zohar18}]). The inverse (or Hermitian conjugate) of our bosonization TNO (this maps a bosonic state to a fermionic state) can be understood as ``un-gauging'' fermion parity or ``fermion condensation'' [\onlinecite{Ellison19},\onlinecite{Williamson17a},\onlinecite{Aasen17}]. We emphasize that our bosonization duality is distinct from the efforts to express fermionic tensor networks in terms of bosonic tensor networks. Refs. [\onlinecite{Corboz09},\onlinecite{Corboz10},\onlinecite{Kraus10}] develop strategies for rewriting fermionic tensor network states as bosonic tensor network states. However, these do not change the state -- only its tensor network representation. The bosonization duality, in contrast, maps unentangled fermionic states to long-range entangled bosonic states. Nonetheless, our bosonization duality may prove useful for analyzing fermionic states, since expectation values of local fermionic operators can be recovered by computing the expectation value of the transformed operators in the bosonized tensor network state. Furthermore, our bosonization duality and the subsequent rewriting as an explicit bosonic tensor network state preserves the locality of the tensor network and only increases the bond dimension by a factor of 2. The remainder of the paper is structured as follows. We begin by introducing the formalism of $\mathbb{Z}_2$-graded Hilbert spaces and $\mathbb{Z}_2$-graded tensor networks. We find the language of $\mathbb{Z}_2$-graded tensor networks especially convenient for expressing our bosonization TNO, and we use the notation established in section \ref{sec:gradedTN} throughout the text. We encourage readers that are familiar with the formalism of $\mathbb{Z}_2$-grading to briefly skim section \ref{sec:gradedTN} to simply acquaint themselves with our notation. Before constructing the bosonization TNO, we review the 2D bosonization duality of Ref. [\onlinecite{ChenYA17}], in section \ref{subsec: review of 2D}. Subsequently, in section \ref{TNOrepresentation} we construct the TNO that implements this 2D bosonization duality at the level of states. After applying the bosonization TNO to a fermionic tensor network state, the resulting state is not explicitly a bosonic tensor network state. Therefore, section \ref{sec: bosonization of fPEPS} is devoted to describing an algorithmic procedure for ``removing the grading'' and rewriting a bosonized fPEPS as a bPEPS. The procedure involves summing over inequivalent spin-structures, discussed in section \ref{subsec: choosing SS}. Lastly, we note that we describe a tensor network representation of 1D bosonization in Appendices \ref{operatorduality1d} and \ref{subsec:TNbosonization1d}. \section{Tensor network bosonization duality in 2D} \label{2Dbosonization} In this section, we use the formalism of $\mathbb{Z}_2$-graded tensor networks to construct a TNO that implements the exact 2D bosonization duality of Ref. [\onlinecite{ChenYA17}]. We start by reviewing the operator-level duality, and then show that it can be naturally represented by a TNO, which we refer to as the bosonization TNO. The TNO representation allows us to easily compute the action of bosonization on quantum states (as opposed to just the action on operators). In particular, in section \ref{sec: bosonization of fPEPS}, we use the bosonization TNO to map fermionic tensor network states to bosonic tensor network states. \begin{figure} \centering \begin{tikzpicture}[Sbase,xscale=1.5,yscale=0.8] \randt; \node[berc] at ($1/2*(1)+1/2*(2) $){}; \node[berc] at ($1/2*(1)+1/2*(7) $){}; \node[berc] at ($1/2*(2)+1/2*(7) $){}; \node[berc] at ($1/2*(2)+1/2*(4) $){}; \node[berc] at ($1/2*(2)+1/2*(3) $){}; \node[berc] at ($1/2*(2)+1/2*(6) $){}; \node[berc] at ($1/2*(3)+1/2*(5) $){}; \node[berc] at ($1/2*(3)+1/2*(6) $){}; \node[berc] at ($1/2*(3)+1/2*(4) $){}; \node[berc] at ($1/2*(4)+1/2*(7) $){}; \node[berc] at ($1/2*(4)+1/2*(5) $){}; \node[berc] at ($1/2*(5)+1/2*(7) $){}; \node[berc] at ($1/2*(8)+1/2*(7) $){}; \node[berc] at ($1/2*(11)+1/2*(7) $){}; \node[berc] at ($1/2*(8)+1/2*(11) $){}; \node[berc] at ($1/2*(8)+1/2*(10) $){}; \node[berc] at ($1/2*(8)+1/2*(9) $){}; \node[berc] at ($1/2*(8)+1/2*(1) $){}; \end{tikzpicture} \begin{tikzpicture}[Sbase] \node[scale=2] at (4,-1.5) {$ \Uparrow$}; \end{tikzpicture} \begin{tikzpicture}[Sbase,xscale=1.5,yscale=0.8] \randt' \node[ferc] at ($1/3*(1)+1/3*(2)+1/3*(7) $){}; \node[ferc] at ($1/3*(2)+1/3*(4)+1/3*(7) $){}; \node[ferc] at ($1/3*(2)+1/3*(4)+1/3*(3) $){}; \node[ferc] at ($1/3*(3)+1/3*(4)+1/3*(5) $){}; \node[ferc] at ($1/3*(2)+1/3*(3)+1/3*(6) $){}; \node[ferc] at ($1/3*(3)+1/3*(5)+1/3*(6) $){}; \node[ferc] at ($1/3*(1)+1/3*(7)+1/3*(8) $){}; \node[ferc] at ($1/3*(4)+1/3*(5)+1/3*(7) $){}; \node[ferc] at ($1/3*(7)+1/3*(11)+1/3*(8) $){}; \node[ferc] at ($1/3*(5)+1/3*(7)+1/3*(11) $){}; \node[ferc] at ($1/3*(8)+1/3*(9)+1/3*(10) $){}; \node[ferc] at ($1/3*(8)+1/3*(11)+1/3*(10) $){}; \end{tikzpicture} \caption{ The bosonization duality maps a system of spinless complex fermions to a system of spin-1/2 degrees of freedom. The bottom picture shows the fermionic degrees of freedom (red circles) at each triangular face $f$. The top picture shows the spin-1/2 bosonic degrees of freedom (black circles) on each edge $e$.} \label{fig:2Dlattice} \label{fig:my_label} \end{figure} \subsection{Review of the operator-level bosonization duality} \label{subsec: review of 2D} To begin, we describe the lattice on which the duality is defined and set some notation. The duality in Ref. [\onlinecite{ChenYA17}] can be defined on an arbitrary triangulation of a 2D manifold with boundary [\onlinecite{Ellison19},\onlinecite{Djordje18}]. It is also required that the lattice has a branching structure, i.e. each edge has an orientation (see Fig.~\ref{fig:2Dlattice}) such that the edges around any triangle do not form a cycle. The branching structure yields an ordering of the vertices around a triangle and allows us to define an orientation of each triangle relative to the orientation of the underlying oriented manifold. We denote the ordered vertices of the triangular face $f$ as $f_0$, $f_1$ and $f_2$, where $f_j$ is the $j$-vertex of the triangle, and $j$ refers to the number of edges of the triangle $f$ that point toward $f_j$. We adopt the convention that a triangle is positively oriented if $f_0$, $f_1$ and $f_2$ appear in counter-clockwise order, and otherwise it is negatively oriented. Further, we label the edges of $f$ by $f_{01}$, $f_{12}$, and $f_{02}$, such that $f_{jk}$ is the edge pointing from $f_j$ to $f_k$. We also find it convenient to denote the endpoints of the edge $e$ as $e_0$ and $e_1$, with $e$ pointing from $e_0$ to $e_1$. Let us illustrate the notation above using examples from Fig.~\ref{fig:2Dlattice}. (Note that the vertices in Fig.~\ref{fig:2Dlattice} are labeled with integers arbitrarily simply to guide the discussion. They do not denote a global ordering of the vertices.) If $f = \langle 3,2,4 \rangle$ then $f_0 = \langle 3 \rangle$, $f_1 = \langle 2 \rangle$, $f_2 = \langle 4 \rangle $ and $f_{01} = \langle 3,2 \rangle$, $f_{12} = \langle 2,4 \rangle$, $f_{02} =\langle 3,4 \rangle $. Further, if $e=\langle 2,4 \rangle$, then $e_0=2$, $e_1=4$. The triangle ${\langle 8,1,7 \rangle}$ is positively oriented while ${\langle 3,2,4\rangle}$ is negatively oriented. We are now in a position to describe the fermionic degrees of freedom on the lattice and the corresponding operator algebra mapped by the bosonization duality. Each triangle $f$ hosts a spinless complex fermion, and as explained in section \ref{subsec: representing fermions}, its operator algebra is generated by Majorana operators, $\gamma_f$ and $\bar \gamma_f$. The total fermionic algebra is generated by the set of $\gamma_f, \bar \gamma_f$ for all triangles $f$. The bosonization duality is defined on a subset of the full fermionic operator algebra to ensure that the duality maps local operators to local operators. Specifically, the duality is defined on the subalgebra of even operators $\mathcal{E}$, i.e., the operators that commute with the global fermion parity operator $\prod_{f}P_{f}$, where \begin{align} P_{f}=-i\gamma_f\bar \gamma_f \end{align} is the fermion parity operator at $f$. $\mathcal{E}$ is generated by fermion parity $ P_{f}$ at each triangle $f$, and \textit{hopping operators} $S_e$ at each edge $e$ defined as: \begin{align} \label{eq:Sdefinition} S_{e} = i(-1)^{\eta_e} \gamma_{L_{e}}\bar \gamma_{R_{e}}. \end{align} Here, $L_{e}$ and $R_{e}$ denote the triangle to the left and right of the edge $e$, respectively. For example, in Fig.~\ref{fig:2Dlattice}, we have $L_{\langle 2,4 \rangle }=\langle {2,4,7} \rangle$ and $R_{\langle 2,4 \rangle} = \langle 3,2,4 \rangle$. $(-1)^{\eta_e}$ is a sign that comes from a choice of the so-called \textit{spin-structure} $\eta$ [\onlinecite{Ellison19}]. We postpone a detailed discussion of spin-structure until section \ref{subsec: choosing SS} below. For now, $\eta$ should be understood as a chosen set of edges with $\eta_e$ defined as: \begin{align} \eta_e= \begin{cases} 1 & \text{if }e \in \eta\\ 0 & \text{otherwise.} \end{cases} \end{align} As we will explain below, $\eta$ is dependent upon the branching structure, and roughly speaking, ensures that the bosonization duality is uniform across the 2D manifold. We now discuss the relations satisfied by the generators of the even algebra $\mathcal{E}$. First, all parity operators commute with each other: $P_fP_{f'} = P_{f'}P_f,$ for all $f,f'$. However, not all hopping operators commute with each other. Instead, they satisfy the following commutation relations: \begin{align} S_e S_{e'} = (-1)^{\delta_{L_e,L_{e'}}} (-1)^{\delta_{R_e,R_{e'}}} S_{e'}S_e. \end{align} That is, two hopping operators anticommute if and only if they have a common triangle to the left or to the right. For example, in Fig.~\ref{fig:2Dlattice}, $S_{\langle 2,4\rangle}$ and $S_{\langle 3,2\rangle}$ anti-commute because they have a common triangle to the right: $R_{\langle 2,4\rangle} = R_{\langle 3,2\rangle}= \langle324 \rangle$. However, $S_{\langle 2,4\rangle}$ and $S_{\langle 3,4\rangle}$ commute because they do not have a common right or left triangle. Parity operators and hopping operators anti-commute if they share a triangle: \begin{align}\label{id:PfSeReg} S_e P_f = (-1)^{\delta_{e \subset f}} P_f S_e, \end{align} otherwise they commute. ($\delta_{e \subset f}=1$ if edge $e$ is part of the triangle, otherwise it is 0.) Furthermore, the fermion parity operators and hopping operators are not independent, since for each vertex $v$, they satisfy the relation [\onlinecite{Ellison19}]: \begin{align} \label{SePfidentity} \prod_{e:e_0=v}S_e\prod_{e:e_1=v}S_e \prod_{f:f_0,f_2=v} P_f = 1. \end{align} In equation \eqref{SePfidentity}, the first product is over all edges $e$ for which the $e_0$ vertex is $v$, the second product is over all edges $e$ for which $v$ is the $e_1$ vertex, and the last product is over all triangles for which $v$ is either a $0$-vertex or a $2$-vertex. Note that the sign of $(-1)^{\eta_e}$ in the definition of the hoping operator [Eq.~\eqref{eq:Sdefinition}] is crucial to obtain $1$ on the right hand side of Eq.~\eqref{SePfidentity}. This completes our description of the algebra $\mathcal{E}$ on the fermionic side of the duality\footnote{For each non-contractible cycle of the manifold there is an additional relation between the parity operators and hopping operators. These relations correspond to a certain product of $S_e$ and $P_f$ along the cycle. With an appropriate choice of $\eta$ we are in the $+1$ sector of these relations. See \unexpanded{[\onlinecite{Djordje18}]} for more detail.}, and we move on to describe the bosonic side of the duality. On the bosonic side of the duality, as shown in Fig.~\ref{fig:2Dlattice}, we have a spin-1/2 degree of freedom at each edge $e$. The operator algebra at $e$ is generated by the Pauli operators $X_e$ and $Z_e$, and the full bosonic algebra is generated by the set containing $X_e$ and $Z_e$ for all edges $e$. The bosonization duality maps to just a subalgebra of the full bosonic algebra, where the subalgebra is defined by a certain $\mathbb{Z}_2$ gauge constraint. The explicit form for the gauge constraint will emerge naturally from the mapping of operators described below. The bosonization duality $\mathfrak{D}$, is a homomorphism from the algebra of fermion parity even operators $\mathcal{E}$ to a particular bosonic subalgebra. $\mathfrak{D}$ is defined by its action on the generators of $\mathcal{E}$, $P_f$ and $S_e$. It maps fermion parity $P_{f}$ to an operator that measures the $\mathbb{Z}_2$ flux at triangle $f$, namely: \begin{align}\label{def:Wf} W_{f} \equiv Z_{f_{01}}Z_{f_{12}}Z_{f_{02}}. \end{align} Since $S_e$ and $P_f$ anticommute whenever $e$ borders $f$, a natural first guess for the image of $S_e$ under $\mathfrak{D}$ is the operator $X_e$. $X_e$ creates a pair of $\mathbb{Z}_2$ fluxes and hence anti-commutes with the operator that measures flux on a neighboring triangle. However, mapping $S_e$ to $X_e$ does not preserve the commutation relations with the other hopping operators. To remedy this, we dress $X_e$ with Pauli $Z$ operators: \begin{align} \label{def:Ue} U_e \equiv X_e \prod_{ f \in \lbrace L_e, R_e \rbrace} Z_{f_{01}}^{\delta_{e,f_{12}}}. \end{align} In words, the expression in Eq.~\eqref{def:Ue} says that if $e$ is the $f_{12}$ edge of the triangle to the left, then we include a factor of $Z_{f_{01}}$ on the $f_{01}$ edge of that triangle. Likewise, if $e$ is the $f_{12}$ edge of the triangle to the right, then we include a factor of $Z_{f_{01}}$ on the $f_{01}$ edge of that triangle. For example, looking at Fig.~\ref{fig:2Dlattice}, we have $U_{\langle 3,4\rangle} = X_{\langle 3,4\rangle}$, $U_{\langle 2,4\rangle} = X_{\langle 2,4\rangle} Z_{\langle 3,2\rangle}$, $U_{\langle 5,7 \rangle} = X_{\langle 2,7\rangle} Z_{\langle 4,5\rangle}Z_{\langle 11,5 \rangle}$, etc. Lastly, we must check that the relation in Eq.~\eqref{id:PfSeReg} is preserved by the bosonization duality. For each vertex $v$, we find: \begin{align} \label{2UWrel1} \prod_{e:e_0=v}U_e\prod_{e:e_1=v}U_e \prod_{f:f_0,f_2=v} W_f=G_v, \end{align} where $G_v$ is equal to: \begin{align} \label{Gp} G_v=\prod_{e \supset v }X_{e} \prod_{f: f_0=v} W_{f}. \end{align} {The first product in Eq.~\eqref{Gp} is over all edges $e$ connected to $v$.} Thus, to preserve the relation \eqref{id:PfSeReg}, we need to impose the gauge constraint $G_v=1$ for all $v$. Denoting by $\mathcal{G}$ the bosonic subalgebra generated by the set of $W_{f}$ and $U_e$ with the gauge constraint $G_v=1$ for all $v$, we see that the 2D bosonization duality $\mathfrak{D}$ is a {{bijective}} map from $\mathcal{E}$ to $\mathcal{G}$ defined by: \begin{align} \label{def:duality2D} \mathfrak{D}(P_{f}) &= W_{f}, \nonumber\\ \mathfrak{D}(S_e) &= U_e. \end{align} The choice of spin-structure $\eta$ ensures that the gauge constraint on the bosonic side of the duality is $G_v=1$ at every vertex $v$. In section \ref{sec: bosonization of fPEPS}, we detail a prescription for choosing a suitable spin structure $\eta$. \subsection{TNO representation of the 2D duality } \label{TNOrepresentation} Having reviewed both $\mathbb{Z}_2$-graded tensor networks and the operator-level 2D bosonization duality, we can now describe one of our main results -- a realization of 2D bosonization at the level of quantum states. To accomplish this, we represent the bosonization duality $\mathfrak{D}$ in Eq.~\eqref{def:duality2D} using a TNO, $\M{D}$. We say that a TNO $\M{D}$ represents the duality $\mathfrak{D}$, if it satisfies: \begin{align} \label{dualitytno1} \begin{tikzpicture}[Sbase] \draw[red,loosely dotted] (-0.25,0)--(0,0); \draw[red,loosely dotted] (3,0)--(3.25,0); \foreach \j in {0.5,1,...,2.5} {\draw[red] (\j,0)--+(0,-1); } \foreach \j in {0.25,0.75,...,2.75} {\draw[black!99] (\j,0)--+(0,1);} \draw[draw=black,fill=white] (0.95,-0.8) rectangle node{A} ++(1.1,0.4); \draw[black,fill=white] (0,-0.15) rectangle (3,0.15); \node at (1.5,0) {$ \mathsf{D}$}; \end{tikzpicture} = & \begin{tikzpicture}[Sbase] \node at (1.5,0) {$ \mathsf{D}$};\draw[red,loosely dotted] (-0.25,0)--(0,0); \draw[red,loosely dotted] (3,0)--(3.25,0); \foreach \j in {0.5,1,...,2.5} {\draw[red] (\j,0)--+(0,-1); } \foreach \j in {0.25,0.75,...,2.75} {\draw[black!99] (\j,0) --+(0,1); } \draw[draw=black,fill=white] (0.65,0.35) rectangle node{$\mathfrak{D}(A)$} ++(1.75,0.45); \draw[black,fill=white] (0,-0.15) rectangle (3,0.15); \node at (1.5,0) {$ \mathsf{D}$}; \end{tikzpicture}, \end{align} for all fermion parity even operators $A \in \mathcal{E}$. Algebraically, this is: \begin{align} \label{MDdef} \M{D} \boldsymbol{{\cdot}} A = \mathfrak{D}(A) \boldsymbol{{\cdot}}\M{D}. \end{align} In Eq.~\eqref{MDdef}, we have used the operation $\boldsymbol{{\cdot}}$ defined in section \ref{subsec:contraction} for the contraction of $\mathbb{Z}_2$-graded tensors. For Eq.~\eqref{MDdef} to hold, it suffices to show that $\M{D}$ satisfies Eq.~\eqref{MDdef} for the generators of $\mathcal{E}$, since for any $A,B,C \in \mathcal{E}$ we have: \begin{align} \M{D} \boldsymbol{{\cdot}} (AB+C)= & \M{D} \boldsymbol{{\cdot}} AB+ \M{D} \boldsymbol{{\cdot}} C\nonumber\\ =& \mathfrak{D}(A) \boldsymbol{{\cdot}} \M{D} \boldsymbol{{\cdot}} B + \mathfrak{D}(C) \boldsymbol{{\cdot}} \M{D}\nonumber \\ =& \mathfrak{D}(A)\mathfrak{D}(B) \boldsymbol{{\cdot}} \M{D} + \mathfrak{D}(C) \boldsymbol{{\cdot}} \M{D} \nonumber\\ =& \mathfrak{D}(AB+C) \boldsymbol{{\cdot}} \M{D} \end{align} Hence, we need only find a $\M{D}$ that satisfies: \begin{subequations} \begin{align} \M{D} \boldsymbol{{\cdot}} P_{f} =& W_{f} \boldsymbol{{\cdot}} \M{D} \label{dualityconstraint1} \\ \M{D} \boldsymbol{{\cdot}} S_e=& U_e \boldsymbol{{\cdot}} \M{D}, \label{dualityconstraint2} \end{align} \end{subequations} for all triangles $f$ and edges $e$. To this end, we propose the TNO ansatz for $\mathsf{D}$ shown in Fig.~\ref{fig:2DTNO}. \begin{figure} \centering \begin{tikzpicture}[Sbase,xscale=1.7,yscale=1.4] \randt; \Fposf{(1)}{(2)}{(7)}{(0,0.2,-0.5)}; \Fnegf{(3)}{(2)}{(4)}{(0,0.2,-0.5)}; \Fnegf{(3)}{(5)}{(6)}{(0,0,-0.7)}; \Fnegf{(3)}{(4)}{(5)}{(0,0,-0.7)}; \Fposf{(2)}{(4)}{(7)}{(0,0,-0.7)}; \Fposf{(3)}{(2)}{(6)}{(0,0,-0.7)}; \Fposf{(4)}{(5)}{(7)}{(0.3,0,-0.2)}; \Fnegf{(8)}{(11)}{(7)}{(0.2,0,-0.5)}; \Fposf{(1)}{(7)}{(8)}{(0,0,-0.7)}; \Fnegf{(8)}{(10)}{(11)}{(0,0,-0.7)}; \Fposf{(9)}{(8)}{(10)}{(0,0,-0.7)}; \Fnegf{(11)}{(5)}{(7)}{(0,0,-0.7)}; \Btwopf{(1)}{(2)}{(0,0,0.4)};\Btwopf{(1)}{(7)}{(0,0,0.4)};\Btwopf{(2)}{(7)}{(0,-0.2,0.2)}; \Btwopf{(2)}{(4)}{(0,0,0.4)};\Btwopf{(3)}{(2)}{(0,0,0.4)};\Btwopf{(6)}{(2)}{(0,0,0.4)};\Btwopf{(3)}{(5)}{(0,0,0.4)};\Btwopf{(3)}{(6)}{(0,0,0.4)};\Btwopf{(3)}{(4)}{(0,-0.1,0.3)};\Btwopf{(4)}{(7)}{(0,0,0.4)};\Btwopf{(4)}{(5)}{(0,0,0.4)};\Btwopf{(5)}{(7)}{(-0.2,0,0.2)};\Btwopf{(7)}{(8)}{(0,0,0.4)};\Btwopf{(7)}{(11)}{(0,0,0.4)};\Btwopf{(8)}{(11)}{(-0.2,0,0.3)};\Btwopf{(8)}{(10)}{(0,0,0.4)};\Btwopf{(8)}{(9)}{(0,0,0.4)};\Btwopf{(1)}{(8)}{(0,0,0.4)}; \end{tikzpicture} \caption{TNO representation of the bosonization duality on a general triangulation of a 2D torus. The TNO is constructed from three types of tensors: $\mathsf{F}$ on positive triangles (downward pointing triangular nodes), $\bar \mathsf{F}$ on negative triangles (upward pointing triangular nodes), and $\mathsf{B}_\eta$ on edges (circular nodes). The TNO is a map from the fermionic legs (red legs, pointing towards the triangular nodes from behind) of $\mathsf{F}$ and $\bar \mathsf{F}$ tensors to the bosonic legs of $\mathsf{B}_\eta$ (black legs, pointing out of the page). } \label{fig:2DTNO} \end{figure} \begin{figure*} \centering \begin{minipage}{\linewidth} \begin{tikzpicture}[Sbase] \pic[ scale=1.3] at (0,0) {newf}; \end{tikzpicture}= \begin{tikzpicture}[Sbase] \pic[ scale=1.3] at (0,0) {newf}; \node[OP,scale=0.8] at (d) {$P$}; \node[OP] at (a) {$P$};\node[OP] at (b) {$P$};\node[OP] at (c) {$P$}; \end{tikzpicture}=\begin{tikzpicture}[Sbase] \pic[ scale=1.3] at (0,0) {newf}; \node[OP] at (a) {$\gamma $};\node[OP] at (c) {$P$};\node[OP,scale=0.8] at (d) {$\gamma$}; \path (d)++(0.3,0)node[red,scale=0.8]{1}; \path (c)++(0,-0.3)node[red,scale=0.8]{2}; \end{tikzpicture}=\begin{tikzpicture}[Sbase] \pic[ scale=1.3] at (0,0) {newf}; \node[OP] at (c) {$\gamma $};\node[OP,scale=0.8] at (d) {$\gamma$}; \path (d)++(0.3,0)node[red,scale=0.8]{1}; \path (c)++(0,-0.3)node[red,scale=0.8]{2}; \end{tikzpicture}=\begin{tikzpicture}[Sbase] \pic[ scale=1.3] at (0,0) {newf}; \node[OP] at (b) {$\gamma $};\node[OP,scale=0.8] at (d) {$i\bar \gamma$}; \path (d)++(0.3,0)node[red,scale=0.8]{1}; \path (b)++(-0.3,0)node[red,scale=0.8]{2}; \end{tikzpicture} \end{minipage} \vspace{1cm} \begin{minipage}{\linewidth} \begin{tikzpicture}[Sbase] \pic[ scale=1.3] at (0,0) {newfbar}; \end{tikzpicture}= \begin{tikzpicture}[Sbase] \pic[ scale=1.3] at (0,0) {newfbar};\node[OP,scale=0.8] at (d) {$P$}; \node[OP] at (a) {$P$};\node[OP] at (b) {$P$};\node[OP] at (c) {$P$}; \end{tikzpicture}=\begin{tikzpicture}[Sbase] \pic[ scale=1.3] at (0,0) {newfbar};\node[OP,scale=0.8] at (d) {$i\bar \gamma$}; \node[OP] at (a) {$\gamma $};\node[OP] at (c) {$P$}; \path (d)++(-0.3,0)node[red,scale=0.8]{1}; \path (a)++(0,-0.3)node[red,scale=0.8]{2}; \end{tikzpicture}=\begin{tikzpicture}[Sbase] \pic[ scale=1.3] at (0,0) {newfbar}; \node[OP] at (c) {$\gamma $};\node[OP,scale=0.8] at (d) {$i\bar \gamma$}; \path (d)++(-0.3,0)node[red,scale=0.8]{1}; \path (c)++(0,-0.3)node[red,scale=0.8]{2}; \end{tikzpicture}=\begin{tikzpicture}[Sbase] \pic[ scale=1.3] at (0,0) {newfbar}; \node[OP] at (b) {$\gamma $};\node[OP,scale=0.8] at (d) {$\gamma$}; \path (d)++(-0.3,0)node[red,scale=0.7]{1}; \path (b)++(-0.3,0)node[red,scale=0.7]{2}; \end{tikzpicture} \end{minipage} \begin{minipage}{0.8\linewidth} \begin{tikzpicture}[Sbase,scale=1] \Bnorthp; \end{tikzpicture}= \begin{tikzpicture}[Sbase,scale=1] \Bnorthp; \node[OP] at (b) {$P $};\node[OP] at (c) {$P $}; \end{tikzpicture}= \begin{tikzpicture}[Sbase,scale=1] \Bnorthp;\node[OP] at (b) {$P $};\node[OP] at (a) {$ Z$}; \end{tikzpicture} = $(-1)^{\eta_e}$ \begin{tikzpicture}[Sbase,scale=1] \Bnorthp;\node[OP] at (b) {$\gamma $};\node[OP] at (c) {$\gamma $};\node[OP] at (a) {$X$}; \path (b)++(0,0.3)node[red,scale=0.7] {$2$}; \path (c)++(0,0.3)node[red,scale=0.7] {$1$}; \end{tikzpicture} \end{minipage} \caption{Graphical representation of the symmetries in Eqs.~\eqref{F2sym}, \eqref{F2sym2}, and \eqref{B2sym} for tensors $\mathsf{F}[f]$ (downward pointing triangular nodes), $\bar\mathsf{F}[f]$ (upward pointing triangular nodes), and $\mathsf{B}_\eta[e]$ (circular nodes). } \label{fig:2Dsym} \end{figure*} The ansatz depicted in Fig.~\ref{fig:2DTNO} is created by contracting together three kinds of tensors: tensors $\mathsf{F}[f]$ on positivly oriented triangles, tensors $\bar \mathsf{F}[f]$ on negativly oriented triangles, and tensors $\mathsf{B}_\eta[e]$ on edges. In explicit component form, the tensors $\mathsf{F}[f]$ and $\bar\mathsf{F}[f]$ are: \begin{align} \mathsf{F}[f]\equiv &\sum_{j,a,b,c} F^j_{a,b,c}|c)_{f_{01}}|a)_{f_{12}}(b|_{f_{02}} (j|_f\nonumber\\ \bar \mathsf{F}[f] \equiv & \sum_{j,a,b,c} \bar{F}^j_{a,b,c}|b)_{f_{02}}(a|_{f_{12}}(c|_{f_{01}}(j|_f, \end{align} where all sums are over binary values. Diagrammatically, we represent $\mathsf{F}[f]$ and $\bar\mathsf{F}[f]$ respectively as: \begin{align} \begin{tikzpicture}[Sbase,scale=1.5] \pic at (0,0) {newf}; \end{tikzpicture}, \, \begin{tikzpicture}[Sbase,scale=1.5] \pic at (0,0) {newfbar}; \end{tikzpicture}. \end{align} The legs labeled by $f$ are the physical legs and extend into the page. These legs contract with fermionic operators or a fermionic tensor network state when the TNO is applied. The tensor $\mathsf{B}_{\eta}[e]$ at each edge is obtained by making a spin-structure dependent modification to a tensor $\mathsf{B}[e]$. $\mathsf{B}[e]$ has the component form: \begin{align} \mathsf{B}[e]=\sum_{j,a,b} B^j_{a,b}|a)_e|j\rangle_e (b|_e, \end{align} while the component form of $\mathsf{B}_{\eta}[e]$ is: \begin{align} \mathsf{B}_{\eta}[e] =& Z^{\eta_e}_e\boldsymbol{{\cdot}} \mathsf{B} \nonumber\\ =& \sum_{j,a,b} (-1)^{j\eta_e}B^j_{a,b}|a)_e|j\rangle_e (b|_e, \end{align} which is pictorially represented as: \begin{align} \begin{tikzpicture}[Sbase] \Bnorthp; \end{tikzpicture} \equiv \begin{tikzpicture}[Sbase] \Bnorth; \node[OP] at (1,0,1.5) {$Z^{\eta_e}$}; \end{tikzpicture}. \end{align} The darker node on the left hand side represents $\mathsf{B}_{\eta}$, and the lighter node on the right hand side represents $\mathsf{B}$. The physical legs are bosonic Hilbert spaces depicted in black and pointing out of the page. Now, we view the constraints in \eqref{dualityconstraint1} and \eqref{dualityconstraint2} as symmetries of the tensor $\M{D}$. These symmetries can be further reduced to symmetries of the local tensors of $\mathsf{D}$, which then fixes the values of the local tensors. Indeed, we now show that $\mathsf{D}$ satisfies Eqs.~\eqref{dualityconstraint1} and \eqref{dualityconstraint2}, if the local tensors $\mathsf{F}$, $\bar \mathsf{F} $ and $\mathsf{B}$ satisfy the symmetries depicted in Fig.~\ref{fig:2Dsym}. Algebraically, we write the symmetries for $\mathsf{F}[f]$ and $\bar\mathsf{F}[f]$ as: \begin{align}\label{F2sym} \mathsf{F} &= P_{f_{01}}\boldsymbol{{\cdot}} P_{f_{12}}\boldsymbol{{\cdot}} \mathsf{F} \boldsymbol{{\cdot}} P_{f_{02}}\boldsymbol{{\cdot}} P_f = P_{f_{01}} \boldsymbol{{\cdot}} \gamma_{f_{12}}\boldsymbol{{\cdot}} \mathsf{F}\boldsymbol{{\cdot}} \gamma_f \nonumber \\ &=\gamma_{f_{01}}\boldsymbol{{\cdot}} \mathsf{F}\boldsymbol{{\cdot}} \gamma_f = \mathsf{F}\boldsymbol{{\cdot}} \gamma_{f_{02}} \boldsymbol{{\cdot}} i\bar \gamma_f \\ \label{F2sym2} \bar\mathsf{F} &= P_{f_{02}} \boldsymbol{{\cdot}} \bar\mathsf{F} \boldsymbol{{\cdot}} P_{f_{01}}\boldsymbol{{\cdot}} P_{f_{12}}\boldsymbol{{\cdot}} P_f= \bar\mathsf{F} \boldsymbol{{\cdot}} \gamma_{f_{12}} \boldsymbol{{\cdot}} P_{f_{01}}\boldsymbol{{\cdot}} i\bar \gamma_f \nonumber \\ &=\bar\mathsf{F}\boldsymbol{{\cdot}} \gamma_{f_{01}}\boldsymbol{{\cdot}} i\bar \gamma_f=\gamma_{f_{02}}\boldsymbol{{\cdot}} \bar\mathsf{F} \boldsymbol{{\cdot}} \gamma_f \end{align} and the symmetries for $\mathsf{B}[e]$ can be written as: \begin{align}\label{B2sym} \mathsf{B}_{\eta}=P_e\boldsymbol{{\cdot}} \mathsf{B}_{\eta}\boldsymbol{{\cdot}} P_e = P_e\boldsymbol{{\cdot}} Z_e\boldsymbol{{\cdot}} \mathsf{B}_{\eta} = (-1)^{\eta_e}\gamma_e\boldsymbol{{\cdot}} X_e \boldsymbol{{\cdot}} \mathsf{B}_{\eta} \boldsymbol{{\cdot}} \gamma_e, \end{align} where the contractions in Eqs.~\eqref{F2sym}, \eqref{F2sym2}, and \eqref{B2sym} should be read in conjunction with the diagrams in Fig.~\ref{fig:2Dsym}. We note that the first symmetries of $\mathsf{F}$, $\bar\mathsf{F}$, and $\mathsf{B}$ imply that each of these tensors is fermion parity even. To see how the symmetries of the local tensors ensure that $\mathsf{D}$ satisfies the relations in Eqs.~\eqref{dualityconstraint1} and \eqref{dualityconstraint2} we use the graphical representations of the symmetries shown in Fig.~\ref{fig:2Dsym}. For example, consider the action of the TNO on the parity operator at face $f$: \begin{align*} \M{D} \boldsymbol{{\cdot}} P_{f} &= \begin{tikzpicture}[Sbase] \DP; \node[OP]at (a){$P$}; \end{tikzpicture}\nonumber \\* & = \begin{tikzpicture}[Sbase] \DP; \path (-30:{sqrt(3)})+(-30:0.4)node[OP]{$P$}+(90:0.4)node[OP]{$P$}+(-150:0.4)node[OP]{$P$}; \end{tikzpicture}\nonumber \\* & =\begin{tikzpicture}[Sbase] \DP; \node[OP]at (b){$Z$};\node[OP]at (c){$Z$};\node[OP]at (d){$Z$}; \end{tikzpicture} \nonumber \\* & = W_f \boldsymbol{{\cdot}} \M{D}. \end{align*} Here, we have applied the symmetries of $\mathsf{F}[f]$ and $\mathsf{B}$ in succession to show that $\mathsf{D}$ satisfies Eq.~\eqref{dualityconstraint1}. Similarly, for hopping operator we have: \begin{align} \M{D} \boldsymbol{{\cdot}} S_{e} & = (-1)^{\eta_e} \begin{tikzpicture}[Sbase,scale=0.9] \path (30:{sqrt(3)})++(0,0.25,-0.5)node[OP]{$i\bar \gamma$}; \path (30:{2*sqrt(3)})++(0,0,-1)node[OP]{$\gamma$};\DSsw; \path (30:{sqrt(3)})++(0,0.25,-0.5)++(0,0.45)node[red,scale=0.8]{2}; \path (30:{2*sqrt(3)})++(0,0,-1)++(0.3,0)node[red,scale=0.8]{1}; \end{tikzpicture} \nonumber \\ & = (-1)^{\eta_e}\begin{tikzpicture}[Sbase,scale=0.9] \DSsw ; \path (30:{sqrt(3)}) --node[OP,pos=1/4]{$\gamma$}node[OP,pos=3/4]{$\gamma$} (30:{2*sqrt(3)}); \path (30:{sqrt(3)})++(150:{sqrt(3)/4})node[OP]{$P$}; \path (30:{sqrt(3)})++(0,0.4) --node[red,scale=0.8,pos=1/4]{2}node[red,scale=0.8,pos=3/4]{1} ++(30:{sqrt(3)}); \end{tikzpicture} \nonumber \\ & =\begin{tikzpicture}[Sbase,scale=0.9] \DSsw; \path (60:3/2)++(0,0,1)node[OP]{$Z$}; \path (30:{3/2*sqrt(3)})++(0,-.25,0.5)node[OP]{$X$}; \end{tikzpicture} \nonumber \\* & =U_e \boldsymbol{{\cdot}} \M{D}. \end{align} Thus, $\mathsf{D}$ satisfies \eqref{dualityconstraint2} as well. This implies that $\mathsf{D}$ formed from $\mathsf{F}$, $\bar\mathsf{F}$, and $\mathsf{B}_\eta$ is indeed a representation of the operator-level duality of Ref. [\onlinecite{ChenYA17}]. The tensors $\mathsf{F}$, $\bar\mathsf{F}$, and $\mathsf{B}$ can be computed explicitly using their symmetries in Fig.~\ref{fig:2Dsym}. This is because the symmetries are independent, commute with each other, and square to identity. Hence, for $\mathsf{F}$ and $\bar\mathsf{F}$, they form a $\mathbb{Z}_2^5$ symmetry group, and for $\mathsf{B}$ they form a $\mathbb{Z}_2^3$ symmetry group. Since $\mathsf{F}$ and $\bar\mathsf{F}$ belong to $2^5$ dimensional spaces, and $\mathsf{B}$ belongs to a $2^3$ dimensional space, their symmetries fix their values uniquely up to a normalization factor. It can be shown that the following tensors satisfy their respective symmetries: \begin{align} \label{FFbarBexp} \mathsf{F}[f] \propto & \sum_{a,b,c}|c)_{f_{01}}|a)_{f_{12}}(b|_{f_{02}} (a+b+c|_f \nonumber\\ \bar \mathsf{F}[f] \propto & \sum_{a,b,c} |b)_{f_{02}}(c|_{f_{01}}(a|_{f_{12}} (a+b+c|_f \nonumber\\ \mathsf{B}[e] \propto & \sum_{a} |a)_{e}|a\rangle_{e}(a|_{e}. \end{align} Remember that all indices take values in $\{0,1\}$, and $a+b+c \equiv a+b+c \text{ mod }2$. \subsection{Bosonization of quantum states} We are now able to define the bosonization of quantum states, wherein a fermionic state is bosonized by simply applying the bosonization TNO. Before providing a simple example, we comment on constraints of the state-level duality that arise from the symmetries of $\mathsf{D}$. In particular, we show that fermion parity odd states belong to the kernel of $\mathsf{D}$ and that $\mathsf{D}$ maps to bosonic states satisfying the constraint $G_v=1$ for all $v$. Hence, fermion parity even states are mapped to bosonic states in a certain $\mathbb{Z}_2$ gauge theory. To show that fermion parity odd states are in the kernel of the bosonization TNO, we use that $\prod_f W_f=1$ on a closed manifold. This leads to: \begin{align}\label{eq:domainD1} \mathsf{D}=\prod_f W_f \boldsymbol{{\cdot}} \mathsf{D} = \mathsf{D} \boldsymbol{{\cdot}} \prod_f P_f. \end{align} When $\mathsf{D}$ is applied to a fermionic state $|\psi_f)$, Eq.~\eqref{eq:domainD1} implies: \begin{align} \mathsf{D}|\psi_f)=\mathsf{D} \boldsymbol{{\cdot}} \prod_f P_f |\psi_f). \end{align} Thus, if $|\psi_f)$ is fermion parity odd, we have: ${\prod_f P_f |\psi_f)=-|\psi_f)}$, and it must be that $\mathsf{D}|\psi_f)=0$. The constraints on the image of $\mathsf{D}$ can be determined using the relation in Eq.~\eqref{SePfidentity}. We see that: \begin{align} \mathsf{D} =& \mathsf{D} \boldsymbol{{\cdot}} \left(\prod_{e:e_0=v}S_e\prod_{e:e_1=v}S_e \prod_{f:f_0,f_2=v} P_f\right) \nonumber\\ =& \left(\prod_{e:e_0=v}U_e\prod_{e:e_1=v}U_e \prod_{f:f_0,f_2=v} W_f\right) \boldsymbol{{\cdot}} \mathsf{D} \nonumber\\ =& G_v \boldsymbol{{\cdot}} \mathsf{D} .\nonumber \end{align} Hence, for any bosonic state $\langle \psi_b|$: \begin{align} \langle \psi_b| \mathsf{D} = \langle \psi_b| G_v \boldsymbol{{\cdot}} \mathsf{D}, \end{align} which implies that $\mathsf{D}$ projects to the $G_v=1$ subspace for each vertex $v$. Now, we give a first example of the state-level duality and use the symmetries of $\mathsf{D}$ to show that the bosonization of an atomic insulator state yields a ground state of the toric code (a deconfined $\mathbb{Z}_2$ gauge theory). The atomic insulator state $|\psi_{AI})$ is the unique ground state of the Hamiltonian: $H_{AI}=-\sum_f P_f$. $H_{AI}$ is certainly unfrustrated, so $|\psi_{AI})$ satisfies $P_f|\psi_{AI})=|\psi_{AI})$ for all $f$. Applying $\mathsf{D}$ to $|\psi_{AI})$, we find: \begin{align} \mathsf{D} |\psi_{AI})= \mathsf{D} \boldsymbol{{\cdot}} P_f |\psi_{AI}) = W_f \boldsymbol{{\cdot}} \mathsf{D} |\psi_{AI}),\, \forall f. \end{align} Therefore, the bosonized state $\mathsf{D} |\psi_{AI})$ is in the $+1$ eigenspace of $W_f$ for all $f$. Given the constraint on the image of $\mathsf{D}$, the bosonized state is also in the $+1$ eigenspace of $G_v$ for all $v$. Hence, $\mathsf{D} |\psi_{AI})$ is a ground state of the unfrustrated Hamiltonian ${H=-\sum_v G_v-\sum_f W_f}$. Recalling the definition of $G_v$ defined in Eq.~\eqref{Gp}: \begin{align} G_v=\prod_{e \supset v }X_{e} \prod_{f: f_0=v} W_{f}, \end{align} we see that the $G_v$ terms in $H$ can be replaced by $\prod_{e \supset v }X_{e}$ without changing the ground states. (${G_v=\prod_{e \supset v }X_{e}}$ in the subspace where $W_f=1$.) Thus, $\mathsf{D} |\psi_{AI})$ is a ground state of the toric code Hamiltonian ${H_{TC}=-\sum_v \prod_{e \supset v }X_{e}-\sum_f W_f}$. To gain intuition for the mapping, we consider acting with $\mathsf{D}$ on a state with non-trivial fermion occupancy. In particular, we apply a hopping operator $S_e$ at edge $e$ to the atomic insulator state $|\psi_{AI})$ to obtain a state with fermions at the two faces neighboring $e$. The image of $S_e|\psi_{AI})$ under $\mathsf{D}$ is: \begin{align} \mathsf{D} \boldsymbol{{\cdot}} S_e |\psi_{AI}) = U_e \boldsymbol{{\cdot}} \mathsf{D} |\psi_{AI}) = U_e |\psi_{TC}\rangle. \end{align} $U_e$ (defined in Eq.\eqref{def:Ue}) creates a $\mathbb{Z}_2$ flux ($-1$ eigenvalue of $W_f$) at each face bordering the edge $e$ and moves $\mathbb{Z}_2$ charges ($-1$ eigenvalue of $\prod_{e \supset v }X_{e}$) to the $0$-vertices of $L_e$ and $R_e$. A $\mathbb{Z}_2$ flux bound to a $\mathbb{Z}_2$ charge has fermionic statistics -- it is an \textit{emergent} fermion. Therefore, physical fermions are mapped to emergent fermions in the $\mathbb{Z}_2$ gauge theory. The gauge constraint $G_v=1,\, \forall v$ removes ambiguity in this mapping, since it enforces that charges are bound to fluxes, with the charges located at the $0$-vertex of the corresponding triangle. Any fermion parity even state can be created from $|\psi_{AI})$ by applying operators in $\mathcal{E}$. Hence, one strategy for mapping an arbitrary even fermion parity state $|\psi_f)$ is to identify an even operator $\mathcal{O}\big(\{S_e\}_e,\{P_f\}_f\big)$, written here explicitly in terms of the generators of $\mathcal{E}$, such that: \begin{align} {|\psi_f)=\mathcal{O}{\big(}\{S_e\}_e,\{P_f\}_f{\big)}|\psi_{AI})}. \end{align} Then, the duality maps: \begin{align} |\psi_f) \rightarrow \mathcal{O}\big(\{U_e\}_e,\{W_f\}_f\big)|\psi_{TC}). \end{align} In general, it may be challenging to find an operator, expressed in terms of the generators of $\mathcal{E}$, that creates $|\psi_f)$ from $|\psi_{AI})$. Moreover, the analysis of bosonizing states, thus far, has only required the operator-level bosonization duality. In the next section, we illustrate the true potential of the bosonization TNO. Given a fermion parity even state $|\psi_f)$ constructed from the contraction of local tensors, we show that $|\psi_f)$ can be bosonized by using $\mathsf{D}$ to modify each of the local tensors. The resulting state can then be written as a bosonic tensor network state.
\section{Appendix} {\it Convexity of the Weight.---} Consider two devices $D$ and $E$ and their mixture $pD+(1-p)E$, with $p\in[0,1]$. One can write \begin{eqnarray} D&=&(1-\omega)D_F+\omega\Tilde{D}, \\ E&=&(1-\nu)E_F+\nu \Tilde{E}, \end{eqnarray} where this denotes the optimal solutions to the optimisation problem in Eq.~\eqref{WeightDev}, i.e., $\mathcal{W}(D)=\omega$ and $\mathcal{W}(E)=\nu$. We define new variables by \begin{eqnarray} \mu &=& p\omega + (1-p)\nu \\ M_F &=& \frac{p(1-\omega)D_F + (1-p)(1-\nu) E_F}{1-\mu}\\ \Tilde{M} &=& \frac{p\omega \Tilde{D} + (1-p)\nu \Tilde{E}}{\mu} \end{eqnarray} This allows us to write the mixture $pD+(1-p)E=(1-\mu)M_F+\mu \Tilde{M}$. The weight of the mixture $\mathcal{W}(pD+(1-p)E)$, is given by an optimal triplet $(\Tilde{\mu},N_F,\Tilde{N})$ for which \begin{equation} pD+(1-p)E = (1-\Tilde{\mu})N_F+\Tilde{\mu}\Tilde{N}. \end{equation} From the optimality of $\Tilde{\mu}$ we can conclude that $\Tilde{\mu}\leq \mu$ and thus $\mathcal{W}(pD+(1-p)E)\leq p\mathcal{W}(D)+(1-p)\mathcal{W}(E)$. \textit{Convex weight for transformations---} Here we provide the technical details needed for the derivation of the convex weight in the case of transformations, with special attention being given to channels. Consider a pair of Hilbert spaces $\mathcal{H}, \mathcal{K}$---with their respective spaces $\mathcal{L}(\mathcal{H}),\mathcal{L}(\mathcal{K})$ of operators---and the set $T(\mathcal{H},\mathcal{K})$ of all transformations, i.e., completely positive trace-non-increasing maps, $\mI:\mathcal{L}(\mathcal{H})\rightarrow\mathcal{L}(\mathcal{K})$. In the case that a given transformation is trace-preserving, we refer to it as a channel and denote it by $\Lambda$; the set $C(\mathcal{H},\mathcal{K})$ of all channels from $\mathcal{L}(\mathcal{H})$ to $\mathcal{L}(\mathcal{K})$ is a strict subset of $T(\mathcal{H},\mathcal{K})$. It is important to note for our purposes that $T(\mathcal{H},\mathcal{K})$ is convex. For a given channel $\mI\in T(\mathcal{H},\mathcal{K})$ we define the \emph{Choi matrix} $J_{\mI}\in \mathcal{L}(\mathcal{H}\otimes\mathcal{K})$ via $J_{\mI} = (id\otimes \mI)\proj{\psi^+}$, where $\ket{\psi^+}= 1/\sqrt{d}\ \sum_i \ket{i i} \in\mathcal{H}\otimes\mathcal{H}$ and $d=\dim(\mathcal{H})$. In the case that we are dealing with a channel $\Lambda$ the Choi matrix $J_\Lambda$ is both positive and of unit trace (for a transformation it is just positive), hence it is a state on $\mathcal{H}\otimes\mathcal{K}$ known as the \emph{Choi state} of $\Lambda$. We may retrieve the original transformation from the Choi matrix via \begin{equation}\label{eq:Choiinvert} \mI(\rho) = d \ \tr[\mathcal{H}]{(\rho^T\otimes \ensuremath{\openone}_\mathcal{K})J_{\mI}}, \end{equation} where $\tr[\mathcal{H}]{\cdot}$ denotes the partial trace over $\mathcal{H}$ and the $T$ superscript denotes transposition with respect to the computational basis. This corresponds to an inverse of the map $\mI \mapsto J_{\mI}$, and hence the map is an isomorphism. We denote by $F\subset C(\mathcal{H},\mathcal{K})$ the set of \emph{free channels}, which are defined to be the channels satisfying $\mathcal{R}(\Lambda)=0$ for some resource measure $\mathcal{R}:C(\mathcal{H},\mathcal{K})\rightarrow \mathbb{R}$. The free set varies depending on the intended resource---with examples being entanglement breaking, unitary and LOCC channels---though the most important point from our perspective is that such sets are themselves convex. We denote by $C_{J_F} = \{t J_\Gamma | t\geq 0, \Gamma\in F \}$ the cone spanned by the image of the set $F$ under the Choi isomorphism. For a given free set $F$, the \emph{convex weight} $\mathcal{W}_F$ of a channel is the largest degree to which that channel can be seen as an element of $F$. More explicitly, it is given by \begin{equation} \label{WeightChanPrimal} \begin{split} \mathcal{W}_F(\Lambda) = &\min \lambda\\ &\mathrm{s.t.:}\ \Lambda= (1-\lambda) \Gamma + \lambda \Tilde{\Lambda},\\ & \Gamma\in F, \quad \Tilde{\Lambda}\in C(\mathcal{H},\mathcal{K}). \end{split} \end{equation} If we apply the Choi isomoprhism, then Equation \eqref{WeightChanPrimal} can be rewritten in terms of the corresponding Choi states: \begin{equation} \begin{split} \mathcal{W}_F(\Lambda) = &\min \lambda\\ &\mathrm{s.t.:}\ J_\Lambda = (1-\lambda) J_\Gamma + \lambda J_{\Tilde{\Lambda}}, \\ & J_\Gamma\in J_F, \quad \Tilde{\Lambda}\in C(\mathcal{H},\mathcal{K}). \end{split} \end{equation} We wish to remove $J_{\Tilde{\Lambda}}$, and so we rearrange to $J_{\Tilde{\Lambda}} = \frac{1}{\lambda} (J_\Lambda - J_{\hat{\Gamma}})$, where $J_{\hat{\Gamma}}= (1-\lambda) J_\Gamma = J_{(1-\lambda) \Gamma}$. The restrictions on the convex weight are now that $J_{\Tilde{\Lambda}}$ must be positive, corresponding to the equivalent condition of complete positivity of $\Tilde{\Lambda}$, and that $J_{\hat{\Gamma}}\in C_{J_F}$. Noting that $1-\lambda$ is a nonnegative quantity, and that $1-\lambda = \tr{J_{\hat{\Lambda}}}$, we arrive at the desired form of the convex weight for the case of channels: \begin{align*} 1- \mathcal{W}_F(\Lambda) = &\max \tr{J_{\hat\Gamma}} \\ &\mathrm{s.t.:}\ J_\Lambda-J_{\hat\Gamma}\geq0,\quad J_{\hat\Gamma}\in C_{J_F}. \end{align*} \textit{Finding the convex components of a POVM and bounding the convex weight.---} To give an analytical method for finding bounds on the convex weight, we present a characterisation of all POVMs together with the respective weight that can appear in a convex decomposition of a given POVM. The technique is based on the minimal Naimark dilation and although we present it only for the discrete case, we note that the continuous case can be treated in a similar manner by using the techniques in Ref.~\cite[Theorem~1]{Pellonp2012}. We begin by recalling the a characterisation of non-normalised positive operator measures that are upper bounded by a POVM~\cite[Lemma~1]{Pellonp2014}. For this purpose, we fix a POVM $M$ with the input sigma-algebra $\Sigma$ and let $\big(\mathcal{H}_{\oplus},J,P\big)$ be its minimal (diagonal) Naimark dilation. Especially, $J^*J=\ensuremath{\openone}_\mathcal{H}$. We let $D(\mathcal{H}_\oplus)$ denote the algebra of (bounded) operators commuting with the projections $P_X$ for all $X\in\Sigma$. Let $P^J=JJ^*$ be the (minimal) Naimark projection from $\mathcal{H}_\oplus$ onto the (closed) subspace $P^J\mathcal{H}_\oplus$ of $\mathcal{H}_\oplus$; we have $\mathcal{H}\cong P^J\mathcal{H}_\oplus$. \begin{lemma} Let $N$ be a (possibly non-normalized) positive operator measure. Then $N_X\le M_X$ for all $X\in\Sigma$ if and only if there exists a (unique) $E\in D(\mathcal{H}_\oplus)$, $0\le E\leq\openone_{\mathcal{H}_\oplus}$, such that $N_X=J^*P_X EJ$ for all $X\in\Sigma$. \end{lemma} As a direct consequence we get can write for any POVM $M_1$ that is in a convex decomposition of $M$, i.e. $M_X=\lambda M_{X|1}+(1-\lambda)M_{X|2}$ for all $X\in\Sigma$ with $\lambda\in(0,1]$, the following result. \begin{theorem} There exists a unique $E_1\in D(\mathcal{H}_\oplus)$ with $0\leq E_1\leq\lambda^{-1}\openone_{\mathcal{H}_\oplus}$ and $J^* E_1 J=\openone_\mathcal{H}$ such that $M_{X|1}=J^* P_XE_1J$ for all $X\in\Sigma$. \end{theorem} Motivated by the theorem we define a mapping $T:D_{P^J}^+(\mathcal{H}_\oplus)\rightarrow \text{Comp}(M)$ by $T(E)_X=J^*P_X EJ$, where \begin{align} D_{P^J}^+(\mathcal{H}_\oplus):=\{E\in D(\mathcal{H}_\oplus)\,|\,E\geq 0,\;P^JE P^J=P^J\} \end{align} and $\text{Comp}(M)$ consists of POVMs $M_1$ for which there exists another POVM $M_2$ and a weight $\lambda\in(0,1]$ such that $M_X=\lambda M_{X|1}+(1-\lambda)M_{X|2}$ for all $X\in\Sigma$; we say that $M_1$ is a component of $M$ with the weight $\lambda$. Note that the condition $P^JE P^J=P^J$ is equivalent to $J^* E J=\openone_\mathcal{H}$ and that for all $E\in D_{P^J}^+(\mathcal{H}_\oplus)$ one has $\|E\|^{-1}\leq 1$. Hence, for any $E\in D_{P^J}^+(\mathcal{H}_\oplus)$ one can take a $\lambda$ such that $E\leq\lambda^{-1}\openone_{\mathcal{H}_\oplus}$ and write \begin{align} M_X=\lambda T[E]_X + (1-\lambda) Q_X, \end{align} where $Q_X:=\frac{1}{1-\lambda}\big[M_X-\lambda T[E]_X\big]$ clearly normalised to identity and is seen to be positive by writing $M$ using the minimal dilation. We are ready to state the following Corollary. \begin{corollary} Any number $\lambda\in(0,1]$ is a weight of a component $M_1$ if and only if $\lambda\leq\|E_1\|^{-1}$. Moreover, $M$ is extreme if and only if $D_{P^J}^+(\mathcal{H}_\oplus)=\{\openone_{\mathcal{H}_\oplus}\}$. \end{corollary} As an example of the above Corollary we take the case where the free set $F$ consists of trivial POVMs, i.e. POVMs of the form $O_i=p(i)\openone$ with $\{p(i)\}_i$ being a probability distribution. It is straight-forward to verify that a minimal dilation of a discrete POVM $M$ can be given through the isometry $J=\sum_{i,k}|e_{ik}\rangle\langle d_{ik}|$, where $\{|e_{ik}\rangle\}_{ik}$ is an orthonormal basis of the dilation space $\mathcal{H}_\oplus=\bigoplus_i\mathcal{H}_i$, $\mathcal{H}_i={\rm span}\{e_{ik}\}$, and $M_i=\sum_k|d_{ik}\rangle\langle d_{ik}|$ is the spectral decomposition of $M_i$ with orthogonal vectors $|d_{ik}\rangle\ne0$ (the eigenvalues are $\lambda_{ik}=\|d_{ik}\|^2$). In order to bound the convex weight of $M$ with respect to the set $F$ we take a POVM $O\in F$ and write it using the above minimal dilation as \begin{align} O_i=\sum_{kl}\langle e_{il} |E_i e_{ik}\rangle |d_{il}\rangle\langle d_{ik}| \end{align} where $E_i\in{\cal L}(\mathcal{H}_i)$, $E_i\ge 0$. Solving the matrix elements gives \begin{align} \langle e_{il} |E_i e_{ik}\rangle=\frac{p(i)}{\lambda_{ik}}\delta_{kl}, \end{align} where $\{\lambda_{ik}\}_k$ are the eigenvalues of the POVM element $M_i$. Now the operator $E=\sum E_i$ has the norm $\|E\|=\sup_{ik}\{p(i)\lambda_{ik}^{-1}\}$. Hence, any point from the free set gives an upper bound on the convex weight. To see this, we note that $\sup_{ik}\{p(i)\lambda_{ik}^{-1}\}=\sup_i\{p(i)\lambda_{\min(M_i)}^{-1}\}$, where $\lambda_{\min(M_i)}$ refers to the smallest eigenvalue. The optimisation over the free set corresponds to optimising over the distributions $\{p(i)\}$. It is easy to check that for a distribution that maximises the weight of a trivial component, i.e. minimises $\sup_i\{p(i)\lambda_{\min(M_i)}^{-1}\}$, one needs to have $p(i)\lambda_{\min(M_i)}^{-1}=p(j)\lambda_{\min(M_j)}^{-1}$ for all $i,j$. Namely, were this not the case for an optimal distribution, one could define another distribution that replaces the $p(i)$ and $p(j)$ that give the highest and the second highest value of $p(i)\lambda_{\min(M_i)}^{-1}$ with $\tilde p(i)=\tilde p(j):=\frac{p(i)+p(j)}{2}$. Hence, the optimal distribution is $p(i)=\lambda_{\min(M_i)}/\sum_j \lambda_{\min(M_j)}$ the trivial weight is simply $1-W_F(M)=\sum_j \lambda_{\min(M_j)}$. \textit{Finding the convex components of an instrument and bounding the convex weight.---} More generally, one can approach the convex weight of instruments and, hence, state ensembles in a similar manner~\cite[Example~2]{Pellonp2012}. A minimal Stinespring dilation of a (Heisenberg picture) instrument $\{\mathcal I_{i}^\dagger\}$ is given by an isometry $J$ and a normalized projection valued measure $\{P_i\}$ as \begin{align} \mathcal I_i^\dagger(B)=J^\dagger (B\otimes P_i) J \end{align} where $B$ is a (bounded) operator of the output space. Recall that $\tr{\mathcal I_i^\dagger(B)\rho}=\tr{B\mathcal I_i(\rho)}$ where $\rho$ is an initial state. It is straight-forward to check, using Lemma 1 of Ref.~\cite{Pellonp2014b}, that another instrument $\tilde{\mathcal I}_i^\dagger$ is a component of $\mathcal I_{i}^\dagger$ with weight $\lambda$ if and only if there exists a (unique) positive operator $E$ on the dilation space or ancilla $\mathcal{H}_\oplus$, commuting with $\{P_i\}$, such that \begin{align} \tilde{\mathcal I}_i^\dagger(B)=J^\dagger (B\otimes EP_i) J \end{align} with $J^\dagger (\openone\otimes E) J=\openone$ and $\lambda\leq\|E\|^{-1}$. Note that $E=\sum_i E_i$ where $E_i\ge0$ lives in the support space of $P_i$. For example, consider a state ensemble $\{p(i)\varrho_i\}$. Now the input space is trivial (i.e.\ $\mathbb C$, $\cal L(\mathbb C)\cong\mathbb C$), $\mathcal I_i=p(i)\varrho_i$, and ${\mathcal I}_i^\dagger(B)=\tr{p(i)\varrho_i B}=\langle\psi|(B\otimes P_i)\psi\rangle$ where $\psi$ is a purification of the total state $\sum_{i}p(i)\varrho_i=\tr[\mathcal{H}_\oplus]{|\psi\rangle\langle\psi|}$ (since $J=|\psi\rangle\langle1|$) and $\{P_i\}$ constitutes a sharp resolution of the identity of the ancilla. Hence, the component $\tilde{\mathcal I}_i^\dagger(B)=\langle\psi^E|(B\otimes P_i)\psi^E\rangle$, where $\psi^E=(\ensuremath{\openone}\otimes E^{1/2})\psi$ is a unit vector, so that $\tilde{\mathcal I}_i=\tilde p(i)\tilde\varrho_i=\tr[\mathcal{H}_\oplus]{|\psi_i^E\rangle\langle\psi_i^E|}$ with $\psi_i^E=(\ensuremath{\openone}\otimes P_i)\psi^E=(\ensuremath{\openone}\otimes E_i^{1/2})\psi$. Especially, $\langle\psi_i^E|\psi_j^E\rangle=\tilde p(i)\delta_{ij}$ and $\tilde p(i)=\|(\ensuremath{\openone}\otimes E_i^{1/2})\psi\|^2$ gives the necessary and sufficient conditions for the positive operators $E_i$: $\sum_i\|(\ensuremath{\openone}\otimes E_i^{1/2})\psi\|^2=\<\psi|(\ensuremath{\openone}\otimes E)\psi\>=1$. It is straight-forward to check that \begin{align} E_i=\frac{\tilde p(i)}{p(i)}\varrho_i^{-1/2}\tilde\varrho_i\varrho_i^{-1/2}. \end{align} As a special free set, one can consider ensembles that carry no information about the sent state, i.e. $\tilde p(i)\tilde\varrho_i=\frac{1}{n}\tilde\varrho$. The corresponding convex weight corresponds to finding an optimal measurement for the task of exclusion. Hence, instead of searching for collections of positive operators (i.e. POVMs) that optimise the guessing probability, one can search for a single state that minimises the quantity $\max_i\|E_i\|$. We note that the task of minimum-error discrimination can be similarly be mapped into the search of a single state instead of a POVM, but in this case it is not clear how to find analytical bounds for the corresponding measure of generalised robustness. \clearpage \end{document}
\subsection{Malicious Domain Classifier} The second threat detection application is to classify FQDN domain names contacted by enterprise hosts as \mal\ or \ben. \begin{table}[ht] \begin{center} \centering \begin{tabular}{|c||c|} \hline Feature & Description \\ \hline NIP & Number of IPs contacting the domain \\ Num\_Conn & Total number of connections \\ Avg\_Conn & Average number of connections by an IP \\ \hline Frac\_empty & Fraction of connections with empty content type\\ Frac\_html & Fraction of connections with html content type \\ Frac\_img & Fraction of connections with image content type \\ Frac\_other & Fraction of connections with other content type \\ \hline \end{tabular} \end{center} \caption{Connections and Content feature families.} \label{tab:fex} \end{table} \myparagraph{Dataset} We obtained access to a proprietary dataset collected by a company that includes 89 domain features extracted from HTTP proxy logs and domain labels. The features come from 7 families, and we include an example of several families in Table~\ref{tab:fex}. In this application, we do not have access to the raw HTTP traffic, only to features extracted from it. Thus, the constraints are \textbf{mathematical constraints} in the feature space, for instance: \begin{itemize} \item For the Connection family, we have $Stat$ dependencies: computing min, max, average values over a number of events. \item For the Content family, we need to ensure that the sum of all ratio values equals to 1. This is a combination of $Lin$ and $NonLin$ dependencies. \end{itemize} We support other families of dependencies, among which one that includes combination of $Stat$ and $NonLin$ dependencies. We omit here the details. The important observation here is that the constraints update functions are reusable across applications, and they can be extended to support new mathematical dependencies. \myparagraph{Attack algorithm} We assume that we add events to the logs, and never delete or modify existing events. For instance, we can insert more connections, as in the malicious connection classifier. The attack algorithm follows the framework from Algorithm~\ref{alg:evasion_fw}. If the feature of maximum gradient has no dependencies, it is just updated with the gradient value. Otherwise, every dependency family has specific representative feature and is updated following one of the specified \updatedep\ functions. For example, for the Connection family, the representative feature is \emph{Num\_Conn}, which is updated with the gradient value, and other features in this family are updated by calling the UPDATE\_Stat function. \section{Concrete Applications} \label{sec:attacks} In this section we describe the application of \text{FENCE}\ to two classification problems for threat detection: malicious network traffic classification, and malicious domain classification. \subsection{Malicious Network Traffic Classification} \label{sec:nerisattack} Network traffic includes important information about communication patterns between source and destination IP addresses. Classification methods have been applied to labeled network connections to determine malicious infections, such as those generated by botnets~\cite{EXPOSURE,Bartos16,BAYWATCH,oprea2018made}. Network data comes in a variety of formats, but the most common include net flows, Zeek logs, and packet captures. \myparagraph{Dataset} We leverage a public dataset of botnet traffic that was captured at the CTU University in the Czech Republic, called CTU-13 dataset~\cite{Garca2014AnEC}. The dataset includes Zeek connection logs with communications between internal IP addresses (on the campus network) and external ones. The dataset has the advantage of providing ground truth, i.e., labels of \mal\ and \ben\ IP addresses. The goal of the classifier is to distinguish \mal\ and \ben\ IP addresses on the internal network. The fields available in Zeek connection logs are given in Figure~\ref{fig:bro_example}. They include: the \emph{timestamp} of the connection start; the \emph{source IP address}; the \emph{source port}; the \emph{destination IP address}; the \emph{destination port}; the \emph{number of packets sent and received}; the \emph{number of bytes sent and received}; and the connection \emph{duration} (the time difference between when the last packet and first packets are sent). \begin{figure*}[t] \begin{centering} \includegraphics[width=\linewidth]{neris.png} \caption{Zeek logs (top), raw data representation (left), and feature families per port (right) for network traffic classifier.} \label{fig:bro_example} \end{centering} \end{figure*} In this application, we can use either the raw connection representation or leverage domain knowledge to create aggregated features. We describe existing feature relationships and apply our \text{FENCE}\ framework against both representations. \myparagraph{Raw Data Representation} This consists of the following fields: \emph{one-hot encoded port number}, \emph{one-hot encoded connection type}, \emph{duration}, \emph{original bytes}, \emph{received bytes}, \emph{original packets}, and \emph{received packets}. The feature vector is illustrated in Figure \ref{fig:bro_example} on the left. The raw data representation includes no mathematical dependencies, but has the following \textbf{domain-specific constraints}: \vspace{1pt} - The TCP and UDP packet sizes are capped at 1500 bytes. We create range intervals for these values, resulting in a $Ratio$ dependency between the number of packets and their sizes. \vspace{1pt} - The connection duration is the interval between the last and the first packet. If the connection is idle for some time interval (e.g., 30 seconds), it is closed by default by Zeek. The attacker can thus control the duration of the connection by sending packets at certain time intervals to avoid closing the connection. We generate a range of valid durations from the distribution of connection duration in the training dataset. This creates again a $Ratio$ dependency between the number of packets and their duration. \vspace{1pt} - Each continuous feature has its related minimum and maximum values, which are obtained from the training data distribution, thus forming $Range$ relationships. \vspace{1pt} - The port number and connection type have one-hot encoded $OHE$ dependencies. \myparagraph{Engineered Features} Another possibility is to use domain knowledge to create features that improve the classification accuracy. A standard method for creating network traffic features is aggregation by destination port to capture relevant traffic statistics per port (e.g.,~\cite{Garca2014AnEC}, \cite{ongun2019designing}). This is motivated by the fact that different network services and protocols run on different ports, and we expect ports to have different traffic patterns. We select a list of 17 ports for popular applications, including: HTTP (80), SSH (22), and DNS (53). We also add a category called OTHER for connections on other ports. We aggregate the communication on a port based on a fixed time window (the length of which is a hyper-parameter set at one minute). For each port, we compute traffic statistics using the \mymax, \mymin, and \mytotal\ operators for outgoing and incoming connections. See the example in Figure~\ref{fig:bro_example} on the right, in which features extracted for each port define a family of dependent features. We obtain a total of 756 aggregated traffic features on these 17 ports. Table~\ref{tab:features_id_neris} includes the feature description. The resulting feature vector includes both types of dependencies. The \textbf{domain-specific relationships} are the same as for the raw data representation except for the one-hot encoding relationship. There are additional $Stat$ \textbf{mathematical dependencies} between features: the minimum and maximum number of packets, bytes and duration per connection must be updated after change in the total number of packets, bytes, or connections. \begin{table*} \centering \begin{tabular}{|c||c||c|} \hline Category & Feature & Description\\ \hline Bytes & Total\_Sent\_Bytes & Total number of bytes sent \\ &Min\_Sent\_Bytes & Minimum number of bytes sent per connection\\ &Max\_Sent\_bytes & Maximum of bytes sent per connection\\ \hline Packets& Total\_Sent\_Pkts & Total number of packets sent\\ &Min\_Sent\_Pkts & Minimum number of packets sent per connection\\ &Max\_Sent\_Pkts & Maximum of packets sent per connection\\ \hline Duration& Total\_Duration&Total duration of all connections \\ &Min\_Duration&Minimum duration of a connection\\ &Max\_Duration&Maximum duration of a connection\\ \hline Connection type & Total\_TCP & Total number of TCP connections\\ & Total\_UDP & Total number of UDP connections\\ \hline \end{tabular} \caption{Features definition for malicious connection classification. These features are defined for each port by aggregating over all connections on that port in a fixed time window.} \label{tab:features_id_neris} \end{table*} \myparagraph{Attack algorithm on raw data representation} The attacker's goal is to have a connection log classified as \ben\ instead of \mal. We assume that the attacker communicates with an external IP under its control (for instance, the command-and-control IP), and thus has full control on the malicious traffic in that connection. We assume that the attacker \emph{can only add traffic to network connections}, by increasing the number of bytes, packets, and connection duration, to preserve the malicious functionality. For simplicity, we set the number of received packets and bytes to 0, assuming that the external IP does not respond to these connections. We assume that the attacker does not have access to the security monitor that collects the logs and cannot modify directly the log data. The attack algorithm follows the framework from Algorithm~\ref{alg:evasion_fw}. There is only one family of dependent features, including the packets and bytes sent, and connection duration. The representative feature is the number of sent packets, which is updated with the gradient value, following a binary search for perturbation $\delta$, as specified in Algorithm \updatefamily. The dependent number of bytes sent and duration features are updated using the update dependency functions (Update\_Ratio, Update\_Range and Update\_OHE), thus preserving the $Ratio$, $Range$ and $OHE$ dependencies. \myparagraph{Attack algorithm on engineered features} The goal of the attacker here is to change the prediction of a feature vector aggregated over time from \ben\ to \mal. Therefore, in this attack model, the attacker has the ability of \emph{inserting network connections} during the targeted time window to achieve his goal. Similar to the above scenario, the attacker controls a victim IP and can send traffic to external IPs under its control. The adversary has a lot of options in mounting the attack by selecting the protocol, port, and connection features. Here we have 17 families of dependent features, one for the features on each port. The attack algorithm follows the framework from Algorithm~\ref{alg:evasion_fw}. First, the feature of maximum gradient is determined and the corresponding port is identified. The family of dependent features are all the features computed for that port. The attacker attempts to add a fixed number of connections on that port (which is a hyper-parameter of our system). This is done in the \initfam\ function. The attacker can add either TCP, UDP or both types of connections, according to the gradient sign for these features and also respecting network-level constraints. The representative feature for a port's family is the number of packets that the attacker sends in a connection. This feature is updated by the gradient value, following a binary search for perturbation $\delta$, as specified in Algorithm \updatefamily\ . In the \updatedep\ function an update to the aggregated port features is performed. The difference in the total number of bytes sent by the attacker and duration is determined from the gradient, followed by the UPDATE\_Ratio function to keep the resulting values inside the feasible domain. The port family also includes features such as \mymin\ and \mymax\ sent bytes and connection duration. These features are updated by the UPDATE\_Stat function. The detailed algorithm for this attack is illustrated in Algorithm~\ref{alg:neris}. \begin{algorithm}[th] \caption{Neris Attack} \label{alg:neris} \begin{algorithmic}[1] \Require $x$: data point in iteration $m$\\ $p$: port updated in iteration $m$\\ \xsumbytes/\xminbytes/\xmaxbytes: total/min/max number of sent bytes on $p$ per connection\\ \xsumdur/\xmindur/\xmaxdur: total/min/max duration on $p$ per connection\\ $\nabla$: gradient of objective with respect to $x$ \\ $c$: number of connections added\\ $minB$: the minimum total number of sent bytes from data distrinution\\ $maxB$: the maximum total number of sent bytes from data distribution\\ $minD$: the minimum total connections duration from data distribution\\ $maxD$: the maximum total connections duration from data distribution \Function{\initfam}{$x^m, \nabla, j$} \State $ \{x_i\} \leftarrow$ IS\_ALLOWED$(p, Subset(x_j))$ \If{$\nabla_c <0$ and $x_p \in \{x_i\}$} \State $x_c \leftarrow x_c + c$ \State \Return $c$ \EndIf \State \Return 0 \EndFunction \Function{\updatedep}{$s$, $x^m,\nabla, F_{i_{max}}$} \State $\xsumbytes \leftarrow \updateratio (x^m, \nabla^{\mathsf{tot}}_{\mathsf{bytes}}, F^{\mathsf{bytes}}_{i_{max}})$ \State $\xsumbytes,\Delta^{\mathsf{tot}}_{\mathsf{bytes}}\leftarrow$ Update\_Range$(\xsumbytes, minB, maxB)$ \State $\xminbytes, \xmaxbytes \leftarrow \updatestat (x^m, \Delta^{\mathsf{tot}}_{\mathsf{bytes}}/s, F^{\mathsf{bytes}}_{i_{max}})$ \State $\xsumdur \leftarrow \updateratio(x^m, \nabla^{\mathsf{tot}}_{\mathsf{dur}}, F^{\mathsf{dur}}_{i_{max}})$ \State $\xsumdur, \Delta^{\mathsf{tot}}_{\mathsf{dur}} \leftarrow$ Update\_Range $(\xsumdur, minD, maxD)$ \State $\xmindur, \xmaxdur \leftarrow \updatestat ( x^m, \Delta^{\mathsf{tot}}_{\mathsf{dur}}/s, F^{\mathsf{dur}}_{i_{max}})$ \EndFunction \end{algorithmic} \end{algorithm} \section{Background} \label{sec:background} \subsection{Deep Neural Networks for Classification} A feed-forward neural network (\text{FFNN}) for binary classification is a function $y = F(x)$ from input $x \in R^d$ (of dimension $d$) to output $y \in \{0,1\}$. The parameter vector of the function is learned during the training phase using back propagation over the network layers. Each layer includes a matrix multiplication and non-linear activation (e.g., ReLU). The last layer's activation is sigmoid $\sigma$ for binary classification: $y=F(x) = \sigma(Z(x))$, where $Z(x)$ are the \emph{logits}, i.e., the output of the penultimate layer. We denote by $C(x)$ the predicted class for $x$. For multi-class classification, the last layer uses a softmax activation function. \begin{figure*}[t] \begin{centering} \includegraphics[width=\linewidth]{DepDiagramBinary.pdf} \caption{Neural network training for images (left) and for constrained domains with feature space dependencies (right).} \label{fig:learning_diagram} \end{centering} \end{figure*} \subsection{Threat Model} Adversarial attacks against ML algorithms can be developed in the training or testing phase. In this work, we consider testing-time attacks, called \emph{evasion attacks}. There exist several evasion attacks against DNNs: projected gradient descent-based attacks and the penalty-based attack of Carlini and Wagner. \myparagraph{Projected gradient attacks} This is a class of attacks based on gradient descent for objective minimization, that project the adversarial points to the feasible domain at each iteration. For instance, Biggio et al.~\cite{Biggio13} use an objective that maximizes the confidence of adversarial examples, within a ball of fixed radius in $L_1$ norm. Madry et al.~\cite{madry2017towards} use the loss function directly as the optimization objective and use the $L_2$ and $L_{\infty}$ distances for projection. \myparagraph{C\&W attack} Carlini and Wagner~\cite{Carlini17} solve the following optimization problem to create adversarial example against CNNs used for multi-class prediction: \begin{center} $\delta = \argmin ||\delta||_2+ c \cdot h(x + \delta)$\\ $h(x+\delta) = \max(0, \max(Z_k(x+\delta):k \neq t) - Z_t(x + \delta))$,\\ where $Z()$ are the logits of the DNN. \end{center} This is called the penalty method, and the optimization objective has two terms: the norm of the perturbation $\delta$, and a function $h(x + \delta)$ that is minimized when the adversarial example $x+\delta$ is classified as the target class $t$. The attack works for $L_0$, $L_2$, and $L_{\infty}$ norms. The DNN model is trained correctly and the attacker's goal is to create adversarial examples at testing time. In security settings, typically the attacker starts with \mal\ points that he aims to minimally modify into adversarial examples classified as \ben. We consider initially for our optimization framework a white-box attack model, in which the attacker has full knowledge of the ML system. White-box attacks have been considered extensively in previous work, e.g.,~\cite{Goodfellow14, Biggio13, Carlini17, madry2017towards} to evaluate the robustness of existing ML classification algorithms. We also consider a more realistic attack model, in which the attacker has information about the feature representation of the underlying classifier, but not exact details on the ML algorithm and training data. We will address application domains with various constraints in feature space. These could manifest directly in the raw data features, or could be an artifact of the feature engineering process. The attacker has the ability to insert records in the raw data, for instance by inserting network connections in the threat detection applications. We will ensure that the data points modified or added by the attacker are feasible in the constrained domain. \section{Conclusions} \label{sec:conclusion} We showed that evasion attacks against DNNs can be designed to preserve the dependencies in feature space in constrained domains. We proposed a general framework \text{FENCE}\ for generating adversarial examples that respects mathematical dependencies and domain-specific constraints imposed by these applications.We demonstrated evasion attacks that insert a small number of network connections (12 records in Zeek connection logs) to mis-classify \mal\ activity as \ben\ in a malicious connection classifier. We also showed that adversarial training has the potential to increase the robustness of classifiers in the malicious domain setting. \noindent Our \text{FENCE}\ framework is not restricted to security applications, and we plan to apply it to healthcare and financial scenarios. An important open problem in this space is how to increase the resilience of DNN classifiers used in critical, constrained applications. \subsection{ Dependencies in Feature Space} We describe the dependencies in feature space that \text{FENCE}\ supports. For each of these, there is a corresponding \updatedep\ algorithm. \myparagraph{Domain-Specific Dependencies} The supported domain-specific dependencies are illustrated in Table~\ref{tab:dsr}. These dependencies might occur naturally in the raw data space. The \emph{Range} dependency ensures that feature values are in a particular range, while the \emph{Ratio} dependency ensures that the ratio of two features is in an interval. The one-hot encoded feature dependency is a structural dependency of the input vector representation. Algorithms~\ref{alg:dsd} and ~\ref{alg:rangeud} show how to preserve the \emph{Ratio} and \emph{Range} dependencies, respectively. \begin{table}[ht] \centering \begin{tabular}{|c||c|} \hline Type of dependency & Formula\\ \hline $Range$ &$x_i: x_i \in [a, b]$ \\ \hline $Ratio$ &$x_i, x_j: x_i \in [a \cdot x_j,b \cdot x_j]$\\ \hline One-hot encoding (\textbf{$OHE$})&$\{x_i\}_1^N: x_i \in \{0, 1\}, \sum_{i = 1}^N{x_i} = 1$\\ \hline \end{tabular} \caption{Domain-specific feature dependencies.} \label{tab:dsr} \end{table} \myparagraph{Mathematical Feature Dependencies} Mathematical dependencies resulted from feature engineering supported by \text{FENCE}\ are illustrated in Table~\ref{tab:fsd}. These include statistical dependencies, linear and non-linear dependencies between multiple features, as well as combinations of these. To provide some insight, Algorithm~\ref{alg:efd} and Algorithm~\ref{alg:statudf} illustrate how to preserve $NonLin$ and $Stat$ dependencies. \begin{table}[ht] \centering \begin{tabular}{|c||c|} \hline Type of dependency & Formula\\ \hline Statistical ($Stat$) & $ x_{min} \leq x_{avg}\leq x_{max} $ \\ \hline Linear ($Lin$)& $\sum_i^M (w_i * x_i) = Ct$\\ \hline Non-linear ($NonLin$) & $x_i - x_j/x_k = 0$\\ \hline Combinations of $Lin$, & $x_{min} \leq (x_j/x_k)_{avg}\leq x_{max}$\\ $Stat$, and $NonLin$ & $ \sum_i^M (w_i * x_i/x_k) = Ct$\\ \hline \end{tabular} \caption{Mathematical feature dependencies.} \label{tab:fsd} \end{table} \myparagraph{Update Dependencies Functions Examples} \label{app:dep} In this section we describe the algorithms for two types of relationships for feature dependency updates. Algorithm~\ref{alg:dsd} illustrates the procedure for updating dependent features to satisfy the \emph{Ratio} relationship. If the dependency between two features $x$ and $y$ is such that $x \in [a \cdot y,b \cdot y]$, then feature $x$ is modified according to the gradient value, but the range is restricted to the interval $[a \cdot y,b \cdot y]$. Algorithm~\ref{alg:rangeud} gives the update function for \emph{Range}. It ensures that input $x$ is projected to interval $[a,b]$. It returns the projected value of $x$, as well as the absolute value between $x$ and its projection. Algorithm~\ref{alg:efd} shows the \emph{NonLin} update feature dependency procedure. Here, we need to ensure that the constraint $x_i - x_j / x_k = 0$ for three features $x_i,x_j$, and $x_k$. Gradient update is performed first for $x_j$, after which the value of $x_i$ is modified to ensure the equality constraint, while feature $x_k$ is kept constant. Algorithm~\ref{alg:statudf} gives the update method for satisfying the \emph{Stat} dependency. This is done for a family of features that includes the minimum $x_{min}$, the average $x_{avg}$, the maximum $x_{max}$, and the total number $x_{tot}$ from some events from the raw data. After the update of feature $x_{tot}$ (by increasing, for example, the number of connections), we need to adjust the average value $x_{avg}$ and the corresponding minimum and maximum values. The input to \updatestat\ also includes a value $v$ that is the new value added to the raw data, which could impact the minim or maximum values. \begin{algorithm}[ht] \caption{$Ratio$ Update Dependency Function} \label{alg:dsd} \begin{algorithmic}[1] \Function{\updateratio}{$x,\nabla,F$} \State Parse $F$ as $a, b, x, y$ such that $x \in [a \cdot y,b \cdot y]$. \If {$x - \alpha \cdot \nabla_x < a \cdot y$} \State $x' \leftarrow a \cdot y$ \Else \If{ $x - \alpha \cdot \nabla_x > b \cdot y$} \State $x' \leftarrow b \cdot y$ \EndIf \EndIf \State $x' \leftarrow x -\alpha \cdot \nabla_x$ \State \Return $x'$ \EndFunction \end{algorithmic} \end{algorithm} \begin{algorithm}[ht] \caption{$Range$ Update Dependency Function} \label{alg:rangeud} \begin{algorithmic}[1] \Function{\updaterange}{$x,a,b$} \State Parse $F$ as $a,b$ such that $x \in [a, b]$. \State $x' \leftarrow x)$ \If {$x < a$} \State $x' \leftarrow a$ \EndIf \If{ $x > b$} \State $x' \leftarrow b$ \EndIf \State \Return $x'$, $|x' - x|$ \EndFunction \end{algorithmic} \end{algorithm} \begin{algorithm}[ht] \caption{$NonLin$ Update Function} \label{alg:efd} \begin{algorithmic}[1] \Function{\updatenonlin}{$x,\nabla,F$} \State Parse $F$, the family of dependencies as: $x_i,x_j,x_k$ \State such that: $x_i - x_j/x_k = 0$. \State $x'_j \leftarrow x_j - \alpha \nabla_j$ \State $x'_i \leftarrow x'_j/x_k$ \State $x_j \leftarrow x'_j$, $x_i \leftarrow x'_i$ \EndFunction \end{algorithmic} \end{algorithm} \begin{algorithm}[ht] \caption{$Stat$ Update Function} \label{alg:statudf} \begin{algorithmic}[1] \Function{\updatestat}{$x, v, F$} \State Parse $F$, the family of dependencies as $x_{min}, x_{max},$ \State $x_{avg}, x_{tot}, x_{num}. $ \State $x_{avg} \leftarrow x_{tot} / x_{num}$ \State $x_{min} \leftarrow \mymin(x_{min}, v )$ \State $x_{max} \leftarrow \mymax(x_{max}, v)$ \EndFunction \end{algorithmic} \end{algorithm} \section{Experimental evaluation for malicious domain classifier} \label{sec:madeeval} In this section we perform a detailed evaluation on the malicious domain classifier on the enterprise dataset. \subsection{Experimental setup} \label{sec:dataset} The data for training and testing the models was extracted from security logs collected by web proxies at the border of a large enterprise network with over 100,000 hosts. The number of monitored external domains in the training set is 227,033, among which 1730 are classified as \mal\ and 225,303 are \ben. For training, we sampled a subset of training data to include 1230 \mal\ domains, and different number of \ben\ domains to get several imbalance ratios between the two classes (1, 5, 15, 25, and 50). We used the remaining 500 \mal\ domains and sampled 500 \ben\ domains for testing the evasion attack. Overall, the dataset includes 89 features from 7 categories. Among the features included in the dataset, we determined a set of 31 features that can be modified by an attacker (see Table~\ref{tab:features_id} for their description). These include communication-related features (e.g., number of connections, number of bytes sent and received, etc.), as well as some independent features (e.g., number of levels in the domain or domain registration age). Other features in the dataset (for examples, those using URL parameters or values) are more difficult to change, and we consider them immutable during the evasion attack. \begin{table*}[ht] \centering \begin{tabular}{|c||c||c||c|} \hline Family & Feature ID & Feature & Description\\ \hline Connections&1 & Num\_Conn&Number of established connections\\ &2& Avg\_Conn&Average number of connections per host\\ \hline Bytes&3 & Total\_Recv\_Bytes&Total number of received bytes\\ &4&Total\_Sent\_Bytes&Total number of sent bytes\\ &5&Avg\_Ratio\_Bytes& Average ratio of received bytes\\ &&& over sent bytes per IP\\ &6&Min\_Ratio\_Bytes&Maximum ratio of received bytes\\ &&&over sent bytes per IP \\ &7&Max\_Ratio\_Bytes& Minimum ratio of received bytes\\ &&&over sent bytes per IP \\ \hline HTTP & 8&Num\_POST & Total number of POST requests\\ Method &9&Num\_GET & Total number of GET requests\\ & 10 &Avg\_POST&Average number of POST requests\\ &&&over GET requests per IP\\ & 11 &Min\_POST&Minimum number of POST requests\\ &&&over GET requests per IP\\ & 12 &Max\_POST&Maximum number of POST requests\\ &&&over GET requests per IP\\ \hline Result & 59 & Num\_200 & Number of connections with result code 200\\ Code & 60 & Num\_300 & Number of connections with result code 300\\ &61&Num\_400& Number of connections with result code 400\\ &62&Num\_500&Number of connections with result code 500\\ &63&Frac\_200&Fraction of connections with result code 200\\ &64&Frac\_300&Fraction of connections with result code 300\\ &65&Frac\_400&Fraction of connections with result code 400\\ &66&Frac\_500&Fraction of connections with result code 500\\ \hline Independent & 43 & Avg\_OS& Average number operating systems\\ &&&extracted from user-agent\\ & 44& Avg\_Browser& Average number of browsers used\\ &68&Dom\_Levels&Number of levels \\ &69&Sub\_Domains&Number of sub-domains \\ &70&Dom\_Length&Length of domain\\ &71&Reg\_Age& WHOIS registration age\\ &72&Reg\_Validity& WHOIS registration validity\\ &73&Update\_Age& WHOIS update age\\ &74&Update\_Validity& WHOIS update validity\\ &75& Num\_ASNs & Number of ASNs\\ &76& Num\_Countries & Number of countries contacted the domain\\ \hline \end{tabular} \caption{Feature set for malicious domain classification that can be modified by the evasion attack.} \label{tab:features_id} \end{table*} This dataset is extremely imbalanced, and we sample different number of \ben\ domains from the data, to control the imbalance ratio. We are interested in how the imbalance affects the attack success rate. On this dataset, we also compare the Projected and Penalty attack objectives. \subsection{\text{FENCE}\ attack evaluation} \label{sec:exp_adv} We experimented with several models for training classifiers, including logistic regression, random forest, and different \text{FFNN}\ architectures. The best performance was achieved by a two-layer \text{FFNN}\ with 80 neurons in the first layer, and 50 neurons in the second layer. ReLU activation function is used after all hidden layers except for the last layer, which uses sigmoid. We used the Adam optimizer and SGD with different learning rates. The best results were obtained with Adam and learning rate of 0.0003. We ran training for 75 epochs with mini-batch size of 32. As a result, we obtained the model with AUC score 89\% in cross-validation accuracy, for the balanced case. These results were comparable to the best random forest model we trained and better than logistic regression. The ROC curves for training logistic regression, random forest are given in Figure~\ref{fig:ffnn_r} (a), while the results for \text{FFNN}\ with different imbalanced ratios are in Figure~\ref{fig:ffnn_r} (b). Interestingly, the performance of the model increases to 93\% AUC for imbalance ratio up to 25, after which it starts to decrease (with AUC of 83\% at a ratio of 50). Our intuition is that the \text{FFNN}\ model achieves better performance when more training data is available (up to a ratio of 25). But once the \ben\ class dominates the \mal\ one (at ratio of 50), the model performance starts to degrade. \begin{figure*}[ht] \centering \begin{subfigure}[b]{0.4\linewidth} \includegraphics[width=\linewidth]{roc_models_made.png} \caption{Models performance.} \label{fig:models} \end{subfigure} \begin{subfigure}[b]{0.4\linewidth} \includegraphics[width=\linewidth]{roc_dnn_ratios_made.png} \caption{Imbalance results on \text{FFNN}.} \end{subfigure} \caption{Training results for malicious domain classifier.} \label{fig:ffnn_r} \end{figure*} \myparagraph{Existing Attack} We run the existing C\&W attack~\cite{Carlini17} in order to measure the feasibility of adversarial examples. While the attack reaches 98\% success at distance 20 (for the balanced case), the resulting adversarial examples are outside the feasibility region. An example is included in Table~\ref{tab:cw}, showing that the average number of connections is not equal to the total number of connections divided by the number of IPs. Additionally, the average ratio of received bytes over sent bytes is not equal to maximum and minimum values of ratio (as it should be when the number of IPs is 1). \begin{table}[ht] \centering \begin{tabular}{|c||c||c||c|} \hline Feature & Input & Adversarial Example& Correct Value\\ \hline NIP &1 &1 & 1\\ N\_Conn &15 &233.56 & 233.56\\ Avg\_Conns &15 & \color{red}59.94 &\color{green} 233.56 \\ Avg\_Ratio\_Bytes &8.27&204.01 &204.01 \\ Max\_Ratio\_Bytes& 8.27&\color{red}240.02 &\color{green}204.01 \\ Min\_Ratio\_Bytes & 8.27&\color{red}119.12& \color{green}204.01 \\ \hline \end{tabular} \caption{Infeasible C\&W adversarial example, with inconsistent feature values in red (correct values in green).} \label{tab:cw} \end{table} \myparagraph{\text{FENCE}\ Projected attack results} We evaluate the success rate of the attack with Projected objective first for balanced classes (1:1 ratio). We compare in Figure~\ref{fig:proj_rand} the attack against the two baselines. The attacks are run on 412 \mal\ testing examples classified correctly by the \text{FFNN}. The Projected attack improves both baselines, with Baseline 2 performing much worse, reaching success rate 57\% at distance 20, and Baseline 1 having success 91.7\% compared to our attack (98.3\% success). This shows that the attacks is still performing reasonably if feature selection is done randomly, but it is very important to add perturbation to features consistent with the optimization objective. \begin{figure*}[t] \centering \begin{subfigure}[b]{0.3\linewidth} \includegraphics[width=\linewidth]{projected_sr_random_made.png} \caption{FENCE attack success rate.} \label{fig:proj_rand} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \includegraphics[width=\linewidth]{projected_ROC_made.png} \caption{ROC curves under attack.} \label{fig:proj_roc} \end{subfigure} \begin{subfigure}[b]{0.33\linewidth} \includegraphics[width=\linewidth]{projected_sr_mal_made.png} \caption{Imbalance sensitivity.} \label{fig:proj_mal} \end{subfigure} \caption{\text{FENCE}\ Projected attack results for the malicious domain classifier. } \end{figure*} We also measure in Figure~\ref{fig:proj_roc} the decrease of the model’s performance before and after the evasion attack at different perturbations (using 500 \mal\ and 500 \ben\ examples not used in training). While AUC score is 0.87 originally, it drastically decreases to 0.52 under evasion attack at perturbation 7. This shows the significant degradation of the model’s performance under evasion attack. Finally, we run the attack at different imbalance ratios and measured its success for different perturbations. In this experiment, we select 62 test examples which all models (trained for different imbalance ratios) classified correctly before the evasion attack. The results are illustrated in Figure~\ref{fig:proj_mal}. At $L_2$ distance 20, the evasion attack achieves 100\% success rate for all ratios except 1. Additionally, we observe that with higher imbalance, it is easier for the attacker to find adversarial examples (at fixed distance). One reason is that models that have lower performance (as the one trained with 1:50 imbalance ratio) are easier to attack. Second, we believe that as the imbalance gets higher the model becomes more biased towards the majority class (\ben), which is the target class of the attacker, making it easier to cross the decision boundary between classes. We include an adversarial example in Table~\ref{tab:proj_adv}. We only show the features that are modified by the attack and their original value. As we observe, the attack preserves the feature dependencies: the average ratio of received bytes over sent bytes (Avg\_Ratio\_Bytes) is consistent with number of received (Total\_Recv\_Bytes) and sent (Total\_Sent\_Bytes) bytes. In addition, the attack modifies the domain registration age, an independent feature, relevant in malicious domain classification~\cite{MaKDD09}. However there is a higher cost to change this feature: the attacker should register a malicious domain and wait to get a larger registration age. If this cost is prohibitive, we can easily modify our framework to make this feature immutable. \begin{table}[ht] \centering \begin{tabular}{|c||c||c|} \hline Feature & Original & Adversarial \\ \hline NIP &1 & 1\\ Total\_Recv\_Bytes & 32.32 & 43653.50\\ Total\_Sent\_Bytes & 2.0 & 2702.62\\ Avg\_Ratio\_Bytes & 16.15& 16.15\\ Registration\_Age & 349&3616\\ \hline \end{tabular} \caption{Adversarial example for the \text{FENCE}\ Projected attack at distance 10.} \label{tab:proj_adv} \end{table} \myparagraph{\text{FENCE}\ Penalty attack results} We now discuss the results achieved by applying our attack with the Penalty objective on the testing examples. Similar to the Projected attack, we compare the success rate of the Penalty attack to the two types of baseline attacks for balanced classes, in Figure~\ref{fig:pen_rand} (using the 412 \mal\ testing examples classified correctly). Overall, the Penalty objective is performing worse than the Projected one, reaching 79\% success rate at $L_2$ distance of 20. We observe that in this case both baselines perform worse, and the attack improves upon both baselines significantly. The decrease of the model’s performance under the Penalty attack is illustrated in Figure~\ref{fig:pen_roc} (for 500 \mal\ and 500 \ben\ testing examples). While AUC is 0.87 originally on the testing dataset, it decreases to 0.59 under the evasion attacks at maximum allowed perturbation of 7. Furthermore, we measure the attack success rate at different imbalance ratios in Figure~\ref{fig:pen_mal} (using the 62 testing examples classified correctly by all models). For each ratio value we searched for the best hyper-parameter $c$ between 0 and 1 with step 0.05. Here, as with the Projected attack, we see the same trend: as the imbalance ratio gets higher, the attack performs better, and it works best at imbalance ratio of 50. \begin{figure*}[ht] \centering \begin{subfigure}[b]{0.3\textwidth} \includegraphics[width=\textwidth]{penalty_sr_random_made.png} \caption{FENCE attack success rate.} \label{fig:pen_rand} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \includegraphics[width=\textwidth]{penalty_ROC_made.png} \caption{ROC curves under attack.} \label{fig:pen_roc} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \includegraphics[width=\textwidth]{penalty_sr_mal_made.png} \caption{Imbalance sensitivity.} \label{fig:pen_mal} \end{subfigure} \caption{FENCE Penalty attack results for malicious domain classifier.} \end{figure*} \myparagraph{Attack comparison} We compare the success rate of our Projected and Penalty \text{FENCE}\ attacks with the C\&W attack, as well as an attack we call Post-processing. The Post-processing attack runs directly the original C\&W developed for continuous domains, after which it projects the adversarial example to the raw input space to enforce the constraints. For each family of dependent features, the attack retains the value of the representative feature, but then modifies the dependent features using the \updatedep\ function. The success rate of all these attacks is shown in Figure~\ref{fig:attacks_sr}, using the 412 \mal\ testing examples classified correctly. The attacks based on our \text{FENCE}\ framework (with Projected and Penalty objectives) perform best, as they account for feature dependencies during the adversarial example generation. The attack with the Projected objective has the highest performance. The vanilla C\&W has slightly worse performance at small perturbation values, even though it does not take into consideration the feature constraints and works in an enlarged feature space. Interestingly, the Post-processing attack performs worse (reaching only 0.005\% success at distance 20 -- can generate 2 out of 412 adversarial examples). This demonstrates that it is not sufficient to run state-of-art attacks for continuous domains and then adjust the feature dependencies, but more sophisticated attack strategies are needed. \begin{figure}[ht] \begin{center} \includegraphics[width=2.2in]{sr_all.png} \caption{Malicious domain classifier attacks. \text{FENCE}\ Projected attacks perform best. C\&W does not generate feasible adversarial examples.} \label{fig:attacks_sr} \end{center} \end{figure} \myparagraph{Number of features modified} We compare the number of features modified during the attack iterative algorithm to construct the adversarial examples for three attacks: Projected, Penalty, and C\&W. It is not surprising that the C\&W attack modifies almost all features, as it works in $L_2$ norms without any restriction in feature space. Both the Projected and the Penalty attacks modify a much smaller number of features (4 on average). We are interested in determining if there is a relationship between feature importance and choice of feature by the optimization algorithm. For additional details on feature description, we include the list of features that can be modified in Table~\ref{tab:features_id}. We observe that features of higher importance are chosen more frequently by the optimization attack. However, since we are modifying the representative feature in each family, the number of modifications on the representative feature is usually higher (it accumulates all the importance of the features in that family). For the Bytes family, feature 3 (number of received bytes) is the representative feature and it is updated more than 350 times. However, for features that have no dependencies (e.g., 68 -- number of levels in the domain, 69 -- number of sub-domains, 71 -- domain registration age, and 72 -- domain registration validity), the number of updates corresponds to the feature importance. \begin{figure*}[t] \centering \begin{subfigure}[b]{0.37\linewidth} \includegraphics[width=\linewidth]{hist_features_made.png} \caption{Histogram on feature\\ modifications.} \label{fig:features} \end{subfigure} \begin{subfigure}[b]{0.57\linewidth} \includegraphics[width=\linewidth]{features_made.png} \caption{Number of updates (left),\\ feature importance (right).} \end{subfigure} \caption{Feature modification statistics for malicious domain classifier.} \label{fig:f_times} \end{figure*} \myparagraph{Weaker attack models} We consider a threat model in which the adversary only knows the feature representation, but not the exact ML model or the training data. One approach to generate adversarial examples is through transferability~\cite{papernot2016transfer,song2016transfer, tramer2017transfer,suciu2018transfer,demontis2019transfer}. We perform several experiments to test the transferability of the Projected attacks against \text{FFNN}\ to logistic regression (LR) and random forest (RF). Models were trained with different data and we vary the imbalance ratio. The results are in Table~\ref{tab:transferfromdnn}. We observe that the largest transferability rate to both LR and RF is for the highest imbalanced ratio of 50 (98.2\% adversarial examples transfer to LR and 94.8\% to RF). As we increase the imbalance ratio, the transfer rate increases, and the transferability rate to LR is lower than to RF. \begin{table}[ht] \centering \begin{tabular}{|c||c||c||c|} \hline Ratio& \text{FFNN}\ & LR & RF\\ \hline 1&100\%&40\%&51.7\%\\ 5&93.3\%&66.5\%&82.9\%\\ 15&99\%&60.9\%&90.2\%\\ 25&100\%&47.6\%&68.8\%\\ 50&100\%&98.2\%&94.8\%\\ \hline \end{tabular} \caption{Transferability of adversarial examples from \text{FFNN}\ to LR and RF. We vary the imbalance ratio in training. Column \text{FFNN}\ shows the white-box attack success rate.} \label{tab:transferfromdnn} \end{table} We also look at the transferability between different \text{FFNN}\ architectures trained on different datasets (results in Table~\ref{tab:transferbetweendnn}). The attacks transfer best at highest imbalance ratio (with success rate higher than 96\%), confirming that weaker models are easier to attack. \begin{table}[ht] \centering \begin{tabular}{|c||c||c||c|} \hline Ratio& DNN1 & DNN2 & DNN3\\ & [80, 50] & [160, 80] & [100, 50, 25] \\ \hline 1&100\%&57.6\%&42.3\%\\ 5&93.3\%&73.6\%&58.6\%\\ 15&99\%&78.6\%&52.4\%\\ 25&100\%&51.4\%&45.3\%\\ 50&100\%&96\%&97.1\%\\ \hline \end{tabular} \caption{Transferability between architectures (number of neurons per layer in the second row). Adversarial examples computed for DNN1 are transferred to DNN2 and DNN3.} \label{tab:transferbetweendnn} \end{table} \subsection{Adversarial Training} \label{sec:advtr} Finally, we looked at defensive approaches to increase the \text{FFNN}\ robustness in this setting. A well-known defensive technique is adversarial training~\cite{Goodfellow14,madry2017towards}. We trained \text{FFNN}\ using adversarial training with the Projected attack at $L_2$ distance 20. We trained the model adversarially for 11 epochs and obtain AUC score of 89\% (each epoch takes approximately 7 hours). We measure the Projected attack's success rate for the balanced case against the standard and adversarially training models in Figure~\ref{fig:adv_training}. Interestingly, the success rate of the evasion attacks significantly drops for the adversarially-trained model and reaches only 16.5\% at 20 $L_2$ distance. This demonstrates that adversarial training is a promising direction for designing robust ML models for security. We plan to investigate it further and optimize its design in future work. \begin{figure*}[t] \begin{center} \includegraphics[width=2.2in]{projected_adv_train_made.png} \caption{Success rate of the FENCE Projected attack against adversarially and standard trained model.} \label{fig:adv_training} \end{center} \end{figure*} \section{Experimental evaluation for network traffic classifier} \label{sec:neriseval} We evaluate \text{FENCE}\ for the malicious network traffic classifier trained with both the raw data and engineered feature representations. We show feasible attacks that insert a small number of network connections to change the \mal\ prediction. We only analyze the \text{FENCE}\ attack with the Projected objective here. \subsection{Experimental setup} \label{sec:ctu_dataset} CTU-13 is a collection of 13 scenarios including both legitimate traffic from a university campus network, as well as labeled connections of malicious botnets~\cite{Garca2014AnEC}. We restrict to three scenarios for the Neris botnet (1, 2, and 9). We choose to train on two of the scenarios and test the models on the third, to guarantee independence between training and testing data. The raw data representation has 3,712,935 data points, from which 151,625 are labeled as botnets. The attacker can modify three features per connection: bytes and packets sent, and duration. The training data in the engineered features representation has 3869 \mal\ examples, and 194,259 \ben\ examples, and an imbalance ratio of 1:50. There is a set of 432 statistical features that the attacker can modify (the ones that correspond to the characteristics of sent traffic on 17 ports). The physical constraints and statistical dependencies in both scenarios have been detailed in Section~\ref{sec:nerisattack}. We considered two baseline attacks: \emph{Baseline 1} (in which the features that are modified iteratively are selected at random), and \emph{Baseline 2} (in which, additionally, the amount of perturbation is sampled from a standard normal distribution $N(0,1)$). \subsection{Attack results for raw data representation} \label{sec:neris_attack_raw} For training we have used FFDNN with two layers and sigmoid activation function. The architecture that corresponds to the best performance has 12 neurons in the first layer, and 1 neuron in the second layer. We have trained it using Adam optimizer with learning rate equal to 0.0001 for 20 epochs with batch size 64. The best results are for training on scenarios 2 and 9, and testing on scenario 1, with an F1 score of 0.70. We consider an attack on testing scenario 1, and the success rate of our attack is 100\% already at a small $L_2$ distance of 2. Intuitively, an attacker can add a few packets and bytes to a connection and change its classification easily. We compare its performance to Baseline 2, which achieves only 73\% success rate at $L_2$ distance of~2. \subsection{Attack results for engineered features} \label{sec:neris_attack} \begin{figure*}[t] \centering \begin{subfigure}[b]{0.3\linewidth} \includegraphics[width=\linewidth]{success_rate_neris.png} \caption{ FENCE Projected attack\\ success rate.} \label{fig:neris_sr} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \includegraphics[width=\linewidth]{ROCs_8_10_12_neris.png} \caption{ROC curves under FENCE\\ Projected attack.} \label{fig:neris_rocs} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \includegraphics[width=\linewidth]{num_ports_ave_neris.png} \caption{Average number of updated\\ ports.} \label{fig:neris_ports_ave} \end{subfigure} \caption{Projected attack results on malicious connection classifier.} \end{figure*} We perform model selection and training for a number of \text{FFNN}\ architectures on all combinations of two scenarios, and tested the models for generality on the third scenario. The best architecture consists of three layers with 256, 128 and 64 hidden layers. We used the Adam optimizer, 50 epochs for training, mini-batch of 64, and a learning rate of 0.00026. The F1 and AUC scores are much better than the \text{FFNN}\ based on raw data representation. For instance, the best scenario is training on 1, 9, and testing on 2, which achieve an F1 score of 0.97, compared to 0.70 for raw data. We thus perform a more extensive analysis on the attack against engineered features in this scenario. The testing data for the attack is 407 \mal\ examples from scenario 2, among which 397 were predicted correctly by the classifier. \myparagraph{Evasion attack performance} First, we analyze the attack success rate with respect to the allowed perturbation, shown in Figure~\ref{fig:neris_sr}. The attack reaches 99\% success rate at $L_2$ distance 16. Interestingly, in this case the two baselines perform poorly, demonstrating again the clear advantages of our framework. We plot next the ROC curves under evasion attack in Figure~\ref{fig:neris_rocs} (using the 407 \mal\ examples and 407 \ben\ examples from testing scenario 2). At distance 8, the AUC score is 0.93 (compared to 0.98 without adversarial examples), but there is a sudden change at distance 10, with AUC score dropping to 0.77. Moreover, at distance 12, the AUC reaches 0.12, showing the model's degradation under evasion attack with relatively small distance. \begin{table*}[t] \centering \begin{tabular}{|l||l||l||l||l||l||l||l||l|} \hline ts & id.dest\_port & proto & duration & o\_bytes & r\_bytes & o\_pkts & r\_pkts & state\\ \hline 1 &53& UDP & 2.26638&67 & 558&2 & 2&SF\\ 2 & 13363& TCP & 444.334 & 707& 671& 14 &11& SF\\ 3 & 1035 & TCP & 276.084218 & 20768& 0& 110 &0& OTH\\ \hline 4 &443 & TCP & \color{red}432.47 &\color{red}112404& 0 & \color{red}87 &0 & OTH \\ \hline \end{tabular} \caption{Example of Zeek logs records (top 3 rows), and log added to create adversarial example (bottom row).} \label{tab:Brologs} \end{table*} The average number of port families updated during the attack is shown in Figure~\ref{fig:neris_ports_ave}. The maximum number is 3 ports, but it decreases to 1 port at distance higher than 12. While counter-intuitive, at larger distances the attacker can add larger perturbation to the aggregated statistics of one port, crossing the decision boundary. The ports most frequently modified are 443 and 80. \myparagraph{Adversarial examples} We show an adversarial example generated by the Projected attack at distance 14. The attacker adds only 12 TCP connections on port 443, including 87 packets, each of size 1292 bytes, with connection duration of 432.47 seconds. There are 12 additional Zeek connection logs generated by the attack (see Table~\ref{tab:Brologs}). The destination IP can be selected by the attacker so that it is under its control and does not send any bytes or packets. These new connections are added to the activity the attacker already does inside the network, so the malicious functionality of the attack is preserved. Interestingly, all adversarial attacks succeed with at most 12 new connections at distances higher than 10. \section{Introduction} \label{sec:intro} Deep learning has reached super-human performance in machine learning (ML) tasks for classification in image classification, speech recognition, and natural language processing. Still, research in adversarial ML showed that deep neural networks (DNNs) are not robust in face of adversarial attacks. Most of these attacks have been demonstrated in continuous domains, in which features can be modified independently~\cite{Szegedy14,Biggio13,Goodfellow14,kurakin2016adversarial,Papernot17,Carlini17,madry2017towards,athalye2018obfuscated}. ML is also widely deployed in other application domains, including security, finance, and healthcare, in which the raw data is not directly suitable for learning and engineered features are defined by domain experts to train DNNs. Additionally, in certain application domains such as network traffic classification, the raw data itself might exhibit domain-specific constraints in the original input space. Therefore, adversarial attacks designed for continuous domains need to be adapted to the specifics of constrained applications. Initial efforts for testing-time adversarial attacks (called \emph{evasion attacks}) for constrained domains are underway. Examples include PDF malware detection~\cite{Srndic14,Tong19} and malware classification~\cite{grosse2016adversarial,suciu2018exploring}, applicable to binary features. Kulynych et al.~\cite{kulynych2018evading} introduce a graphical framework for evasion attacks in discrete domains, that constructs a graph of all possible transformations of an input and selects a set of minimum cost to generate adversarial examples. The previous work, however, cannot yet handle evasion attacks in applications that need to respect complex feature dependencies, as well as domain-specific constraints. In this paper we introduce a novel and general framework \text{FENCE}\ ({\bf F}easible {\bf E}vasion Attacks on {\bf N}eural Networks in {\bf C}onstrained {\bf E}nvironments). \text{FENCE}\ generates feasible adversarial examples in constrained domains that rely either on feature engineering or naturally have domain-specific dependencies in the input space. At the core of \text{FENCE}\ is an iterative optimization method that determines the feature of maximum gradient of the attacker's objective at each iteration, identifies the family of features dependent on that feature, and modifies consistently all those features, while preserving an upper bound on the maximum distance. At any time during the iterative procedure, the input data point is modified within the feasibility region, resulting in feasible adversarial examples. We demonstrate that \text{FENCE}\ can successfully evade the DNNs in both applications with minimum effort. For instance, by inserting 12 network connections an attacker can change the classification prediction from \mal\ to \ben\ in the first application. We perform detailed evaluation to demonstrate that our attacks perform better than several baselines and existing attacks, and to compare two optimization objectives in our \text{FENCE}\ framework. We also study the impact of data imbalance to the classifier robustness and show that models trained on datasets with higher imbalance, as is common in security applications, are more vulnerable. We consider attack models with minimum knowledge about the ML system and test several approaches for performing the attacks through transferability from a substitute model to the original one. Finally, we test the resilience of adversarial training as a defensive mechanism for DNNs trained in constrained environments. To summarize, our contributions are: \begin{enumerate} \item We introduce a general evasion attack framework \text{FENCE}\ for constrained application domains. \item We apply \text{FENCE}\ to two threat detection applications using different datasets and feature representations: a malicious network connection classifier, and a malicious domain detector, to generate feasible adversarial examples in these domains. \item We extensively evaluate \text{FENCE}\ for these applications and quantify the amount of effort required to bypass the classifiers. We also evaluate the transferability of the proposed evasion attacks between different ML models and architectures. \item We measure the resilience of adversarially-trained models against our attacks. \end{enumerate} \section{Methodology} \label{sec:method} In this section, we start by describing the classification setting in constrained domains with dependencies in feature space and the challenges of evasion attacks in this setting. Then we devote the majority of the section to present our new attack framework \text{FENCE}\ that takes into consideration the relationships between features that occur naturally in the problem space or are the result of feature engineering. \subsection{ML classification in constrained domains} Let the raw data input space be denoted as $\mathcal{R}$. This is the original space in which raw data is collected for an application. In healthcare, $\mathcal{R}$ could be the space of all data available for a patient. In network security, $\mathcal{R}$ could be the raw network traffic. Let the raw data be $R = \{r_1,\dots, r_M\} \in \mathcal{R}$. In standard computer vision tasks such as image classification, the raw data (image pixels) is used directly as input for neural networks. Thus, the training examples $x_i$ are the same as the raw data: $x_i = r_i, i \in [1,M]$. In this case the feature space $\mathcal{F}$ is the same as the input space $\mathcal{R}$. In contrast, in other domains, such as threat detection or health, there exist dependencies and constraints in the feature space. These could manifest naturally in the considered application (for instance, results of two blood tests are correlated). We denote by $\FeasibleSet(R)$ the set of all feasible points in the raw data space. Constraints might also result from the feature engineering process performed in many settings (see Figure~\ref{fig:learning_diagram}). In this case, features are obtained by application of an operator $\mathsf{Op}_j$ on the raw data: $x_{ij} = \mathsf{Op}_j (R)$. Examples of operators are \mymax, \mymin, \myavg, and \mytotal. The set of all supported operators applied to the raw data is denoted by $\mathcal{O}$. This process creates $N$ training examples $x_1,\dots,x_N$ in feature space $\mathcal{F}$, each being $d$-dimensional, with $d$ the size of the feature space. The feature engineering process creates dependencies in feature space. A data point $z = (z_1,\dots,z_d)$ in feature space $\mathcal{F}$ is \emph{feasible} if there exists some raw data $R$ such as for all $i$, there exists an operator $\mathsf{Op}_j \in \mathcal{O}$ with $z_i = \mathsf{Op}_j (R)$. The set of all feasible points in feature space for raw data $R$ and operators $\mathcal{O}$ are called $\FeasibleSet(R,\mathcal{O})$. This space includes the set of feasible points $\FeasibleSet(R)$ (obtained for $\mathcal{O} = \emptyset $). Examples of feasible and infeasible points in feature space are illustrated in Table~\ref{tab:feasible}. \begin{table}[h] \centering \begin{tabular}{|c||c||c|} \hline Feature & Feasible & Infeasible\\ \hline $F_1$ & 0.2 & {\color{red} 0.5}\\ $F_2$ & 0.13 & {\color{red} 0.13} \\ $F_3$ & 0.33 & {\color{red} 0.33} \\ $F_4$ & 0.34 & {\color{red} 0.4} \\ \hline \end{tabular} \caption{Feasible and infeasible points in feature space. The sum of the four features is 1 in the feasibility region.} \label{tab:feasible} \end{table} \begin{figure*}[ht] \begin{centering} \includegraphics[width=\linewidth]{diagram.png} \caption{Flow of the \text{FENCE}\ Evasion Attack Framework.} \label{fig:ea_diagram} \end{centering} \end{figure*} \subsection{Challenges} Existing evasion attacks are mostly designed for continuous domains, such as image classification, where adversarial examples have pixel values in a fixed range (e.g., [0,1]) and can be modified independently~\cite{Carlini17,madry2017towards,athalye2018obfuscated}. However, the vast majority of applications use tabular data, resulting in feature dependencies and physical-world constraints that need to be respected. Several previous work address evasion attacks in domains with tabular data. The evasion attack for malware detection by Grosse et al.~\cite{Grosse17}, which directly leverages JSMA~\cite{Papernot17}, modifies binary features corresponding to system calls. Kolosnjaji et al.~\cite{kolosnjaji2018adversarial} use the attack of Biggio et al.~\cite{Biggio13} to append selected bytes at the end of the malware file. Suciu et al.~\cite{suciu2018exploring} also append bytes in selected regions of malicious files. Kulynych et al. ~\cite{kulynych2018evading} introduce a graphical framework in which an adversary constructs all feasible transformation of an input, and then uses graph search to determine the path of minimum cost to generate an adversarial example. Neither of these approaches are applicable to our general setting. None of these attacks satisfy the required dependencies in the resulting adversarial vector. We believe that crafting adversarial examples that are feasible, and respect all the application constraints and dependencies to be a significant challenge. Once application constraints are specified, the resulting optimization problem for creating adversarial examples includes a number of non-linear constraints and cannot be solved directly using out-of-the-box optimization methods. \subsection{The \text{FENCE}\ framework} To address these issues, we introduce the \text{FENCE}\ framework for evasion attacks that preserves a range of feature dependencies in constrained domains. \text{FENCE}\ guarantees by design that the produced adversarial examples are within the feasible region of the application input space. The starting point for the attack framework are gradient-based optimization algorithms, including projected~\cite{Biggio13,madry2017towards} and penalty-based~\cite{Carlini17}. Of course, we cannot apply these attacks directly since they will not preserve the feature dependencies. To overcome this, we use the values of the objective gradient at each iteration to select features of maximum gradient values. We create feature-update algorithms for each family of dependencies that use a combination of gradient-based method and mathematical constraints to always maintain a feasible point that satisfies the constraints. We also use various projection operators to project the updated adversarial examples to feasible regions of the feature space. \input{evasion_fw} \input{dep_families} \section{Related Work} \label{sec:related} Adversarial machine learning studies ML vulnerabilities against attacks~\cite{Huang2011adversarial}. Research on the robustness of DNNs at testing time started with the work of Biggio et al.~\cite{Biggio13} and Szegedy et al.~\cite{Szegedy14}. They showed that classifiers are vulnerable to adversarial examples generated with minimal perturbation to testing inputs. Since then, the area of adversarial ML has received a lot of attention, with the majority of work focused on evasion attacks (at testing time), e.g.,~\cite{Goodfellow14,kurakin2016adversarial,Papernot17,Papernot-BlackBox17,Carlini17,athalye2018obfuscated}. Other classes of attacks include poisoning (e.g.,~\cite{biggio2012poisoning,Xiao15}) and privacy attacks (e.g.,~\cite{Fredrikson15,Membership}), but we focus here on evasion attacks. \myparagraph{Evasion attacks in security} Several evasion attacks have been proposed against models with discrete and constrained input vectors, as encountered in security. The majority of these use datasets with binary features, not considering dependencies in feature space. Biggio et al.~\cite{Biggio13} use a gradient-based attack to construct adversarial examples for malicious PDF detection by only adding new keywords to PDFs. Grosse et al.~\cite{grosse2016adversarial} leverage the JSMA attack by Papernot et al.~\cite{Papernot17} for a malware classification application in which features can be added or removed. Suciu et al.~\cite{suciu2018exploring} add bytes to malicious binaries either at the end or in slack regions to create adversarial examples. Kreuk~\cite{kreuk2018deceiving} discover regions in executables that would not affect the intended malware behavior. Kolosnjaji et al.~\cite{kolosnjaji2018adversarial} create gradient-based attack against malware detection DNNs that learn from raw bytes, and can create adversarial examples by only changing few specific bytes at the end of each malware sample. Xu et al.~\cite{xu2016automatically} propose a black-box attack based on genetic algorithms for manipulating PDF files, while maintaining the required format. Dang et al.~\cite{dang2017evading} propose a black-box attack against PDF malware classifiers that uses hill-climbing over a set of feasible transformations. Anderson et al.~\cite{anderson2018learning} construct general black-box framework based on reinforcement learning for attacking static portable executable anti-malware engines. Kulynych et al.~\cite{kulynych2018evading} propose a graphical framework for discrete domains with guarantees of minimal adversarial cost. Recently, Pierazzi et al.~\cite{pierazzi2019intriguing} define a formalization for the domain-space attacks, along with a new white-box attack against Android malware classification. The authors use automated software transplantation to extract slices of bytecode from benign applications and inject them into a malicious host to mimic the benign activity and evade the classifier. Evasion attacks for network traffic classifiers include: Apruzesse et al.~\cite{apruzzese2018} analyzing the robustness of random forest for botnet classification; Clements et al.~\cite{clements2019rallying} evaluating the robustness of an anomaly detection method~\cite{mirsky2018kitsune} against existing attacks; and De Lucia et al.~\cite{de2019adversarial} attacking an SVM for network scanning detection. However, none of the previous work can handle the complex dependencies supported by our \text{FENCE}\ framework.
\section{Introduction} \label{sec:introduction} Decades of investigations allowed astrophysicists to clearly define a class of ``quiescent'' galaxies in the local Universe. These systems are typically characterized by their large stellar masses and sizes, several billion years old stellar populations, red colors, little to no active formation of new stars, very limited amount of cold gas and dust, and an overdense surrounding environment \citep[][]{renzini_2006}. The inferred old ages at $z=0$ suggest that these galaxies were already in place at high redshift \citep[e.g.,][]{gallazzi_2005, thomas_2005} and, indeed, a numerous population of massive, compact ($\sim1$~kpc) quiescent galaxies that are Gyrs old already at $z > 2$ has been firmly established from photometry \citep[e.g.,][]{daddi_2005, trujillo_2006, toft_2007, cimatti_2008, cassata_2013, straatman_2014}, and now securely detected with spectrographs \citep[e.g.][M. Stockmann et al., in press]{kriek_2009, vandokkum_2009, vandesande_2013, toft_2012, gobat_2012, belli_2014, belli_2017a, belli_2017b}. Their extreme stellar densities suggest that these compact quiescent systems at $z\sim2$ might be the remnants of an intense burst of star formation triggered by the rapid collapse of a large amount of gas occurred at $z>4$. In this scenario, dissipative gas-rich mergers, counter-rotating gas streams, or disk instabilities would ignite star formation in high-redshift and dusty star-forming galaxies detectable at sub-millimeter wavelengths, quickly consuming the gas and leaving compact and passive remnants \citep[e.g.][]{cimatti_2008, barro_2013, toft_2014, zolotov_2015, tadaki_2018, gomez-guijarro_2018, gomez-guijarro_2019}. The matching number densities, sizes, masses, and formation timescales of sub-millimeter galaxies (SMGs) at $z\sim4-4.5$ and quiescent galaxies at $z\sim2$ may support this picture \citep[][and references therein]{toft_2014}. On the other hand, the mechanism physically responsible for the cessation of star formation in these massive systems is still matter of discussion, with several scenarios still competing (see \citealt{man_2018} for a recent discussion).\\ \noindent This evolutionary scheme has been recently challenged by the spectroscopic confirmation of quiescent systems with $M_{\star}\sim10^{11}$~$M_{\odot}$\ above $z>3$ and up to $z=3.717$ (\citealt{gobat_2012, glazebrook_2017, simpson_2017, schreiber_2018b, schreiber_2018c}, S18b hereafter, \citealt{forrest_2019}, C. D'Eugenio et al. in preparation), as part of a substantial population of photometrically selected red galaxies \citep[e.g.,][to mention recent results]{fontana_2009, ilbert_2013, muzzin_2013, straatman_2014, mawatari_2016, davidzon_2017, deshmukh_2018, merlin_2018, merlin_2019, girelli_2019, guarnieri_2019}. In at least one case, their quiescent nature has been initially challenged by sub-millimeter observations \citep{simpson_2017}, but later confirmed with a high spatial resolution follow-up, necessary to disentangle the emission of these galaxies from nearby companions \citep{schreiber_2018b}. Systematic studies of larger samples of $z>3$ photometric candidates in the sub-millimeter further support their average quiescence \citep{santini_2019}. The extreme masses, stellar densities, old ages, low SFRs, and number densities appear to be hardly reproducible by hydrodynamical simulations and semi-analytical models at $z>3$ \citep[S18b]{steinhardt_2016, cecchi_2019}. Catching quenched and quenching galaxies at the highest possible redshifts, thus, represents a formidable tool to test our galaxy formation models and simulations and, ultimately, the cosmology. For this scope, studying high-redshift galaxies allows us to better estimate their ages, as they are limited by the age of the Universe \citep{belli_2018}.\\ \noindent Here we report the discovery of three massive objects at $z=3.77-4.01$ with suppressed star formation, followed-up with Keck/MOSFIRE and VLT/X-Shooter longslit spectroscopy. In one case, the high-quality of the data allowed us to estimate the stellar velocity dispersion in the highest-redshift target, opening the way to the study of its stellar dynamics and structure. We explored such properties in a dedicated companion paper \citep{tanaka_2019}. Based on the observed properties, we further investigated the expected characteristics of the progenitors of our sample of massive quiescent galaxies and compared them with dusty star-forming objects from surveys at $z>4$ selected based on their sub-millimeter fluxes, testing the evolutionary connection suggested for lower redshift systems. Incorporating information about the previously confirmed quiescent galaxies at $z\sim3.5$, we compared the number densities of this population and the putative SMG progenitors. Finally, we explored the content of the recent \textit{Illustris} TNG cosmological simulation in order to look for rare quenched systems at high-redshift and study their connection with their star-forming progenitors.\\ \noindent This paper is structured as follows. In Section \ref{sec:selection} we introduce the sample that we followed up spectroscopically, with the observations described in Section \ref{sec:observations}. We present the data analysis in Sections \ref{sec:redshift_estimate} to \ref{sec:quiescence}. In Section \ref{sec:progenitors} we explore the connection between our sample of quiescent galaxies and their progenitors at higher redshift, including the view offered by cosmological simulations (Section \ref{sec:simulations}). Concluding remarks are collected in Section \ref{sec:conclusions}. We assumed a $\Lambda$CDM cosmology with $\Omega_{\rm m} = 0.3$, $\Omega_\Lambda= 0.7$, and $H_0 = 70$~km s$^{-1}$~Mpc$^{-1}$ and a Chabrier initial mass function \citep[IMF,][]{chabrier_2003}. All magnitudes are expressed in the AB system. \section{Selection} \label{sec:selection} We based our search for suitable quiescent galaxy candidates on a combination of full modeling of the optical and near-infrared light and a rest-frame color-color selection. The former has proved to be a trustable way to select quiescent objects up to $z\sim2$ (M. Stockmann et al., in press) and it naturally incorporates the whole information available from the photometry, while relying on a set of assumptions on models and templates. Color-color diagrams are flexible instruments to broadly separate galaxy populations capturing the main features with limited observations, but valuable information from the rest of the spectrum might be discarded from the analysis (\citealt{merlin_2018} for a recent detailed analysis). Two members of our team fitted the optical/near-infrared spectral energy distributions of potential targets: MT modeled galaxies in the Subaru-XMM Newton Deep Field \citep[SXDS;][]{furusawa_2008} and ID in the COSMOS field \citep{scoville_2007}. Having been designed for independent spectroscopic runs at different facilities and epochs, the original selection of candidate quiescent galaxies in the two fields was comparable, but not identical. \begin{figure*} \includegraphics[width=0.48\textwidth]{uvj30_z_40_contours.pdf} \includegraphics[width=0.48\textwidth]{nuvrj30_z_40_contours.pdf} \caption{\textbf{Rest-frame colors.} \textit{Left:} \textit{UVJ} colors for a sample of $3<z<4$ galaxies in the UDS ($7,277$ objects) and COSMOS ($11,653$) fields (background gray contours), our observed $z=3.77-4.01$ quiescent objects (red filled and open stars, red open diamond), and the spectroscopic and photometric sample from \citet[filled and open orange circles, respectively]{schreiber_2018c}. The background contours show the density of UDS+COSMOS points from the parent samples in bin of 0.2 mag on both axes, smoothed over $2\times2$ bins with a boxcar average filter. \textit{Right:} \textit{NUVrJ} colors for the same objects in the left panel. The same symbols and colors apply here. The background contours trace the density of UDS+COSMOS points from the parent samples in bin of 0.2 mag on both axes. The tracks in both panels show the evolution of synthetic \citet{bruzual_2003} models of rapidly quenched galaxies (exponentially declining SFH with $\tau=0.1$~Gyr, $Z=Z_\odot$, no dust, orange line), with possible residuals of late star formation ($1$ $M_{\odot}$ yr$^{-1}$\ after quenching for a galaxy of $10^{10}$ $M_{\odot}$, pink line), or systems characterized by a constant SFHs (blue line), the latter simulating an active SFG. The plus symbols mark the time steps as indicated by the blue labels, identical for all the tracks.} \label{fig:rfcolors} \end{figure*} \subsection{SXDS/UDS field} \label{subsec:uds_sample} We performed the SED modeling for galaxies in the SXDS field as described in \cite{kubo_2018}. Briefly, we ran the custom Bayesian photometric code \textsc{Mizuki} \citep{tanaka_2015} on a multiwavelength catalog comprising $u$-band observations from CFHT/Megacam, optical $BVRiz$ imaging from Subaru/Suprime-Cam \citep{furusawa_2008}, $JHK$-bands from the UKIRT Infrared Deep Sky Survey \citep[UKIDSS;][DR10]{lawrence_2007}, and \textit{Spitzer} coverage from the UKIDSS Ultra Deep Survey (SpUDS, PI: J. Dunlop), covering an area of $\sim0.8$ deg$^2$. We modeled the SED adopting the \cite{bruzual_2003} models, exponentially declining star formation histories, solar metallicities, the \cite{calzetti_1994} dust attenuation law, and the \cite{chabrier_2003} initial mass function. Emission lines are included using the intensity ratios from \cite{inoue_2011}. The Lyman-$\alpha$ escape fraction is assumed to be 0.1. Given the constraining power of the data covering the full SEDs of galaxies, we applied top-hat priors, assigning zero probability to templates outside observationally motivated ranges. The parameters include $\tau$ ($\in[1,100]$ Gyr, for the SFH model), dust attenuation (Calzetti law, with optical depth in the $V$ band $\in[0,5]$), age ($\in[0.001,14]$ Gyr, excluding ages larger than the age of the Universe at each redshift), and redshift ($\in[0,6]$), while the metallicity was fixed to solar. We have confirmed that our results do not significantly change if we apply the physical priors discussed in \cite{tanaka_2015}. We then selected a sample of $5$ candidate ``quiescent'' and $12$ ``quenching'' (or ``post-starburst'') galaxies based on their specific SFRs ($\mathrm{sSFR} \leq 10^{-11}$~yr$^{-1}$ and $10^{-11} \leq \mathrm{sSFR} \leq 10^{-10}$~yr$^{-1}$), redshift ($4 < z_{\rm phot} < 4.6$), and reliability of the fit (reduced $\chi^2 < 4.5$). The adopted redshift cut would have allowed us to observe the $4000$~\AA\ break in the $K$ band, providing a constraint on the age of the stellar populations. In order to minimize the exposure time for a spectroscopic follow-up, we finally selected the quiescent candidate SXDS-10017 at $z_{\rm phot}=4.07^{+0.07}_{-0.07}$ and the quenching object SXDS-27434 at $z_{\rm phot}=4.12^{+0.03}_{-0.05}$, the brightest galaxies among our initial pool of sources ($K=22.5$ and $21.9$~mag, respectively). Consistently with the sSFR cut and quality checks, SXDS-10017 falls in the quiescent region of both the $UVJ$ \citep{williams_2009} and $NUVrJ$ \citep{ilbert_2010} rest-frame color diagrams (Figure \ref{fig:rfcolors}). On the other hand, consistently with the looser constraint on the sSFR, SXDS-27434 falls outside the canonical $UVJ$ and $NUVrJ$ limits for quiescent galaxies \citep{ilbert_2010, williams_2009}, showing rather blue $U-V$ and $NUV-r$ colors. However, this is not unexpected for recently and abruptly quenched galaxies at high redshift \citep{merlin_2018}. A posteriori, using the spectroscopic or photometric redshift estimates does not significantly change the location of our targets in the color-color diagrams. In Figure \ref{fig:rfcolors} we show the expected color evolution for galaxies with an exponentially declining star formation history ($\tau = 0.1$~Gyr) compared with objects with the same SFH, but residuals of late star formation (a constant $1$ $M_{\odot}$ yr$^{-1}$\ after quenching for a galaxy of $10^{10}$ $M_{\odot}$) and active SFGs with a constant SFH of $10$~$M_{\odot}$ yr$^{-1}$. The tracks are based on \citet{bruzual_2003} models with no dust and a $Z_\odot$ metallicity (see \citealt{belli_2018} for a similar attempt with different parameters and at lower redshift). We therefore expected SXDS-27434 to show younger stellar populations than SXDS-10017, allowing us to probe the post-starburst or quenching epoch at $z\sim4$. \subsection{COSMOS field} \label{subsec:cosmos_sample} We re-modeled the SEDs of galaxies in the COSMOS field ($\sim1.8$ deg$^{2}$) with \textsc{LePhare} \citep{arnouts_1999, ilbert_2006} following \cite{davidzon_2017}, based on the 30-band photometric catalog by \cite{laigle_2016}. We adopted \cite{bruzual_2003} stellar population models, exponentially declining and delayed star formation histories, solar and subsolar metallicities ($Z=0.4Z_\odot$), and a \cite{chabrier_2003} initial mass function. For the estimate of the photometric redshifts, we adopted an SMC extinction law \citep{prevot_1984} and three different flavors of the \cite{calzetti_2000} prescription, including the bump at $2700$ \AA. On the other hand, we used the \cite{calzetti_2000} (allowing for the bump) and \cite{arnouts_2013} extinction laws when estimating the physical parameters. We then selected $2$ quenching candidates with $K_s<23$~mag and $NUVrJ$ colors consistent with a $\mathrm{sSFR}<10^{-10}$~yr$^{-1}$ (Figure \ref{fig:rfcolors}), excluding solutions at $\chi^2 > 10 $. We finally chose the brightest among our candidates at $z>4$ (COS-466654, $z_{\rm{phot}}=4.11^{+0.04}_{-0.1}$ and $K_s=22.26$), so to target the $4000$~\AA\ break in the $K$ band. In agreement with the initial constraint on the $NUVrJ$ colors, COS-466654 falls in the post-starburst or quenching regions of the rest-frame color diagrams as in the case of SXDS-27434 (Figure \ref{fig:rfcolors}, Section \ref{subsec:uds_sample}). \begin{figure*} \centering \includegraphics[width=\textwidth]{spectra_zpdf_ID} \caption{\textbf{Spectra of the quiescent galaxies.} \textit{Top:} Keck/MOSFIRE $K$-band spectrum of SXDS-10017, rebinned to a wavelength bin of $8.7$~\AA. \textit{Center}: Keck/MOSFIRE $K$-band spectrum of SXDS-27434 at its original $2.17$~\AA\ resolution. \textit{Bottom:} VLT/X-Shooter VIS+NIR spectrum of COS-466654, rebinned to a wavelength bin of $72$~\AA. In every panel, the 2D frame is smoothed with a Gaussian kernel of 2 pixels of width. The orange and gold areas mark the optimally extracted 1D spectrum and its noise, respectively. The spectra are rebinned differently to reach comparable levels of S/N. The best SED models with $z=z_{\rm spec}$ obtained including the $\sim2$ \AA\ resolution spectra are shown in red. Each SED model is broadened as mentioned in Section \ref{sec:redshift_estimate}. The location of the main absorption features is labeled. The darker areas indicate the wavelengths of poor atmospheric transmission between the observed bands. \textit{Right:} The black and red solid lines indicate the probability distribution functions for the photometric and spectroscopic redshift, respectively.} \label{fig:spectrum} \end{figure*} \subsection{Consistency of the applied selection criteria} As shown in Figure \ref{fig:rfcolors}, the rest-frame color and the sSFR selection criteria are consistent. In fact, the same galaxies would have been targeted if we applied the COSMOS selection criteria also in SXDS, and vice versa. However, we used different SED fitting codes to implement the two selections. To test possible systematics introduced by this choice, we applied the modeling that we used for the SXDS field to the COSMOS catalog and vice versa. A small difference in redshifts emerged from this test. For the sources in SXDS, \textsc{LePhare} returns $z_{\rm phot} = 3.58$ and $4.12$ for SXDS-10017 and SXDS-27434, respectively. However, in contrast to the \textsc{Mizuki} selection, the one with \textsc{LePhare} does not strictly exclude candidates at $z_{\rm phot}<4$, considering the typical accuracy of redshift measurements in the distant universe. On the other hand, we retrieve a slightly lower redshift for COS-466654 with \textsc{Mizuki} ($z_{\rm phot} = 3.72^{+0.08}_{-0.07}$), but its quiescent state is confirmed. Notice that the spectroscopic constraints for SXDS-10017 and COS-466654 fall in between the photometric estimates here above (Section \ref{sec:redshift_estimate}). This kind of discrepancies may affect statistical studies that purely rely on the parent photometric samples, but they are less relevant for the present analysis since we focus on quiescent galaxies individually confirmed via spectroscopy. \section{Spectroscopic observations} \label{sec:observations} \subsection{Keck/MOSFIRE observations of the UDS field} \label{sec:mosfire} We observed the two targets in the UDS field with the Multi-Object Spectrometer For Infra-Red Exploration \citep[MOSFIRE]{mclean_2012} at the Keck I telescope on two separate runs. On November 23$^{\rm rd}$ 2017, we collected a total of $4$ hours of observations of SXDS-10017 out of a complete night initially granted, with an average seeing of $\mathrm{FWHM}=0.8$'' during the night, as estimated from individual stars in the field. We observed SXDS-27434 on December 20$^{\rm th}$-21$^{\rm st}$ 2018 for 7.75 hours, with an average seeing of $\mathrm{FWHM}=0.7$'' over two half-nights. In both cases, we observed the targets in $K$-band with a slit width of $0.7$'', ensuring a nominal initial spectral resolution of $R\sim 3600$. We adopted the standard ABBA nodding technique with a dithering of $1.5$'' and 180 s exposures to allow for an optimal background subtraction. We reduced the data with the MOSFIRE pipeline and obtained a final flux calibrated, optimally combined 2D spectrum. We corrected for aperture losses modeling the galaxies as 2D Gaussian curves with $\mathrm{FWHM}=\mathrm{FWHM_{seeing}}$ and calculating the light lost outside a 0.7'' wide rectangular slit. The measured effective major axis of the targets ($R_{\rm eff, maj}=(0.95\pm 0.32)$~kpc and $(0.76\pm 0.20)$~kpc for SXDS-10017 and 27434, respectively, \citealt{kubo_2018, tanaka_2019}) effectively allows us to treat the targets as a point sources and to adopt this simple approach. We further checked for possible residual telluric absorptions due to the varying airmass during the night by calibrating the spectra of several stars observed simultaneously with our science target, resulting in a negligible effect. We rebinned the 2D spectra by $2\times, 4\times$, and $30\times$ to a final resolution of $4.3$, $8.7$, and $65$~\AA, for testing and displaying purposes. We applied a running optimal weighted mean, providing the maximal signal-to-noise ratio among the several approaches we attempted (median, mean, and clipped mean). We simultaneously increased the noise to account for the possible correlation among adjacent spectral elements by forcing the reduced $\chi_{\rm red}^2=1$ computed in regions of the 2D frame of pure background. This approach is applicable since the noise variations due to sky lines occur on scales smaller than the absorption features we aim to detect. We optimally extracted the spectrum and its associated noise following \cite{horne_1986}. We finally corrected the 1D spectrum for possible residual flux losses by computing the synthetic photometry and anchoring it to the best model reproducing the photometry (Section \ref{sec:sed}). The data reduction process for SXDS-10017 resulted in a final median $S/N=6.7$ and a maximum of $S/N=11.6$ for bins of $65$~\AA, comparable with the performances reported in S18b for similar integrations and $K$-band luminosities. Consistently with the brighter $K$-band magnitude and the $\sim2\times$ longer integration, we find a final median $S/N=16.4$ and a maximum of $S/N=30.0$ for bins of $65$~\AA\ for SXDS-27434. The 2D frames and the optimally extracted spectra are shown in Figure \ref{fig:spectrum}. \subsection{VLT/X-Shooter observations of the COSMOS field} \label{sec:xshooter} We observed the target in the COSMOS field with the cross-dispersed echelle spectrograph X-Shooter \citep{vernet_2011} mounted on UT2 at the Very Large Telescope (VLT). The observations were carried out in service mode over March-April, 2018. A total of 8.6 hours of spectroscopic integration were spent on target, with an average seeing of $\mathrm{FWHM}=0.66$''. We observed the target with slit widths of $1.0$'', $0.9$'', and $0.9$'' in the UVB, VIS, and NIR arms, respectively, ensuring a lower limit on the resolving power of 4350, 7450, and 5300 in the three arms, given the average seeing smaller than the slit widths. The chosen configuration and the seeing conditions allowed us to cover the wavelength range from $3000$ \AA\ to $24,800$ \AA\ with minimal slit losses. We adopted the standard ABBA dithering technique with a nod throw of $4.5$'' and a jitter width of 1''. We optimized the observing time for 1 hour observing blocks (OB) exposing for $420$, $448$, and $480$ s in the UVB, VIS, and NIR arms, respectively. For the only OB of 0.5 hours we integrated for $534$, $563$, and $600$ s, in the three arms. The spectra have been bias-corrected, flat-fielded, wavelength calibrated, rectified and flux calibrated using observations of spectrophotometric standards with the VLT/X-Shooter pipeline \citep{modigliani_2010}. We supplemented the pipeline with optimal frame combination, telluric correction, and slit flux loss estimate using the customized scripts described in \cite{selsing_2018} and publicly available online\footnote{\url{https://github.com/jselsing/XSGRB_reduction_scripts }}. We rebinned the 2D spectrum using a weighted mean to a final wavelength step of $1.8$ \AA\ in the NIR arm to match the resolution of MOSFIRE and ensure a minimum signal-to-noise ratio to measure the redshift. We further rebinned the spectrum up to $72$ \AA\ for displaying purposes. We optimally extracted the spectrum \citep{horne_1986} and corrected the residual flux losses due to seeing variations over the epochs of observations by computing the synthetic photometry in the available optical and near-infrared bands and tying them to best model representing the observed photometry (Section \ref{sec:sed}). The $72$ \AA\ rebinned combined frame and the optimally extracted spectrum are shown in Figure \ref{fig:spectrum}. The final median $S/N$ over bins of $72$~\AA\ is $3.3$, $1.7$, $3.8$ and $4.1$ in the VIS arm, \textit{J}, \textit{H}, and \textit{K} bands, with a maxima of $S/N=7.4$, $3.7$, $6.7$, and $9.4$, respectively. We did not detect significant emission in the UVB arm.\\ \section{Redshift estimate} \label{sec:redshift_estimate} We estimated the redshift using \textsc{Slinefit}\footnote{\url{https://github.com/cschreib/slinefit}}, a flexible algorithm based on $\chi^2$-minimization that allows for simultaneous continuum template matching and emission line measurements. We initially fit the spectra with the best SED models obtained fixing $z=z_{\rm phot}$. We convolved these models with a Gaussian curve to reach a stellar velocity dispersion of $230$ and $214$ km s$^{-1}$\ for SXDS-10017 and COS-466654 respectively, following the $\sigma_{\rm vel}$-$M_\star$ relation as in S18b \citep{belli_2017b}. This is an assumption, as we cannot constrain the stellar velocity dispersion given the available combination of signal-to-noise and spectral resolution. On the contrary, for SXDS-27434 we used the measured dispersion of $\sigma_{\rm vel}= 268 \pm 59$ km s$^{-1}$\ \citep{tanaka_2019}, consistent with the $\sigma_{\rm vel}$-$M_\star$ relation we adopted for the other two sources. We further took into account the possible presence of emission lines with fixed velocity widths ranging between $60$ and $300$ km s$^{-1}$. However, the redshift search returns the same results with or without the presence of emission lines. We explored the redshift range $2<z<5$ and then refined the redshift measurement within $\pm0.2$ from the best fit over the large interval. We ran the code on the $\sim2$ \AA\ resolution spectra and on $2\times$ and $3\times$ binned frames. This did not impact the final solution of $4.0127^{+0.0005}_{-0.0005}$ for SXDS-27434 consistently with the one-peak redshift probability distribution (RPD) and the high probability associated with it ($p=100$\%, integrating the RPD within $\pm0.01$ from the best fit, \citealt{benitez_2000, brammer_2008}; reduced $\chi^2=1.3$). Using the penalized Pixel Fitting algorithm \citep[pPXF,][]{cappellari_2004, cappellari_2017} and a slightly different set of assumptions returns a fully consistent estimate \citep{tanaka_2019}. Similarly secure is the solution of $z=3.775^{+0.002}_{-0.003}$ for COS-466654 ($p=98$\%, reduced $\chi^2=1.1$). On the other hand, the solution for SXDS-10017 $z=3.767^{+0.103}_{-0.001}$ is more uncertain and it varies by $0.015$ when using the native resolution or the mildly binned spectra. This uncertainty manifests itself as a second peak of the RPD at $z=3.871$ and with a lower probability associated with the best solution ($p=81$\%, reduced $\chi^2=1.6$). We conservatively adopt the solution derived with the native resolution, despite the significant improve in probability ($p\sim100$\%) when running \textsc{Slinefit} on the $3\times$ binned spectrum. In every case we rescaled the RPD by the empirical factor $C=2$ as described in S18b ($P(z) \propto \mathrm{exp} \left[ (\chi^2 (z) - \chi^2_{\rm min}) / 2C \right]$), in order to take into account the noise on scales of few spectral elements relevant for the template matching. We derived independent symmetrical uncertainties randomly perturbing and refitting the spectrum $1000$ times, obtaining consistent results ($z=4.0127^{+0.0004}_{-0.0004}$, $z=3.775^{+0.004}_{-0.004}$ and $z=3.767^{+0.051}_{-0.051}$ for SXDS-27434, COS-466654 and SXDS-10017, respectively). We finally refit the spectra with the best SED models obtained fixing $z=z_{\rm spec}$. In every case we find that our initial photometric redshift overestimated the spectroscopic determination (Figure \ref{fig:spectrum}). As a result, the initial choice of $z_{\rm phot}>4$ candidates to measure the $4000$~\AA\ break in the $K$ band did not have success. This is likely due to the choice of following up the brightest targets, biasing against breaks fully enclosed in the $K$ band. Based on the criteria defined in S18b, we can consider ``robust'' the redshifts for SXDS-27434 and COS-466654, while ``uncertain'' the estimate for SXDS-10017. \begin{figure*} \centering \includegraphics[width=\textwidth]{sed} \caption{\textbf{Spectral energy distribution of the quiescent galaxies.} The gray and black solid lines show the best modeling of the spectral energy distribution with fixed $z_{\rm phot}$ and $z_{\rm spec}$, respectively. In both cases we show the results obtained with the composite SFH parametrization by \citet{schreiber_2018c}. Red open circles and arrows mark the photometric points and $3\sigma$ upper limits.} \label{fig:sed} \end{figure*} \begin{figure*} \centering \includegraphics[width=\textwidth]{sfh} \caption{\textbf{Star formation history from modeling of the SED.} The black line shows the composite SFH (Eq. \ref{eq:composite_sfh}, \ref{eq:composite_sfh2}) corresponding to the best model representing the SED in Figure \ref{fig:sed}. The blue vertical line and shaded area mark the main formation epoch $t_{\rm form}$ and duration of the star formation episode $\Delta t_{\rm form}$ of the galaxy. The red line indicates the quenching time $t_{\rm quench}$. The blue horizontal line shows the mean $\langle \mathrm{SFR} \rangle_{\rm main}$ during the main formation epoch. The dashed and dotted-dashed gray lines mark the best truncated and delayed SFHs. The blue and red bands in the top insets mark the formation and quenching redshifts $z_{\rm form}$ and $z_{\rm quench}$ and their 90\% confidence intervals, respectively (Table \ref{tab:properties}).} \label{fig:sfh} \end{figure*} \section{Modeling of the Spectral Energy Distribution} \label{sec:sed} In order to derive detailed physical properties, we re-modeled the photometry and the rebinned spectra simultaneously with \textsc{Fast++}\footnote{\url{https://github.com/cschreib/fastpp}}, fixing $z=z_{\rm phot, spec}$ and the maximum possible age to the age of the Universe $t=t_{\rm obs}(z=z_{\rm phot, spec})$. The results are robust against the use of the photometric or the spectroscopic redshift. We assumed \cite{bruzual_2003} stellar population models, the \cite{chabrier_2003} initial mass function, and the \cite{calzetti_2000} dust attenuation law, allowing for extinction values in the range $A_{\rm V}=0-6$~mag. We fixed the metallicity to solar $Z=Z_\odot = 0.02$, as reasonable for very massive objects. We then adopted multiple analytical parametrizations of the star formation histories (SFHs): \begin{itemize} \item the delayed exponentially declining form $\mathrm{SFR}(t) \propto te^{-t/\tau}$ where $t$ is time, widely adopted in the literature. We allowed $\tau$ to vary within steps of 0.1 dex within $\mathrm{log}\,(\tau / \mathrm{yr}^{-1})= [6.5,10]$ and set a minimum age of $100$ Myr \item a truncated model, consisting in a constant $\mathrm{SFR} (t)$ over an interval $t_{\rm CSF}$ starting at an onset time $t_{\rm onset}$ and then instantaneously switched to $\mathrm{SFR}=0$ $M_{\odot}$ yr$^{-1}$. The duration $t_{\rm CSF}$ is free to vary within $\mathrm{log}\,(t_{\rm CSF}/ \mathrm{yr}^{-1}) = [6.5, t_{\rm obs}]$ in steps of 0.1 dex. \item the composite star formation history (SFH) described in S18b, so to allow direct comparison with their sample of massive quiescent galaxies at similar redshifts. This SFH consists of exponentially rising and declining phases with $e$-folding times free to vary: \begin{align} \label{eq:composite_sfh} \mathrm{SFR}_{\rm base} (t) \propto \left\{\begin{array}{ll} e^{(t_{\rm burst} - t)/\tau_{\rm rise}} & \text{for $t > t_{\rm burst}$} \\ e^{(t - t_{\rm burst})/\tau_{\rm decl}} & \text{for $t \le t_{\rm burst}$} \\ \end{array}\right. \end{align} and $t$ is the lookback time. We adopted the same grid of possible parameters as in S18b: $t_{\rm burst}=[10\,\mathrm{Myr},t_{\rm obs}]$ with (logarithmic) steps of 0.05~dex, $\tau_{\rm rise}, \tau_{\rm decl}=[10\,\mathrm{Myr},3\,\mathrm{Gyr}]$ with steps of 0.1~dex. As in S18b, we further included an extra degree of freedom to decouple the current SFR from the previous history of formation, allowing for a burst or abrupt quenching on a short period of duration $t_{\rm free}$ \citep{ciesla_2016}: \begin{align} \label{eq:composite_sfh2} \mathrm{SFR}(t) = \mathrm{SFR}_{\rm base}(t)\times\left\{\begin{array}{ll} 1 & \text{for $t > t_{\rm free}$,} \\ R_{\rm SFR} & \text{for $t \le t_{\rm free}$.} \\ \end{array}\right. \end{align} where $t_{\rm free}$ is free to vary between $10$ and $300$~Myr with steps of 0.5~dex, and $R_{\rm SFR}$ within $10^{-2}$ and $10^{5}$ with steps of 0.2~dex. \end{itemize} In order to properly compare the results from the different SFH parametrizations, we computed several integrated quantities \citep[e.g.,][S18b]{pacifici_2016, belli_2018}. We adopt the same terminology as in S18b to simplify the comparison between the two works. We define the epoch of assembly as the ``half-mass formation time'' $t_{\rm form}$, i.e., the time at which $50$\% of the total stellar mass was formed, excluding mass loss and recycling, obtained integrating $\mathrm{SFR}(t)$ over time. The ``duration of the main formation epoch'' $\Delta t_{\rm form}$ is the contiguous period enclosing $t_{\rm form}$ and $68$\% of the total integrated SFR, i.e., limited by the 16\% and 84\% percentiles of the integral of $\mathrm{SFR}(t)$ over time. We assumed the mean $\langle \mathrm{SFR} \rangle_{\rm main}$ during this period as representative of ``the typical SFR during the main mass assembly episode''. We computed ``the quenching epoch'' $t_{\rm quench}$ as the initial point of the longest contiguous time interval starting from the time of observation $t_{\rm obs}$ (at $z=z_{\rm spec}$) and going backwards, where $\mathrm{SFR}<10$\%$\langle \mathrm{SFR} \rangle_{\rm main}$. We finally adopted the uncertainties on the individual parameters estimated by \textsc{FAST++} following the $\Delta \chi^2 = (\chi^2 - \mathrm{min}\{\chi^2\})<2.71$ criterion to encompass the 90\% confidence interval \citep[S18b]{avni_1976, schreiber_2018b}. We further cross-checked the uncertainties by bootstrapping $100$ ($1000$) Monte Carlo simulations for COS-466654 and SXDS-27434 (SXDS-10017) with the same code. The number of simulations for COS-466654 and SXDS-27434 was limited by the available computational time, as their spectra have $>2000$ individual elements. The numerical approach results in less conservative error bars than the analytical one, as previously found for similar high-redshift quiescent objects (S18b). We therefore adopted the $\chi^2$ criterion as the final estimate for uncertainties derived from the modeling of the SED. \begin{deluxetable*}{lccc} \tabletypesize{\normalsize} \tablecolumns{4} \tablecaption{Physical properties of the quiescence galaxies.\label{tab:properties}} \smallskip \tablehead{ \colhead{Properties\tablenotemark{a}}& \colhead{SXDS-10017}& \colhead{SXDS-27434}& \colhead{COS-466654} } \startdata Coordinates (RA, Dec)/deg. & $(34.756250, -5.308038)$ & $(34.29871, -4.98987)$ & $(149.419583, 2.007550)$ \\ \smallskip $z_{\rm phot}$ & $4.07^{+0.12}_{-0.10}$ & $4.12^{+0.09}_{-0.08}$ & $4.11^{+0.06}_{-0.21}$ \\ \smallskip $z_{\rm spec}$ & $3.767^{+0.103}_{-0.001}$ & $4.0127^{+0.0005}_{-0.0005}$ & $3.775^{+0.002}_{-0.003}$ \\ \smallskip $\mathrm{log}(M_\star/M_\odot)$ & $10.89^{+0.05}_{-0.06}$ & $11.06^{+0.04}_{-0.04}$ & $10.82^{+0.03}_{-0.03}$ \\ \smallskip $\mathrm{log(SFR}_{\rm SED}/M_\odot \mathrm{yr}^{-1})$ & $<0.05$ & $1.38^{+0.28}_{-1.25}$ & $0.46^{+0.13}_{-0.69}$ \\ \smallskip $\mathrm{log(SFR}_{\rm H\beta}/M_\odot \mathrm{yr}^{-1})$ & $<0.53$ & --- & $<0.92$ \\ \smallskip $\mathrm{log(SFR}_{\rm [O\,\scriptscriptstyle{II}]}/M_\odot \mathrm{yr}^{-1})$ & --- & --- & $<0.41$ \\ \smallskip $A_{\rm V}/$mag & $0.2^{+0.2}_{-0.2}$ & $0.7^{+0.1}_{-0.1}$ & $0^{+0}_{-0}$ \\ \smallskip $t_{\rm form} / \mathrm{Gyr}$ & $1.08^{+0.09}_{-0.27}$ & $1.33^{+0.04}_{-0.06}$ & $1.28^{+0.04}_{-0.05}$ \\ \smallskip $z_{\rm form}$ & $5.34^{+1.34}_{-0.37}$ & $4.51^{+0.16}_{-0.11}$ & $4.64^{+0.15}_{-0.12}$ \\ \smallskip $t_{\rm quench} / \mathrm{Gyr}$ & $1.15^{+0.22}_{-0.14}$ & $1.37^{+0.11}_{-0.05}$ & $1.38^{+0.14}_{-0.08}$ \\ \smallskip $z_{\rm quench}$ & $5.02^{+0.62}_{-0.61}$ & $4.41^{+0.13}_{-0.31}$ & $4.37^{+0.21}_{-0.39}$ \\ \smallskip $\Delta t_{\rm form} /\mathrm{Myr} $ & $50^{+730}_{-27}$ & $32^{+140}_{-10}$ & $56^{+140}_{-41}$ \\ \smallskip $ \mathrm{log(\langle SFR} \rangle_{\rm main} / M_\odot \mathrm{yr^{-1}})$ & $3.21^{+0.64}_{-0.40}$ & $3.54^{+0.19}_{-0.35}$ & $3.07^{+1.22}_{-0.30}$ \\ \smallskip $ \mathrm{log}(\tau_{\rm decl}/\mathrm{yr})$& $7.1^{+1.3}_{-0.1}$& $7.2^{+0.2}_{-0.2}$& $7.0^{+0.6}_{-0.0}$\\ \enddata \tablenotetext{a}{The uncertainties on the quantities derived from the SED modeling represent the 90\% confidence interval computing following \citet[and Section \ref{sec:sed} of this work]{avni_1976}. These values are computed adopting the composite SFH from \citet[Eq. \ref{eq:composite_sfh} and \ref{eq:composite_sfh2} of this work]{schreiber_2018c}.} \end{deluxetable*} We show the best-fit SEDs in Figure \ref{fig:sed}, resulting from the composite SFHs in Figure \ref{fig:sfh}. The best models based on the three parametrizations of the SFHs are indistinguishable and the resulting parameters are consistent with each other within the uncertainties (Appendix \ref{sec:appendix}). Similarly, we tested the choice of the \cite{bruzual_2003} models by comparing with the set from \cite{conroy_2010}, retrieving consistent results within the error bars (Appendix \ref{sec:appendix}). From here on we therefore adopt the double exponential SFH as a reference in order to facilitate the comparison with the sample in \cite{schreiber_2018c}, using the \cite{bruzual_2003} templates. The best-fit parameters are reported in Table \ref{tab:properties}. We find that all three sources went through a major burst of star formation with $ \mathrm{log(\langle SFR} \rangle_{\rm main} \, [M_\odot \mathrm{yr^{-1}}]) \sim 3.07-3.54$ ($\langle \mathrm{SFR} \rangle_{\rm main}\sim1200-3500$ $M_{\odot}$ yr$^{-1}$) over a short period of time $\Delta t_{\rm form} \sim 50$~Myr. Notice that this refers only to the last episode of star formation. The abrupt quenching following the rapid formation occurred earlier in time for SXDS-10017 ($z_{\rm quench} = 5.02^{+0.62}_{-0.61}$) than for SXDS-27434 and COS-466654 ($z_{\rm quench} = 4.41^{+0.13}_{-0.31}$ and $4.37^{+0.21}_{-0.39}$, respectively). This naturally follows our initial selection and the rest-frame colors, once ascertained the spectroscopic redshift of the sources and excluded the contamination of low-redshift interlopers. \begin{figure} \centering \includegraphics[width=\columnwidth]{main_sequence} \caption{\textbf{Location with respect to the main sequence of galaxies.} The red stars and diamond indicate the location of our $z=3.77-4.01$ quiescent galaxies in the $M_{\star}$-SFR plane. The golden symbols mark the $\langle \mathrm{SFR_{\rm main}} \rangle$ of their progenitors at $z_{\rm form}$, fixing the mass to 50\% of the total final stellar mass. The magenta filled square and the brown open square indicate the quiescent galaxy at $z=2.99$ and $z=3.493$ reported in \citet{gobat_2012} and \citet{forrest_2019}, respectively. The filled and open orange circles mark spectroscopically confirmed and unconfirmed quiescent sources at $3\lesssim z\lesssim4$ from \citet{schreiber_2018c}. The yellow circles show $\langle \mathrm{SFR_{\rm main}} \rangle$ of the progenitors at $z_{\rm form}$ from S18b. The location of the main sequence at $z=3-4$ as parametrized in \citet{schreiber_2015} is shown by the blue shaded area. The thin blue line marks the position of sources $10\times$ below the main sequence at $z=3-4$. The golden solid lines indicate the position of the main sequence and $4\times$ above it at $z=5\,( \sim z_{\rm form})$. The dashed lines show the extrapolation of the main sequence to masses larger than $\mathrm{log}(M_\star/M_\odot) = 11.5$. Blue diamonds mark SMGs at $z>4$ from \citet{dacunha_2015}, blue crosses from \citet{michalowski_2017}, and blue open squares from \citet{miettinen_2017}.} \label{fig:ms} \end{figure} \section{Quiescence} \label{sec:quiescence} From the SED modeling we estimate stellar masses of $\mathrm{log}(M_\star/M_\odot) = 10.89^{+0.05}_{-0.06}$, $10.82^{+0.03}_{-0.03}$, and $11.06^{+0.04}_{-0.04}$ and SFR of $\mathrm{log}(\mathrm{SFR}/M_\odot \mathrm{yr}^{-1}) < 0.05$ (90\% upper limit), $0.46^{+0.13}_{-0.69}$, and $1.38^{+0.28}_{-1.25}$ for SXDS-10017, COS-466654, and SXDS-27434 respectively. These estimates place the galaxies $<2.1$, $1.6$, and $1.0$ dex below the main sequence of galaxies at their redshift, adopting the parametrization of \cite{schreiber_2015}. We show the location of our targets in the $M_{\star}$--SFR plane in Figure \ref{fig:ms}, along with the sample of similarly selected massive quiescent galaxies at $3<z<4$ from \cite{schreiber_2018c}, the massive object at $z=3.493$ reported in \cite{forrest_2019}, and the passive galaxy at $z=2.99$ confirmed through \textit{HST}/WFC3 slitless spectroscopy by \cite{gobat_2012}. We further estimated an upper limit on the SFR from H$\beta$ and [O\,{\footnotesize II}]\ emission lines, when covered by our observations. We do not identify any significant detections from the line search in the original resolution and the $\sim2$~\AA\ binned spectra. No evident residual emission appears when subtracting the best stellar SED continuum model from the spectra. We therefore put upper limits on the line fluxes as $\sqrt{\sum_i{\sigma_i}^2}$ where $\sigma_i$ is the noise per $i$-th spectral bin covered by the potential line. As line widths we assumed the FWHM of the stellar models we adopted to estimate the redshift (Section \ref{sec:redshift_estimate}). We then converted the upper limits into SFR following \cite{kennicutt_1998}, modified according to our \cite{chabrier_2003} IMF. We adopted the $A_{\rm V}$ extinction from the best SED model to correct for the dust attenuation. To be more conservative we also computed a final upper limit using the 90\% upper limit on $A_{\rm V}$ and including a possible extra-absorption for emission lines following the correction described in \cite{kashino_2018} ($E_{\rm neb}(B-V) = E_{\rm star}(B-V)/0.69$ adopting a \citealt{calzetti_2000} extinction law for both nebular and stellar emission). For SXDS-10017 we derive $\mathrm{SFR(H\beta)} < 2.3$ $M_{\odot}$ yr$^{-1}$\ ($<3.4$~$M_{\odot}$ yr$^{-1}$\ for the $90$\% conservative upper limit), placing the galaxy $1.8$ ($>1.6$) dex below the main sequence at its redshift. For COS-466654 we estimate $\mathrm{SFR(H\beta)} < 8.3$ $M_{\odot}$ yr$^{-1}$\ and $\mathrm{SFR([O\,\scriptstyle{II} \textstyle{])}} < 2.6$ $M_{\odot}$ yr$^{-1}$\ (90\% confidence interval), corresponding to $>1.2$ and $>1.7$ dex below the main sequence. The $H\beta$ and [O\,{\footnotesize II}]\ emission lines are not covered for SXDS-27434, but a similar attempt for $H\gamma$ returns an upper limit of $\mathrm{SFR}<8$ $M_{\odot}$ yr$^{-1}$\ \citep{tanaka_2019}. We finally looked for possible far-infrared/sub-mm emission associated with the three galaxies. SXDS-10017 and SXDS-27434 are not detected in \textit{Spitzer}/MIPS 24~$\mu$m (SpUDS survey, PI: James Dunlop), \textit{Herschel}/SPIRE $250$, $350$, and $500$~$\mu$m bands from the HerMES survey \citep{oliver_2012}, nor in the SCUBA-2 870~$\mu$m maps from the SCUBA-2 Cosmology Legacy Survey \citep[S2CLS]{geach_2017} or at VLA/1.4 GHz \citep{simpson_2006}. Similarly, COS-466654 is not detected in any of the mid-infrared ($24$ $\mu$m) to radio (1.4 GHz) bands collected in the ``super-deblended'' catalog of the COSMOS field by \cite{jin_2018}, resulting in a combined infrared signal-to-noise ratio of $\mathrm{SN}_{\rm IR} = 1.8$. At the current sensitivity and spatial resolution limits, this further confirms the quiescence of the two galaxies and excludes the presence of bright dusty star-forming companions in their immediate proximity, at odds with at least one previously reported case \citep{glazebrook_2017, simpson_2017, schreiber_2018b}. \section{Progenitors} \label{sec:progenitors} After putting on solid ground the existence and the properties of our targets, we now explore their past history. The number of quiescent galaxies at $3<z<4$, their epoch of formation and its duration, the quenching time, and the average SFR can be used to look for plausible progenitors. The short formation intervals $\Delta t $ and the large $\langle \mathrm{SFR} \rangle_{\rm main}$ are reminiscent of the depletion timescales and the observed SFR of dusty star-forming galaxies (DSFGs) at high-redshift \citep{daddi_2010, tacconi_2010, casey_2014}. To quantify such possible connection, we first computed the abundance of these two populations in terms of their \textit{comoving} number densities. Figure \ref{fig:number_densities} shows a compilation of values from recent works in the literature. \subsection{Number densities of quiescent galaxies at $3<z<4$} \label{sec:number_densities_qg} For the quiescent samples, we report the number densities for $UVJ$-selected galaxies at $M_\star> 4\times 10^{10}$~$M_{\odot}$\ and $3<z<4$ from UltraVISTA \citep{muzzin_2013} and from ZFOURGE as in \cite{straatman_2014} (see \citealt{spitler_2014} for an earlier estimate). The latter has been then updated by S18b after their spectroscopic follow-up and corrected for contamination of low redshift interlopers. Notice that S18b computes the number density to a $25$\% smaller threshold in stellar mass, compatibly with their completeness limit ($M_\star=3\times10^{10}$ $M_{\odot}$). We then included the calculation based on the latest version of the COSMOS catalog as in \cite{davidzon_2017}, who presented an extensive comparison with previous works (see references therein); the extended sample at $3<z<4$ from \cite{girelli_2019}; and finally from the combined CANDELS fields by \cite{merlin_2019}, expanding their previous work on GOODS-South \citep{merlin_2018}. The authors correct their estimates for incompleteness and compute the impact of the emission lines on the photometry (see \citealt{santini_2019} for the recent confirmation of the quiescence of a subsample of these galaxies). For consistency, we report the estimates with similar mass and redshift cuts as in \cite{straatman_2014} and S18b. We recomputed the number densities and their uncertainties whenever necessary to match the criteria above, i.e., by integrating the stellar mass functions in \cite{muzzin_2013} and \cite{davidzon_2017}. For the other works, we reported the original values.\\ Figure \ref{fig:number_densities} shows a wide range of measurements for the quiescent population, with variations up to a factor of $10\times$. The values derived integrating the stellar mass functions over large area surveys \citep{muzzin_2013, davidzon_2017} are systematically lower than computed by counting red galaxies in smaller fields \citep{straatman_2014, schreiber_2018c, merlin_2019}. We estimated the impact of the cosmic variance on COSMOS ($1.8$ deg$^2$) and ZFOURGE-like ($0.1$ deg$^2$) areas as in \cite{davidzon_2017}, both adopting the analytic approach by \cite{moster_2011} and by comparing with the mock galaxy catalogs from $24$ realizations in the Millenium simulations \citep{henriques_2015, springel_2005, boylan-kolchin_2009}, the latter including Poisson noise. For masses $\gtrsim 3\times10^{10}$ $M_{\odot}$, we estimate a $\sigma_{\rm cv}=9.3$\% ($9.8$\%) uncertainty due to cosmic variance from the analytical (heuristic, including Poissonian noise) approach in the COSMOS field at $3<z<4$. For the area covered by the ZFOURGE survey for the same redshift range and $M_{\star}$\ threshold, we compute a $\sigma_{\rm cv}=15.3$\% (a factor of $1.5\times$) uncertainty from the analytical (heuristic, including Poissonian noise) approach. Besides the variations induced by cosmic and sample variance, the difference among the various estimates of number densities is affected by the classification method, based on colors and/or sSFR with different thresholds \citep{davidzon_2017, merlin_2019}; the contamination of lower redshift interlopers (see the discussion in S18b) and AGN \citep{davidzon_2017}; the slightly different lower stellar mass integration limits and redshift intervals considered; and the depth of the observations. \begin{figure} \includegraphics[width=\columnwidth]{number_densities} \caption{\textbf{Number densities of high-redshift quiescent galaxies and SMGs.} The red ticks mark the observed number densities of massive ($M_\star \gtrsim 4\times10^{10}$~$M_{\odot}$) quiescent galaxies at $3 \lesssim z \lesssim 4$ from the works and projects reported on the Y-axis. The rose areas indicate the uncertainties, when available. The blue open ticks mark the number densities of variously selected $z>4$ SMGs available in the literature. The blue filled ticks include a correction of the duty cycle of SMGs ($\rho_{\rm corr} = \rho \times t_{\rm obs}/t_{\rm burst}$, where $t_{\rm burst}=200$ Myr), following \citet{ivison_2016}. The blue shaded areas indicate the uncertainties reported in the original works (Cooke+18, Michalowski+17 ($4<z<5$), Michalowski+17 ($5<z<6$)) or recomputed in this work based on the $z_{\rm phot}$ uncertainties of the samples (Michalowski+17, Miettinen+17, da Cunha+15). The calculations for the \textit{Illustris} and \textit{Illustris} TNG (300-1) simulations were performed in the snapshots corresponding to the labeled redshifts. The comoving number densities of SMGs in both suites are based on the catalogs by C. Hayward et al. (in preparation) down to a threshold of $1$ mJy, similar to the ALESS limiting flux and $\sim3-4\times$ higher than for S2CLS/COSMOS. No duty cycle correction is applied to simulations. For the simulated quiescent galaxies, the rose area indicates the variation between estimates including only ``quenched'' ($\mathrm{sSFR}<10^{-11}$ yr$^{-1}$) or also ``quenching/post-starburst'' objects ($\mathrm{sSFR}<10^{-10}$ yr$^{-1}$, red ticks). The values for the \textit{Illustris} TNG(100-1) have been corrected by $1.2\times$ for the box volume (Section \ref{sec:mass_resolution_effect}).} \label{fig:number_densities} \end{figure} \subsection{A conservative lower limit from spectroscopy} For the sake of completeness, we finally derived a conservative estimate on the comoving number densities of quiescent objects at $3.219<z_{\rm spec}<4.012$ purely based on spectroscopically confirmed galaxies, by combining our sample and the objects in S18b. Considering the $8$ robust detections over an area of $2.6$ deg$^{2}$ covered by the COSMOS, UDS, and ZFOURGE fields\footnote{Two of the ZFOURGE fields are included in COSMOS and UDS. Therefore, we did not account for their area in this calculation.}, we obtain $n=3.4\times10^{-7}$ Mpc$^{-3}$ at face value and a 3$\sigma$ lower limit of $>8.8\times10^{-8}$ Mpc$^{-3}$ assuming a Poissonian distribution (Table 2 in \citealt{gehrels_1986}). Including $5$ extra uncertain redshift estimates, we derive $n=5.5\times10^{-7}$ and $>2.0\times10^{-7}$ Mpc$^{-3}$ at face value and as a 3$\sigma$ lower limit, respectively. These estimates represent the most conservative limits on the number of quiescent objects at these redshifts, being purposely not corrected for any uncertain completeness effect. With the steady growth of the number of confirmed quiescent objects, the constraining power of these lower limits is destined to rapidly increase in the immediate future. \subsection{Number densities of sub-millimeter galaxies at $z>4$} \label{subsubsec:smg_numberdensities} We collected recent results from large surveys of ``sub-millimeter'' galaxies (SMGs) with detailed modeling of the optical and near-infrared counterparts, a necessary step to derive at least a photometric estimate of the redshift and stellar masses. The definition of a ``sub-millimeter galaxy'' is purely observational and it hides a certain degree of diversity of the underlying population. However, it overlaps with the physical definition of DSFGs at the highest redshifts explored so far, therefore capturing suitable candidates to be the progenitors of massive quiescent galaxies. In this work we compiled results from recent surveys on large fields: \begin{itemize} \item The (ALMA) Laboca Extended \textit{Chandra} Deep Field South Survey \citep[(A)LESS,][]{weiss_2009, hodge_2013, simpson_2014, dacunha_2015,danielson_2017}: $99$ securely detected sources down to an rms of $0.4$~mJy beam$^{-1}$ with ALMA Band 7, originally selected at $870$~$\mu$m down to rms=1.2 mJy/beam with the Large Apex BOlometer Camera (LABOCA) on the APEX telescope in the Extended Chandra Deep Field South field. The optical/near-infrared follow-up includes 19 bands, with a $3\sigma$ detection limit in $K_{\rm s}=24.4$ mag \citep{simpson_2014}. Here we use the results of the full SED modeling with \textsc{Magphys} \citep{dacunha_2008} presented in \cite{dacunha_2015}. Including the uncertainties on the $z_{\rm phot}$, $17^{+26}_{-15}$ sources lie at $z_{\rm phot} \geq 4$ over a $0.25$ deg$^2$ area \citep{simpson_2014}. We further take into account the $2\times$ underdensity of SMGs in the field \citep{weiss_2009} for the number density calculation. Note that this area is formally correct only for fluxes covered by the original LESS survey. Below this limit, the number counts might not be fully representative of the overall population of fainter SMGs down to the ALESS detection limit, but rather of dim sources in the vicinity of previously known bright galaxies \citep{karim_2013}. In this sense, the number density for the faintest sources is in principle biased (but see \citealt{simpson_2014}). However, in absence of a blind survey with such wide coverage, we proceed with the calculation. \item The SCUBA-2 Cosmology Legacy Survey \citep[S2CLS,][]{geach_2017, michalowski_2017}: $\simeq 650$ sources detected at $\geq 4\sigma$ at $850$~$\mu$m with SCUBA-2 at the James Clerk Maxwell Telescope with secure fluxes $\gtrsim 4$~mJy in the COSMOS and UDS fields (area of $2.17$ deg$^2$) and 1.1 mm coverage from ASTE AzTEC (see \citealt{dudzeviciute_2019} for a recent re-imaging of the UDS field with ALMA). Roughly $\sim$ 70\% of this sample has a mass estimate obtained modeling the optical/near-infrared photometry with \textsc{Magphys}, notably assuming a double-component SFH \citep{michalowski_2014}. The limiting $3\sigma$ depth in the $K_{\rm s}$ band is $24.0/24.9$ mag from the UltraVISTA \citep{mccracken_2012} DR3 deep and ultradeep stripes in COSMOS and $25.2$ mag in UDS. Considering only the objects above the completeness limit of $\mathrm{SFR}=300$~$M_{\odot}$ yr$^{-1}$ and taking into account the uncertainties on $z_{\rm phot}$, $91^{+63}_{-77}$ sources lie at $z_{\rm phot} \geq 4$, but only $16^{+7}_{-6}$ with a photometric redshift from the optical/near-infrared, the rest being determined from the far-infrared SED only. \item The ALMA follow-up of $124$ SMGs in COSMOS, selected at 1.1 mm with ASTE AzTEC down to $S^{\rm AzTEC}_{\rm 1.1\,mm}=3.5$~mJy at $>4\sigma$, and with optical/near-infrared counterparts \citep{brisbin_2017, miettinen_2017}. The ALMA follow-up at 1.3 mm reaches an rms of $\sim 0.1$ mJy beam$^{-1}$. The SED has been modeled with \textsc{Magphys} to obtain stellar masses and SFR \citep{miettinen_2017} and with \textsc{Hyperz} \citep{bolzonella_2000} to estimate the photometric redshifts \citep{brisbin_2017}. Five sources are spectroscopically confirmed above $z>4$, consistently with their photometric redshifts \citep{smolcic_2015, gomez-guijarro_2018}. Over a covered area of $0.72$ deg$^{2}$, we count $17^{+16}_{-9}$ sources with $z_{\rm phot}\geq 4$. \end{itemize} We then computed the number densities of SMGs above a redshift threshold $z=z_{\rm thresh}=4$ as described in \cite{ivison_2016}: \begin{equation} n = \frac{N}{V_{\rm com}} \mathcal{C}_{\rm duty} \ [\mathrm{Mpc}^{-3}] \end{equation} where $N$ is the number of galaxies detected at $z > z_{\rm thresh}$ and $V_{\rm com}$ is the comoving volume spanned by the observations detecting the SMG population. $\mathcal{C}_{\rm duty} = t_{\rm obs}/ t_{\rm burst}$ corrects for the typically short duty cycle of SMGs ($t_{\rm burst}$), which shine in the far-infrared/sub-mm regime only for a fraction of their whole existence or, in this case, of the cosmic time probed by the observations $t_{\rm obs}$ \citep[e.g.,][]{toft_2014}. In Figure \ref{fig:number_densities} we show the number densities both uncorrected and introducing $\mathcal{C}_{\rm duty}(t_{\rm burst} = 200\,\mathrm{Myr})$ as a reference (see Section \ref{sec:dutycycle} below). We included the uncertainties on the photometric redshift estimates by counting galaxies with $z_{\rm up}$, $z_{\rm low} > z_{\rm thresh}$, where $z_{\rm up}$, $z_{\rm low}$ are the upper and lower boundary of the redshift uncertainties as reported in the original works. This uncertainty dominates the error budget. We did not include further corrections for completeness of the surveys beyond what reported in the literature works (see \citealt{miettinen_2017} for a caveat for the COSMOS sources). For reference, we also report two recent results from the literature, namely number densities for ultra-red galaxies selected from the \textit{Herschel} Astrophysical Terahertz Large Area Survey \citep[\textit{H}-ATLAS,][]{ivison_2016} and for a sub-sample of spectroscopically confirmed SMGs at $z\sim4.5$ from the S2CLS survey \citep{cooke_2018}, along with the number densities originally reported in \cite{michalowski_2017}.\\ Figure \ref{fig:number_densities} shows that large variations are present in the observed number densities of SMGs. This is likely due to the variety of selection criteria, the depths, the spatial resolution, and the completeness of the various surveys, plus the intrinsic diversity of the SMG population. The choice of the sub-mm band for the initial selection corresponds to the sampling of a specific portion of the far-infrared SED. A selection based on \textit{Herschel} bands or at $\sim 870$~$\mu$m ($170$~$\mu$m rest-frame at $z=4$) maps the SED closer to the peak of the dust emission, being sensitive to the temperature and total IR luminosity ($\propto\,\mathrm{SFR}$). Opting for a cut at $1.1$~mm ($220$~$\mu$m rest-frame at the same redshift) results into the sampling of the optically thin dust emission in the Rayleigh-Jeans tail of the SED, thus being mildly sensitive to the effective temperature and privileging large dust masses over large SFR, even if ultimately the two quantities are correlated. The depth and spatial resolution of the observations likely has an even stronger impact than the selection criterion: shallow limits from single dish observations allow us to capture only the rarest and strongest starbursting systems, likely affected by source blending. Moreover, the necessity to identify a counterpart in the optical/near-infrared to estimate stellar masses and redshift biases the results against the most dusty and highest redshift objects. This is evident for the S2CLS sample, for which only $\sim20$\% of the galaxies with $z_{\rm phot}>4$ have an optical/near-infrared redshift estimate, the rest being determined from the far-infrared SED only \citep{michalowski_2017}. However, adopting the best available photometric redshifts allows us to improve previous estimates based on the simple assumption of a fixed fraction of SMGs above $z=4$ \citep[e.g.,][]{straatman_2014, ivison_2016}. \begin{figure*} \includegraphics[width=\textwidth]{kde_including_tanaka_masssfr} \caption{\textbf{Stellar masses and SFRs of candidate progenitors of high-redshift quiescent galaxies.} Kernel Density Estimator (KDE) of the density probability distributions of stellar masses (left panel) and SFRs (right panel) for the progenitors at $z_{\rm form}$ of massive quiescent galaxies at $3<z<4$ (this work+S18b, golden line) and SMGs at $z>4$ from the ALESS, COSMOS and S2CLS surveys \citep[blue lines]{dacunha_2015, miettinen_2017, michalowski_2017}. For reference, we show the stellar mass distribution of the QGs (red thin line). The areas under the curves are normalized to the number density of each population (Figure \ref{fig:number_densities}).} \label{fig:progenitors_properties} \end{figure*} \subsection{Standard evolutionary connection} \label{sec:evolutionary} We now explore the possible evolutionary connection between SMGs and quiescent galaxies (see previous results in the literature at similar or lower redshift \citealt{cimatti_2008, simpson_2014, toft_2014, straatman_2014, miettinen_2017, gomez-guijarro_2018}). Here we test the common and extreme assumption that \textit{all SMGs at $z>4$ turn into a quiescent object at $3<z<4$} by matching their number densities \citep[e.g.,][]{toft_2014}. For the calculation, we adopt a final number density for quiescent galaxies at $3<z<4$ of $n=1.4\times10^{-5}$ Mpc$^{-3}$ from S18b. We compute results for the samples of SMGs with optical/near-infrared counterparts from the ALESS \citep{dacunha_2015}, S2CLS \citep{michalowski_2017}, and COSMOS \citep{miettinen_2017} surveys. \subsubsection{Stellar masses and SFR distributions} \label{subsubsec:distributions} First, we can compare the distributions of the stellar masses and SFRs of SMGs and the progenitors of quiescent galaxies. In Figure \ref{fig:progenitors_properties} we present the (Gaussian) kernel density estimation (KDE) of the observed distributions. We derived the expected properties of the QG progenitors from the SED modeling of SXDS-10017, SXDS-27434, and COS-466654 and the sample in S18b. We adopted $\langle \mathrm{SFR} \rangle_{\rm main}$ as the average SFR during the main formation epoch and $50$\% of the final stellar mass as $M_\star$ for the progenitors (excluding mass loss and recycling, Section \ref{sec:sed}). Notice that the choice of the SFH does not impact $\langle \mathrm{SFR} \rangle_{\rm main}$ within the uncertainties (Figure \ref{figapp:sfhs}). For the SMGs, we compiled the stellar masses from \cite{dacunha_2015}, \cite{michalowski_2017}, and \cite{miettinen_2017} and the SFRs they derived from the far-infrared luminosities. Given the best-fit values for $\Delta t_{\rm form}$, the far-infrared luminosities and $\langle \mathrm{SFR} \rangle_{\rm main}$ probe similar timescales for star formation. Not all the SMGs have an optical/near-infrared counterpart, necessary to derive a stellar mass. Therefore, the results are biased towards the less dust-obscured objects, either at lower masses or more advanced stages of formation, when the dust shrouding the cocoons of star formation starts fading away.\\ By definition, the integral of each probability density curve is equal to $\int_{-\infty}^{+\infty}P(x)\,dx=1$. In order to compare the various populations, we normalized the KDE to the number density of each sample ($\int_{-\infty}^{+\infty}n\,P(x) \,dx = n$ [Mpc$^{-3}$]). Therefore, the area under each curve in Figure \ref{fig:progenitors_properties} is exactly equal to the number density of each sample, with $\mathcal{C}_{\rm duty} = 1$ for the SMGs (no correction for duty cycle).\\ The left sides of the distributions are in first approximation related to the depth of the observations. The $K_{\rm s}$ band limits are similar for all the surveys and, indeed, the stellar mass distribution for the quiescent galaxies and their progenitors, the ALESS \citep{dacunha_2015} and the COSMOS surveys \citep{miettinen_2017} show a consistent lower mass limit. The only exception is the S2CLS survey \citep{michalowski_2017}, which -- even sharing a similar $K_{\rm s}$ band depth with all the other surveys -- results in a non-negligible probability of low stellar masses. However, this tail of low-mass galaxies disappears when considering only $z_{\rm phot}$ estimates from the optical/near-infrared. Its existence may therefore be a spurious effect due to wrong redshift estimates from the far-infrared SED, which we therefore discarded. For clarity, we show the stellar mass distribution without this low-mass tail in Figure \ref{fig:progenitors_properties}. For what concerns the SFRs, it is evident the effect of the cut imposed by the sensitivity limits of the SMG surveys, resulting in a lower limit on the $L_{\rm IR}\sim\mathrm{SFR}$. On the other hand, the lower limit of the distribution of the progenitors mainly depends on the modeling of the SED and the best SFH.\\ The peaks of the distributions of the stellar masses are consistent for the ALESS survey and the progenitors of the quiescent galaxies, while the modeling of the S2CLS and the COSMOS sources results in larger stellar masses than the quiescent (and star-forming) population at lower redshift, as already reported in \cite{miettinen_2017} and \cite{michalowski_2017}. Under the initial assumption that all SMGs at $z>4$ become quiescent at $3<z<4$, the massive SMGs cannot be considered only a tail of the overall distribution (Appendix \ref{app:duty}). Notice that here we do not include the stellar mass that the ongoing episode of star formation will add to SMGs, which would further increase the discrepancy with the quiescent population. On the other hand, all the distributions of SFRs roughly peak at the same value, even if the KDE for the progenitors of quiescent galaxies allows for significant probability densities at low SFRs, not being hampered by an observational limit. The extension of the distribution of the progenitors towards low SFRs points towards \textit{the necessity of including less extreme systems to explain the existence of red, quiescent galaxies at $3<z<4$}. Independent structural and dynamical arguments suggest a similar conclusion on the origin of quiescent galaxies at $z\sim2$, whose precursors might be compact blue SFGs with properties typical of objects on the main sequence \citep{barro_2013, barro_2017,popping_2017, gomez-guijarro_2019} or a dust-obscured population so far overlooked \citep{williams_2019, wang_2019}. This shows the relevance of pushing our search for DSFGs at lower SFRs, and not limit it to classical starbursting SMGs. We come back to this point later, providing supporting evidence from cosmological simulations (Section \ref{sec:simulations}). \subsubsection{The duty cycle of SMGs} \label{sec:dutycycle} As mentioned in Section \ref{subsubsec:smg_numberdensities}, only a fraction of the global star-forming population shines as SMGs at a specific time, this fraction depending on the sub-mm flux threshold to define an SMG. With the usual assumption that all such systems at $z>4$ turn into the quiescent population at $3<z<4$, we can therefore derive the duty cycle correction $\mathcal{C}_{\rm duty}$ necessary to make the number densities of the two populations exactly equal \citep[e.g.,][]{toft_2014}. Here we do this by matching the number densities (i.e., the area under the curves in Figure \ref{fig:progenitors_properties}) and the stellar mass or SFR distributions (i.e., the shape of the curves) of the quiescent progenitors and the samples of SMGs (see Appendix \ref{app:duty} for the details). We derive $t_{\rm burst} \sim 200-400$~Myr for the sources in the ALESS survey. For the COSMOS and S2CLS surveys we find similar $t_{\rm burst}\sim100$~Myr matching the SFR distributions, but substantially shorter values down to $t_{\rm burst}\sim10$~Myr when matching the $M_{\star}$\ KDEs. The values for $t_{\rm burst}$ are consistent with the typical depletion timescales of strongly star forming galaxies at high-redshift ($t_{\rm duty}\sim100-200$~Myr, \citealt{daddi_2010, tacconi_2010, casey_2014}) and with the formation timescales via the archeological approach \citep[e.g.,][]{thomas_2005, renzini_2006, choi_2014, onodera_2015}. However, at least for the self-consistent values of the ALESS sources, we find duty cycle corrections $\mathcal{C}_{\rm duty} \sim 5\times$ smaller than estimated by \cite{toft_2014} for the range $2<z<3$. Notice that this is partly due to the longer $t_{\rm burst}$ we estimate, and partly it is a natural consequence of observing higher redshift sources as the time spanned between $4<z<6$ is half of the interval between $2<z<3$. These calculations depend on a set of assumptions that we specified at each step and they are affected by several sources of uncertainties. An extended discussion is reported in Appendix \ref{app:duty}. Here we stress once again that the evolutionary connection we tested here relies on the extreme assumption that all SMGs at $z>4$ become quiescent at $3<z<4$, driving to the introduction of a duty cycle correction. Looser conditions (e.g., only $X$\% of the SMGs turn into quiescent galaxies) result to the first order in longer duty cycles by a similar amount. Similar rescaling factors apply when considering a value different than our reference estimate of the comoving number density of quiescent galaxies. \section{Can cosmological simulations capture the formation of quiescent galaxies at $\lowercase{z}\sim4$?} \label{sec:simulations} \subsection{Realistic comoving number densities of quiescent galaxies} \label{sec:simulations_quenched} Previous attempts of reproducing the population of quenched galaxies at $z>3$ with cosmological simulations and semi-analytical models fall short in producing enough systems by up to an order of magnitude in the majority of cases \citep[S18b,][]{cecchi_2019}. Here we explore the content of the recent \textit{Illustris} TNG cosmological simulation public release \citep{marinacci_2018, naiman_2018, volker_2018, pillepich_2018, nelson_2018, nelson_2019}, in comparison with the previous \textit{Illustris} project (\citealt{vogelsberger_2014, vogelsberger_nature_2014, genel_2014, nelson_2015}; see \citealt{merlin_2019} for a similar attempt). As for the observations presented above, we structured our search in two steps: we first looked for the quiescent galaxies in the largest boxes available TNG 300 ($205/h$ comoving Mpc) and TNG 100 ($75/h$ comoving Mpc), so to build enough statistics of these rare systems. We subsequently studied the progenitors of the quenched systems possibly shining as SMGs in these boxes \citep[C. Hayward et al. in preparation,][]{hayward_2013}. \textit{Illustris} TNG 100 has a similar box size to the old \textit{Illustris}-1, so we drew comparisons among these two to test the performances of the new simulations.\\ \begin{deluxetable*}{lcccc} \tabletypesize{\normalsize} \tablecolumns{5} \tablecaption{Number and number densities of quiescent galaxies and their progenitors in the \textit{Illustris} and \textit{Illustris} TNG cosmological simulations.\label{tab:illustris}} \smallskip \tablehead{ \colhead{}& \colhead{\textit{Illustris}-1}& \colhead{\textit{Illustris} TNG 100-1}& \colhead{\textit{Illustris} TNG 100-2}& \colhead{\textit{Illustris} TNG 300-1}\\ \colhead{Box size [cMpc]}& \colhead{75/$h$}& \colhead{75/$h$}& \colhead{75/$h$}& \colhead{ 205/$h$}\\ \colhead{Dark matter mass resolution [$10^6\,M_{\odot}$]}& \colhead{$6.3$}& \colhead{$7.5$}& \colhead{$59.7$}& \colhead{$59$}} \startdata \multicolumn{5}{c}{Quiescent galaxies\tablenotemark{a}}\\ \rule{0pt}{3ex} N$_{<-11}$, N$_{[-11,-10]}$ $(z=3)$& 1, 3& 45, 10& 25, 6& 631, 123\\ $n_{<-11}$, $n_{[-11,-10]}$ $(z=3)$ [$10^{-6}$ Mpc$^{-3}$]& 0.8, 2.4& 36.6, 8.1$^\dagger$& 20.3, 4.9& 25.1, 4.9 \\ \rule{0pt}{3ex} N$_{<-11}$, N$_{[-11,-10]}$ $(z=3.7)$& 0, 1& 8, 0& 0, 1& 53, 12\\ $n_{<-11}$, $n_{[-11,-10]}$ $(z=3.7)$ [$10^{-6}$ Mpc$^{-3}$]& --, 0.8& 6.5$^\dagger$, --& --, 0.8& 2.1, 0.5\\ \hline \multicolumn{5}{c}{Sub-millimeter galaxies\tablenotemark{b}}\\ \rule{0pt}{3ex} N$_{>\rm 1\,mJy}$, N$_{>\rm 3.5\,mJy}$ $(z=4)$ & 49, 0 & 51, 2 & 59, 2& 1224, 48 \\ $n_{>\rm 1\,mJy}$, $n_{>\rm 3.5\,mJy}$ $(z=4)$ [$10^{-6}$ Mpc$^{-3}$]& 39.8, -- & 41.5, 1.6& 48.0, 1.6& 48.7, 1.9 \\ \rule{0pt}{3ex} N$_{>\rm 1\,mJy}$, N$_{>\rm 3.5\,mJy}$ $(z=5)$ & 11, 1& 15, 0 & 17, 1& 393, 11 \\ $n_{>\rm 1\,mJy}$, $n_{>\rm 3.5\,mJy}$ $(z=5)$ [$10^{-6}$ Mpc$^{-3}$]& 8.9, 0.8& 12.2, --& 13.8, 0.8& 15.6, 0.4\\ \enddata \tablenotetext{a}{Number of galaxies in the $z=3$ and $z=3.7$ snapshots with $M_\star \geq 4\times10^{10}$ $M_{\odot}$\ and $\mathrm{sSFR} \leq 10^{-11}$ yr$^{-1}$ (N$_{<-11}$, ``quenched'') or $10^{-11} < \mathrm{sSFR} \leq 10^{-10}$ yr$^{-1}$ (N$_{[-11,-10]}$, ``quenching''). All the quantities are computed within twice the stellar half-mass radius (\textsc{INRAD} in the \textit{Illustris} data releases). The comoving number densities $n$ of ``quenched'' and ``quenching'' galaxies, obtained dividing N$_{<-11}$, N$_{[-11,-10]}$ by the comoving volume of the box (Size$^3$, adopting $h=0.7$).} \tablenotetext{b}{Number of galaxies in the $z=4$ and $z=5$ snapshots with $S_{850}$ flux $>1$ mJy and $>3.5$ mJy within 25 kpc, computed following \cite{hayward_2013}, Hayward et al. (in preparation).\\ $\dagger$ These values are not corrected by the factor $1.2\times$ for the volume of the box (Section \ref{sec:mass_resolution_effect}).} \end{deluxetable*} To mimic our observational selection, we identified quiescent galaxies in the $z=3.7$ snapshot based on the sSFR within twice the stellar half-mass radius (\textsc{INRAD} quantities in the catalogs). The SFR is averaged over 10 Myr, but we checked for the consistent quiescence in the descendant subhalos down to $z=2$, in order to exclude contamination of temporary low-activity galaxies. We selected both ``quenched'' and ``quenching'' (or post-starburst) galaxies fixing a threshold of $\mathrm{sSFR} \leq 10^{-11}$ yr$^{-1}$ and $10^{-11} < \mathrm{sSFR} \leq 10^{-10}$ yr$^{-1}$, respectively, and imposing a minimum $M_\star = 4\times10^{10}$ $M_{\odot}$\ similar to the mass completeness limits in the observations (Section \ref{sec:number_densities_qg}). Note that such a selection in sSFR is robust against variations of the timescale over which the SF is averaged in simulations in the range $\sim10-200$ Myr and the measurement of quantities in different apertures \citep{sparre_2015, davidzon_2018}. Moreover, the quiescent fractions are similar when separating galaxies based on colors or distance from the main sequence \citep{donnari_2019}.\\ We summarize the results of the search in Table \ref{tab:illustris} and Figure \ref{fig:number_densities}. The comoving number densities $n$ of quenched galaxies in the \textit{Illustris} TNG boxes are consistent only with the lowest observational estimates at $z=3.7$, while the old \textit{Illustris} run does not contain enough of these objects, as previously noted \citep[S18b]{wellons_2015} and in line with similar previous attempts in smaller boxes \citep[e.g., \textsc{Mufasa},][]{dave_2016}. On the contrary, we retrieve a numerous enough population of quiescent galaxies in the $z=3$ snapshot (i.e., the lower limit of the redshift range explored here with spectroscopy) of the \textit{Illustris} TNG simulations, while the old \textit{Illustris} still fails at reproducing the observed number densities. This is likely due to the new feedback scheme implemented in the TNG simulations. \subsection{The impact of the mass resolution} \label{sec:mass_resolution_effect} Interestingly, the largest TNG 300 box contains $2.5\times$ and $1.5\times$ less quenched/quenching galaxies per unit comoving volume than TNG 100 at $z=3.7$ and $z=3$, respectively (Table \ref{tab:illustris}). We checked for the effect of the $\sim8\times$ lower mass resolution in TNG 300 than in TNG 100, which might not result in full convergence. As discussed in \cite{pillepich_2018}, the lower resolution of TNG 300(-1) translates into lower stellar masses and SFR than in TNG 100(-1), which might bias our number densities. Therefore, we compared the number of galaxies above our mass threshold ($M_\star \geq 4\times10^{10}$ $M_{\odot}$) in TNG 100-1 and TNG 100-2, the latter having a resolution similar to TNG 300-1. We retrieve $\sim25$\% less galaxies in TNG 100-2 than in TNG 100-1, this fraction increasing when selecting quenched/quenching galaxies, so that we find only 1 (31) objects with $\mathrm{sSFR}\leq10^{-10}$ yr$^{-1}$ at $z=3.7$ ($z=3$) in TNG 100-2, a factor of $8\times$ ($1.7\times$) less than TNG 100-1. Therefore, while at $z=3.7$ the low number statistics and the cosmic variance likely dominate the difference between TNG 300-1 and TNG 100-1, the mass resolution explains the discrepancy at $z=3$ for our selection.\\ \noindent From the comparison between the number densities of quenched/quenching objects in TNG 300-1 and TNG 100-2, we derive a simple factor to correct the comoving number densities from the smaller box of the TNG 100-1 run, while retaining the advantages of the high resolution. We compute such correction as the ratio of the number densities $n_{\rm TNG300}/n_{\rm TNG100(2)} = 1.2\times$ at $z=3$, where we have enough statistics, and we assume that this factor applies also at the previous snapshot at $z=3.7$. Therefore, our fiducial number densities of quenched/quenching objects for the TNG 100-1 box are $5.4\times10^{-5}$ and $7.8\times10^{-6}$ Mpc$^{-3}$ at $z=3-3.7$, respectively. \subsection{Simulated sub-mm galaxies and their properties} \begin{figure} \centering \includegraphics[width=\columnwidth]{main_sequence_illustrisTNG} \caption{\textbf{Stellar mass and SFR plane for the \textit{Illustris} TNG-300 simulation.} The red circles indicate the location of quiescent galaxies ($\mathrm{sSFR}\leq10^{-10}$ yr$^{-1}$ within twice the half-mass radius) in the $z=3.7$ snapshot (the empty symbols represent upper limits fixed at $\mathrm{SFR}=10^{-3}$ $M_{\odot}$ yr$^{-1}$\ for display purpose). The location of the main sequence at $z=3-4$ as parametrized in \citet{schreiber_2015} is shown by the blue shaded area. The blue solid line marks the position of sources $10\times$ below the main sequence at $z=3-4$. The golden solid lines indicate the position of the main sequence and $4\times$ above it at $z=5\,( \sim z_{\rm form})$. The dashed lines show the extrapolation of the main sequence to masses larger than $\mathrm{log}(M_\star/M_\odot) = 11.5$ in order to facilitate the comparison with Figure \ref{fig:ms}. Dark and light blue crosses mark SMGs with $S_{850\rm \mu m}\geq1$ mJy at $z=5$ and $z=4$, respectively, as computed by Hayward et al. (in preparation). The gray and red diamonds show SFGs with $S_{850\rm \mu m}\leq1$ mJy at $z>4$ and quiescent objects at $z=4$, respectively. The gray tracks show the evolution of $z=3.7$ quiescent objects back to $z=5$, while the black solid line shows the median evolution in the same interval.} \label{fig:ms_illustrisTNG} \end{figure} We then traced the evolution of the main subhalo progenitor of each quiescent galaxy back to the main formation epoch derived for the observed targets ($z\sim5$, Section \ref{sec:sed}). In Figure \ref{fig:ms_illustrisTNG} we show the evolutionary tracks in the $M_{\star}$-SFR plane for TNG-300, but similar conclusions hold for TNG-100. In order to directly compare with the operational definition of SMGs widely spread among observers, we also show the modeling of the 850 $\mu$m emission of $z=4-5$ galaxies by Hayward et al. (in preparation). The authors compute mock 850 $\mu$m fluxes for all the sources with $M_\star>4\times10^{9}$ $M_{\odot}$, based on a relation derived from full radiative transfer calculations on idealized discs and mergers at a spatial resolution inaccessible for a cosmological simulations \citep{hayward_2011, hayward_2013}. The calculation is performed by integrating the ISM and the SFR within 25 kpc (and not within twice the half-mass radius) excluding the particles in satellites, in order to compare with typically resolved SMGs (Hayward et al. in prep.). A significant difference between SFR(25 kpc) and SFR(INRAD) is the reason why a minority of objects display bright $S_{850}$ fluxes while being formally quiescent in our selection (Figure \ref{fig:ms_illustrisTNG}). Notice that the 850~$\mu$m emission depends not only on the SFR, but also on the dust mass and its temperature: highly star-forming galaxies might thus not shine as SMGs due to a lower dust content and, thus, hotter dust temperature \citep[e.g.,][]{hayward_2012,safarzadeh_2016}. As a reference, we adopt here cuts at $S_{\rm 850 \mu m}>1$ mJy and $>3.5$ mJy, comparable with the ALESS and the COSMOS/S2CLS limiting sensitivities, respectively.\\ While differing in principle, the SMGs have similar $M_{\star}$\ and SFR to the progenitors of the quenched galaxies at $z=3-3.7$. However, they are consistent with being the tail of most massive galaxies on the main sequence at their redshift, without reaching the extreme values of observed starbursts (Figure \ref{fig:ms}). The choice of the $S_{850}$ flux thresholds has a strong impact on the stellar mass of the selected SMGs, while the redshift does not. Flux cuts at $>1$ and $>3.5$ mJy results in median $\mathrm{log}(M_\star/M_\odot) = 10.5$ and $11.1$, respectively, both at $z=4$ and $z=5$ in TNG 300. This naturally arises from the fact that, by definition, a higher $S_{850}$ threshold selects for higher SFR and $M_{\rm dust}$ values, both of which correlate with $M_\star$. Therefore, a $S_{\rm 850}$-$M_{\star}$\ relation is in place at least for main-sequence galaxies, matching the observations \citep{hayward_2013}. \subsection{Number densities of simulated sub-mm galaxies} We further calculated the number densities for the SMGs with $S_{\rm 850}>1$ and $>3.5$ mJy in the snapshots at $z=4$ and $z=5$ (Table \ref{tab:illustris} and Figure \ref{fig:number_densities}). To avoid overpopulating the latter, we show only the number densities for a threshold of $S_{\rm 850} = 1$ mJy, similar to the ALESS limiting flux. At face value, the simulations slightly overshoot the empirical number densities uncorrected for the duty cycle, but we find an overall good agreement within the observational uncertainties. Notice that no correction is needed for the simulated number densities. Similar conclusions hold when comparing simulations with the COSMOS/S2CLS surveys at the corresponding depth. The comoving number densities for SMGs with $>1$ mJy are all consistent within 20\% among the three suites of simulations, while we find a sizable sample of objects with $>3.5$ mJy only in TNG-300. We further checked for the dependence on the mass resolutions of the simulations as for the quenched galaxies (Section \ref{sec:mass_resolution_effect}) by comparing TNG 100-1 and TNG 100-2, which has a similar resolution to TNG 300-1. We retrieve $\sim10-15$\% less galaxies with $S_{850}$ fluxes $>0.1-0.5$ mJy, but $\sim15-30$\% more SMGs in TNG 100-2 at $z=3-5$ than in TNG 100-1. The low number statistics dominate the comparison for higher $S_{850}$ flux thresholds. These fractions should be considered as the typical uncertainties on the number densities we derived for TNG 300-1. We also attempted a calculation of a volume correction for the SMGs in TNG 100-1 by comparing TNG 300 and TNG 100-2 (Section \ref{sec:mass_resolution_effect}) at $z=4-5$ down to our reference flux threshold of $S_{\rm 850} = 1$ mJy. However, such factor is negligible ($2-10$\%).\\ Moreover, Hayward et al. (in preparation) find that \textit{Illustris} TNG systematically underpredicts the $850$ $\mu$m cumulative number counts (therefore, integrated over redshift) with respect to observations and the old \textit{Illustris} run at similar mass resolution, owing to the increased efficiency of AGN feedback reducing the number of massive strongly star-forming systems. The difference between the two simulation sets is not evident at $z\geq4$. This is likely due to the fact that SMGs at these redshifts have not reached yet the critical black hole mass to trigger efficient AGN feedback. Therefore, the discrepancy between \textit{Illustris} and \textit{Illustris} TNG reported by Hayward et al. is due to the later evolution, while systems at $z>4$ constitute only a minor fraction of the SMG population. \subsection{Not all progenitors are sub-mm galaxies} The comparison between the comoving number densities of quiescent galaxies at $z=3-3.7$ and the SMGs at $z=4-5$ (Table \ref{tab:illustris}) shows that \textit{only a fraction of the SMGs at high redshift turn quiescent at $z=3-3.7$, this fraction depending on the sub-mm flux threshold.} In TNG-300, $88-90$\% of the SMGs with $S_{850}>3.5$ mJy at $z=4-5$ are quenched ($\mathrm{sSFR}<10^{-10}$ yr$^{-1}$) at $z=3$, but only $20-30$\% at $z=3.7$. These fractions drop significantly when considering a lower flux threshold of $S_{850}>1$ mJy: $45-60$\% of the SMGs above this limit at $z=4-5$ are quenched at $z=3$ ($5-15$\% at $z=3.7$). We do not attempt the comparison in TNG-100 and \textit{Illustris}-1 due to the low or even absent statistics. The difference due to the flux threshold likely mirrors the mass selection mentioned above: larger $S_{850}$ fluxes correspond to larger masses, therefore closer to the threshold to ignite efficient AGN feedback and a rapid quenching. The shorter time interval between $z=4$ and $z=3.7$ concurs to the drop of the fractions of SMGs quenching between these two limits, compared with quenching occurring in the $z=3-5$ period. Finally, at the spatial and time resolution \textit{Illustris} TNG, lower $S_{850}$ appear to be sustainable for longer timescales. Dedicated simulations at higher resolution, necessary to capture the stochasticity of the processes igniting the brightest SMGs, could test this result, but they are beyond the scope of this paper.\\ Inverting the order of the terms of comparison, we find that \textit{only a fraction of the progenitors of quenched galaxies at $z=3-3.7$ shine as SMGs at $z=4-5$, this fraction depending on the sub-mm flux threshold.} As Figure \ref{fig:ms_illustrisTNG} shows, $80$\% of the quenched galaxies at $z=3.7$ have $S_{850} > 1$ mJy at $z=4$ ($70$\% at $z=5$) in TNG-300, while $12$\% ($0$\%) were already quenched at $z=4$ ($z=5$). The fraction of sub-mm bright progenitors drops when considering higher flux thresholds: $14$\% of the quiescent galaxies at $z=3.7$ have $S_{850} > 3.5$ mJy at $z=4$ ($5$\% at $z=5$).\\ This comparison suggests a more complex connection between the progenitors of high-redshift quiescent galaxies and SMGs than previously assumed (e.g., Section \ref{sec:evolutionary}). While the majority of extremely bright SMGs at $z=4-5$ detectable by shallow surveys quench by $z=3$, a substantial fraction of the highest redshift quenched systems have less extreme progenitors, lying on the main sequence during their epoch of main stellar mass assembly and emitting sub-mm fluxes partially detectable only by the deepest surveys currently available. \section{Conclusions} \label{sec:conclusions} In this work we reported the discovery and the detailed analysis of three quiescent galaxies at 1.5 Gyr after the Big Bang. Dedicated spectroscopic follow-up in the optical/near-infrared allowed us to securely confirm the redshift of two of the sources ($z=3.775, 4.012$) and to put tentative constraints on the third one ($z\approx3.767$). Their quiescence is supported by the modeling of their SED, by the absence of emission lines, and the non-detections in the far-infrared/sub-millimeter regimes. Given their large stellar masses of $\sim10^{11}$ $M_{\odot}$, these objects are located $\gtrsim 1-2$ dex below the main sequence at their redshifts. The combined modeling of the SED and the spectra suggests that these galaxies went through a short phase ($\sim50$ Myr) of intense star formation ($\sim1200-3500$ $M_{\odot}$ yr$^{-1}$) peaking $\sim150-500$ Myr prior the time of observation, followed by an abrupt decrease of their SFRs and the cessation of any relevant formation of new stars. We then explored their connection with star-forming progenitors at higher redshifts, testing previous suggestions of a direct link with strongly starbursting SMGs. We compared the comoving number densities $n$ of 850~$\mu$m and/or 1.1 mm-selected SMGs at $z>4$ and quiescent galaxies at $3<z<4$, compiling recent results in the literature. In general, a large scatter affects the estimates of $n$ for both populations, predominantly due to a combination of factors dominated by different classification schemes and selection criteria and by the uncertainties on the redshift. We find the number densities of SMGs at $z>4$ from the deepest surveys ($S_{\rm 850\,\mu m}\gtrsim1$ mJy) to be in broad agreement with the estimates for quiescent galaxies at $3<z<4$. Brighter SMGs ($S_{\rm 850\,\mu m}\gtrsim3.5$ mJy) are $6-20\times$ less numerous. Adopting the assumption of a univocal correspondence between SMGs and the progenitors of quiescent galaxies, we attempted to estimate the duty cycle correction necessary to match their comoving number densities. The resulting duty cycle is of the order of the depletion timescale estimated for strongly star-forming galaxies at high-redshift ($t_{\rm burst}\sim100-400$ Myr), but this value significantly drop to $\sim 10$ Myr for the brightest SMGs, questioning the underlying assumption. This is reinforced by the comparison of the stellar masses and SFRs of SMGs and quiescent galaxies. We find that the current SED modeling tends to overpredict $M_{\star}$\ for the brightest SMGs with respect to quiescent galaxies at lower redshift, while objects with lower sub-mm fluxes can better reproduce the distributions of $M_{\star}$\ and SFR expected for the progenitors of quiescent galaxies. This points towards the necessity of including less extreme systems to explain the existence of red, quiescent galaxies at $3 < z < 4$. Finally, we tested our assumptions on the evolutionary path of high-redshift quiescent galaxies by comparing our results with the recent \textit{Illustris} TNG simulation. We retrieve comoving number densities of massive quiescent galaxies at $z=3$ that are in fair agreement with the broad range of observed values, surpassing the performance of the previous generation of cosmological simulations. This is especially due to the large box size necessary to study these rare systems and the improved feedback scheme. However, we report a growing inconsistency in the comoving numbers densities at increasing redshift, so that at $z=3.7$ the simulated populations match only the lowest among the observational estimates. Moreover, we traced their progenitors at $z=4-5$ and their mock sub-mm fluxes, finding a population of SMGs as numerous as in the observations. We find that $\sim90$\% of the SMGs with $S_{850}>3.5$ mJy at $z=4-5$ are quenched by $z=3$, but this fraction drastically decreases to $\sim45-60$\% for dimmer sources with $S_{850}>1$ mJy. In other words, we showed that not all $z=3-3.7$ quiescent galaxies have an SMG progenitor and, similarly, that not all SMGs at $z=4-5$ quench by $z\sim3-3.7$, the fractions mainly depending on the sub-mm flux cut to select the dusty star-forming galaxies. Moreover, as suggested by the observations mentioned above, simulations indicate that the progenitors of massive quiescent galaxies at $z>3$ are not necessarily prototypical extreme starbursting systems, but more normal star-forming galaxies at the most massive end of the main sequence. This highlights the importance of obtaining deep sub-mm observations of high-redshift galaxies, abandoning the original definition of ``SMGs'' to focus on more physically meaningful categories. \section*{Acknowledgements} We acknowledge the constructive comments from the anonymous referee that improved the content and presentation of the results. We warmly thank Corentin Schreiber for the useful discussions and guidance to the use of \textsc{Slinefit} and \textsc{Fast++}. FV thanks Davide Martizzi for discussions about the \textit{Illustris} simulations; Tao Wang, and Helmut Dannerbauer for comments about the sub-mm galaxy samples. FV and GM acknowledge the Villum Fonden research grant 13160 ``Gas to stars, stars to dust: tracing star formation across cosmic time'', and the Carlsberg Fonden research grant CF18-0388 ``Galaxies: Rise And Death''. ST, MS, CGG, and GM acknowledge support from the European Research Council (ERC) Consolidator Grant funding scheme (project ``ConTExt'', grant number: 648179). The Cosmic Dawn Center (DAWN) is funded by the Danish National Research Foundation under grant No. 140. MO acknowledges support from JSPS KAKENHI Grant Number JP17K14257. MS acknowledges support by the European Research Council under ERC-CoG grant CRAGSMAN-646955. OI acknowledges the funding of the French Agence Nationale de la Recherche for the project ``SAGACE'' and the Centre National d'Etudes Spatiales (CNES). KY was supported by JSPS KAKENHI Grant Number JP18K13578. The Flatiron Institute is supported by the Simons Foundation. Based on observations collected at the European Southern Observatory under ESO programme 0100.B-0922(A). Some of the data presented herein were obtained at the W. M. Keck Observatory, which is operated as a scientific partnership among the California Institute of Technology, the University of California and the National Aeronautics and Space Administration. The Observatory was made possible by the generous financial support of the W. M. Keck Foundation. The observations were carried out within the framework of Subaru-Keck time exchange program, where the travel expense was supported by the Subaru Telescope, which is operated by the National Astronomical Observatory of Japan. The authors wish to recognize and acknowledge the very significant cultural role and reverence that the summit of Maunakea has always had within the indigenous Hawaiian community. We are most fortunate to have the opportunity to conduct observations from this mountain.
\section{\label{sec:level1}Introduction} Blazars are active galactic nuclei whose powerful relativistic jets point at small angle $\theta_{\rm obs}$ to the Earth line-of-sight \citep{urry_unified_1995}, so that the Doppler-boosted jet emission dominates the observed spectral energy distribution (SED). This SED is characterized by a low energy peak caused by synchrotron radiation from energetic electrons, and a high energy peak generally attributed to inverse-Compton (IC) scattering of photons by these same electrons \citep{maraschi_jet_1992}, a.k.a. synchrotron self-Compton (SSC). The seed photons can also originate from an external source such as the accretion disk or broad line region (External Compton, EC). Blazars can be subdivided by the frequency of their synchrotron peak \citep{abdo_spectral_2010} into HSP, LSP and ISP sources. HSP tend to to peak in the X-ray. We have yet to determine how the jets are energized and launched with bulk Lorentz factor $\Gamma$, but an attractive origin is the \citet{blandford_electromagnetic_1977} process, so that the jet axis may be associated with the spin axis of the central black hole and the angular momentum axis of the surrounding accretion disk. The jet $e^+/e^-$ obtain an energy distribution extending to $\gamma_{\rm max} \sim 10^4$ or higher, often attributed to shock acceleration or magnetic reconnection. Radiation from these particles spiraling in the embedded magnetic field can be used to constrain the geometry and energetics of the emission zone and, by inference, the jet accelerator. In studying jet geometry polarization can be particularly useful. Radio VLBI studies have long shown that the pc-scale jet can be substantially polarized. Recently much effort has been spent measuring the optical polarization properties of blazars, since this probes even smaller scales, closer to the acceleration zone. This polarization is often quite variable, offering new dynamical information on the jet structure \citep[e.g.][]{blinov_robopol:_2015, lynch_green_2018}. Soon we hope to measure the X-ray polarization of a number of blazars with \textit{IXPE} \citep{weisskopf_imaging_2016}, probing closer to the jet acceleration zone than ever before. Recent optical monitoring campaigns have revealed new polarization patterns. In addition to typical stochastic behavior of polarization fraction ($\Pi$) and angle (PA), \citet{blinov_robopol:_2015} found periods of relatively steady rotation of the PA, sometimes extending many $\times \pi$, lasting weeks or months. These rotations are sometimes associated with flares in total intensity and drops in $\Pi$ \citep{blinov_robopol:_2016}. Various models have been proposed to explain this behavior, including a turbulent stochastic model \citep{marscher_turbulent_2014}, a spiraling jet \citep{lyutikov_polarization_2017} and a helical kink propagating along a conical jet \citep{nalewajko_model_2017}. Although these pictures can accommodate multicycle rotations, they fail to address the optical trends found in \citet{blinov_robopol:_2016}. In \citet{peirson_polarization_2018}, we modeled a simple multizone conical jet model, optionally with a helical core field, and found that, when a proper treatment of relativistic PA rotation (RPAR) is included, it can explain many of the synchrotron emission trends mentioned above. In addition it makes a number new, testable predictions, which can help in interpreting future optical/IR polarization campaigns. However, we soon expect to measure X-ray polarizations with space missions such as {\it IXPE}; This band is often well above the $\nu_{Sync}$ synchrotron peak and, for LSP and ISP, may include significant Compton flux. In this paper we extend our conical jet model to include the multizone treatment of SSC polarization in blazars. We particularly focus on the transition region between synchrotron and SSC dominated flux, as this will be {\it IXPE}'s range for many ISP. We start by reviewing the residual polarization after Compton scattering. We then describe how the synchrotron emission of multiple zones are combined for Compton re-processing. \S4 notes how light-travel time effects additionally modify the polarization seed flux; this varies along the jet so that the effects vary with energy band. A numerical realization of this model lets us check how the averaging scales with the number of effective jet zones (which can be constrained by e.g. optical $\Pi_O$). We conclude with full Sync+SSC simulations for representative blazar parameters. \section{\label{sec:level1}ICS Basics \& Seed Photon Polarization} \citet{bonometto_polarization_1970} have developed an analytical formalism to evaluate inverse-Compton polarization for scattering in the Thomson scattering regime, with \citet[][hereafter BCS]{bonometto_polarization_1973} treating the SSC case. Analytic solutions are difficult in the Klein-Nishina regime, but \citet{krawczynski_polarization_2011} provides a general Monte-Carlo based framework, verifying and extending the BCS results. To date such pseudo-analytic treatments have been applied to homogeneous single-zone jet models. The results provide useful upper limits on the plausible ICS polarization. For example \citet{poutanen_relativistic_1994} explore how the magnetic field orientation in a uniform jet affects $\Pi_{SSC}$, while \citet{mcnamara_x-ray_2009} run a single zone Monte-Carlo model to show how X-ray polarization would differ between synchrotron, SSC and Externally-dominated Compton (EC) emission. Finally \citet{zhang_x-ray_2013} argued from single zone SSC simulations that polarization measurements can distinguish between weakly polarized leptonic Compton emission and strongly polarized hadronic models. However, with the new (especially optical) evidence for incoherent jets with multiple zones contributing to the polarized flux, these studies are inadequate to describe any but the most basic differences between jet models. In addition, many of these previous efforts do not fully incorporate the important RPAR rotation of the emitted polarization to the Compton scattering zone and on to the observer frame. \citet{marscher_turbulent_2014} introduce a multizone framework; in \citet{peirson_polarization_2018} we explored synchrotron emission in this picture, including the effects above. Here we summarize the jet geometry before describing additional polarization averaging of the seed synchrotron flux and computing the final Compton polarization. Our jet is conical with opening angle $\theta_{op}$ pointing $\theta_{obs}$ from our line of sight. The cross sectional radius at launch $R_0$ is determined by the jet power $W_j$, initial magnetic field strength $B_0$ and bulk Lorentz factor $\Gamma$ (all values set in the jet frame) assuming an equipartition fraction $= 1$. The jet is segmented into slices (sections) along the jet, each made up of multiple zones $i$, which share the same bulk $\Gamma$ but have different $\theta_{obs_i}$. The B-field orientation varies, typically randomly, between zones. Alternatively a subset (assumed to be the jet core) has a coherent helical B-field during polarization rotation epochs. Each zone has an initial electron population set by power law index $\alpha$ and exponential cutoff set by $\gamma_{\rm max}$. As a given slice moves down the jet, at each step $dx$ the polarized synchrotron emission from each zone is calculated using expressions from \citet{rybicki_radiative_1979}. $B$, $R$ and the electron populations are evolved at each step. Applying relativistic PA rotation (RPAR) to the emission of each zone and summing the Stokes parameters gives the final SED and polarization. To focus on overall geometrical trends our base calculations assume that all zones are identical except for field orientation. This allows us to ignore electron migration between zones in a given slice; we also ignore small losses associated with complete escape from the jet. Variation in zone efficiency should introduce additional variability, diluting but preserving the geometric trends described here. We do discuss (\textsection3,5) cases when a subset of zones dominate the synchrotron emission, since the ICS emission can be sensitive to their disposition across the jet. \begin{figure}[] \includegraphics[width=0.9\linewidth, height=7.0cm]{Figure1.pdf} \centering \caption{Sketch of the SSC scattering geometry to illustrate the definition of angles. The coordinate system is chosen such that the magnetic field B lies in the (x-z) plane and the scattered photon direction ${\bf v_{k'}}$ is along the z axis.} \end{figure} As we are most interested in X-ray and lower energies, we treat SSC in the Thomson limit, which \cite{zhang_x-ray_2013} show is valid up to at least $500$MeV for a relativistic jet with Doppler factor $D \gtrapprox 10$. The incoming and outgoing photons have momentum unit vectors $\bf{v_k},\bf{~v_{k'}}$ and frequencies $\epsilon$, $\epsilon'$ respectively. BCS show that photons with original polarization direction $\bf{e}$ (perpendicular to the magnetic field for synchrotron seed photons) scatter to energy $\epsilon'$ with powers $P^{SSC}_{||}$ and $P^{SSC}_{\perp}$ for polarization along or perpendicular to the projection of the B-field onto the plane orthogonal to $\bf{v_{k'}}$: \begin{equation} P^{\rm SSC}_{||}(\epsilon') = C\epsilon'\int\frac{d\epsilon}{\epsilon}d\Omega_kE_{\rm min}n(\epsilon)q(\theta) \cdot (Z_{||}(\Sigma_1 + \Sigma_2) + \Sigma_2) \end{equation} \begin{equation} P^{\rm SSC}_{\perp}(\epsilon') = C\epsilon'\int\frac{d\epsilon}{\epsilon}d\Omega_kE_{\rm min}n(\epsilon)q(\theta) \cdot (Z_{\perp}(\Sigma_1 + \Sigma_2) + \Sigma_2). \end{equation} Here $C = \pi (\frac{e^2}{4\pi})^2\frac{c}{m_ec^2}$ in c.g.s units, \begin{equation} E_{\rm min} = \sqrt{\frac{\epsilon'}{2\epsilon(1-{\rm cos}\theta_k)}} \end{equation} is the minimum electron energy required for scattering of a photon from $\epsilon$ to $\epsilon'$, \begin{equation} Z_{\bf{e'}} = \bigg(\mathbf{e \cdot e'} + \frac{(\mathbf{v_k \cdot e'})(\mathbf{v_{k'} \cdot e})}{1-{\rm cos}\theta_k}\bigg)^2 \end{equation} where $Z_{||}$ and $Z_{\perp}$ are found by selecting $\mathbf{e'}_{||}$ or $\mathbf{e'}_{\perp}$ respectively (fig.1), and the solid angle of the photon direction before scattering is \begin{equation} d\Omega_{k} = d{\rm cos}\theta_kd\phi_k. \end{equation} $\Sigma_1$ and $\Sigma_2$ are integrals over the electron population doing the scattering, with maximum electron energy $E_2$ and minimum $E_1$: \begin{equation} \Sigma_1 = \int^{\beta_1}_{\beta_2}dE\frac{N_e(E)}{E^4}\bigg(\frac{E_{\rm min}^2}{E^2} - \frac{E^2}{E_{\rm min}^2} + 2\bigg) \end{equation} \begin{equation} \Sigma_2 = \int^{\beta_1}_{\beta_2}dE \frac{N_e(E)}{E_{\rm min}E^6}(E^2 - E_{\rm min}^2)^2 \end{equation} where $E$ is the electron energy and \begin{equation} \beta_1 = \begin{cases} E_{\rm min} & \quad E_{\rm min} > E_2\\ E_2 & \quad E_{\rm min} < E_2\\ \end{cases} \end{equation} \begin{equation} \beta_2 = \begin{cases} E_{\rm min} & \quad E_{\rm min} > E_1\\ E_1 & \quad E_{\rm min} < E_1\\ \end{cases} \end{equation} $n(\epsilon)$ and $q(\theta)$ denote the synchrotron seed photon spectrum, split into an energy and angle dependent part, where the angle $\theta$ is given by \begin{equation} {\rm cos}\theta = {\rm cos}\Theta {\rm cos}\theta_k + {\rm sin} \Theta {\rm sin} \theta_k {\rm cos} \phi_k \end{equation} from fig. 1. We take $q(\theta) \propto {\rm sin}^{\frac{p+1}{2}}\theta$, given an isotropic distribution of electron pitch angles. $n(\epsilon)$ is calculated self-consistently from the multizone model at each step of the jet. The framework described above assumes a 100\% polarized seed photon population. BCS treated only power law electron populations with synchrotron polarization independent of $\epsilon$ (i.e. $\Pi(\epsilon) =$ const.). For partly polarized seed photons \citet{bonometto_polarization_1970} ignored energy dependence, simply re-scaling the final SSC polarization fraction $(P^{\rm SSC}_{\perp} - P^{\rm SSC}_{||})/(P^{\rm SSC}_{\perp} + P^{\rm SSC}_{||})$. In our case the electron population cools, so that $E_c$ and the photon spectrum evolve, meaning that we cannot assume constant $\Pi(\epsilon)$. Thus we split $n(\epsilon)$ into $n_{\perp}(\epsilon)$ and $n_{||}(\epsilon)$ (synchrotron photon populations with polarization parallel and perpendicular to the projection of the B-field in the plane orthogonal to $\bf{v_k}$) where $\Pi(\epsilon) = (n_{\perp}(\epsilon) - n_{||}(\epsilon))/(n_{\perp}(\epsilon) + n_{||}(\epsilon))$. Evaluating these separately using (1) and (2), we sum their Stokes' parameters to get the SSC polarization for arbitrary $\Pi(\epsilon)$. With jets having significant bulk $\Gamma$, we expect blazar emission to be affected by RPAR (\citealp{peirson_polarization_2018, lyutikov_polarization_2003}). This relativistic aberration strongly changes our effective line of sight, thus rotating the PA we observe as a function of $\Gamma$ for fixed $\theta_{obs}$. We have shown RPAR to be relevant in both stochastic and rotation phases in blazar synchrotron polarization \citep{peirson_polarization_2018}; we expect it to be even more important here since SSC polarization is strongly dependent on the component of the B-field to our line of sight \citep{bonometto_polarization_1973}; note the $\Theta$ dependence in Eqn. 10 and the $\mathbf{e}$ vector. We include the effects of RPAR in our model by rotating the jet frame $\mathbf{B'}$ to the effective magnetic field observed in the lab frame for each zone when calculating the SSC emission and final Stokes' parameters. \begin{equation} \mathbf{B_{eff}} = \mathcal{R}(\Theta_\mathrm{rot}) \cdot \mathbf{B'} \end{equation} and \begin{equation} \Theta_\mathrm{rot} = \arccos\bigg(\frac{\cos\theta_{vl}-\beta}{1-\beta \cos\theta_{vl}}\bigg) - \theta_{vl}~, \end{equation} where $\theta_{vl}$ is the angle between the zone's velocity vector $\beta c \hat{\mathbf{v}}$ and our line of sight in the lab frame. The rotation takes place along the plane containing $\beta c \hat{\mathbf{v}}$ and the line of sight in the lab frame. This is a simpler more intuitive form of the RPAR equations given in \citealp{peirson_polarization_2018, lyutikov_polarization_2003}. This prescription gives us the observed synchrotron and SSC polarized emission from a single B-field zone, assuming that all Compton upscatter is only from local sychrotron seed emission (`on the spot' approximation). This is, of course, the approximation used in single zone models. Instead we expect that the true seed photon field will be strongly dependent on the inhomogeneous surrounding zones \textsection3. Further, since the jet electron populations evolve, the seed photons seen at a given zone are also dependent on light travel effects, which we discuss in \textsection4. In particular, since the low energy seeds dominating the upscattering tend to be dominated by the cooled population, this can be especially important for low energy (e.g. X-ray) SSC emission. Nevertheless for some initial insight, we start by computing emission from a multi-zone jet, with SSC independently computed for each zone, as above. We proceed by computing the SSC Stokes components for each B-field zone individually, evolving the electron population and jet parameters by calculating the total electron energy losses at each $dx$ step, then summing the Stokes' flux across the full length of the jet. In this evolving, but isolated, zone example the energy density depends only on $R$ and the instantaneous emitted synchrotron power, and so is the same at all points in a given jet cross-section. Figure 2 shows a simulation slice with isolated zones and typical blazar parameters for synchrotron + SSC. Note the sharp rise in $\Pi_{Sync}$ and $\Pi_{SSC}$ (and EVPA shift) at the upper end of each component. This is more fully explored in \textsection3. \begin{figure}[] \includegraphics[width=0.98\linewidth, height=7.0cm]{Figure2.pdf} \centering \caption{The polarization fraction, observed PA angle and SED for a jet with 19 independent B-field zones jet for a single $dx$ step (i.e. no cooling). The SSC emission is calculated using only local synchrotron seed photons (i.e. evaluating Eq. (17) instantaneously). Published models typically use such a single zone. Red denotes SSC, blue synchrotron and black their combination. The jet parameters are tabulated in the Appendix. } \end{figure} Before we extend to the interacting zone model, we mention some general results already visible in these sums. First, as noted by \citet{bonometto_polarization_1970}, unlike Thomson scattering, Compton scattering does not create polarization. Thus inevitably $\Pi_{\rm SSC} < \Pi_{\rm Sync}$ (although for multi-zone seed photon mixing, this is not always true, \textsection5). Next, a $\Pi_{\rm Sync}=1$ beam scattering off an $e^-$ powerlaw of index $\alpha$ will produce $\Pi_{SSC} = \Sigma_1 + \Sigma_2 / (\Sigma_1 + 3\Sigma_2)$, with the EVPA reflected in the $\mathbf{v_{\rm k}}$ and $\mathbf{v_{\rm k'}}$ plane. For typical values of $\alpha \sim 1-3$, $\Pi_{\rm SSC} \sim 0.5-0.75$. The modest $\Pi_{\rm Sync} \approx 0.03-0.1$ of real jets indicates many $N_{\rm eff}$ emission zones with uncorrelated B field orientations. While $\Pi_{\rm SSC}$ will depend on the particular B orientations of a given realization, as $N_{\rm eff}$ increases, the result tends to an isotropic average. For a single isolated zone averaged over many isotropic B-field realizations we find $\frac{\Pi_{\rm SSC}}{\Pi_{\rm Sync}} \approx 0.35$, (in good agreement with the \citet{bonometto_polarization_1973} result for $\alpha \sim 2$). Note that $\Pi_{\rm Sync}$ is the polarization of the typical seed photons (e.g. $0.01-0.1$eV for for X-ray SSC), discussed in \textsection 5. \begin{figure}[] \includegraphics[width=0.96\linewidth, height=7.3cm]{Figure3.pdf} \centering \caption{Plot of an example full jet synchrotron SED (blue solid) made up of emission from 19 B-field zones. The zones are grouped into 5 different Doppler factor sets. Dashed lines show the SEDs from zone sets with differing $\theta_{\rm obs_i}$. We can see that the total emission (blue solid) has contributions from fewer total zones at high energy. Once the SED is exponentially dominated, the zone with the highest $\gamma_{\rm max}$ dominates the observed flux.} \end{figure} \begin{figure}[] \includegraphics[width=0.96\linewidth, height=7.3cm]{Figure4.pdf} \centering \caption{Effect of combined Doppler boosting and $\gamma_{\rm max}$ spread at the synchrotron SED. Each dashed line now represents an individual zone. Again, $N_{\rm eff}$ drops at high energy.} \end{figure} \section{\label{sec:level1}Multi-zone Effects} In a conical $\theta_{\rm op}$, multizone, fixed-$\Gamma$ jet model, each B-field zone $i$ is observed at a different $\theta_{\rm obs_i}$ and thus has Doppler factor $D_i = \frac{1}{\Gamma(1-\beta {\rm cos}\theta_{\rm obs_i})}$. The observed (lab) power of each zone is then $F_{\rm lab}(\nu) = D_i^3 \cdot F_{\rm jet}(\nu)$ where two powers of $D_i$ come from relativistic aberration and the other from time dilation. Additionally, the frequencies in the lab frame are blue-shifted, $\nu_{\rm lab} = D_i\cdot \nu_{\rm jet}$. For a power law photon spectrum $F(\nu) \propto \nu^{-\beta}$, this provides an additional factor of $D_i^{-\beta}$ to the energy spectrum. For the Doppler boosting computations, we assume that the jet is structured as a set of discrete blobs, as observed at VLBI scale. Thus non-cylindrical geometry alone, with Doppler boosting, guarantees that identical jet zones contribute differently to the the observed synchrotron peak (Fig. 3) and to the seed photon population seen by other zones. Note that with increasing observed photon energy one samples further into the exponential tail of the individual zone spectra. Thus a decreasing number of zones contribute until a single zone dominates. The result is an increasing $\Pi_{\rm Sync}$ and a gradual EVPA evolution, converging on that of the most boosted zone (in the few-zone regime this behavior may not be monotonic). The top panel of figure 2 showcases this effect, while figure 3 shows an example of individual zone spectra. A closely related effect occurs when the zones themselves have different $\gamma_{\rm max}$. For example \citet{marscher_turbulent_2014} assumes in a jet-shock model that $\gamma_{\rm max}$ depends on B field-shock inclination angle, for an injected electron spectrum of index $\alpha$, giving \begin{equation} N(E_e) \propto E_e^{-\alpha}e^{\frac{-E_e}{\gamma_{\rm max}m_ec^2}} \end{equation} with \begin{equation} \gamma_{\rm max} \propto \bigg(\frac{B_{||}}{B} \bigg)^2 . \end{equation} and $B_{||}$ the zone's B-field component parallel to the shock normal. Thus this version is sensitive to the shock geometry. Alternatively we might imagine that shock turbulence gives rise to the same $\gamma_{\rm max}$ distribution as (14) but with orientation independent of the shock geometry, as for our fully random B distribution. In any case, the geometric Doppler effect combines with the intrinsic $\gamma_{\rm max}$ effect to disproportionately weight a subset of the zones. Figure 4 shows the zone spectra when both effects are present. Figure 5 gives the effect on net polarization, and its dependence on jet parameters. Here we define $N_{\rm eff}$ as the number of zones contributing half of the integrated flux. Clearly when $\gamma_{\rm max}$ scales with the shock $B_{||}$ one finds the highest polarization fraction, since the dominating zones have B-fields nearly aligned (although we note that when the shocks are transverse, this large $\Pi$ is strongly dependent on RPAR effects). Interestingly for large $\theta_{\rm op}$, Doppler boosting alone can produce close to the same $\Pi$ rise as a $\gamma_{\rm max}$ spread. Even without any zone differences, a small increase in $\Pi$ is expected at frequencies emitted by electrons above $\gamma_{\rm max}$ due to the deviation from a perfect power law. Thus $\Pi$ tends to 1, not $\sim 0.75$, when a single zone dominates on the exponential tail. \begin{figure}[] \includegraphics[width=1.0\linewidth, height=7.3cm]{Figure5.pdf} \centering \caption{\textit{Bottom Panel:} The number of zones contributing half of the observed flux (normalized to the number contributing at the SED peak) for a typical full jet blazar synchrotron SED. The blue lines represent the dependence for the Doppler effect of Fig. 3. The solid line shows a jet with large $\theta_{\rm op}$ viewed near its edge (large Doppler spread) while the dashed line shows a small $\theta_{\rm op}$ viewed near the axis (small Doppler spread). Red curves give the case where $\gamma_{\rm max}$ varies between zones. The solid red curve is the scenario proposed in \cite{marscher_turbulent_2014} where $\gamma_{\rm max}$ depends on $B_{||}$, the shock-aligned field (here we assume a transverse shock). The dashed red curve represents the same $\gamma_{\rm max}$ distribution as the solid line case, but with random $B$ orientation. \textit{Top Panel:} The corresponding polarization fractions; colors and lines as below.} \end{figure} \section{\label{sec:level1}Light Travel Effects} Since our multizone jets have evolving (cooling) electron populations and since B may also be a function of time or distance along the jet, we need to consider how the finite light travel time (and the slower jet speed) affect the emission observed at any one moment. This is especially important when considering propagation between jet zones in building up the SSC seed photons. First, we should recall that our multizone model has a spatial coherence scale across the jet, the distance over which the magnetic field (and possibly $\gamma_{\rm max}$) decorrelate. With $N$ zones this is $\approx 2R_0/\sqrt{N}$ for the stochastic magnetic field. Assuming isotropic jet turbulence, this should also be $dx_{\rm ch}$, the decorrelation length {\it along} the jet in the jet frame -- this gives a decorrelation timescale $\sim dx_{\rm ch} / c$. For a range of blazar parameters we find $dx_{\rm ch} \sim 10^{15} - 10^{16}$cm giving polarization variability timescales of $\sim 0.5-5$\,d, in agreement with the stochastic optical variability measured by RoboPol \citep{liodakis_prospects_2019}. For rotation-dominated epochs with the helical B fields we can instead associate $dx_{\rm ch}$ with the timescale of a typical observed optical rotation, roughly $360^{\circ}$ per month \citep{blinov_robopol:_2018}, so we take $dx_{\rm ch} \approx 1{\rm d} c/\beta$. For many typical blazar parameters these stochastic and helical characteristic length scales are of similar size. We consider how the observed spectrum and polarization are sensitive to this coherence scale. \subsection{Finite Bulk Lorentz factor} For infinite $\Gamma$, the jet particles and their emitted radiation would be co-spatial for their entire radiation history (and we would detect this flux only along the jet axis). However with finite $\Gamma$ the photons outrun the jet particles. If at some energy the dominant radiation is produced sufficiently far downstream it will lag behind the radiation produced closer to the jet base by that same zone. Thus at a distance $x_p = \beta dx_{\rm ch} / (1 - \beta)$ the radiation from our designated zone will not yet have reached the Earth observer; we will instead measure the flux of the {\it preceding} zone (along the same jet flow line). This preceding zone will in general have different $B$ and particle population properties. Further downstream additional zones can also contribute. However in practice for $\Gamma > 5$ and $N \leq 150$ we find that the bulk of the observed emission at all frequencies of interest has been radiated before $x_p$ (as can be confirmed with the bottom panel of fig. 7). Thus we can infer that the radiation from a single slice is co-eval, except for the most extreme jet parameters. In this picture the field orientation at the jet base is frozen in and $dx_{ch}\sim$ const, so that zones expand only transversely. If in contrast the zones stay quasi-spherical (e.g. due to turbulent cascading along the jet), a longer variability timescale and a decorrelation in polarization compared to higher frequencies can result for late jet emission (radio). \subsection{Non-zero Viewing Angle of a Conical Jet} For a diverging jet viewed off axis, the increasing width of an observer time slice includes an increasing range of jet distances (i.e. larger range of emission times for the jet particles). This is shown in Figure 6. In our zonal picture, this means that once $2R {\rm tan}\theta_{\rm obs} / \sqrt{N} > dx_{\rm ch}$ zones from more than one slice contribute to the emission. For a given $N$ zones in a jet, expansion stretches the zone horizontally, but not radially. Thus with a tilt, the increased radial range incorporates more $B$-field zones at a given observer time slice, and the polarization decreases. In practice, this is dependent on the jet opening angle $\theta_{\rm op}$ through both the expansion rate of $R$ and the individual zone Doppler factors that control $dx_{\rm ch}$. \begin{figure}[] \includegraphics[width=0.9\linewidth, height=5.3cm]{Figure6.pdf} \centering \caption{Simplified schematic displaying the light travel effect described in \textsection 4.2. The jet is split into horizontal slices of width $dx_{\rm ch}$, the scale in the jet frame over which the magnetic field vectors decorrelate. These $B$-field vectors are denoted by the red arrows. Note that for jets viewed at large off-axis angles multiple slices are viewed at a given time. } \end{figure} For typical blazar parameters $\theta_{\rm obs} \sim 0.5^{\circ} - 7^{\circ}$, $\theta_{\rm op} \sim 5^{\circ} - 45^{\circ}$, $N \sim 1 - 100$ (in a stochastic phase) and $dx_{\rm ch} \approx 2R_0/\sqrt{N}$. Then in the worst case, $2R\, {\rm tan}\,\theta_{\rm obs} / \sqrt{N} > dx_{\rm ch}$ when $R \approx 2.3R_0$. Beyond this $N_{\rm eff}$ increases while polarization fraction and variability decrease. These radii contribute most to the radio-microwave range of the synchroton peak. Through SSC this also de-polarizes the very low end of the Compton component. For rotating B-field zones the effect is similar, but slice mixing not only lowers $\Pi$ but smooths over rotational phase in the helix structure. However the large viewing angle conditions required for significant slice mixing will make the rotation less prominent, in any case. \subsection{Finite Travel Time at Large Jet Radius: Seed Photon Build-up} The two geometrical effects above increase $N_{\rm eff}$ slightly at large jet distance $x_p$ (affecting low energy synchrotron and SSC). But finite light travel time affects the SSC of all zones since the seed photon population in a given zone is made up of contributions from all other zones. The furthest zones are a significant light travel time away and this means that their emission represents a smaller $x$ and earlier time in the slice evolution down the jet. The total synchrotron energy in the co-moving jet frame at any point $i$ on the jet cross section is given by: \begin{equation} E^i(t) = \int \frac{P^i_{\rm Sync}(r,\phi,t)}{\pi R(t)^2} rdr\,d\phi\, dz\,dt \end{equation} where $P^i_{\rm Sync}(x,\phi)$ is the total synchrotron power per unit length in the jet cross section. The functional form varies depending on the cross section point $i$. To a good approximation, the emitted synchrotron radiation from the zones is co-moving with its jet slice (\textsection4.1). This reduces the radiative transfer to a 2D sum, allowing us to set $dt = dx/c$ and $dr = dx$ where $x$ is the distance the jet cross section has travelled along the length of the jet. So the energy density is: \begin{equation} \begin{aligned} \rho^i_E(x) = \frac{dE^i(x)}{dV} = \int_0^x\int_0^{2\pi} \frac{P_{\rm Sync}(x,\phi)}{2\pi^2 c R(x)^2} dx\,d\phi \end{aligned} \end{equation} For a cylindrical jet with no cooling and $x_{\rm max}>>R$, choosing $i$ to be the point in the center of the jet (16) reduces to: \begin{equation} \rho_E(x) = \frac{P_{\rm Sync}}{\pi c R^2}\int_0^R x dx = \frac{P_{\rm Sync}}{\pi c R }, \end{equation} which is a familiar expression for the energy density at the center of a 2D emitting disk. To treat the polarization, we sum up the energy density coming from all zones in a given slice. This is done by simply evaluating the distance of every $P_{\rm Sync}(x,\phi)dx$ annulus from each of the zones in the jet cross section. Using the mutual displacement vectors between zones and their individual $\mathbf{B_i}(x)$ we can construct the total seed photon polarization and energy density at every point in the jet. For this one must compute the correct solid angle subtended by the scattering zone and the effects of RPAR rotation on the polarization vectors. Given the finite numerical nature of our simulation, we expect it to be asymptotically more accurate for a higher number of zones. The top panel of figure 7 show this resulting seed photon population, computed using Equation (16), showing the energy density as a function of distance $x$ along the jet. The line types show the difference between edge and central zones for a conical jet. We also show how beyond a critical distance other zones in the slice dominate over self-emission in the seed photon density; this occurs later at the jet edge. Its effect can be seen on the SSC EVPA (see \textsection5). SSC photons of a given energy are, of course produced by a range of seed photons, so care must be taken in comparing the observed polarizations. Figure 8, shows the effective seed photon SED for X-ray (keV) and soft $\gamma$-ray (MeV) Compton emission. X-ray polarization measurements by upcoming missions are thus best compared with synchrotron observations in the mm-optical band. \begin{figure}[] \includegraphics[width=1.0\linewidth, height=9.2cm]{Figure7.pdf} \centering \caption{\textit{Top panel:} Synchrotron energy density as a function of distance along the jet $x$ for three different energy bands (red: mm wavelength, cyan: optical, blue: 10 keV). Solid lines are for a the jet center, while the dashed lines are for the edge. The black vertical dotted line represent $x=R_0$. \textit{Middle panel:} Fraction of the integrated synchrotron density due to the local zone (solid line central zone, dashed line edge zone). Neighboring zones dominate for $x > R_0$. \textit{Bottom panel:} Build up of the on-axis synchrotron seed photon population at three energies. The dotted blue line represents the corresponding 1-10\,keV SSC flux. These are fluxes measured in the jet frame; jet parameters are as in \S5.} \end{figure} \section{\label{sec:level1} SSC with All Effects} As a concrete example, we compute with $B_i$ randomly drawn for all zones at the jet base. Orientations are frozen thereafter, e.g. fixed as the zones propagate down the jet, but magnitude can vary. As in \cite{potter_synchrotron_2012} for a ballistic conical jet we assume that the only energy loss mechanism is radiation, so magnetic energy $U_B$ is conserved. Thus magnetic flux density decreases as the jet expands. The magnetic/particle energy ratio increases slightly along the jet but remains $\sim 1$. We assume here a single fixed $\gamma_{\rm max}$ in all zones. Thus geometrical (Doppler boosting) effects dominate the prominence of individual zones. Indeed, geometric parameters ($\Gamma$, $\theta_{\rm open}$, $\theta_{\rm obs}$) have the largest effect on polarization. Other parameters ($W_j$, $\alpha$, $E_{\rm max}$, $B_0$) primarily affect the shape of the SED. As expected, polarization thus serves as an excellent (and largely independent) probe of jet geometry, although we do note when other (spectral) parameters have a large effect. In contrast to the treatment of BCS, who assumed a simple power law electron spectrum and uniform (energy independent) synchrotron polarization, we need to consider how all seed photon energies contribute to the observed Compton radiation at a given energy in computing the ratio $\Pi_{\rm SSC}/\Pi_{\rm Sync}$. Since our electron population evolves along the jet (\S3, \S4.2), different seeds dominate at different locations along the jet. Nevertheless, we can give a qualitative picture of the seed spectrum. To connect X-ray SSC with observed synchrotron fluxes, we focus on the synchrotron seeds in the optical and mm range (see Figure 8). These are computed in simulations using all effects described above. The simulations employ various zone multiplicities (1, 7, 19, 37) to illustrate the effect the increasing the zone averaging on both the synchrotron and SSC polarization amplitudes. The principal effect is, of course a diminution $\Pi_{\rm Sync} \propto N_{\rm eff}^{-1/2}$. We compute 200+ realizations of each configuration to average down these fluctuations and display $\Pi_{\rm Sync}$, $\Pi_{\rm SSC}$ trends. \begin{figure}[t] \includegraphics[width=0.9\linewidth, height=5.4cm]{Figure8.pdf} \centering \caption{SSC power in the jet frame as a function of the (lab frame) seed photon energy -- i.e. the seed photon spectrum for a given Compton energy. The solid line is for keV SSC emission while the dashed line shows the seed spectrum producing MeV emission. For the overall SED and assumed jet parameters, see \textsection5.1.} \end{figure} \begin{figure}[t] \includegraphics[width=0.95\linewidth, height=5.4cm]{Figure9.pdf} \centering \caption{The geometrical effects of Doppler boosting on the number of effective emitting zones. Jet frame $\theta_{\rm op}$ increases from top to bottom; the fraction of zones within our $1/\Gamma$ effective viewing circle decreases (blue curves). As $\theta_{\rm obs}$ increases off-axis, the fraction of the zones in the $1/\Gamma$ viewing cone also decreases, until $\theta_{\rm obs} > 1/\Gamma$ and more (distant) zones are boosted at a similar level, causing $N_{\rm eff}$ to grow again. The exact functional form is controlled by the weighting function, in this case the Doppler factor $D^4$, and the jet geometry, in this case a cone. We note that treating $N_{\rm eff}$ as the number of zones that dominates half of the flux is not a perfect proxy, the true $N_{\rm eff}$ is controlled by a weighted distribution. The red lines show the same relationship for a $\theta_{\rm op} = 40^{\circ}$ jet affected by LT effects (\textsection 4.2). At low energies (e.g. mm wavelengths), the emission occurs at sufficiently large radii (see fig.7) that light travel effects substantially increase $N_{\rm eff}$ for jets viewed off-axis. } \end{figure} \subsection{$N_{\rm eff}$} In \textsection3 we discussed how the number of effective emission zones, $N_{\rm eff}$, affects the net polarization, with a large increase at synchrotron cutoff energies. $N_{\rm eff}$ effects can help explain both synchrotron and SSC polarization behavior across the whole SED. Synchrotron polarization is controlled solely by $N_{\rm eff}$, since every zone emits its synchrotron independently. Averaging over a large number of isotropic B-field iterations, we expect $\Pi_{\rm Sync} \propto N_{\rm eff}^{-1/2}$. However, the relationship between $\Pi_{\rm SSC}$ and $N_{\rm eff}$ is not {\it a priori} obvious since each single zone scatters synchrotron seed photons from all the other zones in the jet, weighted by their proximity and power. As in \textsection3 we define here $N_{\rm eff}$ as the minimum number of zones that contribute half of the flux. This is an imperfect estimate since $N_{\rm eff}$ depends on the weighted contribution of all zones; $\Pi_{\rm Sync}$ itself provides the best metric for $N_{\rm eff}$. In any event, the underlying behavior is adequately approximated with $N_{\rm eff} \propto \Pi_{\rm Sync}^{-2}$. \begin{figure*}[t] \includegraphics[width=0.9\linewidth, height=7.6cm]{Figure10.pdf} \centering \caption{\textit{Left Panel:} The optical synchrotron (red) and X-ray SSC (blue) polarization fraction plotted against $N_{\rm eff}/N$. Triangle points are for an $N=19$ zone jet, circles for $N=37$. Solid lines show a Doppler-dominated jet. For the dotted lines zone intensities are randomly distributed. The synchrotron cyan dashed lines show $N_{\rm eff}^{-1/2}$, while the SSC equivalents show the best fit power laws (N=37 gives $p=0.29$; N=19, $p=0.31$). \textit{Right Panel:} The SSC/synchrotron polarization ratio {\it versus} $N_{\rm eff}/N$ (line types as in left panel). Note that the SSC angle-averaging is more effective for a randomly distributed jet, leading to a lower ratio. Values are averaged over many simulations with isotropic B-fields; error bars show the residual errors on the mean. The jet parameters used in the simulations are given in the Appendix Table.} \end{figure*} \begin{figure}[t!] \includegraphics[width=0.99\linewidth, height=7.6cm]{Figure11.pdf} \centering \caption{Correlation plot of the X-ray SSC polarization fraction (top) and PA (bottom) against the corresponding optical synchrotron for two different viewing angles ($N_{\rm eff}$) (red: $\theta_{\rm obs} = 4.5^{\circ}$, black: $\theta_{\rm obs} = 0.1^{\circ}$). Note $\Pi_{\rm SSC}$ can persist even when chance cancellation makes $\Pi_{\rm Sync}$ for the Earth line-of-sight; this leads to high $\Pi_{\rm SSC} / \Pi_{\rm Sync} >> 1$ and a non-zero intercept. EVPAs are strongly correlated, but show scatter due to similar differences in the zone-sampling for the Earth line-of-sight.} \end{figure} \begin{figure}[t!] \includegraphics[width=0.99\linewidth, height=7.6cm]{Figure12.pdf} \centering \caption{Example fully treated jet SED for a single random B-field draw, with $\theta_{\rm obs} = 6.0^\circ$ and the remaining jet parameters as in fig. 10. This simulation uses 19 B-field zones and serves to display some typical polarization behavior. Note the substantial jump in EVPA between the Sync and SSC components. Note also the substantial $\Pi$ increase above the synchrotron and SSC peaks due to the decreased $N_{\rm eff}$ and the average $\Pi_{\rm Sync}$ decrease for sub-infrared energies due to \textsection4.2. The shaded bands show the standard deviations in individual realization over many isotropic B-field draw; EVPA average has no preferred direction for either component, with an average value 0.} \end{figure} When the observed brightness of $N$ total zones is controlled purely by viewing angle-determined Doppler weighting, jet geometry determines $N_{\rm eff}/N$. In practice measuring the synchrotron polarization fraction well below the cutoff (and above radio energies affected by light travel time) provides a direct measure of $N_{\rm eff}$, and thus constrains jet geometry. Figure 9 shows the relationship between $N_{\rm eff}/N$ and $\theta_{\rm obs}/\theta_{\rm op}$ for several jet geometries (blue). For low (radio) energies (which radiate at large $x$) and large off-axis angles, finite light travel time effects in a widely diverging jet (\S4.2, Figure 6) increase $N_{\rm eff}$. Red lines in Figure 9 shows this effect (at $\theta_{\rm op} = 40^{\circ}$) for long wavelength synchrotron. While we expect that Doppler weighting of zone flux is always present, the observed flux from individual zones may vary for other reasons. These might include differences in acceleration efficiency between zones \citep{marscher_turbulent_2014}, with electron density, $\gamma_{\rm max}$ and $\Gamma$ variation - or variation in relative sizes of zones. Such variation may be more prominent during flaring events. To illustrate such effects, we plot a simple model where the lab frame flux from individual zones is allowed to vary randomly (as opposed to being controlled purely by jet geometry). The results are compared with a Doppler weighted jet in figure 10 for total zone numbers $N = 19,\, 37.$ Figure 10 displays the expected $\Pi_{\rm Sync} \propto N_{\rm eff}^{-1/2}$ trend. The $N,\, N_{\rm eff}$ behavior of SSC is more complex. $N=19$ is more polarized than $N=37$ for the same $N_{\rm eff}/N$ for both synchrotron and SSC. In the synchrotron case this is simply due to the change in $N_{\rm eff}$. In the SSC case, $N_{\rm eff}$ zones are boosted and scatter the jet frame synchrotron emission from all $N$ zones. A larger $N$ further averages down the seed photon polarization (for the same $N_{\rm eff}$), so $\Pi_{\rm SSC} \propto N^{-1/2}$. This ensures that the dot point SSC curves lie below the triangle poimts in Figure 10. However $\Pi_{\rm SSC}$ also depends on $N_{\rm eff}$ (apparent in figure 10 from the non-zero slope), since with larger $N_{\rm eff}$ one has more scatterers sampling the angular distribution of the synchrotron radiation of the $N$ total zones. This averaging decreases $\Pi_{\rm SSC}$ as $N_{\rm eff}$ grows. The scaling depends on how the $N_{\rm eff}$ zones are chosen/weighted. We can characterize the dependence using a simple power law: \begin{equation} \Pi_{\rm SSC} \propto N_{\rm eff}^{-p} N^{-1/2}. \end{equation} The Doppler-boosted cases have similar slopes $p\approx 0.3$ for both $N=19$ and $N=37$, with the decreased $\Pi_{\rm Sync}$ driving down the coefficient of the latter. Randomly selected zones (dotted lines in figure 10) give $p \approx 0.25$. However these are not universal power laws; the averaging over the seed photon's angular polarization distribution depends on the particular weighting scheme. This can also be seen in the right panel of Figure 10. Since $p<0.5$, we have a slow increase in the SSC/Sync polarization ratio as $N_{\rm eff}$ increases, most obvious for the random zones. For pure Doppler boosting, geometrical effects complicate this trend. As $N_{\rm eff}$ grows ($\theta_{obs}$ decreases), the ratio growth is slow until one starts viewing near the jet edge (or near $1/\Gamma$). Here the increasing $N_{\rm eff}$ zones are together at the near edge of the jet; these all receive synchrotron emission from the $N$ emitting zones at similar angle. This coherence gives rise to poor averaging over the synchrotron beam and, on average, larger SSC polarization, giving an abrupt rise to the ratio. Conversely the largest $N_{\rm eff}$ occur when viewing close to the jet axis. There the most strongly boosted zones dominating the flux are nearly uniformly surrounded by their $N$ synchrotron sources, leading to better angle averaging of the synchrotron field and a drop of SSC polarization and the polarization ratio for jets viewed nearly on axis. Other complications are also present. For example, mm wavelengths and below are emitted on average downstream from X-ray SSC (fig.7), so $\Pi_{\rm SSC} / \Pi_{\rm Sync}$ will be larger ($\sim 0.4$) for such comparison. For some jet parameters (high $\theta_{\rm obs}$, high $\theta_{\rm op}$) energies up to the optical synchrotron and X-ray SSC can also be affected by light-travel time induced $N_{\rm eff}$ increase. In addition to these statistical trends there is a strong correlation between $\Pi_{\rm SSC}$ and $\Pi_{\rm Sync}$ in individual realizations (Figure 11). The magnitude of the correlation depends on $N_{\rm eff}/N$: for high $N_{\rm eff}/N$ (black points) both $\Pi$ and PA are more highly correlated (small $\theta_{\rm obs}$; Spearman $r=0.7$) than the lower $N_{\rm eff}/N$ case (red points, Spearman $r=0.6$). Of course with the smaller $\theta_{\rm obs}$/larger $N_{\rm eff}$ case (black) we seldom achieve very high $\Pi_{\rm Sync}$. But when we do, we have good confidence that the SSC polarization will also be high. Notice that the intercepts are not zero; The different SSC sample can display polarization, even when the observed synchrotron polarization happens to average to near zero. This cautions us to avoid strong conclusions from one large $\Pi_{\rm SSC}/\Pi_{\rm Sync}$ measurement in a weakly polarized source, e.g. that hadronic processes are present.\\ Overall, for synchrotron seed photons emitted early in the jet (optical for the example blazar parameters) we expect to see $\Pi_{\rm SSC}/\Pi_{\rm Sync} \sim 0.3$ when $N_{\rm eff} \sim N/2$. The synchrotron and SSC polarization fractions will be strongly correlated. As $N_{\rm eff}$ decreases relative to $N$ both the ratio and correlation will decrease, controlled in detail by the zone weighting system. For mm ($\Pi$-suppressed) seed photons we expect higher ratios $\Pi_{\rm SSC}/\Pi_{\rm Sync} \sim 0.4$ but lower correlations. For the typical blazar parameters determined by the inferred opening angles (\citealp{clausen-brown_causal_2013, jorstad_kinematics_2017}), $\Gamma_{\rm bulk}$ and $\theta_{\rm obs}$ are such that $N_{\rm eff} \sim N/2$, and we expect in most cases $\Pi_{\rm SSC}/\Pi_{\rm Sync} \sim 0.3$. However for other viewing geometries the ratio can be lower. Since boosting is the only feasible way to change $N_{\rm eff}$ without changing $N$, we expect that non-Doppler weighting effects will preserve $N_{\rm eff} \sim N/2$ and thus $\Pi_{\rm SSC}/\Pi_{\rm Sync} \sim 0.3$. We note that for $>$MeV energies, SSC is emitted before neighbouring zones dominate the seed photon population (fig.7). In this case the polarization amplitudes will scale as $N_{eff}^{-1/2}$ and Sync and SSC will be highly correlated, with $\Pi_{\rm SSC}/\Pi_{\rm Sync} \sim 0.35$ for the appropriate $\Pi_{\rm Sync}$ in fig. 8. Finally, all results shown here are for electron power laws $\alpha \sim 2$. For similar systems with different power laws we expect our results for $\Pi_{\rm SSC}/\Pi_{\rm Sync}$ can be scaled with $\alpha$ as in BCS. \section{Conclusion} We have shown that for a multizone relativistic conical jet, the averaging effects that control the final net polarization are sensitive to the jet opening angle and viewing geometry. In general when viewed at larger off axis angle, fewer zones contribute to the observed radiation and the residual polarization is higher. This is countered to some extent for low frequency (e.g. radio) emission, where the electrons cool slowly enough that emission comes from a large range of radii and the finite light travel time can let zones from different radii across the jet contribute at a given observation epoch -- the increase in the number of effective zones decreases $\Pi_{\rm Sync}$. Note that these trends are guaranteed by the differential Doppler effect across a conical jet, but will be obscured if electron power, $\gamma_{\rm max}$ or $\Gamma$ fluctuations dominate zone brightness variations. One particularly interesting effect is the increased dominance of a few zones as one observes at energies well above the synchrotron peak. There the tail of the synchrotron emission is necessarily dominated by a few zones, selected either by Doppler boosting or extreme $\gamma_{\rm max}$, and $\Pi_{\rm Sync}$ increases. This also means that the EVPA converges to a direction controlled by that dominant zone, which can be quite different to that of the (lower energy) jet average. A similar effect occurs at the upper extreme of the Compton component. Thus we expect a rapid increase in polarization, and a rapid jump in EVPA, until the SSC flux overwhelms the synchrotron component, and one jumps to new SSC values (see Figure 12 for an example). This is of particular interest for `Intermediate Peak' blazars (ISP) which can have this synchro-Compton transition in the soft X-ray regime; \citet{liodakis_prospects_2019} describe this effect and its importance in selecting targets detectable to {\it IXPE} and similar X-ray polarization missions. For example, the ISP S50716+714 has an X-ray flux of $10^{-11} - 10^{-10}$erg/s/cm$^2$. Using its measured optical polarization and Fig. 5 we estimate its X-ray polarization fraction to vary between $12-30\%$. At \textit{IXPE}'s nominal sensitivity of 5.5\% MDP$_{99}$ for $10^{-11}$erg/s/cm$^2$ in 10 days, we should obtain a 99\% significance detection in $\sim 100$\,ks exposure or less. Thus variability should not strongly degrade the single epoch polarization, although longer exposures or multiple visits should see variation in $\Pi$ and EVPA. However the synchrotron emission is steeply falling in the X-ray band and detailed measurement of the polarization variation across the band may require a higher sensitivity future facility. For SSC polarization, the seed photons are drawn from a variety of jet zones with different $B$-field orientations. This decreases the average polarization of the seed population and hence the final Compton polarization. Since in a conical jet different jet sectors have different angles to the Earth line-of-sight and hence different boosting, the averaging is dominated by a sub-set of the jet zones and the final effects are sensitive to RPAR effects. Nevertheless an overall trend of $\Pi_{\rm SSC} \approx 0.3 \Pi_{\rm Sync}$ (compared to optical photons) can be expected, for both Doppler zone and random zone dominated jets. Overall, the simulations show the danger of drawing conclusions from any one realization: The scatter in $\Pi$ is comparable to $\Pi$ itself, and expected geometrical and spectral trends are only recovered when averaging over many realizations. One should also recall that external seed photons are expected to be largely unpolarized so that any EC flux will dilute the high energy polarization signal. We see that Compton polarization is understandably less powerful as a probe of jet geometry than the synchrotron signal. Nevertheless X-ray SSC polarization can be large enough to be detected in favorable cases, where comparison with the instantaneous $\Pi_{\rm Sync}$ can give (at least statistically) information on the seed fields and scattering geometry. Finally, large positive correlations between the SSC and seed synchrotron $\Pi$ make low energy polarization monitoring a useful tool for monitoring fluctuations and aiding in $\Pi_{\rm SSC}$ detection. \bigskip We thank I. Liodakis and A. Marsher for helpful discussions of jet polarization physics. This work was supported in part by NASA grant NNM17AA26C. \section{Appendix} \begin{table}[h!] \begin{tabular}{c c c c c c c} \multicolumn{7}{c}{Jet Parameters}\\ \\ Fig. & $N$ & $B_0[{\rm G}]$ & $L_{\rm jet}[{\rm m}]$ & $\theta_{\rm op}[^{\circ}]$ & $\theta_{\rm obs}[^{\circ}]$ & $\Gamma$ \\ \hline\hline $2$ & $19$ & $1.0$ & $1.8 \times 10^{10}$ & $40.0$ & $1.5$ & $14.0$ \\ \hline $10$ & $19,37$ & $1.0$ & $5.3 \times 10^{15}$ & $40.0$ & $0.1-4.5$ & $14.0$ \\ \hline $11$ & $37$ & $1.0$ & $5.3 \times 10^{15}$ & $40.0$ & $0.1,4.5$ & $14.0$ \\ \hline $12$ & $19$ & $1.0$ & $5.3 \times 10^{15}$ & $40.0$ & $6.0$ & $14.0$ \\ \hline \end{tabular} \caption{ Parameters used for the plotted jet models. All models additionally assume jet power $W_j = 1.3 \times 10^{37}W$, electron spectral index $\alpha = 1.85$, and electron energy range $\gamma_{\rm min}=10$ to $\gamma_{\rm max}=3.3 \times 10^{4}$. } \end{table} \subsection{Computational Jet Model} The code used for this work is made publicly available at \url{https://github.com/alpv95/SSCpol}. Further documentation on how to compile and run can be found there. The main code consists of a C script, \textit{jet\_model.c}, that initializes a single jet slice and follows the evolution of the electron population and the emitted photon spectrum, accumulating the observed Stokes' fluxes for both synchrotron and SSC emission. More detail on the synchrotron emission slice and its application to blazar rotations can be found in \citet{peirson_polarization_2018}. The bulk of the CPU time required is, however, spent calculating SSC emission, evaluating the integrals in Eqs. (1) and (2) $N^2 \times$ for each slice step along the jet length. This computation is accelerated using OpenMP. For example, 16 CPU cores runs the N=37 zone model (one random B-field draw, as in fig. 12) in $\sim 250$ minutes. With the assumptions of \textsection4, each slice can be evolved independently (the exception is high observation angle mm); we do not consider synchrotron seed photons from adjacent slices. In this paper we do not include self-absorption effects which are typically significant in the longer wavelength radio emission; this has essentially no effect on the SSC X-ray fluxes. The jet is assumed to be optically thin at all times. The algorithm begins by initializing the free jet parameters: total jet power $W_j$, bulk Lorentz factor $\Gamma_{\rm bulk}$, electron exponential energy cutoff $\gamma_{\rm max}$, observation angle $\theta_{\rm obs}$, jet opening angle (jet frame) $\theta_{\rm open}$, electron power law index $\alpha$, initial magnetic flux density $B_0$, minimum electron energy $\gamma_{\rm min}$, number of B-field zones in jet slice $N$, the length of the jet $L_{\rm jet}$, and the number of electron energy and emitted frequency bins desired. From these, the initial jet radius $R_0$ and electron population $\frac{dN_e}{dE_e}$ discretized in energy bins can be derived following \citet{potter_synchrotron_2012}. The cross-section is split up into $N$ circular zones, with their position and mutual displacement vectors calculated. Each zone is a initialized with a B-field vector direction sampled from an isotropic distribution. A loop over the jet length $x < L_{jet}$ begins the main calculation. The emitted synchrotron powers per unit length $P_{\perp}^i(\nu)$, $P_{||}^i(\nu)$ for each zone $i$ are calculated assuming an isotropic pitch angle distribution, following \citet{rybicki_radiative_1979}. The synchrotron photon energy density in each zone $i$ contributed by zone $j$, $\rho_{\perp}^{ij}(\nu)$, $\rho_{||}^{ij}(\nu)$, are calculated using (16). This requires keeping track of emitted synchrotron power for all prior $x$ and accounting for the RPAR between zones in the diverging jet. The integral is treated as a sum over all $x < x_{\rm current}$. The SSC power per unit length can then be calculated by treating (1) and (2) as discretized sums, resulting in $P^{\rm SSC}_{\perp}(\nu)$, $P^{\rm SSC}_{||}(\nu)$ for every zone. The electron energy losses due to emission are found, and the step length $dx$ is set by the cooling time of the highest energy occupied electron bin, with the constraint that $R_{\rm new} \leq 1.05 R$. Then $\frac{dN_e}{dE_e}$, $x$, $R$ and $B$ are updated and the emitted power for each zone is converted to a Stokes' parameter representation and boosted, using $D_i$. The loop repeats until $x \geq L_{\rm jet}$. Finally the Stokes' parameters are converted to lab frame quantities $\nu' F_{\nu'}$, $\Pi(\nu')$ and $\theta_{PA}(\nu')$ for SSC and synchrotron separately. \bibliographystyle{apj.bst}
\section{Clinical Variant Curation Data} \subsection{ClinGen's Variant Curation Interface (VCI)} The data that we use to develop LitGen are collected through ClinGen’s Variant Curation Interface (VCI). VCI is a curation web tool that was designed to support variant curation based on the ACMG/AMP Guidelines and serves as a platform for the standardized curation of clinical variants by ClinGen’s Variant Curation Expert Panels. This pool of evidence can then be utilized by all VCI users when evaluating each of the ACMG/AMP criteria in turn within the interface. The VCI allows a user to provide an explanation comment describing the rationale for their evaluation in a text field, and to provide a PubMed ID linking to the relevant published literature that contains the data that supports their evaluation. The VCI allows the curator to assert whether the paper is relevant for a subset of evidence types. Here we focus on the five most common evidence types (Fig. 1). \begin{figure}[h] \centerline{ \includegraphics[scale=0.6]{images/WeakSupFigure6.pdf} } \caption{Paper annotation workflow. From a paper on PubMed (left), the curator selects which subset of the five variant curation (VCI) evidence types that the paper is relevant for (middle), and provide explanations for the selection (right). We highlight some keywords for emphasis. LitGen's goal is to predict which evidence types are relevant given a paper.} \label{fig:vci-screenshot} \end{figure} \vspace{-0.3cm} \subsection{Labeled papers} We extracted all papers entered by VCI users between October 2016 and March 2019. The collected data include 1543 unique papers which contained clinical information on 932 unique variants. We randomly split this set of papers into train, dev, and test set by 0.9/0.05/0.05. Additionally, we collected a new set of 358 papers entered from April 2019 to May 2019 as a holdout evaluation dataset. Papers in this holdout evaluation dataset are entirely new. Table ~\ref{tab:labeled-data} shows the distribution of these two datasets. Each paper contains information that can be categorized into different evidence types that curators used to assert clinical pathogenicity. Curators can optionally provide an explanation comment for each type of evidence. In this manuscript, we focused on the top 5 VCI evidence types by the number of unique papers---these are Case Control, Specificity of Phenotype, Allele Data, Experimental Studies, and Segregation Data. These 5 evidence types covers 84\% of all papers annotated in the VCI. \begin{table}[h] \footnotesize \tbl{Labeled data summary: number of papers and explanations by VCI evidence type.} {\begin{tabular}{@{}lccccc@{}} \toprule & & \multicolumn{2}{c}{\# unique papers} & \multicolumn{2}{c}{\# explanations} \\ Evidence types in the VCI & ACMG criteria & Train & Holdout & Train & Holdout \\ \colrule Experimental Studies & BS3, PS3 & 385 & 74 & 732 & 80 \\ \colrule Allele Data & BP2, PM3 & 441 & 86 & 971 & 103 \\ \colrule Segregation Data & BS4, PP1 & 232 & 40 & 271 & 40 \\ \colrule Specificity of Phenotype & PP4 & 482 & 26 & 993 & 28 \\ \colrule Case Control & PS4 & 656 & 264 & 952 & 331 \\ \colrule \textbf{Total} & & \textbf{1543} & \textbf{358} & \textbf{3919} & \textbf{582} \\ \botrule \end{tabular}} \small Training data collected during Oct 2016 to Mar 2019. Holdout evaluation data collected during April 2019 to May 2019. Note that we do not allow the algorithm to use explanations during test time. We have 1543 labeled data points for training. \label{tab:labeled-data} \end{table} \subsection{Unlabeled papers} In order to investigate whether semi-supervised learning can improve our model's performance, we collect a larger set of unlabeled papers through the following pipeline. We use ClinGen Allele Registry~\cite{pawliczek2018clingen} to find the rsid of the variant if a clinical variant ID is provided. We use LitVar API, a new service provided by NCBI~\cite{allot2018litvar}, to retrieve relevant literature of a given variant. LitVar scanned and indexed all of PubMed abstracts and PubMed Central full papers. We use this pipeline to retrieve all relevant papers to all variants curated through the ClinGen VCI. ClinGen Allele Registry found rsid for 877 of 932 variants (94.1\%). We further found 742 (79.6\%) variants that have been mentioned in the literature indexed in LitVar. We queried 4477 papers in total from LitVar, and 650 of these papers overlap with papers that have already entered into ClinGen by curators. Excluding these papers, we have 3827 new papers. We release all of our code and data at \url{https://github.com/windweller/ClinGenML/}. \section{Discussion} \paragraph{Automatic literature recommendation for variant curation} We propose a new goal for the field of literature recommendation: automatically generate semantic tags according to VCI evidence types to aid biocurators in filtering papers. We are operating under a low-resource setting where few papers have currently been annotated by experts. However, such annotations are very rich and often contain explanations to justify curator's decisions to submit a paper as evidence. We propose a pipeline that leverages explanations beyond semantic parsing and can be automatically learned by training a Lasso classifier. \paragraph{Implication for the curation pipelines} In the era of implementing genomic medicine, machine assistance is needed for scalability. Human time should be reserved for steps that need true domain expertise and critical interpretation. A feasible model for systematic curation at scale would automate the generation and delivery of gene or variant level information to expert biocurators that can then critique the quality and relevance of the evidence in the context of a specific disease. This reduces the time it takes to identify evidence of interest that need more in depth human review. Our machine learning model for predicting relevant literature by variant and evidence type is well suited for a semi-automated model of curation at scale. Early efforts in automated literature curation have been able to \anie{recommend} papers by \anie{matching} for the variant of interest. The added functionality \anie{suggests} what type of evidence helps to further streamline curation workflow and efficiency by pre-mapping evidence onto predicted ACMG/AMP criteria. Displaying papers by evidence type also matches the natural organization of curation interfaces such as the VCI, making this an even more feasible tool to implement and have true clinical impact. LitGen is not meant to replace biocurators, but rather to \anie{facilitate} the curation process by prioritizing papers that are more likely to contain particular types of evidence. \paragraph{Acknowledgement} This project is supported by NIH ClinGen. J.Z. is also supported by the Chan-Zuckerberg Biohub. We would like to thank S. Plon and A. Milosavljevic for feedback. \section{Experimental results} \subsection{Evaluation metrics} We use the following metrics to evaluate model performance in predicting the evidence types given a paper. We compute the average accuracy (Avg Accu) across VCI evidence types. Accuracy reflects how correctly the model can determine whether the paper contains a type of evidence or not. We compute the exact match ratio (EM) as well, which is a more strict metric that requires the model's predictions to exactly match every ground truth label. Finally, we also compute the average $F_1$ score weighted by the number of examples in each evidence type (Wgt F1). All the models are trained on data up to March 2019 and are evaluated on new ClinGen paper annotated from April to May 2019. \subsection{Performance comparison} We train the \textbf{LitGen model} based on the strategies described in the method section. We also consider a baseline classifier that randomly predicts the value of each label based on the class balance of the training data. We evaluate all trained models on a final holdout set of 347 disjoint papers. In Table~\ref{tab:main-result}, we show the performance of our proposed methods to incorporate explanations into the supervised learning and proxy-label semi-supervised learning pipelines. \begin{table}[h] \tbl{Performance of different training strategies for LitGen model. } {\begin{tabular}{@{}lccc@{}} \toprule & \multicolumn{3}{c}{Apr 2019 to May 2019} \\ Strategy & Avg Accu & EM & Wgt $F_1$ \\ \colrule Baseline (Majority) & 62.9 & 8.7 & 36.0 \\ \colrule BiLSTM & 82.6 & 45.2 & 62.7 \\ BiLSTM + Naive Exp & 83.8 & 48.7 & 66.5 \\ BiLSTM + Naive Unlabled & 83.9 & 50.1 & 65.7 \\ BiLSTM + Naive Exp + Naive Unlabeled & \textit{82.9} & \textit{48.4} & \textit{66.4} \\ \colrule BiLSTM + Exp-guided Snorkel & 84.0 & 50.1 & 66.8 \\ \textbf{LitGen}: BiLSTM + Exp-guided Unlabeled & \textbf{85.0} & \textbf{51.6} & \textbf{68.1} \\ \botrule \end{tabular}}\label{tab:main-result} \end{table} \paragraph{Unlabeled data and explanations both help} We observe the improvement over BiLSTM model when training on proxy-labeled paper abstracts and leveraging explanations: both \textit{BiLSTM + Naive Unlabled} and \textit{BiLSTM + Naive Exp} outperform \textit{BiLSTM} on all the evaluation metrics. That naive training on explanations leads to improvement shows that explanations do provide learning signals for the model. \smallskip \paragraph{Naive joint training hurts performance} However, even though training on explanation prediction task or training on proxy-labeled paper abstracts each improves the final model's performance, such effect is not additive when we train on both. \emph{BiLSTM + Naive Exp + Naive Unlabeled} performs relatively poorly. We have discussed potential drawback of training naively on explanations such as text length distribution mismatch and noisy explanation text. \smallskip \paragraph{Using explanations for feature selection outperforms all} Explanations contain valuable learning signals but are noisy in its writing. When we use them for feature selection, choosing words that are determined important by a Lasso classifier, we accomplish two goals at once: 1) reducing the overall document feature vector dimension for the random forest proxy labeling model; 2) provide a set of labeling functions that can be leveraged by algorithms like Snorkel-MeTal. We can see in Table~\ref{tab:main-result}, this approach produces two best performing final models. \subsection{Performance of Proxy Labeling Model} \begin{table}[h] \tbl{Evaluation of the quality of generated proxy labels on the holdout test set.} {\begin{tabular}{@{}lccc@{}} \toprule & \multicolumn{3}{c}{Apr 2019 to May 2019} \\ Labeling model & Avg Accu & EM & Wgt $F_1$ \\ \colrule Naive Unlabeled & 81.2 & 40.3 & 53.2 \\ Exp-guided Unlabeled & 82.8 & 46.1 & 60.0 \\ Exp-guided Snorkel & 11.5 & 2.6 & 42.3 \\ \botrule \end{tabular}}\label{tab:labeling-model-result} \end{table} We performed additional analysis to gain more insights into the improved performance of LitGen due to proxy labels on the unlabeled papers. Since we do not have access to ground truth labels for the unlabeled papers, we evaluate the performance of the proxy labeling models on the holdout evaluation dataset that we used to evaluate our BiLSTM model. It is notable that the random forest with explanation-guided feature selection (Exp-guided Unlabeled) gives reasonably accurate proxy labels, and is indeed more accurate than the Naive Unlabeled which does not have this feature selection. Moreover because this random forest derived proxy label provides complementary signal, training the original BiLSTM on this additional data leads to additional improvements and give rise to our final LitGen algorithm. We note that popular weak supervision algorithm, Snorkel, performs poorly \anie{with our automatic labeling functions}. \subsection{Performance by Evidence Types} \begin{table}[h] \tbl{Accuracy of baseline (always guess the majority class), BiLSTM and LitGen model for each evidence type.} {\begin{tabular}{@{}lccc@{}} \toprule Evidence type & Baseline (Majority) & BiLSTM & LitGen \\ \colrule Experimental Studies & 63.1 & 85.6 & \textbf{86.7} \\ Allele Data & 65.7 & 80.4 & \textbf{83.0} \\ Segregation Data & 73.8 & 88.8 & 88.8 \\ Specificity of Phenotype & 66.0 & 87.0 & \textbf{90.2} \\ Case Control & 45.8 & 71.2 & \textbf{76.4} \\ \botrule \end{tabular}}\label{tab:accu-evidence-type} \end{table} We show the performance of our model on each of the evidence types in Table~\ref{tab:accu-evidence-type}. We can see that one of the most difficult class to predict is the evidence type ``segregation data''. We conjecture that this is because we only used paper abstracts. Most segregation data are mentioned in the actual content of the paper. However, it remains a major challenge for a deep learning system to consume input as long as a full scientific paper. One of the easiest evidence types to learn is ``experimental studies'' because curators mostly look for experimental procedure keywords and most of them are present in the abstracts. \section{Introduction} The diversity of genetic variations that exist in the modern human population are slowly been recognized and discovered. Some of these variations are responsible for well-known physical differentiation across humans (e.g. hair color \cite{branicki2011model}), other variants can predict the development of inherited diseases like sickle-cell anemia or cystic fibrosis, and a few others are protective of disease, like some variations of PCSK9 which lowers the risk for coronary heart disease \cite{cohen2006sequence}. However, little is known overall about the more than 650 million variants known to date across the human genome \cite{pawliczek2018clingen}. In PubMed using the search term ‘genetic variation’ returns over one million manuscripts, with almost half of them generated in the last 10 years. Our understanding of previous published studies linking human genetic variants with medical syndromes and phenotypic traits is still limited. In 2013, the United States’ National Center for Biotechnology Information (NCBI) established the Clinical Genome program~\cite{rehm2015clingen}, with the goal of defining the clinical relevance of key genes and variants through several gene and variant curation expert panels. These experts meet regularly to consider new evidence in the literature to curate and assess the pathogenicity of variants. The variant curation process combines clinical, genetic, population, and functional evidence with expert review to classify variants into 1 of 5 categories (Pathogenic, Likely Pathogenic, Variant of Unknown Significance, Likely Benign, Benign) according to the joint 2015 American College of Medical Genetics (ACMG), and Association for Medical Pathology (AMP) guidelines on clinical significance \cite{richards2015standards}. The ACMG/AMP guidelines provide a set of criteria, and a curator searches for evidence and evaluates whether or not the evidence is sufficient to mark each criterion as met. A pathogenicity classification for each variant is calculated from the totality of the evidence evaluated using the ACMG/AMP criteria. Many of these criteria are mostly evaluated using pertinent information gleaned from publications, and finding the relevant publications that contain relevant evidence is a significant challenge to curators. \smallskip \noindent \textbf{The workflow of curating variants of clinical relevance.} The ClinGen procedure for biocurators\footnote{https://clinicalgenome.org/site/assets/files/3677/clingen\_variant-curation\_sopv1.pdf} defines four steps to assess the pathogenicity of a variant: 1) select a variant of interest with and the suspected disease or mode of inheritance; 2) review available literature evidence about the disease; 3) curate evidence according to the ACMG/AMP criteria; 4) propose a level of pathogenicity. This process is assisted by ClinGen’s Variant Curation Interface\footnote{https://clinicalgenome.org/curation-activities/variant-pathogenicity/}. Biocurators outside of the ClinGen environment follow a similar procedure. In the third step, when biocurators consider each of the ACMG/AMP criteria to systematically evaluate if the considered variant has some available literature. VCI further groups ACMG/AMP criteria into evidence types, many of which require evidence from published literature. Assessing which paper is relevant for each of the evidence types has a high burden of time and effort on the biocurator. To the best of our knowledge, there is currently no tool to automatically facilitate this task. \smallskip \noindent \textbf{Our contribution} We built a machine learning system LitGen that recommends papers to biocurators based on the evidence types presented in the paper. We believe this is the first system that analyzes papers for content on clinically relevant evidence types beyond variant name normalization or information matching~\cite{wei2017tmvar,Birgmeier171322,kuleshov2019machine}. We also contribute to the research area of semi-supervised learning with explanations. LitGen effectively uses explanations to guide semi-supervised learning. A thorough evaluation on new ClinGen data demonstrates that LitGen outperforms competitive baselines by a large margin. \section{Using Other Packages}\label{aba:sec1} \bibliographystyle{ws-procs11x85} \section{Method} We use the following notations to describe our data. Each paper in our dataset is annotated with at least one VCI evidence type and the associated explanation comments on the rationale of selection. For the labeled papers dataset, we have $(x, \bm{y}) \in (\mathcal{X}, \bm{\mathcal{Y}})$ where $\bm{y} \in [0, 1]^m$ for m labels and $ m = 5$ in our case. Here $x$ represents the paper title and abstract. This is a multi-label setting because each paper can contain multiple evidence types. Each explanation comment is associated with \anie{exactly} one evidence type. We can regard it as $(e, y) \in (E, \mathcal{Y})$, where $e$ is the explanation text and $y \in \{1,...,m\}$ describes the evidence type. \subsection{BiLSTM baseline} We aim to train a competitive supervised learning algorithm on the labeled data. We use the state-of-the-art text processing algorithm for our model: long-short-term memory networks (LSTMs). It has been used in many natural language processing applications~\cite{mikolov2012statistical}, generating complex human responses~\cite{nie2019learning}, and well-adopted in clinical text processing~\cite{nie2018deeptag,zhang2019vettag}. We use the bidirectional variant of this algorithm proposed by Graves et al.~\cite{graves2005bidirectional}. For each paper abstract $x = w_1, ..., w_T$, we compute the hidden state vectors $H = [h_1, ..., h_T]$. We compute the vector representation of the abstract $c(x)$ using the global max-pooling over the temporal dimension suggested by Collobert \& Weston \cite{collobert2008unified}. At last, we predict whether an evidence type $y_i$ exist through a sigmoid binary classifier with parameter $\theta_i$. We compute the binary cross-entropy loss through the predicted labels $\bm{\hat{y}} = [\hat y_1, ..., \hat y_m]$ and true labels $\bm{y}$. \begin{eqnarray} &H = [h_1, ..., h_T] = \text{BiLSTM}(w_1,...,w_T) \text{, } H \in \mathbb{R}^{T \times d} \\ &\bm{c}(x) = [\max(H_{\cdot, 1}), \max(H_{\cdot, 2}), ..., \max(H_{\cdot, d})], \bm{c}(x) \in \mathbb{R}^{d} \\ &P(y_i) = \hat{y}_i = \sigma(\theta_i^\intercal \bm{c}(x)) \text{, for } i=1,...,m \\ & \mathcal{L}_{\text{BCE}}(x, \bm{\hat{y}}, \bm{y}) = - \frac{1}{m} \sum_{i=1}^m y_i \log (\hat y_i) + (1 - y_i)\log(1- \hat y_i) \end{eqnarray} \subsection{Leveraging unlabeled data} After training a competitive baseline model only on limited labeled data, we explore the possibility of leveraging unlabeled paper by using a proxy labeling model. Proxy-label approach to semi-supervised learning has been generally shown to improve the performance of the final model. This approach aims to produce proxy labels on unlabeled data, which later are used as targets together with labeled data to train the final model. These proxy labels do not reflect the ground truth labels, but they might provide some signals for learning~\cite{blum1998combining,zhou2004democratic}. \begin{figure}[h] \centerline{ \includegraphics[scale=0.5]{images/WeakSupFigure5.pdf} } \caption{\textbf{Naive Unlabeled:} The two views of inputs for the proxy labeling model and the BiLSTM model.} \label{fig:input-pipeline} \end{figure} We train a random forest model to predict evidence types on our labeled dataset (represented as bag-of-words). We then apply this random forest to predict labels for each unlabeled paper; we call these the proxy labels. Finally we train our BiLSTM model on proxy-labeled unlabeled data and labeled data together. We refer to this strategy as \textbf{Naive Unlabeled}, because \anie{it is} a simple and direct approach to use the unlabeled papers. The point of using the random forest to generate the proxy labels is that it contains different inductive bias compared to the original \anie{BiLSTM}. Zhou \& Goldman~\cite{zhou2004democratic} showed that when the proxy labeling models have different bias compared to the final classifier, the generated proxy labels can often improve the model's performance. \subsection{Explanations in multitask learning} Beyond building a strong BiLSTM baseline and incorporate proxy labeling methods on unlabeled data, another important feature of our curation dataset is that we have human-provided explanations associated with each paper. Each explanation is a concise summary of \emph{why} the curator asserted that a paper provides a particular type of pathogenicity evidence. We hypothesized that these explanations could help us to generating features that are salient for evidence predictions. Contrary to using humans to label each training example, which is very costly both in terms of time and resource, recent works have explored whether human-provided explanations will allow models to learn beyond instance-level labels. Early works focus on using semantic parsing over human explanations to obtain labeling functions~\cite{srivastava2017joint,hancock2018training}. However, such approaches are limited to explanations that have fixed format such as ``X because of Y and Z''. The explanations provided by our curators are free text and do not conform to predefined templates. An innovation of our work is on how to leverage these explanations. \begin{figure}[h] \centerline{ \includegraphics[scale=0.4]{images/WeakSupFigure4.pdf} } \caption{Multi-task learning pipeline that leverages labeled data and explanations} \label{fig:mtl-pipeline} \end{figure} A simple way to use the explanations is to treat them simply as additional labeled examples where the label is the associated VCI evidence type. We build a multi-task learning objective, where the BiLSTM model is asked to optimize for two tasks: predicting whether a paper contains information relevant to a VCI evidence type (original task, loss marked as $\mathcal{L}_1$), as well as whether an explanation is provided as rationale for a VCI evidence type (explanation prediction task, loss marked as $\mathcal{L}_2$). For each epoch, we train on two tasks separately: first on the explanation prediction task, and after iterating through all batches of explanations, we train on the original paper abstract prediction task. We use a scalar hyperparameter $\lambda \in [0, 1]$ to scale the loss of the explanation prediction task. We call this approach \textbf{Naive exp} There are inherent problems to this approach. First of all, when we train on $(e, y)$, the explanations have a different length distribution compares to $x$, the paper abstracts. Explanations tend to be shorter and more succinct. Since we are using the same BiLSTM model to process both texts, we are learning from two data distributions. Second, even though both explanations and papers are associated with a VCI evidence type, one explanation can only exclusively be used to justify for one VCI evidence type, while a paper can be associated with multiple VCI evidence types. Therefore, the nature of data-to-label mapping is different for the two tasks. The last problem is that explanations are noisy. Curators submit these explanations often as a comment or additional information to support their choice of paper. Not all words in explanations are useful for the original task. We address all three problems by proposing our new approach: use explanations to perform feature selection, and then use the selected features to proxy label the unlabeled papers. \subsection{Explanations as feature selection for proxy labeling} \begin{figure}[h] \centerline{ \includegraphics[scale=0.4]{images/WeakSupFigure1.pdf} } \caption{General training pipeline that leverages unlabeled data guided by explanations.} \label{fig:model-pipeline} \end{figure} We first train a Lasso classifier (a logistic regression classifier with $L_1$ regularization) on the frequency-encoded \anie{unigram} feature representation of the explanations. Our Lasso classifier obtains a coefficient on each word that determines whether the word is important for the prediction of which VCI evidence type an explanation is associated with. \anie{Our Lasso classifier obtains 89.0\% accuracy on this classification task}. This shows that explanations are easier to classify compared to paper abstracts and they contain useful signals that can be leveraged. We extract words that have non-zero coefficients. We display some of these words in Figure~\ref{tab:keywords}. In total, we are able to find 799 words that have non-zero coefficient out of 7550 words contained in explanations. We use these 799 words as the selected features and then follow the same proxy labeling strategy as the Naive Unlabeled algorithm. \begin{figure}[h] \centerline{ \includegraphics[scale=0.7]{images/Keywords.pdf} } \caption{We \anie{display} a set of keywords that are the most positively associated with each VCI evidence types from human explanations by training a lasso model on unigram features. Coefficients refer to Lasso coefficients.} \label{tab:keywords} \end{figure} For each paper abstract, we record the frequency of these 799 unique words in the abstract and ignore all other words. Originally, in section 3.2, we naively encode the paper abstract obtaining a vector equivalent to the size of the entire vocabulary space (after removing stop words and punctuation), which is 16860. We have now restricted the dimension of the vector representing the paper abstract from 16860 to 799. We refer to this feature selection process as \textbf{Exp-guided}. We then train our random forest proxy labeling model on the paper abstracts and use it to generate proxy labels for unlabeled data. At last, we train the BiLSTM model on both proxy labeled unlabeled data and ground-truth data. We refer to this setting as the \textbf{LitGen} model. Another advantage to our explanation-guided feature selection process is that we can now automatically generate labeling functions without semantic parsing. We use a simple heuristic to binarize the coefficients in our Lasso classifier: each of the 799 words is a labeling function. If the word has a positive coefficient, we output \anie{+1} when we encounter this word. If the word has a negative coefficient, we output -1. When the word is missing, \anie{we output 0}. This allows us to leverage labeling function aggregation algorithm such as Snorkel-MeTal~\cite{ratner2018snorkel}. We include this result to show that by selecting features from explanations, we are able to leverage multiple approaches in semi/weakly supervised learning. We refer to this setting as \textbf{Exp-guided Snorkel}. \section{Method} \james{This Methods section is quite confusing and needs to be rewritten. It's not clear from the text how the explanation and unlabeled data are used. Reduce the space and clutter that's spend on the standard concepts (e.g. LSTM, gradient descent) and use it to more precisely define the new ideas. Please refer back to the outline we wrote on my whiteboard. } We propose two methods to incorporate high-level explanations into both supervised learning and proxy-label semi-supervised learning. We show that adding explanations to both settingsss can effectively improve the performance of the final model and we describe them in details in the following sections. We use the following notations to describe our data. Each paper is associated with an explanation on why it is chosen as a relevant literature for a VCI tab. Explanations are entered by curators manually. For the labeled papers dataset, we have $(x, \bm{y}) \in (\mathcal{X}, \bm{\mathcal{Y}})$ where $\bm{y} \in [0, 1]^m$ for m labels and $|\bm{y}| = m$. This is a multi-label setting to capture the fact that each paper can be submitted to multiple VCI tabs. The human explanation dataset can be described as $(e, y) \in (E, \mathcal{Y})$, where $y \in \{1,...,m\}$ and $|y| = 1$ because each explanation can only be associated with one VCI tab. Since both explanations and papers are submitted to the same set of tabs, $\mathcal{Y}$ and $\bm{\mathcal{Y}}$ share label space. \subsection{Learning from labeled data} \paragraph{LitGen model} We use the state-of-the-art text processing algorithm for our recommendation model: Long-short-term memory networks (LSTM). It has been widely used in many natural language processing applications~\cite{hochreiter1997long,mikolov2012statistical} and recently adopted for clinical long text processing~\cite{nie2018deeptag,zhang2019vettag}. A long-short-term memory network is a recurrent neural network with a long-short-term memory cell. It takes one word as input, as well as the previous cell and hidden state. Given a sequence of word embeddings $x_1, ..., x_T$, an LSTM network computes these inputs recurrently and outputs a sequence of vectors $h_1, ..., h_T$. An extension of the LSTM network is to intorduce bidirectional passes~\cite{graves2005bidirectional}. We adopt this extension. At the end of both passes, bidirectional LSTM will output two hidden states represents each input $x_t$, and we stack these two hidden states as our new hidden state for this input $ h_t = [\overrightarrow{h_t};\overleftarrow{h_t}]$. After computing hidden states over the entire document, we introduce global max pooling over the hidden states, as suggested by Collobert \& Weston \cite{collobert2008unified} so that the hidden states will aggregate information from the entire documents. Assuming the dimension of hidden state is $d$, global max pooling apply an element-wise maximum operation over the temporal dimension of the hidden state matrix, described in Eq~1-2. \begin{eqnarray} H &= [h_1, ..., h_T] \text{, } H \in \mathbb{R}^{T \times d} \\ c_j &= \max(H_{j}) \text{, for } j = 1, ..., d \end{eqnarray} Then we define a binary classifier for each of VCI tab. This serves as our baseline model. The binary classifier takes in a vector $\bm{c}$ that represents the veterinary record and outputs a sufficient statistic for the Bernoulli probability distribution indicating the probability of whether a paper belongs to a VCI tab. For $i = 1, ..., m$ with input $x$: \begin{equation} \begin{aligned} P(y_i) = \hat{y}_i = \sigma(\theta_i^\intercal \bm{c}(x))\\ \end{aligned} \label{eq:binary} \end{equation} \subsection{Learning from labeled data with explanations} \begin{figure}[h] \centerline{ \includegraphics[scale=0.4]{images/WeakSupFigure4.pdf} } \caption{Multi-task learning pipeline that leverages labeled data and explanations} \label{fig:mtl-pipeline} \end{figure} A simple algorithm that allows model to learn both from the labeled papers and human explanations is multi-task learning. We use the LitGen model as described above. We can formulate two tasks on two datasets: one is to recommend paper to the correct set of VCI tabs, another is to find out which tab does the explanation belong. For the paper recommendation task, we use parameter $\Theta$ for the classifier, and for the explanation classification task, we use parameter $\Gamma$ for the classifier. Both tasks share the same LSTM model for text processing. \begin{eqnarray} \log P(\bm{y}|x) &= \log \sum_{i=1}^m \sigma(\theta_i^\intercal \bm{c}(x)), \theta_i \in \Theta \\ \mathcal{L}_1 &= \sum_{x, \bm{y} \in \mathcal{X}, \bm{\mathcal{Y}}} \log P(\bm{y}|x) \\ \log P(y|e) &= \log \sum_{i=1}^m \sigma(\gamma_i^\intercal \bm{c}(e)), \gamma_i \in \Gamma \\ \mathcal{L}_2 &= \sum_{e, y \in E, \mathcal{Y}} \log P(y|e) \\ \mathcal{L} &= \mathcal{L}_1 + \lambda * \mathcal{L}_2 \end{eqnarray} For each epoch, we first train on one task with minibatch optimization, and when it has finished, we train on the task. Since $\mathcal{L}_2$ is not associated with the real task, we add a scalar $\lambda \in [0, 1]$ to scale down the loss. We describe the training procedure with the following pseudo-code: \begin{algorithm}[H] \caption{Training Procedure for Multi-task Learning} \begin{algorithmic} \While {epoch $<$ K} \ForAll{x, $\bm{y}$ $\in$ $\mathcal{X}, \bm{\mathcal{Y}}$} \State $\bm{c}(x) \gets$ LitGen(x) \State $\mathcal{L}_1 \gets \log P(\bm{y}|x)$ \State take gradient step on $\mathcal{L}_1$ \EndFor \ForAll{e, y $\in$ $E, \mathcal{Y}$} \State $\bm{c}(e) \gets$ LitGen(e) \State $\mathcal{L}_2 \gets \log P(y|e)$ \State take gradient step on $\lambda * \mathcal{L}_2$ \EndFor epoch $\gets$ epoch + 1 \EndWhile \end{algorithmic} \end{algorithm} This simple approach has a few drawbacks. The length of explanations is considerably shorter than paper abstract. The model is trained under two sets of data with distributional shift on the input. The output distribution between two datasets are also different. Explanations' labels are mutually exclusive (i.e., one explanation can only be used for one VCI tab), while papers' labels are non-mutually exclusive (i.e., one paper can be submitted to multiple VCI tabs). \subsection{Learning from unlabeled data} Besides learning from labeled papers, we can also learn from unlabeled papers. Inspired by the approach democratic co-learning~\cite{zhou2004democratic} which employs inductive biases from models with different inductive biases, and co-training~\cite{blum1977combining} which leverages different views of data representation, we can train two models (\textbf{labeling model} and \textbf{LitGen model}) with the following constraints: 1). Two models cannot have similar architecture; 2). Two models must be trained on different representations of the data. \paragraph{Text featurizer} In order to train a labeling model, we need to featurize the papers into a fixed-dimensional representation. Here we use frequency-encoded unigram as the feature representation of the text. By processing the labeled paper dataset and removing stop words, we have 16,860 unique words. For each paper abstract, we construct our unigram feature representation of the abstract by building a 16,860 dimension vector. \paragraph{Labeling model} We use a random forest model with multiple binary output as the learning model that takes the features from the \textbf{text featurizer}. \paragraph{LitGen model} \james{I thought LitGen refers to the best model which uses the unlabeled data and other tricks. Isn't this biLSTM only the baseline?} is a long-short-term memory network model as described. For each paper abstract, we use an embedding lookup process -- for each word in the abstract, we look up a pre-existing word embedding from a large pre-trained word embedding dictionary GloVe~\cite{pennington2014glove}. For words that are specific to our corpus and cannot be found in GloVe, we initialize the embedding according to the Xavier-uniform distribution~\cite{glorot2010understanding}. \begin{figure}[h] \centerline{ \includegraphics[scale=0.5]{images/WeakSupFigure5.pdf} } \caption{The different views of inputs for the labeling model and the LitGen model. Labeling model takes inputs from the text featurizer.} \label{fig:input-pipeline} \end{figure} \begin{figure}[h] \centerline{ \includegraphics[scale=0.4]{images/WeakSupFigure1.pdf} } \caption{General training pipeline that leverages unlabeled data.} \label{fig:model-pipeline} \end{figure} We train the \textbf{labeling model} on the ClinGen labeled papers once and use it to generate labels for unlabeled papers retrieved by LitVar. Then we train the \textbf{LitGen model} on both noisly labeled papers and ClinGen's ground-truth labeled papers. \subsection{Learning from unlabeled data guided by explanations} Explanations may offer insights on what words are important for the prediction of a VCI tab. This means we can use explanations to find a better set of keywords for the \textbf{text featurizer} module. We build a logistic regression classifier with lasso loss on the ClinGen Human Explanations dataset. This lasso classifier uses the unigram feature representation of explanations. After removing stop words, the ClinGen Human Explanations dataset has 7,550 unique words. After fully training our lasso classifier, we select words that have non-zero regression coefficients. We are able to select 799 words that are deemed as important predictors for 5 VCI tabs. One advantage of this approach is that by reducing the dimension of the feature representation. This allows our \textbf{labeling model} to have better performance, as we will empirically observe. \begin{figure}[h] \centerline{ \includegraphics[scale=0.7]{images/Keywords.pdf} } \caption{We deisplay a set of keywords that are most positively associated with each VCI tabs from human explanations by training a lasso model on unigram features. Coefficients refer to Lasso coefficients.\james{sufficient to show only two decimal digits for the coefficients.}\anie{addressed!}} \label{tab:keywords} \end{figure} \paragraph{Snorkel-Metal} Another advantage is that these keywords can be also used as simple heuristic labeling functions for other weak supervision algorithms such as Snorkel-MeTal~\cite{ratner2018snorkel}. We show a list of keywords that are most positively associated with each tab in Figure~\ref{tab:keywords}. Keywords selected by lasso have these advantages that fit naturally into Snorkel style labeling functions: 1) We get positive and negaitve keywords as Snorkel labeling functions require both; 2) If no word is found, our labeling function will output N/A (missing), which is required by Snorkel labeling function as well. \section{Using Other Packages}\label{aba:sec1} The class file loads the packages {\tt amsfonts, amsmath, amssymb, chapterbib, cite, dcolumn, rotating} and {\tt url} at startup. Please try to limit your use of additional packages as they often introduce incompatibilities. This problem is not specific to the WSPC styles; it is a general \LaTeX{} problem. Check this article to see whether the required functionality is already provided by the WSPC class file. If you do need additional packages, send them along with the paper. In general, you should use standard \LaTeX{} commands as much as possible. \section{Layout} In order to facilitate our processing of your article, please give easily identifiable structure to the various parts of the text by making use of the usual \LaTeX{} commands or by using your own commands defined in the preamble, rather than by using explicit layout commands, such as \verb|\hspace, \vspace, \large, \centering|, etc.~Also, do not redefine the page-layout parameters. \section{User Defined Macros} User defined macros should be placed in the preamble of the article, and not at any other place in the document. Such private definitions, i.e. definitions made using the commands \verb|\newcommand,| \verb|\renewcommand,| \verb|\newenvironment| or \verb|\renewenvironment|, should be used with great care. Sensible, restricted usage of private definitions is encouraged. Large macro packages and definitions that are not used in this example article should be avoided. Please do not change the existing environments, commands and other standard parts of \LaTeX. \section{Using WS-procs11x85} \subsection{Input used to produce this paper} \begin{verbatim} \documentclass{ws-procs11x85} \usepackage{ws-procs-thm} \begin{document} \title{For proceedings ...} \author{First Author$^*$ ...} \address{University ...} \author{Second Author} \address{Group, Laboratory, ...} \begin{abstract} This article... \end{abstract} \keywords{Style file; ...} \copyrightinfo{\copyright...} \section{Using Other Packages} The class file has...
\section{Introduction} \IEEEPARstart{G}{\textit{enerative}} \textit{adversarial networks} (GANs) first introduced by \cite{goodfellow2014generative} are well-known and powerful generative models for image synthesis and have been applied to various types of image-related tasks \cite{wang2018perceptual, wang2018deeply, hsu2018sigan, quan2018compressed, gao2019universal, wei2019facial}. The vanilla GANs proposed by \cite{goodfellow2014generative} consist of two neural networks: a generator and a discriminator. The generator is trained to generate fake images to fool the discriminator while the discriminator is trained to distinguish fake images from real ones. To enhance the quality of fake images generated from a vanilla GAN, many subsequent works have aimed to improve its training, such as large-scale training (e.g., BigGAN \cite{brock2018large}), novel normalization (e.g., SN-GAN \cite{miyato2018spectral}), advanced GAN architectures (e.g., SA-GAN \cite{zhang2019self}), and different loss functions (e.g., WGAN loss \cite{arjovsky2017wasserstein, gulrajani2017improved} based on the \textit{Wasserstein distance} \cite{villani2008optimal} and MMD-GAN loss \cite{li2017mmd} based on \textit{maximum mean discrepancy} \cite{gretton2012kernel}). Instead of improving the training procedure, we are more interested in this article in post-processing fake images from a trained GAN, i.e., subsampling fake images to filter out unrealistic images. Two density ratio based subsampling methods for GANs were proposed recently and demonstrated to be effective. \textit{Discriminator Rejection Sampling} (DRS) \cite{azadi2018discriminator} is based on \textit{rejection sampling} (RS) to accept or reject a fake image generated from a trained GAN, and \textit{Metropolis-Hastings GAN} (MH-GAN) \cite{turner2018metropolis} utilizes the \textit{Metropolis-Hastings algorithm} (MH) to sample from a trained GAN. Denote the true data distribution by $p_r(\bm{x})$ and the distribution of fake images by $p_g(\bm{x})$. The key step of these two subsampling methods is \textit{density ratio estimation} (DRE) where the density ratio $p_r(\bm{x})/p_g(\bm{x})$ is estimated. When GANs are trained with the standard adversarial loss function defined in \cite{goodfellow2014generative}, given a fixed generator, the optimal discriminator $D^*(\bm{x})$ and the density ratio $r(\bm{x})=p_r(\bm{x})/p_g(\bm{x})$ satisfy the relationship \begin{equation} \label{eq:relation_DR_Disc} r(\bm{x})=\frac{p_r(\bm{x})}{p_g(\bm{x})}=\frac{D^*(\bm{x})}{1-D^*(\bm{x})}. \end{equation} This property is leveraged by \cite{azadi2018discriminator, turner2018metropolis} to estimate the density ratio $p_r(\bm{x})/p_g(\bm{x})$, and hence DRS and MH-GAN rely heavily on an assumption of optimality of the discriminator. In practice, however, the quality of the discriminator is difficult to guarantee in GAN training. Moreover, this property no longer holds if a GAN is trained with other loss functions such as the WGAN loss \cite{arjovsky2017wasserstein, gulrajani2017improved} or the MMD-GAN loss \cite{li2017mmd}. Thus, strictly speaking, DRS and MH-GAN are not suitable for WGANs and MMD-GANs. To reduce the reliance of DRS and MH-GAN on the quality of a trained discriminator and broaden their application to different GANs, direct estimation of the density ratio from samples is needed. Previous research on density ratio estimation for images includes \cite{nam2015direct, khan2019deep, grover2019bias}. \cite{nam2015direct, khan2019deep} propose use of a \textit{convolutional neural network} (CNN) to model the true density ratio function. \cite{nam2015direct} models the density ratio function by a CNN with only two convolutional layers and fits this shallow CNN under the \textit{unconstrained least-squares importance fitting} (uLSIF) loss function. A deeper CNN structure that contains six convolutional layers along with two new loss functions (called DSKL and BARR, respectively) are proposed by \cite{khan2019deep}. However, the loss functions used by \cite{nam2015direct, khan2019deep} to train CNNs are not bounded from below. Hence, if \textit{stochastic gradient descent} (SGD) or a variant is used for the optimization, the training loss keeps decreasing without converging as long as the CNN has enough capacity. Rather than using a neural network to model the true density ratio function, \cite{grover2019bias} leverages the relationship between the true density ratio function and a Bayes optimal classifier (BOC) to estimate density ratios. The BOC is learned from samples and used for classifying real and fake samples. However, this method suffers from the difficulty of achieving the optimality of the BOC. In this paper, we focus on improving density ratio based subsampling methods for GANs \cite{azadi2018discriminator, turner2018metropolis} by proposing a novel sample-based \textit{density ratio estimation} (DRE) method. Our contributions can be summarized as follows: \begin{itemize} \item We propose in Section \ref{sec:SP_loss} a novel loss function called \textit{Softplus} (SP) loss for density ratio estimation with neural networks. \item We derive in Section \ref{sec:convergence} the rate of convergence of a density ratio model trained with the SP loss under Bregman divergence. \item In Section \ref{sec:DRE-F} we further propose a density ratio estimation method for image data: \textit{Density Ratio Estimation in Feature Space with Softplus Loss} (DRE-F-SP). We model the true density ratio function by a 5-layer multilayer perceptron (MLP) in a feature space learned by a specially designed and pre-trained ResNet-34, and the MLP is trained under the SP loss. \item Then, in Section \ref{sec:DRE-F-SP_Sampling}, we incorporate the proposed DRE-F-SP into the RS and MH schemes of \cite{azadi2018discriminator, turner2018metropolis}. We also apply the \textit{sampling-importance resampling} (SIR) scheme based on the DRE-F-SP because of the high efficiency of the SIR. These three subsampling methods for GANs are denoted by DRE-F-SP+RS, DRE-F-SP+MH, and DRE-F-SP+SIR, respectively. \item Finally, in Section \ref{sec:experiment}, we conduct experiments on a synthetic dataset and the CIFAR-10 dataset to justify our proposed subsampling methods. The experiments show that they can substantially outperform DRS and MH-GAN. In addition to the main study, we also conduct an ablation study on both the synthetic dataset and the CIFAR-10 dataset, respectively, to demonstrate that the novel SP loss is one source of the improvement. On CIFAR-10, we conduct a second ablation study to show the density ratio estimation in the feature space is another source of the improvement. Moreover, our experiments show that our subsampling methods can improve different types of GANs, e.g., DCGAN, WGAN-GP, and MMD-GAN. \changes{Extra experiments on MNIST and CelebA in the supplemental material also demonstrate the superiority of our methods.} Codes for these experiments can be found at \url{https://github.com/UBCDingXin/DDRE_Sampling_GANs}. \end{itemize} \section{Related works} \subsection{Generative Adversarial Networks} A vanilla GAN \cite{goodfellow2014generative} is composed of two neural networks---a generator $G(\bm{z},\theta)$ and a discriminator $D(\bm{x},\phi)$ ($\theta$ and $\phi$ are parameters). The generator takes as input a sample from a simple prior $\bm{z}\in\mathcal{Z}\sim q(\bm{z})$ (e.g., $N(\bm{0},\bm{I})$) and outputs a fake image $\bm{x}^g\in\mathcal{X}\sim p_g(\bm{x})$. The discriminator takes an image $\bm{x}$ from $\mathcal{X}$ as input and outputs the probability $D(\bm{x})$ that $\bm{x}$ is from $p_r(\bm{x})$. These two networks are trained alternately with opposite objective functions. The discriminator is trained to assign a high probability to a real image $\bm{x}^r\sim p_r(\bm{x})$ but a low probability to a fake image $\bm{x}^g\sim p_g(\bm{x})$. Conversely, the training purpose of the generator $G(\bm{z},\theta)$ is to make the discriminator assign a high probability to a fake image $\bm{x}^g$, which is equivalent to making $p_g(\bm{x})$ as close as possible to $p_r(\bm{x})$. The standard loss functions defined by \cite{goodfellow2014generative} for the generator and the discriminator are shown as follows: \begin{equation} \label{eq:standard_gan_loss} \begin{aligned} L_D(\phi)&=-\mathbbm{E}_{\bm{x}\sim p_r}\left[\log D(\bm{x},\phi)\right]\\ &\quad -\mathbbm{E}_{\bm{z}\sim q}\left[\log (1-D(G(\bm{z},\theta),\phi)) \right],\\ L_G(\theta)&=-\mathbbm{E}_{\bm{z}\sim q}\left[\log D(G(\bm{z},\theta),\phi) \right]. \end{aligned} \end{equation} It has been demonstrated by \cite{goodfellow2014generative} that, for a fixed $G$, minimizing $L_D$ results in the optimal discriminator $D^*$: \begin{equation} \label{eq:optimal_D} D^*(\bm{x}) = \frac{p_r(\bm{x})}{p_r(\bm{x})+p_g(\bm{x})}. \end{equation} Thus, Eq.\eqref{eq:relation_DR_Disc} can be obtained by simply rearranging Eq.\eqref{eq:optimal_D}. If we denote all layers before the final {\em Sigmoid} layer in a discriminator $D(\bm{x})$ by $\tilde{D}(\bm{x})$, then $D(\bm{x})$ can be rewritten as \begin{equation*} D(\bm{x}) = \sigma(\tilde{D}(\bm{x})) =\frac{1}{1+e^{-\tilde{D}(\bm{x})}}, \end{equation*} where $\sigma$ denotes a {\em Sigmoid} function. Thus, Eq.\eqref{eq:relation_DR_Disc} can also be rewritten as \begin{equation} \label{eq:DR_and_D_tilde} r(\bm{x})=e^{\tilde{D}^*(\bm{x})}. \end{equation} There are several variants of vanilla GANs, such as WGANs and MMD-GANs. Comparing with vanilla GANs, the generator and discriminator of these variants have different structures and are trained with loss functions different from Eq.\eqref{eq:standard_gan_loss}. In this case, the optimal discriminator $D^*$ in Eq.\eqref{eq:optimal_D} may not be obtained so computing the density ratio as Eq.\eqref{eq:DR_and_D_tilde} may not be applicable. Please see \cite{arjovsky2017wasserstein, gulrajani2017improved, li2017mmd} for more details. \subsection{Discriminator Rejection Sampling and Metropolis-Hastings GAN} \label{sec:DRS_and_MH-GAN} \textit{Discriminator Rejection Sampling} (DRS) \cite{azadi2018discriminator} filters out bad fake images by using rejection sampling and discriminator-based density ratio estimation. To estimate the density ratio required in rejection sampling, DRS \cite{azadi2018discriminator} takes a pre-trained GAN and proposes to further train the discriminator only on some hold-out real images and the same number of fake images with early stopping. Then, the trained discriminator is assumed to be the optimal discriminator $D^*(\bm{x})$, and a density ratio at $\bm{x}$ can be computed by evaluating $\exp(\tilde{D}^*(\bm{x}))$ in Eq.\eqref{eq:DR_and_D_tilde}. A key step in the rejection sampling of DRS is to estimate $M=\max_{\bm{x}}p_r(\bm{x})/p_g(\bm{x})$ by evaluating $\exp(\tilde{D}^*(\bm{x}))$ on 10,000 further fake images. This $M$ may be replaced by a larger density ratio if we find one in subsequent sampling. In regular rejection sampling, a proposed fake sample $\bm{x}^\prime$ is accepted with probability \begin{equation} \label{eq:RS_accept_prob} p=\frac{p_r(\bm{x}^\prime)}{Mp_g(\bm{x}^\prime)}=\frac{r(\bm{x}^\prime)}{M}. \end{equation} However, to deal with acceptance probabilities that are too small when the target distribution is high dimensional, \cite{azadi2018discriminator} uses another acceptance probability \begin{equation*} p=\sigma(\hat{F}(\bm{x},M,\epsilon,\gamma)), \end{equation*} where \begin{equation} \label{eq:DRS_F_hat} \begin{aligned} &\hat{F}(\bm{x},M,\epsilon,\gamma)\\ =&\tilde{D}^*(\bm{x})-\log M-\log\left(1-e^{\tilde{D}^*(\bm{x})-\log M-\epsilon} \right)-\gamma,\\ \triangleq&F(\bm{x})-\gamma, \end{aligned} \end{equation} $\epsilon$ is a small constant (e.g., $10^{-14}$) for numerical stability and $\gamma$ is a hyper-parameter to control the overall acceptance probability. \textit{Metropolis-Hastings GAN} (MH-GAN) \cite{turner2018metropolis} applies the Metropolis-Hastings algorithm to correct the sampling bias of an imperfect generator with information from a calibrated discriminator $D^*$. To be more specific, MH-GAN constructs a Markov chain $\{\bm{x}_1,\bm{x}_2,\ldots\}$ where $\bm{x}_k$ is generated as follows: (1) Draw $\bm{x}^\prime$ from the proposal distribution $p(\bm{x}|\bm{x}_{k-1})=p_g(\bm{x})$ and $u$ from $\textrm{Uniform}(0,1)$; (2) The acceptance probability $p$ is defined as \begin{equation} \label{eq:MH_accept_prob} p=\min\left(1, \frac{r(\bm{x}^\prime)}{r(\bm{x}_{k-1})}\right), \end{equation} where $r(\bm{x}_{k-1})$ and $r(\bm{x}^\prime)$ are computed based on Eq.\eqref{eq:relation_DR_Disc}; (3) If $u\leq p$, then $\bm{x}_{k}=\bm{x}^\prime$; otherwise $\bm{x}_{k}=\bm{x}_{k-1}$. This generation-acceptance/rejection procedure is recursively repeated $K$ times and results in a Markov chain of length $K$. To produce independent filtered images, MH-GAN builds one Markov chain per filtered image and for each chain only the last image $\bm{x}_K$ is taken. MH-GAN also includes calibration to refine the trained discriminator. It places either a logistic, isotonic, or beta regression on top of $\tilde{D}$ and trains the regression model on $n_{\text{hold}}$ fake images and $n_{\text{hold}}$ hold-out real images to distinguish between fake and real. Then the calibrated discriminator is built via $D^*(\bm{x})=C(\tilde{D}(\bm{x}))$, where $C$ is the trained regression model. In our experiment, by default, we use the calibrated discriminator to compute density ratios when implementing MH-GAN. This calibration technique can also be applied to WGANs (or similar GANs) to let the calibrated discriminator output class probabilities rather than class scores. However, this calibration is not suitable for MMD-GAN because the ``discriminator'' of MMD-GAN outputs a reconstructed image instead of class scores or class probabilities. Both of the above methods rely heavily on the optimality of the discriminator to estimate the density ratio, but such optimality is hard to guarantee in practice. In this paper, we focus on improving the density ratio estimation step while keeping most of the other procedures in DRS and MH-GAN unchanged. \subsection{Sampling-Importance Resampling} \label{sec:SIR} When a target distribution $p_r(\bm{x})$ is difficult to sample directly, sampling-importance resampling (SIR) \cite{robert2010introducing, bolic2005resampling} generates samples from an easier proposal distribution $p_g(\bm{x})$ and then takes subsamples. Specifically, SIR generates $\left\{\bm{x}_1^g,\cdots,\bm{x}_n^g\right\}$ from $p_g$ and takes subsamples with replacement from them using probability $$w_i=\frac{p_r(\bm{x}_i^g)/p_g(\bm{x}_i^g)}{\sum_{i=1}^np_r(\bm{x}_i^g)/p_g(\bm{x}_i^g)} $$ for $\bm{x}_i^g$. The probability $w_i$ is also known as the normalized importance weight for $\bm{x}_i^g$. If $n$ is large enough, resampling from $\left\{\bm{x}_1^g,\cdots,\bm{x}_n^g\right\}$ in this way approximates samples generated from $p_r$. \subsection{Density Ratio Estimation in Pixel Space}\label{sec:DRE_images} To estimate the density ratio for a given image $\bm{x}$, \cite{nam2015direct, khan2019deep} model the true density ratio function $r(\bm{x})=p_r(\bm{x})/p_g(\bm{x})$ by a CNN $\hat{r}(\bm{x};\bm{\alpha})$, i.e., \begin{equation} \label{eq:r_hat} \hat{r}(\bm{x};\bm{\alpha})\longrightarrow r(\bm{x}), \end{equation} where $\bm{\alpha}$ is the learnable parameter. The CNN $\hat{r}(\bm{x};\bm{\alpha})$ is trained on samples from both $p_r$ and $p_g$ to map a given image to its density ratio and the estimated density ratio at $\bm{x}$ can be obtained by evaluating the fitted CNN at $\bm{x}$. This type of density ratio estimation method consists of two components: a neural network $\hat{r}(\bm{x};\bm{\alpha})$ (used to model the true density ratio function $r(\bm{x})$) and a loss function. \cite{nam2015direct} proposes a CNN with only two convolutional layers to model the density ratio function and trains this CNN by the uLSIF loss defined as \begin{equation} \label{eq:uLSIF_loss} \widehat{L}_{\text{uLSIF}}(\bm{\alpha}) = \frac{1}{2n_g}\sum_{i=1}^{n_g}\hat{r}^2(\bm{x}_i^g;\bm{\alpha}) - \frac{1}{n_r}\sum_{i=1}^{n_r}\hat{r}(\bm{x}^r_i;\bm{\alpha}). \end{equation} We denote this DRE method by \textbf{DRE-P-uLSIF}, where \textbf{P} stands for working in the pixel space in contrast to the feature-based methods of Section \ref{sec:DRE-F}. There are two reasons, however, why uLSIF loss is not well-defined for training a neural network to model the true density ratio function: \begin{enumerate}[label=\alph*)] \item Due to the strong expression capacity of neural networks, training $\hat{r}(\bm{x};\bm{\alpha})$ under the uLSIF loss may encourage $\hat{r}(\bm{x};\bm{\alpha})$ to memorize all training data by simply assigning almost zero density ratio to all fake images (no matter realistic or not) but very large density ratio to all real images. In this case, if we use the SGD optimizer or its variants, the training loss \changes{may keep decreasing without converging}. \item To prevent $\hat{r}(\bm{x};\bm{\alpha})$ from simply ``memorizing" training data, we may add extra constraints on $\hat{r}(\bm{x};\bm{\alpha})$. Since $\int r(\bm{x})p_g(\bm{x})d\bm{x} = \int p_r(\bm{x})d\bm{x} = 1$, a natural constraint on $\hat{r}(\bm{x};\bm{\alpha})$ is \begin{equation} \label{eq:expectation_dr_fake_samples} \int \hat{r}(\bm{x};\bm{\alpha})p_g(\bm{x})d\bm{x} = 1. \end{equation} An empirical approximation to this constraint is \begin{equation} \frac{1}{n_g}\sum_{i=1}^{n_g}\hat{r}(\bm{x}_i^g;\bm{\alpha}) = 1. \end{equation} We can apply this constraint by adding a penalty term to the uLSIF loss, i.e., \begin{equation} \label{eq:optim_uLSIF_penlaty} \min_{\bm{\alpha}} \left\{\widehat{L}_{\text{uLSIF}}(\bm{\alpha}) + \lambda \hat{Q}(\bm{\alpha})\right\}, \end{equation} where \begin{equation} \label{eq:penalty_hat} \hat{Q}(\bm{\alpha}) = \left(\frac{1}{n_g}\sum_{i=1}^{n_g}\hat{r}(\bm{x}_i^g;\bm{\alpha}) - 1\right)^2. \end{equation} However, due to the unbounded nature of the uLSIF loss (the range of $\widehat{L}_{\text{uLSIF}}(\bm{\alpha})$ is $(-\infty, \infty)$ given $\hat{r}(\bm{x})\geq 0$), the penalty term $\lambda \hat{Q}(\bm{\alpha})$ \changes{can not stop $\widehat{L}_{\text{uLSIF}}(\bm{\alpha})$ from going to negative infinity during training}, no matter how large $\lambda$ is. In this case, the penalty term has no effect. \end{enumerate} Two new DRE methods are given by \cite{khan2019deep} in which a 6-layer-CNN is adapted to model the true density ratio function. The methods differ only in their two new training loss functions---DSKL and BARR---and they are denoted by \textbf{DRE-P-DSKL} and \textbf{DRE-P-BARR}, respectively. The two new loss functions are defined as follows: \begin{equation} \label{eq:DSKL} \widehat{L}_{\text{DSKL}}(\bm{\alpha})=-\frac{1}{n_r}\sum_{i=1}^{n_r}\log \hat{r}(\bm{x}_i^r;\bm{\alpha})+\frac{1}{n_g}\sum_{i=1}^{n_g}\log\hat{r}(\bm{x}_i^g;\bm{\alpha}), \end{equation} \begin{equation} \label{eq:BARR} \widehat{L}_{\text{BARR}}(\bm{\alpha})=-\frac{1}{n_r}\sum_{i=1}^{n_r}\log \hat{r}(\bm{x}_i^r;\bm{\alpha})+\lambda\left|\frac{1}{n_g}\sum_{i=1}^{n_g}\hat{r}(\bm{x}_i^g;\bm{\alpha})-1\right|. \end{equation} \cite{khan2019deep} suggests setting $\lambda=10$ in Eq.\eqref{eq:BARR}. Unfortunately, these two new loss functions still suffer from the same problems besetting uLSIF, so they are still unsuitable for density ratio estimation with neural networks. Different from \cite{nam2015direct, khan2019deep}, \cite{grover2019bias} estimates the density ratio using a relationship between the true density ratio $r(\bm{x})$ and a BOC $c(\bm{x})$: \begin{equation} r(\bm{x})=\frac{p_r(\bm{x})}{p_g(\bm{x})}=\gamma\frac{c(\bm{x})}{1-c(\bm{x})}, \end{equation} where $\gamma$ is a prior odds that an image is fake and $c$ is a binary classifier which distinguishes between images from $p_r$ and $p_g$. A CNN is trained by \cite{grover2019bias} on an equal number of real and fake samples. This trained CNN is used as the BOC and $\gamma$ is assumed to be 1. \subsection{Fitting Density Ratio Models Under Bregman Divergence}\label{sec:BR_div} The uLSIF loss \eqref{eq:uLSIF_loss} is a special case of the Bregman (BR) divergence, based on which we propose a novel loss call Softplus loss in Section \ref{sec:SP_loss}. BR divergence \cite{bregman1967relaxation, varshney2011bayes}, an extension of the squared Euclidean distance, measures the distance between two points $t^*$ and $t$ in terms of a function $f$ as follows: \begin{equation} \label{eq:BR_div} BR^\prime_f(t^*|t)= f(t^*)-f(t)-\triangledown f(t)(t^*-t), \end{equation} where $f:\Omega\rightarrow \mathbbm{R}$ is a continuously differentiable and strictly convex function defined on a closed set $\Omega$. Assume $f$ is defined on $\Omega=[\min(m_1,m_2), \allowbreak \max(M_1,M_2)]$, where $m_1=\min r(\bm{x})$, $m_2=\min \hat{r}(\bm{x};\bm{\alpha})$, $M_1=\max r(\bm{x})$, $M_2=\max \hat{r}(\bm{x};\bm{\alpha})$, and $\hat{r}(\bm{x};\bm{\alpha})$ is a density ratio model with a learnable parameter $\bm{\alpha}$. The BR divergence defined based on $f$ is used by \cite{sugiyama2012density} to quantify the discrepancy between $r(\bm{x})$ and $\hat{r}(\bm{x};\bm{\alpha})$ as follows: \begin{equation} \label{eq:BR_Prime_div_DR} \begin{aligned} BR_f^\prime(\bm{\alpha}) = &\int{p_g(x)}\left[ f(r(\bm{x}))-f(\hat{r}(\bm{x};\bm{\alpha})) - \triangledown f(\hat{r}(\bm{x}))(r(\bm{x})\right.\\ &\quad\left. -\hat{r}(\bm{x};\bm{\alpha})) \right]d\bm{x}\\ =&\quad C+BR_f(\bm{\alpha}), \end{aligned} \end{equation} where $C=\int p_g(\bm{x})f(r(\bm{x}))d\bm{x}$ does not depend on $\hat{r}(\bm{x};\bm{\alpha})$ and \begin{equation} \label{eq:BR_div_DR} \begin{aligned} BR_f(\bm{\alpha}) &= \int p_g(\bm{x})\triangledown f(\hat{r}(\bm{x};\bm{\alpha}))\hat{r}(\bm{x};\bm{\alpha})d\bm{x} \\ &- \int p_g(\bm{x})f(\hat{r}(\bm{x};\bm{\alpha}))d\bm{x} - \int p_r(\bm{x})\triangledown f(\hat{r}(\bm{x};\bm{\alpha})) d\bm{x}. \end{aligned} \end{equation} An empirical approximation to $BR_f(\bm{\alpha})$ is \begin{equation} \label{eq:BR_div_DR_emp} \begin{aligned} \widehat{BR}_f(\bm{\alpha}) &= \frac{1}{n_g}\sum_{i=1}^{n_g}\triangledown f(\hat{r}(\bm{x}_i^g;\bm{\alpha}))\hat{r}(\bm{x}_i^g;\bm{\alpha}) \\ &- \frac{1}{n_g}\sum_{i=1}^{n_g}f(\hat{r}(\bm{x}_i^g;\bm{\alpha})) - \frac{1}{n_r}\sum_{i=1}^{n_r}\triangledown f(\hat{r}(\bm{x}_i^r;\bm{\alpha})). \end{aligned} \end{equation} With $f$ appropriately chosen, $\widehat{BR}_f(\bm{\alpha})$ can be used as a loss function to fit $\hat{r}(\bm{x};\bm{\alpha})$. For example, the uLSIF loss \eqref{eq:uLSIF_loss} is a special case of Eq.\eqref{eq:BR_div_DR_emp} when $f(t) = 0.5(t-1)^2$. \section{Method}\label{sec:method} \subsection{Softplus Loss Function for Density Ratio Estimation}\label{sec:SP_loss} Motivated by the two shortcomings of uLSIF \eqref{eq:uLSIF_loss}, DSKL \eqref{eq:DSKL} and BARR \eqref{eq:BARR}, we propose a novel loss function called Softplus (SP) loss for density ratio estimation with neural networks. The SP loss is a special case of $BR_f(\bm{\alpha})$ in \eqref{eq:BR_div_DR} when $f(t)$ is the softplus function \begin{equation} \label{eq:softplus_function} \eta(t)=\ln(1+e^t). \end{equation} The derivative of the softplus function $\eta(t)$ is the sigmoid function \begin{equation} \label{eq:sigmoid_function} \sigma(t)=\frac{e^t}{1+e^t}. \end{equation} The second derivative of $\eta(t)$ is $\sigma(t)(1-\sigma(t))$ which is positive so the softplus function is strictly convex. Then, the SP loss and its empirical approximation are defined as \begin{equation} \label{eq:SP_loss} \begin{aligned} SP(\bm{\alpha}) &= \int \sigma(\hat{r}(\bm{x};\bm{\alpha}))\hat{r}(\bm{x};\bm{\alpha})p_g(\bm{x})d\bm{x}\\ &-\int \eta(\hat{r}(\bm{x}))p_g(\bm{x})d\bm{x}-\int \sigma(\hat{r}(\bm{x};\bm{\alpha}))p_r(\bm{x})d\bm{x}, \end{aligned} \end{equation} and \begin{equation} \label{eq:SP_loss_emp} \begin{aligned} \widehat{SP}(\bm{\alpha})&=\frac{1}{n_g}\sum_{i=1}^{n_g}\sigma(\hat{r}(\bm{x}_i^g;\bm{\alpha}))\hat{r}(\bm{x}_i^g;\bm{\alpha}) \\ &\quad- \frac{1}{n_g}\sum_{i=1}^{n_g}\eta(\hat{r}(\bm{x}_i^g;\bm{\alpha}))-\frac{1}{n_r}\sum_{i=1}^{n_r}\sigma(\hat{r}(\bm{x}_i^r;\bm{\alpha}))\\ &=\frac{1}{n_g}\sum_{i=1}^{n_g}\left[\sigma(\hat{r}(\bm{x}_i^g;\bm{\alpha}))\hat{r}(\bm{x}_i^g;\bm{\alpha}) - \eta(\hat{r}(\bm{x}_i^g;\bm{\alpha})) \right]\\ &\quad-\frac{1}{n_r}\sum_{i=1}^{n_r}\sigma(\hat{r}(\bm{x}_i^r;\bm{\alpha})), \end{aligned} \end{equation} where $\hat{r}(\bm{x};\bm{\alpha})$ is the density ratio model in Eq. \eqref{eq:r_hat}. \begin{theorem}\label{thm:SP_bound} The empirical SP loss \eqref{eq:SP_loss_emp} is bounded from below, i.e., $\widehat{SP}(\bm{\alpha}) > -\ln 2 -1$. \end{theorem} \begin{proof} We define \begin{equation*} g(t) =\sigma(t)\cdot t-\eta(t)= e^t\cdot t \cdot (1+e^t)^{-1}-\ln(1+e^t),\quad t\geq 0. \end{equation*} Since $g^\prime(t) = e^t\cdot t \cdot (1+e^t)^{-2}>0$ when $t\geq 0$, $g(t)$ is monotonically increasing on its domain and $\min_tg(t)=g(0)=-\ln2$. Moreover, $\sigma(t)$ is lower bounded by -1. Therefore, the empirical SP loss has a lower bound, i.e., $\widehat{SP}(\bm{\alpha}) > -\ln 2 -1$. \end{proof} Then we propose to train the density ratio model $\hat{r}(\bm{x};\bm{\alpha})$ by minimizing the following penalized SP loss: \begin{equation} \label{eq:penalized_SP} \min_{\bm{\alpha}} \left\{\widehat{SP}(\bm{\alpha}) + \lambda \hat{Q}(\bm{\alpha})\right\}, \end{equation} where $\hat{Q}(\bm{\alpha})$ is defined in Eq.\eqref{eq:penalty_hat} and $\lambda$ (a hyper-parameter) controls the penalty strength. Now the penalty term may take effect if a proper $\lambda$ is chosen. {\setlength{\parindent}{0cm} \textbf{Hyperparameter Selection.}} To select the optimal hyperparameter $\lambda^*$, we evaluate a trained density ratio model $\hat{r}(\bm{x};\bm{\alpha})$ on $n_r$ real images which are used for training and $n_v$ hold-out real images $\{\bm{x}_1^v,\cdots,\bm{x}_{n_v}^v\}$ separately. Then we have two sets of density ratios: $\{\hat{r}(\bm{x}_1^r;\bm{\alpha}),\cdots,\hat{r}(\bm{x}_{n_r}^r;\bm{\alpha})\}$ and $\{\hat{r}(\bm{x}_1^v;\bm{\alpha}),\cdots,\hat{r}(\bm{x}_{n_v}^v;\bm{\alpha})\}$. If the model does not overfit the training images, these two sets should have similar distributions. We use the two-sample Kolmogorov-Smirnov (KS) test statistic \cite{Chakravarti1967KStest} to quantify the divergence between these two distributions. The optimal hyperparameter $\lambda^*$ is selected to minimize this KS test statistic. Other metrics (e.g., Kullback–Leibler (KL) divergence \cite{van2014renyi}) may also be useful for the hyperparameter selection. \subsection{Rate of Convergence}\label{sec:convergence} In this section, we derive the rate of convergence of a density ratio model trained with our proposed Softplus loss under the Bregman divergence in the GAN setting (i.e., $n_g$ is large enough). Let $\mathcal{H}=\{h\in\mathcal{H}: \bm{x}\mapsto h(\bm{x}) \}$ denote the set of potential functions that can be represented by the density ratio model $\hat{r}(\bm{x},\bm{\alpha})$ (i.e., the \textit{Hypothesis Space}). Also let $\sigma \circ\mathcal{H}=\{h\in\mathcal{H}: \bm{x}\mapsto\sigma(h(\bm{x})) \}$, where $\sigma$ is the Sigmoid function. \begin{lemma} \label{lem:Rademacher_complexity_SP} Let $\hat{\mathcal{R}}_{p_r,n_r}(\mathcal{H})$ and $\hat{\mathcal{R}}_{p_r,n_r}(\sigma\circ\mathcal{H})$ denote the empirical Rademacher complexities of $\mathcal{H}$ and $\sigma\circ\mathcal{H}$ respectively, where $\hat{\mathcal{R}}_{p_r,n_r}(\mathcal{H})$ and $\hat{\mathcal{R}}_{p_r,n_r}(\sigma\circ\mathcal{H})$ are defined based on independent samples $\{\bm{x}_1,\cdots,\bm{x}_{n_r}\}$ from $p_r(\bm{x})$. The following inequality holds: \begin{equation*} \hat{\mathcal{R}}_{p_r,n_r}(\sigma\circ\mathcal{H})\leq \frac{1}{4}\hat{\mathcal{R}}_{p_r,n_r}(\mathcal{H}), \end{equation*} where \begin{equation*} \begin{aligned} \hat{\mathcal{R}}_{p_r,n_r}(\mathcal{H})&=\mathbb{E}_\rho\left\{\sup_{h\in\mathcal{H}}\left|\frac{1}{n_r}\sum_{i=1}^{n_r}\rho_ih(\bm{x}_i^r) \right| \right\}, \\ \hat{\mathcal{R}}_{p_r,n_r}(\sigma\circ\mathcal{H})&=\mathbb{E}_\rho\left\{\sup_{h\in\mathcal{H}}\left|\frac{1}{n_r}\sum_{i=1}^{n_r}\rho_i\sigma(h(\bm{x}_i^r)) \right| \right\}, \end{aligned} \end{equation*} and $\rho_1,\cdots,\rho_{n_r}$ are independent Rademacher random variables whose distribution is $P(\rho_i=1)=P(\rho_i=-1)=0.5$. \end{lemma} \begin{proof} Since the Sigmoid function $\sigma$ is $\frac{1}{4}$-Lipschitz continuous, the inequality can be obtained by applying Talagrand's Lemma (Lemma 4.2 in \cite{foundation_ml}). \end{proof} \begin{theorem}[Rademacher Bound] \label{thm:Rademacher_bound} If a hypothesis space $\mathcal{H}$ is a class of functions $h$ such that $0\leq h(\bm{x})\leq1$, then for $\forall\delta\in(0,1)$ with probability at least $1-\delta$, \begin{equation} \label{eq:Rademacher_bound} \sup_{h\in\mathcal{H}}\left|\mathbb{E}_{\bm{x}\sim p}h(\bm{x})-\frac{1}{n}\sum_{i=1}^nh(\bm{x}_i)\right|\leq 2\hat{\mathcal{R}}_{p,n}(\mathcal{H})+\sqrt{\frac{4}{n}\log\left(\frac{2}{\delta}\right)}, \end{equation} where the $\bm{x}_i$'s are independently drawn from a distribution $p$ and $\hat{\mathcal{R}}_{p,n}(\mathcal{H})$ is the empirical Rademacher complexity of the hypothesis space $\mathcal{H}$ defined on these $n$ samples. \end{theorem} \begin{proof} The proof of Theorem \ref{thm:Rademacher_bound} can be found in \cite{lafferty2010}. \end{proof} Let $BR_f(h)$ be the Bregman divergence between the true density ratio function $r$ in Eq.\eqref{eq:relation_DR_Disc} and a function $h$ in the hypothesis space $\mathcal{H}$. Let $\widehat{BR}_f(h)$ be the empirical approximation of $BR_f(h)$. If $f$ is replaced by the Softplus function $\eta$, then \begin{equation} \begin{aligned} BR_f(h)&=\mathbb{E}_{\bm{x}\sim p_g(\bm{x})}\left[\sigma(h(\bm{x}))h(\bm{x})-\eta(h(\bm{x})) \right]\\ &\quad-\mathbb{E}_{\bm{x}\sim p_r(\bm{x})}\left[\sigma(h(\bm{x})) \right], \end{aligned} \end{equation} \begin{equation} \begin{aligned} \widehat{BR}_f(h)&=\frac{1}{n_g}\sum_{i=1}^{n_g}\left[\sigma(h(\bm{x}^g_i))h(\bm{x}^g_i)-\eta(h(\bm{x}^g_i)) \right]\\ &\quad-\frac{1}{n_r}\sum_{i=1}^{n_r}\sigma(h(\bm{x}^r_i)). \end{aligned} \end{equation} Note that the $BR_f(h)$ and $\widehat{BR}_f(h)$ are equivalent to Eq.\eqref{eq:SP_loss} and Eq.\eqref{eq:SP_loss_emp} respectively. For simplicity, we only consider the Softplus loss without a penalty term. \changes{Following the notation in Appendix D of \cite{uehara2016generative},} we define $r_0$ and $r_s$ as \begin{equation*} r_0=\arg\min_{h\in\mathcal{H}}BR_f(h), \quad r_s=\arg\min_{h\in\mathcal{H}}\widehat{BR}_f(h). \end{equation*} Note that $BR_f(h)$ reaches its minimum if and only if $h=r$ but $r$ may be not in $\mathcal{H}$. If $r\notin\mathcal{H}$, then $BR_f(r_0)-BR_f(r)$ is a positive constant; otherwise $BR_f(r_0)-BR_f(r)=0$. However, in practice, we can only optimize $\widehat{BR}_f(h)$ instead of $BR_f(h)$. Therefore, we are interested in the distance of $r_s$ from $r$ under the Bregman divergence, i.e., $BR_f(r_s)-BR_f(r)$. Before we introduce our main theorem for the rate of convergence, we need some more notation. Denote by $\mathcal{\bm{A}}$ the parameter space of the density ratio model $\hat{r}(\bm{x}_i^r;\bm{\alpha})$. Note that the hypothesis space $\mathcal{H}$ is determined by the parameter space $\mathcal{\bm{A}}$. Denote $\sigma(h(\bm{x}))h(\bm{x})-\eta(h(\bm{x}))$ by $g(\bm{x};\bm{\alpha})$. \begin{theorem} \label{thm:rate_of_convergence} If (i) the $f$ in the Bregman divergence is the Softplus function $\eta$ in \eqref{eq:softplus_function}, (ii) $n_g$ is large enough, (iii), $\mathcal{\bm{A}}$ is compact, (iv) $\forall g(\bm{x};\bm{\alpha})$ is continuous at $\bm{\alpha}$, (v) $\forall g(\bm{x};\bm{\alpha}), \exists $ a function $g^u(\bm{x})$ that does not depend on $\bm{\alpha}$, s.t. $|g(\bm{x};\bm{\alpha})|\leq g^u(\bm{x})$, and (vi) $\mathbbm{E}_{\bm{x}\sim p_g}g^u(\bm{x})<\infty$, then $\forall \delta\in(0,1)$ and $\forall \delta^\prime\in (0,\delta]$ with probability at least $1-\delta$, \begin{equation} \label{eq:rate_of_convergence} \begin{aligned} BR_f(r_s)-BR_f(r)&\leq \frac{1}{n_g}+\hat{\mathcal{R}}_{p_r,n_r}(\mathcal{H})+2\sqrt{\frac{4}{n_r}\log\left(\frac{2}{\delta^\prime}\right)}\\ &\quad+BR_f(r_0)-BR_f(r). \end{aligned} \end{equation} \end{theorem} \begin{proof} \changes{Following Eq.(11) of Appendix D in \cite{uehara2016generative},} we first decompose $BR_f(r_s)-BR_f(r)$ as follows \begin{equation} \label{eq:decompose_genearlization_gap} \begin{aligned} &BR_f(r_s)-BR_f(r) \\ = &BR_f(r_s)-\widehat{BR}_f(r_s)+\widehat{BR}_f(r_s)-BR_f(r_0)\\ &\quad+BR_f(r_0)-BR_f(r)\\ \leq& \left|BR_f(r_s)-\widehat{BR}_f(r_s)\right|+\left|\widehat{BR}_f(r_s)-BR_f(r_0)\right|\\ &\quad+BR_f(r_0)-BR_f(r)\\ \leq& 2\sup_{h\in\mathcal{H}}|BR_f(h)-\widehat{BR}_f(h)|+BR_f(r_0)-BR_f(r).\\ \end{aligned} \end{equation} The second term in Eq.\eqref{eq:decompose_genearlization_gap} is a constant so we just need to bound the first term, and if $f=\eta$, the first term can be further decomposed with an upper bound as follows \begin{equation*} \begin{aligned} &\sup_{h\in\mathcal{H}}\left|BR_f(h)-\widehat{BR}_f(h)\right|\\ \leq&\sup_{h\in\mathcal{H}}\left|\mathbb{E}_{\bm{x}\sim p_g(\bm{x})}\left[\sigma(h(\bm{x}))h(\bm{x})-\eta(h(\bm{x})) \right] \vphantom{\sum_{i=1}^{n_g}} \right. \\ &\quad\left.- \frac{1}{n_g}\sum_{i=1}^{n_g}\left[\sigma(h(\bm{x}^g_i))h(\bm{x}^g_i)-\eta(h(\bm{x}^g_i)) \right]\right|\\ &\quad+\sup_{h\in\mathcal{H}}\left| \mathbb{E}_{\bm{x}\sim p_r(\bm{x})}\left[\sigma(h(\bm{x})) \right]- \frac{1}{n_r}\sum_{i=1}^{n_r}\sigma(h(\bm{x}^r_i))\right|. \end{aligned} \end{equation*} Since $\mathcal{\bm{A}}$ is compact, $g(\bm{x};\bm{\alpha})$ is continuous at $\bm{\alpha}$, $|g(\bm{x};\bm{\alpha})|\leq g^u(\bm{x})$, and $\mathbbm{E}_{\bm{x}\sim p_g}g^u(\bm{x})<\infty$, based on the uniform law of large numbers \cite{noteULLN, jennrich1969asymptotic}, for $\forall \epsilon>0$, \begin{equation*} \begin{aligned} \lim_{n_g\rightarrow\infty}&P\left\{\sup_{h\in\mathcal{H}}\left|\mathbb{E}_{\bm{x}\sim p_g(\bm{x})}\left[\sigma(h(\bm{x}))h(\bm{x})-\eta(h(\bm{x})) \right] \vphantom{\sum_{i=1}^{n_g}}\right.\right.\\ &\quad\left.\left.- \frac{1}{n_g}\sum_{i=1}^{n_g}\left[\sigma(h(\bm{x}^g_i))h(\bm{x}^g_i)-\eta(h(\bm{x}^g_i)) \right]\right|>\epsilon \right\}=0. \end{aligned} \end{equation*} Since $n_g$ is large enough, let $\epsilon={1}/{2n_g}$, $\forall \delta_1\in(0,1)$ with probability at least $1-\delta_1$, whereupon \begin{equation} \label{eq:first_bound} \begin{aligned} \sup_{h\in\mathcal{H}}&\left|\mathbb{E}_{\bm{x}\sim p_g(\bm{x})}\left[\sigma(h(\bm{x}))h(\bm{x})-\eta(h(\bm{x})) \right]\vphantom{\sum_{i=1}^{n_g}}\right. \\ &\left.- \frac{1}{n_g}\sum_{i=1}^{n_g}\left[\sigma(h(\bm{x}^g_i))h(\bm{x}^g_i)-\eta(h(\bm{x}^g_i)) \right]\right|\leq \frac{1}{2n_g}. \end{aligned} \end{equation} Moreover, based on Theorem \ref{thm:Rademacher_bound} and Lemma \ref{lem:Rademacher_complexity_SP}, $\forall \delta_2\in(0,1)$ with probability at least $1-\delta_2$, \begin{equation} \label{eq:second_bound} \begin{aligned} &\sup_{h\in\mathcal{H}}\left| \mathbb{E}_{\bm{x}\sim p_r(\bm{x})}\left[\sigma(h(\bm{x})) \right]- \frac{1}{n_r}\sum_{i=1}^{n_r}\sigma(h(\bm{x}^r_i))\right|\\ \leq& 2\hat{\mathcal{R}}_{p_r,n_r}(\sigma\circ\mathcal{H})+\sqrt{\frac{4}{n_r}\log\left(\frac{2}{\delta_2} \right)}\\ \leq&\frac{1}{2}\hat{\mathcal{R}}_{p_r,n_r}(\mathcal{H})+\sqrt{\frac{4}{n_r}\log\left(\frac{2}{\delta_2} \right)}. \end{aligned} \end{equation} With $\delta=\max\{\delta_1,\delta_2 \}$ and $\delta^\prime=\delta_2$, combining Eq.\eqref{eq:first_bound} and Eq.\eqref{eq:second_bound} leads to the upper bound in Theorem \ref{thm:rate_of_convergence}. \end{proof} \begin{remark} If $f(t)=0.5(t-1)^2$, then $BR_f(h)$ is the uLSIF loss. In this case, \cite{uehara2016generative} gives an upper bound for $BR_f(r_s)-BR_f(r)$ and at least one term in this upper bound is proportional to a constant $M$ (\cite{uehara2016generative} assumes all elements in $\mathcal{H}$ are bounded by $M$). However, in real practice, $M$ may be quite large so the upper bound provided by \cite{uehara2016generative} may be too loose, which helps explain why the SP loss outperforms the uLSIF loss in our experiments. \end{remark} \begin{remark} The $\hat{\mathcal{R}}_{p_r,n_r}(\mathcal{H})$ term on the right hand side of the inequality \eqref{eq:rate_of_convergence} implies we should not use a density ratio model that is too complex. Therefore, we propose to estimate the density ratio by a simple multilayer perceptron in the feature space learned by a pre-trained deep CNN in Section \ref{sec:DRE-F}. \end{remark} \subsection{Density Ratio Estimation in Feature Space}\label{sec:DRE-F} In this section, we propose a novel density ratio estimation method called \textit{density ratio estimation in feature space under Softplus loss} (DRE-F-SP). Assume we have $n_r$ real images $\bm{x}_1^r, \bm{x}_2^r, \cdots, \bm{x}_{n_r}^r \sim p_r(\bm{x}),$ and $n_g$ fake images $\bm{x}_1^g, \bm{x}_2^g, \cdots, \bm{x}_{n_g}^g \sim p_g(\bm{x}).$ The distributions $p_r(\bm{x})$ and $p_g(\bm{x})$ are both unknown. Rather than estimating density ratios in the pixel space \cite{nam2015direct, khan2019deep} (the density ratio model $\hat{r}(\bm{x};\bm{\alpha})$ directly maps an image to its density ratio) or using the property of a well-trained GAN model \cite{azadi2018discriminator, turner2018metropolis}, we model the true density ratio function via a small-scale \textit{multilayer perceptron} (MLP) in a feature space learned by a pre-trained deep CNN. This deep CNN takes an image as input and outputs a class label. The architecture of this CNN is specially designed to let one of its hidden layers output a feature map $\bm{y}$ that has the same dimension as the input $\bm{x}$. In our experiment, we build such a CNN by adding an extra fully connected layer which can output such feature map $\bm{y}$ on top of all convolutional layers of the ResNet-34 \cite{he2016deep}. We train this specially designed ResNet-34 on a set of labelled samples with the cross-entropy loss. Denote the fully connected layer which is used to output the feature map $\bm{y}$ and other layers before it in this pre-trained ResNet-34 as $\phi(\bm{x})$, then $\phi$ defines a mapping of a raw image $\bm{x}$ in the pixel space $\mathcal{X}$ to a high-level feature $\bm{y}$ in the feature space $\mathcal{Y}$, i.e, \begin{equation} \label{eq:pre_trained_CNN} \bm{y}=\phi(\bm{x}). \end{equation} In the remainder of this paper, we simply call $\phi(\bm{x})$ ResNet-34. We define $q_r$ and $q_g$ as the distribution of real and fake features respectively. Since $\mathcal{X}$ and $\mathcal{Y}$ have the same dimension, the Jacobian matrix ${\partial \bm{y}}/{\partial \bm{x}}$ is a square matrix and the relationship between the distributions of $\bm{x}$ and $\bm{y}$ can be summarized as follows: \begin{equation*} p_r(\bm{x}) = q_r(\bm{y})\cdot\left\|\frac{\partial \bm{y}}{\partial \bm{x}}\right\|,\quad p_g(\bm{x}) = q_g(\bm{y})\cdot\left\|\frac{\partial \bm{y}}{\partial \bm{x}}\right\|, \end{equation*} where $\left\|\frac{\partial \bm{y}}{\partial \bm{x}}\right\|$ is the absolute value of the Jacobian determinant \changes{and assumed to be positive}. Then the true density ratio function $r(\bm{x})$ can be equivalently expressed in the features space via \begin{equation} \label{eq:DR_F} \psi(\phi(\bm{x}))=\psi(\bm{y})= \frac{q_r(\bm{y})}{q_g(\bm{y})}=\frac{q_r(\bm{y})\cdot \left\|\frac{\partial \bm{y}}{\partial \bm{x}}\right\|}{q_g(\bm{y})\cdot \left\|\frac{\partial \bm{y}}{\partial \bm{x}}\right\|}=\frac{p_r(\bm{x})}{p_g(\bm{x})}=r(\bm{x}), \end{equation} where $\psi(\bm{y})$ denotes the true density ratio function in the feature space. Note that the Jacobian determinant is cancelled so we only need to model the density ratio function $\psi(\bm{y})$ in the feature space. We propose to model $\psi(\bm{y})$ by a 5-layer multilayer perceptron $\hat{\psi}(\bm{y};\bm{\beta})$ with a learnable parameter $\bm{\beta}$, and $\hat{\psi}(\bm{y};\bm{\beta})$ is trained by minimizing the following penalized SP loss: \begin{equation} \label{eq:DRE_F_SP} \begin{aligned} &\min_{\bm{\beta}} \left\{\widehat{SP}(\bm{\beta}) + \lambda \hat{Q}(\bm{\beta})\right\}\\ =&\min_{\bm{\beta}}\left\{\frac{1}{n_g}\sum_{i=1}^{n_g}\left[\sigma(\hat{\psi}(\bm{y}_i^g;\bm{\beta}))\hat{\psi}(\bm{y}_i^g;\bm{\beta}) - \eta(\hat{\psi}(\bm{y}_i^g;\bm{\beta})) \right]\right.\\ &-\frac{1}{n_r}\sum_{i=1}^{n_r}\sigma(\hat{\psi}(\bm{y}_i^r;\bm{\beta})) \left. + \lambda \left(\frac{1}{n_g}\sum_{i=1}^{n_g}\hat{\psi}(\bm{y}_i^g;\bm{\beta})-1 \right)^2 \right\}. \end{aligned} \end{equation} Eq.\eqref{eq:DRE_F_SP} is adapted from Eq.\eqref{eq:SP_loss_emp} by replacing $\hat{r}(\bm{x};\bm{\alpha})$ with $\hat{\psi}(\bm{y};\bm{\beta})$. Then $\hat{\psi}(\bm{y};\bm{\beta})$ can be seen as a density ratio model in the feature space, and $\hat{\psi}(\phi(\bm{x});\bm{\beta})$ can be seen as a density ratio model in the pixel space. Their workflows are visualized in Fig. \ref{fig:digram_DRE_DR}. We implement DRE-F-SP by Alg. \ref{alg:DRE-F-SP}. \changes{ \begin{remark} \label{remark:CNN_in_feature_space} The density ratio model in the feature space is not necessarily a MLP. It can be another small-scale neural network such as a CNN as long as its complexity is moderate. \end{remark} } \begin{figure*}[h] \centering \includegraphics[width=0.80\textwidth, height=6.2cm]{./Diagram_DRE_DR.jpg} \caption{The workflow of our proposed density ratio model $\hat{\psi}(\bm{y};\beta)$ in the feature space in Eq.\eqref{eq:DRE_F_SP}. The composition of $\hat{\psi}$ and $\phi$ leads to the density ratio model $\hat{\psi}(\phi(\bm{x});\beta)$ in the pixel space. The pre-trained ResNet-34 $\phi(\bm{x})$ \eqref{eq:pre_trained_CNN} takes an image $\bm{x}$ as input and outputs a feature map $\bm{y}$ from the fully-connected layer fc 1. If we flatten the image $\bm{x}$, then $\text{flat}(\bm{x})$ and $\bm{y}$ are two $CHW\times 1$ vectors, where $C$, $H$ and $W$ denote the number of channels, height and width of the image $\bm{x}$. } \label{fig:digram_DRE_DR} \end{figure*} \begin{algorithm}[h] \footnotesize \SetAlgoLined \KwData{$n_r$ real samples $\{\bm{x}^r_1,\cdots,\bm{x}^r_{n_r}\}$, a generator $G$, a pre-trained CNN $\phi(\bm{x})$ \eqref{eq:pre_trained_CNN}, a untrained MLP $\hat{\psi}(\bm{y};\bm{\beta})$ in \eqref{eq:DRE_F_SP} and a preset hyperparameter $\lambda$} \KwResult{a trained density ratio model $\hat{r}(\bm{x})=\hat{\psi}(\phi(\bm{x});\bm{\beta})=\hat{\psi}(\bm{y};\bm{\beta})$ } Initialize $\bm{\beta}$\; \For{$k=1$ \KwTo $K$}{ Sample a mini-batch of $m$ real samples $\bm{x}^r_{(1)},\cdots,\bm{x}^r_{(m)}$ from $\{\bm{x}^r_1,\cdots,\bm{x}^r_{n_r}\}$\; Sample a mini-batch of $m$ fake samples $\bm{x}^g_{(1)},\cdots,\bm{x}^g_{(m)}$ from $G$\; Update $\bm{\beta}$ via the SGD or its variants with the gradient of Eq.\eqref{eq:DRE_F_SP} \begin{equation*} \begin{aligned} &\frac{\partial}{\partial\bm{\beta}} \left\{\frac{1}{m}\sum_{i=1}^{m}\left[\sigma(\hat{\psi}(\phi(\bm{x}_{(i)}^g);\bm{\beta}))\hat{\psi}(\phi(\bm{x}_{(i)}^g);\bm{\beta}) - \eta(\hat{\psi}(\phi(\bm{x}_{(i)}^g);\bm{\beta})) \right] \right.\\ &\quad\left. -\frac{1}{m}\sum_{i=1}^{m}\sigma(\hat{\psi}(\phi(\bm{x}_{(i)}^r);\bm{\beta})) + \lambda \left(\frac{1}{m}\sum_{i=1}^{m}\hat{\psi}(\phi(\bm{x}_{(i)}^g);\bm{\beta})-1 \right)^2\right\} \end{aligned} \end{equation*} } \caption{Density Ratio Estimation in the Feature Space Under Penalized SP Loss (DRE-F-SP)} \label{alg:DRE-F-SP} \end{algorithm} \subsection{Application of DRE-F-SP in Subsampling GANs}\label{sec:DRE-F-SP_Sampling} Fig. \ref{fig:digram_DRE_sampler} describes the workflow of a density ratio based subsampling method for GANs. Each density ratio based subsampling method consists of two components: a DRE method and a sampler. DRE methods can be as proposed in \cite{azadi2018discriminator, turner2018metropolis, nam2015direct, khan2019deep, grover2019bias} or our DRE-F-SP. A sampler here is a density ratio based sampling scheme such as the rejection sampling scheme (RS sampler) in DRS, the Metropolis-Hastings algorithm (MH sampler) in MH-GAN and the sampling-importance resampling scheme (SIR sampler) in Section \ref{sec:SIR}. Moreover, a neural network based DRE method can also be decomposed into two components: a density ratio model and a loss function. For example, our DRE-F-SP uses the composition of a pre-trained ResNet-34 and a 5-layer MLP as the density ratio model and trains the density ratio model with the SP loss. We propose three density ratio based subsampling methods for GANs, which are called DRE-F-SP+RS, DRE-F-SP+MH, and DRE-F-SP+SIR, respectively. These three methods utilize the same DRE method (i.e., DRE-F-SP) but three different samplers (i.e., RS, MH, and SIR). We provide three corresponding algorithms Alg. \ref{alg:DRE-F-SP+RS}--\ref{alg:DRE-F-SP+SIR} to implement them. In some scenarios, the RS sampler and MH sampler suffer from low acceptance rates, and consequently they may take a very long time. The SIR sampler does not suffer from this problem, so it is more efficient than the RS and MH samplers, but the SIR sampler may perform poorly if we subsample from a small pool of fake images. \begin{figure*}[h] \centering \includegraphics[width=0.90\textwidth]{./Diagram_DRE_Sampler.jpg} \caption{Workflow of density ratio based subsampling for GANs.} \label{fig:digram_DRE_sampler} \end{figure*} \begin{algorithm}[h] \footnotesize \SetAlgoLined \KwData{a generator $G$, a trained CNN $\phi(\bm{x})$ \eqref{eq:pre_trained_CNN}, a trained MLP $\hat{\psi}(\bm{y};\bm{\beta})$ in \eqref{eq:DRE_F_SP}} \KwResult{$images=\{N\text{ filtered images from }G\}$} Generate $N^\prime$ fake images from $G$\; Estimate the density ratios of these $N^\prime$ fake images by evaluating $\hat{\psi}(\phi(\bm{x});\bm{\beta})$\; $M\leftarrow\max\{N^\prime \text{ estimated density ratios}\}$\; $images\leftarrow \emptyset$\; \While{$|images|<N$}{ $\bm{x}\leftarrow \text{get a fake image from }G$\; $ratio\leftarrow \hat{\psi}(\phi(\bm{x});\bm{\beta})$\; $M\leftarrow\text{max}\{M,ratio\}$\; $p\leftarrow ratio/M$ (based on Eq.\eqref{eq:RS_accept_prob})\; $u\leftarrow \text{Uniform}(0,1)$\; \If{$u\leq p$}{ $\text{Append}(\bm{x}, images)$\; } } \caption{DRE-F-SP+RS} \label{alg:DRE-F-SP+RS} \end{algorithm} \begin{algorithm}[h] \footnotesize \SetAlgoLined \KwData{a generator $G$, a trained CNN $\phi(\bm{x})$ \eqref{eq:pre_trained_CNN}, a trained MLP $\hat{\psi}(\bm{y};\bm{\beta})$ in \eqref{eq:DRE_F_SP}, real images} \KwResult{$images=\{N\text{ filtered images from }G\}$} $images\leftarrow \emptyset$\; \While{$|images|<N$}{ $\bm{x}\leftarrow\text{a real image}$\; \For{$i=1$ \KwTo $K$}{ $\bm{x}^\prime\leftarrow \text{get a fake image from }G$\; $u\leftarrow \text{Uniform}(0,1)$\; $p=\min\left(1,\frac{\hat{\psi}(\phi(\bm{x}^\prime);\bm{\beta})}{\hat{\psi}(\phi(\bm{x});\bm{\beta})}\right)$ (based on Eq.\eqref{eq:MH_accept_prob})\; \If{$u\leq p$}{ $\bm{x}\leftarrow \bm{x}^\prime$\; } } \If{$\bm{x}$ is not a real image}{ $\text{Append}(\bm{x}, images)$\; } } \caption{DRE-F-SP+MH} \label{alg:DRE-F-SP+MH} \end{algorithm} \begin{algorithm}[h] \footnotesize \SetAlgoLined \KwData{a generator $G$, a trained CNN $\phi(\bm{x})$ \eqref{eq:pre_trained_CNN}, a trained MLP $\hat{\psi}(\bm{y};\bm{\beta})$ in \eqref{eq:DRE_F_SP}} \KwResult{$images=\{N\text{ filtered images from }G\}$} Generate a pool of $N_p$ samples $\{\bm{x}^g_1,\cdots,\bm{x}^g_{N_p}\}$ from $G$\; Compute $N_p$ normalized importance weights $\{w_1,\cdots,w_{N_p}\}$ for these fake samples via $$w_i=\frac{\hat{\psi}(\phi(\bm{x}_i^g);\bm{\beta})}{\sum_{i=1}^n\hat{\psi}(\phi(\bm{x}_i^g);\bm{\beta})};$$ $images\leftarrow \emptyset$\; \While{$|images|<N$}{ Sample an integer $j$ from $\{1,2,\cdots,N_p\}$ where $j$ is drawn with probabability $w_j$\; $\text{Append}(\bm{x}^g_j, images)$\; } \caption{DRE-F-SP+SIR} \label{alg:DRE-F-SP+SIR} \end{algorithm} \section{Experiment}\label{sec:experiment} In this section, our main objective is to justify that DRE-F-SP+RS, DRE-F-SP+MH, and DRE-F-SP+SIR perform better than DRS and MH-GAN for subsampling GANs. Hence, we conduct experiments on a synthetic dataset and a real dataset---CIFAR-10 \cite{krizhevsky2009learning}. We also conduct several ablation studies to empirically demonstrate that the power of three proposed subsampling methods comes from the novel Softplus loss and the scheme of estimating density ratio in the feature space. \changes{Besides the experiments reported here, the results of some extra experiments on the synthetic dataset, CIFAR-10 \cite{krizhevsky2009learning}, MNIST \cite{lecun1998gradient} and CelebA \cite{liu2015faceattributes} are shown in the supplemental material.} \subsection{Mixture of 25 2-D Gaussians}\label{sec:exp_simulation} We first test the performance of our proposed subsampling methods on synthetic data generated from a mixture of 25 two-dimensional Gaussians (the 25 mixture components have equal weights). This mixture model is used as a toy example in \cite{azadi2018discriminator, turner2018metropolis} and is very popular in the GAN literature. {\setlength{\parindent}{0cm}\textbf{Experimental setup of the main study:}} The means of these 25 Gaussians are arranged on a 2-D grid $\bm{\mu}\in\{-2,-1,0,1,2\}\times\{-2,-1,0,1,2\}$ and the common covariance matrix is set to $\sigma\bm{I}_{2\times 2}$, where $\sigma=0.05$. From this mixture model, we generate 50,000 training samples, 50,000 validation samples and 10,000 test samples. Following \cite{azadi2018discriminator, turner2018metropolis}, we train a GAN model with the standard loss \eqref{eq:standard_gan_loss} on the training set. Both the generator and discriminator in this GAN consist of four fully connected layers with ReLU activation functions, and all hidden layers have size 100. The last layer of the discriminator is a Sigmoid function, and the noise $\bm{z}\in\mathbbm{R}^2$ fed into the generator is drawn from a 2-D Gaussian with mean 0 and standard deviation 1. We deliberately train the generator and discriminator for only 50 epochs to prevent them from reaching optimality, so density ratio estimation in terms of Eq.\eqref{eq:relation_DR_Disc} is not reliable. When implementing DRS, we follow the setting in \cite{azadi2018discriminator} and set $\gamma$ dynamically for each batch of fake samples drawn from the GAN to the $95$th percentile of $F(\bm{x})$ in Eq.\eqref{eq:DRS_F_hat} for each $\bm{x}$ in this batch. We also keep training the discriminator on the validation set for another 20 epochs to further improve performance of the DRS. When implementing MH-GAN \cite{turner2018metropolis}, we calibrate the trained discriminator on the validation set with logistic regression and set the MCMC iteration $K$ to 100 (more iterations do not show significant improvement). In our proposed sampling method, at the density ratio estimation stage, we use a 5-layer MLP as the density ratio model $\hat{r}(\bm{x};\bm{\alpha})$ in Eq.\eqref{eq:SP_loss_emp} to directly map a sample to its density ratio without a pre-trained CNN since our synthetic data are not images; its architecture is shown in Supp. \ref{appendix:Sim_nets}. The 5-layer MLP is trained with our proposed penalized SP loss \eqref{eq:penalized_SP}. To select the optimal $\lambda$, we generate a grid of values between 0 and 0.1 and select the one which minimizes the KS test statistic on the validation set (shown in Table \ref{tab:sim_parameter_selection} of the supplemental material). To show the superiority of our proposed SP loss, we also train the 5-layer MLP with the uLSIF \cite{nam2015direct}, DSKL, and BARR \cite{khan2019deep} losses. Following the setting in \cite{khan2019deep}, the $\lambda$ in BARR is set to 10. At the sampling stage, all three samplers---RS, MH, and SIR---are considered. The number of burn-in samples $N^\prime$ for RS in Alg.\ref{alg:DRE-F-SP+RS} is 50,000. The MCMC iterations $K$ for MH in Alg.\ref{alg:DRE-F-SP+MH} is set to 100. The pool size $N_p$ for SIR in Alg.\ref{alg:DRE-F-SP+SIR} is set to 20,000. We subsample 10,000 fake samples from the trained GAN with each method, and the quality of these fake samples is evaluated. We repeat the whole experiment (i.e., data generation, GAN training, MLP training, subsampling) three times and report in Table \ref{tab:results_simulation_main} the average quality of 10,000 fake samples from each subsampling method over the three repetitions. {\setlength{\parindent}{0cm}\textbf{Experimental setup of an ablation study:}} To evaluate the effectiveness of the SP loss, we conduct an ablation study by training the 5-layer MLP in DRE-F-SP with other losses: uLSIF \cite{nam2015direct}, DSKL \cite{khan2019deep}, and BARR \cite{khan2019deep}. We subsample 10,000 fake samples under different losses and three samplers and evaluate the quality of these samples. Similar to the main study, we repeat the whole setting three times and report in Table \ref{tab:results_simulation_different_loss} the average quality of 10,000 fake samples under each loss and each sampler. {\setlength{\parindent}{0cm}\textbf{Evaluation metrics:}} To measure performance, following \cite{azadi2018discriminator, turner2018metropolis}, we assign each fake sample to its closest mixture component. A fake sample is defined as ``high-quality" if its Euclidean distance to the mean of its mixture component is smaller than $4\sigma=0.2$. Also, we define that a mode (i.e., a mixture component) is recovered if at least one ``high-quality" fake sample is assigned to it. For each sampling method in the main study and the ablation study, we report in Tables \ref{tab:results_simulation_main} and \ref{tab:results_simulation_different_loss} the average percentage of high-quality samples and the average percentage of recovered modes. {\setlength{\parindent}{0cm}\textbf{Quantitative results:}} From Table \ref{tab:results_simulation_main}, we can see that three proposed sampling methods almost perfectly correct the sampling bias of the imperfect generator and significantly outperform DRS and MH-GAN without trading off mode coverage for quality. Table \ref{tab:results_simulation_different_loss} shows that the power of three proposed sampling methods comes from the novel SP loss. \begin{table}[htbp] \centering \scriptsize \caption{Average quality of 10,000 fake synthetic samples from different subsampling methods over three repetitions. Higher \% high-quality samples and higher \% recovered modes are better. Each setting is repeated three times, and we report the averaged \% high-quality samples and averaged \% recovered modes. The optimal $\lambda^*$ in each round is shown in Table \ref{tab:sim_parameter_selection}.} \begin{tabular}{cccc} \toprule & No Subsampling & DRS \cite{azadi2018discriminator} & MH-GAN \cite{turner2018metropolis} \\ \midrule \% High Quality & $69.8\pm 15.4$ & $96.3\pm 1.3$ & $89.7\pm 5.3$ \\ \% Rec. Modes & $100.0\pm 0.0$ & $100.0\pm 0.0$ & $100.0\pm 0.0$ \\ \bottomrule & DRE-F-SP+RS & DRE-F-SP+MH & DRE-F-SP+SIR \\ \midrule \% High Quality & $\bm{99.1\pm 0.5}$ & $\bm{99.2\pm 0.5}$ & $\bm{99.2\pm 0.4}$ \\ \% Rec. Modes & $100.0\pm 0.0$ & $100.0\pm 0.0$ & $100.0\pm 0.0$ \\ \bottomrule \end{tabular}% \label{tab:results_simulation_main}% \end{table}% \begin{table}[htbp] \centering \scriptsize \caption{Ablation study on synthetic data. We train the 5-layer MLP with different loss functions. Each setting is repeated three times, and we report the averaged \% high-quality samples and averaged \% recovered modes.} \begin{tabular}{ccccc} \toprule & \multicolumn{4}{c}{RS} \\ \cline{2-5} & uLSIF \cite{nam2015direct} & DSKL \cite{khan2019deep} & BARR \cite{khan2019deep} & SP \\ \midrule \% High Quality & $89.7\pm 2.4$ & $66.4\pm 7.6$ & $71.9\pm 14.9$ & $\bm{99.1\pm 0.5}$ \\ \% Rec. Modes & $100.0\pm 0.0$ & $42.7\pm 5.0$ & $100.0\pm 0.0$ & $100.0\pm 0.0$ \\ \midrule & \multicolumn{4}{c}{MH} \\ \cline{2-5} & uLSIF \cite{nam2015direct} & DSKL \cite{khan2019deep} & BARR \cite{khan2019deep} & SP \\ \midrule \% High Quality & $89.6\pm 2.6$ & $66.3\pm 7.3$ & $72.1\pm 15.0$ & $\bm{99.2\pm 0.5}$ \\ \% Rec. Modes & $98.7\pm 1.9$ & $38.7\pm 5.0$ & $100.0\pm 0.0$ & $100.0\pm 0.0$ \\ \midrule & \multicolumn{4}{c}{SIR} \\ \cline{2-5} & uLSIF \cite{nam2015direct} & DSKL \cite{khan2019deep} & BARR \cite{khan2019deep} & SP \\ \midrule \% High Quality & $89.5\pm 2.3$ & $66.2\pm 7.8$ & $72.1\pm 15.1$ & $\bm{99.2\pm 0.4}$ \\ \% Rec. Modes & $98.7\pm 1.9$ & $40.0\pm 5.7$ & $100.0\pm 0.0$ & $100.0\pm 0.0$ \\ \bottomrule \end{tabular}% \label{tab:results_simulation_different_loss}% \end{table}% {\setlength{\parindent}{0cm}\textbf{Visual results:}} We visualize the first-round results of the main study in Fig. \ref{fig:sim_visual_results}. In Fig. \ref{fig:sim_visual_gan}, we can see that many samples directly drawn from the generator locate between two neighboring modes. Fig. \ref{fig:sim_visual_DRS} and \ref{fig:sim_visual_MHGAN} show that DRS and MH-GAN can remove some ``bad-quality" points, but many between-modes points still exist. Fig. \ref{fig:sim_visual_SP_RS} to \ref{fig:sim_visual_SP_SIR} show that fake samples from our proposed methods are close to their assigned mixture components where between-modes samples only account for a small portion. \begin{figure*}[h] \begin{minipage}[b]{.25\textwidth} \raisebox{+0.5\height}{\subfloat[][Real Samples]{\includegraphics[width=0.9\textwidth, height=4cm]{./real_samples.jpg}\label{fig:sim_visual_data}}} \end{minipage} \begin{minipage}[b]{.75\linewidth} \subfloat[][No subsampling]{\includegraphics[width=0.3\textwidth, height=4cm]{./GAN.jpg}\label{fig:sim_visual_gan}} \subfloat[][DRS \cite{azadi2018discriminator}]{\includegraphics[width=0.3\textwidth, height=4cm]{./DRS.jpg}\label{fig:sim_visual_DRS}} \subfloat[][MH-GAN \cite{turner2018metropolis}]{\includegraphics[width=0.3\textwidth, height=4cm]{./MH-GAN_cal.jpg}\label{fig:sim_visual_MHGAN}}\\ \subfloat[][DRE-F-SP+RS]{\includegraphics[width=0.3\textwidth, height=4cm]{./SP+RS.jpg}\label{fig:sim_visual_SP_RS}} \subfloat[][DRE-F-SP+MH]{\includegraphics[width=0.3\textwidth, height=4cm]{./SP+MH.jpg}\label{fig:sim_visual_SP_MH}} \subfloat[][DRE-F-SP+SIR]{\includegraphics[width=0.3\textwidth, height=4cm]{./SP+SIR.jpg}\label{fig:sim_visual_SP_SIR}} \end{minipage} \caption{Visual results of the 25 2-D Gaussians example. Each setting is repeated for three times and we visualize the results of the first round here. In each figure, blue dots denote 10,000 real samples in the test set and green dots denote 10,000 fake samples from each method. The GAN model is trained for only 50 epochs so the discriminator and generator do not reach their optimality. Thus many samples generated by this GAN shown in Fig. \ref{fig:sim_visual_gan} are between-modes. DRS and MH-GAN are effective but we still observe many between-modes samples in Fig. \ref{fig:sim_visual_DRS} and \ref{fig:sim_visual_MHGAN}. On the other hand, our proposed methods can nearly correct the bias in the generator and almost all generated samples in Fig. \ref{fig:sim_visual_SP_RS} to \ref{fig:sim_visual_SP_SIR} are ``high quality".} \label{fig:sim_visual_results} \end{figure*} {\setlength{\parindent}{0cm}\changes{\textbf{The superiority of the Softplus loss:}}} \changes{Besides the main study and the ablation study, we conduct an extra experiment to empirically show why the SP loss performs better than other loss functions such as the uLSIF loss. In this study, the 5-layer MLP as a density ratio model is trained for 5000 epochs with the penalized uLSIF loss \eqref{eq:optim_uLSIF_penlaty} and our penalized SP loss \eqref{eq:penalized_SP} respectively when $\lambda=0.05$. The initial learning rate is $10^{-3}$ and decayed every 1000 epochs with factor $0.1$ (see Supp. \ref{appendix:convergence_uLSIF_SP} for details). From Fig. \ref{fig:convergence_uLSIF} and \ref{fig:convergence_SP}, we can see the SP loss converges after 1000 epochs while the \textit{uLSIF loss does not stop decreasing until the 3000th epoch and then starts fluctuating over a large range}. The uLSIF loss stops decreasing because of a too small learning rate (Fig. \ref{fig:convergence_uLSIF_not_decay_lr} of the supplemental material shows the training curve of the 5-layer MLP under the uLSIF loss with a constant learning rate $10^{-5}$ where we can observe a constantly descending trend). We draw 10,000 fake samples from the trained GAN and evaluate the 5-layer MLP on the high and low quality fake samples separately. Fig. \ref{fig:dr_HQ_vs_epoch} and \ref{fig:dr_LQ_vs_epoch} show the average density ratios on high/low quality samples and the percentage high quality samples versus epoch. We estimate $p_g$ by a Gaussian mixture model \cite{reynolds2009gaussian} and $p_r$ is known so we can get the true density ratio function which is used to compute the ground truth. From Fig. \ref{fig:dr_HQ_vs_epoch}, when using the SP loss, the average density ratio of high quality samples is slightly above the ground truth and does not decrease over epochs. \textit{This implies the SP loss does not overfit the training data and the penalty term takes effect.} Note that the SP loss may overfit training data if $\lambda=0$; see Supp.\ref{appendix:convergence_uLSIF_SP} for details. In contrast, when using uLSIF loss, the average density ratio of high quality samples decreases after around 900 epochs and is always below the ground truth implying that the \textit{uLSIF loss overfits the training data and the penalty term does not effectively control its unboundedness}. Fig. \ref{fig:dr_LQ_vs_epoch} shows that the uLSIF loss tends to overestimate the density ratios of low quality samples while the SP loss performs optimally. The underestimation and overestimation of the uLSIF loss results in a small difference between high and low quality samples from the density ratio perspective and makes it difficult for the subsequent sampler to distinguish between high and low quality samples. These findings explain why SP loss outperforms uLSIF loss when subsampling.} \begin{figure*}[ht] \centering \subfloat[][Penalized uLSIF loss \eqref{eq:optim_uLSIF_penlaty}]{ \includegraphics[width=0.48\textwidth, height=5cm]{./training_loss_uLSIF.jpg} \label{fig:convergence_uLSIF}} \subfloat[][Penalized Softplus loss (ours) \eqref{eq:penalized_SP}]{ \includegraphics[width=0.48\textwidth, height=5cm]{./training_loss_SP.jpg} \label{fig:convergence_SP}} \caption{Training curves of a 5-layer MLP under the penalized uLSIF loss \eqref{eq:optim_uLSIF_penlaty} and the penalized SP loss \eqref{eq:penalized_SP} when $\lambda=0.05$ in the 25 2-D Gaussians example.} \label{fig:convergence_uLSIF_SP} \end{figure*} \begin{figure*}[ht] \centering \subfloat[][Average density ratio (solid lines) of \textit{high quality} fake samples and \% high quality samples (dotted lines) versus epoch of DRE training.]{ \includegraphics[width=0.48\textwidth, height=5.5cm]{./dr_versus_epochs_HQ_fake_samples_lambda0.05.jpg} \label{fig:dr_HQ_vs_epoch}} \subfloat[][Average density ratio (solid lines) of \textit{low quality} fake samples and \% high quality samples (dotted lines) versus epoch of DRE training.]{ \includegraphics[width=0.48\textwidth, height=5.5cm]{./dr_versus_epochs_LQ_fake_samples_lambda0.05.jpg} \label{fig:dr_LQ_vs_epoch}} \caption{The density ratio estimation and subsampling performance of a 5-layer MLP trained under the penalized uLSIF loss \eqref{eq:optim_uLSIF_penlaty} and the penalized SP loss \eqref{eq:penalized_SP} when $\lambda=0.05$ in the 25 2-D Gaussians example. The grey lines stand for the ground truth average density ratios.} \label{fig:dre_subsampling_uLSIF_SP} \end{figure*} \subsection{CIFAR-10 Dataset}\label{sec:exp_cifar10} In this section, our main study is to empirically show the superiority of our approach to DRS \cite{azadi2018discriminator} and MH-GAN \cite{turner2018metropolis} in subsampling DCGAN \cite{radford2015unsupervised}, WGAN-GP \cite{gulrajani2017improved}, and MMD-GAN \cite{li2017mmd} trained on the CIFAR-10 \cite{krizhevsky2009learning} dataset. We also conduct two extra ablation studies to investigate the reason behind the efficacy of our approach. {\setlength{\parindent}{0cm}\textbf{Experimental setup of the main study:}} The CIFAR-10 dataset consists of 60,000 $32\times 32$ RGB images which are classified into 10 classes. The dataset is split into a training set of 50,000 images with 5000 per class and a validation set of 10,000 images with 1000 per class. GANs are trained with network architectures and training setups shown in Supp. \ref{appendix:cifar10_nets}. We use DRE-F-SP+RS, DRE-F-SP+MH, and DRE-F-SP+SIR to subsample 50,000 fake images from a trained GAN. At density ratio estimation stage, we train a ResNet-34 \cite{he2016deep} on the training set with a modified architecture shown in Supp. \ref{appendix:cifar10_nets} where we incorporate an extra fully connected layer to output a feature map with dimension $(32\times 32\times 3)\times 1=3072\times 1$. A 5-layer MLP is used as the density ratio model $\hat{\psi}(\bm{y};\bm{\beta})$ in Eq.\eqref{eq:DRE_F_SP} to map the extracted features of an image to its density ratio, which is trained with the penalized SP loss \eqref{eq:penalized_SP} on the training set and fake images from the trained GAN. Detailed training setups of the ResNet-34 and the 5-layer MLP are described in Supp. \ref{appendix:cifar10_training_setups}. We conduct hyperparameter selection on a grid of values from 0 to 0.1 on the validation set (shown in Table \ref{tab:cifar10_hyperparameter_selection} of the supplemental material). At the sampling stage, the number of burn-in samples $N^\prime$ for RS in Alg.\ref{alg:DRE-F-SP+RS} is set to 50,000; the MCMC iterations $K$ for MH in Alg.\ref{alg:DRE-F-SP+MH} is set to 640; the pool size $N_p$ for SIR in Alg.\ref{alg:DRE-F-SP+SIR} is set to 100,000. We consider three competitors: no subsampling, DRS \cite{azadi2018discriminator} and MH-GAN \cite{turner2018metropolis}. We use each subsampling method to draw 50,000 fake images from a trained GAN. No subsampling refers to directly sampling from a generator. When implementing DRS, following the setting of \cite{azadi2018discriminator} on ImageNet dataset, we set $\gamma$ dynamically for each batch of fake samples drawn from the GAN to the $80$th percentile of the $F(\bm{x})$ in Eq.\eqref{eq:DRS_F_hat} for each $\bm{x}$ in this batch. Continuing to train the discriminator on the validation set does not improve the performance of DRS, so we do not conduct ``keep training". Since the discriminator of WGAN-GP outputs a class score instead of a probability, we apply the calibration technique in MH-GAN \cite{turner2018metropolis} to calibrate the trained discriminator on the validation set with logistic regression to let it output class probabilities. When implementing MH-GAN, following \cite{turner2018metropolis}, the MCMC iteration $K$ is set to 640. Note that, as we mentioned in Section \ref{sec:DRS_and_MH-GAN}, DRS and MH-GAN cannot be applied to MMD-GAN. In the main study, we subsample 50,000 fake images with each subsampling method from each GAN three times. The average quality of 50,000 fake images of each method over three repetitions is reported in Table \ref{tab:results_cifar10_main}. Note that, in real data analysis, we only repeat subsampling three times, but train each GAN and each density ratio model only once. {\setlength{\parindent}{0cm}\textbf{Experimental setup of two ablation studies:}} The first ablation study aims at justifying the effectiveness of our proposed DRE-F-SP in subsampling three types of GANs. We consider four other density ratio estimation methods for images in the comparison: DRE-P-uLSIF \cite{nam2015direct}, DRE-P-DSKL \cite{khan2019deep}, DRE-P-BARR \cite{khan2019deep} and BOC \cite{grover2019bias}. The architectures of the 2-layer CNN for DRE-P-uLSIF and the 6-layer CNN for DRE-P-DSKL and DRE-P-BARR are shown in Supp. \ref{appendix:cifar10_nets}. When implementing BOC, we train a CNN as the Bayes optimal classifier with the architecture proposed in \cite{grover2019bias} and shown in Supp. \ref{appendix:cifar10_nets} on 10,000 hold-out validation images and 10,000 fake images. We attach a RS sampler to these DRE methods and conduct the same three repetitions of the main study. We report in Table \ref{tab:results_cifar10_DRE_compare} the average quality of 50,000 fake images for different DRE methods over three repetitions. The second ablation study focuses on researching the effect of different loss functions on the final subsampling performance. We replace the SP loss in DRE-F-SP with other loss functions---uLSIF \cite{nam2015direct}, DSKL \cite{khan2019deep} and BARR \cite{khan2019deep}---while using the same RS sampler and the same 5-layer MLP. The average quality of 50,000 fake images for each loss over three repetitions is shown in Table \ref{tab:results_cifar10_loss_compare}. {\setlength{\parindent}{0cm}\textbf{Evaluation metrics:}} We evaluate the quality of fake images from different subsampling methods by \textit{Inception Score} (IS) \cite{salimans2016improved} and \textit{Fr\'echet Inception Distance} (FID) \cite{heusel2017gans}. They are two popular evaluation metrics for GANs; see Supp. \ref{appendix:IS_FID} for more details. Larger IS and smaller FID are better. {\setlength{\parindent}{0cm}\textbf{Quantitative results:}} Table \ref{tab:results_cifar10_main} shows the results of the main study and demonstrates our approaches significantly outperform other existing subsampling methods and can also dramatically improve MMD-GAN, where DRS and MH-GAN are not applicable. Table \ref{tab:results_cifar10_DRE_compare} shows the results of ablation study 1. Four existing DRE methods for images are applied in this case, but they are incapable of improving any GAN model, let alone outperforming DRE-F-SP. This ablation study demonstrates that the effectiveness of the three proposed subsampling methods results from our proposed density ratio estimation method---DRE-F-SP. Table \ref{tab:results_cifar10_loss_compare} shows the results of the ablation study 2 and demonstrates the novel SP loss plays a crucial role in the success of the density ratio estimation in the feature space. {\setlength{\parindent}{0cm}\textbf{Visual results:}} We also show in Fig. \ref{fig:cifar_visual_results_dcgan} to \ref{fig:cifar_visual_results_mmdgan} of Supp. \ref{appendix:cifar10_visual_results} some example images from each subsampling method in the main study. \begin{table}[htbp] \centering \footnotesize \caption{Average quality of 50,000 fake CIFAR-10 images from different subsampling methods over three repetitions. We draw 50,000 fake images by each method on which we compute the IS and FID. We repeat this sampling three times and report the average IS and FID. Higher IS and lower FID are better. A grid search is conducted for DRE-F-SP to select the hyperparameter, and the results under the optimal $\lambda^*$ are shown in this table. We include the IS and FID of 50,000 training data and 10,000 test data as a reference.} \begin{tabular}{lll} \toprule Method & IS (mean$\pm$std) & FID (mean$\pm$std) \\ \midrule \textbf{- Real Data -} & & \\ 50,000 Training Data & 9.984 & --- \\ 10,000 Test Data & 9.462 & 0.134 \\ \midrule \textbf{- DCGAN -} & & \\ No Subsampling & $6.261\pm 0.003$ & $3.006\pm 0.011$ \\ DRS \cite{azadi2018discriminator} & $6.385\pm 0.004$ & $2.930\pm 0.008$ \\ MH-GAN \cite{turner2018metropolis} & $6.300\pm 0.010$ & $2.982\pm 0.009$ \\ DRE-F-SP+RS ($\lambda^*=0$) & $\bm{8.597\pm 0.011}$ & $\bm{1.664\pm 0.007}$ \\ DRE-F-SP+MH ($\lambda^*=0$) & $\bm{8.588\pm 0.007}$ & $\bm{1.669\pm 0.004}$ \\ DRE-F-SP+SIR ($\lambda^*=0$) & $\bm{8.572\pm 0.021}$ & $\bm{1.685\pm 0.027}$ \\ \midrule \textbf{- WGAN-GP -} & & \\ No Subsampling & $6.445\pm 0.015$ & $2.944\pm 0.004$ \\ DRS \cite{azadi2018discriminator} & $6.427\pm 0.012$ & $2.947\pm 0.013$ \\ MH-GAN \cite{turner2018metropolis} & $6.428\pm 0.021$ & $2.948\pm 0.014$ \\ DRE-F-SP+RS ($\lambda^*=0.005$) & $\bm{8.625\pm 0.013}$ & $\bm{1.774\pm 0.011}$ \\ DRE-F-SP+MH ($\lambda^*=0.005$) & $\bm{8.606\pm 0.013}$ & $\bm{1.796\pm 0.014}$ \\ DRE-F-SP+SIR ($\lambda^*=0.005$) & $\bm{8.605\pm 0.043}$ & $\bm{1.826\pm 0.030}$ \\ \midrule \textbf{- MMD-GAN -} & & \\ No Subsampling & $5.508\pm 0.016$ & $3.682\pm 0.007$ \\ DRS \cite{azadi2018discriminator} & --- & --- \\ MH-GAN \cite{turner2018metropolis} & --- & --- \\ DRE-F-SP+RS ($\lambda^*=0.006$) & $\bm{7.800\pm 0.012}$ & $\bm{2.471\pm 0.017}$ \\ DRE-F-SP+MH ($\lambda^*=0.006$) & $\bm{7.782\pm 0.008}$ & $\bm{2.469\pm 0.007}$ \\ DRE-F-SP+SIR ($\lambda^*=0.006$) & $\bm{7.740\pm 0.017}$ & $\bm{2.525\pm 0.045}$ \\ \bottomrule \end{tabular}% \label{tab:results_cifar10_main}% \end{table}% \begin{table}[htbp] \centering \footnotesize \caption{Ablation study 1 on CIFAR-10. The average quality of 50,000 fake CIFAR-10 images from subsampling methods with different DRE methods but the same RS sampler over three repetitions.} \begin{tabular}{lll} \toprule Method & IS (mean$\pm$std) & FID (mean$\pm$std) \\ \midrule \textbf{- DCGAN -} & & \\ DRE-P-uLSIF \cite{nam2015direct} & $6.340\pm 0.005$ & $2.773\pm 0.004$ \\ DRE-P-DSKL \cite{khan2019deep} & $5.584\pm 0.015$ & $3.986\pm 0.008$ \\ DRE-P-BARR \cite{khan2019deep} & $6.191\pm 0.002$ & $3.156\pm 0.013$ \\ BOC \cite{grover2019bias} & $6.259\pm 0.005$ & $3.003\pm 0.003$ \\ DRE-F-SP & $\bm{8.597\pm 0.011}$ & $\bm{1.664\pm 0.007}$ \\ \midrule \textbf{- WGAN-GP -} & & \\ DRE-P-uLSIF \cite{nam2015direct} & $6.418\pm 0.008$ & $2.897\pm 0.007$ \\ DRE-P-DSKL \cite{khan2019deep} & $6.274\pm 0.010$ & $2.998\pm 0.003$ \\ DRE-P-BARR \cite{khan2019deep} & $6.427\pm 0.006$ & $2.945\pm 0.005$ \\ BOC \cite{grover2019bias} & $6.431\pm 0.022$ & $2.953\pm 0.007$ \\ DRE-F-SP & $\bm{8.625\pm 0.013}$ & $\bm{1.774\pm 0.011}$ \\ \midrule \textbf{- MMD-GAN -} & & \\ DRE-P-uLSIF \cite{nam2015direct} & $5.427\pm 0.007$ & $3.776\pm 0.004$ \\ DRE-P-DSKL \cite{khan2019deep} & $5.473\pm 0.002$ & $3.668\pm 0.008$ \\ DRE-P-BARR \cite{khan2019deep} & $5.465\pm 0.008$ & $3.733\pm 0.000$ \\ BOC \cite{grover2019bias} & $5.384\pm 0.013$ & $3.884\pm 0.006$ \\ DRE-F-SP & $\bm{7.800\pm 0.012}$ & $\bm{2.471\pm 0.017}$ \\ \bottomrule \end{tabular}% \label{tab:results_cifar10_DRE_compare}% \end{table}% \begin{table}[htbp] \centering \footnotesize \caption{Ablation study 2 on CIFAR-10. The average quality of 50,000 fake CIFAR-10 images from subsampling methods with different loss functions but the same DR model and RS sampler over three repetitions.} \begin{tabular}{lll} \toprule Method & IS (mean$\pm$std) & FID (mean$\pm$std) \\ \midrule \textbf{- DCGAN -} & & \\ uLSIF \cite{nam2015direct} & $8.036\pm 0.007$ & $2.194\pm 0.018$ \\ DSKL \cite{khan2019deep} & $6.619\pm 0.010$ & $2.736\pm 0.004$ \\ BARR \cite{khan2019deep} & $6.910\pm 0.005$ & $2.582\pm 0.006$ \\ SP & $\bm{8.597\pm 0.011}$ & $\bm{1.664\pm 0.007}$ \\ \midrule \textbf{- WGAN-GP -} & & \\ uLSIF \cite{nam2015direct} & $8.435\pm 0.006$ & $1.943\pm 0.020$ \\ DSKL \cite{khan2019deep} & $5.941\pm 0.003$ & $3.623\pm 0.005$ \\ BARR \cite{khan2019deep} & $6.966\pm 0.009$ & $2.528\pm 0.010$ \\ SP & $\bm{8.625\pm 0.013}$ & $\bm{1.774\pm 0.011}$ \\ \midrule \textbf{- MMD-GAN -} & & \\ uLSIF \cite{nam2015direct} & $7.760\pm 0.017$ & $2.503\pm 0.017$ \\ DSKL \cite{khan2019deep} & $5.590\pm 0.005$ & $3.765\pm 0.003$ \\ BARR \cite{khan2019deep} & $5.763\pm 0.008$ & $3.488\pm 0.005$ \\ SP & $\bm{7.800\pm 0.012}$ & $\bm{2.471\pm 0.017}$ \\ \bottomrule \end{tabular}% \label{tab:results_cifar10_loss_compare}% \end{table}% \section{Conclusion}\label{sec:discussion} We propose a novel subsampling framework (including DRE-F-SP+RS, DRE-F-SP+MH, and DRE-F-SP+SIR) for GANs to replace DRS \cite{azadi2018discriminator} and MH-GAN \cite{turner2018metropolis}. In this framework, a novel SP loss function is proposed for density ratio estimation, and its rate of convergence is determined theoretically with respect to training size. Based on the SP loss, we further propose to do density ratio estimation in the feature space learned by a specially designed ResNet-34. We demonstrate the efficiency of the overall framework on a 25 2-D Gaussians example and the CIFAR-10 dataset. Experimental results show that our proposed framework can dramatically improve different types of GANs and substantially outperform DRS and MH-GAN. Our approach can also improve GANs (e.g., MMD-GAN), where DRS and MH-GAN are not applicable. \bibliographystyle{IEEEtran}
\section{Introduction} The multi-agent framework has been used to model swarming or collective behavior in a number of applications. Those include animal herding or flocking \cite{PhysRevLett.96.104302,Camazine_etal,CFTVreview,HCH,lukeman}, cell movement \cite{HP,PBSG,Pbook}, cell adhesion \cite{GC,BDZ,BCDPZ}, alloy clustering \cite{nano1}, opinion formation \cite{DMPW}, robotics \cite{TFYE}, among others. Controlling these collective-behavior models, both at the microscopic and macroscopic levels, has recently become a very popular research direction \cite{CFPT13,FoSo,CFPT15,BFK,FPR,PRT,ACFK}. Of particular interest is the mean-field limit of a system of $N$-agents interacting through a potential $W$ in presence of Gaussian noise. It leads to the control problem of a density $\rho$ solving an aggregation-diffusion equation of the form: \begin{equation}\label{Eq.control} \begin{cases} \frac{\partial \rho}{\partial t}=\div\left( (\nabla W\star \rho)\rho+F\rho\right)+\Delta \rho& \;\;\;\;\;\mbox{in}\;\;\;\;\;{\mathbb{T}}^d\times(0,\infty)\\ \rho(x, 0)=\rho_0(x)&\;\;\;\;\;\mbox{in}\;\;\;\;\;{\mathbb{T}}^d \end{cases} \end{equation} where the control $F$ is chosen to minimize the functional: \begin{equation}\label{eq_control1} \inf_{\rho, F}\left\{E(F)+\int_{{\mathbb{T}}^d}\phi_T(x)\rho(x,T) dx\right\} \end{equation} with \begin{equation}\label{eq_control2} E(F)=\int_0^T\!\!\!\int_{{\mathbb{T}}^d}\left[L(x,\rho)+\frac{|F|^2} 2\right]\rho dx dt. \end{equation} A distinctive feature in \eqref{Eq.control} regards the drift term. In addition to the optimal control component $F$, it depends on $\rho$ itself through the interactions driven by $W$. Perhaps more involving is the fact that such a dependence is nonlocal; this character of the drift term poses important mathematical difficulties to the program developed in this paper. Typical potentials used in applications are radially symmetric $W(x)=w(|x|)$ in the whole space chosen to be repulsive in the short range and attractive in the long range. Some examples include the Morse or power-law potentials \[ w(r)=-C_Ae^{-\frac{r}{l_A}}+C_Re^{-\frac {r}{l_R}} \] or \[ w(r)=\frac{r^a}{a}- \frac{r^b}{b}\,, \] for well-prepared parameters $Cl^d<1$, with $C:=C_A/C_R$ and $l:=l_A/l_R$, and $a>b>-d$ respectively. See \cite{PhysRevLett.96.104302,predict,CHM} and the references therein. Many other biological applications use finite range potentials, i.e. compactly supported, but with local behaviors near the origin, similar to the Morse or power-laws potentials above. We refer the reader to \cite{CP,BDZ,BCDPZ,CCS}, to name just a few. Notice that these potentials can be used in the periodic setting $x\in{\mathbb{T}}^d$, see \cite{CP,BDZ,BCDPZ}. The optimal control problem in \eqref{eq_control1}-\eqref{eq_control2} can be written as \[ \inf_{\rho, F\in \eqref{Eq.control}}\sup_{\phi}\left\{E(F)+\int_{{\mathbb{T}}^d}\phi_T(x)\rho(x,T) dx- \int_{0}^{T}\!\!\!\int_{{\mathbb{T}}^d}\phi\left[\frac{\partial \rho}{\partial t}-\div\left( (\nabla W\star \rho)\rho+F\rho\right)-\Delta \rho\right]\right\}, \] reminiscent of optimal transport problems \cite{Bre}. By changing the order of the infimum and the supremum, we obtain the dual problem \[ \sup_{\phi}\inf_{(\rho, F)\in \eqref{Eq.control}}\left\{ \int_0^T\!\!\!\int_{{\mathbb{T}}^d}\left[L(x,\rho)+\frac{|F|^2} 2+\frac{\partial \phi}{\partial t}-(\nabla W\star \rho)\cdot \nabla \phi-F\cdot \nabla \phi+\Delta\phi\right]\rho(x,t) dx dt\right\}. \] At least heuristically, this optimization problem leads to a system of PDEs of the form \begin{equation}\label{Eq.main-secondorder} \begin{cases} \displaystyle -\phi_t+\frac{|\nabla \phi|^2}{2}+(\nabla W\star \rho)\cdot \nabla \phi+\nabla W\star (\rho \nabla \phi)-U(x,\rho)=\Delta \phi&\;\;\;\mbox{in}\;\;\;{\mathbb{T}}^d\times(0,T)\\[2mm] \displaystyle \rho_t=\div\left( (\nabla W\star \rho)\rho+\rho\nabla \phi\right)+\Delta\rho&\;\;\;\mbox{in}\;\;\;{\mathbb{T}}^d\times(0,T)\\[2mm] \phi(x,T)=\phi_T(x),\, \rho(x,0)=\rho_0(x)&\;\;\;\mbox{in}\;\;\;{\mathbb{T}}^d, \end{cases} \end{equation} where $U(x,\rho)=L(x,\rho)+\frac{\delta L}{\delta \rho}(x,\rho)\rho$, $F=-\nabla\phi$, and $$ \nabla W\star (\rho \nabla \phi) = \sum_{i=1}^d \frac{\partial W}{\partial x_i}\star \left(\rho \frac{\partial \phi}{\partial x_i}\right). $$ It is worthy noticing that the system in \eqref{Eq.main-secondorder} can be regarded as a first order condition associated with \eqref{eq_control1}-\eqref{eq_control2}. These first-order optimality conditions were obtained both formally and rigorously in \cite{ACFK}. We pose the problem in the $d$-dimensional torus ${\mathbb{T}}^d$ to focus on the main difficulties related to the regularity of the Hamilton-Jacobi equation in the system \eqref{Eq.main-secondorder}. \begin{remark}\label{rem:convtor} Throughout the paper we use the convention to identify functions on the torus $\mathbb{T}^d$ with 1-periodic functions on the cube $Q^d=[-\frac 1 2, \frac 1 2]^d.$ Hence, since the function $|x|$ has periodic boundary data on that cube it can be considered as function on the torus, and therefore radial potentials can be considered in the torus as well. Furthermore, the convolution $\nabla W \star \rho$ is defined by: \[ \nabla W \star \rho(x):=\int_{Q^d} \nabla W(x-y)\rho(y) dy=\int_{Q^d} \nabla W(y)\rho(x-y) dy, \] where the values $\nabla W(x-y),\,\rho(x-y)$ are defined by periodicity. \end{remark} The contribution of the present paper concerns the existence and regularity of the solutions to \eqref{Eq.main-secondorder}. Our main result is the following: \begin{teo}[Existence of solutions] \label{teo-main} Let the following assumptions hold: \begin{enumerate} \item[{\bf (A1)}] Regularity of the potential: $W\in W^{2, \infty}({\mathbb{T}}^d)=C^{1,1}({\mathbb{T}}^d)$. \item[{\bf (A2)}] Regularity of the coupling: $U:{\mathbb{T}}^d\times L^2({\mathbb{T}}^d)\to {\mathbb{R}}$ is uniformly bounded in $x$ in $\mathcal{C}^2$ norm and continuous in $m$ in $L^2$ norm, i.e., there exists a constant $C>0$ such that \[ \|U(\cdot, m)\|_{\mathcal{C}^2},\ \|\phi_T\|_{\mathcal{C}^2}\leq C,\,\forall m\in L^2({\mathbb{T}}^d), \] for every $m \in L^2({\mathbb{T}}^d)$, and \[ |U(x,m_1)-U(x,m_2)|\leq C\|m_1-m_2\|_{L^2({\mathbb{T}}^d)}, \] for every $x\in {\mathbb{T}}^d\times(0,T)$ and for all $m_1,\,m_2\in L^2({\mathbb{T}}^d)$. \item[{\bf (A3)}] Initial-terminal boundary conditions: $\rho_0\in L^2({\mathbb{T}}^d)$ with $\int \rho_0=1$, $\rho_0\geq 0$, and $\phi_T\in\mathcal{C}^1({\mathbb{T}}^d)$. \end{enumerate} Then, there exists a solution $(\phi, \rho)$ to the optimal control system \eqref{Eq.main-secondorder} with $\rho\in L^\infty(0,T;L^2({\mathbb{T}}^d))$ and $\phi \in \mathcal{C}^{1,2}({\mathbb{T}}^d\times [0,T] )$. \end{teo} \begin{remark} Typical potentials with power law behavior satisfying our assumptions are $$W(x)\simeq\frac{|x|^a}a - \frac{|x|^b}{b}\text{, with }a, b\geq 2,$$ to be understood in the sense of Remark \ref{rem:convtor}. \end{remark} The system in \eqref{Eq.main-secondorder} relates to the mean-field games (MFG, for short) introduced by Jean-Michel Lasry and Pierre-Louis Lions \cite{ll1, ll2, ll3, ll4}, and, independently, by Minyi Huang, Roland P. Malham{\'e}, and Peter E. Caines \cite{Caines2,Caines1}. Indeed, it couples a Hamilton-Jacobi equation describing an optimization problem, with the Fokker-Planck equation accounting for the evolution of the population. An interesting feature of \eqref{Eq.main-secondorder} regards the lack of an adjoint structure, which yields further difficulties from the regularity viewpoint. In the recent years, the MFG theory developed in a number of directions. The existence and uniqueness of solutions is the topic of \cite{cgbt,cd2,CLLP,cllp13,cargra,pim4,pim2,pim3,marcir1,marcir2,marcir3,marcir4}, whereas the study of numerical methods is the object of \cite{achdou2013finite,MR2928376,CDY,DY}, to name just a few. In \cite{carpor,benone,bentwo,cardel1,delaruegalera,gangboswiech} the authors examine the master equation. Applications of the MFG framework to social sciences can be found in \cite{moll,bmoll1,bmoll2,bmoll3}. We also refer the reader to the monographs \cite{cardaliaguet,bensoussan,pim1} and the lists of references therein. An important toy-model in the context of time-dependent mean-field games has the form \begin{equation*} \begin{cases} -u_t-\nu\Delta u+H(D_xu, x, \theta)=0&\;\;\;\;\;\mbox{in}\;\;\;\;\;{\mathbb{T}}^d\times(0,T)\\ \theta_t -\nu\Delta \theta-\div(D_pH(D_xu, x, \theta)\theta)=0&\;\;\;\;\;\mbox{in}\;\;\;\;\;{\mathbb{T}}^d\times(0,T)\\ u(x, T)=\psi(x, \theta(T)),\quad \theta(x, 0)=\theta_0&\;\;\;\;\;\mbox{in}\;\;\;\;\;{\mathbb{T}}^d. \end{cases} \end{equation*} This class of systems consists of a Hamilton-Jacobi equation coupled with a Fokker-Plank equation; the latter is the formal adjoint, in the $L^2$-sense, of the linearization of the former one. This (adjoint) structure was exploited in proving the existence of classical solutions \cite{GPatVrt, GPM1, GM, PV15} through the so-called non-linear adjoint methods, introduced by L.C. Evans \cite{E3}. The system in \eqref{Eq.main-secondorder} does not present this adjoint structure because of the additional term $\nabla W\star (\rho \nabla \phi)$, which substantially complicates the arguments. However, the non-linear adjoint method is still useful in proving the Lipschitz continuity of a solution $\phi$ to the Hamilton-Jacobi equation in \eqref{Eq.main-secondorder}. The nonlocal interaction among agents affects the PDE system accounting for the optimality conditions of the model. Here, the drift term in the Fokker-Planck equation becomes nonlocal. A similar phenomenon takes place in the Hamilton-Jacobi counterpart of the system: the Hamiltonian becomes nonlocal \emph{with respect to the gradient of the solutions}. In this context, at least two genuine difficulties appear. First, the existence and uniqueness of the solutions to the Fokker-Planck equation becomes a nontrivial matter. Also the (uniform) compactness of the solutions to the Hamilton-Jacobi equation does not follow from the usual techniques. At first, one could resort to semiconvexity/semiconcavity properties to bypass this issue - however, we notice the equation falls short in preserving those conditions. To circumvent the first question, we resort to an argument in \cite{Por}, combined with a fixed-point strategy performed in an appropriate space of measures. As for the compactness for the solutions to the Hamilton-Jacobi, we reason through a nonlocal $L^p$-regularity theory, together with (compact) embedding results. We believe our techniques are flexible enough to produce information on a larger class of problems. The remainder of this article is structured as follows: in Section \ref{Sec:mainthm} we present a brief outline of the proof of Theorem \ref{teo-main}. Section \ref{sec_existfp} establishes the well-posedness for the Fokker-Planck equation in \eqref{Eq.main-secondorder}, whereas in Section \ref{Sec:Lip} we produce a number of a priori estimates for the solutions of the Hamilton-Jacobi. Finally, a section reporting the proof of Theorem \ref{teo-main} closes the paper. \section{Set up and outline of the proof}\label{Sec:mainthm} In what follows, let us introduce the general lines along which we establish Theorem \ref{teo-main}. Let us start with the definition of (weak) solution used in the paper. \begin{definition}[Weak solution]\label{def_solution} A pair $(\phi,\rho)$ is a solution to \eqref{Eq.main-secondorder} if \begin{enumerate} \item $\phi\in\mathcal{C}({\mathbb{T}^d}\times(0,T))$ satisfies the first equation in \eqref{Eq.main-secondorder} in the viscosity sense; \item $\rho\in L^\infty(0,T;L^2({\mathbb{T}^d}))$ satisfies the second equation in \eqref{Eq.main-secondorder} in the sense of distributions. \end{enumerate} \end{definition} Throughout the paper, we denote by $\mathcal{C}^{1,2}({\mathbb{T}^d}\times[0,T])$ the space of functions defined over ${\mathbb{T}^d}\times[0,T]$ that are of class $\mathcal{C}^1$ with respect to time and class $\mathcal{C}^2$ with respect to space. Similarly, for any $\alpha\in(0,1),$ $\mathcal{C}^{\alpha,1+\alpha}({\mathbb{T}^d}\times[0,T])$ stands for the functions that are $\alpha-$H\H older continuous in time, $\mathcal{C}^1$ with respect to space with $\alpha-$H\H older continuous derivative. We establish Theorem \ref{teo-main} by using a fixed-point argument. The argument starts by taking an element $\phi$ in $\mathcal{C}^{0,1}({\mathbb{T}}^d\times[0,T])$. To such a function $\phi\in\mathcal{C}^{0,1}({\mathbb{T}}^d\times[0,T])$, we can assign the unique weak solution $\rho\in L^\infty(0,T;L^2({\mathbb{T}^d}))$ to the Fokker-Planck equation \begin{equation}\label{Eq.rhophi} \frac{\partial \rho}{\partial t}=\div\left( (\nabla W\star \rho)\rho+\nabla \phi\,\rho\right)+\Delta \rho, \end{equation} equipped with initial condition $\rho(x,0)=\rho_0(x)$ in the $d$-dimensional torus. Then, standard results in the literature ensure the existence of a unique solution, $\Phi\in \mathcal{C}^{1,2}({\mathbb{T}}^d\times[0,T])$ to \begin{equation}\label{eq:HJB} \begin{cases} -\Phi_t+\frac{|\nabla\Phi|^2}{2}+(\nabla W\star \rho)\cdot \nabla \Phi+\nabla W\star (\rho \nabla \phi)=\Delta \Phi +U(x,\rho)&\;\;\mbox{in}\;\;{\mathbb{T}}^d\times(0,T)\\ \Phi(x,T)=\phi_T(x)&\;\;\mbox{in}\;\;{\mathbb{T}}^d\times(0,T); \end{cases} \end{equation} see, for instance, \cite[Section 3.2]{cardaliaguet}. This procedure induces a mapping $\phi\,\to\,\rho\,\to\,\Phi$, which we denote $$\mathcal{F}\,:\,\cap_{\alpha\in (0,1)}\mathcal{C}^{\alpha,1+\alpha}({\mathbb{T}^d}\times[0,T])\,\longrightarrow\, \cap_{\alpha\in (0,1)}\mathcal{C}^{\alpha,1+\alpha}({\mathbb{T}^d}\times[0,T]),$$ and define as \[ \mathcal{F}(\phi):=\Phi. \] To prove the existence of a solution $(\phi,\rho)$ to problem \eqref{Eq.main-secondorder} is tantamount to verify that the mapping $\mathcal{F}$ has a fixed point. To that end, we start with the definition of an appropriate subset $\mathcal{K}_{\alpha}\subset \mathcal{C}^{\alpha,1+\alpha}({\mathbb{T}}^d\times[0,T])$. For some constants $A$, $B$, and $C>0$ to be determined further, we define \[ \mathcal{K}_{\alpha}=\left\{\phi\in\mathcal{C}^{\alpha,1+\alpha}({\mathbb{T}^d}\times[0,T])\,|\, \left\|\Phi\right\|_{\mathcal{C}^{\alpha,1+\alpha}}\leq C \mbox{ and } \|\Phi(\cdot,t)\|_{Lip}\leq Ae^{B(T-t)}\right\}. \] \begin{remark} We remark here that the set $\mathcal{K}_{\alpha}$ is nonempty, since for any smooth function $\phi$ appropriately rescaled $\phi(\lambda x, \lambda t)$ is in $\mathcal{K}_{\alpha}$. Furthermore, the set of smooth function $\mathcal{C}^{\infty}({\mathbb{T}^d}\times[0,T])$ is dense in $\mathcal{K}_{\alpha}$, this can be proved by a simple mollification argument. \end{remark} The first step towards the proof of Theorem \ref{teo-main} is a result on the well-posedness for the Fokker-Planck equation in \eqref{Eq.main-secondorder}. \begin{proposition}[Well-posedness for the Fokker-Planck equation]\label{prop_fpeu} Suppose the assumptions {\rm\bf (A1)-(A3)} hold and $\phi\in\mathcal{K}_{\alpha}$ is fixed. Then, there exists a unique solution to \eqref{eq_fp1}. \end{proposition} Once the existence and uniqueness for the Fokker-Planck equation \eqref{eq_fp1} is assured, we turn our attention to the compactness of the solutions to the Hamilton-Jacobi equation \eqref{eq:HJB}. We proceed with the following proposition. \begin{proposition} \label{proposition.bounds} Let the assumptions {\rm\bf (A1)-(A3)} hold. Then, there exists a choice of constants $A$, $B$, $C$ depending only on $T$, $\phi_T$, $\rho_0$, $\|W\|_{W^{2,\infty}({\mathbb{T}}^d)}$ and $U$, such that for any $\phi\in \mathcal{C}({\mathbb{T}^d}\times[0,T])$, satisfying \[ |\phi(x, t)-\phi(y,t)|\leq Ae^{B(T-t)}|x-y|, \] we have \begin{equation}\label{phiset} \|\Phi(\cdot,t)\|_{Lip}\leq Ae^{B(T-t)},\;\;\;\|\Phi\|_{\infty}\leq C, \nonumber \end{equation} for every solution $\Phi$ to \eqref{eq:HJB}. \end{proposition} From now on, the set $\mathcal{K}_{\alpha}$ is defined with the constants $A$ and $B$ given by Proposition \ref{phiset}. We now turn to fix $C$. The $L^p$-regularity theory for the Hamilton-Jacobi equation is pivotal in proving uniform bounds for the solutions in appropriate H\"older spaces. This is the content of the next proposition. \begin{proposition}\label{proposition_c1alpha} Let $\Phi$ be a solution to \eqref{eq:HJB} corresponding to $\phi\in \mathcal{K}_{\alpha}$. Suppose the assumptions {\rm\bf (A1)-(A3)} hold true. Then, $\Phi\in\mathcal{C}^{\alpha,1+\alpha}(\mathbb{T}^d\times[0,T])$ for some $\alpha\in(0,1)$. Moreover, there exists $C>0$ depending solely on $T$, $\phi_T$, $\rho_0$, $\|W\|_{\mathcal{C}^2({\mathbb{T}}^d)}$ and $U$, such that \[ \left\|\Phi\right\|_{\mathcal{C}^{\alpha,1+\alpha}(\mathbb{T}^d\times[0,T])}\,\leq\,C. \] \end{proposition} From now on, the set $\mathcal{K}_{\alpha}$ is fixed with the definition of $C$ given in the previous proposition. We detail next the proof of Proposition \ref{prop_fpeu}. \section{Well-posedness for the Fokker-Planck equation}\label{sec_existfp} In this section, we prove Proposition \ref{prop_fpeu} on the existence and uniqueness of solutions to \begin{equation}\label{por1} \begin{cases} \rho_t\,=\,\div\left[\left(\left(\nabla W\star\rho\right)\,+\,\nabla \phi\right)\rho\right]\,+\,\Delta\rho&\;\;\;\;\;\mbox{in}\;\;\;\;\;\mathbb{T}^d\times[0,T]\\ \rho(x,0)\,=\,\rho_0(x)&\;\;\;\;\;\mbox{in}\;\;\;\;\;\mathbb{T}^d, \end{cases} \end{equation} provided $W$ and $\phi$ are well-prepared. We reason through a fixed-point argument; the next proposition details the functional space we work. Before proceeding let us recall the 1-Wasserstein metric on the space of probability measures $\mathcal{P}({\mathbb{T}}^d)$: \begin{definition}[Wasserstein metric] The $1$-Wasserstein metric between probability measures $\mu, \nu\in\mathcal{P}({\mathbb{T}}^d)$ is given by \[ d_1(\mu,\,\nu):=\inf_{\pi\in\Gamma(\mu,\,\nu)}\int_{{\mathbb{T}}^d\times{\mathbb{T}}^d}|x-y|d\pi(x,y), \] where $ \Gamma (\mu ,\nu )$ is the collection of all measures on ${\mathbb{T}}^d\times{\mathbb{T}}^d$ with marginals $ \mu $ and $\nu .$ \end{definition} Recall that the $d_1$ distance in bounded sets is the same as the bounded Lipschitz distance defined via duality with respect to Lipschitz functions, see \cite{Vil}. \begin{proposition}\label{prop_fp1}Define the function \[ N(t):=\int_{\mathbb{T}^d}\left|(\nabla W\star\mu)+\nabla \phi\right|^2d\mu(x,t). \] Take $C>0$ to be determined later. Set \[ \mathcal{M}:=\left\lbrace\mu\in\mathcal{C}([0,T],\mathcal{P}({\mathbb{T}}^d)):d_1(\mu(s),\mu(t))\leq C|t-s|^\frac{1}{2},\left\|N\right\|_{L^\infty([0,T])}\leq C \right\rbrace. \] Then, $\mathcal{M}$ is a convex and compact subset of $\mathcal{C}([0,T],\mathcal{P}({\mathbb{T}}^d))$. \end{proposition} The proof of the Proposition \ref{prop_fp1} follows along the same lines as in \cite[Lemma 5.7]{cardaliaguet}, except for minor modifications, and is omitted here. In what follows, we define a mapping $\mathcal{T}:\mathcal{C}([0,T],\mathcal{P}({\mathbb{T}}^d))\to\mathcal{C}([0,T],\mathcal{P}({\mathbb{T}}^d))$. Let $\phi\in\mathcal{K}_{\alpha}$ be fixed and take $\rho^0\in\mathcal{M}$. Solve \begin{equation}\label{eq_fp1} \rho_t\,=\,\div\left[\left(\left(\nabla W\star\rho^0\right)\,+\,\nabla \phi\right)\rho\right]\,+\,\Delta\rho\;\;\;\;\;\mbox{in}\;\;\;\;\;\mathbb{T}^d\times[0,T] \end{equation} equipped with initial condition $\rho(x,0)=\rho_0$. By \cite[Lemma 3.3]{cardaliaguet}, we know that there exists a solution $\rho^1$ to \eqref{eq_fp1}. Notice, that \[ \left|\left(\nabla W\star\rho^0\right)\,+\,\nabla \phi\right|^2\rho^1\,\in\,L^1(\mathbb{T}^d\times(0,T)). \] In fact, \[ \int_0^T\int_{\mathbb{T}^d}\left|\left(\nabla W\star\rho^0\right)\,+\,\nabla \phi\right|^2d\rho^1(x,t)\,\leq\,C(W,\phi,T). \] Therefore, it follows from \cite[Theorem 1.1]{Por} that \eqref{eq_fp1} has at most one solution, which is precisely $\rho^1$. As a consequence, we define \begin{equation}\label{eq_fp2} \mathcal{T}(\rho^0)\,:=\,\rho^1. \end{equation} Next we examine properties of the mapping $\mathcal{T}$ which are related to the fixed-point arguments presented further in this section. \begin{proposition}\label{prop_fp2} Let $\mathcal{T}:\mathcal{C}([0,T],\mathcal{P}({\mathbb{T}}^d))\to\mathcal{C}([0,T],\mathcal{P}({\mathbb{T}}^d))$ be defined as in \eqref{eq_fp2}. Then, $\mathcal{T}$ maps $\mathcal{M}$ into itself. In addition, $\mathcal{T}$ is a continuous mapping when restricted to the set $\mathcal{M}$. \end{proposition} \begin{proof} First, we verify the inclusion $\mathcal{T}(\mathcal{M})\subset\mathcal{M}$. Let $\mu\in\mathcal{M}$ and $\sigma:=\mathcal{T}(\mu)$. We have \[ d_1(\sigma(t),\sigma(s))\leq \mathbb{E}(X_t,X_s), \] where \begin{equation}\label{eq_fp3} \begin{cases} dX_t\,=\,\left[(\nabla W\star\mu)\,+\,\nabla \phi\right]dt\,+\,\sqrt{2}IdW_t\\ X(0)\,=\,X_0, \end{cases} \end{equation} and $W_t$ is a $d$-dimensional Brownian motion. Because the vector field $(\nabla W\star\mu)\,+\,\nabla \phi$ is H\"older continuous with respect to space, there exists a unique solution to \eqref{eq_fp3}; see, for example, \cite{chadru1}. Hence, using the Lipschitz continuity of $W$ and $\phi$, we obtain \begin{align*} d_1(\sigma(t),\sigma(s))\,&\leq\,\mathbb{E}\left[\int_s^t\left|(\nabla W\star\mu)\,+\,\nabla \phi\right|d\tau\,+\,\sqrt{2}\left|W_t\,-\,W_s\right|\right]\\ &\leq\,C_1\left|t\,-\,s\right|^\frac{1}{2}, \end{align*} with $C_1=C_1(W,\phi,T)$. Moreover, once more from the Lipschitz continuity of $W$ and $\phi$, we infer \[ \int_0^T\int_{\mathbb{T}^d}\left|\nabla W\star\sigma\,+\,\nabla \phi\right|^2d\sigma(x,t)\,\leq\,C\int_0^T\int_{\mathbb{T}^d}\sigma(x,t)dxdt\,\leq\,C_2, \] where $C_2=C_2(W,\phi,T)$. Finally, by choosing the constant $C>0$ in the definition of $\mathcal{M}$ as $ C\,:=\,\max\left\lbrace C_1,\,C_2\right\rbrace, $ we have $\mathcal{T}(\mathcal{M})\subset\mathcal{M}$. It remains to prove that $\mathcal{T}$ is continuous. However, it follows from standard results in stability theory for the Fokker-Planck equation in the presence of H\"older-continuous drift terms \cite{Por}. \end{proof} \begin{remark} We notice that the constant $C>0$ in the definition of $\mathcal{M}$ depends solely on $W$ and $\phi$. \end{remark} We close this section with the proof of Proposition \ref{prop_fpeu}. \begin{proof}[Proof of Proposition \ref{prop_fpeu}] We start by noticing that $\mathcal{T}$ has a fixed point. In fact, Proposition \ref{prop_fp1} ensures that $\mathcal{M}$ is a convex and compact subset of $\mathcal{C}([0,T],\mathcal{P}_1)$. From Proposition \ref{prop_fp2} we infer that $\mathcal{T}(\mathcal{M})\subset\mathcal{M}$ and that this mapping is continuous. Therefore, the Schauder's Fixed Point Theorem yields the existence of a fixed point for $\mathcal{T}$. The uniqueness is ensured by a straightforward application of \cite[Theorem 1.1]{Por} and the proposition is established. \end{proof} \begin{proposition}[Propagation of $L^2$ regularity] Let the assumptions of Proposition \ref{prop_fpeu} hold, then $\rho \in L^{\infty}( 0,T; L^2 ({\mathbb{T}}^d))$. \end{proposition} \begin{proof} We take a standard radially symmetric mollifier $\varphi_{\varepsilon}\in C^{\infty}({\mathbb{T}}^d)$ and a smooth function $\psi\in C^{\infty}_c([0,T)\times {\mathbb{T}}^d)$, and consider $\varphi_{\varepsilon}\star\psi(t, \cdot)$ as test function for the weak solution $\rho$: \[ \int_0^T\int_{{\mathbb{T}}^d}(\varphi_{\varepsilon}\star\psi_t\,-\,\Delta \varphi_{\varepsilon}\star\psi\,+\, b D\varphi_{\varepsilon}\star\psi)\rho\,dxdt\,=\, \int_{{\mathbb{T}}^d} \rho_0 \varphi_{\varepsilon}\star\psi(0) dx, \] where $b(x,t):=\nabla W\star\rho\,+\,\nabla \phi$. Using the identity \[ \int_{{\mathbb{T}}^d}(\varphi_{\varepsilon}\star g)(x)\, f(x)\,dx =\int_{{\mathbb{T}}^d}g(x)\, (\varphi_{\varepsilon}\star f)(x) \,dx, \] we get \[ \int_0^T\int_{{\mathbb{T}}^d}(\psi_t\,-\,\Delta \psi) (\varphi_{\varepsilon}\star\rho) \,+\, D\psi (\varphi_{\varepsilon}\star (b\rho)) \,dxdt\,=\, \int_{{\mathbb{T}}^d} \varphi_{\varepsilon}\star\psi\, \rho_0 dx\,, \] implying $\varphi_{\varepsilon}\star\rho$ is weak solution to \[ \begin{cases} (\varphi_{\varepsilon}\star\rho)_t\,=\,\div\left[\varphi_{\varepsilon}\star (b\rho))\right]\,+\,\Delta (\varphi_{\varepsilon}\star\rho)&\;\;\;\;\;\mbox{in}\;\;\;\;\;\mathbb{T}^d\times[0,T]\\ \rho(x,0)\,=\, \varphi_{\varepsilon}\star\rho_0(x)&\;\;\;\;\;\mbox{in}\;\;\;\;\;\mathbb{T}^d. \end{cases} \] Since $t\mapsto \rho\, dx$ is continuous with respect to $d_1$ and $\nabla W$ is in $C^1({\mathbb{T}}^d)$, then $\nabla W \ast \rho$ is continuous in time and is in $C^1({\mathbb{T}}^d)$. Since $\nabla \phi \in C^\alpha({\mathbb{T}}^d)$ the vector field $b$ is continuous in time and is in $C^\alpha({\mathbb{T}}^d)$. This implies that the first term of the right hand side of the above equation, $\div\left[\varphi_{\varepsilon}\star (b\rho)\right]$, is a bounded function, hence $\rho_{\varepsilon}:=\varphi_{\varepsilon}\star\rho$ is a classical solution due to classical regularity of the heat equation. Multiplying it by $\rho_{\varepsilon}$ and integrating in space we get by integration by parts \begin{align*} \frac{d}{dt}{\|\rho_{\varepsilon}(\cdot,t)\|_{L^2({\mathbb{T}}^d)}^2} =&\,2\int_{{\mathbb{T}}^d}\left[-|\nabla \rho_{\varepsilon}|^2\,-\,\varphi_{\varepsilon}\star (b\rho)\cdot \nabla \rho_{\varepsilon}\right] dx\\ \leq& \frac 1 2\int_{{\mathbb{T}}^d} (\varphi_{\varepsilon}\star (b\rho))^2dx \leq \frac 1 2 \|b\|_{\infty} \int_{{\mathbb{T}}^d} (\varphi_{\varepsilon}\star\rho)^2dx. \end{align*} Since $\|b\|_{\infty}\leq \|\nabla W\|_{\infty}\,+\,\|\nabla \phi\|_{\infty}<+\infty$, Gronwall's inequality implies \[ \|\rho_{\varepsilon}(\cdot,t)\|_{L^2({\mathbb{T}}^d)}^2\leq e^{\frac 1 2 C t} \|\rho_{\varepsilon}(\cdot,0)\|_{L^2({\mathbb{T}}^d)}^2. \] By taking the limit $\varepsilon\to 0$ we finally obtain $\|\rho\|_{L^{\infty}([0,T], L^2({\mathbb{T}}^d) )}<+\infty.$ \end{proof} \section{Lipschitz continuity and H\"older regularity}\label{Sec:Lip} In this section we detail the proofs of Propositions \ref{proposition.bounds} and \ref{proposition_c1alpha}. Under the assumption $W\in W^{2,\infty}$ the coefficients of the equation \eqref{eq:HJB} are $C^1$ in the $x$ variable. As a consequence, we have that $\Phi$ is $C^2$ in the $x$ variable. This fact can be verified through a Hopf-Cole transformation; see e.g. \cite[Section 3.2]{cardaliaguet}. We resort to the nonlinear adjoint method, introduced by L. C. Evans in \cite{Evans.adjoint}. For a detailed discussion on the application of this method to the theory of mean field games, we refer the reader to \cite{GPatVrt,pim1}. Start by fixing $(x_0,t_0)\in{\mathbb{T}}^d\times[0,T]$ and consider two adjoint variables $\eta$, $\zeta$ given by the equations \begin{equation*}\label{aux1}{\textit{Optimal Flow:\quad}} \begin{cases} \eta_t\,=\,\div\left( (\nabla W\star \rho)\eta\,+\,\nabla \Phi\eta\right)\,+\,\Delta \eta&\;\;\;\;\;\mbox{in}\;\;\;\;\;{\mathbb{T}^d}\times(0,T)\\ \eta(\cdot,t_0)\,=\,\delta_{x_0}&\;\;\;\;\;\mbox{in}\;\;\;\;\;{\mathbb{T}^d} \end{cases} \end{equation*} and \begin{equation}\label{aux0}{\textit{Zero velocity Flow:\quad}} \begin{cases} \zeta_t\,=\,\div\left( (\nabla W\star \rho)\zeta\right)\,+\,\Delta \zeta&\;\;\;\;\;\mbox{in}\;\;\;\;\;{\mathbb{T}^d}\times(0,T)\\ \zeta(\cdot,t_0)\,=\,\delta_{x_0}&\;\;\;\;\;\mbox{in}\;\;\;\;\;{\mathbb{T}^d}. \end{cases} \end{equation} The first one represents the evolution of the distribution of the optimal trajectories in the stochastic optimal control problem associated with the first equation in \eqref{Eq.main-secondorder}. The second one accounts for the evolution of the distribution of the trajectory corresponding to the zero velocity. Note that $$\int_{{\mathbb{T}}^d}\eta(x,t)dx\,=\,\int_{{\mathbb{T}}^d}\zeta(x,t)dx\,=\,1$$ and $\eta,\,\zeta\geq 0$. Note that in general $\eta$ and $\zeta$ are measure valued. However since the vector fields $(\nabla W\star \rho)\,+\,\nabla \Phi$ and $(\nabla W\star \rho)$ are $C^1$ in space, for times $t>t_0$, $\eta$ and $\zeta$ can be viewed as functions. Alternatively, to make the rest of the arguments rigorous one can approximate the delta distributions $\delta_{x_0}$ by smooth approximations of unity and pass to the limit at the end. Below we will avoid these complications for simplicity. \begin{proof}[Proof of Proposition \ref{proposition.bounds}] We split the proof of the proposition in several steps. \bigskip \begin{stp}\label{Stepl2} \textbf{An estimates on $\int_{t_0}^T\int_{{\mathbb{T}}^d}\frac{|\nabla\Phi|^2}{2}\eta dxdt$:} \end{stp} We integrate \eqref{eq:HJB} against the measure $\zeta$ and use the equation \eqref{aux0} in the distributional sense to obtain $$ \Phi(x_0,t_0)\!-\!\int_{{\mathbb{T}}^d}\phi_T\zeta_T dx+\!\!\int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d}\!\!\frac{|\nabla\Phi|^2}{2}\zeta dxdt+\!\!\int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d}\!\!\nabla W\star (\rho \nabla \phi)\zeta dx dt=\!\int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d}\! U\zeta dxdt. $$ Subsequently, we infer that \begin{equation}\label{Eq.Phiupper} \Phi(x_0,t_0)\leq \|\nabla W\|_{\infty}\int_{t_0}^T\|\nabla \phi(\cdot, t)\|_{\infty}dt+(T-t_0)\|U\|_{\infty}+\|\phi_T\|_{\infty}. \end{equation} Similarly, multiplying \eqref{eq:HJB} by $\eta$ and using \eqref{aux1} in the distributional sense, we have \[ \Phi(x_0,t_0)-\int_{{\mathbb{T}}^d}\phi_T\eta_T dx-\int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d}\frac{|\nabla\Phi|^2}{2}\eta dxdt+\int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d}\nabla W\star (\rho \nabla \phi)\eta dx dt=\int_{t_0}^T\!\!\! \int_{{\mathbb{T}}^d}U\eta dxdt. \] Thus, we get \begin{equation}\label{Eq.Philow} \int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d}\frac{|\nabla\Phi|^2}{2}\eta dxdt\leq \Phi(x_0,t_0)+\|\phi_T\|_{\infty}+\|\nabla W\|_{\infty}\int_{t_0}^T\|\nabla \phi(\cdot, t)\|_{\infty}dt+(T-t_0)\|U\|_{\infty}\,. \end{equation} From \eqref{Eq.Phiupper} and \eqref{Eq.Philow} we deduce \begin{eqnarray}\label{Eq.Philower} \int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d}\frac{|\nabla\Phi|^2}{2}\eta dxdt \leq 2\|\phi_T\|_{\infty}+2\|\nabla W\|_{\infty}\int_{t_0}^T\|\nabla \phi(\cdot, t)\|_{\infty}dt+2(T-t_0)\|U\|_{\infty}. \end{eqnarray} \ \begin{stp}\label{Steplip} \textbf{Lipschitz continuity in space:} \end{stp} Fix $\xi\in{\mathbb{R}}^d$ and let $u=\nabla\Phi\cdot\xi:=\Phi_{\xi}$, then differentiating the equation for $\Phi$, we get \[ -u_t+\nabla\Phi\cdot \nabla u+(\nabla W_{\xi} \star \rho)\cdot \nabla \Phi+(\nabla W\star \rho)\cdot \nabla u+\nabla W_{\xi}\star (\rho \nabla \phi)=\Delta u+U_{\xi}. \] As above, integrating the equation for $\Phi$ against $\zeta$ and using integration by parts, we obtain \begin{equation*} u(x_0,t_0)-\!\int_{{\mathbb{T}}^d}\!\!\!\nabla\phi_T\eta_T dx+\int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d}\!\!(\nabla W_{\xi} \star \rho)\cdot \nabla \Phi\eta dxdt+\int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d}\!\!\!\nabla W_{\xi} \star (\rho \nabla \phi)\eta dx dt=\!\!\int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d}\!\! U_{\xi}\eta dxdt. \end{equation*} Hence \begin{equation*} |u(x_0,t_0)|\leq\|\nabla\phi_T\|_{\infty}+\|\nabla^2 W\|_{\infty}\int_{t_0}^T\!\!\!\left(\int_{{\mathbb{T}}^d} |\nabla \Phi|\eta dx+ \|\nabla \phi(\cdot, t)\|_{\infty}\right)dt+(T-t_0)\|\nabla U\|_{\infty}+C. \end{equation*} Since \[\int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d} |\nabla \Phi|\eta dxdt\leq\frac 1 2 \int_{t_0}^T\!\!\!\int_{{\mathbb{T}}^d} [1+|\nabla \Phi|^2]\eta dxdt,\] we use \eqref{Eq.Philower} to produce \begin{equation*} \begin{split} |u(x_0,t_0)|\leq A+B\int_{t_0}^T\|\nabla \phi(\cdot, s)\|_{\infty}ds \end{split} \end{equation*} with $$ A=\|\nabla\phi_T\|_{\infty}+\|\nabla^2 W\|_{\infty}\left(\frac1 2 T+2\|\phi_T\|_{\infty} +2T\|U\|_{\infty}\right)+T\|\nabla U\|_{\infty}+C $$ and $B=\|\nabla^2 W\|_{\infty}\left(2\|\nabla W\|_{\infty}+1\right)$. Since $x_0$ and $t_0$ were arbitrary, we have proved \[ \|\nabla\Phi(\cdot,t)\|_{\infty}\leq A+B\int_{t}^T\|\nabla \phi(\cdot, s)\|_{\infty}ds,\quad \forall t\in[0,T]. \] Now it is easy to check that \[ \|\nabla \phi(\cdot,t)\|_{\infty}\leq Ae^{B(T-t)}\implies \|\nabla \Phi(\cdot,t)\|_{\infty}\leq Ae^{B(T-t)}. \] This together with \eqref{Eq.Phiupper} and \eqref{Eq.Philow} yields $\|\Phi\|_{\infty}\leq C_1,$ where $C_1$ depends on $\|W\|_{\mathcal{C}^2}$,$\|U\|_{\mathcal{C}^2}$,$\|\phi_T\|_{\mathcal{C}^1}$, $A$ and $B$. \end{proof} Next we present the proof of Proposition \ref{proposition_c1alpha}. \begin{proof}[Proof of Proposition \ref{proposition_c1alpha}] We observe that \eqref{eq:HJB} can be written as \[ -\Phi_t\,-\,\Delta\Phi\,=\,f(x,t)\,\in\,L^\infty(\mathbb{T}^d\times[0,T]), \] with a bound on $\|f\|_{L^\infty}$ depending only on $\|W\|_{\mathcal{C}^2}$,$\|U\|_{\mathcal{C}^2}$,$\|\phi_T\|_{\mathcal{C}^1}$, $A$ and $B$. Therefore, by standard elliptic regularity theory, we have \[ \Phi_t,\,\nabla^2 \Phi\,\in\,L^p(\mathbb{T}^d\times[0,T]), \] for every $p>1$, see for example \cite[Theorem D.1. and Remark D.1.4]{lionsbook}. Morrey's Embedding Theorem implies the result. \end{proof} \section{Proof of Theorem \ref{teo-main}}\label{Sec:mapcont} In this section we present the proof of Theorem \ref{teo-main}. In fact, we show that $\mathcal{F}$ restricted to $\mathcal{K}_{\alpha}$ is a continuous mapping. This fact builds upon Propositions \ref{prop_fpeu}-\ref{proposition_c1alpha} to cover the existence of a fixed point of $\mathcal{F}$ under the scope of the Schauder's Fixed-Point Theorem \cite[Theorem 11.1]{GilTru}. \begin{theorem*}[Schauder's Fixed-Point Theorem] Let $K$ be a compact convex set in a Banach space $\mathbb{B}$ and let $T$ be a continuous mapping of $K$ into itself. Then $T$ has a fixed point, that is, $Tx\,=\,x$ for some $x\in\mathbb{B}$. \end{theorem*} \begin{proof}[Proof of Theorem \ref{teo-main}] Take $0<\beta<\alpha<1$, it is obvious that $\mathcal{K}_{\alpha}$ is a closed and convex set which is compact in $\mathcal{C}^{\beta, 1+\beta}({\mathbb{T}^d}\times[0,T])$. Its compactness follows from Propositions \ref{proposition.bounds} and \ref{proposition_c1alpha}, together with the Arzel\`a-Ascoli Theorem. The fact that $\mathcal{F}({\mathcal{K}_{\alpha}})\subset \mathcal{K}_{\alpha}$ follows from Proposition \ref{proposition.bounds}. It remains to prove that the map $\mathcal{F}\big|_{\mathcal{K}_{\alpha}}$ is continuous in $\mathcal{C}^{\beta, 1+\beta}({\mathbb{T}^d}\times[0,T])$. For that we need to show that for any sequence $(\phi_n)_{n\in\mathbb{N}}\subset \mathcal{K}_{\alpha}$ with $\phi_n\to \phi\;\;\; \mbox{in}\;\;\; \mathcal{C}^{\beta, 1+\beta}({\mathbb{T}^d}\times[0,T])$, we have $\Phi_n:=\mathcal{F}(\phi_n)\to\mathcal{F}(\phi),$ in $\mathcal{C}^{\beta, 1+\beta}({\mathbb{T}^d}\times[0,T])$. We split the proof in two steps. \bigskip \noindent{{\bf Step 1}} {\it Stability property of the Fokker-Planck equation:} Let $(\rho_n)_{n\in\mathbb{N}}$ be such that \[ \frac{\partial \rho_n}{\partial t}=\div\left( (\nabla W\star \rho_n)\rho_n+\nabla \phi_n\rho_n\right)+\Delta \rho_n\;\;\;\;\;\mbox{in}\;\;\;\;\;{\mathbb{T}^d}\times(0,T), \] under the initial condition $\rho_n(x,0)\,=\,\rho_0(x).$ We will prove that $\rho_n\to\rho$ in $L^\infty(0,T; L^2({\mathbb{T}}^d))$. We have $$\|\phi_n-\phi\|_{L^\infty({\mathbb{T}^d}\times[0,T])}\to 0, \;\;\;\|\nabla \phi_n\|_{L^\infty({\mathbb{T}^d}\times[0,T])}\leq Ae^{BT}\;\;\; \mbox{and}\;\;\;\left\|\nabla \phi_n(\cdot,t)\right\|_{\mathcal{C}^{\alpha}({\mathbb{T}^d})}\leq C;$$ hence, we can conclude that $\nabla \phi_n(\cdot, t)\to \nabla \phi (\cdot, t),$ uniformly in ${\mathbb{T}}^d$. In particular, by the Lebesgue's Dominated Convergence Theorem \[ \int_0^T\int_{{\mathbb{T}^d}}\rho^2(\nabla\phi_n-\nabla\phi)^2dxdt\to 0. \] Now, denote $m^n=\rho_n-\rho$; then \[ m^n_t-\div((\nabla W\star \rho)m^n)-\div((\nabla W\star m^n)\rho)-\div(\nabla\phi_n m^n) -\div\left(\rho(\nabla\phi_n-\nabla\phi)\right)=\Delta m^n, \] under the homogeneous initial condition $ m_n(x,0)=0.$ Proceeding analogously to the previous section, we get \begin{align*} \frac{d}{dt}{\|m^n(\cdot,t)\|_{L^2({\mathbb{T}}^d)}^2} =&\,2\int_{{\mathbb{T}}^d}\left[-|\nabla m^n|^2-m^n\nabla m^n\cdot \nabla\phi_n-\rho \nabla m^n\cdot (\nabla\phi_n-\nabla\phi)\right] dx\\ &+ 2\int_{{\mathbb{T}}^d}\left[(\nabla W\star \rho)m^n \nabla m^n +(\nabla W\star m^n)\nabla m^n\rho\right]dx\,. \end{align*} Therefore, using the inequality $a\,b\leq\, \varepsilon a^2\,+\,\frac{b^2}{4\varepsilon}$, with $\varepsilon$ small enough and $a\,=\,\nabla m^n$, on each term above starting from the second one , we obtain \[ \frac{d}{dt}\|m^n(\cdot,t)\|_{L^2({\mathbb{T}}^d)}^2\leq C(\|\nabla\phi_n\|_{\infty}^2+\|\nabla W\|_{L^2}^2\|\rho\|^2_{L^2})\|m^n(\cdot,t)\|_{L^2({\mathbb{T}}^d)}^2+C\|\rho (\nabla\phi_n-\nabla\phi)\|_{L^2({\mathbb{T}}^d)}^2. \] Thus, by Gronwall's inequality, we conclude \[ \|m^n(\cdot,t)\|_{L^2({\mathbb{T}}^d)}^2\leq \|\rho (\nabla\phi_n-\nabla\phi)\|_{L^2([0,t]\times {\mathbb{T}}^d)}^2e^{C(T-t)}\to 0. \] As a result, $$\rho_n\to \rho\;\;\;\mbox{in}\;\;\;L^{\infty}([0,T], L^2({\mathbb{T}}^d)),$$as desired. \bigskip \noindent{\bf Step 2} {\it Stability and Uniqueness of viscosity solutions for the Hamilton-Jacobi equation:} We now examine the convergence $\Phi_n\to \Phi$. We first observe that \[ \|(\nabla W\star \rho_n)-(\nabla W\star \rho)\|_{\infty}\leq \|\nabla W\|_{L^2}\|\rho_n-\rho\|_{L^2}\to 0 \] and \[ \|U(\cdot, \rho_n)-U(\cdot, \rho)\|_{\infty}\leq C\|\rho_n-\rho\|_{L^2}\to 0. \] Since $\nabla \phi_n(\cdot, t)\to \nabla \phi (\cdot, t)$ uniformly due to our functional setting, then $$ \nabla W\star \rho \nabla \phi_n\longrightarrow \nabla W\star \rho \nabla \phi $$ uniformly on $[0,T]\times{\mathbb{T}}^d.$ Hence, the nonlocal terms \begin{align*} |\nabla W\star(\rho_n\nabla \phi_n)-\nabla W\star(\rho\nabla \phi)|\,\leq &\, \|\nabla\phi_n\|_{\infty}\|\nabla W\|_{L^2}\|\rho_n-\rho\|_{L^2}\\ &+\,|\nabla W\star\rho (\nabla\phi_n-\nabla\phi)| \end{align*} converge to zero uniformly. By the compactness of $\mathcal{K}_{\alpha}$ there is a converging subsequence $\Phi_{n_k}\to\tilde{\Phi}$, in $\mathcal{C}^{\beta, 1+\beta}({\mathbb{T}^d}\times[0,T])$, in particular $\nabla \Phi_{n_k}\to\nabla\tilde{\Phi}$ uniformly. Then $\tilde{\Phi}$ is a weak solution to \[ -{\tilde\Phi}_t+\frac{|\nabla{\tilde\Phi}|^2}{2}+(\nabla W\star \rho)\cdot \nabla {\tilde\Phi}+\nabla W\star (\rho \nabla \phi)=\Delta {\tilde\Phi} +U(x,\rho),\,\qquad {\tilde\Phi}(x,T)=\phi_T(x). \] By parabolic regularity $\tilde\Phi$ is also a classical solution. Thus $\Phi$ and $\tilde\Phi$ solve the same equation, to prove that $\Phi=\tilde{\Phi},$ we introduce two adjoint variables $\eta, \tilde{\eta}$ which solve the following equations respectively \begin{equation*} \begin{cases} \frac{\partial \eta}{\partial t}=\div\left( (\nabla W\star \rho)\eta+\nabla \Phi\eta\right)+\Delta \eta,\\ \eta(\cdot,0)=\delta_{x_0}, \end{cases} \end{equation*} and \begin{equation*} \begin{cases} \frac{\partial \tilde\eta}{\partial t}=\div\left( (\nabla W\star \rho)\tilde\eta+\nabla \tilde\Phi\tilde\eta\right)+\Delta \tilde\eta,\\ \tilde\eta(\cdot,0)=\delta_{x_0}. \end{cases} \end{equation*} By subtracting the equation for $\Phi$ from the one for $\tilde{ \Phi}$, we deduce \[ -\left({\tilde\Phi}-\Phi\right)_t+\frac{|\nabla{\tilde\Phi}|^2}{2}-\frac{|\nabla{\tilde\Phi}|^2}{2}+(\nabla W\star \rho)\cdot \nabla \left({\tilde\Phi}- \Phi\right)=\Delta \left({\tilde\Phi}-\Phi\right), \] and similarly, \[ (\tilde{\eta}-\eta)_t=\div\left( (\nabla W\star \rho)(\tilde{\eta}-\eta)+\nabla \tilde\Phi\tilde\eta-\nabla \Phi\eta\right)+\Delta (\tilde\eta-\eta)\,. \] Multiplying the first equation above by $\tilde{\eta}-\eta$ and subtracting the second equation multiplied by ${\tilde\Phi}-\Phi$ and then integrating by parts on $[0,T]\times{\mathbb{T}}^d$, we obtain \[ \int_{{\mathbb{T}^d}}\!\!\!({\tilde\Phi}-\Phi)({\tilde\eta}-\eta)dx\big|_0^T=\int_0^T\!\!\!\int_{{\mathbb{T}^d}}\!\!\left[ \left(\frac{|\nabla{\tilde\Phi}|^2}{2}-\frac{|\nabla{\tilde\Phi}|^2}{2}\right)\!({\tilde\eta}-\eta) -\left(\nabla \tilde\Phi\tilde\eta-\nabla \Phi\eta\right) \!\cdot\! \nabla({\tilde\Phi}-\Phi) \right]\!\!dx dt. \] Recalling the terminal conditions on $\Phi$, $\tilde\Phi$ and initial conditions on $\eta, \tilde{\eta}$, we have that the left hand side of the equality is zero, and thus \[ \int_0^T\!\!\!\int_{{\mathbb{T}^d}}\frac{|\nabla{\tilde\Phi} -\nabla{\Phi} |^2}{2}({\tilde\eta}+\eta)dx dt=0. \] Hence $\nabla{\tilde\Phi} = \nabla{\Phi}$ and then $\Phi _t=\tilde{ \Phi}_t$. Since $\Phi (T, x)=\tilde{ \Phi}(T, x)=\phi_T(x)$, we obtain $\Phi =\tilde{ \Phi}$. The above arguments show that any subsequence of the sequence $\{\Phi_n\}_{n\geq 1}$ has a further subsequence converging to $\Phi$ in $\mathcal{C}^{\beta, 1+\beta}({\mathbb{T}^d}\times[0,T])$. This proves that $\Phi_n\to \Phi$ in $\mathcal{C}^{\beta, 1+\beta}({\mathbb{T}^d}\times[0,T])$. Thus we have proved that the conditions of Schauder's Fixed-Point Theorem are satisfied, we infer that $\mathcal{F}$ has a fixed point in $\mathcal{K}_{\alpha}$ and the proof is complete. \end{proof} {\small {\bf Acknowledgements.-} JAC was partially supported by the EPSRC grant number EP/P031587/1. EAP was partially supported by FAPERJ (\# E26/200.002/2018), CNPq-Brazil (\#433623/2018-7 and \#307500/2017-9) and Instituto Serrapilheira. We would like to acknowledge the Institute Mittag-Leffler, Imperial College London and King Abdullah University of Science and Technology for hosting us and providing with constant help and vivid research environment.} \bibliographystyle{siam}
\section{Introduction} Suppressing and correcting errors in quantum circuits is a critical challenge driving a substantial fraction of research in the quantum information science community. These efforts build on quantum error correction (QEC) and the theory of fault tolerance \cite{Shor:1995, Shor:1996, Steane:1996, Steane:1996b, Aharonov:1997, Gottesman:1998} as the fundamental developments that support the concept of large-scale quantum computation~\cite{Preskill:1998 QECLidar2013, Campbell:2017}. In combination, these theoretical constructs suggest that so long as the probability of error in each physical quantum information carrier can be reduced below a threshold value, a properly executed QEC protocol can detect and suppress logical errors to arbitrarily low levels, and hence enable arbitrarily large computations. Underlying this proposition is an assumption that errors are statistically independent, i.e., the emergence of a qubit error at a specific time is uncorrelated with errors arising in other qubits or at any other time in the computation. Error correlations that decay with distance between qubits (spatially) can induce simultaneous multi-qubit errors~\cite{Preskill_correlations2013}, and correlations that decay with circuit length (temporally) have been shown to produce more rapid accumulation of net circuit errors~\cite{Wallman:2015, Proctor:2017}. The practicality of the assumption of uncorrelated errors has long been questioned, as laboratory sources of noise commonly exhibit strong temporal correlations, captured through spectral measures exhibiting high weight at low frequencies. As such, coherent errors induced by low frequency noise and miscalibrations have recently become a larger focus of research, with their detrimental effects on QEC implementations being examined ~\cite{Wallman:2015, Greenbaum:2018,Huang:2018,Chubb:2018} and first ideas targeting their suppression emerging \cite{Debroy:2018, Majumder:2019}. Attempts to address these errors in the theory of quantum error correction are challenging and results to date suggest that revision of postulated fault-tolerant thresholds may be required~\cite{Preskill2009, Preskill2006} relative to more optimistic predictions that have recently emerged~\cite{Fowler_Surface}. Indeed, when implicit assumptions that errors are both spatially and temporally uncorrelated are weakened, the value of a tolerable error threshold can change from some value $\varepsilon$ to $\varepsilon^2$, easily leading to order-of-magnitude decreases in the acceptable error rates~\cite{Preskill:1998}. The adverse effect of correlated errors on error correction procedures has been observed in the context of a repetition code both experimentally~\cite{Schindler:2011} -- where they were seen to effectively negate any advantage obtained from iterative error correction -- and theoretically~\cite{Greenbaum:2018}, where an increase in the logical failure rate was identified. Furthermore, while a recent full-scale numerical simulation has shown that coherent errors at the physical layer can, in fact, be overcome by topological error correcting codes~\cite{Bravyi:2018}, large numbers of physical qubits are required with error rates that are \emph{uniformly} sub-threshold. The emerging message is that, while correlated errors do not invalidate the use of QEC, their presence can significantly increase the requisite overhead, and may reduce the tolerable magnitude of physical qubit errors. In this manuscript, we demonstrate experimentally that using a low-level abstraction known as a dynamically corrected gate (DCG), we can suppress error correlations in addition to error magnitudes. Replacing \enquote{primitive} physical quantum gate operations with logically equivalent DCGs~\cite{Brown2004, Khodjasteh2009dcg, True, DasSarmaGate, SoareNatPhys2014} forms a ``virtual'' layer wherein error characteristics can be modified (``virtualized'') before the application of QEC~\cite{Preskill_Layered, JonesPRX2012}. We present a novel first-principles analysis of Clifford randomized benchmarking~\cite{Emerson2005, Dankert:2009} in order to quantitatively model the impact of error correlations on simple experimental observables, building on concepts in~\cite{Ball:2016}. Specifically, we identify that error correlations are manifested in the scaling of the distribution over sequence randomizations, at fixed sequence length, with measurement averaging. We validate this framework using randomized benchmarking experiments performed with a single trapped Ytterbium ion. We then demonstrate that the replacement of the individual Clifford operations within each sequence with logically equivalent DCGs modifies the error correlation signatures such that they are experimentally consistent with the presence of uncorrelated errors. Single-qubit experiments performed under engineered noise with tunable correlation characteristics show consistent reduction in the correlated error component when switching from primitive to DCG sequences. We explain this behaviour using a framework that describes the action of DCGs at the operator level~\cite{Kabytayev2014,SoareNatPhys2014,ViolaFFF} as whitening the effective error spectrum experienced by each gate. Finally, we demonstrate that using DCGs in sequence construction reduces spatial error correlations between qubits, through simultaneous randomized benchmarking on five trapped ion qubits. These results provide direct and strong evidence that the use of dynamically protected physical qubit operations in a layered architecture for quantum computing~\cite{JonesPRX2012} can facilitate the successful application of existing QEC theory with only minimal revision on the path to fault-tolerant quantum computation. \section{Identifying signatures of error correlations in circuits} \label{sec:correlations_theory} \begin{figure*}[t!] \centering \includegraphics[scale=1]{Fig1.png} \caption{\textbf{Translation of noise correlations to error correlations in quantum circuits.} \textbf{a,} A single operation applied to a qubit in the presence of noise $\tilde{U}_j$ can be decomposed into an error operator $\errorOp{j}$ and the target operation $\hat{U}_{j}$. Bloch spheres schematically illustrate the effect of an imperfect $\pi$-rotation about the $x$-axis acting on input state $\ket{1}$, with dark shading indicating an over-rotation error. \textbf{b,} Noise (red line) exhibiting non-zero temporal correlation of length $\mathcal{M}_\mathrm{n}=3$, quantized in units of gate operations, acts on a quantum circuit composed of sequentially applied unitary operations. The resultant errors accumulate and lead to a noisy effective operator $\tilde{U}_\mathrm{eff}$, whose effect is determined through a projective measurement at the end of the circuit. \textbf{c,} Translation of correlations in a noise process to correlations in the magnitude of the circuit error vector, $\norm{\errorVect_j}$. The error vector for each gate of a randomly composed sequence of 1000 primitive gates under a noise process with noise correlation length $\mathcal{M}_\mathrm{n}$ is calculated and the autocorrelation function of the magnitude of the error vector, $\E{\norm{\errorVect_{j_1}}\norm{\errorVect_{j_2}}}$, is shown for the first 100 gates. \textbf{d, e,} Random walks for the extreme error correlation cases, \textbf{d,} $\mathcal{M}_\varepsilon = 1$ (uncorrelated) and \textbf{e,} $\mathcal{M}_\varepsilon = J$ (fully correlated). Final walk displacements of eight sequences, each with 1000 error realizations, are shown along with the full walk for a single sequence that is common between the two cases. } \label{fig:noise2errorsRW} \end{figure*} We begin by laying out the challenge of establishing clear quantitative metrics allowing the identification of error correlations in quantum circuits. As a first step we analyze how correlations in a physical noise process translate to correlations in the resultant unitary errors within a circuit of $j=1,\ldots,J$ gates. In our model, any noisy operation $\tilde{U}_j$ within the circuit can be decomposed into the ideal operator $\hat{U}_j$ and an error operator $\errorOp{j}$, such that \mbox{$\tilde{U}_j = \errorOp{j}\hat{U}_j$}. Here, \mbox{$\hat{U}_j \equiv \hat{U}(\textbf{\emph{n}}_j, \theta_j)$} rotates the state vector by angle $\theta_j$ around an arbitrary axis $\textbf{\emph{n}}_j$ on the Bloch sphere. Considering unitary semiclassical noise processes, the error component in each operation can be written as \mbox{$\hat{\Lambda}_{j}=\exp\left\{{i\sum_{\alpha=1}^{\infty}[\errorVect_j]_{\alpha}\cdot {\hat{\boldsymbol{\sigma}}}}\right\}$}, with ${\hat{\boldsymbol{\sigma}}}$ the vector of Pauli matrices, $\alpha$ an index denoting the Magnus expansion order~\cite{GreenNJP2013}, and $\errorVect_j$ the error vector characterizing the strength and nature (affected quadrature) of the error~\cite{Kofman2004, GreenPRL2012, GreenNJP2013, ViolaFFF}. A quantum circuit experiences temporally correlated errors if the values of $\errorVect_j$ across the circuit (in space or time) exhibit non-zero correlations. Our approach to measuring error correlations is built on common quantum verification protocols employed to infer the average behavior of gate operations~\cite{Emerson2005, Knill2008, MagesanInterleaved, Emerson2011, Magesan:2012, Merkel:2013, Kimmel:2014, Wallman:2015, Sheldon:2016, BlumeKohout:2017, Mavadia:2017, Onorati:2019}. Restricting our analysis to the single-qubit case, error correlations between gates may occur in these protocols when physical noise processes exhibit strong correlations in time. We demonstrate this numerically by calculating the error vector $\errorVect_j$ for each operation in a single-qubit randomized benchmarking sequence exposed to detuning ($\hat{\sigma}_z$) noise with a variable block-correlation length, $\mathcal{M}_\mathrm{n}$; this is defined to be the number of gates over which the noise strength is constant within the sequence. The sequence is assembled from the 24 Clifford operations comprising combinations of $\pi$ and $\pi/2$-rotations about the $x,y$ and $z$-axes of the Bloch sphere, and an identity gate ${\hat{\mathbb{I}}}$. Calculating the autocorrelation function of the error vector's magnitude throughout a sequence reveals strong correlations over a length of gates, $\mathcal{M}_\varepsilon$, which appear to scale linearly with the correlation length of the input noise process, $\mathcal{M}_\mathrm{n}$ (Fig.~\ref{fig:noise2errorsRW}c). This behavior suggests a linear mapping from noise correlations to error correlations in conventional settings. As a prelude to future demonstrations in this manuscript, we note that if the individual Clifford gates are replaced by DCGs, this simple linear mapping from input noise correlations to output error correlations breaks down. In general, the primary limitation one faces in accessing information about $\mathcal{M}_\varepsilon$ in a physical experiment is that using standard, projective measurements at the end of a circuit will limit the ability to probe correlations that arise throughout the circuit's execution. Most experimental quantum verification routines suffer from exactly this limitation, and primarily measure the average difference between a qubit state transformed under an imperfect operation and a predetermined target state at the end of the protocol (Fig.~\ref{fig:noise2errorsRW}a). However, as we will illustrate in the following, there is additional useful information present in the outcomes of randomized benchmarking measurement routines that may be employed to extract novel insights about error correlations appearing during the sequence. The key underlying concept is that in a randomized benchmarking sequence built up from many operations, the resultant net state transformation in the presence of noise, $\tilde{U}_\mathrm{eff}\ket{\psi}$ (Fig.~\ref{fig:noise2errorsRW}b), is determined by an interplay of both the sensitivity of each individual operation to the noise~\cite{GreenNJP2013} and the impact of the sequence structure on error accumulation~\cite{Ball:2016, Wallman:2016, Mavadia:2017}. Specifically, nominally equivalent randomized benchmarking sequences (constructed to perform the same net operation) exhibit variations in correlated-noise susceptibility that are analytically calculable and verifiable in experiments. We use this variability and the behavior under experimental averaging to extract a signature of error correlations within quantum sequences. \subsection{Random walk formalism for error accumulation} We present a first-principles analysis to directly link measurement outcomes for single-qubit randomized benchmarking sequences to the nature of the underlying error correlations quantified by $\mathcal{M}_\varepsilon$, expanding the formalism introduced in reference~\cite{Ball:2016}. We consider randomized benchmarking sequences composed of $J$ single-qubit Clifford operations, \mbox{$\prod_{j=1}^J \cleanC{\etaVectj{j}} = {\hat{\mathbb{I}}}$}, with the vector $\etaVect$ containing labels for the 24 Clifford operations, \mbox{$\etaVectj{j} \in \{1, 2, \dots, 24\}$}. A final gate is pre-calculated to yield a net identity operation for the sequence, such that in the absence of error the final qubit state will be the same as the initial state. Due to imperfections in the operations, the physically implemented gates $\noisyC{\etaVectj{j}}$ differ from the ideal gates by an error map \mbox{$\noisyC{\etaVectj{j}}= \errorOp{j} \cleanC{\etaVectj{j}}$}. The accumulation of errors throughout a sequence can be represented by a sequence-dependent ``random walk'' in three-dimensional Pauli-error space; the net walk length can then be related to the final sequence error~\cite{Ball:2016}. For a particular realization of the error $i$, this walk is captured by the vector \begin{equation} \label{eq:random_walk} \Ri{\textrm{3D}}{i} = \stepSum{j} \eps{j}{i} \rVect{\textrm{3D}, j} \end{equation} with gate error values \mbox{$\eps{j}{i}\sim \mathcal{N}(0,\sigma^2)$} sampled from a zero-mean Gaussian distribution with rms value $\sigma$. It will be shown in Section~\ref{sec:2D_walks} that this leads to an average, randomized benchmarking error per gate $\propto\sigma^2$. Here, the values of $\rVect{\textrm{3D}, j}$ are unit-length vectors that define the sequence-specific random walk steps; they can be calculated deterministically for any randomized benchmarking sequence, irrespective of the strength or correlation characteristics of the gate errors. In a circumstance where the normalized error takes a consistent value $\eps{j}{i}\equiv 1$, the length of the $J$-step walk created by these steps is an intrinsic property of the sequence and will be shown to act as a proxy for its susceptibility to correlated errors. Examining individual randomized benchmarking sequences reveals the idiosyncratic nature of their walks; certain randomizations exhibit long walks, while others have walks that terminate near the origin, solely determined by the structure of the sequence and the form of the error channel. Accordingly, in the presence of correlated errors we expect a wide variance of outcomes, determined by the underlying structures of the randomly selected sequences. The general framework linking this Pauli walk to accumulated error was experimentally validated in~\cite{Mavadia:2017}. \subsection{Signatures of error correlations} We identify that the key measurable signature of error correlations arises in the process of experimental averaging over repetitions of a sequence, and hence over different realizations of the error. In order to understand this, we begin by examining how error correlations impact the random walk introduced above, and how the behavior of that walk changes with experimental averaging. Gate errors induce the mapping $\rVect{\textrm{3D}, j} \to \Ri{\textrm{3D}}{i}$; the term $\eps{j}{i}$ in Eq.~\eqref{eq:random_walk} can change the direction and scale the magnitude of each step in the random walk. Thus correlations in $\eps{j}{i}$ are translated into correlated modifications of the steps in $\Ri{\textrm{3D}}{i}$. To see the effect of correlations in the error process, we calculate the locus of walk termination points for eight different sequences and 1000 error realizations, shown in \mbox{Fig.~\ref{fig:noise2errorsRW}d,e}. In the presence of errors whose magnitudes are constant across all gates in a given benchmarking sequence, the error \mbox{$\eps{j}{i}\equiv\eps{}{i}$} rescales all steps in the walk uniformly, such that all termination points for a given sequence fall on a line (Fig.~\ref{fig:noise2errorsRW}e). The walk terminations for the same sequence are thus dominated by the underlying sequence structure (``rays'' in Fig.~\ref{fig:noise2errorsRW}e). By contrast, in the presence of uncorrelated errors where $\eps{j}{i}$ changes randomly for each step, the termination points appear randomly distributed in Pauli space for different realizations of the error (Fig.~\ref{fig:noise2errorsRW}d). These differences will manifest in an experiment that averages the experimental performance of a set of sequences over many different realizations of an error-inducing noise process. In the case of correlated errors, the preservation of sequence-structure dependence in the sequence error leads to a broad distribution of outcomes over different randomized benchmarking sequences. This breadth is maintained even when averaging experiments together over various realizations of the random but temporally correlated errors. In contrast, for uncorrelated errors, the random, formless distribution of walk termination points over the same set of sequences implies that averaging over experiments would result in a spread of outcomes that grows narrower as the experiment number increases, consistent with the central limit theorem. It is therefore in the distribution over measured results of noise-averaged, randomized benchmarking sequences that the signatures of error correlations between gates within a sequence will appear. In Sections~\ref{sec:2D_walks} and~\ref{sec:theory_to_laboratory} we will describe how this phenomenology can be accessed through a modified analysis of conventional randomized benchmarking experiments. \subsection{Mapping to measurable quantities} \label{sec:2D_walks} We now link the random-walk framework to measurements commonly performed in the laboratory -- a single projective measurement in the qubit basis. Such measurements are unaffected by rotations about the $z$-axis, i.e., they are phase invariant. Consequently, this type of projective measurement is insensitive to the component of the random walk oriented along the $\hat{\sigma}_z$-axis, and instead probes a two-dimensional projection of the walk onto the $\hat{\sigma}_{x}\hat{\sigma}_{y}$-plane of Pauli-error space~\cite{Mavadia:2017}. Considering a measurement routine involving averaging a single sequence over $n$ realizations of the error, we may relate the two-dimensional walk length to the projective measurement results as, \begin{equation} \label{eq:state_fid} \mathcal{P} = 1 - \noiseAve{\RNormSq{\textrm{2D}}} + \Order{\sigma^4}, \end{equation} where \mbox{$\noiseAve{\cdot}$} is an average over $n$ instances of the error process, \mbox{$\mathcal{P} \vcentcolon= 1 - \noiseAve{P(\ket{1})}$} is the measurable, noise-averaged sequence ``survival probability'' when the qubit is initialized in the state $\ket{0}$, $\sigma$ is the rms of the normally distributed errors, and $\R{\textrm{2D}}$ denotes the random walk in the $\hat{\sigma}_{x}\hat{\sigma}_{y}$-plane of Pauli-error space. For simplicity, we will proceed by referring to $\R{\textrm{2D}}$, and its individual steps $\rVect{\textrm{2D}, j}$, simply as $\R{}$ and $\rVect{j}$ respectively. We analyze in detail three distinct error correlation regimes for a unitary error channel with values \mbox{$\eps{j}{i}\sim \mathcal{N}(0,\sigma^2)$}: (i) $\mathcal{M}_\varepsilon=J$, identically correlated errors with fixed, constant magnitude over a sequence and rms value $\sigma_C$; (ii) $\mathcal{M}_\varepsilon=1$, uncorrelated, normally distributed errors that change randomly between each gate in a sequence with rms value $\sigma_U$; and (iii) statistically independent, contemporaneous correlated and uncorrelated error processes such that the relative strengths $\sigma_C$ and $\sigma_U$ determine the effective error correlation length. The expression for survival probability in Eq.~\eqref{eq:state_fid} can be used to calculate the distribution of survival probabilities without modification for both regime (i) and (ii) simply by using the appropriately calculated random walks. In the limit of long sequences and many noise averages (large $J$ and $n$), the noise-averaged survival probability is Gamma distributed over different, nominally equivalent, sequence randomizations~\cite{Mavadia:2017}; the shape and scale parameters of the distribution, $a$ and $b$ respectively, can be calculated from first principles using the particulars of the sequence, noise averaging, and error characteristics. For these two limiting cases of identically correlated errors over a sequence and uncorrelated errors changing randomly between gates, the respective survival probabilities are sampled from Gamma distributions shaped according to \begin{subequations} \label{eq:gamma_dists} \begin{align} \mathcal{P}_{C} &\sim \Gamma(a = 1, b = \tfrac{2}{3}J\sigma^2), \\ \mathcal{P}_{U} &\sim \Gamma(a = n, b = \tfrac{2}{3n}J\sigma^2). \end{align} \end{subequations} From these expressions, the variance and expectation values of the distribution over sequence randomizations can be calculated. To leading order, both distributions exhibit the same mean value \mbox{$\mathbb{E} = ab$}, giving a randomized benchmarking average gate error of $\frac{2}{3}\sigma^2$. However, the distributions diverge in the second moment \mbox{$\mathbb{V} = ab^2$}. We may now derive the properties of the distribution associated with regime (iii) by considering two independent walks; one is induced by the correlated error component $\Ri{C}{i}$, and the other by the uncorrelated component $\Ri{U}{i}$. To begin, it is convenient to note that in the case of a correlated, fixed error process over a sequence, it is possible to factor out the constant error strength from the random walk for a particular realization of the error~\cite{Ball:2016}, \begin{equation} \Ri{C}{i} = \eps{C}{i} \stepSum{j} \rVect{j} = \eps{C}{i} \V{}. \end{equation} We thus introduce $\V{}$ to describe the sequence-specific walk, defined by the steps $\rVect{j}$ that remain invariant under different realizations of the error process (Fig.~\ref{fig:noise2errorsRW}e). This separability is not achievable in the presence of uncorrelated errors due to the randomization of each step in the walk by the error process. The expression for survival probability can then be expanded in terms of these independent walks to second order in $\sigma_C,\,\sigma_U$ as \begin{align} \label{eq:dual_error_fid} \mathcal{P} &= 1 - \noiseAve{ \norm{\Ri{U}{i} + \eCorr{i} \V{}}^2 } \nonumber\\ &= 1 - \noiseAve{ \RiNormSq{U}{i}} - \sigma_C^2 \VNormSq{}, \end{align} where the cross-term is identically zero using \mbox{$\noiseAve{\eCorr{i}} = 0$}. For all three correlation regimes, higher-order terms and cross-terms contribute to the second moment of the distribution and have been calculated analytically (Table~\ref{tab:statistical_moments}). These terms reduce to those calculated using the Gamma distributions in Eq.~\ref{eq:gamma_dists} in the limit of large $J$ and $n$, with $J\gg n$. On inspection, we expect that in the presence of uncorrelated errors the variance will narrow with increasing $n$, while it will remain fixed in the presence of correlated errors. Such differences in scaling of a variance measure with averaging are reminiscent of the manifestation of noise correlations in other physical quantities, e.g., the Allan variance used in precision frequency metrology~\cite{Allan:1966, Rutman1978}. Our analysis therefore highlights that calculating the variance of measurements of randomized benchmarking survival probabilities for different sequences, and exploring how this variance changes with experimental averaging, can give insights into the underlying error correlations. The functional dependence of the distribution variance with $n$ will be employed throughout the remainder of this work as a key signature of error correlations in standard randomized benchmarking. \begin{table}[!t] \center \begin{tabular}{|l||c|c|} \hline \parbox[c][30pt][c]{\textwidth/6}{\textbf{Error Type}} & $1 - \E{\mathcal{P} }$ & $\Var{\mathcal{P} }$ \\ \hhline{|=||=|=|} % \parbox[c][30pt][c]{\textwidth/6}{(i) Fully Correlated,\\$\mathcal{M}_\varepsilon=J$} & $ \frac{2}{3} J \sigma_C^2 $ & $ \frac{2}{9} \frac{(n+2)}{n} J(2J - 1) \sigma_C^4 $ \\ \hline % \parbox[c][30pt][c]{\textwidth/6}{(ii) Uncorrelated,\\$\mathcal{M}_\varepsilon=1$} & $ \frac{2}{3} J \sigma_U^2 $ & $ \frac{2}{9n} J \left(4 + 2J + n \right) \sigma_U^4 $ \\ \hline % \parbox[c][40pt][c]{\textwidth/6}{(iii) Correlated +\\Uncorrelated} &$ \frac{2}{3} J (\sigma_U^2 + \sigma_C^2 ) $ & \parbox[c][40pt][c]{\textwidth/7}{$ \Var{ \mathcal{P}_U} + \Var{ \mathcal{P}_C }$\\ \parbox[c][20pt][c]{\textwidth/7}{$+ \frac{4}{9} J \sigma_C^2 \sigma_U^2$}} \\ \hline \end{tabular} \caption{The statistical moments for the distribution of noise-averaged sequence survival probabilities with different error correlation lengths - fully correlated across the sequence, completely uncorrelated values between gates, and a combination of two independent error processes in the same quadrature, one correlated and one uncorrelated. The variance for case (iii) incorporates contributions from each error source individually, $\Var{ \mathcal{P}_C}, \Var{ \mathcal{P}_U}$, as well as a cross-term.} \label{tab:statistical_moments} \end{table} In the next section we demonstrate how the model can be updated to connect to realistic laboratory noise models. \subsection{Modelling realistic laboratory error models} \label{sec:theory_to_laboratory} Building on the general framework introduced above, we introduce new first-principles calculations connecting the theoretical model for gate \emph{error} with actual, error-inducing \emph{noise} in experiments. We determine the sequence walk in the presence of arbitrary, unitary error maps, incorporating the possibility of multi-axis and gate-dependent errors. This facilitates the analysis of experimental measurements performed subject to the most common noise sources encountered in the laboratory. We consider two physically motivated noise processes that can occur throughout a randomized benchmarking sequence. First, frequency detuning noise -- either on the qubit's resonant frequency or the frequency of the control field used to drive qubit gate operations -- creates an off-resonance error between the qubit and control. Second, amplitude noise, which may arise from coupling-strength variations or drifts and miscalibrations in the control, results in an over- or under-rotation error of the qubit state vector. Both of these represent ``concurrent'' noise sources (i.e., applied simultaneously with the execution of a gate), which ultimately produce complex gate-dependent errors. In general, depending on their underlying cause, both frequency detuning and amplitude noise processes may possess temporally correlated and uncorrelated components. Correlated noise sources include miscalibrations, magnetic field drifts, and temperature drifts in control systems, while uncorrelated noise often stems from electrical noise or local environmental sources, e.g., anomalous heating in ion traps \cite{Sedlacek:2018} or two-level system (TLS) fluctuators in superconducting qubits \cite{Schloer:2019, Burnett:2019}. To now examine the impact of these physical noise processes on the behavior of the sequence survival-probability distributions, we proceed by explicitly calculating the translation between the physical noise strength, $\del{j}{i}\sim\mathcal{N}(0, \rho^2)$, and the effective sequence errors at the core of our model $\varepsilon = \varepsilon(\delta)$. In our notation, $\rho$ is used to denote the rms magnitude of the noise, distinguishing it from the rms magnitude of the error operator $\sigma$. Our calculations incorporate the fact that single-axis noise (e.g., detuning) present during a non-commuting operation generally results in a multi-axis error process. Furthermore, physical implementations of Clifford operations typically employ variable gate durations, resulting in gate-dependent error operators. \begin{table*}[!t] \center \begin{tabular}{|c||c|c|} \hline \parbox[c][30pt][c]{\textwidth/6}{\textbf{Error Type} } & \textbf{$\rho\to\sigma$ Translation for} $\mathbb{E}$ & \textbf{$\rho\to\sigma$ Translation for} $\mathbb{V}$ \\ \hhline{|=||=|=|} % \parbox[c][30pt][c]{\textwidth/6}{(i) Fully Correlated, \\ $\mathcal{M}_\mathrm{n}=J$} & $ \sigma_C^2 = \frac{3}{2} \exprTwo{j} \rho_C^2 $ & $ \sigma_C^4 = \frac{9}{2} \frac{ \exprFour{j} + (J - 2) \exprTwo{j}^2}{2J-1} \rho_C^4$ \\ \hline % \parbox[c][30pt][c]{\textwidth/6}{(ii) Uncorrelated, \\ $\mathcal{M}_\mathrm{n}=1$} & $ \sigma_U^2 = \frac{3}{2} \exprTwo{j} \rho_U^2 $ & $ \sigma_U^4 = \frac{9}{2} \frac{ (2+n)\exprFour{j} + (J-1-n) \exprTwo{j}^2 }{4+2J+n} \rho_U^4 $ \\ \hline % \parbox[c][30pt][c]{\textwidth/6}{(iii) Correlated + \\ Uncorrelated} &$ (\sigma_C^2 + \sigma_U^2) = \frac{3}{2} \left( \E{\norm{\rVect{U, j}}^2} \rho_U^2 + \E{\norm{\rVect{C, j}}^2} \rho_C^2 \right) $ &$ \sigma_C^2 \sigma_U^2 = \frac{9}{2} \Cov{ \norm{\rVect{U, j}}^2 }{\norm{\rVect{C, j}}^2 } \rho_C^2 \rho_U^2$ \\ \hline \end{tabular} \caption{The translation from the rms value of a physical noise process, $\rho$, with correlation length $\mathcal{M}_\mathrm{n}$, to the rms value of the gate error, $\sigma$, used to calculate the first and second moments of noise-averaged sequence survival probabilities. The values $\rho_C, \rho_U$ represent the rms magnitudes of the correlated and uncorrelated noise processes respectively. Similarly, the terms $\rVect{U, j}, \rVect{C, j}$ represent the random walk steps for the different noise processes. Full details of the derivation of the relevant random walk step expectation values, $\exprTwo{j}, \, \exprFour{j},$ and \mbox{$\Cov{ \norm{\rVect{U, j}}^2 }{\norm{\rVect{C, j}}^2 }$} for the specific noise models employed in our verification experiments are presented in Appendix~\ref{app:expr_calculation}.} \label{tab:noise_to_error} \end{table*} In this setting, the error $\eps{j}{i}$ employed in Eq.~\eqref{eq:random_walk} is replaced by the physical noise strength $\del{j}{i}$. As a result, the previously unit-length steps $\rVect{\textrm{3D}, j}$ now take more complex, but still analytically calculable, values due to the gate-dependence and multi-axis character of the errors induced by concurrent noise processes. For a particular noise process we calculate the associated random walk, which enables a mapping of the rms magnitude of the physical noise $\rho$ to an updated rms value of the error $\sigma$. Appendix~\ref{app:revised_RB_theory} describes the formalism to calculate the noise-to-error translation in standard Clifford gates for an arbitrary, unitary error process. Table~\ref{tab:noise_to_error} summarizes the results which, when combined with the expressions from Table~\ref{tab:statistical_moments}, can be used to predict both the expectation and the variance of the distribution of survival probabilities over sequence randomization. \section{Experimental Implementation} \label{sec:experimental_setup} \subsection{Randomized benchmarking on ${}^{171}\textrm{Yb}^+$ qubits} We perform experiments using a qubit encoded in the $^2\mathrm{S}_{1/2}$ hyperfine ground states of a single laser-cooled ${}^{171}\textrm{Yb}^+$ ion confined in a linear Paul trap, with the computational basis states defined as \mbox{$\ket{0} \vcentcolon= \ket{F=0, m_F = 0}$} and \mbox{$\ket{1} \vcentcolon= \ket{F=1, m_F = 0}$}. Laser cooling, state initialization to $\ket{0}$, and detection are performed using a laser at 369\,nm that couples the ${}^{2}{\textrm{S}}_{1/2} \ket{{F}=1}$ ground state to the first excited state ${}^2\mathrm{P}_{1/2} \ket{ {F}=0}$. As the ion selectively fluoresces when it is projected to the upper, ``bright'' qubit state $\ket{1}$, one can distinguish between the two basis states by counting the number of emitted photons during the detection period. Single-ion qubit state detection is performed in a time-resolved manner~\cite{Wolk:2015, Mavadia:2017} using an avalanche photodiode; multi-ion data employs an EMCCD camera and processing through a Random Forest classifier from the scikit-learn framework~\cite{scikit-learn}. Qubit rotations are driven via a microwave field near 12.6\,GHz generated by a Vector Signal Generator (VSG). Using an internal baseband generator, we program arbitrary rotations of the qubit via \textit{IQ} modulation. Rotations about the $z$-axis are implemented as instantaneous, pre-calculated \textit{IQ} frame shifts. Randomized benchmarking sequences composed from Clifford operations are pre-loaded into the VSG and mapped to the desired physical operations prior to the recording of each data set. The experiments in this manuscript are performed using $k$ sequences each comprising $J$ operations. The first $J-1$ gates are randomly composed Clifford operations, $\cleanC{\etaVectj{j}}$, and the final operation, \mbox{$\cleanC{\etaVectj{J}} = (\prod_{j=1}^{J-1}\cleanC{\etaVectj{j}})^{\dagger}$}, is selected such that the sequence implements the identity in the absence of error. A full list of the Clifford operations and their physical implementations can be found in the \textit{Supplementary Materials} of reference \cite{Ball:2016}. Typical, single-qubit randomized benchmarking experiments with primitive gates achieve a baseline result of $p_{\textrm{RB}}\approx 1.9\times 10^{-5}$ in our system (Appendix~\ref{app:single_qubit_RB}). \subsection{Verifying error correlation signatures with engineered errors}\label{sec:histograms} The key signature of the presence of temporally correlated errors appears in the variance of the distribution over sequence survival probabilities and its scaling with experimental averaging; averaging reduces the variance in the case of uncorrelated errors, but has limited impact when errors exhibit strong temporal correlations. We begin our experimental study by engineering experimental noise sources to test and verify the predictions of the theoretical model presented in Sec.~\ref{sec:correlations_theory}. We perform standard randomized benchmarking, but engineer detuning and control-amplitude noise with different user-defined bandwidths. All noise values are generated numerically, and are sampled from a zero-mean Gaussian distribution $\mathcal{N}(0,\rho^2)$ with rms strength $\rho$. Off-resonance errors are induced via fractional detuning noise present during the application of the randomized benchmarking sequence, $\delta = (\Delta/\Omega)$, set by the frequency detuning $\Delta$ between the qubit transition and the microwave source in units of the Rabi frequency, $\Omega$. Over-rotation errors are produced by amplitude noise in the microwave control field, effectively changing $\Omega$. Two limiting noise bandwidths are treated: maximally correlated noise, $\mathcal{M}_\mathrm{n}=J$, and uncorrelated noise, $\mathcal{M}_\mathrm{n} \leq 1$. For the detuning (control-amplitude) noise process, the correlated noise component is engineered using a constant offset in the VSG microwave frequency (amplitude) over the entire sequence, and the uncorrelated noise is applied via an external FM (AM) modulation input, and changes value every primitive $\pi/2$-time. The relevant random walk steps calculated for these noise processes and used in modelling our experimental measurements are found in Table~\ref{tab:expected_error_steps} of Appendix~\ref{app:revised_RB_theory}. Instead of simply calculating the randomized benchmarking decay rate, $p_\textrm{RB}$ derived from fitting to the mean of the distribution over different values of $J$, we instead focus on analyzing our data to extract information that is otherwise generally discarded in averaging processes. In each individual measurement, the qubit is initialized in state $\ket{0}$ via optical pumping and one of $k=50$ randomized benchmarking sequences with $J=100$ gates is applied in the presence of engineered noise. A final projective measurement in each experiment yields a discretized qubit state measurement, which is used to infer the probability of finding the qubit in state $\ket{1}$ by repeating the experiment $r=220$ times under application of the same engineered noise realization (reducing quantum projection noise). The survival-probability measurement outcomes for each sequence are then averaged over a variable number up to $n=200$ different realizations of noise possessing the same engineered correlations. This process is repeated for all $k=50$ sequences, allowing us to calculate the distribution variance $\mathbb{V}_{k}^{(n)}$. \begin{figure}[t] \centering \includegraphics[scale=1]{Fig2.png} \caption{\textbf{Signatures of error correlations in randomized benchmarking sequences.} \textbf{a-c,} Distribution of measured survival probabilities for $k=50$ randomly composed sequences averaged over $n=5, 25$ and 100 noise realizations drawn from \mbox{$\delta\sim\mathcal{N}(0,\rho^2=2\times10^{-3})$} for both maximally correlated, $\mathcal{M}_\mathrm{n} = J$, (gray) and uncorrelated (red) engineered noise processes. Uncorrelated noise possesses a ``$\pi/2$-bandwidth'', i.e., noise values change with a rate set at the inverse of the duration of a primitive $\pi/2$-rotation, and hence can take one or multiple values in a gate ($\mathcal{M}_\mathrm{n} \leq 1$). Solid lines are normalized Gamma distributions plotted with no free parameters. \textbf{d,} Scaling of cumulatively noise-averaged histogram variances, \mbox{$\mathbb{V}_\mathrm{k}^{(n)} \equiv \mathbb{V}_\mathrm{k}\left[ \noiseAve{P(\ket{1})} \right]$}. Trajectories correspond to different orderings of noise realizations with dotted lines representing the mean of 1000 re-orderings, and solid lines are theoretical predictions with no free parameters (see main text). Vertical dashed lines indicate the values of $n$ used in panels \textbf{a-c}. } \label{fig:engineerednoise} \end{figure} Figs.~\ref{fig:engineerednoise}a-c show the distributions over randomized benchmarking sequences of measured noise-averaged survival probabilities in the presence of concurrent detuning noise. The same set of sequences is subject to correlated (gray) or uncorrelated (red) noise sampled from a common distribution. Data are represented as histograms for different fixed values of averaging number, $n$, for each sequence. Solid lines are theoretical predictions for the distribution of survival probabilities derived from the updated random-walk framework, as given by the Gamma distributions from Eq.~\eqref{eq:gamma_dists}, and substituting the error rms value $\sigma$ using the noise-to-error translation for the expectation value shown in Table~\ref{tab:noise_to_error}. These theoretical predictions - which involve no free parameters - show good agreement with the data in the regimes studied. These data clearly illustrate the differences in the distributions over the same set of randomized benchmarking sequences when subjected to noise with differing correlation properties. As shown in Ref.~\cite{Ball:2016} and highlighted here in Table~\ref{tab:statistical_moments}, the distributions possess approximately the same mean value, despite the differing noise-correlation properties. The skew to high fidelities in the data taken using correlated noise is a manifestation of the randomized decoupling effects known to exist within some randomized benchmarking sequences~\cite{Ball:2016}. More importantly, the behavior of the variance of the distributions under an increasing number of noise averages $n$ varies substantially. For small $n$ the distributions are similarly broad despite the differences in their shapes, but with further averaging the distribution measured under uncorrelated noise narrows while the variance of the distribution measured under correlated noise remains approximately constant (as discussed in Sec.~\ref{sec:2D_walks}). To highlight the effect of noise correlations on the experimental averaging behavior, we plot the variance of the distribution over measured sequence survival probabilities, \mbox{$\mathbb{V}_\mathrm{k}^{(n)} \equiv \mathbb{V}_\mathrm{k}\left[ \noiseAve{P(\ket{1})} \right]$}, as a function of the number of noise averages $n$ (Fig.~\ref{fig:engineerednoise}d). Potential unintended systematic bias in the scaling of the experimental data with $n$ is mitigated by random re-ordering of the measured outcomes prior to cumulative averaging, producing a collection of individual averaging trajectories. For correlated noise, $\mathcal{M}_\mathrm{n}=J$, the resulting trajectories are initially broadly distributed and fluctuate before converging with $n$ to a fixed, analytically calculable variance. By contrast, in the case of uncorrelated noise with $\mathcal{M}_\mathrm{n}\leq 1$, all trajectories show an approximate reduction in \mbox{$\mathbb{V}_\mathrm{k}^{(n)} \propto 1/n$}, commensurate with a continued narrowing of the distribution of outcomes over different sequences under averaging \mbox{(Fig.~\ref{fig:engineerednoise}a-c)}. Solid lines capturing key scaling behaviors observed in both data sets of Fig.~\ref{fig:engineerednoise}d are derived from the expression for variance in Table~\ref{tab:statistical_moments} using the noise-to-error translations presented in Tables~\ref{tab:noise_to_error} and \ref{tab:expected_error_steps}, calculated for concurrent detuning noise with no free parameters. Overall, agreement with the measured experimental data are good across a wide parameter range and two orders of magnitude in $\mathbb{V}_\mathrm{k}^{(n)}$. For correlated noise, small deviations between the theoretical trace and measured mean scaling appear for low values of $n$. Numerical evidence attributes this to the limited sample size in terms of sequences, which does not always capture the rare, highly error-susceptible sequences that would lead to a larger variance. In the case of uncorrelated noise, there is an overall vertical shift between the theory and the data, which is fully compensated by adjusting the rms noise strength $\rho_U$ by $\sim6\%$. Numerical simulations and analytic considerations attribute the need for this adjustment to the strong noise employed in these experiments, which violates the theoretical assumption $J\rho_U^2 \ll 1$, such that higher-order terms in the theory cannot be fully ignored. The uncorrelated noise data begin to deviate from an exact $1/n$-scaling of $\mathbb{V}_\mathrm{k}^{(n)}$ at large numbers of noise averages. This behavior is captured by our theoretical model and varies in a predictable way with the applied noise bandwidth and sequence length $J$ (Appendix~\ref{app:expr_calculation}); we have verified it is not due to fundamental measurement limits in our system or quantum projection noise, as discussed in Appendix~\ref{app:QPN}. We are able to attribute this ``saturation'' in variance scaling for uncorrelated noise to residual sequence dependence, even in the case of purely uncorrelated noise, and the fact that our projective measurement probes only a two-dimensional $\hat{\sigma}_{x}\hat{\sigma}_{y}$-plane in Pauli-error space. For example, one can imagine a sequence composed solely of ${\hat{\mathbb{I}}}$ gates, which, due to an induced off-resonance error, will experience a net phase rotation that cannot be measured by single-axis projective measurements. Hence, no amount of averaging over different noise strength realizations will produce a survival probability that converges to the distribution mean, even in the case of uncorrelated noise. Overall we find that our theoretical models predict not only the full distribution of survival probabilities over randomized benchmarking sequences, but also the scaling of this distribution's variance with experimental averaging. The difference between the gray and red data in Fig.~\ref{fig:engineerednoise}d, and the agreement of theory, thus constitute key experimental validations of the central theoretical contributions made in this manuscript. \section{Suppressing Error Correlations Using Dynamically Corrected Gates} In the next part of our study we explore the ability to modify error correlations within a sequence through deterministic replacement of each Clifford operation in a randomized benchmarking sequence with an error-suppressing dynamically corrected gate (DCG). Each DCG is implemented by replacing primitive physical rotations with composite pulses comprising multiple physical rotations~\cite{Kabytayev2014}, according to one of several prescriptions~\cite{True}. This approach abstracts the target state transformations away from the physical qubit manipulation in a manner that builds in error robustness via coherent averaging. In this way, these composite gates modify the error susceptibility of the target operations, and in particular change the relationship between an input correlated-noise process and output gate errors. We therefore refer to their action as ``virtualizing'' the Clifford operations, consistent with an abstraction above the physical-layer operations presented in \cite{JonesPRX2012}. \begin{figure*}[t!] \centering \includegraphics[scale=1]{Fig3.png} \centering \caption{ \textbf{Suppression of error correlations using dynamically corrected gates.} \textbf{a,} The first-order, generalized filter-transfer function for dephasing noise of a primitive operation $G^{(1)}_{z}(\omega, T_{j})$ and the noise spectrum (here $\beta_{z}(\omega)\propto1/\omega$) combine to produce an effective error spectrum $E(\omega, T_{j})$ for a single gate. \textbf{b,} The modified filter functions for first-order DCGs scale as $\omega$ at low frequencies, which results in a ``whitening'' of $E(\omega, T_{j})$ relative to the input noise spectrum. \textbf{c, d,} Variance scaling with $n$ for primitive (gray) gates, and WAMF (orange), CORPSE (blue), and BB1 (green) DCGs all subjected to noise with both correlated and uncorrelated components. For \textbf{c}, detuning noise is engineered with strength \mbox{$\delta_{C} \sim \mathcal{N}(0, 2\times10^{-3})$}, \mbox{$\delta_{U} \sim \mathcal{N}(0, 5\times10^{-4})$}, and for \textbf{d}, amplitude noise is engineered with strength \mbox{$\delta_{C} \sim \mathcal{N}(0, 9\times10^{-4})$}, \mbox{$\delta_{U} \sim \mathcal{N}(0, 2\times10^{-4})$}. Dotted lines are means of 1000 trajectories randomized over noise realizations, and solid lines for the DCGs are theoretical fits from Table~\ref{tab:statistical_moments} to the mean with the values of $\sigma_U^2$ and $\sigma_C^2$ allowed to vary. Black solid lines for primitive gates are derived from the same theory with no free parameters. As with Fig.~\ref{fig:engineerednoise}, all data is measured for $k=50$ sequences of length $J=100$ with $n=200$ noise realizations and $r=220$ repetitions. } \label{fig:DCG_engineerednoise} \end{figure*} The error-virtualization process is described quantitatively by calculating the error vector $\errorVect_j$ at the operator level and expressing it in the Fourier domain. In the limit of classical Gaussian dephasing noise, described in the Fourier domain as the spectrum $\beta_{z}(\omega)$, the leading-order Magnus term ($\alpha=1$) in the $\hat{\sigma}_z$-quadrature may be written as \begin{equation} [\epsilon_{j, z}]_{1}=-i\int \frac{d\omega}{2\pi}G^{(1)}_{z}(\omega, T_j)\beta_{z}(\omega). \end{equation} Here, $G^{(1)}_{z}(\omega, T_j)$ is an analytically calculable, filter-transfer function that describes the spectral characteristics of a gate active for duration $T_j$~\cite{ViolaFFF}. The \textit{effective} error spectrum experienced by the gate may therefore be represented by the spectral overlap of the filter-transfer function with the noise, written as \mbox{$G^{(1)}_{z}(\omega, T_j)\times \beta_{z}(\omega)\to E(\omega, T_j)$}. Fig.~\ref{fig:DCG_engineerednoise}a demonstrates the mapping between input noise and the effective error spectrum schematically for an example $1/\omega$-noise spectrum and a primitive $\pi$-rotation about the $x$-axis. In this example, correlations in the noise are directly transferred to the correlations in the effective error spectrum~\cite{GreenPRL2012} (c.f. direct $\mathcal{M}_\mathrm{n}$ to $\mathcal{M}_\varepsilon$ translation for primitive gates in Fig.~\ref{fig:noise2errorsRW}c). Replacement of the primitive gate with a logically equivalent DCG virtualizes the effective error spectrum for each operator through the process of noise filtering~\cite{GreenPRL2012, Kabytayev2014, SoareNatPhys2014, ViolaFFF}. Fig.~\ref{fig:DCG_engineerednoise}b illustrates this effect, where the DCG's reduced susceptibility to low frequency noise (captured through its filter-transfer function) results in a whitening of the effective error spectrum relative to $\beta_{z}(\omega)$. In the current context, this whitening suggests that DCGs should not only reduce overall error magnitudes when the noise is dominated by low frequency contributions, but they should also suppress the signatures of error correlations between sequentially applied gates. The particular DCG constructions examined in this work are the \enquote{Compensation for Off-Resonance with a Pulse SEquence} (CORPSE) \cite{Cummins:2000} and \enquote{Walsh Amplitude Modulated Filter} (WAMF) \cite{Ball:2014} gates, which suppress detuning errors, and the BB1 pulse family \cite{Wimperis:1994}, which suppresses over-rotation errors. Specific details of DCG construction for the various operations employed here are presented in Appendix~\ref{app:DCG}. \subsection{Modification of variance scaling with engineered errors using DCGs} We begin by performing a detailed, quantitative study of the measured signatures of error correlations through the application of engineered noise. We experimentally implement primitive, CORPSE, WAMF and BB1 gates, where the first two DCGs are designed to suppress errors arising from frequency detuning noise and the latter is designed to suppress errors arising from amplitude noise. Using the same set of randomly generated randomized benchmarking sequences as in Fig.~\ref{fig:engineerednoise}, we now apply a mixed noise spectrum, simultaneously containing uncorrelated, rapidly varying noise \mbox{($\mathcal{M}_\mathrm{n} \leq 1$)}, and quasi-static offsets that are constant over a full sequence giving a strongly correlated component \mbox{($\mathcal{M}_\mathrm{n} = J$)}. In addition to performing measurements with primitive gates, we also construct DCG sequences by deterministically replacing each Clifford with its logically equivalent DCG counterpart. The relations for the mixed noise spectrum provided in Tables~\ref{tab:statistical_moments} and \ref{tab:noise_to_error} now permit a direct study of the impact of using DCGs on error correlations appearing within the randomized benchmarking sequences via the averaging behavior of $\mathbb{V}_\mathrm{k}^{(n)}$. Beginning with frequency detuning noise, both DCG implementations shown in Fig.~\ref{fig:DCG_engineerednoise}c exhibit an initial variance scaling with noise averaging \mbox{$\mathbb{V}_\mathrm{k}^{(n)}\propto 1/n$}, reminiscent of the application of the purely uncorrelated noise process in Fig.~\ref{fig:engineerednoise}d. The observed saturation in \mbox{$\mathbb{V}_\mathrm{k}^{(n)}$} at large $n$ for the DCG data combines contributions due to both the analytically calculable component occurring in the presence of purely uncorrelated noise introduced above, and residual uncompensated error correlations. The general behavior observed for the DCG sequences is to be contrasted with that observed for the same sequences composed of primitive gates where, as in Fig.~\ref{fig:engineerednoise}, the strong correlated noise component causes the variance to converge to a large constant value (gray). Similar behavior is observed when considering the amplitude error quadrature. We demonstrate this through the application of engineered control-amplitude noise in Fig.~\ref{fig:DCG_engineerednoise}d, where measurements on sequences composed of DCGs derived from the BB1 family exhibit a similar \mbox{$\mathbb{V}_\mathrm{k}^{(n)}\propto 1/n$} averaging behavior. Again, this is contrasted with the behavior of sequences composed of primitive gates where once more the variance saturates to a high constant value, despite application of the same noise in both settings. \subsection{Quantitative analysis of error-correlation suppression} In order to calculate the change in error correlations realized in randomized benchmarking sequences composed of DCGs, we compare experimental measurements of \mbox{$\mathbb{V}_\mathrm{k}^{(n)}$} with the predictions of the model summarized in Table~\ref{tab:statistical_moments}. For the primitive gates, we explicitly translate the applied detuning noise strengths to an effective error strength using the noise-to-error relations in Table~\ref{tab:noise_to_error}; for this, we also use the expected random walk step expressions calculated and presented in Table~\ref{tab:expected_error_steps} of Appendix~\ref{app:revised_RB_theory} for detuning or amplitude noise with a $\pi/2$-bandwidth in the uncorrelated component. The solid, black lines in \mbox{Figs.~\ref{fig:DCG_engineerednoise}c,d} are then derived using these calculated error strengths, with no free parameters. Agreement between experimental measurements and theoretical predictions for the primitive gate sequences is good, but we observe a small ($\sim$20\%) deviation that appears approximately constant over several orders of magnitude in $n$ for both noise processes. Ongoing work is investigating the source of this discrepancy; possible sources include the unaccounted impact of higher-order terms due to the strength of the applied noise, and undersampling of the distribution over noise-averaged sequences. To extract the relative correlated and uncorrelated error components after DCG application, we fit the data using the theoretical predictions for the scaling of $\mathbb{V}_\mathrm{k}^{(n)}$ shown in Table~\ref{tab:statistical_moments}, and use the strengths of the two error components $\sigma_U^2$ and $\sigma_C^2$ as free parameters. First, for all DCGs we observe a reduction in $\sigma_C^2$ coupled with an increase in $\sigma_U^2$. Specifically, $\sigma_C^2$ is reduced by a factor of $49\times$ for CORPSE, $6\times$ for WAMF, and $10\times$ for BB1, while all experience an increase in $\sigma_U^2$ by approximately $6-7\times$. The relative performance of the DCGs observed in our experiments is aligned with their documented strengths, as CORPSE is known to more efficiently cancel purely static detuning errors than WAMF~\cite{Kabytayev2014, Ball:2014}, although improved calibration of the pulse-amplitude values used in WAMF gates is expected to improve the efficacy of correlated-error suppression. The increase in $\sigma_U^2$ is approximately consistent with the increase in duration of the DCGs relative to the primitive gate implementations. Considering the high-pass-filtering nature of all DCGs illustrates why uncorrelated noise processes fluctuating rapidly on the scale of the individual DCGs are transmitted by their filters and lead to residual errors that may be amplified by the DCG structure. Overall, these measurements -- in particular the scaling of $\mathbb{V}_\mathrm{k}^{(n)}$ -- are consistent with an interpretation that the action of the noise whitening in the filter-transfer-function framework transforms correlated noise into predominantly uncorrelated residual errors \emph{at the operator level}. \subsection{Signatures of variable error-correlation lengths} \begin{figure}[t!] \centering \includegraphics[scale=1]{Fig4.png} \caption{\textbf{Suppression of error correlations using DCGs under noise with varying $\mathcal{M}_\mathrm{n}$.} \textbf{a, b,} Variance scaling of $k=20$ sequences with noise averaging for \textbf{a,} primitive and \textbf{b,} CORPSE gates. Traces are normalized to the initial mean variance for each applied noise case. Engineered noise is composed of an uncorrelated component ($\mathcal{M}_\mathrm{n} \leq 1$) and a block correlated component of length $\mathcal{M}_\mathrm{n}$ that is varied from fully correlated ($\mathcal{M}_\mathrm{n} = J$) to uncorrelated ($\mathcal{M}_\mathrm{n} = 1$) in units of virtual gates. Dotted lines are means of 1000 randomized trajectories. \textbf{c,} Ratio of initial to final variance in the upper panels as $\mathcal{M}_\mathrm{n}$ is varied for primitive (black) and CORPSE (blue) gates. Dotted line marks the ratio at which CORPSE gates saturate, and the dashed vertical line indicates the value of $\mathcal{M}_\mathrm{n}$ where this ratio crosses the scaling trend for primitive gates. Error bars calculated from the SEM of the 200 initial values of variance and normalized by the fully noise-averaged variance are smaller than point size.} \label{fig:block_correlated_noise} \end{figure} To expand on the previous analyses, we experimentally demonstrate that the reduction in effective error correlation, indeed, resides at the virtual gate layer. Using the same sequences as before, and the same engineered $\rho_U$ and $\rho_C$ rms magnitudes for detuning noise, the length of the correlated noise component is now varied in terms of the number of gates at the virtual level, breaking it up into blocks of length $\mathcal{M}_\mathrm{n}$. The lab-frame durations of the noise blocks therefore now differ by a factor of $\sim6$ between the primitive and the CORPSE gates (the average increase in the duration of the Clifford operations when using CORPSE). In the case of sequences composed of primitive gates, the signature exhibited by the variance scaling under noise averaging in Fig.~\ref{fig:block_correlated_noise}a gradually changes from indicating correlated errors (saturation at high variance) to purely uncorrelated errors ($1/n$-like scaling) as the block length is decreased, consistent with observations in Fig.~\ref{fig:engineerednoise} and Fig.~\ref{fig:DCG_engineerednoise}. By contrast, the sequences composed of CORPSE gates in Fig.~\ref{fig:block_correlated_noise}b retain their overall $1/n$-like scaling behavior for all correlated component block lengths, demonstrating that residual uncorrelated errors remain dominant. All traces in \mbox{Fig.~\ref{fig:block_correlated_noise}a,b} have been normalized to the initial mean variance for each engineered noise case to highlight the change in the relative correlated and uncorrelated error components, rather than the net error strength. As a witness of the suppression of error correlations, Fig.~\ref{fig:block_correlated_noise}c shows the ratio of the initial mean variance $\mathbb{V}_\mathrm{k}^{(n=1)}$ to the final, fully noise-averaged variance $\mathbb{V}_\mathrm{k}^{(n=200)}$. This ratio scales approximately inversely with $\mathcal{M}_\mathrm{n}$ for primitive gates but remains nearly constant for CORPSE gates. Extrapolation of this ratio for CORPSE back towards small $\mathcal{M}_\mathrm{n}$ reveals a crossover with the primitive data that lies between $\mathcal{M}_\mathrm{n} \approx 1$ to 2. This shows that CORPSE gates can reduce the noise correlation length to an error correlation length commensurate with physical noise $\mathcal{M}_\mathrm{n} \approx 1$ to 2. Because the noise correlation blocks were matched to the duration of the underlying Cliffords - whether through primitive or composite construction - these data highlight the efficacy of DCGs in virtualizing error characteristics for the logical gates implemented. \section{DCG's impact on intrinsic errors} After verifying the utility of the theoretical constructs we have introduced in this work, we now turn to characterizing the intrinsic errors limiting the performance of our system. In the trapped ${}^{171}\textrm{Yb}^+$ ion experiment described in Section~\ref{sec:experimental_setup}, we achieve a single-qubit randomized benchmarking average error per gate (EPG) of $(1.89 \pm 0.12) \times 10^{-5}$ (Appendix~\ref{app:single_qubit_RB}). Increasing the number of qubits to five and performing simultaneous randomized benchmarking using a global microwave control field reveals a monotonic increase in the EPG across the register, ranging from $(5.7 \pm 0.5) \times 10^{-5}$ to $(1.3 \pm 0.1) \times 10^{-4}$. As such, were we to run multi-ion algorithms that use global state manipulations, e.g., transversal gates in the 7-qubit Steane code~\cite{Steane:1996b}, we would not see the net error rate scale linearly with respect to the initial single-qubit EPG. This non-linear scaling with increasing qubit numbers has been observed in many systems and is often due to cross-talk between qubits~\cite{Proctor:2019}. It is important to note that this experimental observation of inhomogeneous error rates also violates a common assumption on noise statistics made in studies of error correcting codes, namely that the noise is independent and \emph{identically-distributed} (iid). In our case, the underlying cause of the observed error inhomogeneity is a sub-percent-level gradient in the amplitude of the microwave control field across the ion chain, caused by interference from metallic surfaces in the proximity of our in-vacuum antenna. We also observe a small magnetic-field gradient across the qubit chain, such that both amplitude and detuning noise are present simultaneously. Spatially correlated errors have recently been studied in reference~\cite{Postler:2018}, wherein it is noted that previous studies of multi-qubit errors tend to assume either spatially independent errors or identically spatially correlated errors, facilitating the use of a decoherence free subspace. Our situation, with a gradient of spatially correlated errors, falls between these two cases, but can still induce simultaneous multi-qubit errors that lower the efficacy of QEC. To characterize the impact of DCGs on spatially correlated errors, we utilize simultaneous randomized benchmarking sequences of length $J=500$ applied to all five qubits in the register, and again explore variance scaling with experimental averaging. We construct DCG sequences using BB1 gates to combat the dominant microwave-control-amplitude errors. Data collection proceeds by interleaving a single sequence implemented using either primitive or BB1 gates to ensure a fair comparison between the sequences in time, in the event that any systematic drifts occur. We examine the scaling of $\mathbb{V}_{\mathrm{k}}^{(r)}$ with averaging over repetitions $r$, up to $r=500$; because noise is native to the system, we make the substitution $n\equiv r$. The signature of the temporally correlated intrinsic errors is observed for all ions when using sequences of primitive gates in Fig.~\ref{fig:intrinsic_errors}a (red). We observe a staggered, increasing saturation value for $\mathbb{V}_{\mathrm{k}}^{(r)}$ at $r=500$, increasing with the spatial distance from qubit 1 (leftmost qubit in Fig.~\ref{fig:intrinsic_errors}a inset), which is used to calibrate the gate operations. As expected, the qubit that is furthest from the calibration qubit suffers both the worst randomized benchmarking performance and shows the highest saturation value in variance scaling. By contrast, the over-rotation error suppressing BB1 gates (blue) saturate at a value of variance over an order of magnitude lower than achieved by the primitive gates, and recover a $1/r$-like scaling for all qubits. We further find the relationship between the physical positions of the qubits and the ordering of saturation variances has become scrambled. Using the analysis introduced above, we fit the mean variance trends with the expression in Table~\ref{tab:statistical_moments}, allowing the strengths of the error $\sigma_C^2$, $\sigma_U^2$ to vary. We extract a reduction in the correlated error strength when using BB1 gates ranging from $\sim5$ to $16\times$ for the five qubits. \begin{figure} \centering \includegraphics[scale =1]{Fig5.png} \caption{\textbf{Intrinsic errors in a five-qubit chain.} \textbf{a,} Variance over noise-averaged sequence survival probabilities for five-qubits using $k=60$ sequences of length $J=500$, averaged over repetitions $r$, up to $r=500$. Each trajectory is produced by shuffling the order of repetitions used in the graph to avoid bias, dotted lines indicate the means of 1000 trajectory randomizations, and solid lines are fits where the correlated and uncorrelated error strengths were free to vary. The correlated error strengths, $\sigma_C^2$, are $\{1.2, 1.5, 1.9, 2.4, 2.7\}\times10^{-4}$ from qubit 1 to 5 for the primitive gates, and $\{2.3, 2.5, 1.1, 2.2, 2.3\}\times10^{-5}$ for the BB1 gates. The uncorrelated error strengths, $\sigma_U^2$, are $\{7.5, 8.1, 8.5, 8.6, 8.7\}\times10^{-4}$ from qubit 1 to 5 for the primitive gates, and $\{6.5, 6.5, 6.3, 6.6, 6.5\}\times10^{-4}$ for the BB1 gates. (Inset) EMCCD image of a five-ion chain, spaced over $\sim 30 \upmu$m. The control field amplitude and frequency is calibrated with respect to the highlighted, leftmost ion. \textbf{b,} Pairwise, cross-correlation coefficients between the five-qubit survival probabilities for primitive gates (left) and BB1 DCGs (right), revealing a $\sim50\%$ reduction in the correlations between qubit errors when using DCGs.} \label{fig:intrinsic_errors} \end{figure} To directly probe the action of DCGs in virtualizing the spatially correlated errors, we calculate the pairwise cross-correlation coefficient between the survival probabilities in each experimental realization (Fig.~\ref{fig:intrinsic_errors}b). For primitive gates, all errors are highly correlated between qubits (cross-correlation coefficient $\geq 0.9$ for all qubit pairs), whereas for the BB1 gates, a reduction of approximately 50\% can be seen between all qubit pairs, further supporting the evidence that DCGs provide a suppression of error correlations in both time and space. Separate investigations not presented here using the multi-axis error suppressing DCG CinBB showed no additional benefit. This observation suggests that the off-resonance error created by the magnetic-field gradient was sufficiently small that it was dominated by other larger, but rapidly fluctuating, intrinsic error sources \section{Outlook} The results we have presented suggest that the path to the practical implementation of QEC may be facilitated by transforming miscalibrations and common laboratory noise sources exhibiting slow drifts and low-weight noise spectra, into effective error processes with dramatically reduced correlations at the virtual layer using DCGs. We believe this is important as the pursuit of functional quantum computers -- even at the mesoscale -- will clearly require major advances in the control and suppression of errors, as gate counts quickly exceed $10^{10}$ for even moderate problems requiring only $\sim200$ qubits \cite{Reiher:2017}. Combined with the observation that certain DCGs can mitigate spatial cross-talk in multi-qubit systems \cite{Merrill:2014}, we believe that our demonstration of the suppression of temporal and spatial error correlations within quantum circuits solidifies the central importance of dynamic error suppression techniques at the virtual level for practical quantum computing. \section*{Acknowledgments} The authors acknowledge S. Mavadia for assistance with data collection and simulations, and discussions with H. Ball, C. Ferrie, and C. Granade on data analysis. Work partially supported by the ARC Centre of Excellence for Engineered Quantum Systems CE170100009, the Intelligence Advanced Research Projects Activity (IARPA) through the US Army Research Office Grant No. W911NF-16-1-0070, and a private grant from H. \& A. Harley.
\section{Introduction} D-branes in superstring theory play various essential roles, not only theoretically but also phenomenologically in particle physics and cosmology, and have been intensively and extensively investigated (see for example \cite{Blumenhagen:2006ci,Ibanez:2012zz,Baumann:2014nda} for phenomenological works and \cite{Dvali:1998pa,Kehagias:1999vr,Silverstein:2003hf,Easson:2007dh} for cosmological works). But the dynamics has not yet been fully understood. Suppose two D$p$-branes are set in a target space-time. If they are at rest in parallel, it is a BPS configuration and stable. When they move at a relative velocity $v$, very weak attractive force is induced \cite{Bachas:1995kx,Lifschytz:1996iq}. Furthermore, due to the parametric resonance associated with the open string modes connecting D$p$-branes \cite{Bachas:1995kx,McAllister:2004gd} and also due to the closed string emission \cite{AbouZeid:1999fs,Bachlechner:2013fja}, the configuration loses its energy. What is the fate of these D$p$-branes? They may be either separated apart or may be attracted to combine into a stack of D$p$-branes with an enhanced gauge symmetry \cite{Kofman:2004yc,Enomoto:2013mla}: {\it Beauty is attractive.} If an appropriate initial condition is given, they may start revolving around each other and form a bound state. The motivation of the present work is to investigate such a possibility. The mechanism we search for is similar to the Coleman-Weinberg mechanism in the following sense. For a revolving motion, there is repulsive centrifugal potential. Thus, if there are no other attractive forces, revolving motion cannot be a solution. When two D-branes relatively move, the configuration generally violates the BPS condition and attractive force arises radiatively. Thus the question is whether the classical centrifugal potential can be balanced by the attractive force generated by one-loop radiative corrections of massive open string modes stretched between revolving D-branes. In order to answer whether such a stationary state exists or not, we calculate one-loop corrections to the interaction between two D3-branes revolving with each other. At large distances $r>l_s$, we cannot expect a bound (resonant) state, since the induced attractive force is too weak compared to the centrifugal repulsive force. Thus we focus on the behavior of the potential at shorter distances $r \lesssim l_s$. At short distances, the closed string picture is no longer valid and replaced by its dual open string picture \cite{Douglas:1996yp}. Then the open string massless modes dominantly contribute to the potential between D-branes whose effective action is given by the supersymmetric Yang-Mills (SYM) theory. We first calculate the one-loop Coleman-Weinberg potential in a background corresponding to the two D3-branes revolving with each other with the radius $r$ and the angular frequency $\omega$. The $U(2)$ gauge symmetry in D3-brane worldvolume is spontaneously broken to $U(1) \times U(1)$ by the Higgs mechanism, where the vacuum expectation value is given by the diameter $2r$.\footnote{Here, we set the string scale $2\pi \alpha'=1$ and the distance $r$ has dimension of mass.} Open strings stretched between D3-branes acquire mass $\sim 2r$ due to the Higgs mechanism. In addition, the revolution with the angular frequency $\omega$ breaks supersymmetry and the masses are split by an amount of $\omega$ between bosons and fermions. The one-loop Coleman-Weinberg potentials $m(r,\omega)^4 \log m(r,\omega)^2$ generate the effective potential for the moduli field $r$. Since the potential must vanish at $\omega=0$, we expect that the potential between revolving D3-branes is given by $V \propto \omega^2 r^2$ in the leading order of $r$ and $\omega$ expansions. Therefore, the moduli field $r$ is expected to acquire mass proportional to the supersymmetry breaking scale $\omega$. This is, however, not the end of the story since we have infinitely many massive open string modes whose masses $M$ are dominantly given by the string scale $m_s:= \sqrt{1/2\pi\alpha'}$, with additional $r$ and $\omega$ corrections; $M=M(m_s, r, \omega)$. One-loop corrections of the massive modes to the potential of $r$ are given by the Coleman-Weinberg form $M^4 \log M^2$. Due to the supersymmetry at $\omega=0$, $m_s^2 r^2$ terms must vanish. Thus, expanding $M(m_s,r,\omega)$ with respect to $r$ and $\omega$, one-loop threshold corrections from these massive open string modes are expected to become $\omega^2 r^2$. Since there are infinitely many massive states, the coefficients might be large compared to the contributions from the massless modes. One of the motivations of the present paper is to calculate the string threshold corrections to the moduli field $r$ in the perspective of the hierarchy problem of the Higgs boson mass. In this paper, we propose an efficient method to calculate the threshold corrections of open string massive modes even when the open string spectrum cannot be explicitly obtained. The method is to combine the SYM and the supergravity calculations with appropriate cutoffs in the moduli parameters. It was first suggested in \cite{Douglas:1996yp}, where a partial modular transformation (open-closed string duality transformation) was utilized. The partial modular transformation converts the ultraviolet (UV) region of the open string one-loop amplitude to the infrared (IR) region of the closed string tree propagations, and an introduction of cutoffs in the moduli parameter avoids the double counting of summing both open and closed string channels. We apply the method to calculate the interaction potential between revolving D3-branes in parallel. The paper is organized as follows. In section \ref{approximation}, we first introduce a method to efficiently calculate string threshold corrections from massive open string modes in D-brane models. In a toy example where the open string spectrum can be exactly obtained, we check that the method gives a very accurate approximation to the potential. We then apply it to a system of revolving D$p$-branes. In section \ref{revolving Dp}, the contributions from massless open string modes are calculated in the SYM theory with a stationary revolving background. In section \ref{sugra}, we calculate the contributions from massive open string modes using the supergravity theory with an appropriate Schwinger parameter cutoff. In section \ref{Epotential}, we sum up these two contributions in sections \ref{revolving Dp} and \ref{sugra}. We explicitly evaluate the effective potential at short distances $r \ll m_s$ by expanding the formulae derived in the previous sections, and draw the shape of the potential. We also discuss a possibility of a bound state. Section \ref{discussion} is devoted to conclusions and discussions. Some technical details in the calculations are given in Appendices. In Appendix \ref{SUGRA}, we derive tree amplitudes of the supergravity for a pair of generally moving D$p$-branes. In Appendix \ref{potential omega-expansion}, we evaluate the one-loop Yang-Mills amplitude for a system of revolving D$p$-branes, especially $p=3$, by using the $\omega$-expansion. The expansion is valid for $\omega<r.$ In Appendix \ref{r/w expansion}, the same amplitude is evaluated by the $r$-expansion, which is valid for $r<\omega$. \section{String Threshold Corrections in D-brane Models \label{approximation}} \vspace{5mm} We are interested in interaction potential between D-branes, which are relatively moving in a target space-time. At weak string coupling, we can obtain the potential by calculating the one-loop partition function of an open string stretched between the D-branes. For simple cases, we can quantize the stretched open strings and determine a closed form of the one-loop effective potential. But in many other cases where D-branes are accelerating, it is not possible to write the effective potential in a closed form, since open strings have complicated boundary conditions. For example, when two D-branes are revolving like a binary star, open string spectrum can be solved only perturbatively with respect to the relative velocity \cite{Iso:2018cwb}. Thus, in order to calculate the potential between these D-branes, it is necessary to develop an alternative method. In this section, we propose an efficient method to obtain the interaction potential between generally moving D-branes, including threshold corrections of massive open string modes. The method was indicated in a seminal paper \cite{Douglas:1996yp}. Schematically, the effective potential $V(R)$ is given as \begin{equation} V(R)\ =\ -\int_0^\infty\frac{dt}{t}\,e^{-\frac{R^2}{2\pi\alpha'}t}Z(t), \label{V(r) schematic} \end{equation} where $R$ is the distance between the D-branes. $Z(t)$ is the partition function of the stretched open string with the modulus (Schwinger parameter) $t$, where the factor $e^{-\frac{R^2}{2\pi\alpha'}t}$ due to the string tension is extracted. In many known examples the $R$-dependence only appears through $e^{-\frac{R^2}{2\pi\alpha'}t}$ and $Z(t)$ is $R$-independent, but generally it is not the case. The method for analyzing the effective potential at all ranges of $R$ is based on a simple idea of separating the integration region into the UV region of $t \in [0,1]$ and the IR region of $t \in[1, \infty)$. The IR region for the open strings is dominantly given by the massless modes of open strings. If the modular transformation for $Z(t)$ can be explicitly performed, the UV region is mapped to the IR region of the dual closed strings and thus determines the large $R$ behavior of the potential. But as we will see in the next section \ref{sec:stringthreshold}, it may also give sizable contributions to the small $R$ behavior of the potential. They are the threshold corrections of infinitely many open string massive modes. The UV region $[0,1]$ is dominantly described by the massless closed string modes, i.e., supergravity. The property holds even when the modular transformation is not explicitly given. Thus the open string one-loop amplitude of the UV region is approximated by using the supergravity calculations with an appropriate cutoff corresponding to $t \in [0,1]$. \vspace{5mm} \subsection{Why are the string threshold corrections important?} \label{sec:stringthreshold} \vspace{5mm} In this section, we explain the method of {\it partial modular transformation}. It can provide a good approximation of the effective potential without directly performing the one-loop open string amplitude. Let us start from a toy example in the bosonic string theory. The model contains an open string tachyon and the potential is not well-defined for small $R$, but still it is a good example to see its efficiency and usefulness of the method. The effective potential of a pair of static parallel D$p$-branes in the bosonic string theory is given by \begin{equation} V(R)\ =\ -\int_0^\infty\frac{dt}{t}\, e^{-\frac{R^2}{2\pi\alpha'}t}(8\pi^2\alpha't)^{-\frac12(p+1)}\eta(it)^{-24}. \label{V(r) bosonic} \end{equation} The integral contains contribution from the tachyon which makes the integral divergent at small $R$. We simply ignore it here. In the following sections, we will consider tachyon-free models whose effective potential is well-defined for all ranges of $R$. First, let us consider the potential at large $R$. As usual, the asymptotic behavior of $V(R)$ at large $R$ can be easily determined by using the modular transformation. Due to the exponential factor $e^{-\frac{R^2}{2\pi\alpha'}t}$, small $t$ region dominantly contributes to the behavior at large $R$. After a modular transformation, we get \begin{equation} V(R)\ =\ -(8\pi^2\alpha')^{-\frac12(p+1)}\int_0^\infty ds\, e^{-\frac{R^2}{2\pi\alpha'}s^{-1}}s^{\frac12(p-25)}\eta(is)^{-24}. \end{equation} The large $s$ region gives the dominant contribution at large $R$. Thus we expand the Dedekind eta function $\eta(is)$ as \begin{equation} \eta(is)^{-24}\ =\ \sum_{n=-1}^\infty d_ne^{-2\pi ns}, \label{Dedekind eta} \end{equation} where $d_{-1}=1$, $d_0=24$, $d_1=324$, $d_2=3200$ etc., and we retain only terms with small $n$. Again we ignore the closed tachyon contribution ($n=-1$) here. The $n=0$ term gives \begin{equation} V(R)\ \sim\ -(4\pi)^{-\frac12(p+1)}(2\pi\alpha')^{11-p}\Gamma({\textstyle \frac{23-p}2})R^{p-23}, \end{equation} which is a good approximation for large $R$, up to the tachyonic contribution. It corresponds to the exchange of massless closed string states, i.e., the dilaton and the graviton. The behavior of $V(R)$ at small $R$, however, is more non-trivial. Similarly we can expand the $\eta(it)$ in eq.(\ref{V(r) bosonic}) by using the formula of eq.(\ref{Dedekind eta}). Then, discarding the open string tachyon ($d_{-1}$), we may think that only the massless open string modes contribute to the behavior of $V(R)$ at small $R$. But actually it is not the case because all values of $t$, including large $t$, can contribute to the integral\footnote{ It is known that a singular behavior of physical quantities can be extracted solely from the lightest open string states which become massless in the singular limit \cite{Douglas:1996yp}. }. For example, the contribution from $n$-th excited states with the coefficient $d_n$ in (\ref{Dedekind eta}) gives the following contribution to the effective potential $V(R)$; \begin{eqnarray} && \int_{1/\Lambda^2}^\infty\frac{dt}{t}e^{-\frac{R^2}{2\pi\alpha'}t}t^{-\frac12(p+1)}e^{-2\pi nt} \nonumber \\ [2mm] &=& \left\{ \begin{array}{lc} \displaystyle{2\Lambda-\sqrt{4\pi x}} + {\cal O}(1/\Lambda), & (p=0) \\ [2mm] \displaystyle{\frac{\Lambda^4}{2}-\Lambda^2 x+\frac{3-2\gamma}{4}x^2-\frac12x^2\log(x/\Lambda^2)} + {\cal O}(1/\Lambda^2), & (p=3) \end{array} \right. \label{bosonic each order} \end{eqnarray} where we have introduced the UV cutoff $\Lambda$ (in unit of the string scale) and \begin{equation} x\ :=\ \frac{R^2}{2\pi\alpha'}+2n\pi. \end{equation} The first and the second terms in the formula for $p=3$ are nothing but the quartic and quadratic divergences in $d=4$ quantum field theories. The third and the fourth terms are the Coleman-Weinberg effective potential with a mass squared, $M^2=x$. Since $x$ increases with increasing $n$, massive open string modes give huge contributions to the low energy effective potential. Therefore, we cannot simply discard the contributions from massive open string states in determining the behavior of $V(R)$ for small $R$, even though they are heavy. We also need to take an appropriate treatment of the UV cutoff $\Lambda$ appearing in the above formulas, which causes ambiguities of finite renormalizations of low energy observables. In addition, the above calculations can provide behaviors of the potential $V(R)$ only for small $R$ or large $R$ regions. But, we are interested in the behavior of potential $V(R)$ in the whole ranges of $R$. In the next section, we propose an efficient method to evaluate $V(R)$ interpolating the small $R$ and large $R$ regions. \vspace{5mm} \subsection{Partial modular transformation} \vspace{5mm} We will now provide an efficient method to obtain a good approximation of $V(R)$ for all ranges of $R$. Interestingly, this method also resolves the issue of the UV divergences mentioned in the previous section. Our method is based on the following rewriting of the potential of eq.(\ref{V(r) bosonic}): \begin{eqnarray} V(R) &=& -(8\pi^2\alpha')^{-\frac12(p+1)}\left[ \int_1^\infty\frac{dt}{t}\, e^{-\frac{R^2}{2\pi\alpha'}t}t^{-\frac12(p+1)}\eta(it)^{-24} \right. \nonumber \\ [1mm] & & \left. \hspace*{2.5cm} +\int_1^\infty ds\, e^{-\frac{R^2}{2\pi\alpha'}s^{-1}}s^{\frac12(p-25)}\eta(is)^{-24} \right]. \label{V(r) bosonic separate} \end{eqnarray} Here, we divided the integration region $[0,\infty)$ for $t$ into $[0,1]$ and $[1,\infty)$, and perform the modular transformation for the first half region. An advantage of this rewriting is that, since $t,s\ge1$ are satisfied, the Dedekind eta functions in the right-hand side can be replaced with a few terms in eq.(\ref{Dedekind eta}) corresponding to light open (closed) string states, even for small $R$. For example, \begin{equation} \int_1^\infty\frac{dt}{t}\, e^{-\frac{R^2}{2\pi\alpha'}}t^{-\frac12(p+1)}\eta(it)^{-24}\ \to\ \mbox{(tachyon)}+24\int_1^\infty\frac{dt}{t}\,e^{-\frac{R^2}{2\pi\alpha'}}t^{-\frac12(p+1)} \label{open approx} \end{equation} is a good approximation for all ranges of $R$. Accuracy of the approximation can be estimated as follows. Using the expansion of eq.(\ref{Dedekind eta}), the left-hand side of eq.(\ref{open approx}) can be estimated as \begin{equation} \sum_{n=0}^\infty d_n\int_1^\infty\frac{dt}{t}\, e^{-\frac{R^2}{2\pi\alpha'}t}t^{-\frac12(p+1)}e^{-2\pi nt}\ <\ \sum_{n=0}^\infty d_ne^{-2\pi n}\int_1^\infty\frac{dt}{t}\, e^{-\frac{R^2}{2\pi\alpha'}t}t^{-\frac12(p+1)}. \end{equation} Since $e^{-2\pi}=0.001867$ is a very small number, the contributions from massive states are much smaller than those from the massless states. One might be worried that the exponential growth of $d_n$ would invalidate this argument. However, it is known that $d_n$ grows as $e^{4\pi\sqrt{n}}$, which is not large enough to overcome the suppression factor $e^{-2\pi n}$. The total contribution (without tachyon) to $V(R)$ turns out to be smaller than the massless state contribution times an infinite sum \begin{equation} \sum^\infty_{n=0} d_ne^{-2\pi n}\ =\ \eta(i)^{-24}-e^{2\pi}\ =\ 1.026\,d_0. \end{equation} Therefore, the error due to discarding all massive open string states is less than 3\%. Note that the smallness of the error is assured because we have introduced the cutoff at $t=1$. The second half in eq.(\ref{V(r) bosonic separate}) can be similarly approximated as \begin{equation} \sum_{n=0}^\infty d_n\int_1^\infty ds\,e^{-\frac{R^2}{2\pi\alpha'}s^{-1}}s^{\frac12(p-25)}e^{-2\pi ns}\ <\ \sum_{n=0}^\infty d_ne^{-2\pi n}\int_1^\infty ds\,e^{-\frac{R^2}{2\pi\alpha'}s^{-1}}s^{\frac12(p-25)}. \end{equation} Therefore, retaining the contributions from massless closed string states gives a good approximation with the same accuracy as above. We emphasize that the accuracy of the approximation does not depend on $R$, so this approximation is valid for all range of $R$. If one needs a more precise approximation, one can retain the first excited states for both open and closed string channels. Then, \begin{equation} \sum^\infty_{n=1} d_ne^{-2\pi n}\ =\ \eta(i)^{-24}-e^{2\pi}-24\ =\ 1.019\,d_1e^{-2\pi}, \end{equation} shows that the expected error is about $0.019\,d_1e^{-2\pi}/d_0=0.05$\%. \vspace{5mm} Several comments are in order. First the method is to sum the contributions from the open massless modes and the closed massless modes. If we did not introduce the Schwinger parameter cutoff, it would be a double counting. But as is clear from the procedure, it is not. Next, the expression is finite, as long as the square of the mass of the ``tachyonic'' state is positive. This implies that the issue of the UV divergences and ambiguities of finite renormalizations mentioned above are resolved by summing all open string massive contributions. Finally, in eq.(\ref{V(r) bosonic separate}), we separated the region of the moduli integration at $t=s=1$, which is the fixed point of the modular transformation. If we separate the modulus at a different value, $t=2$ and $s=1/2$ for example, the suppression factor for the open string channel becomes $e^{-4\pi}=3.487\times10^{-6}$ and the approximation becomes better. However, the suppression factor for the closed string channel becomes $e^{-\pi}=0.04321$, giving a worse approximation. Hence the choice $t=s=1$ seems to be optimal. \vspace{5mm} \subsection{Another example: D3-branes at angle} \vspace{5mm} As another example in the superstring case, we consider a pair of D3-branes at angle in Type IIB string theory. We follow the notations of the section 13.4 in \cite{Polchinski:1998rq,Polchinski:1998rr}. For $\phi_4=0$, the one-loop effective potential is given by \begin{equation} V(R)\ =\ -\int_0^\infty\frac{dt}{t}(8\pi^2\alpha't)^{-\frac12}e^{-\frac{R^2}{2\pi\alpha'}t} \frac{i\prod_{a=1}^4\vartheta_{11}(\frac i\pi\phi_a't,it)} {\eta(it)^3\prod_{a=1}^3\vartheta_{11}(\frac i\pi\phi_at,it)}, \label{D3-at-agnle-string} \end{equation} where \begin{eqnarray} \phi_1'\ :=\ \frac12(\phi_1+\phi_2+\phi_3), & & \phi_2'\ :=\ \frac12(\phi_1+\phi_2-\phi_3), \nonumber \\ \phi_3'\ :=\ \frac12(\phi_1-\phi_2+\phi_3), & & \phi_4'\ :=\ \frac12(\phi_1-\phi_2-\phi_3). \end{eqnarray} We assume that the angles $\phi_a$ are small so that the mass spectrum of the stretched open string is not largely deviated from that for the BPS configuration with $\phi_a=0$. This integral is convergent for large $t$ if \begin{equation} \sum_{a=1}^4|\phi_a'|\ \le\ \sum_{a=1}^3|\phi_a| \end{equation} is satisfied. This corresponds to the condition for the absence of open string tachyons. A solution of this condition is \begin{equation} \phi_1\ =\ \phi_2\ =\ \phi_3\ =\ \phi \label{no open tachyon} \end{equation} for any $\phi$. The integral is always convergent for small $t$ since there is no closed string tachyons. Therefore, the effective potential $V(R)$ with $\phi_a$ satisfying eq.(\ref{no open tachyon}) is well-defined for all ranges of $R$. \begin{figure}[!htb] \center \includegraphics [scale=.3] {V-D3-brane-at-angle.eps} \vspace{10mm} \caption{\small The effective potential $V(R)$ for D3-branes at angle with $\phi=\pi/12$ and $\alpha'=1$. The exact effective potential in eq.(\ref{D3-at-agnle-string}) is drawn with red solid line. The blue broken line shows the potential using the approximate formula in eq.(\ref{D3approx}), which agrees very well with the exact one. } \label{VD3} \end{figure} \vspace{5mm} Similarly to the bosonic example in the previous section, the stringy result of eq.(\ref{D3-at-agnle-string}) can be approximated by a sum of open light and closed massless contributions, \begin{eqnarray} \tilde{V}(R) &=& \frac1{\sqrt{8\pi^2\alpha'}}\left[ \int_1^\infty dt\,t^{-\frac32}e^{-\frac{R^2}{2\pi\alpha'}t} \frac{2\sinh(\frac32\phi t)\sinh^3(\frac12\phi t)}{\sinh^3(\phi t)} \right. \nonumber \\ & & \left. \hspace*{1.5cm} +\int_1^\infty ds\,s^{-\frac32}e^{-\frac{R^2}{2\pi\alpha'}s^{-1}} \frac{2\sin(\frac32\phi)\sin^3(\frac12\phi)}{\sin^3\phi} \right]. \label{D3approx} \end{eqnarray} This formula provides a good approximation of eq.(\ref{D3-at-agnle-string}). Indeed, the plot of $V(R)$ and $\tilde{V}(R)$ is shown in Figure \ref{VD3}. The error for the approximation is quite small for all range of $R$, which is difficult to see by naked eyes. \subsection{General Recipe \label{recipe} } \vspace{5mm} Let us summarize the method to give an efficient approximation to the one-loop effective potential $V(R)$ at all ranges of $R$. In the example in the previous section, given a modulus integral for the effective potential of interest in eq.(\ref{D3-at-agnle-string}), we divided the integration region into two, and performed the modular transformation for one of the integrals. Then, we retained only the contributions from light states to the integrals, open (nearly) massless states and closed massless states. The resulting expression gives a good approximation to the full effective potential for all ranges of $R$. Now we generalize the method to more complicated situations. To determine the approximate expression for the effective potential in the D-brane system, we did not actually need to know the full spectrum of the stretched open string. Only the information of the effective theories of the open massless states and the closed massless states are necessary. Namely the approximate effective potential is given as a sum of the SYM and the supergravity contributions; \begin{equation} \tilde{V}(R)\ =\ \tilde{V}_o(R)+\tilde{V}_c(R), \end{equation} where $\tilde{V}_o(R)$ and $\tilde{V}_c(R)$ are schematically given as \begin{eqnarray} \tilde{V}_o(R) &=& -\int_1^\infty\frac{dt}{t}\int\frac{d^{D}k}{(2\pi)^{D}} \sum_{\rm light\ open}e^{-2\pi tE_o(k)-\frac{R^2}{2\pi\alpha'}t}, \nonumber \\ \tilde{V}_c(R) &=& -\int_1^\infty ds\, \sum_{\stackrel{\rm \scriptstyle massless}{\rm closed}}\int\frac{d^{D'}k}{(2\pi)^{D'}}\, \langle B|c\rangle\langle c|B'\rangle e^{-2\pi sE_c(k)-\frac{R^2}{2\pi\alpha'}s^{-1}}. \label{V_approx} \end{eqnarray} Here $|B\rangle$ and $|B'\rangle$ are the boundary states for the D-branes and $|c\rangle$ are the closed string massless states propagating between D-branes. $\tilde{V}_o(R)$ is the Schwinger parametrization of the one-loop determinant for light open string states with the UV cutoff at the string scale. Thus, it can be obtained from the worldvolume theory of the D-brane system under consideration. Suppose that a D-brane configuration of interest is described by a classical field configuration in the worldvolume theory. Then, the one-loop calculation around the classical configuration gives the desired one-loop determinant. If we rewrite this in terms of the Schwinger parameter and put a suitable cutoff, we obtain $\tilde{V}_o(R)$ without performing any stringy calculations. On the other hand, $\tilde{V}_c(R)$ is obtained from the massless closed string exchange between the D-branes. For general configurations of D-branes, see \cite{Kazama:1997bc,Hirano:1996pf}. This can be understood by noticing that the Schwinger parametrization of the massless propagator in $D'$ dimensions is proportional to \begin{equation} \int\frac{d^{D'}k}{(2\pi)^{D'}}\frac{e^{ikx}}{k^2}\ =\ (4\pi)^{-\frac{D'}2}\int_0^\infty ds\,s^{-\frac{D'}2}e^{-\frac14x^2s^{-1}}. \label{Schwinger} \end{equation} The interaction vertex $\langle B|c\rangle$ of a D-brane to a closed string state is given by the corresponding Dirac-Born-Infeld (DBI) action with Chern-Simons (CS) term, provided that the trajectory of the D-brane is specified. Then, we obtain $\tilde{V}_c(R)$ by determining the appropriate tree amplitudes in supergravity, written in the Schwinger parametrization, and putting a suitable UV cutoff at the string scale. \vspace{5mm} Now, we have the recipe for a well-approximated expression to the full one-loop effective potential of a D-brane system, which includes threshold contributions from infinitely many massive open string modes: \begin{enumerate} \item Find a classical configuration in the worldvolume theory of a D-brane system under consideration, which corresponds to the D-brane configurations we are interested in. Then perform one-loop calculations around the classical configuration, and express the resulting one-loop determinant in terms of the Schwinger parameter $t$. UV cutoff in the $t$-integration is introduced. \item Calculate the classical potential, mediated by the massless closed string states in supergravity, between the given configurations of D-branes. The coupling vertices are derived from the corresponding DBI action with CS term. Express the result in terms of the Schwinger parameter $s$ and introduce the UV cutoff. \item Normalize $t$ and $s$ such that the $R$-dependence appears in either of the form \begin{equation} e^{-\frac{R^2}{2\pi\alpha'}t}, \hspace{1cm} e^{-\frac{R^2}{2\pi\alpha'}s^{-1}}, \end{equation} and put the ``cutoff'' at $t,s=1$. This corresponds to introducing the UV cutoff at the string mass scale $m_s=(2 \pi \alpha')^{-1/2}$. \item The sum of the above two expressions gives a good approximation $\tilde{V}(R)$ to the full effective potential $V(R)$ for all ranges of $R$. \end{enumerate} \vspace{5mm} If we interpret this recipe from the open string channel, what we have done amounts to summing all the stringy threshold corrections to the effective potential with a very good accuracy. This can be done by converting the threshold corrections into a contribution from the closed string massless states. The open-closed duality plays a key role in this calculation. Note that the above calculations in the recipe can be performed even for {\it off-shell} configurations of D-brane system. In principle, an off-shell interaction of D-branes would be calculated in terms of an open string {\it field} theory. The leading order contribution with respect to $g_s$ is given by the one-loop open string amplitude. The Schwinger parametrization for this amplitude should be available. According to the recipe given above, we divide the integration region of the Schwinger parameter into two. A half of them corresponding to small Schwinger parameters can be replaced with a tree amplitude of a closed string {\it field} theory, assuming that the open-closed duality persists off-shell. By truncating both string field theory calculations, they are reduced to off-shell calculations in a worldvolume theory of the D-branes and in a supergravity. We know, in principle, how to perform the both calculations. These calculations should give an approximate effective potential for an off-shell D-brane system. We should also emphasize again that our recipe does not suffer from a double-counting problem, since we have introduced a cutoff in the Schwinger parameter integration. One can convince oneself of the validity of our recipe by examining the large $R$ behavior of $\tilde{V}_o(R)$. Due to the factor $e^{-\frac{R^2}{2\pi\alpha'}t}$ and the cutoff at $t=1$, $\tilde{V}_o(R)$ exponentially damps at large $R$, $V(R) \sim e^{-R^2/2\pi\alpha'}$. Therefore, the Newton potential appears only from $\tilde{V}_c(R)$. It is also important to notice that, although $\tilde{V}_c(R) \sim -1/R^{7-p}$ at large $R$, $\tilde{V}_c(R)$ is finite in the limit $R\to0$, due to the cutoff at $s=1$. \vspace{5mm} In the following, we apply our method to the revolving D-branes. In \cite{Iso:2018cwb}, we investigated this system based on a worldsheet theory of the stretched open string. However, there were several difficulties. One of them is the fact that the revolving configuration is off-shell at tree level, so that worldsheet calculations could have some troubles, for example an ambiguity for the renormalization procedure. We will see that our method in this paper gives a quite reasonable finite result for the effective potential of the revolving D-branes, improving our previous investigation in \cite{Iso:2018cwb}. \vspace{1cm} \section{Gauge theory calculations in revolving D$p$-branes } \label{revolving Dp} \vspace{5mm} In the following sections, we apply the recipe in the previous section to calculate the effective potential $\tilde{V}(R)$ for a system of D$p$-branes revolving around each other. The distance $R=2r$ is chosen to have mass dimension 1 and so is the radius of the revolution $r$. The radius with dimension -1 is given by $2 \pi \alpha' r$. In this section, we set $2\pi\alpha'=1$. To determine $\tilde{V}_o(2r)$, we perform a one-loop calculation around a suitable background field configuration in maximally supersymmetric Yang-Mills theory in $p$+1 dimensions\footnote{ The effective theory of D$p$-branes is given by the DBI action with CS term and contains higher derivative corrections to the SYM theories. These higher dimensional vertices are suppressed by a factor {$1/m_s$} and the corrections to the effective potential between D-branes can be neglected in the region {$r < m_s$}. Such suppression property is different from the threshold corrections of massive open string modes running in internal lines of the Feynman diagrams, which may give sizable contributions to the potential as discussed in section \ref{sec:stringthreshold}. }. For $\tilde{V}_c(2r)$, in the next section, we calculate the amplitude for the one-particle exchange between the revolving D$p$-branes in Type II supergravity. Before discussing details, we first briefly explain our procedure to calculate the one-loop radiative corrections to the effective potential based on the background field method. We first divide the field configurations into collective coordinates and fluctuations around it. The collective coordinates represent generally off-shell background. In the present case, it represents the revolving motion of D-branes. On the other hand, fluctuations are chosen so that they are perpendicular to the collective coordinates in the field configurations so that the Gaussian integrations can be performed. Massive open string modes correspond to these fluctuations. Then by calculating the one-loop determinant, we can obtain one-loop corrections to the effective potential. The maximally supersymmetric Yang-Mills theory in $p$+1 dimensions consists of gauge fields $A_{\mu}$ $(\mu=0,1,\cdots,p)$, scalar fields $\Phi_I$ $(I=p+1,\cdots,9)$ and fermions which are obtained from a Majorana-Weyl fermion $\Psi$ in ten dimensions via the dimensional reduction. Since we want to describe two D$p$-branes revolving around each other, we choose the gauge group to be ${\rm SU}(2)$. The ${\rm U}(1)$ part describes the center of mass degrees of freedom and it is irrelevant in the present analysis. The signature of the metric is $(-1,1,\cdots,1)$ all through the paper. The action including a gauge-fixing term and the associated ghost action is given by \begin{eqnarray} S &=&\frac{1}{g^2}\int d^{p+1}x\ \textrm{Tr}\left[-\frac14F_{\mu \nu}F^{\mu \nu}-\frac12D_{\mu}\Phi_ID^{\mu}\Phi^I +\frac14([\Phi_I,\Phi_J])^2\right.\nonumber \\ &&\left.\hspace{2.5cm}+\frac i2\bar \Psi \Gamma^{\mu}D_{\mu}\Psi +\frac12\bar \Psi \Gamma^I[\Phi_I,\Psi]\right] \nonumber \\ & &-\frac1{2g^2}\int d^{p+1}x\ \textrm{Tr}\left[(\partial^\mu A_\mu-i[B^I,\Phi_I])^2\right] \nonumber \\ [1mm] & &+\frac1{g^2}\int d^{p+1}x\ \textrm{Tr}\left[\bar c(\partial^\mu D_\mu c-[B^I,[\Phi_I,c]])\right], \label{SYM action} \end{eqnarray} where $\Gamma^\mu, \Gamma^I$ are the Dirac matrices in ten dimensions, and $B_I$ are background fields for the scalars $\Phi_I$. We have chosen the background field gauge \begin{equation} \partial^\mu A_\mu-i[B_I,\Phi^I]=0. \end{equation} (See e.g. \cite{Becker:1997wh}.) This is a natural gauge choice from the point of view of ${\cal N}=1$ SYM theory in ten dimensions. \vspace{5mm} \subsection{SYM in a general background $B_I$} \vspace{5mm} We expand the action of eq.(\ref{SYM action}) around the background $B_I$ by setting \begin{equation} A_\mu=a_\mu,\hspace{1cm}\Phi_I=B_I+\phi_I,\hspace{1cm}\Psi=\psi. \end{equation} The relevant part $S_2$ of the action for obtaining the one-loop determinant consists of terms quadratic in the fluctuations $a_\mu$, $\phi_I$ and $\psi$. It is given by \begin{eqnarray} S_2&=&\frac{1}{g^2}\int d^{p+1}x\ \textrm{Tr}\left[-\frac12(\partial_\mu a_\nu)^2+\frac12[B_I,a_\mu]^2-\frac12(\partial_\mu \phi_I)^2 +\frac12[B_I,\phi_J]^2 \right. \nonumber \\ [2mm] &&\left. \hspace{3cm}+[B_I,B_J][\phi^I,\phi^J]+2i\partial_\mu B_I[a^\mu,\phi^I]\right. \nonumber \\ [2mm] &&\left.\hspace{2.5cm}+\frac i2\bar \psi \Gamma^{\mu}\partial_{\mu}\psi+\frac12\bar \psi \Gamma^I[B_I,\psi] +\bar c \partial^\mu \partial_\mu c-\bar c[B^I,[B_I,c]]\right]. \nonumber \\ \end{eqnarray} In the following, we are interested in a background configuration $B_I$ corresponding to a motion of the D$p$-branes. The background configuration $B_I$ takes the form of \begin{equation} B_I=b_I(t) \sigma_3, \end{equation} where $b_I(t)$ are functions of time $t$, describing the trajectories of the D$p$-branes, and $\sigma_i$ are Pauli matrices. It turns out that most of the terms in $S_2$ including $B_I$ are the mass terms for the fluctuations. In addition, there is a mixing term of the gauge field $a^\mu$ and the scalar field $\phi^I$, $2i\partial_\mu B_I[a^\mu, \phi^I]$ which gives a non-trivial effect of the background to the one-loop determinant. The effective potential between the D$p$-branes are induced by an open string stretched between them. Such an open string corresponds to the off-diagonal components of the fluctuations, which are proportional to $\sigma_{1,2}$. As mentioned before, there are no linear terms for them in the action. To compute the one-loop determinant relevant for the effective potential, we perform the Wick rotation \begin{equation} t=-i\tau, \hspace{1cm} a_0=ia_\tau, \hspace{1cm} \Gamma^0=-i\Gamma_\tau \label{Wick rotation} \end{equation} to regularize the path integral, and set \begin{equation} a_m =\tilde{a}_m\sigma_+ + \tilde{a}_m^\dagger \sigma_-, \hspace{1cm} \phi_I=\varphi_I \sigma_+ + \varphi_I ^\dagger \sigma_-, \hspace{1cm} \psi=\chi\sigma_+ + \tilde {\chi}\sigma_-, \end{equation} where $\sigma_\pm:=\frac12(\sigma_1\pm i\sigma_2)$ and $m=1,\cdots,p,\tau$. Note that $\chi$ and $\tilde{\chi}$ are related to each other by the Majorana-Weyl condition of $\psi$. Inserting them into $S_2$, we obtain \begin{eqnarray} S_2 &=& \frac1{g^2}\int d^{p+1}x\ {\rm Tr}\left[ |\partial_m a_n|^2+4(b_I)^2|a_m|^2+|\partial_m\varphi_I|^2+4(b_I)^2|\varphi_J|^2 \right. \nonumber \\ & & \hspace*{2cm} -4i\partial_m b_I(a_m\varphi_I^\dagger-a_m^\dagger \varphi_I) +i\bar \chi \Gamma_m \partial_m\chi - 2\bar \chi\Gamma_Ib_I\chi \nonumber \\ [1mm] & & \left. \hspace*{2cm}+\bar c_+\partial^2 c_+ + \bar c_-\partial^2 c_--4(b_I)^2(\bar c_+ c_+ + \bar c_- c_-) \right], \end{eqnarray} where we denoted $a_m$ instead of $\tilde{a}_m$ for notational simplicity. \vspace{5mm} \subsection{One-loop amplitude of SYM in revolving D$p$-branes} \vspace{5mm} We now consider a specific background corresponding to the revolving D$p$-branes ($p \leq 7$) in the 8-9 plane. The extended directions of D$p$-branes are taken to be the same and thus always in parallel. The corresponding background configuration is given by \begin{equation} b_8=r \cos \omega \tau,\hspace{1cm}b_9= r \sin \omega \tau, \label{B_I} \end{equation} and $b_I=0$ otherwise, where $\omega$ is the angular frequency of the revolution and $r$ is the radius of the circle on which the D-branes are revolving. Note that $\omega$ above has been analytically continued according to the Wick rotation of eq.(\ref{Wick rotation}). To recover the results in the Lorentzian signature, we will replace $\omega$ with $-i\omega$. At first sight, since the quadratic action $S_2$ for the above stationary configuration $b_I$ is $\tau$-dependent, one may think that the one-loop determinant also depends on $\tau$. Indeed, it is the case when D-branes are moving with a constant relative velocity \cite{Bachas:1995kx,Lifschytz:1996iq}. But in the present situation, since the motion is stationary, the $\tau$-dependence of the effective potential can be eliminated. By introducing new fields $\varphi_\pm$ defined by \begin{equation} \varphi_{\pm}:=\frac1{\sqrt2}e^{\mp i\omega \tau}(\varphi_8\pm \varphi_9), \end{equation} the $\tau$-dependence of the bosonic part of $S_2$ can be eliminated. Similarly, the $\tau$-dependence of the fermionic part of $S_2$ can be eliminated by introducing \begin{equation} \theta:=\exp \left[\frac12 \omega \tau \Gamma^{89}\right]\chi. \end{equation} In terms of these new fields, the quadratic action $S_2$ becomes \begin{equation} S_2=\frac1{g^2}\int d^{p+1}x\,\left[ L_B+L_F+L_{\rm free} \right] \end{equation} where \begin{eqnarray} L_B &=&|(\partial_m+i\omega_m)\varphi_+|^2+4r^2|\varphi_+|^2+|(\partial_m-i\omega_m)\varphi_-|^2+4r^2|\varphi_-|^2 \nonumber \\ &&+|\partial_m a|^2+4r^2|a|^2 -2\sqrt{2}r\omega \left(\varphi_- a^\dagger+\varphi_-^\dagger a-\varphi_+ a^\dagger -\varphi_+^\dagger a \right), \\ L_F &=&i\bar{\theta}\Gamma_m \left( \partial_m-\frac12\omega_m\Gamma^{89} \right)\theta -2r\bar{\theta}\Gamma^8\theta, \\ L_{\rm free} &=&|\partial_m a_i|^2+4r^2|a_i|^2 +\bar{c}_+\partial^2c_+-4r^2\bar{c}_+c_++\bar{c}_-\partial^2c_--4r^2\bar{c}_-c_-. \nonumber \\ \end{eqnarray} Here, we defined $\omega_m:=\omega\delta_{m\tau}$ and $i=1,2,\cdots,p$. For notational simplicity, we used $a$ instead of $a_\tau$. Now we can compute the one-loop determinant. Since the $\tau$-dependence is no longer present, we can employ the momentum representation. Then, the bosonic Lagrangian $L_B$ can be written as \begin{eqnarray} &&(k^2+4r^2)\left|a(k)-\frac{2\sqrt2r\omega}{k^2+4r^2}(\varphi_-(k)-\varphi_+(k))\right|^2 \nonumber \\ [2mm] &&+(k^2+\omega^2+4r^2+2\omega k_\tau)|\varphi_+(k)|^2+(k^2+\omega^2+4r^2-2\omega k_\tau)|\varphi_+(k)|^2 \nonumber \\ [2mm] &&-\frac{8(r\omega)^2}{k^2+4r^2}|\varphi_-(k)-\varphi_+(k)|^2, \end{eqnarray} where $k^2=(k_m)^2$. The path integral for $a$ can be easily performed, resulting in the determinant $\det(-\partial^2+4r^2)^{-1}$. To perform the path integral for $\varphi_\pm$, we need to diagonalize the matrix \begin{equation} \left(k^2+\omega^2+4r^2-\frac{8(r\omega)^2}{k^2+4r^2}\right) I_{2 \times 2}+ \left(\begin{array}{cc} \displaystyle{2\omega k_\tau}&\displaystyle{\frac{8(r\omega)^2}{k^2+4r^2}} \\ \displaystyle{\frac{8(r\omega)^2}{k^2+4r^2}} &\displaystyle{-2\omega k_\tau} \end{array}\right), \end{equation} where $I_{2\times 2}$ is the diagonal matrix. Its eigenvalues are given by \begin{equation} E_{B\pm}(k):=k^2+\omega^2+4r^2-\frac{8(r\omega)^2}{k^2+4r^2} \pm\sqrt{4\omega^2k_\tau^2+\left(\frac{8(r\omega)^2}{k^2+4r^2}\right)^2}. \end{equation} Hence, the path integral for the bosonic field $\varphi_\pm$ gives $\det(E_{B+}(-i\partial))^{-1}\det(E_{B-}(-i\partial))^{-1}$. \vspace{5mm} Next, consider the fermionic part $L_F$. In the momentum representation, it can be written as \begin{eqnarray} -(\begin{array}{cc} \bar \theta_+&\bar \theta_- \end{array}) \left(\begin{array}{cc} \Gamma_m(k_m+\frac12 \omega_m)&2r \Gamma^8\\ 2r\Gamma^8&\Gamma_m(k_m-\frac12 \omega_m) \end{array}\right) \left(\begin{array}{c} \theta_+\\ \theta_- \end{array}\right), \label{quadratic fermion} \end{eqnarray} where $\theta_\pm$ satisfy $i\Gamma^{89}\theta_\pm=\pm\theta_{\pm}$. The result of the path integral is given by the determinant of the following matrix \begin{eqnarray} & & \left[ \begin{array}{cc} \left( k_m+\frac12\omega_m \right)^2+4r^2 & 2r\omega\Gamma^{\tau8} \\ 2r\omega\Gamma^{8\tau} & \left( k_m-\frac12\omega_m \right)^2+4r^2 \end{array} \right] \nonumber \\ &=& \left[ \begin{array}{cc} 1 & 0 \\ 0 & \Gamma^{8\tau} \end{array} \right]\left[ \begin{array}{cc} \left( k_m+\frac12\omega_m \right)^2+4r^2 & 2r\omega \\ 2r\omega & \left( k_m-\frac12\omega_m \right)^2+4r^2 \end{array} \right]\left[ \begin{array}{cc} 1 & 0 \\ 0 & \Gamma^{\tau8} \end{array} \right], \nonumber \\ \end{eqnarray} which is the square of the matrix in eq.(\ref{quadratic fermion}). The eigenvalues of this matrix are \begin{equation} E_{F\pm}(k)=k^2+\frac14 \omega^2+4r^2\pm \omega \sqrt{k_\tau^2+4r^2} \end{equation} with multiplicity four for each of them. Therefore, the resulting determinant is given by $\det(E_{F+}(-i\partial))^4\det(E_{F-}(-i\partial))^4$. \vspace{5mm} The remaining part $L_{\rm free}$ simply gives $\det(-\partial^2+4r^2)^{-5}$. \vspace{5mm} In summary, we obtain the one-loop determinant whose logarithm is given by \begin{eqnarray} &&\log \Bigl[ \det(-\partial^2+r^2)^{-6}\det(E_{B+}(-i\partial))^{-1}\det(E_{B-}(-i\partial))^{-1} \nonumber \\ && \hspace*{1cm}\times \det(E_{F+}(-i\partial))^{4}\det(E_{F-}(-i\partial))^{4} \Bigr] \nonumber \\ [2mm] &=& \int_{\Lambda^{-2}}^\infty \frac{dt}{t}\int \frac{d^{p+1}k}{(2\pi)^{p+1}} \Bigl[ e^{-tE_{B+}(k)}+e^{-tE_{B-}(k)} \nonumber \\ [1mm] &&\hspace*{2cm}-4\left( e^{-tE_{F+}(k)}+e^{-tE_{F-}(k)} \right)+6\,e^{-t(k^2+4r^2)} \Bigr], \label{1-loop det} \end{eqnarray} where $\Lambda$ is a UV momentum cutoff with mass dimension 1. In section \ref{VO}, it is fixed at $\Lambda=m_s$ following the recipe in section \ref{recipe}. A similar calculation was performed in \cite{Bachas:1995kx} where D0-branes are moving with constant velocities. In this situation, an open string stretched between the D0-branes changes its length with time. If the change is non-adiabatic, this causes the parametric resonance, resulting in open string pair productions. Indeed, the one-loop determinant for this system has an imaginary part. On the other hand, since our investigation is performed to find a possibility of a solution in which the induced attractive potential and the centrifugal potential are balanced, we assumed that the revolving D-brane system we have discussed so far is stationary. Thus the length of the stretched open string is constant in time and there is no pair production of open strings, indicated by the absence of an imaginary part in the one-loop determinant (\ref{1-loop det}). \vspace{5mm} \subsection{One-loop effective potential $\tilde{V}_o(2r)$ from SYM \label{VO} } \vspace{5mm} The contributions from the open light modes to the effective potential $\tilde{V}_o(2r)$ are given as a sum of the bosonic and fermionic ones, \begin{equation} \tilde{V}_o(2r)=\tilde{V}_{o,B}(2r)+\tilde{V}_{o,F}(2r) \end{equation} where they are given by \begin{eqnarray} \tilde{V}_{o,B}(2r) &=&-\int_{\Lambda^{-2}}^\infty\frac{dt}{t}\int\frac{d^{p+1}k}{(2\pi)^{p+1}} \left[ e^{-tE_{B+}(k)}+e^{-tE_{B-}(k)}+6e^{-t\left( k^2+4r^2 \right)} \right], \nonumber \\ \\ \tilde{V}_{o,F}(2r) &=& 4\int_{\Lambda^{-2}}^\infty\frac{dt}{t}\int\frac{d^{p+1}k}{(2\pi)^{p+1}} \left[ e^{-tE_{F+}(k)}+e^{-tE_{F-}(k)} \right]. \end{eqnarray} The ghost contribution is included in the bosonic part, $\tilde{V}_{o,B}(2r)$. Let us now determine the cutoff parameter $\Lambda$ following the recipe in section \ref{recipe}. The factor due to the string tension in the above expression is ${\rm exp}(-r^2t/(\pi\alpha')^2)$ where $\alpha'$ is recovered. Since $R=2r$, the recipe tells us to choose the cutoff at $\tilde{t}_{\rm cutoff}=1$ when we rescale the variable $t$ so that ${\rm exp}(-r^2t/(\pi\alpha')^2) = {\rm exp}(-(2r)^2\tilde{t}/2 \pi\alpha')$. Thus we choose $t=2 \pi \alpha' \tilde{t}$ and the momentum cutoff $\Lambda$ can be fixed by the relation, $t_{\rm cutoff} =\Lambda^{-2} = 2\pi\alpha' \tilde{t}_{\rm cutoff} = 2\pi\alpha'$. Therefore, $\Lambda=m_s$. Though $\Lambda$ should be fixed as above, it is interesting to see the asymptotic behavior of $\tilde{V}_o(2r)$ at large $r$ in the limit $\Lambda\to\infty$. By rescaling the integration variables, $\tilde{V}_o(2r)$ is rewritten as \begin{eqnarray} \tilde{V}_o(2r) &=&-r^{p+1}\int_{r^2\Lambda^{-2}}^\infty\frac{dt}{t}\int\frac{d^{p+1}k}{(2\pi)^{p+1}}e^{-t(k^2+4)} \Bigg[ 6 - 8e^{-\frac{\alpha^2}4t}\cosh\left( t\alpha\sqrt{k_\tau^2+4} \right) \nonumber \\ && \hspace*{1cm}+ 2e^{-t\left( \alpha^2-\frac{8\alpha^2}{k^2+4} \right)} \cosh\left( t\sqrt{4\alpha^2k_\tau^2+\left( \frac{8\alpha^2}{k^2+4} \right)^2} \right) \Bigg], \end{eqnarray} where $\alpha:=\omega/r$. This indicates that the $1/r$ expansion of this expression corresponds to the $\alpha$ expansion. We find that there are no terms with an odd power of $\alpha$, as it should be, since the potential is independent of the direction of rotation with angular frequency $\omega$. The ${\cal O}(\alpha^0)$ terms cancel trivially due to supersymmetry. The next ${\cal O}(\alpha^2)$ terms also cancel between $\tilde{V}_{o,B}(2r)$ and $ \tilde{V}_{o,F}(2r)$; \begin{equation} -r^{p+1}\int_{r^2\Lambda^{-2}}^\infty\frac{dt}{t}\int\frac{d^{p+1}k}{(2\pi)^{p+1}}e^{-t(k^2+4)} \cdot 16\alpha^2\left( \frac t{k^2+4}-t^2 \right)\stackrel{\Lambda\to0}{\longrightarrow}0. \end{equation} Then, the leading non-vanishing terms are ${\cal O}(r^{p+1}\alpha^4)$, or equivalently ${\cal O}(v^4/r^{7-p})$, where $v:=r\omega$. This behavior, which can be interpreted as the effective potential for D$p$-branes at large $r$, is the same as the one expected from the supergravity calculation, which will be shown in the next section. The effective potential $\tilde{V}_o(2r)$ in the Lorentzian signature is obtained by the replacement $\omega \rightarrow -i \omega$ after evaluating the integral in the Euclidean signature. Details are discussed in section \ref{Epotential}. We briefly comment on some properties of the effective potential. For $r > l_s$, the effective potential represents an attractive force, which qualitatively agrees with the supergravity result. For small $r < l_s$, on the other hand, the effective potential behaves nontrivially as a function of $r$ and $\omega$. Many cancellations occur between bosons and fermions and we will show that, for $p=3$, a minimum of the potential appears at a fixed value of $\omega$. \vspace{5mm} \section{Supergravity calculations in revolving D$p$-branes} \label{sugra} \vspace{5mm} In this section, we calculate the classical potential $\tilde{V}_c(2r)$ by the one-particle exchanges of massless closed string modes. \vspace{5mm} \subsection{Potential between D-branes mediated by supergravity fields} \label{propagator} \vspace{5mm} The relevant fields are the graviton, dilaton and R-R ($p$+1)-field. The bosonic part of the action of Type II supergravity is given by \begin{equation} S_{\rm SUGRA}=\frac1{2\kappa_{10}^2}\int d^{10}x \sqrt{-g}\left[R+\frac12(d \Phi)^2+\frac12(dC^{(p+1)})^2+\cdots \right], \end{equation} where the fields are normalized such that the kinetic terms become canonical. Then the propagators are given by \begin{eqnarray} \mbox{dilaton:} && \Delta(x):=2\kappa_{10}^2\int \frac{d^{10}k}{(2\pi)^{10}}\frac{e^{ik\cdot x}}{k^2}, \\ \mbox{graviton:} && \Delta_{\mu\nu;\rho\sigma}(x):=\left(\eta_{\mu\rho}\eta_{\nu\sigma}+\eta_{\mu\sigma}\eta_{\nu\rho}-\frac14 \eta_{\mu\nu}\eta_{\rho\sigma}\right)\Delta(x), \\ \mbox{R-R field:} && \Delta_{\mu_0\cdots\mu_p;\nu_0\cdots\nu_p}(x) :=\ \sum_{\sigma\in {\cal S}_{p+1}}{\rm sgn}(\sigma)\,\eta_{\mu_0\nu_{\sigma(0)}}\cdots\eta_{\mu_p\nu_{\sigma(p)}}\Delta(x), \end{eqnarray} where the target space indices run over $0,1\cdots,9$. \vspace{5mm} We then specify how these supergravity fields are coupled to D-branes. Suppose that a D$p$-brane is embedded in the target space as \begin{equation} X^\mu=X^\mu(\zeta) \end{equation} where $\zeta^\alpha$ are the worldvolume coordinates with $\alpha=0,1,\cdots,p$. The interaction vertices of the D$p$-brane with the supergravity fields can be read off from the DBI action with CS term \begin{equation} S_{\rm DBI+CS}=T_p\int d^{p+1}\zeta\left[ e^{\frac14(p-3)\Phi} \sqrt{-\hat g}+\hat C_{p+1}\right], \end{equation} where $T_p$ is the tension of a D$p$-brane and \begin{equation} \hat g_{\alpha \beta}=\partial_\alpha X^\mu \partial_\beta X^\nu g_{\mu\nu}, \hspace{1cm} \hat C^{(p+1)}_{\alpha_1 \cdots \alpha_{p+1}} =\partial_{\alpha_1} X^{\mu_1}\cdots\partial_{\alpha_{p+1}} X^{\mu_{p+1}} C^{(p+1)}_{\mu_1 \cdots \mu_{p+1}} \end{equation} are the induced fields on the worldvolume. The vertices can be read off from the variations of this action. The relevant terms are \begin{eqnarray} \mbox{dilaton:} && \frac{p-3}{4}T_p\int d^{p+1}\zeta\,\sqrt{-\det\hat{\eta}_{\alpha\beta}} \, \delta\phi,\\ [1mm] \mbox{graviton:} && -\frac{1}{2}T_p\int d^{p+1}\zeta\,\sqrt{-\det\hat{\eta}_{\alpha\beta}}\, \hat{\eta}^{\gamma\delta}\partial_{\gamma} X^\mu\partial_{\delta} X^\nu \, \delta g_{\mu\nu}, \\ [1mm] \mbox{R-R field:} && \frac{T_p}{(p+1)!}\int d^{p+1}\zeta\,\epsilon^{\alpha_0\cdots\alpha_p} \partial_{\alpha_0}X^{\mu_0}\cdots\partial_{\alpha_p}X^{\mu_p} \, \delta C_{\mu_0 \cdots \mu_p}, \end{eqnarray} where \begin{equation} \hat{\eta}_{\alpha\beta}:=\partial_\alpha X^\mu \partial_\beta X^\nu \eta_{\mu\nu}, \hspace{1cm} \hat{\eta}^{\alpha\beta}\hat{\eta}_{\beta\gamma}=\delta^\alpha_\gamma. \end{equation} The dilaton vacuum expectation value is absorbed in the string coupling constant. \vspace{5mm} Using the above propagators and interaction vertices, the classical potential is given by a sum of contributions of the exchanges of the supergravity fields: \begin{equation} \tilde{V}_{c}= -2\kappa_{10}^2\int d^{p+1}\zeta\int d^{p+1}\tilde{\zeta}\,\Delta(X-\tilde{X}) \left( F_\Phi(X,\tilde{X})+F_g(X,\tilde{X})+F_C(X,\tilde{X}) \right), \label{V_C general} \end{equation} where \begin{eqnarray} F_\Phi(X,\tilde{X}) &=& \left( \frac{p-3}{4} \right)^2T_p^2 \sqrt{-\det\hat{\eta}_{\alpha\beta}(X)}\sqrt{-\det\hat{\eta}_{\gamma\delta}(\tilde{X})}, \\ [2mm] F_g(X,\tilde{X}) &=& T_p^2\sqrt{-\det\hat{\eta}_{\alpha\beta}(X)}\sqrt{-\det\hat{\eta}_{\gamma\delta}(\tilde{X})} \nonumber \\ &&\times \left( -\frac{(p+1)^2}{16} +\frac12\hat{\eta}^{\alpha\beta}(X)(\partial_\beta X\cdot\partial_\delta\tilde{X}) \hat{\eta}^{\delta\gamma}(\tilde{X})(\partial_\gamma\tilde{X}\cdot\partial_\alpha X) \right), \nonumber \\ \\ F_C(X,\tilde{X}) &=& T_p^2\det(\partial_\alpha X\cdot\partial_\beta\tilde{X}). \end{eqnarray} Here, $F_\Phi(X,\tilde{X})$, $F_g(X,\tilde{X})$ and $F_C(X,\tilde{X})$ are contributions from the dilaton, graviton and RR-fields, respectively. Details of the calculations are given in Appendix \ref{appendix:sugra-general}. \vspace{5mm} \subsection{Supergravity potential of Revolving D$p$-branes} \label{SUGRA potential} \vspace{5mm} We apply the result of eq.(\ref{V_C general}) to the revolving D$p$-branes. The embedding functions $X^\mu$ and $\tilde{X}^\mu$ for the revolving D$p$-branes are given by \begin{equation} \begin{array}{lll} X^\alpha=\zeta^\alpha, \hspace{5mm} & X^8=r\cos \omega \zeta^0, \hspace{5mm} & X^9=r\sin \omega \zeta^0, \\ [2mm] \tilde{X}^\alpha=\tilde{\zeta}^\alpha, \hspace{5mm} & \tilde{X}^8=-r\cos \omega \tilde{\zeta}^0, \hspace{5mm} & \tilde{X}^9=-r\sin \omega \tilde{\zeta}^0. \end{array} \end{equation} Inserting these functions into eq.(\ref{V_C general}) and performing some of the integrations, we obtain \begin{eqnarray} \tilde{V}_{c} (2r)&=& -\kappa_{10}^2T_p^2(4\pi)^{-\frac{10-p}{2}}\frac{v^4}{1+v^2} \int^\infty_{\tilde{\Lambda}^{-2}} ds \ s^{-\frac{10-p}{2}} \nonumber \\ &&\times \int d\zeta \exp\left[-\frac1{4s} \left(\zeta^2+2r^2(1+\cos \omega \zeta)\right)\right] (1+\cos \omega \zeta)^2, \label{V_C rev} \end{eqnarray} where $v = r \omega$. For details of the calculations, see Appendix \ref{appendix:sugra-revolvingDp}. Note that we have performed the Wick rotation of $\zeta^0$ and $\tilde{\zeta}^0$ so that the integral is well-defined. $\omega$ is analytically continued as well. Following the recipe in section \ref{recipe}, the cutoff $\tilde{\Lambda}$ is fixed as follows. The suppression factor due to the string tension in the above integrand is given by ${\rm exp}(-r^2/s)$. The cutoff is chosen at $\tilde{s}=1$ when this factor is expressed as ${\rm exp}(-(2r)^2/(2\pi\alpha' \tilde{s}))$. Thus we take $s= \pi \alpha' \tilde{s}/2$ and $s_{\rm cutoff}=\tilde{\Lambda}^{-2} =\pi \alpha'/2$. Hence $\tilde{\Lambda}$ needs to be fixed at $\tilde{\Lambda}=\sqrt{4/(2\pi\alpha')}=2 m_s$. Several comments are in order. First, let us investigate the large $r$ behavior of the potential with $v$ fixed as a small value. The integral eq.(\ref{V_C rev}) becomes \begin{equation} \tilde{V}_{c} (2r)= -(4\pi^2\alpha')^{3-p}(4\pi)^{-\frac{7-p}{2}}\Gamma({\scriptstyle \frac{7-p}{2}})\frac{v^4}{r^{7-p}} +{\cal O}(v^6), \label{sugra-large-r} \end{equation} It reproduces the effective potential for two D$p$-branes moving with the relative velocity $2v$ and the impact parameter $2r$, which can be calculated in string worldsheet theory (see eq.(13.5.7) in \cite{Polchinski:1998rr}). This provides a consistency check for our result in eq.(\ref{V_C rev}). We note that the potential from the supergravity calculation in eq.(\ref{sugra-large-r}) is proportional to $v^4/r^{7-p}$. This behavior in case of $p=0$ is well-known in the calculation of D0-brane scattering in the BFSS matrix theory \cite{Banks:1996vh,Seiberg:1997ad}. As mentioned at the end of section \ref{VO}, the same potential can be reproduced from the SYM calculation, if we take the UV cutoff to infinity $\Lambda \rightarrow \infty.$ In our calculation, $\Lambda$ needs to be fixed at $m_s$ in order to avoid the double counting, and the behavior of the Newton potential at large $r$ is generated only by the supergravity calculation. There is no chance of a bound state at large distances $r > l_s$. The potential is proportional to $-\omega^4 r^{p-3}$ and a very weak attractive potential. Indeed, if angular momentum of the revolving D-brane is conserved, $\omega$ is proportional to $1/r^2$. Then the potential is proportional to $- r^{p-11}$. Though it is attractive, the attractive force is too weak to balance with the repulsive centrifugal potential which is proportional to $1/r^2$. Finally, note that the potential in eq.(\ref{V_C rev}) is proportional to $v^4=\omega^4 r^4$ and the $v^2=\omega^2 r^2$ terms are cancelled. It is contrary to a naive expectation that there are large radiative corrections to the $\omega^2 r^2$ term in the effective potential: the supersymmetry breaking scale is given by $\omega$. We come back to this property in the next section. \vspace{5mm} \section{One-loop effective potential at all ranges of $r$ \label{Epotential} } \vspace{5mm} We now investigate the behavior of the one-loop contributions, in the sense of open-strings, to the effective potential at all ranges of $r$ by adding the contributions from SYM and supergravity; $\tilde{V}(2r)= \tilde{V}_o(2r)+\tilde{V}_c(2r)$. Here we assume that the angular frequency is small compared to the string scale, $\omega \ll m_s$ and the pair of D$p$-branes are revolving slowly. We mainly focus on the $p=3$ case. D0-branes are also interesting from the BFSS matrix theory point of view, since a threshold bound state is expected to arise \cite{Kabat:1996cu,Danielsson:1996uw}. We leave its detailed analysis for future investigations. In the following, we recover $\alpha'$ and the ``distance'' $r$ is defined to have mass dimension 1. The gauge theory results turn out to be intact by regarding $r$ as a quantity with mass dimension $1$. For the supergravity result, we need to replace $r$ with $2\pi\alpha'r$ in order to combine it with the gauge theory result for obtaining the effective potential in the worldvolume effective field theory. The contributions from open light modes to the potential in Euclidean signature is given by a sum of these two contributions, \begin{eqnarray} \tilde{V}_{o,B}(2r)&= & -\int_{\Lambda^{-2}}^\infty \frac{dt}{t}\int\frac{d^{p+1}k}{(2\pi)^{p+1}} e^{-(k^2+4r^2)t} \nonumber \\ && \times \left[ 6+2e^{-\omega^2t+\frac{8(r\omega)^2}{k^2+4r^2}t} \cosh\left( t\sqrt{4\omega^2k_\tau^2+\left( \frac{8(r\omega)^2}{k^2+4r^2} \right)^2} \right) \right], \nonumber \\ [2mm] \tilde{V}_{o,F}(2r)&= & 8\int_{\Lambda^{-2}}^\infty\frac{dt}{t}\int\frac{d^{p+1}k}{(2\pi)^{p+1}}e^{-(k^2+4r^2)t}e^{-\frac14\omega^2t} \cosh\left( t\sqrt{\omega^2k_\tau^2+4(r\omega)^2} \right), \nonumber \\ [2mm] \label{openpotential-summary} \end{eqnarray} where the UV cutoff is fixed as $\Lambda=\sqrt{1/2\pi\alpha' }= m_s$. They are complicated integrals and the behaviors at small $r$ and $\omega$ are nontrivial. We first look at some general behaviors. First, as discussed at the end of section \ref{VO}, the potential is exponentially damped $\tilde{V}_o \sim e^{-4r^2/\Lambda^2}$ at large $r > \Lambda=m_s$. In the small $r$ region, it behaves nontrivially, though the potential vanishes at $r=0$. This can be seen by setting $r=0$ in eq.(\ref{openpotential-summary}). \begin{eqnarray} \tilde{V}_{o,B}(2r)&= & -\int_{\Lambda^{-2}}^\infty \frac{dt}{t}\int\frac{d^{p+1}k}{(2\pi)^{p+1}}e^{-k^2t} \left[ 6+2e^{-\omega^2t}\cosh\left(2 \omega k_\tau t \right) \right], \nonumber \\ [2mm] \tilde{V}_{o,F}(2r)&= & 8\int_{\Lambda^{-2}}^\infty\frac{dt}{t}\int\frac{d^{p+1}k}{(2\pi)^{p+1}}e^{-k^2t} e^{-\frac14\omega^2t}\cosh\left( \omega k_\tau t \right). \end{eqnarray} Then, the $\omega$ dependence in each integral is removed by a shift of $k_\tau$ variable: $k_\tau \rightarrow k_\tau \pm \omega$ for the bosonic contribution and $k_\tau \rightarrow k_\tau \pm \omega/2$ for the fermionic contribution. We see that the bosonic and fermionic contributions are cancelled at $r=0$ and $\tilde{V}_o(0)=0$. Thus, the supersymmetry makes the potential non-singular at $r=0$. Similarly the potential $\tilde{V}_o(2r)$ vanishes at $\omega=0$. The contributions from the supergravity $\tilde{V}_c(2r)$ in eq.(\ref{V_C rev}) gives the Newton potential at large $r$ and the threshold corrections to $\tilde{V}_o(2r)$ at small $r$. We discuss more details later, but here note that the potential is proportional to $v^4=\omega^4 r^4$, and there are no terms proportional to $v^2$. As discussed in the introduction, since the supersymmetry breaking scale is given by $\omega$, we may naively expect large threshold corrections proportional to $\omega^2 r^2$ from open string massive modes. In the present calculations, however, they are cancelled between infinitely many modes, and no terms like $\omega^2 r^2$ are generated for the moduli field $r$ in the worldvolume effective field theory. It might be a stringy effect with infinitely many particles, and could not occur in ordinary quantum field theories. It is amusing if a similar mechanism would be applied to the hierarchy problem of the Higgs potential in the Standard Model. \vspace{5mm} \subsection{Shape of the one-loop contributions of the effective potential} \vspace{5mm} In this section, in order to get an overview of the one-loop effective potential $\tilde{V}(2r)$, we expand the formulae in eq.(\ref{openpotential-summary}) with respect to $\omega$ and perform the integrations. First, we look at $\tilde{V}_o(2r)$. From the integral representation of eq.(\ref{openpotential-summary}), the expansion turns out to be an expansion with respect to $\omega/r$. Thus the validity of the following expansion is restricted in the region $\omega < r$. This region is important for phenomenological applications \cite{Iso:2015mva,Iso:2018sgx}. Details of the calculations are given in appendix \ref{potential omega-expansion}. After analytic continuation $\omega \rightarrow -i \omega$, we obtain the effective potential for $p=3$ in the Lorentzian signature up to ${\cal O}(\omega^4)$; \begin{eqnarray} \tilde{V}_{o,B}(2r) &=& -\frac{\Lambda^4}{4\pi^2} \left[ \left( 1-\frac{4r^2}{\Lambda^2} \right)e^{-4r^2/\Lambda^2}+\frac{16r^4}{\Lambda^4}E_1(4r^2/\Lambda^2) \right] \nonumber \\ [2mm] & &-\omega^2 \left[ \frac{r^2}{\pi^2}e^{-4r^2/\Lambda^2} -\left( \frac{r^2}{\pi^2}+\frac{4r^4}{\pi^2\Lambda^2} \right)E_1(4r^2/\Lambda^2) \right] \nonumber \\ [2mm] & & -\omega^4 \left[ \left( \frac{1}{24\pi^2}+\frac{2r^2}{3\pi^2\Lambda^2} +\frac{10r^4}{3\pi^2\Lambda^4} \right)e^{-4r^2/\Lambda^2} -\left( \frac{6r^4}{\pi^2\Lambda^4} +\frac{40r^6}{3\pi^2\Lambda^6} \right)E_1(4r^2/\Lambda^2) \right] \nonumber \\ [2mm] & &+{\cal O}(\omega^6), \\ [3mm] \tilde{V}_{o,F}(2r) &=& \frac{\Lambda^4}{4\pi^2} \left[ \left( 1-\frac{4r^2}{\Lambda^2} \right)e^{-4r^2/\Lambda^2}+\frac{16r^4}{\Lambda^4}E_1(4r^2/\Lambda^2) \right] \nonumber \\ [2mm] & &-\omega^2 \left[ \frac{r^2}{\pi^2}E_1(4r^2/\Lambda^2) \right] -\omega^4\left[ \left( \frac1{48\pi^2} -\frac{r^2}{12\pi^2\Lambda^2} \right)e^{-4r^2/\Lambda^2} \right]+{\cal O}(\omega^6), \label{SYMpotential-w} \end{eqnarray} where $E_n(x)$ are the exponential integral functions defined in eq.(\ref{expintegral}), whose small $x$ behavior for $n=1$ is given by \begin{equation} E_1(x) = -\gamma - \log x + x -\frac{x^2}{4} + {\cal O}(x^3) . \end{equation} Both of the bosonic and fermionic contributions have quartic and quadratic divergences but they are completely cancelled as expected. The sum gives the SYM contribution to the effective potential; \begin{eqnarray} \tilde{V}_{o}(2r) &= &-\frac{\omega^2 r^2 }{\pi^2} \left[ e^{-4r^2/m_s^2} -\left(\frac{4r^2 }{m_s^2} \right)E_1(4r^2/m_s^2) \right] \nonumber \\ [2mm] & & -\omega^4 \left[ \left( \frac{1}{16\pi^2}+\frac{7r^2}{12\pi^2m_s^2} +\frac{10r^4}{3\pi^2m_s^4} \right)e^{-4r^2/m_s^2} \right. \nonumber \\ [2mm] & & \hspace*{1cm}\left. -\left( \frac{6r^4}{\pi^2m_s^4} +\frac{40r^6}{3\pi^2m_s^6} \right)E_1(4r^2/m_s^2) \right]+{\cal O}(\omega^6). \label{open-potential-wexpansion} \end{eqnarray} Here we have replaced $\Lambda$ by $m_s$. This formula is valid as far as the condition $\omega <r $ is satisfied. At large $r$ it is exponentially damped and the potential is negative so that the corresponding force is attractive. From a general discussion, we saw that the potential vanishes $\tilde{V}_o(0)=0$ at the origin. At small $r$ (but $r>\omega$), the potential in eq.(\ref{open-potential-wexpansion}) behaves like the inverted harmonic potential, $-\omega^2 r^2/\pi^2$, and the corresponding force is repulsive for a fixed $\omega$. The next order term proportional to $\omega^4$ seems to give a constant value at $r=0$ and contradict with the general discussion $\tilde{V}_o(0)=0$. However, it is simply because $r=0$ at fixed $\omega$ is out of the validity region of the $\omega$ expansion in eq.(\ref{open-potential-wexpansion}). In the region $r<\omega$, we can perform a different approximation of the integral for $\tilde{V}_o(2r)$ to estimate the shape of the potential. We set $r=\beta \omega$ and expand $\tilde{V}_{o}(2r)$ in terms of $\beta$. As a result, we obtain \begin{eqnarray} \tilde{V}_o &=& \frac{\beta^2\omega^4}{\pi^2}\left( -\frac{m_s^2}{\omega^2}\left( 1-E_2(\omega^2/m_s^2) \right)+\int_{\omega^2/m_s^2}^\infty\frac{dt}{t}e^{-t/4}F({\textstyle \frac12,\frac32;\frac t4}) \right)+{\cal O}(\beta^4). \nonumber \\ \end{eqnarray} Details of the calculations are given in the appendix \ref{r/w expansion}. The leading order behavior with respect to $\omega/m_s$ is the same as the above $\omega$-expansion \begin{equation} \tilde{V}_o(2r) \sim - \frac{\omega^2 r^2}{\pi^2} . \label{small r} \end{equation} Thus, as far as the leading behavior is concerned, eq.(\ref{open-potential-wexpansion}) seems to give a good approximation at small $r$. \vspace{5mm} The contributions from the supergravity calculations in eq.(\ref{V_C rev}) can be also obtained by the $\omega$ expansion. In this case, the expansion is with respect to $v=\omega r$, and the validity holds as far as $\omega r < 1$ (here, the mass dimension of $r$ is taken to be $-1$). Recall that, in this section, $r$ is defined to have mass dimension $1$. Thus we need to multiply $r$ in eq.(\ref{V_C rev}) by $1/2\pi\alpha'=m_s^2$. After expanding eq.(\ref{V_C rev}) with respect to $\omega$, the integrals can be easily performed and we obtain \begin{eqnarray} \tilde{V}_c(2r) &=& -\frac{\omega^4}{16\pi^2} \left[ 1-\left( 1+4 r^2/m_s^2 \right)e^{-4r^2/m_s^2} \right] +{\cal O}(\omega^6) \label{closed-potential-wexpansion} \end{eqnarray} At large $r$, it is approximated by \begin{equation} \tilde{V}_c(2r) \sim \frac{-\omega^4}{16 \pi^2} = -\frac{v^4}{16\pi^2 r^4} \end{equation} with $v=\omega r$, which reproduces the Newton-like potential for D3-branes in D=10. At small $r$, it becomes \begin{equation} \tilde{V}_c(2r) \sim -\frac{\omega^4 r^4}{2\pi^2m_s^4 } . \end{equation} Note that a naively expected term $v^2= \omega^2 r^2$ is absent and the potential starts from $v^4$. It has been known in the large $r$ behavior of the D-brane potential, but it has also an important implication in the small $r$ behavior of the effective potential in the field theory of D-branes. \vspace{5mm} \begin{figure}[!htb] \center \includegraphics [scale=.8] {FigV} \caption{\small The shape of the effective potential $\tilde{V}(2r)$ (the sum of eqs.(\ref{open-potential-wexpansion}) and (\ref{closed-potential-wexpansion})) with $\omega=0.1$ and $\Lambda=1$. } \label{Fig-Vshape} \end{figure} Now we sum the contributions from SYM and supergravity. The shape of the potential $\tilde{V}(2r)$ is drawn in figure \ref{Fig-Vshape} with $\omega$ fixed at $0.1$. At large $r$, Newton potential is reproduced and the corresponding force is attractive. At small $r$, there is a minimum of the one-loop potential and the corresponding force is repulsive. In the intermediate region of $r$, both of the SYM and supergravity contribute to the potential. In the next section, we briefly argue a possibility of a bound state by combining both of the classical centrifugal potential and the one-loop effective potential discussed above. \vspace{5mm} \subsection{Can the revolving D3-branes form a bound state?} Finally we briefly argue whether there exists a bound state of revolving D3-branes with the potential $\tilde{V}(2r)$ studied above. Assume that the angular momentum is conserved and there are no quantum radiation. We then need to take into account the effect of the centrifugal potential for the D3-branes. Also it is necessary to study the behavior of the potential with fixing the angular momentum $L$ of the D3-branes per unit volume, instead of the angular frequency $\omega$. The potential we need to study is given by \begin{equation} U(2r):=\frac{L^2}{4T_3r^2}+\tilde{V}(2r) \end{equation} with $\omega$ replaced with $L/T_3r^2$. The relative distance and reduced mass for a unit volume is given by $2r$ and $T_3/2=m_s^4/4\pi g_s$. Since our calculations are based on the one-loop string calculations, the string coupling constant should be smaller than 1. In such a situation, the potential $U(2r)$ behaves like in Figure \ref{Fig-NoBound}, and there is no minimum, because the centrifugal potential is more dominant than the induced potential by the one-loop calculations. It excludes a possibility of forming a bound state for revolving two D3-branes as long as the string coupling is weak. The situation is changed if we consider a stack of $N$ D3-branes revolving around each other. Suppose that each of the revolving D3-branes are replaced with $N$ D3-branes. Then, $\tilde{V}(2r)$ is multiplied by $N^2$, since there are $N^2$ open strings stretched between the two sets of D3-branes. On the other hand, the centrifugal potential is multiplied by $N$. Therefore, the potential $U(2r)$ is modified as \begin{equation} U_N(2r):=\frac{NL^2}{4T_3r^2}+N^2\tilde{V}(2r). \end{equation} For a sufficiently large $N$, the behavior of $U_N(2r)$ changes to the figure drawn in Figure \ref{Fig-BoundState}, which is qualitatively different from $U(2r)$. The potential at small $r$ in eq.(\ref{small r}) shows that the potential $U_N(r)$ falls off as $r^{-2}$ for small $r$ after replacing $\omega$ by $1/r^2$. It is still questionable if a stable bound state exists, but it is amusing that the potential shows different behavior at small $r$. \begin{figure}[!htb] \center \includegraphics [scale=.8] {FigNoBound} \caption{\small The shape of the potential $U(2r)$ with $T_3=1$, $L=0.01$ and $\Lambda=1$. } \label{Fig-NoBound} \end{figure} \begin{figure}[!htb] \center \includegraphics [scale=.8] {FigBound} \caption{\small The shape of the potential $U_N(2r)$ with $T_3=1$, $L=0.01$ and $\Lambda=1, N=5$. } \label{Fig-BoundState} \end{figure} \section{Conclusions and Discussions} \label{discussion} In this paper, we have calculated the one-loop effective potential between revolving parallel D$p$-branes (especially $p=3$) in ten-dimensional space-time. Since the end points of open strings attached to the D$p$-branes are accelerating, the boundary conditions become complicated, and we cannot exactly obtain the spectrum of open strings. Thus, in the usual method with string worldsheet theory, it is difficult to calculate one-loop open string amplitudes to obtain the shape of the potential in the whole ranges of $r$. In this paper, we have introduced a method of {\it partial modular transformation} and calculated the effective potential without resorting to the conventional method to obtain open string amplitudes. Our method of the partial modular transformation is to perform the modular transformation only in the UV region of the open string modular parameter. Then, the one-loop open string amplitudes can be approximated by a sum of the one-loop amplitudes in the SYM effective worldvolume field theory and tree-level amplitudes in supergravity theory. Corresponding to the partial modular transformation, appropriate cutoffs in both theories are introduced, which can remove undesirable double counting of open and closed channels. Furthermore, the approximation is good with an accuracy of less than $3 \%$. We then applied the method to a system of revolving parallel D$p$-branes (in particular, D3-branes) with angular frequency $\omega$ and the relative distance $2r$. In the SYM side, we calculated one-loop field theory amplitudes in a background corresponding to the revolving motion of D-branes. In the supergravity side, we calculated potential generated by exchanges of supergravity fields between revolving D-branes. Summing these contributions with appropriate cutoffs, we have obtained a potential $\tilde{V}(2r)$ in the whole ranges of $r$. At large $r$, the supergravity potential is reproduced. At small $r$, we found that the potential has a minimum for a fixed $\omega$, and the whole shape is drawn in Figure \ref{Fig-Vshape}. From the field theory point of view, $r$ is the moduli field in effective worldvolume SYM field theory. Due to the supersymmetry, the moduli field is massless at $\omega=0$ and expected to acquire a mass proportional to $\omega$ by supersymmetry breaking. It is indeed the case in the SYM calculations; the $\omega^2 r^2$ term is radiatively generated in the effective potential. On the other hand, the supergravity calculation, which corresponds to one-loop amplitudes of open string massive states, shows that the leading order term of the potential is given by ${\cal O}(\omega^4)\,$\footnote{ This fact is known in the context of D0-brane scattering at large $r$, e.g. \cite{Douglas:1996yp}.}, and no terms like $\omega^2 r^2$ arise. The cancellation of the threshold corrections to the term $\omega^2 r^2$ among infinitely many massive modes will be related to the large supersymmetries in the bulk space-time. We hope to apply the cancellation mechanism of the stringy threshold corrections to the hierarchy problem of the Higgs potential. Another interesting behavior is the shape of the effective potential and a possibility of a bound state. The potential in Figure \ref{Fig-Vshape} has a minimum in small $r$ region, but when we discuss a bound state, we need to take the centrifugal potential into account. With the angular momentum kept fixed, the shape of the potential is changed to Figure \ref{Fig-NoBound} and the minimum disappears. The balance between the centrifugal potential and the induced effective potential is, however, subtle and if we consider a stack of N D-branes, the shape of the potential might change to Figure \ref{Fig-BoundState}. Then the next task is to quantize the collective coordinate, i.e. D-brane relative motion, in the potential of Figure \ref{Fig-BoundState}. In future investigations, we want to come back to the issue of bound states and to construct phenomenologically viable models. \vspace{1cm} {\Large \bf Acknowledgements} \vspace{3mm} We would like to thank Takeshi Morita for enlightening discussions. This work is supported in part by Grants-in-Aid for Scientific Research No.~16K05329, No.~18H03708 and No.~19K03851 from the Japan Society for the Promotion of Science. \vspace{1cm}
\section*{Acknowledgments} This paper grew out of a productive discussion during the special workshop ``Bridging Statistics and Sheaves'' at the Institute for Mathematics and Applications in May 2018. The authors would like to thank the organizers for putting together the workshop, the IMA for hosting the event, and Mikael Vejdemo-Johansson for insightful conversations at the onset of this collaboration. The authors also thank the reviewers for helpful comments and suggestions. JC is partially funded by NSF CCF-1850052. JL is partially funded by EP/P025072/1. BTF is partially funded by NSF CCF-1618605 and DMS-1664858. BW is partially funded by NSF IIS-1513616 and IIS-1910733. \bibliographystyle{abbrv} \input{main.bbl} \end{document} \section{Technical Background} \label{sec:background} We first summarize relevant aspects of Morse theory, see \cite{Milnor1963}, \cite{Matsumoto1997}, and \cite{Nicolaescu2007} for detailed expositions on the topic. We then review known notions of equivalence among Morse functions. After that, we introduce the notions of graph equivalence, height equivalence, and poset equivalence. We conclude by a comparison of equivalence relations among Morse functions. \subsection{Morse Functions and Persistence} \label{sec:morsefuncs-persistence} Let $\Mspace$ be a smooth, compact, orientable manifold, equipped with a Riemannian metric $g_{\Mspace}$, and $f \colon \Mspace \to \Rspace$ be a smooth function. \subsubsection{Morse Functions} A critical point $p$ of $\Mspace$ is \emph{non-degenerate} if there exists a chart $(x_1,\ldots, x_n)$ on a neighborhood $U$ of $p$ such that \begin{enumerate} \item $x_i(p) = 0$ for all $i$, and \item $f(x) = f(p) - x_1^2 -\cdots - x_\lambda^2 + x_{\lambda+1}^2 +\cdots + x_n^2$. \end{enumerate} The number $\lambda$ is the \emph{(Morse) index} of the critical point $p$, and is independent of the choice of chart. The index of a critical point is an integer between $0$ and the dimension of $\Mspace$. A smooth function $f\colon \Mspace \to \Rspace$ is a \emph{Morse function} if all its critical points are non-degenerate. Furthermore, $f$ is an \emph{excellent Morse function} if all critical points have distinct function values~\cite{Nicolaescu2008}. All Morse functions considered in this paper are excellent, and referred to simply as Morse functions. \subsubsection{Handle Decomposition} For $f \colon \Mspace \to \Rspace$ a Morse function, let $\Mspace_t \colonequals f^{-1}(-\infty, t] = \{ x \in \Mspace \mid f(x) \leq t\}$ denote sublevel sets of $f$. Morse theory studies how $\Mspace_t$ changes as the parameter $t$ changes. There are two fundamental theorems regarding handle decomposition of manifolds in Morse theory~\cite{Milnor1963,Matsumoto1997,Nicolaescu2007}. \begin{theorem}[{\cite[Theorem 3.1]{Milnor1963}}] \label{theorem:CMT-A} If $f$ has no critical values in the real interval $[a,b]$, then $\Mspace_a$ and $\Mspace_b$ are diffeomorphic. \end{theorem} \begin{theorem}[{\cite[Theorem 3.2]{Milnor1963},\cite[page 77]{Matsumoto1997}}] \label{theorem:CMT-B} \edits{Let $p$ be a critical point of index $\lambda$ with critical value $c = f(p)$. Suppose that for some $\varepsilon>0$, the set $f^{-1}([p-\varepsilon, p+\varepsilon])$ contains no critical points of $f$ besides $p$. Then the space $\Mspace_{c+\epsilon}$ is diffeomorphic to the manifold obtained by attaching a $\lambda$-handle to $\Mspace_{c-\epsilon}$. That is, $\Mspace_{c+\epsilon}$ is diffeomorphic to $\Mspace_{c-\epsilon} \cup \Dspace^{\lambda} \times \Dspace^{d-\lambda}$, where $\Dspace^\lambda$ denotes a $\lambda$-dimensional disk.} \end{theorem} Summarizing, the sublevel sets of a Morse function change precisely when passing through a critical value. Moreover, this change is completely characterized topologically by the index of the critical point. \subsubsection{Gradient Vector Fields} A \emph{vector field} on a manifold is a smooth section of the tangent bundle. Equivalently, it is a smooth function $v: \Mspace \to \TM$, such that $v(x) \in \TM_{x}$, where $\TM_x$ is the tangent space of $\Mspace$ at $x$. Given a smooth function $f\colon \Mspace \to \Rspace$, the \emph{gradient} of $f$ (with respect to the metric $g_\Mspace$) is a vector field $\grad{f}\colon \Mspace \to \TM$ consisting of vectors in the direction of the steepest ascent of $f$, and is formally dual to the differential $df$. The singularities of $\grad{f}$ coincide with the critical points of $f$, and hence are isolated and finite. \subsubsection{Morse--Smale Functions} Let $\phi_t$ denote the flow generated by $\grad{f}$. For a critical point $p \in \Mspace$ of $f$, the \emph{stable manifold} of $p$ is $S(p) = \{x \in \Mspace \mid \lim_{t \to \infty} \phi_t(x) = p\} \,. $ The \emph{unstable manifold} of $p$ is $U(p) = \{x \in \Mspace \mid \lim_{t \to -\infty} \phi_t(x) = p\} \,. $ A \emph{Morse--Smale function} is a Morse function whose stable and unstable manifolds intersect transversally. The Morse--Smale condition is dependent on the metric $g_{\Mspace}$, but we omit this from the terminology. An \emph{integral curve} of $f$ passing through a regular point $x$ is $\gamma = \gamma_x \colon \Rspace \to \Mspace$ defined by $\gamma(t) = \phi_t(x)$. A \emph{flow line} is an equivalence class of integral curves of $f$, where $\gamma\sim \gamma'$ if $\gamma(t) = \gamma'(s+t)$ for some $s$ and all $t\in \Rspace$. Therefore the unstable and stable manifolds of a critical point are the unions of all flow lines which begin and terminate, respectively, at that critical point. The Morse--Smale condition imposes restrictions on flow lines. For example, flow lines of a Morse--Smale gradient cannot connect critical points of the same index. For a given Morse--Smale function $f$, by intersecting the stable and unstable manifolds, we obtain the \emph{Morse--Smale cells} as the connected components of the set $U(p) \cap S(q)$ for all critical points $p, q \in \Mspace$~\cite{EdelsbrunnerHarerZomorodian2003}. The \emph{Morse--Smale complex} is the collection of Morse--Smale cells~\cite{EdelsbrunnerHarerZomorodian2003}.\footnote{The Morse--Smale complex described here is treated as a combinatorial structure, not to be confused with Morse--Smale--Witten chain complex~\cite[Chapter 7]{BanyagaHurtubise2013}.} We define the \emph{Morse--Smale graph} of $f$ to be the 1-skeleton of the Morse--Smale complex, that is, the union of the zero-dimensional (vertices) and one-dimensional (edges) cells of the Morse--Smale complex of $f$. \begin{remark} The Morse--Smale graph is also referred to as the \emph{topological skeleton} in visualization~\cite{HelmanHesselink1989}, consisting of critical points and streamlines that connect them which divide the domain of $\grad{f}$ into areas of different flow behavior (referred to as separatrices). A similar invariant is the \emph{distinguished graph} of a gradient-like flow~\cite{Peixoto1973}, allowing for the possibility of maximum-minimum connections, which never occur in the Morse--Smale graph~\cite[Quadrangle Lemma]{EdelsbrunnerHarerZomorodian2003}. \end{remark} Let $V_f$ denote the vertices of the Morse--Smale graph. We define the \emph{decorated Morse--Smale graph} of a Morse function $f\colon \Mspace \to \Rspace$ to be the Morse--Smale graph of~$f$ equipped with a vertex weighting given by restricting $f$ to the vertices: $f|_{V_f}\colon V_f \to \Rspace$. Figure~\ref{fig:msc-example} is an example of a decorated Morse--Smale graph with the vertex weighting marked next to the critical points. We begin with a Morse function on the sphere $f\colon \Sspace^2 \to \Mspace$ with three maxima, three saddles and two minima. We imagine cutting open and replacing the global minimum with an elastic band, and mapping the sphere to a disk for a clearer visualization. \begin{figure}[h]\centering \input{fig-example-graph.tex} \caption{A decorated Morse--Smale graph for a Morse function on the sphere. The boundary of this disk is identified to a point, which is the global minimum with weight 1.} \label{fig:msc-example} \end{figure} \subsubsection{Filtrations for Persistent Homology} In this paper, we are mostly concerned with \emph{sublevel set} filtrations of functions. That is, we are interested in the topological and algebraic properties of sets $f^{-1}(-\infty,t]$ for $t\in \Rspace$, and inclusion maps among them. Section \ref{sec:results-posets} is an exception, where \emph{level set} and \emph{interlevel set} filtrations are considered, that is, we use sets of the sort $f^{-1}(t)$ and $f^{-1}[t-\epsilon,t+\epsilon]$ for $t\in \Rspace$ and $\epsilon>0$. We refer the reader to broader surveys such as~\cite{EdelsbrunnerHarer2010,BendichEdelsbrunnerMorozov2013} for more on the different ways to approach persistence. \subsection{Equivalences Among Morse Functions} \label{sec:morsefunc-equivalence} We first review several equivalence relations between Morse functions that have been studied in the literature, including \emph{geometric equivalence}, \emph{topological equivalence}, and \emph{homological equivalence}. We then introduce new notions of equivalence relations between Morse--Smale functions that are essential to our research objectives, namely, \emph{graph equivalence}, \emph{height equivalence}, and \emph{poset equivalence}. \subsubsection{Orientation Preservation and Level Set Preservation} Let $\Mspace$ and $\Nspace$ be smooth, oriented manifolds (of dimension $n$). A diffeomorphism $h\colon \Mspace \to \Nspace$ is \emph{orientation-preserving} provided that $dh_p$ preserves the orientation at each point $p$ of $\Mspace$, that is, the linear transformation $dh_p$ has positive determinant. Given two Morse functions on manifolds, $f\colon \Mspace \to \Rspace$ and $g\colon \Nspace \to \Rspace$, a homeomorphism $h\colon \Mspace \to \Nspace$ is \emph{level set preserving} if $h(f^{-1}(a)) = g^{-1}(a)$ for any $a \in \Rspace$. Equivalently, $h\colon \Mspace \to \Nspace$ is level-set preserving if and only if the diagram \begin{equation} \begin{tikzcd} \Mspace \arrow[rr, rightarrow, "h"] \arrow[dr, rightarrow, "f"'] & & \Nspace \arrow[dl, rightarrow, "g"] \\ & \Rspace & \end{tikzcd} \end{equation} commutes. \subsubsection{Geometric, Topological and Homological Equivalences} As before, let $f\colon \Mspace \to \Rspace$ be Morse and $\Mspace_{t}^f \colonequals f^{-1}(\infty, t]$ its sublevel sets. For $n_f$ the number of critical points of $f$, let $a_0 < \cdots < a_{n_f}$ be a sequence of regular values of $f$ such that each interval $(a_i, a_{i+1})$ contains exactly one critical value of $f$ (for $0 \leq i \leq n_f-1$), called a \emph{slicing}~\cite{Nicolaescu2008} of $f$. Two Morse functions $f, g\colon \Mspace \to \Rspace$ are \emph{geometrically equivalent} if there exist orientation-preserving diffeomorphisms $r\colon \Mspace \to \Mspace$ and $l\colon \Rspace \to \Rspace$ such that $g = l \circ f \circ r^{-1}$, or equivalently, if the diagram \begin{equation}\label{eqn:geom_equiv} \begin{tikzcd} \Mspace \arrow[r,rightarrow,"r"] \arrow[d,"f"] & \Mspace \arrow[d,"g"] \\ \Rspace \arrow[r,rightarrow,"l"] & \Rspace \end{tikzcd}\end{equation} commutes. The Morse functions $f$ and $g$ are \emph{topologically equivalent} if they have the same number of critical values $n_f = n_g$ and there \edits{exists} a slicing $a_0 < \cdots < a_{n_f}$ of $f$ and a slicing $b_0 < \cdots < b_{n_g}$ of $g$ together with orientation-preserving diffeomorphisms $\phi_i\colon \Mspace_{a_i}^f \to \Mspace_{b_i}^g$ between sublevel sets. They are \emph{(mod $p$) homologically equivalent} if they have the same number of critical points and there exists a slicing of $f$ and a slicing of $g$ such that each of the sublevel sets $\Mspace_{a_i}^f$ and~$\Mspace_{b_i}^g$ have the same (mod $p$) Betti numbers. Note that geometric equivalence implies topological equivalence, which in turn, implies homological equivalence; see~\cite{Nicolaescu2008} for details. \subsubsection{Graph Equivalence} Two Morse--Smale functions $f,g$ are \emph{graph equivalent} if there is a graph isomorphism $\varphi\colon V_f \to V_g$ with $f|_{V_f} = g|_{V_g}\circ \varphi$. Graph equivalence is strictly stronger than topological equivalence and level-set equivalence, as described in Figure~\ref{fig:graph-non-equivalence}. \begin{figure}[h]\centering \input{fig-graph-non-equivalence.tex} \caption{An example of two Morse functions $\Sspace^2\to \Rspace$ that have the same barcode, Reeb graph, and merge tree. These functions are geometrically equivalent by~\cite[Theorem 3.3]{Nicolaescu2008}, but are not graph equivalent.} \label{fig:graph-non-equivalence} \end{figure} \subsubsection{Height Equivalence} Let $\iota, \iota'\colon \Sspace^2 \to \Rspace^3$ be smooth embeddings of a sphere to $\Rspace^3$. Let~$\pi\colon \Rspace^3 \to \Rspace$ be a projection onto the unit normal vector $[0,0,1]^T$. Let $f, g\colon \Sspace^2 \to \Rspace$ be two Morse functions that factor through the two embeddings $\iota$ and $\iota'$, respectively; that is,~$f = \pi \circ \iota$ and $g = \pi \circ \iota'$. Then $f$ and $g$ are called \emph{height equivalent} whenever there is a level set preserving homeomorphism~$\psi\colon \Rspace^3 \to \Rspace^3$ with $\iota'=\psi \circ \iota$. Equivalently, $f$ and $g$ are height equivalent if the diagram \begin{equation} \label{eqn:height-equiv-diag} \begin{tikzcd} & \Sspace^2 \arrow[dl,hookrightarrow,"\iota"'] \arrow[dr, hookrightarrow, "\iota' "] & \\ \Rspace^3 \arrow[rr, rightarrow, "\psi"] \arrow[dr, twoheadrightarrow, "\pi"'] & & \Rspace^3 \arrow[dl, twoheadrightarrow, "\pi"] \\ & \R & \end{tikzcd} \end{equation} commutes. Two height equivalent Morse functions are necessarily equal as functions $\Sspace^2 \to \R$, and thus will have the same critical values and (sub)level set persistence barcodes. \subsubsection{Poset Equivalence} We remind the reader that an \emph{isomorphism} from a poset $(F,\leq _{F})$ to a poset $(G,\leq _{G})$ is a bijective function $\varphi\colon F\to G$ of sets with the property that, for every $x$ and $y$ in~$F$, $x\leq _{F}y$ if and only if $\varphi(x)\leq _{G}\varphi(y)$. \begin{definition}[Poset Equivalence] \label{def:poset-equivalence} Two Morse functions $f, g\colon \Sspace^2 \to \Rspace$ factoring through embeddings $\iota$, $\iota'$, respectively, are \textit{poset equivalent} if they are height equivalent, and if \begin{enumerate} \item there exists a common slicing $a_0 < \cdots < a_{n}$ of $f$ and $g$ such that, for every $i$, the sets $F_i \colonequals \pi_0\left(\pi^{-1}(a_i) - \iota \circ f^{-1}(a_i)\right)$ and $G_i \colonequals \pi_0\left(\pi^{-1}(a_i) - \iota' \circ g^{-1}(a_i)\right)$ have the structure of a poset, and \item the map $\pi_0 \circ \psi_i \colon F_i \to G_i $ induced by $\psi_i \colon \left(\pi^{-1}(a_i) - \iota \circ f^{-1}(a_i)\right) \to \left(\pi^{-1}(a_i) - \iota' \circ g^{-1}(a_i)\right)$ is an isomorphism of posets, where $\psi_i$ is a restriction of $\psi$ to the planes $\pi^{-1}(a_i)$. \end{enumerate} \end{definition} This equivalence is necessary for understanding the preimage of the persistence map in Section~\ref{sec:results-posets}. Both Figure~\ref{fig:nesting}(a) and Figure~\ref{fig:nesting}(c) give two examples of this poset structure, and Figure~\ref{fig:shotglassworm} describes these examples in the context of their Morse functions. \subsubsection{Comparison of Equivalence Relations} We conclude this section with a comparison of the equivalence relations introduced thus far, for Morse functions $f\colon \Sspace^2\to \Rspace$. \begin{lemma} The following are strict implications among the equivalence relations. \begin{center} \begin{tikzpicture}[yscale=1.5,stronger/.style={double,line width=.8pt,double distance=2pt,-Implies}] \node (poset) at (0,0) {poset}; \node[anchor=west] (height) at ($(poset.east)+(0:1)$) {height}; \node[anchor=west] (geo) at ($(height.east)+(0:1)$) {geometric}; \node[anchor=west] (top) at ($(geo.east)+(0:1)$) {topological}; \node[anchor=west] (hom) at ($(top.east)+(0:1)$) {homological}; \node (gr) at ($(geo)+(270:1)$) {graph}; \foreach \x\y in {poset/height, height/geo, geo/top, top/hom}{ \draw[stronger] (\x)--(\y); } \draw[stronger] (geo) to node[right=-4.5pt,rotate=-45,pos=.25,scale=1.2] {$|$} (gr); \end{tikzpicture} \end{center} \end{lemma} \begin{proof} In the top line, the first implication follows directly by definition, and is strict by the example of Figure~\ref{fig:shotglassworm}. The second implication follows from taking $r = \id_{\Sspace^2}$ and $l = \id_{\Rspace}$ in Diagram~\eqref{eqn:geom_equiv}. Given any Morse function $f \colon \Sspace^2 \to \Rspace$, and sufficiently small $\epsilon$, the functions $f$ and $f+\epsilon$ are geometrically equivalent, but not height equivalent (because they are distinct). The third and fourth implications are shown in~\cite{Nicolaescu2008}, and Figure 5 in the same paper shows that the third implication is strict. As topological equivalence considers orientation while homological equivalence does not, examples abound of why the fourth implication is strict. Figure~\ref{fig:graph-non-equivalence} gives an example of two Morse functions that are geometrically equivalent but not graph equivalent. \qed \end{proof} \edits{Both the cell decomposition in the decorated Morse--Smale graph and recent work \cite[Theorem 1]{morsebott} suggest that graph equivalence implies geometric equivalence. However, this remains an open problem.} \begin{remark} If two functions $f,g \colon \Sspace^2 \to \Rspace$ are homologically equivalent, this does not imply they have the same barcode. However, if we instead consider $\varepsilon$-interleavings~\cite{ChazalCohen-SteinerGlisse2009} of barcodes (thought of as persistence modules), then homological equivalence does imply an $\varepsilon$-interleaving. \end{remark} \section{Discussions} \label{sec:discussions} We have characterized the moduli space of classes of Morse functions on the sphere under both functional and dynamic settings. Using persistence as a constraint, we have defined equivalence relations between Morse functions and have studied the combinatorial structure of Morse functions on a sphere modulo such relations. Our approach describes structures in detail, and therefore provides a fruitful ground for continued research in several directions. \subsection{Realizing Preimages of a Barcode} Conjecture \ref{conj:counting} considers a counting argument that is only at the beginning of addressing Objective~3 from Section \ref{sec:introduction}. This is given in the context of finding a representative of the preimage of the persistence map \begin{equation} \{ \text{Morse functions on } \Sspace^2\} \rightarrow \{ \text{Barcodes} \}, \end{equation} where a barcode is viewed as a multiset of intervals of $\Rspace$. To further answer Objective 3, we may ask: given a barcode $B$, find an embedding $\iota \colon \Sspace^2 \rightarrow \Rspace^3$ such that $B$ is the barcode of $f \colonequals \pi \circ \iota$ under level set persistence in degree zero. Note that some barcodes cannot be realized as height-embedded Morse functions on $\Sspace^2$, for example $B = \{ \left[ 0, 3 \right], \left( 1, 2 \right) \}$, as any open interval or a closed interval nested in another closed interval is forbidden for the sphere. However, if $B$ has a single closed bar inside which all other bars are contained, we can easily construct a Reeb graph $\mathcal{R}_B$, which in turn may be associated to a diagram of 1-spheres and wedges of 1-spheres, which may then be assembled into an embedding of a 2-sphere, as in Figure \ref{fig:preimage-realization}. \begin{figure}[h]\centering \input{fig-preimage-realization.tex} \caption{Constructing a 2-sphere embedding from a barcode.} \label{fig:preimage-realization} \end{figure} This construction suggests an algorithmic approach to constructing embeddings $\iota\colon \Sspace^2 \rightarrow \Rspace^3$ such that the barcode of the height function on $\im(\iota)$ will produce the barcode $B$. That is, every vertex of the Reeb graph of degree $n\geqslant 3$ corresponds to a wedge of $n-1$ spheres, every vertex of degree 1 corresponds to a point, and every edge between vertices corresponds to a zigzag $X\leftarrow \Sspace^1 \rightarrow Y$ in $\mathbf{Top}$. We leave the formalization and extension of these ideas open for further research. \subsection{Extending the Nesting Poset} Theorem \ref{theorem:nesting-poset-B} and its proof used arguments based on including smaller topological spaces into larger ones. Using the critical values of $f$, every open interval of $\Rspace$ containing at most one critical value can be uniquely associated with a nesting poset. Then the maps described in Theorem \ref{theorem:nesting-poset-B} correspond to restriction to a subset or containment in a superset, the former case described in Figure \ref{fig:sheaf-example}, following Figure \ref{fig:nesting3}. \begin{figure}[h]\centering \input{fig-sheaf-example.tex} \caption{Associating poset maps to set restrictions.} \label{fig:sheaf-example} \end{figure} What we have described suggests the structure of an \emph{$\Rspace$-constructible sheaf} encoding the nesting poset. More detail is given by \cite{currypatel} as well as by \cite{patelmacpherson} but we do not explore this here and leave it open for further research. \subsection{Keeping Track of Critical Values} \label{sec:tracking-values} \edits{The techniques we have described here are concerned with the relative order of critical values, and only as a consequence of other structural changes. Using the order of critical values as a primary motivator opens up new directions of research, some of which} are addressed by ongoing work in vector field design~\cite{ZhouLazovskisCatanzaro2019} \edits{and existing literature on distances for topological invariants~\cite{difabiolandi2016,bauerlandimemoli2018,damicofrosinilandi2010}}. In addition, specifying function values on singularities would allow for an additional measure on how ``far apart" two functions are: one could use the number of moves together with the difference of function values to measure their differences. The ``complexity" of a Morse function $f$ could then be given by measuring the difference between $f$ and a baseline function, such as the height function $h$ on the standard embedding of $\Sspace^2$ in $\Rspace^3$. \section{Introduction} \label{sec:introduction} Morse theory describes the topology of a manifold $\Mspace$ by studying well-behaved functions $f: \Mspace \to \Rspace$ \cite{Milnor1963}. This \emph{well-behavedness} is qualified by the notion of a \emph{Morse function}: a smooth real-valued function with no degenerate critical points. One of the main ideas of Morse theory is to associate the topological changes of the sublevel sets $\Mspace_a = f^{-1}(\infty, a]$, as $a$ varies, with the critical points of $f$. From an algebraic perspective, Morse functions are \emph{effective} in topological problems due to their local rigidity; that is, critical points of Morse functions have a very simple local, quadratic structure (up to a change of coordinates) \cite{Nicolaescu2007}. From a homological perspective, the relationship between the topology of $\Mspace$ and the critical points of $f$ is described by the powerful Morse inequalities, which have both topological and geometric significance. \begin{figure}[!ht]\centering \input{fig-equivalent-barcodes.tex} \caption{The graphs of two different functions $f, g: \Rspace \to \Rspace$ restricted to a finite interval in $\Rspace$, and their identical one-dimensional barcode and persistence diagram based on sublevel set filtration. The longest bar in the barcode captures the connected component; while the 2nd longest bar is created due to the boundary condition.} \label{fig:equivalent-barcodes} \end{figure} Persistent homology is a relatively new tool for discriminating functions on topological spaces based on how the shape of their (sub)level sets evolve. In the standard setting, persistence is an extension of Morse theory, as it studies homology groups of sublevel sets connected by inclusion maps, $\Mspace_a \xhookrightarrow{} \Mspace_b$ (for $a \leq b$). The evolution of shape is captured by what is known as the \emph{persistence diagram} or \emph{barcode}~\cite{EdelsbrunnerHarer2010,Ghrist2008}. Barcodes enjoy properties such as \emph{simplicity}, as a barcode is simply a collection of intervals in the real line; and \emph{stability}, as small perturbations of shape produce small perturbations of the barcode. Both of these properties make persistence an ideal tool for studying the shape of data, with wide applications to science and engineering; see \cite{EdelsbrunnerMorozov2012} for a survey. We are interested in exploring different moduli spaces of Morse functions from the perspective of persistence. We characterize the set of Morse functions that give rise to the same barcode, see Figure~\ref{fig:equivalent-barcodes} for an example. Some of these functions should be considered as different, because taking one function to another requires a significant deformation. In other words, we are putting different equivalence relations on the space of Morse functions that respect persistence, i.e.,~two functions can only be deemed equivalent only if they have the same barcode, but simply having the same barcode does not guarantee equivalence. Each choice of equivalence relation leads to a different moduli space structure on the space of Morse functions; and each equivalence class has an interesting combinatorial structure that can be used practically to enrich the barcode. Instead of focusing on \emph{any} Morse function $f\colon \Mspace \to \Rspace$, we are initially motivated by a simpler question by considering $\Mspace = \Sspace^2$: \emph{How many Morse functions on the sphere~$\Sspace^2$ have the same barcode?} Or more precisely: \emph{How many equivalence classes of Morse functions on the sphere have the same barcode?} Asking such an open question is a first step towards exploring three areas of interests described below. For simplicity, we sometimes require more from $f$, such as factoring as an embedding into Euclidean space followed by a projection, so as to exclude pathological examples like the Alexander horned sphere. \textbf{Topological data analysis:} The simplicity of the barcode is both a benefit and a drawback, as information about the space and function is lost during its computation. Precisely how much information is lost? How does the barcode compare to other topological invariants, and does it fail to capture some key topological and geometric features? How does the analysis on a sphere extend to a compact surface of genus $g$? From a statistical perspective, how common is a particular barcode, and which one should we expect in a \emph{general} situation? \textbf{Shape analysis:} Properties of shapes, such as being convex, nested, elongated, or circular, are mostly geometric in nature. Do the discriminative capabilities of persistence---known to be mostly topological---also capture these geometric properties? Recent work by \cite{BubenikHullPatel2019} has shown that short intervals in barcodes encode geometric information; in particular, persistent homology detects the curvature of disks from which points are sampled. How much geometric information is preserved by the barcodes? Topological descriptors, such as Reeb graphs~\cite{Reeb46} and Morse--Smale complexes~\cite{EdelsbrunnerHarerNatarajan2003,EdelsbrunnerHarerZomorodian2003}, provide an abstract and compact representation of data modeled by Morse functions. For instance, the small number of cells in a Morse--Smale complex can significantly reduce the number of cells when discretizing a shape, while keeping the same topological properties. Does persistence allow us to reduce the carried data even further? We refer the interested reader to the survey paper by \cite{biasotti2008describing} for a summary of shape analysis's relationship to persistence and Reeb graphs. \textbf{Dynamical systems:} What is the space of all Morse or Morse--Smale vector fields, with and without the requirement of identical persistence as a constraint? Equivalence classes of Morse--Smale vector fields on 2-manifolds have been studied previously \cite{Peixoto1973,Fleitas1975,GutierrezMelo1977}; however, not in the context of persistence. It is known that the set of Morse--Smale vector fields on orientable surfaces is dense \cite[Theorem 2.6]{PalisMelo1982}. Given two Morse--Smale vector fields which are not topologically equivalent, can we derive a distance measure between them? What is the minimal number of operations (critical pair cancellation or reverse-cancellation) to transform one to another? \subsection{Research Objectives} Our overarching goal is to classify and algorithmically construct all equivalence classes of Morse functions on a manifold, where the equivalence is captured by functions, embeddings, or dynamics, using barcodes as constraints. Fixing a homology degree, the \emph{persistence map} is the map that takes a function $f$ on $\Mspace$ to its associated barcode~\cite{Curry2017}. We classify the image, preimage, and embeddings of the preimage of the persistence map under different notions of equivalence relations. While there have been approaches to interpreting the persistence map functorially \cite{BauerLesnick2015,SilvaMunchPatel2016}, and such categorical generalizations are of interest to us (see Section \ref{sec:results-posets}), considering the persistence map simply as a map rather than a functor does not take away from our analysis. Let $\Mspace$ denote a smooth manifold, and let $f\colon \Mspace \to \Rspace$ denote a Morse function. In this paper, we focus on characterizing Morse functions on the sphere $\Mspace = \Sspace^2$ that produce the same barcode. \begin{itemize} \item \textbf{Objective 1: Classifying the image.} Fix $\Mspace$ (for example,~$\Sspace^2$) and the number and type of critical points that respect the Euler characteristic (for example,~two maxima, one saddle point, and one minimum on $\Sspace^2$). Enumerate the barcodes that correspond to sublevel set filtrations of functions $f\colon \Mspace \to \Rspace$. This is a computational objective, and can be interpreted by counting Morse--Smale graphs (Section~\ref{sec:background}) via elementary moves (Section~\ref{sec:results-abcd}) instead of functions. In this setting, we declare that two Morse functions $f, g\colon \Mspace \to \Rspace$ are \emph{indistinguishable} if they are \emph{graph equivalent} (Section~\ref{sec:background}). \item \textbf{Objective 2: Classifying embeddings of the preimage.} Fix $\Mspace$ and a barcode, and ask how many different embeddings $\iota: \Mspace \to \Rspace^d$ of the space $\Mspace$ into Euclidean space $\Rspace^d$ produce the given barcode when projected onto a fixed axis via $\pi \colon \Rspace^d \to \Rspace$. In other words, we study the behavior of the function $f:= \pi \circ \iota$. This is related to the persistent homology transform~\cite{TurnerMukherjeeBoyer2014}, which asks the same question, but for all directions. Here, two Morse functions $f, g: \Mspace \to \Rspace$ (where $f\colonequals \pi \circ \iota$ and $g\colonequals \pi \circ \iota'$) are considered \emph{indistinguishable} if (i) they generate the same barcode and (ii) they are \emph{poset equivalent} (Section~\ref{sec:background}). \item \textbf{Objective 3: Classifying the preimage.} Fix $\Mspace$ and a barcode, and ask for all functions, up to \emph{level-set preserving equivalence}, whose image is the given barcode. This topological objective benefits from the Reeb graph~\cite{Reeb46}, which enriches the barcode by distinguishing different type of persistence pairings, and its refinement the \emph{decorated Morse--Smale graph}, introduced in Section \ref{sec:morsefuncs-persistence}. Two Morse functions $f, g\colon \Mspace \to \Rspace$ are \emph{indistinguishable} in this context if (i) they generate the same barcode and (ii) they give rise to isomorphic decorated Morse--Smale graphs. \end{itemize} Classifying Morse functions under different notions of equivalences via the persistence map is well-motivated, as persistence has emerged as a central tool of topological data analysis. Applications of persistence include shape analysis~\cite{CarlssonZomorodianCollins2004,PoulenardSkrabaOvsjanikov2018}, cancer research~\cite{SeemannShulmanGunaratne2012,LockwoodKrishnamoorthy2015,HofmannKrufczikHeermann2018,QaiserTsangTaniyama2019} and material sciences~\cite{LeeBarthelDlotko2018}. By exploring the above moduli spaces, we aim to build a better or enriched barcode for real-world applications. \subsection{Related Work} The mathematical study of height functions through level sets (contour lines) and relationships between them dates back to at least the 1850s, when Cayley classified topographical maps based on configurations of contour lines~\cite{cayley1859xl}. \cite{maxwell1870hills} extended this work and laid the foundation for Morse theory. \cite{Reeb46} defined a graphical invariants to classify Morse functions; today, we call this invariant the \emph{Reeb graph}. Later, \cite{Arnold1991,Arnold1992} defined geometric equivalence classes of functions on $\Sspace^1$ using a notion of ``snakes". The classification for functions on surfaces is much more involved, and has been considered in certain cases~\cite{Arnold2007,Nicolaescu2007}, the latter of which analyzed homological and geometric equivalence of Morse functions on $\Sspace^2$. Further, ~\cite{Kulinich1998} and ~\cite{Sharko1996,Sharko2003} classified Morse functions on surfaces, up to geometric equivalence, using Reeb graphs. Reeb graphs use level-sets of functions, and the analogous join tree or merge tree structure with sublevel sets was developed by \cite{pascucci2004} and \cite{Curry2017}. Further implications of Reeb graphs for persistent homology were considered by~\cite{difabiolandi2016,bauerlandimemoli2018}. From the dynamical system perspective, \cite{Peixoto1973} classified Morse--Smale flows on two-manifolds up to trajectory topological equivalence using the concept of ``distinguished graph". Subsequent work by \cite{Fleitas1975} and \cite{Wang1990} gave simpler invariants for Morse flows on two-manifolds. \cite{OshemkovSharko1998} also considered the problem of topological trajectory classification of Morse--Smale flows on closed surfaces and introduced a ``three-color graph" as another alternative to the Peixoto invariant. Morse flows are also used to determine two-dimensional Hamiltonian flows; and \cite{SakajoYokoyama2018} developed tree representations for such flows. Both three-color graphs and tree representations are combinatorial codings that detail processes for constructing a flow by adding pairs of critical points. Finally, \cite{AdamsCarlsson2015} used topological arguments like the ones in Section~\ref{sec:results-posets} to decompose spaces for network evasion paths, however they did not use the language of Morse functions. Our work focuses on invariants based on cell decompositions of the domain using gradient flows. It is primarily concerned with the structure of the Morse--Smale complex and its interplay with persistence, which is distinct from previous approaches. The formal underpinnings of the sequence of moves described in Section~\ref{sec:results-abcd} originate from Cerf theory (also known as pseudoisotopy theory)~\cite{Cerf1970,hatcher_pseudo-isotopies_1973}. In proving his celebrated ``Pseudoisotopy Theorem'', Cerf described the low codimension strata of a particular stratification on the space of smooth functions on a smooth compact manifold. The codimension-zero stratum consists of Morse functions with distinct critical values, and the codimension-one stratum consists of either `generalized Morse functions' (those with a single cubic `birth-death' singularity), or Morse functions with precisely two critical values equal. Furthermore, Cerf showed that a generic or typical path of smooth functions lies in the codimension-zero stratum for all but finitely many `times' (thinking of the path parameter as `time'), at which points the function lies in the codimension-one stratum. The moves described in Section~\ref{sec:results-abcd} are inspired by moving across the codimension-one stratum in the space of smooth functions and passing through a generalized Morse function. The statement and proof of Theorem~\ref{thm:exh_moves} relies on this description of the stratification and adapts these ideas to the combinatorics of the Morse--Smale graph of a surface. Performing one of the moves introduced in Section~\ref{sec:results-abcd} can be thought of as a perturbation of the initial Morse-Smale flow (albeit a fairly large one from the perspective the aforementioned stratification of Cerf). Perturbations in the space of all vector fields have been studied by other authors (see~\cite{szymczak2012hierarchy} and its extensive references). This perspective might be useful for future work, but we do not take this approach now. \subsection{Overview} Our main contributions in this paper are: \begin{itemize} \item New notions of equivalence among (embeddings of) Morse functions containing persistence information; \item A set of fundamental operations on Morse--Smale vector fields that relate all such vector fields; \item A foundation for counting the number of Morse functions producing the same barcode. \end{itemize} In Section \ref{sec:morsefuncs-persistence} we begin with a background to the functions of interest in the context of persistent homology, with new and existing notions of equivalence among these functions in Section \ref{sec:morsefunc-equivalence}. Section \ref{sec:results-abcd} contains a method for relating Morse--Smale vector fields on the sphere, building from existing decomposition results \cite{EdelsbrunnerHarerZomorodian2003}. Section \ref{sec:results-posets} explores one of the new invariants, the nesting poset, and describes a zigzag poset structure in Corollary \ref{cor:zigzag}, making steps to extend it combinatorially in Conjecture \ref{conj:zigzag-algebra}, with a goal of developing an enriched barcode. Section \ref{sec:results-counting} presents a lower bound in Conjecture \ref{conj:counting} to counting height-equivalence classes of Morse functions that factor through $\Rspace^3$ as smooth embeddings, which leads to better understanding of Morse functions by their barcode. \section{Fundamental Moves} \label{sec:results-abcd} We focus on understanding how cells (generically as quadrangles) of a Morse--Smale complex fit together on a surface and how they change when a pair of critical points is added or removed. We only consider Morse--Smale complexes that arise from a Morse-Smale function on a sphere, and we refer to the changes as fundamental moves, or \emph{moves} in short. Our first main result is to define moves on the Morse--Smale complex, with the goal of describing all the possible ways to create a new Morse--Smale function. By the Quadrangle Lemma \cite{EdelsbrunnerHarerZomorodian2003}, every face (cell) of a decorated Morse--Smale graph has four edges, counting an edge twice if the face is on both sides of the edge. This allows us to describe changes to the graph as a composition of moves. The gradient of a Morse--Smale function gives rise to a Morse--Smale vector field, therefore our approach equivalently describes changes to a Morse--Smale vector field due to the moves, with the changes limited to a particular region of cells for each move. Everything in the vector field outside of this region stays the same between moves. \edits{As we only investigate Morse--Smale functions on a manifold, by definition, all saddles are simple}; that is, every saddle has degree four, and the endpoints of the four adjacent edges alternate between maxima and minima. All higher-order saddles can be unfolded into simple saddles. As in Figure \ref{fig:msc-example}, a saddle-maximum connection is indicated by a solid line, and a saddle-minimum connection is marked by a dashed line. Maxima and minima may have arbitrary degrees. We now describe face moves, edge moves, and vertex moves; which operate on faces, edges, and vertices, respectively. All of the moves add or remove two cells to the quadrangulation, or equivalently, they add or remove one saddle-maximum or saddle-minimum pair. \begin{definition}[Face Moves]\label{def:facemove} A \emph{face move} is \edits{addition (cancellation)} of a pair of critical points in the interior of a cell. \[\input{fig-face-move.tex}\] \end{definition} \begin{definition}[Edge Moves]\label{def:edgemove} An \emph{edge move} is \edits{addition (cancellation)} of a pair of critical points on the edge of a cell. \[\input{fig-edge-move.tex}\] \end{definition} \begin{definition}[Vertex Moves]\label{def:vertexmove} A \emph{vertex move} is \edits{addition (cancellation)} of a pair of critical points at an existing critical point. \[\input{fig-vertex-move.tex}\] \end{definition} The face, edge, and vertex moves are ways of manipulating the Morse--Smale complex to obtain another Morse--Smale complex. These moves do not have functional values associated with the critical points, so they are manipulations of the Morse--Smale complex and not of the underlying function. \begin{theorem} \label{thm:exh_moves} The Morse--Smale graph of any two Morse--Smale functions is related by a sequence of face, edge, and vertex moves. \end{theorem} The proof of this theorem relies on the following restriction imposed on the Morse--Smale graph. We recall this fact from~\cite{EdelsbrunnerHarerZomorodian2003} without proof. \begin{lemma}[Quadrangle Lemma] Each region of the Morse--Smale complex is a quadrangle with vertices of index 0, 1, 2, and 1, in this order around the region. The boundary is possibly glued to itself along vertices and arcs. \end{lemma} \begin{proof}[Proof of Theorem~\ref{thm:exh_moves}] We recall the following fact due to \cite{Cerf1970}: any two Morse functions on a manifold $\Mspace$, and therefore any two Morse flows, can be connected by a path in the space of all smooth functions on $\Mspace$. Furthermore, this path can be chosen to be comprised of Morse functions for all but finitely many times -- at which times the function has a single cubic degenerate critical point -- in addition to non-degenerate critical points. As one moves along this path of functions, the cubic degenerate critical point either gives rise or removes two non-degenerate critical points. Translating this general result to the Morse--Smale complex of a surface, it suffices to consider introducing or removing a pair of critical points into a quadrangle decomposition of the surface. Depending on where we introduce this pair, we shall obtain the different moves of Definitions~\ref{def:facemove}--\ref{def:vertexmove}. Notice that since the cubic degenerate critical point must give rise to critical points of adjacent index, a saddle point must always be involved in these moves. Since adding and removing critical points are symmetric operations, we only discuss the case of adding critical points. First suppose the pair of critical points is added in the interior of a quadrangle. Then, as in Figure~\ref{fig:face-move-proof}, the introduced saddle must have two flow lines to a single vertex on the boundary of the quadrangle. If a maximum-saddle pair is added, the additional saddle must have two flow lines to the unique minimum, and for an added minimum-saddle pair, the saddle must have two flow lines to the unique maximum. This completely determines the move, and hence is the face-max or face-min move. \begin{figure}[h]\centering \input{fig-face-move-proof.tex} \caption{New edges are uniquely determined when a pair of critical points is added in the interior of a quadrangle.} \label{fig:face-move-proof} \end{figure} Next, suppose the pair is added on an edge between two quadrangles. Note that a maximum-saddle pair cannot be added on a separatrix between a minimum and a saddle, and vice-versa, since such a pair would force the saddle in the initial separatrix to have more than four flow lines incident to it. However, adding a maximum-saddle pair to the separatrix between a maximum and a saddle is permissible. In this case, there is a unique way of adding flow lines to obtain a valid configuration, and this is precisely the edge-max move. The edge-min move case is proven similarly. Finally, suppose the pair is added at a vertex in the quadrangulation. As in the edge moves, a maximum-saddle pair cannot be added at a minimum, and a minimum-saddle pair cannot be added at a maximum. For example, if a minimum-saddle pair was added at a maximum, a quadrangle would be formed with two minima and two saddles, contradicting the Quadrangle Lemma. Suppose a minimum-saddle pair was added at a minimum. Then, the additional saddle must connect to two maxima. If it connects to the same maximum twice, this is a face move. If it connects to two adjacent maxima, meaning they are both connected to a saddle in the quadrangulation, then this is an edge move. Otherwise, the saddle connects to two maxima, and we have the vertex move. The max-saddle case gives rise to the vertex-max move and is proven similarly. \qed \end{proof} \edits{As the fundamental moves add critical points, the moves change the equivalence class (of the classes described in Section \ref{sec:morsefunc-equivalence}) of the associated Morse--Smale function. However, different moves may give the same change of equivalence class, as witnessed by their Reeb graphs in Figure \ref{fig:fundamental-reeb}. These changes in the Reeb graph are termed \emph{elementary deformations of B-type} and \emph{D-type} by \cite{difabiolandi2016}, though their analysis emphasizes movement of critical values past each other (see Section \ref{sec:tracking-values} for further discussion).} \begin{figure}[h]\centering \input{fig-fundamental-reeb.tex} \caption{Changes to the Reeb graph by the fundamental moves. } \label{fig:fundamental-reeb} \end{figure} \edits{Moreover, attempting to consider notions of ``distance" on the fundamental moves, as in \cite{damicofrosinilandi2010,bauerlandimemoli2018}, gives no meaningful results, as not specifying critical values allows these distances to be infinitesimally small.} \begin{remark} The fundamental moves \edits{also have} implications for the space of all vector fields, with topology induced by distance between functions. This infinite-dimensional stratified space has strata within which vector fields are Morse--Smale, and the \edits{lower-dimensional strata} are where transversality of the stable and unstable manifolds fails to hold. Hence the described operations identify different types of \edits{lower-dimensional} strata, and may be used to count the number of strata within some parameters. \end{remark} \section{Counting Morse Functions} \label{sec:results-counting} The observations of the previous section, specifically Figure \ref{fig:crit-types}, hint to a method of counting Morse functions by their barcode. In this section, instead of analyzing the local behavior around critical values as before, we start with a global picture of a complete barcode, and use Figure \ref{fig:counting-example} as motivation. As before, $f\colon \Sspace^2 \rightarrow \R$ factors as $\pi\circ\iota$, for $\iota\colon \Sspace^2\to \Rspace^3$ a smooth embedding. \begin{figure}[h]\centering \input{fig-counting-example.tex} \caption{A motivating example.} \label{fig:counting-example} \end{figure} \begin{example}\label{ex:one-max} Suppose $f$ has $6$ critical values and a known zero-dimensional barcode consisting of $3$ bars nested inside each other, as in Figure \ref{fig:counting-example}(a). Construct all embeddings $\iota$ of $f$ by considering the effect of each bar on the embedding separately, following the nesting/non-nesting poset approach of Section \ref{sec:results-posets}. Begin with the largest bar of the barcode, then add bars in their nesting order. The second bar gives $2$ nesting choices. Each of the $2$ nesting choices gives $4$ more nesting choices, when the smallest bar of the barcode is added. \end{example} Example \ref{ex:one-max} leads immediately to several observations. First note that the types of critical points associated with closed endpoints of barcodes are decided (local minimum at the highest points, local maximum at the lowest points). Second, we see that simply choosing nesting or non-nesting-type at the open barcode endpoints does not give all the embeddings. For example, $\iota_{111}$ and $\iota_{113}$ have identical critical value types in the same order. Finally, note that the relation between the number of bars and number of embeddings depends upon containment relations among the bars. That is, by considering bars largest to smallest, for every bar contained in a larger one, the number of embeddings computed up to that point doubles. This is more precisely described by Conjecture \ref{conj:counting}. Let $B$ be the barcode of $f$, viewed as a set of subintervals $I_1,\dots,I_N$ of $\Rspace$. For every $j=1,\dots,N$, let $\mu_B(I_j)$ be the number of bars $I_k$ in $B$ such that $I_j\subsetneq I_k$. \begin{conjecture} \label{conj:counting} The number of ways the Morse function $f$ factors through $\Rspace^3$, up to height-equivalence, is bounded below by \begin{equation} \label{eqn:count} 2^{N-1}\prod_{j=2}^N \mu_B(I_j). \end{equation} \end{conjecture} We leave this conjecture open for future work, and make two observations about why Example \ref{ex:one-max} is not a generic example. \begin{itemize} \item The barcode in the example has a single interval whose highest endpoint is closed. Given more than one such interval, the count given in Conjecture \ref{conj:counting} would miss such embeddings. \item The barcode in the example does not give rise to embeddings whose branches might be ``twisted" in a non-trivial manner. That is, given a barcode with more bars, the count from Conjecture \ref{conj:counting} would miss the embeddings with ``twists". \end{itemize} \section{The Nesting Poset} \label{sec:results-posets} To study poset equivalence, we employ the nesting poset introduced in Section~\ref{sec:background}. The nesting poset is used to study the level sets of a Morse function, and describe relations among the posets by using the topology of associated level sets. We also show that the nesting poset is a circle containment order, following research in geometric containment orders~\cite{FishburnTrotter1999}. \subsection{The Nesting Poset of Level Sets} We first show that the poset isomorphism condition (2) in Definition~\ref{def:poset-equivalence} can be formulated as a nesting poset isomorphism, or equivalently as a circle containment order isomorphism. \subsubsection{Nesting Poset of Jordan Curves} A \emph{Jordan curve} is a non-self-intersecting continuous loop in the plane. Formally, a Jordan curve is a simple closed curve in $\Rspace^2$ that is the image of an injective continuous map $\phi \colon \Sspace^1 \to \Rspace^2$. Let $\gamma \colonequals \image(\phi)$ denote a Jordan curve. The Jordan curve theorem~\cite{Veblen1905} states that the complement $\Rspace^2 - \gamma$ of every Jordan curve $\gamma$ consists of exactly two connected components: one bounded interior component, denoted as $\interior(\gamma)$, and one unbounded exterior component. In this paper, we consider two Jordan curves $\gamma_1$ and $\gamma_2$ to be \emph{semi-disjoint} if they intersect at a single point ($\gamma_1 \cap \gamma_2 = *$). Two nonidentical Jordan curves are \emph{nested} if $\interior(\gamma_1) \subseteq \interior(\gamma_2)$ or vice versa. Given a set of $m$ Jordan curves $\Gamma \colonequals \{\gamma_1, \ldots, \gamma_m\}$ with at most one pair of semi-disjoint curves (and the rest are disjoint), its complement $\Rspace^2 - \Gamma$ consists of exactly $m+1$ connected components: $m$ bounded components and one unbounded component. \begin{remark} Let $P \colonequals \pi_0(\Rspace^2 - \Gamma)$ denote the set of (path-)connected components of $\Rspace^2 - \Gamma$. The closure of each bounded component in $P$ is a collection of elements of $\Gamma$, consisting of an exterior boundary and zero or more interior boundaries. With a slight abuse of notation, we speak of the boundary of a component in $P$ as the boundary of its closure. Let $p_i \in P$ denote the component whose exterior boundary is~$\gamma_i \in \Gamma$; let $p_0 \in P$ denote the unbounded component. Let $\bdr(p_i)$ denote the set of boundary curves of $p_i$, where we note that $\bdr(p_0)$ contains only interior boundaries. Two components $p_i, p_j \in P$ are \emph{adjacent} if they share a boundary in $\Gamma$, that is, $\bdr(p_i) \cap \bdr(p_j) \in \Gamma$. \end{remark} \begin{definition}[Nesting Poset of Jordan Curves] Let $\Gamma=\{\gamma_1, \ldots, \gamma_n\}$ and $P = \pi_0(\Rspace^2 - \Gamma)$ be as above. For any two adjacent components $p_i, p_j \in P$, define a binary relation~$\leq$, such that $p_i \leq p_j$ if and only if (1) $\interior(\gamma_i) \subseteq \interior(\gamma_j)$, or (2) $p_j$ is unbounded. The \emph{nesting poset} associated to $\Gamma$ is $N(\Gamma) \colonequals (P, \leq_P)$, where $\leq_P$ is the transitive closure of $\leq$ on $P$. \end{definition} Reflexivity, anti-symmetry, and transitivity of $\leq_P$ follow from the same properties of set containment $\subseteq$, so $N(\Gamma)$ is indeed a poset. Figure~\ref{fig:nesting} illustrates five examples of Jordan curves (in white) on the plane. Curves in Figure~\ref{fig:nesting}(a), Figure~\ref{fig:nesting}(b), and Figure~\ref{fig:nesting}(d) are disjoint; while curves in Figure~\ref{fig:nesting}(c) and Figure~\ref{fig:nesting}(e) are semi-disjoint. For each set $\Gamma$, the nesting poset $N(\Gamma)$ is visualized by its Hasse diagram: each vertex corresponds to an element in $P$ (a green shaded region); each arrow indicates a binary relation between adjacent elements (that is, an arrow exists from $p_i$ to $p_j$ if and only if $p_i \leq p_j$). \begin{figure}[!ht]\centering \input{fig-nesting.tex} \caption{Poset structures of level sets of some Morse functions for two regular values (a, b), and three critical values, (c, d, and e).} \label{fig:nesting} \end{figure} \begin{figure}[!ht]\centering \input{fig-shotglassworm.tex} \caption{A Morse function factoring through two different embeddings $\iota$, $\iota'$, which are height equivalent but not poset equivalent, as distinguished by their different nesting posets.} \label{fig:shotglassworm} \end{figure} \subsubsection{Nesting Poset of Level Sets} Let $f\colon \Sspace^2 \rightarrow \Rspace$ be a Morse function that factors through a smooth embedding $\iota$; that is, $f$ is defined as the composition $f = \pi \circ \iota$, for $\Sspace^2 \xrightarrow{\iota} \Rspace^3 \xrightarrow{\pi} \Rspace$. Assuming~$\Mspace$ is smooth and compact, the level set~$f^{-1}(a)$ is a (not necessarily connected) 1-manifold without boundary for a regular value~$a \in \Rspace$ according to the Implicit Function Theorem. The set~$\iota \circ f^{-1}(a)$ is therefore a set of disjoint Jordan curves in the plane $\pi^{-1}(a) \subset \Rspace^3$. For $a = c$ a critical value of $f$, the set~$\iota \circ f^{-1}(a)$ contains either exactly one pair of semi-disjoint Jordan curves or a point (together with other disjoint Jordan curves). \begin{definition}[Nesting Poset of Level Sets] \label{def:levelset-nesting} For any $a \in \Rspace$, let $\Gamma = \iota \circ f^{-1}(a)$ and~$P = \pi_0(\pi^{-1}(a) - \Gamma)$. The \emph{nesting poset} $N_a$ associated with $a$ is the nesting poset of Jordan curves~$\Gamma$ in the plane $\pi^{-1}(a)$. With an abuse of notation, $N_a \colonequals N(\Gamma) = (P, \leq_P)$. \end{definition} For example, Figure~\ref{fig:nesting}(a) and Figure~\ref{fig:nesting}(b) illustrate two sets of disjoint Jordan curves (in white) that arise from level sets of two Morse functions $f$ and $g$ at a shared regular value, respectively. Figure~\ref{fig:shotglassworm} describes these examples in the context of their corresponding Morse functions. Specifically, two Morse functions $f, g \colon \Sspace^2 \to \Rspace$ factor through embeddings $\iota, \iota' \colon \Sspace^2 \to \Rspace^3$ with the same barcode, $f = \pi \circ \iota$ and $g = \pi \circ \iota'$ in Figure~\ref{fig:shotglassworm}. For \emph{any} common slicing $a_0 < a_1 < a_2 < a_3 < a_4$, let $F_i \colonequals \pi_0\left(\pi^{-1}(a_i) - \iota \circ f^{-1}(a_i)\right)$ and $G_i \colonequals \pi_0\left(\pi^{-1}(a_i) - \iota' \circ g^{-1}(a_i)\right)$; the map $F_i \to G_i$ is not a poset isomorphism for $i = 2$; in particular, regular value $a_2$ gives rise to a poset structure in Figure~\ref{fig:nesting}(a) for $f$ and a different one in Figure~\ref{fig:nesting}(b) for $g$. By Definition~\ref{def:poset-equivalence}, $f$ and $g$ are not poset equivalent. \subsubsection{Circle Containment Order} A partially ordered set $(P, \leq)$ is called a \emph{circle containment order}~\cite{ScheinermanWierman1988}, provided one can assign to each $p_i \in P$ a closed disc in the plane $o_i \subseteq \Rspace^2$ satisfying $p_i \leq p_j$ if and only if $o_i \subseteq o_j $. Let $\alpha \colon P \to \Rspace^2$ denote such an assignment. If $\phi\colon \Rspace^2 \to \Rspace^2$ is an orientation-preserving homeomorphism, then $\phi$ does not change the circle containment order, so that $\alpha$ and $\phi \circ \alpha$ are equivalent circle containment orders. The nesting poset structure of $P = \pi_0\left(\pi^{-1}(a) - \iota \circ f^{-1}(a)\right)$, for any regular value $a$, could be understood in terms of a circle containment order. As illustrated in Figure~\ref{fig:nesting}(a), each bounded element in a poset (a green shaded region) $p_{i} \in P$ (where $i>0$) can be assigned a closed disc in the plane, which is the bounded interior component $\interior(\gamma_i)$. The unbounded component $p_0 \in P$ is assigned a closed disc that enclose all other discs. Such an assignment imposes a circle containment order. Hence a nesting poset is a circle containment order. \subsection{A Morse-Theoretic Perspective on Nesting Posets} Now we provide theorems analogous to Theorems~\ref{theorem:CMT-A} and~\ref{theorem:CMT-B}. As before, the Morse function $f\colon \Sspace^2\to \Rspace$ factors through an embedding $\iota$ as $f = \pi\circ \iota$. Let $L_t \colonequals \iota \circ f^{-1}(t)$ denote the embedding of its level sets. There are three types of critical points in $\image(\iota)$: local minima, saddles, and local maxima, with indices $0$, $1$, and $2$, respectively. To study local structure surrounding the critical points, we further classify the saddles into \emph{merging saddles} and \emph{splitting saddles} by investigating the relation between level sets $L_{c-\epsilon}$ and $L_{c+\epsilon}$ as $t$ crosses the critical value $c = f(p)$ of a saddle $p$. If $\epsilon>0$ is small enough, the intervals $[c-\epsilon, c)$ and $(c, c+\epsilon]$ contain no critical values. A saddle $p$ is a \emph{merging saddle} if a pair of disjoint Jordan curves in~$L_{c-\epsilon}$ merges into a single Jordan curve in~$L_{c + \epsilon}$ as $t$ crosses $c$. A saddle $p$ is a \emph{splitting saddle} if a Jordan curve at $L_{c-\epsilon}$ splits into a pair of disjoint Jordan curves at $L_{c+\epsilon}$ as $t$ crosses $c$. A merging saddle is of \emph{nesting} type if the Jordan curves that merge at $L_{c + \epsilon}$ are nested at~$L_{c-\epsilon}$; otherwise, the saddle is of \emph{non-nesting} type. Similarly, we can define splitting saddles of nesting and non-nesting types. Figures~\ref{fig:crit-types}~-~\ref{fig:nesting4} illustrate the reasoning behind this terminology. \begin{figure}[h]\centering \input{fig-critical-value-types.tex} \caption{A local minimum (a), a non-nesting (b) and a nesting (c) merging saddle with their corresponding (partial) zero-dimensional interlevel persistence barcodes.} \label{fig:crit-types} \end{figure} As before, let $\Gamma = L_t = \iota \circ f^{-1}(t)$ and $N_t = N(\Gamma) = (P, \leq_P)$ be the nesting poset. We now study how $N_t$ changes as $t\in \Rspace$ changes. \begin{theorem} \label{theorem:nesting-poset-A} If $f$ has no critical values in the interval $[a,b]$, then $N_a$ and $N_b$ are poset isomorphic, that is, $N_a \cong N_b$. \end{theorem} \begin{proof} This follows from a key observation in proving Theorem~\ref{theorem:CMT-A} from Morse theory. Recall~\cite[Theorem 2.31]{Matsumoto1997}, that if $f$ has no critical values in the interval $[a, b]$, then $\Mspace_{[a,b]}:=\{x \in \Mspace \mid a \leq f(a) \leq b\}$ is diffeomorphic to the product $f^{-1}(a) \times [a,b]$. Using the gradient-like vector field for $f$, the proof of Theorem 2.31 in~\cite{Matsumoto1997} includes a construction of an orientation-preserving diffeomorphism $h\colon f^{-1}(a) \times [0, b-a] \to \Mspace_{[a,b]}$. Therefore, $\Mspace_{[a,b]}$ is diffeomorphic to $f^{-1}(a) \times [0, b-a]$ and thus also to $f^{-1}(a) \times [a,b]$. However, we do not study $f$ directly, we instead study the function $\pi$ restricted to $\image(\iota)$ and sublevel sets $L_{[a,b]} \colonequals \iota \circ f^{-1}[a,b]$. Nonetheless, Theorem 2.31 from~\cite{Matsumoto1997} still applies, that is, there exists a diffeomorphism $h \colon L_a \times [0, b-a] \to L_{[a,b]}$ implying $L_{[a,b]} \cong L_{a} \times [0, b-a]$. The diffeomorphism $h$ is orientation-preserving, therefore it does not change the circle containment order moving from $N_a$ to $N_b$. Therefore $N_a \cong N_b$. \qed \end{proof} Denote an injective map of posets by $\hookrightarrow$ and a surjective map of posets by $\twoheadrightarrow$. If the injective map happens to be an isomorphism, we write $\xhookrightarrow{\cong}$. The conditions on $f\colon \Sspace^2\to \Rspace$ are as above. \begin{theorem} \label{theorem:nesting-poset-B} Let $p$ be a critical point of $f$ with critical value $c \colonequals f(p)$. Then for $\epsilon$ small enough, there exist zigzags of poset maps: \begin{enumerate} \item\label{thm:nesting1} $N_{c-\epsilon} \xhookleftarrow \cong N_c \hookrightarrow N_{c+\epsilon}$ if $p$ is a local minimum; \item\label{thm:nesting2} $N_{c-\epsilon} \hookleftarrow N_c \xhookrightarrow \cong N_{c+\epsilon}$ if $p$ is a local maximum; \item\label{thm:nesting3} $N_{c-\epsilon} \xhookleftarrow \cong N_c \twoheadrightarrow N_{c+\epsilon}$ if $p$ is a non-nesting merging saddle; \item\label{thm:nesting4} $N_{c-\epsilon} \twoheadleftarrow N_c \xhookrightarrow \cong N_{c+\epsilon}$ if $p$ is a non-nesting splitting saddle; \item\label{thm:nesting5} $N_{c-\epsilon} \xhookleftarrow \cong N_c \hookleftarrow N_{c+\epsilon}$ if $p$ is a nesting merging saddle; \item\label{thm:nesting6} $N_{c-\epsilon} \hookrightarrow N_c \xhookrightarrow \cong N_{c+\epsilon}$ if $p$ is a nesting splitting saddle. \end{enumerate} \end{theorem} As the behavior of nesting posets for local maxima and nesting/non-nesting splitting saddles of $f$ is the same as local minima and nesting/non-nesting merging saddles, respectively, of the Morse function $-f$, we only prove Statements \ref{thm:nesting1}, \ref{thm:nesting3}, and \ref{thm:nesting5} in Theorem~\ref{theorem:nesting-poset-B}. \begin{proof} By the Morse Lemma, there exists a neighborhood $V$ of $p$ such that on $V$, $f(x) = f(p) \pm x_1^2 \pm x_2^2$. The function $f$ is excellent, so there exists some $\epsilon > 0$ such that $f^{-1}[c-\epsilon, c+ \epsilon]$ contains only one critical point of $f$, namely $p$. Let $U\colonequals f^{-1}[c-\epsilon,c+\epsilon] \cap V$. Then $\nabla f$ provides a diffeomorphism from $f^{-1}(c-\epsilon) \setminus U$ to $f^{-1}(c+\epsilon) \setminus U$. By Theorem~\ref{theorem:nesting-poset-A}, the nesting poset is unchanged outside of $U$, hence the proof is reduced to a local computation of the nesting poset of $U$ for each case. For every $t\in [c-\epsilon,c+\epsilon]$, let $L_t \colonequals \iota(f^{-1}(t) \cap V)$ and let $L \colonequals \bigcup_{t\in [c-\epsilon,c+\epsilon]}L_t$. Take a contractible neighborhood $W$ of $L$, and without loss of generality assume that $L\subseteq \pi^{-1}[c-\epsilon,c+\epsilon]$ and $W_t \colonequals \pi^{-1}(t)\cap W$ is non-empty and contractible for every $t\in [c-\epsilon,c+\epsilon]$. Note that $\iota\circ f^{-1}[c-\epsilon,c+\epsilon]$ may contain more than one connected component. This proof proceeds functorially, by describing for every $t\leqslant s\in [c-\epsilon,c+\epsilon]$ a map of posets $N_t\to N_s$ induced by the topological inclusions $W_t-L_t\hookrightarrow (W-L)\cap \pi^{-1}[t,s]$ and $W_s-L_s\hookrightarrow (W-L)\cap \pi^{-1}[t,s]$. For Statement~\ref{thm:nesting1}, the function $f$ has index $0$ and so $f(x)=f(p)+x_1^2+x_2^2$ in $V$. As in Figure~\ref{fig:nesting1}, assign labels to the connected components of the three (subsets of) level sets $W_{c-\epsilon}\subseteq \pi^{-1}(c-\epsilon)$, $W_c-L_c\subseteq \pi^{-1}(c)$, and $W_{c+\epsilon}-L_{c+\epsilon}\subseteq \pi^{-1}(c+\epsilon)$. The topological inclusion $A'\hookrightarrow A$ and the natural injective map $A'\hookrightarrow A''$ that widens the hole of $A'$ induce analogous maps on the nesting posets $N_c\to N_{c-\epsilon}$ and $N_c\to N_{c+\epsilon}$, respectively. The poset elements are given the same labels as the connected components to which they correspond, and their relation is defined in Definition \ref{def:levelset-nesting}. \begin{figure}[!h]\centering \input{fig-nesting-maps1.tex} \caption{Topological construction and labelling for Statement~\ref{thm:nesting1}.} \label{fig:nesting1} \end{figure} For Statements~\ref{thm:nesting3} and \ref{thm:nesting5}, the function $f$ has index 1 and so $f(x)=f(p)-x_1^2+x_2^2$ up to diffeomorphism. As in Figure \ref{fig:nesting2}, assigning labels coherently to the connected components of the three (subsets of) level sets is ambiguous, as some may connect beyond $W$. It is necessary to clarify this, as we want an injective map from the nesting poset constructed from $W_t-L_t$ to the nesting poset constructed from $\pi^{-1}(t)-\iota(f^{-1}(t))$. \begin{figure}[!h]\centering \input{fig-nesting-maps2.tex} \caption{Ambiguity in coherent component labeling of (subsets of) level sets near a saddle.} \label{fig:nesting2} \end{figure} To resolve this, take a larger neighborhood $W'\supseteq W$ so that $W_t'\colonequals W'\cap \pi^{-1}(t)$ contains some connected components of the embedded 1-manifold $\iota(f^{-1}(t))$, for every $t\in [c-\epsilon,c+\epsilon]$ a regular value (and contains an embedded $\Sspace^1\vee \Sspace^1$ for $t$ a critical value). There are 4 unique embeddings, up to diffeomorphism, as shown in Figure \ref{fig:nesting-ALL}, among which Figure \ref{fig:nesting-ALL}(a) corresponds to Statement~\ref{thm:nesting3} and Figure \ref{fig:nesting-ALL}(c) corresponds to Statement~\ref{thm:nesting5}. For Statement~\ref{thm:nesting3}, as in Figure \ref{fig:nesting3}, assign labels to the connected components of the (subsets of) level sets $W_{c-\epsilon}'-\iota(f^{-1}(c-\epsilon))$, $W_c'-\iota(f^{-1}(c))$, and $W_{c+\epsilon}'-\iota(f^{-1}(c+\epsilon))$. The topological inclusions $A'\hookrightarrow A$, $B'\xhookrightarrow{\cong} B$, and $C'\xhookrightarrow{\cong} C$ induce an analogous nesting poset $N_c\to N_{c-\epsilon}$. Similarly, the topological surjections $A'\xtwoheadrightarrow{\cong}A''$, $B'\xtwoheadrightarrow{\cong}B''$, and $C'\xtwoheadrightarrow{\cong}B''$ induce an analogous nesting poset map $N_c\to N_{c+\epsilon}$. \begin{figure}[!h]\centering \input{fig-nesting-maps3.tex} \caption{Topological construction and labelling for Statement~\ref{thm:nesting3}.} \label{fig:nesting3} \end{figure} \begin{figure}[!ht]\centering \input{fig-nesting-maps4.tex} \caption{Topological construction and labelling for Statement~\ref{thm:nesting5}.} \label{fig:nesting4} \end{figure} For Statement~\ref{thm:nesting5}, as in Figure \ref{fig:nesting4}, assign labels to the connected components of the (subsets of) level sets $W_{c-\epsilon}'-\iota(f^{-1}(c-\epsilon))$, $W_c'-\iota(f^{-1}(c))$, and $W_{c+\epsilon}'-\iota(f^{-1}(c+\epsilon))$. The topological inclusions $A'\hookrightarrow A$, $B'\xhookrightarrow{\cong} B$, and $C'\xhookrightarrow{\cong} C$ induce an analogous nesting poset $N_c\to N_{c-\epsilon}$. Similarly, the topological inclusions $A''\xhookrightarrow{\cong}A'$ and $B''\xhookrightarrow{\cong}B'$ induce an analogous nesting poset map $N_{c+\epsilon}\to N_c$. \qed \end{proof} Note that the maps in Statements~\ref{thm:nesting1}~-~\ref{thm:nesting4} all have a zigzag structure $N_{c-\epsilon} \leftarrow N_c \rightarrow N_{c+\epsilon}$, but Statements ~\ref{thm:nesting5} and~\ref{thm:nesting6} do not. One may enforce such maps on Statements~\ref{thm:nesting5} and~\ref{thm:nesting6}, and following Figure \ref{fig:nesting4} we have two choices. One choice is to map $C'$ and $A'$ both to $A''$, following the induced topology, but that would collapse the poset down to a single point, as we require order-preservation. The second choice is to map $C'$ and $B'$ both to $B''$, but that would break functoriality and not follow the topology of the neighborhood. \begin{remark} We mention some observations from this section so far. \begin{enumerate} \item The nesting poset doesn't see the critical value in $[c-\epsilon,c]$ if $c$ is merging or a minimum, because the interiors have not merged yet. \item Functoriality seems to hold from the category of topological spaces $\mathbf{Top}$ to the category of posets and order-preserving maps. However, we only assigned poset maps to particular topological inclusions, not all of them, as mentioned in the comment after the proof of Theorem \ref{theorem:nesting-poset-B}, so functoriality may hold for an appropriately defined subcategory of $\mathbf{Top}$. \item In Figures \ref{fig:nesting1}, \ref{fig:nesting3}, \ref{fig:nesting4} there was always a largest poset element, and in fact $N_t$ always has a maximal element representing the unbounded component of $\pi^{-1}(t)-\iota(f^{-1}(t))$. The poset maps always send the maximal element to the maximal element, so it does not contain any interesting information. \end{enumerate} \end{remark} For completeness, we include in Figure \ref{fig:nesting-ALL} an exhaustive description, up to diffeomorphism, of all of the choices presented by the ambiguous connected component labelling from Figure \ref{fig:nesting2}. \begin{figure}[!ht]\centering \input{fig-nesting-mapsALL.tex} \caption{Larger neighborhoods $W'\supseteq W$ corresponding to Statements~\ref{thm:nesting3}-\ref{thm:nesting6} of Theorem \ref{theorem:nesting-poset-B}.} \label{fig:nesting-ALL} \end{figure} \subsection{The Zigzag of Posets} \subsubsection{Combinatorial Barcode} We now have a zigzag structure along $\Rspace$ of the nesting posets of $f$. This new data will allow us to augment the data of the barcode with a new type of barcode that combinatorially describes a Morse function factoring through an embedding by a height projection. \begin{corollary} \label{cor:zigzag} Given a slicing $a_0 < t_1 < a_1 < \cdots < t_n < a_{n}$, there is a zigzag of posets \begin{equation} \label{eqn:nesting-zigzag} N_{a_0} \xleftrightarrow{\varphi^-_0} N_{t_1} \xleftrightarrow{\varphi^+_0} N_{a_1} \xleftrightarrow{\varphi^-_1} N_{t_2} \xleftrightarrow{\varphi^+_1} \cdots \xleftrightarrow{\varphi^-_n} N_{t_n} \xleftrightarrow{\varphi^+_n} N_{a_{n}}, \end{equation} where the direction of each $\varphi^\pm_i$ is defined by Theorem \ref{theorem:nesting-poset-B}. \end{corollary} This follows directly from Theorem \ref{theorem:nesting-poset-B}. Note that every backwards map $\varphi$ in the zigzag \eqref{eqn:nesting-zigzag} can be reversed using the Galois connection construction \cite[Chapter 3]{roman2008lattices} with \begin{equation} \varphi^{\dagger}(y) \colonequals \max \{x:~\varphi(x) \leq y\}, \end{equation} though we are only guaranteed $\varphi^{\dagger}(\varphi(x)) \geq x$. That is, while we do get a diagram \begin{equation} \label{diag:straightened-zigzag} N_{a_0} \longrightarrow N_{t_1} \longrightarrow N_{a_1} \longrightarrow \cdots \longrightarrow N_{t_n} \longrightarrow N_{a_n} \end{equation} of posets, it does not capture splitting saddles (neither nesting nor non-nesting). Hence we instead explore a combinatorial barcode with $\field$-algebras corresponding to posets in a persistence module. \begin{remark} The zigzag \eqref{eqn:nesting-zigzag} is reminiscent of diagrams in zigzag persistence \cite{zigzag}, and at first glance it seems possible to recover \eqref{eqn:nesting-zigzag} by taking the nesting posets of spaces whose homology is taken to compute zigzag persistence. However, in zigzag persistence the considered spaces are of the sort $f^{-1}[t,s]$, whereas in our case we compute the nesting poset of (a subset of) $f^{-1}(t)$. For such $t$, there does not always exist $\epsilon>0$ such that $f^{-1}(t\pm \epsilon)$ is the same nesting poset as for $f^{-1}(t)$, and so computing the nesting poset of an interlevel set does not make sense in our context. Nonetheless, there are modifications \cite{kimmemoli} of this approach that hold promise for applications. \end{remark} For a poset $P$, an \emph{interval} $I$ in $P$ is a connected subposet $I\subseteq P$ such that for any $x, y \in I$, $x \leq t \leq y$ implies $t \in I$. When the poset if finite, an interval $I$ is generated by two endpoints, and we write $I = \left[ a, b \right] \colonequals \{t\in P :~ a \leq t \leq b \}$. The following definition comes from \cite{charalambides2018enumerative}. \begin{definition} The \textit{incidence algebra} $\field P $ of a poset $P$ is the free vector space over $\field$ generated by set of intervals $I$ of $P$. Multiplication $\times \colon \field P \times \field P \rightarrow \field P$ is given by concatenation of compatible intervals \[ \left[ c,d \right] \times \left[ a,b \right] = \begin{cases} \left[ a,d \right] & \text{if\ }b=c \\ 0 & \text{else,} \end{cases} \] and multiplication is $0$ for unconcatenable intervals, making $\field P $ a $\field$-algebra. \end{definition} \begin{conjecture} \label{conj:zigzag-algebra} There is a zigzag module of $\field$-algebras \[ \field N_{a_0} \leftrightarrow \field N_{t_1} \leftrightarrow \field N_{a_1} \leftrightarrow \field N_{t_2} \leftrightarrow \cdots \leftrightarrow \field N_{t_n} \leftrightarrow \field N_{a_{n}}, \] with arrow direction given by Corollary \ref{cor:zigzag}, that decomposes into a sum of interval indecomposables of the form \[ \field_I (t) = \begin{cases} \field \{*\} & \text{if\ } t \in I \\ 0 & \text{if\ } t \notin I. \end{cases} \] Furthermore, this collection of interval indecomposables determines $f$ up to poset equivalence. \end{conjecture} This approach follows the vein of foundational persistent homology results \cite{Crawley-Boevey2015,Botnan2017} about decomposition of barcodes into fundamental parts. We call this collection of interval indecomposables the \emph{combinatorial barcode} of $f$.
\section{Introduction} Vast growth in the popularity of cloud storage and other cloud services in recent years has led to an increased interest in coding solutions for distributed data storage. Traditionally, protection against the failure of nodes/servers was achieved by replicating the contents of a node multiple times. While this results in very efficient repair in the case of a node failure, i.e., a failed node can be replaced by simply replicating any of the remaining nodes, the required storage overhead makes this method unattractive for large scale data centers. Instead, some system operators have made the transition to MDS-coded storage. While these codes offer the optimal trade-off between the number of recoverable nodes and storage overhead, the cost of recovering/replacing a failed node in terms of total network traffic and number of nodes involved is in general far from optimal. Different approaches have been considered to reduce this cost of node recovery, with special attention to the more likely event of a single or very few node failures, as efficient repair for those cases is especially important. The most prominent approaches addressing this issue are \emph{regenerating codes} \cite{Dimakis2010,Dimakis2011,Rashmi2012,Tamo2017}, which aim to decrease the network traffic required for repair, and \emph{locally repairable codes} (LRC) \cite{Huang2007,Huang2012,Gopalan2012,Sathiamoorthy2013,Kamath2014,Papailiopoulos2014,Tamo2014,Silberstein2015}, which limit the number of nodes involved in the repair. In \cite{Tamo2014}, a family of LRCs, popular for the small required field size and for fulfilling the Singleton-like bound on the distance \cite{Gopalan2012,Kamath2014}, was constructed as subcodes of (generalized) Reed-Solomon (GRS) codes. In addition, \emph{partial maximum distance separable} (PMDS) codes\footnote{In \cite{Huang2007, Chen2007, Gopalan2014,gopalan2017,martinez2019universal} these codes are referred to as \emph{maximally recoverable codes}, the definitions are equivalent.} \cite{Huang2007, Chen2007, Gopalan2014,Blaum2013,gabrys2018constructions,Blaum2016,calis2016general,gopalan2017,Horlemann-Trautmann2017,martinez2019universal} fulfill an even stronger notion of locality by requiring that any information-theoretically solvable erasure pattern can be recovered and have been proposed for use in distributed storage systems to further decrease the probability of data loss. The main motivation of storage codes such as LRCs and regenerating codes is erasure correction, as these occur naturally in distributed storage systems whenever nodes fail, e.g., due to hardware failures, power outages, or maintenance. It is often assumed that errors are detected \cite{Blaum2013}, e.g., by a cyclic redundancy check (CRC), thereby turning errors into erasures. Such a storage system can also be viewed as a concatenated coding scheme where the inner code is used solely for error detection, and the outer code for recovery of erasures \cite{roth2014coding}. While this declaration of erasures is likely to be successful for some causes of errors, such as, e.g., faulty sectors on a hard-drive or solid-state drive, errors caused by faulty synchronization or bad links between the nodes cannot be detected on these lower levels. These events result in \emph{errors}, i.e., events where the position of occurrence is unknown, which is what we consider in this work. More specifically, such an error event is likely to corrupt a large number of symbols, which results in a burst of errors, a fact that we will exploit in the second part of this work to increase the error correction capability of some LRCs and PMDS codes. As erasures are a far bigger concern than errors in distributed storage systems, where these code classes are of interest, we would like to emphasize that the proposed methods focus either on LRCs/PMDS codes in general or on popular classes of LRCs, i.e., subcodes of GRS codes such as Tamo--Barg codes \cite{Tamo2014}, and \emph{do not require a change in the structure of the codes}. Hence, they can be viewed as a worst-case measure that can be employed as a last resort in the case of error events, without any increase in costs, e.g., storage overhead, for the system. There have been several previous works that consider error correction from storage codes such as LRCs and regenerating codes. In \cite{Silberstein2015,Pawar2011,Han2012} the authors consider a concatenated structure with LRCs or regenerating codes as inner codes and rank metric codes as outer codes to protect against adversaries of different types. Regenerating codes with an error tolerance in the repair process were considered in \cite{Rashmi2012,Pawar2011,Han2012}. In \cite{Dikaliotis2010} a hashing scheme is proposed to detect errors and protect against adversarial nodes. Efficient repair of nodes by error correction from parts of the received word was considered in \cite{Tamo2017}. To the best of our knowledge, this is the first work which utilizes the additional redundancy accounting for the locality in order to increase the \emph{error} decoding radius beyond the unique decoding radius of the code. Besides the practical implications, the presented results are especially of theoretical interest, as very few classes of codes are known to be decodable beyond the Johnson radius or even up to the Singleton bound. In particular, it is known that Reed--Solomon (RS) codes, like all linear codes, can be list-decoded up to the Johnson radius \cite{Johnson1962} and an explicit algorithm exists \cite{Guruswami1999}. Although it has been shown that some Reed-Solomon codes can be list-decoded beyond this radius~\cite{Rudra2013}, there are no known algorithms to achieve this in general. It is therefore an interesting observation distance-optimal LRCs \emph{can be list-decoded beyond the Johnson radius} while the complexity and list size grow polynomially in the code length, when the number of local repair sets is constant. \textbf{Our Contribution:} We consider different approaches that apply to different settings and rate regimes. First, we study \emph{list decoding} of LRCs. A list decoder returns all codewords within a specified distance around the received word and it is known that every $q$-ary code can be list-decoded up to the $q$-ary Johnson radius~\cite{Johnson1962,bassalygo1965} with a list size polynomial in the code length. For specific code classes, such as GRS codes, there exists a full body of work on list decoding, including explicit decoding algorithms \cite{sudan1997,Guruswami1999,kotter1996,roth2000,Guruswami2012} and analysis of the (average) list size for random errors \cite{Cheung1988,cheung1989,McEliece1986,McEliece2003}. Further, for some classes of codes based on GRS codes it has been shown that they can be decoded beyond the Johnson radius~\cite{Guruswami2012,guruswami2008,parvaresh2005}. In the second part of this work, we show that interleaved codes, i.e., the direct sum of codes with errors occurring in the same positions, can increase the tolerance against errors even further. In fact, in distributed data storage the assumption of burst errors, i.e., errors that corrupt the same positions in many codewords, which is required for a possible increase of the decoding radius through interleaved decoding, is very natural (cf.~Figure~\ref{fig:illustration}). Typically, a distributed storage system stores many codewords of the storage code, where each node stores one symbol of each codeword. Hence, if, e.g., one of the nodes is not synchronized correctly or an inner decoder fails, all codewords will be corrupted in the same position and in this case interleaved decoding can correct more errors compared to bounded minimum distance (BMD) decoding. \begin{figure}[htb] \begin{center} \resizebox{0.6\linewidth}{!}{\input{graphicServers.tex}} \end{center} \caption{Illustration of LRC coded storage system with burst errors} \label{fig:illustration} \end{figure} \textbf{Structure of the Paper}: Section~\ref{sec:prelim} gives notations and definitions. In Section~\ref{sec:listDecoding}, we show that a large class of optimal LRCs can be list-decoded beyond the alphabet-dependent Johnson radius. Among others, we show that if the number or locally list-decodable errors, normalized by the repair set size, is larger than the normalized global Johnson radius, we can increase the overall decoding radius (cf.~Theorem~\ref{thm:ListDecodingLRCs} and Lemma~\ref{lem:localUniqueDecoding}). We give bounds on the resulting list size and decoding complexity, which are exponential in the number of repair sets, but polynomial in the length of the code when considered under an asymptotic regime where the number of repair sets is constant. The new decoder can also be interpreted as a probabilistic unique decoder, which is of low complexity, but fails with a probability that we can bound using probabilities that certain other list decoders return a unique result. In Section~\ref{sec:ILRC}, we first specialize the decoder of Section~\ref{sec:listDecoding} to LRCs that are subcodes of GRS codes, and whose local codes are GRS codes. Using the Guruswami--Sudan list decoder, we obtain an explicit algorithm that attains the new decoding radius described in Section~\ref{sec:listDecoding}. Using McEliece's results on the probability that the list size of the Guruswami--Sudan decoder is one~\cite{McEliece2003}, we obtain explicit bounds on the success probability of the unique decoder and show that it converges to $1$ for the code length going to infinity. Furthermore, in Section~\ref{subsec:decSupercode}, we show that the decoding radius can be further increased by interleaved decoding using the existing decoders for interleaved GRS codes. In Section~\ref{sec:PMDS}, we consider decoding of interleaved PMDS codes. We show that we can decode some interleaved PMDS codes beyond their minimum distance with high probability by the decoding algorithm for high-order interleaved codes by Metzner and Kapturowski \cite{metzner1990general}. The advantage of this decoder is that it only relies on the inherent properties of PMDS codes, and is therefore applicable to \emph{any} class of PMDS codes. We derive bounds on the success probability and show that for some families of PMDS code parameters we can correct up to $n-k-1$ errors with success probability approaching $1$ as the length goes to infinity. The introduced methods of decoding give an improvement for many different rate regimes, complementing each other in the required relation between rate of the local codes and the global code (cf.~Figure~\ref{fig:rate_tuples} in Section~\ref{sec:conclusion}). \section{Preliminaries}\label{sec:prelim} We denote by $\F{q}$ a finite (extension) field with $q=p^m$ elements, where~$p$ is a prime and $m$ is a positive integer. We write $[a]$ for the set of integers $\{i : 1 \leq i \leq a , i \in \mathbb{Z} \}$. A $q$-ary code of length $n$, dimension $k$, and distance $d$ is denoted by $[n,k,d]_q$, and if the parameters $d$ and/or $q$ are not of interest, we omit them. Let $\mathcal{C}$ be an $[n,k]$ code and $\mathcal{R} \subseteq [n]$ be a set of coordinates. Denote by $\mathcal{C}|_{\mathcal{R}}$ the code obtained by restricting the code~$\mathcal{C}$ to the coordinates of $\mathcal{R}$, i.e., puncturing (deleting) the positions $[n]\setminus \mathcal{R}$. We define \emph{shortening} the code $\mathcal{C}$ in position $i$ by a fixed value $\gamma$ as $\mathcal{C}' = \{c | c\in \mathcal{C} , c_i = \gamma \}_{[n] \backslash i}$. \subsection{Locally Repairable Codes} A code is said to have locality $r$ if every position can be recovered from at most $r$ other codeword positions. If multiple erasures can be tolerated within such a \emph{local repair set}, the code is said to have $(r,\varrho)$ locality. \begin{definition}[$(r,\varrho)$-locality] An $[n,k]$ code $\mathcal{C}$ has $(r,\varrho)$-locality if there exists a partition $\mathcal{P} = \{\mathcal{R}_1,\mathcal{R}_2,...,\mathcal{R}_\mu\}$ of $[n]$ into sets of cardinality $|\mathcal{R}_j| \leq r+\varrho-1$ such that for the distance of the code restricted to the positions of $\mathcal{R}_j$ it holds that $d\left(\mathcal{C}|_{\mathcal{R}_j}\right) \geq \varrho \;, \forall \, j\in [\mu]$. \end{definition} A Singleton-like upper bound on the achievable distance of an $[n,k,r,\varrho]$ LRC was derived in \cite{Gopalan2012} for $\varrho=2$ and generalized to $\varrho \geq 2$ in \cite{Kamath2014} to \begin{equation} \label{eq:boundDistanceLRC} d \leq n-k+1-\left( \left\lceil \frac{k}{r} \right\rceil -1 \right) (\varrho-1) \ . \end{equation} In the following we refer to codes achieving this bound with equality as \emph{optimal} LRCs. Several classes of optimal LRCs are known \cite{tamo2016optimal, Silberstein2013}, including one of particular interest for this work, the so-called Tamo--Barg LRCs \cite{Tamo2014}. Tamo--Barg LRCs are constructed as subcodes of RS codes, therefore the requirement on the field size is only in the order of the code length $n$ and they can be decoded by any of the well-studied RS decoders. In the following, $\mathcal{R}_j$ is referred to as the $j$-th local repair set and the code $\mathcal{C}|_{\mathcal{R}_j}$ as the $j$-th local code. For simplicity, we only consider LRCs where every local code is of the same length $n_l = |\mathcal{R}_1| = ...= |\mathcal{R}|_{\mu}$ with $n_l \mid n$ and $r \mid k$. We denote a $q$-ary code of length~$n$, dimension~$k$, locality~$r$ and local distance~$\varrho$ by $[n,k,r,\varrho]_q$, and if the field size $q$ is not important, we omit it. \subsection{Partial MDS Codes} In Section~\ref{sec:PMDS}, we consider interleaved decoding of a special class of codes with locality, namely \emph{partial MDS} (PMDS) codes \cite{Blaum2013,gabrys2018constructions,Blaum2016,calis2016general,Horlemann-Trautmann2017}, also referred to as \emph{maximally recoverable codes} \cite{Huang2007, Chen2007, Gopalan2014,gopalan2017,martinez2019universal}. The distinctive property of these codes is that they guarantee to correct any pattern of erasures that is information-theoretically correctable, i.e., every set of codeword positions which is not necessarily linearly dependent by the locality constraint or the code dimension, is linearly independent. While this increases the number of correctable erasure patterns, it generally comes at the cost of a larger required field size compared to other LRCs. We state the definition of PMDS codes given in \cite{Blaum2013} in terms of our notation. \begin{definition}[PMDS codes]\label{def:partialMDS} Let $\mathcal{C}$ be an $[n,k,r,\varrho]$ LRC code, where the local codes are $[r+\varrho-1,r,\varrho]$ MDS codes. We say that the code $\mathcal{C}$ is a \emph{partial MDS code} if for any set $E \subset [n]$, where $E$ is obtained by picking $\varrho-1$ positions from each local repair set, the distance of the code punctured in these positions is $d(\mathcal{C}|_{[n]\setminus E}) = n-\frac{n(\varrho-1)}{r+\varrho-1}-k+1$. \end{definition} Note that the definition of PMDS codes implies the optimality of the code with respect to the Singleton-like bound \cite{Gopalan2012,Kamath2014} given in (\ref{eq:boundDistanceLRC}). \begin{remark} A more general form of PMDS codes, where the distance, i.e., number of tolerable erasures, can be different in each local repair set is often considered in literature. For simplicity, we focus on PMDS with the same distance in each local code in this work but note that the decoding approach is also valid for PMDS codes with different distances in the local codes. \end{remark} \subsection{Interleaved Codes} Interleaved codes are direct sums of a number of constituent codes, where, by assuming that errors occur at the same positions in all constituent codewords (burst errors), one is often able to decode far beyond half the minimum distance and even the Johnson radius. We will only consider homogeneous interleaved codes over linear codes in this work, for which the constituent codes are all the same and linear. \begin{definition}[See, e.g., \cite{metzner1990general,krachkovsky1997decoding}] Let $\mathcal{C}[n,k,d]$ be a linear code over $\ensuremath{\mathbb{F}_q}$ and $\ell \in \mathbb{N}$ be called the interleaving degree. The corresponding $\ell$-interleaved code is defined by \begin{align*} \mathcal{IC}[\ell; n,k,d] := \left\{ \ve{C} = \left[\begin{smallmatrix} \c_1 \\ \c_2 \\ \vphantom{\int\limits^x}\smash{\vdots} \\ \c_\ell \end{smallmatrix}\right] \, : \, \c_i \in \mathcal{C} \right\}. \end{align*} \end{definition} The assumed error model is as follows. We want to reconstruct a codeword $\ve{C}$ from a received word of the form $\ve{R} = \ve{C} + \ve{E}$, where $\ve{E} \in \ensuremath{\mathbb{F}_q}^{\ell \times n}$ is an error matrix. Let $\mathcal{E}$ be the set of indices of non-zero columns of $\ve{E}$, then we say that an error matrix is of weight $t$ if $|\mathcal{E}| = t$. This error model is often called a ``burst error'' and motivated by many applications, such as replicated file disagreement location~\cite{metzner1990general}, data-storage applications~\cite{krachkovsky1997decoding} (cf.~Figure~\ref{fig:illustration}), suitable outer codes in concatenated codes~\cite{metzner1990general,krachkovsky1998decoding,haslach1999decoding,justesen2004decoding,schmidt2005interleaved,schmidt2009collaborative}, an ALOHA-like random-access scheme \cite{haslach1999decoding}, decoding non-interleaved codes beyond half-the-minimum distance by power decoding \cite{schmidt2010syndrome,kampf2014bounds,rosenkilde2018power,puchinger2019improved}, and recently for code-based cryptography \cite{elleuch2018interleaved,Holzbaur2019crypto}. It is well-known that by interpreting the columns of the interleaved codewords as elements of an extension field $\mathbb{F}_{q^\ell}$, the resulting code is a linear code over $\mathbb{F}_{q^\ell}$ with the same parameters $[n,k,d]$. If the constituent codes are RS codes, then the resulting code is also an RS codes with the same evaluation points (which are in a subfield $\ensuremath{\mathbb{F}_q}$ of the code's field $\mathbb{F}_{q^\ell}$), cf.~\cite{sidorenko2008decoding}. Note that the mapping also provides a one-to-one correspondence of burst errors in $\ensuremath{\mathbb{F}_q}^{\ell \times n}$ and Hamming errors of the same weight in $\mathbb{F}_{q^\ell}^n$. For some constituent codes, for instance RS or some AG codes, there are efficient decoders that correct many errors beyond half the minimum distance and even the Johnson radius with high probability. Beyond these radii, the known algorithms fail for some error patterns, but succeed for a fraction of errors close to $1$. The first such algorithm was given in \cite{krachkovsky1997decoding} for interleaved RS codes and corrects up to $\tfrac{\ell}{\ell+1}(n-k)$ errors. Since then, many decoders with better complexity and larger decoding radius, as well as some bounds on the probability of decoding failure have been derived \cite{bleichenbacher2003decoding,coppersmith2003reconstructing,parvaresh2004multivariate,brown2004probabilistic,parvaresh2007algebraic,schmidt2007enhancing,schmidt2009collaborative,cohn2013approximate,nielsen2013generalised,wachterzeh2014decoding,puchinger2017irs,yu2018simultaneous}. One decoder of special interest for this work was introduced by Metzner and Kapturowski in \cite{metzner1990general} and will be discussed in more detail in Section~\ref{sec:metznerKapturowski}. It is a generic decoder, which works for interleaved codes of high interleaving degree and arbitrary constituent codes. \section{List Decoding of Errors in Locally Repairable Codes} \label{sec:listDecoding} List decoding is a powerful technique, where instead of returning a unique codeword or a decoding failure, the decoder returns a list of \emph{all codewords} within a given distance from the received word. It has been shown combinatorially that any $q$-ary code can be list-decoded up to the $q$-ary Johnson radius \cite{Johnson1962,bassalygo1965}, which only depends on the code alphabet, length, and minimum distance, with a maximum list size that is polynomial in the code length. Note however that for many code classes, it is a challenging task to find explicit decoders up to the Johnson radius. In this section, we introduce a decoding method for LRCs that achieves a decoding radius that exceeds the Johnson radius of the a large class of LRCs, by making use of the additional redundancy required for the locality in the decoding process. There are only few other known non-trivial classes of codes \cite{Guruswami2012,guruswami2008,parvaresh2005} for which it is known that they can be decoded beyond the Johnson radius. In addition to this theoretical interest, the proposed decoder is also of interest for practice, as it applies to a very large class of LRCs without requiring a change in the structure of the code. In this work we consider list decoding of \emph{errors}, but for sake of completeness we include a discussion of erasure list decoding in Appendix~\ref{app:erasure_list_decoding}. \subsection{New Decoding Radius}\label{subsec:newdecodingradius} A $q$-ary code of length~$n$ is called~$(\tau,L)$-list-decodable if the Hamming sphere of radius~$\tau$ centered at any vector~$\ve{v}$ of length~$n$ always contains at most~$L$ codewords~$\c\in \mathcal{C}$. It is known \cite{Johnson1962,bassalygo1965} that any $q$-ary code of length~$n$ and distance~$d$ is list-decodable up to the $q$-ary Johnson radius, which is given by the largest $\tau_J$ such that \begin{align} 0&\leq (\theta_qn-\tau_J)^2 - \theta_qn(\theta_qn-d) \label{eq:johnsonCondition}\\ &\Longrightarrow \;\; \tau_J = \theta_q n\left(1-\sqrt{1-\frac{d}{n\theta_q}} \right) \ , \label{eq:johnsonradius} \end{align} where $\theta_q = 1-\frac{1}{q}$ and the maximum list size is upper bounded by \begin{equation} L \leq \frac{\theta_q dn}{\tau^2-\theta_qn(2\tau-d)} \ . \label{eq:maximal_list_size} \end{equation} In the following, if $q$ is not explicitly given, we consider the alphabet-independent case of $q \rightarrow \infty$, i.e., $\theta_q = 1$. For any radius $\tau$, we denote the number of list-decodable errors, i.e., the largest integer smaller than~$\tau$, by \begin{align} t=\ceil{\tau-1},\; \text{where} \;\tau-1 \leq t < \tau \label{eq:definet} \ , \end{align} with the corresponding subscript, e.g., $t_J$ for the Johnson radius $\tau_J$. Further, for an LRC we denote by~$\tau_g$ and~$\tau_l$ the global and local decoding radius and define~$t_g$ and~$t_l$ accordingly, i.e., as the total number of correctable errors and the number of errors correctable in each local code. Generally, it has to be assumed that the list size increases exponentially in the code length~$n$ when the radius exceeds~\eqref{eq:johnsonradius}. While it is known that there are codes for which the bound is not tight and the list-decoding radius exceeds the Johnson radius \cite{parvaresh2005,Guruswami2006,guruswami2008,Guruswami2012, Rudra2013}, the behavior of most codes is still mostly an open problem. In the following, we show that the list-decoding radius of certain LRCs exceed the Johnson radius, i.e., the complexity and list size grow \emph{polynomially} in the length when the number of local repair sets~$\frac{n}{n_l}$ is constant. Before giving the main statement of this section, we first establish two lemmas on the distribution of the of errors in an LRC and the relation of the Johnson radius to the code length. \begin{lemma} \label{lem:sigma} Let~$\mathcal{C}$ be an~$[n,k,r,\varrho]$ LRC. For a codeword~$\c \in \mathcal{C}$ and any word~$\ve{w}$ with~$\dt{\c}{\ve{w}} \leq t_g$, let~$\mathcal{I}\subseteq \left[\frac{n}{n_l}\right]$ be the set of repair set indices~$i$ with~$\dt{\c|_{\mathcal{R}_i}}{\ve{w}|_{\mathcal{R}_i}} \leq t_l, \; \forall \; i \in \mathcal{I}$. Then the cardinality of~$\mathcal{I}$ is bounded by $\mathcal{I} \geq \ceil{\sigma}$ with \begin{equation} \sigma = \max\left\{0,\frac{n}{n_l}-\frac{\tau_g}{\tau_l} \right\} .\label{eq:sigmaineq} \end{equation} \end{lemma} \begin{IEEEproof} Trivially, the cardinality of~$\mathcal{I}$ is non-negative. The maximum number of repair sets~$\mathcal{R}_j$ with~$\dt{\c_{\mathcal{R}_j}}{\ve{w}_{\mathcal{R}_j}} > t_l$ such that~$\dt{\c}{\ve{w}} = \sum_{j=1}^{\frac{n}{n_l}} \dt{\c_{\mathcal{R}_j}}{\ve{w}_{\mathcal{R}_j}} \leq t_g$ is given by~$\floor{\frac{t_g}{t_l+1}}$. Subtracting from the total number of repair sets~$\frac{n}{n_l}$ gives \begin{align*} \frac{n}{n_l}-\floor{\frac{t_g}{t_l+1}} \stackrel{(a)}{=} \ceil{\frac{n}{n_l}-\floor{\frac{t_g}{t_l+1}}} \geq \left\lceil \frac{n}{n_l}-\frac{t_g}{t_l+1}\right\rceil \geq \ceil{\frac{n}{n_l}-\frac{\tau_g}{\tau_l}} \ , \end{align*} where $(a)$ holds because the left hand side is an integer. \end{IEEEproof} \begin{lemma}\label{lem:increasingInN} For any fixed $d,\ell\geq 1$ and $q>1$ let \begin{align*} h(n) \coloneqq \theta_q n\left(1-\left(1-\frac{d}{n\theta_q}\right)^{\frac{\ell}{\ell+1}} \right) \ , \end{align*} with $\theta_q = q-\frac{1}{q}$. The function $h(n)$ is monotonically decreasing in $n$ for $n \geq \frac{d}{\theta_q}$. \end{lemma} \begin{IEEEproof} The proof is given in Appendix~\ref{app:proof_of_lemma_increasingInN}. \end{IEEEproof} Note that $n \geq \frac{d}{\theta_q}$ needs to hold for any $q$-ary code of length $n$ and distance $d$ \cite{bassalygo1965}. The following theorem provides our most general statement, which is valid for any LRC. \begin{theorem}[List Decoding of LRCs] \label{thm:ListDecodingLRCs} Let $L_{(n,d,\tau)}$ denote the maximum list size when list decoding an~$[n,k,d]_q$ code with radius~$\tau$. Then an $[n,k,r,\varrho]_q$ LRC is~$(\tau_g,L_g)$-list-decodable, with \begin{equation} \tau_g = \left\{ \begin{array}{ll} \frac{d}{\varrho} \cdot \tau_{J,l} \, , &\text{if}\;\; \ceil{\sigma}>0 \\ \theta_q\left(n-\sqrt{n\left(n-\frac{d}{\theta_q}\right)}\right) \, , & \text{else} \ , \end{array} \right. \label{eq:jblrc} \end{equation} where $\theta_q=1-\frac{1}{q}$ and $\tau_{J,l}$ denotes the $q$-ary Johnson radius of the local codes. The list size is upper bounded by \begin{equation}\label{eq:listSize} L_g \leq \binom{\frac{n}{n_l}}{\ceil{\sigma}} L_{(n_l,\varrho,\tau_{J,l})}^{\ceil{\sigma}} L_{(n-\ceil{\sigma} n_l,d,\tau_g)} \ . \end{equation} \end{theorem} \begin{IEEEproof} Denote by $\mathcal{I}\subseteq \left[\frac{n}{n_l}\right]$ the set of repair set indices $i$ with~$\dt{\c_{\mathcal{R}_i}}{\ve{w}_{\mathcal{R}_i}} \leq t_l$. By Lemma~\ref{lem:sigma} the cardinality of this set is~$|\mathcal{I}| \geq \ceil{\sigma}$. These repair sets can be list-decoded locally. For every combination of codewords in these local lists, shortening the code in the corresponding~$|\mathcal{I}|n_l$ positions gives an~$(n',k',d')$ code\footnote{The dimension $k'$ of the shortened code depends on the particular code. However, the Johnson radius, and thereby the following arguments, only depend on the length $n'$ and distance $d'$ of the shortened code.} of length $n'=n-|\mathcal{I}| n_l$ and distance $d' \geq d$. Let $\tau'$ be the $q$-ary Johnson radius of the shortened code. By setting $\ell=1$ in Lemma~\ref{lem:increasingInN} we obtain \begin{align*} \tau' = \theta_q\left(n-|\mathcal{I}| n_l - \sqrt{(n-|\mathcal{I}| n_l)\left(n-|\mathcal{I}| n_l-\frac{d'}{\theta_q}\right)}\right) \geq \theta_q\left(n-\sigma n_l - \sqrt{(n-\sigma n_l)\left(n-\sigma n_l-\frac{d}{\theta_q}\right)}\right) \coloneqq \tau_g \end{align*} for any $n-|\mathcal{I}|n_l \geq d$. Note that if $n-|\mathcal{I}|n_l \leq d$ the shortened code is necessarily of dimension $k'=0$ and decoding is trivial. With $n-\sigma n_l = \frac{\tau_g}{\tau_l} n_l$ we obtain \begin{align} \tau_g &= \theta_q\left( \frac{\tau_g}{\tau_l} n_l- \sqrt{\frac{\tau_g}{\tau_l} n_l\left(\frac{\tau_g}{\tau_l} n_l-\frac{d}{\theta_q}\right)}\right) \nonumber \\ \tau_g \left( \frac{n_l}{\tau_l} - \theta_q^{-2}\right)^2 &= \frac{n_l}{\tau_l} \left( \frac{n_j}{\tau_l} - \frac{d}{\theta_q}\right) \nonumber \\ \tau_g &= \frac{d \tau_l}{2 \tau_l-\frac{\tau_l^2}{\theta_q n_l}} \ . \label{eq:tau2} \end{align} Each local code is a $q$-ary code of length $n_l$ and distance $\varrho$, and can therefore be decoded up to the local Johnson radius of \begin{align*} \tau_{J,l} = \theta_q \left( n_l-\sqrt{n_l\left(n_l-\frac{\varrho}{\theta_q}\right)}\right) \ . \end{align*} Setting $\tau_l = \tau_{J,l}$ gives \begin{align*} \tau_g &= \frac{d \tau_{J,l}}{2 \theta_q \left( n_l-\sqrt{n_l\left(n_l-\frac{\varrho}{\theta_q}\right)}\right)-\frac{\theta_q^2 \left( n_l-\sqrt{n_l\left(n_l-\frac{\varrho}{\theta_q}\right)}\right)^2}{\theta_q n_l}} = \frac{d}{\varrho} \tau_{J,l} \ . \end{align*} There are at most~$\binom{\frac{n}{n_l}}{\ceil{\sigma}}$ choices for the~$\ceil{\sigma}$ list-decodable repair sets and for each choice there are at most~$L_{(n_l,\varrho,\tau_{J,l})}^{\ceil{\sigma}}$ distinct possibilities to shorten the received word. The list size of each shortened code is upper bounded by~$L_{(n-\ceil{\sigma} n_l,d,\tau_g)}$ and the upper bound on the global maximum list size $L_g$ follows. \end{IEEEproof} \begin{remark} Observe that the radius and list size defined in Theorem~\ref{thm:ListDecodingLRCs} are equal to the Johnson radius and the corresponding list size when $\sigma=0$. For $\sigma>0$, the radius is larger than the Johnson radius while the list size is still polynomial in $n$ for fixed $\frac{n}{n_l}$. Therefore, the radius of Theorem~\ref{thm:ListDecodingLRCs} generalizes the Johnson radius in the sense that it contains the pair of radius (\ref{eq:johnsonradius}) and list size (\ref{eq:maximal_list_size}) as a special case. In particular, notice that the upper bound on the list size of (\ref{eq:maximal_list_size}) is not simply exponential in $n$ for $\tau>\tau_J$ (which would suffice to say that the bound does not imply list decodability anymore) but does not hold for $\tau>\tau_J$ and therefore \textbf{does not allow to make any statement on the list size} for such $\tau$. For many classes of codes, e.g., RS codes, it is an open problem whether they are list decodable beyond the Johnson radius with polynomial list size. Hence, even for finite parameters with $\sigma>0$, i.e., in the non-asymptotic regime, Theorem~\ref{thm:ListDecodingLRCs} is an improvement compared to the Johnson radius, regardless of the specific upper bound on the list $L_g$, as the Johnson radius and the corresponding bound on the list size are unsuitable to give any statement for $t$ with $\tau_J < t <\tau_g$. \end{remark} \begin{remark}\label{rem:list_size_bound_not_tight} For $\sigma>0$, the list size bound in Theorem~\ref{thm:ListDecodingLRCs} is not tight, both for the worst and average case. \textbf{1) Worst-case list size:} It becomes apparent from the proof of Theorem~\ref{thm:ListDecodingLRCs} that the upper bound \eqref{eq:listSize} on the list size can only be attained if \begin{itemize} \item the list size in each local repair set is maximal, i.e., equals $=L_{(n_l,\varrho,\tau_{J,l})}$ and \item for each of the $\binom{\frac{n}{n_l}}{\ceil{\sigma}}$ combinations of $\ceil{\sigma}$ repair sets and all $L_{(n_l,\varrho,\tau_{J,l})}^{\ceil{\sigma}}$ combinations the codewords in the output lists of the local decoders in these repair sets, after shortening these repair sets, the decoder returns a list of $L_{(n-\ceil{\sigma} n_l,d,\tau_g)}$ codewords. \end{itemize} For a given set of $\ceil{\sigma}$ repair sets and combination of local codewords in the local decoder's output, the number of errors in the remaining repair sets is at most $\tau_g-\chi$, where $\chi$ is the sum of the distances of the chosen local codewords to the corresponding repair sets of the received word. Note that $\chi$ is known to the decoder after fixing the repair sets and local codewords. Hence, a decoder can globally decode the shortened received word with a decoder of radius $\tau_g-\chi$ instead of $\tau_g$, decreasing the maximal list size for this combination of repair sets and local codewords from $L_{(n-\ceil{\sigma} n_l,d,\tau_g)}$ to $L_{(n-\ceil{\sigma} n_l,d,\tau_g-\chi)}$. It is easy to see that for a fixed combination of local repair sets, there is at most one combination of local codewords with $\chi=0$ (in fact, if $\chi=0$ for one combination, the list size must be $1$ for all these local repair sets). Hence, the sum of the resulting list sizes of all repair sets/local codewords combinations is strictly smaller than the bound \eqref{eq:listSize}. By carefully analyzing possible distances of local codewords to the received word for maximal local list sizes, one may obtain a better worst-case bound. We present a first-order improvement of the worst-case bound in Theorem~\ref{thm:ListDecodingLRCsImproved} in Appendix~\ref{app:improved_list_bound}, which makes use of the fact that a local list either contains only one element or, if the list is larger, all codewords in the list have a minimal distance to the received word. The improvement is, however, not significant: we can save at most a factor $L_{(n-\ceil{\sigma} n_l,d,\tau_g)}$ compared to \eqref{eq:listSize} and the terms exponential in the number of local repair sets remain (cf.~Remark~\ref{rem:improved_list_size_bound_no_significant_improvement} in Appendix~\ref{app:improved_list_bound}). In the main part of the paper, we present the bound~\eqref{eq:listSize} to focus on the principle of our list decoding approach. The improvement discussed before is technical and the improvement is marginal, but it might yield to more significant improvements by further analyzing the relation of local and global list sizes and is therefore shown in Appendix~\ref{app:improved_list_bound}. As a second possible approach for improving the worst-case list size we will discuss a connection of the list size to low-weight codewords of a code in Remark~\ref{rem:list_decoding_connection_to_low_weight_codewords} below. By bounding the number of such codewords, one may also be able to obtain a better upper bound on the worst-case list size~\eqref{eq:listSize}. In both approaches, the weight distribution of the local and global codes is a key towards an improved result, which is however not known (and in general not the same) for all codes---making a general statement technical and hard to achieve. If the decoder had, for each codeword with distance at most $\tau_g$ to the received word, additional side information which $\lceil \sigma \rceil$ local decoders were successful (i.e., contain the correct local codeword in the list), it would be possible to save up to a factor $\binom{\frac{n}{n_l}}{\ceil{\sigma}}$ compared to the worst-case list size bound~\eqref{eq:listSize}. For the worst-case list size, this is only relevant if this side information is not probabilistic (e.g., if the information is given from an external source with additional information about the received word). We are not aware of a method to extract this information intrinsically in a non-probabilistic fashion without first obtaining the entire output list. \textbf{2) Average-case list size:} We will see in Sections~\ref{subsec:probdec} and \ref{subsec:ProbTB} that for certain families of LRCs, we can show that for random errors of weight at most $\tau_g$, the probability of obtaining a global list size greater than $1$ is small. Hence, the expected list size is usually significantly smaller than the upper bound \eqref{eq:listSize}. Slightly more general, we can also extract the above mentioned additional side information (on which local decoders were successful) as soft information from the local lists. In this case, we end up with a scenario where the side information is correct with a certain probability and the resulting output list size is significantly smaller. The analysis goes, however, beyond the scope of this paper. The probabilistic behavior of the list size for random received words is not known for all code classes, making a general statement technical and hard to achieve. For cases in which it is known (e.g., MDS codes), it might be possible to generalize the results in Sections~\ref{subsec:probdec} and \ref{subsec:ProbTB}. Note also that for many code parameters, the probability to obtain a list size $>1$ is quite small, so it is not clear if we could obtain a significantly better list size bound with the more general probabilistic analysis. \end{remark} \begin{remark}\label{rem:radiusWithFloor} Note that the radius derived in Theorem~\ref{thm:ListDecodingLRCs} is obtained by using the bound on the number of locally correctable repair sets derived in Lemma~\ref{lem:sigma}. While this allows for deriving a closed form expression for the maximum radius, the actual number of correctable errors is larger when considering the floor operation, i.e., shortening to obtain a code of length $n_J=n-\left(\frac{n}{n_l}-\left\lfloor \frac{t_g}{t_l+1} \right\rfloor \right)n_l$. Then, the number of correctable errors $\bar{t}_g$ is given by the largest integer $\bar{t}_g$ such that \begin{align} 0< \bar{t}_g^2 + \theta_q \left\lfloor \frac{\bar{t}_g}{t_l+1} \right\rfloor n_l(d-2\bar{t}_g) \ . \label{eq:radiusWithFloor} \end{align} \end{remark} \begin{example}\label{eg:code63} Consider an~$[63,16,8,14]$ optimal LRC achieving~\eqref{eq:boundDistanceLRC} with equality, i.e.,~$d=35$. It follows that BMD decoding corrects up to~$t_{\mathrm{BMD}} = 17$ errors uniquely and with~\eqref{eq:johnsonradius} we get a list-decoding radius of~$\tau_J < 21$, i.e.,~$t_J = 20$. By Theorem~\ref{thm:ListDecodingLRCs}, we obtain~$\tau_g < 22.18$, i.e.,~$t_g = 22$. Hence, two additional errors can be corrected. When considering the floor as discussed in Remark~\ref{rem:radiusWithFloor}, the number of correctable errors is $\bar{t}_g = 24$. \end{example} \begin{example} Consider an optimal $[15,6,3,3]$ LRC of distance $d=8$. Equation~\eqref{eq:jblrc} gives $\tau_g \approx 4.9$ and it follows that $4$ errors can be corrected, the same number as given by the Johnson radius for any code of length $n=15$ and distance $d=8$. However, when considering the floor operations as in Remark~\ref{rem:radiusWithFloor}, which are bounded in the proof of Lemma~\ref{lem:sigma}, the error correction capability is given by the largest integer $\bar{t}_g$ that fulfills (\ref{eq:radiusWithFloor}), which is $\bar{t}_g= 5$. For more examples, see Table~\ref{tab:exampleParameters}. \end{example} Whether the obtained radius is larger than the Johnson radius of the code can be determined by a simple criterion. \begin{corollary} \label{cor:gain} The decoding radius~$\tau_g$ of~\eqref{eq:jblrc} is larger than the global Johnson radius~$\tau$ if and only if the sum of the local distances is larger than the code distance, i.e. \begin{equation} \label{eq:gaincond} \tau_g > \tau \;\; \Longleftrightarrow \;\; \frac{n}{n_l} \cdot \varrho > d . \end{equation} \end{corollary} \begin{IEEEproof} It follows from Lemma~\ref{lem:increasingInN} that~$\tau_g > \tau$ if~$\sigma >0$. Substituting~\eqref{eq:jblrc} for~$\sigma > 0$ into~\eqref{eq:sigmaineq} gives \begin{align*} \frac{n}{n_l} - \frac{\tau_g}{\tau_{J,l}} = \frac{n}{n_l} - \frac{d}{\varrho} &> 0 . \end{align*} \end{IEEEproof} \begin{remark}\label{rem:list_decoding_connection_to_low_weight_codewords} Equation~\eqref{eq:gaincond} provides some intuition why the decoding radius can be increased. For linear codes, the list-decoding problem is closely related to low-weight codewords, as every incorrect codeword in the Hamming sphere of radius~$\tau$ centered around the received word~$\ve{w}$ can be written as~$\ve{c}+\ve{c}'$, where~$\ve{c}$ is the correct codeword and~$\ve{c}'$ is a codeword with~$\wt(\ve{c}') < 2 \tau$. Further, it has to hold that~$\wt(\ve{c'}) \geq d$ and~$\wt(\ve{c}'_{\mathcal{R}_i}) \geq \varrho \;, \; i \in \left[\frac{n}{n_l}\right]$. It follows that if~\eqref{eq:gaincond} holds, low-weight codewords must have entire repair sets that are all zero. When taking all codewords from~$\mathcal{C}$ that have the same all-zero repair sets, we obtain shorter codes of same distance and the number of such shortened codes depends on the number of repair sets. As every low-weight codeword has to be in one of these, the total number of low-weight codewords in~$\mathcal{C}$ depends only on the number of repair sets and the number of low-weight codewords in codes of shorter length and distance~$d$. \end{remark} To derive the radius in Theorem~\ref{thm:ListDecodingLRCs} we set the local decoding radius to be the Johnson radius of the local codes. While this choice is valid for any code, it is also possible to increase the radius for different $\tau_l$. \begin{lemma}\label{lem:localUniqueDecoding} The decoding radius of Theorem~\ref{thm:ListDecodingLRCs} is larger than the $q$-ary Johnson radius if \begin{equation*} \frac{\tau_l}{n_l} > \theta_q\left(1-\sqrt{1-\frac{d}{n\theta_q }}\right) \ , \end{equation*} i.e., if the normalized local decoding radius is larger than the normalized $q$-ary Johnson radius. \end{lemma} \begin{IEEEproof} By (\ref{eq:tau2}) there is a gain if \begin{align*} \frac{d\tau_l}{2\tau_l-\frac{\tau_l^2}{\theta_qn_l}} > \theta_q\left(n-\sqrt{n\left(n-\frac{d}{\theta_q}\right)}\right) \ . \end{align*} Rewriting as a condition on the normalized local decoding radius gives \begin{align*} \frac{\tau_l}{n_l} &> 2\theta_q-\frac{d}{n}\frac{1}{1-\sqrt{1-\frac{d}{n\theta_q}}}\\ &= \frac{2\theta_q\left(1-\sqrt{1-\frac{d}{n\theta_q}} \right)-\frac{d}{n}}{1-\sqrt{1-\frac{d}{n\theta_q}}}\\ &= \frac{\theta_q\left(1-\sqrt{1-\frac{d}{n\theta_q}} \right)^2}{1-\sqrt{1-\frac{d}{n\theta_q}}}\\ &= \theta_q\left(1-\sqrt{1-\frac{d}{n\theta_q}} \right) \ . \end{align*} \end{IEEEproof} \begin{remark} A different approach to the list-decoding problem would be to view each codeword from the local codes as a symbol over $\F{q^{n_l}}$, as, e.g., in \cite{goparaju2014binary}. Let $\mathcal{C}$ be an optimal $[n,k,r,\varrho]$ LRC. Viewing each local repair set as a symbol over $\F{q^{n_l}}$ gives an $\F{q}$-linear subcode of a code of length $\frac{n}{n_l}$ code over $\F{q^{n_l}}$. Denote this code by $\hat{\mathcal{C}}$ and note that error correction in this code allows to correct some \emph{number of incorrect local repair sets}. However, as the number of errors is the number of incorrect symbols over $\F{q}$ (and not $\F{q^{n_l}}$), a single error in a local repair set would cause the resulting symbol over $\F{q^{n_l}}$ to be incorrect. By Lemma~\ref{lem:sigma} we know that $\ceil{\sigma}$ local repair sets can be corrected locally, i.e., the list of at least $\ceil{\sigma}$ local repair sets contains the correct local codeword. In the context of viewing the local repair sets as symbols over $\F{q^{n_l}}$ this means that we can find a combination of $\ceil{\sigma}$ elements of the local lists that give correct \emph{positions} of the codeword of $\hat{\mathcal{C}}$. Further, it follows directly from the proof of Lemma~\ref{lem:sigma} that there exists a distribution of $\tau_g$ errors such that the remaining $\frac{n}{n_l}-\ceil{\sigma}$ local repair sets contain a number of errors that cannot be corrected locally. In this case, assuming we found the correct combination of local list entries, we can partition the symbols of the code $\hat{\mathcal{C}}$ into two disjoint (known) sets, one containing the $\ceil{\sigma}$ correct positions and the other containing the $\frac{n}{n_l}- \ceil{\sigma}$ incorrect positions. As it is \emph{always} beneficial in terms of error correction capability to shorten a code in positions that are known to be correct\footnote{We can assume that the shortened position is non-trivial (i.e., the position is not the same in all codewords), as otherwise it clearly provides no benefit for decoding. Trivially, the maximum amount of information a symbol can contain is one dimension. As shortening one non-trivial position reduces the dimension of the code by one, it is not possible to use this symbol in a way that provides more information about the received word.} the best strategy is to shorten the code in all $\ceil{\sigma}$ correct positions. This leaves only incorrect position, so the only possibility of correct decoding is that the shortened positions already contain an information set, in which case no further decoding is required after shortening. As the shortening strategy described above is the same as in the approach of Theorem~\ref{thm:ListDecodingLRCs}, this corresponds to a trivial case in Theorem~\ref{thm:ListDecodingLRCs} in which no global decoding (over $\F{q}$) is necessary. This implies that the application of the same approach while viewing the local repair sets as symbols over $\F{q^{n_l}}$ does not offer any advantage. \end{remark} \subsection{List-Decoding Algorithm} \label{subsec:listdecodingalgo} To achieve the decoding radius of Theorem~\ref{thm:ListDecodingLRCs}, several steps have to be taken sequentially, as shown in \algoref{algo:fanta}. While Lemma~\ref{lem:sigma} guarantees that at least~$\ceil{\sigma}$ repair sets can be decoded, it does not guarantee that all repair sets for which the local decoder is able to return a local codeword are decoded correctly. For this reason, all combinations of seemingly correct local repair sets have to be tried in order to guarantee finding the correct one. Note that if this list of correctable local codes was known, the complexity could be decreased significantly, but with the chosen approach of only decoding locally in the first step, this is in general not possible. \begin{algorithm} \KwData{ $[n,k,r,\varrho]_q$ LRC $\mathcal{C}$; Received word~$\ve{w}=\c+\ve{e}$ with~$\c\in \mathcal{C}$} \KwResult{List of codewords within radius~$\tau_g$ of~$\ve{w}$} \ForEach{Local code}{ Decode up to~$\tau_l$~$\Rightarrow$~$\xi \geq \ceil{\sigma}$ repair sets with~$L_l \geq 1$} \ForEach{of the~$\binom{\xi}{\ceil{\sigma}}$ combinations of local repair sets with~$L_l \geq 1$ \label{step5}}{ \ForEach{combination of codewords in the current~$\ceil{\sigma}$ local lists \label{step6}}{ Shorten~$w$ and decode as~$(n-\ceil{\sigma} n_l,d)$ code up to radius~$\tau_g$} } Return all codewords~$\c'$ with~$\dt{\ve{w}}{\c'} \leq t_g$ \caption{List Decoder} \label{algo:fanta} \end{algorithm} Note that \algoref{algo:fanta} can be improved in terms of complexity, e.g., by considering the number of errors corrected in the local codes and decreasing the decoding radius of the shortened code accordingly (see Remark~\ref{rem:list_size_bound_not_tight}). Similarly, if the decoder has some additional knowledge which helps to correctly determine one or more local codewords, fewer combinations of repair sets have to be analyzed, thereby reducing the complexity. However, as this is not the focus of this work, such performance optimizations are not considered here. Its complexity is polynomial in $n$ when the number of repair sets~$\frac{n}{n_l}$ is constant, as~$\xi= O(n^{\frac{n}{n_l}})$ grows exponentially otherwise. The bound on the list size given in (\ref{eq:listSize}) is obtained by assuming the worst case, i.e., the maximal list size, in each step of \algoref{algo:fanta}. As mentioned in Section~\ref{subsec:newdecodingradius}, this bound on the list size is not tight and we expect that the maximum list size, and thereby also the worst-case and average-case complexity of \algoref{algo:fanta}, is considerably overestimated. \subsection{Probabilistic Unique Decoder} \label{subsec:probdec} Even for a moderate number of local repair sets, the worst case complexity of \algoref{algo:fanta} can be rather high. In \stepref{step5} all combinations of corrected local repair sets have to be tried because an undetected error event might occur, i.e., a local code might return a list with~$L_l >0$ that does not contain the correct codeword. Further, in \stepref{step6}, all combinations of the codewords in the local lists have to be tried to guarantee finding one that consists only of correct local codewords. It follows that whether these steps are required depends on the probability of the local list size being larger than one and on the probability of a local list with~$L_l>0$ not containing the correct local codeword. We define a \emph{probabilistic unique decoder}, where instead of shortening the code in every combination of elements of the lists of the local repair sets, we only decode a single shortened code. Explicitly, the decoder performs local list decoding, chooses $\frac{n}{n_l}-\left\lfloor \frac{t_g}{t_l+1} \right\rfloor$ of the repair sets with the smallest, non-zero list size, shortens the code in these repair sets, and decodes this shortened code. If the codewords from the lists of the local repair sets chosen for shortening are correct and the list decoder of the shortened code returns a unique codeword, the decoding is successful. Note, that for this probabilistic decoder the constraint of~$\frac{n}{n_l} = \mathrm{const.}$ can be omitted, as its complexity grows only linear with the number of local repair sets. \begin{theorem}[Probabilistic Decoding]\label{thm:probabilisticSuccessProb} An~$[n,k,r,\varrho]$ LRC can be uniquely decoded up to radius~$\tau_g$ of~\eqref{eq:jblrc} with probability \begin{equation} \Pr\{L_g=1\} \geq (1-P_E)^{\left\lfloor \frac{t_g}{t_l+1}\right\rfloor } \cdot \Pr\{L_{(n_l,\varrho,t_l)} = 1 \}^{\frac{n}{n_l} - \left\lfloor \frac{t_g}{t_l+1}\right\rfloor} \cdot \Pr\left\{L_{\left( \left\lfloor \frac{t_g}{t_l+1} \right\rfloor n_l,d,t_g\right)} = 1\right\}, \label{eq:sucprob} \end{equation} where $P_E$ denotes the maximum probability that an incorrect codeword is within distance~$t_l$ for any number of errors in the repair set. \end{theorem} \begin{IEEEproof} From Lemma~\ref{lem:sigma} it is known that there are at least $\frac{n}{n_l}- \left\lfloor \frac{t_g}{t_l+1}\right\rfloor$ local repair sets that can be corrected locally, i.e., where the list returned by a list decoder with radius $\tau_l$ contains the correct local codeword. The first term bounds the probability that the list of all other repair sets is either empty or also contains the correct local codeword. The second term gives the probability that the list size of the local repair sets that are guaranteed to contain the correct word, only contain this correct word. Finally, the third term gives the probability that the list returned by the list decoder of the shortened code also contains only the correct word. \end{IEEEproof} This is a pessimistic bound as it does not take the distribution of errors into account, i.e., at every step of the decoder it is assumed that the worst case number of errors occur. However, even this simple bound can give good results, as will be shown in Section~\ref{subsec:ProbTB} for a specific class of LRCs. \subsection{Asymptotic Behavior} \label{subsec:asymptotic} When considering codes without locality, the asymptotic behavior is usually characterized by regarding the normalized decoding radius over the normalized distance. For codes with locality the distance depends not only on the length and dimension, but also the locality~$r$ and local distance~$\varrho$, which yields different views on the asymptotic behavior.\\ Consider an optimal~$[n,k,r,\varrho]$ LRC with~$r\mid k$ and~${(r+\varrho-1)\mid n}$. By~\eqref{eq:boundDistanceLRC} the code rate is given by \begin{equation} R = \left(1-\frac{d}{n} + \frac{\varrho}{n} \right) \frac{r}{r+\varrho-1} = \left(1-\frac{d}{n} + \frac{\varrho}{n_l} \frac{n_l}{n} \right) R_l \ , \label{eq:rate} \end{equation} where~$R_l$ denotes the rate of the local codes. It follows that the rate~$R$ only depends on the normalized distance~$\frac{d}{n}$, the local normalized distance~$\frac{\varrho}{n_l}$, the number of repair sets~$\frac{n}{n_l}$ and the local rate~$R_l$. In the following we consider the asymptotic regime where the locality~$r$ and the local distance~$\varrho$ scale with the code length $n$ such that the number of repair sets~$\frac{n}{n_l}$ is constant, as well as the ratio~$\frac{d}{\varrho}$ between local and global distance. Figure~\ref{fig:cw_asympt} gives a graphical illustration of this scaling, where~$(a)$ depicts a short codeword and~$(b)$ and~$(c)$ depict codewords of longer codes. Note that, as indicated by the marked redundancy, the short code has the same normalized distance as the other two. The difference between~$(b)$ and~$(c)$ is due to the scaling of the parameters, where for~$(b)$ the local distance and the repair set size are the same as in $(a)$, while for~$(c)$ both scale with~$n$. We are interested in the latter, which can be interpreted in several ways, e.g., assume each repair set corresponds to a data center and the codeword symbols are distributed over several servers. Adapting the code to an increasing number of servers in each data center corresponds to increasing the size of each repair set while keeping the normalized distance (local storage overhead) constant. Thus, we characterize LRCs asymptotically by a fixed relation~$\beta = \frac{n \varrho}{n_l d}$ between the normalized local and global distance. \begin{figure} \centering \resizebox{0.6\columnwidth}{!}{\input{cw_asympt.tex}} \caption{Illustration of asymptotic scaling of parameters} \label{fig:cw_asympt} \end{figure} To compare our list-decoding radius~\eqref{eq:jblrc} with the Johnson radius~\eqref{eq:johnsonradius}, we write \begin{equation} \frac{\varrho}{n_l} = \beta \cdot \frac{d}{n} \ . \label{eq:rhonl3} \end{equation} Then for the case of $\ceil{\sigma}>0$ the normalized decoding radius of Theorem~\ref{thm:ListDecodingLRCs} is given by \begin{align} \frac{\tau_g}{n} &= \frac{d\tau_l}{n \varrho} = \frac{d}{n} \frac{\theta_qn_l}{\varrho}\left(1-\sqrt{1-\frac{\varrho}{n_l\theta_q}}\right)\nonumber\\ &= \beta^{-1}\theta_q\left(1-\sqrt{1-\beta\frac{d}{n\theta_q}}\right), \quad \text{with} \; \beta \cdot \frac{d}{n\theta_q} \leq 1. \label{eq:asympnorm} \end{align} Thus, the normalized decoding radius of the global code, given by~\eqref{eq:asympnorm}, depends only on $\beta$, the normalized distance of the code, and the code alphabet. When the normalized distances of the global and the local codes are equal, i.e.,~$\beta = 1$, the radius equals the $q$-ary Johnson radius~\eqref{eq:johnsonradius}. For any~$\beta>1$ our decoding radius provides a gain up to the point where~$\beta \frac{d}{n\theta_q}= 1$ and the curves meets the Singleton bound. Figure \ref{fig:asympplot} shows the normalized decoding radii for different values of~$\beta$ in the most general case of $q \rightarrow \infty$, i.e., $\theta = 1$, which is valid for any code, independent of the alphabet. \begin{figure}[h] \centering \input{plottauas3lld.tex} \caption{Normalized list-decoding radius~$\tau_g$ of Theorem~\ref{thm:ListDecodingLRCs}, for $\theta_q=1$, local decoding up to the $q$-ary Johnson radius, and~$\beta = \frac{n \varrho}{d n_l}$, compared to the normalized global Johnson radius for $\theta_q=1$.} \label{fig:asympplot} \end{figure} In Figure~\ref{fig:asympplot_constant_list_size}, we show a similar plot, but with separate curves for given maximal list sizes $L$ bounded by the formula in \eqref{eq:listSize} using the list size bound \eqref{eq:maximal_list_size} for the local and global list decoders. For given \begin{itemize} \item number of local repair sets $\mu$ (here: $\mu=3$), \item ratio $\beta = \frac{n \varrho}{n_l d}$ (here: $\beta \in \{1,1.5,2,3\}$), and \item maximal list size $L$ (here: $L \in \{300,1000,3000,10000,100000\}$), \end{itemize} we plot the maximal relative decoding radius (achieved with maximal list size $L$ for all codes with the given parameters $\mu$, $\tfrac{d}{n}$, and $\beta$) over the relative minimum distance $\tfrac{d}{n}$. \begin{figure}[h] \centering \input{radius_constant_list_size.tex} \caption{Normalized list-decoding radius~$\tau_g$ of Theorem~\ref{thm:ListDecodingLRCs} for a maximal list size $L$ according to \eqref{eq:listSize}, $\theta_q=1$, $\beta = \frac{n \varrho}{d n_l}$ and number of repair sets $\mu=3$.} \label{fig:asympplot_constant_list_size} \end{figure} We also show the limit of this curve for $L \to \infty$.\footnote{The asymptotic curves ($L \to \infty$) shown in Figure~\ref{fig:asympplot_constant_list_size} do not constitute the radii achieved by taking the relative decoding radius of any decoder with infinite list size---such a decoder could output the entire code and would have always relative radius $1$. Instead, we see the maximal relative decoding radius for the family of codes with fixed parameters $\mu$, $\beta$, and $\tfrac{d}{n}$ as a function of $L$ and compute the limit for $L \to \infty$. Note also that this family contains codes of arbitrary code length, and hence, for any given finite $L$, there is a code in the family whose cardinality is larger than $L$.} The curves for $\beta=1$ equal the ordinary Johnson radii for the given maximal list sizes and the asymptotic limit (note that the difference between relative radii for finite $L$ and the asymptotic curve is so small that the curves almost coincide in this plot). Thus, a direct comparison of the Johnson radius and the decoding radius of the new decoder for the same fixed maximal list size is possible. It can be seen that for $\mu=3$, we obtain improvements beyond the Johnson radius ($\beta=1$) for list sizes $L \geq 1000$, or $L \geq 300$ for $\beta=3$. To get close to the asymptotic radius ($L \to \infty$), we need to allow huge list sizes according to \eqref{eq:listSize}. Furthermore, this list size gets even larger for growing $\mu$ (this is not shown in the plot). Recall, however, that \eqref{eq:listSize} is a very rough worst-case bound on the list size and we expect the actual maximal value to be much smaller. We will see in Section~\ref{subsec:ProbTB} that for LRCs whose local and global codes are subcodes of MDS codes, we often have $\Pr(L=1) \approx 1$ for random errors, even close to the maximum decoding radius. \section{Decoding Locally Repairable Subcodes of Reed--Solomon Codes} \label{sec:ILRC} In the previous section we proved a new list-decoding radius that is valid for any LRC with $(r+\varrho-1)\mid n$. Further, the proof of Theorem~\ref{thm:ListDecodingLRCs} directly implies a decoder based on list decoding of the local codes, shortening of the code, and list decoding of the shortened code. In general, decoding a code up to the Johnson radius is a difficult problem, but for specific code classes, such as GRS codes, such a decoder exists~\cite{Guruswami1999}. Based on this, we will give an explicit decoding algorithm for LRCs that are subcodes of GRS codes and where the local repair sets are (subcodes of) GRS codes (we will refer to these codes as \emph{GRS-subcode LRCs}), such as the popular class of Tamo--Barg LRCs~\cite{Tamo2014}. \subsection{An Explicit Decoder for GRS-Subcode LRCs} \label{sec:tamobarg} \algoref{algo:fanta} provides a decoding procedure up to the radius of \eqref{eq:jblrc}. To be feasible, it requires an efficient list-decoding algorithm of the global and local code, as well as an efficient way to shorten the code by known positions. While shortening is a commonly used method to decrease the length of a code, it is usually done at the encoder, where it suffices to set information symbols to zero. To shorten a code by some known positions at the decoder, all codewords that differ in the known positions need to be removed from the codebook. While this gives a code of desired distance and dimension, the structure of the code is lost and it is unclear how to decode in this newly obtained code. In this section, we address this problem for GRS codes and show how to efficiently apply \algoref{algo:fanta} to list decoding GRS subcode LRCs, such as the Singleton-optimal Tamo--Barg codes~\cite{Tamo2014}. \algoref{algo:fanta} consists of three major steps: decoding locally, shortening the code, and decoding the shortened code. As, by definition, the local codes of a GRS subcode LRC are GRS codes, we can list-decode the $[n_l,r,\varrho]$ local codes up to the Johnson radius~\eqref{eq:johnsonradius}. For shortening, denote the number of positions in a word $\ve{w}=\c+\ve{e}$ with $\c\in \mathcal{C}$ that are known to be free of error by $\delta$. The $[n,k,d]$ code $\mathcal{C}$ can be shortened by removing all codewords from the codebook that differ from $\ve{w}$ in these positions. The obtained code is an $[n-\delta,k-\delta,d]$ code, which is non-linear in general. Further, the structure of the shortened code is generally unknown, making efficient decoding difficult. To obtain a \emph{linear and structured} shortened code, we give a bijective map from the $[n-\delta,k-\delta,d]$ code to an $[n-\delta,k-\delta,d]$ GRS code. \begin{definition}[Generalized Reed-Solomon Code]\label{def:GRS} Given a set of \emph{code locators} $\alpha_0, \ldots, \alpha_{n-1} \in \F{}$ with $\alpha_i \neq \alpha_j\ \forall \ i\neq j$ and a set of column multipliers $\nu_0,\ldots, \nu_{n-1} \in \F{} \setminus \{0\}$, the $[n,k]$ generalized Reed-Solomon code is defined as \begin{align*} \mathcal{C} \coloneqq \{ (\nu_0f(\alpha_0),\nu_1f(\alpha_1),\ldots,\nu_{n-1}f(\alpha_{n-1})) \ | \ f(x) \in \F{}[x], \deg(f(x)) < k \} \ . \end{align*} \end{definition} For ease of notation we define the following polynomial. \begin{definition}\label{def:polred} For a polynomial $f(x)$ define \begin{align*} f^{\beta}(x) &\coloneqq \frac{f(x)-f(\beta)}{x-\beta} \ . \end{align*} For an ordered subset $\mathcal{S} \subset \mathcal{A}$ define $f^{\mathcal{S}}(x)$ as the repeated application of the previous definition. \end{definition} \begin{lemma} \label{lem:RSred} Let $\mathcal{C}$ be an $[n,k,d]$ GRS code with code locators $\mathcal{A} = \{\alpha_0,\cdots, \alpha_{n-1}\}$. Then for any set $\mathcal{S} \subset \mathcal{A}$ with $|\mathcal{S}| \leq k$ the code \begin{align*} \mathcal{C}^{\mathcal{S}} \coloneqq \{ (\nu_0f^{\mathcal{S}}(\alpha_0),\nu_1f^{\mathcal{S}}(\alpha_1),\ldots,\nu_{n-1}f^{\mathcal{S}}(\alpha_{n-1})) \ | \ f(x) \in \F{}[x], \deg(f(x)) < k \} \ . \end{align*} is an $[n-|\mathcal{S}|,k-|\mathcal{S}|, d]$ GRS code. \end{lemma} \begin{IEEEproof} By Definition~\ref{def:GRS}, we need to show that for any $f(x)$ with $\deg(f(x)) < k$ it holds that ${\deg(f^{\mathcal{S}}(x)) \leq k-|\mathcal{S}|}$. The polynomial $f'(x) = f(x) - f(\alpha_0)$ has a root at $\alpha_0$ and hence the polynomial $f^{\alpha_0}(x)$ with $f'(x) = f^{\alpha_0}(x) (x-\alpha_0)$ exists. It follows that $ \deg(f^{\alpha_0}(x)) = \deg(f'(x))-1 = \deg(f(x)) -1 < k-1$. The generalization to $f^{\mathcal{S}}(x)$ follows by induction. \end{IEEEproof} Since most positions in a codeword are free of error, we define a relation between the error vector of the shortened code and the original code. Then, instead of recovering the original codeword from the decoded shortened codeword, we can obtain the complete error vector directly from the error vector of the shortened code. For ease of notation we fix $\nu_0 = \ldots = \nu_{n-1} = 1$, i.e., we consider RS codes, in the following. Note that a codeword of an $[n,k,d]$ RS code with errors $e_0,...,e_{n-1}$ can be described as the evaluation of the polynomial \begin{align*} g(x) = f(x) + \hat{e}(x) \end{align*} with \begin{align}\label{eq:errorLagrange} \hat{e}(x) = \sum_{i\in [n]} e_i \prod_{\substack{j\in [n] \\ j\neq i}} \frac{x-\alpha_j}{\alpha_i-\alpha_j} = \sum_{i\in [n]} e_i \lambda_i(x) \ . \end{align} The polynomials $\lambda_i(x)$ are Lagrange basis polynomials and therefore $\hat{e}(\alpha_i) = e_i \ \forall \ i\in [n]$. \begin{lemma} For a vector $\ve{e}\in\ensuremath{\mathbb{F}_q}^n$ denote $\mathcal{E} = \{i \ | \ e_i \neq 0, i \in [n] \}$. Given a set $\mathcal{A}=\{\alpha_0,...,\alpha_{n-1}\}$, a subset $\mathcal{S} \subset \mathcal{A} \setminus \{\alpha_i \ | \ i \in \mathcal{E}\}$ with $|\mathcal{S}| \leq k$, and a polynomial $f(x)$, let $g(x) \coloneqq f(x)+\hat{e}(x)$ with $\hat{e}(x)$ as in (\ref{eq:errorLagrange}) and $g^{\mathcal{S}}(x)$ as in Definition~\ref{def:polred}. Then \begin{align*} g^{\mathcal{S}}_i(x) &= f^{\mathcal{S}}(x) + \hat{e}^{\mathcal{S}}(x) \end{align*} with \begin{align*} \hat{e}^{\mathcal{S}}(x) = \frac{\hat{e}(x)}{\prod_{\beta \in \mathcal{S}} (x-\beta)} \ . \end{align*} \end{lemma} \begin{IEEEproof} For $\delta>0$ and any $i \in \mathcal{S}$, applying Definition~\ref{def:polred} gives \begin{align*} g^{\alpha_i}(x) &= \frac{(f(x)+\hat{e}(x)) - (f(\alpha_{i})+\hat{e}(\alpha_i))}{x-\alpha_{i}} \\ &= \frac{f(x) - f(\alpha_{i})}{x-\alpha_{i}} + \frac{\hat{e}(x) - \hat{e}(\alpha_i)}{x-\alpha_{i}} \\ &= f^{\alpha_i}(x) + \hat{e}^{\alpha_i}(x) \ . \end{align*} The lemma statement follows from $\hat{e}(\alpha_i)=e_i = 0$ for $i\notin \mathcal{E}$ and $\mathcal{S} \cap \{\alpha_i \ | \ i \in \mathcal{E}\} = \emptyset$. \end{IEEEproof} With Lemma~\ref{lem:RSred} and the Guruswami-Sudan decoder~\cite{Guruswami1999}, all necessary tools for decoding up to the alphabet-independent radius $\tau_g$ of Theorem~\ref{thm:ListDecodingLRCs} are given. \begin{figure} \centering \input{plo93.tex} \caption{Relative gain in the decoding radius in relation to the alphabet-independent Johnson radius for optimal LRCs of length $n=1023$ and repair set size $n_l=11$, where $\tau_J$ denotes the Johnson radius \eqref{eq:johnsonradius} for the respective parameters, the lines are obtained from $\tau_g$ in Theorem~\ref{thm:ListDecodingLRCs} and for the crosses the number of correctable errors is given by the largest integer $\bar{t}_g$ that fulfills (\ref{eq:radiusWithFloor}).} \label{fig:relativegain} \end{figure} \figref{fig:relativegain} shows the relative gain for optimal LRCs of length $n=1023$ and repair set size $n_l=11$ for different values of $\varrho$. For each $\varrho$, a lower bound on the relative gain is given, i.e., the fraction by which our bound in Theorem~\ref{thm:ListDecodingLRCs} exceeds the Johnson radius of \eqref{eq:johnsonradius}. Each cross depicts the gain obtained for an LRC with $r\mid k$ and $(r+\varrho-1)\mid n$, when considering the exact values for all ceiling and floor operations as discussed in Remark~\ref{rem:radiusWithFloor}. \subsection{Probabilistic Unique Decoding of GRS-Subcode LRCs} \label{subsec:ProbTB} In Section~\ref{subsec:probdec} we introduced a simple probabilistic unique decoder whose success probability depends on the likelihood of a miscorrection, as well as the probability of the list sizes being equal to one. For MDS codes, and thereby for RS codes, these probabilities are known to be small for a wide range of parameters \cite{McEliece1986,Cheung1988,McEliece2003}, which we will use to give numerical results and show the asymptotic behaviour of the probability of successful probabilistic unique decoding in GRS-Subcode LRCs. Here, we only consider GRS codes, but note that the same results apply also to MDS codes in general, if the MDS conjecture of $q \rightarrow \infty$ for $n\rightarrow \infty$ is correct. Denote by $u$ the number of errors that actually occurred. Then, it was shown in \cite{McEliece1986,McEliece2003} that when list decoding\footnote{In \cite{McEliece1986} only unique decoding is considered, i.e., the case of $2t \leq d-1$. However, as noted in \cite{McEliece2003}, the bound also holds for $2t>d-1$.} up to $t$ errors in an $[n,k]$ RS code, the probability $P_E$ of a codeword other than the correct codeword being in the list, i.e., within distance $t$ of the received word, is bounded by \begin{align}\label{eq:PERS} P_E(u) \leq \tilde{P}_E(n,d,q,t) = \frac{1}{(q-1)^{d-1}}\sum_{s=0}^t (q-1)^s \binom{n}{s} \ . \end{align} There are upper bounds that slightly improve upon this bound, in particular for $u\leq d-1$ \cite{McEliece1986,McEliece2003,Cheung1988}, but as these improvements are not substantial and complicate the following expressions we employ the bound (\ref{eq:PERS}), which is \emph{independent of the actual number of errors} $u$. Note that this bound also holds for any subcode of an $[n,k]$ RS code of distance $d$. As the correct codeword is guaranteed to be in the list for a list decoder of radius $\tau$ if $\wt(e)\leq \left\lceil \tau -1 \right\rceil = t$, it follows that \begin{align*} \Pr \{ L_{(n,d,t)}=1 | \wt(e) \leq t\} \geq 1-\tilde{P}_E(n,d,q,t) \ . \end{align*} Lemma~\ref{lem:sigma} guarantees that at least $\frac{n}{n_l}-\floor{\frac{\bar{t}_g}{t_l+1}}$ local repair sets contain at most $t_l$ errors, so the probability that all lists returned by the local decoders are either empty or contain only the correct local codeword is given by $\left(1-\tilde{P}_E(n_l,\varrho,q,t_l) \right)^{\frac{n}{n_l}}$ . If this is the case, the shortening of the code is guaranteed to be correct, i.e., the obtained word is of the form $\ve{c}'+\ve{e}$, where $\wt(\ve{e}) \leq \bar{t}_g$ and $\ve{c}'$ is a codeword of a code of length $n' = n- \left(\frac{n}{n_l} - \floor{\frac{\bar{t}_g}{t_l+1}} \right) n_l = \floor{\frac{\bar{t}_g}{t_l+1}} n_l$ and distance $d$. The shortening of any LRC that is a subcode of an GRS code such as, e.g., Tamo--Barg LRCs \cite{Tamo2014}, results in a subcode of an RS code. Hence, the probability of obtaining an unique decoding result for the shortened code can be bounded by (\ref{eq:PERS}). Overall, the probability $P_E$ of decoding success for unique decoding $\bar{t}_g$ errors, as defined in Remark~\ref{rem:radiusWithFloor}, in an $[n,k,r,\varrho]$ GRS-subcode LRC with the decoder described in Section~\ref{subsec:probdec} is upper bounded by \begin{align}\label{eq:sucprobTB} \Pr\{L_g=1\} \geq \left(1-\tilde{P}_E(n_l,\varrho,q,t_l) \right)^{\frac{n}{n_l}} \left(1-\tilde{P}_E\left(\left\lfloor \frac{\bar{t}_g}{t_l+1} \right\rfloor n_l,d,q,\bar{t}_g\right)\right) \ . \end{align} \tabref{tab:sucprob} provides a lower bound on the success probabilities obtained by \eqref{eq:sucprobTB} for different LRC parameters. The columns labeled $\tau_J$, $\tau_{J,l}$, and $\tau_{g}$ give the $q$-ary Johnson radius, the $q$-ary local Johnson radius, and the radius of Theorem~\ref{thm:ListDecodingLRCs}, respectively. The values show that the computationally expensive case, where multiple repair sets have undetected error events and the local lists contain incorrect codewords, is highly unlikely and it is possible to efficiently decode beyond the global Johnson radius with a low probability of failure. As noted in Section~\ref{subsec:listdecodingalgo}, the given upper bound on the list size can be very large. For example, using the introduced decoder to decode the maximum number of errors $t_g = 171$ in a $[500,99,33,68]_{2^9}$ LRC (cf. Table~\ref{tab:sucprob}), the upper bound of (\ref{eq:listSize}) on the obtained list size is given by $L_g \lessapprox 2.2 \times 10^6$, compared to the an upper bound of $\approx 476$ for decoding up to the Johnson radius ($t_j = 159$). However, the results of Table~\ref{tab:sucprob} show that despite the high bound on the \emph{maximum} list size, the probability that the output of the list decoder is unique is very close to $1$. \begin{table} \caption{Success probabilities \eqref{eq:sucprob} of probabilistic unique decoding of~$t_g$ errors for different parameters of GRS-subcode LRCs, where $\tau_g$ is given by the \eqref{eq:jblrc} and $\bar{t}_g$ is the largest integer that fulfills (\ref{eq:radiusWithFloor}), both for $\theta_q=1$. The local and global alphabet-independent Johnson radii are denoted by $\tau_{J,l}$ and $\tau_J$, respectively.}\label{tab:sucprob} \begin{center} \begin{tabular}{CCCCCCC|CCCC|C} n&k&r&\varrho&q&n_l&d&\substack{\mathrm{Eq.~}(\ref{eq:johnsonradius}) \\\tau_{J,l}} & \substack{\mathrm{Eq.~}(\ref{eq:johnsonradius}) \\\tau_J} & \substack{\mathrm{Thm.}~\ref{thm:ListDecodingLRCs} \\ \tau_g} & \substack{\mathrm{Eq.}~(\ref{eq:radiusWithFloor}) \\ \bar{t}_g} & \substack{\mathrm{Eq.}~(\ref{eq:sucprobTB})\\ \Pr\{L_g=1\}\geq} \\ \hline 1023& 99& 3& 9& 1024& 11& 669& 6.31& 421.22& 469.01& 491& 0.95973\\ 1023& 99& 3& 9& 4096& 11& 669& 6.31& 421.22& 469.01& 491& 0.99744\\ 1023& 99& 3& 9& 8192& 11& 669& 6.31& 421.22& 469.01& 491& 0.99936\\ 1023& 120& 4& 8& 1024& 11& 701& 5.26& 449.06& 460.51& 483& 0.95974\\ 1023& 120& 4& 8& 4096& 11& 701& 5.26& 449.06& 460.51& 483& 0.99744\\ 1023& 120& 4& 8& 8192& 11& 701& 5.26& 449.06& 460.51& 483& 0.99936\\ 1023& 220& 5& 7& 1024& 11& 546& 4.37& 324.45& 340.61& 354& 0.97108\\ 1023& 220& 5& 7& 4096& 11& 546& 4.37& 324.45& 340.61& 354& 0.99817\\ 1023& 220& 5& 7& 8196& 11& 546& 4.37& 324.45& 340.61& 354& 0.99954\\ 500& 99& 33& 68& 512& 100& 268& 43.43& 159.41& 171.17& 175& 1-10^{-35}\\ 500& 99& 33& 68& 1024& 100& 268& 43.43& 159.41& 171.17& 175& 1-10^{-42}\\ 500& 99& 33& 68& 2048& 100& 268& 43.43& 159.41& 171.17& 175& 1-10^{-50}\\ 63& 16& 8& 14& 64& 21& 35& 8.88& 21.0& 22.19& 24& 0.99938\\ 63& 16& 8& 14& 128& 21& 35& 8.88& 21.0& 22.19& 24& 0.99998\\ 63& 16& 8& 14& 256& 21& 35& 8.88& 21.0& 22.19& 24& 1-10^{-6} \end{tabular} \end{center} \end{table} We now consider the asymptotic regime. First note that for GRS codes the distance is given by $d=n-Rn+1$ and the alphabet-independent, i.e., $\theta_q=1$, Johnson radius (\ref{eq:johnsonradius}) can be expressed in terms of the rate as $\tau_J = n\left(1-\sqrt{R-\frac{1}{n}}\right)$. For $n\rightarrow \infty$, any constant rate $R<1$, and $t_J$ given by the alphabet-independent Johnson radius~(\ref{eq:johnsonradius}), it holds that \begin{align*} \tilde{P}_E(n,d,q,t_J) &= \frac{1}{(q-1)^{d-1}}\sum_{s=0}^{t_J} (q-1)^s \binom{n}{s}\\ &\leq \frac{1}{(q-1)^{d-1}}q^{t_J} \binom{n}{t_J} \\ &\leq \frac{1}{(q-1)^{d-1}}q^{t_J} \left(\frac{n \cdot e}{t_J}\right)^{t_J} \\ &\leq q^{-(d-1)\log_q(q-1)+t_J\left[ 1 + \log_q\left(\frac{n \cdot e}{t_J} \right) \right]} \end{align*} Since for RS code $q \to \infty$ for $n \to \infty$, we have $\log_q(q-1) \to 1$ for $n \to \infty$ and \begin{align*} \log_q\left(\frac{n \cdot e}{t_J}\right) &= \log_q\left(\frac{e}{1-\sqrt{R-\tfrac{1}{n}}}\right) \to 0 \quad (n \to \infty). \end{align*} Hence, we have \begin{align*} \lim_{n\rightarrow \infty}\tilde{P}_E(n,d,q,t_J) &\leq \lim_{n,q\rightarrow \infty} q^{-(d-1)\log_q(q-1)+t_J\left[ 1 + \log_q\left(\frac{n \cdot e}{t_J} \right) \right]} \\ &= \lim_{n,q\rightarrow \infty} q^{t_J-(d-1)} \\ &= \lim_{n,q\rightarrow \infty} q^{n\left(1-\sqrt{R-\frac{1}{n}}\right)-(n-Rn+1)+1}\\ &= \lim_{n,q\rightarrow \infty} q^{n\left(R-\sqrt{R-\frac{1}{n}}\right)}\stackrel{(\ast)}{=} 0 \ , \end{align*} where $(\ast)$ holds because $\lim_{n\rightarrow \infty} \Big( R-\sqrt{R-\frac{1}{n}}\Big) < 0$ for any $0<R<1$. Now consider the asymptotic regime as defined in Section~\ref{subsec:asymptotic}, i.e., a fixed number of local repair sets $\frac{n}{n_l}$, a fixed code rate $R=\frac{k}{n}$, and a normalized local distance of $\frac{\varrho}{n_l}=\beta\cdot \frac{d}{n}$ for some constant $\beta>1$. In this regime both the local and the global distance grow linearly in $n$. Hence the asymptotic success probability of the unique decoder, when decoding up to the alphabet-independent Johnson radius locally and globally, is \begin{align*} \lim_{n\rightarrow \infty} \Pr\{L_g=1\} = \lim_{n\rightarrow \infty} (1-\tilde{P}_E(n_l,\varrho,q,t_l) )^{\frac{n}{n_l}} \left(1-\tilde{P}_E\left(\left\lfloor \frac{t_g}{t_l+1} \right\rfloor n_l,d,q,t_g\right)\right) = 1 \ . \end{align*} \subsection{Improved Decoding Using Interleaved Reed--Solomon Codes} \label{subsec:decSupercode} In data storage, as in data transmission, codes over small fields are generally favorable as they allow for lower complexity decoding of errors or recovery from erasures. Hence, several codewords are stored simultaneously on a set of servers (cf.~Figure~\ref{fig:illustration}). These codewords can be viewed as a codeword of an interleaved code. Furthermore, if errors occur, they are likely to affect a server or hard drive sector as discussed in the introduction. In the interleaved code interpretation of the stored data, this corresponds to a burst error and collaborative decoding of the stored data promises an improvement over separate decoding. An advantage of interleaved codes, e.g., compared to other codes over a larger alphabet, is that in most cases, i.e., when erasures or only up to $<d/2$ errors occur, it is sufficient to consider each codeword separately, thereby keeping the decoding complexity low. Only in a worst-case scenario where $\geq d/2$ errors occur, the stored codewords can be viewed as an interleaved code, hence increasing the decoding radius and resolving the errors with high probability. As discussed in Section~\ref{sec:tamobarg}, any LRC that is a subcode of a GRS code, e.g., Tamo--Barg LRCs \cite{Tamo2014}, can be decoded using a decoder of its GRS supercode. Hence, also its $\ell$-interleaved codes can be decoded using an interleaved decoder for GRS codes. For instance, the decoder in \cite{schmidt2009collaborative} can correct a random burst error of weight $t < t_{\mathrm{max}} \coloneqq \tfrac{\ell}{\ell+1}(d-1)$, where $d$ is the minimum distance of the constituent LRC, with success probability\footnote{By failure, we mean that the decoder does not return a codeword and by miscorrection if it returns a codeword different to the transmitted one. Since we consider subcodes of GRS codes, some miscorrections will turn into failures (i.e., if a miscorrected GRS codeword is not an element of the LRC subcode), but the sum of miscorrections and failures will stay the same.} $1-P_\mathrm{failure}-P_\mathrm{miscorrection}$ where $P_\mathrm{failure}$ and $P_\mathrm{miscorrection}$ are defined as in \cite{schmidt2009collaborative} ($P_\mathrm{failure}$ goes to $0$ exponentially in $t-t_\mathrm{max}$ and usually $P_\mathrm{miscorrection} \ll P_\mathrm{failure}$, see~\cite{schmidt2009collaborative} for more details). Already for small code parameters, this probability can be quite close to $1$ if the interleaving degree is high (which is usually the case in a real storage system) as the following example shows. \begin{example} Consider an $[n=15,k=8,r=4,\varrho=2]$ storage code of distance $d=7$ operating on bytes, i.e., over the field $F_{2^8}$. The unique decoding radius of this code is $\left\lfloor \frac{d-1}{2} \right\rfloor = 3$. Now assume burst errors occurring on hard-drive sectors of typical size $512$ bytes. This results in an interleaving order of $\ell = 512$ and an interleaved decoding radius of $t = 5$. The bound mentioned above gives a success probability $> 1- 10^{-1223}$. \end{example} For GRS subcode LRCs we can combine interleaved decoding and the local-global decoding strategy introduced in Section~\ref{sec:listDecoding}. We will analyze the resulting decoding radius in the following. There are various decoding algorithms for interleaved GRS codes, e.g., \cite{krachkovsky1997decoding,bleichenbacher2003decoding,coppersmith2003reconstructing,parvaresh2004multivariate,brown2004probabilistic,parvaresh2007algebraic,schmidt2007enhancing,schmidt2009collaborative,cohn2013approximate,nielsen2013generalised,wachterzeh2014decoding,puchinger2017irs,yu2018simultaneous}. Among these decoders, the maximal ``expected'' decoding radius for a given code of length $n$ and minimum distance $d$ is \begin{align} \tau_{\mathrm{IRS,max}} = n\left(1- \left(\frac{n-d}{n}\right)^{\frac{\ell}{\ell+1}} \right), \label{eq:IRS_radius} \end{align} which can be achieved in polynomial time by the algorithms in \cite{parvaresh2004multivariate,cohn2013approximate,puchinger2017irs}. We use the term ``expected'' here since for none of the above mentioned algorithms we have a decoding guarantee comparable to a polynomial-time list decoder. To be precise, the algorithms can be subdivided into two classes: list decoders with exponential worst-case list size and partial unique decoders that fail for some error patterns. We are not aware of bounds on the probability (given a random error of prescribed weight) that the list size is small or that decoding fails, for the decoders in \cite{parvaresh2004multivariate,cohn2013approximate,puchinger2017irs} at error weight close to the maximal decoding radius \eqref{eq:IRS_radius}. However, numerical results indicate that decoding succeeds with very high probability up to the given radius. To obtain a precise statement in the following, we assume that we know the probability of \emph{unique decoding success} $\mathrm{Pr}_{\mathrm{UDS}}(n,d,\ell,t,\mathrm{dec})$ for a given decoder $\mathrm{dec}$ and number of errors $t \leq \tau_{\mathrm{IRS,max}}$ at the maximal decoding radius $\tau_{\mathrm{IRS,max}}$, i.e., the probability that a list decoder ($\mathrm{dec}$ being one of the algorithms in \cite{parvaresh2004multivariate,cohn2013approximate}) returns a list of size $1$ or that a partial unique decoder ($\mathrm{dec}$ as in \cite{puchinger2017irs}) succeeds in finding a unique closest codewords to the received word (the probability sample space is the set of error words of weight $t$). Further, we assume that $\mathrm{Pr}_{\mathrm{UDS}}(n,d,\ell,t_1,\mathrm{dec}) \geq \mathrm{Pr}_{\mathrm{UDS}}(n,d,\ell,t_2,\mathrm{dec})$ for any $t_1 < t_2 \leq \tau_{\mathrm{IRS,max}}$, i.e.\ the success probability is not smaller for fewer errors. Using similar arguments as in the proofs of Theorem~\ref{thm:ListDecodingLRCs}\footnote{In Theorem~\ref{thm:ListDecodingLRCs}, we used the alphabet-dependent Johnson radius to derive the decoding radius of the new decoder. Although \eqref{eq:IRS_radius} appears to be a natural generalization of the alphabet-independent Johnson radius formula for $\ell>1$, we are not aware of any work that achieves an alphabet-dependent bound greater than \eqref{eq:IRS_radius}. Such an improvement seems to be possible by combining \cite{parvaresh2004multivariate,cohn2013approximate,puchinger2017irs} and the algorithm in \cite{augot2011list} for decoding alternant codes up to the alphabet-dependent Johnson radius. Nevertheless, we solely use the alphabet-independent bound here since this extension is out of the scope of this paper.} and Theorem~\ref{thm:probabilisticSuccessProb}, we can in principle obtain a probabilistic unique decoder for interleaving degree $\ell$, where for $\ceil{\sigma}$ correctly decoded local codes, the resulting decoding radius is the largest $\tau$ fulfilling \begin{equation*} 0 < ( (n-\ceil{\sigma} n_l)-\tau)^{\ell+1} - (n-\ceil{\sigma} n_l)((n-\ceil{\sigma} n_l)-d)^\ell \ . \end{equation*} \begin{theorem}\label{thm:interleavedGeneral} Consider an $\ell$-interleaved $[n,k,r,\varrho]_q$ LRC which is a subcode of an $[n,k',d]_q$ GRS code and where every local code is a (subcode of a) $[r+\varrho-1,r,\varrho]_q$ GRS code. Then there is an efficient decoding algorithm correcting $t_g=\ceil{\tau_g-1}$ errors, where $t_g$ is the largest integer such that \begin{equation} 0 < ( (n-\ceil{\sigma} n_l)-t_g)^{\ell+1} - (n-\ceil{\sigma} n_l)((n-\ceil{\sigma} n_l)-d)^\ell, \label{eq:interleaved_max_radius_general} \end{equation} that succeeds with probability \begin{align*} P_{suc} \geq (1-\tilde{P}_E(n_l,\varrho,q^\ell,t_l))^{\left\lfloor \frac{t_g}{t_l+1}\right\rfloor } \cdot \mathrm{Pr}_{\mathrm{UDS}}(n_l,\varrho,\ell,t_l,\mathrm{dec})^{\frac{n}{n_l} - \left\lfloor \frac{t_g}{t_l+1}\right\rfloor} \cdot \mathrm{Pr}_{\mathrm{UDS}}(n-\ceil{\sigma} n_l,d,\ell,t_g,\mathrm{dec}), \end{align*} where $\mathrm{dec}$ is one of the decoders in \cite{parvaresh2004multivariate,cohn2013approximate,puchinger2017irs} and $t_l$ is the number of errors locally correctable by these decoders. \end{theorem} \begin{proof} The maximal radius follows directly from the same argument as in the proof of Theorem~\ref{thm:ListDecodingLRCs}. Similar to Theorem~\ref{thm:probabilisticSuccessProb}, the success probability consists of three terms. The first term gives the probability that all repair sets that are not used for shortening return either a nothing or the correct decoding result. It is well known that an $\ell$-interleaved GRS code over a field $\F{q}$ is a GRS code over $\F{q^\ell}$. Hence, the bound of \cite{McEliece2003} given in (\ref{eq:PERS}) applies, with the field size $q^\ell$. The second term gives the probability that the decoder returns a unique result for the $\ceil{\sigma}$ repair sets that are used for shortening, i.e., are guaranteed to have $\leq t_l$ errors. The third term gives the probability that the shortened code is decoded successfully. \end{proof} For $\ell=2$, we can resolve the condition in \eqref{eq:interleaved_max_radius_general} and obtain the following radius. \begin{theorem}\label{thm:RadiusRSSubcodes} A $2$-interleaved $[n,k,r,\varrho]_q$ LRC which is a subcode of an $[n,k,d]_q$ GRS code and where every local code is a $[r+\varrho-1,r,\varrho]_q$ GRS code can be efficiently decoded up to a radius of \begin{align*} \tau_g = d \cdot \frac{2-\tfrac{\varrho}{n_l}}{\left(1-\frac{\varrho}{n_l}\right)^{4/3}+\left(1-\frac{\varrho}{n_l}\right)^{2/3}+1} \end{align*} with success probability \begin{align*} P_{suc} \geq (1-\tilde{P}_E(n_l,\varrho,q^\ell,t_l))^{\left\lfloor \frac{t_g}{t_l+1}\right\rfloor } \cdot \mathrm{Pr}_{\mathrm{UDS}}(n_l,\varrho,2,t_l,\mathrm{dec})^{\frac{n}{n_l} - \left\lfloor \frac{t_g}{t_l+1}\right\rfloor} \cdot \mathrm{Pr}_{\mathrm{UDS}}(n-\ceil{\sigma} n_l,d,2,t_g,\mathrm{dec}), \end{align*} where $\mathrm{dec}$ is one of the decoders in \cite{parvaresh2004multivariate,cohn2013approximate,puchinger2017irs}. \end{theorem} \begin{IEEEproof} It follows from \ref{lem:increasingInN} that replacing $\ceil{\sigma}$ with $\sigma$ in the condition of Theorem~\ref{thm:interleavedGeneral} gives a valid decoding radius. It follows that for $\ell=2$ and $\sigma$ as defined as in \ref{lem:sigma}, the decoding radius is given by the largest $\tau_g$ such that \begin{align*} 0&\leq \left(\frac{\tau_g (n_l-\tau_l)}{\tau_l} \right)^{3} - \frac{n_l \tau_g}{\tau_l} \left(\frac{n_l \tau_g-d\tau_l}{\tau_l} \right)^{2} \nonumber \\ &= \tau_g^3 \frac{n_l^3-3n_l^2\tau_l+3n_l\tau_l^2-\tau_l^3}{\tau_l^3}- \tau_g \frac{n_l}{\tau_l^3} \big[n_l^2\tau_g^2-2n_l\tau_g d \tau_l + d^2 \tau_l^2\big] \nonumber \\ \overset{\tau_l>0, \tau_g>0}{\Longleftrightarrow} \quad 0 &\leq \tau_g^2 \Big[-3n_l^2+3n_l\tau_l-\tau_l^2 \Big] + \tau_g \Big[ 2 n_l^2 d \Big] + \Big[ -n_l d^2 \tau_l \Big] \label{eq:quadratic_inequality} \end{align*} Since $-3n_l^2+3n_l\tau_l-\tau_l^2<0$, the inequality is fulfilled between the two roots of the polynomial in $\tau_g$, i.e., \begin{align*} \tau_{g,1/2} = \frac{2n_l^2d \pm \sqrt{4 n_l^4d^2 - 4n_l d^2\tau_l (3 n_l^2-3n_l\tau_l + \tau_l^2)}}{2(3 n_l^2-3n_l\tau_l + \tau_l^2)}. \end{align*} With $\tau_l = n_l(1-(\tfrac{n_l-\varrho}{n_l})^{2/3})$, we have \begin{align*} \tau_{g,1/2} &= d \cdot\frac{1 \pm \sqrt{1 - (1-(\tfrac{n_l-\varrho}{n_l})^{2/3}) (3 - 3(1-(\tfrac{n_l-\varrho}{n_l})^{2/3}) + (1-(\tfrac{n_l-\varrho}{n_l})^{2/3})^2)}}{3 - 3(1-(\tfrac{n_l-\varrho}{n_l})^{2/3}) + (1-(\tfrac{n_l-\varrho}{n_l})^{2/3})^2} \\ &= d \cdot \frac{1 \pm (\tfrac{n_l-\varrho}{n_l})}{(\tfrac{n_l-\varrho}{n_l})^{4/3}+(\tfrac{n_l-\varrho}{n_l})^{2/3}+1} \\ \end{align*} and the theorem statement follows. \end{IEEEproof} In Table~\ref{tab:exampleParameters} we give some example of parameters and the respective decoding radii achieved by the different decoders of Section~\ref{subsec:listdecodingalgo} and Section~\ref{subsec:decSupercode}. Note that especially for LRCs with a small number of local repair sets $\mu=\frac{n}{n_l}$, the number of correctable errors $\bar{t}_g$ when considering the floors in the derivation of the number of correctable errors (cf. Remark~\ref{rem:radiusWithFloor}), can give a large relative improvement compared to the radius of Theorem~\ref{thm:ListDecodingLRCs}. \begin{table}\centering \caption{Decoding radii for different parameters. The alphabet-independent Johnson-radii for the local and the global code are denoted by $\tau_{J,l}$ and $\tau_{J,g}$ respectively. The radius for $\ell=2$-interleaved decoding given in (\ref{eq:IRS_radius}) is denoted by $\tau_{J,\ell=2}$. The radius of Theorem~\ref{thm:ListDecodingLRCs} is given by $\tau_g$ and the number of correctable errors when considering the floors by $\bar{t}_g$. The radius of Theorem~\ref{thm:RadiusRSSubcodes} is denoted by $\tau_{g,\ell=2}$.} \begin{tabular}{CCCCCCC|CC||CC|CC||C|C} n&k&r&\varrho&q&n_l&d&R_{\text{global}} & R_{\text{local}} & \substack{\text{Eq. (\ref{eq:johnsonradius})} \\ \tau_{J,l}}&\substack{\text{Eq. (\ref{eq:johnsonradius})}\\ \tau_{J,g}}&\substack{\text{Thm.~\ref{thm:ListDecodingLRCs}}\\\tau_{g}} & \substack{\text{Eq.~(\ref{eq:radiusWithFloor})} \\\bar{t}_g} & \substack{\text{Eq.~(\ref{eq:IRS_radius})}\\\tau_{J,\ell=2}}&\substack{\text{Thm.~\ref{thm:RadiusRSSubcodes}}\\\tau_{g,\ell=2}} \\ \hline 15& 6& 3& 3& \infty& 5& 8&0.40 & 0.60 & 1.84& 4.75& 4.9& 5& 5.98& 6.09\\ 30& 16& 4& 3& \infty& 6& 9&0.53 &0.66& 1.76& 4.9& 5.27& 5 & 6.35& 6.66\\ 30& 15& 3& 3& \infty& 5& 8&0.50 & 0.60 & 1.84& 4.31& 4.9& 5 & 5.6& 6.09\\ 63& 16& 8& 14& \infty& 21& 35& 0.25 & 0.38 & 8.88& 21& 22.19& 24 & 26.31& 27.26\\ 63& 40& 5& 3& \infty& 7& 10& 0.63 & 0.71 & 1.71& 5.22& 5.69& 5 & 6.86& 7.27\\ 500& 99& 33& 68& \infty& 100& 268& 0.20 & 0.33 & 43.43& 159.41& 171.17& 175 & 200.33& 209.73 \end{tabular} \label{tab:exampleParameters} \end{table} \section{Decoding of PMDS codes beyond their Minimum Distance} \label{sec:PMDS} In this section, we focus on interleaved PMDS (maximally recoverable) codes, as in Definition~\ref{def:partialMDS}. For these codes we propose an explicit decoder that can correct \emph{beyond the minimum distance} for many error patterns (i.e., error positions). The results do not assume any structure on the underlying PMDS code other than the PMDS property and a sufficiently large interleaving order. Hence, it is a generic decoder for interleaved PMDS codes that runs in cubic time in the code length independent of the chosen PMDS code. The idea is based on interleaving a PMDS code (which is again a PMDS code, just over a larger alphabet) and then applying the Metzner--Kapturowski algorithm \cite{metzner1990general}, which is an efficient decoder for generic interleaved codes of high interleaving order that corrects up to $d-2$ errors if the error matrix has full rank. We derive a new condition on the set of error positions which allows the decoder to correct more than $d-2$ errors. For PMDS codes, we derive bounds on the number of such sets corresponding to errors of a given weight, and show that for many PMDS codes, the relative number of error patterns of weight $n-k-1$ that can be corrected is close to $1$. Among others, we show that any family of (high-order interleaved) PMDS codes that contains codes of length greater than any given integer and any code that fulfills the rate restriction \begin{equation*} \left(\frac{R_\mathsf{local}}{e}\right)^{\varrho-2} > R_\mathsf{global} \ , \end{equation*} contains codes that can correct a fraction of error patterns of weight $n-k-1$ arbitrarily close to $1$. \subsection{A Generalization of Metzner and Kapturowski's Statement} \label{sec:metznerKapturowski} Metzner and Kapturowski proved in \cite[Theorem~2]{metzner1990general} that a codeword $\ve{C}$ of an interleaved code with minimum distance $d$ can be uniquely recovered from a corrupted word $\ve{C}+\ve{E}$ if \begin{enumerate} \item The number of errors is $t \coloneqq |\mathcal{E}| \leq d-2$ and \item the error matrix $\ve{E}$ has full rank $t$ (this implicitly assumes that the interleaving order is high, i.e., $\ell \geq t$). \end{enumerate} However, the first condition is very restrictive and not necessary for the decoder to work. In fact, the proof of \cite[Theorem~2]{metzner1990general} only assumes an implication of the first property: The $t+1$ columns of the parity-check matrix indexed by the error positions $\mathcal{E}$ and any other integer in $\{1,\dots,n\} \setminus \mathcal{E}$ must be linearly independent. We will give this property a name in the following definition. \begin{definition}\label{def:t+1-independent} Let $\H \in \ensuremath{\mathbb{F}_q}^{(n-k) \times n}$ be a parity-check matrix of a linear $[n,k,d]$ code $\mathcal{C}$. A set $\mathcal{E} \subseteq \{1,\dots,n\}$ with $t = |\mathcal{E}|$ is called \emph{$(t+1)$-independent (with respect to $\H$)} if \begin{align*} \rank \left(\H_{\mathcal{E} \cup \{i\}}\right) = t+1 \quad \forall i \in \{1,\dots,n\} \setminus \mathcal{E}, \end{align*} where $\H_{\mathcal{E} \cup \{i\}}$ is the matrix consisting of the columns of $\H$ indexed by $\mathcal{E} \cup \{i\}$. \end{definition} Note that for $t\leq d-2$, any set is $t+1$-independent, and for $t\geq n-k$, no set is $t+1$-independent. Using this definition, we can formally state a generalization of the result in \cite[Theorem~2]{metzner1990general}. The proof resembles Metzner and Kapturowski's argumentation, but we include it for completeness. \begin{theorem}\label{thm:MK_generalization} Let $\mathcal{C}$ be a linear code with parity-check matrix $\H$ and $\ve{E} \in \ensuremath{\mathbb{F}_q}^{\ell \times n}$ be an error matrix whose $t$ non-zero columns are indexed by the set $\mathcal{E} \subset \{1,\dots,n\}$. Furthermore, let $\S = \H \ve{E}^\top \in \ensuremath{\mathbb{F}_q}^{(n-k) \times \ell}$ be the syndrome matrix, $\P \in \ensuremath{\mathbb{F}_q}^{(n-k) \times (n-k)}$ be an invertible matrix such that $\P \S$ is in reduced row Echelon form, and $\zeta$ be the number of zero rows in $\P \S$ (i.e. $\zeta = n-k-\rank(\S)$). We denote the lowest $\zeta$ rows of $\P \H$ by $\ve{Q} \in \ensuremath{\mathbb{F}_q}^{\zeta \times n}$. If $\ve{E}$ satisfies the conditions \begin{enumerate}[label=\roman*)] \item\label{itm:t+1-independence_condition} $\mathcal{E}$ is $(t+1)$-independent w.r.t.\ $\H$ (\textbf{${\boldsymbol{(t+1)}}$-independence condition}) and \item $\rank(\ve{E})=t$ (\textbf{full-rank condition}), \end{enumerate} then the zero columns of $\ve{Q}$ are exactly the error positions $\mathcal{E}$. \end{theorem} \begin{proof} Since the rank of the error equals its number of non-zero columns, a vector is in the right kernel of $\ve{E}$ if and only if it is zero at the error positions $\mathcal{E}$. Due to $\ve{0} = \ve{Q} \ve{E}^\top$ ($\Leftrightarrow$ $\ve{E} \ve{Q}^\top = \ve{0}$), the rows of $\ve{Q}$ must be in the right kernel of $\ve{E}$ and thus $\ve{Q}$ has zero columns at the error positions. We prove that the other columns are non-zero. Assume the contrary, i.e., let $i \notin \mathcal{E}$ be a zero column of $\ve{Q}$. Then, the matrix $(\P \H)_{\mathcal{E} \cup \{i\}}$, consisting of the $t+1$ columns of $\P\H$ indexed by $\mathcal{E} \cup \{i\}$, has at least $\zeta = n-k-\rank(\S) \geq n-k-t$ zero rows (recall that $\ve{Q}$ is, by definition, the submatrix of $\P\H$ consisting of the last $\zeta$ rows, and thus, as $\ve{Q}$ is zero in all columns indexed by $\mathcal{E} \cup \{i\}$, the last $\zeta$ rows of $(\P \H)_{\mathcal{E} \cup \{i\}}$ are zero). Hence, the left kernel of $(\P \H)_{\mathcal{E} \cup \{i\}}$ has dimension at least $n-k-t$ (e.g., the identity vectors $\ve{e}_{t+1},\dots,\ve{e}_{n-k}$ are contained in the kernel). On the other hand, as $\mathcal{E}$ is $(t+1)$-independent, we have $\rank((\P \H)_{\mathcal{E} \cup \{i\}}) = t+1$ and by the rank nullity theorem, the left kernel of $(\P \H)_{\mathcal{E} \cup \{i\}}$ has dimension $n-k-t-1$, which is a contradiction. \end{proof} The decoding strategy implied by Theorem~\ref{thm:MK_generalization} is outlined in Algorithm~\ref{alg:MK}. Note that Line~\ref{line:erasure_correction} performs erasure correction after determining the error positions. This gives a unique result if $\mathcal{E}$ is $t+1$-independent since the columns of $\H$ indexed by $\mathcal{E}$ are linearly independent, hence the complementary columns of a generator matrix are linearly independent, i.e., $\{1,\dots,n\} \setminus \mathcal{E}$ contains an information set. As the decoder is only based on linear-algebraic operations, it can be implemented in $O(\max\{\ell,n\}n^2)$ operations over the base field $\ensuremath{\mathbb{F}_q}$ of the code $\mathcal{C}$. Note that the second condition, $\rank\left(\ve{E}_\mathcal{E}\right)=t$, is fulfilled for most error matrices with $t$ non-zero columns if the interleaving order $\ell$ is large enough. In the following subsections, we will see that Theorem~\ref{thm:MK_generalization} is indeed a significant improvement over \cite[Theorem~2]{metzner1990general} since there are PMDS with only a few error positions $\mathcal{E}$ that are not $t+1$-independent for $d-2< t < n-k$. \printalgoIEEE{ \DontPrintSemicolon \KwIn{Parity-check matrix $\H$, received word $\ve{R} = \ve{C} + \ve{E}$} \KwOut{Transmitted codeword $\ve{C}$} $\S \gets \H \ve{R}^{\top} \in \ensuremath{\mathbb{F}_q}^{(n-k)\times\ell}$. Determine $\P\in \ensuremath{\mathbb{F}_q}^{(n-k)\times(n-k)}$ s.t. $\P \S$ is in reduced row echelon form. $\zeta \gets$ number of zero rows in $\P \S$. $\ve{Q} \in \ensuremath{\mathbb{F}_q}^{\zeta \times n} \gets$ last $\zeta$ rows of $\P \H$ Determine $\ve{B}\in\ensuremath{\mathbb{F}_q}^{(n-k-\zeta) \times n}$ s.t.\ the columns of $\ve{B}$ which correspond to the zero-columns of $\ve{Q}$ form an identity matrix and the remaining columns of $\ve{B}$ are zero. Determine $\ve{A}\in\ensuremath{\mathbb{F}_q}^{\ell \times (n-k-\zeta)} $ s.t. $(\H\ve{B}^{\top})\ve{A}^{\top} = \S$. \label{line:erasure_correction} $\ve{C} \gets \ve{R} - \ve{A}\ve{B} \in \ensuremath{\mathbb{F}_q}^{\ell \times n}$. \Return{$\ve{C}$} \caption{Metzner--Kapturowski Algorithm \cite{metzner1990general}} \label{alg:MK} } \subsection{PMDS Codes With Many $(t+1)$-Independent Positions} A set of erasures $\mathcal{E}$ can be corrected if and only if its complement $\bar{\mathcal{E}} \coloneqq \{1,\dots,n\} \setminus \mathcal{E}$ contains an \emph{information set}, i.e., indexes $k$ linearly independent columns of the generator matrix. The authors of \cite{tamo2016optimal} studied a family of optimal LRCs, which in some parameter range are able to correct $n-k$ erasures with probability approaching $1$ for large code lengths. This follows from showing that the number of information sets relative to the number of all sets with $k$ elements tends to $1$ for $n \to \infty$. We will use a similar approach in the following to show that the relative number of $(t+1)$-independent positions with $t \leq n-k-1$ tends to $1$ for a family of PMDS codes. \begin{definition}[\!\!\cite{tamo2016optimal}] Let $\mathcal{R}_1,\dots,\mathcal{R}_{n/(r+\varrho-1)}$ be the repair sets of an $[n,k,r,\varrho]$ PMDS code. We define the set \begin{equation*} \mathbb{S}_{\mu} \coloneqq \{ \mathcal{S} \subseteq \{1,\dots,n\} \, : \, |\mathcal{S}|=\mu , \, |\mathcal{S} \cap \mathcal{R}_i| \leq r \, \forall i \} \ . \end{equation*} \end{definition} The following was shown in \cite{tamo2016optimal} for a special class of PMDS codes and holds in general for PMDS codes. \begin{lemma}\label{lem:information_sets_Sk} Let $\ve{G}$ be a generator matrix of an $[n,k,r,\varrho]$ PMDS code. Let $\mathcal{S} \subseteq \{1,\dots,n\}$ be of cardinality $k$. Then, the columns of $\ve{G}_\mathcal{S}$ (i.e., the columns of $\ve{G}$ indexed by $\mathcal{S}$) are linearly independent if and only if $\mathcal{S} \in \mathbb{S}_k$. \end{lemma} \begin{proof} The statement was proven for the codes in \cite{tamo2016optimal} within the proof of \cite[Lemma~7]{tamo2016optimal}. It holds in general for PMDS codes since any set $\mathcal{S} \in \mathbb{S}_k$ corresponds to $k$ columns of a generator matrix of the MDS code obtained by puncturing the PMDS code at $\varrho-1$ positions of each local repair set not in $\mathcal{S}$. This puncturing is possible since $\mathcal{S}$ intersects with each local repair set in at most $r$ positions, so there are at least $\varrho-1$ positions left in each repair set. It is well-known that any $k$ columns of an MDS code's generator matrix are linearly independent. \end{proof} The following lemma is necessary to relate the sets in $\mathbb{S}_{\mu}$ to the $(t+1)$-independent property. We will also use the statement, in Section~\ref{ssec:Pf_finite}, to derive bounds on the number of $(t+1)$-independent sets. \begin{lemma}\label{lem:t+1-independent_criterion} Let $\H \in \ensuremath{\mathbb{F}_q}^{n-k \times n}$ be a parity-check matrix of an $[n,k,r,\varrho]$ PMDS code. Let $\mathcal{E} \subseteq \{1,\dots,n\}$ be a set of cardinality $t$ and $\bar{\mathcal{E}} \coloneqq \{1,\dots,n\} \setminus \mathcal{E}$ its complement. For each local repair set, indexed by $i \in \{1,\dots,\mu\}$, we define \begin{align*} \mathcal{T}_i^\mathcal{E} &\coloneqq \bar{\mathcal{E}} \cap \mathcal{R}_i, &&\text{(set of error-free positions in each local repair set)} \\ T_i^\mathcal{E} &\coloneqq \left|\mathcal{T}_i^\mathcal{E}\right|, &&\text{(number of error-free positions in each local repair set)}\\ O_i^\mathcal{E} &\coloneqq \max\left\{0, T_i^\mathcal{E}-r\right\}, &&\text{(\textbf{excess} $\coloneqq$ number of error-free positions in each local repair set exceeding $r$)} \end{align*} Then, $\mathcal{E}$ is $(t+1)$-independent if and only if \begin{align*} \sum_{i=1}^{\mu} O_i^\mathcal{E} \leq \begin{cases} n-k-t-1, &\text{if $\exists \, j$ : $0 < T_j^\mathcal{E} \leq r$,} \\ n-k-t, &\text{else.} \end{cases} \end{align*} (I.e., if the \textbf{overall excess} is small enough) \end{lemma} \begin{proof} We have \begin{align*} &\mathcal{E} \text{ is $(t+1)$-independent} \\ \Leftrightarrow \quad &\forall \, i \in \bar{\mathcal{E}}: \, \rank(\H_{\mathcal{E} \cup \{i\}}) = t+1 \\ \Leftrightarrow \quad &\forall \, i \in \bar{\mathcal{E}} \, \exists \, J_i \subseteq \{1,\dots,n\}, \, |J_i| = n-k-t-1 \,: \rank (\H_{\mathcal{E} \cup \{i\} \cup J_i}) = n-k \\ \overset{(\ast)}{\Leftrightarrow} \quad &\forall \, i \in \bar{\mathcal{E}} \, \exists \, S_i \in \mathbb{S}_k \, : \, S_i \subseteq \overline{\mathcal{E} \cup \{i\}} \\ \Leftrightarrow \quad &\forall \, i \in \bar{\mathcal{E}} \, \exists \, S_i \in \mathbb{S}_k \, : \, S_i \subseteq \bar{\mathcal{E}} \setminus \{i\}, \end{align*} where $(\ast)$ is due to the fact that $S \in \mathbb{S}_k$ if and only if $S$ is an information set, which again holds if and only if the columns of $\H$ indexed by the complementary positions $\bar{S}$ are linearly independent. Hence, $\mathcal{E}$ is $(t+1)$-independent if and only if there is an information set in the complement of $\mathcal{E}$ even when we remove an arbitrary element from it. By the above notation, the $\mathcal{T}_i^\mathcal{E}$ form a partition of $\bar{\mathcal{E}}$, i.e., $\mathcal{T}_i^\mathcal{E} \cap \mathcal{T}_j^\mathcal{E} = \emptyset$ for all $i \neq j$ and $\cup_{j=1}^{\mu} \mathcal{T}_j^\mathcal{E} = \bar{\mathcal{E}}$. Thus, $\mathcal{E}$ is $(t+1)$-independent if and only if after removing any element $i$ from $\cup_{j=1}^{\mu} \mathcal{T}_j^\mathcal{E}$, there is still a subset $S_i \subseteq \cup_{i=1}^{\mu} \mathcal{T}_i^\mathcal{E}$ with $S_i \in \mathbb{S}_k$. This again is equivalent to saying that if we remove an \emph{arbitrary} element $i$ from $\bigcup_{j=1}^{\mu} \mathcal{T}_j^\mathcal{E}$, then there are $n-k-t-1$ elements (\emph{which we can choose}), say $D_i \subseteq \bar{\mathcal{E}} \setminus \{i\}$, such that \begin{align*} \left(\bigcup_{i=1}^{\mu} \mathcal{T}_i^\mathcal{E} \right) \setminus \left(\{i\} \cup D_i\right) \in \mathbb{S}_k. \end{align*} This is equivalent to \begin{align*} \left| \mathcal{T}_i^\mathcal{E} \setminus \left[ \left(\{i\} \cup D_i\right) \cap \mathcal{R}_i \right] \right| \leq r \quad \forall \, i, \end{align*} i.e., that we can remove enough elements from each local repair set such that there are at most $r$ elements left in each local repair set. The cardinality $O_i^\mathcal{E}$ defined above corresponds to the excess of $\bar{\mathcal{E}}$ in each local repair set, i.e., the number of elements in $\bar{\mathcal{E}} \cap \mathcal{R}_i$ that exceeds $r$. In general, we thus need to keep the sum of the $O_i^\mathcal{E}$ small as follows: If there is a $j$ such that $0<T_j^\mathcal{E}\leq r$, then $i$ could be from this local repair set $j \in \mathcal{T}_j^\mathcal{E}$, so the overall excess after removing $i$ is exactly $\sum_{i=1}^{\mu} O_i^\mathcal{E}$, which must not exceed $n-k-t-1$ (note that by removing an element from $\mathcal{T}_j^\mathcal{E}$, we get $T_j^\mathcal{E} \gets T_j^\mathcal{E}-1 <r$, so $O_j^\mathcal{E} = 0$ is unchanged). Otherwise, all $T_j^\mathcal{E}$ are either $0$ (we cannot remove an element from this repair set) or $>r$ (in this case, $O_i^\mathcal{E}$ is reduced after removing an element). Hence, after removing $i$, the overall excess is $(\sum_{i=1}^{\mu} O_i^\mathcal{E})-1$, so we get the condition $\sum_{i=1}^{\mu} O_i^\mathcal{E} \leq n-k-t$. \end{proof} From Lemma~\ref{lem:t+1-independent_criterion}, we get the following sufficient condition for a set to be $(t+1)$-independent. \begin{lemma}\label{lem:t+1-independent_S_k+1} Let $\H \in \ensuremath{\mathbb{F}_q}^{(n-k) \times n}$ be a parity-check matrix of an $[n,k,r,\varrho]$ PMDS code. Further, let $\mathcal{E}$ be a set of cardinality $|\mathcal{E}| =: t \leq n-k-1$. If there is a set $\mathcal{S} \in \mathbb{S}_{k+1}$ that is a subset of the complement of $\mathcal{E}$, i.e., $\mathcal{S} \subseteq \bar{\mathcal{E}} \coloneqq \{1,\dots,n\} \setminus \mathcal{E}$, then $\mathcal{E}$ is $(t+1)$-independent. \end{lemma} \begin{proof} By assumption, there is a set $\mathcal{J} \subset \bar{\mathcal{E}}$ such that $\bar{\mathcal{E}} = \mathcal{S} \cup \mathcal{J}$ and $\mathcal{S} \cap \mathcal{J} = \emptyset$. Using the notation of Lemma~\ref{lem:t+1-independent_criterion}, we have \begin{align*} T_i^{\mathcal{E}} = \left|\bar{\mathcal{E}} \cap \mathcal{R}_i\right| = \left|\mathcal{S} \cap \mathcal{R}_i\right| + \left|\mathcal{J} \cap \mathcal{R}_i\right| \overset{\mathcal{S} \in \mathbb{S}_{k+1}}{\leq} r + \left|\mathcal{J} \cap \mathcal{R}_i\right|, \end{align*} i.e., $O_i^\mathcal{E} \leq \left|\mathcal{J} \cap \mathcal{R}_i\right|$, and thus \begin{align*} \sum_{i=1}^{\mu} O_i^\mathcal{E} \leq \sum_{i=1}^{\mu} \left|\mathcal{J} \cap \mathcal{R}_i\right| = |\mathcal{J}| = \left|\bar{\mathcal{E}}\right|-|\mathcal{S}| = (n-t)-(k+1) = n-k-t-1. \end{align*} By Lemma~\ref{lem:t+1-independent_criterion}, the claim follows. \end{proof} \begin{remark} For $t=n-k-1$ and $r<k$ (note that the case of $r=k$ gives an MDS code without locality), Lemma~\ref{lem:t+1-independent_S_k+1} becomes an if and only if statement, i.e., $\mathcal{E}$ is $(t+1)$-independent if and only if $\bar{\mathcal{E}} \in \mathbb{S}_{k+1}$. The proof is as follows. Note first that $|\bar{\mathcal{E}}|=k+1$. If $\mathcal{E}$ is $(t+1)$-independent and $t = n-k-1$, then we must have $\sum_{i} O_i^\mathcal{E} = 0$ if there is a $j$ with $0 < T_j^\mathcal{E} \leq r$ and $\sum_{i} O_i^\mathcal{E} \leq 1$ otherwise. From $\sum_{i} O_i^\mathcal{E} = 0$, it directly follows that $T_j^\mathcal{E} \leq r$ for all $j$, which implies $\bar{\mathcal{E}} \in \mathbb{S}_{k+1}$. If $\sum_{i} O_i^\mathcal{E} = 1$, we have $T_j^\mathcal{E} = 0$ except for one $j$ which fulfills $T_j^\mathcal{E}=r+1$. Since $|\bar{\mathcal{E}}|=\sum_j T_j^\mathcal{E} = k+1$, we have $r=k$, a contradiction. The claim follows. \end{remark} Due to Lemma~\ref{lem:t+1-independent_S_k+1}, the relative amount of $(t+1)$-independent positions can be lower-bounded using the set $\mathbb{S}_{k+1}$ as follows. \begin{lemma} Let $t \leq n-k-1$. Then, \begin{equation*} \frac{|\{ \mathcal{E} \subseteq \{1,\dots,n\} \, : \, |\mathcal{E}| = t, \, \text{$(t+1)$-independent} \}|}{\binom{n}{t}} \geq \frac{|\mathbb{S}_{k+1}|}{\binom{n}{k+1}}. \end{equation*} \end{lemma} \begin{proof} A set is $(t+1)$-independent if and only if its complement contains an element of $\mathbb{S}_{k+1}$. Consider the bipartite graph with the elements of $\mathbb{S}_{k+1}$ on the left and all $(t+1)$-independent sets $\mathcal{E}$ of cardinality $t$ on the right. We draw an edge between any $\mathcal{S} \in \mathbb{S}_{k+1}$ and $\mathcal{E}$ if $\mathcal{S} \subseteq \{1,...,n\} \setminus \mathcal{E}$. Clearly the degree of any vertex on the left is exactly $\binom{n-(k+1)}{(n-t)-(k+1)}$, as we can add $|\{1,...,n\} \setminus \mathcal{E}| - |\mathcal{S}| = (n-t)-(k+1)$ elements to each set $\mathcal{S}$ to obtain a set $\mathcal{E}$ and there are $n-|\mathcal{S}| = n-(k+1)$ elements that are not already in $\mathcal{S}$. The degree of the vertices on the right is upper bounded by $\binom{n-t}{k+1}$, the number of subsets of $\{1,...,n\} \setminus \mathcal{E}$ of cardinality $k+1$. This yields \begin{align*} \binom{n-t}{k+1} |\{ \mathcal{E} \subseteq \{1,\dots,n\} \, : \, |\mathcal{E}| = t, \, \text{$(t+1)$-independent} \}| &\geq \binom{n-(k+1)}{(n-t)-(k+1)} |\mathbb{S}_{k+1}| &\\ \frac{(n-t)!}{((n-t)-(k+1))! \cdot (k+1)!} |\{ \mathcal{E} \subseteq \{1,\dots,n\} \, : \, |\mathcal{E}| = t, \, \text{$(t+1)$-independent} \}| &\geq \frac{(n-(k+1))!}{(n-(k+1)-t)! \cdot t!}|\mathbb{S}_{k+1}| \\ \frac{|\{ \mathcal{E} \subseteq \{1,\dots,n\} \, : \, |\mathcal{E}| = t, \, \text{$(t+1)$-independent} \}|}{\binom{n}{t}}&\geq\frac{|\mathbb{S}_{k+1}|}{\binom{n}{k+1}} \ , \end{align*} where equality holds for $t=n-k-1$. \end{proof} The following theorem is a generalization of \cite[Theorem~3]{tamo2016optimal}, which lower-bounds $\nicefrac{\mathbb{S}_{k}}{\binom{n}{k}}$ for the special case $\varrho=2$. \begin{lemma}\label{lem:Partial_MDS_bound_S_k+1} Let $\mathcal{C}$ be an $[n,k,r,\varrho]$ PMDS code. Then, \begin{align} \frac{|\mathbb{S}_{k+1}|}{\binom{n}{k+1}} \geq 1-2^{\log_2(n) - (r+1) \log_2\left( \binom{r+\varrho-1}{\xi}^{-\frac{1}{r+1}} \frac{n}{k+1}\right)}, \label{eq:bound_on_S_k+1} \end{align} where $\xi \coloneqq \min\left\{\varrho-2,\left\lfloor\frac{r+\varrho-1}{2}\right\rfloor\right\}$. \end{lemma} \begin{proof} We have \begin{align} &\binom{n}{k+1}-|\mathbb{S}_{k+1}| = |\overline{\mathbb{S}_{k+1}}| \notag \\ &= \left| \left\{ \mathcal{S} \subseteq \{1,\dots,n\} \, : \, |\mathcal{S}|=k+1 , \, \exists i \, : \, |\mathcal{S} \cap \mathcal{R}_i| > r \right\} \right| \notag \\ &\leq \sum_{i=1}^{\mu} \left| \left\{ \mathcal{S} \subseteq \{1,\dots,n\} \, : \, |\mathcal{S}|=k+1 , \, \, |\mathcal{S} \cap \mathcal{R}_i| > r \right\} \right| \notag \\ &\leq \mu \sum_{j=r+1}^{r+\varrho-1} \binom{r+\varrho-1}{j} \binom{n-(r+\varrho-1)}{k+1-j} \label{eq:P_t=n-k-1_union_bound_step} \\ &\overset{(\ast)}{\leq} \mu \left(\frac{k+1}{n}\right)^{r+1}\binom{n}{k+1} \sum_{j=r+1}^{r+\varrho-1} \underbrace{\binom{r+\varrho-1}{j}}_{\leq \binom{r+\varrho-1}{\xi}} \notag \\ &\leq \mu (\varrho-1) \left(\frac{k+1}{n}\right)^{r+1}\binom{n}{k+1} \binom{r+\varrho-1}{\xi}, \end{align} where $(\ast)$ follows from (recall that $j \in \{r+1,\dots,r+\varrho-1 \}$) \begin{align*} \binom{n-(r+\varrho-1)}{k+1-j} &\leq \binom{n-j}{k+1-j} \\ &= \binom{n}{k+1} \prod_{i=0}^{j-1} \frac{k+1-i}{n-i} \\ &\leq \binom{n}{k+1} \prod_{i=0}^{j-1} \frac{k+1}{n} \\ &\leq \left(\frac{k+1}{n}\right)^j \binom{n}{k+1}. \end{align*} Hence, we have \begin{align*} \frac{|\mathbb{S}_{k+1}|}{\binom{n}{k+1}} &\geq 1-\mu (\varrho-1) \left(\binom{r+\varrho-1}{\xi}^{\frac{1}{r+1}} \frac{k+1}{n}\right)^{r+1} \\ &\geq 1-n \left(\binom{r+\varrho-1}{\xi}^{\frac{1}{r+1}} \frac{k+1}{n}\right)^{r+1} \\ &= 1-2^{\log_2(n) - (r+1) \log_2\left( \binom{r+\varrho-1}{\xi}^{-\frac{1}{r+1}} \frac{n}{k+1}\right)} \ , \end{align*} which proves the claim. \end{proof} Note that for $\varrho \leq r+2$, we always have $\xi = \varrho-2$. Using the bound in Lemma~\ref{lem:Partial_MDS_bound_S_k+1}, we are able to formulate conditions on the local and global distance of a family of PMDS codes for which the relative size of $\mathbb{S}_{k+1}$ compared to all cardinality-$(k+1)$ subsets of $\{1,\dots,n\}$ approaches $1$ for growing code length. \begin{lemma}\label{lem:Partial_MDS_bound_S_k+1_asymptotical} Let $\{\mathcal{C}_n\}$ be a family of $[n,k_n,r_n,\varrho_n]$ PMDS LRC with \begin{align} \binom{r_n+\varrho_n-1}{\xi_n}^{-\frac{1}{r_n+1}} &> C_1 \frac{k_n+1}{n}\label{eq:rate_condition}\\ r_n+1 &\geq \frac{C_2 \log_2(n)}{\log_2(C_1)} \label{eq:number_of_local_groups_condition} \end{align} for some $C_1,C_2>1$, where $\xi_n \coloneqq \min\left\{\varrho_n-2,\left\lfloor\frac{r_n+\varrho_n-1}{2}\right\rfloor\right\}$. Then, \begin{align*} \frac{|\mathbb{S}_{k_n+1}|}{\binom{n}{k_n+1}} \to 1 \quad (n \to \infty). \end{align*} \end{lemma} \begin{proof} It is easy to see that the exponent of $2$ in the bound \eqref{eq:bound_on_S_k+1} converges to minus infinity under the given conditions. \end{proof} \begin{remark} Condition~\eqref{eq:number_of_local_groups_condition} puts a rate constraint on the code. However, if $r_n$ grows faster to infinity than $\varrho_n$, the following argument shows that we can choose arbitrary rates. We study the asymptotic behavior of $\binom{r_n+\varrho_n-1}{\xi_n}^{-\frac{1}{r_n+1}}$ for $r_n \in \omega(\varrho_n)$ (i.e., $r_n$ grows asymptotically strictly faster than $\varrho_n$): \begin{align*} \binom{r_n+\varrho_n-1}{\xi_n}^{-\frac{1}{r_n+1}} &= \frac{1}{\binom{r_n+\varrho_n-1}{\varrho_n-2}^{\frac{1}{r_n+1}}} \\ &\geq \frac{1}{\left(\frac{e(r_n+\varrho_n-1)}{\varrho_n-2}\right)^{\frac{\varrho_n-2}{r_n+1}}} \\ &=\frac{1}{\underbrace{e^{\frac{\varrho_n-2}{r_n+1}}}_{\to \, 1} \cdot \underbrace{\left(1+\frac{r_n+1}{\varrho_n-2}\right)^{\frac{\varrho_n-2}{r+1}}}_{\to \, 1} } \to 1. \end{align*} Note that we use that if $r_n$ grows faster than $\varrho_n$, at some point we have $\xi_n = \varrho_n-2$. \end{remark} \begin{remark} By a similar argument as above, Condition~\eqref{eq:rate_condition} in Lemma~\ref{lem:Partial_MDS_bound_S_k+1_asymptotical} can be replaced by \begin{equation*} \left(\frac{R_\mathsf{local}}{e}\right)^{\varrho-2} \approx \left(\frac{r+1}{e(r+\varrho-1)}\right)^{\varrho-2} > C_1 \frac{k+1}{n} \approx C_1 R_\mathsf{global} \end{equation*} \end{remark} Lemma~\ref{lem:Partial_MDS_bound_S_k+1_asymptotical} implies that under the given conditions, asymptotically almost any set of $k+1$ indices is in $\mathbb{S}_{k+1}$, and thus, almost any set of $t \leq n-k-1$ error positions is $(t+1)$-independent. \begin{remark} Since any cardinality-$k$ subset of $\mathbb{S}_{k+1}$ is an information set, Lemma~\ref{lem:Partial_MDS_bound_S_k+1_asymptotical} also implies that the codes satisfying Conditions \eqref{eq:rate_condition} and \eqref{eq:number_of_local_groups_condition}, and can correct almost all $n-k$ erasures asymptotically. This constitutes a generalization of the statement in \cite[Theorem~3]{tamo2016optimal}, which proves the special case $\varrho=2$. \end{remark} \subsection{Decoding PMDS Codes Beyond the Minimum Distance} Using Lemma~\ref{lem:Partial_MDS_bound_S_k+1_asymptotical}, we can state the following explicit class of PMDS codes correcting almost any error up to weight $n-k-1$. \begin{theorem}\label{thm:PMDS_family_correcting_n-k-1} Let $\{\mathcal{C}_n\}$ be a family of $[n,k_n,r_n,\varrho_n]$ PMDS LRC over a field $q_n$, where $q_n \to \infty$ for $n \to \infty$ and the parameters $r_n, \varrho_n$ fulfill conditions \eqref{eq:rate_condition} and \eqref{eq:number_of_local_groups_condition} of Lemma~\ref{lem:Partial_MDS_bound_S_k+1_asymptotical} for fixed constants $C_1,C_2>1$. Furthermore, let $\ell_n = n-k_n-1$. Then, the family $\{\mathcal{C}_n'\}$ of $[n,k_n,r_n,\varrho_n]$ codes over the fields of size $q_n^{\ell_n}$ obtained by interpreting the $\ell_n$-interleaved codes of $\mathcal{C}_n$ as linear codes over the large field $\mathbb{F}_{q_n^{\ell_n}}$, fulfill the following properties: \begin{itemize} \item the codes $\mathcal{C}_n'$ are PMDS, \item $\mathcal{C}_n'$ corrects up to $n-k_n-1$ errors with probability approaching $1$ for $n \to \infty$ (assuming uniformly distributed errors of given weight), and \item the decoding complexity is $O(n^3)$ operations over $\mathbb{F}_{q_n}$. \end{itemize} \end{theorem} \begin{proof} A (homogeneous) interleaved code is a linear code over the large field of the same parameters as the constituent code. Since puncturing the interleaved code corresponds to puncturing the constituent codes, the definition of PMDS codes directly implies that the interleaved code is also PMDS. For showing the correction capability, first note that interpreting elements of $\mathbb{F}_{q_n^{\ell_n}}$ as vectors in $\mathbb{F}_{q_n}^{\ell_n}$ gives a bijective mapping between all Hamming errors of weight $t$ in $\mathbb{F}_{q_n^{\ell_n}}^n$ and all burst errors in $\mathbb{F}_{q_n}^{\ell_n \times n}$ of weight $t$. We use Theorem~\ref{thm:MK_generalization}, Lemma~\ref{lem:Partial_MDS_bound_S_k+1_asymptotical}, and the fact that the fraction of $\ell_n \times t_n$ matrices over the field of size $q_n$ of rank $t_n$ is at least $1-\nicefrac{4}{q_n}$ for $q_n\geq 4$, cf.~\cite[Lemma~3.13]{Overbeck_Diss_InterleveadGab}. The probability that a random error pattern of weight $t<n-k$ cannot be corrected is therefore \begin{align*} &\mathrm{P}(\ve{E} \text{ cannot be corrected}) \\ &=\mathrm{P}\left(\mathcal{S} \not\subseteq \overline{\supp(\ve{E})} \, \forall \mathcal{S} \in \mathbb{S}_{k_n+1} \, \lor \, \rank_{\ensuremath{\mathbb{F}_q}}(\ve{E})<t_n \right) \\ &= \mathrm{P}\left(\mathcal{S} \not\subseteq \overline{\supp(\ve{E})} \, \forall \mathcal{S} \in \mathbb{S}_{k_n+1}\right) + \underbrace{\mathrm{P} \left(\rank_{\ensuremath{\mathbb{F}_q}}(\ve{E})<t_n \right)}_{< \, 4/q_n} \\ &< 1-\frac{|\mathbb{S}_{k_n+1}|}{\binom{n}{k_n+1}} + \frac{4}{q_n} \to 0 \quad (n \to \infty) \end{align*} since $q_n \to \infty$ for $n \to \infty$. As for the complexity, we apply the Metzner--Kapturowski algorithm on the received matrix in $\mathbb{F}_{q_n}^{\ell_n \times n}$, which runs in complexity $O(n^3)$ over the small field $\mathbb{F}_{q_n}$ since $\ell_n \leq n$. \end{proof} \begin{remark} If the assumption $q_n \to \infty$ for $n \to \infty$ in Theorem~\ref{thm:PMDS_family_correcting_n-k-1} is not fulfilled for a class of codes, this would disprove the MDS conjecture. \end{remark} In the following we give the overall field size $Q_n$ for some families of PMDS codes. \begin{corollary} Let the family $\{\mathcal{C}_n\}$ be a subset of the code class in \cite{tamo2016optimal}. Then, the field size is given by \begin{align*} \log Q_n &\in O\left( n^{2+\log(\log(n))}\log(n) \right). \end{align*} and the overall decoding complexity in bit operations is \begin{align*} O^\sim\!\left( n^{4+\log(\log(n))} \right), \end{align*} where $O^\sim$ neglects logarithmic terms in $n$. \end{corollary} \begin{proof} The field size of the codes in \cite{tamo2016optimal} is \begin{align*} q_n &\in O \left( \left( \frac{nr_n}{r_n+\varrho_n-1} \right)^{(r_n-1)r_n^{r_n+\varrho_n-1}k_n+1} \right) \\ &\subseteq O\left(n^{n [\log(n)]^{\log(n)}}\right) =O\left( e^{n^{1+\log(\log(n))}\log(n)} \right). \end{align*} Hence, we must choose an $\ell_n$-interleaved code of the above mentioned code, where $\ell_n=n-k_n-1$. Then, the overall field size is $Q_n = q^{\ell_n}$, i.e., \begin{equation*} \log Q \in O\left( n^{2+\log(\log(n))}\log(n) \right). \end{equation*} Using the bases described in \cite{couveignes2009elliptic}, field operations in $\mathbb{F}_{q_n}$ cost $O^\sim(\log(q_n))$ bit operations. Hence, the overall complexity is given by \begin{equation*} O^\sim\!\left( n^3 \log(q_n) \right) \subseteq O^\sim\!\left( n^{4+\log(\log(n))} \right). \qedhere \end{equation*} \end{proof} \begin{corollary} Let the family $\{\mathcal{C}_n\}$ be a subset of the code class in \cite{gabrys2018constructions}. Then, the field size is given by \begin{align*} \log Q_n &\in O \left( n^3 log(log(n)) \right). \end{align*} and the overall decoding complexity is $O^\sim(n^5)$ bit operations. \end{corollary} For the special case of $\varrho = 2$ the probability of successful decoding can be stated exactly. \begin{corollary} \label{col:PsucExact} The probability of successfully decoding $t$ errors in an $[n,k,r,\varrho=2]$ PMDS code is given by \begin{equation*} P_{\mathsf{suc}} = P\{\rank (E) = t\} -\frac{|\mathbb{S}_{k+1}|}{\binom{n}{k+1}} \ , \end{equation*} where, as shown in \cite[Proof of Theorem~3]{tamo2016optimal}, \begin{equation*} |\mathbb{S}_{k+1}| = \sum_{j=1}^{\left\lfloor \frac{k+1}{r+1} \right\rfloor} (-1)^{j-1}\binom{n/(r+1)}{j} \binom{n-j(r+1)}{k+1-j(r+1)} \end{equation*} and the fraction of full rank matrices $E \in \ensuremath{\mathbb{F}_q}^{\ell \times t}$ \cite{migler2004} is \begin{equation*} P\{\rank(E) = t\} = q^{-t \ell} \prod_{j=0}^{t-1} (q^\ell-q^j) \ . \end{equation*} \end{corollary} The following example shows that the success probability is reasonably close to $1$ even for small parameters. In Section~\ref{ssec:Pf_finite} we will explore the probability of failure in more detail. \begin{example} Consider the PMDS code as defined in \cite{tamo2016optimal} with parameters $[n=15,k=8,r=4,\varrho=2]$ over the field $\ensuremath{\mathbb{F}_q}$ with $q=16^{k+1} = 2^{36}$. The code is of distance $d=7$, fulfilling the bound (\ref{eq:boundDistanceLRC}) on the distance of an LRC. The unique decoding radius of this code is $t=\left\lfloor \frac{d-1}{2} \right\rfloor = 3$. Given a full rank error matrix, the decoder introduced in \cite{metzner1990general} guarantees decoding of up to $t=d-2=5$ errors. In the case of $t=n-k-1=6$ errors, the error matrix is of full rank with probability $>1-10^{-10}$ and Corollary~\ref{col:PsucExact} gives the probability of success as $P_{\mathsf{dec}} \approx \frac{125}{143}$. \end{example} \subsection{Failure Probability for Finite Parameters}\label{ssec:Pf_finite} In the last subsection, we have seen that there are families of PMDS codes for which the probability of successful decoding approaches $1$ for the code length going to infinity. Our central tool was to show that the relative number of $(t+1)$-independent sets among all cardinality-$t$ subsets of $\{1,\dots,n\}$ goes to $1$ for these code families. For this, we derived a lower bound on the relative number of these sets in Lemma~\ref{lem:Partial_MDS_bound_S_k+1}, which approaches $1$ for $n \to \infty$. However, for finite $n$, the bound is not necessarily tight and usually orders of magnitude away from the actual probability for $d-2 < t < n-k-1$ (recall that the Metzner--Kapturowski algorithm always works for $t \leq d-2$). In the following, we show how to efficiently compute the exact probability of drawing a $(t+1)$-independent set for finite parameters. The algorithm uses dynamic programming to efficiently compute the expression in the following theorem recursively. The resulting complexity in bit operations is cubic in the code length and linear in the number of errors. \begin{theorem}\label{thm:exact_failure_prob} Let $n$, $k$, $t$, $r$, $\varrho$, $n_l = r+\varrho-1$, $\mu = n/(r+\varrho-1)$ (number of local repair sets) be given. For $\eta\geq 1$, $\tau \geq 0$, $\sigma \geq 0$, $\beta \in \{0,1\}$ define \begin{align} \mathcal{W}(\eta,\tau,\sigma,\beta)\! &\coloneqq \! \left\{\! \ve{\omega}\! \in \! \{0,\dots,n_l\}^\eta : \sum_{i} \omega_i = \tau, \, \sigma + \sum_{i=1}^{\eta} \max\{0,\omega_i-r\} \!> \!\begin{cases} n-k-t-1, &\text{if $\beta=1$ or $\exists \, i$ : $0 < \omega_i \leq r$,} \\ n-k-t, &\text{else.} \end{cases} \right\}, \notag\\ \mathsf{W}(\eta,\tau,\sigma,\beta)\! &\coloneqq \! \sum_{\ve{\omega} \in \mathcal{W}(\eta,\tau,\sigma,\beta)} \prod_{i=1}^{\eta} \binom{n_l}{\omega_i}. \label{eq:W_value} \end{align} For an error set $\mathcal{E}$ that is chosen uniformly at random from the cardinality-$t$ subsets of $\{1,\dots,n\}$, the probability that it is not $(t+1)$-independent is \begin{align} \Pr\left( \mathcal{E} \text{ is \textbf{not} $(t+1)$-independent} \right) = \frac{\mathsf{W}(\mu,n-t,0,0)}{\binom{n}{t}}. \label{eq:exact_failure_probability} \end{align} \end{theorem} \begin{proof} The elements $\ve{\omega} \in \mathcal{W}(\mu,n-t,0,0)$ correspond exactly to all distributions of the error-free positions to the local repair sets such that the set $\mathcal{E}$ is not $(t+1)$-independent (cf.~Lemma~\ref{lem:t+1-independent_criterion}). Thus, we just need to count how many errors with this distribution there are, which is given by the product $\prod_{i=1}^{\mu} \binom{r+\varrho-1}{\omega_i}$. The statement follows directly by the fact that $\mathcal{E}$ is uniformly distributed. \end{proof} It is not immediately obvious why Theorem~\ref{thm:exact_failure_prob} is formulated in such a complicated way, i.e., why we define $\mathsf{W}(\eta,\tau,\sigma,\beta)$ with four parameters and then use it only for $[\eta,\tau,\sigma,\beta] = [\mu,n-t,0,0]$. The reason is that we can efficiently recursively compute $\mathsf{W}(\mu,n-t,0,0)$ using the general definition of $\mathsf{W}(\eta,\tau,\sigma,\beta)$ as follows. \begin{lemma}\label{lem:W_recursion} Let $n$, $k$, $t$, $r$, $\varrho$, $n_l = r+\varrho-1$, $\mu = n/(r+\varrho-1)$ be given. Furthermore, let $\mathsf{W}(\eta,\tau,\sigma,\beta)$ be defined as in Theorem~\ref{thm:exact_failure_prob} for $\eta\geq 1$, $\tau \geq 0$, $\sigma \geq 0$, $\beta \in \{0,1\}$. For $\eta >1$, we have the recursion \begin{align} \mathsf{W}(\eta,\tau,\sigma,\beta) &= \sum_{\omega_1=0}^{\min\{\tau,n_l\}} \binom{n_l}{\omega_1} \mathsf{W}\big(\eta-1,\tau-w_1,\sigma+\max\{0,\omega_1-r\},\beta'(\beta,\omega_1)\big), \label{eq:W_eta>1_recursion} \end{align} and for $\eta=1$, we have \begin{align} \mathsf{W}(1,\tau,\sigma,\beta) = \begin{cases} \tbinom{n_l}{\tau}, &\text{if } \tau\leq n_l \quad \land \quad \sigma+\max\{0,\tau-r\} > n-k-t-\beta'(\beta,\tau), \\ 0, &\text{else.} \end{cases}\label{eq:W_eta=1_recursion} \end{align} where \begin{align*} \beta'(\beta,\omega_1) &= \begin{cases} 1, &\text{if } \beta=1 \, \lor 0<\omega_1 \leq r, \\ 0, &\text{else.} \end{cases} \end{align*} \end{lemma} \begin{proof} We start with the recursion \eqref{eq:W_eta>1_recursion}. Note that by definition of $\mathcal{W}$, we have \begin{align*} \mathcal{W}(\eta,\tau,\sigma,\beta) &= \bigcup_{\omega_1=0}^{\min\{\tau,n_l\}} \Big\{[\omega_1,\omega_2,\dots,\omega_\eta] \, : \, [\omega_2,\dots,\omega_\eta] \in \mathcal{W}(\eta-1,\tau-w_1,\sigma+\max\{0,\omega_1-r\},\beta'(\beta,\omega_1))\Big\}. \end{align*} This is clear since for a fixed $\omega_1$, we have $\sum_i \omega_i = \tau$ if and only if $\sum_{i=2}^{\eta} \omega_i = \tau-\omega_1$ and we have \begin{equation*} \sigma + \sum_{i=1}^{\eta} \max\{0,\omega_i-r\} \!> \!\begin{cases} n-k-t-1, &\text{if $\beta=1$ or $\exists \, i$ : $0 < \omega_i \leq r$,} \\ n-k-t, &\text{else.} \end{cases} \end{equation*} if and only if (note that ``$\beta=1$ or $0 < \omega_1 \leq r$'' iff ``$\beta'(\beta,\omega_1)=1$'') \begin{equation*} \big(\sigma + \max\{0,\omega_i-r\}\big) +\sum_{i=2}^{\eta} \max\{0,\omega_i-r\} > \begin{cases} n-k-t-1, &\text{if ($\beta=1$ or $0 < \omega_1 \leq r$) or $\exists \, i>1$ : $0 < \omega_i \leq r$,} \\ n-k-t, &\text{else.} \end{cases} \end{equation*} Hence, for $\eta>1$, we have \begin{align*} \mathsf{W}(\eta,\tau,\sigma,\beta) &= \sum_{\omega_1=0}^{\min\{\tau,n_l\}} \binom{n_l}{\omega_1} \underbrace{\sum_{\ve{\omega}' \in \mathcal{W}\big(\eta-1,\tau-w_1,\sigma+\max\{0,\omega_1-r\},\beta'(\beta,\omega_1)\big)} \prod_{i=1}^{\eta-1} \binom{n_l}{\omega_i'}}_{= \mathsf{W}\big(\eta-1,\tau-w_1,\sigma+\max\{0,\omega_1-r\},\beta'(\beta,\omega_1)\big)}. \end{align*} For $\eta=1$, we have \begin{align*} \mathcal{W}(1,\tau,\sigma,\beta) = \begin{cases} \Big\{[\tau]\Big\}, &\text{if } \tau\leq n_l \quad \land \quad \sigma+\max\{0,\tau-r\} > n-k-t-\beta'(\beta,\tau), \\ \emptyset, &\text{else.} \end{cases} \end{align*} The claim follows immediately by definition of $\mathsf{W}$. \end{proof} Lemma~\ref{lem:W_recursion} implies an algorithm for computing $\mathsf{W}$ recursively. If implemented naively, one could obtain an algorithm that calls itself up to roughly $n_l^{\mu}$ times as in each recursive step, we call for up to $n_l+1$ values of $w_1$ the algorithm recursively, with recursion depth at most $\mu-1$. In this naive approach, the algorithm would call itself often for the same parameters. Hence, we can turn it into a dynamic programming routine by memoizing already computed values of $\mathsf{W}(\eta,\tau,\sigma,\beta)$ in a table. We outline this approach in Algorithm~\ref{alg:W_computation}. Algorithm~\ref{alg:Pf_computation} computes the probability in \eqref{eq:exact_failure_probability} using this recursive algorithm and we bound its complexity in Theorem~\ref{thm:Pf_alg_correctness_complexity} below. \printalgoIEEE{ \DontPrintSemicolon \KwIn{ \begin{itemize} \item Integers $\eta \geq 0$, $\tau \geq 0$, $\sigma \geq 0$, $\beta \in \{0,1\}$. \item Global parameters $n$, $k$, $t$, $r$, $\varrho$, $n_l = r+\varrho-1$, $\mu = n/(r+\varrho-1)$. \\ \item Global integer table $\{\mathsf{T}(\eta,\tau,\sigma,\beta)\}_{\eta \geq 0, \tau \geq 0, \sigma \geq 0, \beta \in \{0,1\}}$ with $\mathsf{T}(\eta,\tau,\sigma,\beta)=\mathsf{W}(\eta,\tau,\sigma,\beta)$ if $\mathsf{W}(\eta,\tau,\sigma,\beta)$ has already been computed and $\mathsf{T}(\eta,\tau,\sigma,\beta)=-1$ otherwise. \end{itemize}} \KwOut{Integer $\mathsf{W}(\eta,\tau,\sigma,\beta)$ as in \eqref{eq:W_value}.} \If{$\mathsf{T}(\eta,\tau,\sigma,\beta) \neq -1$}{ \Return{$\mathsf{T}(\eta,\tau,\sigma,\beta)$} } \Else{ \If{$\eta=1$ \label{line:W_comp_start}}{ \If{$\beta=1$ or $0<\tau \leq r$}{ $\beta' \gets 1$ } \Else{ $\beta' \gets 0$ } \If{$\tau \leq n_l$ and $\sigma+\max\{0,\tau-r\} > n-k-t-\beta'$}{ $\mathrm{res} \gets \tbinom{n_l}{\tau}$ } \Else{ $\mathrm{res} \gets 0$ } } \Else{ $\mathrm{res} \gets 0$ \\ \For{$w_1=0,\dots,\min\{\tau,n_l\}$}{ \If{$\beta=1$ or $0<\omega_1 \leq r$}{ $\beta' \gets 1$ } \Else{ $\beta' \gets 0$ } $\mathrm{res} = \mathrm{res} + \tbinom{n_l}{\omega_1} \mathsf{W}\big(\eta-1,\tau-w_1,\sigma+\max\{0,\omega_1-r\},\beta'\big)$ \\ } } $\mathsf{T}(\eta,\tau,\sigma,\beta) \gets \mathrm{res}$ \\ \Return{$\mathrm{res}$ \label{line:W_comp_stop}} } \caption{$\mathsf{W}(\eta,\tau,\sigma,\beta)$} \label{alg:W_computation} } \printalgoIEEE{ \DontPrintSemicolon \KwIn{Global parameters $n$, $k$, $0\leq t\leq n$, $r$, $\varrho$, $n_l = r+\varrho-1$, $\mu = n/(r+\varrho-1)$} \KwOut{Probability $\Pr\left( \mathcal{E} \text{ is \textbf{not} $(t+1)$-independent} \right)$ for $\mathcal{E}$ chosen uniformly at random from the subsets of $\{1,\dots,n\}$ of cardinality $t$} $\{\mathsf{T}(\eta,\tau,\sigma,\beta)\}_{1 \leq \eta \leq \mu, \, 0 \leq \tau \leq n-t, \, 0 \leq \sigma \leq (\mu-1)(\varrho-1), \, 0 \leq \beta\leq 1} \gets $ global integer table filled with $-1$ initially \\ \Return{$\frac{\mathsf{W}(\mu,n-t,0,0)}{\binom{n}{t}}$} \caption{Compute Probability $\Pr\left( \mathcal{E} \text{ is \textbf{not} $(t+1)$-independent} \right)$} \label{alg:Pf_computation} } \begin{theorem}\label{thm:Pf_alg_correctness_complexity} Algorithm~\ref{alg:Pf_computation} is correct and can be implemented with complexity \begin{align*} O^\sim\!\left( n^3 t \right) \end{align*} in bit operations, where $O^\sim$ is the ``soft-O'' notation, i.e., it neglects logarithmic factors in $n$ and $t$. \end{theorem} \begin{proof} Correctness of the algorithm immediately follows from Lemma~\ref{lem:W_recursion}. For the complexity, we need to analyze how often Lines~\ref{line:W_comp_start}--\ref{line:W_comp_stop} of Algorithm~\ref{alg:W_computation} are called. This corresponds to exactly the number of entries of the table $\{\mathsf{T}(\eta,\tau,\sigma,\beta)\}$ that need to be computed. Our claim is that we compute at most the entries with indices $1 \leq \eta \leq \mu$, $0 \leq \tau \leq n-t$, $0 \leq \sigma \leq (\mu-1)(\varrho-1)$, and $0 \leq \beta\leq 1$, i.e., in total at most \begin{align*} 2\mu(n-t+1)\big[(\mu-1)(\varrho-1)+1\big] \leq 2\mu^2 \varrho n \end{align*} table entries. This is clear for $\eta$ and $\tau$, since they are $\mu$ and $n-t$ initially, and during the recursion, their value is never increased and never drops below $1$ and $0$, respectively. Also $\beta$ is either $0$ or $1$ in each function call. For $\sigma$, we see that in each recursion, its value is increased by at most $\max\{0,w_1-r\} \leq r+\varrho-1-r = \varrho-1$. As the maximal recursion depth is $\mu-1$, we get the claimed upper bound. In each function call, we perform at most $n_l$ integer additions and multiplications (assuming a negligible pre-computation of all the binomial coefficients $\tbinom{n_l}{0},\dots,\tbinom{n_l}{\lfloor n_l/2\rfloor}$). The cost (in bit operations) of each such operation is quasi-linear in the maximal bit size of the involved integers, cf.~\cite{harvey2019faster}. We can, very roughly, upper-bound the size of the integers by \begin{align*} \leq \tbinom{n}{t} \leq n^t \leq 2^{t \log_2(n)}. \end{align*} Hence, the overall complexity is in $O^\sim\!\left( \mu^2 \varrho n n_l t \right) \subseteq O^\sim\!\left( n^3 t\right)$. \end{proof} \begin{remark} In practice, Algorithm~\ref{alg:Pf_computation} often only needs to compute a small fraction of the table entries. This means that the implemented top-down approach of dynamic programming (also called memoization) is typically faster than a bottom-up approach (i.e., computing the entire table iteratively for $\eta=1,\dots,\mu$). Furthermore, the upper bound on the integer bit size in the proof of Theorem~\ref{thm:Pf_alg_correctness_complexity} is for most (or all) multiplications orders of magnitude away from the actual bit size. Hence, Algorithm~\ref{alg:Pf_computation} is in practice much faster than the upper complexity bound in Theorem~\ref{thm:Pf_alg_correctness_complexity} suggests. \end{remark} The following examples are computed with Algorithm~\ref{alg:Pf_computation}. \begin{example} We consider three example PMDS codes and compute the probability $\Pr\left( \mathcal{E} \text{ is \textbf{not} $(t+1)$-independent} \right)$ using Algorithm~\ref{alg:Pf_computation} for several values of $t$ for $d-1 \leq t \leq n-k-1$. Recall that for $t=d-2$, this probability is always $0$ and $t=n-k-1$ is the largest integer for which the probability is less than $1$. \textbf{Parameter Set 1:} $n=45$, $k=16$ (rate $\approx 0.36$), $r=8$, $\varrho=8$ (local rate $\approx 0.53$, $\mu=3$ local repair sets). \begin{center} \begin{tabular}{l|l} $t$ & $\Pr\left( \mathcal{E} \text{ is \textbf{not} $(t+1)$-independent} \right)$ \\ \hline $>28$ & $1$ \\ $28 = n-k-1$ & $9.87 \cdot 10^{-2}$ \\ $27$ & $3.61\cdot 10^{-2}$ \\ $26$ & $1.10\cdot 10^{-2}$ \\ $25$ & $2.73\cdot 10^{-3}$ \\ $24$ & $5.13\cdot 10^{-4}$ \\ $23$ & $6.55\cdot 10^{-5}$ \\ $22 = d-1$ & $4.27\cdot 10^{-6}$ \\ $<22$ & $0$ \end{tabular} \end{center} We see that already for a few errors below the maximal radius $n-k-1$, the probability that the error positions are $(t+1)$-independent is relatively close to $1$, even for such a short code ($n=45$). \textbf{Parameter Set 2:} $n=70$, $k=24$ (rate $\approx 0.34$), $r=8$, $\varrho=3$ (local rate $0.8$, $\mu=7$ local repair sets). \begin{center} \begin{tabular}{l|l} $t$ & $\Pr\left( \mathcal{E} \text{ is \textbf{not} $(t+1)$-independent} \right)$ \\ \hline $>45$ & $1$ \\ $45 = n-k-1$ & $1.68 \cdot 10^{-3}$ \\ $44$ & $9.38\cdot 10^{-5}$ \\ $43$ & $1.25\cdot 10^{-8}$ \\ $42 = d-1$ & $4.03 \cdot 10^{-10}$ \\ $<42$ & $0$ \end{tabular} \end{center} For $t=45$, the failure probability bound in \eqref{eq:P_t=n-k-1_union_bound_step} (i.e., after the union bound step) gives $\leq 1.68\cdot 10^{-3}$ and differs from the exact value only from the fifth digit on. \textbf{Parameter Set 3:} $n=196$, $k=156$ (rate $\approx 0.80$), $r=26$, $\varrho=3$ (local rate $\approx 0.93$, $\mu=7$ local repair sets). \begin{center} \begin{tabular}{l|l} $t$ & $\Pr\left( \mathcal{E} \text{ is \textbf{not} $(t+1)$-independent} \right)$ \\ \hline $>39$ & $1$ \\ $39 = n-k-1$ & $7.62\cdot 10^{-2}$ \\ $38$ & $1.11 \cdot 10^{-2}$ \\ $37$ & $3.49 \cdot 10^{-4}$ \\ $36$ & $2.71 \cdot 10^{-5}$ \\ $35$ & $2.76 \cdot 10^{-7}$\\ $34$ & $1.50 \cdot 10^{-8}$\\ $33$ & $2.13 \cdot 10^{-11}$\\ $32$ & $9.31 \cdot 10^{-13}$\\ $31$ & $1.73 \cdot 10^{-17}$\\ $30 = d-1$ & $6.56 \cdot 10^{-19}$\\ $<30$ & $0$ \end{tabular} \end{center} For $t=39$, the failure probability bound in \eqref{eq:P_t=n-k-1_union_bound_step} gives $\leq 7.71 \cdot 10^{-2}$ and differs from the exact value on the second digit. \end{example} \section{Conclusion} \label{sec:conclusion} In this work we derived a new list-decoding radius for locally repairable codes and gave an explicit algorithm that achieves it. The complexity and the list size are polynomial in the code length $n$ when considering scaling that preserves the number of local repair sets. The asymptotic behavior has been analyzed and a simple probabilistic unique decoder has been introduced. Further, we considered interleaved decoding of LRCs and PMDS codes, showing that it increases the error tolerance of a storage system. We combined the approach used for increasing the list-decoding radius for improving the decoding radius of LRCs by local decoding with an interleaved decoder. Further, we proved that the decoding radius of interleaved PMDS codes can be increased by the Metzner-Kapturowski decoder \cite{metzner1990general} beyond their minimum distance, with probability of successful decoding going to $1$ as the code length goes to infinity. As future work, the list decoding algorithm and bound on the list size given in Section~\ref{sec:listDecoding} should be further studied with the goal to reduce the worst-case list size/complexity (cf. \emph{1)} in Remark~\ref{rem:list_size_bound_not_tight}). Moving from list decoding to probabilistic decoding, an interesting problem is the analysis and algorithmic exploitation of intrinsic side information, e.g., obtained from the local list size or from the distance of local codewords to the received word, to improve the success probability of probabilistic unique decoding (cf. \emph{2)} in Remark~\ref{rem:list_size_bound_not_tight}). Further, list decoding by combining the local lists through list recovery, similar to the approach taken in \cite{zeh2016improved}, is a promising extension. Another open problem is the application of results from Section~\ref{sec:PMDS} to PMDS codes under a weaker definition, as considered in \cite{calis2016general}. Finally, we present in Figure~\ref{fig:rate_tuples} an illustration of tuples of global and local rate for which the new decoders are ``suitable'' (exact definition: see figure caption). It can be seen that for the majority of code parameters, at least one of the decoders is ``suitable''. \begin{figure} \begin{center} \input{rate_regions_improvements} \end{center} \caption{Rate tuples for which the new list decoder of Section~\ref{sec:listDecoding} can correct more errors than the Johnson radius (event $\mathcal{L}$) and for which the new PMDS decoder of Section~\ref{sec:PMDS} can decode up to $n-k-1$ errors with probability at least $0.9$ (event $\mathcal{P}$). Legend (\# of points): \textcolor{red}{$\mathcal{L} \land \neg \mathcal{P}$ (25986)}, \textcolor{mygreen}{$\mathcal{L} \land \mathcal{P}$ (2299)}, \textcolor{blue}{$\neg \mathcal{L} \land \mathcal{P}$ (9806)}, \textcolor{black}{$\neg \mathcal{L} \land \neg \mathcal{P}$ (3922)}. The points show all rate pairs achievable for optimal LRCs with $r \mid k$ and $(r+\varrho-1) \mid n$ for $100 \leq n \leq 200$. For clarity the plot does not show a point for every set of valid parameters, but instead we divide the plane into squares and a point is colored \textcolor{red}{red} or \textcolor{blue}{blue} if all parameter sets within the square give the respective improvement. We color the point \textcolor{mygreen}{green} if both improvements apply within a square and at least one of the improvements applies to every set of parameters within the square.} \label{fig:rate_tuples} \end{figure} \vspace{4pt} \bibliographystyle{IEEEtran}
\section{Introduction} Over the last two decades, a large variety of exoplanetary systems has been discovered, primarily through photometric transit and radial velocity observations \citep[e.g.][]{P2018}. Among these systems, several populations of exoplanets orbit very close to their host stars (with orbital periods of a few days), such as hot-Jupiters, super-Earths, and mini-Neptunes \citep{MQ1997,S2014}. In these short period systems as well as in tight binary stars, tides induced by each other's body drive the rotational and orbital evolutions of the system through dissipation mechanisms \citep[the so-called tidal dissipation, see e.g.][]{Z1977,H1980,ZB1989,GN1989,WS2002}. Usually, tides are split into two components following the work of \cite{Z1966a,Z1966b,Z1966c,Z1975,Z1977}. First, the equilibrium tide is the quasi-hydrostatic response of the main body to tidal perturbations induced by the companion. It is materialised by a large-scale deformation in the perturbed body, that is displayed as a near-equatorial tidal bulge in the direction of the companion. In addition, waves are excited in its interior as the equilibrium tide is not an exact solution to the equations of motion, providing an additional driving force \citep{O2014}. The tidally-forced waves correspond to the dynamical tides. The convective zone (CZ) of a perturbed rotating body is the seat of inertial waves that get dissipated by turbulent friction \citep[e.g.][]{OL2004,OL2007}, while the radiative zone supports gravito-inertial waves which are dissipated by thermal damping and turbulent friction \citep[e.g.][]{Z1975, TP1998,GD1998,BO2010}. The dissipation of the dynamical tides in the CZ is very efficient in young stars (pre-main sequence and early main sequence) whereas for older stars the dissipation of the equilibrium tide dominates mainly because of the slower stellar rotation, as demonstrated for instance by \cite{BM2016} \citep[see also ][]{SB2017,G2017,BM2018}. The efficiency of the tidal excitation and viscous dissipation of inertial and gravito-inertial waves can be measured with the tidal quality factor $Q$. This quantity reflects the fact that the perturbed body undergoes a forced oscillation and dissipates a fraction of the associated energy during each oscillation period. It has been evaluated by \citet{OL2004,OL2007}, with and without differential rotation \cite[see also][for this particular topic]{G2016a,G2016b}, in the case of giant planets and solar-type stars. Recently, \cite{M2015} and \cite{G2017} explored the influence of mass, age and rotation based on the frequency-averaged dissipation estimates of \cite{O2013} to understand the behaviour of tidal dissipation along the evolution of stars. They emphasised that the variation of these parameters could drastically modify the strength of tidal dissipation with a higher frequency-averaged tidal dissipation for low-mass stars. Similarly, \cite{BG2017} highlighted the importance of the stellar metallicity. Within this context, the variations of tidal dissipation along stellar evolution have a strong impact on the orbital architecture of compact planetary systems and the planet survival \citep{BM2016,BR2019}. In the aforementioned studies of star-planet tidal interactions, an important ingredient is missing though: stellar magnetism. In the Sun and solar-like stars, magnetism is revealed by external magnetic features such as sunspots, prominences or flares \citep{DL2009}. The magnetic fields of solar-like stars originates from a powerful dynamo mechanism, sustained by turbulent convection and differential rotation in the convective envelope of the star \citep{BB2017}. Recent endeavours have been carried out to assess the effects of magnetism on tidally-excited inertial waves in stars \citep{W2016,W2018,LO2018}. In the presence of a magnetic field, tidal waves excited in the CZ become magneto-inertial waves. Moreover, they feel the magnetic tension of the large-scale magnetic field which affects their propagation and dissipation \citep{F2008}. These magnetically modified inertial waves have a broader range of propagation frequencies, compared to the hydrodynamical case, and can be dissipated through both viscous and Ohmic processes. Specifically, the transition between hydrodynamical and magneto-hydrodynamical (MHD) regimes have been explored in a shearing box model with a uniform magnetic field \citep{W2016} and in spherical geometry with both a uniform field directed along the z-axis and a dipolar magnetic field \citep{LO2018}. The authors of these studies both stressed that the Lehnert number $\mathrm{Le}$ \citep{L1954} determines how important magnetism is to tidal dissipation. This dimensionless number compares the Alfvén velocity to the rotation speed of the body. Additionally, how magnetism influences the effective tidal force to excite magneto-inertial waves remains to be addressed, as mentioned in \citet[Appendix B]{LO2018}. In practice, given the equation of motion tidal waves are excited by an effective body force driven by the Coriolis acceleration of the equilibrium tidal flow in the non-magnetized case \citep{O2005}. In the presence of a magnetic field, the Lorentz force acting on the equilibrium tide is likely to play a role in the excitation of tidal waves. Thus, this motivates the study of the impact of stellar magnetism on both dissipation and excitation of dynamical tides inside the CZ and along the evolution of low-mass stars. The paper is organised as follows. In Section \ref{sec21} we work out the contribution of magnetism to tidal forcing and derive a criterion to assess its importance relative to non-magnetized forces. This criterion features the Lehnert number and thus the magnetic field and the rotation speed of the body, as well as the tidal forcing frequency. Simple scaling laws are applied in Sect. \ref{sec22} to estimate the dynamo-driven magnetic field in the convective envelope of low-mass stars. Thanks to the stellar evolution code STAREVOL \citep[Sect. \ref{sec23}, see also][and references therein]{AP2019}, the strength of a mean magnetic field is given, in Sect. (\ref{sec24}), at the base and top of the CZ for various low-mass stars. Thus, we evaluate in Sect. \ref{sec25} the Lehnert number as a function of age, mass, initial rotation, and radius in the CZ of these stars. We then estimate in Sect. \ref{sec26} the Lehnert number along with the rotation and tidal frequencies in several observed short-period exoplanetary systems to assess the importance of the star's magnetic field on the tidal forcing. Based on our estimates of the Lehnert number, we compare in Sect. \ref{sec3} the relative importance of Ohmic over viscous dissipations of tidally induced magneto-inertial waves throughout the evolution of low-mass stars. In Sect. \ref{sec4}, we examine how small-scale magnetic fields impact tidal forcing. Finally, we present in Sect. \ref{sec_conclu} the conclusions and perspectives of this work. \section{The Lorentz force influence on tidal forcing} The purpose of this section is to quantify the contribution of the stellar magnetic field to the tidal excitation of magneto-inertial waves in the CZ of low-mass stars. \subsection{A criterion to settle the importance of magnetism} \label{sec21} We aim for an approach as general as possible, yet we restrict our model adopting a solid-body rotation with an angular frequency $\Omega$. In particular, we do not assume a specific geometry for the magnetic field. We linearise the momentum and induction equations to derive the magnitude of the magnetic tidal forcing (the effective tidal force arising from the Lorentz force) and compare it with the classical hydrodynamical tidal forcing. We introduce the self-gravitational potential $\Phi_0$, as well as the gravitational potential perturbation $\Phi$, and the external tidal potential $\Psi$ \citep[see e.g.][]{Z1966a,O2013}. The continuity and entropy equations are as given in Zahn's paper, with the addition of Ohmic heating to the entropy equation. The momentum equation for tidal perturbations in the co-rotating frame can be written as: \begin{equation} \begin{aligned} \rho_0(\partial_t{\bf u}+2\boldsymbol\Omega\times{\bf u})=&-{\boldsymbol\nabla} p+\rho_0{\boldsymbol\nabla}(\Phi+\Psi)+\rho{\boldsymbol\nabla}\Phi_0+{\bf F}_\mathrm{\nu}+{\bf F}_\mathrm{L}, \end{aligned} \label{eq0} \end{equation} where $\rho_0$ is the mean density and ${\bf u}$, $p$, and $\rho$ are the perturbed velocity, pressure, and density, respectively. We include the volumetric viscous force ${\bf F}_\nu=\rho_0\nu{\boldsymbol\nabla^2}{\bf u}$, which represents the effective action of turbulent convection on tidal flows with $\nu$ the effective so-called eddy-viscosity \citep[e.g.][]{Z1966b, Z1989, OL2012, MA2016} which we assume to be constant in the CZ. Moreover, \[ {\bf F}_\mathrm{L}=\frac{{\boldsymbol\nabla}\times{\bf B}_0}{\mu_0}\times{\bf b}+\frac{{\boldsymbol\nabla}\times{\bf b}}{\mu_0}\times{\bf B}_0 \] is the linearised Lorentz force, where ${\bf B}_0$ and ${\bf b}$ are the large-scale and perturbed magnetic fields, respectively. Note also that we have no background flow (${\bf u}_0=\bf 0$) as we work in the rotating frame, the action of the convective flows is parametrized as a diffusion, and any differential rotation and associated meridional flows are neglected. Furthermore, the linearised induction equation is: \begin{equation} \partial_t{\bf b}={\boldsymbol\nabla}\times({\bf u}\times{\bf B}_0)+\eta{\boldsymbol\nabla^2}{\bf b}, \label{ind} \end{equation} with $\eta$ the magnetic turbulent diffusivity, related to the eddy-viscosity by the relationship $\eta=\nu/\mathrm{Pm}$, where $\mathrm{Pm}$ is the turbulent magnetic Prandtl number often chosen close to unity \citep[e.g.][]{CT1992,JJ2013,KR2019}. Following \cite{O2005,O2013}, we decompose all physical perturbed quantities $X$ into a non-wave like part associated with the equilibrium tide denoted as $X_\mathrm{e}$, and a wave-like part $X_\mathrm{d}$ related to the dynamical tides. The equilibrium tidal flow ${\bf u}_\mathrm{e}$ is defined as the velocity resulting from the hydrostatic adjustment of the primary due to the perturbation induced by the companion in the rotating frame of the tidal bulge. This frame rotates at the corresponding tidal frequency $n \Omega_\mathrm{o}/2$ \citep[see][]{RM2012}, where $n$ labels the temporal harmonic of the orbital motion of the perturber (when projecting the tidal potential on the spherical harmonics basis) and $\Omega_\mathrm{o}$ is the associated orbital frequency. In the adiabatic case, this hydrostatic equilibrium leads to \citep{Z1966a}: \begin{equation} -{\boldsymbol\nabla} p_\mathrm{e}+\rho_0{\boldsymbol\nabla}(\Phi_\mathrm{e}+\Psi)+\rho_\mathrm{e}{\boldsymbol\nabla}\Phi_0=0. \label{eq0bis} \end{equation} This equation comes from Eq. (\ref{eq0}) without the left hand side and dissipative terms. As a first step, we also neglect the deformation of the stellar structure induced by rotation and magnetic field. In the case of magnetic fields this is a reasonable assumption except in the low density region near the stellar surface \citep{DM2010}. For the centrifugal acceleration, this is a fair hypothesis for slow and median rotators while potentially strong deformation should be taken into account for young rapid rotators \citep[see e.g.][Fig. 7]{GB2013}. We split the equation of induction in the co-rotating frame, accounting for the equilibrium and dynamical tides decomposition: \begin{subnumcases}{} {\bf b}_\mathrm{e}={\boldsymbol\nabla}\times(\boldsymbol\xi_\mathrm{e}\times{\bf B}_0) \label{eq01a} \\ \partial_t{\bf b}_\mathrm{d}={\boldsymbol\nabla}\times({\bf u}_\mathrm{d} \times{\bf B}_0)+\eta{\boldsymbol\nabla^2}{\bf b}_\mathrm{d}\label{eq01b}\ , \end{subnumcases} where $\boldsymbol\xi_\mathrm{e}$ is the equilibrium tide displacement, defined by ${\bf u}_\mathrm{e}=\partial_t\boldsymbol\xi_\mathrm{e}$, given a mean static magnetic field ${\bf B}_0$. We also introduce $\bf u_\mathrm{d}$, the perturbed flow of the dynamical tide. We assume here that ${\bf B}_0$ does not vary over the tidal timescale which is a few days. This is corroborated by the fact that the large-scale magnetic field varies very little (far below one order of magnitude) within several years for the majority of observed stars \citep{VG2014}. Moreover, we choose to define the magnetic field associated with the equilibrium tide as the field it induces by the advection of ${\bf B}_0$. We neglect the Ohmic diffusion acting on the equilibrium tide because its time scale $R^2/\eta$, where $R$ is the radius of the star which is also the length of variation of this flow, is much larger than its typical time of variation (in the range of a few days for Hot Jupiter), even when considering a turbulent magnetic diffusivity. One can not do the same assumption for dynamical tides since they involve potentially smaller length scales, for example along waves' attractors. The equation of induction for dynamical tides (Eq. (\ref{eq01b})) follows from this definition when writing the equation of induction for the sum of the equilibrium and dynamical tide perturbations (Eq. (\ref{ind})) since it is a linear equation. In the momentum equation, we use the Cowling approximation \citep{C1941} for the dynamical tides i.e. we neglect their perturbed gravitational potential $\Phi_\mathrm{d}$. In addition, as our model applies to a convective region (i.e. adiabatically stratified), the term $\rho_\mathrm{d}{\boldsymbol\nabla}\Phi_0$ is neglected because it is related to the buoyancy force associated with gravity waves. Using Eq. (\ref{eq0bis}), the momentum equation for tidally-forced magneto-inertial waves becomes: \begin{equation} \rho_0(\partial_t{\bf u}_\mathrm{d}+2\boldsymbol\Omega\times{\bf u}_\mathrm{d})+{\boldsymbol\nabla} p_\mathrm{d}-{\bf F}_\nu({\bf u}_\mathrm{d})-{\bf F}_\mathrm{L}({\bf b}_\mathrm{d})=f({\bf u}_\mathrm{e}), \label{de_eq} \end{equation} where the wave-like part encompassing the propagation of tidal waves (on the left hand side of the equation), is excited by an effective force driven by the equilibrium tidal flow (on the right hand side). This force can be written as: \begin{equation*} \begin{aligned} f({\bf u}_\mathrm{e})=&\underbrace{-\rho_0(\partial_t{\bf u}_\mathrm{e}+2\boldsymbol\Omega\times{\bf u}_\mathrm{e}}_{\fh})+\\ &\underbrace{\frac{{\boldsymbol\nabla}\times{\bf B}_0}{\mu_0}\times\left[{\boldsymbol\nabla}\times(\boldsymbol\xi_\mathrm{e}\times{\bf B}_0)\right]+\frac{{\boldsymbol\nabla}\times\left[{\boldsymbol\nabla}\times(\boldsymbol\xi_\mathrm{e}\times{\bf B}_0)\right]}{\mu_0}\times{\bf B}_0}_{\fm}. \end{aligned} \end{equation*} It is worth noting that the action of turbulent friction on the hydrostatic flow has been neglected for the same reasons we ignored the ohmic diffusion in Eq. (\ref{eq01a}). The term $\fh$ comprises the driving inertial force and the Coriolis acceleration \citep[see the Appendix B in][]{O2005} while $\fm$ embodies the action of the Lorentz force on the hydrostatic displacement and has been derived by \citet[see Appendix B]{LO2018}. These authors studied the propagation and dissipation of magneto-inertial waves excited by the effective forcing induced solely by the Coriolis acceleration of the equilibrium tide (in short $f({\bf u}_\mathrm{e})=\fh$). However, they also suggest that a large-scale magnetic field can potentially interact with the equilibrium tide for sufficiently large Lehnert numbers (typically $\mathrm{Le}>0.1$). For this reason, we propose to examine the relative importance of both forcings $\fm$ and $\fh$. We use $R$ as the typical length scale of the large-scale magnetic field and of the equilibrium tide, which involves large-scale flows. Henceforth, we can give the order of magnitude of the different forcings: \begin{equation*} \left\{\begin{aligned} \fh&\sim \rho_0u_\mathrm{e}\sigma_\mathrm{max}\hspace{0.5 cm}\text{ with }\sigma_\mathrm{max}=\max{[\sigma_\mathrm{t},2\Omega]}\\ \fm&\sim B_0^2\xi_\mathrm{e}/(\mu_0 R^2) \end{aligned}\right., \end{equation*} and their ratio: \begin{equation} \frac{\fm}{\fh}\simeq\frac{B_0^2}{\rho_0\mu_0 (2\Omega R)^2}\times\frac{2\Omega\xi_\mathrm{e}}{u_\mathrm{e}}\times\frac{2\Omega}{\sigma_\mathrm{max}}\equiv\mathrm{Le}^2\times\mathrm{Ro}_\mathrm{t}^{-1}\times\hat\sigma_\mathrm{max}^{-1}, \label{eq1} \end{equation} where we define the Lehnert number as $\mathrm{Le}=B_0/(\sqrt{\rho_0\mu_0}2\Omega R)$. We also introduce the Doppler-shifted tidal Rossby number $\mathrm{Ro}_\mathrm{t}=\sigma_\mathrm{t}/(2\Omega)$ with $\sigma_\mathrm{t}=u_\mathrm{e}/\xi_\mathrm{e}$ the related tidal frequency, and a dimensionless frequency ratio $\hat\sigma_\mathrm{max}=\sigma_\mathrm{max}/(2\Omega)=\max[\mathrm{Ro}_\mathrm{t},1]$. According to Eq. (\ref{eq1}), magnetism needs to be taken into account in the tidal forcing whenever $\mathrm{Le}^2/(\mathrm{Ro}_\mathrm{t}\hat\sigma_\mathrm{max})\gtrsim1$. \subsection{Scaling laws to estimate stellar magnetic fields} \label{sec22} The determination of the Lehnert number inside the convective envelope of low-mass stars requires knowledge of the internal magnetic field of these stars. However, we are currently only able to constrain the magnetic field of stars at their surface. Indeed, thanks to Zeeman-Doppler Imaging, one can reconstruct the topology and strength of large-scale, stellar magnetic fields \citep{D2006,DJ2007}. Regarding the Sun, internal magnetic fields can be assessed indirectly from surface tracers like sunspots, as a manifestation of flux ropes emerging through the surface \citep{C2013}. This approach is based on the so-called interface dynamo theory where the magnetic field is generated by a convective dynamo and pumped into the tachocline (the interface between the radiative and convective zones), where it eventually becomes strong enough to be buoyantly unstable, rise through the convection zone, and emerge at the surface as sunspots \citep{SZ1992,C2014,BB2017}. This picture has been recently questioned, especially by \cite{WD2016} by studying fully convective stars. It is indeed possible that the spot-forming magnetic fields can be generated in the bulk \citep{SB2017} or in the shallow layers \citep{B2016} of the CZ instead of overshoot layers beneath the core-envelope interface. Through helioseismology, \cite{GT1990} and \cite{A2000} have placed an upper bound of 30 T on the toroidal magnetic field strength at the base of the CZ. On the contrary, the mean magnetic field at the Sun's surface is significantly smaller, about a few Gauss ($\sim 10^{-4}\,\tesla$), even though sunspots are the seats of local intense magnetic fields (several tenths of a Tesla). As far as younger or smaller stars than the Sun are concerned, \cite{VG2014} gives an overview of known large-scale surface magnetic fields, that appear to vary from the globally weak fields of the order of the Gauss for solar-like stars to the strong Tesla-strength fields of M dwarf and T-Tauri stars. They establish a relationship between surface magnetic field and the convective Rossby number $\mathrm{Ro}=u_\mathrm{c}/(2\Omegal_\mathrm{c})$, where $u_\mathrm{c}$ and $l_\mathrm{c}$ are the convective velocity and length, respectively. This dimensionless quantity is generally calculated at half the mixing-length $\alpha H_p/2$ \citep{LM2010,G1986} above the base of the CZ, with $H_p$ the pressure scale height and $\alpha$ the mixing-length theory coefficient. Nonetheless, as indicated above, it is difficult to estimate the magnetic field inside stars. In this context, 3D global non-linear simulations \citep{SB2017,EB2017} and scaling relationships for stellar dynamos \citep[ and references therein]{AB2019} can help us to estimate the internal magnetic field strength in the convective envelope of low-mass stars. Three scaling laws are described hereafter and the derivation of the related dynamo-induced magnetic field is detailed in Appendix \ref{AA}. We have: \begin{enumerate} \item \textit{the (turbulent) equipartition}, that is often used to give an averaged, rough estimate of the magnetic field's amplitude in the bulk of the CZ \citep{BB2017}. It assumes that the dynamo is efficient i.e. that the system is equally good at generating magnetic field as it is at generating flows. This balance is also used in moderately active plages at the solar surface, while in the active sunspots superequipartition (i.e. magnetic energy is greater than kinetic energy) can be fairly common \citep{DL2009}. \label{item1} \begin{table}[t] \centering \begin{threeparttable} \begin{tabular}{lll} Regime & Balance & Estimation of $B_\mathrm{dyn}$ \\ \hline\hline \rule[-2ex]{0pt}{5ex} \ref{item1} Equipartition & $\mathrm{ME}=\mathrm{KE}$ & $\sqrt{\mu_0 2\mathrm{KE}}$\\ \rule[-2ex]{0pt}{5ex} \ref{item2} Buoyancy dynamo & $\cfrac{\mathrm{ME}}{\mathrm{KE}}=\mathrm{Ro}^{-1/2}$ & $\sqrt{\mu_02\mathrm{KE}/\mathrm{Ro}^{1/2}}$\\ \rule[-2ex]{0pt}{5ex} \ref{item3} Magnetostrophy & ${\bf F}_\mathrm{L}=2\rho_0\boldsymbol\Omega\times{\bf u}$ & $\sqrt{\mu_02\mathrm{KE}/\mathrm{Ro}}$ \\ \end{tabular} \end{threeparttable} \caption{Magnetic fields derived from simple balances (forces or energies) written in the second column. Details of the calculations are given in the appendix \ref{AA}. $\mathrm{KE}$ and $\mathrm{ME}$ are the kinetic and magnetic energy densities of the convective flow, respectively.} \label{tab1} \end{table} \item \textit{the buoyancy dynamo regime}, in which the Coriolis, buoyancy and Lorentz forces are taken to have the same order of magnitude assuming a low atomic magnetic Prandtl number, that is the ratio of atomic viscosity to magnetic diffusivity \citep{D2013,AB2019} . This assumption is well verified for fast rotating giant planets, young contracting stars like T-Tauri and rapidly-rotating low-mass stars \citep{CH2009}. \label{item2} \item \textit{the magnetostrophic regime}, for which the force balance is realised between the Coriolis and Lorentz forces. This balance, also called magnetostrophy, gives an upper estimate of the magnetic field. The magnetostrophic regime generally gives fields in super-equipartition \citep{BG2015,AB2019}. \label{item3} \end{enumerate} We summarise in Table \ref{tab1} the order of magnitude estimation of the magnetic field (named hereafter $B_\mathrm{dyn}$) within the convective envelope of a low-mass star as obtained by the three aforementioned scaling laws. These relationships involve the kinetic and magnetic energy densities of the convective flow $\mathrm{KE}=\rhou_\mathrm{c}^2/2$ and $\mathrm{ME}=B_\mathrm{dyn}^2/(2\mu_0)$ respectively, along with the convective Rossby number $\mathrm{Ro}=u_\mathrm{c}/(2\Omegal_\mathrm{c})$ at the base of the CZ. \\ The main objective of this paper is to determine and quantify the impact of a large-scale magnetic field on the excitation and dissipation of the dynamical tides. We still discuss in Sect. \ref{sec4} to what extent the small-scale component of the stellar magnetic field can influence the tidal flows. To allow comparison with the amplitude of observed surface magnetic fields of low-mass stars, we extrapolate a large-scale, dipolar, surface magnetic field from the scaling laws at the base of the CZ (Table \ref{tab1}). First, we suppose that the dipolar component of the star's magnetic field at the base of the CZ is a fraction $\gamma$ of the dynamo-induced magnetic field at that location: \begin{equation} B_\mathrm{dip}(r_\mathrm{base})=\gamma B_\mathrm{dyn}(r_\mathrm{base}). \label{gamma} \end{equation} The factor $\gamma$ encapsulates both the ratio of large-scale to small-scale magnetic fields \cite[similarly to the filling factor in][]{R2012,SM2019} and the part of the total energy that is available in the dipolar component of the magnetic field. Then, we infer the dipolar component of the surface magnetic field simply as: \begin{equation} B_\mathrm{dip}(r_\mathrm{top})=(r_\mathrm{base}/R)^3B_\mathrm{dip}(r_\mathrm{base}), \label{extrapol} \end{equation} where $R$ is the radius of the star, the subscripts "base" and "top" are the position inside the CZ, and "dip" and "dyn" refer to the dipolar and dynamo-induced magnetic fields, respectively. As the dipolar magnetic field at the surface of the Sun is well known, typically $4\,\mathrm{G}$ \citep{DB2012}, $\gamma$ can be estimated for the Sun by using Eqs. (\ref{gamma}) and (\ref{extrapol}): \begin{equation} \gamma=\frac{B_{\mathrm{dip},\odot}(r_\mathrm{top})}{ B_{\mathrm{dyn},\odot}(r_\mathrm{base})}\times\left(\frac{r_\mathrm{base,\odot}}{R_\odot}\right)^{-3}, \label{gam2} \end{equation} with $R_\odot$, $B_{\mathrm{dyn},\odot}(r_\mathrm{\bf base})$ and $r_\mathrm{\bf base,\odot}$ obtained from the grid models of the STAREVOL evolution code (see the Sect. \ref{sec23} below) for a $1M_\odot$ star of the age of the Sun. In the following we will assume that $\gamma$ in Eq. (\ref{gamma}) is independent of the mass and the age of the star, and that it takes the Sun's current value as in Eq. (\ref{gam2}). This is a strong assumption since $\gamma$ is close to a filling factor that depends on the Rossby number and therefore on the angular frequency of the star \citep{SM2019}. Nevertheless, refining the expression of this factor would not change the final conclusions of this paper which are robust to several orders of magnitude, as we will see later. The factor $\gamma$ however depends on the scaling law used to estimate $B_{\mathrm{dyn},\odot}$. Finally, the dipolar component of a star's surface magnetic field will be estimated as \begin{equation} B_\mathrm{dip}(r_\mathrm{top})=\gamma (r_\mathrm{base}/R)^{3} B_\mathrm{dyn}(r_\mathrm{base}). \label{Bdip} \end{equation} \subsection{The stellar evolution code STAREVOL} \label{sec23} To estimate the magnetic field and then the Lehnert number in the convective envelope of low-mass stars of different ages via the scaling laws described in Sect \ref{sec22}, we use the 1D stellar evolution code STAREVOL \citep{AP2019}. Initial masses of the stars range from $0.4$ to $1.4M_\odot$, given a solar metallicity $Z=0.0134$ \citep{AG2009}, and a mixing length parameter $\alpha=1.9730$. This latter is defined by the calibration of the standard solar model and used to model convective regions according to the mixing length theory. Basic input microphysics like the equation of state, nuclear reactions or opacities, are described in \cite{AP2016} and \cite{LD2012}. The initial rotation periods are fixed using the calibration for fast ($1.6$ days), median ($4.5$ days) and slow ($9$ days) rotators from \cite{AP2019}. The rotation is assumed to be uniform inside the CZ but varies dramatically with stellar ages \citep{GB2013}. As a result, the evolution of the surface angular velocity dictates that of the Lehnert number. During the first few Myr of the pre-main sequence (PMS), the surface angular velocity of the stars remains stationary as the result of star-disk magnetic interactions \citep{ZF2013,GB2015,AP2016}. This holds over the disk lifetime, typically a few Myr \citep{RW2004,BN2013,GB2015}. After the dissipation of the disk, the gravitational contraction of the star leads to an increase in the angular velocity, in order to conserve angular momentum, until the star begins hydrogen fusion at the zero-age main sequence (ZAMS). From this stage onward, magnetised stellar winds apply a torque on the star, spinning it down throughout its main sequence (MS) lifetime. In the STAREVOL code, the effects of a stellar wind acting from the early PMS to the tip of the MS are implemented using the prescription given by \cite{MB2015}. \begin{figure*}[ht] \includegraphics[width=\hsize/2]{B_age_0p9BCZ} \includegraphics[width=\hsize/2]{B_age_0p9TCZ} \caption{Magnetic field versus the age of a $0.9M_\odot$ star for three different initial rotation periods. At the base of the convective zone (\textit{left panel}), the magnetic field is estimated from the scaling laws listed in Table \ref{tab1}. At the top of the convective zone (\textit{right panel}), the same scaling laws are used to extrapolate a dipolar magnetic field near the surface (see Eq. (\ref{Bdip})). The "stars" symbols {\color{jv}\ding{72}} that represent mean dipolar magnetic fields at the surface of $0.9M_\odot$ stars are taken from \cite{SJ2017}, and the age of the stars are from \cite{GE2006,JR2008,LT2015} and \cite{FP2016}. Multiple observations of the dipolar magnetic field of a star are joined by a line. } \label{fig1} \end{figure*} In the following, the base of the CZ refers to a height that is located $0.002R$ above the bottom of the CZ as computed in the STAREVOL model. This convention avoids erratic numerical behaviour of the mixing length convective velocity at the interface between the radiative and convective zones. Furthermore, the top of the CZ refers to the radius where the convective velocity vanishes in the STAREVOL models. \subsection{Estimation of the dipolar magnetic field at the base and the top of a convective zone} \label{sec24} Figure \ref{fig1} shows the evolution of the magnetic field of a $0.9M_\odot$ star along its lifetime for the three different initial rotation rates stated in Sect. \ref{sec23}. It should be specified that we chose a $0.9M_\odot$ star rather than $1M_\odot$ to add measurements of the mean dipolar magnetic fields at the surface of stars in the early MS (see next paragraph). At the base of the CZ (left panel), the magnetic field is calculated with the scaling laws listed in Table \ref{tab1}. At the top of the CZ (right panel), we use these dynamo-induced magnetic fields to extrapolate dipolar magnetic fields near the surface by using Eq. (\ref{Bdip}). The results obtained with fast ($1.6\,\mathrm{ days}$), median ($4.5\,\mathrm{ days}$), and slow ($9\,\mathrm{ days}$) initial rotations are plotted with solid, dash-dotted, and dashed curves, respectively. We note that the magnetic field decreases in time after about $50$ Myr in the two panels for both the magnetostrophic and buoyancy dynamo regimes. It is due to the fact that these regimes depend on a positive power of the angular velocity (in the denominator of the Rossby number, see Table \ref{tab1}) that decreases after the ZAMS as a result of the stellar wind action on the star's surface. After $1\,\mathrm{Gyr}$, this decline is well described by the empirical Skumanich relationship \citep{WD1967,S1972}. At the age of the present Sun ($\sim 4.6\,\giga\mathrm{yr}$), the buoyancy dynamo and magnetostrophic regime at the base of the CZ give the order of magnitude of the toroidal magnetic field strength expected in the Sun at the tachocline, typically a few to a few tens of Tesla \citep{C2013}. We have added on the plot for the top of the CZ (right-hand panel) the average unsigned measured dipolar field strength of $0.9M_\odot$ stars \citep{SJ2017}. We have adopted a conservative error estimate of 0.434 dex in $\log B_\mathrm{dip}$ for all stars. Note that HD 22049 displays several values of the amplitude of the dipolar magnetic field measured at different times. The ages of the stars and their errors are taken from \cite{FP2016} for the early MS stars and \cite{GE2006, JR2008,LT2015} for the three oldest stars. It is interesting to note that the strength of the observed dipolar magnetic fields seems to be steady for end PMS and early MS stars. This finding is consistent with the saturation levels observed by \cite{VG2014,SJ2017} for the large-scale and dipolar surface magnetic fields at low Rossby numbers. As a matter of fact, low Rossby numbers means high angular frequencies and therefore stars in the vicinity of the ZAMS. However, whether or not this observed saturation level is an atmospheric effect or a dynamo related phenomenon has yet to be determined \citep{V1984,JU1999}. Dipolar fields of young stars seem to fit quite well with the magnetostrophic regime along with fast initial rotation. We must nevertheless specify that we realised the same plot with more observed dipolar magnetic fields (See et al. in preparation, private communication) featuring weaker magnetic fields for PMS and early MS stars, and so consistent with median and slow initial rotation. That being said, we have to bear in mind that several strong assumptions have been made to derive the dipolar magnetic field near the surface (Eq. (\ref{Bdip}), see also Appendix \ref{dis}). These prescriptions are nonetheless sufficient for this work given the robustness of our results as we will see in Sect. \ref{sec26}. We have plotted in Fig. \ref{BobsBdyn} the ratio of the observed and estimated dipolar magnetic fields versus the mass of various low-mass stars distributed from PMS to MS stages. The magnetic field $B_\mathrm{sim}$ is calculated with the magnetostrophic regime and a median initial rotation. The magnetic field $B_\mathrm{obs}$ is again taken from \cite{SJ2017} and ages are from \cite{VG2014} based on different methods (see the last quoted paper for more details). We note that the surface dipolar magnetic field of stars is well reproduced by $B_\mathrm{sim}$ within an order of magnitude. The estimate $B^\mathrm{sim}_\mathrm{dip}$ tends to deviate from $B^\mathrm{obs}_\mathrm{dip}$ for relatively massive ($M_\star\gtrsim1.2M_\odot$) or very low-mass ($M_\star\lesssim 0.6M_\odot$) stars, which is not surprising considering that the ratio $\gamma$ of dipolar/non dipolar magnetic field is determined from solar parameters (see Eq. (\ref{gam2})). \begin{figure}[th] \includegraphics[trim=0cm 0cm 1cm 0cm clip,width=\textwidth/2]{BobsVSBdyn_m_medn.pdf} \caption{Ratio of the mean unsigned observed dipolar magnetic field $B_\mathrm{dip}^\mathrm{obs}$ \citep{SJ2017,VG2014} over estimated dipolar magnetic field $B_\mathrm{dip}^\mathrm{sim}$ as a function of the mass of the star. The age of the stars is indicated in colour and ranges from $21$ Myr to $17.2$ Gyr. Magnetostrophic regime and median initial rotation have been used to plot the ratio $B_\mathrm{dip}^\mathrm{obs}/B_\mathrm{dip}^\mathrm{sim}$. Multiple observations of the dipolar magnetic field of a star are again joined by a line. A typical error bar for $M_\star$ and $B_\mathrm{dip}^\mathrm{obs}/B_\mathrm{dip}^\mathrm{sim}$ is indicated in grey. We have adopted a conservative error estimate of 0.434 dex in $\log B_\mathrm{dip}$ and $0.1M_\odot$ in $M_\star$.} \label{BobsBdyn} \end{figure} \subsection{Lehnert number for a low-mass star along its evolution} \label{sec25} Using the estimates of the dynamo-induced magnetic field in Table \ref{tab1}, we can express the related Lehnert number at the base of the CZ (see Table \ref{tab2}). Within each regime, $\mathrm{Le}$ depends on the convective Rossby number, and the ratio between the convective length scale and the stellar radius $l_\mathrm{c}/R$. This ratio results from the different length scales used in the magnetic scaling laws and in the definition of the Lehnert number (the length scales $l_\mathrm{c}$ and $R$ respectively). Specifically, we choose a definition of the Lehnert number that is consistent with the previous works of \citet{LO2018} and \cite{W2018}. \begin{table}[h] \centering \begin{threeparttable} \begin{tabular}{cc} Regime & $\mathrm{Le}$ scaling \\ \hline\hline \rule[-2ex]{0pt}{5ex} Equipartition & $\mathrm{Ro}\timesl_\mathrm{c}/R$\\ \rule[-2ex]{0pt}{5ex}Magnetostrophy & $\sqrt{\mathrm{Ro}}\timesl_\mathrm{c}/R$ \\ \rule[-2ex]{0pt}{5ex} Buoyancy dynamo & $\mathrm{Ro}^{3/4}\timesl_\mathrm{c}/R$\\ \end{tabular} \end{threeparttable} \caption{Lehnert number scaling laws depending on magnetic field regimes, detailed in Table \ref{tab1}.} \label{tab2} \end{table} At the top of the CZ, we use the dipolar magnetic field derived in Eq. (\ref{Bdip}) to estimate the Lehnert number near the surface: \begin{equation} \mathrm{Le}_\mathrm{top}=\frac{B_\mathrm{dip}(r_\mathrm{top})}{\sqrt{\mu_0\rho_\mathrm{top}}2\Omega R}=\gamma\left(\frac{r_\mathrm{base}}{R}\right)^3\sqrt{\frac{\rho_\mathrm{base}}{\rho_\mathrm{top}}}\mathrm{Le}_\mathrm{base}, \label{Letop} \end{equation} where we recall that "top" and "base" refer to the position in the CZ and that $\mathrm{Le}_\mathrm{base}$ is taken from Table \ref{tab2}. \begin{figure*}[h] \resizebox{\hsize/2}{!}{\includegraphics{Le2_age_0p9BCZ}} \resizebox{\hsize/2}{!}{\includegraphics{Le2_age_0p9TCZ}} \caption{Lehnert number squared at the base (\textit{left panel}) and the top (\textit{right panel}) of the convective zone as a function of age for a $1M_\odot$ star, and for different magnetic scaling laws and initial rotations (see the legends in the left panel).} \label{fig2} \end{figure*} In Fig. \ref{fig2}, the Lehnert number squared of a $1M_\odot$ star is shown as a function of age, at the base (left panel, see Table \ref{tab2}) and top (right panel, Eq. (\ref{Letop})) of the CZ. The different scaling laws, with fast and slow initial rotations, are shown with the same layout as Fig. \ref{fig1}. First, we note that $\mathrm{Le}^2$ remains always smaller than unity, consistent with the previous works of \citet{LO2018} and \cite{W2018}. Whether we look at the base or the top, $\mathrm{Le}^2$ increases with decreasing initial rotation speed from the PMS until about $1\mathrm{Gyr}$. This is the opposite behaviour to the magnetic field strength, since the Lehnert number decreases with the angular velocity (see Table \ref{tab2} and Eq. (\ref{Letop})). Finally, $\mathrm{Le}^2$ is greater at the base than at the top of the CZ as it scales with $B^2$. \begin{figure}[t] \resizebox{\hsize}{!}{\includegraphics{Le2_age_slow}} \caption{Evolution of the Lehnert number squared over time, at the base (solid lines) and the top (dotted dashed lines) of the convective zone, for various low-mass stars sorted from $0.7$ to $1.4M_\odot$. Slow initial rotation has been used here and a magnetostrophic balance has been assumed.} \label{fig3} \end{figure} The mass dependence of the Lehnert number is illustrated in Fig. \ref{fig3}, which displays $\mathrm{Le}^2$ against age for stars ranging from $0.7$ to $1.4M_\odot$. We have used slow initial rotation and the magnetostrophic regime to plot $\mathrm{Le}^2$ at both the base and the top of the CZ. At the base of the CZ, we obtain the same features as in Fig. \ref{fig2} i.e. $\mathrm{Le}^2$ reaches a minimum at the ZAMS and increases during the MS. We highlight a quite small dispersion of the curves, though $\mathrm{Le}^2$ still grows slightly with mass for $M_\star\lesssim1.2\,M_\odot$ stars. This trend is driven mostly by the decay of the convective turnover time $\tau_\mathrm{c}=l_\mathrm{c}/u_\mathrm{c}$ when the mass grows (note that $\mathrm{Ro}=(\tau_\mathrm{c}2\Omega)^{-1}$ in Table \ref{tab2}). When $M_\star\gtrsim1.2\,M_\odot$, the decrease in $l_\mathrm{c}/R$ at the base of the CZ for growing masses helps to reverse this behaviour. The drop in $\mathrm{Le}^2$ with mass is even more pronounced at the top of the CZ for $M_\star\gtrsim1\,M_\odot$. These changes simply reflects the fact that the convective envelope shrinks with mass, which naturally leads to an increase in convective length and a decrease in convective turnover time and density at the base of the CZ (see Table \ref{tab2} and Eq. (\ref{Letop})). \subsection{The influence of magnetism on tidal forcing for observed star-planet systems} \label{sec26} The ratio of the magnitude of the Lorentz forcing to the hydrodynamical forcing (Eq. (\ref{eq1})) does not only depend on the Lehnert number, but also on the Doppler-shifted Rossby number $\mathrm{Ro}_\mathrm{t}$ and the ratio of frequencies $\hat\sigma_\mathrm{max}$ which need to be estimated from a two-body system. \cite{O2014} gives the expression of the tidal frequency in the fluid frame, $\sigma_\mathrm{t}$ in our notations, using the integers $l$, $m$, $n$ coming from the spherical harmonics functions on which the gravitational potential is projected \citep[we refer the reader to Sect. 2.1 in][]{O2014}. The tidal frequency is $\sigma_\mathrm{t}=n\Omega_\mathrm{o}-m\Omega$, where $m$ is the azimuthal order of the spherical harmonics, and $n$ and $\Omega_\mathrm{o}$ have been introduced in Sect. \ref{sec21}. In the previous section, it has been shown that $\mathrm{Le}^2$ does not go much beyond $10^{-3}$, regardless of the age and the mass of the star at the base and top of the CZ (Figs. \ref{fig2} and \ref{fig3}). This means that the ratio $\fm/\fh$ (Eq. (\ref{eq1})) is likely to be small compared to unity, unless the rotation frequency is much greater (by at least a factor of a thousand) than the tidal frequency. Given the definition of the tidal frequency introduced above, the closer we get to a resonance between orbital and rotation frequencies, the more important the ratio $\fm/\fh$ will be. For the sake of simplicity we will consider here systems with an almost circular and coplanar orbit. This allows us to reduce the number of pairs $(m,n)$ because the tidal potential components are labelled by these integers and depend on eccentricity and stellar obliquity. Moreover, the dominant term in the tidal potential is the quadrupolar component as long as the planet and its host star are well separated, namely $l=2$ with $l$ the degree of the spherical harmonics \citep{ML2009,O2014}. Within this assumption and the limits of low eccentricity and obliquity, $(m,n)\in\{(2,2),(0,1),(2,1),(2,3),(1,0),(1,2)\}$ \citep[see][for more mathematical details]{O2014}. When the orbit is strictly circularised and coplanar, the asynchronous tide acts alone and the only matching pair of integers is $(2,2)$. For the other pairs, the eccentricity or obliquity tides can be dominant. \\ In Table \ref{tabsys}, we have thus listed known star-planet systems satisfying the following conditions: \begin{itemize} \item a near-circular orbit: we choose the eccentricity such as $e<0.1$. \item a low sky-projected obliquity: $|\lambda|<30\degree$. $\lambda$ is the sky-projected angle between the stellar spin axis and the axis perpendicular to the planet orbit. Ideally, we should use the true obliquity $\psi$ but this quantity is more difficult to determine than $\lambda$ and too few measurements exist. However, when both values of $\psi$ and $\lambda$ exist for the selected systems, they are quite similar and far from the threshold of $30\degree$. \item a planet orbiting close to its host star : $P_\mathrm{o}<10$ days, where $P_\mathrm{o}$ is the orbital period of the planet, so that stellar tidal effects are important . \end{itemize} Under these conditions the chosen systems are mostly hot-Jupiter-like systems, with host stars ranging from $0.7$ to $1.4\,M_\odot$ in order to have a similar structure to that of the Sun (namely with a convective envelope and a radiative region below it during the MS). They have been picked out using the online database \href{http://www.exoplanet.eu}{exoplanet.eu}\footnote{http://www.exoplanet.eu} \citep[e.g.][]{SD2011} which presents the orbital period and eccentricity of the planet, along with the \href{http://www.astro.keele.ac.uk/jkt/tepcat/tepcat.html}{TEPcat}\footnote{www.astro.keele.ac.uk/jkt/tepcat/tepcat.html} \citep{S2011} database to find the sky-projected obliquity. Then, we removed the systems for which the age of the star was not known. For the remaining systems, stellar period has been found in the literature: the related references are reported in the last column of Table \ref{tabsys}. In Fig. \ref{fVSm}, we present the ratio of the magnetic to hydrodynamic forcings $\fm/\fh=\mathrm{Le}^2\mathrm{Ro}_\mathrm{t}^{-1}\hat\sigma_\mathrm{max}^{-1}$ as a function of the mass of the host star. The quantity $\mathrm{Ro}_\mathrm{t}\hat\sigma_\mathrm{max}$ has been calculated using orbital and stellar rotation periods (see Table \ref{tabsys}) for the pair $(m,n)$ that minimizes this quantity and thus maximizes $\fm/\fh$. To calculate the Lehnert number squared, we have used the star's rotation period and radius displayed in Table \ref{tabsys}, coupled with density, convective length and velocity given by our grid of STAREVOL models at the closest age and mass of the host star. For each system, $\mathrm{Le}^2$ is evaluated at the base and the top of the CZ. Moreover, the magnetostrophic regime has been selected because it best reproduces the observed surface magnetic fields (see Figs. \ref{fig1} and \ref{BobsBdyn}). As expected, the ratio $\fm/\fh$ at the base is greater than at the top of the CZ, consistent with the relative magnitude of the large-scale magnetic field inside the convective envelope. Moreover, at the base of the CZ the higher the mass, the greater this ratio. On the contrary, we observe a drop in $\fm/\fh$ at the top of the CZ for stars more massive than $1.2\ M_\odot$, similar to what we notice in Fig. \ref{fig3}. More importantly, we point out that $\fm/\fh$ is always smaller than unity, regardless of the mass of star and the position inside the stellar envelope. Only HAT-P-24 (b) may feature the ratio of forcings around unity within the error bar for $(m,n)=(2,1)$ at the base of the CZ. Indeed, the rotation period of the star HAT-P-24 is nearly twice the orbital period of the planet HAT-P-24 b, which implies that $\mathrm{Ro}_\mathrm{t}$ is very close to zero, thereby making $\fm/\fh$ close to unity, despite the small value of $\mathrm{Le}^2$. It is worth noticing that \cite{O2009} and \cite{LO2018} mentioned a significant impact of the magnetic field on non-wave like motions as soon as $\mathrm{Le}>0.1$. In our study, some star-planet systems (like HAT-P-13 and HD 149026) feature a Lehnert number greater than $10^{-1}$ and yet a ratio $\fm/\fh$ far below unity. This stresses the fact that the Lehnert number is not the only quantity to come into play and that the relative amplitude of the tidal and rotation frequencies has to be considered to conclude on the impact of magnetism on the tidal forcing.\\ \begin{figure}[ht] \includegraphics[width=\textwidth/2]{Le2sRoh_m_slowmag.pdf} \caption{Dependence of the ratio of the Lorentz forcing relative to the hydrodynamic forcing with respect to the mass of the host star for the selected star-planet systems (see Table \ref{tabsys}). The magnetic forcing term $\fm$ is estimated with the magnetostrophic balance at the base and the top of the CZ and a stellar model evolved with a slow initial rotation. The tidal frequency has been calculated with the pair $(m,n)$ that minimizes $\mathrm{Ro}_\mathrm{t}\hat\sigma_\mathrm{max}$ and thus maximizes $\fm/\fh$. } \label{fVSm} \end{figure} From the results of this section, we conclude that the tidal forcing arising from the Lorentz force remains small in comparison to a pure hydrodynamical forcing. This conclusion is important, as it stresses that adopting a Coriolis-driven tidal forcing is justified to study the propagation and dissipation of tidally-forced magneto-inertial waves in the convective envelope of low-mass stars, despite the presence of a large-scale, dynamo generated magnetic field, as was done in \cite{W2016,W2018} and \cite{LO2018}. \section{The relative importance of viscous over Ohmic dissipation for magneto-inertial waves} \label{sec3} In the previous section, we have demonstrated that the Lorentz force has a weak contribution to the tidal forcing of (magneto-) inertial waves. It can, however, affect their propagation (hence the name magneto-inertial waves) and dissipation as the Lorentz force acts on the wave-like part of the equation of motion and we have introduced the Ohmic diffusion in the induction equation (see Eqs. (\ref{de_eq}) and (\ref{eq01b}), respectively). \cite{W2016} studied the dissipation of these waves by turbulent friction and magnetic diffusion processes using a local Cartesian model of an isentropic convective region. He compared the importance of Ohmic versus viscous dissipations, especially at resonances. Varying the Lehnert number, \cite{W2016} found that the transition from a viscous-dominated regime to a regime dominated by Ohmic dissipation occurs when the Lehnert number is greater than $\sim10^{-4}$--$10^{-3}$, for average atomic Ekman and Prandtl numbers close to those expected in the Sun or in Jupiter. This led him to the conclusion that when $\mathrm{Le}$ is larger than $10^{-3}$, magnetic effects on tidal dissipation should be taken into account. This work has been taken up by \cite{LO2018} in which they studied the propagation and the kinetic and magnetic energy dissipations of tidally forced magneto-inertial waves in a spherical shell. They showed that, at high Lehnert numbers, dissipation is no longer focused along the shear layers that are shaped by rotation and viscosity following attractors of characteristics as in the pure hydrodynamical case. \begin{figure}[h] \centering \resizebox{4\hsize/5}{!}{\includegraphics[scale=0.5]{LO_scalingLaw}} \caption{Sketch of an inertial wave beam with a magnetic field (\textit{red arrow}), an Alfvén wave (\textit{dashed red line}) and an inertial wave propagating from the left to the right (\textit{blue arrows)}. The time for an Alfvén wave to transversely cross the wave beam of length $\ell(\tau_\mathrm{i}=\tau_\eta)$, is greater than the time for an inertial wave to go through the wave beam of length $L\sim R$.} \label{fig5} \end{figure} \begin{figure*}[ht] \resizebox{\hsize/2}{!}{\includegraphics{Le_age_1p0slowBCZ}} \resizebox{\hsize/2}{!}{\includegraphics{Le_age_1p0slowTCZ}} \caption{Lehnert number at the base (\textit{left panel}) and top (\textit{right panel}) of the convective zone versus the age of a $1M_\odot$ star. Slow initial rotation has been used in both panels. The thresholds for which magnetic field impacts the propagation of inertial waves is estimated with different Ekman numbers and drawn in orange (see the legend).} \label{fig4} \end{figure*} Once again, they identified a critical Lehnert number that separates the regimes dominated by viscosity or by Ohmic dissipation. They expressed this critical Lehnert number with the help of characteristic timescales of ray tracing. Specifically, the width of an inertial wave beam $\ell$ is deduced by equating the magnetic diffusion timescale $\tau_\eta=\ell^2/\eta$ and the inertial wave propagation time $\tau_\mathrm{i}=R/|{\bf V}_\mathrm{g}|$, where $|{\bf V}_\mathrm{g}|\sim\ell\Omega$ is the group velocity (see Fig. \ref{fig5}). Indeed, the higher the Ohmic diffusion (or the viscosity), the larger the spread of the inertial wave beam. Furthermore, hydrodynamical terms prevail over MHD ones when Alfvén waves (produced by the deformation of the magnetic field by the inertial flow) do not have time to distort the wave beam. In other words the hydrodynamical terms dominate when $\tau_\mathrm{a}>\tau_\mathrm{i}$ \text{ where } \[ \tau_\mathrm{a}=\ell/|{\bf V}_\mathrm{a}|\sim\mathrm{Le}^{-1}\Omega^{-1}\ell/R, \] is the typical time for an Alfvén wave to transversely cross the wave beam (see Fig. \ref{fig5}). Using these heuristic considerations, \cite{LO2018} have shown that the propagation of inertial waves is little influenced by a magnetic field as long as \[\mathrm{Le}\ll\mathrm{Em}^{2/3},\] with $\mathrm{Em}=\eta/(2\Omega R^2)$ the magnetic Ekman number. This prediction has been inferred in the context of a low $\mathrm{Pm}$. This condition is generally satisfied in solar-like stars. In the Sun, the atomic magnetic Prandtl number varies from $10^{-6}$ at the surface to $10^{-1}$ at the base of the CZ \citep{Z1983}. When viscosity dominates, for instance in the core of massive stars \citep[see Fig. 2 in ][]{AB2019}, the same relationship holds with the viscous Ekman number $\mathrm{Ek}$ instead of $\mathrm{Em}$. In Fig. \ref{fig4}, the Lehnert number is illustrated as a function of stellar age, where the threshold defined in \cite{LO2018} is included with atomic and turbulent magnetic diffusivities: $\mathrm{Em}_\mathrm{ato}^{2/3}$ and $\mathrm{Em}_\mathrm{tur}^{2/3}$ being the atomic and turbulent magnetic Ekman numbers, respectively. The parameter $\mathrm{Em}_\mathrm{ato}$ has been computed thanks to the Braginskii prescription for plasma diffusivities \citep[Appendix B]{B1965,AB2019} using the grid of STAREVOL models. The turbulent magnetic Ekman number ($\mathrm{Em}_\mathrm{tur}$) is derived assuming that the eddy-magnetic diffusivity takes the simple form: $\eta_\mathrm{tur}=u_\mathrm{c}l_\mathrm{c}/3$. In this approach, $\eta_\mathrm{tur}$ is equivalent to the eddy-viscosity that means a magnetic turbulent Prandtl number of the order of unity \citep[see e.g.][]{CT1992}. We highlight that in both panels of Fig. \ref{fig4}, the threshold calculated with an atomic magnetic diffusivity is much lower than $\mathrm{Le}$ derived in the various regimes, by at least three order of magnitudes near the surface and six order of magnitude at the base of the CZ. Consequently, the Ohmic dissipation largely outbalances the viscous dissipation along the lifetime of a 1$M_\odot$ when taking Lin \& Ogilvie's threshold assessed with a magnetic atomic diffusivity $\eta_\mathrm{ato}$. In contrast, the limit estimated with the turbulent magnetic Ekman number is of the same order of magnitude as the Lehnert number in the equipartition regime at the base of the CZ, whereas the threshold is slightly smaller than the Lehnert number curves at the top. Note that the turbulent magnetic Ekman number is close to the value of the magnetic Ekman number used in Lin \& Ogilvie's (previously quoted) paper for their simulations. This explains why the transition from an hydrodynamical to a fully magnetic regime is carried out at similar Lehnert number in their case and in ours when using $\mathrm{Em}_\mathrm{tur}$ here \citep[see Figs. 2, 3 and 4 in ][]{LO2018}. By choosing an eddy-magnetic diffusivity, both Ohmic and viscous dissipations have to be taken into account in the dissipation calculation. \section{The impact of a smaller-scale magnetic field} \label{sec4} The stellar dynamo is a multi-scale process. Indeed, large-scale and small-scale dynamos coexist inside a star's CZ and produce magnetic fields at different length scales \cite[and references therein]{BS2005,SB2013}. At the base of the CZ, the convective length scale computed by STAREVOL is about one tenth of the radius of the star and decreases drastically towards the top of the CZ ($\sim10^{-4}\,R$ in our model). In Sect. \ref{sec22}, we have made the assumption that a dynamo-like magnetic field is the result of turbulent convective motions featured by the convective velocity at the base of the CZ, associated to a relatively large-scale convective length. Then, we have used this dynamo-induced magnetic field to extrapolate a dipolar magnetic field near the surface of the star (see Eq. (\ref{Bdip})). However, one can question the role of the small-scale dynamo fields on tidal excitation and dissipation throughout the convective envelope. \begin{figure}[ht] \resizebox{\hsize}{!}{\includegraphics[scale=0.5]{profil_m1p0fast.pdf}} \caption{Lehnert number squared against the normalised radius in the magnetostrophic (\textit{dark red}) and equipartition (\textit{green}) regimes, for a $1M_\odot$ star. The reader is referred to the body of Sect. \ref{sec4} for the new definition of $\mathrm{Le}$ that involves a small-scale magnetic field. The Lehnert number squared is plotted at different epochs: amid the pre-main sequence (midPMS; $\sim30\,\mathrm{Myr}$), at zero-age main sequence (ZAMS; $\sim60\,\mathrm{Myr}$), amid the main sequence (midMS; $\sim5.3\,\mathrm{Gyr}$), and toward the end of the main sequence (TAMS; $\sim10.5\,\mathrm{Gyr}$).} \label{Le2_r} \end{figure} The dynamical tides will possibly interact with the smaller-scale magnetic field. Indeed, the scale of variation of dynamical tides along the inertial wave beam is of order $R$ (Sect. \ref{sec3}), but the transverse length scale $l$ of this beam is smaller. The balance between magnetic diffusion and inertial timescales (see also Sect. \ref{sec3}) leads to $l=\sqrt[3]\mathrm{Em}\,R$ i.e. the transverse length scale of the beam varies from one hundredth to one tenth of the stellar radius when using typical values of the turbulent Ekman number (see Fig. \ref{fig4}). This orthogonal length scale is thus comparable to the length scale of the convection and of the corresponding magnetic field. The scale of variation of the equilibrium tide is also of order $R$ \citep[see e.g.][]{RM2012}. The small-scale components of the star's magnetic field can collectively affect the large-scale flow of the equilibrium tide provided their correlations sustain a large-scale effective Lorentz force. We plot $\mathrm{Le}^2$ associated with a small-scale magnetic field in Fig. \ref{Le2_r} as a function of the normalized radius in the whole CZ. The typical length to be used in the expression of $\fm$ (Eq. (\ref{eq1})) is no longer $R$ but $l_\mathrm{c}$ which represents the characteristic length of the fluctuating component of the dynamo-generated magnetic field. We redefine the Lehnert number here as $\mathrm{Le}=B_\mathrm{dyn}/(\sqrt{\mu_0\rho}2\Omegal_\mathrm{c})$, where $B_\mathrm{dyn}$ (Table \ref{tab1}) depends upon $l_\mathrm{c}$, which in turn varies inside the CZ. In the three regimes listed in Table \ref{tab2}, $\mathrm{Le}$ now depends only on the Rossby number (i.e. each scaling has to be multiplied by $R/l_\mathrm{c}$). The profile of $\mathrm{Le}^2$ is shown for magnetostrophic and equipartition regimes at different evolutionary stages. In both regimes, the Lehnert number follows the Rossby number tendency obtained in \cite{MA2016}. Indeed, the authors pointed out that $\mathrm{Ro}$ always increases with radius, regardless of the changes in mass and stellar evolutionary phases. In the early stages of the $1M_\odot$ star's evolution (PMS and ZAMS), the probability of having a significant magnetic forcing e.g. $\fm/\fh>1$ is weak at the base of the CZ ($\mathrm{Le}^2<10^{-3}$), but becomes high near the surface ($\mathrm{Le}^2>10$) based on the analyses of Sects. \ref{sec25} and \ref{sec26}. The chances are even higher when the star is older (from the midpoint to the end of the MS) since $\mathrm{Le}^2$ is already greater than $10^{-3}$ at the base of the CZ in both regimes. From this analysis, we should keep in mind that small-scale magnetic fields can affect the equilibrium and dynamical tides. Indeed, $\mathrm{Le}^2$ can be significantly enhanced near the surface of the star, a fortiori for all three regimes described in Table \ref{tab1}. This may change the results of Sect. \ref{sec26}, namely boost the effect of magnetism on tidal forcing so that $\fm$ is no longer negligible in front of $\fh$. \section{Conclusions and discussions} \label{sec_conclu} The influence of magnetism on tidal interaction along the evolution of low-mass stars has been investigated through its impact on tidal excitation and dissipation. We have first derived an analytic criterion to quantify the Lorentz contribution to the tidal forcing. The relative importance of Coriolis-like versus Lorentz-like forcings relies on the Lehnert number and characteristic frequencies of star-planet systems, i.e. the tidal frequency and the rotation frequency of the main body. With the help of simple scaling laws, we have estimated the magnitude of a dynamo-generated magnetic field near the tachocline. Then, a large-scale dipolar magnetic field has been inferred near the surface of the star from these scaling relationships. For this purpose, we have used grids of low-mass stars computed by the stellar evolution code STAREVOL \citep{AP2019}. This allowed us to compare our magnetic field estimates at the surface with the observations of the surface dipolar magnetic field. We find that the magnetostrophic regime (resulting from the balance between Coriolis and Lorentz forces) gives a good estimate, within an order of magnitude, of the magnetic fields of PMS and MS stars when assuming a median or fast initial rotation. Nevertheless, improvements still need to be made in terms of magnetic scaling laws in order to better reproduce the observed magnetic fields of \cite{VG2014} and \cite{SJ2017} (see Appendix \ref{dis}). Subsequently, we have estimated the Lehnert number with these prescriptions for the stellar dynamo at the base and the top of the convective zone. We have explored how it varies for different stellar masses and initial rotation speeds as a function of time. In all cases, the Lehnert number is small compared to unity. This means that magnetism can play a role in tidal forcing only for small tidal to rotational frequency ratios. In practice, this condition is verified neither at the base nor at the top of the convective zone when using the large-scale magnetic fields in the primary component of quasi-circular and coplanar star-planet systems. Although the ratio $\fm/\fh$ increases with the mass of the host star until $1.2M_\odot$ (see Fig. \ref{fVSm}) and is greater at the base of the convective zone, it remains below $1$ for all the studied systems. Indeed, only specific and sharp enough resonances between the tidal and the rotational frequency can increase the $\fm/\fh$ ratio. This statement is also valid for non-circular and non-coplanar systems, the tidal frequency being just a different combination of orbital and rotation frequencies. Eventually, one should note that all the selected systems (Table \ref{tabsys}) have a host star on the mid and late MS. But it should not change the fact that large-scale magnetic fields have little influence on the tidal excitation because $\mathrm{Le}^2$ is even weaker for younger stars (as we have seen in Fig. \ref{fig3}). In contrast, the dissipation of the dynamical tide is strongly affected by stellar magnetism. Indeed, we have shown that viscous dissipation is no longer the main process of energy dissipation. Ohmic dissipation is at least as important as viscous dissipation (see Fig. \ref{fig4}) in the whole convective zone for a $1M_\odot$ star as well as other low-mass stars. This means that a full MHD treatment is needed to analyse the propagation and dissipation of tidally-forced (magneto-) inertial waves inside the convective zone of a low-mass star. It can be added that whatever the energy mix distributed in the toroidal and poloidal components of the large-scale magnetic field at the surface \citep[which is also variable over time ][]{KP2017}, it does not change the main conclusions of our paper because these energies are comparable within an order of magnitude \citep{SJ2015}.\\ In Sect. \ref{sec4}, we have addressed the question of the effect of small-scale components of the dynamo-induced magnetic field on tidal interactions. We have pointed out that they are likely to play a role on both dynamical and equilibrium tides and consequently on the tidal forcing and dissipation. We first demonstrated that the transverse component of the typical length scale of the dynamical tide is commensurate with the convective mixing length in the bulk of the convective zone. In this respect, it would also mean that the modelling of the friction applied by turbulent convection on the dynamical tides should go beyond an eddy viscosity model \citep{OL2012} to incorporate magnetic effects. Then, we showed that the Lehnert number squared estimated with a small-scale magnetic field can be much greater than $\mathrm{Le}^2$ calculated with a large-scale field. As a result, the impact of a small-scale dynamo induced magnetic field on tidal forcing could be not as negligible as the effect of a larger-scale magnetic field. Quantifying this impact now requires ab-initio modelling of tidal forcing in turbulent convective envelopes sustaining a small-scale dynamo. \begin{acknowledgements} We would like to thank the anonymous referee for the helpful comments and suggestions regarding our work. A. Astoul, K. Augustson, E. Bolmont, and S. Mathis acknowledge funding by the European Research Council through the ERC grant SPIRE 647383. The authors acknowledge the PLATO CNES funding at CEA/IRFU/DAp and IRAP. The authors further thank V. See for fruitful discussions and the use of his data. F. Gallet acknowledges financial support from a CNES fellowship. A.S.Brun acknowledges funding by ERC WHOLESUN 810218 grant, INSU/PNST, and CNES Solar Orbiter. This work has been carried out within the framework of the NCCR PlanetS supported by the Swiss National Science Foundation. This research has made use of NASA's Astrophysics Data System. \end{acknowledgements} \bibliographystyle{aa.bst}
\section{Introduction} In this article we will study the following problem: \begin{equation*} (P)\; \left\{\begin{array}{rllll} (-\De)^s u &=g(x,u)+ \left(\ds \int_{\Om}\frac{F(u)(y)}{|x-y|^{\mu}}dy\right) f(u) \; \text{in}\; \Om,\\ u&=0 \; \text{ in } \R \setminus \Om \end{array} \right. \end{equation*} where $\Om$ is a smooth bounded domain in $\mathbb R^n, N\ge 2$, $s \in (0,1)$, $\mu <N$, $g:\Om\times \mathbb R\to \mathbb R$ Carath\'edory function, $f:\mathbb R \rightarrow \mathbb R$ is a continuous function and $F$ is the primitive of $f$. Here the operator $(-\De)^s$ is the fractional Laplacian defined up to a positive multiplicative constant as \begin{align*} (-\De)^su(x)=\text{P.V. } \int_{ \R} \frac{u(x)-u(y)}{|x-y|^{N+2s}} dy \end{align*} where P.V. denotes the Cauchy principal value. The existence and regularity of weak solutions have been a fascinating topic for the researchers for a long time. The work on Choquard equations was started with the quantum theory of a polaron model given by S. Pekar \cite{pekar}. In 1976, in the modeling of a one component plasma, P. Choquard \cite{ehleib} used the following equation with $\mu=1,\; p=2$ and $N=3$: \begin{equation}\label{ch26} -\De u +u = \left(\frac{1}{|x|^{\mu}}* F(u)\right) f(u) \text{ in } \mathbb{R}^3 \end{equation} where $f(u)=|u|^{p-2}u$ and $F^\prime =f$. In \cite{moroz2}, Moroz and Schaftingen established the existence of a ground state solution and the regularity of weak solutions of the problem \eqref{ch26} in higher dimensions $N \geq 3 , \mu \in (0,N)$ and with more general functions $F\in C^1(\mathbb{R},\mathbb{R})$ satisfying certain growth conditions. For more results on the existence of solutions we refer to \cite{moroz4,moroz5} and the references therein. In \cite{yang}, Yang and Gao studied the Brezis-Nirenberg type result for the following equation \begin{equation*} -\Delta u = \la u+ \left(\int_{\Om}\frac{|u(y)|^{2^*_{\mu}}}{|x-y|^{\mu}}dy\right)|u|^{2^*_{\mu}-2}u \text{ in } \Om, \quad u=0 \text{ on } \pa \Om, \end{equation*} \noi where $\Om\subset \mb R^N, N\ge 3$ is a bounded domain having smooth boundary $\pa \Om$, $\la>0$, $0<\mu<N$ and $ 2^*_\mu = \frac{2N-\mu}{N-2}$. Later, many researchers studied the Choquard equation for the existence and multiplicity of solutions, for instance see \cite{alves,yang1, ts} and references therein. \\ On the other hand, in recent years, the subject of nonlocal elliptic equations involving fractional Laplacian has gained more popularity because of many applications such as continuum mechanics, game theory and phase transition phenomena. For an extensive survey on fractional Laplacian and its applications, one may refer to \cite{valdi, stinga} and references therein. The nonlocal equations with Hartree-type nonlinearities were used to model the dynamics of pseudo-relativistic boson stars. In fractional quantum mechanics, fractional Schr\"odinger equations play an important role, for instance see \cite{frank,zhang,ts}. For the existence and multiplicity results on fractional Laplacian, readers can refer to \cite{servadei} and references therein. For the doubly nonlocal problem, precisely, the nonlocal elliptic equation involving fractional Laplacian and Choquard type nonlinearity, there are articles which discuss the existence and multiplicity of solutions, we cite \cite{ambrosio,avenia,pucci,zhang} and references therein, with no attempt to provide a complete list. Regularity results about problem involving fractional diffusion are also attracting a large number of researchers. Consider the following nonlocal problem \begin{equation}\label{ch24} (-\Delta)^s u =g\text{ in } \Om, \quad u=h \text{ in } \R\setminus \Om. \end{equation} The interior regularity of solutions to \eqref{ch24} is primarily determined by Caffarelli and Silvestre. In \cite{caffe1}, authors developed the $C^{1+\al}$ interior regularity for viscosity solutions to nonlocal equations with bounded measurable coefficients. For the convex equation, authors proved $C^{2s+\al}$ regularity in \cite{caffe2} while in \cite{caffe3}, authors established a perturbative theory for non translation invariant equations. In \cite{silves}, Silvestre studied regularity of weak solutions to free boundary problem. For the boundary regularity, Ros-Oton and Serra \cite{RS} studied the regularity of weak solutions to \eqref{ch24} with $h=0$ and $g \in L^\infty(\Om)$. By using a suitable upper barrier and the interior regularity results for the fractional Laplacian they prove that $u\in C^s(\mathbb R^N)$ and $\|u\|_{C^s} \le c \|g\|_{L^\infty(\Om)}$ for some constant $c$. Moreover, authors established a fractional analog of the Krylov boundary Harnack method to further prove $u \in C_d^{0,\al}(\overline{\Om})$ for some $\al \in (0,1)$. In \cite{RS1}, authors proved the high integrability of the weak solution by using the regularity of Riesz potential established in \cite{stein}. In \cite{adi}, authors discussed the existence and regularity of weak solution to the following problem \begin{equation*} (-\De)^s u =u^{-q}+ f(u) \; \text{in}\; \Om,\; u=0 \; \text{ in } \R \setminus \Om \end{equation*} where $q>0$ and the function $f$ is of subcritical growth. When $f$ has critical growth then the question of existence and regularity have been answered in \cite{gts1}. Despite the ample amount of research on doubly nonlocal problems, there is very little done in respect of regularity of weak solutions to these problems. For instance, in \cite{avenia}, authors proved the regularity of a ground state solution of doubly nonlocal equation with subcritical growth in the sense of Hardy-Littlewood-Sobolev inequality, by generalizing the idea of \cite{moroz4} in fractional framework. In \cite{su}, authors establish the $L^\infty(\mathbb R)$ bound of the nonnegative ground state solution of doubly local problem with critical growth in the sense of Hardy-Littlewood-Sobolev inequality under the assumption that $\mu < \min\{ N, 4s\}$. In \cite{yangjmaa}, Gao and Yang studied the Dirichlet problem involving Choquard nonlinearity with Laplacian operator. Here authors aim to prove the regularity for weak solutions. The boot-strap techniques as it is developed in \cite{yangjmaa} work for the subcritical growth and seems to fail in handling the critical non linearity in the sense of Hardy-Littlewood-Sobolev inequality. For the critical case, Moroz and Schaftingen \cite{moroz2}, studied problem \eqref{ch26} and prove the $W^{2,p}_{\text{loc}}(\mathbb R^N), \; p>1$, regularity of the weak solution for problems in the whole space without a perturbation term $g(x,u)$. The techniques given in \cite{moroz2} cannot be straightforward carried to problem $(P)$ in a general setting. The regularity of positive solution to the following singular problem \begin{equation}\label{ch34} -\De u = u^{q-1} + \left(\ds \int_{\Om}\frac{F(u)(y)}{|x-y|^{\mu}}dy\right) f(u) \; \text{in}\; \Om, u=0 \; \text{ in } \R \setminus \Om, ~ 0<q<1 \end{equation} was also an open problem. Motivated by the above discussion and the stated issues, the first part of the present article is intended to address the question of $L^\infty(\Om) $ bound for weak solutions of the problem $(P)$ covering large classes of $f$ and $g$. Since once $L^\infty(\Om)$ is there then one can use the result given by Ros-Oton \cite{RS,silves} coupled with Hardy-Littlewood-Sobolev inequality, to prove the desired regularity results. To prove the $L^\infty(\Om)$ bound, we develop an unified approach handling both subcritical and critical case of the perturbation $g$. In this article we also provide an answer to the regularity of weak solutions to doubly nonlocal equation involving singular nonlinearity, particularly problem \eqref{ch34}. The existence and multiplicity of solutions to problem \eqref{ch34}, is specially address in \cite{jds}. The novelty of the obtained results here is that they hold true for all $\mu<N$, contrasting to previous regularity results in literature. The techniques and tools which are used here to prove the $L^\infty(\Om)$ estimate are contemporary and new. Precisely, we extend further the classical Brezis-Kato techniques \cite{kato} to improve the integrability of weak solutions to (P). In addition, we mention that to the best of our knowledge, there is no article which establish the proof of $L^\infty(\Om)$ bound to problem involving singular nonlinearity. The results in this article can be used similarly to Laplacian operator (that is, $s=1$) and are also new to the literature. The second part of this article is destined to prove the $H^s$ versus $C^0$- weighted minimizers. That is, we show that the local minima with respect to $C_d^0(\overline{\Om})$ topology will also be a local minima with respect to $X_0$ topology. In variational problems this result illustrate a significant role as it helps to prove that the solutions to constraint minimization of the energy functional emerge as solutions to unconstraint local minimization of the energy functional. This procedure of constraint minimizations has ample amount of applications such as to prove the existence and multiplicity of solutions to elliptic problems, for instance see Theorem \ref{thmch4}. In case of local framework this result was first done by Brezis and Nirenberg \cite{niren}. Here authors prove that local minima in $C^1 $ will remain so in $H^1$ topology despite of the fact that latter one is weaker than the former one. In fractional framework, this result is proved by Iannizzotto, Mosconi and Squassina \cite{squassina}. But in case of nonlocal nonlinearity, in particular, Choquard equation, a particular case to our result had been answered by \cite{yangjmaa} for the Laplacian operator. For the general nonlinearity, this issue is recently posed as an open problem in \cite{ts}. In this article, we also provide a full answer to this open problem. Since there is significant amount of difference in handling doubly nonlocal problem, so we cannot stick around the tools given in \cite{niren,squassina} to establish the result. \begin{Remark} We would like to remark that the results of our article can be adapted to the following fractional Schr\"odinger problem \begin{equation*} (-\De)^s u + Vu =g(x,u)+ \left(\ds \int_{\Om}\frac{F(u)(y)}{|x-y|^{\mu}}dy\right) f(u) \; \text{in}\; \Om, u=0 \; \text{ in } \R \setminus \Om, \end{equation*} where $ V\in L^2(\Om)$ and $ (-\De)^s + V$ should be coercive in the energy space $X_0$. \end{Remark} \section{Functional framework and main results} This section of the article is intended to provide the fractional Sobolev space setting. For the complete and rigid details, one can refer \cite{nezzaH,servadei}. Further in this section we state the main results of current article with a short sketch of proof. \\ For $0<s<1$, the fractional Sobolev space is defined as \begin{align*} H^{s}(\R)= \left\lbrace u \in L^2(\R): \int_{\R}\int_{\R} \frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}}~dxdy <+ \infty \right\rbrace \end{align*} \noi endowed with the norm \begin{align*} \|u\|_{H^{s}(\R)}:= \|u\|_{L^2(\R)}+ [u]_{H^s(\mathbb R^N)} = \|u\|_{L^2(\R)}+\left(\int_{\R}\int_{\R} \frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}}~dxdy \right)^{\frac{1}{2}}. \end{align*} \noi Consider the space \begin{align*} X_0:= \{u \in H^{s}(\R): u=0 \text{ a.e in } \R \setminus \Om \} \end{align*} equipped with the norm \begin{align*} \ld u,v \rd = \int_{Q} \frac{(u(x)-u(y))(v(x)-v(y))}{|x-y|^{N+2s}}~dxdy \end{align*} where $ Q= \R \setminus (\Om^c\times \Om^c)$. From the embedding results (\cite{servadei}), the space $X_0$ is continuously embedded into $L^r(\R)$ with $ r\in [1,2^*_s]$ where $2^*_s= \frac{2N}{N-2s}$. The best constant $S_s$ is defined \begin{align}\label{ch27} S_s= \inf_{u \in X_0\setminus \{ 0\}} \frac{\int_{\R}\int_{\R} \frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}}~dxdy }{\left( \int_{ \Om} |u|^{2^*_s}~dx\right)^{2/2^*_s}}. \end{align} Let $d: \overline{\Om} \ra \mathbb{R}_+ $ by $d(x):= \text{dist}(x,\R\setminus \Om),\; x \in \overline{\Om}$. The best constant $S_H$ is defined as \begin{align}\label{ch35} S_H= \inf_{u \in X_0\setminus \{ 0\}} \frac{\int_{\R}\int_{\R} \frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}}~dxdy }{ \int_{ \Om}\frac{ |u|^{2}}{d^{2s}}~dx}. \end{align} Now we define the weighted H\"older-type spaces \begin{align*} & C^0_d(\overline{\Om}) := \bigg \{ u \in C^0(\overline{\Om}): u/d^s \text{ admits a continuous extension to } \overline{\Om} \bigg\},\\ & C^{0,\al}_d(\overline{\Om}) := \bigg \{ u \in C^0(\overline{\Om}): u/d^s \text{ admits a } \al \text{ -H\"older continuous extension to } \overline{\Om} \bigg\} \end{align*} endowed with the norms \begin{align*} \|u\|_{0,d}:= \|u/d^s\|_{\infty}, \quad \|u\|_{\al,d}:= \|u\|_{0,d}+ \sup_{x, y \in \overline{\Om}, x\not = y } \frac{|u(x)/(x)d^s- u(y)/d(y)^s|}{|x-y|^{\al}} \end{align*} respectively. We assume that $f$ satisfies the following growth conditions throughout the current article.\\ $(\mc F) \quad F\in C^1(\mathbb{R},\mathbb{R})$, $ F^\prime= f$ and there exists $C>0$ such that for all $t\in \mathbb R$, \begin{align*} |tf(t)| \leq C(|t|^{\frac{2N-\mu}{N}}+ |t|^{\frac{2N-\mu}{N-2s}}). \end{align*} \begin{Definition} A function $u\in X_0$ with $u\equiv 0$ in $\mathbb R^N \backslash \Omega$ is said to be a solution to (P) if \begin{equation*} \int_{Q} \frac{(u(x)-u(y))(\phi(x)-\phi(y))}{|x-y|^2}~dxdy= \la\int_{\Om} g(x,u )\phi ~dx + \iint_{\Om\times \Om} \frac{F(u)f(u)}{|x-y|^\mu} \phi ~dxdy \end{equation*} for all $\phi \in X_0$. \end{Definition} Let $G(x,u) = \int_{0}^{u} g(x, \tau )~d\tau$ then functional associated with problem $(P)$ is defined as \begin{align*} J(u) = \frac{\|u\|^2}{2}-\int_{\Om}G(x,u)~dx -\frac{1}{2} \iint_{\Om\times \Om} \frac{F(u)F(u)}{|x-y|^\mu} ~dxdy, \text{ for all } u \in X_0. \end{align*} With this functional framework, we state the main results of the article. First we state the result about the regularity of weak solution to problem $(P)$. \begin{Theorem}\label{thmch1} Let $ g: \overline{\Om} \times \mathbb{R} \ra \mathbb{R}$ be a Carath\'eodory function satisfying \begin{align*} g(x, u) = O(|u|^{2^*_s-1}), & \text{ if } |u|\ra \infty \end{align*} uniformly for all $ x \in \overline{\Om}$. Then any solution $u \in X_0$ of $(P)$ belongs to $L^\infty(\R) \cap C^s(\R)$. Furthermore, there exists positive constant $C$ depending on $N,\mu, s, |\Om|$ such that\\ $|u|_\infty\leq C (1+|u|_{2^*_s})^{\frac{2}{(2^*-1)(2^*-2)}}\left( 1+ \left( (1+|u|_{2^*_s}) \left(|u|_{2^*_s}^{2^*_s} + R^{2^*_s} |u|_{2^*_s-1}^{2^*_s-1} \right) \right)^{\frac{2^*_s}{2}} \right)^{\frac{2}{2^*_s(2^*_s-1)}}$ and $R>0$ large enough such that $ \left( \int_{|u|>R} |u|^{2^*_s} ~dx\right)^{\frac{2^*_s-2}{2^*_s}} \leq \frac{1}{2 C (1+|u|_{2^*_s})}.$ \end{Theorem} Next we consider the regularity for singular problems. \begin{Theorem}\label{thmch2} Let $ q \in (0,1)$ and $ g(x,u)=u^{q-1}$. Then any positive solution $u \in X_0$ of $(P)$ belongs to $L^\infty(\R) \cap C^s(\R)$. Moreover, there exists $C>0 $ depending on $N,\mu, s $ and $|\Om|$ and a positive constant $C_1$ s.t. \begin{align*} |u|_{\infty} \leq 1+ C_1\mc S_1^{\frac{2}{(2^*-1)(2^*-2)}}\left( 1+ \left( \mc S_1\left(|(u-1)^+|_{2^*_s}^{2^*_s} + R^{2^*_s} |(u-1)^+|_{2^*_s-1}^{2^*_s-1} \right) \right)^{\frac{2^*_s}{2}} \right)^{\frac{2}{2^*_s(2^*_s-1)}} \end{align*} with $\mc S_1= \max\{ 1, C(N,\mu ,|\Om|) |u|_{2^*_s} \}$, $R>0$ such that $\left( \int_{|u|>R} |(u-1)^+|^{2^*_s} ~dx\right)^{\frac{2^*_s-2}{2^*_s}} \leq \frac{1}{2(2^*_s+1)\mc S_1}.$ \end{Theorem} \begin{Remark} Replacing $u^{q-1}$ by $g(x,u)$ with $g:\Om\times \mathbb R^+\backslash\{0\}\to \mathbb R^+$ satisfying $g(x,t)t^{1-q}$ uniformly bounded as $t\to 0^+$ and $t\to g(x,t)$ nonincreasing for a.e $x\in \Om$, then Theorem \ref{thmch2} holds. \end{Remark} To achieve the intended goal in the above results, we first prove the non local version of Brezis-Kato estimates (See Lemma \ref{lemch3} and \ref{lemch4}) in a similar manner as in \cite{kato, moroz2}. Subsequently we construct a sequence of coercive, bilinear maps. This sequence allows us to further construct a sequence of function $u_n$ will converge weakly to $u$ (weak solution to $(P)$). Then we inherit some classical technique of Brezis-Kato \cite{kato, moroz2}. We prove that $u_n \in L^p(\Om) $ with $2^*_s<p< p_0$ for some $p_0$. Consequently, $u \in L^p(\Om) $ with $2^*_s<p< p_0$. Using these estimates, we establish \begin{align*} \int_{\Om}\frac{F(u(y))}{|x-y|^{\mu}}dy \in L^\infty(\Om). \end{align*} Then by Moser iterations proved established in Lemma \ref{lemch5}, we prove that $u \in L^\infty(\Om) $. For the $C^{0,\al}(\overline{\Om})$ regularity we can conclude by using Ros-Oton and Serra \cite{RS} mentioned above. We mention here that the construction of the bilinear forms for the Theorem \ref{thmch2} is most sensitive part and require more technicality. We remark that if we use Moser iterations without employing the method we present above then we can achieve $ L^\infty(\Om) $ bound of weak solutions to $(P)$ under the additional assumption $\mu < \min \{N, 4s \}$ and $f= |u|^{\frac{N-\mu+2}{N-2s}}$, see for instance \cite{jds}. To incorporate the case $\mu \geq \min \{N, 4s \}$, we develop the above stated unified course of steps. The second main aim of this paper is to give an application of $L^\infty(\Om)$ estimate. In that direction we have the following. \begin{Theorem}\label{thmch3} Let $ g: \overline{\Om} \times \mathbb{R} \ra \mathbb{R}$ be a Carath\'eodory function satisfying \begin{align*} g(x, u) = O(|u|^{2^*_s-1}), & \text{ if } |u|\ra \infty \end{align*} uniformly for all $ x \in \overline{\Om}$. Let $v_0 \in X_0$. Then the following assertions holds are equivalent: \begin{itemize} \item[(i)] there exists $\e>0 $ such that $ J(v_0+v) \geq J(v_0) $ for all $ c\in X_0,\; \|v\|\leq \e$. \item[(ii)] there exists $\rho>0$ such that $J(v_0+ v) \geq J(v_0)$ for all $ v \in X_0 \cap C^0_d(\overline{\Om})$, $\|v\|_{0,\de}\leq \rho$. \end{itemize} \end{Theorem} To prove the above result we have modified the techniques which have been developed by \cite{niren,squassina}. As an application of the $H^s$ versus $C^0$- weighted minimizers, in section 6, we proved the existence of weak solution to Choquard equation, which is also a local minimizer in $X_0$ topology (See Theorem \ref{thmch4}). To prove the desired result, instead by trapping the nonlinearity between sub and supersolution, we generalize Perron's method for the doubly nonlocal problem \cite[Theorem 2.4]{struwe2}. An advantage to proceed by this alternative method is that we don't need strong assumptions on sub and supersolution except the fact, they belong to $X_0$. For simplicity of illustration, we set some notations. We denote $\|u\|_{L^p(\Om)} $ by $|u|_p$ and $\|u\|_{X_0}$ by $\|u\|$. $B^X_\rho(u),\bar{B}^X_\rho(u)\;(B^d_\rho(u),\bar{B}^d_\rho(u))$ denote the open and closed ball, centered at $u$ with radius $\rho$, respectively in $X_0\;(C^0_d(\overline{\Om}))$. The positive constant $C$ values change case by case. Rest of the paper organized as follows: In section 3, we give some preliminary results. In section 4, we give some technical lemmas which will help us to prove the main theorems of the paper. In section 5, we prove the Theorem \ref{thmch1} and \ref{thmch2}. In section 6, we give the proof of Theorem \ref{thmch3} and provide an application to Theorem \ref{thmch3}. \section{Preliminary results} In this section we contribute some preliminary results, though rather straightforward, do not appear explicitly in former literature, and are worthy to archive them here. \\ The Hardy-Littlewood-Sobolev Inequality, foundational in study of Choquard equation is stated here. \begin{Proposition} \cite{leib} Let $t,r>1$ and $0<\mu <N$ with $1/t+\mu/N+1/r=2$, $f\in L^t(\mathbb{R}^N)$ and $h\in L^r(\mathbb{R}^N)$. There exists a sharp constant $C(t,r,\mu,N)$ independent of $f,h$, such that \begin{equation*}\label{co9} \int_{\mathbb{R}^N}\int_{\mathbb{R}^N}\frac{f(x)h(y)}{|x-y|^{\mu}}~dydx \leq C(t,r,\mu,N) |f|_{t}|h|_{r}. \end{equation*} \end{Proposition} \begin{Lemma}\label{lemch3} If $V\in L^\infty(\Om)+ L^{N/2s}(\Om)$ then for every $\e>0$ there exists $C_\e$ such that for every $u \in X_0$, we have \begin{align*} \int_{ \Om} V|u|^2~dx \leq \e^2 \|u\|^2+ C_\e \int_{ \Om}|u|^2~dx. \end{align*} \end{Lemma} \begin{proof} Let $V=V_1+V_2$ where $V_1 \in L^\infty(\Om)$ and $V_2 \in L^{N/2s}(\Om)$. For each $k>0$ we have \begin{align*} \int_{ \Om} V|u|^2~dx & \leq \|V_1\|_{L^\infty(\Om)}\int_{ \Om}|u|^2~dx + k \int_{|V_2|\leq k} |u|^2~dx + \int_{|V_2|> k} |V_2||u|^2~dx\\ &\leq \|V_1\|_{L^\infty(\Om)}\int_{ \Om}|u|^2~dx + k \int_{|V_2|\leq k} |u|^2~dx + S^{-1}_s \left(\int_{|V_2|> k} |V_2|^{N/2s}~dx\right)^{2s/N}\|u\|^2 \end{align*} where $S_s$ is the best constant of the embedding $X_0$ into $L^{\frac{2N}{N-2s}}.$ For a given $\e>0$, choose $k>0$ such that \begin{align*} S^{-1}_s \left(\int_{|V_2|> k} |V_2|^{N/2s}~dx\right)^{2s/N} < \e^2. \end{align*} It implies that \begin{align*} \int_{ \Om} V|u|^2~dx & \leq \e^2\|u\|^2+ C_\e \int_{ \Om}|u|^2~dx. \end{align*} \QED \end{proof} \begin{Lemma}\label{lemch4} \cite[Lemma 3.3]{moroz2} Let $p,q,r,t \in [1,\infty)$ and $\la \in [0,2]$ such that \begin{align*} 1+\frac{N-\mu}{N}-\frac{1}{p} -\frac{1}{t} = \frac{\la}{q}+ \frac{2-\la}{r}. \end{align*} If $\theta \in (0,2)$ satisfies \begin{align*} & \min\{ q,r\} \left(\frac{N-\mu}{N}-\frac{1}{p} \right)< \theta < \max\{ q,r\} \left(1-\frac{1}{p} \right)\\ & \min\{ q,r\} \left(\frac{N-\mu}{N}-\frac{1}{t} \right)< 2-\theta < \max\{ q,r\} \left(1-\frac{1}{t} \right) \end{align*} then for $H \in L^p(\R), K \in L^t(\R)$ and $ u \in L^q(\R) \cap L^r(\R)$, \begin{align*} \int_{ \R}(|x|^{-\mu}* (H|u|^{\theta}))K|u|^{2-\theta}~ dx \leq C \|H\|_{L^p(\mathbb R^N)} \|K\|_{L^t(\mathbb R^N)} \left( \int_{ \R} |u|^q\right)^{\la/q} \left( \int_{ \R} |u|^r\right)^{\frac{(2-\la)}{r}} . \end{align*} \end{Lemma} \begin{Lemma}\label{lemch1} Let $N\geq 2s ,\; 0<\mu<N$ and $\theta \in (0,2)$. If $H,\; K \in L^{\frac{2N}{N-\mu+2s}}(\R) + L^{\frac{2N}{N-\mu}}(\R) $ and $ 1-\frac{\mu}{N} < \theta <1+ \frac{\mu}{N}$ then for every $\e>0$ there exists $C_{\e,\theta} \in \mathbb{R}$ such that for every $u \in H^s(\R)$, \begin{align*} \int_{ \R}(|x|^{-\mu}* (H|u|^{\theta}))K|u|^{2-\theta}~ dx \leq \e^2 \left(\int_{ \mathbb{R}^{2N}}\frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}}~dxdy\right)^2 + C_{\e,\theta} \int_{ \R}|u|^2~ dx. \end{align*} \end{Lemma} \begin{proof} We follow the proof of \cite[Lemma 3.2]{moroz2} in the nonlocal framework. Let $H= H_1+H_2$ and $K= K_1+K_2$ with $H_1,K_1 \in L^{\frac{2N}{N-\mu}}(\R)$ and $H_2, K_2 \in L^{\frac{2N}{N-\mu+2s}}(\R)$. Now using Lemma \ref{lemch4} iteratively with appropriate values of $p,q,r,t, \theta$ and $\la$ (See \cite[Lemma 3.2]{moroz2}), we have \begin{align*} \int_{ \R}(|x|^{-\mu}* (H|u|^{\theta}))K|u|^{2-\theta}~ dx & \leq C \left( |H_2|_{\frac{2N}{N-\mu+2s}} + |K_2|_{\frac{2N}{N-\mu+2s}} \right)^2 \left(\int_{ \mathbb{R}^{2N}}\frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}}~dxdy\right)^2\\& \quad + C \left( |H_1|_{\frac{2N}{N-\mu}} + |K_1|_{\frac{2N}{N-\mu}} \right)^2 \int_{ \R}|u|^2~ dx. \end{align*} For given $\e>0$, choose $H_2, K_2$ such that \begin{align*} |H_2|_{\frac{2N}{N-\mu+2s}} , |K_2|_{\frac{2N}{N-\mu+2s}} < \frac{\e}{2\sqrt{C}}. \end{align*} Therefore, the result holds. \QED \end{proof} \begin{Lemma}\label{lemch2} For $a,b \in \mathbb R, r\geq 2 , k\geq 0 $, we have \begin{align*} \frac{4(r-1)}{r^2} \left( |a_k|^{r/2} -|b_k|^{r/2}\right)^2 \leq (a-b)(a_k|a_k|^{r-2}-b_k|b_k|^{r-2}) \end{align*} where \begin{align*} a_{k} = \max\{-k , \min\{ a,k\} \}=\left\{ \begin{array}{ll} -k , & \text{ if } a\leq -k, \\ a, & \text{ if } -k< a<k,\\ k , & \text{ if } a\geq k. \\ \end{array} \right. \end{align*} \end{Lemma} \begin{proof} From \cite[Lemma 3.1]{squassina}, we have \begin{align}\label{ch1} \frac{4(r-1)}{r^2} \left( a|a_k|^{\frac{r}{2}-1} -b|b_k|^{\frac{r}{2}-1} \right)^2 \leq (a-b)(a_k|a_k|^{r-2}-b_k|b_k|^{r-2}). \end{align} By symmetry of the inequality, it is enough to show that result hold for $a\leq b$. For this, let $a= a_k $ and $b=b_k$ in \eqref{ch1}, we have \begin{align*} \frac{4(r-1)}{r^2} \left( a_k|a_k|^{\frac{r}{2}-1} -b_k|b_k|^{\frac{r}{2}-1} \right)^2 \leq (a_k-b_k)(a_k|a_k|^{r-2}-b_k|b_k|^{r-2}). \end{align*} \begin{enumerate} \item[Case 1:] $0\leq b<a$\\ Clearly $0\leq b_k< a_k$ and $a_k-b_k \leq a-b$. This implies \[(a_k-b_k)(a_k|a_k|^{r-2}-b_k|b_k|^{r-2}) \leq (a-b)(a_k|a_k|^{r-2}-b_k|b_k|^{r-2}).\] \item[Case 2:] $b\leq 0 \leq a$\\ Again notice that $b_k\leq 0\leq a_k , a_k-b_k \leq a-b $ and $ a_kb_k \leq |a_kb_k|$ we have \[(a_k-b_k)(a_k|a_k|^{r-2}-b_k|b_k|^{r-2}) \leq (a-b)(a_k|a_k|^{r-2}-b_k|b_k|^{r-2})\] and \[\left( |a_k|^{r/2} -|b_k|^{r/2}\right)^2 \leq \left( a_k|a_k|^{\frac{r}{2}-1} -b_k|b_k|^{\frac{r}{2}-1} \right)^2.\] Hence the proof. \QED \end{enumerate} \end{proof} \section{Technical results} This section is devoted to the study of weak solutions to the following problem \begin{equation*} (P_1)\; \left\{\begin{array}{rllll} (-\De)^s u &=g(x,u)+ \left(\ds \int_{\Om}\frac{H(y)u(y)}{|x-y|^{\mu}}dy\right) K(x) \; \text{in}\; \Om,\\ u&=0 \; \text{ in } \R \setminus \Om, \end{array} \right. \end{equation*} where $H, K \in L^{\frac{2N}{N-\mu+2s}}(\Om) + L^{\frac{2N}{N-\mu}}(\Om) $. Here we use the results, established in last section to improve the integrability regularity of weak solutions to the above mentioned problem. \begin{Proposition}\label{Propch1} Let $H, K \in L^{\frac{2N}{N-\mu+2s}}(\Om) + L^{\frac{2N}{N-\mu}}(\Om) $. Let $g: \overline{\Om} \times \mathbb{R} \ra \mathbb{R}$ be a continuous function satisfying \begin{align*} g(x, u) = O(|u|^{2^*_s-1}), & \text{ if } |u|\ra \infty \end{align*} uniformly for all $ x \in \overline{\Om}$. Then any solution $u \in X_0$ of the problem $(P_1)$ belongs to $L^r(\Om)$ where $r \in [2, \frac{2N^2}{(N-\mu)(N-2s)})$. \end{Proposition} \begin{proof} For $\theta=1 $ in Lemma \ref{lemch1}, there exists $\al >0$ such that for every $ \phi \in X_0$, \begin{align}\label{ch2} \int_{ \Om} \int_{\Om}\frac{|H(y)\phi(y)K(x)\phi(x)|}{|x-y|^{\mu}}~dxdy \leq \frac12 \left(\int_{ Q}\frac{|\phi(x)-\phi(y)|^2}{|x-y|^{N+2s}}~dxdy\right)^2 + \frac{\al}{2} \int_{ \Om}|\phi|^2~ dx. \end{align} If $3\leq 2^*_s\leq 2^*_s$ then $|u|^{2^*_s-2} \in L^{N/2s}(\Om)$. If $2<2^*_s<3$ then choose $p>1$ such that $1\leq \frac{p(2^*_s-2)N}{2s}\leq 2^*_s$ then using H\"older's inequality gives us \begin{align*} \left( \int_{\Om} |u|^{\frac{(2^*_s-2)N}{2s}}~dx\right)^{2s/N} \leq C \left( \int_{ \Om} |u|^{\frac{p(2^*_s-2)N}{2s}}~dx\right)^{2s/Np}<\infty. \end{align*} Choose $L_1>0$ such that $ \left( \int_{|u|>L_1} |u|^{\frac{(2^*_s-2)N}{2s}}~dx\right)^{2s/N} \leq \frac{S_s}{2}$ where $S_s$ is the best Sobolev constant defined in \eqref{ch27}. Since $g(x,u)= O(|u|^{2^*_s-1})$ for $u$ large enough, there exist $L/2> L_1>0$ such that $ g(x,u)\leq |u|^{2^*_s-1}$ uniformly for $x \in \overline{\Om}$ and $|u|>L/2$. Define $\eta \in C_c^\infty[0,\infty)$ such that $0\leq \eta\leq 1$ and \begin{align*} \eta(u) = \left\{ \begin{array}{ll} 1 , & \text{ if } |u|< L/2, \\ 0, & \text{ if } |u|>L. \end{array} \right. \end{align*} Define $V:= (1-\eta) \frac{g(x,u)}{u}$ and $T := \eta g(x,u)+ \al u $. By the choice of $\eta$, we obtain \begin{align}\label{ch28} |V|_{N/2s}< S_s/2 \text{ and } T \in X_0^\prime. \end{align} Observe that $u$ is the unique solution to the following problem \begin{equation*} (-\De)^s u + \al u =Vu+ \left(\ds \int_{\Om}\frac{H(y)u(y)}{|x-y|^{\mu}}dy\right) K +T \; \text{in}\; \Om,u=0 \; \text{ in } \R \setminus \Om. \end{equation*} Choose sequence $ \{ H_n \}_{n\in \N}$ and $\{ K_n \}_{n\in \N}$ in $L^{\frac{2N}{N-\mu}}(\Om)$ such that $|H_n |\leq |H|,\; |K_n|\leq |K| $ and $H_n \ra H $, $K_n \ra K $ a.e in $\Om$. For each $ n\in \N$, $V_n$ denotes the truncated potential defined as $V_n= V$ if $|V|\leq n$ and $V_n = n $ if $|V|>n$. Now we introduce the bilinear form \begin{align*} B_n(v, w )= & \int_{ Q} \frac{(v(x)-v(y))(w(x)-w(y))}{|x-y|^{N+2s}}~dxdy +\al \int_{ \Om} vw~dx \\& \quad - \int_{ \Om} \int_{\Om}\frac{H_n(y)v(y)K_n(x)w(x)}{|x-y|^{\mu}}~dxdy- \int_{ \Om}V_n vw~dx. \end{align*} In view of H\"older's inequality, Sobolev embedding, \eqref{ch28} and \eqref{ch2}, one can easily conclude that $ B_n$ is continuous coercive bilinear form. Hence by Lax-Miligram Lemma (See \cite[Corollary 5.8]{brezis}) there exists a unique $u_n \in X_0$ such that for all $w \in X_0$ we have \begin{align}\label{ch3} B_n(u_n, w)= \int_{ \Om}T w~dx . \end{align} Subsequently, $u_n$ is a unique solution to the problem \begin{equation}\label{ch12} (-\De)^s u_n + \al u_n = \left(\ds \int_{\Om}\frac{H_n(y)u_n(y)}{|x-y|^{\mu}}dy\right) K_n +V_nu_n +T \; \text{in}\; \Om, u_n=0 \; \text{ in } \R \setminus \Om. \end{equation} Furthermore, using \eqref{ch3} we can easily prove that $u_n $ is a bounded sequence in $X_0$. It implies that up to a subsequence, $u_n \rp u$ weakly in $X_0$. Let $u_{n, \tau}= \max\{-\tau , \min\{ u_n,\tau \} \} $ for $ \tau>0$ and $x \in \Om$. Testing Problem \eqref{ch12} with $ \phi = |u_{n, \tau}|^{r-2} u_{n, \tau} \in X_0$ ($2\leq r< \frac{2N}{N-\mu}$), with the help of Lemma \ref{lemch2}, we get \begin{equation}\label{ch6} \begin{aligned} & \frac{4(r-1)}{r^2} \| |u_{n, \tau}|^{r/2}\|^2 + \al \int_{ \Om} || u_{n, \tau}|^{r/2}|~dx \\ & \leq \int_{Q} \frac{(u_n(x)-u_n(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}~dxdy + \al \int_{ \Om} u_n \phi~dx \\ & = \int_{\Om} \int_{ \Om} \frac{H_n(y)u_n(y)K_n(x) |u_{n, \tau}|^{r-2} u_{n, \tau} }{|x-y|^{\mu}}dy + \int_{ \Om} V_n u_n |u_{n, \tau}|^{r-2} u_{n, \tau}~dx + \int_{\Om}T |u_{n, \tau}|^{r-2} u_{n, \tau}~dx. \end{aligned} \end{equation} Using Lemma \ref{lemch1} with $\e^2 =\frac{(r-1)}{r^2}$, we obtain \begin{equation}\label{ch7} \begin{aligned} \int_{\Om} \int_{ \Om} \frac{H_n(y)u_n(y)K_n(x) |u_{n, \tau}|^{r-2} u_{n, \tau} }{|x-y|^{\mu}}dxdy & \leq \int_{\Om} \int_{ \Om} \frac{|H_n(y)u_{n,\tau}(y)||K_n(x)| |u_{n, \tau}(x)|^{r-1} }{|x-y|^{\mu}}dxdy\\ & + \int_{E_{n,\tau}} \int_{ \Om} \frac{|H_n(y)u_{n}(y)||K_n(x)| |u_{n}(x)|^{r-1}}{|x-y|^{\mu}}dxdy \\ &\leq \frac{(r-1)}{r^2} \||u_{n \tau}|^{r/2}\|^2 + C_r \int_{ \Om}|u_{n, \tau}|^{r}~dx \\ & + \int_{E_{n,\tau}} \int_{ \Om} \frac{|H_n(y)u_{n}(y)||K_n(x)||u_{n}(x)|^{r-1}}{|x-y|^{\mu}}dxdy \end{aligned} \end{equation} where $E_{n,\tau}= \{ x \in \mathbb{R}^N : |u_n(x)|\geq \tau \}$. By Hardy-Littlewood-Sobolev inequality and H\"older's inequality, we have \begin{align}\label{ch5} \int_{E_{n,\tau}} \int_{ \Om} \frac{|H_n(y)u_{n}(y)||K_n(x)||u_{n}(x)|^{r-1}}{|x-y|^{\mu}}dxdy\leq C \left( \int_{ \R} \bigg||K_n||u_n|^{r-1}\bigg|^j~ d \xi\right)^{\frac{1}{j}}\left( \int_{E_{n,\tau}} |H_nu_n|^l~ d \xi\right)^{\frac{1}{l}} \end{align} where $j$ and $l$ satisfy the relation $\frac{1}{j}= 1+ \frac{N-\mu}{2N}-\frac{1}{r}$ and $\frac{1}{l}= \frac{N-\mu}{2N}+\frac{1}{r}$. Using the fact that $H_n, K_n \in L^{\frac{2N}{N-\mu}}(\Om)$ and again the H\"older's inequality, $u_n \in L^r(\R)$ implies that $|K_n||u_n|^{r-1} \in L^j(\R)$ and $ |H_nu_n| \in L^l(\R)$. Therefore, as $\tau\ra \infty$, \eqref{ch5} gives \begin{align}\label{ch8} \lim_{\tau \ra \infty}\int_{E_{n,\tau}} \int_{ \Om} \frac{|H_n(y)u_{n}(y)||K_n(x)||u_{n}(x)|^{r-1}}{|x-y|^{\mu}}dxdy =0. \end{align} Using the Sobolev inequality, \eqref{ch6}, \eqref{ch7} and \eqref{ch8}, we have \begin{equation}\label{ch13} \begin{aligned} \frac{3(r-1)S_s}{r^2}& \left( \int_{ \Om} |u_{n,\tau}|^{\frac{rN}{(N-2s)}}~dx\right)^{\frac{N-2s}{N}}\\ & \leq C_r \int_{ \Om}|u_{n}|^{r} + \int_{E_{n,\tau}} \int_{ \Om} \frac{|H_n(y)u_{n}(y)||K_n(x)||u_{n}(x)|^{r-1}}{|x-y|^{\mu}}dxdy \\ & \quad + \int_{ \Om} V_n u_n |u_{n, \tau}|^{r-2} u_{n, \tau}~dx + \int_{\Om}g |u_{n, \tau}|^{r-2} u_{n, \tau}~dx. \end{aligned} \end{equation} Employing the fact that $g$ is a Carath\'eodory function, \begin{equation}\label{ch14} \begin{aligned} \int_{\Om}T |u_{n, \tau}|^{r-2} u_{n, \tau}~dx & \leq \int_{|u|\leq L }g(x,u) |u_{n}|^{r-1} ~dx + \al \int_{\Om} u |u_{n, \tau}|^{r-1} ~dx \\ & \leq C(L_1) \left( \int_{\Om} |u|^{r} ~dx + \int_{\Om} |u_{n}|^{r} ~dx\right). \end{aligned} \end{equation} By Lemma \ref{lemch3} for $\e^2 = \frac{r-1}{r^2}$, we have \begin{equation}\label{ch15} \begin{aligned} \int_{ \Om} V_n u_n |u_{n, \tau}|^{r-2} u_{n, \tau}~dx & \leq 2 \int_{E_{n,\tau}} V_n |u_{n}|^{r} ~dx + \int_{ \Om} V_n |u_{n, \tau}|^{r} ~dx \\ & \leq \frac{(r-1)}{r^2} \||u_{n \tau}|^{r/2}\|^2 + C_r \int_{ \Om}|u_{n, \tau}|^{r}~dx + 2 \int_{E_{n,\tau}} V_n |u_{n}|^{r} ~dx. \end{aligned} \end{equation} Using Dominated Convergence theorem, one can easily shows that $\ds \lim_{\tau \ra \infty} \int_{E_{n,\tau}} V_n |u_{n}|^{r} ~dx=0$. Now taking into account \eqref{ch13}, \eqref{ch14}, \eqref{ch15} and letting $\tau \ra \infty$, we have \begin{equation*} \begin{aligned} \left( \int_{ \Om} |u_{n}|^{\frac{rN}{(N-2s)}}~dx\right)^{\frac{N-2s}{N}} & \leq C_r \left( \int_{\Om}|u_{n}|^r~dx + \int_{\Om}|u|^r~dx \right). \end{aligned} \end{equation*} Therefore, \begin{align*} \limsup_{n \ra \infty} \left( \int_{ \Om} |u_{n}|^{\frac{rN}{(N-2s)}}~dx\right)^{\frac{N-2s}{N}} \leq C_r \limsup_{n \ra \infty} \left( \int_{\Om}|u_{n}|^r~dx + \int_{\Om}|u|^r~dx \right). \end{align*} Hence, by iterating a finite number of times, we infer that $ u \in L^q(\Om)$ for all $ q\in \left[2, \frac{2N^2}{(N-\mu)(N-2s)}\right) $. Moreover, there exists a positive constant $C(q,N,\mu, |\Om|)$ such that $|u|_q\leq C(q,N,\mu, |\Om|) |u|_{2^*_s}$. \QED \end{proof} \begin{Definition} For $\phi \in C^0(\overline{\Om})$ with $\phi >0$ in $\Om$, the set $C_\phi(\Om)$ is defined as \begin{align*} C_\phi(\Om)= \{ u \in C^0(\overline{\Om})\; :\; \text{there exists } c \geq 0 \text{ such that } |u(x)|\leq c\phi(x), \text{ for all } x \in \Om \}, \end{align*} endowed with the natural norm $\bigg\|\ds \frac{u}{\phi}\bigg\| _{L^{\infty}(\Om)}$. \end{Definition} \begin{Definition} The positive cone of $C_\phi(\Om)$ is the open convex subset of $C_\phi(\Om)$ defined as \begin{align*} C_\phi^+(\Om)= \left\{ u \in C_\phi(\Om)\; :\; \inf_{x \in \Om} \frac{u(x)}{\phi(x)}>0 \right\}. \end{align*} \end{Definition} \begin{Proposition}\label{propch1} \cite[Theorem 1.2]{adi} Let $\phi_1 \in C^s(\R) \cap C^+_{d^s}(\Om)$ be the normalized eigenvalue of $(-\De)^s$ in $X_0$. If $q \in (0,1)$ then there exists a unique positive $ \underline{u} \in X_0 \cap C^+_{\phi_1}(\Om) \cap C_0(\overline{\Om}) $ classical solution to the following problem \begin{equation}\label{ch25} (-\De)^s u =u^{q-1},\; u>0 \; \text{in}\; \Om,\; u=0 \; \text{ in } \R \setminus \Om. \end{equation} \end{Proposition} \begin{Proposition}\label{Propch3} Let $ q \in (0,1), g(x,u)=u^{q-1}$ and $0 \leq H, K \in L^{\frac{2N}{N-\mu+2s}}(\Om) + L^{\frac{2N}{N-\mu}}(\Om) $. Let $ u \in X_0$ be a positive weak solution of problem $(P_1)$. Then $u \in L^p(\Om)$ where $p \in [2, \frac{2N^2}{(N-\mu)(N-2s)})$. \end{Proposition} \begin{proof} Since $0 \leq H, K,$ we see that $\underline{u}\in X_0$ is a subsolution to problem $(P_1)$. \\ \textbf{Claim:} $\underline{u}\leq u $ a.e in $\Om$. \\ Assuming by contradiction, assume that the Claim is not true. Since for any $ u \in X_0$ we have \begin{align*} \|u^+\|^2 \leq \int_{ Q} \frac{(u(x)-u(y))(u^+(x)-u^+(y))}{|x-y|^{N+2s}}~dxdy. \end{align*} Testing $(-\De)^s\underline{u}- (-\De)^s u\leq \underline{u}^{q-1}- u^{q-1} $ with $(\underline{u}-u)^+$, we obtain \begin{align*} 0\leq \|(\underline{u}-u)^+\|^2 & \leq \int_{ Q} \frac{((\underline{u}-u)^+(x)-(\underline{u}-u)^+(y))((\underline{u}-u)(x)-(\underline{u}-u)(y))}{|x-y|^{N+2s}}~dxdy\\ & \leq \int_{ \Om} ( \underline{u}^{q-1}- u^{q-1})(\underline{u}-u)^+~dx \leq 0. \end{align*} It implies $|\{ x \in \Om \; : \; \underline{u } \geq u \text{ a.e in } \Om \}| = 0$. It provides the expected contradiction. Hence $\underline{u}\leq u $ a.e in $\Om$.\\ Observe that using Proposition \ref{propch1}, for all $\ba >0$, we have \begin{align*} \chi_{\{u< \ba \} }u^{q-1}\leq \chi_{\{u< \ba \} }\frac{u}{\underline{u}^2} u^{q} < \chi_{\{u< \ba \} }\frac{u}{C_1^2\phi_1^2} \ba^{q} \leq \chi_{\{u< \ba \} }\frac{u}{C_1^2C_2^2d^{2s}} \ba^{q}. \end{align*} where $C_1$ and $C_2$ are appropriate positive constants. Hence we can choose $\de:= \de(\ba)>0$ such that $\chi_{\{u< \ba \} }u^{q-1}= \de(\ba) \chi_{\{u< \ba \} }\frac{u}{d^{2s}}$. Now choose $\ba >0$ such that $\ga_1:= \frac12 - S_{H} \de(\ba)>0$ and $\ga_2:= \frac{3(r-1)}{r^2} - S_{H}\de(\ba)>0$ for $2\leq r< \frac{2N}{N-\mu}$ and with $S_H$ defined on \eqref{ch35}. The choice of $\ba, \de(\ba)$ and Lax-Milgram Lemma, imply that $u$ is the unique solution of the following problem: \begin{equation*} (-\De)^s u+ \al u -\de(\ba) \chi_{\{u< \ba \} }\frac{u}{d^{2s}} = \left(\ds \int_{\Om}\frac{H(y)u(y)}{|x-y|^{\mu}}dy\right) K +\chi_{\{u\geq \ba \} }u^{q-1} + \al u \; \text{in}\; \Om, u=0 \; \text{ in } \R \setminus \Om \end{equation*} where $\al>0$ is chosen as in Proposition \ref{Propch1}. Now we will follow the same arguments as in Proposition \ref{Propch1} to achieve the result. Notice that $T= \chi_{\{u\geq \ba \} }u^{q-1} + \al u \in X_0^\prime$. For each $n \in \N$, we define the bilinear form \begin{align*} B_n(v, w )= & \int_{ Q} \frac{(v(x)-v(y))(w(x)-w(y))}{|x-y|^{N+2s}}~dxdy +\al \int_{ \Om} vw~dx \\& \quad - \int_{ \Om} \int_{\Om}\frac{H_n(y)v(y)K_n(x)w(x)}{|x-y|^{\mu}}~dxdy- \int_{ \Om}\de(\ba) \chi_{\{u< \ba \} }\frac{vw}{d^{2s}} ~dx. \end{align*} Using as the arguments as in Proposition \ref{Propch1}, there exist unique $u_n \in X_0$ such that for all $w \in X_0$ we have \begin{align*}\label{ch16} B_n(u_n, w)= \int_{ \Om}T w~dx. \end{align*} Moreover, $u_n$ is a unique solution to the problem \begin{equation*}\label{ch17} (-\De)^s u_n + \al u_n = \left(\ds \int_{\Om}\frac{H_n(y)u_n(y)}{|x-y|^{\mu}}dy\right) K_n +\de(\ba) \chi_{\{u< \ba \} }\frac{u_n}{d^{2s}} +T \; \text{in}\; \Om, u_n=0 \; \text{ in } \R \setminus \Om. \end{equation*} Clearly, $u_n \rp u$ weakly in $X_0$. Let $u_{n, \tau}= \max\{-\tau , \min\{ u_n,\tau \} \} $ for $ \tau>0$ and $x \in \Om$. Choose $ \phi = |u_{n, \tau}|^{r-2} u_{n, \tau} \in X_0$ ($2\leq r< \frac{2N}{N-\mu}$) as the test function in \eqref{ch12}. Using the same arguments as in Proposition \ref{Propch1}, we have \begin{equation}\label{ch18} \begin{aligned} \frac{3(r-1)S_s}{r^2}& \left( \int_{ \Om} |u_{n,\tau}|^{\frac{rN}{(N-2s)}}~dx\right)^{\frac{N-2s}{N}}\\ & \leq C_r \int_{ \Om}|u_{n}|^{r} + \int_{E_{n,\tau}} \int_{ \Om} \frac{|H_n(y)u_{n}(y)||K_n(x)||u_{n}(x)|^{r-1}}{|x-y|^{\mu}}dxdy \\ & \quad + \int_{ \Om}\de(\ba) \chi_{\{u< \ba \} }\frac{u_n}{d^{2s}}|u_{n, \tau}|^{r-2} u_{n, \tau}~dx + \int_{\Om}g |u_{n, \tau}|^{r-2} u_{n, \tau}~dx. \end{aligned} \end{equation} Consider \begin{equation}\label{ch19} \begin{aligned} \int_{\Om}T |u_{n, \tau}|^{r-2} u_{n, \tau}~dx & = \int_{ \Om} \chi_{\{u\geq \ba \} }(u^{q-1} + \al u) |u_{n, \tau}|^{r-2} u_{n, \tau}~dx\\ & \leq C(N,\mu , r, |\Om|) \left( \int_{\Om} |u|^{r} ~dx + \int_{\Om} |u_{n}|^{r} ~dx\right). \end{aligned} \end{equation} With the help of Hardy inequality, we have \begin{equation}\label{ch20} \begin{aligned} \int_{ \Om} \de(\ba) \chi_{\{u< \ba \} }\frac{u_n}{d^{2s}}|u_{n, \tau}|^{r-2} u_{n, \tau}~dx & \leq 2 \int_{E_{n,\tau}} \de(\ba) \frac{|u_{n}|^{r}}{d^{2s}} ~dx + \int_{ \Om} \frac{|u_{n, \tau}|^{r}}{d^{2s}}~dx \\ & \leq S_{H}\de(\ba) \||u_{n \tau}|^{r/2}\|^2 + 2 \int_{E_{n,\tau}} \de(\ba) \frac{|u_{n}|^{r}}{d^{2s}} ~dx . \end{aligned} \end{equation} Using Dominated Convergence theorem, it follows that $\ds \lim_{\tau \ra \infty} \int_{E_{n,\tau}} \frac{ \de(\ba)|u_{n}|^{r}}{d^{2s}} ~dx=0$. Now taking into account \eqref{ch18}, \eqref{ch19}, \eqref{ch20}, definition of $\ga_2$ and letting $\tau \ra \infty$, we have \begin{equation*} \begin{aligned} \left( \int_{ \Om} |u_{n}|^{\frac{rN}{(N-2s)}}~dx\right)^{\frac{N-2s}{N}} & \leq C(N,\mu , r, |\Om|) \left( \int_{\Om}|u_{n}|^r~dx + \int_{\Om}|u|^r~dx \right). \end{aligned} \end{equation*} Therefore, \begin{align*} \limsup_{n \ra \infty} \left( \int_{ \Om} |u_{n}|^{\frac{rN}{(N-2s)}}~dx\right)^{\frac{N-2s}{N}} \leq C(N,\mu , r, |\Om|) \limsup_{n \ra \infty} \left( \int_{\Om}|u_{n}|^r~dx + \int_{\Om}|u|^r~dx \right). \end{align*} Hence, $ u \in L^r(\Om)$ for all $ r\in \left[2, \frac{2N^2}{(N-\mu)(N-2s)}\right) $. As earlier we remark that there exists a positive constant $ C(N,\mu , q, |\Om|) $ such that $|u|_q\leq C(N,\mu , q, |\Om|) |u|_{2^*_s}$. \QED \end{proof} \begin{Remark} We highlight here that the next lemma investigates the $L^\infty(\Om)$ bound for the fractional Laplacian with critical Sobolev exponent. In \cite{servadei} authors already proved this type of result for a positive solution. Here we used the ideas form \cite{ squassina,servadei} to extend the result of \cite{servadei} to any weak solution. \end{Remark} \begin{Lemma}\label{lemch5} Let $u$ be any weak solution to the following problem \begin{align}\label{ch36} (-\De)^su = k(x,u) \text{ in } \Om,\; u=0 \text{ in } \R \setminus \Om \end{align} where $|k(x,u)|\leq C(1+|u|^{2^*_s-1})$ and $C>0$. Then $u \in L^\infty(\Om)$. \end{Lemma} \begin{proof} Let $u \in X_0$ be any weak solution to \eqref{ch36}. Let $u_\tau= \max\{-\tau , \min\{ u,\tau \} \} $ for $ \tau>0$. Let $ \phi = u|u_\tau|^{r-2} \in X_0$ ($ r\geq 2$) be a test function to problem \eqref{ch36}, then by inequality \eqref{ch1}, we deduce that \begin{equation}\label{ch37} \begin{aligned} |u|u_\tau|^{\frac{r}{2}-1}|^2_{2^*_s}& \leq C \|u|u_\tau|^{\frac{r}{2}-1}\|^2 \leq \frac{Cr^2}{r-1} \int_{Q} \frac{(u(x)-u(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}~dxdy\\ &\leq Cr \int_{ \Om} |k(x,u)||u ||u_\tau|^{r-2}~dx\\ & \leq Cr \int_{ \Om} |u ||u_\tau|^{r-2}+|u|^{2^*_s}|u_\tau|^{r-2} ~dx. \end{aligned} \end{equation} \textbf{Claim:} Let $r_1= 2^*_s+1$. Then $ u \in L^{\frac{2^*_s r_1}{2}}(\Om)$.\\ For this, consider \begin{equation}\label{ch38} \begin{aligned} \int_{ \Om} |u|^{2^*_s}|u_\tau|^{r_1-2} ~dx& = \int_{ |u|\leq R} |u|^{2^*_s}|u_\tau|^{r_1-2} ~dx+ \int_{|u|>R} |u|^{2^*_s}|u_\tau|^{r-2} ~dx\\ & \int_{ |u|\leq R} R^{2^*_s}|u_\tau|^{r_1-2} ~dx+\left(\int_{\Om}( u^2|u_\tau|^{r-2})^{\frac{2^*_s}{2}} ~dx\right)^{\frac{2}{2^*_s}} \left( \int_{|u|>R} |u|^{2^*_s} ~dx\right)^{\frac{2^*_s-2}{2^*_s}}. \end{aligned} \end{equation} Choose $R>0$ large enough such that \begin{align}\label{ch39} \left( \int_{|u|>R} |u|^{2^*_s} ~dx\right)^{\frac{2^*_s-2}{2^*_s}} \leq \frac{1}{2Cr_1}. \end{align} Taking into account \eqref{ch37}, \eqref{ch38} jointly with \eqref{ch39}, we obtain \begin{align*} |u|u_\tau|^{\frac{r_1}{2}-1}|^2_{2^*_s}& \leq Cr_1\left(\int_{ \Om} |u |^{2^*_s}~dx + \int_{ \Om} R^{2^*_s}|u|^{2^*_s-1} ~dx\right). \end{align*} Appealing Fatou's Lemma as $\tau \ra \infty$, we obtain \begin{align}\label{ch41} ||u|^{\frac{r_1}{2}}|^2_{2^*_s}& \leq Cr_1\left(\int_{ \Om} |u |^{2^*_s}~dx + \int_{ \Om} R^{2^*_s}|u|^{2^*_s-1} ~dx\right)<\infty. \end{align} This establishes the Claim. Now let $\tau \ra \infty$ in \eqref{ch37}, we deduce that \begin{equation*} \begin{aligned} ||u|^{\frac{r}{2}}|^2_{2^*_s}& \leq Cr \int_{ \Om} |u |^{r-1}+|u|^{r+2^*_s-2} ~dx \leq 2Cr(1+|\Om|) \left(1+ \int_{ \Om} |u|^{r+2^*_s-2} \right). \end{aligned} \end{equation*} It implies that \begin{equation}\label{ch40} \begin{aligned} \left(1+ \int_{ \Om}|u|^{\frac{2^*_s r}{2}}\right)^{\frac{2}{2^*_s(r-2)}}& \leq \mc C_r^{\frac{1}{(r-2)}} \left(1+ \int_{ \Om} |u|^{r+2^*_s-2} \right)^{\frac{1}{(r-2)}} \end{aligned} \end{equation} where $\mc C_r= 4Cr(1+|\Om|)$. For $j\geq 1$, we define $r_{j+1}$ iteratively as $ r_{j+1} +2^*_s-2= \frac{2^*_s r_j}{2}$. It implies \begin{align*} \left(r_{j+1}-2 \right)= \left(\frac{2^*_s}{2}\right)^j \left(r_1-2 \right). \end{align*} From \eqref{ch40}, we get \begin{align*} \left(1+ \int_{ \Om}|u|^{\frac{2^*_s r_{j+1}}{2}}\right)^{\frac{2}{2^*_s(r_{j+1}-2)}}& \leq \mc C_{j+1}^{\frac{1}{(r_{j+1}-2)}} \left(1+ \int_{ \Om} |u|^{\frac{2^*_s r_j}{2}} \right)^{\frac{2}{2^*_s(r_j-2)}} \end{align*} where $\mc C_{j+1}:= 4Cr_{j+1}(1+|\Om|)$. Denote $ D_j= \left(1+ \int_{ \Om} |u|^{\frac{2^*_s r_j}{2}} \right)^{\frac{2}{2^*_s(r_j-2)}}$, for $j\geq 1$. By limiting arguments, one can easily prove that, for $j>1$, \begin{align*} D_{j+1}\leq \prod_{k=2}^{j+1} \mc C_{k}^{\frac{1}{(r_{k}-2)}} D_1 \leq \mc C_0 D_1. \end{align*} It implies that $|u|_\infty\leq \mc C_0 D_1$ where $D_1$ is explicitly given in \eqref{ch41}. \QED \end{proof} \section{Proof of Theorem \ref{thmch1} and \ref{thmch2}} In this section we will conclude the proofs of Theorem \ref{thmch1} and Theorem \ref{thmch2}. Before this we recall the following result, which can be consulted in \cite{RS}. \begin{Proposition}\label{Propch5} Let $\Om$ be a bounded Lipschitz domain satisfying the exterior ball condition, $g \in L^\infty(\Om)$ and $u$ be a solution of \eqref{ch24}. Then $u \in C^s(\R)$ and \begin{align*} \|u\|_{C^s(\R)}\leq C\|g\|_{L^\infty(\Om)} \end{align*} where $C$ is a constant depending on $\Om$ and $s$. \end{Proposition} \textbf{Proof of Theorem \ref{thmch1} :} Let $ u \in X_0$ be a positive weak solution to problem $(P)$ and $H= F(u)/u$ and $K=f$. Then From Proposition \ref{Propch1}, we get $ u \in L^r(\Om)$ for all $ r\in \left[2, \frac{2N^2}{(N-\mu)(N-2s)}\right) $. It implies $F(u) \in L^r(\Om)$ for all $ r\in \left[\frac{2N}{2N-\mu}, \frac{2N^2}{(N-\mu)(2N-\mu)}\right)$. Observe that $ \frac{2N}{2N-\mu}< \frac{N}{N-\mu}< \frac{2N^2}{(N-\mu)(2N-\mu)}$ and there exists a constant $C(N,\mu, |\Om|)>0$ such that $|F(u)|_{\frac{N}{N-\mu}} \leq C(N,\mu, |\Om|) |u|_{2^*_s}$. Therefore, we infer that $\int_{\Om} \frac{F(u)}{|x-y|^\mu} ~dy \in L^{\infty}(\Om)$ and \begin{align*} \bigg| \int_{\Om} \frac{F(u)}{|x-y|^\mu} ~dy\bigg|_{\infty} \leq C(N,\mu, |\Om|) |u|_{2^*_s}. \end{align*} Using the assumptions on $f$ and $g$, we obtain \begin{align*} (-\De)^s u& = g(x,u)+ \left(\ds \int_{\Om}\frac{F(u)(y)}{|x-y|^{\mu}}dy\right) f \\ & \leq C(N,\mu, |\Om|) (1+ |u|_{2^*_s}) (1+ |u|^{2^*_s-1})= \mc S_0 (1+ |u|^{2^*_s-1})(\text{say}). \end{align*} From Lemma \ref{lemch5}, we have $ u \in L^\infty(\Om)$. Furthermore, there exists a function $ C_0>0 $ independent of $N,\mu, s$ and $|\Om|$ such that \begin{align*} |u|_{\infty} \leq C_0 \mc S_0^{\frac{2}{(2^*-1)(2^*-2)}}D_1 \end{align*} \begin{align*} \text{ with }\quad D_1\leq\left( 1+ \left( (2^*_s+1)\mc S_0 \left(\int_{ \Om} |u |^{2^*_s}~dx + \int_{ \Om} R^{2^*_s}|u|^{2^*_s-1} ~dx\right) \right)^{\frac{2^*_s}{2}} \right)^{\frac{2}{2^*_s(2^*_s-1)}} \end{align*} and $R>0$ chosen large enough such that \begin{align}\label{ch42} \left( \int_{|u|>R} |u|^{2^*_s} ~dx\right)^{\frac{2^*_s-2}{2^*_s}} \leq \frac{1}{2(2^*_s+1)\mc S_0}. \end{align} Now using Proposition \ref{Propch5}, we obtain that $u \in C^s(\R)$. \QED \textbf{Proof of Theorem \ref{thmch2} :} From Proposition \ref{Propch3}, and the assumption on $f$, we have \begin{align*} \int_{\Om} \frac{F(u)}{|x-y|^\mu} ~dy \in L^{\infty}(\Om). \end{align*} Furthermore, there exists a constant $C(N,\mu , |\Om|) >0$ such that $|F(u)|_{\frac{N}{N-\mu}} \leq C(N,\mu , |\Om|) |u|_{2^*_s}$. Therefore, we infer that \begin{align*} (-\De)^s u& \leq u^{q-1}+ C(N,\mu , |\Om|) |u|_{2^*_s} |f| \leq u^{q-1}+ C(N,\mu , |\Om|) |u|_{2^*_s} (1+ |u|^{2^*_s-1}). \end{align*} Let $ \psi \in \mathbb{R} \ra [0,1]$ be a $C^\infty(\mathbb{R})$ convex increasing function such that $\psi^\prime(t)\leq 1$ for all $t \in [0,1]$ and $\psi^\prime(t)=1$ when $t\geq 1$. Define $\psi_\e(t)= \e \psi(\frac{t}{\e})$ then using the fact that $\psi_\e$ is smooth, we obtain $\psi_\e \ra (t-1)^+$ uniformly as $\e \ra 0$. It implies \begin{align*} (-\De)^s \psi_\e(u) \leq \psi_\e^\prime(u)(-\De)^s u& \leq \chi_{\{ u >1\}}(-\De)^s u\\ & \leq \chi_{\{ u >1\}} (u^{q-1}+ C(N,\mu , |\Om|) |u|_{2^*_s} (1+ |u|^{2^*_s-1}))\\ & \leq \max\{ 1, C(N,\mu ,|\Om|) |u|_{2^*_s} \}(1+ ((u-1)^+)^{2^*_s-1})\\ &= \mc S_1 (1+ ((u-1)^+)^{2^*_s-1}) \text{ (say)}. \end{align*} Hence, as $\e \ra 0$, we deduce that \begin{align*} (-\De)^s (u-1)^+ \leq \mc S_1 (1+ ((u-1)^+)^{2^*_s-1}). \end{align*} Employing Lemma \ref{lemch5}, we deduce that $(u-1)^+ \in L^\infty(\Om)$, that is, $ u \in L^\infty(\Om)$. Furthermore, since $u$ is a positive solution, there exists $C_1>0 $ such that independent of $N,\mu, s $ and $|\Om|$ such that \begin{align*} |u|_{\infty} \leq 1+ C_1 \mc S_1^{\frac{2}{(2^*-1)(2^*-2)}}D_1 \end{align*} \begin{align*} \text{ with }\quad D_1\leq\left( 1+ \left( (2^*_s+1)\mc S_1 \left(\int_{ \Om} |(u-1)^+ |^{2^*_s}~dx + \int_{ \Om} R^{2^*_s}|(u-1)^+|^{2^*_s-1} ~dx\right) \right)^{\frac{2^*_s}{2}} \right)^{\frac{2}{2^*_s(2^*_s-1)}} \end{align*} and $R>0$ chosen large enough such that \begin{align*} \left( \int_{|u|>R} |(u-1)^+|^{2^*_s} ~dx\right)^{\frac{2^*_s-2}{2^*_s}} \leq \frac{1}{2(2^*_s+1)\mc S_1}. \end{align*} Let $\overline{u}$ be the unique solution (See \cite[Theorem 1.2, Remark 1.5]{adi}) to the following problem \begin{align*} (-\De)^s \overline{u} = \overline{u}^{-q}+ c, u>0 \text{ in } \Om, u =0 \text{ in } \R\setminus \Om \end{align*} where $c= C_1|F(u) f(u)|_\infty $ with $C_1= \bigg|\ds \int_{\Om}\frac{dy}{|x-y|^{\mu}}\bigg|_\infty$. Then following similar lines as in the proof of Claim in Proposition \ref{Propch3}, we have $\underline{u}\leq u \leq \overline{u}$ a.e in $\Om$ where $\underline{u}$ is the unique solution to \eqref{ch25}. Therefore, $ u \in X_0 \cap L^\infty(\Om)\cap C^+_{\phi_1}(\Om) $. Now from \cite[Theorem 1.3]{gts1}, we have the desired result.\QED \section{Applications} The purpose of this section is to derive applications from the uniform estimates given in Theorems \ref{thmch1} and \ref{thmch2}. Precisely, here, we prove the theorem \ref{thmch3} which deals with $H^s$ versus $C^0_d(\overline{\Om})$ weighted minimizers. Furthermore, we provide an application of this result, concerning the existence and multiplicity of solutions. \textbf{Proof of Theorem \ref{thmch3}: (i) implies (ii).} Assume by contradiction that there exists a sequence $v_n \ra v_0$ in $C^0_d(\overline{\Om})$ and $J(v_n)< J(v_0)$. It follows that \begin{align*} \int_{\Om}G(x,v_n)~dx \ra \int_{\Om}G(x,v_0)~dx \text{ and } \iint_{\Om\times \Om} \frac{F(v_n)F(v_n)}{|x-y|^\mu} ~dxdy \ra \iint_{\Om\times \Om} \frac{F(v_0)F(v_0)}{|x-y|^\mu} ~dxdy. \end{align*} Taking into account above statements, we infer that $ \ds\limsup_{n \ra \infty} \|v_n\|^2 \leq \|v_0\|^2$. Hence upto a subsequence $v_n$ converges to $v_0$ weakly in $X_0$. By Fatou's Lemma and above conclusion one obtains $\| v_n\|\ra \|v\| $. This settles the proof. \\ \textbf{Proof of Theorem \ref{thmch3}: (ii) implies (i).} To show the result, we will first consider the case $v_0=0 $. It implies that \begin{align}\label{ch29} \inf_{v \in X_0 \cap \bar{B}_\rho ^d(0)} J(v)= J(v_0)=0. \end{align} Assume that (i) doesn't hold. Then we can choose $\e_n \in (0,\infty),\; \e_n \ra 0$ such that there exist $z_n \in \bar{B}_{\e_n} ^X(0)$ with $J(z_n)<0$. For each $m\in \N$, define the functions $g_m,\;G_m: \overline{\Om} \times \mathbb{R} \ra \mathbb{R}$ and $f_m,\; F_m: \mathbb{R} \ra \mathbb{R}^+$ as \begin{align*} & g_{m}(x,t) = \max\{g(x,-m) , \min\{ g(x,t),g(x,m)\} \}, \quad G_m(x,t):= \int_0^tg_m(x,\tau) ~d \tau\\ & \text{ and } f_m(t):= \max\{f(-m) , \min\{ f(t),f(m)\} \},\quad F_m(t):= \int_0^tf_m(\tau) ~d \tau. \end{align*} Subsequently, we define the truncated functional $J_m$ as \begin{align*} J_m(v)= \frac{\|v\|^2}{2} - \int_{ \Om} G_m(x,v)~dx - \frac12 \iint_{ \Om\times \Om} \frac{F_m(v)F_m(v)}{|x-y|^\mu} ~dxdy \text{ for all } v \in X_0. \end{align*} Notice that $J_m \in C^1(X_0)$ and by appealing Dominated convergence theorem, we infer that $J_m(v) \ra J(v)$ as $m \ra \infty$ and for all $v \in X_0$. Thus, for every $n \in \N$ we pick $ m_n \in \N$ such that $J_{m_n}(z_n)<0$. Observe that $|G_m(x,v)|\leq (|g(x,-m)|+|g(x,m)|)|v|$ and $F_m(v)|\leq (f(-m)+f(m))|v|$. That is, $G_m$ and $F_m$ has subcritical growth in the sense of Sobolev inequality and Hardy-Littlewood-Sobolev inequality respectively. Therefore, $J_m$ is weakly lower semicontinuous functional. Since $ \bar{B}_{\e_n} ^X(0)$ is a closed convex set, it implies that there exists $w_n \in \bar{B}_{\e_n} ^X(0)$ such that \begin{align*} J_{m_n}(w_n)= \inf_{v \in \bar{B}_{\e_n} ^X(0)} J_{m_n}(v) \leq J_{m_n}(w_n). \end{align*} With the help of Lagrange multiplier's rule, one can easily prove that there exists $\la_n \in (0,1]$ such that $w_n$ is a weak solution of \begin{equation*} \left\{\begin{array}{rllll} (-\De)^s u &=\la_n \left(g_{k_n}(x,u)+ \left(\ds \int_{\Om}\frac{F_{k_n}(u)(y)}{|x-y|^{\mu}}dy\right) f_{k_n}(u) \right) \; \text{in}\; \Om,\\ u&=0 \; \text{ in } \R \setminus \Om. \end{array} \right. \end{equation*} Since $\|w_n\|\in \bar{B}_{\e_n} ^X(0),\; \|w_n\|\ra 0 $ as $|\e_n| \ra 0 $. It implies $ |w_n|_{2^*_s} \ra 0$ and hence for $n$ large enough we can choose $R=0$ in \eqref{ch42}. Subsequently there exists $K>0$ such that $|w_n|_\infty\leq K$ for all $n$. By appealing \cite[Theorem 1.2]{RS}, we obtain that for all $n$, $ w_n \in C_d^0(\overline{\Om})$ and $\|w_n\|_{C^{0,\al}_d(\overline{\Om})}\leq K_1$ for some suitable $K_1>0$. Since $ C^{0,\al}_d(\overline{\Om})$ is compactly embedded into $C_d^0(\overline{\Om}) $, $w_n $ is strongly convergent in $C_d^0(\overline{\Om})$. Consequently, taking in account the fact that $w_n \ra 0 $ a.e in $\Om$, we get $ w_n \ra 0 $ in $C_d^0(\overline{\Om})$. We conclude that for $n$ large enough, $\|w_n\|_{C^0_d(\overline{\Om})}\leq \rho$ and $|w_n|_\infty <1$. From this we infer that \begin{align*} J(w_m)= J_{m_n}(w_m)<0 \end{align*} and we obtain the desired contradiction to the assumption \eqref{ch29}. Now we will consider the case $v\not = 0$. By given assumption (ii), it follows that $ J^\prime(v_0)(v)=0$ for all $v \in C_c^\infty(\Om)$ and applying the standard density arguments we infer that \begin{align}\label{ch30} J^\prime(v_0)(v)=0 \text{ for all } v \in X_0. \end{align} In view of Theorem \ref{thmch1}, we have $ u \in L^\infty(\Om) \cap C_d^0(\overline{\Om})$. For all $v \in X_0$, let \begin{align*} \widehat{F}(x,v) := & \left(\ds \int_{\Om}\frac{F(v_0+v)(y)}{|x-y|^{\mu}}dy\right) F(v_0+v)(x)- \left(\ds \int_{\Om}\frac{F(v_0)(y)}{|x-y|^{\mu}}dy\right)\left( F(v_0)+2f(v_0)v\right)(x)\\ \text{and }\quad & \widehat{G}(x,v) := G(x,(v_0+v)(x)) - G(x,v_0(x))- g(x,v_0(x))v(x). \end{align*} Set \begin{align*} \widehat{J}(v)= \frac{\|v\|^2}{2}- \int_{\Om} \widehat{G}(x,v) ~dx -\frac12 \int_{\Om} \widehat{F}(x,v) ~dx \text{ for all } v \in X_0. \end{align*} Note that $ \widehat{J}\in C^1(X_0)$. Employing \eqref{ch30} and the definition of $\widehat{F} $ and $\widehat{G}$, we have \begin{align*} \widehat{J}(v)& = \frac{\|v_0+v\|^2}{2}- \frac{\|v_0\|^2}{2} - \int_{ \Om} G(x,(v_0+v)(x)) - G(x,v_0(x))~dx\\ & \quad -\frac{1}{2} \iint_{\Om\times \Om}\frac{F(v_0+v)F(v_0+v)}{|x-y|^{\mu}}~dxdy +\frac{1}{2} \iint_{\Om \times \Om}\frac{F(v_0)F(v_0)}{|x-y|^{\mu}}~dxdy\\ & = \widehat{J}(v_0+v)- \widehat{J}(v_0). \end{align*} We may deduce that $\tilde{J}(0)=0$. Therefore given assumptions can be expressed as \begin{align*} \inf_{v \in X_0 \cap \bar{B}_\rho ^d(0)} \widehat{J}(v)=0. \end{align*} Now by using above case we get the desired result and hence the proof of (ii) implies (i). \QED \begin{Theorem}\label{thmch4} Let $ G: \overline{\Om} \times \mathbb{R} \ra \mathbb{R}$ be a Carath\'eodory function satisfying \begin{align*} g(x, u) = O(|u|^{2^*_s-1}), & \text{ if } |u|\ra \infty \end{align*} uniformly for all $ x \in \overline{\Om}$. Let $f$ satisfies $(\mc F)$. Let $f(\cdot)$ and $G(x,\cdot)$ be non decreasing functions for all $x \in \Om$. Suppose $\underline{w}, \overline{w} \in X_0$ are a weak subsolution and a weak supersolution, respectively to $(P)$, which are not solutions. Then, there exists a solution $ w_0\in X_0$ to $(P)$ such that $\underline{w} \leq w_0 \leq \overline{w}$ a.e in $\Om$ and $w_0$ is a local minimizer of $J$ on $X_0$. \end{Theorem} \begin{proof} Consider a closed convex set $W$ of $X_0$ as \begin{align*} W: = \{ w \in X_0\; :\; \underline{w} \leq w_0 \leq \overline{w} \text{ a.e in } \Om \}. \end{align*} Using the definition of $W$, one can easily prove that \begin{align*} J(w)\geq \frac{\|w\|^2}{2}- c_1-c_2 \end{align*} for appropriate positive constants $c_1$ and $c_2$. This implies $J$ is coercive on $W$. $J$ is weakly lower semi continuous on $W$. Indeed, let $\{ v_n\} \subset W$ such that $v_n \rp v$ weakly in $X_0$ as $n\ra \infty$. For each $n$, \begin{align*} & \int_{ \Om} G(x,v_n)~dx \leq \int_{ \Om} G(x,v)~dx< +\infty,\\ & \iint_{\Om \times \Om}\frac{F(v_n)F(v_n)}{|x-y|^{\mu}}~dxdy\leq \iint_{\Om \times \Om}\frac{F(\overline{w})F(\overline{w})}{|x-y|^{\mu}}~dxdy< +\infty. \end{align*} Now we may invoke Dominated convergence theorem and the weak lower semicontinuity of norms to get that $J$ is weakly lower semi continuous on $W$. Hence, there exists $ w_0 \in X_0$ such that \begin{align}\label{ch31} \inf_{w \in W} J(w) = J(w_0). \end{align} \textbf{Claim:} $w_0$ is a weak solution to $(P)$. \\ Let $\phi \in C_c^\infty(\Om)$ and $\e>0$. Define \begin{align*} u_\e = \min\{ \overline{w}, \max\{ \underline{w}, w_0+ \e\phi\} \}= v_0+\e\phi - \phi^{\e}+\phi_{\e} \end{align*} where $\phi^{\e}= \max\{ 0, w_0+ \e\phi -\overline{w} \}$ and $\phi_{\e}= \max\{ 0, \underline{w}-w_0- \e\phi\}$. Observe that $\phi_{\e},\phi^{\e} \in X_0 \cap L^\infty(\Om)$. In view of the fact that $w_0+ t(u_\e-w_0) \in W$ for all $ t \in (0,1)$ and \eqref{ch31}, we obtain \begin{align*} \int_{ \R}(-\De)^s w_0 (u_\e-w_0)~dx - \int_{\Om} g(x,w_0)(u_\e-w_0)~dx- \iint_{\Om \times \Om}\frac{F(w_0)f(w_0) (u_\e-w_0)}{|x-y|^{\mu}}~dxdy \geq0. \end{align*} Set \begin{align*} & A^\e= \int_{ \R}(-\De)^s (w_0-\overline{w}) \phi^{\e} ~dx + \int_{ \R}(-\De)^s \overline{w}\phi^{\e} ~dx- \int_{\Om} g(x,w_0)\phi^{\e}~dx\\ &\qquad - \iint_{\Om \times \Om}\frac{F(w_0)f(w_0) \phi^{\e}}{|x-y|^{\mu}}~dxdy, \\ & A_\e= \int_{ \R}(-\De)^s (w_0-\underline{w}) \phi_{\e} ~dx + \int_{ \R}(-\De)^s \underline{w}\phi_{\e} ~dx- \int_{\Om} g(x,w_0)\phi_{\e}~dx\\ &\qquad - \iint_{\Om \times \Om}\frac{F(w_0)f(w_0) \phi_{\e}}{|x-y|^{\mu}}~dxdy . \end{align*} Then by simple computations, we get \begin{align}\label{ch32} \int_{ \R}(-\De)^s w_0 \phi~dx - \int_{\Om} g(x,w_0)\phi~dx- \iint_{\Om \times \Om}\frac{F(w_0)f(w_0) \phi}{|x-y|^{\mu}}~dxdy \geq \frac{1}{\e} \left( A^\e- A_\e \right). \end{align} Using the assertions as in \cite[Propostion 3.2]{gts1} with $\overline{w}$ in spite of $u_{\la^\prime}$, we have \begin{align*} \frac{1}{\e}\int_{ \R}(-\De)^s (w_0-\overline{w}) \phi^{\e} ~dx\geq o(1) \text{ as } \e \ra 0^+. \end{align*} To this end, employing the fact that $\overline{w} $, we deduce that \begin{align*} & \frac{1}{\e} \int_{ \R}(-\De)^s \overline{w}\phi^{\e} ~dx- \frac{1}{\e}\int_{\Om} g(x,w_0)\phi^{\e}~dx- \frac{1}{\e}\iint_{\Om \times \Om}\frac{F(w_0)f(w_0) \phi^{\e}}{|x-y|^{\mu}}~dxdy\\ &\geq \frac{1}{\e} \int_{\Om}(g(x,\overline{w})- g(x,w_0))\phi^{\e}~dx+ \frac{1}{\e} \iint_{\Om \times \Om}\frac{(F(\overline{w})f(\overline{w})-F(w_0)f(w_0)) \phi^{\e}}{|x-y|^{\mu}}~dxdy\\ & \geq \frac{1}{\e} \int_{\Om}(g(x,\overline{w})- g(x,w_0))\phi^{\e}~dx = o(1) \text{ as } \e \ra 0^+. \end{align*} Hence we infer that $ \frac{1}{\e} A^{\e}\geq o(1)\text{ as } \e \ra 0^+$. On the similar lines, one can prove that $ \frac{1}{\e} A_{\e}\leq o(1)\text{ as } \e \ra 0^+$. From \eqref{ch32}, for all $\phi \in C_c^\infty(\Om)$, it follows that \begin{align} \int_{ \R}(-\De)^s w_0 \phi~dx - \int_{\Om} g(x,w_0)\phi~dx- \iint_{\Om \times \Om}\frac{F(w_0)f(w_0) \phi}{|x-y|^{\mu}}~dxdy \geq 0 \text{ as } \e \ra 0^+. \end{align} As $\phi \in C_c^\infty(\Om)$ was arbitrarily chosen, it implies that $w_0$ is weak solution to $(P)$. From this, we follows that there exists a solution $ w_0\in X_0$ to $(P)$ such that $\underline{w} \leq w_0 \leq \overline{w}$ a.e in $\Om$. To prove that $w_0$ is a local minimizer in $X_0$, we proceed as follows. Using Theorem \ref{thmch1} and \cite[Theorem 1.2]{RS}, we deduce $ w_0 \in C^{0,\al}_d(\overline{\Om})$. Now consider \begin{align*} (-\De)^s(w_0-\underline{w})& \geq( g(x,w_0)- g(x,\underline{w})) + \left( \int_{\Om }\frac{F(w_0)}{|x-y|^{\mu}}~dy\right) f(w_0)- \left( \int_{\Om }\frac{F(\underline{w})}{|x-y|^{\mu}}~dy\right) f(\underline{w})\\ & \geq 0 . \end{align*} Using the fact that $\underline{w}$ is not solution to $(P)$, we have $w_0 \not = \underline{w}$ and by definition, $w_0-\underline{w}\geq 0$ in $\R \setminus \Om$. From \cite[Lemma 2.7]{squassina}, we infer that $w_0 -\underline{w}>Cd^s$ for some $C>0$. On a similar note $\overline{w}-w_0 > Cd^s$ for some $C>0$. For each $w \in \bar{B}^d_{C/2}(w_0)$, we have \begin{align*} \frac{w_0 -\underline{w}}{d^s} = \frac{w_0 -w}{d^s}+ \frac{w -\underline{w}}{d^s} \geq \frac{C}{2}. \end{align*} From above, it can read that $w_0 -\underline{w}>0 $ in $\Om$. Likewise, $\overline{w}-w_0>0$ in $\Om$. Therefore, $w_0$ emerge as a local minimizer of $J$ on $X_0\cap \bar{B}^d_{C/2}(w_0)$ and this completes the proof. \QED \end{proof} \begin{Remark} Consider the following problem \begin{equation}\label{ch33} \left\{\begin{array}{rllll} (-\De)^s u &=\la \left( |u|^{q-2}u + \left(\ds \int_{\Om}\frac{F(u)(y)}{|x-y|^{\mu}}dy\right) f(u)\right) ,\; u>0 \; \text{in}\; \Om,\\ u&=0 \; \text{ in } \R \setminus \Om, \end{array} \right. \end{equation} where $\la>0,\; 1<q<2$ and $f$ is a non decreasing function and satisfies $(\mc F)$. Let $\underline{v}$ denotes the solution to \begin{equation*} (-\De)^s u =\la |u|^{q-2}u , \; u>0 \; \text{in}\; \Om, u=0 \; \text{ in } \R \setminus \Om, \end{equation*} and let $\overline{v}$ is a solution to \begin{equation*} (-\De)^s u =1 , \; u>0 \; \text{in}\; \Om, u=0 \; \text{ in } \R \setminus \Om. \end{equation*} Then for all $\la>0,\; \underline{v}$ is a subsolution to \eqref{ch33}. And for $\la$ small enough, $\overline{v}$ is a supersolution to \eqref{ch33}. Now using Theorem \ref{thmch4}, there exists a solution to \eqref{ch33}, which is a local minimizer in $X_0$. The moutain pass lemma provides then the existence of a second solution. \end{Remark}
\section{Introduction} A hundred years ago, Einstein's theory of General Relativity (GR) \cite{einstein08, einstein16} revolutionised our understanding of gravitation, transforming the well-known ``at-distance" force into a manifestation of the interplay between matter and the curved space-time manifold. The newborn theory was eagerly accepted after it solved the Mercury perihelion puzzle and Eddington measured the gravitational deflection of stars' light passing near the Sun. But its most exotic predictions were the existence of gravitational waves and of black holes. The former were indirectly discovered from the observed decrease in the period of the Hulse-Taylor pulsar \cite{hulse75} in the 1970s, before LIGO's direct detection in 2015 \cite{abbott16}; the gravitational waves observed during this event were produced by the merger of two black holes, thereby proving the existence of the latter. Today, GR has passed all experimental tests and seems unassailable. A few years before, CERN's Large Hadron Collider had found the last missing piece in the Standard Model, the Brout-Englert-Higgs boson, with a mass of 125 GeV \cite{atlas12, cms12}. However, despite those successes, it is hardly the end of the route for fundamental physics. Shedding light on the dark sector is proving particularly difficult, decades after the discovery of the missing mass at cosmological scale \cite{zwicky33, rubin70} and of the acceleration of the cosmic expansion \cite{riess98, perlmutter99}. Other questions remain unanswered, dealing in particular with symmetries and symmetry-breaking, the possibility of a supersymmetry between bosons and fermions through a supersymmetric extension of the Standard Model \cite{fayet77}, the origin of the preponderance of matter over antimatter, or the problems of quantum gravity and the quest for a possible unification of all interactions. Theories beyond the standard model propose the existence of new particles. For instance, string-inspired theories introduce a spin-0 dilaton-like particle (e.g. Refs. \cite{damour94, damour02}), and extensions of the Standard Model gauge group suggest the possible existence of a very light spin-1 U-boson mediating a new force \cite{fayet90, fayet17}. Other models, such as scalar-tensor models, modify GR's equations via the introduction of a new scalar field (see e.g. Refs. \cite{damour92, clifton12, joyce15}). The existence of a new very light scalar field (thereby, of a new long-range force) can be made compatible with current solar system tests with the inclusion of a screening mechanism that makes the field's mass environment-dependent \cite{damour94,vainshtein72,Damour:1992kf,khoury04a, khoury04b, babichev09,hinterbichler10, brax13,burrage18}. Although they mimic GR because of their screening mechanism, those models can nevertheless have measurable effects, such as an apparent violation of the equivalence principle (e.g. \cite{khoury04b, damour12}). The weak equivalence principle (WEP) states that two bodies of different compositions and/or masses fall at the same rate in the same gravitational field (universality of free fall-UFF); similarly, it states the equivalence of the ``inertial'' and ``gravitational'' masses. It was formulated by Einstein in 1907 as a starting point of GR, and has since been verified experimentally with higher and higher precision. Tests of the WEP are usually presented in terms of the E\"otv\"os ratio $\eta$ \cite{eotvos22}, defined as the normalised difference of acceleration (or equivalently, as the normalised difference of gravitational-to-inertial masses) of two test bodies affected by the same gravitational field \cite{will14}: \begin{equation} \label{eq_eotvos} \eta = 2 \frac{a_2-a_1}{a_2+a_1} = 2 \frac{m_{g2}/m_{i2} - m_{g1}/m_{i1}}{m_{g2}/m_{i2} + m_{g1}/m_{i1}} \end{equation} where $a_j$ is the acceleration of the $j$th test-body, and $m_{g,j}$ and $m_{i,j}$ are its gravitational and inertial masses. In this paper, we use a good first order approximation of the E\"otv\"os parameter $\delta (2,1)$: \begin{equation} \delta(2,1) \equiv \frac{m_{g2}}{m_{i2}} - \frac{m_{g1}}{m_{i1}}. \end{equation} Tests of the UFF and of the WEP have a long history, starting with Galileo Galileo (1638) and Newton (1687), and continuing to the end of the 20th century after Fischbach \cite{fischbach86} revived the interest in experimental searches for new, WEP-violating interactions. The state-of-the-art experiments have measured $|\eta|<{\rm a \,\, few\,\,} 10^{-13}$ (see Ref. \cite{will14} for a historical account of tests of the WEP): (i) the E\"ot-Wash group used a high-precision torsion pendulum in the Earth and Sun gravitational fields \cite{schlamminger08, wagner12}, and (ii) the Lunar Laser Ranging has monitored the motion of the Moon and the Earth around the Sun \cite{williams12,viswanathan18} and measures a combination of the WEP and SEP with a slightly better accuracy. However, in spite of huge efforts to incrementally improve these experiments, it became apparent in the early 2000's that a new approach was needed to significantly improve on existing constraints on the WEP. In the 1970's, Chapman \cite{chapman01} proposed a space experiment to test the Equivalence Principle. It was the basis of the STEP experiment extensively studied in Stanford University \cite{everitt2003}. Performing a test in space became feasible with ultra-sensitive accelerometers and drag-free satellites, as experimented with GRACE \cite{tapley04}, GOCE \cite{rummel11} and LISA Pathfinder \cite{armano16}. Thence, those technologies were shown to be well suited to measure weak accelerations in a well-controlled dynamical environment motion \cite{touboul04}. In the early 2000s, the Centre National d'Etudes Spatiales (CNES), the Observatoire de la C\^ote d{'}Azur (OCA) and the Office National d'Etudes et de Recherches A\'erospatiales (ONERA) embarked on the development of the MICROSCOPE (Micro-Satellite \`a tra\^in\'ee Compens\'ee pour l'Observation du Principe d'Equivalence) mission \cite{touboul99, touboul01a, touboul01b,touboul09,touboul12}, the first laboratory experiment that would actually test the WEP in space. The experiment relies on the comparison of the free-fall motion of two test-masses of different composition (one of titanium alloy and one of platinum alloy) at the centre of a dedicated drag-free and attitude-controlled satellite (see Sect. \ref{sect:ssect_drag}). At the core of the instrument, an ultra-sensitive accelerometer forces each test mass to remain in equilibrium using electrostatic forces. Thus, the test-masses have to follow the motion of the satellite and the electrostatic forces compensate the difference of acceleration between the masses and the satellite. In this paper, we define the electrostatic acceleration (or sometime acceleration for short) as the electrostatic force divided by the mass even if the mass are motionless with respect to the satellite. Once potential disturbing effects are accounted for, the comparison of those electrostatic forces is a direct measure of the difference in the control accelerations of the test masses, and hence of the WEP. If the WEP is violated, since the gravitational source is the Earth, then the measured difference will be modulated by the motion and attitude of the spacecraft along its orbit. Therefore, the violation signal will be detectable at a given frequency $f_{\rm EP}$ that is the sum of the orbital frequency and of the satellite spinning frequency. MICROSCOPE was launched into a low-Earth sun-synchronous orbit from Kourou on April 25, 2016 at an altitude of 710 km. The science experiment started in December 2016 after a successful commissioning phase \cite{prieur17,berge17a}. Since then, MICROSCOPE has delivered high-quality data. In Ref. \cite{touboul17}, we used 7\% of the total data expected from the mission to provide first, intermediate results. We found no violation of the WEP, but even this small amount of data allowed us to improve the constraints on $\delta$ by one order of magnitude, down to \begin{equation} \delta({\rm Ti,Pt})=[-1\pm{}9{\rm (stat)}\pm{}9{\rm (syst)}] \times{}10^{-15} \end{equation} at 1$\sigma$ statistical uncertainty, for the titanium and platinum pair of materials. This new upper bound on the WEP has allowed new limits to be set on beyond-GR models involving a light dilaton \cite{berge18} or a U-boson \cite{fayet18,fayet19}. This paper is an expanded version of the letter \cite{touboul17}. We provide more details on the experiment, the instrument geometry and electronic characterisation, the assessment of systematic uncertainties and the data analysis. Several upcoming papers are in preparation to better detail the mission rationale and all the main subsystems relevant to the final performance. The layout of the paper is as follows. Sect. \ref{sect_instrument} presents the satellite and instrument, whose characteristics were assessed during the commissioning phase, as shown in Sect. \ref{sect_commissioning}. The measurement principle and systematic errors are discussed in Sect. \ref{sect_measure}. {Sect. \ref{sect_analysis} presents the data analysis (restricted to one measurement session) and discusses MICROSCOPE's first results. We conclude in Sect. \ref{sect_ccl}.} \section{Experimental apparatus} \label{sect_instrument} The MICROSCOPE satellite carries the T-SAGE (Twin Space Accelerometers for Gravitation Experiment) science payload, a pair of double electrostatic accelerometers designed to test the WEP in space. In this section, we first briefly present the satellite. We then give detailed metrology and electronic information about the T-SAGE instrument, as measured on the ground before MICROSCOPE's launch. The left panel of Fig. \ref{fig_satellite} shows the satellite during its pre-launch tests; the right panel shows T-SAGE, which sits at the centre of the satellite. \subsection{Satellite and its acceleration and attitude control system} \label{sect:ssect_drag} The satellite is based on the CNES Myriade line, with a mass of 300kg and a volume of 2m$^3$ (Fig.\ref{fig_satellite}). It is covered by Multi Layer Insulation (MLI) that provides good radiative thermal filtering. Cold gas proportional thrusters are used to reduce non-gravitational accelerations experienced by the satellite and to finely control the attitude. The Drag Free and Attitude Control System (DFACS) uses the scientific instrument itself in a control loop for sensing linear and angular accelerations \cite{jafry01, theil01, prieur17}. The DFACS cancels the linear common mode acceleration in the frequency band of interest which could be measured differently by each test-mass due to the different transfer functions. \begin{figure} \begin{center} \includegraphics[width=0.56\textwidth]{fig_1a} \includegraphics[width=0.4\textwidth]{fig_1b} \caption{Left: MICROSCOPE satellite during vibration test campaign (\textcopyright CNES GRIMAULT Emmanuel 2015). Right: T-SAGE payload sensor units and front end electronics in satellite clean room before integration (\textcopyright CNES/S. Girard, 2014).} \label{fig_satellite} \end{center} \end{figure} \subsection{T-SAGE instrument: test-masses' metrology and servo-loop electronics} \subsubsection{Sensor units} The science payload comprises two sensor units (two SU) shown in right panel of Fig. \ref{fig_satellite}. Both SU share the same design (sensor mechanics and electronic circuits), the same technologies (mechanics and components) and the same materials. Their only difference is in the composition of their test-masses. Fig. \ref{fig_SU} shows a cut-away view of a SU. It contains two concentric cylindrical accelerometers. Each accelerometer uses electrostatic levitation of a cylindrical test mass (purple cylinders in Fig. \ref{fig_SU}): pairs of electrodes (supported by silica cylinders --in red in Fig. \ref{fig_SU}) surrounding the mass and controlling the electric field arround it. The electric field generates electrostatic (negative) pressures on the test-mass, whose six degrees of freedom are digitally controlled by six independent servo-channels using different combinations of electrode pairs. A thin gold wire of $7\rm\mu$m diameter and of $\sim$ 25mm length is glued onto each test-mass: it allows the test-mass charge control and the capacitive sensing through the application of a DC and a 100kHz voltages. Two Front End Electronics Unit (FEEU) boxes (one per sensor unit) include the capacitive sensing of the test-mass motion, the reference voltage sources and the analog electronics to generate the voltages applied to the electrodes. An Interface Control Unit (ICU) includes the digital electronics associated with the servo-loop digital control laws, as well as the interfaces to the satellite's data bus. The FEEU output is used by the DFACS. \begin{figure} \includegraphics[width=0.95\textwidth]{fig_2} \caption{Cut-away representation of the sensor unit. Each test-mass has its measurement reference frame symbolised by the 6 axis schematic.} \label{fig_SU} \end{figure} One sensor unit (SUREF) serves as a reference for the experiment. Its test-masses are made of the same platinum alloy (see below), so that it should not be affected by composition-dependent forces. Although not a direct probe of systematic uncertainties, it provides valuable indications about instrumental effects. In the remainder of this paper, SUREF's inner (outer) mass is called IS1-SUREF (IS2-SUREF). The second sensor unit (SUEP) has two masses of different compositions and is used for the Equivalence Principle test. Its inner mass is made of the same platinum alloy as SUREF's test-masses, while its outer test-mass is made of titanium alloy. In the remainder of this paper, SUEP's inner (outer) mass is called IS1-SUEP (IS2-SUEP). Each sensor unit comprises a hermetic Invar housing surrounding the silica core which is maintained under vacuum by a getter material in orbit. On ground, an ion pump is used during all the flight configuration test phases except thermal, vibration and shock qualification. Finally, Fig. \ref{fig_SU} shows the coordinate system used in the instrument: $X$ is the main axis of the cylinder. It is the most sensitive axis (see below) and the WEP signal is estimated along this axis. Measurements along the $X$, $Y$ and $Z$ axes are used by the DFACS. \subsubsection{Test-masses} The cylindrical test-masses are what differentiates the sensor units. They have been produced and precisely characterised in the Physikalisch-Technische Bundesanstalt (PTB) laboratory, in Braunschweig, the German National Metrology Institute, with a metrology accuracy better than 1$\mu$m \cite{hagedorn13}. The SU PtRh10 platinum-rhodium alloy contains 90\% by mass of Pt (A=195.1, Z=78) and 10\% Rh (A=102.9, Z=45). The isotopic composition of Pt has been measured by PTB on a sample of flight material (see Table \ref{tab_Ptiso}). SUEP's outer test-mass is made of 90\% of titanium (A=47.9, Z=22), 6\% of aluminium (A=27.0, Z=13) and 4\% of vanadium (A=50.9, Z=23). The choice of the materials is a trade-off between the machining laboratory know-how and the theoretical motivation \cite{touboul01b, blaser01}. Titanium and platinum differ mainly from the neutron excess over the atomic mass $(N-Z)/A$ and a little from the nuclear electrostatic energy $Z(Z-1)/(N+Z)^{1/3}$. \begin{table} \caption{\label{tab_Ptiso} Measured isotopic composition of Pt in PtRh10 material. } \begin{indented} \item[]\begin{tabular}{@{}lc} \br Isotope & Mol per mol of PtRh10 \\ \mr Pt(190) & 0.000117 \\ Pt(192) & 0.00782 \\ Pt(194) & 0.32863 \\ Pt(195) & 0.33776 \\ Pt(196) & 0.25210 \\ Pt(198) & 0.07357 \\ \br \end{tabular} \end{indented} \end{table} All test-masses have four small flat areas along their $X$-axis to break the cylindrical symmetry and to allow for angular control about $X$ ($\Phi$ angle). Their length has been optimised to keep quasi-identical moments of inertia about their three axes. The moments of inertia have been computed taking into account the measured dimensions and densities, and their dispersions. The total relative dispersion of the moments, with respect to an ideal homogenous spherical test-mass, is, in the worst case, $10^{-3}$. This is small enough to mitigate the effect of local gravity gradients as required. The mass of each test-mass was measured with a maximum error of 0.025 mg. Density was estimated to better than 0.001g/cm$^3$ by cutting two slices from either end of each test-mass (also allowing estimation of the material homogeneity). Table \ref{tab_metrology} summarises the test-mass metrology data. The accuracy of production of individual parts, and subsequent integration are at the micro-meter level. In particular the relative positions of the test-masses have been evaluated by direct metrology and capacitive measurements during integration. Finally, in order to limit the residual effect of the Earth's gravity gradient variations at the WEP test frequency, $f_{\rm EP}$, the relative centring of the test-masses was specified to be $<\,20\,\mu$m along each axis for each sensor. In Sect. \ref{sect_measure}, we show that we are able to estimate the off-centring in flight to better than 0.1$\mu$m. \begin{table} \caption{\label{tab_metrology} Main test-masses physical parameters measured in the laboratory before flight.} \begin{indented} \item[]\begin{tabular}{@{}lllll} \br Parameter & IS1-SUREF & IS2-SUREF & IS1-SUEP & IS2-SUEP \\ \mr Inner radius [mm] & 30.801 & 60.799 & 30.801 & 60.802 \\ Outer radius [mm] & 39.390 & 69.397 & 39.390 & 69.401 \\ Length [mm] & 43.331 & 79.821 & 43.330 & 79.831 \\ Inertia about X [kg\,mm$^2$] & 125.0206 & 1442.454 & 125.0775 & 319.0266 \\ Inertia about Y [kg\,mm$^2$] & 125.0021 & 1442.139 & 125.0524 & 318.9978 \\ Inertia about Z [kg\,mm$^2$] & 125.0070 & 1442.214 & 125.0549 & 318.9867 \\ Maximum relative difference & 0.0004 & 0.0007 & 0.001 & 0.0001 \\ in moment of inertia \\ Mass [kg] & 0.401533 & 1.359813 & 0.401706 & 0.300939 \\ Density @ 20$^{\rm o}$C [g\,cm$^{-3}$] & 19.967 & 19.980 & 19.972 & 4.420 \\ Density homogeneity along X & 0.04\% & 0.05\% & 0.1\% & 0.001\% \\ \br \end{tabular} \end{indented} \end{table} \subsubsection{Capacitive Sensing and Electronic control} Each test-mass is equipped with electronics to control its movements. Each servo-channel is composed of (Fig.\ref{fig_detect}): \begin{itemize} \item capacitive sensors which measure six test-mass degrees of freedom: three positions ($x,y,z$) and three angles ($\phi, \theta, \psi$) about those axes \cite{josselin99} \item a digital PID controller, whose control laws are programmed into Digital Signal Processor (DSP); the DSP has a 20 MHz cycle and operates the servo-loop at a submultiple of this frequency (1027 Hz); it computes signals representative of the forces and torques applied to the test mass and delivers them to the satellite on-board computer \item actuators which apply voltages onto each electrode to generate the required force or couple; these voltages are obtained by digital to analogue conversion of the DSP outputs. \end{itemize} \begin{figure} \begin{center} \includegraphics[width=0.75\textwidth]{fig_3} \caption{Schematic of one degree of freedom servo-loop control.} \label{fig_detect} \end{center} \end{figure} The inertial sensor acceleration range is limited by the voltages that can be applied to the electrodes, and it must exceed the weak residual accelerations managed by the satellite control. The voltage applied on the electrodes depends on the geometrical and electrical configuration and on the mass of the test mass; it can be expressed as an acceleration resulting from an electrostatic force: \begin{equation} \Gamma_{\rm elec} = \alpha (V_p - V'_p)V_e, \end{equation} where $V_p$ is the DC voltage applied directly to the test mass, $V'_p$ is the offset voltage applied to the electrodes, $V_e$ is the controllable part of the voltage that can be applied to the electrodes ($\lvert V_e \rvert<40$V) and $\alpha$ is an electrostatic physical gain expressed in $\rm ms^{-2}V^{-2}$. When $V'_p$ is null, the voltage $V_p$ can modify the electrostatic acceleration's behaviour: the higher $V_p$, the easier the acquisition of the test-mass. For example, in order to enable the test-mass acquisition in ZARM's Bremen Tower, the $V_p$ voltage and the maximum electrode range voltage $V_{\rm max}$ were both fixed to 90V using the Engineering Model Electronics \cite{selig10}. For the Flight Electronics, $V_{\rm max}$ is limited to 40V for derating reasons. Hence, the flight model range was not compatible with the free-fall residual accelerations in the short time of fall in the ZARM tower (9 seconds in the catapult mode). For flight, two modes were defined : the Full Range Mode (FRM) has a relatively high $V_p=40$V and is used to acquire the test-mass after it is unlocked or the control is lost while the High Resolution Mode (HRM) uses $V_p=5$V and is used for fine science measurements. In all cases $V_{\rm max}=40$V. $V'_p$ is used to increase or decrease, depending on its sign, the scale factor for each axis. When the electrostatic servo-loop operates properly and thus the test-mass is motionless, the electrostatic acceleration range is proportional to ($V_p-V'_p)V_{\rm max}$ to first order. Depending on the axis, $V'_p$ and $V_{\rm max}$ can be set in order to optimise the resolution versus the range. Table \ref{tab_range} gives the $V'_p$ values and ranges for the HRM used during scientific sessions: the differences between SUREF's inner and outer masses are due to their different size; the differences between SUEP's and SUREF's outer masses arise from their different mass. In HRM, $V_p$ is measured in flight as $V_p=5.003 \pm{}0.013$V with respect to the FEEU null voltage reference point (which is different from the electrical ground of the structure). The DC voltage $V'_p$ is applied symmetrically on each electrode pair. \begin{table} \caption{\label{tab_range} DC $V'_p$ voltage applied symmetrically on each electrode pair and full-scale range of the applied electrostatic accelerations of the inertial sensor for each axis, in High Resolution Mode (HRM).} \begin{indented} \item[]\begin{tabular}{@{}lcccc} \br & IS1-SUREF & IS2-SUREF & IS1-SUEP & IS2-SUEP \\ \mr $V'_p$ [V] \\ $X$ & -5 & -10 & -5 & 0 \\ $Y$ and $\Psi$ & 2.5 & 0 & 2.5 & 2.5 \\ $Z$ and $\Theta$ & 2.5 & 0 & 2.5 & 2.5 \\ $\Phi$ & -10 & -10 & -10 & -10 \\ \mr Range \\ $X$ [$\mu$m\,s$^{-2}$] & 2.40 & 1.60 & 2.40 & 3.20 \\ $Y$ [$\mu$m\,s$^{-2}$] & 3.44 & 10.5 & 3.44 & 21.2 \\ $X$ [$\mu$m\,s$^{-2}$] & 3.44 & 10.5 & 3.44 & 21.2 \\ $\Phi$ [$\mu$rad\,s$^{-2}$] & 62.3 & 38.4 & 62.4 & 173 \\ $\Theta$ [$\mu$rad\,s$^{-2}$] & 62.5 & 112 & 62.5 & 212 \\ $\Psi$ [$\mu$rad\,s$^{-2}$] & 62.5 & 112 & 62.5 & 212 \\ \br \end{tabular} \end{indented} \end{table} As shown in Fig. \ref{fig_detect} the 1027Hz servo-loop provides the voltage to control the test-mass. This voltage is picked up at the output of the digital loop, filtered to prevent aliasing and downsampled to 4 Hz \cite{touboul12}. It is then multiplied by the a priori physical gain, delivered to the on-board computer (OBC) and sent to Earth for analysis. \begin{table} \caption{\label{tab_resbias} Laboratory measured resolution, bias, thermal sensitivity and gain of the capacitive sensors with a 100kHz applied voltage on the test-mass, $V_d=5\, Vrms$.} \begin{indented} \item[]\begin{tabular}{@{}lllllll} \br & $x$ & $y$ & $z$ & $\phi$ & $\theta$ & $\psi$ \\ \mr Capacitive sensor's resolution \\ at $10^{-2}$Hz [$\mu$V\,Hz$^{-1/2}$] \\ IS1-SUREF & 8.1 & 3.8 & 3.7 & 9.3 & 3.8 & 3.7 \\ IS2-SUREF & 5.4 & 2.1 & 2.1 & 9.6 & 2.1 & 2.1 \\ IS1-SUEP & 12 & 3.1 & 3.1 & 12 & 3.1 & 3.1\\ IS2-SUEP & 5.6 & 1.9 & 1.9 & 5.5 & 1.9 & 1.9\\ \mr Bias [V] \\ IS1-SUREF & -0.006 & -0.007 & -0.001 & 0.014 & 0.002 & -0.003 \\ IS2-SUREF & 0.014 & -0.001 & -0.001 & -0.046 & 0.000 & 0.001\\ IS1-SUEP & 0.014 & -0.001 & -0.009 & 0.049 & 0.001 & -0.004\\ IS2-SUEP & 0.021 & -0.002 & -0.005 & 0.030 & 0.001 & -0.001 \\ \mr Thermal sensitivity [$\mu$V/K] \\ IS1-SUREF & 64.7 & 10.1 & 14.3 & 36.6 & 1.7 & -2.1\\ IS2-SUREF & 16.7 & 12.0 & 25.4 & 130.9 & 2.7 & 12.2 \\ IS1-SUEP & 65.9 & 23.3 & 10.7 & 37.7 & 10.4 & -0.6 \\ IS2-SUEP & 16.3 & 8.9 & 14.0 & 193.3 & 1.2 & -0.5 \\ \mr Capacitive sensor's gain [V/pF] \\ IS1-SUREF & 82.5 & 16.9 & 17.3 & 82.2 & 16.9 & 17.3\\ IS2-SUREF & 40.6 & 5.0 & 5.2 & 84.5 & 5.0 & 5.2\\ IS1-SUEP & 81.2 & 16.0 & 16.1 & 81.0 & 16.0 & 16.1 \\ IS2-SUEP & 39.3 & 5.0 & 5.0 & 85.0 & 5.0 & 5.0\\ \br \end{tabular} \end{indented} \end{table} Table \ref{tab_resbias} shows the measured resolution, bias, thermal sensitivity and gain of the capacitive sensing for all test-masses for all degrees of freedom. The capacitive sensor resolution and bias have been measured in the laboratory before flight, for each axis in open loop and are fully consistent with the objective of the mission: the WEP test at $10^{-15}$ accuracy. The capacitance gradient along the $X$-axis is fixed by the geometry, and the detector sensitivity along the $X$-axis is computed to 0.30 V/$\mu$m for all accelerometers; thence, the noise of the sensor corresponds to less than $4 \times{}10^{-11}$m\,Hz$^{-1/2}$. Along $Y$ and $Z$, the performance and sensitivity of the detector are of the same order. For the attitude motion of the test-mass, the sensitivity is estimated to be between $10^{-2}$V/$\mu$rad and $10^{-3}$V/$\mu$rad. Because each capacitive sensing is used inside a servo-loop, its accuracy is not critical. The bandwidths of the sensors are sufficient and measured to $>160$\,Hz (-3dB), which are sufficient. With the measured thermal sensitivity of the electronics, a thermal stability of 1\,K\,Hz$^{-1/2}$ is required to achieve the resulting position measurement noise. The electrode configuration used for test-mass control about its six degrees of freedom is shown in Figs. \ref{fig_Phi} and \ref{fig_xyz}. The test-masses are controlled in translation and rotation. Independent pairs of electrodes are used to control the translation along $Y$ (and $Z$) using the mean value of the capacitive sensing given by the two pairs $Y1$ and $Y2$ (and $Z1$ and $Z2$). The rotation about $Z$ (and $Y$) uses the same set of electrodes $Y1$ and $Y2$ (and $Z1$ and $Z2$) but now the difference of the capacitive sensing is calculated. For translation along $X$, the $X+$ and $X-$ pair of electrodes is used. Finally, for the rotation about $X$, a set of 8 electrodes have been electrically connected to form 2 assemblies of electrodes ($\Phi1-$ to $\Phi4-$ and $\Phi1+$ to $\Phi4+$) that are sensitive to the $\Phi$ motion. The actuation voltages on each electrode come from a drive voltage amplifier (DVA) and are calculated by the DSP that takes into account the 6 degrees of freedom capacitive sensing. The characteristics of each DVA have been verified on ground; in particular, we checked that the low-frequency DVA noise increases with a $f^{-1/2}$ law, below $3\times 10^{-2}$Hz. \begin{figure} \begin{center} \includegraphics[width=0.75\textwidth]{fig_4} \caption{Electrode arrangement for $\Phi$ measurement} \label{fig_Phi} \end{center} \end{figure} \begin{figure} \begin{center} \includegraphics[width=0.45\textwidth]{fig_5a} \includegraphics[width=0.45\textwidth]{fig_5b} \caption{Electrode arrangement for $X$ (left), $Y$, $Z$, $\Theta$ and $\Psi$ (right).} \label{fig_xyz} \end{center} \end{figure} For the $X+$ and $X-$ channels, each DVA has a matched gain of 16.000 to an accuracy $<0.2$\% for the particular case of the channel $X+$ and $X-$. The sensor outputs is from the PID controller. The satellite DFACS reduces the common mode acceleration, but the measurement output may be sensitive to actuator fluctuations and in particular the thermal ones (see Sect. \ref{sect_measure}). Additionally, each DVA command may be biased, giving two possible effects. If the same bias is applied on two electrodes which control a test-mass degree of freedom, say $X+$ and $X-$, then it acts as a bias in the $V_p$ reference voltage (in the way as $V'_p$); alternatively, if it acts non symmetrically then it results in an offset in the applied restoring force along $X$. Table \ref{tab_resbias2} lists the bias and thermal sensitivity of the actuator electronics (DVA) at electrodes $X+$ and $X-$ (that control translation along the $X$-axis) as measured in the laboratory before flight, for each test-mass. The physical gain (that relates the electrode voltage to the measured electrostatic acceleration) along the $X$-axis of IS1-SUEP is estimated to be $6.89\times{}10^{-8}$ms$^{-2}$/V, while that of IS2-SUEP is estimated to be $8.05\times{}10^{-8}$ms$^{-2}$/V. In the same way, the physical gain along the $X$-axis of IS1-SUREF electrodes is estimated to be $6.89\times{}10^{-8}$ ms$^{-2}$/V and that of IS2-SUREF to $5.37\times{}10^{-8}$ms$^{-2}$/V. \begin{table}[t] \caption{\label{tab_resbias2} Bias and thermal sensitivity of the actuator electronics (DVA) at electrodes $X+$ and $X-$ (that control translation along the $X$-axis) as measured in the laboratory before flight.} \begin{indented} \item[]\begin{tabular}{@{}lll} \br & $X+$ & $X-$ \\ \mr Noise (all masses) [$\mu$V\,Hz$^{-1/2}$] & 0.4 & 0.4 \\ \mr Bias [$\mu$V] \\ IS1-SUREF & 157.05 & 167.56 \\ IS2-SUREF & 117.95 & 145.64 \\ IS1-SUEP & 146.80 & 224.86 \\ IS2-SUEP & 255.64 & 253.58 \\ \mr Thermal sensitivity [$\mu$V/K] \\ IS1-SUREF & 0.32 & 1.00 \\ IS2-SUREF & -0.78 & 0.86 \\ IS1-SUEP & -2.01 & -1.11 \\ IS2-SUEP & 0.44 & -0.89 \\ \br \end{tabular} \end{indented} \end{table} \section{Launch and mission operations} \label{sect_commissioning} MICROSCOPE was launched from Kourou on April 25, 2016 and injected into a sun-synchronous, circular, Low Earth orbit. Its mean semi-major axis 7090km and small eccentricity ($1.4 \times{}10^{-3}$) are perfectly compliant with science requirements. In particular, a low eccentricity reduces the disturbing effect of the Earth's gravity gradient at the $f_{\rm EP}$ frequency. The 710 km altitude was chosen from a trade-off to minimise the atmospheric drag while maximising the strength of the Earth's gravitational acceleration. A sun-synchronous orbit is beneficial to stabilise the temperature of the satellite. Given these orbital parameters, the orbital frequency $f_o = 1.6818 \times{}10^{-4}$ Hz. The T-SAGE instrument was switched on one week later (May 2nd, 2016) and its four test-masses were levitated about their six degrees of freedom. Fig. \ref{fig_TMrelease} shows the measured electrostatic acceleration and position of SUEP (upper panel) and SUREF (lower panel) of all four test-masses during release at the same time. Before release, the test masses are locked. Therefore the electrostatic control exerts its maximum force leading to a saturated measured acceleration. The position measurement gives the locked position. When the test-masses are unlocked, they start to oscillate and their position converges at the centre of the cage. They are then acquired and controlled by the electrostatic servo-loop. After a brief verification of the satellite's behaviour, where all its operational modes were checked, the DFACS was turned on and the six degrees of freedom of the satellite were continuously servo-controlled with the help of the measurements provided by the scientific payload and the star-trackers. The DFACS provides a very soft acceleration environment to the experiment \cite{prieur17}. \begin{figure} \begin{center} \includegraphics[width=0.75\textwidth]{fig_6a} \includegraphics[width=0.75\textwidth]{fig_6b} \caption{Transient phase during the first test-mass levitation acquisition; before the release of the test-masses, all detectors show the test-masses locked on the stops; after release, the position sensor for each degree of freedom is controlled to null; the operation is perfectly autonomous from the first levitation on May, the 2nd. Both Sensor Units are shown. In both panels, green and purple lines represent the position of the test-mass along X, and the blue and red lines show their control electrostatic acceleration along X.} \label{fig_TMrelease} \end{center} \end{figure} After the commissioning phase ended on November 14, 2016, the satellite and payload were declared ready for science operations in optimal thermal environment conditions. Since then, the science program has been managed as a succession of independent sessions in order to allow in-orbit flexibility of the mission scenario which can be modified weekly. Several science sessions have been successively performed with SUREF and SUEP: in-orbit calibration sessions of five orbits in inertial pointing and WEP test sessions of 120 orbits with the satellite spinning about its axis normal to the orbital plane. In this paper, as in Ref. \cite{touboul17}, we focus on only two WEP test sessions: one with the SUREF instrument of 62 orbits and one of with the SUEP instrument of 120 orbits. The science phase includes several measurement sessions dedicated either to the SUEP or the SUREF instrument. Because of a failure in a capacitor, the power consumption increased in the SUREF, and thus so did the operating temperature also. In order to minimise the risk of a failure propagation, SUEP and SUREF were not used simultaneaously. For each Sensor Unit, the test-mass motions are compared by calculating the difference of electrostatic acceleration during up to 120 orbits, sampled at 4Hz rate. This duration was defined prior to launch and is actually limited by the operation of the attitude controller that must be reset periodically. This limits the effect of any stochastic disturbance (instrument noise, stochastic distribution of accelerometric environment). The scenario alternates EP sessions and calibration sessions in order to monitor the stability of the experiment. Moreover, we have defined the duration of the sessions as a multiple of orbital periods $T_o$, spin periods $T_s$ and EP periods $T_{\rm EP}$. This has the advantage of getting a natural de-correlation between signals at multiples of $f_o$, $f_s$ and $f_{\rm EP}$. This is achieved by first estimating the orbital frequency from the orbit determination and then controlling the spin frequency to be a rational number times the orbital frequency. The spin frequencies have been selected to take advantage of the actual instrument levels and shapes (lower noise at higher frequencies: see Fig. \ref{fig_ggt}), as proposed also in the STEP mission \cite{sumner2007}: enforcing the compatibility between the spacecraft, the instrument capabilities and the natural de-correlation led to $f_s = 35/2 f_o$ for most sessions dedicated to the SUEP instrument, and $f_s = 9/2 f_o$ for most sessions dedicated to the SUREF instrument. The rotation of the satellite is performed about the axis normal to the orbital plane, in the opposite direction to the orbital motion. Thus the apparent rotation of the Earth in the satellite frame defines the measurement frequency $f_{\rm EP}$ as the sum of the orbital frequency $f_o$ and of the satellite spin frequency $f_s$, $f_{\rm EP}=f_o+f_s$: \begin{itemize} \item $f_{\rm EP} = 3.1113 \times{}10^{-3}$ Hz for SUEP in this paper; \item $f_{\rm EP} = 0.92500 \times{}10^{-3}$ Hz for the SUREF in this paper. \end{itemize} In practice, the theoretical relation between the different periods mentioned above cannot be perfectly satisfied. Hardy et al. \cite{hardy13b} have studied realistic cases. In particular, with a specified error of $3\times{}10^{-8}\rm\,rad\,s^{-1}$ in the actual spin frequency, the projection rate of signals at frequencies $(n_1 f_o+n_2 f_s)$ over the $f_{\rm EP}$ frequencies does not exceed $10^{-4}$ (see Table 1 in). It has been checked in flight that this specification on the spin frequency is fully respected. Tests of SUEP or SUREF at different frequencies have been performed since then and are being processed. \begin{figure} \includegraphics[width=0.95\textwidth]{fig_7} \caption{Fast Fourier Transform (FFT) of the difference of the measured electrostatic acceleration along X during the scientific session with the SUEP instrument; $f_{\rm EP} = 3.1113 \times{}10^{-3}$ Hz; $f_o = 1.6818 \times{}10^{-4}$ Hz; satellite rotation frequency $f_s$ = $2.9432 \times{}10^{-3}$ Hz; the main peak caused by the gravity gradient is at $2 f_o = 6.222 \times{}10^{-3}$ Hz. The peaks at higher frequencies are common mode signals that disappear after matching the scale factors.} \label{fig_ggt} \end{figure} \section{Measurement, WEP signal and systematics} \label{sect_measure} \begin{figure} \center \includegraphics[width=0.5\textwidth]{fig_8} \caption{Orientation of the test-mass axes versus satellite axes.} \label{figor} \end{figure} We define ${\vec \Gamma_k} $ as the acceleration exerted on the $k$-th test-mass by the electrodes that surround it. The three components of each acceleration ${\vec \Gamma_k} $ are measured in the frame ($X_k$,~$Y_k$,~$Z_k$) attached to the corresponding test-mass electrode set (see Fig. \ref{figor}). Because of small (time-independent) misalignments with respect to the satellite frame, ($X_{\rm sat}$,~$Y_{\rm sat}$,~$Z_{\rm sat}$), the locally measured components ${\vec \Gamma_k} $ are related to their components ${\vec \Gamma_k^{\rm sat}} $ in the satellite frame via ${\vec \Gamma_k} = [\theta_k] {\vec \Gamma_k^{\rm sat}} $, where the matrix $[\theta_k]$ reads \begin {equation} \left[\theta_{k}\right] = \left[ \begin{matrix} 1 & \theta_{kz} & -\theta_{ky} \\ -\theta_{kz} & 1 & \theta_{kx} \\ \theta_{ky} & -\theta_{kx} & 1 \\ \end{matrix} \right]. \end {equation} The three (antisymmetric) off-diagonal elements $\theta_{kl}$ measure the small rotation between the satellite frame and the $k$-th test-mass frame ($\theta_{kl} < 2.5 \times{}10^{-3}$\,rad, as constrained by the construction of the MICROSCOPE instrument and its installation on board the satellite). In addition to the antisymmetric off-diagonal elements $\theta_{kl}$, there are also other defects to be taken into account in the measurement equation: the control acceleration offsets, the non-unit scale factors (1+$K_{kl}$) and the couplings ($\eta_{kl}$). The measurement is then written as ${\vec \Gamma_k}^{\rm meas} = [A_k] {\vec \Gamma_k}$ where the sensitivity matrix $[A_k]$ reads \begin {equation} \left[A_k \right]~=~\underbrace{\left[ \begin{matrix} 1+K_{kx} & 0 & 0 \\ 0 & 1+K_{ky} & 0 \\ 0 & 0 & 1+K_{kz} \end{matrix} \right]}_{\text{scale factor}} + \underbrace{\left[ \begin{matrix} 0 & \eta_{kz} & \eta_{ky} \\ \eta_{kz} & 0 & \eta_{kx} \\ \eta_{ky} & \eta_{kx} & 0 \end{matrix} \right]}_{\text{coupling}}. \end {equation} Any WEP violation will appear in the difference of accelerations between the inner mass ($k=1$) and the outer mass ($k=2$) of the SUEP sensor measurement, say ${\vec \Gamma_d}^{\rm meas} \equiv {\vec \Gamma_1}^{\rm meas} - {\vec \Gamma_2}^{\rm meas}$ (we call acceleration the ratio between the electrostatic force and the inertial mass). The derivation of the measurement is detailed in Ref. \cite{hardy13a}: \begin{multline} \label{eq_gammad} \overrightarrow\Gamma_d^{meas}\simeq \left[M_c\right]\left( \delta\left(2,1\right) \overrightarrow g \left( O_{sat} \right) + \left( \left[ T \right]- \left[\rm{In}\right] \right)\overrightarrow\Delta - 2\left[\Omega \right]\dot{\overrightarrow\Delta}-\ddot{\overrightarrow\Delta} \right) + \overrightarrow K_{0,d} \\ + 2\left[ M_d\right] \overrightarrow\Gamma_c^{app} + \overrightarrow \Gamma_d^{quad} + \left[ \rm{Coupl}_d\right] \dot{\overrightarrow \Omega}+ \overrightarrow \Gamma_d^{n}, \end{multline} where all quantities are expressed in the instrument frame and $\delta(2,1)$ is the potential WEP violation signal (approximate E\"otv\"os parameter of the outer mass (2) with respect to the inner mass (1) --see Sect. \ref{ssect_delta}) coupled to the Earth gravity acceleration vector in the satellite frame $\overrightarrow g(O_{\rm sat}) =\left(g_x, g_y, g_z \right)^T$. Other terms on the right-hand-side of the equation are instrumental and nuisance contributions to the measurement, which impact its accuracy and precision. They can be sorted into three main non-exclusive categories: (i) geometrical and mechanical imperfections, (ii) perturbative accelerations and (iii) electronic noise. We briefly list them here, before giving more details about their effects below. Geometrical imperfections come from tiny differences in the centring, alignment and parallelism of the test-masses or the electrodes with respect to each other and to the satellite. The most obvious is the test-masses off-centring (their centres of mass are not exactly coincident): $\overrightarrow \Delta = \left(\Delta x,\Delta y,\Delta z \right)^T$ is the vector (in the satellite frame) connecting the centre of the inner mass to that of the outer mass (see Sect. \ref{ssect_ggt}). Their first and second time derivatives $\dot{\overrightarrow \Delta}$ and $\ddot{\overrightarrow \Delta}$ are nullified in the instrument's bandwidth when the instrument servo-controls maintain the masses motionless versus the satellite frame. The off-centrings are coupled to the Earth gravity gradient tensor and to the matrix gradient of inertia (expressed in the satellite frame) $\left[ T \right]$ and $[\mathrm{In}]= \left[\dot \Omega\right] + \left[ \Omega \right]\left[ \Omega \right]$, creating a characteristic signal at the $2f_{\rm EP}$ frequency (see Sect. \ref{ssect_ggt}). The first derivative of the off-centring couples to the satellite angular velocity to give rise to a Coriolis effect $2\left[ \Omega \right]\dot{\overrightarrow \Delta}$ ; it is very weak because the relative velocity of the test-masses at the test frequency is limited by the integral term of the accelerometer's servo-loops and because the angular velocity is well controlled by the satellite DFACS loops. Additionally, correlations in the accelerations projected on different axes, as well as projections of undesired contributions may result from misalignments, thereby contaminating the measurement. Those imperfections are accounted for in the common-mode and differential-mode sensitivity matrices $\left[M_c\right] = \frac{1}{2}\left(\left[A_1\right]\left[\theta_1\right]+\left[A_2\right]\left[\theta_2\right]\right)$ and $\left[M_d\right] = \frac{1}{2}\left(\left[A_1\right]\left[\theta_1\right]-\left[A_2\right]\left[\theta_2\right]\right)$. The $\left[M_d\right]$ matrix can be calibrated in flight to minimise their effect on the measurement (see Sect. \ref{ssect_calib}). Mechanical imperfections impact the control of the test-mass positions. The mechanical parts must be well designed and integrated (with no residual free-motions, with stabilities of the instrument assembly, with low residual stiffness between the masses and these assemblies). The accuracy of the measurement is limited by the sensors position noise, by the inertial sensors servo-channel qualities and the stabilities of the instrument mechanics which form the instrument frame reference before launch, and by the performance of the servo-channel electronics that has been measured in the laboratory as already shown in Tables \ref{tab_resbias} and \ref{tab_resbias2}. The most obvious disturbing accelerations are non-gravitational accelerations applied to both test-masses through the satellite (such as atmospheric drag and solar radiation pressure). They can be minimised by the satellite's drag-free system (see Sect. \ref{ssect_dragfree}). As they are felt by both test masses, those accelerations are combined in the common-mode acceleration $\overrightarrow\Gamma_c^{app}$. Additionally, $\overrightarrow \Gamma_d^{quad}$ is the difference of the non-linear terms in the measurement (mainly the difference of the quadratic responses of the inertial sensors). Other disturbing accelerations, that do not appear directly in Eq. (\ref{eq_gammad}) are due to: \begin{itemize} \item radiation pressure, radiometer effect and residual gas damping --Sect. \ref{ssect_therm}; \item local gravity of the satellite --Sect. \ref{ssect_field}; \item magnetic field effect --Sect. \ref{ssect_field}; \item electric field --Sect. \ref{ssect_field}; \end{itemize} Finally, Eq. (\ref{eq_gammad}) takes into account the vector $\overrightarrow K_{0,d}$ of the difference of the inertial sensor measurement offset, the matrix $\left[ \mathrm{Coupl}_d \right]$ of the difference, between the two sensors, of the coupling from the angular acceleration $\dot{\overrightarrow \Omega}$ to the linear acceleration (see Sect. \ref{ssect_coupling}), and the difference $\overrightarrow \Gamma_d^{n}$ of the acceleration measurement noises of the two sensors (coming from thermal noise, electronic noise, parasitic forces,...), including stochastic and systematic error sources. \subsection{WEP signal} \label{ssect_delta} $\delta \overrightarrow{g}$ (7.9\,m\,s$^{-2}$) is the signal to be possibly found if the WEP is violated to a high enough level. In an ideal experiment, the SUREF should give a null value while the SUEP gives a signal proportional to the E\"otv\"os parameter for that combination of materials. Since the $X$-axis is much more sensitive than $Y$ and $Z$, we use only measurements along this axis to look for an EP violation; the corresponding model is Eq. (\ref{eq_gammad}) projected on the $X$-axis. Thence, only the first lines of the matrices $[M_c]$, and $[M_d]$ are relevant to our analyses. \subsection{Effects of off-centrings and gravity gradients} \label{ssect_ggt} As shown by Eq. (\ref{eq_gammad}), the differential measurement is sensitive to the Earth gravity gradient, mainly modulated in the instrument frame at $2f_{\rm EP}=2(f_o+f_s)$ \cite {touboul12}. The amplitude of this signal depends on the off-centring $\overrightarrow \Delta$ between the centre of the test-masses. We can easily see the corresponding peak in the frequency domain (at $2f_{\rm EP} = 6.222 \times{}10^{-3}$ Hz) in Fig. \ref{fig_ggt}. We follow Ref. \cite{metris98} to compute the Earth gravity gradient tensor projected into the instrument frame, with the help of the measured position and attitude of the satellite and the ITSG-Grace2014s gravity potential model \cite{mayer06} expanded up to spherical harmonic degree and order 50. The distance between the two test masses' centres of mass is a priori unknown but its components along the $X$- and $Z$-axes (in the instrument frame, fixed to the satellite frame) can be precisely estimated from the gravity gradient signal at $2 f_{\rm EP}$. \\ The contribution of this effect in the differential measurement can then be corrected; the remaining error after correction can be expressed by: \begin{equation} \label{eq_dggt} \left( [T] \overrightarrow{\Delta}_{DC} - \hat{[T]}\hat{\overrightarrow{\Delta}}_{DC} \right) \approx \left( [T]- \hat{[T]} \right) \overrightarrow{\Delta}_{DC} + \hat{[T]} \left( \overrightarrow{\Delta}_{DC} - \hat{\overrightarrow{\Delta}}_{DC} \right) \end{equation} where $\hat{\alpha}$ denotes the estimate of $\alpha$. The first term is due to error on the gravity gradient, expressed in the instrument frame, used to correct the effects of the estimated off-centring. The second term is due to the error of calibration of the off-centring. In contrast with the STEP mission \cite{sumner2007}, it is better here not to correct the real position of the test-mass to cancel the gravity-gradient effects. Indeed, this position corresponds to the zero of the capacitive sensor that is not optimised to operate far from this position. In closed loop, the capacitive sensor output is null because an equivalent force is applied to displace the test-mass in order to nullify the output of the capacitive sensing. This back-action force turns into an offset in the accelerometer measurement output. Given the very small distance between the two test-masses, an error on the gravity gradient limited to $10^{-11}$s$^{-2}$ leads to an error smaller than a few $10^{-16}$ms$^{-2}$ on the acceleration correction. The intrinsic knowledge of the Earth gravity potential ensures an error much smaller than $10^{-11}$s$^{-2}$ on the gravity gradient tensor; however it is also necessary to know the position of the satellite and its attitude (to convert the gradient tensor from the Earth frame to the instrument frame) with a sufficient precision. The precise orbit and attitude are provided by CNES. The orbit determination is based on a Doppler tracking system currently used in the Myriad Satellite Line and on-board Global Positioning System (GPS) receiver measurements. For the SUEP session, the accuracy of the position knowledge is estimated to be 0.061 m along the radial direction, 0.109 m along the cross-track direction and 0.133 m along the tangential direction; this is much better than needed (the most stringent requirement is specified to 7 m). The attitude of the satellite is evaluated by filtering and combining the on-board star tracker system outputs and the angular acceleration measurements provided by the instrument itself. The alignment between the star tracker frame (satellite frame) and the instrument frame has been calibrated by ground measurements during the satellite integration and after qualification. This ground calibration is used to project the star sensor frame onto the instrument one but the small misalignment values ($\approx 10^{-4}$ rad), allow it to be neglected. The hybridisation of the accelerometer and the star sensor measurements create a systematic error depending on frequency. When the satellite rotates, the star sensor exhibits an accuracy of 0.14 $\mu$rad about $X$-axis (instrument frame), 0.81 $\mu$rad about $Y$-axis and 0.13 $\mu$rad about $Z$-axis. These accuracies are compliant with the correction of the gravity gradient to $10^{-16}$ ms$^{-2}$ (requiring only 1$\mu$rad). To mitigate uncertainties in the off-centring, we benefit from the fact that the gravity gradient signature is mainly at $2f_{\rm EP}$ frequency, allowing $\Delta x$ and $\Delta z$ to be estimated from this signal; its contribution at $f_{EP}$ is small in inertial mode and completely negligible in spinning mode (which is the case considered here) \cite{touboul12}. In the nominal configuration, where the $Y$-axis is normal to the orbital plane, the gravity gradient due to the off-centring along $Y$ is negligible. Nevertheless, it is calibrated (and corrected if necessary) through a dedicated session, where we project the gravity gradient along the $X$-axis by biasing the satellite star tracker output which causes the DFAC to swing the satellite. The off-centring has been estimated for the SUEP during the EP session (120 orbits) for the $X$ and $Z$ components and during the calibration session after the EP session (5 orbits) for the $Y$ component: \begin{itemize} \item Along $X$: $\Delta x = 20.14 \pm{}0.05 \mu$m \item Along $Z$: $\Delta z = -5.55 \pm{}0.05 \mu$m \item Along $Y$: $\Delta y = -7.4 \pm{}0.2 \mu$m. \end{itemize} \subsection{Calibration} \label{ssect_calib} Dedicated sessions are used for in-flight calibration: stimuli specific to each parameter are applied in the DFACS satellite loop \cite{guiu07,jafry02} or in the test-mass control loop \cite{hardy13a, hardy12}. The calibration allows us to match both the sensitivities of the sensor and the alignments of their $X$ axes and to verify the quadratic term levels \cite{hardy13a, guiu07, hardy12}. Note that it is designed to optimise the precision of the measured acceleration along the most sensitive axis ($X$). In order to calibrate some elements of the matrix ${M_d}$, a sine wave linear acceleration of $5 \times{}10^{-8}$ms$^{-2}$ at the frequency $f_{\rm calib} = 1.2285 \times{}10^{-3}$Hz is applied to the satellite propulsion by biasing the SU measurement output used by the DFACS along one axis (Fig. \ref{fig_calib}). For a given SU, both test-masses undergo the same acceleration, allowing for the estimate of the difference of their sensitivities along their various axes, their misalignment and their cross-axes coupling (having previously demonstrated a sufficient sensor output linearity). \begin{figure} \includegraphics[width=0.95\textwidth]{fig_9} \caption{Difference of acceleration measured along the $X$-axis during a $[M_d]$ matrix calibration session, in the time domain (left) and frequency domain (right). A sine wave of $5 \times{}10^{-8}$ms$^{-2}$ at $1.2285 \times{}10^{-3}$Hz was added to the drag-free loop. The spike about $t=26000$ s is due to a transient acceleration applied to the satellite and seen through the transfer function and the anti-aliasing filter of the measurement channels; a residual signal remains in the difference; such a large signal occurs less than once a week and is probably due to micro-debris.} \label{fig_calib} \end{figure} \begin{table}[t] \caption{\label{tab_calib} Coefficients of the first line of the $[M_d]$ matrix, as estimated in orbit with dedicated sessions. The quadratic terms $K_{2i}$ were evaluated by exploiting the $2\times{}f_{\rm calib}$ frequency during the same sessions.} \begin{indented} \item[]\begin{tabular}{@{}lll} \br Parameter & SUREF & SUEP \\ \mr $M_{d11}/M_{c11}$ & $-1.43\times{}10^{-2} \pm{}0.8\times{}10^{-4}$ & $8.56\times{}10^{-3}\pm{}6.5\times{}10^{-5}$ \\ $M_{d12}/M_{c11}$ [rad] & $-2.62\times{}10^{-5} \pm{}2.4\times{}10^{-6}$ & $-2.63\times{}10^{-4} \pm{}6.4\times{}10^{-6}$ \\ $M_{d13}/M_{c11}$ [rad] & $-8.90\times{}10^{-5} \pm{}2.0\times{}10^{-6}$ & $1.24\times{}10^{-4} \pm{}1.1\times{}10^{-5}$ \\ $(K_{21} - K_{22})/ M^2_{c11}$ [m$^{-1}$s$^2$] & $1795 \pm{}82$ & $695 \pm{}335$ \\ $|K_{21}|$ [m$^{-1}$s$^2$] & $\leqslant 3800$ & $\leqslant 900$ \\ $|K_{22}|$ [m$^{-1}$s$^2$] & $\leqslant 1500$ & $\leqslant 600$ \\ \br \end{tabular} \end{indented} \end{table} The requirements on both SU's $M_{d11}/M_{c11}$, $M_{d12}/M_{c11}$ and $M_{d13}/M_{c11}$ terms were established before launch, based on an analytical error budget. As shown in Table \ref{tab_calib}, they are virtually obtained by construction and integration of the instrument, without correction. Nevertheless, those terms are estimated in orbit just before each respective EP session, with accuracies better than $10^{-4}$ (two orders of magnitude better than the requirements). Two methods were used to check the sensor linearity along their $X$-axis (i.e., estimate their quadratic terms). The first one is a by-product of $M_{d11}/M_{c11}$ calibration sessions: $(K_{21}-K_{22})/M^2_{c11}$ is readily extracted from the $2f_{\rm calib}$ signal. The second method is based on applying a square wave acceleration to the satellite: a large amplitude 60Hz-signal acceleration ($1.3\times{}10^{-7}$m\,s$^{-2}$ to $2\times{}10^{-7}$ m\,s$^{-2}$ depending on the mass) is alternatively turned on and off during 500s phases. The servo-loop's gain rejects the response at 60Hz and 120Hz, while the quadratic response produces a constant signal added as an offset to the control acceleration during 500s every 1000s: the expected signal is thus a mHz-square signal proportional to the quadratic coefficient. Due to the low values of the quadratic terms realised in-flight, the response to the stimuli is at the limit of the sensitivity, so that Table \ref{tab_calib} reports only upper bounds. Both methods provide values much lower than requirements ($|K_{21}| <$ 20 000 m$^{-1}$s$^2$ and $|K_{22}| <$ 6 000 m$^{-1}$s$^2$) (Table \ref{tab_calib}). \subsection{DFACS operation and impact} \label{ssect_dragfree} Since the inertial sensor sensitivities are not perfectly identical (the sensitivity $[M_d]$ is not null), the difference of acceleration measurement is sensitive to the level of the platform's residual acceleration (Eq. \ref{eq_gammad}). When in operation, the satellite's drag-free control acts on the propulsion system to cancel the measurement output of one test-mass (or more rarely of a combination of two test-masses). Then, the residual acceleration measured by the sensor controlling the drag-free compensation represents the residual of the DFACS pilotage. Fig. \ref{fig_dragfree} shows the measured acceleration when the drag-free is controlled by SUEP's external mass: the DFACS residual is less than $10^{-14}$\,m\,s$^{-2}$ in the bandwidth of interest [$10^{-4}$ Hz -- $4\times10^{-3}$ Hz] (green line). The other sensor gives an upper bound of the residual acceleration experienced by the satellite. It mainly contains the residual common mode acceleration ($\leqslant 10^{-13}$\,m\,s$^{-2}$ at $f_{EP}=3.1\times10^{-3}$ Hz) and all systematic errors (the gravity gradient dominates at $2f_{EP}$). It is one order of magnitude smaller than the requirements, which helps to reduce the constraint on the calibration accuracy. \begin{figure} \center \includegraphics[width=0.7\textwidth]{fig_10.jpg} \caption{FFT of the SUEP acceleration measurement along X for the inner mass (IS1 --blue) and the outer mass (IS2 --green) over 120 orbits. The IS2 test-mass output provides the measurements to the drag-free loop (which has a bandwidth of about 0.01 Hz).} \label{fig_dragfree} \end{figure} The DFACS also controls the satellite's attitude in order to limit the variation of its angular acceleration and velocity at $f_{EP}$. The resulting residuals are lower than $7 \times10^{-12}$ rad\,s$^{-2}$ and $3.6 \times10^{-10}$ rad\,s$^{-1}$, respectively. \subsection{Instrument error analysis} \label{ssect_coupling} \subsubsection{Noise characteristics} The frequency characteristics of the instrument noise were finely analysed before launch, both through tests on the MICROSCOPE flight models and through our experience from previous missions (GRACE, GOCE -- Refs. \cite{touboul99, touboul04, flury08, marque10}). Each inertial sensor's error budget was established in Ref. \cite{touboul12}. Fig. \ref{fig_noise} shows the expected difference of acceleration noise along the $X$ axis (red curves) and compares it with the measured noise (blue curves). The deviation of the measured noise with respect to the expected one is not yet totally explained. The noise depends mainly on three terms, which we describe below. \begin{figure} \centering \includegraphics[width=0.9\textwidth]{fig_11a} \includegraphics[width=0.9\textwidth]{fig_11b} \caption{Spectral Density of the sensor difference of acceleration along the x sensitive axis for SUEP (upper panel) and SUREF (lower panel): measured noise (in blue) with its fit (in black) and modelled before flight (in red).} \label{fig_noise} \end{figure} At higher frequencies, the noise is dominated by the contribution of the position sensor noise multiplied by the square of the angular frequency. The position of the test-masses inside their electrode cage is measured by capacitive sensing converted into displacement, sampled at 1 Hz and stored in the housekeeping data. Fig. \ref{fig_pos218} shows the spectral density of the test-mass position measured along the $X$-axis for SUEP and SUREF. The maximum level of noise around $f_{\rm EP}$ and $2 f_{\rm EP}$ is less than $10^{-10}$\,m\,Hz$^{-1/2}$ for all four masses. The shape at low frequency of the inner test-mass position spectrum is determined by the PID control law and the level of acceleration. In particular in the experiment leading to Fig. \ref{fig_pos218}, we implemented a softer PID for SUEP than for SUREF. This new PID gave better rejection of aliasing of resonant frequencies between 10Hz and 12Hz into the range of 0.1Hz to 1Hz. A large number of peaks from $6\times{}10^{-3}$Hz to $4\times{}10^{-2}$Hz in common-mode measurements almost completely disappear in the differential measurement. \begin{figure} \center \includegraphics[width=0.45\textwidth]{fig_12a} \includegraphics[width=0.45\textwidth]{fig_12b} \caption{Spectral density of the test-mass position measurement along X: SUEP (left) and SUREF (right)} \label{fig_pos218} \end{figure} Finally, the spectrum is governed by damping of the test-mass motion with respect to the instrument frame ($f^{-1/2}$ behaviour) at low frequencies, and by the thermal environmental noise ($f^{-1}$ behaviour) at very low frequency. The latter depends on the thermal sensitivity of the instrument and the environment temperature fluctuations. The damping has been attributed to the gold wire used to control the charge of the test mass. This effect is supposed to be much greater than the one caused by residual gas in the vacuum vessel due to out-gassing of mechanical parts : the use of silica parts and getter material limit the amount of residual gas. Using a rough assumption about the quality factor ($Q=100$) of the gold wire \cite{willemenot00b}, Fig. \ref{fig_noise} shows the best log-log fits to the measured spectral density, with known frequency laws $f^{-1/2}$ and $f^2$. The red curves correspond to the expected noise with the error model established before the launch. Though it shows a good order of magnitude, the rough model may be improved. Table \ref{tab_bias} shows the values of the acceleration offset and noise (around $10^{-3}$ Hz) observed on the $X$-axis for all inertial sensors. The biases are computed as the mean values of the outputs over an integer number of orbits, without no drag-free. This is a good approximation since the drag acceleration averages to zero over one orbit, and the effects of the gravity gradients (Earth and satellite) and of the radiation pressure are negligible compared to the biases. The values of the noise at $10^{-3}$\,Hz correspond to the maximum of the spectrum at this frequency. The noise levels on the $Y$ and $Z$ axes are observed to be less than a few $10^{-11}$\,m\,s$^{-2}$Hz$^{-1/2}$ and $10^{-10}$\,m\,s$^{-2}$Hz$^{-1/2}$ respectively. Given the low cross-coupling ($<10^{-4}$) observed during calibrations, the noise sources from the $Y$ and $Z$ projected on the $X$-axis are negligible. \begin{table}[t] \caption{\label{tab_bias} Control acceleration offset and noise along $X$ of the four inertial sensors: a good approximation of the offsets can be given by the mean values of the acceleration measurement outputs over an integer numbers of orbits (when the drag-free is not operating), the noise is evaluated by the maximum values of the spectra of the sensor output difference at the stated frequency.} \begin{indented} \item[]\begin{tabular}{@{}lllll} \br & Measured acceleration offset [m\,s$^{-2}$] \\ \mr SUREF internal mass (IS1) & $-1.4\times{}10^{-7}$ \\ SUREF external mass (IS2) & $ 7.7\times{}10^{-7}$ \\ SUEP internal mass (IS1) & $3.4 \times{}10^{-8}$ \\ SUEP external mass (IS2) & $-1.4\times{}10^{-6}$ \\ \br & Observed acceleration noise at $10^{-3}$Hz [m\,s$^{-2}$Hz$^{-1/2}$] \\ \mr SUREF Difference (IS1-IS2) & $<2.5 \times{}10^{-11}$ $\pm{}0.5\times{}10^{-11}$ at 1$\sigma$ \\ SUEP Difference (IS1-IS2) & $< 11.6 \times{}10^{-11}$ $\pm{}0.9\times{}10^{-11}$ at 1$\sigma$ \\ \br \end{tabular} \end{indented} \end{table} \subsubsection{Stiffness} Most of the measurement offset comes from the stiffness of each sensor with respect to the instrument frame. The periodic displacement of a test mass with respect to its electrodes induces a measurable periodic acceleration proportional to its stiffness and to its displacement. The sensor stiffnesses have been characterised in flight during the commissioning phase (Table \ref{tab_stiffness}). \begin{table}[h] \caption{\label{tab_stiffness} Measured and expected (between brackets) stiffness; the theoretical values have been computed before the flight assuming a perfect and simple electrostatic configuration and a negligible stiffness of the wire.} \begin{indented} \item[]\begin{tabular}{@{}lllll} \br Axis & IS1-SUREF & IS2-SUREF & IS1-SUEP & IS2-SUEP \\ \mr $X$ [$\times{}10^{-3}\rm N\,m^{-1}$]& 1.1 ($\sim 0$) & 5.7 (0) & 1.8 ($\sim 0$) & 1.1 (0) \\ $Y$ [$\times{}10^{-2}\rm N\,m^{-1}$] & -1.5 (-2.8) & -8.4 (-14.3) & -1.7 (-2.8) & -6.9 (-12.4) \\ $Z$ [$\times{}10^{-2}\rm N\,m^{-1}$] & -1.5 (-2.8) & -7.5 (-14.3) & -1.5 (-2.8) & -6.8 (-12.4) \\ $\Phi$ [$\times{}10^{-5}\rm N\,rad^{-1}$] & 3.9 (-0.8) & 345 (-0.7) & 1.2 (-0.8) & 6.5 (-0.7) \\ $\Theta$ [$\times{}10^{-2}\rm N\,rad^{-1}$] & -0.6 (-0.7) & -3.4 (-5.3) & -0.5 (-0.7) & -3.0 (-3.5) \\ $\Psi$ [$\times{}10^{-2}\rm N\,rad^{-1}$] & -0.6 (-0.7) & -3.9 (-5.3) & -0.6 (-0.7) & -3.0 (-3.5) \\ \br \end{tabular} \end{indented} \end{table} The stiffness is expected to be particularly low on the $X$-axis because the capacitive sensing depends on the variation of overlap of the electrode area on the test-mass \cite{hudson07}. It should be similar on $\Phi$. But as shown in Table \ref{tab_stiffness}, both $X$ and $\Phi$ have a significant positive stiffness due to the higher than expected gold wire stiffness: a result of modifying the integration process to improve the resistance to launch vibrations. On the contrary, along the $Y$ and $Z$ axes, and for $\Theta$ and $\Psi$ rotations, the capacitive sensing is based on the variation of gap which generates a negative stiffness as for $\Theta$ and $\Psi$ sensing. The electrostatic stiffness, the derivative of the force with respect to the displacement, depends only on the geometry and the voltage applied on the electrodes. That is why we observe similar values on $Y$ and $Z$, for the SUEP and SUREF internal mass, that are electrostatically identical. For the external masses, the difference of the electrostatic stiffness is due to the different voltages applied on electrodes. The differences between the model and the in-orbit estimation is due to the simplified theoretical electrostatic configuration. The sensitivity of stiffness to the square of the voltage has been checked on all axes (but $X$) during the assessment phases, proving mainly an electrostatic origin; this has been checked by comparing stiffness when operating the sensors either in FRM (with $V_p = 40$V) with that in HRM (with $V_p = 5$V): stiffness varies with $V_p^2$. Note that for the axes $Y$, $Z$, $\Theta$ and $\Psi$, the major contribution to the stiffness comes from the outer cylinder supporting the $X$ and $\Phi$ electrodes. Thus, a larger gold wire stiffness causing a higher offset along $X$, the PID controller applies a DC voltage on $X$ electrodes increasing the stiffness along the radial axes. That is why the measured stiffness value for IS2-SUEP is higher that expected. The observed orders of magnitude confirm the accuracy of the geometry but the stiffness along the $X$-axis is larger than expected and independent of $V_p$, most likely because of the gold wire and its implementation \cite{willemenot00b,willemenot00a}. This error source is independent of the electrode geometry but depends on the geometry of the wire when glued by its extremities: the tools used to handle such a thin wire do not allow for a full control of its initial geometry; flexure and traction can mix when the mass moves, leading to a large range of values. The stiffness, either negative or positive, leads to an offset in the restoring force. As the mechanical stiffness of the gold wire was higher than expected, it was decided to increase the range of measurement along $X$ by applying a DC voltage on the $X$ electrodes $V'_p = -2.5$V. This voltage changes the scale factor of the $X$-axis and thus the sensor dynamic response. \subsection{Thermal sensitivity} \label{ssect_therm} From a thermal point of view, the instrument is composed of three elements: the digital electronics in the ICU, the two FEEU analogue electronics units and the two SU housings including the two masses. Each one has its own temperature, whose variation impacts the measurement in different ways: \begin{itemize} \item the variation of the electronics temperature induces a variation of the reference voltages, leading to a variation of scale factor or acceleration offset; \item the variation of the SU temperature induces a variation of the instrument's geometry and a variation of the force offsets due to photon (radiation pressure), to outgassing and to residual gas pressure (radiometer effect). The last two depend on the anisotropy of the temperature stability and the residual gas pressure. They are negligible primarily because the temperature stability is much better than the specified 0.001K at $f_{EP}$ (the anisotropy has been also measured and is 3 times lower). The pressure specified to be lower than $10^{-5}$Pa has not been measured in flight but was measured to be within the requirements on an engineering model during more than 5 years in the laboratory. \end{itemize} The temperature of the ICU is additionally constrained by the stability need of the bus power converters placed near the mechanical interface of the satellite. However, these specifications are compatible with the digital electronics operation and have no impact on the performance. Despite the very small temperature variations of the FEEU and of the SU around $f_{\rm EP}$, we do observe a drift of the acceleration measurements at lower frequencies; it is due to a temperature sensitivity. However, this can be corrected (see Sect. \ref{sect_analysis}), so that its impact remains negligible at $f_{\rm EP}$. We noted in Ref. \cite{touboul17} that the acceleration sensitivity to SU temperature variations is two orders of magnitude higher than expected. Since then, additional measurements allowed us to explain it as a consequence of thermal expansion of the satellite interface at SU bindings: SU parts expand more than the expected values calculated only with SU material properties. This expansion causes elongation of the gold wire of the outer test-mass and thus an increased force. The temperature of the FEEU is measured by 5 Pt-resistance thermometers mounted on the circuit boards and the unit interface. The spectrum of the temperature measured by the probe located at the electronic interface ($T_{\rm FEEU}$) is shown in Fig. \ref{fig_thermal}. At the $f_{\rm EP}$ frequency, no signal emerges from the probe noise of $2\times{}10^{-2}$\,K\,Hz$^{-1/2}$. That leads to a 1$\sigma$ upper bound $20 \times{}10^{-6}$ K of temperature variation at $f_{\rm EP}$. The requirement for the capacitive position sensor implemented in the FEEU is a stability of 1 K Hz$^{-1/2}$ (equivalently, $2 \times{}10^{-4}$ K over 120 orbits), the thermal behaviour at the orbital frequency defining the worst case for the satellite design. As expected, spinning the satellite significantly improves (by up to two orders of magnitude) the temperature stability about $f_{\rm EP}$, mainly because of thermal filtering \begin{figure} \center \includegraphics[width=0.7\textwidth]{fig_13} \caption{SUEP temperature variations: FEEU (upper panel), difference of temperature inside SU between 2 probes separated by 159 mm along $X$ (middle panel) and SU (lower panel).} \label{fig_thermal} \end{figure} Similarly, the temperature of the SU has been measured in orbit at six locations to confirm the very good passive insulation of the satellite payload enclosure and the very low thermal dissipation inside the core of the sensors. The temperature fluctuations at the interface with the satellite, $T_{\rm SU}$, are evaluated with the two probes closest to the interface. The temperature measurement is limited by the temperature probe noise, providing a 1$\sigma$ upper bound $15 \times{}10^{-6}$ K at $f_{\rm EP}$. We looked for systematic error at $f_{\rm EP}$ due to thermal variations with dedicated experiments. We could estimate the SU's and FEEU's thermal sensitivity by varying the temperature at the SU and FEEU interfaces with a controlled profile. Fig. \ref{fig_thermalstimulus} illustrates the experimental procedure: a temperature stimulus is locally applied to one of the units, FEEU or SU; in this particular case the resistors located on the plate between the two SU are switched on and off periodically in order to generate a periodic variation of temperature. The resistors are mounted by pairs in such a way that the current passing through each resistor of the pair is opposite and thus the induced magnetic field can be cancelled. Several periods have been used during the mission. The green line of Fig. \ref{fig_thermalstimulus} shows the temperature stimulus, while the blue line shows the concomitant SUEP baseplate temperature. The temperature and acceleration measurements are then analysed at the frequency of the stimuli, $f_{\rm th}$ and at its harmonics $2f_{\rm th}$, $3f_{\rm th}$ and $4f_{\rm th}$. The sensitivity at $f_{\rm EP}$ is deduced by interpolating the results from these 4 frequencies. Table \ref{tab_Tsens} lists the results for the $X$-axis. \begin{figure} \center \includegraphics[width=0.7\textwidth]{fig_14} \caption{Profile of the temperature stimulus (switch on of a resistor during 200sec periodically every 4500sec --green) and resulting temperature variations at the SUEP baseplate interface (blue).} \label{fig_thermalstimulus} \end{figure} \begin{table}[t] \caption{\label{tab_Tsens} Difference of acceleration thermal sensitivity at $f_{\rm EP}$} \begin{indented} \item[]\begin{tabular}{@{}lcc} \br & SUREF & SUEP \\ \mr Sensitivity to $T_{\rm SU}$ at $f_{\rm EP}$ [ms$^{-2}$K$^{-1}$] & $3.9\times{}10^{-9}$ & $4.3\times{}10^{-9}$ \\ Sensitivity to $T_{\rm FEEU}$, at $f_{\rm EP}$ [ms$^{-2}$K$^{-1}$] & $5\times{}10^{-11}$ & $7\times{}10^{-11}$ \\ \br \end{tabular} \end{indented} \end{table} Two important remarks must be raised: \begin{itemize} \item The temperature variation stimuli are performed at the SU interface. These stimuli also generate a temperature gradient, measured with two probes in the SU separated by 159 mm along $X$. During the scientific sessions, the sources of the temperature variations at $f_{\rm EP}$ are located outside of the payload enclosure, which is thermally decoupled from the rest of the satellite. Thus, the temperature variations around the SU are more uniform and the thermal sensitivity is dominated by the sensitivity to the interface temperature variation. \item At the time of writing, no signal at $f_{\rm EP}$ has been detected in the temperature probe measurements during the science sessions. The values taken into account here are limited by the noise of the measurement pick-up considered at $1\sigma$. \end{itemize} \subsection{Disturbing field environment} \label{ssect_field} \subsubsection{Magnetic field environment} Because of their different magnetic susceptibilities, the Pt and Ti test masses have different magnetic behaviours. Consequently, the instruments are inside a magnetic shield whose efficiency was characterised on ground prior to the launch. The satellite's magnetic torquers are switched off (except during the commissioning phase) in order to minimise any magnetic source on board. In the same way, particular care was taken when designing the sensor to avoid electrical pins with magnetic moments. The magnetic moment of the satellite is lower than 0.2 A\,m$^2$ (the specification was 1 A\,m$^2$) as deduced from the level of the residual torque due to the Earth's magnetic field, as it is counteracted by the satellite attitude control. Finally, a 3D finite element model of the satellite and of the instrument was realised to assess the residual magnetic field and gradient at the test-mass level. The magnetic field variations and its effects in terms of acceleration at $f_{\rm EP}$ were also considered. \subsubsection{Electric field environment} The vacuum tight metallic housings of the instruments act also in orbit as an electrical shields for both sensors. We have not observed any disturbance in the feedthroughs (that may limit the shielding). Measurements of the electronics were performed in open loop during the instrument and satellite Electro-Magnetic Compatibility (EMC) acceptance tests. In particular we compared the noise of the capacitive sensor at each stage with the reference one obtained with the electronics connected to a reference capacitor in the laboratory. No disturbing signal was detected, proving the low effect of the feedthroughs. Since the test-mass voltage is controlled by the gold wire, we do not consider the test-mass electrical charge and its fluctuation due to particle radiation. \subsubsection{Local gravity field environment} Besides the Earth's gravity, one has to consider the gravity and gravity gradient due to the satellite itself. A detailed model with meshing based on a Computer-Aided Design (CAD) model of the satellite and payload has been computed to estimate the self-gravity at the test-mass position. This model allowed us to check the thermal expansion due to temperature variation at different frequencies. Indeed, the thermal expansion at $f_{\rm EP}$ makes the mass distribution move and thus generates local gravity field variations. It has thus been demonstrated that their effects are negligible, even when we consider the motion of the test-mass inside the same instrument (note that the satellite has been designed to have no moving parts). The major effects come from the distribution of mass nearest to the test-mass (i.e. the SU itself). The geometry and the material used for the SU are well defined, so that the CAD model is well suited to compute the local gravity distribution and variations in the worst case conditions. Table \ref{tab_grav} summarises the local gravity effect in the differential measurement (maximum value along all axes) evaluated by considering the thermal variations as specified in inertial pointing. In spin mode, the temperature variations are much lower and should result in even smaller effects. \begin{table} \caption{\label{tab_grav} Gravity perturbations: satellite local gravity variations established by modelling} \begin{indented} \item[]\begin{tabular}{@{}ll} \br DC value of gravity field & $1.8\times{}10^{-8}$m\,s$^{-2}$ \\ Gravity field variations at $f_{\rm EP}$ (common mode effect) & $4\times{}10^{-13}$m\,s$^{-2}$ \\ Gravity gradient at $f_{\rm EP}$ & $4\times{}10^{-13}$ s$^{-2}$ \\ { }{ }{ }This effect results in $8\times{}10^{-18}$m\,s$^{-2}$ disturbing difference of acceleration\\ { }{ }{ }with 20$\mu$m off-centring \\ Difference of acceleration due to gravity effect & $1.5\times{}10^{-17}$m\,s$^{-2}$ \\ (thermal expansion) and to test-mass shape defects \\ \br \end{tabular} \end{indented} \end{table} \subsection{Summary of systematic error sources} Table \ref{tab_calibration} summarises the distribution of systematic error sources and the method used in the analysis to evaluate their amplitude or upper bound. The effect of off-centrings are evaluated by in orbit calibration associated to the DFACS performances. The DFACS performances are established with the accelerometer common mode and the star-tracker measurements (see Sect. \ref{ssect_dragfree}). \\ The main source of error comes from the temperature variation at $f_{\rm EP}$ seen through the accelerometer sensitivity (Sect. \ref{ssect_therm}). The value used to establish the systematic error is calculated on the basis of the noise of the temperature probe integrated over 120 orbits at 1$\sigma$ for the variations at $f_{\rm EP}$. Recent analyses, still under validation, may show that the actual variation is much lower. Nevertheless, in this paper we remain conservative and keep the more recent analyses for an upcoming paper. For the sake of simplicity, and to avoid a detailed consideration of correlation between errors, we add systematics linearly to get a 1$\sigma$ upper bound from systematics expressed as an E\"otv\"os parameter of $9\times 10^{-15}$. Table \ref{tab_calibration} shows the result for the SUEP. The error allocation for SUREF is the same except for thermal systematics which are estimated as $61 \times{}10^{-15}$\,m\,s$^{-2}$ if we consider the thermal sensitivities of Table \ref{tab_Tsens}. Thus, the total systematic error for SUREF, expressed as an E\"otv\"os parameter is $8 \times{}10^{-15}$ at 1$\sigma$. \begin{table} \caption{\label{tab_calibration} Evaluation of systematic errors in the difference of acceleration measurement for SUEP @$f_{\mathrm{EP}}$=3.1113$\times{}10^{-3}\,Hz$.} \begin{indented} \item[]\begin{tabular}{@{}lll} \br {\bf Term in the Eq.\,(1) projected} & \vline {\bf Amplitude or } & \vline {\bf Method} \\ {\bf on $\overrightarrow x$ in phase with $g_x$ at $f_{\mathrm{EP}}$} & \vline {\bf upper bound} & \vline {\bf of estimation} \\ \hline {\bf Gravity gradient effect } & & \\ {\bf $\left[ T \right]\overrightarrow \Delta$ in \,m\,s$^{-2}$} & & \\ \hline ($T_{xx}\Delta x$; $T_{xy}\Delta y$; $T_{xz}\Delta z$) & \vline $< (10^{-18}$;$ 10^{-19}$;$ 10^{-17}$) & \vline Earth{'}s gravity model. \\ \hline {\bf Gradient of inertia matrix $\left[ In \right]$} & & \\ {\bf effect along $X$ in\,m\,s$^{-2}$ } & & \\ \hline & \vline & \vline DFACS performances \\ $\dot \Omega_y\Delta z - \dot \Omega_z \Delta y$ & \vline $5\times{}10^{-17}$ & \vline and calibration. \\ \hline $\Omega_x \Omega_y \Delta y - \Omega_x \Omega_z \Delta z$ & \vline & \vline DFACS performances \\ $- \left(\Omega_y^2 + \Omega_z^2 \right)\Delta x$ & \vline $1.3 \times{}10^{-17}$ & \vline and calibration. \\ \hline {\bf Drag-free control in \,m\,s$^{-2}$} & {} & \\ \hline & \vline & \vline DFACS performances \\ $(\left[ M_d \right] \overrightarrow \Gamma_c^{app}). \overrightarrow x$ & \vline $1.7 \times{}10^{-15}$ & \vline and calibration. \\ \hline {\bf Instrument systematics} & & \\ {\bf and defects in \,m\,s$^{-2}$} & & \\ \hline & \vline & \vline DFACS performances \\ $(\overrightarrow \Gamma_d^{quad}).\overrightarrow x$ & \vline $5 \times{}10^{-17}$ & \vline and calibration. \\ \hline $([Coupl_d] \dot {\overrightarrow \Omega}).\overrightarrow x$ & \vline & \vline Couplings observed \\ & \vline $< 2 \times{}10^{-15}$ & \vline during commissioning phase.\\ \hline Thermal systematics & \vline & \vline Thermal sensitivity \\ & \vline $<67 \times{}10^{-15}$ & \vline in-orbit evaluation. \\ \hline Magnetic systematics & \vline $< 2.5 \times{}10^{-16}$ & \vline Finite elements calculation.\\ \hline {\bf Total of systematics in $\Gamma_{dx}^{meas}$} & \vline {\bf $< 71 \times{}10^{-15}\,$m\,s$^{-2}$} & \\ \hline {\bf Total of systematics in $\delta$ } & \vline $< 9 \times{}10^{-15}$ & \\ \br \end{tabular} \end{indented} \end{table} \subsection{Signal stationarity by wavelet analysis} So far, we based our analyses on power spectra, i.e. on FFT of the autocorrelation of the measured accelerations, under the implicit assumption that the signal is stationary. However, the Fourier transform does not provide any temporal information and is clearly not suited to detect non-stationarities in the data (either transients or slow drifts). A non-stationarity in the data will plague our analysis and hamper our estimation of the E\"otv\"os parameter. In this paper, we checked the stationarity of the data using a wavelet analysis \cite{selig16} that provides a time-frequency representation of the signal. Fig. \ref{fig_wavelets} shows the obvious off-centring signal at $2 f_{\rm EP}$ (solid line), but no significant continuous or temporal signals at $f_{\rm EP}$ (dashed line); in particular, no frequency-varying signal is detected. \begin{figure} \includegraphics[width=0.95\textwidth]{fig_15} \caption{Wavelet representation of SUEP difference of acceleration measurement. The solid horizontal line indicates the characteristic frequency $2 f_{\rm EP}$, the dashed line $f_{\rm EP}$. The colour indicates the fraction of the total signal energy.} \label{fig_wavelets} \end{figure} In future analyses, the stationarity of the noise and/or signals will be assessed with better sensitivity using wavelet analysis due to the accumulation of all the available sessions. \section{Data analysis and results} \label{sect_analysis} When analysing EP sessions, we estimate three parameters simultaneously: the approximated E\"otv\"os parameter $\delta$ and the components $\Delta x$ and $\Delta z$ of the off-centring. We use the model equation (\ref{eq_gammad}) and proceed in several steps: \begin{enumerate} \item we first fit the measurements $\overrightarrow\Gamma_d^{meas}$ with a polynomial of order 3, in particular to correct the effects of long term drift with the temperature; \item we then correct the measurements $\overrightarrow\Gamma_d^{meas}$ with the in-flight calibrated $[M_d]$ matrix and with the off-centring along all axes also estimated with the calibration sessions associated to the estimation of the Earth's gravity gradient. Quadratic terms are also estimated but do not need to be corrected as their effect is found to be negligible; \item then we can use the simplified equation $\overrightarrow\Gamma_d^{meas}(t_i) =\delta g_x(t_i) + T_{xx}(t_i) \Delta x + T_{xz}(t_i) \Delta z$ for the $N$ dates of the measurement $t_i \,\, (0 \leqslant t_i \leqslant T)$ sampled at $t_s =0.25 \,s$; \item these equations are projected in the frequency space by applying a discrete Fourier transform to the time series $\overrightarrow\Gamma_d^{meas}(t_i)$, $g_x(t_i)$, $T_{xx}(t_i)$ and $T_{xz}(t_i)$ to get $\overrightarrow\Gamma_d^{meas}(f_j) =\delta g_x(f_j) + T_{xx}(f_j) \Delta x + T_{xz}(f_j) \Delta z$ for the $N/2$ frequencies $f_j \,\, (0\leqslant f_j \leqslant 1/(2 t_s))$ with a sampling of $f_T=1/T$; for each frequency we get complex values including a real and an imaginary part; \item since the useful signal is concentrated at $f_{\rm EP}$ for the E\"otv\"os parameter and at $2 f_{\rm EP}$ for the off-centring, we select narrow bands around these frequencies: this is equivalent to selecting the corresponding equations in the frequency domain; \item from these selected equations, the parameters $\delta$, $\Delta x$, and $\Delta z$ are estimated by weighted least-square method; the weighting is a diagonal matrix using the inverse of the estimated measured Power Spectral Density (PSD) for each frequency. \end{enumerate} During measurement sessions, gaps in the data may occur because of many reasons such as data losses of few seconds in the instrument (less than two per year), very short (one data point) losses between the satellite memory system and the ground segments (at most one to two times per day). These gaps induce leakage phenomena in the frequency domain, leading to an apparent increase of the noise level at low frequency \cite{baghi15}. Several methods have been developed to overcome this effect, either by generalising the least-square regression technique \cite{baghi15, baghi16} or by filling the gaps with artificial data consistent with the statistics of the observed data \cite{berge15b, pires16}. The unique gaps in these two cases come from telemetry data losses: only 8 points are missing in the two sessions analysed in this paper, which represents less than 0.001\% of the data. These few gaps have been corrected with the inpainting method \cite{berge15b,pires16}, but we have verified that with so small a number of gaps (more than 1000 times smaller than the worst case anticipated before the launch), computing the missing values as a local average of the neighbouring data yields similar results. Our analysis, done using the two sessions described above, provides constraints on the E\"otv\"os parameter (i.e. acceleration divided by the amplitude $g_x=7.9\,m\,s^{-2}$) one order of magnitude better than pre-MICROSCOPE measurements \cite{wagner12}: \begin{equation} \delta({\rm Ti,Pt})=[-1\pm{}9{\rm (stat)}\pm{}9{\rm (syst)}] \times{}10^{-15} \quad (1\sigma \,\, {\rm statistical \,\, uncertainty}), \end{equation} where the systematic error is dominated by thermal effects, as shown in Table \ref{tab_calibration}. We used the same analysis process to extract a signal at $f_{\rm EP}$ from the SUREF difference of acceleration measurement, leading to: \begin {equation} \delta({\rm Pt,Pt})=[+4\pm{}4{\rm (stat)}\pm{}8{\rm (syst)}] \times{}10^{-15} \quad (1\sigma \,\, {\rm statistical \,\, uncertainty}), \end {equation} which is compatible with a null value as expected. This result was obtained from raw measurements. The calibration sessions (scale factors matching and misalignment estimations) were used only to validate the good behaviour of the system and to confirm the requirements on the matrix $[M_d]$. In the forthcoming analyses aimed to reach the mission objective of $10^{-15}$, the calibration of matrix $[M_d]$ may be necessary. The error quoted in the estimation of the E\"otv\"os parameter is the root of the variance of the least-squares method in the Fourier domain, rescaled by the root mean square of the residuals. \section{Conclusion and perspectives} \label{sect_ccl} In this paper, we presented the first results of the MICROSCOPE mission. We provided details about the mission, the satellite, the instrument, our assessment of systematic errors, as well as our data analysis process, which allowed us to consolidate the results given in letter \cite{touboul17}. In particular, the matching of the scale factors and alignments of the instrument were performed in orbit with a sensitivity better than specified. The very good performance of the satellite's drag-free system allowed for the relaxation of some constraints on the effect of the common mode accelerations. The data analysis did not show any evidence for the presence of a differential signal between platinum and titanium alloys at $f_{EP}$ and at 1$\sigma$ statistical uncertainty: $\delta({\rm Ti,Pt})=[-1\pm{}9{\rm (stat)}\pm{}9{\rm (syst)}] \times{}10^{-15}$. This result takes into account the estimation of the systematic errors and the measured variances for the statistical error over 120 orbits . The systematic errors are dominated by thermal effects, which will be further analysed and better estimated in a future work. Most importantly, albeit this preliminary conclusion seems robust, it has to be re-assessed after cumulating all the 1800 orbits for SUEP and the 980 orbits for SUREF that are available today. The MICROSCOPE in orbit mission came to its end in October 2018. Additional scientific data are under validation and should improve the current result as the final amount of data represents about 15 times the amount analysed in this paper. \ack The authors express their gratitude to all the different services involved in the mission partners and in particular CNES, the French space agency in charge of the satellite. This work is based on observations made with the T-SAGE instrument, installed on the CNES-ESA-ONERA-CNRS-OCA-DLR-ZARM MICROSCOPE mission. ONERA authors' work is financially supported by CNES and ONERA fundings. Authors from OCA, Observatoire de la C\^ote d'Azur, have been supported by OCA, CNRS, the French National Center for Scientific Research, and CNES. ZARM authors' work is supported by the German Space Agency of DLR with funds of the BMWi (FKZ 50 OY 1305) and by the Deutsche Forschungsgemeinschaft DFG (LA 905/12-1). The authors would like to thank the Physikalisch-Technische Bundesanstalt institute in Braunschweig, Germany, for their contribution to the development of the test-masses with funds of CNES and DLR. \section*{References} \bibliographystyle{iopart-num}
\section*{Introduction}\label{intro} \section{Introduction}\label{intro} Mesons are most numerous of hadrons in the Particle Data Group (PDG) tables~\ci{PDG2014}. They are simplest relativistic quark-antiquark systems in case of equal-mass quarks, but they are not simple if quarks' masses are different. It is believed that physics of light and heavy mesons is different; this is true only in asymptotic limits of large and small distances. Most mesons listed in the PDG being unstable and are resonances, exited quark-antiquark states. There are great amount and variety of experimental data and the different approaches used to extract the properties of the mesons~\ci{KlemZaits07,NussLamp02,LiMaLi04}. Heavy $Q\bar Q$ mesons (quarkonia) can be considered as nonrelativistic (NR) bound systems and are well described by the~two-particle Shr\"odinger's wave equation. Light $q\bar q$ states are relativistic bound states and require another approach. Within the framework of Quantum Field Theory (QFT) the covariant description of relativistic bound states is the Bethe-Salpeter (BS) formalism~\ci{LuchSho16,BethSal08}. The homogeneous BS equation governs all the bound states. However, numerous attempts to apply the BS formalism to relativistic bound-state problems give series of difficulties. Its inherent complexity usually prevents to find the exact solutions or results in the appearance of excitations in the relative time variable of the bound-state constituents (abnormal solutions), which are difficult to interpret in the framework of quantum physics~\ci{LuchSho99}. Usually, calculations of hadron properties are carried out with the help of phenomenological and relativistic quark models~\ci{Morp90,EbFausGa11}. Description of the heavy-light $Q\bar q$ systems in a way fully consistent with all requirements imposed by special relativity and within the framework of QFT is one of the great challenges in theoretical elementary particle physics~\ci{CagnAll94}. For various practical reasons and applications to both QED and QCD some simplified equations, situated along a path of NR reduction, are used. More valuable are methods which provide either exact or approximate analytic solutions for various forms of differential equations. They may be remedied in three-dimensional reductions of the BS equation. In most cases the analytic solution can be found if original equation is reduced to the Schr\"odinger-type wave equation. The most well-known of the resulting bound-state equations is the one proposed by Salpeter~\ci{Salpet52}. There exist many other approaches to bound-state problem. One of the promising among them is the Regge method in hadron physics~\ci{Collin77}. All hadrons and their resonances in this approach are associated with Regge poles which move in the complex angular momentum $J$~plane. Moving poles are described by the Regge trajectories, $\alpha(s)$, which are the functions of the invariant squared mass $s=W^2$ (Mandelshtam's variable), where $W=E^*$ is the c.\,m. rest energy (invariant mass of two-particle system). Hadrons and resonances populate their Regge trajectories which contain all the dynamics of hadron interaction in bound state and scattering regions. Light and heavy mesons have been studied in a soft-wall holographic approach AdS/CFT~\ci{Lyubo10} using the correspondence of string theory in Anti-de Sitter space and conformal field theory in physical space-time. It is analogous to the Schr\"odinger theory for atomic physics and provides a precise mapping of the string modes $\Phi(z)$ in the AdS fifth dimension $z$ to the hadron light-front wave functions in physical space-time. In this work we study $Q\bar q$ mesons and their excitations (resonances) as relativistic two-body (R2B) systems from unified point of view in the framework of the relativistic quantum mechanics (RQM)~\ci{GreinerRQM00,Dirac49}. The issue is connected with two fundamental problems: 1)~two-particle relativistic wave equation of motion and 2)~absence of a~strict definition of the potential in relativistic theory. Using relativistic kinematics and the correspondence principle, we deduce a two-particle wave equation. The interaction of particles (quarks) is described by the modified funnel-type Lorentz-scalar Cornell potential. We obtain two exact asymptotic solutions of the equation which are used to write the complex-mass formula for the bound system. \section{ Relativistic two-body problem}\label{Rel2B} Quarkonia as quark-antiquark bound states are simplest among mesons. The quarkonium universal mass formula and ``saturating'' Regge trajectories were derived in~\ci{MyZPhC94} and in~\ci{MyEPJC12,MyEPL10} applied for gluonia (glueballs). The mass formula was obtained by interpolating between NR heavy $Q\bar Q$ quark system and ultra-relativistic limiting case of light $q\bar q$ mesons for the Cornell potential~\ci{LattBali01,EichGMR08}, \be V(r)=V_\S(r)+V_\L(r)\equiv-\frac 43\frac{\alpha_\S}r +\sigma r. \ee{CornPot} The short-range Coulomb-type term $V_\S(r)$, originating from one-gluon exchange, dominates for heavy mesons and the linear one $V_\L(r)$, which models the string tension, dominates for light mesons. Parameters $\alpha_\S$ and $\sigma$ are directly related to basic physical quantities of mesons. Operators in ordinary quantum mechanics (QM) are Hermitian and the corresponding eigenvalues are real. It is possible to extend the QM Hamiltonian into the complex domain while still retaining the fundamental properties of a~quantum theory. One of such approaches is complex quantum mechanics~\ci{BendBH}. The complex-scaled method is the extension of theorems and principles proved in QM for Hermitian operators to non-Hermitian operators. The Cornell potential (\ref{CornPot}) is a~special in hadron physics and results in the complex energy and mass eigenvalues. Separate consideration of two asymptotic components $V_\S(r)$ and $V_\L(r)$ of the potential (\ref{CornPot}) for quarkonia results in the complex-mass expression for resonances, which in the center-of-momentum (c.m.) frame is ($\hbar=c=1$)~\ci{MyAHEP13,MyNPCS14}: \be \mc{M}_\N^2 = 4\left[\left(\sqrt{2\sigma\tilde{N}} +\frac{i\tilde\alpha m}N \right)^2 +\left(m-i\sqrt{2\tilde\alpha\sigma}\right)^2\right], \ee{CompE2n} where $\tilde\alpha=\frac 43\alpha_\S$, $\tilde{N}=N+(k+\frac12)$, $N=k+l+1$, $k$ is radial and $l$ is orbital quantum numbers; it has the form of the squared energy $\mc{M}_\N^2=4\left[(\pi_\N)^2+\mu^2\right]$ of two free relativistic particles with the quarks' complex momenta $\pi_\N$ and masses $\mu$. This formula allows to calculate in a~unified way the centered masses and total widths of heavy and light quarkonia. In our method the energy, momentum and quark masses are {\it complex}. A more complicate case are flavored $Q\bar q$ mesons. A simplest example of heavy-light two-body system is the hydrogen ($H$) atom, comprising only a~proton and an~electron which are stable particles. This simplicity means its properties can be calculated theoretically with impressive accuracy~\ci{MyRelHx19}. The~spherically symmetric Coulomb potential, with interaction strength parametrized by dimensionless coupling (``fine structure'') constant $\alpha$, is of particular importance in many realms of physics. The $H$ atom can be used as a tool for testing any relativistic two-body theory, because latest measurements for transition frequencies have been determined with a highest precision~\ci{MohrTayl}. \vspace{3mm} {\bf 1. The interaction potential.} The NR QM shows very good results in describing bound states; this is partly because the potential is NR concept. In relativistic mechanics one faces with different kind of speculations around the potential, because of absence of a strict definition of the potential in this theory. In NR formulation, the $H$ atom is described by the Schr\"odinger equation and is usually considered as an electron moving in the external field generated by the proton static electric field given by the Coulomb potential. In relativistic case, the binding energy of an electron in a~static Coulomb field (the external electric field of a point nucleus of charge $Ze$ with infinite mass) is determined predominantly by the Dirac eigenvalue~\ci{MohrTayl}. The spectroscopic data are usually analyzed with the use of the Sommerfeld's fine-structure formula~\ci{Bohm79}, One should note that, in these calculations the $S$ states start to be destroyed above $Z=137$, and that the $P$ states being destroyed above $Z=274$. Similar situation we observe from the result of the Klein-Gordon wave equation, which predicts $S$ states being destroyed above $Z=68$ and $P$ states destroyed above $Z=82$. Besides, the radial $S$-wave function $R(r)$ diverges as $r\ra 0$. These problems are general for all Lorentz-vector potentials which have been used in these calculations~\ci{Huang01,Bhadur95}. In general, there are two different relativistic versions: the potential is considered either as the zero component of a~four-vector, a~Lorentz-scalar or their mixture~\ci{SahuAll89}; its nature is a~serious problem of relativistic potential models~\ci{Sucher95}. This problem is very important in hadron physics where, for the vector-like confining potential, there are no normalizable solutions~\ci{Sucher95,SemayCeu93}. There are normalizable solutions for scalar-like potentials, but not for vector-like. This issue was investigated in~\ci{MyZPhC94,Huang01}; it was shown that the effective interaction has to be Lorentz-scalar in order to confine quarks and gluons. The relativistic correction for the case of the Lorentz-vector potential is different from that for the case of the Lorentz-scalar potential~\ci{MyMPLA97}. The Cornell potential (\ref{CornPot}) is fixed by the two free parameters, $\alpha_\S$ and $\sigma$. However, the strong coupling $\alpha_\S$ in QCD is a~function $\alpha_\S(Q^2)$ of virtuality $Q^2$ or $\alpha_\S(r)$ in configuration space. The potential can be modified by introducing the $\alpha_\S(r)$-dependence, which is unknown. A~possible modification of $\alpha_\S(r)$ was introduced in~\ci{MyEPJC12}, \be V_\QCD(r) = -\frac 43\frac{\alpha_\S(r)}r +\sigma r,\quad \alpha_\S(r)=\frac 1{b_0\ln[1/(\Lambda r)^2+(2\mu_g/\Lambda)^2]}, \ee{VmodCor} where $b_0=(33-2n_f)/12\pi$, $n_f$ is number of flavors, $\mu_g=\mu(Q^2)$ --- gluon mass at $Q^2=0$, $\Lambda$ is the QCD scale parameter. the running coupling $\alpha_\S(r)$ in (\ref{VmodCor}) is frozen at $r\ra\infty$, $\alpha_\infty=\frac 12[b_0\ln(2\mu_g/\Lambda)]^{-1}$, and is in agreement with the asymptotic freedom properties, i.\,e., $\alpha_\S(r\ra 0)\ra 0$. {\bf 2. The two-body problem in RQM.} Standard relativistic approaches for R2B systems run into serious difficulties in solving known relativistic wave equations. The formulation of RQM differs from NR QM by the replacement of invariance under Galilean transformations with invariance under Poincar\`e transformations. The RQM is also known in the literature as relativistic Hamiltonian dynamics or Poincar\`e-invariant QM with direct interaction~\ci{Dirac49}. There are three equivalent forms in the RQM called ``instant'', ``point'', and ``light-front'' forms. The dynamics of many-particle system in the RQM is specified by expressing ten generators of the Poincar\`e group, $\hat M_{\mu\nu}$ and $\hat W_\mu$, in terms of dynamical variables. In the constructing generators for interacting systems it is customary to start with the generators of the corresponding non-interacting system; the interaction is added in the way that is consistent with Poincare algebra. In the relativistic case it is necessary to add an interaction $V$ to more than one generator in order to satisfy the commutation relations of the Poincar\'e algebra. The interaction of a~relativistic particle with the four-momentum $p_\mu$ moving in the external field $A_\mu(x)$ is introduced in QED according to the gauge invariance principle, $p_\mu\ra P_\mu=p_\mu-eA_\mu$. The description in the ``point'' form of RQM implies that the mass operators $\hat M^{\mu\nu}$ are the same as for non-interacting particles, i.\,e., $\hat M^{\mu\nu}=M^{\mu\nu}$, and these interaction terms can be~presented only in the form of the four-momentum operators~$\hat W^\mu$~\ci{MyRQMAnd99}. Consider the R2B problem in classic relativistic theory. Two particles with four-momenta $p_1^\mu$, $p_2^\mu$ and the interaction field $W^\mu(q_1,\,q_2)$ together compose a~closed conservative system, which can be characterized by the 4-vector $\mc{P}^\mu$, \be \mc{P}^\mu = p_1^\mu + p_2^\mu + W^\mu(q_1,\,q_2), \ee{Main4vec} where the space-time coordinates $q_1^\mu$, $q_2^\mu$ and four-momenta $p_1^\mu$, $p_2^\mu$ are conjugate variables, $\mc{P}_\mu \mc{P}^\mu=\mathsf{M}^2$; here $\mathsf{M}$ is the system's invariant mass. Underline, that no external field and each particle of the system can be considered as moving source of the interaction field; the interacting particles and the potential are a~unified system. There are the following consequences of (\ref{Main4vec}) and they are key in our approach. The four-vector (\ref{Main4vec}) describes {\it free motion} of the bound system and can be presented as, \bea E = \sqrt{\mathbf{p}_1^2+m_1^2}+\sqrt{\mathbf{p}_2^2+m_2^2} +W_0(q_1,\,q_2)=\rm{const}, \quad \label{TwoEnr}\\ \mathbf{P}=\mathbf{p}_1+\mathbf{p}_2 +\mathbf{W}(q_1,\,q_2)=\rm{const}, \quad \label{TwoMom} \eea describing the energy and momentum conservation laws. The energy (\ref{TwoEnr}) and total momentum (\ref{TwoMom}) of the system are the constants of motion. By definition, for conservative systems, the integrals (\ref{TwoEnr}) and (\ref{TwoMom}) can not depend on time explicitly. This means the interaction $W(q_1,\,q_2)$ should not depend on time, i.\,e., $W(q_1,\,q_2)=>V(\mathbf{r}_1,\,\mathbf{r}_2)$. It is well known that the potential as a~function in 3D-space is defined by the pro\-pa\-ga\-tor $D(\mathbf{q}^{\,2})$ (Green function) of the virtual particle as a carrier of interaction, where $\mathbf{q}=\mathbf{p}_1-\mathbf{p}_2$ is the transfered momentum. In case of the Coulomb potential the propagator is $D(\mathbf{q}^{\,2})=-1/\mathbf{q}^{\,2}$; the Fourier transform of $4\pi\alpha D(\mathbf{q}^{\,2}$) gives the Coulomb potential, $V(r)=-\alpha/r$. The relative momentum $\mathbf{q}$ is conjugate to the relative vector $\mathbf{r}=\mathbf{r}_1-\mathbf{r}_2$, therefore, one can accept that $V(\mathbf{r}_1,\,\mathbf{r}_2)=V(\mathbf{r})$~\ci{LuchSho99}. If the potential is spherically symmetric, one can write $V(\mathbf{r})=>V(r)$, where $r=|\mathbf{r}|$. Thus, the system's relative time $\tau=t_1-t_2=0$ (instantaneous interaction). Equations (\ref{TwoEnr}) and (\ref{TwoMom}) in the c.m. frame are \bea \mathsf{M} = \sqrt{\mathbf{p}^2+m_1^2}+\sqrt{\mathbf{p}^2 +m_2^2}+\mathsf{V}(r), \label{ClasE2B} \\ \mathbf{P}=\mathbf{p}_1 +\mathbf{p}_2 + \mathbf{W}(\mathbf{r}_1,\,\mathbf{r}_2)=\mathbf{0}, \label{ClasM2B} \eea where $\mathbf{p}=\mathbf{p}_1 =-\mathbf{p}_2$ that follows from the equality $\mathbf{p}_1+\mathbf{p}_2=0$; this means that $\mathbf{W}(\mathbf{r}_1,\,\mathbf{r}_2)=0$. The system's mass (\ref{ClasE2B}) in the c.m. frame is Lorentz-scalar. In case of free particles ($\mathsf{V}=0$) the invariant mass $\mathsf{M}=\sqrt{\mathbf{p}^2+m_1^2}+\sqrt{\mathbf{p}^2+m_2^2}$ can be transformed for $\mathbf{p}^2$ as \be \mathbf{p}^2 =\frac 1{4s}(s-m_-^2)(s-m_+^2)\equiv\mathsf{k}^2, \ee{InvMom1} which is relativistic invariant, $s=\mathsf{M}^2$ is the Mandelstam's invariant, $m_-=m_1-m_2$, $m_+=m_1+m_2$. Equation (\ref{TwoEnr}) is the zeroth component of the four-vector (\ref{Main4vec}) and the potential $\mathsf{W_0}$ is Lorentz-vector. But, in the c.m. frame the mass (\ref{ClasE2B}) is Lorentz-scalar; and what about the potential $\mathsf{V}$? Is it still Lorentz-vector? To show that the potential is Lorentz-scalar, let us reconsider (\ref{ClasE2B}) as follows. The relativistic total energy $\epsilon_i(\mathbf{p})$ ($i=1,\,2$) of particles in (\ref{ClasE2B}) given by $\epsilon_i^2(\mathbf{p})=\mathbf{p}^2+m_i^2$ can be represented as sum of the kinetic energy $\tau_i(\mathbf{p})$ and the particle rest mass $m_i$, i.\,e., $\epsilon_i(\mathbf{p})=\tau_i(\mathbf{p})+m_i$. Then the system's total energy (invariant mass) (\ref{ClasE2B}) can be written in the form $\mathsf{M}=\sqrt{\mathbf{p}^2+\mathsf{m}_1^2(r)} +\sqrt{\mathbf{p}^2+\mathsf{m}_2^2(r)}$, where $\mathsf{m}_{1,2}(r)=m_{1,2}+\frac 12\mathsf{V}(r)$ are the distance-dependent particle masses~\ci{MyNDA17} and (\ref{InvMom1}) with the use of $\mathsf{m}_1(r)$ and $\mathsf{m}_2(r)$ takes the form, \be \mathbf{p}^2 = K(s)\left[s-(m_+ +\mathsf{V})^2\right]\equiv\mathsf{k}^2-U(s,\,r), \ee{InvMom2} where $K(s)=(s-m_-^2)/4s$, $\mathsf{k}^2$ is squared invariant momentum given by (\ref{InvMom1}) and $U(s,\,r) = K(s)\left[2m_+\mathsf{V} +\mathsf{V}^2\right]$ is the potential function. The equation (\ref{InvMom2}) is the relativistic analogy of the NR expression $\mathbf{p}^2=2\mu[E-V(r)]\equiv\mathsf{k}^2-U(E,r)$. The equality (\ref{InvMom2}) with the help of the fundamental correspondence principle gives the two-particle spinless wave equation, \be \left[\vec\nabla^2 +\mathsf{k}^2-U(s,\,r)\right]\psi(\mathbf{r})=0. \ee{Rel2Eq} The equation (\ref{Rel2Eq}) can not be solved by known methods for the potential (\ref{VmodCor}). Here we use the quasiclassical (QC) method and solve another wave equation~\ci{MyMPLA97,MyPRA96}. \section{ Solution of the QC wave equation}\label{SolQCEq} Solution of the Shr\"odinger-type's wave equation (\ref{Rel2Eq}) can be found by the QC method developed in~\ci{MyPRA96}. In our method one solves the QC wave equation derivation of which is reduced to replacement of the operator $\vec{\nabla}^2$ in (\ref{Rel2Eq}) by the canonical operator $\Delta^c$ without the first derivatives, acting onto the state function $\Psi(\vec r)=\sqrt{{\rm det}\,g_{ij}}\psi(\vec r)$, where $g_{ij}$ is the metric tensor. Thus, instead of (\ref{Rel2Eq}) one solves the QC equation, for the potential~(\ref{VmodCor}), \be \Biggl\{\frac{\pa^2}{\pa r^2}+\frac 1{r^2}\frac{\pa^2}{\pa\theta^2} +\frac 1{r^2\sin^2\theta}\frac{\pa^2}{\pa\varphi^2} +\frac{s-m_-^2}{4s}\biggl[s-\left(m_+ -\frac 43\frac{\alpha_\S(r)}r +\sigma r\right)^2\biggr]\Biggr\}\Psi(\mathbf{r})=0. \ee{Rel2Equa} This equation is separated. Solution of the angular equation was obtained in~\ci{MyPRA96} by the QC method in the complex plane, that gives $\textrm{M}_l=(l+\frac 12)\hbar$, for the angular momentum eigenvalues. These angular eigenmomenta are universal for all spherically symmetric potentials in relativistic and NR cases. The radial problem has four turning points and cannot be solved by standard methods. We consider the problem separately by the QC method for the short-range Coulomb term (heavy mesons) and the long-range linear term (light mesons). The QC method reproduces the exact energy eigenvalues for all known solvable problems in quantum mechanics~\ci{MyMPLA97,MyPRA96}. The radial QC wave equation of (\ref{Rel2Equa}) for the Coulomb term has two turning points and the phase-space integral is found in the complex plane with the use of the residue theory and method of stereographic projection~\ci{MyPRA96,MyAHEP13} that gives \be \mc{M}_\N^2|_C = \left(m_1+m_2\right)^2\left(1-v_\N^2\right)\pm 2im_+m_-v_\N \equiv \Re\{\mc{M}_\N^2|_C\}\pm i\Im\{\mc{M}_\N^2|_C\}, \ee{W2Coul} where $v_\N=\frac 23\alpha_\infty/N$, $N=k+l+1$. Large distances in hadron physics are related to the problem of confinement. The radial problem of (\ref{Rel2Equa}) for the linear term has four turning points, i.\,e., two cuts between these points. The phase-space integral in this case is found by the same method of stereographic projection as above that results in the cubic equation~\ci{MyNDA17}: $s^3 + a_1s^2 + a_2s + a_3 = 0$, where $a_1=16\tilde\alpha_\infty\sigma-m_-^2$, $a_2=64\sigma^2\left(\tilde\alpha_\infty^2-\tilde N^2 -\tilde\alpha_\infty m_-^2/4\sigma\right)$, $a_3=-(8\tilde\alpha_\infty\sigma m_-)^2$, $\tilde N=N+k+\frac 12$, $\tilde\alpha_\infty=\frac 43\alpha_\infty$, $\alpha_\infty=\alpha_\S(r\ra\infty)$. The first root $s_1(N)$ of this equation gives the physical solution (complex eigenmasses), $\mathsf{M}_1^2|_L=s_1(N)$, for the squared invariant mass. Two exact asymptotic solutions obtained such a way are used to derive the interpolating mass formula. The~interpolation procedure for these two solutions~\ci{MyZPhC94} is used to derive the meson's complex-mass formula, \be \mc{M}_\N^2 = \left(m_1+m_2\right)^2\left(1-v_\N^2\right)\pm 2im_+m_-v_\N +\mathsf{M}_1^2|_L. \ee{W2int} The real part of the square root of (\ref{W2int}) defines the~centered masses and its imaginary part defines the~total widths, $\Gamma_\N^\TOT=-2\,\Im\{\mathsf{M}_\N\}$, of mesons and resonances~\ci{MyAHEP13,MyNPCS14}. In the QC method not only the total energy, but also momentum of a~particle-wave in bound state is the {\em constant of motion}. Solution of the QC wave equation in the whole region is written in elementary functions as~\ci{MyPRA96} \be \mathsf{R}(r) = C_n\left\{\ba{lc} \label{osol} \frac 1{\sqrt 2}e^{|\mathsf{k}_n|r -\phi_1}, & r<r_1,\\ \cos(|\mathsf{k}_n|r -\phi_1 -\frac\pi 4), & r_1\le r\le r_2,\\ \frac{(-1)^n}{\sqrt 2}e^{-|\mathsf{k}_n|r +\phi_2}, & r>r_2, \ea\right.\ee where $C_n=\sqrt{2|p_n|/[\pi(n+\frac 12)+1]}$ is the normalization coefficient, $\mathsf{k}_n$ is the corresponding eigenmomentum found from solution of (\ref{Rel2Eq}), $\phi_1=-\pi(n+\frac 12)/2$ and $\phi_2=\pi(n+\frac 12)/2$ are the values of the phase-space integral at the turning points $r_1$ and $r_2$, respectively. The free fit to the data~\ci{PDG2014} shows a~good agreement for the light and heavy $Q\bar q$ meson and their resonances. To demonstrate efficiency of the model we calculate the leading-state masses of the $\rho$ and $B^*$ meson resonances (see tables, where masses are in MeV). Note, that the gluon mass, $m_g=416$\,MeV, and the string tension $\sigma=140$\,MeV$^2$ in the independent fitting are the same. \begin{table}[ht] \begin{center} \caption{The masses of the $\rho^\pm$-mesons and resonances} \label{rho_mes} \begin{tabular}{lllll} \hline\noalign{\smallskip} \ \ Meson &~~~$J^{PC}$ &~~~$\ \ E_n^{ex}$ &~~~$\ \ E_n^{th}$& ~~~Parameters in (\ref{W2int})\\ \noalign{\smallskip}\hline\hline\noalign{\smallskip} \ \ \ $\rho\ (1S)$&~~~$1^{--}$&~~~$\ \ 776$&~~~$\ \ 776$& ~~~~~$\Lambda=488$ MeV\\ \ \ \ $a_2(1P)$&~~~$2^{++}$&~~~$\ 1318$&~~~$\ 1315$& ~~~~~$\mu_g=416$\,MeV\\ \ \ \ $\rho_3(1D)$&~~~$3^{--}$&~~~$\ 1689$&~~~$\ 1689$& ~~~~~$\sigma=140$\,MeV$^2$\\ \ \ \ $a_4(1F)$&~~~$4^{++}$&~~~$\ 1996$&~~~$\ 1993$& ~~~~~$m_d=119$\,MeV\\ \ \ \ $\rho\ (1G)$&~~~$5^{--}$&~~~$ ~ $&~~~$\ 2257$& ~~~~~$m_u=69$\,MeV\\ \ \ \ $\rho\ (2S)$&~~~$1^{--}$&~~~$\ 1720$&~~~$\ 1688$&~\\ \ \ \ $\rho\ (2P)$&~~~$2^{++}$&~~~$ ~ $&~~~$\ 1993$&~\\ \ \ \ $\rho\ (2D)$&~~~$3^{--}$&~~~$ ~ $&~~~$\ 2257$&~\\ \noalign{\smallskip}\hline \end{tabular} \caption{The masses of the $B^{*0}$-mesons and resonances} \label{Dp_mes} \begin{tabular}{lllll} \hline\noalign{\smallskip} \ \ Meson &~~~$J^{PC}$ &~~~$\ \ E_n^{ex}$ &~~~$\ \ E_n^{th}$& ~~~Parameters in (\ref{W2int})\\ \noalign{\smallskip}\hline\hline\noalign{\smallskip} \ \ \ $B^*(1S)$&~~~$1^{--}$&~~~$\ 5325$&~~~$\ 5325$& ~~~~~$\Lambda=75$\,MeV\\ \ \ \ $B_2^*(1P)$&~~~$2^{++}$&~~~$\ 5743$&~~~$\ 5743$& ~~~~~$m_g=416$\,MeV\\ \ \ \ $B_3^*(1D)$&~~~$3^{--}$&~~~$\ ~ $&~~~$\ 5946$& ~~~~~$\sigma=140$\,MeV$^2$\\ \ \ \ $B_4^*(1F)$&~~~$4^{++}$&~~~$\ ~ $&~~~$\ 6088$& ~~~~~$m_b=2856$\,MeV\\ \ \ \ $B_5^*(1G)$&~~~$5^{--}$&~~~$\ ~ $&~~~$\ 6205$& ~~~~~$m_d=25$\,MeV\\ \ \ \ $B^*(2S)$&~~~$1^{--}$&~~~$\ ~ $&~~~$\ 5834$&~\\ \ \ \ $B^*(2P)$&~~~$2^{++}$&~~~$\ ~ $&~~~$\ 6034$&~\\ \ \ \ $B^*(2D)$&~~~$3^{--}$&~~~$\ ~ $&~~~$\ 6175$&~\\ \noalign{\smallskip}\hline \end{tabular} \end{center} \end{table} Note, that gluon mass $\mu_g$ is the same for glueballs~\ci{MyEPJC12}. The $d$ quark effective mass decreases if heavy quark mass increases. \section*{Conclusion}\label{Conclu} We have modeled mesons containing light and heavy quarks and their resonances in the framework of relativistic quantum mechanics. We have used the modified funnel-type potential with the distant dependent strong coupling, $\alpha_\S(r)$. Using the complex-mass analysis, we have derived the meson interpolating masses formula~(\ref{W2int}), in which the real and imaginary parts are exact expressions. We have developed the free particle hypothesis: quark and antiquark move as free particles in the bound system. We have calculated masses of light-heavy $S=1$ mesons containing $d$ quark and their resonances, i.\,e., $\rho^{\pm}$ and $B^{*0}$ states for universal string tension $\sigma=140$\,MeV$^2$, which can be considered as a fundamental constant in hadron physics. We have found that quarks' masses are not constant values but are position-dependent. We have studied light-heavy mesons containing $d$ quark and found if heavy quark mass is larger the $d$ quark mass is smaller; this is because distance between quarks becomes smaller. This approach allows to simultaneously describe in the unified way the centered masses and total widths of resonances. We have shown here the results only for unflavored and beauty mesons and resonances, however, we have obtained a~good description for strange and charm mesons as well.
\section{Introduction} \label{sec:intro} A multiplex network structure is a comprehensive representation of real world networks considering that it allows for multiple kinds of relations, and encodes them separately. The multilayer nature of these networks substantially changes their structure and dynamics \cite{Bianconi2013,DeDomenico2013,Cardillo2013,Boccaletti2014,DeDomenico2015a,Mahdizadehaghdam2016} in comparison to single layer representations\cite{Karrer2011,Wang2013}. Despite being one of the main topics of network science for over a decade, the community detection problem has only recently been more closely studied in the context of multilayer networks \cite{PeterJ.Mucha2010,DeDomenico2015a,Loe2015,Wilson2016,Valles-Catala2016,Taylor2016,Stanley2016,Afsarmanesh2016,Paul2017,DeBacco2017}. Community detection in multiplex networks has found numerous applications, such as dynamics \cite{Palla2007} and multi-relation \cite{Szell2010,huang2016consensus} in social networks, evolution of granular force networks \cite{Papadopoulos2016}, and cognitive states of brain networks \cite{Telesford2016}. It is generally advantageous for community detection to decompose an ordinary network into multiple layers based on additional attributes, and to create a multiplex network for individual layers to potentially unravel entangled structures, such as overlapping communities. It can, however, be difficult to reach this goal with a usually limited knowledge. Carelessly breaking a network into layers can be problematic since it can either retain overlapping communities in a single layer, or decrease detectability of certain communities by breaking them up and distributing them over multiple layers, leading to redundant communities and reduced edge density. This problem arises in many real world multiplex networks. For example, in the networks of protein-genetic interactions, each type of genetic interaction may be used to define a layer, but it is shown to return highly redundant layers, which require recombination \cite{DeDomenico2015}. Some recent studies consider the redundancy phenomenon in multiplex networks \cite{DeDomenico2015,Taylor2016,Stanley2016} and try to resolve it by further aggregating the redundant layers. Domenico et al. \cite{DeDomenico2015} utilize tools from quantum information to identify redundant layers and aggregate them hierarchically, thus simplifying the structure. They discovered that many real world multiplex networks, including protein-genetic interactions, social networks, economical and transportation systems, can be significantly simplified by their proposed technique. Taylor et al. \cite{Taylor2016} showed that the detectability of community structure is significantly improved by aggregating layers generated from the same stochastic block model (SBM), which is a popular probabilistic generative model for describing nodes' group memberships \cite{Wang1987}. Stanley et al. \cite{Stanley2016} proposed a specific multilayer SBM which partitions layers into sets called strata, each described by a single SBM. Layers in a stratum are treated as multiple realizations of the same community structure, thus improving community detection accuracy. A drawback of layer aggregation is that completely consistent community structure between layers is required and needs to be known a priori, otherwise different communities may overlap when aggregated into a single layer, as shown in Fig. \ref{fig:demo}. Domenico et al. \cite{DeDomenico2015a} used the concept of modular flow to show that aggregating layers into a single layer may obscure actual organizations, and that highly overlapping communities exist in some real-world networks. While many algorithms are proposed for overlapping community detection in single layer networks \cite{Palla2005,Esquivel2011,Psorakis2011,Yang2013a,Yang2013b,Nguyen2015,Gamble2015}, the performances remain mediocre due to the loss of layer information. Inspired by these works, we consider a general multiplex SBM that allows layers to be "partially" redundant, in which case layers may share one or more common communities, and have different ones at the same time (lower row in Fig. \ref{fig:demo}). Our goal is to improve detectability by leveraging the consensus communities without assuming any two layers to belong to the exact same SBM. This not only achieves higher accuracy, but improves detectability of weak consensus communities as well, by combining their information from different layers, which are otherwise too noisy to be detectable individually. Since our model potentially generates a heterogeneous community structure across layers, our method provides a way to detect overlapping communities at theoretically optimal accuracy, when they can be allocated to different layers. Our method originates from an application of belief propagation algorithm to community detection, as first developed by Decelle et al. \cite{Decelle2011,Decelle2011a}. \NEW{Belief propagation is one algorithms in the Bayesian inference framework, which in turn, is known to yield optimal estimates of communities for a network generated by the underlying SBM \cite{Decelle2011}}. Decelle et al. studied detectability transition, and identified a phase transition point in the parameter space, where all community detection algorithms fail. Since then, some extending works using belief propagation have been reported \cite{Newman2015,Ghasemian2015,Zhang2016,Kawamoto2017}. Ghasemian et al. \cite{Ghasemian2015} extended this method to temporal networks, introducing Dynamic Stochastic Block Model, where nodes gradually change connections and their community memberships over time. While not intended for general temporal networks, our multiplex network model in contrast to \cite{Ghasemian2015}, addresses networks that typically encode multiple relations through layers, and the members of a given community remain unchanged irrespectively of the layer the latter occurs in. Our model also does not enforce a temporal order of the layers as in \cite{Ghasemian2015}. Despite aiming for different types of multiplex networks, a simplified version of \cite{Ghasemian2015} is used as a comparison with our model, in presence of homogeneous and heterogeneous community structures. We show that in different situations, both method show their own strength. The outline of the paper is as follows. In Sec. \ref{subsec:problem}, we define the problem of community detection and information fusion in multilayer networks. In Sec. \ref{subsec:Bayesian}, we present our proposed stochastic model and a simpler model for comparison. In Sec. \ref{ssec:BP}, we review the belief propagation algorithm and explain the implementation on the proposed model. In Sec. \ref{sec:synthetic}, we show multiple experimental results of the proposed model and discuss its evaluation in detail and its comparison with the simpler model. \begin{figure}[!t] \centering \includegraphics[width=2.5in]{Fig1_attribute_demo.PNG} \caption{Demonstration of potential benefit (upper row) and caveat (lower one) of aggregating multiplex layers. In both rows, left hand side shows the adjacency matrices of two multiplex layers, and right hand side shows that of the aggregated layer by adding the two adjacency matrices. The upper row shows a better community quality of the aggregated network than single layer, while the lower row shows a obscured community structure (notice in the lower row that the consistent community between two layers still gets enhanced quality).} \label{fig:demo} \end{figure} \section{Problem and method} \label{sec:problem} \subsection{Problem Description} \label{subsec:problem} An informed description of our problem of interest is the following: suppose that a multiplex network $W=(V,E(1),E(2),...,E(L))$ is given where $V=\{v_1,v_2,...v_N\}$ is the set of $N$ nodes and $E(l)$ is the set of edges on $V$ at the $l$-th layer. We are to identify a collection $C=\{C_1,C_2,...,C_q\}$ of node communities, where $C_i\subseteq V$ corresponds to a dense subgraph in at least one layer. Although our problem admits overlapping communities, we assume that the co-occurring communities in each layer are disjoint. Each community may also appear in multiple layers, in which case the resulting data multiplicity can be used to improve community detectability by improving the signal to noise ratio (SNR). However, since the occurrence pattern of the communities is not a priorily known, fusing multiple observations of the same community is not straightforward. For a large part of this paper, we assume that the number $q$ of communities is known. However in Section \ref{effect_q}, we briefly discuss the impact of an incorrect choice of $q$ and possible remedies. \subsection{Bayesian Solution by Stochastic Modeling} \label{subsec:Bayesian} We adopt a Bayesian approach by providing a stochastic generative model for the observed multiplex network, expressed by a likelihood function $P(W\mid C)$, as well as a prior distribution $P(C)$ on communities. Then, the maximum a-posteriori (MAP) estimate of the communities is obtained by maximizing the a-posteriori distribution, computed according to the Bayes rule: \[ \hat{C}_\mathrm{ML}=\arg\max\limits_{C}P(C\mid W)= \arg\max\limits_{C}\frac{P(W\mid C)P(C)}{P(W)}, \] where $P(W)=\sum\limits_{C^\prime}P(W\mid C^\prime)P(C^\prime)$ is a scaling constant and can be eliminated from optimization. Our generative model utilizes the stochastic block model (SBM), explained in Section \ref{sec:SBM}, which is widely expressed in terms of node-community labeling. For this reason, we provide an alternative representation of the communities by community labeling $T=\{t_i(l)\}$ of the nodes $i$ at different layers $l$. Since, there is a correspondence between possible communities $C$ and the labeling $T$, the generative model $P(W\mid C)$ and the prior $P(C)$ can be equivalently expressed in terms of the labeling as $P(W\mid T)$ and $P(T)$, respectively. We carefully explain this approach, and the resulting stochastic model is given in Section \ref{sssec:SBMWPP}. We can similarly obtain the MAP estimate $\hat{T}_\mathrm{MAP}$ of $T$ and find its corresponding set of communities, which coincides with $\hat{C}_\mathrm{ML}$, but we resort to a well-known alternative approach, for numerical feasibility. In this approach, we first calculate the marginal probability distribution $p_{i,l}(\alpha)=P(t_i(l)=\alpha\mid W)$ of the labels $\alpha$ of a single node $i$ in a single layer $l$. This is given by \begin{equation} P(t_i(l)=\alpha\mid W)=\sum_{T\mid t_i(l)=\alpha}P(T\mid W), \label{eq:margin} \end{equation} where we recall that the posterior distribution $P(T\mid W)$ is calculated by Bayes rule as \begin{equation} P(T\mid W)=\frac{P(W\mid T)P(T)}{\sum_{T^\prime}P(W\mid T^\prime) P(T^\prime)}. \label{eq:global} \end{equation} Next, we obtain the maximum marginal a-posteriori probability (MMAP) label estimates $\hat{T}_\mathrm{MMAP}=\{\hat{t}_{i,\mathrm{MMAP}}(l)\}$ by individually maximizing the resulting \textit{posterior marginal} distributions $p_{i,l}(\alpha)$ for every node: \[ \hat{t}_{i,\mathrm{MMAP}}(l)=\arg\max_\alpha p_{i,l}(\alpha), \] from which the corresponding community estimates $\hat{C}_\mathrm{MMAP}$ can be easily obtained. It is shown in \cite{Decelle2011} that $\hat{C}_\mathrm{MMAP}$ is an optimal estimate of the original assignment for large networks with the SBM, which is often slightly better than the MAP estimate $\hat{C}_\mathrm{MAP}$ (ground state) in terms of the number of correct assignments. Numerical efficiency of the above approach depends on the computation of marginal distributions $p_{i,l}(\alpha)$, which is difficult to perform directly. For example, the denominator in Eq. \eqref{eq:global}, known as the partition function, cannot be exactly calculated unless the system is extremely small or approximate approaches such as Gibbs sampling are used. In Sec. \ref{ssec:BP}, we use a computationally more efficient variational method called belief propagation (BP), which gives the exact marginals $p_{i,l}(\alpha)$ as an approximation of the partition function by a product of marginals, and leads to an efficient implementation of the above approach. We next discuss the generative model in detail. \subsubsection{\label{sec:SL_SBM}Stochastic Block Model in Single-Layer Network} \label{sec:SBM} Stochastic block model (SBM) is commonly used to describe non-overlapping community structures of a single layer network, and plays an important role in our model. Hence, we explain it first. As a generative model, it includes the following parameters: the number of communities $q$, the fraction of the size of each community $\{n_a\}$, the affinity matrix $p=\{p_{ab}\}$ showing the probability of an edge between nodes in communities $a$ and $b$, and the community assignment $t_i\in \{1,...,q\}$ for each node $i$. A single-layer network is generated from SBM by first assigning to each node one of the community labels $t_i$. The probability of a node being assigned to a community label $a$ is proportional to the size $n_a$ of the community. Then, a pair $(i,j)$ are connected ($A_{ij}=1$ in the adjacency matrix) with probability $p_{t_it_j}$ independently of other pairs. According to the SBM \cite{Wang1987}, if the size of a community is large enough, the community will appear as a block with high probability in the adjacency matrix, under suitable ordering of the nodes. In benchmark tests, it is common to set $p_{ab}=p_{in}$ if $a=b$, and $p_{ab}=p_{out}$ if $a\neq b$. The constants $p_{in}$ and $p_{out}$ are selected such that the fraction $\epsilon=p_{out}/p_{in}$ is between 0 to 1, so as to control the community quality in the generated network. $\epsilon=0$ means no connections between two different communities, which represents a high quality community structure. A high $\epsilon$ value \NEW{($\epsilon\approx1$)} means that the connection densities inside and outside the blocks are not significantly distinct, usually reflecting a noisy and weak community structure. \subsubsection{Generalization to Multiplex Networks} \label{sssec:SBMWPP} Now we generalize SBM to multiplex networks. The idea behind our generative model for multiplex networks is that the same community may appear in multiple layers. Each layer $l$ takes a subset of a collection of communities $C$, denoted by $H_l\subseteq C$. If communities $C_a,C_b\in H_l$ and $a\neq b$ (here $a$ and $b$ are community labels), it is required that $C_a \cap C_b= \emptyset$, meaning that overlapping communities are not allowed in any layer. Also, we assume that when a community $C_a$ exists in multiple layers, it refers to the same group of nodes, so that the definition of $C_a$ is independent of the layers. We call these requirements Well Partitioned Property (WPP), and it is an interlayer constraint. WPP has real world relevance a good case being the social network. We can build a multiplex social network using different types of relations, such as contacts, collegial interaction, common interests, etc., in order to disentangle overlapping community structures. However, communities may exist across multiple layers, e.g. a group of close friends may be reflected as the same community in both the rock music network and the soccer fan network. Meanwhile, in these two layers, other people may form inconsistent community structures. In conclusion, we want to build a model, such that only if consistent communities exist between layers, they will be matched and fused. Under WPP, we may define the community label vector $\bm{t}(l)=(t_1(l),t_2(l),...t_N(l))$ for all $N$ nodes in layer $l$ similarly to the single-layer model in Sec. \ref{sec:SL_SBM}: \[ t_i(l)=\left\{\begin{array}{cc} a & i\in C_a,\ C_a\in H_l ,\\ \emptyset & \text{otherwise}. \end{array}\right. \] The community $C_a$ can be easily recovered from the labels by collecting every node labeled by $a$: \[ C_a=\{v_i\mid\exists l,\ t_i(l)=a\} \] The generative model proceeds as follows: the community label vector $\bm{t}(l)$ for nodes in layer $l$ is generated from SBM parameters, under the interlayer constraint WPP. The adjacency matrix of layer $l$ is then independently generated as an ordinary SBM. We propose to formulate the probability of a multiplex network $\{W(l)\}$ and community labels $\{\bm{t}(l)\}$, conditioned on a set of SBM parameters as,\\\\ \textbf{Proposed model}: \begin{equation} \begin{aligned} &P(\{W(l)\},\{\bm{t}(l)\}|p,q,\{n_a\})\\ &=\frac{1}{Z}\prod_{(i,j),(l,l')}f_{check}(t_i(l),t_j(l),t_{i}(l'),t_{j}(l'))\\ &\times \prod_{l=1}^L\left[\prod_{(i,j)\in E(l)}p_{t_i(l),t_j(l)}\prod_{(i,j)\notin E(l)}(1-p_{t_i(l),t_j(l)})\prod_{i}n_{t_i(l)}\right]. \end{aligned} \label{eq:overall} \end{equation} In the following, we break down the formulation and explain each component. We start with a factorized form of the likelihood function, assuming the set of parameters $\theta =\{p,q,\{n_a\}\}$ given, \begin{equation} \begin{aligned} &P(\{W(l)\},\{\bm{t}(l)\}|\theta)\\ =&P(\{W(l)\}|\{\bm{t}(l)\},\theta)P(\{\bm{t}(l)\}|\theta),\\ =&P(\{\bm{t}(l)\}|\theta)\prod_{l=1}^{L}P(W(l)|\bm{t}(l),\theta),\\ \end{aligned} \label{eq1} \end{equation} where $W(l)=(V,E(l)), \ \ l=1,...,L$ is a multiplex layer. If we look at the product term, $P(W(l)|\bm{t}(l),\theta)$ is the probability that a layer $l$ of the network being generated by a community structure $\bm{t}(l)$. Same as the single-layer SBM, introduced in \cite{Decelle2011}, \begin{equation} \begin{aligned} &P(W(l)|\bm{t}(l),\theta)\\ &=\prod_{(i,j)\in E(l)}p_{t_i(l),t_j(l)}\prod_{(i,j)\notin E(l)}(1-p_{t_i(l),t_j(l)}). \end{aligned} \label{eq:sbm} \end{equation} The other term, $P(\{\bm{t}(l)\}|\theta)$, is the probability distribution over all community patterns satisfying the interlayer constraints from WPP. We express these constraints by a product of local indicator functions $f_{check}$ over the associated community assignment labels $t_i(l)$. Therefore if at least one of the indicator functions is zero (local WPP condition is not satisfied), $P(\{\bm{t}(l)\}|\theta)$ will be zero. Specifically, we propose the distribution of community patterns as: \begin{equation} \begin{aligned} &P(\{\bm{t}(l)\}|\theta)\\ &=\frac{1}{Z}\prod_{i,l}n_{t_i(l)}\prod_{i(l),j(l),i(l'),j(l')}f_{check}(t_i(l),t_j(l),t_i(l'),t_j(l')), \label{eq:check} \end{aligned} \end{equation} where $Z$ is a suitable normalization constant. The local constraint $f_{check}$ is an indicator function of the state (community label) of the copies of 2 nodes $i,j$ in 2 different layers, $l,l^\prime$ ($i(l)$ means node $i$ in layer $l$). The function $f_{check}$ checks whether the associated labels satisfy WPP, and $f_{check}$ equals one if the following occurs, and is zero otherwise: \[ \begin{aligned} &\text{Assume}\ \begin{cases} t_i(l)=\alpha \\ t_j(l)=\beta \end{cases},\\ &\text{If}\ \alpha=\beta,\ \text{then}\ \begin{cases} t_i(l')=t_j(l')=\alpha\\ \text{or}\ \begin{cases} t_i(l')\neq \alpha\\ t_j(l')\neq \alpha \end{cases}\\ \end{cases},\\ \\ &\text{If}\ \alpha\neq \beta,\ \text{then}\ \begin{cases} t_i(l')\neq \beta\\ t_j(l')\neq \alpha \end{cases}.\\ \end{aligned} \] This set of conditions summarize when the labels of two nodes satisfy WPP, as we will discuss in detail next. In practice, given a certain number of communities $q$, we can build a list of all possible combinations that satisfy the above constraint and set $f_{check}=1$. Therefore, the process of evaluating the function $f_{check}$ by verifying the above constraint, can be significantly simplified by storing a look-up table. The look-up table is simple to build for moderate $q$ with a complexity of $q^4$, and only needs to be computed once for a certain $q$ value. \subsubsection{Characterizing WPP} We are able to proof that a multi-layer community structure $(C,\{H_l\})$ satisfies WPP, if and only if, for the labels of every pair of nodes and every two layers, the value of function $f_{check}$ equals one and hence $P(\{\mathbf{t}(l)\}\mid\theta)=1$. The general proof is in the appendix. Here we show a simple example to demonstrate one of the constraints. \begin{figure}[htb] \begin{minipage}[b]{1.0\linewidth} \includegraphics[width=8.5cm]{Fig2_constraint_example.eps} \end{minipage} \caption{An example of a two-layer network with different community structures.} \label{fig:consexa} \end{figure} Fig. \ref{fig:consexa} shows a situation where community structures in two layers are different (each connected component in a layer is a community). According to the connectivity patterns, we observe that $t_i(1)=t_j(1)$ and $t_i(2)\neq t_j(2)$ as $i,j$ are in the same community in layer 1, while they are in different communities in the second layer. We conclude that, in the second layer, neither node $i$, nor node $j$ can be assigned to the same community as the one in the first layer, and hence at least 3 communities are required for a correct assignment. This simple intuition is reflected in the definition of $f_{check}$ (the case of $\alpha=\beta$), where $l=1,l^\prime=2$. We observe that the constraints in $f_{check}$, when utilized in a Bayesian learning algorithm, ensure that distinct communities in different layers will not be assigned the same label and not be confounded as one community, so that the structural information will not be mixed up and obscured. This is, according to our example, due to the fact that assigning the same labels to unequal communities will lead to violation of constraints, and make corresponding $f_{check}$ functions zero and consequently a zero-value posterior distribution $P(\{W(l)\},\{\bm{t}(l)\}|\theta)$. Another role of the constraints is to equally assign consistent communities in different layers, and fuse the structural information to improve detectability. This is illustrated in our example, depicted in Fig. \ref{fig:consexa2}, where only the community for node $i$ is consistent between two layers, and our goal is to assign to the copies of node $i$ the same community label. Notice that in total, 4 communities are involved in this example. If we set $q=4$, any community assignment with $t_i(1)\neq t_i(2)$ will violate the $f_{check}$ constraints, which in turn will force $t_i(1)=t_i(2)$ in the Bayesian learning algorithm. For example, let $t_i(1)=a_1$ and $t_i(2)=a_2$. Since $t_i(1)\neq t_j(1)$, according to the constraint where $\alpha \neq \beta $, we know that $t_i(1)\neq t_j(2)$ and $t_i(2)\neq t_j(1)$, and we let $t_j(1)=a_3$ and $t_j(2)=a_4$, and therefore $t_k(1)=a_3$. Similarly using the same constraint, we know $t_i(1)\neq t_k(2)$. We derive that $t_k(2)\neq a_1$, and due to the community structure in layer 2, $t_k(2)\neq a_2,a_4$. Then again using the constraint of $\alpha \neq \beta$ on $t_j(2)\neq t_k(2)$, we derive that $t_k(2)\neq t_j(1)=a_3$. We find out that $t_k(2)$ is not able to choose from any of the four community labels without violating the constraints. However if we set $q=5$, we can find community assignments with $t_i(1)\neq t_i(2)$ while satisfying the constraints (for example $t_i(1)=a_1, t_j(1)=t_k(1)=a_2, t_i(2)=a_3, t_j(2)=a_4, t_k(2)=a_5$), in which case, the communities for node $i$ in the two layers will be independently treated and detectability cannot be improved. This also demonstrates the important role of the number $q$ of communities as a design parameter. Although we may not know \textit{a priori} the actual number of communities, this number can be estimated \cite{Decelle2011}. We will discuss later (in Sec. \ref{effect_q}) how the number of communities affects detection results. \begin{figure}[htb] \begin{minipage}[b]{1.0\linewidth} \includegraphics[width=8.5cm]{Fig3_constraint_example2.eps} \end{minipage} \caption{An example of a two-layer network with partially consistent and partially different community structures. Each ellipse represents a community.} \label{fig:consexa2} \end{figure} \subsubsection{A Prototypical Multiplex Model} \label{sssec:oracle} To discuss the performance of our proposed approach in Sec. \ref{sssec:BPconstraint}, we present a simpler "correlated model" without overlapping communities, but with variable and correlated ones in different layers. The correlated model is similar to the DSBM (Dynamic Stochastic Black Model) introduced in \cite{Ghasemian2015}. This model achieves the best performance when the communities in different layers are the same, since layer consistency is used as prior knowledge, much like the layer aggregation method in \cite{Taylor2016}. However, the presence of such a strong prior information is not always realistic, and this model only serves as an oracle bound for our proposed model as in Eq. \eqref{eq:overall}. We now modify the above SBM model to a correlated multilayer structure, following the same Bayesian description as in Eqs. \eqref{eq1} and \eqref{eq:sbm}, nevertheless different from our model in Eq. \eqref{eq:overall}, in that the community assignment prior is instead given by: \begin{equation} \begin{aligned} P(\{\bm{t}(l)\}|\theta)=\prod_{i(l),i(l')}f(t_i(l),t_i(l')), \end{aligned} \end{equation} where $f(\cdot)$ is a factor function for the correlation of community assignment of the same node $i$ in two layers, indicating the probability of different $(t_i(l),t_i(l'))$ combinations: \[ f(t_i(l),t_i(l'))= \begin{cases} p_{same},\ t_i(l)=t_i(l')\\ 1-p_{same},\ t_i(l)\neq t_i(l') \end{cases}, \] where $p_{same}\in [0,1]$ is the probability of consistent community labels between the same node in two layers. In a special case, if we constrain the number of both layers and communities to 2, when $p_{same}>0.5$, node labels between two layers are correlated, when $p_{same}<0.5$, anti-correlated, and when $p_{same}=0.5$, uncorrelated. Note that when $p_{same}<1$, it allows the same community label to correspond to different sets of nodes in different layers. For $q>2$, $p_{same}=0.5$ is still the threshold above which the communities become correlated, but then $f(t_i(l),t_i(l'))$ needs to be normalized to be the real probability. Similarly to Eq. \eqref{eq:overall}, we propose the following Bayesian model: \begin{equation} \begin{aligned} &P(\{W(l)\},\{\bm{t}(l)\}|p,q,\{n_a\})\\ &=\frac{1}{Z}\prod_{i(l),i(l')}f(t_i(l),t_i(l'))\\ &\times \prod_{l=1}^L\left[\prod_{(i,j)\in E(l)}p_{t_i(l),t_j(l)}\prod_{(i,j)\notin E(l)}(1-p_{t_i(l),t_j(l)})\prod_{i}n_{t_i(l)}\right]. \end{aligned} \label{eq:oracle} \end{equation} Unlike WPP, this model assumes variable communities and correlation between community assignments of a single node between layers. This may be too ideal relative to Eq. \eqref{eq:overall}, since it adds to the model some privileged prior knowledge which is uncommon in real scenarios. We will later compare the model in Eq. \eqref{eq:oracle} with the constrained multiplex model proposed in Eq. \eqref{eq:overall}. \subsection{BP algorithm for multilayer community detection} \label{ssec:BP} Belief Propagation is an efficient message-passing method for inference problems. Message-passing appears in various contexts, and with various references, such as sum-product algorithm, belief propagation, Kalman filter and cavity method which is used to compute phase diagrams of spin glass systems. Yedidia et al. \cite{Yedidia2002,Yedidia2005} gave a detailed introduction to Belief Propagation and its connection to free energy. We use the BP algorithm for calculating the marginal posterior distributions $p_{i,l}(\alpha)$ as explained in Section \ref{subsec:Bayesian}. To that end, we will represent our model in Eq. \eqref{eq:overall} as a factor graph. A factor graph is composed of factor nodes and variable nodes. Each variable node corresponds to an actual node in our multiplex network. A factor node corresponds to a factor in Eq. \eqref{eq:overall}. In a tree-like Bayesian network, each factor can also be interpreted as a conditional probability distribution $p(x_i|Parent(x_i))$. Here $x_i$ corresponds to a variable node and $Parent (x_i)$ denotes its parent nodes \cite{Yedidia2002}. A factor node is connected to its contributing variables, therefore connecting a variable node and all its parent variable nodes. As seen in Eq. \eqref{eq:overall}, two types of factor nodes arise in our case: constraint ($f_{check}$) nodes, connected to four variable nodes, and the remaining SBM nodes, connected to two variables (See Fig. \ref{fig:factorgraph}). In BP, "messages" are reciprocally sent between variable nodes and factor nodes. These messages are a set of equations about the estimates of the conditional marginals. These equations are self-consistent in the sense that they will converge to a consistent solution upon repeatedly iterating. On factor graphs, messages $m^{i\rightarrow a}$ from variable nodes $i$ to factor nodes $a$ are different from the reversed ones $m^{a\rightarrow i}$ and are given by: \begin{equation} \begin{aligned} &m^{i\rightarrow a}(x_i):=\prod_{c\in N(i)\backslash a} m^{c\rightarrow i}(x_i)\\ &m^{a\rightarrow i}(x_i):=\sum_{\textbf{x}_a\backslash x_i}f_a(\textbf{x}_a)\prod_{j\in N(a)\backslash i}m^{j\rightarrow a(x_j)}, \end{aligned} \label{eq:variablefactor} \end{equation} where $N(i)\backslash a$ denotes the neighbors of the variable node $i$ except $a$, and $\textbf{x}_a\backslash x_i$ denotes the neighbors of the factor node $a$ except node $i$. Basically, a variable-to-factor message is proportional to the product of all other incoming messages to the variable node, while a factor-to-variable message is the posterior marginal distribution of the variable based on the individual factor, and assuming other incoming messages to the factor as independent priors. The computational complexity of BP is low. To obtain a marginal probability distribution of an objective node in graphs with no loops, one starts from all the leaves and uses all messages only once, toward the objective node. In practice, one starts with random initial messages, and let them update iteratively, until they converge to a fixed point, or until they meet a stopping criterion. Hence, for a fixed number of iterations, the computation time is $O(|E|)$. In a generated sparse graph where we fix the average degree, the computation time is $O(N)$ . After convergence, the marginal distribution (also called belief) of a node can be calculated using all incoming messages: \begin{equation} b^{i}(x_i)\propto \prod_{c\in N(i)} m^{c\rightarrow i}(x_i). \label{eq:BPmarginal} \end{equation} While, in the presence of cycles, messages may theoretically require infinite iterations to converge, BP has been observed to perform well in graphs that are locally tree-like even if they have many loops\cite{Decelle2011}. Notice that in loopy graphs, the order of message passing is arbitrary and often heuristic. \subsubsection{Message Passing for Single-Layer SBM} For single layer networks, ordinary SBM is used to describe community structures. In \cite{Decelle2011} it is shown that since each factor is exactly connected to two variables, the two steps in Eq. \eqref{eq:variablefactor} can be combined to yield a single node-to-node message passing step as follows: \[ m_{t_i}^{i\rightarrow j}=\frac{1}{Z^{i\rightarrow j}}n_{t_i}\prod_{k\in N(i)\backslash j}\left[\sum_{t_k}c_{t_kt_i}^{A_{ik}}(1-\frac{c_{t_kt_i}}{N})^{1-A_{ik}}m_{t_k}^{k\rightarrow i}\right], \] where $Z^{i\rightarrow j}$ is a normalization constant. $n_{t_i}$ is the fraction of the size of the community $t_i$ (assigned to node $i$), which represents local evidence for node $i$. $c_{t_kt_i}$ is the rescaled connection probability between nodes in communities $t_k$ and $t_i$ respectively i.e., $c_{ab}=Np_{ab}$ ($N$ is the number of nodes). Finally, $A_{ik}$ is an element of the adjacency matrix of the network. Decelle et al. \cite{Decelle2011} further use the following mean field approximation to simplify the influence from unconnected nodes, \begin{equation} m_{t_i}^{i\rightarrow j}=\frac{1}{Z^{i\rightarrow j}}n_{t_i}e^{-h_{t_i}}\prod_{k\in N(i)\backslash j}\left(\sum_{t_k}c_{t_kt_i}m_{t_k}^{k\rightarrow i}\right), \label{eq:BPforCD} \end{equation} where $h$ is an external field, and expressed as, \[ h_{t_i}=\frac{1}{N}\sum_k \sum_{t_k}c_{t_k t_i}b^k_{t_k}. \] Here $b^k_{t_k}$ is the belief at node $k$ for community label $t_k$, corresponding to our objective in Eq. \eqref{eq:margin}. The belief at node $i$ is written as, \[ b^i_{t_i}=\frac{1}{Z^{i}}n_{t_i}e^{-h_{t_i}}\prod_{k\in N(i)}\left(\sum_{t_k}c_{t_kt_i}m_{t_k}^{k\rightarrow i}\right). \] Clearly, Eq. \eqref{eq:BPforCD} bears a similar structure to a combination of the two steps in Eq. \eqref{eq:variablefactor}. Note that the inner summation part in parentheses in Eq. \eqref{eq:BPforCD} is in the form of a message from a factor node to a variable node i.e., the second line in Eq. \eqref{eq:variablefactor}, while the outside product manifests message passing in the first line of Eq. \eqref{eq:variablefactor} from a variable node to a factor node. We observe that the message \eqref{eq:BPforCD}, being from variable $i$ to variable $j$, essentially bypasses the factor node lying between these two variable nodes, hence further reducing complexity. \subsubsection{Multiplex Network as a Message Passing Model} \label{sssec:BPconstraint} Since the interlayer constraint function in Eq. \eqref{eq:check} is defined by 4 variable nodes rather than pairwise interaction, we can no longer combine the two messages in Eq. \eqref{eq:variablefactor} and directly write inter-layer messages between variable nodes. We instead opt to explicitly write inter-layer messages from variable nodes to factor nodes. For the sake of consistency, we do the same for intralayer messages. The factor graph is illustrated in Fig. \ref{fig:factorgraph}. The message update equations are shown below. \begin{strip} \textbf{Proposed update equations}: Intra-layer message: \begin{equation} \begin{aligned} &m_{t_i}^{i\rightarrow a}(l)=\frac{1}{Z^{i\rightarrow a }(l)}n_{t_i(l)}e^{-h_{t_i(l)}}\prod_{d\in N_{intra}(i(l))\backslash a}\left(\sum_{t_d}c_{t_dt_i(l)}m_{t_d}^{d\rightarrow i(l)}\right)\\ & \times \prod_{c\in N_{inter}(i)}\left(\sum_{t_j(l),t_i(l'),t_j(l')} f_{check}(t_i(l),t_i(l'),t_j(l),t_j(l'))\prod_{k\in N_{inter}(c)\backslash i} m_{t_k}^{k\rightarrow c}\right). \end{aligned} \label{BPcomplete} \end{equation} Inter-layer message: \begin{equation} \begin{aligned} &m_{t_i}^{i\rightarrow c}=\frac{1}{Z^{i\rightarrow c }}n_{t_i}e^{-h_{t_i(l)}}\prod_{d\in N_{intra}(i)}\left(\sum_{t_d}c_{t_dt_i}m_{t_d}^{d\rightarrow i}\right) \times\\ & \prod_{c^*\in N_{inter}(i)\backslash c}\left(\sum_{t_j(l),t_i(l'),t_j(l')} f_{check}(t_i(l),t_i(l'),t_j(l),t_j(l'))\prod_{k\in N_{inter}(c^*)\backslash i} m_{t_k}^{k\rightarrow c^*}\right), \end{aligned} \label{BPcomplete2} \end{equation} where $N_{intra}(i)$ represents intra-layer neighbors of node $i$, and $N_{inter}(i)$ the inter-layer ones (the constraint-checking factors). \NEW{$h_{t_i(l)}$ is the external field in layer $l$, referring to the single layer version in Eq. \eqref{eq:BPforCD}.} To calculate the node belief: \begin{equation} \begin{aligned} &b_{t_i}^{i}(l)=\frac{1}{Z^{i}(l)}n_{t_i(l)}e^{-h_{t_i(l)}}\prod_{d\in N_{intra}(i(l))}\left(\sum_{t_d}c_{t_dt_i(l)}m_{t_d}^{d\rightarrow i(l)}\right)\times\\ & \prod_{c\in N_{inter}(i(l))}\left(\sum_{t_j(l),t_i(l'),t_j(l')} f_{check}(t_i(l),t_i(l'),t_j(l),t_j(l'))\prod_{k\in N_{inter}(c)\backslash i(l)} m_{t_k}^{k\rightarrow c}\right). \end{aligned} \label{BPcomplete_belief} \end{equation} \end{strip} \begin{figure}[tb!] \begin{minipage}{1.0\linewidth} \includegraphics[width=8.5cm]{Fig4_factor_graph.eps} \end{minipage} \caption{An example of a factor graph for our model. A circle is a variable node, and a square is a factor node. \NEW{There are two types of factor nodes. One is within each layer, $f_a(t_i(l),t_j(l))=c_{t_i(l),t_j(l)}$, representing the likelihood of node $i$ having label $t_i(l)$ and node $j$ having label $t_j(l)$}. Another is between layers, $f_{check}(t_i(l),t_i(l'),t_j(l),t_j(l'))$, representing the local constraints of community labels.} \label{fig:factorgraph} \end{figure} Note that the marginal posteriors are given by the beliefs as $p_{il}(\alpha)=b^i_{t_i(l)=\alpha}(l)$. For experimental purposes, and clarity, we write down the belief propagation equations for a two layer network, similarly for the following model. The associated resulting message passing algorithm is shown below as a pseudocode. The "for" loops, which update the messages, can be easily executed in a parallel or distributed fashion for large networks. In our experiments, a serial version of the algorithm is implemented. In each step, one edge is randomly selected without replacement and the corresponding message is updated, which influences the following updates of other edges. \begin{algorithm}[t] \caption{BP for constrained multiplex networks}\label{alg:euclid} \begin{algorithmic}[1] \State Initialize belief vector for each node in each layer \State Compute initial messages and field $h$(more detail) \While{$t<t_{max}$ and conv$>$criterium \State conv=0; t=t+1 \For{layer $l$ from 1 to $L$} \For{every directed edge $i\rightarrow j$ in layer $l$} \State Update message $m^{i\rightarrow j}(l)$ according to Eq. \eqref{BPcomplete} \State Update message $m^{i\rightarrow c}$ according to Eq. \eqref{BPcomplete2} \EndFor \For{every node $i$ in layer $l$} \State Update belief $b^{i}(l)$ according to Eq. \eqref{BPcomplete_belief} \EndFor \State Update field $h(l)$ in layer $l$ \EndFor \State conv$=\sum|m_{new}-m_{old}|$ \For{every ordered pair of layers $l$ and $l'$} \For{every ordered pair of nodes $i$ and $j$} \State Update message from $i$ in layer $l$ to the constraint factor node between $i$ and $j$, $m^{i\rightarrow c}(l)$ according to Eq. \eqref{BPcomplete2} \EndFor \EndFor \EndWhile \State Compute group assignment \State Compute accuracy \label{BP} \end{algorithmic} \end{algorithm} \subsubsection{An Oracle Limit: Correlated Variable Communities} \label{sssec:BPcorr} We now show the message passing expression for the correlated-community model in Eq. \eqref{eq:oracle}. The message paths are illustrated in Fig. \ref{fig:interlayer}, highlighting inter-layer messages and intra-layer ones. Since every factor node connects only two variable nodes, we can bypass the factor nodes and write messages between variable nodes as in the figure. \begin{figure}[htb!] \includegraphics[width=5.5cm]{Fig5_inter_layer.eps} \caption{The red arrow shows the interlayer message from $i(l')$ to $i(l)$.} \label{fig:interlayer} \end{figure} \begin{floatEq} \begin{minipage}{1.0\linewidth} \textbf{Proposed update equations}: Intra-layer message: \[ m_{t_i}^{i\rightarrow j}(l)=\frac{1}{Z^{i\rightarrow j}(l)}n_{t_i(l)}e^{-h_{t_{i}(l)}}\prod_{k\in N(i(l))\backslash j(l)}\left(\sum_{t_k}c_{t_kt_{i}}(l)m_{t_k}^{k\rightarrow i}(l)\right)\times \sum_{t_i(l')}f(t_i(l),t_i(l'))m^{i(l')\rightarrow i(l)}_{t_i(l')}, \] Inter-layer message: \[ m_{t_i(l')}^{i(l')\rightarrow i(l)}=\frac{1}{Z^{i(l')\rightarrow i(l)}}n_{t_i(l')}e^{-h_{t_i(l')}}\prod_{k\in N(i(l'))}\left(\sum_{t_k}c_{t_kt_i}(l^\prime)m_{t_k}^{k\rightarrow i}(l^\prime)\right). \] \end{minipage} \end{floatEq} \section{Detectability transition of constrained multiplex networks} \label{sec:synthetic} \subsection{Homogeneous multiplex network} In this section, we report the results of the Bayesian method in Section \ref{subsec:Bayesian} with the message-passing algorithms developed in Sec. \ref{sssec:BPconstraint} and \ref{sssec:BPcorr}. We set the experimental scenario to consist of a 2-layer network with 200 nodes, where each layer is randomly generated according to a SBM. The nodes are partitioned into two communities of equal size, which are present in both layers. This is a result of the probability having the same labels between two layers, i.e. $p_{same}=0$ or 1 in the correlated model, all the while simultaneously satisfying the WPP. For each algorithm, we observe community detectability transition by varying $\epsilon=p_{out}/p_{in}$ in the SBM. The transition is quantitatively characterized by a normalized agreement score $Q\in [0,1]$ (referring to "agreement" in \cite{Decelle2011}), \[ Q(\{t_i^*(l)\},\{\hat{t}_i(l)\})=\max_\pi \frac{\frac{1}{N}\sum_i{\delta_{t_i^*(l),\pi(\hat{t}_i(l))}-\max_an_a}}{1-\max_an_a}, \] where $\{t_i^*(l)\}$ is the ground truth community labels, $\pi$ is one of the permutations of estimated community labels $\{\hat{t}_i(l)\}$, and $\max_an_a$ is the size of the largest community. $\frac{1}{N}\sum_i{\delta_{t_i^*(l),\pi(\hat{t}_i(l))}}$ is called agreement score and represents the overlap between estimated community labels and ground truth. For the correlated-community model in Sec. \ref{sssec:oracle}, we observe transitions curves under various value of $p_{same}$ in the algorithm in Sec. \ref{sssec:BPcorr}. In Fig. \ref{fig:diff_factors}, for $p_{same}=0.5$, detectability transition is similar to that in a single layer (red dash line) \cite{Decelle2011}, because we are practically treating them as independent layers. Except for $p_{same}=0$ or 1, high correlation (such as $p_{same}=0.9$) or anti-correlation (such as $p_{same}=0.1$) between labels increases detectability significantly. We conjecture that the poor performance for $p_{same}=0$ or 1 is due to its low tolerance of wrong intermediate label, leading to a lower chance of convergence to the correct fixed point. The fluctuation of the $p_{same}=0$ or 1 curves also indicates that the convergence is not stable in these cases, especially considering the loopy factor graph. \begin{figure}[htb] \begin{minipage}[b]{1.0\linewidth} \includegraphics[width=8.5cm]{Fig6_different_factors.eps} \end{minipage} \caption{Detectability transition curves for various $p_{same}$ ranging from 0 to 1. The slower the normalized agreement score $Q$ \cite{Decelle2011} drops down, the better the detectability. Data points for $p_{same}=0,0.1,0.5,0.9,1$ are connected by solid lines. The results are averaged over 100 experiments. The error bars represent standard errors.} \label{fig:diff_factors} \end{figure} This naive assumption that all nodes in different layers have correlated community labels is, however, the same as directly connecting corresponding nodes in two layers without any further weight adjustment over messages. \NEW{In this case, all nodes in each layer are assumed as uniformly correlated. This assumption from the correlated model is reasonable for certain types of multiplex networks such as temporal networks. However, to account for heterogeneous structure, and a more realistic case of unknown prior knowledge of consistent communities, it will be more suitable to use our generative model with label constraint.} \NEW{Fig. \ref{fig:diff_factors} shows that a two-layer network is enough to exhibit the strength of the correlated model. To directly compare the constrained multiplex model in Sec. \ref{sssec:SBMWPP} with the correlated one in Sec. \ref{sssec:oracle}, we follow the same experimental setting as in Fig. \ref{fig:diff_factors}, and test both methods on the homogeneous double layer network. We make sure that each layer has the same community structure and is independently generated by the same SBM parameters: 200 nodes which are divided into two equal communities. Note that we do not generate the network from the correlated model, although the correlated model fits it.} We vary $\epsilon=p_{out}/p_{in}$ to observe the detectability transitions. The result is shown in Fig. \ref{fig:singleVScorrVSconstr}, where we include the transition curve for a single layer (red line) as a reference. Similarly to the correlated model (blue line), the constrained model (black line with circle marks) fails around similar $\epsilon$ values. They both perform much better (fail for larger $\epsilon$) than a single layer. Note that in the correlated model, we know \textit{a priori} that the community labels are correlated between two layers. In the constrained model, we, however, do not specifically have that prior knowledge. Just by enforcing WPP constraints and limiting the number of communities to 2, we can still achieve a similar performance improvement. This is beneficial for real world networks, since in practice we often have limited prior information about consistent communities. \NEW{Indeed, in this experiment, this prior knowledge may also be inferred in the correlated model, setting interlayer correlation as a parameter and using the EM algorithm \cite{Dempster1977}. However, in more complex cases where, for example, community structure in two layers can not be simply described by a single correlation parameter, the correlated model will face difficulty, as we will show in the next section.} One may suspect that as long as the blocks are consistent, the detectability can be automatically improved regardless of such correlation being available to the model. This is clearly not the case for the correlated model as in Fig. \ref{fig:diff_factors}, since setting $p_{same}=0.5$, does not include correlation in the model, and the performance is poorer and similar to a single layer setting. \begin{figure}[htb] \begin{minipage}[b]{1.0\linewidth} \includegraphics[width=8.5cm]{Fig7_singleVScorrVSconstr_errorbar.eps} \end{minipage} \caption{Detectability transition curves for a single layer network, a correlated double layer network and a double layer network with constraint. \NEW{The synthetic network is a two-layer network, where each layer is independently generated by the same SBM model such that 200 nodes form two equal communities. Nodes have the same community labels in layer 1 and 2, while the edges are different across layers, so information between two layers can be easily combined. $p_{same}$ is 0.9, only used as the inference parameter for the correlated model.} The results are averaged over 30 experiments. Error bars represent the standard error of the experiments.} \label{fig:singleVScorrVSconstr} \end{figure} \subsection{Heterogeneous multiplex network}\label{hete_exp} The constrained model being the only model that naturally generates heterogeneous networks, shows the advantage over the correlated model or single layer networks. In the following we compare the community detection performance between the constrained model and the correlated model on heterogeneous networks. \NEW{We construct a double layer network of 200 nodes, with $\epsilon\in[0,1]$ An example of the synthetic network is shown in Fig. \ref{fig:hete}. In the first layer, the first 100 nodes form a community and the remaining 100 nodes are assigned to another community. In the second layer the first 100 nodes still form a community but the remaining 100 nodes are divided into two equal communities.} By limiting the total number of communities to $q=4$, we expect the belief of the first 100 nodes in both layers to converge to the same label, and the remaining 100 nodes in two layers to converge to three different labels (refer to Fig. \ref{fig:hete}). We refer to this expected result as WPP-satisfying labels and other results as error. \begin{figure}[htb] \begin{minipage}[b]{1.0\linewidth} \includegraphics[width=8.5cm]{Fig8_hete.PNG} \end{minipage} \caption{An example ($\epsilon=0.2$) of the heterogeneous network generated to test the constraint multiplex model. There are in total four distinct communities. First 100 nodes in two layers form the same community, while the rest 100 nodes form three different communities in two layers.} \label{fig:hete} \end{figure} \begin{figure}[htb] \begin{minipage}[b]{1.0\linewidth} \includegraphics[width=8.5cm]{Fig9_ratio} \end{minipage} \caption{Fraction of trials that result in WPP-satisfying labels for different $\epsilon$. For each of the five clusters of nodes in two layers, we determine the label by the majority of node labels in that cluster. Then we check if these five labels satisfy WPP. Refer to Fig. \ref{fig:hete} for synthetic network setup.} \label{fig:ratio} \end{figure} We performed 100 independent trials of tests using both models, and count the fraction of the tests that result in WPP-satisfying labels. As in Fig. \ref{fig:ratio}, when $\epsilon\in [0,0.4]$, our constrained model yields WPP-satisfying labels in some of the trials, while the correlated model is able to achieve that only for $\epsilon\in [0,0.1]$. Also, the constrained model has significantly higher likelihood to yield correct labels, i.e., has the messages converge to the correct point, when $\epsilon\in [0,0.4]$. Note that in this experiment, for each layer, we do not limit the number of communities to the correct value (i.e. two communities for layer 1 and three for layer 2), which means each node in a layer will freely choose from 4 different labels. If we detect communities independently in two layers, which corresponds to setting no constraint, the chance of WPP-satisfying labels is no more than $4!/(P^4_2\times P^4_3)=1/12$, where $P^n_k$ is $k$-permutation of $n$. Our result does show an advantage in identifying consistent communities in heterogeneous networks, while the correlated model is unsuitable for this task. The detection error may be attributed to local minima which violate the constraint (WPP) to some degree, with, however, sufficient resilience for the messages to converge. In practice, we can run the algorithm multiple times and choose the results that more likely converged to a correct point. \begin{figure}[htb] \begin{minipage}[b]{1.0\linewidth} \includegraphics[width=8.5cm]{Fig10_conVScorr} \end{minipage} \caption{Detectability transition curves for constrained model and correlated model on heterogeneous networks. $p_{same}$ is 0.9 for the correlated model. The results are averaged over top 20 trials where most node labels satisfy WPP. Error bars represent the standard error of the trials. Refer to Fig. \ref{fig:hete} for synthetic network setup.} \label{fig:consVScorr} \end{figure} In Fig. \ref{fig:consVScorr}, for both constrained model and correlated model, we examine the agreement score $\frac{1}{N}\sum_i{\delta_{t_i^*(l),\pi(\hat{t}_i(l))}}$ between prediction and ground truth. That is because in this more complex experiment, it is not as straightforward to define a normalized agreement score $Q$ as in Fig. \ref{fig:diff_factors} and Fig. \ref{fig:singleVScorrVSconstr}. \NEW{As stated above, not every trial will converge to the correct point, we therefore select for both models the top 20 trials that satisfy WPP better (without using ground truth information). Specifically, for each trial we count how many pairs of nodes satisfy WPP locally, by calculating $f_{check}$ function over the inferred labels of pairs of nodes.} We observe in Fig. \ref{fig:consVScorr} that for $\epsilon\in[0.1,0.2]$, the agreement score of the constrained model is remarkably higher than the correlated model. The performance advantage benefits from a high fraction of WPP-satisfying results using the constrained model for $\epsilon\in[0.1,0.2]$, as shown in Fig. \ref{fig:ratio}. When this benefit vanishes, for $\epsilon\in [0.3,0.5]$, the constrained model gets similar or worse agreement score than the correlated model. Note that again, the proposed constrained model does not utilize the knowledge that the first 100 nodes have correlated community labels, while the correlated model is supplied with this prior information. The reason of the better performance for $\epsilon\in[0.1,0.2]$ is that, the constrained model manages to fuse information for the first 100 nodes in two layers, meanwhile leaving the remaining 100 nodes intact, while the correlated model tends to unify the entire community structure in the two layers, hence corrupting the remaining 100 nodes. The poorer performance of the constrained model in the noisier $\epsilon\in [0.3,0.5]$ range, we suspect, is due to an optimization in stability caused by many more constraints and factor nodes in the graphical model. On the other hand, the correlated model has a simpler form and is less susceptible to the stability issue. \NEW{In this section, we have compared our constrained model with a basic correlated model, and results show a higher modeling capability of the constrained model, in presence of heterogeneous community structures. Although the correlated model is simpler, the assumption of a uniform label correlation between two layers does not naturally generate multiplex networks with diverse relations, where only a portion of communities are correlated or consistent. Hence, the correlated model (similar to \cite{Ghasemian2015}) is more appropriate for smoothly evolving temporal networks, and the constrained model we proposed is typically suitable for multiplex networks with different types of relations, where the layers are not necessarily uniformly correlated. In principle, the basic correlated model can be extended so that different nodes can have their own interlayer correlation, and the flexibility of the correlated model can be much greater. However, we expect inference difficulty for such model, given the significantly larger number of free parameters, unless the parameters are properly constrained. Such model design will require nontrivial work and is interesting for future works.} \NEW{Since the goal of the proposed algorithm is that of fusing consistent communities across layers in general networks and of improving detectability, we are not aware of a directly comparable algorithm that is designed for the exact same goal. Nevertheless, we provide in passing a comparison with a popular multilayer community detection algorithm, Genlouvain \cite{jutla2011generalized}, which maximizes a multilayer modularity function. For the same experiments in this section, when $\epsilon=0.2$, Genlouvain converges correctly only 3 out of 100 trials, while our proposed algorithm has over 40\% success rate. Genlouvain performs similarly to the correlated model in this particular test. The reason is that Genlouvain requires interlayer coupling parameters, which, when not given, and can only be assumed to be uniform. In contrast, our proposed constrained model implicitly infers interlayer coupling through $f_{check}$ factor nodes.} \subsection{Impact of a known number of communities $q$}\label{effect_q} For a single layer network, any $q$ that is larger than or equal to the actual value will fit the model well. For example, by setting $q=3$ while performing the BP algorithm in a network generated from SBM with 2 communities, we are allowing each node to choose from 3 distinct community labels. However when the messages have converged, generally most nodes will tend to choose from only 2 of the labels, leaving one barely used. Therefore, the general practice is to opt for a larger $q$, until the free energy of the model stops decreasing \cite{Decelle2011}. This is in contrast to the constrained multiplex networks. In the experiment of a homogeneous multiplex network, only $q=2$ gives the best performance according to the detectability transition curve. To show this effect, we generate such a 2-layer, 2-community network, with high noise $\epsilon=0.35$. (The noise is so high that when we perform BP algorithm on one of the layers with $q=3$, the community detection is affected and all 3 labels may have a significant presence among nodes, making the decision of $q$ difficult.) Then we run the algorithm with $q$ being 2,3, and 4. \begin{figure*}[htb] \begin{minipage}[b]{1.0\linewidth} \includegraphics[width=16.5cm]{Fig9_qeffect.eps} \end{minipage} \caption{Probabilities of nodes being assigned certain community labels (node beliefs) at $q=2,3$ and 4. Various community labels are represented by different colors and markers. The lower right image shows the noisy double layer network used in this test.} \label{fig:qeff} \end{figure*} As shown in Fig. \ref{fig:qeff}, the performance is getting poorer as $q$ increases. Specifically, at $q=2$, most nodes have close-to-one probability of some label, and the selected labels match well among two layers. For $q=3$, the labels still tend to match across layers, but for nodes from 101 to 200, two labels are competing with each other (blue circles and yellow asterisks). For $q=4$, even the labels are not correctly matched. This is because the constraint factors, more specifically WPP, allows the same communities in two layers to be assigned different labels when $q>2$. We therefore cannot combine their information to increase the signal-to-noise ratio. The fact that using the correct $q$ will give a distinctive performance, also enables us to more reliably select $q$. \subsection{Practical considerations and more layers} \NEW{A common challenge in belief propagation algorithm for general graphical model is the presence of a fair number of short loops. Specifically, in our model, the interlayer factor nodes introduce many short loops in our factor graph, both within layer and between layers. These short loops result in a quick convergence to undesirable points, and message update equations become more approximate, due to the influence of $f_{check}$ being overly amplified. To cope with this, we slightly modify message update equations. Specifically, instead of making the product over all incoming messages from neighboring interlayer factor nodes $N_{inter}(i)$, we sample and multiply a fraction $N_{sample}$ of incoming interlayer messages, which also conveniently reduces the computational load. Meanwhile, we can also change the values of $f_{check}$ function from $\{0,1\}$ to, for example, $\{0.2,0.8\}$, to relax the constraint. By applying these modifications, we observe a more reliable and stable convergence to the correct point in our experiments. In Figure. \ref{fig:ratio_parascan}, we find multiple combinations of learning parameters $f_{check}$ value and $N_{sample}$, where the constrained model has over $50\%$ chance to converge to the correct point. These points form a continuous band in the parameter space.} \begin{figure}[tb!] \begin{minipage}{1.0\linewidth} \includegraphics[width=8.5cm]{ratio_parascan.png} \end{minipage} \caption{Ratio of trials that satisfy WPP constraint after convergence, in the parameter space of $f_{check}$ and $N_{sample}$. We identify a band in the parameter space where the constrained model have over half the chance to reach the correct point. The numerical experiment includes 50 trials for each point, and uses the same setup as the heterogeneous two-layer experiment in Section \ref{hete_exp}, when $\epsilon=0.2$.} \label{fig:ratio_parascan} \end{figure} \NEW{Generally for networks with $N$ node, $L$ layers and $E$ edges per layer, the number of message passing per epoch is $2EL+2(N^2-N)(L^2-L)$, which is dense. For multiplex networks with $L>2$ layers, our original idea needs in total $(L^2-L)/2$ different interlayer factor nodes between pairs of layers, since we do not assume sequential layers. Viewing from the scale of layers, messages between all pairs of layers form high level loops, making it even more difficult to converge correctly. We address this difficulty by adopting the idea of alternating projection. Specifically, in each iteration, we optimize messages in every two layers at a time, while freezing other layers, until all pairs are updated. In this way, we break the high level loops among the layers, and decompose the problem $(L>2)$ into several subproblems $(L=2)$, which are more studied and have better convergence behavior. Another possibility to reduce the complexity is to incorporate this complex structure into a single factor node, an extended constraint function $f_{check}(t_i(1),...,t_i(L),t_j(1),...,t_j(L))$ that covers all the layers at once, instead of just two layers, so the number of interlayer messages will scale linearly to the number of layers. We show an experiment of a 3-layer heterogeneous network to compare these two strategies. The 3-layer network has 90 nodes in each layer, including 5 different communities in total, while a common one exists between layer 1 and 2, and between layer 2 and 3 respectively. We find that only optimizing two layers at a time has a significant advantage in improving the speed and chance of convergence to a correct point (48 correct convergence out of 100 trials). Similar to the experiment in Section \ref{hete_exp}, the correlated model will fail to deal with such heterogeneous structures.} \section{Conclusions} \label{sec:conclusion} We developed a belief propagation algorithm for community detection in general multiplex networks. We considered a case where natural label constraints exist. This case corresponds to a potentially heterogeneous community structure for different layers, a likely scenario for real-world networks. \NEW{As a comparison, we also considered a correlated model where community labels are uniformly correlated across the layers, for homogeneous multiplex networks. Relying on Bayesian inference, our method is theoretically optimal for networks described by our proposed probability model. For the correlated model, combining information from two layers significantly improves detectability due to the additional prior information. More importantly, for the label constrained model, we showed that using just label WPP constraints and limiting the number of communities, we can achieve a similar performance improvement as that of the correlated model, without rather restrictive prior assumptions. Furthermore, the constrained model is able to assign correct labels to heterogeneous commnuity structures, and achieve a much better detection accuracy than the correlated model over some parameter space. This is especially beneficial for detecting sparse and noisy communities in multiplex networks, such as social networks and biological neural networks. Our current constrained model assumes a homogeneous structure within each community. For networks with specific topologies, we can apply modified SBM in our model, such as degree-corrected SBM for social networks \cite{Karrer2011,Newman2015}. Future directions also include improving factor graph design and interlayer message passing efficiency, and applications to real world networks, with the proper numerical efficiencies.} \ifCLASSOPTIONcompsoc \section*{Acknowledgments} \else \section*{Acknowledgment} \fi We thank Han Wang for helpful discussions. We would like to acknowledge the support of U.S. Army Research Office: Grant \# W911NF-16-2-0005. \ifCLASSOPTIONcaptionsoff \newpage \fi \bibliographystyle{IEEEtran}
\section{Introduction}\label{introduction} To establish a human-machine dialogue system is one of the most challenging tasks in Artificial Intelligence (AI). Existing works on building dialogue systems are mainly divided into two categories: retrieval-based method \cite{Yan-2016-Learning,Zhou-2016-Multi}, and generation-based method \cite{Vinyals-2015A}. The retrieval-based method retrieves multiple candidate responses from the massive repository and selects the best one as the system's response, while the generation-based method uses the encoder-decoder framework to generate the response, which is similar to machine translation. \begin{figure}[tp] \centering \small \begin{tabular}{m{7cm}} \toprule \textbf {A}: i downloaded angry ip scanner and now it doesn't work and \uline{i can't \textbf {uninstall} it }\\ \textbf {B}: you \uline{\textbf {installed}} it via package or via some \uwave{binary installer}\\ \textbf {A}: \uline{i \textbf {installed}} from ubuntu soft center\\ \textbf {B}: hm i do n't know what package it is but it should let you remove it the same way \\ \textbf {A}: ah makes sense then ... hm \uwave{was it a deb \textbf {file} }\\ \midrule \textbf {True Response}: i think \uwave{it was another \textbf {format}} mayge sth starting with r \\ \textbf {False Response}: thanks i appreciate it try \uline{sudo apt-get \textbf {install}} libxine-extracodecs \\ \bottomrule \end{tabular} \caption{\label{case-ubuntu} A real example in the Ubuntu Corpus. The upper part is the conversation between speaker A and B. The speaker A want to uninstall the ip scanner and the current query is about the format of the package, so the true response is about the format, but the existing conversation model can be easily misled by the high frequency term `install' as they deal with the query and other utterances in the same way.} \end{figure} In this paper, we are focusing on the retrieval-based method because it is more practical in applications. Selecting a response from a set of candidates is an important and challenging task for the retrieval-based method. Many of the previous approaches are based on Deep Neural Network (DNN) to select the response for single-turn conversation \cite{Lu-2013-A}. We study multi-turn response selection in this paper, which is rather difficult because it not only requires identification of the important information such as keywords, phrases, and sentences, but also the latent dependencies between the context, query, and candidate response. Previous works \cite{zhou-2018-multi,Wu-2017-Sequential} show that representing the context at different granularities is vital for multi-turn response selection. However, it is not enough for multi-turn response selection. Figure \ref{case-ubuntu} illustrates the problem with a real example in Ubuntu Corpus. As demonstrated, the following two points should be modeled to solve the problem: (1) the importance of current query should be highlighted, because it has great impact on the importance of different utterances in the context. For example, the query in the case is about the format of the file (`deb file'), which leads the last two utterances (including the query) are more important than the previous ones. If we only match the response with the context, the model may be misled by the high frequency word `install' and choose the false candidate. (2) the information of different granularities is important, which includes not only the word, utterance, and context level, but also the char level. For example, the different tenses (`install,' `installed') and the misspelling word (`angry') appear constantly in the conversation. Similar to the role of question for the task of machine reading comprehension \cite{seo-2016-bidirectional, cui-acl2017-aoa, chen-2019-convolutional}, the query in this task is also the key to selecting the response. In this paper, we propose a model named TripleNet to excavate the role of query. The main contributions of our work are listed as follows. \begin {itemize} \item we use a novel triple attention mechanism to model the relationships within $ \left\langle{C, Q, R} \right\rangle$ instead of $ \left\langle{C, R} \right\rangle$; \item we propose a hierarchical representation module to fully model the conversation from char to context level; \item The experimental results on Ubuntu and Douban corpus show that TripleNet significantly outperform the state-of-the-art result. \end {itemize} \section{Related Works}\label{related-works} Earlier works on building the conversation systems are generally based on rules or templates \cite {Walker-2001-Quantitative}, which are designed for the specific domain and need much human effort to collect the rules and domain knowledge. As the portability and coverage of such systems are far from satisfaction, people pay more attention to the data-driven approaches for the open-domain conversation system \cite{Ritter-2011-Data, Higashinaka-2014-Towards}. The main challenge for open-domain conversation is to produce a corresponding response based on the current context. As mentioned previously, the retrieval-based and generation-based methods are the mainstream approaches for conversational response generation. In this paper, we focus on the task response selection which belongs to retrieval-based approach. The early studies of response selection generally focus on the single-turn conversation, which use only the current query to select the response \cite{Lu-2013-A, Ji-2014-An,Li-2015-Syntax}. Since it is hard to get the topic and intention of the conversation by single-turn, researchers turn their attention to multi-turn conversation and model the context instead of the current query to predict the response. First, \citet{Lowe-2015-The} released the Ubuntu Dialogue dataset and proposed a neural model which matches the context and response with corresponding representations via RNNs and LSTMs. \citet{Kadlec-2015-Improved} evaluate the performances of various models on the dataset, such as LSTMs, Bi-LSTMs, and CNNs. Later, \citet{Yan-2016-Learning} concatenated utterances with the reformulated query and various features in a deep neural network. \citet{Baudi-2016-Sentence} regarded the task as sentence pair scoring and implemented an RNN-CNN neural network model with attention. \citet{Zhou-2016-Multi} proposed a multi-view model with CNN and RNN, modeling the context in both word and utterance view. Further, \citet{Xu-2017-Incorporating} proposed a deep neural network to incorporate background knowledge for conversation by LSTM with a specially designed recall gate. \citet{Wu-2017-Sequential} proposed matching the context and response by their word and phrase representations, which had significant improvement from previous work. \citet{zhang-2018-modeling} introduced a self-matching attention to route the vital information in each utterance, and used RNN to fuse the matching result. \citet{zhou-2018-multi} used self-attention and cross-attention to construct the representations at different granularities, achieving a state-of-the-art result. Our model is different from the previous methods: first we model the task with the triple $ \left\langle{C, Q, R} \right\rangle$ instead of $ \left\langle C, R \right\rangle$ in the early works, and use a novel triple attention matching mechanism to model the relationships within the triple. Then we represent the context from low (character) to high (context) level, which constructs the representations for the context more comprehensively. \begin {figure*} [t] \centering \includegraphics [width= 0.9\textwidth] {figure/TripleNet.pdf} \caption{\label{HAN-arch} The neural architecture of the model TripleNet. \emph{(best viewed in color)}} \end {figure*} \section{Model}\label{Model} In this section, we will give a detailed introduction of the proposed model TripleNet. We first formalize the problem of the response selection for multi-turn conversation. Then we briefly introduce the overall architecture of the proposed model. Finally, the details of each part of our model will be illustrated. \subsection{Task Definition} For the response selection, we define the task as given the context $C$, current query $Q$ and candidate response $R$, which is different from almost all the previous works \cite{zhou-2018-multi,Wu-2017-Sequential}. We aim to build a model function $g(C, Q, R)$ to predict the possibility of the candidate response to be the correct response. \begin {equation} score = g(C, Q, R) \end{equation} The information in context is composed of four levels: context, utterances, words and characters, which can be formulated as $C = (u_{1}, u_{2}, ... , u_{i}, ..., u_{n})$, where $u_i$ represents the $i$th utterance, and $n$ is the maximum utterance number. The last utterance in the context is query $Q=U_n$; we still use query as the end of context to maintain the integrity of the information in context. Each utterance can be formulated as $u_i = (w_1, ..., w_j, .., w_{m})$, where $w_j$ is the $j$th word in the utterance and $m$ is the maximum word number in the utterance. Each word can be represented by multiply characters $w_j = (ch_1, ..., ch_k, .., ch_{l})$, where $ch_k$ is the $k$th char and $l$ is the length of the word in char-level. The latter two levels are similar in the query and response. \subsection{Model Overview} The overall architecture of the model TripleNet is displayed in Figure \ref {HAN-arch}. The model has a bottom-up architecture that organizes the calculation from char to context level. In each level, we first uses the hierarchical representation module to construct the representations of context, response and query. Then the triple attention mechanism is applied to update the representations. At last, the model matches them while focused on the response and fuses the result for prediction. In the hierarchical representation module, we represent the conversation in four perspectives including char, word, utterance, and context. In the char-level, a convolutional neural network (CNN) is applied to the embedding matrix of each word and produces the embedding of the word by convolution and maxpooling operations as the char-level representation. In word-level, we use a shared LSTM layer to obtain the word-level embedding for each word. After that, we use self-attention to encode the representation of each utterance into a vector which is the utterance-level representation. At last, the utterance-level representation of each utterance is fed into another LSTM layer to further model the information among different utterances, forming the context-level representation. The structure of the triple attention mechanism can be seen in the right part of Figure \ref {HAN-arch}. We first design a bi-directional attention function (BAF) to calculate the attention between two sequences and output their new representations. To model the relationship of the triple $\left\langle{C, Q, R} \right\rangle$, we apply BAF to each pair within the triple and get two new representations for each one element, and then we add them together as its final attention-based representation. In the triple attention mechanism, we can update the representation of each one based on the attention result with the other two simultaneously, and each element participates in the whole calculation in the same way. \subsection{Hierarchical Representation} {\noindent{\bf Char-level Representation.}} At first, we embed the characters in each word into fixed size vectors and use a CNN followed by max-pooling to get character-derived embeddings for each word, which can be formulated by \begin {gather} ch_{j,t} = tanh(W_1^j * x_{t:t+s_j-1} + b_1^j) \\ ch_j = MaxPooling_{t=0}^L[ch_{j,t} ] \end {gather} where $W_1^j$, $b_1^j$ are parameters, $x_{t:t+s_j-1}$ refers to the concatenation of the embedding of ($x_t$,...,$x_{t+s_j-1}$), $s_j$ is the window size of $j$th filter, and the $ch$ is the representation of the word in char-level. {\noindent{\bf Word-level Representation.}} Furthermore, we embed word $x$ by pre-trained word vectors, and we also introduce a word matching (MF) feature to the embedding to make the model more sensitive to concurrent words. If the word appears in the response and context or query simultaneously, we set the feature to 1, otherwise to 0. \begin {gather} e(x) = [W_{e} \cdot x; ch(x); MF] \end {gather} where $e(x)$ to denotes the embedding representation, $W_{e}$ is the pre-trained word embedding, and $ch(x)$ is the character embedding function. We use a shared bi-directional LSTM to get contextual word representations in each utterance, query, and the response. The representation of each word is formed by concatenating the forward and backward LSTM hidden output. \begin {gather} \overleftarrow {h(x)} = \overleftarrow{\text{LSTM}}(e(x)) \\ {\overrightarrow{h(x)}} = \overrightarrow{\text{LSTM}}(e(x)) \\ h(x) = [\overleftarrow {h(x)};\overrightarrow {h(x)} ] \end {gather} where $h(x)$ is the representation of the word. We denote the word-level representation of the context as $h_{u} \in \mathbb{R} ^ { m * d_w} $ and the response as $h_{r} \in \mathbb{R} ^ {m * d_w} $, where $d_w$ is the dimension of Bi-LSTMs. Until now, we have constructed the representations of context, query, and response in char and word level, and we only represent the latter two in these two levels because they don't have such rich contextual information as the context. {\noindent{\bf Utterance-level Representation.}} Given the $k_{th}$ utterance ${u_k} = [h^i_{u_k}]^m_{i=1}$, we construct the utterance-level representation by self-attention \cite{lin-2017-structured}: \begin {gather} \alpha_i^k = softmax(W_{3} tanh(W_{2}h_{u_k}(i)^T)) \\ u_{k} = \sum\nolimits_{i=1}^m h^i_{u_k} \alpha_i^k \end {gather} where $W_2 \in \mathbb{R}^{d * d_w}$, $W_3 \in \mathbb{R}^{d}$ are trainable weights, $d$ is a hyperparameter, $u_{k}$ is the utterance-level representation, and $\alpha_i^k$ is the attention weight for the $i$th word in the $k$th utterance, which signifies the importance of the word in the utterance. {\noindent{\bf Context-level Representation.}} To further model the continuity and contextual information among the utterances, we fed the utterance-level representations into another bi-directional LSTM layer to obtain the representation for each utterance in context perspective. \begin {gather} c_{k} = \text{Bi-LSTM}([u_{k}]_{k=1}^n) \end {gather} where $c_{k} \in \mathbb{R}^{d_c}$ is the context-level representation for the $k$th utterance in the context and $d_c$ is the output size of the Bi-LSTM. \subsection{Triple Attention} In this part, we update the representations of context, query, and response in each level by triple attention, the motivation of which is to model the latent relationships within $ \left\langle{context, query, response} \right\rangle$ . Given the triple $ \left\langle{C, Q, R} \right\rangle$ , we fed each of its pairs into bi-directional attention function (BAF). \begin {gather} C_1, Q_1 = BAF(C, Q) \\ C_2, R_1 = BAF(C, Q) \\ Q_2, R_2 = BAF(C, R) \\ C' = BN(C_1 + C_2) \\ Q' = BN(Q_1+Q_2) \\ R' = BN(R_1+R_2) \end {gather} where $BN$ denotes the batch normalization layer \cite{ioffe-2015-batch} which is conducive to preventing vanishing or exploding of gradients. $BAF$ produces the new representations for two sequences (P, Q) by the attention from two directions, which is inspired by \citet{seo-2016-bidirectional}. We can formulate it by \begin {gather} M_{pq} = P^T tanh(W_3 Q) \\ Att_{pq} = softmax( M_{pq}) \\ Att_{qp} = softmax( M_{pq}^T) \\ P' = P - \tilde{Q}; ~~ \tilde{Q} = Q Att_{pq}; \\ Q' = Q - \tilde{P}; ~~ \tilde{P} = P Att_{qp}; \end {gather} where $Att_{pq}$, $Att_{qp}$ are the attention between $P$ and $Q$ in two directions, $P'$, $Q'$ are the new representations the two sequences (P, Q), and we apply a batch normalization layer upon them too. We find that the triple attention has some interesting features: (1) triple, the representation for each element in the triple $\left\langle{C, Q, R} \right\rangle$ is updated based on the attention to the other two concurrently; (2) symmetrical, which means each element in the triple plays the same role in the structure because their contents are similar in the whole conversation; (3) unchanged dimension, all the outputs of triple attention has the same dimensions as the inputs, so we can stack multiple layers as needed. \subsection{Triple Matching and Prediction} {\noindent{\bf Triple Matching.}} We match the triple $\left\langle{C,Q,R} \right\rangle$ in each level with the cosine distance using new representations produced by triple attention. This process focuses on the response because it is our target. For example, in the char-level, we match the triple by \begin {gather} \tilde M_{rc}^1 (i, k, j) = cosine(ch_{r}'(i), ch_{u_k}'(j)) \\ M_{rc}^1(i, k) = \max \limits_{0<j<m} \tilde M_1(i, j, k) \\ M_{rq}^1 (i, j) = cosine(ch_{r}'(i), ch_{q}'(j)) \\ M_1 = [M_{rc}^1(i, k);M_{rq}^1 (i, j)] \end {gather} where $ch'$ is the representation updated by triple attention, $M_1 \in \mathbb{R}^{m * (n+m)}$ is the char-level matching result, the word-level matches the triple in the same way, and the utterance and the context level match the triple without the maxpooling operation. We use $M_2$, $M_3$, $M_4$ as the matching results in the word, utterance and context levels. {\noindent{\bf Fusion.}} After obtaining the four-level matching matrix, we use hierarchical RNN to get highly abstract features. Firstly, we concatenate the four matrices to form a 3D cube $M \in \mathbb{R}^{m*(n+m)*4}$ and we use $m$ as one of the matrix in $M$, which denotes the matching result for one word in response in four levels. \begin {gather} M = [M_1;M_2;M_3;M_4] \\ \tilde{m} = MaxPooling_{i=0}^{n+m}[\text{Bi-LSTM}(m_i)]\\ v = MaxPooling_{j=0}^m[\text{Bi-LSTM}{(\tilde{m}_j})] \end {gather} Where $m_i$ and $\tilde{m}_j$ are the $i$th, $j$th row in the matrix $m$ and $\tilde{m}$. We merge the results from different time steps in the outputs of LSTM by max-pooling operation. Until now, we encode the matching result into a single feature vector $v$. {\noindent{\bf Final Prediction.}} For the final prediction, we fed the vector $V$ into a full-connected layer with sigmoid output activation. \begin {equation} g(C, Q, R) = sigmoid(W_4 \cdot v+b_4) \\ \end {equation} where $W_4, b_4$ are trainable weights. Our purpose is to predict the matching score between the context, query and candidate response, which can be seen as a binary classification task. To train our model, we minimize the cross entropy loss between the prediction and ground truth. \section{Experiments}\label{experiments} \begin{table*}[t!] \begin{center}\small \begin{tabular}{l cccc | cccccc} \toprule & \multicolumn{4}{c}{\bf {Ubuntu Dialogue Corpus}} & \multicolumn{6}{c}{\bf {Douban Conversation Corpus} } \\ & R${_2}$@1& R$_{10}$@1& R$_{10}$@2 & R$_{10}$@5 & MAP & MRR & P@1 & R$_{10}$@1 & R$_{10}$@2 &R$_{10}$@5 \\ \midrule DualEncoder & 90.1 & 63.8 & 78.4 & 94.9 & 48.5 & 52.7 & 32.0 & 18.7 & 34.3 & 72.0 \\ MV-LSTM & 90.6 & 65.3 & 80.4 & 94.6 & 49.8 & 53.8 & 34.8 & 20.2 & 35.1 & 71.6 \\ Match-LSTM & 90.4 & 65.3 & 80.4 & 94.6 & 49.8 & 53.8 & 34.8 & 20.2 & 34.8 & 71.0 \\ DL2R & 89.9 & 62.6 & 78.3 & 94.4 & 48.8 & 52.7 & 33.0 & 19.3 & 34.2 & 70.5 \\ Multi-View & 90.8 & 66.2 & 80.1 & 95.1 & 50.5 & 54.3 & 34.2 & 20.2 & 35.0 & 72.9\\ SMN & 92.6 & 72.6 & 84.7 & 96.1 & 52.9 & 56.9 & 39.7 & 23.3 & 39.6 & 72.4 \\ \midrule RNN-CNN & 91.1 & 67.2 & 80.9 & 95.6 & - & - & - & - & - & - \\ DUA & - & 75.2 & 86.8 & 96.2 & \emph{55.1} & 59.9 & 42.1 & 24.3 & \emph{42.1} & \emph {78.0} \\ DAM & \emph{93.8} & \emph{76.7} & \emph{87.4} & \emph{96.9} & 55.0 & \emph{60.1} & \emph{42.7} & \emph{25.4} & 41.0 & 75.7 \\ \midrule \midrule TripleNet &\bf 94.3 &\bf 79.0 &\bf 88.5 &\bf 97.0 &\bf 56.4 &\bf 61.8 &\bf 44.7 &\bf 26.8 &\bf 42.6 & 77.8 \\ TripleNet$_{elmo}$ & 95.1 & 80.5 & 89.7 & 97.6 & 60.9 & 65.0 & 47.0 & 27.8 & 48.7 & 81.4 \\ TripleNet$_{ensemble}$ & 95.6 & 82.1 & 90.9 & 98.0 & 63.2 & 67.8 & 51.5 & 31.3 & 49.4 & 83.2 \\ \bottomrule \end{tabular} \end{center} \caption{\label{result-chat} Experimental results on two public dialogue datasets. The table is segmented into three sections: Non-Attention models, Attention-based models and our models. The italics denotes the previous best results, and the scores in bold express the new state-of-the-art result of single model without any pre-training layer.} \end{table*} \subsection{Dataset} We first evaluate our model on Ubuntu Dialogue Corpus \cite {Lowe-2015-The} because it is the largest public multi-turn dialogue corpus which consists of about one million conversations in the specific domain. To reduce the number of unknown words, we use the shared copy of the Ubuntu corpus by \citet{Xu-2017-Incorporating} which replaces the numbers, paths, and URLs by specific symbols.\footnote {\url{https://www.dropbox.com/s/ 2fdn26rj6h9bpvl/ubuntudata.zip}} Furthermore, to verify the generalization of our model, we also carry out experiments on Douban Conversation Corpus \cite {Wu-2017-Sequential}, which shares similar format with the Ubuntu corpus but is open-domain and in the Chinese language. For the Ubuntu corpus, we use the recall at position k in $n$ candidate responses ($R_n@k$) as evaluation metrics, and we use MAP (Mean Average Precision), MRR (Mean Reciprocal Rank), and Precision-at-one as the additional metrics for Douban corpus, following the previous work \cite {Wu-2017-Sequential}. \subsection{Experiment Setup} We implement our model by Keras \cite {chollet-2015-keras} with TensorFlow backend. In the Embedding Layer, the word embeddings are pre-trained using the training set via GloVe \cite{pennington-etal-2014}, the weights of which are trainable. For char embedding, we set the kernel shape as 3 and filter number as 200 in the CNN layer. For all the Bi-directional LSTM layers, we set their hidden size to 200. We use Adamax \cite{kingma-2014-adam} for weight updating with an initial learning rate of 0.002. For ensemble models, we generate 6 models for each corpus using different random seeds and merge the result by voting. For better comparison with the baseline models, the main super parameters in TripleNet, such as the embedding size, max length of each turn, and the vocabularies, are the same as those of the baseline models. The maximum number of conversation turns, which changes with the models, is 12 in our model, 9 in DAM \cite {Wu-2017-Sequential}, and 10 in SMN \cite {Wu-2017-Sequential}. \subsection{Baseline Models} We basically divided baseline models into two categories for comparisons. \\ \textbf {Non-Attention Models.} The majority of the previous works on this task are designed without attention mechanisms, including the Sequential Matching Network (SMN) \cite {Wu-2017-Sequential}, Multi-View model \cite{Zhou-2016-Multi}, Deep Learning to Respond (DL2R) \cite{Yan-2016-Learning}, Match-LSTM \cite {wang-2016-learning}, MV-LSTM \cite {wan-2016-match}, and DualEncoder \cite {Lowe-2015-The}. \\ \textbf {Attention-based Models.} The attention-based models typically match the context and the candidate response based on the attention among them, including DAM \cite {zhou-2018-multi}, DUA \cite {zhang-2018-modeling}, and RNN-CNN \cite {Baudi-2016-Sentence}. \subsection{Overall Results} The overall results on two datasets are depicted in Table \ref {result-chat}. Our results are obviously better on the two datasets compared with recently attention-based model DAM, which exceeds 2.3\% in $R_{10}$@1 of Ubuntu and 2.6\% in $P@1$ of Douban. Furthermore, our score is significantly exceeding in almost all metrics except the $R_{10}$@5 in Douban when compared with DUA, which may be because the metric is not very stable as the test set in Douban is very small (1000). To further improve the performance, we utilize pre-trained ELMo \cite{peters-elmo-2018} and fine-tune it on the training set in the Ubuntu condition while we train ELMo from scratch using the Douban training set. As the baseline of Douban corpus is relatively lower, we observe much bigger improvements in the corpus using ELMo. The model ensemble has further improvements based on the single model with ELMo; the score of $R_{10}$@1 in Ubuntu is close to the average performance of human experts at 83.8 \cite{lowe-2016-evaluation}. Compared to non-attention models such as the SMN and Multi-view, which match the context and response at two levels, TripleNet shows substantial improvements. On $R_{10}$@1 for Ubuntu corpus, there is a 6.3\% absolute improvement from SMN and 12.8\% from Multi-view, showing the effectiveness of triple attention. \begin{figure*}[htbp] \centering \subfigure{ \begin{minipage}[c]{0.31\linewidth} \includegraphics[width=1\linewidth]{./figure/query_context_att1.pdf} \end{minipage}} \subfigure{ \begin{minipage}[c]{0.31 \linewidth} \includegraphics[width=1\linewidth]{./figure/query_response_att1.pdf} \end{minipage}} \subfigure{ \begin{minipage}[c]{0.31\linewidth} \includegraphics[width=1\linewidth]{./figure/response_context_att1.pdf} \end{minipage}} \caption{\label{bottom-up-att} The attention visualization among the query, context, and response in word-level. } \end{figure*} \subsection{Model Ablation} To better demonstrate the effectiveness of TripleNet, we conduct the ablations on the model under the Ubuntu corpus for its larger data size. We first remove the triple attention and matching parts (-TAM); the result shows a marked decline (2.4\% in $R_{10}$@1), which is in the second part of Table \ref{result-ablation}. The performance of the model is similar to the baseline model DAM. This indicates that our four-level hierarchical representation may play a similar role to the five stacks Transformer in DAM. We then remove the triple attention part, which means we match the pairs $\left\langle{C, R} \right\rangle$ and $\left\langle{Q, R} \right\rangle$ with their original representation in each level; the score of $R_{10}$@1 drops 1.4\%, which shows the effect of triple attention. We also have tried to remove all the parts related to the query (-Query). That means the attention and matching parts are only calculated within the pair $\left\langle{C, R} \right\rangle$. It is worth mentioning that the information of the query is still contained at the end of the context. The performance also has a marked drop (1.6\% in $R_{10}$@1), which shows that it is necessary to model the query separately. To find out which subsection in those parts is more important, we remove each one of them. {\noindent \textbf {Triple attention matching ablation.} } As we can see in the third part of Table \ref{result-ablation}, when attention between context and response is removed (-A$_{CR}$), the largest decrease (0.6\% in $R_{10}$@1) appears, which indicates that the relationship between context and response is most important in the triple. The attentions in the other two pairs $\left\langle{C, Q} \right\rangle$ and $\left\langle{Q, R} \right\rangle$ all lead to a slight performance drop (0.3 and 0.5 in $R_{10}$@1), which may be because they overlap with each other for updating the representation of the triple. When we remove the matching between context and response, we find that the performance of the model has a marked drop (2.1 in $R_{10}$@1), which shows that the relationship within $\left\langle{C, R} \right\rangle$ is the base for selecting the response. The query and response matching part also leads to a significant decline. This shows that we should pay more attention to query within the whole context. \begin {table} [tp] \begin {center}\small \begin {tabular} {l cccc} \toprule & R${_2}$@1& R$_{10}$@1& R$_{10}$@2 & R$_{10}$@5 \\ \midrule TripleNet & 94.3 & 79.0 & 88.5 & 97.0\\ \midrule ~ -TAM & 93.5 & 76.6 & 86.8 & 96.6 \\ ~ -A$_{tri}$ & 93.8 & 77.6 & 87.6 & 96.9 \\ ~ -Query & 93.8 & 77.4 & 87.3 & 96.6 \\ \midrule ~ -A$_{CR}$ & 94.1 & 78.4 & 87.9 & 97.0 \\ ~ -A$_{QR}$ & 94.1 & 78.5 & 88.1 & 97.0 \\ ~ -A$_{CQ}$ & 94.3 & 78.7 & 88.3 & 97.0 \\ ~ -M$_{CR}$ & 93.7 & 76.9 & 87.0 & 96.7 \\ ~ -M$_{QR}$ & 94.4 & 78.5 & 88.1 & 97.1 \\ \midrule ~ -char & 94.1 & 78.3 & 88.0 & 97.1 \\ ~ -word & 94.3 & 78.5 & 88.2 & 97.0 \\ ~ -utterance & 94.1 & 78.6 & 88.1 & 97.1 \\ ~ -context & 94.0 & 78.4 & 88.0 & 97.0 \\ \bottomrule \end {tabular} \end {center} \caption {\label{result-ablation}Ablation studies on Ubuntu Dialogue Corpus. The letter `A' stands for the subsection in triple attention, and `M' the is triple matching part.} \end {table} {\noindent \textbf {Hierarchical representation ablation.} } To find out the calculation of which level is most important, we also tried to remove each level calculation from the hierarchical representation module, which can be seen in the fourth part of Table \ref{result-ablation}. To our surprise, when we remove char (-char) and context level calculation (-context), we observe that the reduction (0.5 in $R_{10}$@1) is more significant than the other two, indicating that we should pay more attention to the lowest and highest level information. Also by removing the other two levels, there is also a significant reduction from TripleNet, which means each level of the three is indispensable for our TripleNet . From the experiments in this part, we find that each subsection of the hierarchical representation module only leads to a slight performance drop. Maybe it's because the representation from each level represent the conversation from a unique and indispensable perspective, and the information conveyed by different representations may have some overlap. \section{Analysis and Discussion}\label{analysis} \subsection{Visualization} By decoding our model for the case in Figure \ref{case-ubuntu}, we find that our model TripleNet can choose the true response. To analyze in detail how triple attention works, we get the attention in word-level as the example and visualize it in Figure \ref{bottom-up-att}. As there are so many words in the context, we only use the second utterance in the upper part of Figure \ref{case-ubuntu} for its relatively rich semantics. In the query-context attention, the query mainly pays attention to the keyword `package.' This is helpful to get the topic of the conversation. While the attention of context focuses on the word `a' which is near the key phrase `deb file,' which may be because the representation of the word catches some information from the words nearby by Bi-LSTM. In the query-response attention, the result shows that the attention of the query mainly focuses on the word `format,' which is the most important word in the response. But we can also find that the response does not catch the important words in the query. In the response-context attention, the response pays more attention to the word `binary,' which is another important word in the context. From the three maps, we find that each attention can catch some important information but miss some useful information too. If we join the information in query-context and response-context attention, we can catch the most import information in the context. Furthermore, the query-response attention can help us catch the most important word in the response. So it is natural for TripleNet to select the right response because the model can integrate the three attentions together. \subsection {Discussion} \begin {figure} [t] \centering \includegraphics [width= 0.48\textwidth] {figure/Utterance-discuss.pdf} \caption{\label{result-query} The decrease of the performance when the $utterance_i$ is removed in Ubuntu Corpus.} \end {figure} In this section, we will discuss the importance of different utterances in the context. To find out the importance of different utterances in the context, we conduct an experiment by removing each one of them with the model (-Query) in the ablation experiment part because the model deals all the utterances include the query in the same way. For each experiment in this part, we remove the $i$th ($0<i<13$ and $Q=U_{12}$) utterance in the context both in training and evaluation processes and report the decrease of performance in Figure \ref {result-query}. We find that the removing of the query leads the most significant decline (more than 6\% in $R_{10}$@1), that indicates the query is much more important than any other utterances. Furthermore, the decrease is stable before the $9$th utterances and raises rapidly in the last 3 utterances. We can deduce that the last three utterances are more important than the other ones. From the whole result, we can conclude that it's better to model the query separately than deal all of the utterances in the same way for their significantly different importance; we also find that we should pay more attention to the utterances near the query because they are more important. \section{Conclusion}\label{conclusion} In this paper, we propose a model TripleNet for multi-turn response selection. We model the context from low (character) to high (context) level, update the representation by triple attention within $ \left\langle{C, Q, R} \right\rangle$, match the triple focused on response, and fuse the matching results with hierarchical LSTM for prediction. Experimental results show that the proposed model achieves state-of-the-art results on both Ubuntu and Douban corpus, which ranges from a specific domain to open domain, and English to Chinese language, demonstrating the effectiveness and generalization of our model. In the future, we will apply the proposed triple attention mechanism to other NLP tasks to further testify its extensibility. \section*{Acknowledgement}\label{Acknowledgement} We would like to thank all anonymous reviewers for their hard work on reviewing and providing valuable comments on our paper. We also would like to thank Yunyi Anderson for proofreading our paper thoroughly. This work is supported by National Key R\&D Program of China via grant 2018YFC0832100. \section{Introduction}\label{introduction} To establish a human-machine dialogue system is one of the most challenging tasks in Artificial Intelligence (AI). Existing works on building dialogue systems are mainly divided into two categories: retrieval-based method \cite{Yan-2016-Learning,Zhou-2016-Multi}, and generation-based method \cite{Vinyals-2015A}. The retrieval-based method retrieves multiple candidate responses from the massive repository and selects the best one as the system's response, while the generation-based method uses the encoder-decoder framework to generate the response, which is similar to machine translation. \begin{figure}[tp] \centering \small \begin{tabular}{m{7cm}} \toprule \textbf {A}: i downloaded angry ip scanner and now it doesn't work and \uline{i can't \textbf {uninstall} it }\\ \textbf {B}: you \uline{\textbf {installed}} it via package or via some \uwave{binary installer}\\ \textbf {A}: \uline{i \textbf {installed}} from ubuntu soft center\\ \textbf {B}: hm i do n't know what package it is but it should let you remove it the same way \\ \textbf {A}: ah makes sense then ... hm \uwave{was it a deb \textbf {file} }\\ \midrule \textbf {True Response}: i think \uwave{it was another \textbf {format}} mayge sth starting with r \\ \textbf {False Response}: thanks i appreciate it try \uline{sudo apt-get \textbf {install}} libxine-extracodecs \\ \bottomrule \end{tabular} \caption{\label{case-ubuntu} A real example in the Ubuntu Corpus. The upper part is the conversation between speaker A and B. The speaker A want to uninstall the ip scanner and the current query is about the format of the package, so the true response is about the format, but the existing conversation model can be easily misled by the high frequency term `install' as they deal with the query and other utterances in the same way.} \end{figure} In this paper, we are focusing on the retrieval-based method because it is more practical in applications. Selecting a response from a set of candidates is an important and challenging task for the retrieval-based method. Many of the previous approaches are based on Deep Neural Network (DNN) to select the response for single-turn conversation \cite{Lu-2013-A}. We study multi-turn response selection in this paper, which is rather difficult because it not only requires identification of the important information such as keywords, phrases, and sentences, but also the latent dependencies between the context, query, and candidate response. Previous works \cite{zhou-2018-multi,Wu-2017-Sequential} show that representing the context at different granularities is vital for multi-turn response selection. However, it is not enough for multi-turn response selection. Figure \ref{case-ubuntu} illustrates the problem with a real example in Ubuntu Corpus. As demonstrated, the following two points should be modeled to solve the problem: (1) the importance of current query should be highlighted, because it has great impact on the importance of different utterances in the context. For example, the query in the case is about the format of the file (`deb file'), which leads the last two utterances (including the query) are more important than the previous ones. If we only match the response with the context, the model may be misled by the high frequency word `install' and choose the false candidate. (2) the information of different granularities is important, which includes not only the word, utterance, and context level, but also the char level. For example, the different tenses (`install,' `installed') and the misspelling word (`angry') appear constantly in the conversation. Similar to the role of question for the task of machine reading comprehension \cite{seo-2016-bidirectional, cui-acl2017-aoa, chen-2019-convolutional}, the query in this task is also the key to selecting the response. In this paper, we propose a model named TripleNet to excavate the role of query. The main contributions of our work are listed as follows. \begin {itemize} \item we use a novel triple attention mechanism to model the relationships within $ \left\langle{C, Q, R} \right\rangle$ instead of $ \left\langle{C, R} \right\rangle$; \item we propose a hierarchical representation module to fully model the conversation from char to context level; \item The experimental results on Ubuntu and Douban corpus show that TripleNet significantly outperform the state-of-the-art result. \end {itemize} \section{Related Works}\label{related-works} Earlier works on building the conversation systems are generally based on rules or templates \cite {Walker-2001-Quantitative}, which are designed for the specific domain and need much human effort to collect the rules and domain knowledge. As the portability and coverage of such systems are far from satisfaction, people pay more attention to the data-driven approaches for the open-domain conversation system \cite{Ritter-2011-Data, Higashinaka-2014-Towards}. The main challenge for open-domain conversation is to produce a corresponding response based on the current context. As mentioned previously, the retrieval-based and generation-based methods are the mainstream approaches for conversational response generation. In this paper, we focus on the task response selection which belongs to retrieval-based approach. The early studies of response selection generally focus on the single-turn conversation, which use only the current query to select the response \cite{Lu-2013-A, Ji-2014-An,Li-2015-Syntax}. Since it is hard to get the topic and intention of the conversation by single-turn, researchers turn their attention to multi-turn conversation and model the context instead of the current query to predict the response. First, \citet{Lowe-2015-The} released the Ubuntu Dialogue dataset and proposed a neural model which matches the context and response with corresponding representations via RNNs and LSTMs. \citet{Kadlec-2015-Improved} evaluate the performances of various models on the dataset, such as LSTMs, Bi-LSTMs, and CNNs. Later, \citet{Yan-2016-Learning} concatenated utterances with the reformulated query and various features in a deep neural network. \citet{Baudi-2016-Sentence} regarded the task as sentence pair scoring and implemented an RNN-CNN neural network model with attention. \citet{Zhou-2016-Multi} proposed a multi-view model with CNN and RNN, modeling the context in both word and utterance view. Further, \citet{Xu-2017-Incorporating} proposed a deep neural network to incorporate background knowledge for conversation by LSTM with a specially designed recall gate. \citet{Wu-2017-Sequential} proposed matching the context and response by their word and phrase representations, which had significant improvement from previous work. \citet{zhang-2018-modeling} introduced a self-matching attention to route the vital information in each utterance, and used RNN to fuse the matching result. \citet{zhou-2018-multi} used self-attention and cross-attention to construct the representations at different granularities, achieving a state-of-the-art result. Our model is different from the previous methods: first we model the task with the triple $ \left\langle{C, Q, R} \right\rangle$ instead of $ \left\langle C, R \right\rangle$ in the early works, and use a novel triple attention matching mechanism to model the relationships within the triple. Then we represent the context from low (character) to high (context) level, which constructs the representations for the context more comprehensively. \begin {figure*} [t] \centering \includegraphics [width= 0.9\textwidth] {figure/TripleNet.pdf} \caption{\label{HAN-arch} The neural architecture of the model TripleNet. \emph{(best viewed in color)}} \end {figure*} \section{Model}\label{Model} In this section, we will give a detailed introduction of the proposed model TripleNet. We first formalize the problem of the response selection for multi-turn conversation. Then we briefly introduce the overall architecture of the proposed model. Finally, the details of each part of our model will be illustrated. \subsection{Task Definition} For the response selection, we define the task as given the context $C$, current query $Q$ and candidate response $R$, which is different from almost all the previous works \cite{zhou-2018-multi,Wu-2017-Sequential}. We aim to build a model function $g(C, Q, R)$ to predict the possibility of the candidate response to be the correct response. \begin {equation} score = g(C, Q, R) \end{equation} The information in context is composed of four levels: context, utterances, words and characters, which can be formulated as $C = (u_{1}, u_{2}, ... , u_{i}, ..., u_{n})$, where $u_i$ represents the $i$th utterance, and $n$ is the maximum utterance number. The last utterance in the context is query $Q=U_n$; we still use query as the end of context to maintain the integrity of the information in context. Each utterance can be formulated as $u_i = (w_1, ..., w_j, .., w_{m})$, where $w_j$ is the $j$th word in the utterance and $m$ is the maximum word number in the utterance. Each word can be represented by multiply characters $w_j = (ch_1, ..., ch_k, .., ch_{l})$, where $ch_k$ is the $k$th char and $l$ is the length of the word in char-level. The latter two levels are similar in the query and response. \subsection{Model Overview} The overall architecture of the model TripleNet is displayed in Figure \ref {HAN-arch}. The model has a bottom-up architecture that organizes the calculation from char to context level. In each level, we first uses the hierarchical representation module to construct the representations of context, response and query. Then the triple attention mechanism is applied to update the representations. At last, the model matches them while focused on the response and fuses the result for prediction. In the hierarchical representation module, we represent the conversation in four perspectives including char, word, utterance, and context. In the char-level, a convolutional neural network (CNN) is applied to the embedding matrix of each word and produces the embedding of the word by convolution and maxpooling operations as the char-level representation. In word-level, we use a shared LSTM layer to obtain the word-level embedding for each word. After that, we use self-attention to encode the representation of each utterance into a vector which is the utterance-level representation. At last, the utterance-level representation of each utterance is fed into another LSTM layer to further model the information among different utterances, forming the context-level representation. The structure of the triple attention mechanism can be seen in the right part of Figure \ref {HAN-arch}. We first design a bi-directional attention function (BAF) to calculate the attention between two sequences and output their new representations. To model the relationship of the triple $\left\langle{C, Q, R} \right\rangle$, we apply BAF to each pair within the triple and get two new representations for each one element, and then we add them together as its final attention-based representation. In the triple attention mechanism, we can update the representation of each one based on the attention result with the other two simultaneously, and each element participates in the whole calculation in the same way. \subsection{Hierarchical Representation} {\noindent{\bf Char-level Representation.}} At first, we embed the characters in each word into fixed size vectors and use a CNN followed by max-pooling to get character-derived embeddings for each word, which can be formulated by \begin {gather} ch_{j,t} = tanh(W_1^j * x_{t:t+s_j-1} + b_1^j) \\ ch_j = MaxPooling_{t=0}^L[ch_{j,t} ] \end {gather} where $W_1^j$, $b_1^j$ are parameters, $x_{t:t+s_j-1}$ refers to the concatenation of the embedding of ($x_t$,...,$x_{t+s_j-1}$), $s_j$ is the window size of $j$th filter, and the $ch$ is the representation of the word in char-level. {\noindent{\bf Word-level Representation.}} Furthermore, we embed word $x$ by pre-trained word vectors, and we also introduce a word matching (MF) feature to the embedding to make the model more sensitive to concurrent words. If the word appears in the response and context or query simultaneously, we set the feature to 1, otherwise to 0. \begin {gather} e(x) = [W_{e} \cdot x; ch(x); MF] \end {gather} where $e(x)$ to denotes the embedding representation, $W_{e}$ is the pre-trained word embedding, and $ch(x)$ is the character embedding function. We use a shared bi-directional LSTM to get contextual word representations in each utterance, query, and the response. The representation of each word is formed by concatenating the forward and backward LSTM hidden output. \begin {gather} \overleftarrow {h(x)} = \overleftarrow{\text{LSTM}}(e(x)) \\ {\overrightarrow{h(x)}} = \overrightarrow{\text{LSTM}}(e(x)) \\ h(x) = [\overleftarrow {h(x)};\overrightarrow {h(x)} ] \end {gather} where $h(x)$ is the representation of the word. We denote the word-level representation of the context as $h_{u} \in \mathbb{R} ^ { m * d_w} $ and the response as $h_{r} \in \mathbb{R} ^ {m * d_w} $, where $d_w$ is the dimension of Bi-LSTMs. Until now, we have constructed the representations of context, query, and response in char and word level, and we only represent the latter two in these two levels because they don't have such rich contextual information as the context. {\noindent{\bf Utterance-level Representation.}} Given the $k_{th}$ utterance ${u_k} = [h^i_{u_k}]^m_{i=1}$, we construct the utterance-level representation by self-attention \cite{lin-2017-structured}: \begin {gather} \alpha_i^k = softmax(W_{3} tanh(W_{2}h_{u_k}(i)^T)) \\ u_{k} = \sum\nolimits_{i=1}^m h^i_{u_k} \alpha_i^k \end {gather} where $W_2 \in \mathbb{R}^{d * d_w}$, $W_3 \in \mathbb{R}^{d}$ are trainable weights, $d$ is a hyperparameter, $u_{k}$ is the utterance-level representation, and $\alpha_i^k$ is the attention weight for the $i$th word in the $k$th utterance, which signifies the importance of the word in the utterance. {\noindent{\bf Context-level Representation.}} To further model the continuity and contextual information among the utterances, we fed the utterance-level representations into another bi-directional LSTM layer to obtain the representation for each utterance in context perspective. \begin {gather} c_{k} = \text{Bi-LSTM}([u_{k}]_{k=1}^n) \end {gather} where $c_{k} \in \mathbb{R}^{d_c}$ is the context-level representation for the $k$th utterance in the context and $d_c$ is the output size of the Bi-LSTM. \subsection{Triple Attention} In this part, we update the representations of context, query, and response in each level by triple attention, the motivation of which is to model the latent relationships within $ \left\langle{context, query, response} \right\rangle$ . Given the triple $ \left\langle{C, Q, R} \right\rangle$ , we fed each of its pairs into bi-directional attention function (BAF). \begin {gather} C_1, Q_1 = BAF(C, Q) \\ C_2, R_1 = BAF(C, Q) \\ Q_2, R_2 = BAF(C, R) \\ C' = BN(C_1 + C_2) \\ Q' = BN(Q_1+Q_2) \\ R' = BN(R_1+R_2) \end {gather} where $BN$ denotes the batch normalization layer \cite{ioffe-2015-batch} which is conducive to preventing vanishing or exploding of gradients. $BAF$ produces the new representations for two sequences (P, Q) by the attention from two directions, which is inspired by \citet{seo-2016-bidirectional}. We can formulate it by \begin {gather} M_{pq} = P^T tanh(W_3 Q) \\ Att_{pq} = softmax( M_{pq}) \\ Att_{qp} = softmax( M_{pq}^T) \\ P' = P - \tilde{Q}; ~~ \tilde{Q} = Q Att_{pq}; \\ Q' = Q - \tilde{P}; ~~ \tilde{P} = P Att_{qp}; \end {gather} where $Att_{pq}$, $Att_{qp}$ are the attention between $P$ and $Q$ in two directions, $P'$, $Q'$ are the new representations the two sequences (P, Q), and we apply a batch normalization layer upon them too. We find that the triple attention has some interesting features: (1) triple, the representation for each element in the triple $\left\langle{C, Q, R} \right\rangle$ is updated based on the attention to the other two concurrently; (2) symmetrical, which means each element in the triple plays the same role in the structure because their contents are similar in the whole conversation; (3) unchanged dimension, all the outputs of triple attention has the same dimensions as the inputs, so we can stack multiple layers as needed. \subsection{Triple Matching and Prediction} {\noindent{\bf Triple Matching.}} We match the triple $\left\langle{C,Q,R} \right\rangle$ in each level with the cosine distance using new representations produced by triple attention. This process focuses on the response because it is our target. For example, in the char-level, we match the triple by \begin {gather} \tilde M_{rc}^1 (i, k, j) = cosine(ch_{r}'(i), ch_{u_k}'(j)) \\ M_{rc}^1(i, k) = \max \limits_{0<j<m} \tilde M_1(i, j, k) \\ M_{rq}^1 (i, j) = cosine(ch_{r}'(i), ch_{q}'(j)) \\ M_1 = [M_{rc}^1(i, k);M_{rq}^1 (i, j)] \end {gather} where $ch'$ is the representation updated by triple attention, $M_1 \in \mathbb{R}^{m * (n+m)}$ is the char-level matching result, the word-level matches the triple in the same way, and the utterance and the context level match the triple without the maxpooling operation. We use $M_2$, $M_3$, $M_4$ as the matching results in the word, utterance and context levels. {\noindent{\bf Fusion.}} After obtaining the four-level matching matrix, we use hierarchical RNN to get highly abstract features. Firstly, we concatenate the four matrices to form a 3D cube $M \in \mathbb{R}^{m*(n+m)*4}$ and we use $m$ as one of the matrix in $M$, which denotes the matching result for one word in response in four levels. \begin {gather} M = [M_1;M_2;M_3;M_4] \\ \tilde{m} = MaxPooling_{i=0}^{n+m}[\text{Bi-LSTM}(m_i)]\\ v = MaxPooling_{j=0}^m[\text{Bi-LSTM}{(\tilde{m}_j})] \end {gather} Where $m_i$ and $\tilde{m}_j$ are the $i$th, $j$th row in the matrix $m$ and $\tilde{m}$. We merge the results from different time steps in the outputs of LSTM by max-pooling operation. Until now, we encode the matching result into a single feature vector $v$. {\noindent{\bf Final Prediction.}} For the final prediction, we fed the vector $V$ into a full-connected layer with sigmoid output activation. \begin {equation} g(C, Q, R) = sigmoid(W_4 \cdot v+b_4) \\ \end {equation} where $W_4, b_4$ are trainable weights. Our purpose is to predict the matching score between the context, query and candidate response, which can be seen as a binary classification task. To train our model, we minimize the cross entropy loss between the prediction and ground truth. \section{Experiments}\label{experiments} \begin{table*}[t!] \begin{center}\small \begin{tabular}{l cccc | cccccc} \toprule & \multicolumn{4}{c}{\bf {Ubuntu Dialogue Corpus}} & \multicolumn{6}{c}{\bf {Douban Conversation Corpus} } \\ & R${_2}$@1& R$_{10}$@1& R$_{10}$@2 & R$_{10}$@5 & MAP & MRR & P@1 & R$_{10}$@1 & R$_{10}$@2 &R$_{10}$@5 \\ \midrule DualEncoder & 90.1 & 63.8 & 78.4 & 94.9 & 48.5 & 52.7 & 32.0 & 18.7 & 34.3 & 72.0 \\ MV-LSTM & 90.6 & 65.3 & 80.4 & 94.6 & 49.8 & 53.8 & 34.8 & 20.2 & 35.1 & 71.6 \\ Match-LSTM & 90.4 & 65.3 & 80.4 & 94.6 & 49.8 & 53.8 & 34.8 & 20.2 & 34.8 & 71.0 \\ DL2R & 89.9 & 62.6 & 78.3 & 94.4 & 48.8 & 52.7 & 33.0 & 19.3 & 34.2 & 70.5 \\ Multi-View & 90.8 & 66.2 & 80.1 & 95.1 & 50.5 & 54.3 & 34.2 & 20.2 & 35.0 & 72.9\\ SMN & 92.6 & 72.6 & 84.7 & 96.1 & 52.9 & 56.9 & 39.7 & 23.3 & 39.6 & 72.4 \\ \midrule RNN-CNN & 91.1 & 67.2 & 80.9 & 95.6 & - & - & - & - & - & - \\ DUA & - & 75.2 & 86.8 & 96.2 & \emph{55.1} & 59.9 & 42.1 & 24.3 & \emph{42.1} & \emph {78.0} \\ DAM & \emph{93.8} & \emph{76.7} & \emph{87.4} & \emph{96.9} & 55.0 & \emph{60.1} & \emph{42.7} & \emph{25.4} & 41.0 & 75.7 \\ \midrule \midrule TripleNet &\bf 94.3 &\bf 79.0 &\bf 88.5 &\bf 97.0 &\bf 56.4 &\bf 61.8 &\bf 44.7 &\bf 26.8 &\bf 42.6 & 77.8 \\ TripleNet$_{elmo}$ & 95.1 & 80.5 & 89.7 & 97.6 & 60.9 & 65.0 & 47.0 & 27.8 & 48.7 & 81.4 \\ TripleNet$_{ensemble}$ & 95.6 & 82.1 & 90.9 & 98.0 & 63.2 & 67.8 & 51.5 & 31.3 & 49.4 & 83.2 \\ \bottomrule \end{tabular} \end{center} \caption{\label{result-chat} Experimental results on two public dialogue datasets. The table is segmented into three sections: Non-Attention models, Attention-based models and our models. The italics denotes the previous best results, and the scores in bold express the new state-of-the-art result of single model without any pre-training layer.} \end{table*} \subsection{Dataset} We first evaluate our model on Ubuntu Dialogue Corpus \cite {Lowe-2015-The} because it is the largest public multi-turn dialogue corpus which consists of about one million conversations in the specific domain. To reduce the number of unknown words, we use the shared copy of the Ubuntu corpus by \citet{Xu-2017-Incorporating} which replaces the numbers, paths, and URLs by specific symbols.\footnote {\url{https://www.dropbox.com/s/ 2fdn26rj6h9bpvl/ubuntudata.zip}} Furthermore, to verify the generalization of our model, we also carry out experiments on Douban Conversation Corpus \cite {Wu-2017-Sequential}, which shares similar format with the Ubuntu corpus but is open-domain and in the Chinese language. For the Ubuntu corpus, we use the recall at position k in $n$ candidate responses ($R_n@k$) as evaluation metrics, and we use MAP (Mean Average Precision), MRR (Mean Reciprocal Rank), and Precision-at-one as the additional metrics for Douban corpus, following the previous work \cite {Wu-2017-Sequential}. \subsection{Experiment Setup} We implement our model by Keras \cite {chollet-2015-keras} with TensorFlow backend. In the Embedding Layer, the word embeddings are pre-trained using the training set via GloVe \cite{pennington-etal-2014}, the weights of which are trainable. For char embedding, we set the kernel shape as 3 and filter number as 200 in the CNN layer. For all the Bi-directional LSTM layers, we set their hidden size to 200. We use Adamax \cite{kingma-2014-adam} for weight updating with an initial learning rate of 0.002. For ensemble models, we generate 6 models for each corpus using different random seeds and merge the result by voting. For better comparison with the baseline models, the main super parameters in TripleNet, such as the embedding size, max length of each turn, and the vocabularies, are the same as those of the baseline models. The maximum number of conversation turns, which changes with the models, is 12 in our model, 9 in DAM \cite {Wu-2017-Sequential}, and 10 in SMN \cite {Wu-2017-Sequential}. \subsection{Baseline Models} We basically divided baseline models into two categories for comparisons. \\ \textbf {Non-Attention Models.} The majority of the previous works on this task are designed without attention mechanisms, including the Sequential Matching Network (SMN) \cite {Wu-2017-Sequential}, Multi-View model \cite{Zhou-2016-Multi}, Deep Learning to Respond (DL2R) \cite{Yan-2016-Learning}, Match-LSTM \cite {wang-2016-learning}, MV-LSTM \cite {wan-2016-match}, and DualEncoder \cite {Lowe-2015-The}. \\ \textbf {Attention-based Models.} The attention-based models typically match the context and the candidate response based on the attention among them, including DAM \cite {zhou-2018-multi}, DUA \cite {zhang-2018-modeling}, and RNN-CNN \cite {Baudi-2016-Sentence}. \subsection{Overall Results} The overall results on two datasets are depicted in Table \ref {result-chat}. Our results are obviously better on the two datasets compared with recently attention-based model DAM, which exceeds 2.3\% in $R_{10}$@1 of Ubuntu and 2.6\% in $P@1$ of Douban. Furthermore, our score is significantly exceeding in almost all metrics except the $R_{10}$@5 in Douban when compared with DUA, which may be because the metric is not very stable as the test set in Douban is very small (1000). To further improve the performance, we utilize pre-trained ELMo \cite{peters-elmo-2018} and fine-tune it on the training set in the Ubuntu condition while we train ELMo from scratch using the Douban training set. As the baseline of Douban corpus is relatively lower, we observe much bigger improvements in the corpus using ELMo. The model ensemble has further improvements based on the single model with ELMo; the score of $R_{10}$@1 in Ubuntu is close to the average performance of human experts at 83.8 \cite{lowe-2016-evaluation}. Compared to non-attention models such as the SMN and Multi-view, which match the context and response at two levels, TripleNet shows substantial improvements. On $R_{10}$@1 for Ubuntu corpus, there is a 6.3\% absolute improvement from SMN and 12.8\% from Multi-view, showing the effectiveness of triple attention. \begin{figure*}[htbp] \centering \subfigure{ \begin{minipage}[c]{0.31\linewidth} \includegraphics[width=1\linewidth]{./figure/query_context_att1.pdf} \end{minipage}} \subfigure{ \begin{minipage}[c]{0.31 \linewidth} \includegraphics[width=1\linewidth]{./figure/query_response_att1.pdf} \end{minipage}} \subfigure{ \begin{minipage}[c]{0.31\linewidth} \includegraphics[width=1\linewidth]{./figure/response_context_att1.pdf} \end{minipage}} \caption{\label{bottom-up-att} The attention visualization among the query, context, and response in word-level. } \end{figure*} \subsection{Model Ablation} To better demonstrate the effectiveness of TripleNet, we conduct the ablations on the model under the Ubuntu corpus for its larger data size. We first remove the triple attention and matching parts (-TAM); the result shows a marked decline (2.4\% in $R_{10}$@1), which is in the second part of Table \ref{result-ablation}. The performance of the model is similar to the baseline model DAM. This indicates that our four-level hierarchical representation may play a similar role to the five stacks Transformer in DAM. We then remove the triple attention part, which means we match the pairs $\left\langle{C, R} \right\rangle$ and $\left\langle{Q, R} \right\rangle$ with their original representation in each level; the score of $R_{10}$@1 drops 1.4\%, which shows the effect of triple attention. We also have tried to remove all the parts related to the query (-Query). That means the attention and matching parts are only calculated within the pair $\left\langle{C, R} \right\rangle$. It is worth mentioning that the information of the query is still contained at the end of the context. The performance also has a marked drop (1.6\% in $R_{10}$@1), which shows that it is necessary to model the query separately. To find out which subsection in those parts is more important, we remove each one of them. {\noindent \textbf {Triple attention matching ablation.} } As we can see in the third part of Table \ref{result-ablation}, when attention between context and response is removed (-A$_{CR}$), the largest decrease (0.6\% in $R_{10}$@1) appears, which indicates that the relationship between context and response is most important in the triple. The attentions in the other two pairs $\left\langle{C, Q} \right\rangle$ and $\left\langle{Q, R} \right\rangle$ all lead to a slight performance drop (0.3 and 0.5 in $R_{10}$@1), which may be because they overlap with each other for updating the representation of the triple. When we remove the matching between context and response, we find that the performance of the model has a marked drop (2.1 in $R_{10}$@1), which shows that the relationship within $\left\langle{C, R} \right\rangle$ is the base for selecting the response. The query and response matching part also leads to a significant decline. This shows that we should pay more attention to query within the whole context. \begin {table} [tp] \begin {center}\small \begin {tabular} {l cccc} \toprule & R${_2}$@1& R$_{10}$@1& R$_{10}$@2 & R$_{10}$@5 \\ \midrule TripleNet & 94.3 & 79.0 & 88.5 & 97.0\\ \midrule ~ -TAM & 93.5 & 76.6 & 86.8 & 96.6 \\ ~ -A$_{tri}$ & 93.8 & 77.6 & 87.6 & 96.9 \\ ~ -Query & 93.8 & 77.4 & 87.3 & 96.6 \\ \midrule ~ -A$_{CR}$ & 94.1 & 78.4 & 87.9 & 97.0 \\ ~ -A$_{QR}$ & 94.1 & 78.5 & 88.1 & 97.0 \\ ~ -A$_{CQ}$ & 94.3 & 78.7 & 88.3 & 97.0 \\ ~ -M$_{CR}$ & 93.7 & 76.9 & 87.0 & 96.7 \\ ~ -M$_{QR}$ & 94.4 & 78.5 & 88.1 & 97.1 \\ \midrule ~ -char & 94.1 & 78.3 & 88.0 & 97.1 \\ ~ -word & 94.3 & 78.5 & 88.2 & 97.0 \\ ~ -utterance & 94.1 & 78.6 & 88.1 & 97.1 \\ ~ -context & 94.0 & 78.4 & 88.0 & 97.0 \\ \bottomrule \end {tabular} \end {center} \caption {\label{result-ablation}Ablation studies on Ubuntu Dialogue Corpus. The letter `A' stands for the subsection in triple attention, and `M' the is triple matching part.} \end {table} {\noindent \textbf {Hierarchical representation ablation.} } To find out the calculation of which level is most important, we also tried to remove each level calculation from the hierarchical representation module, which can be seen in the fourth part of Table \ref{result-ablation}. To our surprise, when we remove char (-char) and context level calculation (-context), we observe that the reduction (0.5 in $R_{10}$@1) is more significant than the other two, indicating that we should pay more attention to the lowest and highest level information. Also by removing the other two levels, there is also a significant reduction from TripleNet, which means each level of the three is indispensable for our TripleNet . From the experiments in this part, we find that each subsection of the hierarchical representation module only leads to a slight performance drop. Maybe it's because the representation from each level represent the conversation from a unique and indispensable perspective, and the information conveyed by different representations may have some overlap. \section{Analysis and Discussion}\label{analysis} \subsection{Visualization} By decoding our model for the case in Figure \ref{case-ubuntu}, we find that our model TripleNet can choose the true response. To analyze in detail how triple attention works, we get the attention in word-level as the example and visualize it in Figure \ref{bottom-up-att}. As there are so many words in the context, we only use the second utterance in the upper part of Figure \ref{case-ubuntu} for its relatively rich semantics. In the query-context attention, the query mainly pays attention to the keyword `package.' This is helpful to get the topic of the conversation. While the attention of context focuses on the word `a' which is near the key phrase `deb file,' which may be because the representation of the word catches some information from the words nearby by Bi-LSTM. In the query-response attention, the result shows that the attention of the query mainly focuses on the word `format,' which is the most important word in the response. But we can also find that the response does not catch the important words in the query. In the response-context attention, the response pays more attention to the word `binary,' which is another important word in the context. From the three maps, we find that each attention can catch some important information but miss some useful information too. If we join the information in query-context and response-context attention, we can catch the most import information in the context. Furthermore, the query-response attention can help us catch the most important word in the response. So it is natural for TripleNet to select the right response because the model can integrate the three attentions together. \subsection {Discussion} \begin {figure} [t] \centering \includegraphics [width= 0.48\textwidth] {figure/Utterance-discuss.pdf} \caption{\label{result-query} The decrease of the performance when the $utterance_i$ is removed in Ubuntu Corpus.} \end {figure} In this section, we will discuss the importance of different utterances in the context. To find out the importance of different utterances in the context, we conduct an experiment by removing each one of them with the model (-Query) in the ablation experiment part because the model deals all the utterances include the query in the same way. For each experiment in this part, we remove the $i$th ($0<i<13$ and $Q=U_{12}$) utterance in the context both in training and evaluation processes and report the decrease of performance in Figure \ref {result-query}. We find that the removing of the query leads the most significant decline (more than 6\% in $R_{10}$@1), that indicates the query is much more important than any other utterances. Furthermore, the decrease is stable before the $9$th utterances and raises rapidly in the last 3 utterances. We can deduce that the last three utterances are more important than the other ones. From the whole result, we can conclude that it's better to model the query separately than deal all of the utterances in the same way for their significantly different importance; we also find that we should pay more attention to the utterances near the query because they are more important. \section{Conclusion}\label{conclusion} In this paper, we propose a model TripleNet for multi-turn response selection. We model the context from low (character) to high (context) level, update the representation by triple attention within $ \left\langle{C, Q, R} \right\rangle$, match the triple focused on response, and fuse the matching results with hierarchical LSTM for prediction. Experimental results show that the proposed model achieves state-of-the-art results on both Ubuntu and Douban corpus, which ranges from a specific domain to open domain, and English to Chinese language, demonstrating the effectiveness and generalization of our model. In the future, we will apply the proposed triple attention mechanism to other NLP tasks to further testify its extensibility. \section*{Acknowledgement}\label{Acknowledgement} We would like to thank all anonymous reviewers for their hard work on reviewing and providing valuable comments on our paper. We also would like to thank Yunyi Anderson for proofreading our paper thoroughly. This work is supported by National Key R\&D Program of China via grant 2018YFC0832100.
\section{Introduction and motivation}\label{sec:Intro} \subsection{The standard approaches}\label{sec:Intro1} Discussions on signature changing spacetimes were arguably ignited by Hartle and Hawking's no-boundary proposal for the initial conditions of the universe \citep{1983PhRvD..28.2960H,1984NuPhB.239..257H}. The study of the semi-classical approximations \citep{1990PhRvD..42.2458G} to the wave function of the universe, especially the dominating real tunnelling solutions (a real Riemannian spacetime joined onto a real Lorentzian one, with the Riemannian part determining the weighting in the path integral) \citep{1983PhRvD..27.2848V,1990PhRvD..42.2458G}, had garnered some interest. While studying the tunnelling solutions, it immediately became clear that it is impossible to transition a solution of the Einstein's equations into the Riemannian signature in an uneventful manner, because even a continuous metric will necessarily become either degenerate or divergent. In other words, General Relativity (GR), without any relaxations, is not intrinsically capable of dealing with signature changes (the transition surface is at best a mild singularity). However, if one is only interested in semi-classical approximations to quantum wave functions, the classical Einstein's equations only need to be ``almost'' satisfied, in the sense that some pathologies on the transition surface is allowed so long as they do not spoil the steepest descent considerations by making a divergent contribution to the action \citep{1990PhRvD..42.2458G}. Furthermore, even if we throw away such leniency afforded by quantum mechanics, and consider, as in Refs.~\cite{1992CQGra...9.1535E,1992GReGr..24.1047E}, purely classical set-ups, arguments can be made that suitably weaker versions of GR equations are not outrageous, since after all, there are many situations which the standard GR formalism cannot handle, such as when it comes to singularities inside black holes or impulsive gravitational waves, that do not appear to be prohibited by nature. Broadly speaking, depending on the functional space from which one draws solutions to the Einstein's equations that are formally ill-defined (not just singular in a differential equation sense like when some higher derivative terms vanish; some quantities appearing in the equations may become divergent and thus not defined) at a change-of-signature boundary, two types of junction conditions have been proposed in literature (both for when a purely spatial Riemannian side is reached via the temporal eigenvalue of the metric switching sign): \begin{itemize} \item *1: A more flexible one (e.g., Refs.~\cite{1990PhRvD..42.2458G,1991GReGr..23..967D,1992CQGra...9.1535E,1992GReGr..24.1047E,1993PhRvD..48.2587D,1996JMP....37.5627D}) allowing for discontinuous metrics with a continuous but not necessarily vanishing extrinsic curvature of the signature change surface $\Pi$, suitable for distributional solutions. The Einstein's equations themselves remain ill-defined at $\Pi$, so by ``the distribution is a solution'', those authors mean that it satisfies the equation at any point away from that surface, while the equation is suspended on $\Pi$. \item *2: Or a more restrictive one (e.g., Refs.~\cite{1992CQGra...9.1851H,1993gr.qc.....3034H,1993CQGra..10.2363K,1993CQGra..10.1157K,1994RSPSA.444..297K}) requiring the metric to be continuous and the extrinsic curvature to vanish when computed from both sides. This set of conditions is suitable for smoother solutions satisfying a regularized version of the Einstein's equations that are not suspended on $\Pi$. Specifically, those offending ill-defined quantities are in fact well-defined off of $\Pi$, so their limits can possibly be obtained through a process asymptoting to $\Pi$, and the broken expressions are then replaced by such limits (and strong junction conditions are required for these limits to exist). One must note that only the covariant form of the equations are regularized, and the inverse metric still diverges, so not everything is made regular in this approach. Since the extrinsic curvature is the time derivative of the spatial metric (its trace is essentially the rate at which spatial volume grows), its suppression is often said to imply stationarity. Indeed, similar analysis on other fields propagating on the signature changing background also analogously possess vanishing velocities. This is easy to see from a naive limit-taking analysis of a toy massless Klein-Gordon equation \begin{align} \label{eq:Toy} \varphi^{;a}{}_{;a} = \frac{1}{\sqrt{|g|}}\left(\sqrt{|g|}g^{ab} \varphi_{,b}\right)_{,a} =0\,, \end{align} where semi-colon denotes covariant derivative and comma denotes partial derivative. The early part of the Latin alphabet will denote spacetime indices, and the middle part the spatial ones. Let $g^{ab}$ be diagonalized in our choice of two dimensional (for illustration) coordinates $(t,x)$ into \begin{eqnarray} \begin{pmatrix} -\lambda_t(t,x) & 0 \\ 0 & \lambda_x(t,x) \end{pmatrix}\,, \end{eqnarray} then the equation becomes \begin{align} \label{eq:KGFull} &\frac{\lambda_x(\lambda_{t,x})}{\lambda_t}\varphi_{,x} + \lambda_{t,t}\varphi_{,t} + \lambda_t\left( 2 \varphi_{,tt}- \frac{\lambda_{x,t}}{\lambda_x}\varphi_{,t}\right)\notag \\ & - \lambda_{x,x}\varphi_{,x}-2\lambda_x\varphi_{,xx}=0\,. \end{align} When approaching the temporal signature change surface $\Pi$, we must have $\lambda_t \rightarrow \infty$ (since it is an entry in the inverse metric) and generically also $\lambda_{t,t} \rightarrow \infty$ at an even faster pace, resulting in the requirements of $\varphi_{,t}\rightarrow 0$ and $\varphi_{,tt} \rightarrow 0$ in order for the equation to admit a well-defined limit on $\Pi$. \end{itemize} There are essentially two steps involved in deriving these conditions. First is to evoke more or less the generic Darmois junction condition (denoted $\mathcal{C}_g$ below) that the surface metric implied (through pullbacks of the embedding maps) by either side must agree so there is a well-defined three-geometry for the boundary surface, and also that the extrinsic curvatures computed on either side must agree to avoid having to confine a stress-energy tensor onto the spacelike boundary (matter worldlines cannot be entirely confined to a spacelike surface) \citep{Darmois1927,Israel:1966rt,MTW}. Although these conditions are derived in the constant signature case, they essentially remain unchanged in the signature-changing situation (note that with *1, the jump is in the time-time component of the metric, while the spatial part remains continuous, so the implied intrinsic spatial geometries from the two sides still agree). The second type of requirements (denoted $\mathcal{C}_s$ below) is specific to the singular (with degenerate or discontinuous metric) signature-changing situation. With *2, $\mathcal{C}_s$ is the vanishing of the matching extrinsic curvatures, which allows a version of the Einstein's equations to be imposed on the transition surface, but is unsurprisingly quite rigid \cite{1994CQGra..11L..87H}. The *1 approach on the other hand aims for more flexibility by not imposing any $\mathcal{C}_s$ at all, arguing that the extra step of regularizing a singular equation is more a matter of choice than necessity \cite{2001GReGr..33.1041D}. The price it pays is a relaxation of the sense in which the resulting solutions are unique \cite{1992CQGra...9.1535E,1994CQGra..11L..87H}. The differences between the approaches reflect alternative philosophies, perhaps of how universally valid the standard form of the Einstein's equations should remain when its usual underlying assumptions are tempered with. \subsection{An alternative} \label{sec:Intro2} In this paper, we investigate an alternative mechanism by which a signature change can be achieved, following more closely the approach of *2, since we wish to see if the restrictions imposed by the regularization procedure, onto the initial conditions (for our Lorentzian universe) lied down on our transition surface $\Sigma$, can help explain some cosmological fine-tuning issues. So the equations of motion of metric and matter, for which the initial conditions are meant, must not be suspended on $\Sigma$. We begin by noting that while having the temporal metric eigenvalue ($1/\lambda_t$ in the notation of Eq.~\ref{eq:KGFull}, since $\lambda_t$ is an eigenvalue of the inverse metric) going through zero (we shall call this approach route A in this paper), either continuously or with a jump, is taken to be the default in previous literature, it is not the only way for the metric signature to change. Having it going through $\infty$ (equivalently $\lambda_t$ through zero) is also valid, since $\infty$ is just the antipodal end of the stereographic projection circle of the real line. However, with this approach (route A') in its raw form, the integration measure $\sqrt{-g}$ diverges on $\Sigma$, which has adverse side effects with quantum path integrals (the logic of steepest descent that makes our classical investigation useful in a quantum context may be spoiled \citep{1990PhRvD..42.2458G}). A related approach that removes this problem is to have $1/\lambda_x$ go through zero instead, so that the signature becomes Riemannian not because time changes sign, but because the spatial signature reverses. This alternative (route B) is related to route A' since the $1/\tilde{\lambda}_t = \lambda_x/\lambda_t$ of the conformally rescaled metric $\tilde{g}_{ab} = g_{ab} \lambda_x$ (that shares the same causal structure as $g_{ab}$, such as those depicted in the figures below) goes through $\infty$. I.e., when the physical metric transitions via route B, the conformal metric changes via route A'. \begin{figure}[t] \centering \begin{overpic}[width=0.89\columnwidth]{ConeStack.png} \end{overpic} \caption{As the base points $\mathcal{C}_3$, $\mathcal{C}_2$ and $\mathcal{C}_1$ incrementally approach the signature change surface $\Sigma$, their null cones flatten out (and return to rising more steeply once they are sufficiently far away from $\Sigma$).} \label{fig:ConeStack} \end{figure} This route B had not been examined in any of the previous literature that we found, and investigating it is the subject of this paper. Aside from filling in a gap in literature to achieve pedagogical thoroughness, we note that route B possesses some features that might help make it physically relevant: \begin{enumerate} \item As compared to route A, it is more straightforward to make connections with our actual universe when we adopt route B, because the Friedman-Lema\^{i}tre-Robertson-Walker (FLRW) metric \begin{align} \label{eq:ConfTrans} \quad \quad g_{ab}dx^adx^b =& a(t)^2\tilde{g}_{ab}dx^adx^b\notag \\ =& -dt^2 + a(t)^2 \hat{\gamma}_{ij}dx^i dx^j \notag \\ \equiv & -dt^2 + a(t)^2\left(d\chi^2 + \zeta^2_{\kappa}(\chi)d\Omega^2\right)\,, \end{align} whereby \begin{eqnarray} d\Omega^2 = d\theta^2 + \sin^2\theta d\phi^2 \,, \end{eqnarray} and \begin{eqnarray} \zeta_{\kappa} = \left\{ \begin{array}{ll} \sin\chi, & \text{for } \kappa =1\\ \chi, & \text{for } \kappa =0\\ \sinh\chi, & \text{for } \kappa =-1\,, \end{array}\right. \end{eqnarray} is automatically a route-B-compatible metric. This means that, within route B, a transition into a Riemannian region can occur at the beginning (where $a(t)=0$ so the spatial metric becomes fully degenerate and ready to be continued further into negative definiteness) of the prevailing cosmological model, extending it beyond the big bang\footnote{Note that contrary to common pictorial depictions, the big bang is not necessarily a single point, just a co-dimension one surface with a degenerate intrinsic metric -- much like how distances along a null ray vanishes, yet the null ray is not a single point. See Sec.~\ref{sec:LightLike} below for more details. }, but without needing significant alterations to the currently prescribed post-big-bang evolution, which wouldn't have been economic since any such alterations must be re-reconciled with observations. We will keep the subsequent discussion in this paper general and not specialize to FLRW unless specifically noted. Nevertheless, it is helpful to always have this particularly well-studied and physically relevant special case in mind for intuition building. \item Route B corresponds to the light cones opening up as one approaches the change of signature surface $\Sigma$ from the Lorentzian side (see Fig.~\ref{fig:ConeStack} for a visual depiction), since equal temporal increments would require increasingly greater spatial coordinate intervals to compensate in the $g_{ab}dx^adx^b =0$ equation for the null rays. As suggested by Fig.~\ref{fig:ConeStack} and will be discussed in more details in Sec.~\ref{sec:Morphology} below, the null cone structure is removed (it cannot exist in the Riemannian side) in route B via the future and past null cones opening up to collide and annihilate each other, so it is the spacelike region that is squeezed out of existence, and the Riemannian side is purely temporal, as the metric signature obviously confirm. In contrast, the cones disappear in route A (*2) by separately closing up into a couple of half lines which then vanish beyond $\Pi$. In other words, the timelike regions are the ones taken out in that approach and the Riemannian side is purely spatial. A complication of that latter method is then that it takes constructive efforts (e.g., use different definitions for the geodesic Lagrangian when in alternative signature regimes \cite{1992GReGr..24.1047E}) to make timelike geodesics thread through $\Pi$, since if left alone, they would have disappeared together with the timelike regions. In contrast, such intervention is unnecessary with route B, whose Riemannian side is capable of hosting timelike curves. That such a continuation of timelike geodesics is required in the first place is due to the desire to show that the signature change scenario no longer suffers geodesic incompleteness, so that the big bang singularity is indeed removed in that particular sense, and one stays faithful to the original no-boundary proposal of \cite{1983PhRvD..28.2960H}. This amelioration is possible because the usual singularity theorem \cite{1965PhRvL..14...57P,1966PhDT.......101H} needs some causal properties that are no longer available in the Riemannian regime \cite{1992CQGra...9.1535E}. \item Following a procedure closely mimicking that of *2 but for route B, we obtain once again strong $\mathcal{C}_s$ conditions, but now including an additional one ($\mathcal{C}^2_s$ of Sec.~\ref{sec:CondEin}) enforcing the vanishing of spatial derivatives on $\Sigma$, in addition to the temporal stationarity. Furthermore, the lapse function within route B can be set to a constant, so that even more components of the four-metric's derivatives vanish as compared to route A. Because these metric derivatives contribute to the curvature tensors, their suppression is beneficial for realizing the uniformity condition on the big bang, that's envisaged by the Weyl curvature conjecture \cite{1989NYASA.571..249P}\footnote{Incidentally, it was noted in this paper that something along the lines of the Hartle-Hawking no-boundary proposal may lead to the required condition.} to start the universe off on low entropy (see also \cite{2014arXiv1406.3057C}). A signature change universe via route B thus offers up an intriguing new way to supplement inflation in its quest to solve some cosmic puzzles. \end{enumerate} In the rest of the paper, we turn to the details, beginning by establishing some basic properties of a route B transition in Sec.~\ref{sec:Conformal}, before finding the junction conditions in Sec.~\ref{sec:Junction}. We finally conclude in Sec.~\ref{sec:Conclusion} with a discussion on the many studies required to more thoroughly explore the viability and properties of route B. For the Lorentzian side, we adopt signature $(-,+,+,+)$ and the Riemannian side subsequently has $(-,-,-,-)$. \section{Large scale features} \label{sec:Conformal} \subsection{The signature morphology} \label{sec:Morphology} \begin{figure}[t] \centering \begin{overpic}[width=0.99\columnwidth]{Merge.png} \end{overpic} \caption{If a single eigenvalue of $\gamma_{ij}$ turns negative at $q$, then at a later time $q^+$ along a timelike path through $q$, the future and past null cones remain separated as per usual with a Lorentzian metric signature; at $q$, the two very elongated cones touch along a (black in the figure) line that's the eigenvector (eigenvectors are not directional, so the black line is a full and not half line) corresponding to the eigenvalue that now becomes zero, and thus vectors along this direction now have zero norms; at some earlier time $q^-$, the two cones partially ``annihilate'', splitting the black line. The timelike interior of the cones join up through the opened up gap between the pair of black lines indicating the intersection lines between the cones. When all three eigenvalues change sign at the same point $q$ (not plotted), the cones will open up towards each other as we approach $q$ from $q^+$, and the entireties of the two cones collide and annihilate at $q$, so there are no null cones at $q^-$ and all directions are timelike -- the spacetime becomes Riemannian. } \label{fig:Merge} \end{figure} A complication that route A did not suffer but route B must now face is that since three dimensions now switch signature, there is the possibility that the three switches occur sequentially, instead of simultaneously as in the FLRW example. Specifically, consider the generic metric in the 3+1 form \cite{2008GReGr..40.1997A} \begin{align} \label{eq:Synch} &g_{ab}dx^a dx^b \notag \\ &\quad = -\alpha^2 dt^2 + \gamma_{ij}\left( \beta^i dt + dx^i \right)\left( \beta^j dt + dx^j \right)\,, \end{align} where we fix the gauge freedoms by setting lapse $\alpha \equiv 1$ and shift $\beta^i \equiv 0$ so as to pick Gaussian normal (synchronous) coordinates, whose temporal coordinate curves are timelike geodesics. Starting from an arbitrary coordinate system $x^{\bar{a}}$, we can find the Gaussian normal coordinates by solving the Hamilton-Jacobi equation \begin{eqnarray} g^{\bar{a}\bar{b}}S_{,\bar{a}}S_{,\bar{b}}=-1\,, \end{eqnarray} for which real solution $S$ (it is to be the new time coordinate) exists even as signature is allowed to vary, because we always have at least one timelike dimension within route B. A subtlety is that at places of signature change, some spatial\footnote{We will slightly abuse terminology in the interest of brevity and assign the label ``spatial'' to the other coordinates that are not $t$, even though their associated dimension can become null or timelike.} components in the inverse metric $g^{\bar{a}\bar{b}}$ may diverge, but well-defined limits exist for these locations if the spatial derivatives of $S$ simply vanish sufficiently quickly there. Once the solution is found, the Gaussian normal coordinate system can be constructed by following the standard textbook recipe. In this new coordinate system, that we adopt for expositional clarity, $\gamma_{ij}$ is positive definite in a usual Lorentzian region, but its eigenvalues can transition, either one at a time or several together, into negative values. We can understand what this physically means by examining what happens to the null cones when one or more eigenvalues turns to zero and then negative through a transition point $q$. The situation is depicted in Fig.~\ref{fig:Merge}, and the local tangent space geometry can be intuited as future and past null cones colliding and ``annihilating'', allowing their timelike interiors to merge. The possibilities of partial sign switches and thus more diversified signature configurations are intriguing, but physically problematic. For example, a scalar field in a signature $(-,-,+,+)$ spacetime region would propagate via an ultrahyperbolic equation, which is generically (unless nonlocal constrains are imposed \citep{2009RSPSA.465.3023C}) ill-posed \citep{1953mmp..book.....C} when evolved off of any Cauchy surface (on the other hand, an elliptic equation in an Riemannian region admits well-posed boundary value problems). Beyond the scalar field, Ref.~\cite{2001PhLB..520..159V} also showed that fields with finite spins greater than zero cannot be defined in a signature $(-,-,+,+)$ spacetime region (they are however allowed in a Riemannian region). This implies a rather strange requirement where a Dirac field describing say, electrons, can exist in the Lorentzian region, but must somehow collude with spacetime in a fashion far beyond simply warping it, and stop existing (not just becoming zero in amplitude) as soon as one spatial direction mutates. We therefore need at least two spatial directions to switch simultaneously, leading to a time-space swapped Lorentzian spacetime of signature $(-,-,-,+)$. All massive particles must now become essentially long-lived ``tachyons'' \citep{1997CQGra..14L..69T}, since they now move outside of lightcones (centred on the remaining spatial direction) in order to follow timelike worldlines. Because the mathematics for a quantum field theory in this region is the same as in the regular Lorentzian signature (in fact, the sign convention adopted in particle physics is the opposite of that used by relativists, and this paper, so no sign changes are even needed when lifting formulae from books), one are then faced with all the vacuum instability issues and other pathologies that tachyons bring. We therefore assume, from here onwards, that sequential sign switches are forbidden, and that all three spatial dimensions switch simultaneously, giving us $(-,-,-,-)$ straight away. \subsection{The FLRW junction surface}\label{sec:LightLike} Continuity of the metric requires that any curve linking two points of different signatures must intersect the bounding wall $\Sigma$ at least once, so $\Sigma$ should at most have codimension one (the curve itself takes up one codimension, and if there exists another, the curve's intersection point with $\Sigma$, as well as the surrounding sections to preserve continuity, can be shifted in that direction to avoid $\Sigma$), but does not need to be a constant $t$ surface. The case of the highly symmetric FLRW is much simpler though, and due to its cosmological relevance, worthy of us taking a little detour to clarify. We emphasize though that most of our discussions on the junction conditions in Sec.~\ref{sec:Junction} are not confined to this case, and are valid for generic $\Sigma$s. They are local considerations relating to limit-taking procedures along an arbitrary single timelike curve threading through $\Sigma$ at a single point, and are as such independent of the larger scale properties of $\Sigma$. The first thing one notices is that the FLRW $\Sigma$ is null, since $g_{ab}dx^adx^b$ vanishes at $a=0$ for any separations confined to $\Sigma$ (with $dt=0$ since $a$ is a function of $t$ only). It should be noted though, points on $\Sigma$ can be macroscopically separated yet null-related just like two points along a null ray, in which case $\Sigma$ is not a single point as often depicted for the big bang, just like a null ray is not a single point. This situation arises because the Lorentzian metric is rather pathological for the purpose of defining open sets (metric balls are noncompact) and studying topology (thus the frequent adoption of a positive definite auxiliary metric in some topological studies, see e.g., \cite{Beemfest,1979grec.conf..212G}). Baring any direct observational consequences of the Riemannian side from which the topology of $\Sigma$ may become more obvious, the best hope we have to ascertain its nature may be to assume global hyperbolicity of the Lorentzian side, whose topology should then be a direct product $\mathbb{R} \times \Sigma$ \cite{1990PhRvD..42.2458G}. Since our universe is not one dimensional, $\Sigma$ cannot be a zero dimensional point. More explicitly, the observational evidence is that the spatial slices of our universe appear to be flat \cite{2018arXiv180706209P}, and thus could well be infinite in extent\footnote{They could also be flat tori or other twisted alterations \cite{Riazuelo:2003ud}, but a point would still have the wrong dimension for a boundary of the 4-D Lorentzian universe, and would instead be an interior point, resulting in the big bang cosmology already being ``no-boundary'' even without introducing a Riemannian region, depriving us of a place to prescribe initial conditions (necessary for Cauchy evolution on the Lorentzian side) on.}. It would then be quite strange for such an infinite noncompact plane to instantaneously collapse into a single point (a compact singleton) as soon as the scale factor reaches precisely zero, when it would still be noncompact for any infinitesimal value of $a>0$. In that scenario, the early universe would not resemble the collar neighbourhood of $\Sigma$, which would obviously adversely affect our ability to evolve initial conditions off of $\Sigma$ to uniquely determine the Lorentzian side of the universe. Incidentally, in the case of the flat slicing of de Sitter (see e.g., Fig.~1 of Ref.~\cite{2002PhRvD..65h3507A}) serving as an isometry to an inflationary FLRW, the finite comoving observers (those labelled by finite spatial comoving coordinates) do in fact all get packed into a single asymptotic point of the de Sitter spacetime when traced back in time. The abrupt jump issue in this case is resolved by pulling in points from comoving spatial infinity to form an extended noncompact border surface. This is fine for de Sitter, since points on this surface are just regular points inside the actual de Sitter spacetime. Their carrying infinite spatial coordinates is simply due to the flat foliation coordinates being singular (a symptom is that this coordinate system cannot be extended beyond this border to cover the other half of de Sitter). However, for the actual FLRW universe, there is no reason to believe that the comoving coordinate system, as preferred by the observed motion of matter, is ill-chosen and ill-behaved, so similar infinity points would likely genuinely reside on the spatial compactification boundary. In other words, they are outside of the actual spacetime (similar to how the future null infinity $\mathscr{I}^+$ \cite{1965RSPSA.284..159P} is outside of an asymptotically flat spacetime itself), and are mathematical constructs not in fact physically available, to smooth out the jump, or to prescribe junction conditions on. In short, while the inflationary FLRW and de Sitter are isometric for the post-big-bang segment, they likely differ when it comes to the topological structure of the big bang itself, which is not a radical prospect given that they already differ on what lies beyond. Finally, as an aside, it is also worthwhile noting that the FLRW big bang is sometimes said to be spacelike, but this characterization is under the conformal metric rather than the physical metric, and the choice is not unique. Specifically, there is a well established field of study on the ``conformal gauge singularities'' (regarding the big bang singularity as being due to the special ``conformal gauge choice'' in a conformal class of mostly regular metrics) \citep{1985CQGra...2...99G,1999AnPhy.276..257A,2008AnPhy.323.2905L,2009JMP....50k2501L,2010JPhCS.229a2013T}. Even the well-posedness of the Cauchy problem for various matter content types have been proven for this construct \citep{1993RSPSA.443..473N,1999AnPhy.276..257A,1999AnPhy.276..294A,2000AnPhy.282..395A,2003CQGra..20..521T,2007CQGra..24.2415T}. It is also useful for us to think about the causal structure of the spacetime using the conformal metric $\tilde{g}_{ab}$, but we stop short of carrying out the additional temporal transformation $t\rightarrow \tau$ defined by \begin{eqnarray} \label{eq:ConformalTime} \frac{d\tau}{dt}=\frac{1}{a(t)} \,. \end{eqnarray} After this extra layer of coordinate transformation, the FLRW metric becomes conformally flat. However Eq.~\eqref{eq:ConformalTime} is singular at $a=0$, and since $t$ is the intrinsic clock carried by physical comoving observers, results obtained under $\tau$ must be fed through an additional singular transformation before it can be translated back into predictions on physical experimental outputs. The reward for this extra trouble is flexibility. Specifically, since $dt/d\tau =0$ at the big bang, the condition of moving along the constant $t$ surface, as expressed by $dt=0$, can be satisfied by any finite $d\tau$ choice. Instinctively, one picks $d\tau=0$ which gives a conformally spacelike (under the physical metric it is still null) big bang, but one could actually equally well choose other $d\tau$ that makes it conformally null or even timelike. The arbitrariness is because that essentially, via an infinite stretching, the zero-thickness three dimensional $\Sigma$ got stretched into a four dimensional object. While people still customarily pick out a 3-D surface in there and call it the big bang, it perhaps should have been the whole 4-D totality. Regardless, if one holds the view that this newly inserted internal structure to the big bang is physical, then its flexibility would allow for establishing beautiful mathematical infrastructures. We will remain more parsimonious in this paper though, and formulate the junction conditions under the physical metric. \section{The junction conditions} \label{sec:Junction} A singular differential equation can be well-defined at its singular set, e.g., $x \beta_{,xx}+ \beta=0$ at $x=0$. However, with our toy Eq.~\eqref{eq:KGFull} or Einstein's equations, the coefficient functions appearing in the equation or the curvature expressions become divergent or otherwise ill-defined (e.g., $0/0$) on $\Sigma$. So strictly speaking, the equations are not merely singular; they are not formally defined there. Nevertheless, we could follow the approach of \cite{1993CQGra..10.2363K} and regularize the offending divergences by imposing strict junction conditions, so that the equations admit well-defined limits on $\Sigma$. Solutions satisfying such conditions can then be sought such that the $\Sigma$ limits of the left and right hand sides of the equations match. This distils a set of equations of motion to be satisfied on $\Sigma$, so physics won't be left completely arbitrary there, but as already alluded to in Sec.~\ref{sec:Intro1}, $\Sigma$ cannot be rendered completely regular. At the very least, the inverse metric still diverges, and some of the Carminati-McLenaghan curvature invariants \citep{Carminati:1991} might do so as well. Our present endeavour is a modest attempt at partially resolving the big bang singularity in order to glean some information on the likely behaviour of the important classical saddle point solutions; it is not aimed at removing the singularity altogether, a task for which an understanding of quantum gravity is probably required (but the intriguing possibility of accomplishing it even at a classical level, perhaps through the adoption of more topology-friendly auxiliary metrics, should not be dismissed out of hand; for such an investigation, our study would serve as a first step to demonstrate how far one can go without bringing in additional infrastructures, and to identify the remaining problems they must solve, thereby clue us in on where new physics/mathematics might come in, as well as what they might look like). \subsection{The Einstein's equations} \label{sec:CondEin} \subsubsection{The method} \label{sec:EinMethod} We begin with the left hand side of the Einstein's equations. Following standard literature \cite{MTW}, under Gaussian normal coordinates, the Einstein tensor can be written in the $3+1$ form as \begin{align} G_{tt}=& \frac{1}{2}{}^{(3)}R + \frac{1}{2} \left[ K^2 - \text{tr}(K\cdot K)\right] \,, \label{eq:G1}\\ G_{ti} =& -K_i{}^m{}_{|m}+K_{|i} \,, \label{eq:G2} \\ G_{ij} =& {}^{(3)}G_{ij} - \bigg\{ (K_{ij}-K \gamma_{ij} )_{,t} + 2 K_{ik}K^{k}{}_j - 3K K_{ij} \notag \\ &+ \frac{1}{2}K^2\gamma_{ij}+ \frac{1}{2} \text{tr}(K\cdot K)\gamma_{ij} \bigg\}\,,\label{eq:G3} \end{align} where $K_{ij}=- \gamma_{ij,t}/2$ is the extrinsic curvature of the constant $t$ slice (not necessarily coincident with $\Sigma$), and the vertical bar denotes 3-D covariant derivative. The first two equations do not contain temporal derivatives, and are the Hamiltonian and momentum constrains respectively. The third equation tells us how to evolve the metric in time. Note that these expressions are valid on both sides of $\Sigma$, since unlike with route A, there is no change to the norm of the normal vector $\partial_t$ of the spatial slices within route B, thus none of the explicit signs in Eqs.~\eqref{eq:G1}-\eqref{eq:G3} needs to change; the signature changes are all hidden inside the symbolic spatial quantities, just as they are all hidden inside the $\gamma_{ij}$ in the metric (see Eq.~\ref{eq:Synch}). We therefore will not explicitly distinguish between the Lorentzian and Riemannian sides in the derivations below, since all expressions are identical. Because $\gamma^{ij}$ is the source of divergences at $\Sigma$, the terms \begin{align} K \equiv \gamma^{ij}K_{ij}\,, \quad \text{tr}(K\cdot K) \equiv \gamma^{ij}\gamma^{kl}K_{ik}K_{jl}\,, \notag \end{align} as well as $K_i{}^{m}{}_{|m}$, $K_{ik}K^{k}{}_j$, and since (also due to other contractions with the inverse metric in trace-taking computations) \begin{eqnarray} \label{eq:Connection} {}^{(3)}\Gamma ^i_{{jk}}=\frac{1}{2} \gamma^{{il}} \left(\gamma_{{kl,j}}-\gamma_{{jk,l}}+\gamma_{{lj,k}}\right) \,, \end{eqnarray} also ${}^{(3)}R$ and ${}^{(3)}G_{ij}$, could all diverge there. The goal, following the arguments of Ref.~\cite{1993CQGra..10.2363K}, is to see what conditions arise from demanding that $G_{ab}$ remains bounded in the $\Sigma$ limit. It should be noted that this approach demands component-wise regularity for the Einstein tensor (because the Einstein's equations are in component form), but being explicit tensor components, the expressions \eqref{eq:G1}-\eqref{eq:G3} depend on the underlying coordinate basis onto which the tensor is decomposed, and this basis could be ill-behaved even when the underlying geometry is perfectly fine (e.g., if caustics develop for the congruence of timelike geodesics underlying the Gaussian normal coordinate system, due to a bad choice of initial velocities). This coordinate singularity issue is familiar and not specific to the problem at hand, but it is nevertheless worth emphasizing that it implies the conditions $\mathcal{C}^{1/2}_s$ we obtain in the next section are (unfortunately unavoidably) sufficient but not necessary. They are also quite strong in another way, as they will demand that all the terms in $G_{ab}$ that could possibly diverge would instead remain finite, in an individual term-wise fashion. There is of course also the possibility that divergences cancel across terms. To find these cases, one needs to solve differential regularity equations derived from the condition that the divergent terms in Eqs.~\eqref{eq:G1}-\eqref{eq:G3} are curbed, which is technically difficult without assuming symmetries to simplify expressions, but doing so would defeat the purpose of trying to find out what kind of constraints that regularity at $\Sigma$ would place on our universe. Instead, we deploy generic considerations to argue that such solutions would unlikely be numerous (or indeed exist at all), so at the very least, the solutions given by $\mathcal{C}^{1/2}_s$ would not be unlikely as physically relevant junction conditions from a statistical point of view. We begin by noting that Eqs.~\eqref{eq:G2} and \eqref{eq:G3} contain terms involving both one and two factors of the inverse spatial metric $\gamma^{ij}$, which diverge at different rates and have to be treated separately. Schematically, write $\gamma^{ij} \sim 1/\zeta$ with $\zeta \rightarrow 0$ when approaching $\Sigma$, then Eq.~\eqref{eq:G2} or \eqref{eq:G3} could be stylized as \begin{eqnarray} \label{eq:RawCancel} \frac{A(\zeta)}{\zeta}+\frac{B(\zeta)}{\zeta^2}=\frac{1}{\zeta}\left(A+\frac{B}{\zeta}\right)\,, \end{eqnarray} where $A$ and $B$ are non-divergent at $\zeta=0$ since we have collected all the problematic terms into powers of $1/\zeta$. Regularity then requires that \begin{eqnarray} \label{eq:Reg1} A = -\frac{B}{\zeta} + \mathcal{O}(\zeta)\,, \end{eqnarray} and since $A$ can not diverge (but can be nonvanishing) when $\zeta\rightarrow 0$, we also need \begin{eqnarray} \label{eq:Reg2} B = \mathcal{O}(\zeta)\,. \end{eqnarray} The cross cancellations thus allow for more relaxed $A$ and $B$ than what term-wise regularity would demand, which is $A = \mathcal{O}(\zeta)$ and $B=\mathcal{O}(\zeta^2)$ (these select a subset of solutions to Eqs.~\ref{eq:Reg1} and \ref{eq:Reg2}, and are not alternatives to them). The catch is that for each original Eq.~\eqref{eq:RawCancel}, we end up with twice as many regularity conditions \eqref{eq:Reg1} and \eqref{eq:Reg2}. This means that Eqs.~\eqref{eq:G2} and \eqref{eq:G3} would demand $2\times 3$ and $2\times 6$ regularity equations respectively, while Eq.~\ref{eq:G1} adds another few. Furthermore, the three eigenvalues $\gamma_{\iota}^e$ could all vanish at different rates, so instead of just two powers as in our stylized example Eq.~\eqref{eq:RawCancel}, there are in fact more distinct divergence rates, spawning a great many regularity equations. On the other hand, there are only 12 independent components in the variables $\gamma_{ij}$ and $K_{ij}$\footnote{We are here taking the Hamiltonian approach of Arnowitt-Deser-Misner (ADM) \cite{2008GReGr..40.1997A}, where $\gamma_{ij}$ and $K_{ij}$ are regarded as independent variables, each marching forward according to a first-derivative-in-time evolution equation. One can of course also take the Lagrangian view and see $\gamma_{ij}$ as the only fundamental variable, governed by a second-derivative-in-time evolution equation. By definition, the regularity equations are there to limit what initial conditions one can place on $\Sigma$ (they are allowed to be under-determining), and for these initial conditions, one can either lay down $6$ initial values for $\gamma_{ij}$ and $K_{ij}$ each, or $12$ for $\gamma_{ij}$ alone (since it is then governed by a second order equation, one should give both Dirichlet and Neumann conditions). The number of required initial values is always $12$, and they must satisfy the $\Sigma$ limit of the regularity equations, which is generically impossible if there are more than $12$ such equations.}, so the coupled set of regularity equations is heavily overdetermined, thus generically does not admit solutions beyond the trivial ones identified by $\mathcal{C}^{1/2}_s$. By triviality\footnote{The regularity equations are stronger than just implicit initial conditions confined to $\Sigma$, since they also constrain the variables at small but nonvanishing $\zeta$ values (for well-defined limits to exist for $G_{ab}$, just having the coefficients to the various powers of $1/\zeta$ vanishing on $\Sigma$ is not enough, they also need to vanish sufficiently quickly as $\Sigma$ is approached). Yet they are more relaxed than the usual exact equations in the interior, since small errors are allowed (e.g., stray $\zeta^2$ terms are allowed for Eq.~\ref{eq:Reg1} due to the $\mathcal{O}(\zeta)$ provision). For interior equations, the relevant number of free variables drops to $6$ (the number of physical freedoms in a metric; the $6$ freedoms in $K_{ij}$ are removed by its definition as the time derivative of $\gamma_{ij}$, which gives a set of $6$ constraint equations) from the $12$ as for the initial conditions, exacerbating the over-determinacy. Alternatively, one may stay with the boundary view and note that each of the regularity equation is stronger than just one initial condition, since one could expand it into powers of $\zeta$ (as surrogate for $t$) around $\zeta=0$ (i.e., the expansion coefficients are evaluated on $\Sigma$), and observe that coefficients to all powers lower than that inside $\mathcal{O}$ must vanish (there is always at least one such coefficient, that of $\zeta^0$, but there could be more), translating into multiple initial conditions. Thus the severity of over-determinacy is underestimated in the main text, although already sufficient for our purpose. The triviality discussed here is in regard to these relaxed interior equations, and a more familiar notion of trivial solutions to overdetermined exact equation systems can be recovered by confining the discussion to $\Sigma$ itself, as we have also done in this footnote.}, we mean that individual terms in each equation are all pushed below the ``error budget'' of that equation (e.g., $\mathcal{O}(\zeta)$ for Eq.~\ref{eq:Reg1}) by $\mathcal{C}^{1/2}_s$, so no strict equalities need to be actually enforced (to precisely balance/cancel out between quantities above the error tolerance threshold), resulting in the over-abundance of equations all being rendered inert, left with no chance to conflict with one another. For an illustrative example of how the error budget bestows flexibility, take the case $A \propto B^p$ with some fixed $p$ prescribed by physics (i.e., there is only one free variable $B$, and the Eqs.~\ref{eq:Reg1} and \ref{eq:Reg2} are overdetermined), and let $B \propto \zeta^q$ be an ansatz solution whose $q$ is up to us to pick. Then if we take up the more relaxed $q=1$ as allowed by Eq.~\eqref{eq:Reg2}, we would have a chance of balancing Eq.~\eqref{eq:Reg1} only in the fine-tuned case of $p=0$. However, if $q=n\geq 2$ as required by $\mathcal{C}^{1/2}_s$, then any $p\geq 1/n$ is comfortably accommodated. This is because, in the latter case, the $B/\zeta$ term does not rise above the error tolerance $\mathcal{O}(\zeta)$ of the overall equation, thus does not require careful cancellation from $A$ (as a result, $p$ does not have to be of any particular value), which is not freely variable and thus is defective for fulfilling this role. Note that although we have used cancellation across different powers of $\zeta$ for our example, analogous considerations, as well as the triviality discussion of the last paragraph in general, also apply to cancellations between terms contributing to the same power (i.e., $A$, and/or $B$, alone could further subdivide into a small number of contributors), which $\mathcal{C}^{1/2}_s$ also excludes. \subsubsection{The conditions} Near a temporal coordinate geodesic $\xi$ of our Gaussian normal coordinate system $x^a$ that threads through $\Sigma$, we can construct a principal coordinate system $x^{\check{a}}$ under which $\gamma_{\check{i}\check{j}}$ is diagonalized on $\xi$, by first applying an $\text{O}(3)$ transformation within the spatial tangent space to diagonalize $\gamma_{ij}$ there (this is always possible according to the Spectral Theorem since $\gamma_{ij}$ is non-singular real symmetric; we don't need $x^{\check{a}}$ to be unique), and then lay down the spatial coordinates in an open tube surrounding $\xi$ via the exponential map. Note that we do not normalize $\gamma_{\check{i}\check{j}}$ to unity (the coordinate basis $\{\partial_{x^{\check{a}}}\}$ is not orthonormal), so that the Jacobian transforming between the two coordinate systems remains well-behaved along $\xi$, even as we approach $\Sigma$ (always just a block diagonal matrix with a regular orthogonal matrix for the spatial sector, and unity for the temporal sector). Along $\xi$ (where the spatial tangent spaces according to $x^{a}$ and $x^{\check{a}}$ coincide), the spatial tensors on the right hand sides of Eqs.~\eqref{eq:G1}-\eqref{eq:G3} can be computed as their counterparts in the $x^{\check{i}}$ coordinate system multiplied for an appropriate number of times by the $O(3)$ spatial Jacobian, which is never divergent nor degenerate (always full-ranked), thus it suffices to examine the divergences under $x^{\check{i}}$ where the algebraic matrix operations reduce to those between the three eigenvalues $\gamma^e_{\iota},\,\iota \in \{1,2,3\}$ shared by $\gamma_{ij}$ and $\gamma_{\check{i}\check{j}}$, which are positive on the Lorentzian side and negative on the Riemannian side. Essentially, we have here a Fermi normal coordinate construction \cite{1922RendL..31...21F,1963JMP.....4..735M} with the addition of a rescaling step (on the parallelly transported spatial basis vectors) to recover the eigenvalues, thus ensuring that the divergences are not appropriated by the coordinates and are captured by $\gamma^{\check{i}\check{j}}$. Just like the Fermi coordinates, our principal coordinates covers the entire open tube, but the nice properties such as the metric $\gamma_{\check{i}\check{j}}$ being diagonal is only true on the geodesic $\xi$ itself (a $[\xi]$ prefix below signifies expressions valid only on $\xi$). This is fine for us though, since we are studying the limiting behaviours of quantities as we approach $\Sigma$ along $\xi$, so we only ever need to evaluate such quantities on $\xi$. Therefore, in our computations, $\gamma_{\check{i}\check{j}}$, $\gamma^{\check{i}\check{j}}$ and their temporal partial derivatives (measuring changes along $\xi$) to any order (including $K_{\check{i}\check{j}}$ in particular) are diagonal \begin{align} \label{eq:SpecialSpatialCoord} \big[\xi\big]:\,\,&\gamma_{\check{i}\check{j}} = \Big[ \text{diag}_{\iota} \gamma^e_{\iota} \Big]_{\check{i}\check{j}}\,, \quad \big[\xi\big]:\,\, \gamma^{\check{i}\check{j}} = \left[ \text{diag}_{\iota} \frac{1}{\gamma^e_{\iota}} \right]^{\check{i}\check{j}} \,, \notag \\ \big[\xi\big]:\,\,&K_{\check{i}\check{j}} = \left[ -\frac{1}{2}\text{diag}_{\iota} \gamma^e_{\iota,\check{t}} \right]_{\check{i}\check{j}}\,, \notag \\ \big[\xi\big]:\,\,&K = -\frac{1}{2}\sum_{\iota}\frac{ \gamma^e_{\iota,\check{t}}}{\gamma^e_{\iota}}\,, \notag \\ \big[\xi\big]:\,\,&K_{,\check{t}} = -\frac{1}{2}\sum_{\iota}\left(\frac{\gamma^e_{\iota,\check{t}\check{t}}}{\gamma^e_{\iota}} - \left(\frac{\gamma^e_{\iota,\check{t}}}{\gamma^e_{\iota}}\right)^2\right)\,, \notag \\ \big[\xi\big]:\,\,&\text{tr}(K\cdot K) = \frac{1}{4}\sum_{\iota}\left(\frac{\gamma^e_{\iota,\check{t}}}{\gamma^e_{\iota}}\right)^2\,,\notag \\ \big[\xi\big]:\,\,&K_{\check{i}}{}^{\check{m}} = \left[ -\frac{1}{2}\text{diag}_{\iota} \frac{\gamma^e_{\iota,\check{t}}}{\gamma^e_{\iota}} \right]_{\check{i}}{}^{\check{m}}\,, \notag \\ \big[\xi\big]:\,\,&K_{\check{i}\check{k}}K^{\check{k}}{}_{\check{j}} = \frac{1}{4} \left[\text{diag}_{\iota}\frac{( \gamma^e_{\iota,\check{t}})^2}{\gamma^e_{\iota}}\right]_{\check{i}\check{j}}\,. \end{align} We then immediately see that the requirement (c.f., Ref.~\cite{1993CQGra..10.2363K} for route A) \vspace{3mm} \noindent $\mathcal{C}^1_s$: \emph{Temporal derivatives of the spatial metric vanish at least as quickly as the spatial metric itself as $\Sigma$ is approached, in the sense that $\gamma^e_{\iota,\check{t}} = \mathcal{O}(\gamma^e_{\iota})\,,\,\,\gamma^e_{\iota,\check{t}\check{t}} = \mathcal{O}(\gamma^e_{\iota})\,,\,\, \forall \iota$}, \vspace{3mm} \noindent is necessary and sufficient to ensure that the following terms \begin{align} \label{eq:timeterms} &K^2\,, \quad \text{tr}\left(K\cdot K\right)\,, \quad (K_{\check{i}\check{j}}-K \gamma_{\check{i}\check{j}} )_{,\check{t}}\,, \notag \\ &K_{\check{i}\check{k}}K^{\check{k}}{}_{\check{j}}\,, \quad K K_{\check{i}\check{j}} \end{align} in $G_{\check{a}\check{b}}$ all individually remain bounded. Note that although $K_{\check{i}\check{j}}$ vanishes on $\Sigma$, its trace $K$ does not need to, since $\mathcal{C}^1_s$ allows for $\gamma^e_{\iota,\check{t}} = \Theta(\gamma^e_{\iota})$, i.e., it allows the numerator and denominator in the $K$ expression in Eq.~\eqref{eq:SpecialSpatialCoord} to vanish equally quickly when approaching $\Sigma$, so the limit of the ratio can be finite but nonvanishing. The other terms in $G_{\check{a}\check{b}}$ not appearing in Eq.~\eqref{eq:timeterms} involve spatial derivatives. In general, spatial derivatives of even the off-diagonal entries in the tensorial quantities appearing in Eq.~\eqref{eq:SpecialSpatialCoord} do not necessarily vanish, since these quantities can be non-diagonal off $\xi$. Nonetheless, because the principal coordinate system is constructed via the exponential map, we must have a vanishing connection \begin{eqnarray} \label{eq:ConnectionExplicit} \big[\xi\big]:\,\,{}^{(3)}\Gamma^{\check{i}}_{\check{j}\check{k}} =0\,, \end{eqnarray} and subsequently \begin{eqnarray} \label{eq:FirstDerivs} \big[\xi\big]:\,\,\gamma_{\check{i}\check{j},\check{k}}=\gamma_{\check{i}\check{l}}{}^{(3)}\Gamma^{\check{l}}_{\check{j}\check{k}}+\gamma_{\check{j}\check{l}}{}^{(3)}\Gamma^{\check{l}}_{\check{i}\check{k}} = 0\,. \end{eqnarray} Since \begin{eqnarray} 0 = \delta_{\check{i}}{}^{\check{j}}{}_{,\check{k}} = \left(\gamma_{\check{i}\check{l}} \gamma^{\check{l}\check{j}}\right)_{,\check{k}} = \gamma_{\check{i}\check{l},\check{k}}\gamma^{\check{l}\check{j}}+\gamma_{\check{i}\check{l}} \gamma^{\check{l}\check{j}}{}_{,\check{k}}\,, \end{eqnarray} Eq.~\eqref{eq:FirstDerivs} further yields \begin{eqnarray} \label{eq:FirstDerivs2} \big[\xi\big]:\,\,\gamma^{\check{m}\check{i}} \gamma_{\check{i}\check{l}} \gamma^{\check{l}\check{j}}{}_{,\check{k}} =\delta^{\check{m}}{}_{\check{l}} \gamma^{\check{l}\check{j}}{}_{,\check{k}} = \gamma^{\check{m}\check{j}}{}_{,\check{k}} =0\,. \end{eqnarray} Furthermore, since Eqs.~\eqref{eq:FirstDerivs} and \eqref{eq:FirstDerivs2} are true everywhere along $\xi$, temporal derivatives can be added to yield \begin{eqnarray} \label{eq:FirstDerivs3} \big[\xi\big]:\,\,\gamma_{\check{i}\check{j},\check{k}\check{t}} = 0 = \gamma^{\check{i}\check{j}}{}_{,\check{k}\check{t}}\,. \end{eqnarray} Equipped with these tools, we are now ready to tackle the first derivative terms in $G_{\check{t}\check{i}}$. Eq.~\eqref{eq:ConnectionExplicit} reduces covariant derivative to partial derivative, and then by Eqs.~\eqref{eq:FirstDerivs2} and \eqref{eq:FirstDerivs3}, we have \begin{align} &\big[\xi\big]:\,\,K_{\check{i}}{}^{\check{m}}{}_{|\check{m}}= -\frac{1}{2}\left(\gamma^{\check{m}\check{j}}\gamma_{\check{i}\check{j},\check{m} \check{t}}+ \gamma^{\check{m}\check{j}}{}_{,\check{m}}\gamma_{\check{i}\check{j},\check{t}}\right) = 0\,,\notag \\ &\big[\xi\big]:\,\, K_{|\check{i}}= -\frac{1}{2} \left(\gamma^{\check{j}\check{k}}\gamma_{\check{j}\check{k},\check{i} \check{t}}+ \gamma^{\check{j}\check{k}}{}_{,\check{i}}\gamma_{\check{j}\check{k},\check{t}}\right) = 0\,, \end{align} which are automatically regular without requiring any additional conditions. The spatial curvatures are then the only ones left, with the Ricci tensor given by \begin{align}\label{eq:RicciT} \big[\xi\big]:\,\,{}^{(3)}R_{\check{j}\check{l}}={}^{(3)}R^{\check{i}}{}_{\check{j}\check{i}\check{l}} =& \sum_{\check{i}}\frac{{}^{(3)}R_{\check{i}\check{j}\check{i}\check{l}}}{ \gamma^e_{\iota \mathrel{\hat{=}} \check{i}}} \,, \end{align} where the correspondence relation like $\iota \mathrel{\hat{=}} \check{i}$ means that the principal coordinate base $\partial_{\check{i}}$ should be along the eigenvector direction corresponding to $\gamma^e_{\iota}$. There is also a further contraction with the problematic $\gamma^{\check{i}\check{j}}$ to get to \begin{align}\label{eq:RicciS} \big[\xi\big]:\,\,{}^{(3)}R= \sum_{\check{i}\check{j}}\frac{{}^{(3)}R_{\check{i}\check{j}\check{i}\check{j}}}{\gamma^e_{\iota \mathrel{\hat{=}} \check{i}}\gamma^e_{\iota' \mathrel{\hat{=}} \check{j}}} \,, \end{align} and subsequently ${}^{(3)}G_{\check{i}\check{j}}$. Because the three $\gamma^e_{\iota}$s generically decline at different rates, we need the Riemann tensor components in each term of the summations in Eqs.~\eqref{eq:RicciT} and \eqref{eq:RicciS} to separately decline sufficiently quickly. In fact, even if all the eigenvalues share the same rate of decline, there will still be $7$ regularity equations between Eqs.~\eqref{eq:RicciT} and \eqref{eq:RicciS}, but only $6$ independent components in the 3-D Riemann tensor, thus the equation set is over-determining, and generically only admit trivial solutions where each variable individually ``vanishes'' (sinks below the ``error budget''). In either case, we have explicitly \begin{align} \label{eq:CondRiemann} \big[\xi\big]&:\,\,{}^{(3)}R_{\check{i}\check{j}\check{i}\check{l}} = \mathcal{O}\left(\gamma^e_{\iota \mathrel{\hat{=}} \check{i}}\right)\,, \notag\\ \big[\xi\big]&:\,\,{}^{(3)}R_{\check{i}\check{j}\check{i}\check{j}} = \mathcal{O}\left(\gamma^e_{\iota \mathrel{\hat{=}} \check{i}}\gamma^e_{\iota' \mathrel{\hat{=}} \check{j}}\right)\,, \end{align} where $\check{i}$, $\check{j}$ and $\check{l}$ all take different values. Through index symmetries, Eq.~\eqref{eq:CondRiemann} accounts for all $6$ freedoms in the spatial Riemann tensor (explicitly, the $\check{i}=1,\,2$ or $3$ possibilities for the first line and the three inequivalent pairs $(\check{i},\check{j})=(1,2),\,(1,3)$ or $(2,3)$ for the second line). These conditions can be further transcribed onto the second spatial derivatives of $\gamma_{\check{i}\check{j}}$. To this end, note that our principal coordinates are just rescalings of the Fermi coordinates, so the coordinate transformations between them is achieved via the Jacobian, and some simple Jacobian gymnastics allow us to import the standard Fermi result \cite{Ni:1978zz} to produce (note the sign difference with \cite{1963JMP.....4..735M}, stemming from the different conventions in the definition of the Riemann tensor) \begin{eqnarray} \label{eq:Offxi} \gamma_{\check{i}\check{j}} = \Big[ \text{diag}_{\iota} \gamma^e_{\iota} \Big]_{\check{i}\check{j}}\Big|_{\xi} -\frac{1}{3}R_{\check{i}\check{l}\check{j}\check{m}}\Big|_{\xi}x^{\check{l}}x^{\check{m}} + \mathcal{O}\left((x)^3\right)\,, \end{eqnarray} that extend Eq.~\eqref{eq:SpecialSpatialCoord} off $\xi$ (the expansion coefficients labelled with $|_{\xi}$ are to be evaluated on $\xi$). Applying the Gauss-Codazzi equation, Eq.~\eqref{eq:Offxi} then implies \begin{align} \label{eq:SecondDerivAsRiemann} \big[\xi\big]:\,\,\gamma_{{\check{i}\check{j},\check{p}\check{q}}} =& \frac{2}{3} R_{\check{i}(\check{p}\check{q})\check{j}} \\ =& \frac{2}{3}\left( {}^{(3)}R_{\check{i}(\check{p}\check{q})\check{j}}+K_{\check{i}(\check{p}}K_{\check{q})\check{j}}-K_{\check{i}\check{j}}K_{\check{p}\check{q}}\right)\,. \notag \end{align} We note that there are four indices in the second derivatives of the metric, yet only three spatial dimensions to choose from, so at least one of the four indices repeat. On the other hand, if any index repeats three times or more, the 4-D Riemann tensor in the first line of the right hand side of Eq.~\eqref{eq:SecondDerivAsRiemann} vanishes due to its index antisymmetry properties. Applying these properties to the rest, and using the fact that the extrinsic curvature is diagonal on $\xi$, we obtain that all of the components in these second derivatives that are not automatically precisely zero are \begin{align} \label{eq:SecondDerivCons} &\big[\xi\big]:\,\,\gamma_{{\check{i}\check{j},\check{i}\check{j}}} = \frac{1}{3} \left({}^{(3)}R_{\check{i}\check{j}\check{i}\check{j}} +K_{\check{i}\check{i}}K_{\check{j}\check{j}}\right) = \mathcal{O}\left(\gamma^e_{\iota \mathrel{\hat{=}} \check{i}}\gamma^e_{\iota' \mathrel{\hat{=}} \check{j}}\right) \,, \notag \\ &\big[\xi\big]:\,\,\gamma_{{\check{i}\check{i},\check{j}\check{j}}} = -\frac{2}{3} \left({}^{(3)}R_{\check{i}\check{j}\check{i}\check{j}} +K_{\check{i}\check{i}}K_{\check{j}\check{j}}\right) =\mathcal{O}\left(\gamma^e_{\iota \mathrel{\hat{=}} \check{i}}\gamma^e_{\iota' \mathrel{\hat{=}} \check{j}}\right)\,, \notag \\ &\big[\xi\big]:\,\,\gamma_{{\check{i}\check{j},\check{i}\check{l}}} = \frac{1}{3} {}^{(3)}R_{\check{i}\check{j}\check{i}\check{l}} =\mathcal{O}\left(\gamma^e_{\iota \mathrel{\hat{=}} \check{i}}\right)\,, \notag \\ &\big[\xi\big]:\,\,\gamma_{{\check{i}\check{i},\check{j}\check{l}}} = -\frac{2}{3} {}^{(3)}R_{\check{i}\check{j}\check{i}\check{l}}=\mathcal{O}\left(\gamma^e_{\iota \mathrel{\hat{=}} \check{i}}\right)\,, \end{align} where we have used Eq.~\eqref{eq:CondRiemann} and $\mathcal{C}_s^1$, and once again no two of $\check{i}$, $\check{j}$ and $\check{l}$ can equal each other. The conditions in Eq.~\eqref{eq:SecondDerivCons} can be summarized as \vspace{3mm} \noindent $\mathcal{C}^2_s$: \emph{ Spatial derivatives of the spatial metric vanish at least as quickly as the spatial metric itself as $\Sigma$ is approached, in the sense that, let $\check{p}$ be the doubly-repeated index appearing in the second spatial derivative of the spatial metric, then that second derivative must belong to $\mathcal{O}(\gamma^e_{\iota \mathrel{\hat{=}} \check{p}})$, and when there are two doubly-repeated indices (say $\check{p}$ and $\check{q}$), the derivative belongs to $\mathcal{O}(\gamma^e_{\iota \mathrel{\hat{=}} \check{p}}\gamma^e_{\iota' \mathrel{\hat{=}} \check{q}})$. } \vspace{3mm} \noindent The first spatial derivatives of $\gamma_{\check{i}\check{j}}$ already vanish according to Eq.~\eqref{eq:FirstDerivs}, and these conditions on the second derivatives enforce a constraint on inhomogeneity in the early universe. Importantly, $\mathcal{C}_s^2$ is to be satisfied along every, and not just one, temporal coordinate curve of the Gaussian normal system. Just like $\beta_{,x}=0$ for some function $\beta(x)$ at one particular $x=x_0$ value would be a mere boundary condition that's not very constraining, having it satisfied everywhere will force $\beta$ to be a constant. In our case, there is a complication that the first derivatives are made to vanish due to the choice of the principal coordinate system, which is schematically akin to going into local coordinate patches $(x',y')_{q}$ individually rotated to adapt to the slope of $\beta$ ($x'$ axis is chosen to be parallel to this slope) at each point $q \in \beta$, so $\beta_{,x'}|_{q}=0$ is guaranteed whatever the shape of $\beta$ (besides being sufficiently smooth to allow derivatives). Now, the vanishing of the second derivative $\beta_{,x'x'}|_{q}=0$ carries the weight instead. It is a nontrivial condition that ensures the infinitesimally-close neighbouring local patches $(x',y')_{q\pm\delta q}$ do not need to be rotated against $(x',y')_{q}$ (Jacobian is identity). The same argument continues on and propagates out further away from $q$ if the vanishing of the second derivative is to be satisfied everywhere, so $\beta$ is forced to be a straight line again, that can be made into a constant if a boundary condition \begin{eqnarray} \label{eq:ToyBC} \beta_{,\hat{x}}|_{\hat{x}_0}=0 \end{eqnarray} is supplied at any single point $\hat{x}_0$ in some global coordinate system $(\hat{x},\hat{y})$. This last step amounts to judiciously choosing the global/finite-regional coordinate system, which is necessary in our case also, since the metric is not spatially constant under arbitrary coordinate systems even for the FLRW spacetime. In particular, the metrics as they are written under polar coordinates in Eq.~\eqref{eq:ConfTrans} are spatially variable (the basis vectors for this coordinate system are not parallelly transported, thus there are many non-vanishing spin coefficients even in a flat spacetime), and cannot be directly plugged into $\mathcal{C}_s^2$ that is instead stated under the more physical principal coordinates (geodetically constructed, somewhat like Cartesian coordinates in flat spacetime). With the toy example, Eq.~\eqref{eq:ToyBC} can be achieved by simply extending the local $(x',y')_{q}$ for an arbitrary $q$ into a global coordinate system $(\hat{x},\hat{y})$, which in our context is mimicked by using the principal coordinates associated with an arbitrary $\xi$ within entire finite regions surrounding that geodesic. When homogeneity is coupled with an initial ${K}>0$ (growing spatial volumes) allowed by $\mathcal{C}^1_s$, we have the basic ingredients underlying Wald's theorem \cite{1983PhRvD..28.2118W}, as a concrete realization of the more general cosmological ``no-hair'' conjecture \cite{1977PhRvD..15.2738G,1982PhLB..110...35H}, that shows isotropy and spatial flatness (local resemblance to de Sitter) can possibly be achieved later through accelerated expansion, due to inflation (with any vestiges plausibly manifesting as the low multipole temperature anomalies of the Cosmic Microwave Background \cite{2019arXiv190602552P}, provided those are not simply statistical fluctuations accentuated by cosmic variance). Within the proof of Wald's theorem, homogeneity is required to maintain ${}^{(3)}R \leq 0$, but can be slightly relaxed to allow small perturbations on top of a homogeneous background \cite{1983JETPL..37...66S,1983veu..conf..273B,1983veu..conf..267B,1988ASIC..219..261P}. Furthermore, if one is only interested in isotropy, then it has long been known \cite{1968ApJ...151..431M,1992PhR...214..223G} that anisotropy drops off rapidly with the effective spatial scale factor in a homogeneous universe, even without inflation. In this sense, isotropy may be seen as a secondary consequence of $\mathcal{C}^2_s$, provided that the universe subsequently expands. Finally we note that the conditions $\mathcal{C}_s^{1/2}$ are to be applied in conjunction with the generic condition $\mathcal{C}_g$. Namely that the spatial metric induced on $\Sigma$ from the two sides match up, and that the extrinsic curvature of the two sides should also suitably agree. For the latter condition, it is worth noting that, in principle, $\mathcal{C}_g$ allows a surface layer of radiation or gravitational impulsive wave \cite{1968AIHPA...8..327C,MTW,Penrose:1972ia,Penrose:1972xrn} to reside on the null surface $\Sigma$, permitting the extrinsic curvature to jump and the curvature tensors to become distributional at $\Sigma$ \cite{Taub:1980zr}. However, the specific condition $\mathcal{C}^{1}_s$ removes such scenarios. In other words, the discontinuities and mild ``zero-width blow-up'' \cite{Mikusinski1948} of a Dirac-delta type distribution become collateral casualties of our attempt to avoid more severe divergences. \subsection{The Klein-Gordon equation} \label{sec:CondKG} \subsubsection{The conditions} We have regularized the left hand side of the Einstein's equations in the last section, and now turn to the right hand side, the matter stress-energy. We also need to make sure that the equation of motion for the matter itself is well-behaved. As a tractable representative case (particularly relevant for those single field inflation scenarios without other fields before reheating), we concentrate on the scalar field, which satisfies the Klein-Gordon equation \begin{eqnarray} g^{\check{a}\check{b}}\varphi_{,\check{a}\check{b}}-g^{\check{a}\check{b}}\Gamma^{\check{c}}_{\check{a}\check{b}}\varphi_{,\check{c}}= \mathcal{V}'(\varphi)\,, \end{eqnarray} where the prime denotes derivative against $\varphi$. On $\xi$, the 4-D metric is block diagonal, so the equation becomes \begin{eqnarray} \big[\xi\big]:\,\, -\varphi_{,\check{t}\check{t}}+\gamma^{\check{i}\check{j}}\varphi_{,\check{i}\check{j}}+\Gamma^{\check{c}}_{\check{t}\check{t}}\varphi_{,\check{c}}-\gamma^{\check{i}\check{j}}\Gamma^{\check{c}}_{\check{i}\check{j}}\varphi_{,\check{c}}=\mathcal{V}'(\varphi)\,. \end{eqnarray} Since $\xi$ is a geodesic always at the origin of the $x^{\check{a}}$ coordinate system, and $\check{t}$ in this coordinate system is its affine parameter, we have by the geodesic equation that $\Gamma^{\check{c}}_{\check{t}\check{t}}=0$. Furthermore, from the same procedure that yielded Eq.~\eqref{eq:Offxi}, we see that, just as within the Fermi coordinates, the first spatial derivatives of $g_{\check{a}\check{b}}$ vanishes on $\xi$ (but different from the Fermi case, the temporal derivatives do not vanish, since our $\gamma_{\check{i}\check{j}}$ is not constant along $\xi$), so \begin{eqnarray} \label{eq:ConnectionTime} \big[\xi\big]:\,\,\Gamma^{\check{t}}_{\check{i}\check{j}} =\frac{1}{2}\gamma_{\check{i}\check{j},\check{t}}=-K_{\check{i}\check{j}}\,, \quad \Gamma^{\check{k}}_{\check{i}\check{j}} = 0\,. \end{eqnarray} Therefore, the Klein-Gordon equation reduces to \begin{align} \label{eq:KGDetails} \big[\xi\big]:\,\, \mathcal{V}'(\varphi)=& -\varphi_{,\check{t}\check{t}}+\gamma^{\check{i}\check{j}}\varphi_{,\check{i}\check{j}}-\frac{1}{2}\gamma^{\check{i}\check{j}}\gamma_{\check{i}\check{j},\check{t}}\varphi_{,\check{t}} \notag \\ =& -\varphi_{,\check{t}\check{t}} + \sum_{\check{i}}\frac{\varphi_{,\check{i}\check{i}}}{\gamma^e_{\iota \mathrel{\hat{=}} \check{i}}}+K\varphi_{,\check{t}} \,, \end{align} where the condition $\mathcal{C}^1_s$ ensures that the coefficient to the $\varphi_{,\check{t}}$ term is regular, so the temporal derivatives of $\varphi$ does not need to vanish. Only the spatial derivative needs to decline sufficiently quickly to ensure that the equation of motion admits a well-defined limit on $\Sigma$. The other condition for $\varphi$ is that the stress-energy tensor ${T}_{\check{a}\check{b}}$ that equates to ${G}_{\check{a}\check{b}}$ in Eqs.~\eqref{eq:G1}-\eqref{eq:G3} should not diverge. Explicitly (including the contribution from a cosmological constant $\Lambda$) \begin{align}\label{eq:EnergyKG} \big[\xi\big]:\,\, T_{\check{t}\check{t}} =& \frac{1}{2}\varphi_{,\check{t}}^2 + \frac{1}{2}\gamma^{\check{i}\check{j}} \varphi_{,\check{i}} \varphi_{,\check{j}}+ \mathcal{V}(\varphi) + \frac{\Lambda}{8\pi}\,, \notag \\ \big[\xi\big]:\,\, {T}_{\check{i}\check{j}} =& \gamma_{\check{i}\check{j}}\left( \frac{1}{2}\varphi_{,\check{t}}^2 - \frac{1}{2}\gamma^{\check{k}\check{l}} \varphi_{,\check{k}} \varphi_{,\check{l}}- \mathcal{V}(\varphi) - \frac{\Lambda}{8\pi} \right) \notag \\ &+ \varphi_{,\check{i}}\varphi_{,\check{j}}\,, \notag \\ \big[\xi\big]:\,\, {T}_{\check{t}\check{i}} =& \varphi_{,\check{t}} \varphi_{,\check{i}}\,, \end{align} and the only dangerous term is \begin{eqnarray} \label{eq:KGCond2} \big[\xi\big]:\,\,\gamma^{\check{k}\check{l}} \varphi_{,\check{k}} \varphi_{,\check{l}} = \sum_{\check{k}}\frac{(\varphi_{,\check{k}})^2}{\gamma^e_{\iota \mathrel{\hat{=}} \check{k}}}\,. \end{eqnarray} Combining with our earlier discussion on the Klein-Gordon equation, and noting that the $\gamma^e_{\iota}$s can decline at different rates (or that there are still two regularity equations arising from Eqs.~\ref{eq:KGDetails} and \ref{eq:KGCond2} even if they do share the same rate), but there is only one variable $\varphi$, we obtain the conditions \vspace{3mm} \noindent $\mathcal{C}^3_s$: \emph{The first and second spatial derivatives of $\varphi$ must vanish sufficiently quickly as compared to the spatial metric, in the sense that $\varphi_{,\check{i}} = \mathcal{O}\left((\gamma^e_{\iota\mathrel{\hat{=}} \check{i}})^{1/2}\right)$ and $\varphi_{,\check{i}\check{i}} = \mathcal{O}\left(\gamma^e_{\iota\mathrel{\hat{=}} \check{i}}\right)$. } \vspace{3mm} \noindent These spatial homogeneity conditions ensure that ${T}_{\check{i}\check{j}}$ and ${T}_{\check{t}\check{j}}$ vanish on $\Sigma$, but none of the terms in $T_{\check{t}\check{t}}$ need to. Unfortunately then, $\mathcal{C}_s^3$ alone is not sufficient to ensure potential energy dominance to launch inflation if $\varphi$ is the inflaton. \subsubsection{The inflationary universe} \label{sec:Inflation} Nevertheless, additional supplementary junction conditions $\mathcal{C}_{\rm sup}$ can be obtained through physical considerations. Such conditions are not needed by the mathematical regularity of the various equations of motion, so not strictly the subject of the present paper. Nevertheless, they owe their appearance to $\mathcal{C}_s$, and are thus interesting to investigate. It is to be noted that the energy density $T_{\check{t}\check{t}}$ as given by Eq.~\eqref{eq:EnergyKG} is a special (scalar field) case of the matter density $\rho$ that appears in FLRW derivations (the FLRW comoving coordinates are Gaussian normal, so $\xi$ is automatically the worldline of a comoving observer), and will scale as $\rho\propto a^{-3(1+w)}$, when the equation of state is $P=w\rho$. So if $\rho$ is finite at $a=0$, it will vanish at later times unless $w \leq -1$. Looking at the same issue in reverse, if instead $\rho\neq 0$ when $a > 0$ with a $w > -1$, the FLRW will have a diverging Hubble's parameter $\mathcal{H}=a_{,t}/a$ on $\Sigma$, defying $\mathcal{C}_s^1$ which requires it to be regular. We can see this quite readily from the Friedmann equation \begin{eqnarray} \label{eq:FRWMatch} 3\mathcal{H}^2 = 8\pi \rho - \frac{{}^{(3)}R}{2} + \Lambda\,. \end{eqnarray} Since we have required ${}^{(3)}R$ to remain regular on $\Sigma$ (for FLRW, this requires flatness $\kappa=0$, thus ${}^{(3)}R|_{\Sigma}=0$), and $\Lambda$ is just a constant, there is nothing to cancel with the divergence from $\rho$. Furthermore, adding anisotropy would unlikely be helpful, because while it adds a shear scalar term \cite{1983PhRvD..28.2118W} \begin{align} \sigma^2 \equiv& \frac{1}{2}\left( K_{\check{i}\check{j}}-\frac{1}{3}K\gamma_{\check{i}\check{j}} \right) \left( K_{\check{k}\check{l}}-\frac{1}{3}K\gamma_{\check{k}\check{l}} \right) \gamma^{\check{i}\check{k}}\gamma^{\check{j}\check{l}} \notag \\ =& \frac{1}{2}\text{tr}(K\cdot K)-\frac{1}{6}K^2 \end{align} into the right hand side of Eq.~\eqref{eq:FRWMatch}, this term is regulated by $\mathcal{C}_s^1$ to be non-divergent. In summary, $\mathcal{C}_s^1$ and the fact that our universe has a non-vanishing matter energy density today, together, force a scalar inflaton field $\varphi$ to be the only matter near $\Sigma$ (c.f.,~Ref.~\cite{2002PhRvD..65h3507A}), which must also behave like a perfect cosmological constant with $w=-1$ (we ignore the $w <-1$ case since there are no accepted matter models with that kind of equation of state). This makes physical sense, since traditional particles of constant finite spatial metric sizes (the standard assumption is that the sizes of particles like electrons are determined by local physics and will not scale with the cosmic size $a$) shouldn't already exist all the way back at $\Sigma$, or else they will each engulf the entire spatial slice and overlap with one another, at the very least significantly deviate from our normal intuition of how they behave. A potential-energy-dominated inflaton field or cosmological constant do not need to possess any finite-spatial-size features on the other hand, and can be accommodated quite easily. They will also not dilute or concentrate, so won't produce diverging stress-energy tensors when $a=0$. We therefore impose the condition \vspace{3mm} \noindent $\mathcal{C}_{\rm sup}: $\emph{ $\varphi_{,\check{a}} \rightarrow 0$ sufficiently quickly so $T_{\check{t}\check{t}}|_{\Sigma}$ as given by Eq.~\eqref{eq:EnergyKG} is contributed only by the potential $\mathcal{V}$ and the cosmological constant. } \vspace{3mm} \noindent This condition translates directly into the Cartesian coordinates for FLRW (recall $\kappa=0$), which coincide with the principal coordinates associated with the timelike geodesic at the arbitrarily chosen spatial origin. As a consequence, the Lorentzian universe will be born directly into an inflationary period with (solving Eq.~\ref{eq:FRWMatch} for the FLRW case) \begin{eqnarray} \label{eq:Infl} a(t) \approx \mathcal{B} e^{\lambda t}, \quad \lambda=\mathcal{H}=\sqrt{\frac{8\pi \mathcal{V}|_{\Sigma}+\Lambda}{3}}\,, \end{eqnarray} where $\mathcal{B}$ is a constant, and the approximation is valid regardless of the shape of the potential $\mathcal{V}$, because $\mathcal{C}_{\rm sup}$ sets inflation off with an instantaneous no-rolling configuration $\varphi_{,t}|_{\Sigma}=0$. However, since (c.f.~Eq.~\ref{eq:KGDetails}) \begin{eqnarray} \label{eq:KGFLRW} \varphi_{,tt}=-3\mathcal{H}\varphi_{,t}-\mathcal{V}' \end{eqnarray} does not need to vanish initially, the $\varphi$ field will eventually begin to roll. A flattish $\mathcal{V}$ could significantly prolong inflation though, depending on the location of the flat region in relation to $\varphi|_{\Sigma}$, either by reducing initial $\varphi_{,tt}|_{\Sigma}=-\mathcal{V}'|_{\Sigma}$ to delay rolling (if $\mathcal{V}'|_{\Sigma} =0$ precisely, the Klein-Gordon Eq.~\ref{eq:KGFLRW} is satisfied at all times without $\varphi$ ever changing), or/and to allow the $\varphi$ field to settle into a standard slow-roll regime of $\varphi_{,t}\approx -\mathcal{V}'/(3\mathcal{H})$ at a later time. Regardless, the constraints on regularity within route B, through $\mathcal{C}_{\text{sup}}$ (as a consequence of $\mathcal{C}_s^1$) specifically, compels inflation to start without delay (in reverse, such an inflationary homogeneous early universe is in compliance with all the conditions in this paper). I.e., there isn't a pre-inflationary radiation- or kinetic-dominated deceleration phase, the signatures of which had been searched for, but indeed not found in observational data \cite{2018arXiv180706211P}. Furthermore, the conditions $\mathcal{C}^{2}_{s}$, $\mathcal{C}^{3}_{s}$ and $\mathcal{C}_{\text{sup}}$ are beneficial to the inflation paradigm in another sense, that they could conceivably take us to the required initial homogeneity \cite{1992PhR...214..223G,2000PhRvD..61b3502V,2003PhRvD..67h3515A} (a more precise quantitative and non-perturbative statement of this requirement would facilitate further analysis). \section{Discussion and conclusion} \label{sec:Conclusion} In this paper, we have examined what classical junction conditions would be required for a transition of our universe into a purely timelike Riemannian regime through the big bang. So far, the restrictions they impose do not appear to raise immediate contradictions that would spoil the viability of the signature change scenario in terms of describing our physical universe. Instead, useful constraints seem to arise. E.g., the conditions $\mathcal{C}_s^1$ and $\mathcal{C}_s^2$ (particularly in the form of Eq.~\ref{eq:CondRiemann}) enforce that as we approach $\Sigma$ along a timelike geodesic $\xi$, the geodetically developed spatial slices in the principal coordinate system associated with $\xi$ become intrinsically and extrinsically flat. Because the direction of $\xi$ can be chosen freely ($\xi$ is any temporal coordinate curve of any Gaussian normal system, which can be built out of arbitrary timelike congruences), this means that, via the Gauss-Codazzi equation, the projection of the 4-D covariant Riemann curvature tensor onto any spatial tangent plane at a point near $\Sigma$ must be small (when written in sensible coordinates whose Jacobian against the principal coordinates associated with the timelike geodesic orthogonal to that plane does not diverge). Although the spatial projection operator is rank deficient, its kernel is only one dimensional (specifically the tangential direction to $\xi$; the projection will yield zero for nonvanishing vectors only if the vector is precisely along this direction), so if the projection is vanishingly small for any arbitrary $\xi$, the full 4-D covariant Riemann tensor should be nearly zero (because any large component hidden inside the kernel of one projection operator would have been exposed by a different operator). In this sense, a strong version of the low gravitational entropy condition for the early universe, mentioned in item $3$ of Sec.~\ref{sec:Intro2}, is realized. In particular, the inflationary FLRW discussed in Sec.~\ref{sec:Inflation}, that's compatible with $\mathcal{C}_s^{1/2}$, not only has a vanishing 4-D Weyl curvature as FLRW metrics always do due to their symmetries, but the entire 4-D Riemann curvature vanishes when $a\rightarrow 0$. In contrast, this is not the case with dust or radiation dominated FLRWs that do not satisfy $\mathcal{C}_s^{1}$. Our conditions $\mathcal{C}^{1/2/3}_s$ and $\mathcal{C}_{\rm sup}$ are however not yet as strong as they can be. While they ensure the existence of one-sided limits such as ${}^{\mp}G_{ab}|_{\Sigma}$, so that the equations of motion for metric and matter can be extended onto the big bang $\Sigma$ from either side, they do not require that the ${}^{\mp}$ limits match up, which would force the two signature regimes to connect up in a smoother manner. This omission is intentional (besides trying to be conservative given our ignorance of whether the matching is absolutely necessary), because then the one-sided conditions enumerated in this paper would admit physical interpretations independent of signature change. Namely, they need to be satisfied if the equations of motion are to be extended onto the big bang itself. Without including the big bang into the domain of validity for these equations, the Lorentzian universe will become an open set, without a suitable boundary to impose boundary (initial) conditions on. In other words, regardless of one's view on what happens beyond the big bang, the main result of this paper can be read as necessary conditions for our Lorentzian universe to admit a Cauchy description. The utility of this paper thus does not fully diminish even if the signature change scenario is not physically realized in nature. There are many important issues that we have not been able to tackle. In particular, unlike in \cite{1992CQGra...9.1535E,1992GReGr..24.1047E}, where the genuinely classical transition into a spacelike Riemannian region occurs prior to the Planck time, it seems more difficult for us to circumvent the issue of quantum gravity, because the scale factor do need to vanish in our case. The theory of quantum gravity is as yet unavailable, thus our discussion merely aims to shed some light on the possible behaviour of the classical saddle point solutions that hopefully would dominate the full quantum path integral. Having said that, it must be noted though, that whether such a semi-classical approach even makes sense in the gravitational context is presently subject to debate \cite{2017PhRvL.119q1301F,2017PhRvD..96d3505D}. Furthermore, one could also note that the criteria for the onset of quantum gravity, based on dimensional analysis, is not Lorentz invariant unless one demands macroscopically separated events connected by null rays also be treated quantum gravitationally \cite{2002GReGr..34.2043H}, a prospect that has not been shown to be necessary. Taken to the extreme, this appears to indicate that the distances computed with the Lorentzian metric may not be the sole determining factor regarding the onset of quantum gravity, and one should perhaps be more circumspect when stating that quantum gravity must be evoked near the transition surface, which in our case could just be another macroscopic null surface. In other words, the trans-Plankian problem \cite{2001PhRvD..63l3501M} of inflation might not necessarily arise. Finally, even staying at the purely classical level, the junction conditions examined in this paper are minimal, in that while they ensure initial conditions can be imposed on the big bang, they do not tell us whether the evolution off of such compliant (with the junction conditions) initial data sets can be a well-posed initial value problem. In other words, they do not guarantee that physically interesting solutions (not plagued by wild exponentially growing perturbations, which inevitably lead to an extreme prevalence of singularities that appear to arise spontaneously) exist (the inflationary FLRW do satisfy the junction conditions, but its stability may need further scrutiny within our context). For different purposes, the required level of well-posedness is different. When trying to simulate the universe on a computer, initial conditions even off of the constraint surface (i.e., do not strictly satisfy the Hamiltonian and momentum constraints) are relevant, since numerical errors are inevitable, not least because computers cannot store numbers to infinite digits (i.e., we always have truncation error). There is of course the possibility that our physical universe is not amenable to being studied this way, and the well-posedness condition can presumably be relaxed to considerations on only a neighbourhood of the constraint-satisfying initial conditions space, surrounding that of our actual universe. Regardless, answering this well-posedness question demands substantial technical dexterity (as attested by the already strenuous work that went into proving the well-posedness of specific formulations of Einstein's equations off more familiar spacelike Cauchy surfaces), and will have to be addressed in future works. \acknowledgements This work is supported by the National Natural Science Foundation of China grants 11503003 and 11633001, the Interdiscipline Research Funds of Beijing Normal University, and the Strategic Priority Research Program of the Chinese Academy of Sciences Grant No. XDB23000000.
\section{Introduction} In this work we consider the equation for the density matrix \begin{equation}\label{eq:mainEq} \frac{d}{dt} \rho_t = \mathcal{L}(\rho_t), \qquad \mathcal{L}(\rho) = \sum_{k=1}^K \lambda_k (U_k \rho U_k^{\dagger} - \rho), \qquad \lambda_k >0, \end{equation} where $ U_k $ are unitary operators with the generators which are quadratic in bosonic creation and annihilation operators (squeeze operators). Such generators naturally arise in the case of averaging with respect to classical Poisson processes. These processes have the intensities $ \lambda_k $ and lead to unitary jumps $ U_k $ \cite{Holevo96, Holevo98}. In a finite dimensional Hilbert space the dilation of form \eqref{eq:mainEq} by the Poisson process was discussed in \cite{Kummerer87}. Let us note that Poisson processes and the correspondent quantum Markov equation arise in physical applications \cite{accardi2002quantum, vacchini2009quantum, Basharov2014, TrubBash2018}. Unitary evolution with the quadratic generators mentioned above was discussed in \cite{Fried1953, Ber86, Manko79, Manko87, dodonov2003theory, Cheb11, Cheb12}. Let us also note that the generator $ \mathcal{L} $ has \textit{Gorini-Kossakowski-Sudarshan-Lindblad} (GKSL) form \cite{gorini1976completely, lindblad1976generators} \begin{equation*} \mathcal{L}(\rho) = \sum_{k=1}^K \left(L_k \rho_t L_k^{\dagger} - \frac12 L_k^{\dagger} L_k\rho- \frac12 \rho L_k^{\dagger} L_k\right), \end{equation*} if one assumes $ L_k = \sqrt{\lambda_k} U_k $. We need an additional bit of notation to formulate our result. Notation here is similar to \cite{Ter16, Ter17a, Ter19}. We consider the Hilbert space $\otimes_{j=1}^n\ell_2$. In such a space one could \cite[Paragraph 1.1.2]{scalli2003} define $n$ pairs of creation and annihilation operators satisfying \textit{canonical commutation relations} (CCR): $ [\hat{a}_i, \hat{a}_j^{\dagger}] = \delta_{ij}$, $ [\hat{a}_i, \hat{a}_j] = [\hat{a}_i^{\dagger}, \hat{a}_j^{\dagger}]= 0 $. Let us define the $2n$-dimensional vector $\mathfrak{a} = (\hat{a}_1, \cdots, \hat{a}_n, \hat{a}_1^{\dagger}, \cdots, \hat{a}_n^{\dagger} )^T$. Linear and quadratic forms in such operators we denote by $ f^T \mathfrak{a} $ and $ \mathfrak{a}^T K \mathfrak{a} $, respectively. Here, $ f \in \mathbb{C}^{2n} $ and $ K \in \mathbb{C}^{2n \times 2n} $. Define the $2n \times 2n$-dimensional matrices as \begin{equation*} J = \biggl( \begin{array}{cc} 0 & -I_n \\ I_n & 0 \end{array} \biggr), \qquad E = \biggl( \begin{array}{cc} 0 & I_n \\ I_n & 0 \end{array} \biggr), \end{equation*} where $ I_n $ is the identity matrix from $ \mathbb{C}^{n \times n} $. CCR in such a notation takes the form $ [f^T \mathfrak{a},\mathfrak{a}^T g] = - f^T J g, \forall g, f \in \mathbb{C}^{2n}, $ we also write it in the shorter form $ [\mathfrak{a},\mathfrak{a}^T] = - J $. We also define the $\sim$-conju\-ga\-tion of vectors and matrices by the formulae \begin{equation*} \tilde{g} = E\overline{g}, \; g \in \mathbb{C}^{2n}, \qquad \tilde{K} = E \overline{K} E, \; K \in \mathbb{C}^{2n \times 2n}, \end{equation*} where the overline is an (elementwise) complex conjugation. \begin{theorem}\label{th:main} Let the density matrix $ \rho_t $ satisfy Eq.~\eqref{eq:mainEq}, where the unitary operators $ U_k$, $ k=1, \ldots, K $, are defined by the formulae $ U_k = e^{- \frac{i}{2} \mathfrak{a}^T H_k \mathfrak{a} } $, $ H_k = H_k^T = \tilde{H}_k \in \mathbb{C}^{2n \times 2 n} $, and $ \langle \otimes_{m=1}^M \mathfrak{a} \rangle_0 < \infty$, then the dynamics of the moments have the form \begin{equation}\label{eq:momDynam} \langle \otimes_{m=1}^M \mathfrak{a} \rangle_t = e^{\sum_{k=1}^K\lambda_k (\otimes_{m=1}^M S_k - I_{(2n)^M}) t} \langle \otimes_{m=1}^M \mathfrak{a} \rangle_0, \qquad S_k = e^{i J H_k}, \end{equation} where the average is defined by the formula $ \langle \otimes_{m=1}^M \mathfrak{a} \rangle_t \equiv \mathrm{tr} \; (\rho_t \otimes_{m=1}^M \mathfrak{a} ) $. In particular, for the first and second moments we have \begin{equation*} \langle\mathfrak{a}\rangle_t = e^{\sum_{k=1}^K \lambda_k(S_k - I_{2n}) t} \langle\mathfrak{a}\rangle_0, \qquad \langle\mathfrak{a} \otimes \mathfrak{a}\rangle_t = e^{\sum_{k=1}^K \lambda_k (S_k \otimes S_k - I_{4 n^2}) t} \langle \mathfrak{a} \otimes \mathfrak{a} \rangle_0. \end{equation*} \end{theorem} Here $ I_{(2n)^m} $ is the identity matrix in $ \mathbb{C}^{2n} \otimes \cdots \otimes \mathbb{C}^{2n} = \mathbb{C}^{(2n)^m} $. $ \langle \otimes_{m=1}^M \mathfrak{a} \rangle_0 < \infty$ means that the operators in the tensor $ \otimes_{m=1}^M \mathfrak{a} \rho_0 $ are nuclear. \section{Moments dynamics} In this section we prove theorem \ref{th:main} splitting it into several lemmas. \begin{lemma} \label{lem:conjGen} Let $ \rho $ be a nuclear operator and $ \hat{X} $ be an operator in $ \otimes_{j=1}^n\ell_2 $ which could be unbounded, but the operators $ U_k^{\dagger} \hat{X} U_k \rho $, $ k=1, \ldots, K $ and $ \hat{X} \rho $ are nuclear, then \begin{equation*} \mathrm{tr} \, \hat{X} \mathcal{L}(\rho) = \mathrm{tr} \, \mathcal{L}^* (\hat{X})\rho, \end{equation*} where \begin{equation}\label{eq:conjGen} \mathcal{L}^* (\hat{X}) = \sum_{k=1}^K \lambda_k (U_k^{\dagger} \hat{X} U_k - \hat{X}). \end{equation} \end{lemma} \begin{demo} As the trace of the nuclear operator is basis independent, then we have $ \mathrm{tr} \,(U_k^{\dagger} \hat{X} U_k \rho ) = \mathrm{tr} \,(V U_k^{\dagger} \hat{X} U_k \rho V^{\dagger})$ for an arbitrary unitary operator $ V $ in $ \otimes_{j=1}^n\ell_2 $. Assume $ V = U_k $, then $ \mathrm{tr} \,(U_k^{\dagger} \hat{X} U_k \rho ) = \mathrm{tr} \,(\hat{X} U_k \rho U_k^{\dagger})$. By applying this reasoning to each summand \eqref{eq:mainEq} we obtain \eqref{eq:conjGen}. \qed \end{demo} Thus, the GKSL equation in the Heisenberg representation takes the form \begin{equation}\label{eq:GKSLHeis} \frac{d}{dt} \hat{X}_t = \sum_{k=1}^K \lambda_k (U_k^{\dagger} \hat{X} U_k - \hat{X})_t. \end{equation} Lemma 3.1 from \cite{Ter17a} in the case, when $ K = i H $, $ M =0 $, $ g=0 $, by the arbitrariness of $ f $ takes the following form. \begin{lemma} Let $ H = H^T \in \mathbb{C}^{2 n \times 2n} $, then \begin{equation*} e^{ \frac{i}{2} \mathfrak{a}^T H \mathfrak{a} } \mathfrak{a} e^{- \frac{i}{2} \mathfrak{a}^T H \mathfrak{a} } = S \mathfrak{a} , \qquad S = e^{i J H}. \end{equation*} \end{lemma} Let us note that in accordance with \cite{Ter16} in the case, when $ \tilde{H} = H$, the operator $ \frac12 \mathfrak{a}^T H \mathfrak{a} $ is self-adjoint. Hence, the operator $ e^{- \frac{i}{2} \mathfrak{a}^T H \mathfrak{a} } $ is unitary. Thus, the operators $ U_k $ defined in theorem \ref{th:main} are unitary. \begin{lemma} \label{lem:sympTransform} If $ \mathcal{L}^* $ is defined by formula \eqref{eq:conjGen} in the case, when $ U_k = e^{- \frac{i}{2} \mathfrak{a}^T H_k \mathfrak{a} } $, $ H_k = \tilde{H}_k \in \mathbb{C}^{2n \times 2 n} $, one has \begin{equation*} \mathcal{L}^*(\otimes_{m=1}^M \mathfrak{a}) = \sum_{k=1}^K \lambda_k (\otimes_{m=1}^M S_k - I_{(2n)^M}) \otimes_{m=1}^M \mathfrak{a} , \qquad S_k = e^{i J H_k}. \end{equation*} \end{lemma} \begin{demo} Taking into account lemma \eqref{eq:conjGen} \begin{equation*} \mathcal{L}^*(\otimes_{m=1}^M \mathfrak{a} ) = \sum_{k=1}^K \lambda_k (U_k^{\dagger} (\otimes_{m=1}^M \mathfrak{a} ) U_k - \otimes_{m=1}^M \mathfrak{a} ) = \sum_{k=1}^K \lambda_k ( \otimes_{m=1}^M (U_k^{\dagger} \mathfrak{a} U_k) - \otimes_{m=1}^M \mathfrak{a}). \end{equation*} By lemma \ref{lem:sympTransform} we have $ U_k^{\dagger} \mathfrak{a} U_k= e^{\frac{i}{2} \mathfrak{a}^T H_k \mathfrak{a} } \mathfrak{a} e^{- \frac{i}{2} \mathfrak{a}^T H_k \mathfrak{a} } = e^{i J H_k} \mathfrak{a} = S_k \mathfrak{a} $. Thus, we obtain \begin{equation*} \mathcal{L}^*(\otimes_{m=1}^M \mathfrak{a} ) = \sum_{k=1}^K \lambda_k ( \otimes_{m=1}^M ( S_k \mathfrak{a} ) - \otimes_{m=1}^M \mathfrak{a}) = \sum_{k=1}^K \lambda_k (\otimes_{m=1}^M S_k - I_{(2n)^M}) \otimes_{m=1}^M \mathfrak{a}.\qed \end{equation*} \end{demo} \noindent\textbf{Proof of theorem \ref{th:main}}. By lemmas \ref{lem:conjGen} and \ref{lem:sympTransform} we obtain the following GKSL eq\-ua\-tion in the Heisenberg representation \eqref{eq:GKSLHeis} in the case, when $ \hat{X}_t = (\otimes_{m=1}^M \mathfrak{a})_t $. \begin{equation*} \frac{d}{dt} (\otimes_{m=1}^M \mathfrak{a})_t = \sum_{k=1}^K \lambda_k (\otimes_{m=1}^M S_k - I_{(2n)^M})( \otimes_{m=1}^M \mathfrak{a})_t. \end{equation*} When we apply lemma \ref{lem:conjGen}, we take into account that the linear combinations of nuclear operators in the tensor $ \otimes_{m=1}^M \mathfrak{a} \rho_0 $ are also nuclear ones. The obtained equation is a linear ordinary differential equation with respect to the tensor $ ( \otimes_{m=1}^M \mathfrak{a})_t $. Hence, its solution could be represented in terms of matrix exponential of the $ (2n)^M\times(2n)^M $-matrix $ \sum_{k=1}^K \lambda_k (\otimes_{m=1}^M S_k - I_{(2n)^M}) t $, i.e. \begin{equation*} (\otimes_{m=1}^M \mathfrak{a})_t = e^{\sum_{k=1}^K \lambda_k (\otimes_{m=1}^M S_k - I_{(2n)^M}) t} (\otimes_{m=1}^M \mathfrak{a})_0. \end{equation*} By averaging over the initial density matrix $ \rho_0 $, we obtain \eqref{eq:momDynam}.\qed \section{Conclusions} In this work the explicit expressions for dynamics of the density matrix moments were obtained. This density matrix satisfies equation \eqref{eq:mainEq} with the squeeze operators. The possible directions of the further generalizations are analogous calculations in the fermionic case (it could be done by means of \cite{Ter19,Ter17}) and the consideration of arbitrary Gaussian channels \cite{Holevo15} instead of weighted sums of unitary Gaussian channels. In the latter case we also obtain linear differential equations for the moments, but they have more complicated form.
\section{Introduction} Experimental measurements during the stagnation phase of Inertial Confinement Fusion (ICF) implosions are primarily aimed towards diagnosing the hot fusing fuel conditions. This is in part due to the low emittance of the dense fuel, compared to the hotspot, preventing any direct observation. Scattering of neutrons\cite{Johnson2012,Frenje2010} and Compton radiography\cite{Hall2014} are used to infer the areal density ($\rho$R) of the dense confining fuel, however other hydrodynamic properties of this region remain undetected. Measurements of the temperature and velocity of the dense DT fuel would be valuable in understanding the stagnation phase hydrodynamics. Residual kinetic energy in the shell can account for a significant loss of energy coupled to the hot fuel \cite{Bose2017}. While a higher temperature, and therefore adiabat, would directly reduce the compressibility and areal density \cite{Zhou2007}. The backscatter edge has been identified as a new diagnostic that will enable insight into the dense fuel conditions.\\ DT fusion neutrons that undergo 180$\degree$ elastic scatter from ions lose the largest fraction of their energy possible for a single scattering event. This produces a sharp edge in the neutron spectrum. For stationary target ions, the resultant edge energy is dependent only on the ion mass and incoming neutron energy. However, if the target ion has significant velocity (due to thermal or non-thermal motion) this will affect the energy of the backscattering neutron. Therefore the energy spectrum of these backscattering neutrons can be related to the hydrodynamic conditions of the ions from which the scattering occured. Previous work by Crilly \textit{et al.}\cite{Crilly2018} showed the early development of the analysis by looking at the effect of fluid velocity on the the backscatter edge. Simulated neutron spectra from an asymmetrically driven capsule implosion showed differences in the fluid velocity and deceleration as inferred from the nT edge. However, the effect of the thermal velocities of the scattering ions on the neutron spectrum was neglected; in this work the effect of temperature will be included. It will be demonstrated that temperature also has a significant effect on the shape of the backscatter edge.\\ The theory behind the spectral shape of the backscatter edge will be developed in section \ref{BSshape_section}. It is shown that the spectral shape is dependent on the scattering rate weighted ion velocity distribution. Section \ref{implosion_dynamics} will discuss how the moments of this distribution are related to hydrodynamic quantities of the capsule. 1D Radiation hydrodynamics simulations are post-processed to investigate the various contributions to the ion velocity distribution. In section \ref{nspec_backgrounds} a model is developed in order to fit the shape of backscatter edge while accounting for the spectral background. This model is tested on synthetic neutron spectra from hydrodynamics simulations. Finally in section \ref{MultiDeffects}, the extension of the analysis to perturbed 3D implosions is discussed. \section{Backscatter Edge Spectral Shape}\label{BSshape_section} The scattering kinematics of neutrons are affected by the velocities of ions with which they interact. In the general case, this is accounted for by a frame transformation from the beam-target frame of the neutron and stationary ion to the lab frame in which the ion is non-stationary. The backscattering geometry simplifies this transform greatly, using the notation that primed quantities are pre-collision and unprimed post-collision: \begin{subequations}\label{classicalkinematices} \begin{align}\label{bs_vel} v_n &= \frac{A_i-1}{A_i+1}v'_n+\frac{2A_i}{A_i+1}v'_{i,\parallel} \\ \mbox{Where} \ v'_{i,\parallel} &\equiv \frac{\pvec{v}'_{i}\cdot\vec{v}_{n}}{v_n} = -\frac{\pvec{v}'_{i}\cdot\pvec{v}'_{n}}{v'_n} \nonumber \end{align} Here subscripts indicate the particle species ($n$ and $i$ for neutron and ion) and $A_i$ is the mass ratio between the ion and neutron. As the pre-collision neutron and ion velocities are uncorrelated, the mean and variance of the final neutron velocity are simply given by: \begin{align} \langle v_n\rangle &= \frac{A_i-1}{A_i+1}\langle v'_n\rangle+\frac{2A_i}{A_i+1}\langle v'_{i,\parallel}\rangle \\ \mbox{Var}(v_n) &= \frac{A_i-1}{A_i+1}\mbox{Var}( v'_n)+\frac{2A_i}{A_i+1}\mbox{Var}( v'_{i,\parallel}) \end{align} \end{subequations} The pre-collision neutron velocity mean and variance are determined by hotspot conditions\cite{Appelbe2011,Appelbe2014,Munro2016}. The scattering medium conditions determine the pre-collision ion velocity mean and variance. Any bulk motion will cause a shift in the edge position and any variation in ion velocity, be it temperature or variance in fluid velocity, will create a broadening of the edge. Hence an analogy can be drawn between the backscatter edge moments and the moments of the primary DT fusion neutron peak. While the DT peak moments are only sensitive to the burn-weighted properties of the hotspot, the backscatter edge shape is also sensitive to the scattering rate weighted properties of the scattering medium.\\ The form of the backscatter edge is found by evaluating the spectrum of singly collided neutrons. This is given by the product of the uncollided or 'birth' neutron flux, $\Psi_b$, and the nuclear interaction differential cross section of the background ions integrated over all space, time, incoming neutron direction, $\hat{\Omega}'$, and energy, $E'$: \begin{equation*} I_{1s}(E,\hat{\Omega}) = \int d\tau_i \int d\hat{\Omega}' \int dE' \frac{d^2\sigma_i}{dEd\Omega}\Psi_b(\vec{r},\hat{\Omega}',E') \end{equation*} Where $d\tau_i = n_idVdt$ and $n_i$ is the number density of ions of species $i$. By assuming energy separability, the birth neutron flux can be split into the spatial angular flux, $\psi_b$, and a normalised birth energy spectrum, $Q_b$. The resultant total spectrum of singly interacting neutrons travelling in direction, $\hat{\Omega}$, with energy, E, is then given by: \begin{align} I_{1s}(E,\hat{\Omega}) &= \int d\tau_i \int d\hat{\Omega}' \psi_b(\vec{r},\hat{\Omega}') \int dE' \frac{d^2\sigma_i}{dEd\Omega}Q_b(E',\hat{\Omega}')\label{collision_source} \end{align} As the densest regions of the capsule are situated outside the fusing plasma, the birth energy spectra across these regions are well represented by the averaged spectrum, supporting energy separability. Here we have also assumed no attenuation between source and scattering site. Since the DT birth spectrum width is small compared to its mean, changes in spectral shape due to differential attenuation are small for typical ICF conditions\cite{Munro2016}.\\ For elastic collisions, energy and momentum conservation requires that the outgoing neutron energy is directly related to the pre-collision velocities and the scattering cosine, $\hat{\Omega}'\cdot\hat{\Omega} = \mu_0$. For a single ion velocity, the double differential cross section can therefore be written as\cite{takahashi1979}: \begin{subequations} \begin{equation} \frac{d^2\sigma_i}{dEd\Omega} = \frac{1}{2\pi}\frac{d\sigma_i}{d\mu_c}\left|\frac{\partial \mu_c}{\partial E}\right| \delta(\mu_0-\mu^*) \end{equation} Subscript $c$ denote terms in the centre of mass frame, $\mu^*$ is the lab frame scattering cosine which satisfies the conservation requirements. By only considering the backscatter geometry, where $\mu_0 = -1$, the neutron trajectory reduces to a single dimension and hence only depends on the parallel component of the ion velocity, as seen in equation \ref{bs_vel}. Therefore to include the summed total effect of a Maxwellian distribution of ion velocities, $M(\vec{r},v_{i,\parallel}')$, one integrates over $v_{i,\parallel}'$ with the associated distribution: \begin{align} \frac{d^2\sigma_i}{dEd\Omega} &= \int dv_{i,\parallel}' M(\vec{r},v_{i,\parallel}') \frac{1}{2\pi}\frac{d\sigma_i}{d\mu_c}\left|\frac{\partial \mu_c}{\partial E}\right| \delta(1+\mu^*) \\ \frac{d^2\sigma_i}{dEd\Omega} &= \int dv_{i,\parallel}' M(\vec{r},v_{i,\parallel}') \left(\frac{d\sigma_i}{dE}\right)_{bs} \label{ddx_maxwellian} \end{align} If the fluid velocity and ion temperature at coordinate $\vec{r}$ are $\vec{v}_f$ and $T_i$, then the Maxwellian, $M(\vec{r},v_{i,\parallel}')$, has mean $\vec{v}_f\cdot\hat{\Omega}$ and variance $T_i/m_i$.\\ \end{subequations} Combining equations \ref{ddx_maxwellian} and \ref{collision_source}, the complete backscattering spectrum function is obtained: \begin{subequations} \begin{align}\label{BSE_integral} I_{bs}(E,\hat{\Omega}) &= \int dv_{i,\parallel}' \int d\tau_i \ \psi_b(\vec{r},-\hat{\Omega}) M(\vec{r},v_{i,\parallel}') \nonumber \\ &\int dE' \left(\frac{d\sigma_i}{dE}\right)_{bs}Q_b(E',-\hat{\Omega}) \end{align} Note that the initial neutron direction has been set to satisfy the backscattering condition, i.e. $\hat{\Omega}' = -\hat{\Omega}$. The birth neutron flux at position $\vec{r}$ in direction $-\hat{\Omega}$ can be found via integration of the neutron production rate along chords. For a detector direction $\hat{\Omega}_{\mbox{det}}$, figure \ref{fig:3D-PDF-diagram} shows the geometry of the integral expression in equation \ref{BSE_integral}. \begin{figure}[htp] \centering \includegraphics*[width=0.485\textwidth]{3D-PDF-diagram.pdf} \caption{Diagram showing the geometry of the backscattered neutron source. Within the volume $dV$ neutrons are backscattering towards the detector along the line of sight $\hat{\Omega}_{\mbox{det}}$. The flux of birth neutrons, $\psi_b$, reaching $dV$ with energy spectrum $Q_b$ are travelling along a chord in the direction $-\hat{\Omega}_{\mbox{det}}$. The ions in $dV$ are assumed to have a Maxwellian distribution of velocities with fluid velocity $\vec{v}_{f}$ and temperature $T_i$.} \label{fig:3D-PDF-diagram} \end{figure} Noting the separation of terms dependent on position and on neutron birth energy, the integral can be expressed as an integral over ion velocity of two collected expressions: \begin{align}\label{PDF_def} I_{bs}(E,\hat{\Omega}) &= C \int dv_{i,\parallel}' P(v_{i,\parallel}',\hat{\Omega}) Q_{bs}(v_{i,\parallel}',E,\hat{\Omega})\\ \mbox{Where:} \ C &= \int d\tau_i \ \psi_b(\vec{r},-\hat{\Omega}) \approx \left\langle \rho R/\bar{m} \right\rangle Y_n\\ P(v_{i,\parallel}',\hat{\Omega}) &= \frac{1}{C}\int d\tau_i \ \psi_b(\vec{r},-\hat{\Omega}) M(\vec{r},v_{i,\parallel}') \label{PDF}\\ Q_{bs}(v_{i,\parallel}',E,\hat{\Omega}) &= \int dE' \left(\frac{d\sigma_i}{dE}\right)_{bs}Q_b(E',-\hat{\Omega}) \end{align} Where $Y_n$ is the birth neutron yield and $\bar{m}$ is the average ion mass in the scattering medium. Physically, $P(v_{i,\parallel}')$ is the normalised distribution of ion velocities seen by backscattering neutrons. This will change based on the hydrodynamic properties of the hotspot and fuel shell. Since the probability of scattering is $\propto n_i$, $P(v_{i,\parallel}')$ will be weighted more strongly towards the densest parts of the capsule. Hence measurement of the spectral shape of the backscatter edge will allow inference of the properties of the dense fuel. This distribution is converted to a backscatter edge shape through the averaged differential cross section, $Q_{bs}$. This term is determined by the primary DT birth spectrum and the elastic scattering differential cross section.\\ \end{subequations} In this work we will focus on the nT backscatter edge and hence the distribution of triton velocities. The theory above is general and applies for elastic scattering from any ion species. However, experimentally the nT edge is more accessible for current ICF target designs, as it has the greatest signal to background. Extra value is gained from the measurement of multiple backscatter edges. For example with both nT and nD edge measurements, separation of thermal and non-thermal broadening effects is possible due to the ion mass differences; a similar analysis exists for the DT and DD primary peaks \cite{Murphy2014,GatuJohnson2016}.\\ The classical expressions given in equations \ref{classicalkinematices} a-c are approximately correct however relativistic corrections are required in order to accurately find the position of the edge. This is due to the relativistic velocities of the DT primary neutrons ($\sim 0.17$c). For a 14 MeV neutron backscattering off a stationary triton ($A_i = 2.99...$) the classical and relativistic kinematic edges differ in energy by 20 keV, 3.483 MeV and 3.463 MeV respectively. Current nToF detectors have the energy resolution to detect these differences. The details of the relativistic collision kinematics can be found in Appendix A. In this section we have only considered pure backscatter events, however scattering angles less than 180$\degree$ must be considered in order to fully model the scattered neutron spectrum. This will be addressed in section \ref{IntegralModelSection}. \\ \section{Measuring Implosion Dynamics Near Stagnation}\label{implosion_dynamics} As the capsule starts to stagnate it consists of three distinct regions: hotspot, shocked shell and free-falling shell \cite{Betti2002}. The return shock acts as the boundary between the subsonic shocked material, composed of both the hotspot and shocked shell, and the unshocked material, which is rapidly inflowing at the implosion velocity. The boundary between the hotspot and shocked shell will be taken as the 1 keV ion temperature contour in this work. Neutrons scatter within each of these regions and the scattering kinematics will be influenced by the different hydrodynamic properties. The relative fraction of areal density in each of these regions will determine the proportion of scattering occurring. Here we will discuss the properties for implosions with weak alpha-heating; they are still compressing during neutron production as there is insufficient heating to sustain fusion reactions during re-expansion\cite{Tong2019}. The free-falling shell is cold ($\sim$ 100 eV) and imploding at or close to the implosion velocity ($\sim$ 300-500 km/s). The shocked shell is at a temperature of a few hundred eV and moving at several tens of km/s. Conditions within the hotspot change rapidly with radius; as the temperature drops, the density rises and hence the scattering neutrons are more sensitive to conditions towards the edge of the hotspot.\\ Of central importance to the backscatter edge shape is the distribution of ion velocities seen by backscattering neutrons, $P(v_{i,\parallel}')$. In the following analysis we will relate the properties of this distribution to relevant hydrodynamic quantities. For a 1D spherical profile, equation \ref{PDF} can be evaluated as follows: \begin{subequations} \begin{align} P(v_{i,\parallel}') &\propto \int dt \int 4\pi r^2 dr \ n_i(r,t) \int d\mu \ \psi_b(r,\mu,t) M(r,\mu, t) \label{1D_PDF_calc}\\ M(r,\mu, t) &= \sqrt{\frac{m_i}{2\pi T_i(r,t)}}\exp\left[-\frac{m_i\left(v_{i,\parallel}'+v_f(r,t)\mu\right)^2}{2T_i(r,t)}\right]\\ \psi_b(r,\mu,t) &= \int_{0}^{\infty} ds \ R_{DT}\left(\sqrt{r^2-2s\mu+s^2},t\right) \\ R_{DT}(r,t) &= f_Df_Tn_i^2(r,t)\langle\sigma v\rangle_{DT}\left(T_i(r,t)\right) \\ \mbox{Where:} \ \mu &= \hat{\Omega}'\cdot\hat{r} \ , \ \phi_b(r,t) = \int d\mu \ \psi_b(r,\mu,t) \nonumber \end{align} \end{subequations} Where $f_D$ and $f_T$ are the number fraction of D and T, $\langle\sigma v\rangle_{DT}$ is the DT reactivity\cite{Bosch1992} and the total birth flux, $\phi_b$, has been defined here for later use. Using the above equations, $P(v_{i,\parallel}')$ can be calculated without the need for a neutron transport calculation. This method also allows for the individual contributions from the hotspot, shocked and free-falling shell to the shape of the backscatter edge to be examined separately. \\ By taking moments of equation \ref{1D_PDF_calc}, expressions for the mean and variance, $\bar{v}$ and $\Delta_v^2$, of $P(v_{i,\parallel}')$ in terms of the appropriate average of hydrodynamic quantities are found: \begin{subequations} \begin{align} \bar{v} &= -\left\langle v_f \mu \right\rangle \label{vbar_def}\\ \Delta_v^2 &= \left\langle \frac{T_i}{m_i} \right\rangle + \left\langle v^2_f \mu^2 \right\rangle - \bar{v}^2 \label{deltav_def}\\ \mbox{Where:} \ \left\langle x \right\rangle &= \frac{\int dt \int 4\pi r^2 dr \ n_i \int d\mu \ \psi_b \ x(r,\mu,t)}{\int dt \int dr \ 4\pi r^2 n_i \phi_b} \nonumber \end{align} \end{subequations} Thus, from measurements of the backscatter edge, inferred $\bar{v}$ and $\Delta_v$ values can be interpreted in terms of the above scattering rate averaged hydrodynamic quantities. For a neutron point source, the scattering rate average reduces to: \begin{equation*} \left\langle x \right\rangle_{\mbox{p.s.}} = \frac{\int dt \frac{dY_n}{dt} \int dr \ n_i x(r,\mu = 1,t)}{\int dt \frac{dY_n}{dt} \int dr \ n_i} \end{equation*} i.e. a burn weighted areal density average, hence the quantities in equations \ref{vbar_def} and \ref{deltav_def} can be approximated as such. An extended neutron source reduces the contribution from the centre of the hotspot and introduces angular dependence to the neutron flux altering the effects of fluid velocity to the moments. \\ Through analysis of radiation hydrodynamics simulations a more detailed understanding of the information contained in the backscatter edge can be found. In this work we will focus on simulations of the single\cite{Sangster2008} and triple\cite{Goncharov2010} picket direct drive designs for OMEGA. These designs have been fielded experimentally and obtain high hotspot pressures and neutron yields\cite{Gopalaswamy2019}. In particular the triple and single picket shots 87653 and 89224 will be considered. In addition to the pulse shape differences, 89224 is a faster target (480 km/s compared to 390 km/s of 87653) leading to a higher burn-averaged ion temperature (4.8 keV compared to 3.8 keV of 87653). The simulations were performed by the 1D hydrodynamics code LILAC\cite{Delettrez1987}. \\ The triple picket design aims to minimize the shock preheating of the fuel and hence achieve a low in-flight adiabat \cite{Sangster2010}. This allows a high peak density to then be achieved in the fuel shell at stagnation. Therefore an increased fraction of the neutrons will scatter in the shell compared to the hotspot. The bangtime profiles for the LILAC simulation of shot 87653 are shown in figure \ref{fig:TP_bangtime}. Also shown is the angular integrated scattering rate, i.e. the averaging used in calculating $\bar{v}$ and $\Delta_v$. It follows the density profile closely outside the hotspot, showing that an areal density average is a good approximation in this region. Comparing the scattering and burn rate it is clear that the primary and scattered neutrons sample different regions. Nearly all primary neutrons are created in the hotspot and a considerable fraction of neutrons scatter in the shell regions. Hence the scattered neutron spectrum contains information of the hydrodynamic properties in regions of the stagnated capsule that are inaccessable via primary neutron measurements. \begin{figure}[htp] \centering \includegraphics*[width=0.485\textwidth]{lilac87653_bangtime} \caption{The bang time hydrodynamic (density $\rho$, ion temperature $T_i$ and fluid velocity $v_f$), burn rate (BR) and scattering rate (SR) profiles for the LILAC simulation of shot 87653. The vertical dotted lines show the position of the hotspot edge and return shock.} \label{fig:TP_bangtime} \end{figure} Given the capsule conditions throughout neutron production, calculation of $P(v_{i,\parallel}')$ and the resultant backscatter edge shape can be performed, see figure \ref{fig:TP_PDFBSE}. The individual contributions to $P(v_{i,\parallel}')$ from the hotspot, shocked and free-falling shell as well as the total mean and variance are given in table \ref{table:vbardeltav}. The positive $\bar{v}$ causes an upshift in the energy of the backscatter edge. The non-zero $\Delta_v$ causes an additional broadening of the edge over the slight broadening due to the variance in the birth neutron energy. \begin{figure}[htp] \centering \includegraphics*[width=0.485\textwidth]{PDF+BSE_TP.pdf} \caption{For shot 87653: the scattering triton velocity distribution as measured by backscattering neutrons (left) and the resultant single scattered spectral shape around the nT backscatter edge (right). The contributions from each region of the capsule are shown individually. (Right) The dashed black line shows the spectral shape if the velocities of the scattering ions are ignored.} \label{fig:TP_PDFBSE} \end{figure} The single picket design uses a pre-pulse designed to increase the adiabat to reduce hydrodynamic instability growth \cite{Goncharov2003}. A consequence of increased adiabat is reduced shell compressibility and hence a lower peak density is achieved in the shell at stagnation. Therefore an increased fraction of the neutrons will scatter in the hotspot compared to the shell. The calculated $P(v_{i,\parallel}')$ and backscatter edge shape for the LILAC simulation of shot 89224 are shown in figure \ref{fig:SP_PDFBSE}. The individual contributions to $P(v_{i,\parallel}')$ from the hotspot, shocked and free-falling shell as well as the total mean and variance are given in table \ref{table:vbardeltav}. \begin{figure}[htp] \centering \includegraphics*[width=0.485\textwidth]{PDF+BSE_SP.pdf} \caption{For shot 89224: the scattering triton velocity distribution as measured by backscattering neutrons (left) and the resultant single scattered spectral shape around the nT backscatter edge (right). The contributions from each region of the capsule are shown individually. (Right) The dashed black line shows the spectral shape if the velocities of the scattering ions are ignored.} \label{fig:SP_PDFBSE} \end{figure} From analysis of these two LILAC simulations some general remarks can be made about the various contributions to $\bar{v}$ and $\Delta_v$. Differences in these quantities can then be attributed to the physical processes which govern the individual behaviour of the hotspot, shocked and free-falling shell. \begin{table}[htb] \caption{Relative contributions from the three regions of the capsule to the scattering ion velocity distribution for simulations of the triple and single picket shots 87653 and 89224. Data for $\Delta_v^2$ have been converted to units of eV via the triton mass to aid comparison with scattering rate averaged temperatures, $\left\langle T_i \right\rangle$.} \begin{tabularx}{\linewidth}{c|X X X X}\label{table:vbardeltav} & Hotspot& Shocked Shell& Free-Falling Shell& Total \\ \hline 87653 - Triple Picket & & & & \\ Scatter fraction & 33\% & 50\% & 17\% & - \\ $\bar{v}$ / km/s & 34 & 40 & 255 & 75 \\ $\Delta_{v}^2$ / eV & 2878 & 784 & 555 & 1644 \\ $\left\langle T_i \right\rangle$ / eV & 2770 & 522 & 207 & 1206 \\ \hline 89224 - Single Picket & & & & \\ Scatter fraction & 45\% & 45\% & 10\% & - \\ $\bar{v}$ / km/s & 45 & 52 & 252 & 69 \\ $\Delta_{v}^2$ / eV & 3606 & 1107 & 1130 & 2359 \\ $\left\langle T_i \right\rangle$ / eV & 3396 & 544 & 475 & 1829 \\ \end{tabularx} \end{table} For $\bar{v}$, it was seen that in both cases the subsonic velocities of the hotspot and shocked shell are within 10 km/s of each other. The free-falling shell is considerably faster therefore a return shock which is less far through the fuel at bang time will cause higher $\bar{v}$ values. However generally $\lesssim$ 20$\%$ neutrons scatter in this region so $\bar{v}$ is closer to the velocity of the shocked fuel. By comparing the shocked and unshocked velocities and using the strong shock limit one finds the return shock is moving radially outwards in the lab frame at peak scattered neutron production. This is in agreement with the hydrodynamics simulations. As the shell implodes, it performs mechanical (PdV) work on the hotspot. Loss mechanisms, such as radiative cooling, must be balanced by compressive and alpha heating. Hence a high rate of mechanical work at bang time indicates both low alpha heating and high losses. Using measurements of hotspot pressure\cite{Cerjan2013} and radius, $\bar{v}$ can be used to calculate the rate of PdV work through an isobaric hotspot approximation: \begin{equation} W_{\mbox{mech}} = 4\pi P_{HS}R_{HS}^2\bar{v} \end{equation} The mechanical power was found to be 4.1 (3.8) and 6.2 (7.1) TW for 87653 and 89224 respectively, where bracketed terms are those calculated directly from the hydrodynamics simulations without approximation. Hence by combining measurements from the backscatter edge and current hotspot diagnostics, the work being done on the hotspot by the imploding shell at bang time can be calculated. \\ For $\Delta_v^2$, ion temperature is the dominant source of ion velocity variance in the hotspot, whereas both temperature and fluid velocity variance are significant for the shell. This leads to approximately 25\% of the total $\Delta_v^2$ being due to fluid velocity variance. For comparison, approximately 10\% of the apparent ion temperature as measured by the width of the primary DT peak\cite{Brysk1973,Ballabio1998,Appelbe2014,Munro2016} is due to fluid velocity variance in these simulations. The scattering rate averaged temperature, $\langle T_i \rangle$, depends on multiple factors within the stagnating capsule. If the shell density is lower, i.e. higher stagnation adiabat, a larger fraction of neutrons will scatter within the hotspot increasing the average temperature. Comparing the triple and single picket simulations, we find scatter weighted adiabats of 7.5 and 11.0 respectively within the shocked shell. Similar fractional change is seen in the total $\Delta_v^2$ for these simulations. Additionally if the temperature gradient at the edge of hotspot is higher this will also cause an increase in the $\langle T_i \rangle$ of the fuel. The fluid velocity variance in the shell can be due to both variation in space and time. To first order, the temporal variation is due to the average deceleration of the shell, $\langle a\rangle$, throughout neutron production, this can be estimated by the following: \begin{equation*} \mbox{Var}\left(v_f\mu\right)_{t} \approx 300\left[\left(\frac{\langle a\rangle}{1 \times 10^{15} \mbox{m/s}^2}\right)\left(\frac{BW}{100 \mbox{ps}}\right)\right]^2 \mbox{eV} \end{equation*} Where $BW$ is the nuclear burn width and the velocity variance has been converted to units of eV via the triton mass. Spatial variations in fluid velocity in the shell are generally dominated by the difference in velocities across the return shock. This can be estimated by assuming the return shock is approximately stationary in the lab frame and satisfies the strong shock conditions. Defining the fraction of shocked areal density, $\chi_{sh}$, and the pre-shock velocity, $v_{\mbox{pre}}$: \begin{equation*} \mbox{Var}\left(v_f\mu\right)_{s} \approx 300\left[\frac{9}{16}\chi_{sh}\left(1-\chi_{sh}\right)\left(\frac{v_{\mbox{pre}}}{100 \mbox{km/s} }\right)^2\right] \mbox{eV} \end{equation*} The fraction of shocked areal density will depend on the position of the return shock through the fuel and the pre-shock velocity is determined by the implosion velocity at the beginning of the deceleration phase. \section{Neutron Spectral Shape Model}\label{nspec_backgrounds} Since the nD and nT backscatter edges occur at low neutron energies there are multiple sources of background. For the nT edge these include; TT primary neutrons, nD single scattering, the D(n,2n) and T(n,2n) break up reactions and multiple scattering. Thus a general model is required in order to evaluate the shape of the edge and backgrounds. Due to the complexity of the backgrounds at lower neutron energies, ad hoc models have been opted for to fit the neutron background under the DD peak \cite{Hatarik2015} and in previous work on the nT edge \cite{Crilly2018}. However for fitting backscatter edges, the background is only constrained at lower energies after the edge, where no single scatter signal for that ion species exists. Therefore a more constraining "ab-initio" model is favoured to ensure the spectral shape under the edge is physical. \subsection{Integral Model}\label{IntegralModelSection} With knowledge of the differential cross sections of the various nuclear interactions, the distribution of scattering ion velocities and the birth neutron energy spectrum, the full scattered neutron spectrum can be approximated. The same simplifying assumptions used to obtain an expression for the spectral shape of the backscatter edge, equation \ref{BSE_integral}, can be used for a general scattering angle for elastic scattering interactions. For complex inelastic processes, such as the (n,2n) reactions, the effect of the ion velocity distribution has not been included. Since these reactions produce a broadband spectrum of neutrons for every scattering angle, the relative effect of ion velocities on the spectral shape is reduced. By assuming isotropy in areal density and birth spectrum, the single interaction components to the spectra are given by: \begin{equation} I_{1s}(E) = \int dv_{i,\parallel}' P(v_{i,\parallel}') \int dE' \frac{d\sigma_i}{dE}(E',v_{i,\parallel}') Q_{b}(E') \end{equation} Multiple interaction events can be treated in a similar fashion to the single interaction terms, however the source term is no longer the birth neutrons and is instead replaced by the scattered neutron source. The neutrons which undergo multiple scattering events will interact with a different unknown velocity distribution of ions so the zeroth order approximation of stationary ions is used. \begin{equation} I_{2s}(E) = \int dE' \frac{d\sigma_i}{dE}\left(E',v_{i,\parallel}' = 0\right) I_{1s}(E') \end{equation} The primary TT neutrons contribute to the spectral background below 9 MeV. Using the ratio of the DT and TT reactivities, the TT yield is calculated from the DT yield and the inferred burn averaged ion temperature. The temperature dependent shape of the TT spectrum has been evaluated by Appelbe \cite{Appelbe2016} and hence can be included in the model with relative ease. The single scattering of the TT neutrons is then evaluated in an identical manner to the single scattering of the DT neutrons. \\ The complete spectral model for the fitting of the backscatter edge includes the following contributions; single interactions (nT, nD, D(n,2n), T(n,2n)) of the DT and TT neutrons including the effects of scattering ion velocities, double interactions of the DT neutrons, and the uncollided TT neutrons. The model can be written as the following fitting function: \begin{align}\label{fullspecmodel} I_{bs}(E) = A_{1s}I_{1s}(E,\bar{v},\Delta_v)+A_{2s}I_{2s}(E,\bar{v},&\Delta_v) \\ &+A_{TT}I_{TT}(E) \nonumber \end{align} The amplitudes will have the following dependencies: $A_{1s} \propto \rho$R, $A_{2s} \propto (\rho$R$)^2$ and $A_{TT} \propto \exp\left(-\sigma\rho\mbox{R}\right)$. The scattering terms have been written as functions of the cumulants of the scattering ion velocity distribution, $P(v_{i,\parallel}')$. In order to fit experimental data some functional form needs to be assumed for $P(v_{i,\parallel}')$, a Gaussian approximation has been shown to produce reasonable results on synthetic data\cite{Crilly2018}, also see figures \ref{fig:TP_PDFBSE} and \ref{fig:SP_PDFBSE}. Figure \ref{fig:model_components} shows the various model components for various $\bar{v}$ and $\Delta_v$ values within the single Gaussian model for $P(v_{i,\parallel}')$. More complex models, such as three Gaussians for the hotspot, shocked shell and free-falling shell respectively, could be used to infer more information about the stagnated capsule but requires many free parameters. \begin{figure}[htp] \centering \includegraphics*[width=0.485\textwidth]{model_components.pdf} \caption{The components of the spectral model given in equation \ref{fullspecmodel} for various $\bar{v}$ and $\Delta_v$ values. The scattering ion velocity distribution was assumed to have a Gaussian functional form with mean $\bar{v}$ and standard deviation $\Delta_v$.} \label{fig:model_components} \end{figure} Experimental measurements of the underlying spectral shapes and differential cross sections has been made for a number of reactions included in this model; the nD and nT single scattering at $\sim$ 14 MeV\cite{Frenje2011}, the TT primary spectrum \cite{Casey2012} and the D(n,2n) reaction at $\sim$ 14 MeV \cite{Forrest2019}. Theoretical models\cite{ENDF,CENDL} in agreement with these measurements are then used at all neutron energies. For the T(n,2n) reaction, limited neutronic experimental data is available and hence there is a larger uncertainty in its spectral shape.\\ \subsection{Synthetic Data Comparison} The 1D spherical discrete ordinates neutron transport code Minotaur \cite{Crilly2018} has been developed to include the effects of fluid velocity and temperature on neutron elastic scattering. The effect of temperature is included in the scattering kernel by the integration over a Maxwellian distribution of ion velocities\cite{Osborn1958,Bell_Glasstone_1970}. Transforming the scattering kernel from the beam-target to the lab frame then includes the effect of fluid velocity.\\ Synthetic neutron spectra, which include transport effects excluded from the simplified spectral model (equation \ref{fullspecmodel}) can be produced based on hydrodynamic profiles. Comparisons between synthetic data and the model will serve as the first test towards experimental viability of this model. \\ For the first case we will consider the LILAC simulation for the shot 87653, see figs \ref{fig:TP_bangtime} and \ref{fig:TP_PDFBSE}. This has a burn-averaged $\rho$R of 218 mg/cm$^2$ for which the attenuation of the primary DT spectrum is $<$ 2\% and approximately 1\% of scattered neutrons undergo triple scattering. Hence many of the assumptions made are valid at this areal density. The analysis of the edge was performed in a similar fashion to an experimental analysis, although in energy rather than time-of-flight space. First, the primary DT peak was fit in order to estimate the birth spectrum shape. Then fitting of the spectrum is performed on both sides of the nT edge (between 3 and 5 MeV), extending the range previously used in Crilly \textit{et al.}\cite{Crilly2018}. Using the $P(v_{i,\parallel}')$ shown in figure \ref{fig:TP_PDFBSE}, excellent agreement is seen between the model and synthetic data with at most $\sim$ 0.5\% deviation, the results are shown in figure \ref{fig:minotaurspectra}. Using the single Gaussian approximation for $P(v_{i,\parallel}')$ showed at most $\sim$ 1\% deviation between model and synthetic data. This produced best fit values of $\bar{v}$ and $\Delta_v$ of 72 and 214 km/s compared to the theoretical values of 75 and 229 km/s; the discrepancies can be attributed in part to non-Gaussian components of $P(v_{i,\parallel}')$. \begin{figure}[htp] \centering \includegraphics*[width=0.485\textwidth]{lilac87653_minotaur_fit.pdf} \caption{(a) A comparison of the synthetic neutron spectra calculated by Minotaur and the spectral model solution. (b) A plot showing the components of the spectral model over the fitting range. All individual components are within 10\% of their equivalent neutron transport result.} \label{fig:minotaurspectra} \end{figure} The same analysis was followed for shot 89224, which has a burn-averaged $\rho$R = 162 mg/cm$^2$. The deviation between model and synthetic data was again $\sim$ 1\%. The single Gaussian model found best fit $\bar{v}$ and $\Delta_v$ values of 70 and 254 km/s compared to the theoretical values of 69 and 274 km/s. Therefore the error introduced in $\bar{v}$ and $\Delta_v$ by the approximations made is $<$ 10\%. Given the results from synthetic data, analysis of experimental data for similar OMEGA shots can be carried out with the model presented.\\ Higher areal densities will reduce the signal to background for the backscatter edge as well as introduce additional backgrounds and non-negligible attenuation. To test the validity of the assumptions made within the model, neutron spectra were made for a set of scaled isobaric profiles with $\rho$Rs of 0.25, 0.5, 0.75 and 1.0 g/cm$^2$. By scaling self-similar profiles it is ensured that the averaged hydrodynamic properties, e.g. burn-weighted ion temperature, of the capsule are unaltered between different areal densities. A pressure of 100 Gbar, central temperature of 6 keV with a parabolic spatial profile and shell temperature of 300 eV were used. Fits to the synthetic spectra are shown in figure \ref{fig:scaledrhorspectra}. Good agreement between the total model and the synthetic spectra is found across the whole fitting range for all areal densities. \\ Agreement between the individual components of the fit (uncollided primary TT, single and double scattering) and the equivalent neutron transport component gives confidence that the underlying physical phenomena are well modelled. For $\rho R = 0.5$ g/cm$^2$, an average deviation of 14\% is found between the amplitude of the single scatters in the model and the equivalent neutron transport result. At higher areal densities, triple scattering and differential attenuation causes increasing deviation between the components of the model and synthetic spectra. Therefore interpretation of the various amplitudes of the backgrounds, $A_{1s}$, $A_{2s}$ and $A_{TT}$, in the model as physical parameters is lost. The complete model however still performs well as an ad-hoc fitting function and measurement of $\bar{v}$ and $\Delta_v$ is possible at higher areal densities. \begin{figure}[htp] \centering \includegraphics*[width=0.485\textwidth]{scaledRhoR.pdf} \caption{Synthetic neutron spectra calculated by Minotaur for four isobaric profiles with varying $\rho$R. The inset plot shows more detail around the nT backscatter edge and the spectral model fits to this region in the dashed black lines.} \label{fig:scaledrhorspectra} \end{figure} These results suggest that the model developed in this work could be used to fit experimental spectra at 0.5 g/cm$^2$ (DSR $\sim 2.5 \%$) and potentially up to 0.75 g/cm$^2$ (DSR $\sim 3.8 \%$) if requirements on physicality of the underlying components of the background are relaxed. Inclusion of triple scattering and attenuation effects would allow access to even higher areal densities with confidence in the physical basis of the ab-initio model. \section{Multidimensional Effects}\label{MultiDeffects} While the proceeding analysis has focussed on 1D implosions, in reality ICF experiments are subject to many instabilities and perturbations which preclude a spherical implosion. The scattered neutron spectrum will still be affected by the velocity distribution of the ions, however now different lines of sight will sample regions of the capsule with different hydrodynamic conditions. Asymmetries in the measured $\bar{v}$ would indicate asynchronous stagnation of the shell. Variation in $\Delta_v$ could be due to differences in the shell deceleration\cite{Crilly2018} and/or angular variation in fuel temperatures. \\ A radiation-hydrodynamics simulation performed by the code Chimera\cite{Chittenden2016,Tong2019} will be used here to illustrate how anisotropy in hydrodynamic conditions manifests within the scattering ion velocity distribution. The 3D simulation, which was presented in previous work\cite{Crilly2018}, involves a High Foot\cite{Park2014,Hurricane2014} NIF implosion and used a 3\% P1/P0 X-ray drive asymmetry, producing a 130 km/s neutron-averaged hotspot velocity. Figure \ref{fig:MultiDimBackscatter} shows the scattering ion velocity distributions as seen by two antipodal detectors along the axis of the P1 drive asymmetry. From the $+z$ direction, a faster shell is observed as this side of the capsule has been driven harder by the drive asymmetry. From the $-z$ direction, a slower shell is observed as well as the presence of a free-falling shell component. Averaged shell velocities, $\bar{v}$, of 160 and 78 km/s from $+z$ and $-z$ respectively are in agreement with previous reported values\cite{Crilly2018}. Asymmetry in $\bar{v}$ will create anisotropy in work done causing ineffective conversion to internal energy within the hotspot. This results in residual kinetic energy which is evident in this case due to the large hotspot velocities. Extending beyond previous work by the inclusion of the thermal velocity of the ions, $\Delta_v^2$ values of 784 and 1591 eV were found from $+z$ and $-z$ respectively. The scatter weighted temperatures of 552 and 1110 eV reveal that the difference in $\Delta_v^2$ between detectors is due to both differences in dense fuel temperatures as well as differential deceleration of the shell. In summary, large anisotropy in both $\bar{v}$ and $\Delta_v^2$ were found therefore demonstrating the backscatter edge measurement could assist in identifying 3D asymmetries in the dense fuel. \begin{figure}[htp] \centering \includegraphics*[width=0.485\textwidth]{P1_plot.pdf} \caption{(Left) The scattering ion velocity distributions from two antipodal lines of sight for a hydrodynamics simulation of an indirect drive High Foot implosion with an imposed P1 X-ray drive asymmetry\cite{Crilly2018}. Inset is a schematic showing the regions of the implosions sampled by the different lines of sight. The $+z$ side, in red, has been driven harder due to the drive asymmetry. (Right) The resultant single scattered spectral shapes around the nT backscatter edge for the two lines of sight. Note the different shifts and slopes for the different lines of sight due to asymmetry in $\bar{v}$ and $\Delta_v^2$ values.} \label{fig:MultiDimBackscatter} \end{figure} Centre of mass motion of the hotspot occurs in asymmetric implosions and causes the birth spectrum to be anisotropic\cite{Munro2016,Appelbe2014,Mannion2018,Hatarik2018}. Backscattered neutrons were initially moving in the opposite direction to the detector line of sight. Hence knowledge of the "reverse" birth spectrum is required in order to analyse the backscatter edge. In previous work \cite{Crilly2018} this was resolved by using antipodal detectors. However without this detector arrangement the reverse birth spectrum can be approximated if the neutron averaged fluid velocity vector is measured. This measurement is currently performed at the NIF\cite{Hatarik2018} and OMEGA\cite{Mannion2018} and requires at least four neutron spectrometers. For the detector measuring the backscattered neutron spectrum, a measurement of the apparent ion temperature is also required. Using the notation of Munro\cite{Munro2016}, the centroid and variance of the reverse birth spectrum can be approximated by: \begin{subequations} \begin{align} \langle\omega\rangle_b &= \langle \bar{\kappa} \rangle + \langle u \rangle_i \hat{\Omega}_{b,i} + ... \approx \langle \bar{\kappa} \rangle - \langle u \rangle_i \hat{\Omega}_{det,i} \\ \mbox{Var}(\omega)_b &= \langle \tau \rangle + \mbox{Var}(\vec{u})_{ij} \hat{\Omega}_{b,i}\hat{\Omega}_{b,j} + ... \approx \mbox{Var}(\omega)_{det} \\ &\mbox{Where:} \ \ \hat{\Omega}_{b,i} = -\hat{\Omega}_{det,i} \ \mbox{for backscatter} \nonumber \end{align} \end{subequations} In the above approximations higher order terms and the effect of scattering have been neglected. Absolute errors in the inferred reverse birth spectrum have a reduced effect due to the mass difference between neutron and scattering ion, see equations \ref{classicalkinematices} a-c. For example, errors in the mean birth energy are reduced by a factor of 4 for the nT edge.\\ Large areal density asymmetries present an issue for the spectral background model if a broad energy range of the neutron spectrum is considered. Restricting to $\sim$ 3-5 MeV reduces the scattering angle range for the elastic processes (nT and nD). The large aspect ratio of hotspot size to shell thickness also acts to reduce the range of neutron averaged areal densities seen\cite{Crilly2018}. For the (n,2n) reactions a single incoming neutron energy and scattering angle produces a broad band of outgoing neutron energies. Hence near the nT edge the (n,2n) background has been produced in all $4\pi$ of solid angle, thus has a much weaker dependence on $\rho$R asymmetries. Further development of the analysis to include the effect of strong $\rho$R asymmetries is required. 3D measurements of $\rho$R from neutron spectrometers\cite{Johnson2012} or FNADs\cite{Bleuel2012,Yeamans2012,Yeamans2017} could be used to inform this analysis. \section{Conclusions} The effect of ion velocities on the spectrum of backscattered neutron energies has been investigated theoretically and through numerical neutron transport calculations, extending on previous work\cite{Crilly2018}. It has been shown that the shape of the backscatter edge is dependent on the scattering rate weighted ion velocity distribution. Hydrodynamic conditions throughout the capsule dictate the form of this distribution and hence these conditions can be inferred from spectroscopic analysis. The mean, $\bar{v}$, and variance, $\Delta_v^2$, of the distribution are given by averaged fluid velocity and the sum of the averaged temperature and fluid velocity variance respectively. Since the neutrons scatter in dense DT fuel which has a low neutron and photon emittance, the backscatter edge presents an avenue to probe regions of the stagnating capsule currently unmeasured. Diagnosing these conditions allows inference of hydrodynamic quantities relevant to capsule performance. For example, from $\bar{v}$ the rate of mechanical work done on the hotspot by the imploding shell during neutron production can be calculated. \\ In order to fit the shape of nT backscatter edge, a spectral model for the background was developed. This includes single and double scattering terms, and the attenuated primary TT neutrons. The model was tested on synthetic data produced by the neutron transport code Minotaur\cite{Crilly2018} and showed good agreement at current ICF experimental areal densities. For LILAC simulations of the triple picket shot 87653 and the single picket shot 89224, the model and neutron transport result were within 1\% of each other at all energies of the fitting region. Using a single Gaussian model for the scattering ion velocity distribution, best fit values for $\bar{v}$ and $\Delta_v$ were all within 10\% of theoretical values. Numerical results suggest that to analyse at areal densities $\gtrsim$ 0.75 g/cm$^2$ (DSR $\sim$ 3.8\%) may require the inclusion of more spectral backgrounds and attenuation effects. \\ Analysis of experimental backscatter edge data would be possible using the same forward fitting technique currently used for neutron time-of-flight spectra\cite{Hatarik2015}. The nT and nD edges occur in the vicinity of the DD peak so instrumental characterisation at these energies would be mutually beneficial for these spectral signals. Measurement of both the nD and nT edge would allow separation of the thermal and non-thermal contributions to the variance in the scattering ion velocity. Analysis of experimental nT backscatter edge data at OMEGA is in progress\cite{Mannion_inprep}.\\ For 3D perturbed implosions different lines of sight would measure the conditions of different regions of the capsule. Asymmetries in dense fuel conditions could therefore be inferred. Four neutron spectrometers are sufficient to characterise the DT neutron birth spectrum needed to analyse the edge. Future investigation is required for the treatment of large areal density asymmetries in the analysis. \section*{Acknowledgements} The results reported in this paper were obtained using the Imperial College High Performance Computer Cx1. This work was supported by Lawrence Livermore National Laboratory through the Academic Partnership Program.
\section{Introduction} \label{sec:intro} Timed automaton (TA) was introduced by Alur and Dill \cite{ta} as an abstract model for real-time systems by extending finite automaton with continuous clocks. When the $\mathrm{TA}$s are non-deterministic then a fundamental problem of language inclusion is, in general, undecidable, for example, whether the set of timed traces of the $\mathrm{TA}$ representing the implementation is included in that of the specification. This lead to imposing restrictions on and modifications to non-deterministic TAs in order to achieve decidability (see \cite{bbbb,ta-eps,era,updatable-ta,Ouak_one_clk,Ouak_time_bound,bounded-time,Dec_TA_Survey,bound-det} for a partial list). Another approach was to allow robustness in the language \cite{GHJ97} or perturbations in the clocks \cite{purturbed-ta} (see also \cite{BMS15}). The problem is that by allowing a fixed imprecision, undecidability problems due to working over continuous time do not vanish. Digitization of timed systems, where basic decision problems like language inclusion are decidable, was considered, for example, in \cite{HMP92,O02,OW03}. But, as stated in \cite{OW03}, the implementation should be 'closed under digitization' and the specification should be 'closed under inverse digitization' in order to be able to reduce the language inclusion problem from the continuous world to the discretized one. In \cite{irta} the authors construct TAs with reset only on integral time and demonstrate the decidability of the language inclusion problem $\mathfrak{L}(A) \subseteq \mathfrak{L}(B)$ in case $B$ is an integer reset TA. In this paper we go further with this approach. The idea is to work in the setting of discretized time, but without restricting or modifying the definition of a TA. The discretization is over intervals which are smaller than 1 time unit so that although we work in the discretized setting we are able to check for exact occurrence of events also outside integral time. For this matter we construct discretized TAs that enable effective comparison of the languages of the original TAs. The discretized TA stays within a distance of $\frac{1}{6}$ time units from the original TA (the distance can, in fact, be as small as we like, in the cost of complexity, but that won't improve our knowledge about the inclusion of the languages of the original automata), a goal that is achieved through the introduction of an additional clock, $t$, that measures absolute time. Now, instead of comparing directly the language of two TAs, a problem which is in general undecidable, we can compare their discretized TAs and have the following (see Theorem~\ref{th:inclusion_gap}): if $\mathfrak{L}(\discta{A})$, the language of the discretized TA of $A$, is not included in $\mathfrak{L}(\discta{B})$, the language of the discretized TA of $B$, then the same holds for $\mathfrak{L}(A)$ with respect to $\mathfrak{L}(B)$. If, however, $\mathfrak{L}(\discta{A}) \subseteq \mathfrak{L}(\discta{B})$ then $\mathfrak{L}(A)$ is included in the topological closure of $\mathfrak{L}(B)$. The next natural question, in case $\mathfrak{L}(A) \nsubseteq \mathfrak{L}(B)$, is how far away is a timed trace of $\mathfrak{L}(A)$ from all timed traces of $\mathfrak{L}(B)$, that is, what is the conformance distance $c(\mathfrak{L}(A), \mathfrak{L}(B))$, the distance of $\mathfrak{L}(A)$ from being conformed with $\mathfrak{L}(B))$. When an untimed word of $\mathfrak{L}(A)$ is not in $\mathfrak{L}(B)$ or when a transition in $A$ which is not bound in time is not met with a similar transition in $\mathfrak{L}(B)$ of the same action label then $c(\mathfrak{L}(A), \mathfrak{L}(B)) = \infty$ and the existence of these cases is decidable. A more challenging question is whether there is a sequence of timed traces of $\mathfrak{L}(A)$ which tend to diverge from $\mathfrak{L}(B)$, causing $c(\mathfrak{L}(A), \mathfrak{L}(B)) = \infty$. For example, it may happen that due to imprecisions or delays in a real system, a TA model is changed to allow wider time intervals around actions compared to the more idealistic previous model. It is then necessary to check whether or not this extended freedom is controlled and the distance between the two TAs stays within a reasonable bound (see \cite{BMS15} regarding an ideal model versus a realistic model). Moreover, an algorithm based on the approach suggested here may find the timed traces that deviate from the allowed distance between two timed languages. Further applications for computing the distance may be when safety properties include time restrictions for specific set of timed traces, given as timed automata, and we want to check these timed traces with respect to the implementation model. In general, in a design of a computerized system, e.g. a network, that contains timing changes, a relaxed equivalence verification may allow bounded perturbations in time that needed to be checked. Computing the distance between TAs (or their languages), even between discretized TAs, may be quite complex. Here we concentrate on the problem of deciding whether the distance is infinite. It is not clear to us whether this problem is decidable in general, but for a (perhaps) restricted version of it we construct an algorithm that solves it. \section{Timed Automaton} \label{sec:ta} A timed automaton is an abstract model of temporal behavior of real-time systems. It is a finite automaton with \emph{locations} and \emph{transitions} between them, extended with a finite set of (continuous) clocks defined over $\mathbb{R}_{\geq 0}$. A transition at time $t$ can occur only if the condition expressed as a \emph{transition guard} is satisfied at $t$. A transition guard is a conjunction of constraints of the form $c \sim n$, where $c$ is a clock, $\sim \ \in \{<,\leq, =,\geq, >\}$ and $n \in \mathbb{N}_0 = \mathbb{N} \cup \{0\}$. Each transition is labeled by some \emph{action} $a \in \Sigma$ and some of the clocks may be reset to zero. In $\mathrm{NTA}$, the class of non-deterministic timed automata, and unlike deterministic TAs, it may occur that two transitions from the same location $q$ can be taken at the same time and with the same action but to two different locations $q'$ and $q''$. \begin{definition}[Timed automaton] \label{def:ntaeps} A \emph{non-deterministic timed automaton} $A \in \mathrm{NTA}$ is a tuple $(\mathcal{Q}, q_0, \mathcal{F}, \Sigma, \mathcal{C}, \mathcal{T})$, where: \begin{enumerate} \item $\mathcal{Q}$ is a finite set of locations and $q_0 \in \mathcal{Q}$ is the initial location; \item $\mathcal{F} \subseteq \mathcal{Q}$ is the set of accepting locations; \item $\Sigma$ is a finite set of transition labels, called actions; \item $\mathcal{C}$ is a finite set of clock variables; \item $\mathcal{T} \subseteq \mathcal{Q} \times \Sigma \times \mathcal{G} \times \powerset{\mathcal{C}} \times \mathcal{Q}$ is a finite set of transitions of the form $(q, a, g, \mathcal{C}_{rst}, q')$, where: \begin{enumerate} \item $q,q' \in \mathcal{Q}$ are the source and the target locations respectively; \item $a \in \Sigma$ is the transition action; \item $g \in \mathcal{G}$ is the \emph{transition guard}; \item $\mathcal{C}_{rst} \subseteq \mathcal{C}$ is the subset of clocks to be reset. \end{enumerate} \end{enumerate} \end{definition} A clock \emph{valuation} $v (c)$ is a function $v:\mathcal{C} \to \mathbb{R}_{\geq 0}$. We denote by $\mathcal{V}$ the set of all clock valuations and by $\textbf{d}$ the valuation which assigns the value $d$ to every clock. Given a valuation $v$ and $d \in \mathbb{R}_{\geq 0}$, we define $v+d$ to be the valuation $(v+d)(c) := v(c)+d$ for every $ c \in \mathcal{C}$. The valuation $v[\mathcal{C}_{rst}]$, $\mathcal{C}_{rst} \subseteq \mathcal{C}$, is defined to be $v[\mathcal{C}_{rst}](c) = 0$ for $c \in \mathcal{C}_{rst}$ and $v[\mathcal{C}_{rst}](c) = v(c)$ for $c \notin \mathcal{C}_{rst}$. The \emph{semantics} of $A \in \mathrm{NTA}$ is given by the \emph{timed transition system} $[[A]] = (S, s_0, \mathbb{R}_{\geq 0}, \Sigma, T)$, where: \begin{enumerate} \item $S = \{(q,v) \in \mathcal{Q} \times \mathcal{V} \}$ is the set of states, with $s_0 = (q_0, \textbf{0})$ the initial state; \item $T \subseteq S \times (\Sigma \cup \mathbb{R}_{\geq 0}) \times S$ is the transition relation. The set $T$ consists of \begin{enumerate} \item \emph{Timed transitions (delays):} $(q,v) \xrightarrow{d} (q, v+d)$, where $d \in \mathbb{R}_{\geq 0}$; \item \emph{Discrete transitions (jumps):} $(q,v) \xrightarrow{a} (q',v')$, where $a \in \Sigma$ and there exists a transition $(q, a, g, \mathcal{C}_{rst}, q')$ in $\mathcal{T}$, such that the valuation $v$ satisfies the guard $g$ and $v' = v[\mathcal{C}_{rst}]$. \end{enumerate} \end{enumerate} A (finite) \emph{run} $\varrho$ on $A \in \mathrm{eNTA}$ is a sequence of alternating timed and discrete transitions of the form $$(q_{0}, \textbf{0}) \xrightarrow{d_{1}} (q_{0}, \textbf{d}_1) \xrightarrow{a_{1}} (q_{1}, v_{1}) \xrightarrow{d_{2}} \cdots \xrightarrow{d_{k}} (q_{k-1}, v_{k-1} + d_{k}) \xrightarrow{a_{k}} (q_{k}, v_{k}). $$ The run $\varrho$ on $A$ induces the \emph{timed trace} (\emph{timed word}) $$ \tau = (t_{1}, a_{1}), (t_{2}, a_{2}), \ldots, (t_{k}, a_{k}), $$ with $a_i \in \Sigma$ and $t_{i} = \Sigma_{j=1}^{i} d_i$. The language $\mathfrak{L}(A)$ consists of the set of timed traces that are obtained from the runs that end in accepting locations. We remark that for simplification of presentation we did not include the location invariants in the definition of timed automata since they are more of a 'syntactic sugar': the invariants of location $q$ are composed of upper bounds to the values of the clocks while being in $q$, but these constraints can be incorporated in the transition guards to $q$ (for the clocks that are not reset at the transitions) and in those transitions that emerge from $q$, thus not affecting $\mathfrak{L}(A)$. \section{Augmented Region Automaton} \label{sec:ARA} Given a (finite) timed automaton $A$, the region automaton $\mathfrak{R}(A)$ \cite{ta} is a finite \emph{discretized} version of $A$, such that time is abstracted and both automata define the same untimed language. Instead of looking at the clocks-space as a continuous space it is partitioned into regions. Suppose that the maximal integer appearing in the transition guards of $A$ is $M$, then we denote by $\top$ a value of a clock which is greater than $M$. The regions partition the space of clock valuations into equivalent classes, where two valuations belong to the same equivalent class if and only if they agree on the clocks with $\top$ value and on the integral parts and the order among the fractional parts of the other clocks. The edges of $\mathfrak{R}(A)$ are labeled by the transition actions and they correspond to the actual transitions that occur in the runs on $A$. The \emph{augmented region automaton}, denoted $\mathfrak{R}^t(A)$, is defined as in \cite{R19}. First, we add to $A$ a clock $t$ that measures absolute time, is never reset to $0$ and does not affect the runs and timed traced of $A$. Secondly, we want to construct $\mathfrak{R}^t(A)$ in a way that keeps track of absolute time and regain much of the information that is lost when passing from the timed automaton $A$ to the regular region automaton $\mathfrak{R}(A)$. But since $t$ does not appear in the transition guards of $A$, we need not know the exact value of the integral part of $t$ but just how much time passes between two consecutive transitions. Thus, we assign $t$ in $\mathfrak{R}^t(A)$ only two time-regions: $\{0\}$ and $(0,1)$. However, in order to keep track of the absolute time that passes, each edge is assigned a 'weight', the time difference in the integral part of $t$ between the target and the source regions. The ordering among the fractional part of the clocks does, however, take that of $t$ into account. Overall, the number of regions of $\mathfrak{R}^t(A)$ is clearly finite (although potentially exponentially large). \begin{definition} \label{def:aug_region_automaton} Given a non-deterministic timed automaton $A$ with clocks $x_1, \ldots, x_s$ extended with absolute-time clock $t$, a corresponding augmented region automaton $\mathfrak{R}^t(A)$ is a tuple $(\mathcal{V}, v_0, \mathcal{E}, \Sigma, \mathcal{W}^*)$, where: \begin{enumerate} \item $\mathcal{V}$ is the set of vertices. Each vertex is a triple $(q, {\bf n}, \Delta)$, where $q$ is a location of $A$ and $r=({\bf n}, \Delta)$ is a region, with ${\bf n} = (n_1, \ldots, n_s) \in \{0, 1, \ldots, M, \top \}^{s}$ consisting of the integral parts of the clocks $x_1, \ldots, x_s$ and $\Delta$ is the simplex (hyper-triangle) with vertices in the lattice $\mathbb{N}_0^{s+1}$ of all points that satisfy a fixed ordering of the fractional parts of the clocks $t=x_0, x_1, \ldots, x_s$: \begin{equation} \label{eq:simplex} 0 \preceq_0 \frc{x_{i_0}} \preceq_1 \frc{x_{i_1}} \preceq_2 \cdots \preceq_s \frc{x_{i_s}} < 1, \end{equation} where $\preceq_i \, \in \{=, < \}$. \item $v_0 = (q_0, {\bf 0}, {\bf 0})$ is the initial vertex, where $q_0$ is the initial location of $A$ and $({\bf 0}, {\bf 0})$ indicates that all clocks have value $0$. \item $\mathcal{E}$ is the set of edges. There is an edge $(q, r) \xrightarrow{a} (q',r')$ if and only if there is a run on $A$ containing $(q, v) \xrightarrow{d} (q, v + d) \xrightarrow{a} (q', v')$, such that, the clock valuation $v$ is in the region $r$ and $v'$ is in $r'$. \item $\Sigma$ is the finite set of actions. \item $\mathcal{W}^*$ is the set of weights $m$ on the edges calculated as $m = \lfloor t_1 \rfloor - \lfloor t_0 \rfloor \in [0..M]$, where $\lfloor t_1 \rfloor$ ($\lfloor t_0 \rfloor$) is the integral part of $t$ in the target (source) location in a corresponding run on $A$. There may be more than one edge between two vertices of $\mathfrak{R}^t(A)$, each one with a distinguished weight. A weight $m$ may be marked as $m^*$, representing infinitely-many consecutive values $m$, $m+1$, $m+2, \ldots$ as weights between the same two vertices, for example when the regular clocks passed the maximal value $M$. \end{enumerate} \end{definition} An augmented region automaton can be seen in Fig.~\ref{fig:disc_ta}(b) (the example is taken from \cite{ta}). \section{Discretized Timed Automaton} \label{sec:Approx} After constructing the augmented region automaton $\mathfrak{R}^t(A)$, we turn it into a deterministic timed automaton $\discta{A}$ which discretizes (digitizes) $A$. \begin{definition} \label{def:appta} A \emph{discretized timed automaton} $\discta{A}$ is a timed automaton constructed from the augmented region automaton $\mathfrak{R}^t(A)$ in the following way. \begin{enumerate} \item The directed graph structure of locations and edges of $\discta{A}$ is the same as that of $\mathfrak{R}^t(A)$. \item The transition labels (actions) are also as in $\mathfrak{R}^t(A)$. \item There is a single clock in $\discta{A}$, namely $t$, which is reset on each transition. \item The transition guards of $\discta{A}$ are of the following form. Let $e = v_0 \to v_1$ be an edge of $\mathfrak{R}^t(A)$, let $w(e)$ be its weight and let $\{t_0\}, \{t_1\} \in [0,1)$ be any fractional parts of $t$ in the source and target regions. Let $$\delta = \frac{1}{2}(\lceil \{t_1\} \rceil - \lceil \{t_0\} \rceil) \in \{-\frac{1}{2},0,\frac{1}{2}\},$$ where $\lceil \{t_i\} \rceil \in \{0,1\}$ is the ceiling function applied to $t_i$. Then, we set the transition guard of the corresponding edge of $\discta{A}$ to be $$t = w(e) + \delta.$$ In case of a weight $w(e) = m^*$ then the transition guard is $$t \geq m+\delta.$$ \end{enumerate} \end{definition} A discretized timed automaton can be seen in Fig.~\ref{fig:disc_ta}(c). We remark that the fact that the transition guards of $\discta{A}$ are over $\frac{1}{2} \mathbb{N}_0$ and not over $\mathbb{N}_0$ need not bother us since the standard definition of timed automata holds also over the rational numbers. Indeed, by letting all clocks run twice as fast and multiplying by 2 all values in the constraints of the transition guards, we end up in an automaton over the integers. \begin{figure}[] \centering \scalebox{0.5}{ \input disc_ta.pdf_t } \caption{a) $A \in \mathrm{TA}$; b) $\mathfrak{R}^t(A)$, the augmented region automaton of $A$; c) $\discta{A}$, the discretized timed automaton with $\Delta=0.5$.} \label{fig:disc_ta} \end{figure} \section{The Conformance Distance} \label{sec:inc_gap} We want to define a metric on the set of timed traces in order to define (conformance) distance between timed languages. \begin{definition} Given a set $T$ of timed traces over the same alphabet $\Sigma$, we define the $\infty$-metric or max-metric $d$ on $T$ in the following way. Given two timed traces \begin{align*} \tau_1 &=(t_1^{\tau_1}, a_1^{\tau_1}), (t_2^{\tau_1}, a_{2}^{\tau_1}),\ldots,(t_m^{\tau_1}, a_m^{\tau_1}), \\ \tau_2 &=(t_1^{\tau_2}, a_1^{\tau_2}), (t_2^{\tau_2}, a_{2}^{\tau_2}),\ldots,(t_n^{\tau_2}, a_n^{\tau_2}), \end{align*} the distance between $\tau_1$ and $\tau_2$ is \begin{equation*} d(\tau_1, \tau_2) = \begin{cases} \infty, &\quad \mathrm{if} \; m \neq n \; \mathrm{or} \; a_i^{\tau_1} \neq a_i^{\tau_2} \; \mathrm{for} \; \mathrm{some} \; i,\\ \max_i{| t_i^{\tau_1}-t_i^{\tau_2} |}, &\quad \mathrm{otherwise.} \end{cases} \end{equation*} \end{definition} The above metric over the set of traces induces inclusion relation on timed languages (languages of timed automata). \begin{definition} Given two timed languages $\mathfrak{L}_1$ and $\mathfrak{L}_2$, $\mathfrak{L}_1$ is $\varepsilon$-included in $\mathfrak{L}_2$, denoted $\mathfrak{L}_1 \subseteq_{\varepsilon} \mathfrak{L}_2$, if for every timed trace $\tau_1 \in \mathfrak{L}_1$ there exists a timed trace $\tau_2 \in \mathfrak{L}_2$ such that $d(\tau_1, \tau_2) \leq \varepsilon$. \\ The \emph{conformance distance} $c(\mathfrak{L}_1, \mathfrak{L}_2)$ between $\mathfrak{L}_1$ and $\mathfrak{L}_2$ is $$c(\mathfrak{L}_1, \mathfrak{L}_2) = \inf\{\varepsilon \, : \, \mathfrak{L}_1 \subseteq_{\varepsilon} \mathfrak{L}_2\},$$ that is, $$c(\mathfrak{L}_1, \mathfrak{L}_2) = \sup_{\tau_1 \in \mathfrak{L}_1} \inf_{\tau_2 \in \mathfrak{L}_2} d(\tau_1, \tau_2) = \sup_{\tau_1 \in \mathfrak{L}_1} d(\tau_1, \mathfrak{L}_2).$$ The distance $d(\mathfrak{L}_1,\mathfrak{L}_2)$ between $\mathfrak{L}_1$ and $\mathfrak{L}_2$ is \begin{equation} \label{qe:lang_dist} d(\mathfrak{L}_1,\mathfrak{L}_2) = \max\{c(\mathfrak{L}_1, \mathfrak{L}_2), c(\mathfrak{L}_2, \mathfrak{L}_1)\}. \end{equation} \end{definition} In case of a finite conformance distance $n$ that is reached as a limit of a sequence of distances, we can denote it as $n^{+}$ (for a limit from above) or as $n^{-}$ (for a limit from below). Thus, $\mathfrak{L}_1 \subseteq \mathfrak{L}_2$ if and only if $c(\mathfrak{L}_1,\mathfrak{L}_2) = 0$. But when $c(\mathfrak{L}_1,\mathfrak{L}_2) = 0^{+}$ then $\mathfrak{L}_1 \nsubseteq \mathfrak{L}_2$ but $\mathfrak{L}_1 \subseteq \overline{\mathfrak{L}_2}$, where $\overline{\mathfrak{L}_2}$ is the closure of $\mathfrak{L}_2$ in the Euclidean topology, defined as follows. Fixing an untimed word $w \in \Sigma^*$ of length $n$, let $\mathfrak{L}_2(w)$ be the timed traces in $\mathfrak{L}_2$ whose untimed word is $w$ and let $\mathbb{R} ^n_w$ be a copy of $\mathbb{R}^n$ indexed by $w$. There is a natural embedding $\iota: \mathfrak{L}_2(w) \to \mathbb{R} ^n_w$. Then, $c(\mathfrak{L}_1, \mathfrak{L}_2)=0^{+}$ implies that $\iota(\mathfrak{L}_1) \subseteq \overline{\iota(\mathfrak{L}_2)}$, where $\iota(\mathfrak{L}_j) = \bigcup_{w \in \Sigma^*}\iota(\mathfrak{L}_j(w))$, $j=1,2$, and $\overline{S}$ is the closure of $S$ in the Euclidean topology. Subadditivity (triangle inequality) holds for the conformance distance: $$c(\mathfrak{L}_1, \mathfrak{L}_3) \leq c(\mathfrak{L}_1, \mathfrak{L}_2) + c(L_2, L_3).$$ \begin{theorem} \label{th:integer_gap} Let $A,B \in \mathrm{NTA}$. Then $c(\mathfrak{L}(A), \mathfrak{L}(B)) \in \frac{1}{2}\mathbb{N}_0 \cup \{\infty\}$. \end{theorem} \begin{proof} Clearly, the conformance distance $c(\mathfrak{L}(A), \mathfrak{L}(B))$ can be $\infty$, for example, when the untimed language of $A$ contains a word that is not in the untimed language of $B$. Suppose now that $\delta = c(\mathfrak{L}(A), \mathfrak{L}(B)) < \infty$. It suffices to show the following. Given a path $\gamma^A$ in $A$ and another path $\gamma^B$ in $B$, where both define the same untimed trace (identical sequence of actions), let $T^A$ ($T^B$) be the set of all timed traces along $\gamma^A$ ($\gamma^B$). We need to show that \begin{equation} \label{eq:dist_path} \sup_{\tau^A \in T^A} \inf_{\tau^B \in T^B} d(\tau^A, \tau^B) \in \frac{1}{2}\mathbb{N}_0. \end{equation} By \cite{R19}, the timestamp of each of the events along $\gamma^A$ and $\gamma^B$ is an interval of the form $(m,n)$, $(m,n]$, $[m,n)$ or $[m,n]$, where $m \leq n$ and $m \in \mathbb{N}_0$, $n \in \mathbb{N}_0 \cup \{\infty\}$. This can be shown by writing equalities and inequalities over the integers and variables $z_i$, where $z_i$ represents the time of the $i$-th event along the path. Then \eqref{eq:dist_path} becomes an optimization problem over the integers and variables for the events along $\gamma^A$ as well as for those along $\gamma^B$. The solution lies in $\frac{1}{2}\mathbb{N}_0$ because it can be shown that for any other solution the timed traces can be shifted so that we are nearer $\frac{1}{2}\mathbb{N}_0$. In fact, it is quite clear that the solution should be looked for when considering the integral end-points of the event intervals. The solution is, in general, in $\frac{1}{2}\mathbb{N}_0$ and not in $\mathbb{N}_0$ as can be seen from the following example. Suppose that an event of $\tau^A$ occurs at time $0 < t < 1$ where the corresponding event in $B$ can occur at time $0$ or at time $1$. Then, the maximal time difference, namely $\frac{1}{2}$, occurs when we choose the event of $\tau^A$ to be at time $t=\frac{1}{2}$. \end{proof} By the way they are defined, the untimed runs on the augmented region automaton $\mathfrak{R}^t(A)$, as well as those on the discretized timed automaton $\discta{A}$, are identical to the untimed runs on $A$. The runs differ in the exact time on which each event occurs. When the absolute time of occurrence of an event is $t_0 \in \mathbb{N}_0$ then $\discta{A}$ agrees with $A$. When $t_0 = n+\varepsilon$, $n \in \mathbb{N}_0$, $0 < \varepsilon <1$ then the time of the event on $\discta{A}$ is set to be $n + \frac{1}{2}$, thus, the time difference is less than $\frac{1}{2}$ time units. The fact that the clock $t$ of $\discta{A}$ is synchronized with the clock $t$ that was added to $A$ to measures absolute time guarantees that the cumulative error does not increase over time but remains bounded by $\frac{1}{2}$. That is, $\discta{A}$ is a $\frac{1}{2}$-time-unit approximation of $A$: there exits a surjective mapping \begin{equation} \label{eq:proj} \pi : \mathfrak{L}(A) \twoheadrightarrow \mathfrak{L}(\discta{A}), \end{equation} such that if $\pi(\tau) = \tilde{\tau}$ then $d(\tau, \tilde{\tau}) < \frac{1}{2}$. We showed that the following holds. \begin{theorem} \label{th:approx_ta} $d(\mathfrak{L}(A), \mathfrak{L}(\discta{A})) \leq \frac{1}{2}$. \end{theorem} Since $t$ is reset only on values in $\frac{1}{2}\mathbb{N}_0$ then $\discta{A}$ is determinizable (see \cite{irta}, \cite{bbbb}). In fact, since $t$ is reset at each transition, we can remove it altogether to obtain an action-labeled, weighted directed graph. The determinization algorithm is then straightforward by searching the graph in a breadth-first manner, unifying edges of the same source location that agree on their labels: $(a,t)$, $a$ - action, $t$ -time, followed by unifying the target locations. The number of vertices, however, may grow exponentially. \section{Computing the Conformance Distance} Since $\discta{A}$ is determinizable, we can gain information about the relation between the languages of two timed automata by comparing their discretized languages. Note that by the way the distance between languages is defined, it is clear that it refers to languages which are supposed to be (almost) identical or that one language is assumed to be (almost) included in the other, but this is normally the case in equivalence verification or when comparing the implication language with its specification. Note that even if the untimed languages of two TAs are identical, it is enough that there exists a cycle, in which the timed languages do not agree, then by repeatedly taking this cycle the distance between the timed traces of the two TAs may grow indefinitely, resulting in a distance of $\infty$, and it is of interest to be able to recognize when this phenomenon occurs. Thus, it seems that since the distance between $A$ and its discretized timed automaton $\discta{A}$ is only $\frac{1}{2}$ time units, we may not lose much by comparing $\discta{A}$ instead of $A$ with another TA. In fact, in order to be more precise in the computation of the distance between two languages we need to make the basic discretization interval, denoted $\Delta$, shorter than $\frac{1}{2}$ time units. By setting $\Delta = \frac{1}{n}$ we get that $d(\mathfrak{L}(A), \mathfrak{L}(\discta{A})) < \frac{1}{n}$, thus we can make $\mathfrak{L}(A)$ and $\mathfrak{L}(\discta{A})$ as close to one another as we like (of course, in the expense of complexity). However, it turns out that it suffices to choose $\Delta = \frac{1}{6}$ in order to get the maximal precision about $d(\mathfrak{L}(A), \mathfrak{L}(B))$. For our convenience, since we prefer not to work with small fractions we accelerate the clocks to run at triple speed. That is, from now on, given the timed automata $A$ and $B$ under test, we first multiply by $3$ all the numbers that appear in the transition guards, so they all belong to $3\mathbb{N}_0$. Then we proceed as before: we construct the region automata with respect to basic regions of size 1 time unit and the discretized automata with respect to $\Delta = \frac{1}{2}$. Now we have, \begin{equation} \label{eq:gap_set} c(\mathfrak{L}(A), \mathfrak{L}(B)) \in \frac{3}{2}\mathbb{N}_0 \cup \{\infty\} \end{equation} and $$ d(\mathfrak{L}(A), \mathfrak{L}(\discta{A})) \leq \frac{1}{2}, \quad d(\mathfrak{L}(B), \mathfrak{L}(\discta{B})) \leq \frac{1}{2}. $$ \begin{theorem} \label{th:inclusion_gap} Let $A,B \in \mathrm{NTA}$ with clocks running at triple speed and let $\discta{A}, \discta{B}$ be their discretized timed automata with respect to $\Delta = \frac{1}{2}$. Then $$ |\, c(\mathfrak{L}(A), \mathfrak{L}(B)) - c(\mathfrak{L}(\discta{A}), \mathfrak{L}(\discta{B})) \, | \leq \frac{1}{2} $$ and $c(\mathfrak{L}(A), \mathfrak{L}(B))$ is known in case $c(\mathfrak{L}(\discta{A}), \mathfrak{L}(\discta{B}))$ is known. In particular: $$ \mathfrak{L}(\discta{A}) \nsubseteq \mathfrak{L}(\discta{B}) \; \Rightarrow \; \mathfrak{L}(A) \nsubseteq \mathfrak{L}(B) $$ and $$ \mathfrak{L}(\discta{A}) \subseteq \mathfrak{L}(\discta{B}) \; \Rightarrow \; \mathfrak{L}(A) \subseteq \overline{\mathfrak{L}(B)}, $$ so that the language inclusion problem between $\mathfrak{L}(A)$ and the topological closure of $\mathfrak{L}(B)$ is decidable. \end{theorem} \begin{proof} $A$ and $\discta{A}$ have the same untimed language. The timed languages $\mathfrak{L}(A)$ (with clocks running at triple speed) and $\mathfrak{L}(\discta{A})$ differ from one another in that every event of a run on $A$ that occurs at time $t$, with $t = n + \varepsilon$ and $0 < \varepsilon < 1$, occurs at the `rounded` time $n+\frac{1}{2}$ in the corresponding run on $\discta{A}$. Similarly for $B$ with respect to $\discta{B}$. It follows that $\delta = c(\mathfrak{L}(A), \mathfrak{L}(B)) = \infty$ if and only if $\delta_d = c(\mathfrak{L}(\discta{A}), \mathfrak{L}(\discta{B})) = \infty$. Suppose now that $\delta < \infty$. We know \eqref{eq:gap_set} that $\delta \in \frac{3}{2}\mathbb{N}_0$. Since the timed traces of $\mathfrak{L}(\discta{A})$ and $\mathfrak{L}(\discta{B})$ are discretized to the set $\frac{1}{2}\mathbb{N}_0$ then, when computing $\delta_d$ instead of $\delta$, we may have a difference of $\frac{1}{2}$ time units between the two. It follows that \begin{equation} \label{eq:delta} \delta = \begin{cases} 3k, &\quad \mathrm{if} \; \delta_d \in \{3k-\frac{1}{2}, 3k, 3k+\frac{1}{2}\}, \\ 3k+\frac{3}{2}, &\quad \mathrm{if} \; \delta_d \in \{3k+1, 3k+\frac{3}{2}, 3k+2 \}. \end{cases} \end{equation} Let us elaborate on that. When $\delta$ is exactly $k$ and not $3k^{+}$ or $3k^{-}$ then it means that it is achieved on specific timed traces and not as a limit. That is, it refers to an even occurring at time $t^A$ on a run on $A$ and and event occurring at time $t^B$ on a run on $B$, with $| t^A - t^B | = 3k$. Since the fractional parts of $t^A$ and $t^B$ are identical, the discretization in the corresponding runs on $\discta{A}$ and $\discta{B}$ are identical so that they occur at times $t^{\discta{A}}$ and $t^{\discta{B}}$ with $| t^{\discta{A}} - t^{\discta{B}} | = 3k$. The same applies when $\delta$ is exactly $3k+\frac{3}{2}$ since we are working with a resolution of $\frac{1}{2}$. When $\delta = 3k^{+}$ or $\delta = 3k^{-}$ then it is achieved as a limit of timed traces. If $\delta = 3k^{+}$ then $\delta_d$ can be $3k + \frac{1}{2}$, for example, when $t^A=3$ and $t^B = 3 + \varepsilon$, $\varepsilon>0$. Then the discretized traces will occur at times $t^{\discta{A}}=3$ and $t^{\discta{B}}=3\frac{1}{2}$. Then by choosing a sequence of timed traces of $\mathfrak{L}(B)$ the time difference can tend to $0$ while in the discretized automata it will remain $\frac{1}{2}$. The other cases of an conformance distance $\delta$ that is a limit of converging distances are analogous, but we do not go here into detail. Let us look at the last claims of the theorem. Suppose that $\mathfrak{L}(A) \subseteq \mathfrak{L}(B)$. Then for each timed trace of $\mathfrak{L}(A)$ there is an identical timed trace of $\mathfrak{L}(B)$. The projection to the discretized timed trace will also be identical, thus, $$ \mathfrak{L}(A) \subseteq \mathfrak{L}(B) \; \Rightarrow \; \mathfrak{L}(\discta{A}) \subseteq \mathfrak{L}(\discta{B}). $$ If $\mathfrak{L}(A) \nsubseteq \overline{\mathfrak{L}(B)}$ then $\delta > 0$. By \eqref{eq:delta}, we have that $\delta_d > 0$. It follows that $$ \mathfrak{L}(A) \nsubseteq \overline{\mathfrak{L}(B)} \; \Rightarrow \; \mathfrak{L}(\discta{A}) \nsubseteq \mathfrak{L}(\discta{B}). $$ \end{proof} By $\eqref{qe:lang_dist}$, a similar result to Theorem~\ref{th:inclusion_gap} holds with respect to distances between languages. By Theorem~\ref{th:inclusion_gap}, in order to compute the conformance distance $c(\mathfrak{L}(A), \mathfrak{L}(B))$, we can compute $c(\mathfrak{L}(\discta{A}), \mathfrak{L}(\discta{B}))$, and know that we lie within an error of at most $\frac{1}{2}$ time unit. We may assume that $\discta{A}$ is deterministic, as this is feasible. It is not necessary to determinize $\discta{B}$. The general goal in computing $c(\mathfrak{L}(\discta{A}), \mathfrak{L}(\discta{B}))$ is to find the timed trace of $\mathfrak{L}(\discta{A})$ that is farthest from $\mathfrak{L}(\discta{B})$ (or a sequence of such timed traces if the distance is $\infty$). A heuristic approach is to play a timed game in which the player in white moves along $\discta{A}$ and tries to maximize her wins, while the player in black moves along $\discta{B}$ and tries to minimize his losses. The players start from the initial vertex of each graph. Then white makes a move by jumping to a vertex in $\discta{A}$ with transition label $a$, followed by a move of black on an edge in $\discta{B}$ with the same label $a$. Next, white moves on an edge with label $a'$, followed by a move of black with the same label $a'$ and so on. At each move we record the time difference between the absolute time duration of the paths along $\discta{A}$ and along $\discta{B}$. The problem is that we may return to the same pair of locations $(q,q') \in \mathcal{Q}^{\discta{A}} \times \mathcal{Q}^{\discta{B}}$ but with a different time difference between the path along $\discta{A}$ and that along $\discta{B}$. In addition, there are moves to locations where the time is not a single value but of the form $t \geq m$. Thus, the game may not be of finite type. One strategy to cope with the complexity of the game is a greedy max-min algorithm: each move of white is one that maximizes the new difference in times after the following move of black that tries to minimizes the time difference. A better, but more expensive, strategy on the part of white is to look-ahead more than one step. So, let us then consider a seemingly easier question: is $c(\mathfrak{L}(\discta{A}), \mathfrak{L}(\discta{B}))$ finite or infinite? For this question we do not need to speed-up the clocks. An infinite conformal distance occurs in one of the following three situations. \begin{enumerate} \item[\textbf{S1.}] The untimed language of $\discta{A}$ is not included in that of $\discta{B}$: there exists a path $q_0 \xrightarrow{a_1} q_1 \xrightarrow{a_2} \cdots \xrightarrow{a_n} q_n$ in $\discta{A}$, with $q_n$ an accepting location, which either cannot be realized in $\discta{B}$ with the same sequence of actions, or all such paths in $\discta{B}$ do not terminate in an accepting location. \item[\textbf{S2.}] There exists a path in $\discta{A}$ of the form $q_0 \xrightarrow{a_1} q_1 \xrightarrow{a_2} \cdots \xrightarrow{a_n} q_n$, where the transition $q_{n-1} \xrightarrow{a_n} q_n$ has guard $t \geq m$, whereas for any path in $\discta{B}$ of the form $q'_0 \xrightarrow{a_1} q'_1 \xrightarrow{a_2} \cdots \xrightarrow{a_n} q'_n$ the guard of the last transition $q'_{n-1} \xrightarrow{a_n} q'_n$ bounds $t$ from above. \item[\textbf{S3.}] For each $N \in \mathbb{N}$ there exists a timed trace $\tau \in \mathfrak{L}(\discta{A})$, such that for each $\sigma \in \mathfrak{L}(\discta{B})$, $d(\tau, \sigma) > N$ and not because of S2. \end{enumerate} In order to find out whether the conformance distance between $\mathfrak{L}(\discta{A})$ and $\mathfrak{L}(\discta{B})$ is infinite as a result of \textbf{S1} or \textbf{S2} we extend $\discta{A}$ and $\discta{B}$ as follows. First, we add to the set $\Sigma$ of actions a copy of it $\bar{\Sigma} = \{ \bar{a} \, : \, a \in \Sigma \}$. Then, for each transition $q \xrightarrow{a} q'$ of $\discta{A}$ or of $\discta{B}$ with time constraint of type $t \geq m$, we add a transition $q \xrightarrow{\bar{a}} q'$ with guard $t = \infty$. Next, we complete $\discta{B}$ by adding a location $s$ which is a 'sink': whenever there is no transition with action $b \in \Sigma \cup \bar{\Sigma}$ from location $q$ of $\discta{B}$, we add the transition $q \xrightarrow{b} s$. The sink location is supplemented by self-loops of all actions. We retain the names $\discta{A}$ and $\discta{B}$ for the resulting automata. In the next step we form the untimed automaton $U(\discta{A})$ which is a determinization of $\discta{A}$ with respect to actions while ignoring the temporal part. Similarly, we construct $U(\discta{B})$. \begin{definition} \label{def:uappta_a} The automaton $U(\discta{A})$ is a tuple $(\mathcal{Q}, Q_0, \mathcal{F}, \Sigma \cup \bar{\Sigma}, \mathcal{E})$, where: \begin{enumerate} \item $\mathcal{Q} \subseteq \mathcal{P}(\mathcal{Q}^{\discta{A}})$ is a subset of the power set of the locations of $\discta{A}$, where $Q_0 = \{q^{\discta{A}}_0\}$ is the initial location; \item $\mathcal{F} \subseteq \mathcal{Q}$ is the set of accepting locations, where $Q = \{q^{\discta{A}}_1, \ldots, q^{\discta{A}}_m\}$ is accepting if at least one of the $q^{\discta{A}}_i$ is an accepting location of $\discta{A}$; \item $\Sigma \cup \bar{\Sigma}$ is the set of actions; \item $\mathcal{E} \subseteq \mathcal{Q} \times (\Sigma \cup \bar{\Sigma}) \times \mathcal{Q}$ is a finite set of edges of the form $(Q, a, Q')$, where $Q' = \{ q'^{\discta{A}} : \exists q^{\discta{A}} \in Q. \, (q^{\discta{A}}, a, q'^{\discta{A}} )\in \mathcal{T}^{\discta{A}} \}$. \end{enumerate} \end{definition} Finally, we construct a version of the untimed product automaton $U(\discta{A}) \times U(\discta{B})$ in which the accepting locations are those pairs of locations $(Q,Q')$ for which $Q$ is an accepting location of $U(\discta{A})$ but $Q'$ is not an accepting location of $U(\discta{B})$. \begin{definition} \label{def:prod} The product automaton $U(\discta{A}) \times U(\discta{B})$ is a tuple $(\mathcal{Q}, Q_0, \mathcal{F}, {\Sigma \cup \bar{\Sigma}}, \mathcal{E})$, where: \begin{enumerate} \item $\mathcal{Q} \subseteq \mathcal{Q}^{U(\discta{A})} \times \mathcal{Q}^{U(\discta{B})}$, where $Q_0 = (q^{U(\discta{A})}_0, q^{U(\discta{B})}_0)$ is the initial location; \item $\mathcal{F} \subseteq \mathcal{Q}$ is the set of accepting locations $(Q,Q')$, where $Q \in \mathcal{F}^{U(\discta{A})}$ and $Q' \notin \mathcal{F}^{U(\discta{B})}$; \item $\Sigma \cup \bar{\Sigma}$ is the set of actions; \item $\mathcal{E} \subseteq \mathcal{Q} \times (\Sigma \cup \bar{\Sigma}) \times \mathcal{Q}$ is the set of edges, where for each $(Q_1, a, Q'_1) \in \mathcal{E}^{U(\discta{A})}$ and $(Q_2, a, Q'_2) \in \mathcal{E}^{U(\discta{B})}$ we have that $((Q_1,Q_2), a, (Q'_1,Q'_2)) \in \mathcal{E}$, \end{enumerate} and $U(\discta{A}) \times U(\discta{B})$ is the connected component of the initial location. \end{definition} \begin{theorem} $c(\mathfrak{L}(\discta{A}), \mathfrak{L}(\discta{B})) = \infty$ as a result of \textbf{S1} or \textbf{S2} if and only if the set of accepting locations of $U(\discta{A}) \times U(\discta{B})$ is not empty. \end{theorem} \begin{proof} By completing $\discta{B}$ we made sure that the set of untimed traces of $U(\discta{B})$ consists of all possible traces. But if a path in $U(\discta{A}) \times U(\discta{B})$ terminates in an accepting location, then there exists a path in $\discta{A}$ that ends in an accepting location, while all paths in $\discta{B}$ of the same sequence of actions either terminate in a non-sink location which is non-accepting, or enter the sink either on an edge with action $a \in \Sigma$ due to missing such an edge on the uncompleted $\discta{B}$ or on an edge labeled $\bar{a} \in \bar{\Sigma}$ due to reaching a transition that is bounded in time in (the uncompleted) $\discta{B}$, but not bounded in $\discta{A}$. \end{proof} Assume now that by constructing the automaton $U(\discta{A}) \times U(\discta{B})$ it turns out that no possible infinite conformance distance exists when checking \textbf{S1} and \textbf{S2} and it remains to check \textbf{S3}. Hence, the goal is to find a sequence of traces in $\discta{A}$ which 'run-away' from $\discta{B}$, and now we are interested in the exact delays between consecutive transitions. This problem may be of very high complexity and even it is not clear whether it is decidable. We will show that a (perhaps) restricted version is decidable. First, we extend $\discta{A}$ and $\discta{B}$ with actions $\bar{\Sigma}$ as before, referring to transitions that are unbounded by time. Let $M$ be the maximal integer that appears in a transition guard of $\discta{A}$ or $\discta{B}$. Then, each transition $q \xrightarrow{a} q'$ of $\discta{A}$ or $\discta{B}$ with time constraint $t \geq m$, $m \leq M+\frac{1}{2}$, is replaced by the transitions $q \xrightarrow{a} q'$ with delays $t = m$, $t=m+\frac{1}{2}$,..., $t=M+\frac{1}{2}$ and another transition $q \xrightarrow{\bar{a}} q'$ with delay $t = (M+1)^*$. The set of delays of $\discta{A}$ ($\discta{B}$) is denoted by $\mathcal{D}$. In the next step we determinize $\discta{B}$ into $D(\discta{B})$. The idea is to be able to compare each timed trace of $\discta{A}$ simultaneously with all equivalent (having the same untimed trace) time traces of $\discta{B}$. \begin{definition} \label{def:detappta_b} The automaton $D(\discta{B})$ is a tuple $(\mathcal{Q}, Q_0, \mathcal{F}, \Sigma \cup \bar{\Sigma}, \mathcal{T})$, where: \begin{enumerate} \item $\mathcal{Q} \subseteq \mathcal{P}(\mathcal{Q}^{\discta{B}})$ is a subset of the power set of the locations of $\discta{B}$, where $Q_0 = \{q^{\discta{B}}_0\}$ is the initial location; \item $\mathcal{F} \subseteq \mathcal{Q}$ is the set of accepting locations, where location $Q = \{q^{\discta{B}}_1, \ldots, q^{\discta{B}}_m\}$ is accepting if at least one of the $q^{\discta{B}}_i$ is an accepting location of $\discta{B}$; \item $\Sigma \cup \bar{\Sigma}$ is the set of actions; \item $\mathcal{T} \subseteq \mathcal{Q} \times (\Sigma \cup \bar{\Sigma}) \times \mathcal{E} \times \mathcal{Q}$ is a finite set of transitions of the form $(Q, a, E, Q')$, where $$E = \{(q^{\discta{B}}, a, d, q'^{\discta{B}}) \in \mathcal{T}^{\discta{B}} \, : \, q^{\discta{B}} \in Q, q'^{\discta{B}} \in Q', a \in \Sigma \cup \bar{\Sigma}, d \in \mathcal{D} \}.$$ and $Q'$ contains exactly the set of these target locations $q'^{\discta{A}}$. \end{enumerate} \end{definition} Note that the transitions of $D(\discta{B})$ retain the set of transitions of $\discta{B}$ including source and target locations. In the next step we make the standard construction of the product automaton $\discta{A} \times D(\discta{B})$. It has at most $L = | \mathcal{Q} ^{\discta{A}} | \cdot 2^{|\mathcal{Q}^{\discta{B}}|}$ locations, where each location is of the form $$ Q^{\discta{A} \times D(\discta{B})} = (q^{\discta{A}}, \{q^{\discta{B}}_1, \ldots, q^{\discta{B}}_m\}). $$ Since the difference between a transition delay on $\discta{A}$ and a corresponding transition on $\discta{B}$ in parallel runs on $\discta{A}$ and $\discta{B}$ is at most $M$ time units (actually, it is $M+\frac{1}{2}$, but it makes no difference for our argument), then a run on $\discta{A} \times D(\discta{B})$ that does not visit the same location twice may result in a delay of at most $LM$ time units between its projection to $\discta{A}$ and each of its projections to $\discta{B}$. At each transition of a run on $\discta{A} \times D(\discta{B})$ we can subtract the delay of the edge of $\discta{A}$ from each of the delays of the corresponding edges of $\discta{B}$ and record at each location $q^{\discta{B}}_i$ of $Q^{\discta{A} \times D(\discta{B})}$ the set of \emph{accumulated time differences} (ATDs), that is, the differences in absolute time between the runs on $\discta{A}$ and all possible runs on $\discta{B}$ of the same untimed trace when reaching $Q^{\discta{A} \times D(\discta{B})}$. The ATD of the least absolute value gives the least difference in time at that location between the run on $\discta{A}$ and a corresponding run on $\discta{B}$. When a delay is $(M+1)^*$ (and then it is the same delay for both $\discta{A}$ and $\discta{B}$) then we denote the difference $0^+$, and this $+$ sign carries on to the next differences by defining $i^+ + j = (i+j)^+$, $i^+ + j^+ = (i+j)^{++}$, and so on. It means that $i^+$ is actually any value of $\frac{1}{2}\mathbb{N}_0$ which is greater than or equals $i$. The reason for that is that for a delay $k$ in $\discta{A}$ we can choose any delay $l \geq k$ in $\discta{B}$. In order to exclude the possibility of choosing also a delay in $\discta{B}$ which is smaller than $k$ (and maybe reduce the distance between the corresponding paths in $\discta{A}$ and $\discta{B}$), each transition of $\discta{A}$ that is unbounded in time is considered as a delay of $M+1$ time units. Once a value of the form $i^+$ is realized as a concrete value $i+j$, for some $j \geq 0$, then in all the difference values that appear in the following locations the relevant $+$ sign is removed and the value $j$ is added. Every run $\rho$ on $\discta{A} \times D(\discta{B})$ can be uniquely written in the form $$ \rho = \rho_0 \sigma_1^{i_1} \rho_1 \sigma_2^{i_2} \rho_2 \cdots \sigma_r^{i_r} \rho_r, $$ for some $r \in \mathbb{N}_0$, $i_j \in \mathbb{N}$ and where each $\sigma_j$ is a simple cycle of positive length and each $\rho_j$ is without cycles and of length $0 \leq l < L$. We say that the number of \emph{power cycles} of $\rho$ is $r$, written $pc(\rho)=r$. \begin{theorem} It is decidable whether there exists a fixed $K \in \mathbb{N}$, such that for every $N \in \mathbb{N}$ there exists a timed trace $\tau \in \mathfrak{L}(\discta{A})$, such that $d(\tau, \mathfrak{L}(\discta{B})) > N$ and the corresponding run $\rho$ on $\discta{A} \times D(\discta{B})$ satisfies $pc(\rho) \leq K$. \end{theorem} \begin{proof} The conformance distance $c(\mathfrak{L}(\discta{A}), \mathfrak{L}(\discta{B}))$ is $\infty$ if for every $N \in \mathbb{N}$ we can reach a location $Q^{\discta{A} \times D(\discta{B})}$ with all ATDs of absolute value at least $N$. Since $pc(\rho) \leq K$, $K$ fixed, it is clear that the unbounded increase in the ATDs can come only from the powers of simple cycles $\sigma^{i_j}$. Since the number of locations of $\discta{A} \times D(\discta{B})$ is finite, all locations can be reached in a bounded number of steps. Then, for each location $Q^{\discta{A} \times D(\discta{B})}$ and each simple cycle $\sigma$ starting at $Q^{\discta{A} \times D(\discta{B})}$, it can be checked for which locations $q^{\discta{B}}_i$ of $Q^{\discta{A} \times D(\discta{B})}$ the minimal (in absolute value) ATD increases indefinitely when repeating the cycle $\sigma$. Let $P$ be the set of these locations $Q^{\discta{A} \times D(\discta{B})}$ with at least one unbounded ATD. Next we look at all the simple paths from each $Q^{\discta{A} \times D(\discta{B})} \in P$ to the other locations of $\discta{A} \times D(\discta{B})$ and update their sub-locations $q^{\discta{B}}_i$ of having an unbounded ATD. Moreover, when reaching a location $Q'^{\discta{A} \times D(\discta{B})} \in P$ from another location $Q^{\discta{A} \times D(\discta{B})} \in P$ then it can be checked whether new sub-locations $q^{\discta{B}}_i$ of $Q'^{\discta{A} \times D(\discta{B})}$ become with unbounded ATD when repeating a cycle $\sigma$ (even when its minimal ATD decreases by a bounded finite number at each round of $\sigma$, if we started with an unbounded value, we can end at an unbounded value). This process is repeated until no improvement in the maximum number of sub-locations of unbounded ATD can be achieved. Since the graph is finite, the whole algorithm is finite. Finally, $c(\mathfrak{L}(\discta{A}), \mathfrak{L}(\discta{B})) = \infty$ when at some step of the algorithm a location $Q^{\discta{A} \times D(\discta{B})}$ becomes with all its sub-locations $q^{\discta{B}}_i$ of unbounded ATD. \end{proof} \section{Conclusion and Suggested Future Research} In this paper we introduced a natural definition of the distance between the languages of non-deterministic timed automata in terms of the times at which events in one automaton occur compared to the times of corresponding events in the other automaton. We showed how one can effectively construct discretized deterministic timed automata and obtain the distance between the original timed automata from the distance between the discretized versions. Consequently, the problem of language inclusion for timed automata, which is undecidable in general, is decidable if we consider the closure of the languages with respect to the Euclidean topology. Computing the distance between timed automata may not be an easy task. We even do not know whether the finiteness of the distance is a decidable problem. We showed, however, that under some restriction on the timed traces, this problem is decidable. There is more than one reasonable way to define the distance between timed automata and the one we chose refers to the accumulated time difference that may occur between timed automata that are supposed to be (almost) the same or conformance distance between the language of an implementation and that of the specification. Other possible definitions of distances like a maximal time difference on a single transition or time difference mean on simple cycles are easier to compute on the discretized automata. For another notion of distance between implementation and specification we refer to \cite{CHR12}. Another interesting problem is to compute the distance between timed automata equipped with probabilities on transitions, where the distances are computed as expected values with respect to these probabilities. \subsection*{Acknowledgements.} \begin{small} This research was partly supported by the Austrian Science Fund (FWF) Project P29355-N35. \end{small}
\section{Introduction} Coexisting solutions or stable attractors are a hallmark of nonlinear systems and appear in highly disparate scientific applications~\cite{Thompson2002Nonlinear,Brun1985Observation,Maurer1980Effect,May1977Thresholds,Hudson1981Chaos,Wang2018Dynamics,Wang2019Nonlinear,Wang2020Nonlinear}. For these systems with multiple attractors, there often exists a preferable solution and one or more less preferable, or potentially catastrophic, solutions~\cite{Pisarchik2014Control}. For example, many nonlinear energy harvesters have multiple attractors, each with different levels of power output, among which the highest-power one is typically desired~\cite{Mann2009Energy,Stanton2010Nonlinear,Stanton2009Reversible}. Another example is the coexistence of period\nobreakdash-1 and period\nobreakdash-2 rhythms in cardiac dynamics. Controlling the trajectory of the cardiac rhythm to period\nobreakdash-1 is desirable to avoid arrhythmia~\cite{Kline1995Dynamical,Yehia1999Hysteresis}. Furthermore, coexisting solutions also appear in ecology and represent various degrees of ecosystem biodiversity~\cite{Scheffer2001Catastrophic}, where a bio-manipulation scheme is needed to avoid certain detrimental environmental states~\cite{Van2007Slow}. These and other applications have motivated the development of several control methods to switch between attractors of nonlinear dynamical systems. Pulse control is one of the simplest methods; it applies a specific type of perturbation to direct a system's trajectory from one basin of attraction to another and waits until the trajectory settles down to the desired attractor~\cite{Kaneko1989Chaotic,Kaneko1990Clustering,Samson1992Nonlinear}. Targeting algorithms, which were presented by Shinbrot et al.\ and modified by Macau et al., exploit the exponential sensitivity of basin boundaries in chaotic systems to small perturbations to direct the trajectory to a desired attractor in a short time~\cite{Shinbrot1990Using,Macau1999Driving}. Lai developed an algorithm to steer most trajectories to a desired attractor using small feedback control, which builds a hierarchy of paths towards the desirable attractor and then stabilizes a trajectory around one of the paths~\cite{Lai1996Driving}. Besides switching between naturally stable attractors, one can also stabilize the unstable periodic orbits and switch between these stabilized attractors. Since the OGY method was devised by Ott, Grebogi, and Yorke in 1990~\cite{Ott1996Controlling}, numerous works have built upon this original idea and explored relevant applications~\cite{Casas1997Control,Macau2006Control,Shinbrot1993Using,Yagasaki1998New,Epureanu1998Optimality,Hill2001Control}. Although these methods can work for certain categories of problems, they are subject to at least one of the following restrictions: (1)~they only work for chaotic systems; (2)~they only work for autonomous systems; (3)~they need existence of unstable fixed points; (4)~they cannot apply constraints to control; or (5)~they cannot apply control optimization. Especially for the last two limitations, the compatibility with constrained optimal control is difficult to realize for most methods mentioned yet plays an important role in designing a real-world controller. For example, the limitations on the instantaneous power/force and total energy/impulse of a controller need be considered in practice. Another practical consideration is the optimization of total time and energy spent on the control process. Switching attractors using as little time or energy as possible is oftentimes required, especially when attempting to escape detrimental responses or using a finite energy supply. Fortunately, a technique that is compatible with a broader scope of nonlinear systems, Reinforcement Learning (RL), can be applied without the aforementioned restrictions. By learning action-decisions while optimizing the long-term consequences of actions, RL can be viewed as an approach to optimal control of nonlinear systems~\cite{Chen1996RL}. Various control constraints can also be applied by carefully defining a reward function in RL~\cite{Sutton1992RL}. Although several studies of attractor selection using RL were published decades ago~\cite{Der1994Q,Gadaleta1999Optimal,Gadaleta2001Learning}, they dealt with only chaotic systems with unstable fixed points due to the limited choice of RL algorithms at the time. In recent years, a large number of advanced RL algorithms have been created to address complex control tasks. Most tasks with complicated dynamics have been implemented using the 3D physics simulator MuJoCo~\cite{Todorov2012Mujoco}, including control of Swimmer, Hopper, Walker~\cite{Levine2013Guided, Schulman2015Trust}, Half-Cheetah~\cite{Heess2015Learning}, Ant~\cite{Schulman2015High} and Humanoid~\cite{Tassa2012Synthesis} systems for balance maintenance and fast movement. Apart from simulated tasks, RL implementation in real-world applications includes motion planing of robotics~\cite{Mahmood2018Benchmarking}, autonomous driving~\cite{Lange2012Autonomous}, and active damping~\cite{Turner2020RL}. Furthermore, several researchers have explored RL-based optimal control for gene regulatory networks (GRNs), with the goal of driving gene expression towards a desirable attractor while using a minimum number of interventions~\cite{Datta2003External}. For example, Sirin et al.\ applied the model-free batch RL Least-Squares Fitted Q Iteration (FQI) method to obtain a controller from data without explicitly modeling the GRN~\cite{Sirin2013Employing}. Imani et al.\ used RL with Gaussian processes to achieve near-optimal infinite-horizon control of GRNs with uncertainty in both the interventions and measurements~\cite{Imani2017Control}. Papagiannis et al.\ introduced a novel learning approach to GRN control using Double Deep Q Network (Double DQN) with Prioritized Experience Replay~(PER) and demonstrated successful results for larger GRNs than previous approaches~\cite{ Papagiannis2019Deep, Papagiannis2019Learning}. Although these applications of RL for reaching GRNs' desirable attractors are related to our goal of switching attractors in continuous nonlinear dynamical systems, they are limited to Random Boolean Networks (RBN), which have discrete state and action spaces. A further investigation into generic nonlinear dynamical systems, where states and control inputs are oftentimes continuous, is therefore needed. This paper will apply two RL algorithms, the cross-entropy method~(CEM) and deep deterministic policy gradient~(DDPG), to investigate the problem of attractor selection for a representative nonlinear dynamical system. \section{Reinforcement Learning (RL) Framework} \label{framework} In the RL framework shown in Fig.~\ref{fig:RL}, an \textit{agent} gains experience by making \textit{observations}, taking \textit{actions} and receiving \textit{rewards} from an \textit{environment}, and then learns a \textit{policy} from past experience to achieve goals (usually maximized cumulative \textit{reward}). To implement RL for control of dynamical systems, RL can be modeled as a Markov Decision Process (MDP): \begin{enumerate} \item A set of environment states $S$ and agent actions $A$. \item $P_a(s, s') = \text{Pr}( s_{t+1} = s'\,|\, s_t = s, a_t=a )$ is the probability of transition from state $s$ at time $t$ to state $s'$ at time $t + 1$ with action $a$. \item $r_a (s,s')$ is the immediate reward after transition from $s$ to $s'$ with action $a$. \end{enumerate} A deterministic dynamical system under control is generally represented by the governing differential equation: \begin{equation} \dot{x} = f(x,u,t), \end{equation} where $x$ is the system states, $\dot{x}$ is the states' rate of change, and $u$ is the control input. The governing equation can be integrated over time to predict the system's future states given initial conditions; it plays the same role as the transition probability in MDP. This equivalent interpretation of the governing equations and transition probability offers the opportunity to apply RL to control dynamical systems. The environment in RL can be either the system's governing equation if RL is implemented in simulation, or the experimental setup interacting with the real world if RL is implemented for a physical system. Instead of the conventional notation of states $x$ and control input $u$ in control theory, research in RL uses $s$ and $a$ to represent states and actions respectively. These RL-style notations are used throughout the remainder of this article. This paper implements RL algorithms to realize attractor selection (control of multi-stability) for nonlinear dynamical systems with constrained actuation. As a representative system possessing multiple attractors, the Duffing oscillator was chosen to demonstrate implementation details. \begin{figure} \centering \includegraphics[width=0.6\linewidth]{RL_schematic \caption{The typical framework of Reinforcement Learning. An agent has two tasks in each iteration: (1)~taking an action based on the observation from environment and the current policy; (2)~updating the current policy based on the immediate reward from environment and the estimated future rewards.} \label{fig:RL} \end{figure} \begin{figure*} \centering \includegraphics[width=0.9\linewidth]{Duffing \caption{Coexisting attractors for the hardening Duffing oscillator: $\ddot{x} + 0.1 \dot{x} + x + 0.04 x^3 = \cos{\omega t}$. (a)~Frequency responses. (b)~Phase portrait of coexisting solutions when $\omega = 1.4$. Within a specific frequency range, periodic solutions coexist in (a), including two stable solutions (green solid lines) and an unstable solution (red dashed line) in-between. The stable solutions correspond to an attractor with small amplitude (SA) and one with large amplitude (LA). The dotted line in (b) is a trajectory of switching attractor SA $\rightarrow$ LA using the control method introduced in this paper.} \label{fig:Duffing} \end{figure*} \textbf{Environment}. A harmonically forced Duffing oscillator, which can be described by the equation $\ddot{x} + \delta \dot{x} + \alpha x + \beta x^3 = \Gamma \cos{\omega t}$, provides a familiar example for exploring the potential of RL for attractor selection. Fig.~\ref{fig:Duffing} shows an example of a hardening ($\alpha > 0$, $\beta > 0$) frequency response. For certain ranges of the parameters, the frequency response is a multiple-valued function of $\omega$, which represents multiple coexisting steady-state oscillations at a given forcing frequency. With a long-run time evolution, the oscillation of the unstable solution cannot be maintained due to inevitable small perturbations. The system will always eventually settle into one of the stable steady-state responses of the system, which are therefore considered ``attractors''. Our objective is to apply control to the Duffing oscillator to make it switch between the two attractors using constrained actuation. To provide actuation for attractor selection, an additional term $a(s)$, is introduced into the governing equation: \begin{equation} \ddot{x} + \delta \dot{x} + \alpha x + \beta x^3 = \Gamma\cos{ \left( \omega t + \phi_0 \right) } + a(s). \label{eq:Duffing} \end{equation} where $a(s)$ is the actuation which depends on the system's states $s$. For example, if the Duffing oscillator is a mass--spring--damper system, $a(s)$ represents a force. \textbf{Action}. Aligned with the practical consideration that an actuation is commonly constrained, the action term can be written as $a(s) := F \pi_\theta(s)$, where $F$ is the action bound which denotes the maximum absolute value of the actuation, and $\pi_\theta(s)$ is the control policy. $\pi_\theta(s)$ is designed to be a function parameterized by $\theta$, which has an input of the Duffing oscillator's states $s$, and an output of an actuation scaling value between $-1$ and $1$. Our objective is achieved by finding qualified parameters $\theta$ that cause the desired attractor to be selected. \textbf{State \& Observation}. The Duffing oscillator is driven by a time-varying force $\Gamma\cos{\omega t}$; thus, the state should consist of position $x$, velocity $\dot{x}$, and time $t$. Given that $\Gamma\cos{\omega t}$ is a sinusoidal function with a phase periodically increasing from $0$ to $2\pi$, time can be replaced by phase for a simpler state expression. The system's state can therefore be written as $s := \left[ x,\, \dot{x},\, \phi \right]$, where $\phi$ is equal to $\omega t \text{ modulo } 2 \pi$. For the sake of simplicity, we have assumed that no observation noise was introduced and the states were fully observable by the agent. \textbf{Reward}. A well-trained policy should use a minimized control effort to reach the target attractor; thus the reward function, which is determined by state $s_t$ and action $a_t$, should inform the cost of the action taken and whether the Duffing oscillator reaches the target attractor. The action cost is defined as the impulse given by the actuation, $|{a}_t| \Delta t$, where $\Delta t$ is the time step size for control. The environment estimates whether the target attractor will be reached by evaluating the next state $s_{t+1}$. A constant reward of $r_\text{end}$ is given only if the target attractor will be reached. For estimating whether the target attractor will be reached, one could observe whether $s_{t+1}$ is in the ``basin of attraction'' of the target attractor. Basins of attraction (BoA) are the sets of initial states leading to their corresponding attractors as time evolves (see Fig.~\ref{fig:BoA}). Once the target BoA is reached, the system will automatically settle into the desired stable trajectory without further actuation. Therefore, the reward function can be written as: \begin{equation} r(s_t, a_t) = -|a_t| \Delta t + \begin{cases} r_\text{end}, & \text{if $s_{t+1}$ reaches target BoA}\\ 0, & \text{otherwise} \end{cases} \label{eq:reward} \end{equation} \textbf{BoA Classification}. Determining whether a state is in the target BoA is non-trivial. For an instantaneous state $s_t = [x_t,\, \dot{x}_t,\, \phi_t]$, we could set $a(s)=0$ in Eq.~\eqref{eq:Duffing} and integrate it with the initial condition $[x_0,\, \dot{x}_0,\, \phi_0] = s_t$. Integrating for a sufficiently long time should give a steady-state response, whose amplitude can be evaluated to determine the attractor. However, this prediction is needed for each time step of the reinforcement learning process, and the integration time should be sufficiently long to obtain steady-state responses; thus this approach results in expensive computational workload and a slow learning process. As a result, a more efficient method was needed for determining which attractor corresponded to the system's state~\cite{Wang2020Data}. Since the number of attractors is finite, the attractor prediction problem can be considered a classification problem, where the input is the system's state and the output is the attractor label. Given that the boundary of the basins is nonlinear as shown in Fig.~\ref{fig:BoA}, the classification method of support vector machines~(SVM) with Gaussian kernel was selected for the Duffing oscillator. For other nonlinear dynamical systems, logistic regression is recommended for a linear boundary of basins, and a neural network is recommended for a large number of attractors. The training data was created by sampling states uniformly on the domain of three state variables, and the attractor label for each state was determined by the method mentioned above: evaluating future responses with long-term integration of governing equation. Generally speaking, this method transfers the recurring cost of integration during the reinforcement learning process to a one-time cost before the learning process begins. Collecting and labeling the data for training the classifier can be time consuming, but once the classifier is well-trained, the time for predicting the final attractor can be negligibly small. \begin{figure*} \centering \includegraphics[width=0.9\linewidth]{BoA \caption{Basins of attraction (BoA) determined by the Duffing oscillator's state variables, $\left[ x,\, \dot{x},\, \phi \right]$. Each point in the BoA represents an initial condition which drives the system to a certain attractor without control. The orange solid line and the shaded areas are the large-amplitude attractor and its corresponding BoA, respectively. The blue dashed line and the blank areas are the small-amplitude attractor and its corresponding BoA, respectively.} \label{fig:BoA} \end{figure*} \section{Algorithms} \label{sec:algr} This section describes two RL algorithms for attractor selection, the cross-entropy method (CEM) and deep deterministic policy gradient (DDPG). These two methods were selected for their ability to operate over continuous action and state spaces~\cite{Duan2016}. This section will first explain a few important terms before describing the specifics of each algorithm. \begin{enumerate} \item[] \textit{Phase 1}: the phase where the system is free of control, i.e., $a(s)=0$. The system is given a random initial condition at the beginning of Phase 1, waits for dissipation of the transient, and settles down on the initial attractor at the end of Phase 1. % \item[] \textit{Phase 2}: the phase following Phase 1; the system is under control. Phase 2 starts with the system running in the initial attractor, and ends with either reaching the target BoA or exceeding the time limit. % \item[] \textit{Trajectory}: the system's time series for Phase 2. CEM uses trajectories of state-action pairs $[s_t,\, a_t]$, while DDPG uses trajectories of transitions $[s_t,\, a_t,\, r_t,\, s_{t+1}]$. The data of trajectories are stored in a replay buffer. % \item[] \textit{Replay Buffer}: an implementation of experience replay~\cite{Lin1992Self}, which randomly selects previously experienced samples to update a control policy. Experience replay stabilizes the RL learning process and reduces the amount of experience required to learn~\cite{Mnih2015Human}. \end{enumerate} The entire process for learning a control policy can be summarized as iterative episodes. In each episode, the system runs through Phase 1 and Phase 2 in turn and the control policy is improved using the data of trajectories stored in the replay buffer. CEM and DDPG are different methods for updating the control policy. \textbf{The cross-entropy method (CEM)} was pioneered as a Monte Carlo method for importance sampling, estimating probabilities of rare events in stochastic networks~\cite{Rubinstein1997, Rubinstein1999}. The CEM involves an iterative procedure of two steps: (1)~generate a random data sample according to a specified mechanism; and (2)~update the parameters of the random mechanism based on the data to produce a ``better'' sample in the next iteration~\cite{deBoer2005}. In recent decades, an increasing number of applications of the CEM have been found for reinforcement learning~\cite{Mannor2003cross, Szita2006learning, Busoniu2009Policy}. CEM-based RL can be represented as an iterative algorithm~\cite{Lapan2018Deep}: \begin{equation} \pi_{i+1} ( s ) = \mathop {\arg \min }\limits_{\pi_{i+1}} -\mathbb{E}_{z\sim\pi_{i} (s)} \left[ R(z) > \rho_i \right] \log \pi_{i+1}( s), \end{equation} where \begin{equation} R(z) = \sum\limits_t r( s_t, a_t | z\sim\pi_{i} ( s ) ). \end{equation} $R(z)$ is the cumulative reward of a single time series trajectory generated by the current control policy $\pi_{i}(s)$, and $\rho_i$ is the reward threshold above which the trajectories are considered successful samples. This iteration minimizes the negative log likelihood (i.e., maximizes the log likelihood) of the most successful trajectories to improve the current policy. In our scenario where the control policy $\pi( s)$ is a neural network parameterized by $\theta$, the CEM iteration can also be written as: \begin{equation} \theta_{i+1} = \mathop {\arg \min }\limits_{\theta} \frac{\sum\limits_j {L (a_j, F \pi_{\theta_{i}} (s_j ) ) \mathds{1}_A ( s_j ) }}{\sum\limits_j \mathds{1}_A ( s_j )}, \end{equation} where \begin{equation} A = \{s_j: s_j \in \mathcal{T}_k \,\,\text{and}\,\, R_{\mathcal{T}_k} > \rho_k\}. \end{equation} Given a state $s_j$ picked from the replay buffer, $L(\cdot,\cdot)$ is the loss function of the difference between its corresponding action value from past experience $a_j$, and the action value predicted by the current policy $F \pi_{\theta_{i}}$. The indicator function $\mathds{1}_A( s_j)$ has the value 1 when a state $s_j$ belongs to a successful trajectory $\mathcal{T}_k$ (i.e., the cumulative reward of the trajectory $R_{\mathcal{T}_k}$ is greater than the a threshold $\rho_k$), and has the value 0 otherwise. The detailed CEM algorithm designed for attractor selection is presented in the experiment section. \textbf{Deep Deterministic Policy Gradient (DDPG)} is a RL algorithm that can operate over continuous state and action spaces~\cite{Lillicrap2015DDPG}. The goal of DDPG is to learn a policy which maximizes the expected return $J = \mathbb{E}_{r_i, s_i, a_i}[R_{t=1}]$, where the return from a state is defined as the sum of discounted future rewards $R_t = \sum\nolimits_{i = t}^T \gamma^{i-t} r(s_i, a_i)$ with a discount factor $\gamma \in [0,\,1]$. An action-value function, also known as a ``critic'' or ``Q-value'' in DDPG, is used to describe the expected return after taking an action $a_t$ in state $s_t$: \begin{equation} Q(s_t, a_t) = \mathbb{E}_{r_{i \geqslant t}, s_{i>t}, a_{i>t}}[R_t | s_t,a_t]. \end{equation} DDPG uses a neural network parameterized by $\psi$ as a function appropriator of the critic $Q(s, a)$, and updates this critic by minimizing the loss function of the difference between the ``true'' Q-value $Q(s_t, a_t)$ and the ``estimated'' Q-value $y_t$: \begin{equation} L( \psi ) = \mathbb{E}_{s_t, a_t, r_t} \left[ \left( Q( s_t, a_t | \psi) - y_t \right) ^ 2 \right], \end{equation} where \begin{equation} y_t = r(s_t, a_t) + \gamma Q( s_{t+1}, \pi( s_{t+1} )_t | \psi). \label{eq:y_t} \end{equation} Apart from the ``critic'', DDPG also maintains an ``actor'' function to map states to a specific action, which is essentially our policy function $\pi(s)$. DDPG uses another neural network parameterized by $\theta$ as a function approximator of the actor $\pi(s)$, and updates this actor using the gradient of the expected return $J$ with respect to the actor parameters $\theta$: \begin{equation} \nabla_\theta J \approx \mathbb{E}_{s_t}\left[ \nabla_a Q_\psi(s, a) |_{s=s_t, a=\pi(s_t)} \nabla_\theta \pi_\theta (s) |_{s=s_t} \right]. \label{dJ} \end{equation} In order to enhance the stability of learning, DDPG is inspired by the success of Deep Q Network (DQN)~\cite{Mnih2013Playing, Mnih2015Human} and uses a ``replay buffer'' and separate ``target networks'' for calculating the estimated Q-value $y_t$ in Eq.~\eqref{eq:y_t}. The replay buffer stores transitions $[s_t,\, a_t,\, r_t,\, s_{t+1}]$ from experienced trajectories. The actor $\pi(s)$ and critic $Q(s, a)$ are updated by randomly sampling a minibatch from the buffer, allowing the RL algorithm to benefit from stably learning across uncorrelated transitions. The target networks are copies of actor and critic networks, $\pi'_{\theta'}(s)$ and $Q'_{\psi'}(s, a)$ respectively, that are used for calculating the estimated Q-value $y_t$. The parameters of these target networks are updated by slowly tracking the learned networks $\pi_{\theta}(s)$ and $Q_{\psi}(s, a)$: \begin{equation} \begin{split} &\psi' \leftarrow \tau \psi + (1-\tau) \psi', \\ &\theta' \leftarrow \tau \theta + (1-\tau) \theta', \end{split} \end{equation} where $0 < \tau \ll 1$. This soft update constrains the estimated Q-value $y_t$ to change slowly, thus greatly enhancing the stability of learning. The detailed DDPG algorithm designed for attractor selection is presented in the experiment section. One major difference between CEM and DDPG is the usage of the policy gradient $\nabla_\theta J$. DDPG computes the gradient for policy updates in Eq.\eqref{dJ} while CEM is a gradient-free algorithm. Another difference lies in their approach to using stored experience in the replay buffer. CEM improves the policy after collecting new trajectories of data, while DDPG continuously improves the policy at each time step as it explores the environment~\cite{Duan2016}. \setcounter{magicrownumbers}{0} \begin{table*} \caption{Algorithm: Cross-Entropy Method (CEM) for Attractor Selection} \label{table:CEM} \begin{tabular}{r|ll} \toprule \rownumber & Randomly initialize policy network ${\pi _\theta }(s)$ with weight $\theta$ &\\ \rownumber & Set the initial condition of the Duffing equation $s_0 = [x_0,\, \dot{x}_0,\, \phi_0]$ &\\ \rownumber & Set time of Phase 1 and Phase 2, $T_1$ and $T_2$ &\\ \rownumber & Set best sample proportion, $p \in [0,\,1]$ &\\ \rownumber & \textbf{for} episode = 1 : M \textbf{do} &\\ \rownumber & \quad Initialize an empty replay buffer $B$ &\\ \rownumber & \quad \textbf{for} sample = 1 : N \textbf{do}&\\ \rownumber & \quad\quad Initialize an empty buffer $\tilde{B}$ &\\ \rownumber & \quad\quad Initialize a random process $\mathcal{N}$ for action exploration &\\ \rownumber & \quad\quad Initialize trajectory reward, $R = 0$ &\\ \rownumber & \quad\quad Add noise to time of Phase 1, ${T_1}'=T_1+\text{random}(0, 2\pi / \omega)$ & \\ \rownumber & \quad\quad Integrate Eq.~\eqref{eq:Duffing} for $t \in \left[0,\, {T_1}' \right]$ with $a(s)=0$ & Phase 1\\ \rownumber & \quad\quad \textbf{for} $t = {T_1}'$ : ${T_1}' + T_2$ \textbf{do} & Phase 2\\ \rownumber & \quad\quad\quad Observe current state, $s_t = \left[ x_t,\, \dot{x}_t,\, \phi_t \right]$ &\\ \rownumber & \quad\quad\quad Evaluate action $a_t(s_t) = F\pi_\theta(s_t) + \mathcal{N}_t$, according to the current policy and exploration noise &\\ \rownumber & \quad\quad\quad Step into the next state $s_{t+1}$, by integrating Eq.~\eqref{eq:Duffing} for $\Delta t$ &\\ \rownumber & \quad\quad\quad Update trajectory reward $R \leftarrow R + r(s_t, a_t)$, according to Eq.~\eqref{eq:reward} &\\ \rownumber & \quad\quad\quad Store state-action pair $[s_t, a_t]$ in $\tilde{B}$ &\\ \rownumber & \quad\quad\quad Evaluate the basin of attraction for $s_{t+1}$ &\\ \rownumber & \quad\quad\quad \textbf{if} the target attractor's basin is reached: &\\ \rownumber & \quad\quad\quad\quad Label each state-action pair $[s_t, a_t]$ in $\tilde{B}$ with trajectory reward $R$, and append them to $B$ &\\ \rownumber & \quad\quad\quad\quad \textbf{break} &\\ \rownumber & \quad\quad \textbf{end for} &\\ \rownumber & \quad \textbf{end for} &\\ \rownumber & \quad Choose the a minibatch of the elite $p$ proportion of $(s, a)$ in $B$ with the largest reward $R$ &\\ \rownumber & \quad Update policy ${\pi _\theta }(s)$ by minimizing the loss, $L = \frac{1}{\text{Minibatch Size}}\sum\limits_i {\left( F \pi_\theta(s_i) - a_i \right)^2 }$ &\\ \rownumber & \textbf{end for} &\\ \bottomrule \end{tabular} \end{table*} \setcounter{magicrownumbers}{0} \begin{table*} \caption{Algorithm: Deep Deterministic Policy Gradient (DDPG) for Attractor Selection} \label{table:DDPG} \begin{tabular}{r|ll} \toprule \rownumber & Randomly initialize actor network ${\pi _\theta }(s)$ and critic network $Q_\psi(s, a)$ with weights $\theta$ and $\psi$ &\\ \rownumber & Initialize target network $\pi'_{\theta'}(s)$ and $Q'_{\psi'}(s, a)$ with weights $\theta' \leftarrow \theta$, $\psi' \leftarrow \psi$ &\\ \rownumber & Set the initial condition of the Duffing equation $s_0 = [x_0,\, \dot{x}_0,\, \phi_0]$ &\\ \rownumber & Set discount factor $\gamma$, and soft update factor $\tau$ &\\ \rownumber & Set time of Phase 1 and Phase 2, $T_1$ and $T_2$ &\\ \rownumber & Initialize replay buffer $B$ &\\ \rownumber & \textbf{for} episode = 1 : M \textbf{do} &\\ \rownumber & \quad Initialize a random process $\mathcal{N}$ for action exploration &\\ \rownumber & \quad Add noise to time of Phase 1, ${T_1}'=T_1+\text{random}(0, 2\pi / \omega)$ &\\ \rownumber & \quad Integrate Eq.~\eqref{eq:Duffing} for $t \in \left[0,\, {T_1}' \right]$ with $a(s)=0$ & Phase 1\\ \rownumber & \quad\textbf{for} $t = {T_1}'$ : ${T_1}' + T_2$ \textbf{do} & Phase 2\\ \rownumber & \quad\quad Observe current state, $s_t = \left[ x_t,\, \dot{x}_t,\, \phi_t \right]$ &\\ \rownumber & \quad\quad Evaluate action $a_t(s_t) = F\pi_\theta(s_t) + \mathcal{N}_t$, according to the current policy and exploration noise &\\ \rownumber & \quad\quad Step into the next state $s_{t+1}$, by integrating Eq.~\eqref{eq:Duffing} for $\Delta t$ &\\ \rownumber & \quad\quad Evaluate reward $r_t(s_t, a_t)$, according to Eq.~\eqref{eq:reward} &\\ \rownumber & \quad\quad Store transition $[s_t,\, a_t,\, r_t,\, s_{t+1}]$ in $B$ &\\ \rownumber & \quad\quad Sample a random minibatch of $N$ transitions $[s_i,\, a_i,\, r_i,\, s_{i+1}]$ from $B$ &\\ \rownumber & \quad\quad Set $y_i = r_i + \gamma Q'_{\psi'}(s_{i+1}, F\pi'_{\theta'}(s_{i+1}))$ &\\ \rownumber & \quad\quad \makecell[l]{Update the critic network by minimizing the loss: \\ \quad\quad\quad\quad $L=\frac{1}{N}\sum\limits_i (y_i - Q_\psi(s_i, a_i))^2$} &\\ \rownumber & \quad\quad \makecell[l]{Update the actor network using the sampled policy gradient: \\ \quad\quad\quad\quad $\nabla_\theta J \approx \frac{1}{N}\sum\limits_i \nabla_a Q_\psi(s, a) |_{s=s_i, a=F\pi_\theta(s_i)} \nabla_\theta \pi_\theta(s)|_{s=s_i}$ } &\\ \rownumber & \quad\quad \makecell[l]{Update the target networks: \\ \quad\quad\quad\quad $\psi' \leftarrow \tau \psi + (1-\tau) \psi',\, \theta' \leftarrow \tau \theta + (1-\tau) \theta'$} &\\ \rownumber & \quad\quad \textbf{if} the target attractor's basin is reached in $s_{t+1}$: \textbf{break}&\\ \rownumber & \quad \textbf{end for} &\\ \rownumber & \textbf{end for} & \\ \bottomrule \end{tabular} \end{table*} \section{Experiment} This section presents the details of the experiment performing attractor selection for the Duffing oscillator using CEM and DDPG. The governing equation for the Duffing oscillator is given by Eq.~\eqref{eq:Duffing}, where $\delta = 0.1$, $\alpha = 1$, $\beta = 0.04$, $\Gamma = 1$ and $\omega = 1.4$. The Duffing equation is integrated using scipy.integrate.odeint() in Python with a time step of 0.01. The time step for control is 0.25, and reaching the target BoA will add a reward $r_\text{end} = 100$. Therefore, the reward function Eq.~\eqref{eq:reward} can be written as: \begin{equation} r(s_t, a_t)= \begin{cases} 100 - 0.25 |a_t|, & \text{if $s_{t+1}$ reaches target BoA,}\\ - 0.25 |a_t|, & \text{otherwise.} \end{cases} \label{eq:reward_SM} \end{equation} For the estimation of BoA, the SVM classifier with radial basis function (RBF) kernel was trained using a \(50\times50\times50\) grid of initial conditions, with $x \in [-10,\, 10]$, $\dot{x} \in [-15,\, 15]$ and $\phi \in [0,\, 2\pi]$. The detailed attractor selection algorithm using CEM can be found in Tab.~\ref{table:CEM}. In line 11, the time of Phase 1 is perturbed by adding a random value between $0$ and $2\pi/\omega$ (a forcing period). This noise provides diversity of the system's states at the beginning of Phase 2, which enhances generality and helps prevent over-fitting of the control policy network $\pi_\theta(s)$. The policy network $\pi_\theta(s)$ has two fully connected hidden layers, each of which has 64 units and an activation function of ReLU \cite{Glorot2011Deep}. The final output layer is a tanh layer to bound the actions. Adam optimizer \cite{Kingma2014Adam} with a learning rate of $10^{-3}$ and a minibatch size of 128 was used for learning the neural network parameters. For the system's settling down in Phase 1 we used $T_1 = 15$, and for constraining the time length of control we used $T_2 = 20$. In each training episode, state-action pairs from 30 trajectory samples were stored in the replay buffer ($N = 30$), and those with reward in the top 80\% were selected for training the network ($p = 0.8$). The detailed attractor selection algorithm using DDPG can be found in Tab.~\ref{table:DDPG}. Apart from the ``actor'' network $\pi_\theta(s)$ which is same as the policy network in the CEM, the DDPG introduces an additional ``critic'' network $Q_\psi(s, a)$. This $Q$ network is designed to be a neural network parameterized by $\psi$, which has the system's state and corresponding action as inputs, and a scalar as the output. As in the algorithm using CEM, the state diversity is promoted by introducing noise to the time of Phase 1 in line 9. Both the actor network $\pi_\theta(s)$ and the critic network $Q_\psi(s, a)$ have two hidden layers, each of which has 128 units and an activation function of ReLU \cite{Glorot2011Deep}. For the actor network, the final output layer is a tanh layer to bound the actions. For the critic network, the input layer consists of only the state $s$, while the action $a$ is included in the 2nd hidden layer. Adam optimizer \cite{Kingma2014Adam} was used to learn the neural network parameters with a learning rate of $\tau_\theta = 10^{-4}$ and $\tau_\psi = 10^{-3}$ for the actor and critic respectively. For the update of the critic network we used a discount factor of $\gamma = 0.9$. For the soft update of the target network $\pi'_{\theta'}(s)$ and $Q'_{\psi'}(s, a)$ by Polyak Averaging, we used $\tau = 0.1$. For the system's settling down in Phase 1 we used $T_1 = 15$, and for constraining the time length of control we used $T_2 = 20$. The replay buffer had a size of $10^6$. In each episode, the minibatch of transitions sampled from the replay buffer had a size of $N=64$. To test the CEM and DDPG algorithms, constraints were constructed with varying levels of difficulty, i.e., different action bounds $F$. Recall that the control term in Eq.~\eqref{eq:Duffing} can be written as $a(s) = F\pi_\theta(s)$, which is bounded between $-F$ and $F$. It's also worth noting that each policy only controls a one-way trip of attractor switching. For the example of a Duffing oscillator with two attractors, one control policy is needed for transitioning from the small-amplitude attractor to the large-amplitude one, and another control policy is needed for the reverse direction. \begin{figure*} \centering \includegraphics[width=\linewidth]{CEM} \caption{Attractor selection using control policy learned by CEM with varying action bounds: (a) $F = 4$, (b) $F = 2$, (c) $F = 1$. The blue lines represent the Duffing oscillator running in the basin of attractor SA, which has a periodic solution with small amplitude. The orange lines represent the Duffing oscillator running in the basin of attractor LA, which has a periodic solution with large amplitude. The black dashed lines represent the Duffing oscillator under control. Each plot of the system's responses in the first row corresponds to the two sub-plots of the control processes in the second row: attractor SA $\rightarrow$ LA and attractor LA $\rightarrow$ SA.} \label{fig:CEM} \end{figure*} \begin{figure*} \centering \includegraphics[width=\linewidth]{DDPG} \caption{Attractor selection using control policy learned by DDPG with varying action bounds: (a) $F = 4$, (b) $F = 2$, (c) $F = 1$. The blue lines represent the Duffing oscillator running in the basin of attractor SA, which has a periodic solution with small amplitude. The orange lines represent the Duffing oscillator running in the basin of attractor LA, which has a periodic solution with large amplitude. The black dashed lines represent the Duffing oscillator under control. Each plot of the system's responses in the first row corresponds to the two sub-plots of the control processes in the second row: attractor SA $\rightarrow$ LA and attractor LA $\rightarrow$ SA.} \label{fig:DDPG} \end{figure*} \section{Results} \label{sec:result} \begin{figure*} \centering \includegraphics[width=0.7\linewidth]{learning_curve} \caption{The control policy performance curve for the success rate of reaching target attractor using (a) CEM and (b) DDPG, and the expected accumulated reward of a control process using (c) CEM and (d) DDPG. The varying action bound of 4, 2, and 1 are represented by the blue, orange, and green lines respectively. The gray areas in plot (c) and (d) represent standard deviation of the accumulated rewards.} \label{fig:learning_curve} \end{figure*} Fig.~\ref{fig:CEM} and Fig.~\ref{fig:DDPG} show the time series of attractor selection using the control policy learned by the CEM and DDPG algorithms, respectively. For simplicity, the attractor with a small amplitude of steady-state response is named ``SA'' while that with a large amplitude is named ``LA''. For all six test cases in Fig.~\ref{fig:CEM} and Fig.~\ref{fig:DDPG}, the Duffing oscillator starts near the SA solution, then switches from SA to LA, and finally switches backwards from LA to SA. Compared with the short time length for control (region of black lines), the attractor selection spends more time waiting for dissipation of the transient process, where the system is automatically approaching the target attractor under no control. This observation shows a smart and efficient strategy the control policy has learned: instead of driving the system precisely to the state set of the target attractor, it just drives the system to the attractor's basin, where the system might be far away from the target attractor initially but will reach it without further control effort as time evolves. One can also observe that a smaller action bound results in a longer time length of control for both CEM and DDPG algorithms. It can be qualitatively explained by the energy threshold for jumping from one attractor to another. The energy provided by the actuation should be accumulated beyond the energy threshold to push the system away from one attractor. A smaller action bound therefore leads to longer time for the energy accumulation. Another observation is that the system quickly approaches near LA when starting from SA, while it takes more time to approach near SA when starting from LA. This can be explained using the unstable solution of the Duffing equation which is represented as the red dashed circle in Fig.~\ref{fig:Duffing}~(b). This circle can be considered the boundary between the basins of two attractors, across which the system jumps from one attractor to another. This boundary is close to LA, which means that the system will be near LA immediately after going across the boundary from SA. In contrast, SA is far from the boundary; therefore, a longer time is needed to reach near SA after going across the boundary from LA. The attractors' distances from the unstable solution also indicate their robustness and likelihood of occurrence. In this Duffing oscillator, SA is more robust and more likely to occur than LA. The successful switching from a more likely attractor (such as SA) to a less likely attractor (such as LA), which is difficult for traditional control methods, is another advantage of the proposed RL-based methods. Although the CEM and DDPG algorithms both achieve attractor selection with various action bounds, DDPG has advantages of providing smooth actuations. From the comparison of the actuation $F\pi_\theta(s)$ between Fig.~\ref{fig:CEM} and Fig.~\ref{fig:DDPG}, the actuation from CEM shows more jagged motion than that from DDPG especially for the small action bound. More advantages of DDPG over CEM can be observed in Fig.~\ref{fig:learning_curve}, which compares the trend of their policies' success rate and expected reward during learning process. In each learning episode, 100 samples with random initial states were used to evaluate the control policy's success rate of reaching the target attractor and the mean and standard deviation of the samples' accumulated reward. For faster convergence, the policy trained for a tighter action bound was initialized with the parameters of a well-trained policy for a more generous action bound. In other words, instead of learning from nothing, a policy learned to solve a hard problem from the experience of solving an easy one. The ``untrained'' policy for the action bound of 2 was initialized with the parameters of the ``trained'' policy for the action bound of 4, and so on. Therefore in Fig.~\ref{fig:learning_curve}, the action bound decreases as the learning episode increases. The success rates and expected rewards were equally high for both CEM and DDPG at the end of the learning for each action bound (episode = 100, 200, 300), but DDPG converged faster, especially for the action bound of 1. This advantage of DDPG can be observed from the performance curve which evolves with ``episode'' in Fig.~\ref{fig:learning_curve}, but DDPG is even better than this considering that it spends much less time on each episode than CEM. As shown in the Table~\ref{table:CEM}, CEM needs $N$ samples of trajectories for updating the policy in each episode, while DDPG (see Table~\ref{table:DDPG}) collects only the sample of a single trajectory. The real learning speed can therefore be reflected by the total ``samples'' generated instead of ``episode''. Fig.~\ref{fig:learning_curve} shows the DDPG's advantage of learning speed and data efficiency by providing an additional horizontal axis for the number of samples, where CEM generates 30 samples per episode while DDPG generates only 1 sample per episode. Parallel computing can be used for helping CEM narrow the gap, but generally DDPG has a natural advantage of learning speed. Furthermore, after the CEM learned an optimal policy, it often degenerated to a sub-optimal policy, which can be observed from the small perturbation around episode 150 and the significant oscillation throughout episode 200--300 in Fig.~\ref{fig:learning_curve}~(b,d). In contrast, DDPG shows a lower variance of the policy performance after an optimal policy has been learned, which can be observed from the flat line in episode 100--200 and the comparatively small perturbation in episode 200--300. \section{Conclusion} \label{sec:conclusion} This work applies advanced reinforcement learning (RL) methods to the control problem of attractor selection, resulting in algorithms that switch between coexisting attractors of a nonlinear dynamical system using constrained actuation. A control framework was presented combining attractor selection and general RL methods. Two specific algorithms were designed based on the cross-entropy method (CEM) and deep deterministic policy gradient (DDPG). The Duffing oscillator, which is a classic nonlinear dynamical system with multiple coexisting attractors, was selected to demonstrate the control design and show the performance of the control policy learned by CEM and DDPG. Both methods achieved attractor selection under various constraints on actuation. They had equally high success rates, but DDPG had advantages of smooth control, high learning speed, and low performance variance. The RL-based attractor selection is model-free and thus needs no prior knowledge on the system model. This provides broad applicability since precise mathematical models for many real-world systems are often unavailable due to their highly nonlinear features or high noise level. Additionally, the control constraints can be easily customized for a wide variety of problems. Apart from constraining the maximum actuation in the Duffing oscillator example, the system's position can be constrained in case of working in a limited space, the system's velocity can be constrained if there exists a hardware requirement of speed range, and the constraints themselves can even be time-varying. Various constraints can be realized by carefully designing the action term and reward function. Future work needs to extend our investigations in three key directions. First, although the proposed approach is model-free and does not require a priori knowledge of the system dynamics when training the control policy, obtaining the basins of attraction (BoAs) might still require prior knowledge of the system's equilibria and stability behavior as derived from the governing equation. In order to entirely get rid of this model dependence, a data-driven approach to automatically finding coexisting attractors based on simulation or experimental data will be needed. Second, the quantity of samples for training a qualified BoA classifier needs to be reduced. As mentioned in the experiment section, the classifier was trained using a $50\times50\times50$ grid of 3-dimensional initial conditions. Each of $125,000$ samples was obtained by running a simulation and evaluating its final state. A large number of training samples will become a huge burden when (1)~simulations are computationally expensive, (2)~samples are collected from experiment, or (3)~the dimension of initial conditions is high. A more data-efficient sampling method is therefore needed. Third, we would like to reiterate that the model-free approach proposed in this paper only indicates that a model is unnecessary for learning a control policy, but does not mean the model is useless. If the approach is implemented in real-world experiments which are much more costly than simulations, a more efficient way is to first find a sub-optimal control policy in simulation and then ``transfer'' the pre-trained policy to the experiments for further optimization. This process is called ``transfer learning'', where the heavy-learning workload in experiments is shared with simulations, and the simulation-based RL will need a model as its environment. More studies implementing the attractor selection approach based on real-world experiments and transfer learning are certainly worthy topics for further investigations. This study demonstrated two reinforcement learning approaches for constrained attractor selection. These approaches make it possible to switch between attractors without the limitations of prior methods in the literature. By optimizing the policy subject to realistic constraints, they are applicable to a wide variety of practical problems. \bibliographystyle{unsrt}
\section{Introduction}\label{sec:introduction}} \else \section{Introduction} \label{sec:introduction} \fi \IEEEPARstart{D}{imension} estimation (DE) is the process of determining the \emph{intrinsic dimensionality} of data (e.g., see Chapter 3 in \cite{nldrLeeVerlysen}). Usually, real world datasets have large numbers of features, often significantly greater than the number of latent factors underlying the data generating process, and DE attempts to quantify the number of latent factors in a dataset. Of course, latent factors are often discussed in relation a linear analysis. However, such ideas can be generalized to a non-linear context, and such generalizations will be our focus here. For example, in an image processing problem each pixel of an image can be thought of a feature that one measures about the image. However, the measured pixels are not independent of each other since, for example, nearby pixels are likely to have similar colors. Accordingly, it can be quite useful to estimate the underlying latent factors, such as pose and lighting, that effect many pixels simultaneously. The precise definition of a latent factor, and therefore the precise definition of the intrinsic dimensionality, can be quite challenging. For example, Principal Component Analysis (PCA) (which we will discuss in detail in the sequel) defines latent factors in terms of linear projections and orthogonality. At the other extreme, one can consider quite complicated scenarios involving fractal dimensions and space filling curves \cite{nldrLeeVerlysen}. In this text we take a middle of the road approach, and focus on non-linear, but smooth, manifolds. Such an approach is quite popular, and such DR and DE techniques are used in diverse domains such as engineering, astronomy\cite{hoyle2015anomaly}\cite{baron2016weirdest}, biology\cite{dai2006dimension}\cite{parsons2017dimension}, remote sensing\cite{zhao2016spectral}\cite{dalponte2008fusion}, economics\cite{nassirtoussi2015text}\cite{rathnayaka2013econometric}, social media\cite{nori2012multinomial}\cite{lee2017big}, and finance\cite{wang2006effects}\cite{albanese2002dimension}; and this class of techniques has a large extant literature (see, e.g., \cite{van2009dimensionality, nldrLeeVerlysen} and references therein). {\textit{Dimension Reduction} (DR) is the process of reducing a high dimension dataset with $N$ features into a dataset with $p$ features, where $p \ll N$. Perhaps the most classic method in this domain is PCA\cite{jolliffe2002principal}, and a detailed study of PCA will illuminate many of the issues that arise when performing DR and DE with autoencoders. Unfortunately, most DR methods need an estimate of the number of latent variables as a user-defined input to the process of dimensionality reduction. Estimates of the number of latent variables in a particular dataset can come from a variety of principles (e.g., see Chapter 3 in \cite{nldrLeeVerlysen}) and looking at the example of PCA will provide illumination for our work. In particular, as we will foreshadow here and detail in the sequel, PCA is commonly implemented using the singular-value decomposition(SVD) \cite{golub1970singular} where a data matrix $\boldsymbol{X}\in\mathbb{R}^{m \times n}$ is factored into the form ${\boldsymbol{U\Sigma V^{T}}}$, where $\boldsymbol{U}\in\mathbb{R}^{m \times m}$ is an unitary matrix, $\boldsymbol{\Sigma}\in\mathbb{R}^{m \times n}$ is rectangular diagonal matrix with non-negative real numbers on the diagonal, and $\boldsymbol{V}\in\mathbb{R}^{n \times n}$ is also an unitary matrix. The diagonal entries ${\boldsymbol{\sigma _{i}}}$ of ${\boldsymbol{\Sigma}}$ are known as the singular values of ${\boldsymbol{X}}$. Dimension reduction to dimension $k$ for $\boldsymbol{X}$ can be performed by removing the $n-k$ columns of ${\boldsymbol{\Sigma}}$ with smallest ${\boldsymbol{\sigma _{i}}}$, giving rise to a ${\boldsymbol{\hat{\Sigma}}}\in\mathbb{R}^{m \times k}$, and then computing $\boldsymbol{U} \boldsymbol{\hat{\Sigma}}$. Of course, in the presence of finite samples and noise in data the choice of an appropriate $k$ is non-trivial. In particular, any ${\boldsymbol{\sigma _{i}}}$ with the property that ${\boldsymbol{\sigma _{i}}}=0$ can be removed without changing the properties of the data (e.g., the Euclidean distances between the points). However, in real-world data it is rarely the case that ${\boldsymbol{\sigma _{i}}}=0$ for any ${\boldsymbol{\sigma _{i}}}$, and dimension reduction using PCA will change the properties of the data in $\boldsymbol{X}$. As a running example in this paper, consider images of hand-written digits from the MNIST\cite{deng2012mnist} dataset. For example, using PCA and a user-defined estimate of the number of latent variable $k = 50,100,200,400, 784$ we reduce the number of features of digit $0$ and reconstruct digit $0$ using the formula $\boldsymbol{\hat{X}} = \boldsymbol{U} \boldsymbol{\hat{\Sigma}} \boldsymbol{\hat{V}^T}$ for $\boldsymbol{\hat{V}}\in\mathbb{R}^{n \times k}$, to see the effect of various levels of dimension reduction. Visually, even when we reduce the number of dimension of digit 0 from 784 to 50, the reconstructed digit $0$ is visually (figure~\ref{fig:mnist_k_dim}) similar to the original digit 0. Note, already a quite important issue has arisen. How is one to chose $k$? To assist the latent dimension estimation process a scree plot (figure~\ref{fig:mnist_digit0_pca}) of the PCA digit $0$, which plots the sizes of the singular values ${\boldsymbol{\sigma _{i}}}$, can be used. Moreover, one may expect that reconstruction error will remain low if $k$ is greater than the intrinsic dimensionality of the linear PCA embedding. On the contrary, if $k$ goes below the intrinsic dimensionality, the dimensionality reduction may cause a sudden increase in reconstruction error. This is illustrated in digit $0$ using a reconstruction error plot(figure~\ref{fig:mnist_digit0_pca_recon_err}) as $k$ decreases. \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/mnist_k_dim.png} \caption{Each MNIST digit $0$ is ${28 \times 28}$ pixel image that gives us $784$ features. We arbitrarily choose a starting dimensionality $k=50$ and reduce the number of features from $784$ down to $50$ and reconstruct and plot digit $0$. This process is repeated by increasing $k$ till $k=784$, the maximum number of features.} \label{fig:mnist_k_dim} \end{figure} \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/mnist_digit0_pca.png} \caption{Scree plot of normalized variance of digit $0$ shows that as the number of principal components increase the normalized variance quickly drops before tapering out at $30$, a number much less than original $784$ components. Hence, a possible approximation of the intrinsic dimension might be $30$.} \label{fig:mnist_digit0_pca} \end{figure} \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/mnist_digit0_pca_recon_err.png} \caption{Estimation of intrinsic dimensionality $k$ of digit 0 as the number of dimension increases. When $k$ is reduced below 50 there is sudden increase in reconstruction error.} \label{fig:mnist_digit0_pca_recon_err} \end{figure} However, we are most interested in moving beyond the linear DR provided by PCA and estimating non-linear dimensionality of datasets. Therefore, we study how autoencoders\cite{rumelhart1985learning}\cite{vincent2008extracting}, a classic deep neural network used for DR, can also be used for DE. An autoencoder (AE) is a type of artificial neural network used to learn an approximation to the identity function, so that the output {\textbf{\^{X}}} is similar to n-dimensional input $\boldsymbol{X}$. Because the hidden layer acts a bottleneck, when the autoencoder compresses the input to a latent space representation and then reconstructs the output from the latent space representation the hidden units encode significant features in input data $\boldsymbol{X}$. \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/autoencoder.png} \caption{A schematic of an autoencoder with input layer, encoding layer, hidden layer, decoding layer and output layer.} \label{fig:autoencoder} \end{figure} Just like $k$, which defines the number of principal components in PCA, $n$ (figure~\ref{fig:mnist_ae_diff_hidden}), which defines the number of nodes in the innermost hidden layer, needs to be estimated before building the autoencoder. Again, how do we estimate the appropriate number of nodes in the innermost hidden layer? PCA and autoencoders are closely related\cite{plaut2018principal}. An autoencoder with an identity activation function, and therefore linear layers, and a squared loss function will compute the same subspace as PCA\cite{plaut2018principal}. However, the parameterization of the subspace can be quite different. For example, the SVD guarantees that the basis is orthogonal and the singular values are ordered. \emph{Running gradient descents, a common optimization routine for neural networks, on an autoencoder makes no such guarantees. Restoring such guarantees for an autoencoder is the focus of our work.} \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/mnist_ae_diff_hidden.png} \caption{Similar to figure~\ref{fig:mnist_k_dim} this figure shows the reconstruction performance as the number of nodes($n$) in the autoencoder hidden layer increase from 2 to 32 the reconstructed image visually resembles more and more like the input.} \label{fig:mnist_ae_diff_hidden} \end{figure} AEs are designed for dimension reduction, but we are interested in using AE for estimating \emph{intrinsic dimension}. Unlike PCA, AEs do not natively support dimension estimation. There are no ordered singular values equivalent in the hidden layer that can be used to estimate dimension. For example, if we were to run the previous input (figure~\ref{fig:mnist_k_dim}) through an autoencoder with 32 nodes in innermost hidden layer (figure~\ref{fig:autoencoder}) and scatter plot the hidden layer for digit $0$ we see a set of values with no clear pattern that can be used to estimate the dimension of digit $0$, as illustrated in figure~\ref{fig:z_layer_orientation_64_0}. To transform the AE hidden layer into singular value proxies and subsequently use the proxies to estimate dimension is our research. \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/z_layer_orientation_64_0.png} \caption{Here we show a selection of images of $0$ and the $64$ dimension innermost hidden layers that correspond to each image. Note that for each image the innermost hidden layer has all $64$ entries non-zero. Does that mean the intrinsic dimension is therefore $64$? Not necessarily, since there is not penalty on the innermost hidden layer to force entries to be $0$ in a classic AE.} \label{fig:z_layer_orientation_64_0} \end{figure} \subsection{CONTRIBUTIONS}\label{sec:contributions} The main contributions of the paper can be summarized as follows: \begin{enumerate} \item We designed an algorithm to estimate the non-linear intrinsic dimension using AEs. The values of the innermost hidden layer are not appropriate for DE. However, we develop appropriate singular value proxies (SVP) that allow the dimension to effectively estimated. \item We applied dimension estimation algorithm to time series dataset such as stock prices of S\&P 500 index constituents as well as image data such as the MNIST digits dataset. \item We compared and contrasted how dimension estimation differs between linear PCA and a non-linear autoencoder. \end{enumerate} \subsection{BACKGROUND}\label{sec:background} While quantifying intrinsic dimension using linear technique such as PCA is standard, estimating the dimension of real-world time series datasets using autoencoders is more challenging. For example, Wang, Yao, and Zhao\cite{wang2016auto} used an autoencoder with varying number of nodes in hidden layer MNIST and Olivetti\cite{samaria1994parameterisation} dataset to determine intrinsic dimension. The authors find that as the number of nodes in hidden layer increased, the classification accuracy increased before plateauing. Our approach is fundamentally different. First, we do not change the network architecture (number of hidden nodes), since we found that using a binary search method to estimate the number of nodes required in hidden layer was quite inefficient. Second, in our approach each class of digits in the MNIST dataset has a different dimension and we have no reason to conjecture that the number of class labels (10 for MNIST) should be the same as intrinsic dimension of each digit. Recently (2018), Li, Farkhoor, Liu, and Yosinski \cite{li2018measuring} used a 2 layer fully connected (FC) and convolutional neural network (CNN) classifier to measure the intrinsic dimension of a neural network itself. For MNIST at 90\% classification accuracy the network's intrinsic dimension in case of FC was 750 and CNN was 290. Although the research is quite impressive, our goal is not determining intrinsic dimension of neural networks, but rather estimate intrinsic dimension of the manifold on which the MNIST digits lay. A widely studied problem in finance is stock portfolio diversification and such problems are closely connected to DE \cite{alexeev2012equity}~\cite{statman1987many}~\cite{tang2004efficient}. However, as far as we know, there is scant research studying the non-linear intrinsic dimension of financial markets. This motivates us to estimate the dimension of financial markets as one of our examples herein. This paper is structured through six sections. In section~\ref{sec:introduction}, we provide the problem definition and a brief introduction of relevant existing literature. We provide an overview of dimension reduction, building blocks to estimate dimension, in section~\ref{sec:pca_mds_iso_ae}. Section~\ref{sec:ae_svp} elaborates architectural choices we make in designing autoencoder for dimension estimation that allow for creating SVPs for autoencoders. Once we have SVPS then section~\ref{sec:dd_algo} details an algorithm to quantify the SVPS into dimensionality estimates. Section~\ref{sec:experiment} presents our experiments with MNIST and S\&P 500 datasets. Additionally, section \ref{sec:experiment} compares and contrasts the differences between PCA and autoencoder. Finally, section~\ref{sec:conclusion} provides a summary and pointers to future work. \section{Dimension Reduction}\label{sec:pca_mds_iso_ae} In this section, we provide an overview of linear dimension reduction technique such as PCA and nonlinear dimension reduction technique such as Isomap \cite{tenenbaum2000global} and autoencoders. \subsection{Linear Dimension Reduction Techniques}\label{sec:linear_dr} Linear techniques such as Principal Component Analysis (PCA)\cite{hotelling1933analysis} have seen wide use. The key idea of PCA is to construct low-dimensional sub-spaces that preserve as much of the variance in the data as possible and thereby preserve the data's correlation structure. \subsubsection{Principal Component Analysis}\label{sec:pca} As mentioned previously, PCA is a linear dimension reduction technique widely used in machine learning. Using correlations between features, PCA finds the direction of maximum variance in high dimensional data and projects data onto a new subspace of fewer dimension. \cite{hotelling1933analysis} As mentioned previously, we assume that we have a data matrix $\boldsymbol{X} \in \mathbb{R}^{m\times n}$ where each of the $m$ rows is thought of as a point in $m$ dimensional space. The \textit{singular value decomposition} (SVD) (figure~\ref{fig:svd}) of a $\boldsymbol{X}$ is \begin{equation} \boldsymbol{X}=\boldsymbol{U \Sigma V^T} \end{equation} \noindent where, \begin{itemize} \item $\boldsymbol{V}\in \mathbb{R}^{m\times m}$ is an orthonormal (or unitary) matrix such that $\boldsymbol{V^T V} =\boldsymbol{I}_{m\times m}$ (an $m \times m$ identity matrix). \item $\boldsymbol{\Sigma}$ is a pseudodiagonal matrix with the same size as $\boldsymbol{X}$; the $m$ entries $\boldsymbol{\sigma}_m$ on the diagonal are called the singular values of $\boldsymbol{X}$. \item $\boldsymbol{U}\in \mathbb{R}^{n\times n}$ is an orthonormal (or unitary) matrix such that $\boldsymbol{U^T U} =\boldsymbol{I}_{n\times n}$ (an $n \times n$ identity matrix). \end{itemize} \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/svd.png} \caption{Singular value decomposition of $\boldsymbol{X}=\boldsymbol{V}\boldsymbol{\Sigma}\boldsymbol{U}^T$. The singular values ${\boldsymbol{\sigma _{i}}}$ are ordered from largest to smallest.} \label{fig:svd} \end{figure} The linear low-dimensional project of $X$ to $k$ dimension space is $\boldsymbol{U} \boldsymbol{\hat{\Sigma}}$ where $\boldsymbol{\hat{\Sigma}}$ has its rightmost $n-k$ columns removed, corresponding to the $n-k$ smallest singular values ${\boldsymbol{\sigma _{i}}}$. Note, PCA provides two important features that we will use in the sequel. Namely, the columns of $\boldsymbol{U}$ are orthonormal and the singular values ${\boldsymbol{\sigma _{i}}}$ are ordered from largest to smallest. \subsection{Nonlinear Dimension Reduction Technique}\label{sec:nonlinear_dr} Real world data does not always lay on a low-dimensional linear manifold, but can instead be most naturally represented by low-dimensional non-linear manifold. There is a large extent literature on such methods, which is beyond the scope of the current text. However, the interested reader can look to \cite{nldrLeeVerlysen}, and references therein, for details on such methods. However, we compare our AE based technique with an important method in this domain called \emph{Isomap} \cite{tenenbaum2000global}. In particular, we will compare the non-linear DE capabilities of Isomap with our proposed autoencoder based algorithm, so in this section we provide a brief overview of Isomap and more in-depth derivation of autoencoders. \subsubsection{Isomap} Isomap~\cite{nldrLeeVerlysen} \cite{yang2002extended}\cite{balasubramanian2002isomap} maps data points in high-dimensional nonlinear manifold to a lower dimensional set of coordinates. It successfully addresses important limitations in MDS\cite{kruskal1964multidimensional} by using geodesic distance - distance along the curve- between two given points - instead of Euclidean distance - which is the straight-line distance between corresponding nodes. The algorithm works by creating a neighborhood and neighbors are converted into a graph structure. In particular, the steps of the algorithm are as follows. \begin{enumerate} \item For each row in $\boldsymbol{X}\in\mathbb{R}^{m \times n}$ considered as a point in $\mathbb{R}^m$, choose $k$ nearest points as neighbors \cite{friedman1977algorithm} \item Consider all the point in $\boldsymbol{X}$ as nodes and if any two nodes are chosen to be neighbors in 1), calculate Euclidean distance between them $\boldsymbol{D}=[d_{ij}^2]_{n\times n}$; where $d_{ij} = \|\boldsymbol{x}_i - \boldsymbol{x}_j\|_2$ and $n$ is the order of the high-dimensional space. This step converts the dataset into a graph. \item For each pair of nodes in the graph, find the points $\mathcal{G}=\big\{\boldsymbol{x}_i\vert i=1 \dots, k\big\}$ in the shortest path using Floyd's algorithm \cite{floyd1962algorithm} and assign it to $\boldsymbol{D}_{ij}$ for that non-neighnoring pair of nodes. \item Convert the matrix of distances $\boldsymbol{D}$ into a Gram matrix $\boldsymbol{S}$ by double centering using $S_{ij}=-\frac{1}{2}\big[d^2_{ij}-\mu_i(d^2) -\mu_j(d^2)+\mu_{ij}(d^2)\big]$, where $\mu_i$ is the average of the $i$-th row, $\mu_j$ is the average of the $j$-th column, and $\mu_{ij}$ is the average of all of the entries in the matrix. Note, $S$ is symmetric semi-positive definite if $D$ is a Euclidean Distance Matrix \cite{nldrLeeVerlysen}. \item Compute the SVD of $S$ using $\boldsymbol{S}=\boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^T$. \item Finally, estimate $k$ dimensional latent variables as $\hat{\boldsymbol{X}}=\boldsymbol{I}_{k\times n}\boldsymbol{\Sigma}^{1/2}\boldsymbol{V}^T$ where $\boldsymbol{I}_{k\times n}$ is a $k\times n$ matrix with $1$ on its diagonal and $0$ elsewhere. \end{enumerate} \subsubsection{Autoencoder}\label{sec:ae} AEs are, in many ways, quite similar to PCA. In particular, at their simplest, an autoencoder with one layer hidden takes input data $\boldsymbol{x}_i \in \mathbb{R}^{n\times 1}$ as transforms that vector into a new $\boldsymbol{y}_i \in \mathbb{R}^{k\times 1}$, often called the hidden layer, according to the mapping \begin{equation}\label{eqn:y_i} \boldsymbol{y}_i = \sigma(W_1\boldsymbol{x_i} + \boldsymbol{b_1}) \end{equation} \noindent where $W_1$ is the weight matrix of the first layer, and $k < n$. The function $\sigma$ is typically a non-linear activation function such as a sigmoid or a rectified linear unit (ReLU) \cite{nair2010rectified}. Another layer then maps $\boldsymbol{y_i}$ to $\hat{\boldsymbol{x_i}} \in \mathbb{R}^{n\times 1}$ according to \begin{equation}\label{eqn:x_hat} \hat{\boldsymbol{x_i}} = \sigma(W_2\boldsymbol{y_i} + \boldsymbol{b_2}) = \sigma(W_2 \sigma(W_1\boldsymbol{x_i} + \boldsymbol{b_1}) +\boldsymbol{b_2}) \end{equation} \noindent where $W_2 \in \mathbb{R}^{n\times k}$ and $\boldsymbol{b}_2 \in \mathbb{R}^{n\times 1}$ are the weight matrix and bias vector of second layer. Deep networks with many layers can be defined in an analogous fashion. The parameters $W_1$, $\boldsymbol{b_1}$, $W_2$, $\boldsymbol{b_2}$ are found by minimizing some cost function(eqn~\ref{eqn:ae_cost_fn}) that quantifies the difference between the output $\hat{\boldsymbol{x_i}}$ and input as in \begin{equation} J(W,b;x) = \frac{1}{2}\|x - \hat{x}\|_2^2, \label{eqn:ae_cost_fn} \end{equation} \noindent with $W=\{W_1,W_2\}$ and $b=\{b_1,b_2\}$, leading to the optimization problem \begin{equation} \min_{W,b} J(W,b;x). \label{eqn:ae_cost_fn_opt} \end{equation} At this point, we can begin to understand the differences between PCA and autoencoder. In particular, $\boldsymbol{y_i}$ is a projection of $\boldsymbol{x_i}$ into a $k$ dimensional space, just as $\boldsymbol{U} \boldsymbol{\hat{\Sigma}}$ is a projection of the rows of a data matrix $X$ into a $k$ dimensional space. However, that is where the analogy ends. While the basis in $\boldsymbol{U}$ is explicitly orthonormal and the diagonal entries in $\boldsymbol{\hat{\Sigma}}$ are ordered by size, the structure of the autoencoder is hidden inside the nonlinear function $\sigma(W_1\boldsymbol{x_i} + \boldsymbol{b_1})$. \emph{So, as opposed to the singluar values in $\boldsymbol{\Sigma}$, the size of the entries in $\boldsymbol{y_i}$ do not provide information about the intrinsic dimensionality of the data set.} Fortunately, the ideas in \cite{ng2011sparse} provide a path forward. When a neural network is constrained by $k$ being small, then the network is forced to learn a compressed representation of input. However, when $k$ is not known beforehand, which is the entire point of DE, one can penalize the hidden layer entries $\boldsymbol{y_i}$ so that they are encouraged to be small, or even $0$. As shown in figure~\ref{fig:z_layer_orientation_64_0_l1}, to achieve sparsity hidden layer is penalized with $\|.\|_1$. $\|.\|_1$ forces small hidden layer entries to zero and prevents over estimation of dimension. \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/z_layer_orientation_64_0_l1.png} \caption{Here we show a selection of images of $0$ and the $64$ dimension innermost hidden layers with $\|.\|_1$ that correspond to each image. $\|.\|_1$ penalty on hidden layer entries makes the entries closer to 0.} \label{fig:z_layer_orientation_64_0_l1} \end{figure} In that way, the number of large entries in $\boldsymbol{y_i}$ can be interpreted as a measure of the intrinsic dimension. Additionally, to achieve consistency in DE and make the DE process independent of range of numeric values we use $\|.\|_2$, which normalizes the values (figure~\ref{fig:z_layer_orientation_64_0_l2}). \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/z_layer_orientation_64_0_l2.png} \caption{Here we show a selection of images of $0$ and the $64$ dimension innermost hidden layers with $\|.\|_2$ that correspond to each image. $\|.\|_2$ normalizes hidden layer entries.} \label{fig:z_layer_orientation_64_0_l2} \end{figure} DE requires both sparsity and consistency, which is shown in figure~\ref{fig:unsorted_digit_0} and figure~\ref{fig:row_sorted_digit_0}. Accordingly, we follow the ideas in \cite{ng2011sparse} and start by normalizing the hidden layer as in eqn~\ref{eqn:y_i_normalize} \begin{equation}\label{eqn:y_i_normalize} y_{norm}^i = \frac{y_{i}}{\sqrt{\sum_{i=1}^k {y_{i}}^2}} \end{equation} \begin{equation}\label{eqn:recon_err} J_{sparse}(W,b;x) = J(W,b;x) + \lambda{\sum_{i=1}^k \| y_{norm}^i\|_1} \end{equation} \noindent to force some entries of $\boldsymbol{y_i}$ to be small or even $0$. The number of large entries in $\boldsymbol{y_i}$, when appropriately interpreted as described in the sequel, the provide an estimate of the dimensionality of $X$. \subsubsection{Autoencoder Model}\label{sec:ae} To estimate dimension of MNISTdigits the AE model uses 5 layer autoencoder. Table~\ref{tbl:mnist_ae_arch} defines the layers, activation function and regularizers. The input and output layer has 784 nodes; the output layer uses sigmoid \cite{cybenko1989approximation} activation function. To estimate dimension of financial market, using S\&P 500 index constituents, we again use 5 layer autoencoder as illustrated in table~\ref{tbl:sp500_ae_arch}. The input and output layer has 550\footnote{S\&P 500 index constituents change due to merger, acquisitions or new public listed companies being added to index.} nodes and uses tanh\cite{glorot2011deep} activation function. \begin{table}[ht] \begin{center} \begin{tabular}{cccc} \hline Layer Type & MNIST & Regularizer & Activation Function \\\hline input layer & 784 & - & - \\\hline encoder layer 1 & 256 & - & relu \\\hline encoder layer 2 & 128 & - & - \\\hline hidden layer & 64 & $l1l2$ (eqn~\ref{eqn:recon_err}) & - \\\hline decoder layer 1 & 128 & - & - \\\hline decoder layer 2 & 256 & - & relu \\\hline output layer & 784 & - & sigmoid \\\hline \end{tabular} \end{center} \caption{MNIST autoencoder architecture.} \label{tbl:mnist_ae_arch} \end{table} \begin{table}[ht] \begin{center} \begin{tabular}{cccc} \hline Layer Type & S\&P 500 & Regularizer & Activation Function \\\hline input layer & 550 & - & - \\\hline encoder layer 1 & 256 & - & relu \\\hline encoder layer 2 & 128 & - & - \\\hline hidden layer & 64 & $l1l2$ (eqn~\ref{eqn:recon_err}) & - \\\hline decoder layer 1 & 128 & - & - \\\hline decoder layer 2 & 256 & - & relu \\\hline output layer & 500 & - & tanh \\\hline \end{tabular} \end{center} \caption{S\&P 500 autoencoder architecture.} \label{tbl:sp500_ae_arch} \end{table} \section{Autoencoder - Singular Value Proxies}\label{sec:ae_svp} SVD decomposes input matrix $\boldsymbol{X}$ such that $\boldsymbol{X}=\boldsymbol{V}\boldsymbol{\Sigma}\boldsymbol{U}^T$, where $\boldsymbol{V}$, $\boldsymbol{U}$ are unitary matrices and $\boldsymbol{\Sigma}$ contains the singular values along the diagonal , where the largest value in upper left and smallest value in lower right. Since we are primarily interested in DE using AE innermost hidden layer, which does not natively provide singular value equivalent, we need to create \emph{singular value proxies} to use innermost hidden layer for DE. \subsection{Number of rows}\label{sec:ae_width} The choice of width, \emph{number of rows}, is driven by a few mathematical and practical factors. In a time series data set, such as stock prices, choice of width is driven by temporal relevance and availability of data. Estimating \emph{width} is tricky. For MNIST digits we found that DE algorithm converged when we increased \emph{width}. DE convergence is illustrated in figure~\ref{fig:digit_0_width} and figure~\ref{fig:digit_1_width}. For brevity we only present results for digit 0 and 1 where width is monotonically increased from 2 to 90. For each width we ran the experiment 50 times and then estimated average dimension. \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/digit_0_width.png} \caption{DE of digit 0 increases with width and then plateaus.} \label{fig:digit_0_width} \end{figure} \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/digit_1_width.png} \caption{Similar to DE of digit $0$, the DE of digit $1$ also increases with width and plateaus.} \label{fig:digit_1_width} \end{figure} \subsection{L2/L1 Hidden Layer Regularizer}\label{sec:ae_norm} Our goal is to use AE innermost hidden layer entries to estimate dimension. While AE faithfully reproduces the input we have no control on the transformations in innermost hidden layer. To make DE consistent and small, we use $\|.\|_{2,1}$ penalty on hidden layer entries. \subsection{Activation Function}\label{sec:ae_actv_fn} When autoencoder is used for DE we should avoid using activation function just before the innermost hidden layer. Relative magnitude between scalar value proxies change when activation function output is used for DE. For example, the ratio of $\sigma_1$ and $\sigma_2$ in illustrated example (figure~\ref{fig:act_fn_eff}) is 10. Contrastingly, when sigmoid activation function is used the ratio changes to 1 and consequently affects our singular value proxies and DE. \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/act_fn_eff.png} \caption{The relative scale of the scalar values change when we use an activation function. } \label{fig:act_fn_eff} \end{figure} The effect of activation function on digit $0$ on MNIST test dataset is illustrated in figure~\ref{fig:noactfn_and_actfn_z_layer_64}. The innermost hidden layer absolute values range between 0 and 1. However, when no activation function is used innermost hidden layer absolute values range between 0 and 6. \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/noactfn_and_actfn_z_layer_64.png} \caption{In the innermost hidden layer, whether activation function is used or not, AE output is invariant. AE is designed to learn the input and produce an output similar to input. As illustrated in row $2$ and $3$, the innermost hidden layer values are very different with and without an activation function (sigmoid in this case). For DE we use the innermost hidden layer values from AE to estimate dimension and hence we do not use activation function in the innermost hidden layer.} \label{fig:noactfn_and_actfn_z_layer_64} \end{figure} Activation function output should not be used for DE. However, this design decision does neither affects the choice of activation function for other layers nor how many layers can a AE have. \subsection{Sparsity Parameter}\label{sec:ae_sprs_param} Deep autoencoder have thousands of parameters to train. AE is data hungry and computationally intensive. We used an iterative approach to determine $\boldsymbol{\lambda}$ the sparsity parameter in our experiment, as shown in figure~\ref{fig:bear_08112011_raw_zlayer_diff_lambda} and figure~\ref{fig:bull_10052015_raw_zlayer_diff_lambda}. For example, if you were to use S\&P 500 stocks over last 10 year as input we will have a mere 2520 end of day prices (252 trading days x 10 year). \subsection{Latent Space Sorting}\label{sec:ae_lss} To create singular value proxies we use \emph{Transforming Latent Representation to Singular Value Proxies} (algorithm~\ref{fig:ae_row_sort}). The algorithm transforms entries of latent layer into singular value proxies which is used for estimating dimension of dataset, as illustrated in figure~\ref{fig:rs_col_avg}. \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/latent_row_unsorted_and_sorted.png} \caption{Without any sorting, innermost hidden layer $64$ values for digit $0$ from MNIST test dataset for first $5$ digit $0$ in shown in a $8 \times 8$ image. Innermost hidden layer $64$ values for digit $0$ from MNIST test dataset for first $5$ digit $0$ in shown in a $8 \times 8$ image after sorting row wise, where for the innermost hidden layer values are arragned from largest to smallest.} \label{fig:latent_row_unsorted_and_sorted} \end{figure} \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/unsorted_digit_0.png} \caption{Without any transformation, the innermost hidden layer, which has $64$ nodes, for all the $980$ digit $0$ of MNIST test dataset is shown here.} \label{fig:unsorted_digit_0} \end{figure} \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/row_sorted_digit_0.png} \caption{After sorting $64$ innermost hidden layer values for each $980$ digit $0$ we get an image where the larger values are on the left and smaller values are on the right.} \label{fig:row_sorted_digit_0} \end{figure} \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/z_mean.png} \caption{Take the column wise mean after sorting rows.} \label{fig:z_mean} \end{figure} \begin{algorithm}[!htp] \caption{ \textit{Transforming Latent Representation to Singular Value Proxies. \\ Inputs: The hidden layer $\boldsymbol{Z}$. The matrix $Z$ is $mxn$. \\Output: $\sigma_i$, a set of positive values that act as singular value proxies and is used to estimate the dimension of dataset . }} \begin{algorithmic}[1] \State We need positive values to estimate dimension. So create $\boldsymbol{M = abs(Z)}$ \State Sort each row of $M_{sorted} = row\_sort(M)$ independently such that the largest value of each row is on the left and smallest value of each row is on right \State Take average of each column of $M_{sorted}$. \State Calculate sum of each columns as $\boldsymbol{{z}_{mn}}=\boldsymbol{\sum_{i=1}^m} {z_{in}}$ \State Singular value proxies is the average of column values calculated as $\boldsymbol{z_n}=\boldsymbol{\frac{z_{mn}}{m}}$ \newline \end{algorithmic}\label{fig:ae_row_sort} \end{algorithm} \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/rs_col_avg.png} \caption{Steps needed to convert a latent representation into singular value proxies that can be used to estimate dimension.} \label{fig:rs_col_avg} \end{figure} \section{Dimensionality Estimation Algorithm}\label{sec:dd_algo} The superficial dimension of data is usually much higher than the intrinsic dimension. The noise in real data prevent the singular values from being exactly 0. To prevent smaller singular values or proxies of singular values from inflating the intrinsic dimension of data, we use 2 different analytic: \begin{enumerate} \item Greater Than Equal To 1\%: Count the singular values or singular values proxies that are larger than 1\% to estimate intrinsic dimension. The threshold 1\% is configurable.(Algorithm: \ref{algo:gte_1pct}) \item Up to 90\%: Using the largest singular values or singular values equivalent, count the number of values required such that the cumulative value is larger than 90\% of the sum of the values. Again, 90\% threshold is configurable.(Algorithm: \ref{algo:upto_90pct}) \end{enumerate} \begin{algorithm}[!htp] \caption{ \textit{Dimensionality using Greater Than Equal To 1\%. \\ Inputs: $({\sigma_1}, {\sigma_2}, ...{\sigma_n})$ - singular values or singular value proxies in case of autoencoder, threshold ($t = 1\%$). \\Output: $p$, the number of values greater than equal 1\% . }} \begin{algorithmic}[1] \State Calculate $\boldsymbol{{\sigma}_{sum}}=\boldsymbol{\sum_{i=1}^n} {\sigma_i}$ \State Dimensionality $p = {\sum I({\sigma}_{i\%}})$, where \begin{equation}\label{eqn:adj1} I({\sigma}_{i\%})= \begin{cases} 1 & : \text{if}~\frac{{\sigma_i}}{{\sigma}_{sum}} \geq 1\% \\ 0 & : \text{otherwise,} \end{cases} \end{equation} \newline \end{algorithmic}\label{algo:gte_1pct} \end{algorithm} \begin{algorithm}[!htp] \caption{ \textit{Dimensionality using up to 90\%. \\ Inputs: $({\sigma_1}, {\sigma_2}, ...{\sigma_n})$ - singular values or singular value proxies in case of autoencoder, threshold ($t = 90\%$). \\Output: $p$, the number of largest singular values that explains 90\% of variance in ($\hat{\boldsymbol{X}}$). }}. \begin{algorithmic}[1] \State Sort $({\sigma_1}, {\sigma_2}, ...{\sigma_n})$ in descending order, where $\boldsymbol{\sigma}_i$ are singular values. \State Calculate $\boldsymbol{{\sigma}_{sum}}=\boldsymbol{\sum_{i=1}^n} {\sigma_i}^2$ \State Calculate ${\sigma}_{i\%}$, where ${\sigma}_{i\%} = \frac{{\sigma_i}^2}{{\sigma}_{sum}}$ \State Dimensionality $p$, is the value of $l$ where $\boldsymbol{\sum_{l=1}^w} {\sigma_{i\%}} \geq t(90\%)$ \newline \end{algorithmic}\label{algo:upto_90pct} \end{algorithm} \section{Experiments}\label{sec:experiment} Our experiments comprise of 2 part. In the first part we estimate dimension of each digit in MNIST dataset. The second part of the experiment estimates dimension of each day in US market using S\&P 500 index constituents. While MNISTdata is static in nature, S\&P 500 dataset has varying correlation among S\&P 500 index constituents. \subsection{Data}\label{sec:data} \begin{enumerate} \item MNIST (figure~\ref{fig:expt_input}), the static data set, is a publicly available dataset comprising digits 0 to 9. There are 60,000 training images and 10,000 testing images. Each image is 28 by 28, which gives us 784 features. Each feature is the pixel intensity, which is normailzed before dimension is estimated. Since we estimate dimension of each digit for convenience, we create a derived dataset, one for each digit. \item S\&P 500\footnote{The S\&P 500 or Standard \& Poor's 500 Index is a market-capitalization-weighted index of the 500 largest U.S. publicly traded companies. The index is widely regarded as the best gauge of large-cap U.S. equities.} dataset (figure~\ref{fig:expt_input}) was created by downloading end of day dividend adjusted prices of S\&P 500 index constituents. We use daily log returns over last 10 years -- January 1 2008 to December 31 2018. When daily returns are missing we use 0 as a convenience. \end{enumerate} \begin{figure}[htp] \centering \includegraphics[width=3.2in]{images/expt_input.png} \caption{MNIST input for each iteration is randomly selected 60 instances of the digit. Each digit has 784 features. Russell 3000 input has 3000 log returns as its feature. To estimate dimension at $t$, we use previous $60$ daily log returns of the stocks.} \label{fig:expt_input} \end{figure} \subsection{Estimate MNIST digit dimension}\label{sec:sge} We calculate and analyze dimension of each digit using \emph{Greater Than Equal To 1\%} (algorithm~\ref{algo:gte_1pct}) and \emph{Up to 90\%} (algorithm~\ref{algo:upto_90pct} ). First we use largest singular values proxies till we get 90\% of the cumulative singular values proxies to estimate dimension. Second, we also estimate dimension using singular values proxies that are greater than 1\% of the cumulative singular values. \begin{table*}[ht] \begin{center} \begin{tabular}{ccccccc} \hline &\multicolumn{2}{c}{PCA} & \multicolumn{2}{c}{Isomap} & \multicolumn{2}{c}{Autoencoder} \\\hline MNIST Digit & Upto 90\% & $>=1\%$ & Upto 90\% & $>=1\%$ & Upto 90\% & $>=1\%$ \\\hline 0 & 42 & 30 & 22 & 27 & 32 & 22 \\\hline 1 & 37 & 26 & 21 & 25 & 24 & 13 \\\hline 2 & 44 & 35 & 22 & 28 & 32 & 22 \\\hline 3 & 43 & 34 & 23 & 28 & 31 & 19 \\\hline 4 & 43 & 33 & 22 & 27 & 31 & 20 \\\hline 5 & 44 & 34 & 22 & 27 & 32 & 22 \\\hline 6 & 42 & 31 & 22 & 27 & 32 & 21 \\\hline 7 & 42 & 31 & 22 & 27 & 30 & 19 \\\hline 8 & 43 & 34 & 22 & 28 & 31 & 20 \\\hline 9 & 42 & 31 & 22 & 27 & 30 & 18 \\\hline \end{tabular} \end{center} \caption{Dimension of MNIST digits using PCA, Isomap and autoencoder.} \label{fig:all_mnist_digit_dim} \end{table*} \subsection{Estimate S\&P 500 dimension}\label{sec:sge} To estimate S\&P 500 dimension we consider \emph{60 days} sliding window of daily log return of 500 stocks that comprise S\&P 500 index. We move the window by 1 day (figure~\ref{fig:spy500_expt}), as it happens in financial markets, and again estimate dimension for next day. We do this for all days in our dataset to get a time series of dimension. \begin{figure*}[htp] \begin{subfigure}{0.5\textwidth} \includegraphics[width=0.9\linewidth, height=5cm]{images/spy500_expt.png} \caption{Dimension time series is estimated by using 60 days of daily log returns and then moving the window by 1 day. This gives us time series of dimension.} \label{fig:spy500_expt} \end{subfigure} \begin{subfigure}{0.5\textwidth} \includegraphics[width=0.9\linewidth, height=5cm]{images/spy_dd_pca.png} \caption{S\&P dimension time series using \emph{greater than 1\%} when PCA, a linear technique, is used. The dimension of the market drops when there is stress in financial markets.} \label{fig:spy_dd_pca} \end{subfigure} \begin{subfigure}{0.5\textwidth} \includegraphics[width=0.9\linewidth, height=5cm]{images/spy_dd_ae.png} \caption{S\&P dimension time series can also be estimated by using autoencoder. AE, a nonlinear technique, is highly sensitive to tuning parameters.} \label{fig:spy_dd_ae} \end{subfigure} \begin{subfigure}{0.5\textwidth} \includegraphics[width=0.9\linewidth, height=5cm]{images/spy_dd_pca_vs_ae.png} \caption{Both autoencoder and PCA estimate changes in dimension when there is stress in financial market. The change in dimension is not of the same magnitude.} \label{fig:spy_dd_pca_vs_ae} \end{subfigure} \caption{S\&P 500 dimension estimated using PCA and autoencoder.} \end{figure*} \subsection{Tuning autoencoder}\label{sec:tuning_ae} AEs have several tuning parameters. Each parameter affects the values in hidden layer, which is used to estimate dimension. Further tuning data hungry\cite{marcus2018deep} neural network is computationally intensive. We analyzed the sensitivity of dimension estimation algorithm by iteratively experimenting with range of lambda. Our goal was not find the optimal $\boldsymbol{\lambda}$, but to study the effect of $\boldsymbol{\lambda}$ on dimension of the dataset. Because financial markets are stochastic, dimension of markets not only changed due to $\boldsymbol{\lambda}$ but also was amplified due to stress in market conditions. Overtuning neural network, especially in finance, can be detrimental. Having an hypothesis or a even broad range of financial market dimension\cite{alexeev2012equity} mitigates the tricky exercise of training neural networks with limited real financial data. \begin{figure*}[htp] \begin{subfigure}{0.5\textwidth} \includegraphics[width=0.9\linewidth, height=5cm]{images/bear_08082011.png} \caption{We compare the singular values from PCA and hidden layer values from autoencoder for August 8th 2011 a day in market when S\&P 500 index dropped more than 6\%.} \label{fig:bear_08112011} \end{subfigure} \begin{subfigure}{0.5\textwidth} \includegraphics[width=0.9\linewidth, height=5cm]{images/bull_10052015.png} \caption{During October 2015 S\&P 500 index increased by 8.3\%, a large positive increase. We compare the singular values from PCA and hidden layer values from autoencoder for October 5th 2015, the day that had largest index change of 1.83\%.} \label{fig:bull_10052015} \end{subfigure} \caption{How does S\&P 500 dimension estimate change when there is a large up or down movement in S\&P 500, a proxy for market.} \end{figure*} \begin{figure*}[htp] \centering \includegraphics[width=6.4in]{images/bear_08082011_raw_zlayer_diff_lambda.png} \caption{We zoom into hidden layer values of August 8th 2011 and study the efffect of increasing $\lambda$ on raw hidden layer values, which is normalized to estimate dimension.} \label{fig:bear_08112011_raw_zlayer_diff_lambda} \end{figure*} \begin{figure*}[htp] \centering \includegraphics[width=6.4in]{images/bull_10052015_raw_zlayer_diff_lambda.png} \caption{S\&P 500 index climbed higher on October 5th 2015. We zoom into the raw hidden layer values for this day and analyze the efffect of increasing $\lambda$ on raw hidden layer values.} \label{fig:bull_10052015_raw_zlayer_diff_lambda} \end{figure*} \section{Conclusion}\label{sec:conclusion} This paper proposes an algorithm for estimate dimension and then uses the algorithm to estimate dimension of digits in MNIST dataset. We find that if linear dimension reduction technique is used then dimension estimated for digits, except digit 1, is between 30 and 32. If autoencoder is used to estimate dimension then dimension estimated for digits, except digit 1, is between 19 and 22. S\&P 500 dimension time series from 2008 to 2018 showed higher variance. Consistent with MNIST digits, nonlinear autoencoder dimension was lower. Moreover, dimension estimated using autoencoder showed much higher variance compared to linear dimension estimation technique. Our conjecture is lack of data to train data hungry autoencoder. Further, the paper provides a set of design criteria that can be followed for transforming an autoencoder latent state representation to singular value proxies that can be used for estimating dimension. \section*{Acknowledgement} Results in this paper were obtained in part using a high-performance computing system acquired through NSF MRI grant DMS-1337943 to WPI. \appendices \input{dd.bbl} \end{document}